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
943f4db5
Commit
943f4db5
authored
Sep 09, 2011
by
Justin Ruggles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adpcm_4xm: process planar packets sequentially rather than simultaneously.
Also properly clip the right channel step_index.
parent
119974b1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
20 deletions
+18
-20
adpcm.c
libavcodec/adpcm.c
+18
-20
No files found.
libavcodec/adpcm.c
View file @
943f4db5
...
...
@@ -463,30 +463,28 @@ static int adpcm_decode_frame(AVCodecContext *avctx,
}
break
;
case
CODEC_ID_ADPCM_4XM
:
cs
=
&
(
c
->
status
[
0
]);
c
->
status
[
0
].
predictor
=
(
int16_t
)
bytestream_get_le16
(
&
src
);
if
(
st
){
c
->
status
[
1
].
predictor
=
(
int16_t
)
bytestream_get_le16
(
&
src
);
}
c
->
status
[
0
].
step_index
=
(
int16_t
)
bytestream_get_le16
(
&
src
);
if
(
st
){
c
->
status
[
1
].
step_index
=
(
int16_t
)
bytestream_get_le16
(
&
src
);
}
if
(
cs
->
step_index
<
0
)
cs
->
step_index
=
0
;
if
(
cs
->
step_index
>
88
)
cs
->
step_index
=
88
;
for
(
i
=
0
;
i
<
avctx
->
channels
;
i
++
)
c
->
status
[
i
].
predictor
=
(
int16_t
)
bytestream_get_le16
(
&
src
);
m
=
(
buf_size
-
(
src
-
buf
))
>>
st
;
for
(
i
=
0
;
i
<
m
;
i
++
)
{
*
samples
++
=
adpcm_ima_expand_nibble
(
&
c
->
status
[
0
],
src
[
i
]
&
0x0F
,
4
);
if
(
st
)
*
samples
++
=
adpcm_ima_expand_nibble
(
&
c
->
status
[
1
],
src
[
i
+
m
]
&
0x0F
,
4
);
*
samples
++
=
adpcm_ima_expand_nibble
(
&
c
->
status
[
0
],
src
[
i
]
>>
4
,
4
);
if
(
st
)
*
samples
++
=
adpcm_ima_expand_nibble
(
&
c
->
status
[
1
],
src
[
i
+
m
]
>>
4
,
4
);
for
(
i
=
0
;
i
<
avctx
->
channels
;
i
++
)
{
c
->
status
[
i
].
step_index
=
(
int16_t
)
bytestream_get_le16
(
&
src
);
c
->
status
[
i
].
step_index
=
av_clip
(
c
->
status
[
i
].
step_index
,
0
,
88
);
}
src
+=
m
<<
st
;
m
=
(
buf_size
-
(
src
-
buf
))
>>
st
;
for
(
i
=
0
;
i
<
avctx
->
channels
;
i
++
)
{
samples
=
(
short
*
)
data
+
i
;
cs
=
&
c
->
status
[
i
];
for
(
n
=
0
;
n
<
m
;
n
++
)
{
uint8_t
v
=
*
src
++
;
*
samples
=
adpcm_ima_expand_nibble
(
cs
,
v
&
0x0F
,
4
);
samples
+=
avctx
->
channels
;
*
samples
=
adpcm_ima_expand_nibble
(
cs
,
v
>>
4
,
4
);
samples
+=
avctx
->
channels
;
}
}
samples
-=
(
avctx
->
channels
-
1
);
break
;
case
CODEC_ID_ADPCM_MS
:
if
(
avctx
->
block_align
!=
0
&&
buf_size
>
avctx
->
block_align
)
...
...
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