libhb: do not use zscale if the CPU has got no AVX2

AVX optimizations were removed from zimg.
This commit is contained in:
Damiano Galassi 2025-08-08 10:59:07 +02:00
parent 866dadac1b
commit a49974ee35
No known key found for this signature in database
GPG Key ID: 5452E231DFDBCA11
1 changed files with 8 additions and 0 deletions

View File

@ -9,6 +9,7 @@
#include "handbrake/handbrake.h"
#include "handbrake/hbffmpeg.h"
#include "libavutil/cpu.h"
static int get_frame_type(int type)
{
@ -788,6 +789,13 @@ int hb_av_can_use_zscale(enum AVPixelFormat pix_fmt,
}
#endif
#if ARCH_X86_64 || ARCH_X86_32
if ((av_get_cpu_flags() & AV_CPU_FLAG_AVX2) == 0)
{
return 0;
}
#endif
if ((in_width % 2) != 0 || (in_height % 2) != 0 ||
(out_width % 2) != 0 || (out_height % 2) != 0)
{