[FFmpeg-cvslog] r10933 - in trunk: libavcodec/adpcm.c tests/ffmpeg.regression.ref tests/rotozoom.regression.ref
benoit
subversion
Tue Nov 6 14:08:04 CET 2007
Author: benoit
Date: Tue Nov 6 14:08:04 2007
New Revision: 10933
Log:
fix predictor initialization for adpcm-ima encoder not to lose first sample
in block in adpcm-ima decoder
Patch by Timofei V. Bondarenko: tim ? ipi, ac, ru
Original thread: [FFmpeg-devel] [PATCH] adpcm-ima-wav header and codec
Date: 10/15/2007 05:55 PM
Modified:
trunk/libavcodec/adpcm.c
trunk/tests/ffmpeg.regression.ref
trunk/tests/rotozoom.regression.ref
Modified: trunk/libavcodec/adpcm.c
==============================================================================
--- trunk/libavcodec/adpcm.c (original)
+++ trunk/libavcodec/adpcm.c Tue Nov 6 14:08:04 2007
@@ -451,7 +451,7 @@ static int adpcm_encode_frame(AVCodecCon
*dst++ = 0; /* unknown */
samples++;
if (avctx->channels == 2) {
- c->status[1].prev_sample = (signed short)samples[1];
+ c->status[1].prev_sample = (signed short)samples[0];
/* c->status[1].step_index = 0; */
bytestream_put_le16(&dst, c->status[1].prev_sample);
*dst++ = (unsigned char)c->status[1].step_index;
@@ -936,11 +936,9 @@ static int adpcm_decode_frame(AVCodecCon
for(i=0; i<avctx->channels; i++){
cs = &(c->status[i]);
- cs->predictor = (int16_t)(src[0] + (src[1]<<8));
+ cs->predictor = *samples++ = (int16_t)(src[0] + (src[1]<<8));
src+=2;
- // XXX: is this correct ??: *samples++ = cs->predictor;
-
cs->step_index = *src++;
if (cs->step_index > 88){
av_log(avctx, AV_LOG_ERROR, "ERROR: step_index = %i\n", cs->step_index);
Modified: trunk/tests/ffmpeg.regression.ref
==============================================================================
--- trunk/tests/ffmpeg.regression.ref (original)
+++ trunk/tests/ffmpeg.regression.ref Tue Nov 6 14:08:04 2007
@@ -176,10 +176,10 @@ aefe11ab5067621a1c674859d6413891 *./test
24279 ./tests/data/a-g726.wav
888f2f016e608d044a1bacbca5497ed2 *./tests/data/out.wav
stddev:8368.02 PSNR:17.87 bytes:96256
-de3f0e1f50b19bd8572fdd3dee2e72c4 *./tests/data/a-adpcm_ima.wav
+3b969c43e45582f713e3c35faee9e0cc *./tests/data/a-adpcm_ima.wav
266300 ./tests/data/a-adpcm_ima.wav
-60178d48204f5662d91776e36eddc82e *./tests/data/out.wav
-stddev:11441.89 PSNR:15.15 bytes:1054720
+947196b1739a9d6fe0c29424cf61cd8c *./tests/data/out.wav
+stddev:904.20 PSNR:37.19 bytes:1056768
628d4789cf9ee16a756ac54b7fd8650d *./tests/data/a-adpcm_ms.wav
267320 ./tests/data/a-adpcm_ms.wav
91a84bb4f319a3a0bf0c0441b3d3a529 *./tests/data/out.wav
Modified: trunk/tests/rotozoom.regression.ref
==============================================================================
--- trunk/tests/rotozoom.regression.ref (original)
+++ trunk/tests/rotozoom.regression.ref Tue Nov 6 14:08:04 2007
@@ -176,10 +176,10 @@ aefe11ab5067621a1c674859d6413891 *./test
24279 ./tests/data/a-g726.wav
888f2f016e608d044a1bacbca5497ed2 *./tests/data/out.wav
stddev:8368.02 PSNR:17.87 bytes:96256
-de3f0e1f50b19bd8572fdd3dee2e72c4 *./tests/data/a-adpcm_ima.wav
+3b969c43e45582f713e3c35faee9e0cc *./tests/data/a-adpcm_ima.wav
266300 ./tests/data/a-adpcm_ima.wav
-60178d48204f5662d91776e36eddc82e *./tests/data/out.wav
-stddev:11441.89 PSNR:15.15 bytes:1054720
+947196b1739a9d6fe0c29424cf61cd8c *./tests/data/out.wav
+stddev:904.20 PSNR:37.19 bytes:1056768
628d4789cf9ee16a756ac54b7fd8650d *./tests/data/a-adpcm_ms.wav
267320 ./tests/data/a-adpcm_ms.wav
91a84bb4f319a3a0bf0c0441b3d3a529 *./tests/data/out.wav
More information about the ffmpeg-cvslog
mailing list