diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2005-07-16 11:18:42 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2005-07-16 11:18:42 +0000 |
commit | b194c327fcedaf3fa9605840466ebcfeb622edb3 (patch) | |
tree | 73211255b8bafb35c20e0a6d6098aa312a751e68 /libavcodec | |
parent | 7885603a0bc06ff8db5ac72216fbd5da6c22c087 (diff) | |
download | ffmpeg-b194c327fcedaf3fa9605840466ebcfeb622edb3.tar.gz |
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
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/adpcm.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c index 67a98769db..3c67242f41 100644 --- a/libavcodec/adpcm.c +++ b/libavcodec/adpcm.c @@ -406,8 +406,8 @@ static int adpcm_encode_frame(AVCodecContext *avctx, for (; n>0; n--) { for(i = 0; i < avctx->channels; i++) { int nibble; - nibble = adpcm_yamaha_compress_sample(&c->status[i], samples[i]) << 4; - nibble |= adpcm_yamaha_compress_sample(&c->status[i], samples[i+avctx->channels]); + nibble = adpcm_yamaha_compress_sample(&c->status[i], samples[i]); + nibble |= adpcm_yamaha_compress_sample(&c->status[i], samples[i+avctx->channels]) << 4; *dst++ = nibble; } samples += 2 * avctx->channels; @@ -1047,14 +1047,14 @@ static int adpcm_decode_frame(AVCodecContext *avctx, while (src < buf + buf_size) { if (st) { *samples++ = adpcm_yamaha_expand_nibble(&c->status[0], - (src[0] >> 4) & 0x0F); - *samples++ = adpcm_yamaha_expand_nibble(&c->status[1], src[0] & 0x0F); - } else { - *samples++ = adpcm_yamaha_expand_nibble(&c->status[0], + *samples++ = adpcm_yamaha_expand_nibble(&c->status[1], (src[0] >> 4) & 0x0F); + } else { *samples++ = adpcm_yamaha_expand_nibble(&c->status[0], src[0] & 0x0F); + *samples++ = adpcm_yamaha_expand_nibble(&c->status[0], + (src[0] >> 4) & 0x0F); } src++; } |