aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil
diff options
context:
space:
mode:
authorJames Darnley <jdarnley@obe.tv>2017-10-26 19:51:37 +0200
committerJames Darnley <james.darnley@gmail.com>2017-12-24 22:02:41 +0100
commite2218ed8ce6e2f208b9279acc80b7e2b7f1eae6c (patch)
treef8087c1bd1a1dcf87853cef59acddb81b617d201 /libavutil
parent4783a01c113b727164588ada47b3145ce5d2c367 (diff)
downloadffmpeg-e2218ed8ce6e2f208b9279acc80b7e2b7f1eae6c.tar.gz
avutil: add alignment needed for AVX-512
Diffstat (limited to 'libavutil')
-rw-r--r--libavutil/mem.c2
-rw-r--r--libavutil/x86/cpu.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/libavutil/mem.c b/libavutil/mem.c
index 6ad409daf4..79e8b597f1 100644
--- a/libavutil/mem.c
+++ b/libavutil/mem.c
@@ -61,7 +61,7 @@ void free(void *ptr);
#include "mem_internal.h"
-#define ALIGN (HAVE_AVX ? 32 : 16)
+#define ALIGN (HAVE_AVX512 ? 64 : (HAVE_AVX ? 32 : 16))
/* NOTE: if you want to override these functions with your own
* implementations (not recommended) you have to link libav* as
diff --git a/libavutil/x86/cpu.c b/libavutil/x86/cpu.c
index 8097b6d146..aca893174e 100644
--- a/libavutil/x86/cpu.c
+++ b/libavutil/x86/cpu.c
@@ -246,6 +246,8 @@ size_t ff_get_cpu_max_align_x86(void)
{
int flags = av_get_cpu_flags();
+ if (flags & AV_CPU_FLAG_AVX512)
+ return 64;
if (flags & (AV_CPU_FLAG_AVX2 |
AV_CPU_FLAG_AVX |
AV_CPU_FLAG_XOP |