1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

yamaha adpcm nibbles in the wrong order fix by (Vidar Madsen: vidarino, gmail com)

Originally committed as revision 4446 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Michael Niedermayer 2005-07-16 11:18:42 +00:00
parent 7885603a0b
commit b194c327fc

View File

@ -406,8 +406,8 @@ static int adpcm_encode_frame(AVCodecContext *avctx,
for (; n>0; n--) { for (; n>0; n--) {
for(i = 0; i < avctx->channels; i++) { for(i = 0; i < avctx->channels; i++) {
int nibble; int nibble;
nibble = adpcm_yamaha_compress_sample(&c->status[i], samples[i]) << 4; nibble = adpcm_yamaha_compress_sample(&c->status[i], samples[i]);
nibble |= adpcm_yamaha_compress_sample(&c->status[i], samples[i+avctx->channels]); nibble |= adpcm_yamaha_compress_sample(&c->status[i], samples[i+avctx->channels]) << 4;
*dst++ = nibble; *dst++ = nibble;
} }
samples += 2 * avctx->channels; samples += 2 * avctx->channels;
@ -1047,14 +1047,14 @@ static int adpcm_decode_frame(AVCodecContext *avctx,
while (src < buf + buf_size) { while (src < buf + buf_size) {
if (st) { if (st) {
*samples++ = adpcm_yamaha_expand_nibble(&c->status[0], *samples++ = adpcm_yamaha_expand_nibble(&c->status[0],
(src[0] >> 4) & 0x0F);
*samples++ = adpcm_yamaha_expand_nibble(&c->status[1],
src[0] & 0x0F); src[0] & 0x0F);
*samples++ = adpcm_yamaha_expand_nibble(&c->status[1],
(src[0] >> 4) & 0x0F);
} else { } else {
*samples++ = adpcm_yamaha_expand_nibble(&c->status[0],
(src[0] >> 4) & 0x0F);
*samples++ = adpcm_yamaha_expand_nibble(&c->status[0], *samples++ = adpcm_yamaha_expand_nibble(&c->status[0],
src[0] & 0x0F); src[0] & 0x0F);
*samples++ = adpcm_yamaha_expand_nibble(&c->status[0],
(src[0] >> 4) & 0x0F);
} }
src++; src++;
} }