Commit d79cbb8c authored by cehoyos's avatar cehoyos

Fix yamaha adpcm stereo (issue 1117).

Patch by Yoshihisa Uchida, yoshihisa D uchida A gmail


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@19237 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 9e38888b
...@@ -648,15 +648,12 @@ static int adpcm_encode_frame(AVCodecContext *avctx, ...@@ -648,15 +648,12 @@ static int adpcm_encode_frame(AVCodecContext *avctx,
*dst++ = buf[0][i] | (buf[1][i] << 4); *dst++ = buf[0][i] | (buf[1][i] << 4);
} }
} else } else
for (; n>0; n--) { for (n *= avctx->channels; n>0; n--) {
for(i = 0; i < avctx->channels; i++) {
int nibble; int nibble;
nibble = adpcm_yamaha_compress_sample(&c->status[i], samples[i]); nibble = adpcm_yamaha_compress_sample(&c->status[ 0], *samples++);
nibble |= adpcm_yamaha_compress_sample(&c->status[i], samples[i+avctx->channels]) << 4; nibble |= adpcm_yamaha_compress_sample(&c->status[st], *samples++) << 4;
*dst++ = nibble; *dst++ = nibble;
} }
samples += 2 * avctx->channels;
}
break; break;
default: default:
return -1; return -1;
......
...@@ -193,10 +193,10 @@ stddev: 914.63 PSNR: 37.09 bytes: 1058604/ 1058444 ...@@ -193,10 +193,10 @@ stddev: 914.63 PSNR: 37.09 bytes: 1058604/ 1058444
268344 ./tests/data/a-adpcm_ms.wav 268344 ./tests/data/a-adpcm_ms.wav
7be370f937c51e8a967e6a3d08d5156a *./tests/data/adpcm_ms.rotozoom.out.wav 7be370f937c51e8a967e6a3d08d5156a *./tests/data/adpcm_ms.rotozoom.out.wav
stddev: 1050.00 PSNR: 35.90 bytes: 1060620/ 1058444 stddev: 1050.00 PSNR: 35.90 bytes: 1060620/ 1058444
14df8b8bb7c127ec70c0167df1c0dbf7 *./tests/data/a-adpcm_yam.wav 2546d72df736b5ffa1557e8c9c9ef788 *./tests/data/a-adpcm_yam.wav
266296 ./tests/data/a-adpcm_yam.wav 266296 ./tests/data/a-adpcm_yam.wav
2f73107dafef6db42e545f9e466d3f05 *./tests/data/adpcm_yam.rotozoom.out.wav c80c847a53a0fee17a88fa889ec34a4e *./tests/data/adpcm_yam.rotozoom.out.wav
stddev:18302.45 PSNR: 11.07 bytes: 1065004/ 1058444 stddev: 1247.64 PSNR: 34.40 bytes: 1065004/ 1058444
42d4639866ed4d692eaf126228a4fa2a *./tests/data/a-adpcm_swf.flv 42d4639866ed4d692eaf126228a4fa2a *./tests/data/a-adpcm_swf.flv
269166 ./tests/data/a-adpcm_swf.flv 269166 ./tests/data/a-adpcm_swf.flv
628089745a7059ae4055c2515b6d668b *./tests/data/adpcm_swf.rotozoom.out.wav 628089745a7059ae4055c2515b6d668b *./tests/data/adpcm_swf.rotozoom.out.wav
......
...@@ -193,10 +193,10 @@ stddev: 914.63 PSNR: 37.09 bytes: 1058604/ 1058444 ...@@ -193,10 +193,10 @@ stddev: 914.63 PSNR: 37.09 bytes: 1058604/ 1058444
268344 ./tests/data/a-adpcm_ms.wav 268344 ./tests/data/a-adpcm_ms.wav
7be370f937c51e8a967e6a3d08d5156a *./tests/data/adpcm_ms.vsynth.out.wav 7be370f937c51e8a967e6a3d08d5156a *./tests/data/adpcm_ms.vsynth.out.wav
stddev: 1050.00 PSNR: 35.90 bytes: 1060620/ 1058444 stddev: 1050.00 PSNR: 35.90 bytes: 1060620/ 1058444
14df8b8bb7c127ec70c0167df1c0dbf7 *./tests/data/a-adpcm_yam.wav 2546d72df736b5ffa1557e8c9c9ef788 *./tests/data/a-adpcm_yam.wav
266296 ./tests/data/a-adpcm_yam.wav 266296 ./tests/data/a-adpcm_yam.wav
2f73107dafef6db42e545f9e466d3f05 *./tests/data/adpcm_yam.vsynth.out.wav c80c847a53a0fee17a88fa889ec34a4e *./tests/data/adpcm_yam.vsynth.out.wav
stddev:18302.45 PSNR: 11.07 bytes: 1065004/ 1058444 stddev: 1247.64 PSNR: 34.40 bytes: 1065004/ 1058444
42d4639866ed4d692eaf126228a4fa2a *./tests/data/a-adpcm_swf.flv 42d4639866ed4d692eaf126228a4fa2a *./tests/data/a-adpcm_swf.flv
269166 ./tests/data/a-adpcm_swf.flv 269166 ./tests/data/a-adpcm_swf.flv
628089745a7059ae4055c2515b6d668b *./tests/data/adpcm_swf.vsynth.out.wav 628089745a7059ae4055c2515b6d668b *./tests/data/adpcm_swf.vsynth.out.wav
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment