[FFmpeg-cvslog] wavpack: Don't shift minclip/maxclip

Derek Buitenhuis git at videolan.org
Fri Feb 24 04:35:03 CET 2012


ffmpeg | branch: master | Derek Buitenhuis <derek.buitenhuis at gmail.com> | Thu Feb 23 10:55:35 2012 -0500| [480b133e6f79c470aff0f84d9ed3648d37c32b03] | committer: Anton Khirnov

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.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis at gmail.com>
Signed-off-by: Anton Khirnov <anton at khirnov.net>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=480b133e6f79c470aff0f84d9ed3648d37c32b03
---

 libavcodec/wavpack.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c
index fb0e0b2..6eb913f 100644
--- a/libavcodec/wavpack.c
+++ b/libavcodec/wavpack.c
@@ -813,8 +813,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;



More information about the ffmpeg-cvslog mailing list