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/pngdsp_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/pngdsp_init.c')
-rw-r--r-- | libavcodec/x86/pngdsp_init.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/libavcodec/x86/pngdsp_init.c b/libavcodec/x86/pngdsp_init.c index aa21847db2..213b85494b 100644 --- a/libavcodec/x86/pngdsp_init.c +++ b/libavcodec/x86/pngdsp_init.c @@ -20,7 +20,7 @@ */ #include "libavutil/common.h" -#include "libavutil/cpu.h" +#include "libavutil/x86/cpu.h" #include "libavcodec/pngdsp.h" void ff_add_png_paeth_prediction_mmx2 (uint8_t *dst, uint8_t *src, @@ -34,18 +34,16 @@ void ff_add_bytes_l2_sse2(uint8_t *dst, uint8_t *src1, void ff_pngdsp_init_x86(PNGDSPContext *dsp) { -#if HAVE_YASM int flags = av_get_cpu_flags(); #if ARCH_X86_32 - if (flags & AV_CPU_FLAG_MMX) + if (EXTERNAL_MMX(flags)) dsp->add_bytes_l2 = ff_add_bytes_l2_mmx; #endif - if (flags & AV_CPU_FLAG_MMXEXT) + if (EXTERNAL_MMXEXT(flags)) dsp->add_paeth_prediction = ff_add_png_paeth_prediction_mmx2; - if (flags & AV_CPU_FLAG_SSE2) + if (EXTERNAL_SSE2(flags)) dsp->add_bytes_l2 = ff_add_bytes_l2_sse2; - if (flags & AV_CPU_FLAG_SSSE3) + if (EXTERNAL_SSSE3(flags)) dsp->add_paeth_prediction = ff_add_png_paeth_prediction_ssse3; -#endif } |