[FFmpeg-cvslog] adpcm: simplify reading of IMA DK4 frame header.
Justin Ruggles
git at videolan.org
Sat Oct 1 03:06:40 CEST 2011
ffmpeg | branch: master | Justin Ruggles <justin.ruggles at gmail.com> | Sat Sep 10 13:52:33 2011 -0400| [a57ea1a87e6b65194718968fe0b778e843d4d4b0] | committer: Justin Ruggles
adpcm: simplify reading of IMA DK4 frame header.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a57ea1a87e6b65194718968fe0b778e843d4d4b0
---
libavcodec/adpcm.c | 13 +++++--------
1 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c
index d46ec4a..be10f88 100644
--- a/libavcodec/adpcm.c
+++ b/libavcodec/adpcm.c
@@ -528,15 +528,12 @@ static int adpcm_decode_frame(AVCodecContext *avctx,
if (avctx->block_align != 0 && buf_size > avctx->block_align)
buf_size = avctx->block_align;
- c->status[0].predictor = (int16_t)bytestream_get_le16(&src);
- c->status[0].step_index = *src++;
- src++;
- *samples++ = c->status[0].predictor;
- if (st) {
- c->status[1].predictor = (int16_t)bytestream_get_le16(&src);
- c->status[1].step_index = *src++;
+ for (channel = 0; channel < avctx->channels; channel++) {
+ cs = &c->status[channel];
+ cs->predictor = (int16_t)bytestream_get_le16(&src);
+ cs->step_index = *src++;
src++;
- *samples++ = c->status[1].predictor;
+ *samples++ = cs->predictor;
}
while (src < buf + buf_size) {
uint8_t v = *src++;
More information about the ffmpeg-cvslog
mailing list