]> git.sesse.net Git - ffmpeg/commitdiff
avutil: add alignment needed for AVX-512
authorJames Darnley <jdarnley@obe.tv>
Thu, 26 Oct 2017 17:51:37 +0000 (19:51 +0200)
committerJames Darnley <james.darnley@gmail.com>
Sun, 24 Dec 2017 21:02:41 +0000 (22:02 +0100)
libavutil/mem.c
libavutil/x86/cpu.c

index 6ad409daf44f64e18d56b9fe8812e12583b41809..79e8b597f1672c2567b1278b77e3f20a7715ea35 100644 (file)
@@ -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
index 8097b6d146cc877cb36119028cdee5b2793d4667..aca893174ea4177563f23d49827645f39b49f9fa 100644 (file)
@@ -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       |