[FFmpeg-cvslog] adpcmenc: fix encoded s_0 value.

Michael Niedermayer git at videolan.org
Sat Apr 7 11:27:48 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Apr  7 10:12:58 2012 +0200| [e3b7079ddf8322577e1d1f9ef762e96c2b0ad923] | committer: Michael Niedermayer

adpcmenc: fix encoded s_0 value.

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavcodec/adpcmenc.c         |    2 +-
 tests/ref/acodec/adpcm_ima_qt |    6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/libavcodec/adpcmenc.c b/libavcodec/adpcmenc.c
index e46e6f2..118a984 100644
--- a/libavcodec/adpcmenc.c
+++ b/libavcodec/adpcmenc.c
@@ -571,7 +571,7 @@ static int adpcm_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
         init_put_bits(&pb, dst, pkt_size * 8);
 
         for (ch = 0; ch < avctx->channels; ch++) {
-            put_bits(&pb, 9, (c->status[ch].prev_sample + 0x10000) >> 7);
+            put_bits(&pb, 9, (c->status[ch].prev_sample & 0xFFFF) >> 7);
             put_bits(&pb, 7,  c->status[ch].step_index);
             if (avctx->trellis > 0) {
                 uint8_t buf[64];
diff --git a/tests/ref/acodec/adpcm_ima_qt b/tests/ref/acodec/adpcm_ima_qt
index c1db43f..a50c30a 100644
--- a/tests/ref/acodec/adpcm_ima_qt
+++ b/tests/ref/acodec/adpcm_ima_qt
@@ -1,4 +1,4 @@
-057d27978b35888776512e4e9669a63b *./tests/data/acodec/adpcm_qt.aiff
+23cbae1182e150ebf28e0abfb9cba127 *./tests/data/acodec/adpcm_qt.aiff
 281252 ./tests/data/acodec/adpcm_qt.aiff
-169c40435c68d50112c9c61fc67e446d *./tests/data/adpcm_ima_qt.acodec.out.wav
-stddev:  918.61 PSNR: 37.07 MAXDIFF:34029 bytes:  1058560/  1058400
+b0fafd002c38fb70acaddfda1a31ed61 *./tests/data/adpcm_ima_qt.acodec.out.wav
+stddev:  904.76 PSNR: 37.20 MAXDIFF:34029 bytes:  1058560/  1058400



More information about the ffmpeg-cvslog mailing list