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
159831cc
Commit
159831cc
authored
Mar 18, 2012
by
Ronald S. Bultje
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adpcm: convert adpcm_xa to bytestream2.
parent
16b7a5e2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
adpcm.c
libavcodec/adpcm.c
+5
-6
No files found.
libavcodec/adpcm.c
View file @
159831cc
...
@@ -292,7 +292,7 @@ static int xa_decode(AVCodecContext *avctx,
...
@@ -292,7 +292,7 @@ static int xa_decode(AVCodecContext *avctx,
for
(
j
=
0
;
j
<
28
;
j
++
)
{
for
(
j
=
0
;
j
<
28
;
j
++
)
{
d
=
in
[
16
+
i
+
j
*
4
];
d
=
in
[
16
+
i
+
j
*
4
];
t
=
(
signed
char
)(
d
<<
4
)
>>
4
;
t
=
sign_extend
(
d
,
4
)
;
s
=
(
t
<<
shift
)
+
((
s_1
*
f0
+
s_2
*
f1
+
32
)
>>
6
);
s
=
(
t
<<
shift
)
+
((
s_1
*
f0
+
s_2
*
f1
+
32
)
>>
6
);
s_2
=
s_1
;
s_2
=
s_1
;
s_1
=
av_clip_int16
(
s
);
s_1
=
av_clip_int16
(
s
);
...
@@ -322,7 +322,7 @@ static int xa_decode(AVCodecContext *avctx,
...
@@ -322,7 +322,7 @@ static int xa_decode(AVCodecContext *avctx,
for
(
j
=
0
;
j
<
28
;
j
++
)
{
for
(
j
=
0
;
j
<
28
;
j
++
)
{
d
=
in
[
16
+
i
+
j
*
4
];
d
=
in
[
16
+
i
+
j
*
4
];
t
=
(
signed
char
)
d
>>
4
;
t
=
sign_extend
(
d
>>
4
,
4
)
;
s
=
(
t
<<
shift
)
+
((
s_1
*
f0
+
s_2
*
f1
+
32
)
>>
6
);
s
=
(
t
<<
shift
)
+
((
s_1
*
f0
+
s_2
*
f1
+
32
)
>>
6
);
s_2
=
s_1
;
s_2
=
s_1
;
s_1
=
av_clip_int16
(
s
);
s_1
=
av_clip_int16
(
s
);
...
@@ -834,13 +834,12 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
...
@@ -834,13 +834,12 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
bytestream2_seek
(
&
gb
,
0
,
SEEK_END
);
bytestream2_seek
(
&
gb
,
0
,
SEEK_END
);
break
;
break
;
case
CODEC_ID_ADPCM_XA
:
case
CODEC_ID_ADPCM_XA
:
while
(
b
uf_size
>=
128
)
{
while
(
b
ytestream2_get_bytes_left
(
&
gb
)
>=
128
)
{
if
((
ret
=
xa_decode
(
avctx
,
samples
,
src
,
&
c
->
status
[
0
],
if
((
ret
=
xa_decode
(
avctx
,
samples
,
buf
+
bytestream2_tell
(
&
gb
)
,
&
c
->
status
[
0
],
&
c
->
status
[
1
],
avctx
->
channels
))
<
0
)
&
c
->
status
[
1
],
avctx
->
channels
))
<
0
)
return
ret
;
return
ret
;
src
+=
128
;
bytestream2_skipu
(
&
gb
,
128
)
;
samples
+=
28
*
8
;
samples
+=
28
*
8
;
buf_size
-=
128
;
}
}
break
;
break
;
case
CODEC_ID_ADPCM_IMA_EA_EACS
:
case
CODEC_ID_ADPCM_IMA_EA_EACS
:
...
...
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