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/dsputilenc_mmx.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/dsputilenc_mmx.c')
-rw-r--r-- | libavcodec/x86/dsputilenc_mmx.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/libavcodec/x86/dsputilenc_mmx.c b/libavcodec/x86/dsputilenc_mmx.c index c9797ef31f..7dcc73175c 100644 --- a/libavcodec/x86/dsputilenc_mmx.c +++ b/libavcodec/x86/dsputilenc_mmx.c @@ -24,6 +24,7 @@ #include "libavutil/cpu.h" #include "libavutil/x86/asm.h" +#include "libavutil/x86/cpu.h" #include "libavcodec/dsputil.h" #include "libavcodec/mpegvideo.h" #include "libavcodec/mathops.h" @@ -1180,17 +1181,16 @@ void ff_dsputilenc_init_mmx(DSPContext* c, AVCodecContext *avctx) } #endif /* HAVE_INLINE_ASM */ -#if HAVE_YASM - if (mm_flags & AV_CPU_FLAG_MMX) { + if (EXTERNAL_MMX(mm_flags)) { c->hadamard8_diff[0] = ff_hadamard8_diff16_mmx; c->hadamard8_diff[1] = ff_hadamard8_diff_mmx; - if (mm_flags & AV_CPU_FLAG_MMXEXT) { + if (EXTERNAL_MMXEXT(mm_flags)) { c->hadamard8_diff[0] = ff_hadamard8_diff16_mmx2; c->hadamard8_diff[1] = ff_hadamard8_diff_mmx2; } - if (mm_flags & AV_CPU_FLAG_SSE2){ + if (EXTERNAL_SSE2(mm_flags)) { c->sse[0] = ff_sse16_sse2; #if HAVE_ALIGNED_STACK @@ -1199,14 +1199,11 @@ void ff_dsputilenc_init_mmx(DSPContext* c, AVCodecContext *avctx) #endif } -#if HAVE_SSSE3 && HAVE_ALIGNED_STACK - if (mm_flags & AV_CPU_FLAG_SSSE3) { + if (EXTERNAL_SSSE3(mm_flags) && HAVE_ALIGNED_STACK) { c->hadamard8_diff[0] = ff_hadamard8_diff16_ssse3; c->hadamard8_diff[1] = ff_hadamard8_diff_ssse3; } -#endif } -#endif /* HAVE_YASM */ ff_dsputil_init_pix_mmx(c, avctx); } |