Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortateu <qtmb@tateuDOTnet>2011-04-27 03:50:50 +0400
committerCarl Eugen Hoyos <cehoyos@ag.or.at>2011-04-27 03:52:36 +0400
commit93c28a55fd84280d97c3c0dd7b0d546043242c34 (patch)
tree671ed5c740bf144114442f09b4d338b7d033c7be /libswscale/utils.c
parent075933a0687974fca74d6d4ac388d24766d8dc78 (diff)
Fix runtime CPU detection in libswscale.
Diffstat (limited to 'libswscale/utils.c')
-rw-r--r--libswscale/utils.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/libswscale/utils.c b/libswscale/utils.c
index 1f4a6c41cd..2080742e90 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -41,6 +41,7 @@
#include "rgb2rgb.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/x86_cpu.h"
+#include "libavutil/cpu.h"
#include "libavutil/avutil.h"
#include "libavutil/bswap.h"
#include "libavutil/opt.h"
@@ -742,6 +743,13 @@ static int update_flags_cpu(int flags)
|SWS_CPU_CAPS_ALTIVEC
|SWS_CPU_CAPS_BFIN);
flags |= ff_hardcodedcpuflags();
+#else /* !CONFIG_RUNTIME_CPUDETECT */
+ int cpuflags = av_get_cpu_flags();
+
+ flags |= (cpuflags & AV_CPU_FLAG_SSE2 ? SWS_CPU_CAPS_SSE2 : 0);
+ 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);
#endif /* CONFIG_RUNTIME_CPUDETECT */
return flags;
}