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
22c48d39
Commit
22c48d39
authored
Mar 17, 2012
by
Ronald S. Bultje
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adpcm: convert adpcm_ea_xas to bytestream2.
parent
edd95555
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
adpcm.c
libavcodec/adpcm.c
+10
-6
No files found.
libavcodec/adpcm.c
View file @
22c48d39
...
...
@@ -1033,18 +1033,22 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
int
coeff
[
2
][
4
],
shift
[
4
];
short
*
s2
,
*
s
=
&
samples
[
channel
];
for
(
n
=
0
;
n
<
4
;
n
++
,
s
+=
32
*
avctx
->
channels
)
{
int
val
=
sign_extend
(
bytestream2_get_le16u
(
&
gb
),
16
);
for
(
i
=
0
;
i
<
2
;
i
++
)
coeff
[
i
][
n
]
=
ea_adpcm_table
[(
src
[
0
]
&
0x0F
)
+
4
*
i
];
shift
[
n
]
=
20
-
(
src
[
2
]
&
0x0F
);
for
(
s2
=
s
,
i
=
0
;
i
<
2
;
i
++
,
src
+=
2
,
s2
+=
avctx
->
channels
)
s2
[
0
]
=
(
src
[
0
]
&
0xF0
)
+
(
src
[
1
]
<<
8
);
coeff
[
i
][
n
]
=
ea_adpcm_table
[(
val
&
0x0F
)
+
4
*
i
];
s
[
0
]
=
val
&
~
0x0F
;
val
=
sign_extend
(
bytestream2_get_le16u
(
&
gb
),
16
);
shift
[
n
]
=
20
-
(
val
&
0x0F
);
s
[
avctx
->
channels
]
=
val
&
~
0x0F
;
}
for
(
m
=
2
;
m
<
32
;
m
+=
2
)
{
s
=
&
samples
[
m
*
avctx
->
channels
+
channel
];
for
(
n
=
0
;
n
<
4
;
n
++
,
src
++
,
s
+=
32
*
avctx
->
channels
)
{
for
(
n
=
0
;
n
<
4
;
n
++
,
s
+=
32
*
avctx
->
channels
)
{
int
byte
=
bytestream2_get_byteu
(
&
gb
);
for
(
s2
=
s
,
i
=
0
;
i
<
8
;
i
+=
4
,
s2
+=
avctx
->
channels
)
{
int
level
=
sign_extend
(
*
src
>>
(
4
-
i
),
4
)
<<
shift
[
n
];
int
level
=
sign_extend
(
byte
>>
(
4
-
i
),
4
)
<<
shift
[
n
];
int
pred
=
s2
[
-
1
*
avctx
->
channels
]
*
coeff
[
0
][
n
]
+
s2
[
-
2
*
avctx
->
channels
]
*
coeff
[
1
][
n
];
s2
[
0
]
=
av_clip_int16
((
level
+
pred
+
0x80
)
>>
8
);
...
...
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