Commit 3ed23dab authored by Andreas Rheinhardt's avatar Andreas Rheinhardt

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: 's avatarAndreas Rheinhardt <andreas.rheinhardt@outlook.com>
parent 9e4e8ae1
......@@ -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; \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment