[FFmpeg-cvslog] shorten: fix lossy decoding
Paul B Mahol
git at videolan.org
Tue May 22 14:06:31 CEST 2012
ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Tue May 22 11:56:18 2012 +0000| [672f8226bbe37d3328731e7f5093e0b00c35ae54] | committer: Paul B Mahol
shorten: fix lossy decoding
Closes #1299, #1300 and #1301.
Signed-off-by: Paul B Mahol <onemda at gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=672f8226bbe37d3328731e7f5093e0b00c35ae54
---
libavcodec/shorten.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavcodec/shorten.c b/libavcodec/shorten.c
index b211e4f..a0b371d 100644
--- a/libavcodec/shorten.c
+++ b/libavcodec/shorten.c
@@ -539,7 +539,7 @@ static int shorten_decode_frame(AVCodecContext *avctx, void *data,
sum += s->offset[channel][i];
coffset = sum / s->nmean;
if (s->version >= 2)
- coffset >>= FFMIN(1, s->bitshift);
+ coffset = s->bitshift == 0 ? coffset : coffset >> s->bitshift - 1 >> 1;
}
/* decode samples for this channel */
More information about the ffmpeg-cvslog
mailing list