diff options
author | Diego Biurrun <diego@biurrun.de> | 2012-08-29 19:01:05 +0200 |
---|---|---|
committer | Diego Biurrun <diego@biurrun.de> | 2012-09-08 18:18:34 +0200 |
commit | e0c6cce44729d94e2a5507a4b6d031f23e8bd7b6 (patch) | |
tree | 5118ee396e1879c3f90dfc1898e9bbd868e4b583 /libavcodec/x86/fmtconvert_init.c | |
parent | 6a0200f24de51eeb94a3a1f75ee105786a6e088d (diff) | |
download | ffmpeg-e0c6cce44729d94e2a5507a4b6d031f23e8bd7b6.tar.gz |
x86: Replace checks for CPU extensions and flags by convenience macros
This separates code relying on inline from that relying on external
assembly and fixes instances where the coalesced check was incorrect.
Diffstat (limited to 'libavcodec/x86/fmtconvert_init.c')
-rw-r--r-- | libavcodec/x86/fmtconvert_init.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/libavcodec/x86/fmtconvert_init.c b/libavcodec/x86/fmtconvert_init.c index e781adbd41..b97fbf9863 100644 --- a/libavcodec/x86/fmtconvert_init.c +++ b/libavcodec/x86/fmtconvert_init.c @@ -24,6 +24,7 @@ #include "libavutil/cpu.h" #include "libavutil/x86/asm.h" +#include "libavutil/x86/cpu.h" #include "libavcodec/fmtconvert.h" #include "libavcodec/dsputil.h" @@ -117,27 +118,27 @@ void ff_fmt_convert_init_x86(FmtConvertContext *c, AVCodecContext *avctx) #if HAVE_YASM int mm_flags = av_get_cpu_flags(); - if (mm_flags & AV_CPU_FLAG_MMX) { + if (EXTERNAL_MMX(mm_flags)) { c->float_interleave = float_interleave_mmx; - if (HAVE_AMD3DNOW && mm_flags & AV_CPU_FLAG_3DNOW) { + if (EXTERNAL_AMD3DNOW(mm_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 (HAVE_AMD3DNOWEXT && mm_flags & AV_CPU_FLAG_3DNOWEXT) { + if (EXTERNAL_AMD3DNOWEXT(mm_flags)) { if(!(avctx->flags & CODEC_FLAG_BITEXACT)){ c->float_to_int16_interleave = float_to_int16_interleave_3dnowext; } } - if (HAVE_SSE && mm_flags & AV_CPU_FLAG_SSE) { + if (EXTERNAL_SSE(mm_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 (HAVE_SSE && mm_flags & AV_CPU_FLAG_SSE2) { + if (EXTERNAL_SSE2(mm_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; |