Commit 365e1ec2 authored by Derek Buitenhuis's avatar Derek Buitenhuis Committed by Anton Khirnov

wavpack: Clip samples after shifting

It doesn't make much sense to clip pre-shift,
nor is it correct for proper decoding.
Signed-off-by: 's avatarDerek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: 's avatarAnton Khirnov <anton@khirnov.net>
parent 0b4c3232
......@@ -405,12 +405,12 @@ static inline int wv_get_value_integer(WavpackFrameContext *s, uint32_t *crc, in
}
bit = (S & s->and) | s->or;
bit = (((S + bit) << s->shift) - bit);
bit = (((S + bit) << s->shift) - bit) << s->post_shift;
if(s->hybrid)
bit = av_clip(bit, -s->hybrid_maxclip, s->hybrid_maxclip - 1);
return bit << s->post_shift;
return bit;
}
static float wv_get_value_float(WavpackFrameContext *s, uint32_t *crc, int S)
......
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