diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2012-08-30 21:33:34 -0400 |
---|---|---|
committer | Justin Ruggles <justin.ruggles@gmail.com> | 2012-10-09 09:03:52 -0400 |
commit | da9620e8e59335b986230c023c7900bdf7e1b8a5 (patch) | |
tree | e2aef78e07068486cbc0b89f006a3842472675a1 /libavcodec | |
parent | d2b6ae02aa4d80fb19137ec11f3cefb9f71b9b81 (diff) | |
download | ffmpeg-da9620e8e59335b986230c023c7900bdf7e1b8a5.tar.gz |
adpcmdec: use planar sample format for adpcm_ea_r1/r2/r3
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/adpcm.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c index 92c7943e4f..9b57b46ac9 100644 --- a/libavcodec/adpcm.c +++ b/libavcodec/adpcm.c @@ -140,6 +140,9 @@ static av_cold int adpcm_decode_init(AVCodecContext * avctx) case AV_CODEC_ID_ADPCM_IMA_WAV: case AV_CODEC_ID_ADPCM_4XM: case AV_CODEC_ID_ADPCM_XA: + case AV_CODEC_ID_ADPCM_EA_R1: + case AV_CODEC_ID_ADPCM_EA_R2: + case AV_CODEC_ID_ADPCM_EA_R3: avctx->sample_fmt = AV_SAMPLE_FMT_S16P; break; case AV_CODEC_ID_ADPCM_IMA_WS: @@ -1037,7 +1040,7 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data, for (channel=0; channel<avctx->channels; channel++) { bytestream2_seek(&gb, offsets[channel], SEEK_SET); - samplesC = samples + channel; + samplesC = samples_p[channel]; if (avctx->codec->id == AV_CODEC_ID_ADPCM_EA_R1) { current_sample = sign_extend(bytestream2_get_le16(&gb), 16); @@ -1053,10 +1056,8 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data, current_sample = sign_extend(bytestream2_get_be16(&gb), 16); previous_sample = sign_extend(bytestream2_get_be16(&gb), 16); - for (count2=0; count2<28; count2++) { - *samplesC = sign_extend(bytestream2_get_be16(&gb), 16); - samplesC += avctx->channels; - } + for (count2=0; count2<28; count2++) + *samplesC++ = sign_extend(bytestream2_get_be16(&gb), 16); } else { coeff1 = ea_adpcm_table[ byte >> 4 ]; coeff2 = ea_adpcm_table[(byte >> 4) + 4]; @@ -1076,8 +1077,7 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data, previous_sample = current_sample; current_sample = next_sample; - *samplesC = current_sample; - samplesC += avctx->channels; + *samplesC++ = current_sample; } } } @@ -1309,9 +1309,9 @@ ADPCM_DECODER(AV_CODEC_ID_ADPCM_4XM, sample_fmts_s16p, adpcm_4xm, 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"); -ADPCM_DECODER(AV_CODEC_ID_ADPCM_EA_R1, sample_fmts_s16, adpcm_ea_r1, "ADPCM Electronic Arts R1"); -ADPCM_DECODER(AV_CODEC_ID_ADPCM_EA_R2, sample_fmts_s16, adpcm_ea_r2, "ADPCM Electronic Arts R2"); -ADPCM_DECODER(AV_CODEC_ID_ADPCM_EA_R3, sample_fmts_s16, adpcm_ea_r3, "ADPCM Electronic Arts R3"); +ADPCM_DECODER(AV_CODEC_ID_ADPCM_EA_R1, sample_fmts_s16p, adpcm_ea_r1, "ADPCM Electronic Arts R1"); +ADPCM_DECODER(AV_CODEC_ID_ADPCM_EA_R2, sample_fmts_s16p, adpcm_ea_r2, "ADPCM Electronic Arts R2"); +ADPCM_DECODER(AV_CODEC_ID_ADPCM_EA_R3, sample_fmts_s16p, adpcm_ea_r3, "ADPCM Electronic Arts R3"); ADPCM_DECODER(AV_CODEC_ID_ADPCM_EA_XAS, sample_fmts_s16, adpcm_ea_xas, "ADPCM Electronic Arts XAS"); ADPCM_DECODER(AV_CODEC_ID_ADPCM_IMA_AMV, sample_fmts_s16, adpcm_ima_amv, "ADPCM IMA AMV"); ADPCM_DECODER(AV_CODEC_ID_ADPCM_IMA_APC, sample_fmts_s16, adpcm_ima_apc, "ADPCM IMA CRYO APC"); |