aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil/cpu.c
diff options
context:
space:
mode:
authorKieran Kunhya <kierank@ob-encoder.com>2013-10-25 07:53:56 -0500
committerDerek Buitenhuis <derek.buitenhuis@gmail.com>2013-10-25 19:36:55 +0100
commit4d6ee0725553a43ba88d6f8327ebcf8f1c5ae8d4 (patch)
treed816bbf9d9dee4bc7e5c8f8b5074b0136d4e5c17 /libavutil/cpu.c
parent7177df90a043bd59e172843fc7cb9e767080ea12 (diff)
downloadffmpeg-4d6ee0725553a43ba88d6f8327ebcf8f1c5ae8d4.tar.gz
libavutil: x86: Add AVX2 capable CPU detection.
Patch based on x264's AVX2 detection Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Diffstat (limited to 'libavutil/cpu.c')
-rw-r--r--libavutil/cpu.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavutil/cpu.c b/libavutil/cpu.c
index 8edebbceed..c96dfa9e6b 100644
--- a/libavutil/cpu.c
+++ b/libavutil/cpu.c
@@ -81,6 +81,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
@@ -100,6 +101,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" },
@@ -193,6 +195,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 }
};