summaryrefslogtreecommitdiff
path: root/libswscale
diff options
context:
space:
mode:
authorDarren Horrocks <killallthehumans@gmail.com>2011-04-05 02:34:26 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-04-05 02:36:57 +0200
commit30c6fefd013a579f455c230ca9b9b0f8fc68285a (patch)
tree21d0e75a0bfb749f35933670e0f50a78236c73ab /libswscale
parent434f248723d4d3e22545c3542ef9fc7c00b2379b (diff)
fix runtime-cpu-detect bug in swscale
swscale doesnt ever actually do any runtime detection at all when runtime cpu detection is enabled, it simply passes whatever is passed to -sws_flags, which could be nothing at all making swscale default to the C implementation.
Diffstat (limited to 'libswscale')
-rw-r--r--libswscale/swscale.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libswscale/swscale.c b/libswscale/swscale.c
index b4107ac873..e0e48088fc 100644
--- a/libswscale/swscale.c
+++ b/libswscale/swscale.c
@@ -62,6 +62,7 @@ untested special converters
#include "rgb2rgb.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/x86_cpu.h"
+#include "libavutil/cpu.h"
#include "libavutil/avutil.h"
#include "libavutil/mathematics.h"
#include "libavutil/bswap.h"
@@ -1315,6 +1316,12 @@ SwsFunc ff_getSwsFunc(SwsContext *c)
#if CONFIG_RUNTIME_CPUDETECT
int flags = c->flags;
+ int cpuflags = av_get_cpu_flags();
+
+ flags |= (cpuflags & AV_CPU_FLAG_MMX ? SWS_CPU_CAPS_MMX : 0);
+ flags |= (cpuflags & AV_CPU_FLAG_MMX2 ? SWS_CPU_CAPS_MMX2 : 0);
+ flags |= (cpuflags & AV_CPU_FLAG_3DNOW ? SWS_CPU_CAPS_3DNOW : 0);
+
#if ARCH_X86
// ordered per speed fastest first
if (flags & SWS_CPU_CAPS_MMX2) {