[FFmpeg-cvslog] x86: avcodec: Consistently structure CPU extension initialization

Diego Biurrun git at videolan.org
Fri Aug 30 12:58:08 CEST 2013


ffmpeg | branch: master | Diego Biurrun <diego at biurrun.de> | Tue Aug 20 15:32:00 2013 +0200| [e998b56362c711701b3daa34e7b956e7126336f4] | committer: Diego Biurrun

x86: avcodec: Consistently structure CPU extension initialization

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e998b56362c711701b3daa34e7b956e7126336f4
---

 libavcodec/x86/dsputilenc_mmx.c  |   70 +++++------
 libavcodec/x86/fmtconvert_init.c |   41 ++++---
 libavcodec/x86/h264dsp_init.c    |  236 +++++++++++++++++++-------------------
 libavcodec/x86/mpegaudiodsp.c    |   20 ++--
 libavcodec/x86/mpegvideo.c       |    9 +-
 libavcodec/x86/rv40dsp_init.c    |   13 ++-
 libavcodec/x86/vc1dsp_init.c     |    5 +-
 7 files changed, 197 insertions(+), 197 deletions(-)

diff --git a/libavcodec/x86/dsputilenc_mmx.c b/libavcodec/x86/dsputilenc_mmx.c
index 7862028..a1852e6 100644
--- a/libavcodec/x86/dsputilenc_mmx.c
+++ b/libavcodec/x86/dsputilenc_mmx.c
@@ -997,63 +997,63 @@ av_cold void ff_dsputilenc_init_mmx(DSPContext *c, AVCodecContext *avctx)
         c->add_8x8basis= add_8x8basis_mmx;
 
         c->ssd_int8_vs_int16 = ssd_int8_vs_int16_mmx;
+    }
 
-        if (INLINE_MMXEXT(cpu_flags)) {
-            c->sum_abs_dctelem = sum_abs_dctelem_mmxext;
-            c->vsad[4]         = vsad_intra16_mmxext;
-
-            if(!(avctx->flags & CODEC_FLAG_BITEXACT)){
-                c->vsad[0] = vsad16_mmxext;
-            }
+    if (INLINE_MMXEXT(cpu_flags)) {
+        c->sum_abs_dctelem = sum_abs_dctelem_mmxext;
+        c->vsad[4]         = vsad_intra16_mmxext;
 
-            c->sub_hfyu_median_prediction = sub_hfyu_median_prediction_mmxext;
+        if (!(avctx->flags & CODEC_FLAG_BITEXACT)){
+            c->vsad[0] = vsad16_mmxext;
         }
 
-        if (INLINE_SSE2(cpu_flags)) {
-            c->sum_abs_dctelem= sum_abs_dctelem_sse2;
-        }
+        c->sub_hfyu_median_prediction = sub_hfyu_median_prediction_mmxext;
+    }
+
+    if (INLINE_SSE2(cpu_flags)) {
+        c->sum_abs_dctelem= sum_abs_dctelem_sse2;
+    }
 
 #if HAVE_SSSE3_INLINE
-        if (INLINE_SSSE3(cpu_flags)) {
-            if(!(avctx->flags & CODEC_FLAG_BITEXACT)){
-                c->try_8x8basis= try_8x8basis_ssse3;
-            }
-            c->add_8x8basis= add_8x8basis_ssse3;
-            c->sum_abs_dctelem= sum_abs_dctelem_ssse3;
+    if (INLINE_SSSE3(cpu_flags)) {
+        if (!(avctx->flags & CODEC_FLAG_BITEXACT)) {
+            c->try_8x8basis = try_8x8basis_ssse3;
         }
+        c->add_8x8basis    = add_8x8basis_ssse3;
+        c->sum_abs_dctelem = sum_abs_dctelem_ssse3;
+    }
 #endif
 
-        if (INLINE_AMD3DNOW(cpu_flags)) {
-            if(!(avctx->flags & CODEC_FLAG_BITEXACT)){
-                c->try_8x8basis= try_8x8basis_3dnow;
-            }
-            c->add_8x8basis= add_8x8basis_3dnow;
+    if (INLINE_AMD3DNOW(cpu_flags)) {
+        if (!(avctx->flags & CODEC_FLAG_BITEXACT)) {
+            c->try_8x8basis = try_8x8basis_3dnow;
         }
+        c->add_8x8basis = add_8x8basis_3dnow;
     }
 #endif /* HAVE_INLINE_ASM */
 
     if (EXTERNAL_MMX(cpu_flags)) {
         c->hadamard8_diff[0] = ff_hadamard8_diff16_mmx;
         c->hadamard8_diff[1] = ff_hadamard8_diff_mmx;
+    }
 
-        if (EXTERNAL_MMXEXT(cpu_flags)) {
-            c->hadamard8_diff[0] = ff_hadamard8_diff16_mmxext;
-            c->hadamard8_diff[1] = ff_hadamard8_diff_mmxext;
-        }
+    if (EXTERNAL_MMXEXT(cpu_flags)) {
+        c->hadamard8_diff[0] = ff_hadamard8_diff16_mmxext;
+        c->hadamard8_diff[1] = ff_hadamard8_diff_mmxext;
+    }
 
-        if (EXTERNAL_SSE2(cpu_flags)) {
-            c->sse[0] = ff_sse16_sse2;
+    if (EXTERNAL_SSE2(cpu_flags)) {
+        c->sse[0] = ff_sse16_sse2;
 
 #if HAVE_ALIGNED_STACK
-            c->hadamard8_diff[0] = ff_hadamard8_diff16_sse2;
-            c->hadamard8_diff[1] = ff_hadamard8_diff_sse2;
+        c->hadamard8_diff[0] = ff_hadamard8_diff16_sse2;
+        c->hadamard8_diff[1] = ff_hadamard8_diff_sse2;
 #endif
-        }
+    }
 
-        if (EXTERNAL_SSSE3(cpu_flags) && HAVE_ALIGNED_STACK) {
-            c->hadamard8_diff[0] = ff_hadamard8_diff16_ssse3;
-            c->hadamard8_diff[1] = ff_hadamard8_diff_ssse3;
-        }
+    if (EXTERNAL_SSSE3(cpu_flags) && HAVE_ALIGNED_STACK) {
+        c->hadamard8_diff[0] = ff_hadamard8_diff16_ssse3;
+        c->hadamard8_diff[1] = ff_hadamard8_diff_ssse3;
     }
 
     ff_dsputil_init_pix_mmx(c, avctx);
diff --git a/libavcodec/x86/fmtconvert_init.c b/libavcodec/x86/fmtconvert_init.c
index bad0c87..3d75df9 100644
--- a/libavcodec/x86/fmtconvert_init.c
+++ b/libavcodec/x86/fmtconvert_init.c
@@ -120,29 +120,28 @@ av_cold void ff_fmt_convert_init_x86(FmtConvertContext *c, AVCodecContext *avctx
 
     if (EXTERNAL_MMX(cpu_flags)) {
         c->float_interleave = float_interleave_mmx;
-
-        if (EXTERNAL_AMD3DNOW(cpu_flags)) {
-            if(!(avctx->flags & CODEC_FLAG_BITEXACT)){
-                c->float_to_int16 = ff_float_to_int16_3dnow;
-                c->float_to_int16_interleave = float_to_int16_interleave_3dnow;
-            }
-        }
-        if (EXTERNAL_AMD3DNOWEXT(cpu_flags)) {
-            if(!(avctx->flags & CODEC_FLAG_BITEXACT)){
-                c->float_to_int16_interleave = float_to_int16_interleave_3dnowext;
-            }
-        }
-        if (EXTERNAL_SSE(cpu_flags)) {
-            c->int32_to_float_fmul_scalar = ff_int32_to_float_fmul_scalar_sse;
-            c->float_to_int16 = ff_float_to_int16_sse;
-            c->float_to_int16_interleave = float_to_int16_interleave_sse;
-            c->float_interleave = float_interleave_sse;
+    }
+    if (EXTERNAL_AMD3DNOW(cpu_flags)) {
+        if (!(avctx->flags & CODEC_FLAG_BITEXACT)) {
+            c->float_to_int16            = ff_float_to_int16_3dnow;
+            c->float_to_int16_interleave = float_to_int16_interleave_3dnow;
         }
-        if (EXTERNAL_SSE2(cpu_flags)) {
-            c->int32_to_float_fmul_scalar = ff_int32_to_float_fmul_scalar_sse2;
-            c->float_to_int16 = ff_float_to_int16_sse2;
-            c->float_to_int16_interleave = float_to_int16_interleave_sse2;
+    }
+    if (EXTERNAL_AMD3DNOWEXT(cpu_flags)) {
+        if (!(avctx->flags & CODEC_FLAG_BITEXACT)) {
+            c->float_to_int16_interleave = float_to_int16_interleave_3dnowext;
         }
     }
+    if (EXTERNAL_SSE(cpu_flags)) {
+        c->int32_to_float_fmul_scalar = ff_int32_to_float_fmul_scalar_sse;
+        c->float_to_int16             = ff_float_to_int16_sse;
+        c->float_to_int16_interleave  = float_to_int16_interleave_sse;
+        c->float_interleave           = float_interleave_sse;
+    }
+    if (EXTERNAL_SSE2(cpu_flags)) {
+        c->int32_to_float_fmul_scalar = ff_int32_to_float_fmul_scalar_sse2;
+        c->float_to_int16             = ff_float_to_int16_sse2;
+        c->float_to_int16_interleave  = float_to_int16_interleave_sse2;
+    }
 #endif /* HAVE_YASM */
 }
diff --git a/libavcodec/x86/h264dsp_init.c b/libavcodec/x86/h264dsp_init.c
index 118495c..4164b83 100644
--- a/libavcodec/x86/h264dsp_init.c
+++ b/libavcodec/x86/h264dsp_init.c
@@ -230,144 +230,140 @@ av_cold void ff_h264dsp_init_x86(H264DSPContext *c, const int bit_depth,
             c->h264_idct_add16intra = ff_h264_idct_add16intra_8_mmx;
             if (cpu_flags & AV_CPU_FLAG_CMOV)
                 c->h264_luma_dc_dequant_idct = ff_h264_luma_dc_dequant_idct_mmx;
-
-            if (EXTERNAL_MMXEXT(cpu_flags)) {
-                c->h264_idct_dc_add  = ff_h264_idct_dc_add_8_mmxext;
-                c->h264_idct8_dc_add = ff_h264_idct8_dc_add_8_mmxext;
-                c->h264_idct_add16   = ff_h264_idct_add16_8_mmxext;
-                c->h264_idct8_add4   = ff_h264_idct8_add4_8_mmxext;
-                if (chroma_format_idc == 1)
-                    c->h264_idct_add8 = ff_h264_idct_add8_8_mmxext;
-                c->h264_idct_add16intra = ff_h264_idct_add16intra_8_mmxext;
-
-                c->h264_v_loop_filter_chroma       = ff_deblock_v_chroma_8_mmxext;
-                c->h264_v_loop_filter_chroma_intra = ff_deblock_v_chroma_intra_8_mmxext;
-                if (chroma_format_idc == 1) {
-                    c->h264_h_loop_filter_chroma       = ff_deblock_h_chroma_8_mmxext;
-                    c->h264_h_loop_filter_chroma_intra = ff_deblock_h_chroma_intra_8_mmxext;
-                }
+        }
+        if (EXTERNAL_MMXEXT(cpu_flags)) {
+            c->h264_idct_dc_add  = ff_h264_idct_dc_add_8_mmxext;
+            c->h264_idct8_dc_add = ff_h264_idct8_dc_add_8_mmxext;
+            c->h264_idct_add16   = ff_h264_idct_add16_8_mmxext;
+            c->h264_idct8_add4   = ff_h264_idct8_add4_8_mmxext;
+            if (chroma_format_idc == 1)
+                c->h264_idct_add8 = ff_h264_idct_add8_8_mmxext;
+            c->h264_idct_add16intra = ff_h264_idct_add16intra_8_mmxext;
+
+            c->h264_v_loop_filter_chroma       = ff_deblock_v_chroma_8_mmxext;
+            c->h264_v_loop_filter_chroma_intra = ff_deblock_v_chroma_intra_8_mmxext;
+            if (chroma_format_idc == 1) {
+                c->h264_h_loop_filter_chroma       = ff_deblock_h_chroma_8_mmxext;
+                c->h264_h_loop_filter_chroma_intra = ff_deblock_h_chroma_intra_8_mmxext;
+            }
 #if ARCH_X86_32 && HAVE_MMXEXT_EXTERNAL
-                c->h264_v_loop_filter_luma       = deblock_v_luma_8_mmxext;
-                c->h264_h_loop_filter_luma       = ff_deblock_h_luma_8_mmxext;
-                c->h264_v_loop_filter_luma_intra = deblock_v_luma_intra_8_mmxext;
-                c->h264_h_loop_filter_luma_intra = ff_deblock_h_luma_intra_8_mmxext;
+            c->h264_v_loop_filter_luma       = deblock_v_luma_8_mmxext;
+            c->h264_h_loop_filter_luma       = ff_deblock_h_luma_8_mmxext;
+            c->h264_v_loop_filter_luma_intra = deblock_v_luma_intra_8_mmxext;
+            c->h264_h_loop_filter_luma_intra = ff_deblock_h_luma_intra_8_mmxext;
 #endif /* ARCH_X86_32 && HAVE_MMXEXT_EXTERNAL */
-                c->weight_h264_pixels_tab[0] = ff_h264_weight_16_mmxext;
-                c->weight_h264_pixels_tab[1] = ff_h264_weight_8_mmxext;
-                c->weight_h264_pixels_tab[2] = ff_h264_weight_4_mmxext;
-
-                c->biweight_h264_pixels_tab[0] = ff_h264_biweight_16_mmxext;
-                c->biweight_h264_pixels_tab[1] = ff_h264_biweight_8_mmxext;
-                c->biweight_h264_pixels_tab[2] = ff_h264_biweight_4_mmxext;
-
-                if (EXTERNAL_SSE2(cpu_flags)) {
-                    c->h264_idct8_add  = ff_h264_idct8_add_8_sse2;
-
-                    c->h264_idct_add16 = ff_h264_idct_add16_8_sse2;
-                    c->h264_idct8_add4 = ff_h264_idct8_add4_8_sse2;
-                    if (chroma_format_idc == 1)
-                        c->h264_idct_add8 = ff_h264_idct_add8_8_sse2;
-                    c->h264_idct_add16intra      = ff_h264_idct_add16intra_8_sse2;
-                    c->h264_luma_dc_dequant_idct = ff_h264_luma_dc_dequant_idct_sse2;
-
-                    c->weight_h264_pixels_tab[0] = ff_h264_weight_16_sse2;
-                    c->weight_h264_pixels_tab[1] = ff_h264_weight_8_sse2;
-
-                    c->biweight_h264_pixels_tab[0] = ff_h264_biweight_16_sse2;
-                    c->biweight_h264_pixels_tab[1] = ff_h264_biweight_8_sse2;
-
-                    c->h264_v_loop_filter_luma       = ff_deblock_v_luma_8_sse2;
-                    c->h264_h_loop_filter_luma       = ff_deblock_h_luma_8_sse2;
-                    c->h264_v_loop_filter_luma_intra = ff_deblock_v_luma_intra_8_sse2;
-                    c->h264_h_loop_filter_luma_intra = ff_deblock_h_luma_intra_8_sse2;
-                }
-                if (EXTERNAL_SSSE3(cpu_flags)) {
-                    c->biweight_h264_pixels_tab[0] = ff_h264_biweight_16_ssse3;
-                    c->biweight_h264_pixels_tab[1] = ff_h264_biweight_8_ssse3;
-                }
-                if (EXTERNAL_AVX(cpu_flags)) {
-                    c->h264_v_loop_filter_luma       = ff_deblock_v_luma_8_avx;
-                    c->h264_h_loop_filter_luma       = ff_deblock_h_luma_8_avx;
-                    c->h264_v_loop_filter_luma_intra = ff_deblock_v_luma_intra_8_avx;
-                    c->h264_h_loop_filter_luma_intra = ff_deblock_h_luma_intra_8_avx;
-                }
-            }
+            c->weight_h264_pixels_tab[0] = ff_h264_weight_16_mmxext;
+            c->weight_h264_pixels_tab[1] = ff_h264_weight_8_mmxext;
+            c->weight_h264_pixels_tab[2] = ff_h264_weight_4_mmxext;
+
+            c->biweight_h264_pixels_tab[0] = ff_h264_biweight_16_mmxext;
+            c->biweight_h264_pixels_tab[1] = ff_h264_biweight_8_mmxext;
+            c->biweight_h264_pixels_tab[2] = ff_h264_biweight_4_mmxext;
+        }
+        if (EXTERNAL_SSE2(cpu_flags)) {
+            c->h264_idct8_add  = ff_h264_idct8_add_8_sse2;
+
+            c->h264_idct_add16 = ff_h264_idct_add16_8_sse2;
+            c->h264_idct8_add4 = ff_h264_idct8_add4_8_sse2;
+            if (chroma_format_idc == 1)
+                c->h264_idct_add8 = ff_h264_idct_add8_8_sse2;
+            c->h264_idct_add16intra      = ff_h264_idct_add16intra_8_sse2;
+            c->h264_luma_dc_dequant_idct = ff_h264_luma_dc_dequant_idct_sse2;
+
+            c->weight_h264_pixels_tab[0] = ff_h264_weight_16_sse2;
+            c->weight_h264_pixels_tab[1] = ff_h264_weight_8_sse2;
+
+            c->biweight_h264_pixels_tab[0] = ff_h264_biweight_16_sse2;
+            c->biweight_h264_pixels_tab[1] = ff_h264_biweight_8_sse2;
+
+            c->h264_v_loop_filter_luma       = ff_deblock_v_luma_8_sse2;
+            c->h264_h_loop_filter_luma       = ff_deblock_h_luma_8_sse2;
+            c->h264_v_loop_filter_luma_intra = ff_deblock_v_luma_intra_8_sse2;
+            c->h264_h_loop_filter_luma_intra = ff_deblock_h_luma_intra_8_sse2;
+        }
+        if (EXTERNAL_SSSE3(cpu_flags)) {
+            c->biweight_h264_pixels_tab[0] = ff_h264_biweight_16_ssse3;
+            c->biweight_h264_pixels_tab[1] = ff_h264_biweight_8_ssse3;
+        }
+        if (EXTERNAL_AVX(cpu_flags)) {
+            c->h264_v_loop_filter_luma       = ff_deblock_v_luma_8_avx;
+            c->h264_h_loop_filter_luma       = ff_deblock_h_luma_8_avx;
+            c->h264_v_loop_filter_luma_intra = ff_deblock_v_luma_intra_8_avx;
+            c->h264_h_loop_filter_luma_intra = ff_deblock_h_luma_intra_8_avx;
         }
     } else if (bit_depth == 10) {
-        if (EXTERNAL_MMX(cpu_flags)) {
-            if (EXTERNAL_MMXEXT(cpu_flags)) {
+        if (EXTERNAL_MMXEXT(cpu_flags)) {
 #if ARCH_X86_32
-                c->h264_v_loop_filter_chroma       = ff_deblock_v_chroma_10_mmxext;
-                c->h264_v_loop_filter_chroma_intra = ff_deblock_v_chroma_intra_10_mmxext;
-                c->h264_v_loop_filter_luma         = ff_deblock_v_luma_10_mmxext;
-                c->h264_h_loop_filter_luma         = ff_deblock_h_luma_10_mmxext;
-                c->h264_v_loop_filter_luma_intra   = ff_deblock_v_luma_intra_10_mmxext;
-                c->h264_h_loop_filter_luma_intra   = ff_deblock_h_luma_intra_10_mmxext;
+            c->h264_v_loop_filter_chroma       = ff_deblock_v_chroma_10_mmxext;
+            c->h264_v_loop_filter_chroma_intra = ff_deblock_v_chroma_intra_10_mmxext;
+            c->h264_v_loop_filter_luma         = ff_deblock_v_luma_10_mmxext;
+            c->h264_h_loop_filter_luma         = ff_deblock_h_luma_10_mmxext;
+            c->h264_v_loop_filter_luma_intra   = ff_deblock_v_luma_intra_10_mmxext;
+            c->h264_h_loop_filter_luma_intra   = ff_deblock_h_luma_intra_10_mmxext;
 #endif /* ARCH_X86_32 */
-                c->h264_idct_dc_add = ff_h264_idct_dc_add_10_mmxext;
-                if (EXTERNAL_SSE2(cpu_flags)) {
-                    c->h264_idct_add     = ff_h264_idct_add_10_sse2;
-                    c->h264_idct8_dc_add = ff_h264_idct8_dc_add_10_sse2;
-
-                    c->h264_idct_add16 = ff_h264_idct_add16_10_sse2;
-                    if (chroma_format_idc == 1)
-                        c->h264_idct_add8 = ff_h264_idct_add8_10_sse2;
-                    c->h264_idct_add16intra = ff_h264_idct_add16intra_10_sse2;
+            c->h264_idct_dc_add = ff_h264_idct_dc_add_10_mmxext;
+        }
+        if (EXTERNAL_SSE2(cpu_flags)) {
+            c->h264_idct_add     = ff_h264_idct_add_10_sse2;
+            c->h264_idct8_dc_add = ff_h264_idct8_dc_add_10_sse2;
+
+            c->h264_idct_add16 = ff_h264_idct_add16_10_sse2;
+            if (chroma_format_idc == 1)
+                c->h264_idct_add8 = ff_h264_idct_add8_10_sse2;
+            c->h264_idct_add16intra = ff_h264_idct_add16intra_10_sse2;
 #if HAVE_ALIGNED_STACK
-                    c->h264_idct8_add  = ff_h264_idct8_add_10_sse2;
-                    c->h264_idct8_add4 = ff_h264_idct8_add4_10_sse2;
+            c->h264_idct8_add  = ff_h264_idct8_add_10_sse2;
+            c->h264_idct8_add4 = ff_h264_idct8_add4_10_sse2;
 #endif /* HAVE_ALIGNED_STACK */
 
-                    c->weight_h264_pixels_tab[0] = ff_h264_weight_16_10_sse2;
-                    c->weight_h264_pixels_tab[1] = ff_h264_weight_8_10_sse2;
-                    c->weight_h264_pixels_tab[2] = ff_h264_weight_4_10_sse2;
+            c->weight_h264_pixels_tab[0] = ff_h264_weight_16_10_sse2;
+            c->weight_h264_pixels_tab[1] = ff_h264_weight_8_10_sse2;
+            c->weight_h264_pixels_tab[2] = ff_h264_weight_4_10_sse2;
 
-                    c->biweight_h264_pixels_tab[0] = ff_h264_biweight_16_10_sse2;
-                    c->biweight_h264_pixels_tab[1] = ff_h264_biweight_8_10_sse2;
-                    c->biweight_h264_pixels_tab[2] = ff_h264_biweight_4_10_sse2;
+            c->biweight_h264_pixels_tab[0] = ff_h264_biweight_16_10_sse2;
+            c->biweight_h264_pixels_tab[1] = ff_h264_biweight_8_10_sse2;
+            c->biweight_h264_pixels_tab[2] = ff_h264_biweight_4_10_sse2;
 
-                    c->h264_v_loop_filter_chroma       = ff_deblock_v_chroma_10_sse2;
-                    c->h264_v_loop_filter_chroma_intra = ff_deblock_v_chroma_intra_10_sse2;
+            c->h264_v_loop_filter_chroma       = ff_deblock_v_chroma_10_sse2;
+            c->h264_v_loop_filter_chroma_intra = ff_deblock_v_chroma_intra_10_sse2;
 #if HAVE_ALIGNED_STACK
-                    c->h264_v_loop_filter_luma       = ff_deblock_v_luma_10_sse2;
-                    c->h264_h_loop_filter_luma       = ff_deblock_h_luma_10_sse2;
-                    c->h264_v_loop_filter_luma_intra = ff_deblock_v_luma_intra_10_sse2;
-                    c->h264_h_loop_filter_luma_intra = ff_deblock_h_luma_intra_10_sse2;
+            c->h264_v_loop_filter_luma       = ff_deblock_v_luma_10_sse2;
+            c->h264_h_loop_filter_luma       = ff_deblock_h_luma_10_sse2;
+            c->h264_v_loop_filter_luma_intra = ff_deblock_v_luma_intra_10_sse2;
+            c->h264_h_loop_filter_luma_intra = ff_deblock_h_luma_intra_10_sse2;
 #endif /* HAVE_ALIGNED_STACK */
-                }
-                if (EXTERNAL_SSE4(cpu_flags)) {
-                    c->weight_h264_pixels_tab[0] = ff_h264_weight_16_10_sse4;
-                    c->weight_h264_pixels_tab[1] = ff_h264_weight_8_10_sse4;
-                    c->weight_h264_pixels_tab[2] = ff_h264_weight_4_10_sse4;
-
-                    c->biweight_h264_pixels_tab[0] = ff_h264_biweight_16_10_sse4;
-                    c->biweight_h264_pixels_tab[1] = ff_h264_biweight_8_10_sse4;
-                    c->biweight_h264_pixels_tab[2] = ff_h264_biweight_4_10_sse4;
-                }
-                if (EXTERNAL_AVX(cpu_flags)) {
-                    c->h264_idct_dc_add  =
-                    c->h264_idct_add     = ff_h264_idct_add_10_avx;
-                    c->h264_idct8_dc_add = ff_h264_idct8_dc_add_10_avx;
-
-                    c->h264_idct_add16 = ff_h264_idct_add16_10_avx;
-                    if (chroma_format_idc == 1)
-                        c->h264_idct_add8 = ff_h264_idct_add8_10_avx;
-                    c->h264_idct_add16intra = ff_h264_idct_add16intra_10_avx;
+        }
+        if (EXTERNAL_SSE4(cpu_flags)) {
+            c->weight_h264_pixels_tab[0] = ff_h264_weight_16_10_sse4;
+            c->weight_h264_pixels_tab[1] = ff_h264_weight_8_10_sse4;
+            c->weight_h264_pixels_tab[2] = ff_h264_weight_4_10_sse4;
+
+            c->biweight_h264_pixels_tab[0] = ff_h264_biweight_16_10_sse4;
+            c->biweight_h264_pixels_tab[1] = ff_h264_biweight_8_10_sse4;
+            c->biweight_h264_pixels_tab[2] = ff_h264_biweight_4_10_sse4;
+        }
+        if (EXTERNAL_AVX(cpu_flags)) {
+            c->h264_idct_dc_add  =
+            c->h264_idct_add     = ff_h264_idct_add_10_avx;
+            c->h264_idct8_dc_add = ff_h264_idct8_dc_add_10_avx;
+
+            c->h264_idct_add16 = ff_h264_idct_add16_10_avx;
+            if (chroma_format_idc == 1)
+                c->h264_idct_add8 = ff_h264_idct_add8_10_avx;
+            c->h264_idct_add16intra = ff_h264_idct_add16intra_10_avx;
 #if HAVE_ALIGNED_STACK
-                    c->h264_idct8_add  = ff_h264_idct8_add_10_avx;
-                    c->h264_idct8_add4 = ff_h264_idct8_add4_10_avx;
+            c->h264_idct8_add  = ff_h264_idct8_add_10_avx;
+            c->h264_idct8_add4 = ff_h264_idct8_add4_10_avx;
 #endif /* HAVE_ALIGNED_STACK */
 
-                    c->h264_v_loop_filter_chroma       = ff_deblock_v_chroma_10_avx;
-                    c->h264_v_loop_filter_chroma_intra = ff_deblock_v_chroma_intra_10_avx;
+            c->h264_v_loop_filter_chroma       = ff_deblock_v_chroma_10_avx;
+            c->h264_v_loop_filter_chroma_intra = ff_deblock_v_chroma_intra_10_avx;
 #if HAVE_ALIGNED_STACK
-                    c->h264_v_loop_filter_luma         = ff_deblock_v_luma_10_avx;
-                    c->h264_h_loop_filter_luma         = ff_deblock_h_luma_10_avx;
-                    c->h264_v_loop_filter_luma_intra   = ff_deblock_v_luma_intra_10_avx;
-                    c->h264_h_loop_filter_luma_intra   = ff_deblock_h_luma_intra_10_avx;
+            c->h264_v_loop_filter_luma         = ff_deblock_v_luma_10_avx;
+            c->h264_h_loop_filter_luma         = ff_deblock_h_luma_10_avx;
+            c->h264_v_loop_filter_luma_intra   = ff_deblock_v_luma_intra_10_avx;
+            c->h264_h_loop_filter_luma_intra   = ff_deblock_h_luma_intra_10_avx;
 #endif /* HAVE_ALIGNED_STACK */
-                }
-            }
         }
     }
 }
diff --git a/libavcodec/x86/mpegaudiodsp.c b/libavcodec/x86/mpegaudiodsp.c
index b6c30b0..3f0943c 100644
--- a/libavcodec/x86/mpegaudiodsp.c
+++ b/libavcodec/x86/mpegaudiodsp.c
@@ -249,16 +249,20 @@ av_cold void ff_mpadsp_init_x86(MPADSPContext *s)
 #endif /* HAVE_SSE2_INLINE */
 
 #if HAVE_YASM
+    if (EXTERNAL_SSE(cpu_flags)) {
+        s->imdct36_blocks_float = imdct36_blocks_sse;
+    }
+    if (EXTERNAL_SSE2(cpu_flags)) {
+        s->imdct36_blocks_float = imdct36_blocks_sse2;
+    }
+    if (EXTERNAL_SSE3(cpu_flags)) {
+        s->imdct36_blocks_float = imdct36_blocks_sse3;
+    }
+    if (EXTERNAL_SSSE3(cpu_flags)) {
+        s->imdct36_blocks_float = imdct36_blocks_ssse3;
+    }
     if (EXTERNAL_AVX(cpu_flags)) {
         s->imdct36_blocks_float = imdct36_blocks_avx;
-    } else if (EXTERNAL_SSSE3(cpu_flags)) {
-        s->imdct36_blocks_float = imdct36_blocks_ssse3;
-    } else if (EXTERNAL_SSE3(cpu_flags)) {
-        s->imdct36_blocks_float = imdct36_blocks_sse3;
-    } else if (EXTERNAL_SSE2(cpu_flags)) {
-        s->imdct36_blocks_float = imdct36_blocks_sse2;
-    } else if (EXTERNAL_SSE(cpu_flags)) {
-        s->imdct36_blocks_float = imdct36_blocks_sse;
     }
 #endif /* HAVE_YASM */
 }
diff --git a/libavcodec/x86/mpegvideo.c b/libavcodec/x86/mpegvideo.c
index caf1e3a..07fd1e5 100644
--- a/libavcodec/x86/mpegvideo.c
+++ b/libavcodec/x86/mpegvideo.c
@@ -568,11 +568,10 @@ av_cold void ff_MPV_common_init_x86(MpegEncContext *s)
         if(!(s->flags & CODEC_FLAG_BITEXACT))
             s->dct_unquantize_mpeg2_intra = dct_unquantize_mpeg2_intra_mmx;
         s->dct_unquantize_mpeg2_inter = dct_unquantize_mpeg2_inter_mmx;
-        if (INLINE_SSE2(cpu_flags)) {
-            s->denoise_dct= denoise_dct_sse2;
-        } else {
-                s->denoise_dct= denoise_dct_mmx;
-        }
+        s->denoise_dct = denoise_dct_mmx;
+    }
+    if (INLINE_SSE2(cpu_flags)) {
+        s->denoise_dct = denoise_dct_sse2;
     }
 #endif /* HAVE_INLINE_ASM */
 }
diff --git a/libavcodec/x86/rv40dsp_init.c b/libavcodec/x86/rv40dsp_init.c
index aeb9072..781f467 100644
--- a/libavcodec/x86/rv40dsp_init.c
+++ b/libavcodec/x86/rv40dsp_init.c
@@ -232,6 +232,13 @@ av_cold void ff_rv40dsp_init_x86(RV34DSPContext *c)
         QPEL_MC_SET(put_, _mmx)
 #endif
     }
+    if (EXTERNAL_AMD3DNOW(cpu_flags)) {
+        c->avg_chroma_pixels_tab[0] = ff_avg_rv40_chroma_mc8_3dnow;
+        c->avg_chroma_pixels_tab[1] = ff_avg_rv40_chroma_mc4_3dnow;
+#if ARCH_X86_32
+        QPEL_MC_SET(avg_, _3dnow)
+#endif
+    }
     if (EXTERNAL_MMXEXT(cpu_flags)) {
         c->avg_chroma_pixels_tab[0]     = ff_avg_rv40_chroma_mc8_mmxext;
         c->avg_chroma_pixels_tab[1]     = ff_avg_rv40_chroma_mc4_mmxext;
@@ -242,12 +249,6 @@ av_cold void ff_rv40dsp_init_x86(RV34DSPContext *c)
 #if ARCH_X86_32
         QPEL_MC_SET(avg_, _mmxext)
 #endif
-    } else if (EXTERNAL_AMD3DNOW(cpu_flags)) {
-        c->avg_chroma_pixels_tab[0] = ff_avg_rv40_chroma_mc8_3dnow;
-        c->avg_chroma_pixels_tab[1] = ff_avg_rv40_chroma_mc4_3dnow;
-#if ARCH_X86_32
-        QPEL_MC_SET(avg_, _3dnow)
-#endif
     }
     if (EXTERNAL_SSE2(cpu_flags)) {
         c->rv40_weight_pixels_tab[0][0] = ff_rv40_weight_func_rnd_16_sse2;
diff --git a/libavcodec/x86/vc1dsp_init.c b/libavcodec/x86/vc1dsp_init.c
index c477d84..9f18131 100644
--- a/libavcodec/x86/vc1dsp_init.c
+++ b/libavcodec/x86/vc1dsp_init.c
@@ -103,13 +103,14 @@ av_cold void ff_vc1dsp_init_x86(VC1DSPContext *dsp)
     if (EXTERNAL_MMX(cpu_flags)) {
         dsp->put_no_rnd_vc1_chroma_pixels_tab[0] = ff_put_vc1_chroma_mc8_nornd_mmx;
     }
+    if (EXTERNAL_AMD3DNOW(cpu_flags)) {
+        dsp->avg_no_rnd_vc1_chroma_pixels_tab[0] = ff_avg_vc1_chroma_mc8_nornd_3dnow;
+    }
     if (EXTERNAL_MMXEXT(cpu_flags)) {
         ASSIGN_LF(mmxext);
         dsp->avg_no_rnd_vc1_chroma_pixels_tab[0] = ff_avg_vc1_chroma_mc8_nornd_mmxext;
 
         dsp->avg_vc1_mspel_pixels_tab[0]         = avg_vc1_mspel_mc00_mmxext;
-    } else if (EXTERNAL_AMD3DNOW(cpu_flags)) {
-        dsp->avg_no_rnd_vc1_chroma_pixels_tab[0] = ff_avg_vc1_chroma_mc8_nornd_3dnow;
     }
     if (EXTERNAL_SSE2(cpu_flags)) {
         dsp->vc1_v_loop_filter8  = ff_vc1_v_loop_filter8_sse2;



More information about the ffmpeg-cvslog mailing list