mlpdsp: x86: Respect cpuflags

This commit is contained in:
Luca Barbato 2013-07-10 03:18:14 +02:00
parent 3abde1a3b4
commit 2b379a9251

View File

@ -21,7 +21,9 @@
#include "libavutil/attributes.h" #include "libavutil/attributes.h"
#include "libavutil/internal.h" #include "libavutil/internal.h"
#include "libavutil/cpu.h"
#include "libavutil/x86/asm.h" #include "libavutil/x86/asm.h"
#include "libavutil/x86/cpu.h"
#include "libavcodec/mlpdsp.h" #include "libavcodec/mlpdsp.h"
#include "libavcodec/mlp.h" #include "libavcodec/mlp.h"
@ -178,6 +180,8 @@ static void mlp_filter_channel_x86(int32_t *state, const int32_t *coeff,
av_cold void ff_mlpdsp_init_x86(MLPDSPContext *c) av_cold void ff_mlpdsp_init_x86(MLPDSPContext *c)
{ {
#if HAVE_7REGS && HAVE_INLINE_ASM #if HAVE_7REGS && HAVE_INLINE_ASM
c->mlp_filter_channel = mlp_filter_channel_x86; int cpu_flags = av_get_cpu_flags();
if (INLINE_MMX(cpu_flags))
c->mlp_filter_channel = mlp_filter_channel_x86;
#endif #endif
} }