Commit c346f630 authored by Ronald S. Bultje's avatar Ronald S. Bultje

adpcm: fix nb_samples rounding for adpcm_ima_dk3, and update reference.

parent 72ec043a
...@@ -448,7 +448,7 @@ static int get_nb_samples(AVCodecContext *avctx, const uint8_t *buf, ...@@ -448,7 +448,7 @@ static int get_nb_samples(AVCodecContext *avctx, const uint8_t *buf,
case CODEC_ID_ADPCM_IMA_DK3: case CODEC_ID_ADPCM_IMA_DK3:
if (avctx->block_align > 0) if (avctx->block_align > 0)
buf_size = FFMIN(buf_size, avctx->block_align); buf_size = FFMIN(buf_size, avctx->block_align);
nb_samples = ((buf_size - 16) * 8 / 3) / ch; nb_samples = ((buf_size - 16) * 2 / 3 * 4) / ch;
break; break;
case CODEC_ID_ADPCM_IMA_DK4: case CODEC_ID_ADPCM_IMA_DK4:
nb_samples = 1 + (buf_size - 4 * ch) * 2 / ch; nb_samples = 1 + (buf_size - 4 * ch) * 2 / ch;
......
...@@ -1859,7 +1859,7 @@ int av_get_audio_frame_duration(AVCodecContext *avctx, int frame_bytes) ...@@ -1859,7 +1859,7 @@ int av_get_audio_frame_duration(AVCodecContext *avctx, int frame_bytes)
case CODEC_ID_ADPCM_IMA_WAV: case CODEC_ID_ADPCM_IMA_WAV:
return blocks * (1 + (ba - 4 * ch) / (4 * ch) * 8); return blocks * (1 + (ba - 4 * ch) / (4 * ch) * 8);
case CODEC_ID_ADPCM_IMA_DK3: case CODEC_ID_ADPCM_IMA_DK3:
return blocks * (((ba - 16) * 8 / 3) / ch); return blocks * (((ba - 16) * 2 / 3 * 4) / ch);
case CODEC_ID_ADPCM_IMA_DK4: case CODEC_ID_ADPCM_IMA_DK4:
return blocks * (1 + (ba - 4 * ch) * 2 / ch); return blocks * (1 + (ba - 4 * ch) * 2 / ch);
case CODEC_ID_ADPCM_MS: case CODEC_ID_ADPCM_MS:
......
bb952ae86c72d461aef7583685ec0a4d 62fbe4db4a49cb044f57f92cce9993c5
This diff is collapsed.
#tb 0: 1/15 #tb 0: 1/15
#tb 1: 1/44100 #tb 1: 1/44100
0, 0, 0, 1, 69120, 0x68beb30f 0, 0, 0, 1, 69120, 0x68beb30f
1, 0, 0, 2709, 10836, 0xedecb6a7 1, 0, 0, 2708, 10832, 0x1597b4c8
1, 2709, 2709, 2709, 10836, 0x8098a323 1, 2708, 2708, 2708, 10832, 0xf9479f8b
0, 1, 1, 1, 69120, 0x3976f5cf 0, 1, 1, 1, 69120, 0x3976f5cf
1, 5418, 5418, 2709, 10836, 0xcfa1112e 1, 5416, 5416, 2708, 10832, 0x8db50e74
0, 2, 2, 1, 69120, 0xf815bc3c 0, 2, 2, 1, 69120, 0xf815bc3c
1, 8127, 8127, 2709, 10836, 0xe241ede4 1, 8124, 8124, 2708, 10832, 0x2b33ecbb
0, 3, 3, 1, 69120, 0xa7cc0ae6 0, 3, 3, 1, 69120, 0xa7cc0ae6
1, 10836, 10836, 2709, 10836, 0xddf254bb 1, 10832, 10832, 2708, 10832, 0x8d0f537b
0, 4, 4, 1, 69120, 0xd85ac282 0, 4, 4, 1, 69120, 0xd85ac282
1, 13545, 13545, 2709, 10836, 0xa16c8507 1, 13540, 13540, 2708, 10832, 0x922081c7
0, 5, 5, 1, 69120, 0xf7fd7edb 0, 5, 5, 1, 69120, 0xf7fd7edb
1, 16254, 16254, 2709, 10836, 0xbe211f93 1, 16248, 16248, 2708, 10832, 0x40291f19
0, 6, 6, 1, 69120, 0x433bb6f6 0, 6, 6, 1, 69120, 0x433bb6f6
1, 18963, 18963, 2709, 10836, 0x26c7283d 1, 18956, 18956, 2708, 10832, 0x88f5271a
0, 7, 7, 1, 69120, 0xdbac8bee 0, 7, 7, 1, 69120, 0xdbac8bee
1, 21672, 21672, 2709, 10836, 0x4d18be56 1, 21664, 21664, 2708, 10832, 0x55c6bbe5
0, 8, 8, 1, 69120, 0x88e2a799 0, 8, 8, 1, 69120, 0x88e2a799
1, 24381, 24381, 2709, 10836, 0x57b9af6f 1, 24372, 24372, 2708, 10832, 0x9b51ae82
0, 9, 9, 1, 69120, 0x49617b26 0, 9, 9, 1, 69120, 0x49617b26
1, 27090, 27090, 2709, 10836, 0xd5864280 1, 27080, 27080, 2708, 10832, 0xcdf2409b
0, 10, 10, 1, 69120, 0xeb44ca01 0, 10, 10, 1, 69120, 0xeb44ca01
1, 29799, 29799, 2709, 10836, 0xd582b451 1, 29788, 29788, 2708, 10832, 0x0933b1a4
0, 11, 11, 1, 69120, 0x6fea37e8 0, 11, 11, 1, 69120, 0x6fea37e8
1, 32508, 32508, 2709, 10836, 0xec13731d 1, 32496, 32496, 2708, 10832, 0x24b77006
1, 35217, 35217, 2709, 10836, 0xe3d4fbb8 1, 35204, 35204, 2708, 10832, 0xf612fa8a
0, 12, 12, 1, 69120, 0xf55d74c7 0, 12, 12, 1, 69120, 0xf55d74c7
1, 37926, 37926, 2709, 10836, 0xcbb54d18 1, 37912, 37912, 2708, 10832, 0x99884b06
0, 13, 13, 1, 69120, 0xb5082ca7 0, 13, 13, 1, 69120, 0xb5082ca7
1, 40635, 40635, 2709, 10836, 0xff7e7133 1, 40620, 40620, 2708, 10832, 0x3c746fbe
0, 14, 14, 1, 69120, 0x5876d758 0, 14, 14, 1, 69120, 0x5876d758
1, 43344, 43344, 2709, 10836, 0xcc28b1a7 1, 43328, 43328, 2708, 10832, 0x05f3b08a
1, 46053, 46053, 2709, 10836, 0xbf9e07a5 1, 46036, 46036, 2708, 10832, 0xa6560483
1, 48762, 48762, 2709, 10836, 0x16408f38 1, 48744, 48744, 2708, 10832, 0xd98a8e19
1, 51471, 51471, 2709, 10836, 0x2b000c9f 1, 51452, 51452, 2708, 10832, 0xf98a0b2e
1, 54180, 54180, 2709, 10836, 0x0ccd9811 1, 54160, 54160, 2708, 10832, 0xb1039582
1, 56889, 56889, 2709, 10836, 0xf9575d48 1, 56868, 56868, 2708, 10832, 0x85dd5c3f
1, 59598, 59598, 2709, 10836, 0x1ee68190 1, 59576, 59576, 2708, 10832, 0x19fc801a
1, 62307, 62307, 2709, 10836, 0xde435373 1, 62284, 62284, 2708, 10832, 0x95805089
1, 65016, 65016, 2709, 10836, 0xd83be17a 1, 64992, 64992, 2708, 10832, 0x576fdec3
1, 67725, 67725, 2709, 10836, 0x9a7f0bbe 1, 67700, 67700, 2708, 10832, 0x704a0905
1, 70434, 70434, 2709, 10836, 0x8709e4d3 1, 70408, 70408, 2708, 10832, 0xf87ce1fa
1, 73143, 73143, 2709, 10836, 0xde1879cb 1, 73116, 73116, 2708, 10832, 0xfc0076b9
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment