x86: Use *_FAST/*_SLOW CPU feature detection macros where appropriate
[ffmpeg.git] / libavcodec / x86 / ac3dsp_init.c
index cd638b9..89044f4 100644 (file)
@@ -47,7 +47,6 @@ void ff_float_to_fixed24_sse2 (int32_t *dst, const float *src, unsigned int len)
 
 int ff_ac3_compute_mantissa_size_sse2(uint16_t mant_cnt[6][16]);
 
-void ff_ac3_extract_exponents_3dnow(uint8_t *exp, int32_t *coef, int nb_coefs);
 void ff_ac3_extract_exponents_sse2 (uint8_t *exp, int32_t *coef, int nb_coefs);
 void ff_ac3_extract_exponents_ssse3(uint8_t *exp, int32_t *coef, int nb_coefs);
 
@@ -224,16 +223,19 @@ av_cold void ff_ac3dsp_init_x86(AC3DSPContext *c, int bit_exact)
         c->float_to_fixed24 = ff_float_to_fixed24_sse2;
         c->compute_mantissa_size = ff_ac3_compute_mantissa_size_sse2;
         c->extract_exponents = ff_ac3_extract_exponents_sse2;
-        if (!(cpu_flags & AV_CPU_FLAG_SSE2SLOW)) {
-            c->ac3_lshift_int16 = ff_ac3_lshift_int16_sse2;
-            c->ac3_rshift_int32 = ff_ac3_rshift_int32_sse2;
-        }
         if (bit_exact) {
             c->apply_window_int16 = ff_apply_window_int16_sse2;
-        } else if (!(cpu_flags & AV_CPU_FLAG_SSE2SLOW)) {
+        }
+    }
+
+    if (EXTERNAL_SSE2_FAST(cpu_flags)) {
+        c->ac3_lshift_int16 = ff_ac3_lshift_int16_sse2;
+        c->ac3_rshift_int32 = ff_ac3_rshift_int32_sse2;
+        if (!bit_exact) {
             c->apply_window_int16 = ff_apply_window_int16_round_sse2;
         }
     }
+
     if (EXTERNAL_SSSE3(cpu_flags)) {
         c->ac3_max_msb_abs_int16 = ff_ac3_max_msb_abs_int16_ssse3;
         if (cpu_flags & AV_CPU_FLAG_ATOM) {