aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/x86/vp3dsp_init.c
diff options
context:
space:
mode:
authorDiego Biurrun <diego@biurrun.de>2012-08-29 19:01:05 +0200
committerDiego Biurrun <diego@biurrun.de>2012-09-08 18:18:34 +0200
commite0c6cce44729d94e2a5507a4b6d031f23e8bd7b6 (patch)
tree5118ee396e1879c3f90dfc1898e9bbd868e4b583 /libavcodec/x86/vp3dsp_init.c
parent6a0200f24de51eeb94a3a1f75ee105786a6e088d (diff)
downloadffmpeg-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/vp3dsp_init.c')
-rw-r--r--libavcodec/x86/vp3dsp_init.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/libavcodec/x86/vp3dsp_init.c b/libavcodec/x86/vp3dsp_init.c
index 45af041a6e..d91050e4b3 100644
--- a/libavcodec/x86/vp3dsp_init.c
+++ b/libavcodec/x86/vp3dsp_init.c
@@ -20,6 +20,7 @@
#include "libavutil/attributes.h"
#include "libavutil/cpu.h"
+#include "libavutil/x86/cpu.h"
#include "libavcodec/avcodec.h"
#include "libavcodec/vp3dsp.h"
#include "config.h"
@@ -38,18 +39,17 @@ void ff_vp3_h_loop_filter_mmx2(uint8_t *src, int stride, int *bounding_values);
av_cold void ff_vp3dsp_init_x86(VP3DSPContext *c, int flags)
{
-#if HAVE_YASM
int cpuflags = av_get_cpu_flags();
#if ARCH_X86_32
- if (HAVE_MMX && cpuflags & AV_CPU_FLAG_MMX) {
+ if (EXTERNAL_MMX(cpuflags)) {
c->idct_put = ff_vp3_idct_put_mmx;
c->idct_add = ff_vp3_idct_add_mmx;
c->idct_perm = FF_PARTTRANS_IDCT_PERM;
}
#endif
- if (HAVE_MMXEXT && cpuflags & AV_CPU_FLAG_MMXEXT) {
+ if (EXTERNAL_MMXEXT(cpuflags)) {
c->idct_dc_add = ff_vp3_idct_dc_add_mmx2;
if (!(flags & CODEC_FLAG_BITEXACT)) {
@@ -58,10 +58,9 @@ av_cold void ff_vp3dsp_init_x86(VP3DSPContext *c, int flags)
}
}
- if (cpuflags & AV_CPU_FLAG_SSE2) {
+ if (EXTERNAL_SSE2(cpuflags)) {
c->idct_put = ff_vp3_idct_put_sse2;
c->idct_add = ff_vp3_idct_add_sse2;
c->idct_perm = FF_TRANSPOSE_IDCT_PERM;
}
-#endif
}