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
66eb5b80
Commit
66eb5b80
authored
May 04, 2016
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/adpcm: fix decoding of stereo non 4-bit ADPCM IMA WAV
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
3395ad48
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
adpcm.c
libavcodec/adpcm.c
+11
-3
No files found.
libavcodec/adpcm.c
View file @
66eb5b80
...
...
@@ -783,15 +783,23 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
if
(
avctx
->
bits_per_coded_sample
!=
4
)
{
int
samples_per_block
=
ff_adpcm_ima_block_samples
[
avctx
->
bits_per_coded_sample
-
2
];
int
block_size
=
ff_adpcm_ima_block_sizes
[
avctx
->
bits_per_coded_sample
-
2
];
uint8_t
temp
[
20
]
=
{
0
};
GetBitContext
g
;
ret
=
init_get_bits8
(
&
g
,
gb
.
buffer
,
bytestream2_get_bytes_left
(
&
gb
));
if
(
ret
<
0
)
return
ret
;
for
(
n
=
0
;
n
<
(
nb_samples
-
1
)
/
samples_per_block
;
n
++
)
{
for
(
i
=
0
;
i
<
avctx
->
channels
;
i
++
)
{
int
j
;
cs
=
&
c
->
status
[
i
];
samples
=
&
samples_p
[
i
][
1
+
n
*
samples_per_block
];
for
(
j
=
0
;
j
<
block_size
;
j
++
)
{
temp
[
j
]
=
buf
[
4
*
avctx
->
channels
+
block_size
*
n
*
avctx
->
channels
+
(
j
%
4
)
+
(
j
/
4
)
*
(
avctx
->
channels
*
4
)
+
i
*
4
];
}
ret
=
init_get_bits8
(
&
g
,
(
const
uint8_t
*
)
&
temp
,
block_size
);
if
(
ret
<
0
)
return
ret
;
for
(
m
=
0
;
m
<
samples_per_block
;
m
++
)
{
samples
[
m
]
=
adpcm_ima_wav_expand_nibble
(
cs
,
&
g
,
avctx
->
bits_per_coded_sample
);
...
...
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