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
c52ddc60
Commit
c52ddc60
authored
Nov 20, 2011
by
Justin Ruggles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adx: simplify adx_decode() by using get_sbits() to read residual samples
parent
ca9e4727
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
12 deletions
+5
-12
adxdec.c
libavcodec/adxdec.c
+5
-12
No files found.
libavcodec/adxdec.c
View file @
c52ddc60
...
...
@@ -22,6 +22,7 @@
#include "libavutil/intreadwrite.h"
#include "avcodec.h"
#include "adx.h"
#include "get_bits.h"
/**
* @file
...
...
@@ -48,24 +49,16 @@ static av_cold int adx_decode_init(AVCodecContext *avctx)
static
void
adx_decode
(
ADXContext
*
c
,
int16_t
*
out
,
const
uint8_t
*
in
,
int
ch
)
{
ADXChannelState
*
prev
=
&
c
->
prev
[
ch
];
GetBitContext
gb
;
int
scale
=
AV_RB16
(
in
);
int
i
;
int
s0
,
s1
,
s2
,
d
;
in
+=
2
;
in
it_get_bits
(
&
gb
,
in
+
2
,
(
18
-
2
)
*
8
)
;
s1
=
prev
->
s1
;
s2
=
prev
->
s2
;
for
(
i
=
0
;
i
<
16
;
i
++
)
{
d
=
in
[
i
];
d
=
(
signed
char
)
d
>>
4
;
s0
=
(
BASEVOL
*
d
*
scale
+
SCALE1
*
s1
-
SCALE2
*
s2
)
>>
14
;
s2
=
s1
;
s1
=
av_clip_int16
(
s0
);
*
out
=
s1
;
out
+=
c
->
channels
;
d
=
in
[
i
];
d
=
(
signed
char
)(
d
<<
4
)
>>
4
;
for
(
i
=
0
;
i
<
32
;
i
++
)
{
d
=
get_sbits
(
&
gb
,
4
);
s0
=
(
BASEVOL
*
d
*
scale
+
SCALE1
*
s1
-
SCALE2
*
s2
)
>>
14
;
s2
=
s1
;
s1
=
av_clip_int16
(
s0
);
...
...
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