diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-05-20 05:23:52 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-06-02 22:59:49 +0200 |
commit | d575984dfcf7f5e8c6e8fef91a3e20455cd69a47 (patch) | |
tree | b68bb6039edb90aa23f1bc86e663c9f7b07c2f4c | |
parent | 9ea1e82d68c1308657e4cbbfab0e6610c4d4aeb9 (diff) | |
download | ffmpeg-d575984dfcf7f5e8c6e8fef91a3e20455cd69a47.tar.gz |
avutil/cpu: force mmx on selection of higher x86 SIMD features
Fixes various runtime failures with manually set flags that represent no
existing CPU
Fixes Ticket3653
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6310eb8010b7a3b3016e297132380cbd4e3d2d10)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavutil/cpu.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/libavutil/cpu.c b/libavutil/cpu.c index 256bd237d5..d6d93a35d6 100644 --- a/libavutil/cpu.c +++ b/libavutil/cpu.c @@ -47,6 +47,26 @@ static int flags, checked; void av_force_cpu_flags(int arg){ + if ( (arg & ( AV_CPU_FLAG_3DNOW | + AV_CPU_FLAG_3DNOWEXT | + AV_CPU_FLAG_SSE | + AV_CPU_FLAG_SSE2 | + AV_CPU_FLAG_SSE2SLOW | + AV_CPU_FLAG_SSE3 | + AV_CPU_FLAG_SSE3SLOW | + AV_CPU_FLAG_SSSE3 | + AV_CPU_FLAG_SSE4 | + AV_CPU_FLAG_SSE42 | + AV_CPU_FLAG_AVX | + AV_CPU_FLAG_XOP | + AV_CPU_FLAG_FMA3 | + AV_CPU_FLAG_FMA4 | + AV_CPU_FLAG_AVX2 )) + && !(arg & AV_CPU_FLAG_MMX)) { + av_log(NULL, AV_LOG_WARNING, "MMX implied by specified flags\n"); + arg |= AV_CPU_FLAG_MMX; + } + flags = arg; checked = arg != -1; } |