ARM: allow runtime masking of CPU features
[ffmpeg.git] / libavcodec / arm / ac3dsp_init_arm.c
index aed11f4..d7cb95b 100644 (file)
@@ -19,6 +19,8 @@
  */
 
 #include <stdint.h>
+
+#include "libavutil/arm/cpu.h"
 #include "libavutil/attributes.h"
 #include "libavcodec/ac3dsp.h"
 #include "config.h"
@@ -39,13 +41,15 @@ void ff_ac3_update_bap_counts_arm(uint16_t mant_cnt[16], uint8_t *bap, int len);
 
 av_cold void ff_ac3dsp_init_arm(AC3DSPContext *c, int bit_exact)
 {
+    int cpu_flags = av_get_cpu_flags();
+
     c->update_bap_counts         = ff_ac3_update_bap_counts_arm;
 
-    if (HAVE_ARMV6) {
+    if (have_armv6(cpu_flags)) {
         c->bit_alloc_calc_bap    = ff_ac3_bit_alloc_calc_bap_armv6;
     }
 
-    if (HAVE_NEON) {
+    if (have_neon(cpu_flags)) {
         c->ac3_exponent_min      = ff_ac3_exponent_min_neon;
         c->ac3_max_msb_abs_int16 = ff_ac3_max_msb_abs_int16_neon;
         c->ac3_lshift_int16      = ff_ac3_lshift_int16_neon;