Browse Source

avutil: add alignment needed for AVX-512

tags/n4.0
James Darnley James Darnley 7 years ago
parent
commit
e2218ed8ce
2 changed files with 3 additions and 1 deletions
  1. +1
    -1
      libavutil/mem.c
  2. +2
    -0
      libavutil/x86/cpu.c

+ 1
- 1
libavutil/mem.c View 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


+ 2
- 0
libavutil/x86/cpu.c View 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 |


Loading…
Cancel
Save