summaryrefslogtreecommitdiff
path: root/libswscale
diff options
context:
space:
mode:
authorAlan Kelly <alankelly-at-google.com@ffmpeg.org>2021-12-20 15:45:45 +0100
committerJames Almer <jamrial@gmail.com>2021-12-21 17:44:53 -0300
commiteebe406c808e6061ee76e93a616537b5369dbf40 (patch)
tree52e7a385571100fafff7c9d1f8e838508dec3efb /libswscale
parentffbab99f2c22be06ef3c564fd38320d40e48a2b5 (diff)
libswscale: Test AV_CPU_FLAG_SLOW_GATHER for hscale functions.
This is instead of EXTERNAL_AVX2_FAST so that the avx2 hscale functions are only used where they are faster.
Diffstat (limited to 'libswscale')
-rw-r--r--libswscale/utils.c2
-rw-r--r--libswscale/x86/swscale.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/libswscale/utils.c b/libswscale/utils.c
index d4a72d3ce1..7158384f0b 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -282,7 +282,7 @@ void ff_shuffle_filter_coefficients(SwsContext *c, int *filterPos, int filterSiz
#if ARCH_X86_64
int i, j, k, l;
int cpu_flags = av_get_cpu_flags();
- if (EXTERNAL_AVX2_FAST(cpu_flags)){
+ if (EXTERNAL_AVX2_FAST(cpu_flags) && !(cpu_flags & AV_CPU_FLAG_SLOW_GATHER)) {
if ((c->srcBpc == 8) && (c->dstBpc <= 14)){
if (dstW % 16 == 0){
if (filter != NULL){
diff --git a/libswscale/x86/swscale.c b/libswscale/x86/swscale.c
index c49a05c37b..ffc7691c12 100644
--- a/libswscale/x86/swscale.c
+++ b/libswscale/x86/swscale.c
@@ -578,7 +578,7 @@ switch(c->dstBpc){ \
break; \
}
- if (EXTERNAL_AVX2_FAST(cpu_flags)) {
+ if (EXTERNAL_AVX2_FAST(cpu_flags) && !(cpu_flags & AV_CPU_FLAG_SLOW_GATHER)) {
if ((c->srcBpc == 8) && (c->dstBpc <= 14)) {
if (c->chrDstW % 16 == 0)
ASSIGN_AVX2_SCALE_FUNC(c->hcScale, c->hChrFilterSize);