diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-10-08 21:36:14 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-10-08 21:46:34 +0200 |
commit | 52dc18d414f4aa2c5a210edfb82cc1a99942ca3b (patch) | |
tree | c2aedd51f56ee49222c76f44b238c16102132db1 /libavcodec/x86/vc1dsp_mmx.c | |
parent | ac627b3d38d370027406c93c2dcaac0b1712a7d4 (diff) | |
parent | 7e522859fc463a14875f78957bb57d2f33607d19 (diff) | |
download | ffmpeg-52dc18d414f4aa2c5a210edfb82cc1a99942ca3b.tar.gz |
Merge remote-tracking branch 'qatar/master'
* qatar/master:
x86: vc1: call ff_vc1dsp_init_x86() under if (ARCH_X86)
x86: cavs: call ff_cavsdsp_init_x86() under if (ARCH_X86)
x86: call most of the x86 dsp init functions under if (ARCH_X86)
doc: support the new website layout
doc: remove a warning from filters.texi
doc: initial nut documentation
segment: drop global headers setting
lavu: fix typo in Makefile
Conflicts:
doc/Makefile
doc/filters.texi
doc/t2h.init
libavcodec/fmtconvert.c
libavcodec/proresdsp.c
libavcodec/x86/Makefile
libavcodec/x86/vc1dsp_mmx.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/x86/vc1dsp_mmx.c')
-rw-r--r-- | libavcodec/x86/vc1dsp_mmx.c | 105 |
1 files changed, 7 insertions, 98 deletions
diff --git a/libavcodec/x86/vc1dsp_mmx.c b/libavcodec/x86/vc1dsp_mmx.c index 66251d0b15..adf89b2f0c 100644 --- a/libavcodec/x86/vc1dsp_mmx.c +++ b/libavcodec/x86/vc1dsp_mmx.c @@ -27,9 +27,11 @@ #include "libavutil/cpu.h" #include "libavutil/mem.h" #include "libavutil/x86/asm.h" +#include "libavutil/x86/cpu.h" #include "libavcodec/dsputil.h" #include "dsputil_mmx.h" #include "libavcodec/vc1dsp.h" +#include "vc1dsp.h" #if HAVE_INLINE_ASM @@ -685,57 +687,8 @@ static void vc1_inv_trans_8x8_dc_mmx2(uint8_t *dest, int linesize, DCTELEM *bloc ); } -#endif /* HAVE_INLINE_ASM */ - -#define LOOP_FILTER(EXT) \ -void ff_vc1_v_loop_filter4_ ## EXT(uint8_t *src, int stride, int pq); \ -void ff_vc1_h_loop_filter4_ ## EXT(uint8_t *src, int stride, int pq); \ -void ff_vc1_v_loop_filter8_ ## EXT(uint8_t *src, int stride, int pq); \ -void ff_vc1_h_loop_filter8_ ## EXT(uint8_t *src, int stride, int pq); \ -\ -static void vc1_v_loop_filter16_ ## EXT(uint8_t *src, int stride, int pq) \ -{ \ - ff_vc1_v_loop_filter8_ ## EXT(src, stride, pq); \ - ff_vc1_v_loop_filter8_ ## EXT(src+8, stride, pq); \ -} \ -\ -static void vc1_h_loop_filter16_ ## EXT(uint8_t *src, int stride, int pq) \ -{ \ - ff_vc1_h_loop_filter8_ ## EXT(src, stride, pq); \ - ff_vc1_h_loop_filter8_ ## EXT(src+8*stride, stride, pq); \ -} - -#if HAVE_YASM -LOOP_FILTER(mmx2) -LOOP_FILTER(sse2) -LOOP_FILTER(ssse3) - -void ff_vc1_h_loop_filter8_sse4(uint8_t *src, int stride, int pq); - -static void vc1_h_loop_filter16_sse4(uint8_t *src, int stride, int pq) -{ - ff_vc1_h_loop_filter8_sse4(src, stride, pq); - ff_vc1_h_loop_filter8_sse4(src+8*stride, stride, pq); -} -#endif /* HAVE_YASM */ - -void ff_put_vc1_chroma_mc8_mmx_nornd (uint8_t *dst, uint8_t *src, - int stride, int h, int x, int y); -void ff_avg_vc1_chroma_mc8_mmx2_nornd (uint8_t *dst, uint8_t *src, - int stride, int h, int x, int y); -void ff_avg_vc1_chroma_mc8_3dnow_nornd(uint8_t *dst, uint8_t *src, - int stride, int h, int x, int y); -void ff_put_vc1_chroma_mc8_ssse3_nornd(uint8_t *dst, uint8_t *src, - int stride, int h, int x, int y); -void ff_avg_vc1_chroma_mc8_ssse3_nornd(uint8_t *dst, uint8_t *src, - int stride, int h, int x, int y); - -void ff_vc1dsp_init_mmx(VC1DSPContext *dsp) +av_cold void ff_vc1dsp_init_mmx(VC1DSPContext *dsp) { - int mm_flags = av_get_cpu_flags(); - -#if HAVE_INLINE_ASM - if (mm_flags & AV_CPU_FLAG_MMX) { dsp->put_vc1_mspel_pixels_tab[ 0] = ff_put_vc1_mspel_mc00_mmx; dsp->put_vc1_mspel_pixels_tab[ 4] = put_vc1_mspel_mc01_mmx; dsp->put_vc1_mspel_pixels_tab[ 8] = put_vc1_mspel_mc02_mmx; @@ -755,12 +708,10 @@ void ff_vc1dsp_init_mmx(VC1DSPContext *dsp) dsp->put_vc1_mspel_pixels_tab[ 7] = put_vc1_mspel_mc31_mmx; dsp->put_vc1_mspel_pixels_tab[11] = put_vc1_mspel_mc32_mmx; dsp->put_vc1_mspel_pixels_tab[15] = put_vc1_mspel_mc33_mmx; +} - if (HAVE_YASM) - dsp->put_no_rnd_vc1_chroma_pixels_tab[0]= ff_put_vc1_chroma_mc8_mmx_nornd; - } - - if (mm_flags & AV_CPU_FLAG_MMXEXT) { +av_cold void ff_vc1dsp_init_mmxext(VC1DSPContext *dsp) +{ dsp->avg_vc1_mspel_pixels_tab[ 0] = ff_avg_vc1_mspel_mc00_mmx2; dsp->avg_vc1_mspel_pixels_tab[ 4] = avg_vc1_mspel_mc01_mmx2; dsp->avg_vc1_mspel_pixels_tab[ 8] = avg_vc1_mspel_mc02_mmx2; @@ -785,47 +736,5 @@ void ff_vc1dsp_init_mmx(VC1DSPContext *dsp) dsp->vc1_inv_trans_4x8_dc = vc1_inv_trans_4x8_dc_mmx2; dsp->vc1_inv_trans_8x4_dc = vc1_inv_trans_8x4_dc_mmx2; dsp->vc1_inv_trans_4x4_dc = vc1_inv_trans_4x4_dc_mmx2; - - if (HAVE_YASM) - dsp->avg_no_rnd_vc1_chroma_pixels_tab[0]= ff_avg_vc1_chroma_mc8_mmx2_nornd; - } else if (HAVE_YASM && mm_flags & AV_CPU_FLAG_3DNOW) { - dsp->avg_no_rnd_vc1_chroma_pixels_tab[0]= ff_avg_vc1_chroma_mc8_3dnow_nornd; - } - - if (HAVE_YASM && mm_flags & AV_CPU_FLAG_SSSE3) { - dsp->put_no_rnd_vc1_chroma_pixels_tab[0]= ff_put_vc1_chroma_mc8_ssse3_nornd; - dsp->avg_no_rnd_vc1_chroma_pixels_tab[0]= ff_avg_vc1_chroma_mc8_ssse3_nornd; - } -#endif /* HAVE_INLINE_ASM */ - -#define ASSIGN_LF(EXT) \ - dsp->vc1_v_loop_filter4 = ff_vc1_v_loop_filter4_ ## EXT; \ - dsp->vc1_h_loop_filter4 = ff_vc1_h_loop_filter4_ ## EXT; \ - dsp->vc1_v_loop_filter8 = ff_vc1_v_loop_filter8_ ## EXT; \ - dsp->vc1_h_loop_filter8 = ff_vc1_h_loop_filter8_ ## EXT; \ - dsp->vc1_v_loop_filter16 = vc1_v_loop_filter16_ ## EXT; \ - dsp->vc1_h_loop_filter16 = vc1_h_loop_filter16_ ## EXT - -#if HAVE_YASM - if (mm_flags & AV_CPU_FLAG_MMX) { - } - - if (mm_flags & AV_CPU_FLAG_MMXEXT) { - ASSIGN_LF(mmx2); - } - - if (mm_flags & AV_CPU_FLAG_SSE2) { - dsp->vc1_v_loop_filter8 = ff_vc1_v_loop_filter8_sse2; - dsp->vc1_h_loop_filter8 = ff_vc1_h_loop_filter8_sse2; - dsp->vc1_v_loop_filter16 = vc1_v_loop_filter16_sse2; - dsp->vc1_h_loop_filter16 = vc1_h_loop_filter16_sse2; - } - if (mm_flags & AV_CPU_FLAG_SSSE3) { - ASSIGN_LF(ssse3); - } - if (mm_flags & AV_CPU_FLAG_SSE4) { - dsp->vc1_h_loop_filter8 = ff_vc1_h_loop_filter8_sse4; - dsp->vc1_h_loop_filter16 = vc1_h_loop_filter16_sse4; - } -#endif /* HAVE_YASM */ } +#endif /* HAVE_INLINE_ASM */ |