ADPCM IMA WAV 2, 3 and 5 bits decoder

Signed-off-by: Paul B Mahol <onemda@gmail.com>
This commit is contained in:
Paul B Mahol
2012-12-01 14:52:22 +00:00
parent 48f2750de8
commit 6516a25f04
4 changed files with 77 additions and 7 deletions

View File

@@ -2899,7 +2899,9 @@ int av_get_audio_frame_duration(AVCodecContext *avctx, int frame_bytes)
int blocks = frame_bytes / ba;
switch (avctx->codec_id) {
case AV_CODEC_ID_ADPCM_IMA_WAV:
return blocks * (1 + (ba - 4 * ch) / (4 * ch) * 8);
if (bps < 2 || bps > 5)
return 0;
return blocks * (1 + (ba - 4 * ch) / (bps * ch) * 8);
case AV_CODEC_ID_ADPCM_IMA_DK3:
return blocks * (((ba - 16) * 2 / 3 * 4) / ch);
case AV_CODEC_ID_ADPCM_IMA_DK4: