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
99423853
Commit
99423853
authored
Nov 20, 2011
by
Justin Ruggles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adx: simplify encoding by using put_sbits()
parent
b237248e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
adxenc.c
libavcodec/adxenc.c
+6
-3
No files found.
libavcodec/adxenc.c
View file @
99423853
...
...
@@ -22,6 +22,7 @@
#include "libavutil/intreadwrite.h"
#include "avcodec.h"
#include "adx.h"
#include "put_bits.h"
/**
* @file
...
...
@@ -37,6 +38,7 @@
static
void
adx_encode
(
ADXContext
*
c
,
unsigned
char
*
adx
,
const
short
*
wav
,
ADXChannelState
*
prev
)
{
PutBitContext
pb
;
int
scale
;
int
i
;
int
s0
,
s1
,
s2
,
d
;
...
...
@@ -72,9 +74,10 @@ static void adx_encode(ADXContext *c, unsigned char *adx, const short *wav,
AV_WB16
(
adx
,
scale
);
for
(
i
=
0
;
i
<
16
;
i
++
)
{
adx
[
i
+
2
]
=
((
data
[
i
*
2
]
/
scale
)
<<
4
)
|
((
data
[
i
*
2
+
1
]
/
scale
)
&
0xf
);
}
init_put_bits
(
&
pb
,
adx
+
2
,
16
);
for
(
i
=
0
;
i
<
32
;
i
++
)
put_sbits
(
&
pb
,
4
,
av_clip
(
data
[
i
]
/
scale
,
-
8
,
7
));
flush_put_bits
(
&
pb
);
}
static
int
adx_encode_header
(
AVCodecContext
*
avctx
,
unsigned
char
*
buf
,
size_t
bufsize
)
...
...
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