diff options
author | Derek Buitenhuis <derek.buitenhuis@gmail.com> | 2012-02-23 10:55:35 -0500 |
---|---|---|
committer | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2012-02-25 20:50:27 +0100 |
commit | 9f82cbf7c11b2eca98a38fc9f1ca3a2ba1066a36 (patch) | |
tree | c3209d34dcb334a30079cf47e71d60490768f3e1 /libavcodec | |
parent | dcde8e1c901851c95fbefa322118198eead96fc7 (diff) | |
download | ffmpeg-9f82cbf7c11b2eca98a38fc9f1ca3a2ba1066a36.tar.gz |
wavpack: Don't shift minclip/maxclip
Since we are clipping before we shift the values to
16 or 32 bits, we should not shift the min/max clip
values to compensate.
Fixes 8 and 24 bit lossy decoding.
Fixes ticket #871.
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 480b133e6f79c470aff0f84d9ed3648d37c32b03)
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/wavpack.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c index b20c3cf67f..71eaf70ecc 100644 --- a/libavcodec/wavpack.c +++ b/libavcodec/wavpack.c @@ -808,8 +808,8 @@ static int wavpack_decode_block(AVCodecContext *avctx, int block_no, s->hybrid = s->frame_flags & WV_HYBRID_MODE; s->hybrid_bitrate = s->frame_flags & WV_HYBRID_BITRATE; s->post_shift = bpp * 8 - orig_bpp + ((s->frame_flags >> 13) & 0x1f); - s->hybrid_maxclip = (( 1LL << (orig_bpp - 1)) - 1) >> s->post_shift; - s->hybrid_minclip = ((-1LL << (orig_bpp - 1))) >> s->post_shift; + s->hybrid_maxclip = (( 1LL << (orig_bpp - 1)) - 1); + s->hybrid_minclip = ((-1LL << (orig_bpp - 1))); s->CRC = AV_RL32(buf); buf += 4; if (wc->mkv_mode) buf += 4; //skip block size; |