diff options
author | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2008-04-25 15:09:26 +0000 |
---|---|---|
committer | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2008-04-25 15:09:26 +0000 |
commit | 9ff8976dad1b2768857a6129daf9dac069ac5bee (patch) | |
tree | 07df194b9f567be28937c5bf07e0faa9b0ef177a /libavcodec/adpcm.c | |
parent | d29ee34ce31668703913f9e9c5dc3b8df969addd (diff) | |
download | ffmpeg-streaming-9ff8976dad1b2768857a6129daf9dac069ac5bee.zip ffmpeg-streaming-9ff8976dad1b2768857a6129daf9dac069ac5bee.tar.gz |
remove ima qt decoding hack, decode whole frame at once
Originally committed as revision 12966 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/adpcm.c')
-rw-r--r-- | libavcodec/adpcm.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c index 6152457..f17fa62 100644 --- a/libavcodec/adpcm.c +++ b/libavcodec/adpcm.c @@ -921,8 +921,8 @@ static int adpcm_decode_frame(AVCodecContext *avctx, switch(avctx->codec->id) { case CODEC_ID_ADPCM_IMA_QT: - n = (buf_size - 2);/* >> 2*avctx->channels;*/ - channel = c->channel; + n = buf_size - 2*avctx->channels; + for (channel = 0; channel < avctx->channels; channel++) { cs = &(c->status[channel]); /* (pppppp) (piiiiiii) */ @@ -946,8 +946,7 @@ static int adpcm_decode_frame(AVCodecContext *avctx, cs->step = step_table[cs->step_index]; - if (st && channel) - samples++; + samples = (short*)data + channel; for(m=32; n>0 && m>0; n--, m--) { /* in QuickTime, IMA is encoded by chuncks of 34 bytes (=64 samples) */ *samples = adpcm_ima_expand_nibble(cs, src[0] & 0x0F, 3); @@ -956,14 +955,9 @@ static int adpcm_decode_frame(AVCodecContext *avctx, samples += avctx->channels; src ++; } - - if(st) { /* handle stereo interlacing */ - c->channel = (channel + 1) % 2; /* we get one packet for left, then one for right data */ - if(!channel) { /* wait for the other packet before outputing anything */ - return src - buf; - } - samples--; } + if (st) + samples--; break; case CODEC_ID_ADPCM_IMA_WAV: if (avctx->block_align != 0 && buf_size > avctx->block_align) |