diff options
author | Mans Rullgard <mans@mansr.com> | 2012-04-21 15:31:10 +0100 |
---|---|---|
committer | Mans Rullgard <mans@mansr.com> | 2012-04-22 12:30:45 +0100 |
commit | d526c5338d50d12a54fd95130030c60070707d3e (patch) | |
tree | 5cac97b8414872d2bdf977292e63ef8edf3eb49a /libavcodec/arm/fmtconvert_init_arm.c | |
parent | d7458bc8c62ae1cb2ffc805b989fcddf4029dda6 (diff) | |
download | ffmpeg-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/fmtconvert_init_arm.c')
-rw-r--r-- | libavcodec/arm/fmtconvert_init_arm.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libavcodec/arm/fmtconvert_init_arm.c b/libavcodec/arm/fmtconvert_init_arm.c index 92e07f17a0..94352636c2 100644 --- a/libavcodec/arm/fmtconvert_init_arm.c +++ b/libavcodec/arm/fmtconvert_init_arm.c @@ -20,6 +20,7 @@ #include <stdint.h> +#include "libavutil/arm/cpu.h" #include "libavcodec/avcodec.h" #include "libavcodec/fmtconvert.h" @@ -33,11 +34,13 @@ void ff_float_to_int16_vfp(int16_t *dst, const float *src, long len); void ff_fmt_convert_init_arm(FmtConvertContext *c, AVCodecContext *avctx) { - if (HAVE_ARMVFP && HAVE_ARMV6) { + int cpu_flags = av_get_cpu_flags(); + + if (have_vfp(cpu_flags) && have_armv6(cpu_flags)) { c->float_to_int16 = ff_float_to_int16_vfp; } - if (HAVE_NEON) { + if (have_neon(cpu_flags)) { c->int32_to_float_fmul_scalar = ff_int32_to_float_fmul_scalar_neon; if (!(avctx->flags & CODEC_FLAG_BITEXACT)) { |