diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2012-01-23 14:57:32 -0500 |
---|---|---|
committer | Justin Ruggles <justin.ruggles@gmail.com> | 2012-01-24 14:13:41 -0500 |
commit | 220506d23f39da3e23d3d42fb7061f19cec8052c (patch) | |
tree | 5a1621e906a2c3ce4c4b9a2b9c5e36800c142d9e /libavcodec/adpcm.c | |
parent | 4340a6363e9ff75dc4e8ce14dc96671623494ed8 (diff) | |
download | ffmpeg-220506d23f39da3e23d3d42fb7061f19cec8052c.tar.gz |
avcodec: add a new codec_id for CRYO APC IMA ADPCM.
The stereo layout and extradata is significantly different from that in
Westwood IMA ADPCM, so a separate codec_id is warranted.
Diffstat (limited to 'libavcodec/adpcm.c')
-rw-r--r-- | libavcodec/adpcm.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c index b319635ed4..64bea6a5da 100644 --- a/libavcodec/adpcm.c +++ b/libavcodec/adpcm.c @@ -120,8 +120,8 @@ static av_cold int adpcm_decode_init(AVCodecContext * avctx) return -1; } break; - case CODEC_ID_ADPCM_IMA_WS: - if (avctx->extradata && avctx->extradata_size == 2 * 4) { + case CODEC_ID_ADPCM_IMA_APC: + if (avctx->extradata && avctx->extradata_size >= 8) { c->status[0].predictor = AV_RL32(avctx->extradata); c->status[1].predictor = AV_RL32(avctx->extradata + 4); } @@ -359,6 +359,7 @@ static int get_nb_samples(AVCodecContext *avctx, const uint8_t *buf, break; /* simple 4-bit adpcm */ case CODEC_ID_ADPCM_CT: + case CODEC_ID_ADPCM_IMA_APC: case CODEC_ID_ADPCM_IMA_EA_SEAD: case CODEC_ID_ADPCM_IMA_WS: case CODEC_ID_ADPCM_YAMAHA: @@ -774,6 +775,7 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data, } break; case CODEC_ID_ADPCM_IMA_WS: + case CODEC_ID_ADPCM_IMA_APC: while (src < buf + buf_size) { uint8_t v = *src++; *samples++ = adpcm_ima_expand_nibble(&c->status[0], v >> 4 , 3); @@ -1220,6 +1222,7 @@ ADPCM_DECODER(CODEC_ID_ADPCM_EA_R2, adpcm_ea_r2, "ADPCM Electronic Arts R2"); ADPCM_DECODER(CODEC_ID_ADPCM_EA_R3, adpcm_ea_r3, "ADPCM Electronic Arts R3"); ADPCM_DECODER(CODEC_ID_ADPCM_EA_XAS, adpcm_ea_xas, "ADPCM Electronic Arts XAS"); ADPCM_DECODER(CODEC_ID_ADPCM_IMA_AMV, adpcm_ima_amv, "ADPCM IMA AMV"); +ADPCM_DECODER(CODEC_ID_ADPCM_IMA_APC, adpcm_ima_apc, "ADPCM IMA CRYO APC"); ADPCM_DECODER(CODEC_ID_ADPCM_IMA_DK3, adpcm_ima_dk3, "ADPCM IMA Duck DK3"); ADPCM_DECODER(CODEC_ID_ADPCM_IMA_DK4, adpcm_ima_dk4, "ADPCM IMA Duck DK4"); ADPCM_DECODER(CODEC_ID_ADPCM_IMA_EA_EACS, adpcm_ima_ea_eacs, "ADPCM IMA Electronic Arts EACS"); |