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
61366821
Commit
61366821
authored
Dec 19, 2011
by
Justin Ruggles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adxenc: avoid stereo deinterleaving
parent
6b77f070
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
15 deletions
+7
-15
adxenc.c
libavcodec/adxenc.c
+7
-15
No files found.
libavcodec/adxenc.c
View file @
61366821
...
...
@@ -34,11 +34,11 @@
*/
static
void
adx_encode
(
ADXContext
*
c
,
uint8_t
*
adx
,
const
int16_t
*
wav
,
ADXChannelState
*
prev
)
ADXChannelState
*
prev
,
int
channels
)
{
PutBitContext
pb
;
int
scale
;
int
i
;
int
i
,
j
;
int
s0
,
s1
,
s2
,
d
;
int
max
=
0
;
int
min
=
0
;
...
...
@@ -46,10 +46,10 @@ static void adx_encode(ADXContext *c, uint8_t *adx, const int16_t *wav,
s1
=
prev
->
s1
;
s2
=
prev
->
s2
;
for
(
i
=
0
;
i
<
32
;
i
++
)
{
for
(
i
=
0
,
j
=
0
;
j
<
32
;
i
+=
channels
,
j
++
)
{
s0
=
wav
[
i
];
d
=
((
s0
<<
COEFF_BITS
)
-
c
->
coeff
[
0
]
*
s1
-
c
->
coeff
[
1
]
*
s2
)
>>
COEFF_BITS
;
data
[
i
]
=
d
;
data
[
j
]
=
d
;
if
(
max
<
d
)
max
=
d
;
if
(
min
>
d
)
...
...
@@ -138,23 +138,15 @@ static int adx_encode_frame(AVCodecContext *avctx, uint8_t *frame,
if
(
avctx
->
channels
==
1
)
{
while
(
rest
>=
32
)
{
adx_encode
(
c
,
dst
,
samples
,
c
->
prev
);
adx_encode
(
c
,
dst
,
samples
,
c
->
prev
,
avctx
->
channels
);
dst
+=
18
;
samples
+=
32
;
rest
-=
32
;
}
}
else
{
while
(
rest
>=
32
*
2
)
{
int16_t
tmpbuf
[
32
*
2
];
int
i
;
for
(
i
=
0
;
i
<
32
;
i
++
)
{
tmpbuf
[
i
]
=
samples
[
i
*
2
];
tmpbuf
[
i
+
32
]
=
samples
[
i
*
2
+
1
];
}
adx_encode
(
c
,
dst
,
tmpbuf
,
c
->
prev
);
adx_encode
(
c
,
dst
+
18
,
tmpbuf
+
32
,
c
->
prev
+
1
);
adx_encode
(
c
,
dst
,
samples
,
c
->
prev
,
avctx
->
channels
);
adx_encode
(
c
,
dst
+
18
,
samples
+
1
,
c
->
prev
+
1
,
avctx
->
channels
);
dst
+=
18
*
2
;
samples
+=
32
*
2
;
rest
-=
32
*
2
;
...
...
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