diff options
author | Janne Grunau <janne-libav@jannau.net> | 2012-10-07 19:41:10 +0400 |
---|---|---|
committer | Janne Grunau <janne-libav@jannau.net> | 2012-10-08 13:54:05 +0400 |
commit | 7e522859fc463a14875f78957bb57d2f33607d19 (patch) | |
tree | 4ffc404b1c651a13572c906978171c1e9d334f12 /libavcodec/x86/vc1dsp_mmx.c | |
parent | cb36febcbc59d18470361fc27ae834b84be975e3 (diff) |
x86: vc1: call ff_vc1dsp_init_x86() under if (ARCH_X86)
Diffstat (limited to 'libavcodec/x86/vc1dsp_mmx.c')
-rw-r--r-- | libavcodec/x86/vc1dsp_mmx.c | 98 |
1 files changed, 7 insertions, 91 deletions
diff --git a/libavcodec/x86/vc1dsp_mmx.c b/libavcodec/x86/vc1dsp_mmx.c index 1bf06fa3b0..6b1ae37efd 100644 --- a/libavcodec/x86/vc1dsp_mmx.c +++ b/libavcodec/x86/vc1dsp_mmx.c @@ -28,9 +28,11 @@ #include "libavutil/internal.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 @@ -686,57 +688,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) +av_cold void ff_vc1dsp_init_mmx(VC1DSPContext *dsp) { - 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) -{ - 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; @@ -756,9 +709,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 (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; @@ -783,43 +737,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; - } -#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) { - dsp->put_no_rnd_vc1_chroma_pixels_tab[0]= ff_put_vc1_chroma_mc8_mmx_nornd; - } - - if (mm_flags & AV_CPU_FLAG_MMXEXT) { - ASSIGN_LF(mmx2); - dsp->avg_no_rnd_vc1_chroma_pixels_tab[0]= ff_avg_vc1_chroma_mc8_mmx2_nornd; - } else if (mm_flags & AV_CPU_FLAG_3DNOW) { - dsp->avg_no_rnd_vc1_chroma_pixels_tab[0]= ff_avg_vc1_chroma_mc8_3dnow_nornd; - } - - 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); - 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; - } - 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 */ |