[FFmpeg-cvslog] adpcmdec: use planar sample format for adpcm_4xm
Justin Ruggles
git at videolan.org
Wed Oct 10 13:05:21 CEST 2012
ffmpeg | branch: master | Justin Ruggles <justin.ruggles at gmail.com> | Wed Aug 29 15:40:26 2012 -0400| [4356d66d784cf03e8e640aa25fd27efe38ff9fdb] | committer: Justin Ruggles
adpcmdec: use planar sample format for adpcm_4xm
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4356d66d784cf03e8e640aa25fd27efe38ff9fdb
---
libavcodec/adpcm.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c
index 35be5d0..95e97c9 100644
--- a/libavcodec/adpcm.c
+++ b/libavcodec/adpcm.c
@@ -138,6 +138,7 @@ static av_cold int adpcm_decode_init(AVCodecContext * avctx)
switch(avctx->codec->id) {
case AV_CODEC_ID_ADPCM_IMA_QT:
case AV_CODEC_ID_ADPCM_IMA_WAV:
+ case AV_CODEC_ID_ADPCM_4XM:
avctx->sample_fmt = AV_SAMPLE_FMT_S16P;
break;
default:
@@ -694,14 +695,12 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
}
for (i = 0; i < avctx->channels; i++) {
- samples = (short *)c->frame.data[0] + i;
+ samples = (int16_t *)c->frame.data[i];
cs = &c->status[i];
for (n = nb_samples >> 1; n > 0; n--) {
int v = bytestream2_get_byteu(&gb);
- *samples = adpcm_ima_expand_nibble(cs, v & 0x0F, 4);
- samples += avctx->channels;
- *samples = adpcm_ima_expand_nibble(cs, v >> 4 , 4);
- samples += avctx->channels;
+ *samples++ = adpcm_ima_expand_nibble(cs, v & 0x0F, 4);
+ *samples++ = adpcm_ima_expand_nibble(cs, v >> 4 , 4);
}
}
break;
@@ -1289,7 +1288,7 @@ AVCodec ff_ ## name_ ## _decoder = { \
}
/* Note: Do not forget to add new entries to the Makefile as well. */
-ADPCM_DECODER(AV_CODEC_ID_ADPCM_4XM, sample_fmts_s16, adpcm_4xm, "ADPCM 4X Movie");
+ADPCM_DECODER(AV_CODEC_ID_ADPCM_4XM, sample_fmts_s16p, adpcm_4xm, "ADPCM 4X Movie");
ADPCM_DECODER(AV_CODEC_ID_ADPCM_CT, sample_fmts_s16, adpcm_ct, "ADPCM Creative Technology");
ADPCM_DECODER(AV_CODEC_ID_ADPCM_EA, sample_fmts_s16, adpcm_ea, "ADPCM Electronic Arts");
ADPCM_DECODER(AV_CODEC_ID_ADPCM_EA_MAXIS_XA, sample_fmts_s16, adpcm_ea_maxis_xa, "ADPCM Electronic Arts Maxis CDROM XA");
More information about the ffmpeg-cvslog
mailing list