[FFmpeg-devel] [PATCH 4/8] avutil: add alignment needed for AVX-512

James Almer jamrial at gmail.com
Tue Oct 31 01:50:36 EET 2017


On 10/30/2017 10:08 AM, James Darnley wrote:
> ---
>  libavutil/x86/cpu.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/libavutil/x86/cpu.c b/libavutil/x86/cpu.c
> index b22a950b79..c56f2a8754 100644
> --- a/libavutil/x86/cpu.c
> +++ b/libavutil/x86/cpu.c
> @@ -247,6 +247,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       |
> 

av_get_cpu_max_align() is not currently being used to align buffers in
libavutil/libavcodec, so you also need to change the STRIDE_ALIGN
constant to 64 before you can feasibly start using avx512 functions.


More information about the ffmpeg-devel mailing list