diff options
author | Kieran Kunhya <kierank@ob-encoder.com> | 2013-10-20 10:28:38 -0500 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-10-26 02:34:22 +0200 |
commit | 865b70bc5d1cf37ec6d6cb729a69dda2cca28bd5 (patch) | |
tree | c8b62155b3715ac4b6bf82ea250d6d442ccaf5e8 /libavutil/x86/cpu.c | |
parent | 780669ef7c23c00836a24921fcc6b03be2b8ca4a (diff) | |
download | ffmpeg-865b70bc5d1cf37ec6d6cb729a69dda2cca28bd5.tar.gz |
Add AVX2 capable CPU detection. Patch based on x264's AVX2 detection
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavutil/x86/cpu.c')
-rw-r--r-- | libavutil/x86/cpu.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libavutil/x86/cpu.c b/libavutil/x86/cpu.c index 81bb15a0a4..174515f68d 100644 --- a/libavutil/x86/cpu.c +++ b/libavutil/x86/cpu.c @@ -134,6 +134,13 @@ int ff_get_cpu_flags_x86(void) if ((eax & 0x6) == 0x6) rval |= AV_CPU_FLAG_AVX; } + if (HAVE_AVX2 && max_std_level >= 7) + { + cpuid(7, eax, ebx, ecx, edx); + if (ebx&0x00000020) + rval |= AV_CPU_FLAG_AVX2; + /* TODO: BMI1/2 */ + } #endif /* HAVE_AVX */ #endif /* HAVE_SSE */ } |