Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
c346f630
Commit
c346f630
authored
Mar 18, 2012
by
Ronald S. Bultje
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adpcm: fix nb_samples rounding for adpcm_ima_dk3, and update reference.
parent
72ec043a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
144 additions
and
144 deletions
+144
-144
adpcm.c
libavcodec/adpcm.c
+1
-1
utils.c
libavcodec/utils.c
+1
-1
adpcm-ima-dk3
tests/ref/fate/adpcm-ima-dk3
+1
-1
truemotion1-15
tests/ref/fate/truemotion1-15
+113
-113
truemotion1-24
tests/ref/fate/truemotion1-24
+28
-28
No files found.
libavcodec/adpcm.c
View file @
c346f630
...
@@ -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
;
...
...
libavcodec/utils.c
View file @
c346f630
...
@@ -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
:
...
...
tests/ref/fate/adpcm-ima-dk3
View file @
c346f630
bb952ae86c72d461aef7583685ec0a4d
62fbe4db4a49cb044f57f92cce9993c5
tests/ref/fate/truemotion1-15
View file @
c346f630
This diff is collapsed.
Click to expand it.
tests/ref/fate/truemotion1-24
View file @
c346f630
#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, 270
9, 10836, 0xedecb6a7
1, 0, 0, 270
8, 10832, 0x1597b4c8
1, 270
9, 2709, 2709, 10836, 0x8098a323
1, 270
8, 2708, 2708, 10832, 0xf9479f8b
0, 1, 1, 1, 69120, 0x3976f5cf
0, 1, 1, 1, 69120, 0x3976f5cf
1, 541
8, 5418, 2709, 10836, 0xcfa1112e
1, 541
6, 5416, 2708, 10832, 0x8db50e74
0, 2, 2, 1, 69120, 0xf815bc3c
0, 2, 2, 1, 69120, 0xf815bc3c
1, 812
7, 8127, 2709, 10836, 0xe241ede4
1, 812
4, 8124, 2708, 10832, 0x2b33ecbb
0, 3, 3, 1, 69120, 0xa7cc0ae6
0, 3, 3, 1, 69120, 0xa7cc0ae6
1, 1083
6, 10836, 2709, 10836, 0xddf254b
b
1, 1083
2, 10832, 2708, 10832, 0x8d0f537
b
0, 4, 4, 1, 69120, 0xd85ac282
0, 4, 4, 1, 69120, 0xd85ac282
1, 1354
5, 13545, 2709, 10836, 0xa16c850
7
1, 1354
0, 13540, 2708, 10832, 0x922081c
7
0, 5, 5, 1, 69120, 0xf7fd7edb
0, 5, 5, 1, 69120, 0xf7fd7edb
1, 162
54, 16254, 2709, 10836, 0xbe211f93
1, 162
48, 16248, 2708, 10832, 0x40291f19
0, 6, 6, 1, 69120, 0x433bb6f6
0, 6, 6, 1, 69120, 0x433bb6f6
1, 189
63, 18963, 2709, 10836, 0x26c7283d
1, 189
56, 18956, 2708, 10832, 0x88f5271a
0, 7, 7, 1, 69120, 0xdbac8bee
0, 7, 7, 1, 69120, 0xdbac8bee
1, 216
72, 21672, 2709, 10836, 0x4d18be56
1, 216
64, 21664, 2708, 10832, 0x55c6bbe5
0, 8, 8, 1, 69120, 0x88e2a799
0, 8, 8, 1, 69120, 0x88e2a799
1, 243
81, 24381, 2709, 10836, 0x57b9af6f
1, 243
72, 24372, 2708, 10832, 0x9b51ae82
0, 9, 9, 1, 69120, 0x49617b26
0, 9, 9, 1, 69120, 0x49617b26
1, 270
90, 27090, 2709, 10836, 0xd5864280
1, 270
80, 27080, 2708, 10832, 0xcdf2409b
0, 10, 10, 1, 69120, 0xeb44ca01
0, 10, 10, 1, 69120, 0xeb44ca01
1, 297
99, 29799, 2709, 10836, 0xd582b451
1, 297
88, 29788, 2708, 10832, 0x0933b1a4
0, 11, 11, 1, 69120, 0x6fea37e8
0, 11, 11, 1, 69120, 0x6fea37e8
1, 32
508, 32508, 2709, 10836, 0xec13731d
1, 32
496, 32496, 2708, 10832, 0x24b77006
1, 352
17, 35217, 2709, 10836, 0xe3d4fbb8
1, 352
04, 35204, 2708, 10832, 0xf612fa8a
0, 12, 12, 1, 69120, 0xf55d74c7
0, 12, 12, 1, 69120, 0xf55d74c7
1, 379
26, 37926, 2709, 10836, 0xcbb54d18
1, 379
12, 37912, 2708, 10832, 0x99884b06
0, 13, 13, 1, 69120, 0xb5082ca7
0, 13, 13, 1, 69120, 0xb5082ca7
1, 406
35, 40635, 2709, 10836, 0xff7e7133
1, 406
20, 40620, 2708, 10832, 0x3c746fbe
0, 14, 14, 1, 69120, 0x5876d758
0, 14, 14, 1, 69120, 0x5876d758
1, 433
44, 43344, 2709, 10836, 0xcc28b1a7
1, 433
28, 43328, 2708, 10832, 0x05f3b08a
1, 460
53, 46053, 2709, 10836, 0xbf9e07a5
1, 460
36, 46036, 2708, 10832, 0xa6560483
1, 487
62, 48762, 2709, 10836, 0x16408f38
1, 487
44, 48744, 2708, 10832, 0xd98a8e19
1, 514
71, 51471, 2709, 10836, 0x2b000c9f
1, 514
52, 51452, 2708, 10832, 0xf98a0b2e
1, 541
80, 54180, 2709, 10836, 0x0ccd9811
1, 541
60, 54160, 2708, 10832, 0xb1039582
1, 568
89, 56889, 2709, 10836, 0xf9575d48
1, 568
68, 56868, 2708, 10832, 0x85dd5c3f
1, 595
98, 59598, 2709, 10836, 0x1ee68190
1, 595
76, 59576, 2708, 10832, 0x19fc801a
1, 62
307, 62307, 2709, 10836, 0xde435373
1, 62
284, 62284, 2708, 10832, 0x95805089
1, 6
5016, 65016, 2709, 10836, 0xd83be17a
1, 6
4992, 64992, 2708, 10832, 0x576fdec3
1, 677
25, 67725, 2709, 10836, 0x9a7f0bbe
1, 677
00, 67700, 2708, 10832, 0x704a0905
1, 704
34, 70434, 2709, 10836, 0x8709e4d3
1, 704
08, 70408, 2708, 10832, 0xf87ce1fa
1, 731
43, 73143, 2709, 10836, 0xde1879cb
1, 731
16, 73116, 2708, 10832, 0xfc0076b9
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment