diff options
author | Timothy Gu <timothygu99@gmail.com> | 2016-02-01 20:50:22 -0800 |
---|---|---|
committer | Timothy Gu <timothygu99@gmail.com> | 2016-02-05 19:29:43 -0800 |
commit | 17ab8f7e6852a9db46aec3267bc8a7e40dde849f (patch) | |
tree | b079118165931a0bbc7ea8a62db051bc7f102b8a | |
parent | 1c40bccc0949f24bde1cd51194367a4a9fd490c5 (diff) | |
download | ffmpeg-17ab8f7e6852a9db46aec3267bc8a7e40dde849f.tar.gz |
diracdsp: Make x86 files/functions names consistent
-rw-r--r-- | libavcodec/diracdsp.c | 4 | ||||
-rw-r--r-- | libavcodec/diracdsp.h | 1 | ||||
-rw-r--r-- | libavcodec/x86/Makefile | 3 | ||||
-rw-r--r-- | libavcodec/x86/diracdsp.asm (renamed from libavcodec/x86/diracdsp_yasm.asm) | 0 | ||||
-rw-r--r-- | libavcodec/x86/diracdsp_init.c (renamed from libavcodec/x86/diracdsp_mmx.c) | 45 | ||||
-rw-r--r-- | libavcodec/x86/diracdsp_mmx.h | 47 |
6 files changed, 43 insertions, 57 deletions
diff --git a/libavcodec/diracdsp.c b/libavcodec/diracdsp.c index 12f27ce684..ab8d1497f7 100644 --- a/libavcodec/diracdsp.c +++ b/libavcodec/diracdsp.c @@ -20,7 +20,6 @@ #include "avcodec.h" #include "diracdsp.h" -#include "libavcodec/x86/diracdsp_mmx.h" #define FILTER(src, stride) \ ((21*((src)[ 0*stride] + (src)[1*stride]) \ @@ -222,5 +221,6 @@ av_cold void ff_diracdsp_init(DiracDSPContext *c) PIXFUNC(avg, 16); PIXFUNC(avg, 32); - if (HAVE_MMX && HAVE_YASM) ff_diracdsp_init_mmx(c); + if (ARCH_X86) + ff_diracdsp_init_x86(c); } diff --git a/libavcodec/diracdsp.h b/libavcodec/diracdsp.h index 439bda26a5..25a872d846 100644 --- a/libavcodec/diracdsp.h +++ b/libavcodec/diracdsp.h @@ -63,5 +63,6 @@ DECL_DIRAC_PIXOP(put, l4_c); DECL_DIRAC_PIXOP(avg, l4_c); void ff_diracdsp_init(DiracDSPContext *c); +void ff_diracdsp_init_x86(DiracDSPContext* c); #endif /* AVCODEC_DIRACDSP_H */ diff --git a/libavcodec/x86/Makefile b/libavcodec/x86/Makefile index ce06b908d4..1baec49649 100644 --- a/libavcodec/x86/Makefile +++ b/libavcodec/x86/Makefile @@ -6,6 +6,7 @@ OBJS-$(CONFIG_AUDIODSP) += x86/audiodsp_init.o OBJS-$(CONFIG_BLOCKDSP) += x86/blockdsp_init.o OBJS-$(CONFIG_BSWAPDSP) += x86/bswapdsp_init.o OBJS-$(CONFIG_DCT) += x86/dct_init.o +OBJS-$(CONFIG_DIRAC_DECODER) += x86/diracdsp_init.o OBJS-$(CONFIG_FDCTDSP) += x86/fdctdsp_init.o OBJS-$(CONFIG_FFT) += x86/fft_init.o OBJS-$(CONFIG_FLACDSP) += x86/flacdsp_init.o @@ -133,7 +134,7 @@ YASM-OBJS-$(CONFIG_ADPCM_G722_ENCODER) += x86/g722dsp.o YASM-OBJS-$(CONFIG_ALAC_DECODER) += x86/alacdsp.o YASM-OBJS-$(CONFIG_APNG_DECODER) += x86/pngdsp.o YASM-OBJS-$(CONFIG_DCA_DECODER) += x86/synth_filter.o -YASM-OBJS-$(CONFIG_DIRAC_DECODER) += x86/diracdsp_mmx.o x86/diracdsp_yasm.o \ +YASM-OBJS-$(CONFIG_DIRAC_DECODER) += x86/diracdsp.o \ x86/dwt_yasm.o YASM-OBJS-$(CONFIG_DNXHD_ENCODER) += x86/dnxhdenc.o YASM-OBJS-$(CONFIG_FLAC_DECODER) += x86/flacdsp.o diff --git a/libavcodec/x86/diracdsp_yasm.asm b/libavcodec/x86/diracdsp.asm index a042413c3a..a042413c3a 100644 --- a/libavcodec/x86/diracdsp_yasm.asm +++ b/libavcodec/x86/diracdsp.asm diff --git a/libavcodec/x86/diracdsp_mmx.c b/libavcodec/x86/diracdsp_init.c index d260364644..5fae79891b 100644 --- a/libavcodec/x86/diracdsp_mmx.c +++ b/libavcodec/x86/diracdsp_init.c @@ -19,14 +19,35 @@ */ #include "libavutil/x86/cpu.h" -#include "diracdsp_mmx.h" +#include "libavcodec/diracdsp.h" #include "fpel.h" +DECL_DIRAC_PIXOP(put, mmx); +DECL_DIRAC_PIXOP(avg, mmx); +DECL_DIRAC_PIXOP(avg, mmxext); + +void ff_put_dirac_pixels16_sse2(uint8_t *dst, const uint8_t *src[5], int stride, int h); +void ff_avg_dirac_pixels16_sse2(uint8_t *dst, const uint8_t *src[5], int stride, int h); +void ff_put_dirac_pixels32_sse2(uint8_t *dst, const uint8_t *src[5], int stride, int h); +void ff_avg_dirac_pixels32_sse2(uint8_t *dst, const uint8_t *src[5], int stride, int h); + +void ff_add_rect_clamped_mmx(uint8_t *, const uint16_t *, int, const int16_t *, int, int, int); +void ff_add_rect_clamped_sse2(uint8_t *, const uint16_t *, int, const int16_t *, int, int, int); + +void ff_add_dirac_obmc8_mmx(uint16_t *dst, const uint8_t *src, int stride, const uint8_t *obmc_weight, int yblen); +void ff_add_dirac_obmc16_mmx(uint16_t *dst, const uint8_t *src, int stride, const uint8_t *obmc_weight, int yblen); +void ff_add_dirac_obmc32_mmx(uint16_t *dst, const uint8_t *src, int stride, const uint8_t *obmc_weight, int yblen); + +void ff_add_dirac_obmc16_sse2(uint16_t *dst, const uint8_t *src, int stride, const uint8_t *obmc_weight, int yblen); +void ff_add_dirac_obmc32_sse2(uint16_t *dst, const uint8_t *src, int stride, const uint8_t *obmc_weight, int yblen); + void ff_put_rect_clamped_mmx(uint8_t *dst, int dst_stride, const int16_t *src, int src_stride, int width, int height); void ff_put_rect_clamped_sse2(uint8_t *dst, int dst_stride, const int16_t *src, int src_stride, int width, int height); void ff_put_signed_rect_clamped_mmx(uint8_t *dst, int dst_stride, const int16_t *src, int src_stride, int width, int height); void ff_put_signed_rect_clamped_sse2(uint8_t *dst, int dst_stride, const int16_t *src, int src_stride, int width, int height); +#if HAVE_YASM + #define HPEL_FILTER(MMSIZE, EXT) \ void ff_dirac_hpel_filter_v_ ## EXT(uint8_t *, const uint8_t *, int, int); \ void ff_dirac_hpel_filter_h_ ## EXT(uint8_t *, const uint8_t *, int); \ @@ -47,11 +68,6 @@ void ff_put_signed_rect_clamped_sse2(uint8_t *dst, int dst_stride, const int16_t } \ } -#if !ARCH_X86_64 -HPEL_FILTER(8, mmx) -#endif -HPEL_FILTER(16, sse2) - #define PIXFUNC(PFX, IDX, EXT) \ /*MMXDISABLEDc->PFX ## _dirac_pixels_tab[0][IDX] = ff_ ## PFX ## _dirac_pixels8_ ## EXT;*/ \ c->PFX ## _dirac_pixels_tab[1][IDX] = ff_ ## PFX ## _dirac_pixels16_ ## EXT; \ @@ -119,7 +135,22 @@ void ff_avg_dirac_pixels32_sse2(uint8_t *dst, const uint8_t *src[5], int stride, } } -void ff_diracdsp_init_mmx(DiracDSPContext* c) +#else // HAVE_YASM + +#define HPEL_FILTER(MMSIZE, EXT) \ + void dirac_hpel_filter_ ## EXT(uint8_t *dsth, uint8_t *dstv, uint8_t *dstc, \ + const uint8_t *src, int stride, int width, int height); + +#define PIXFUNC(PFX, IDX, EXT) do {} while (0) + +#endif // HAVE_YASM + +#if !ARCH_X86_64 +HPEL_FILTER(8, mmx) +#endif +HPEL_FILTER(16, sse2) + +void ff_diracdsp_init_x86(DiracDSPContext* c) { int mm_flags = av_get_cpu_flags(); diff --git a/libavcodec/x86/diracdsp_mmx.h b/libavcodec/x86/diracdsp_mmx.h deleted file mode 100644 index d15dc9137d..0000000000 --- a/libavcodec/x86/diracdsp_mmx.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2010 David Conrad - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef AVCODEC_X86_DIRACDSP_MMX_H -#define AVCODEC_X86_DIRACDSP_MMX_H - -#include "libavcodec/diracdsp.h" - -void ff_diracdsp_init_mmx(DiracDSPContext* c); - -DECL_DIRAC_PIXOP(put, mmx); -DECL_DIRAC_PIXOP(avg, mmx); -DECL_DIRAC_PIXOP(avg, mmxext); - -void ff_put_dirac_pixels16_sse2(uint8_t *dst, const uint8_t *src[5], int stride, int h); -void ff_avg_dirac_pixels16_sse2(uint8_t *dst, const uint8_t *src[5], int stride, int h); -void ff_put_dirac_pixels32_sse2(uint8_t *dst, const uint8_t *src[5], int stride, int h); -void ff_avg_dirac_pixels32_sse2(uint8_t *dst, const uint8_t *src[5], int stride, int h); - -void ff_add_rect_clamped_mmx(uint8_t *, const uint16_t *, int, const int16_t *, int, int, int); -void ff_add_rect_clamped_sse2(uint8_t *, const uint16_t *, int, const int16_t *, int, int, int); - -void ff_add_dirac_obmc8_mmx(uint16_t *dst, const uint8_t *src, int stride, const uint8_t *obmc_weight, int yblen); -void ff_add_dirac_obmc16_mmx(uint16_t *dst, const uint8_t *src, int stride, const uint8_t *obmc_weight, int yblen); -void ff_add_dirac_obmc32_mmx(uint16_t *dst, const uint8_t *src, int stride, const uint8_t *obmc_weight, int yblen); - -void ff_add_dirac_obmc16_sse2(uint16_t *dst, const uint8_t *src, int stride, const uint8_t *obmc_weight, int yblen); -void ff_add_dirac_obmc32_sse2(uint16_t *dst, const uint8_t *src, int stride, const uint8_t *obmc_weight, int yblen); - -#endif |