avcodec: add ADPCM IMA MOFLEX decoder

This commit is contained in:
Paul B Mahol
2020-08-25 00:51:11 +02:00
parent 2d16b6bd3e
commit a1caa16d45
8 changed files with 41 additions and 2 deletions

View File

@@ -1664,6 +1664,8 @@ static int get_audio_frame_duration(enum AVCodecID id, int sr, int ch, int ba,
if (ch > 0 && ch < INT_MAX/16) {
/* calc from frame_bytes and channels */
switch (id) {
case AV_CODEC_ID_ADPCM_IMA_MOFLEX:
return (frame_bytes - 4 * ch) / (128 * ch) * 256;
case AV_CODEC_ID_ADPCM_AFC:
return frame_bytes / (9 * ch) * 16;
case AV_CODEC_ID_ADPCM_PSX: