aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter/vf_spp.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2024-03-29 02:45:51 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2024-04-02 00:21:58 +0200
commit3ed23dab98a1c6246e9b3cf575ec29d245e39f94 (patch)
tree01578eaa810a0eaa32d7ee96454aaf3b113728c3 /libavfilter/vf_spp.c
parent9e4e8ae1e68053fe8e07783ff694b6f101a5c5b3 (diff)
downloadffmpeg-3ed23dab98a1c6246e9b3cf575ec29d245e39f94.tar.gz
avfilter/vf_spp: Fix left-shift of negative value
Affected the vf-spp FATE-test (on x86 only when MMX is disabled). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavfilter/vf_spp.c')
-rw-r--r--libavfilter/vf_spp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavfilter/vf_spp.c b/libavfilter/vf_spp.c
index 48911b296a..d6c7297985 100644
--- a/libavfilter/vf_spp.c
+++ b/libavfilter/vf_spp.c
@@ -172,7 +172,7 @@ static void store_slice_c(uint8_t *dst, const int16_t *src,
int y, x;
#define STORE(pos) do { \
- temp = ((src[x + y*src_linesize + pos] << log2_scale) + d[pos]) >> 6; \
+ temp = (src[x + y*src_linesize + pos] * (1 << log2_scale) + d[pos]) >> 6;\
if (temp & 0x100) \
temp = ~(temp >> 31); \
dst[x + y*dst_linesize + pos] = temp; \
@@ -203,7 +203,7 @@ static void store_slice16_c(uint16_t *dst, const int16_t *src,
unsigned int mask = -1<<depth;
#define STORE16(pos) do { \
- temp = ((src[x + y*src_linesize + pos] << log2_scale) + (d[pos]>>1)) >> 5; \
+ temp = (src[x + y*src_linesize + pos] * (1 << log2_scale) + (d[pos]>>1)) >> 5; \
if (temp & mask ) \
temp = ~(temp >> 31); \
dst[x + y*dst_linesize + pos] = temp; \