diff options
author | Kostya Shishkov <kostya.shishkov@gmail.com> | 2007-03-21 05:56:29 +0000 |
---|---|---|
committer | Kostya Shishkov <kostya.shishkov@gmail.com> | 2007-03-21 05:56:29 +0000 |
commit | c72e05ba0ff0f5b28ad193ba316cb9bfed493df9 (patch) | |
tree | 7bf4e90330b645f7a074ff99e72d5559ca0e8440 /libavcodec | |
parent | 5d171758c08aeda8ba9899ba71ffe4d6a8d0cd7b (diff) | |
download | ffmpeg-c72e05ba0ff0f5b28ad193ba316cb9bfed493df9.tar.gz |
Smacker Audio stereo fix
Originally committed as revision 8460 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/smacker.c | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/libavcodec/smacker.c b/libavcodec/smacker.c index 0bdbc79774..0dd76107b8 100644 --- a/libavcodec/smacker.c +++ b/libavcodec/smacker.c @@ -620,14 +620,10 @@ static int smka_decode_frame(AVCodecContext *avctx, void *data, int *data_size, } } if(bits) { //decode 16-bit data - pred[0] = get_bits(&gb, 8); - pred[0] |= get_bits(&gb, 8); - *samples++ = pred[0]; - if(stereo) { - pred[1] = get_bits(&gb, 8); - pred[1] |= get_bits(&gb, 8); - *samples++ = pred[1]; - } + for(i = stereo; i >= 0; i--) + pred[i] = bswap_16(get_bits(&gb, 16)); + for(i = 0; i < stereo; i++) + *samples++ = pred[i]; for(i = 0; i < unp_size / 2; i++) { if(i & stereo) { if(vlc[2].table) @@ -658,12 +654,10 @@ static int smka_decode_frame(AVCodecContext *avctx, void *data, int *data_size, } } } else { //8-bit data - pred[0] = get_bits(&gb, 8); - *samples++ = (pred[0] - 0x80) << 8; - if(stereo) { - pred[1] = get_bits(&gb, 8); - *samples++ = (pred[1] - 0x80) << 8; - } + for(i = stereo; i >= 0; i--) + pred[i] = get_bits(&gb, 8); + for(i = 0; i < stereo; i++) + *samples++ = (pred[i] - 0x80) << 8; for(i = 0; i < unp_size; i++) { if(i & stereo){ if(vlc[1].table) |