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/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/cpu.c')
-rw-r--r-- | libavutil/cpu.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavutil/cpu.c b/libavutil/cpu.c index a31e195b69..deb2a873d5 100644 --- a/libavutil/cpu.c +++ b/libavutil/cpu.c @@ -85,6 +85,7 @@ int av_parse_cpu_flags(const char *s) #define CPUFLAG_AVX (AV_CPU_FLAG_AVX | CPUFLAG_SSE42) #define CPUFLAG_XOP (AV_CPU_FLAG_XOP | CPUFLAG_AVX) #define CPUFLAG_FMA4 (AV_CPU_FLAG_FMA4 | CPUFLAG_AVX) +#define CPUFLAG_AVX2 (AV_CPU_FLAG_AVX2 | CPUFLAG_AVX) static const AVOption cpuflags_opts[] = { { "flags" , NULL, 0, AV_OPT_TYPE_FLAGS, { .i64 = 0 }, INT64_MIN, INT64_MAX, .unit = "flags" }, #if ARCH_PPC @@ -104,6 +105,7 @@ int av_parse_cpu_flags(const char *s) { "avx" , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = CPUFLAG_AVX }, .unit = "flags" }, { "xop" , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = CPUFLAG_XOP }, .unit = "flags" }, { "fma4" , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = CPUFLAG_FMA4 }, .unit = "flags" }, + { "avx2" , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = CPUFLAG_AVX2 }, .unit = "flags" }, { "3dnow" , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = CPUFLAG_3DNOW }, .unit = "flags" }, { "3dnowext", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = CPUFLAG_3DNOWEXT }, .unit = "flags" }, { "cmov", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_CMOV }, .unit = "flags" }, @@ -267,6 +269,7 @@ static const struct { { AV_CPU_FLAG_3DNOW, "3dnow" }, { AV_CPU_FLAG_3DNOWEXT, "3dnowext" }, { AV_CPU_FLAG_CMOV, "cmov" }, + { AV_CPU_FLAG_AVX2, "avx2" }, #endif { 0 } }; |