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
16b7a5e2
Commit
16b7a5e2
authored
Mar 17, 2012
by
Ronald S. Bultje
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adpcm: convert ima_ws to bytestream2.
parent
74d7ac95
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
17 deletions
+18
-17
adpcm.c
libavcodec/adpcm.c
+18
-17
No files found.
libavcodec/adpcm.c
View file @
16b7a5e2
...
...
@@ -809,28 +809,29 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
}
break
;
case
CODEC_ID_ADPCM_IMA_WS
:
for
(
channel
=
0
;
channel
<
avctx
->
channels
;
channel
++
)
{
const
uint8_t
*
src0
;
int
src_stride
;
int16_t
*
smp
=
samples
+
channel
;
if
(
c
->
vqa_version
==
3
)
{
for
(
channel
=
0
;
channel
<
avctx
->
channels
;
channel
++
)
{
int16_t
*
smp
=
samples
+
channel
;
if
(
c
->
vqa_version
==
3
)
{
src0
=
src
+
channel
*
buf_size
/
2
;
src_stride
=
1
;
}
else
{
src0
=
src
+
channel
;
src_stride
=
avctx
->
channels
;
for
(
n
=
nb_samples
/
2
;
n
>
0
;
n
--
)
{
int
v
=
bytestream2_get_byteu
(
&
gb
);
*
smp
=
adpcm_ima_expand_nibble
(
&
c
->
status
[
channel
],
v
>>
4
,
3
);
smp
+=
avctx
->
channels
;
*
smp
=
adpcm_ima_expand_nibble
(
&
c
->
status
[
channel
],
v
&
0x0F
,
3
);
smp
+=
avctx
->
channels
;
}
}
}
else
{
for
(
n
=
nb_samples
/
2
;
n
>
0
;
n
--
)
{
uint8_t
v
=
*
src0
;
src0
+=
src_stride
;
*
smp
=
adpcm_ima_expand_nibble
(
&
c
->
status
[
channel
],
v
>>
4
,
3
);
smp
+=
avctx
->
channels
;
*
smp
=
adpcm_ima_expand_nibble
(
&
c
->
status
[
channel
],
v
&
0x0F
,
3
);
s
mp
+=
avctx
->
channels
;
for
(
channel
=
0
;
channel
<
avctx
->
channels
;
channel
++
)
{
int
v
=
bytestream2_get_byteu
(
&
gb
)
;
*
samples
++
=
adpcm_ima_expand_nibble
(
&
c
->
status
[
channel
],
v
>>
4
,
3
);
samples
[
st
]
=
adpcm_ima_expand_nibble
(
&
c
->
status
[
channel
],
v
&
0x0F
,
3
)
;
}
s
amples
+=
avctx
->
channels
;
}
}
src
=
buf
+
buf_size
;
bytestream2_seek
(
&
gb
,
0
,
SEEK_END
)
;
break
;
case
CODEC_ID_ADPCM_XA
:
while
(
buf_size
>=
128
)
{
...
...
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