aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/arm/ac3dsp_init_arm.c
diff options
context:
space:
mode:
authorMans Rullgard <mans@mansr.com>2012-04-21 15:31:10 +0100
committerMans Rullgard <mans@mansr.com>2012-04-22 12:30:45 +0100
commitd526c5338d50d12a54fd95130030c60070707d3e (patch)
tree5cac97b8414872d2bdf977292e63ef8edf3eb49a /libavcodec/arm/ac3dsp_init_arm.c
parentd7458bc8c62ae1cb2ffc805b989fcddf4029dda6 (diff)
downloadffmpeg-d526c5338d50d12a54fd95130030c60070707d3e.tar.gz
ARM: allow runtime masking of CPU features
This allows masking CPU features with the -cpuflags avconv option which is useful for testing different optimisations without rebuilding. Signed-off-by: Mans Rullgard <mans@mansr.com>
Diffstat (limited to 'libavcodec/arm/ac3dsp_init_arm.c')
-rw-r--r--libavcodec/arm/ac3dsp_init_arm.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libavcodec/arm/ac3dsp_init_arm.c b/libavcodec/arm/ac3dsp_init_arm.c
index aed11f4bb8..d7cb95b669 100644
--- a/libavcodec/arm/ac3dsp_init_arm.c
+++ b/libavcodec/arm/ac3dsp_init_arm.c
@@ -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;