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
7d2156ae
Commit
7d2156ae
authored
Nov 25, 2012
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adpcm/thp: make use of ADPCMChannelStatus to store prev samples
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
66c3bac2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
adpcm.c
libavcodec/adpcm.c
+8
-8
No files found.
libavcodec/adpcm.c
View file @
7d2156ae
...
@@ -1306,7 +1306,6 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
...
@@ -1306,7 +1306,6 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
case
AV_CODEC_ID_ADPCM_THP
:
case
AV_CODEC_ID_ADPCM_THP
:
{
{
int
table
[
2
][
16
];
int
table
[
2
][
16
];
int
prev
[
2
][
2
];
int
ch
;
int
ch
;
for
(
i
=
0
;
i
<
2
;
i
++
)
for
(
i
=
0
;
i
<
2
;
i
++
)
...
@@ -1314,9 +1313,10 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
...
@@ -1314,9 +1313,10 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
table
[
i
][
n
]
=
sign_extend
(
bytestream2_get_be16u
(
&
gb
),
16
);
table
[
i
][
n
]
=
sign_extend
(
bytestream2_get_be16u
(
&
gb
),
16
);
/* Initialize the previous sample. */
/* Initialize the previous sample. */
for
(
i
=
0
;
i
<
2
;
i
++
)
for
(
i
=
0
;
i
<
2
;
i
++
)
{
for
(
n
=
0
;
n
<
2
;
n
++
)
c
->
status
[
i
].
sample1
=
sign_extend
(
bytestream2_get_be16u
(
&
gb
),
16
);
prev
[
i
][
n
]
=
sign_extend
(
bytestream2_get_be16u
(
&
gb
),
16
);
c
->
status
[
i
].
sample2
=
sign_extend
(
bytestream2_get_be16u
(
&
gb
),
16
);
}
for
(
ch
=
0
;
ch
<=
st
;
ch
++
)
{
for
(
ch
=
0
;
ch
<=
st
;
ch
++
)
{
samples
=
samples_p
[
ch
];
samples
=
samples_p
[
ch
];
...
@@ -1340,11 +1340,11 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
...
@@ -1340,11 +1340,11 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
sampledat
=
sign_extend
(
byte
>>
4
,
4
);
sampledat
=
sign_extend
(
byte
>>
4
,
4
);
}
}
sampledat
=
((
prev
[
ch
][
0
]
*
factor1
sampledat
=
((
c
->
status
[
ch
].
sample1
*
factor1
+
prev
[
ch
][
1
]
*
factor2
)
>>
11
)
+
(
sampledat
<<
exp
);
+
c
->
status
[
ch
].
sample2
*
factor2
)
>>
11
)
+
(
sampledat
<<
exp
);
*
samples
=
av_clip_int16
(
sampledat
);
*
samples
=
av_clip_int16
(
sampledat
);
prev
[
ch
][
1
]
=
prev
[
ch
][
0
]
;
c
->
status
[
ch
].
sample2
=
c
->
status
[
ch
].
sample1
;
prev
[
ch
][
0
]
=
*
samples
++
;
c
->
status
[
ch
].
sample1
=
*
samples
++
;
}
}
}
}
}
}
...
...
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