aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDerek Buitenhuis <derek.buitenhuis@gmail.com>2011-12-16 13:31:28 -0500
committerMichael Niedermayer <michaelni@gmx.at>2012-01-03 19:04:11 +0100
commit8d055e9079f151f13d34e8e04f4aa7ca0273c448 (patch)
tree499580a62512c593fb77ba2a19659090cc629e94
parent4f23f24e3053394407521714e40d0b8398efd40b (diff)
downloadffmpeg-8d055e9079f151f13d34e8e04f4aa7ca0273c448.tar.gz
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: Derek Buitenhuis <derek.buitenhuis@gmail.com> Signed-off-by: Anton Khirnov <anton@khirnov.net> (cherry picked from commit 365e1ec26d7e89a951ebd7851214f59f4aefdec0) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/wavpack.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c
index 1a8c25943f..9f1ce34003 100644
--- a/libavcodec/wavpack.c
+++ b/libavcodec/wavpack.c
@@ -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)