summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/libwebp/src/dsp/quant.h
diff options
context:
space:
mode:
authorTarja Sundqvist <tarja.sundqvist@qt.io>2024-01-04 21:21:52 +0200
committerTarja Sundqvist <tarja.sundqvist@qt.io>2024-01-04 21:21:52 +0200
commit3c2ad3eed6fc522ad809797747c8028b3dd4778a (patch)
treec64f652f34da2e39db11b6fca22ad5322c75554d /src/3rdparty/libwebp/src/dsp/quant.h
parent1019058c497e33edef80d5cb120aa7d6a418a7c6 (diff)
parent1eaa734e4de3589c3c90e4676959a82299a6eb56 (diff)
Merge remote-tracking branch 'origin/tqtc/lts-5.15.13' into tqtc/lts-5.15-opensourcev5.15.13-lts-lgpl
Diffstat (limited to 'src/3rdparty/libwebp/src/dsp/quant.h')
-rw-r--r--src/3rdparty/libwebp/src/dsp/quant.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/3rdparty/libwebp/src/dsp/quant.h b/src/3rdparty/libwebp/src/dsp/quant.h
index 5e8dba8..fc099bf 100644
--- a/src/3rdparty/libwebp/src/dsp/quant.h
+++ b/src/3rdparty/libwebp/src/dsp/quant.h
@@ -21,10 +21,15 @@
#define IsFlat IsFlat_NEON
-static uint32x2_t horizontal_add_uint32x4(const uint32x4_t a) {
+static uint32_t horizontal_add_uint32x4(const uint32x4_t a) {
+#if defined(__aarch64__)
+ return vaddvq_u32(a);
+#else
const uint64x2_t b = vpaddlq_u32(a);
- return vadd_u32(vreinterpret_u32_u64(vget_low_u64(b)),
- vreinterpret_u32_u64(vget_high_u64(b)));
+ const uint32x2_t c = vadd_u32(vreinterpret_u32_u64(vget_low_u64(b)),
+ vreinterpret_u32_u64(vget_high_u64(b)));
+ return vget_lane_u32(c, 0);
+#endif
}
static WEBP_INLINE int IsFlat(const int16_t* levels, int num_blocks,
@@ -45,7 +50,7 @@ static WEBP_INLINE int IsFlat(const int16_t* levels, int num_blocks,
levels += 16;
}
- return thresh >= (int32_t)vget_lane_u32(horizontal_add_uint32x4(sum), 0);
+ return thresh >= (int)horizontal_add_uint32x4(sum);
}
#else