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
fea8e119
Commit
fea8e119
authored
Jan 06, 2018
by
Aurelien Jacobs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
aptx: factorize FFABS calculation
parent
b7915f8a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
aptx.c
libavcodec/aptx.c
+5
-3
No files found.
libavcodec/aptx.c
View file @
fea8e119
...
...
@@ -462,10 +462,12 @@ static void aptx_quantize_difference(Quantize *quantize,
{
const
int32_t
*
intervals
=
tables
->
quantize_intervals
;
int32_t
quantized_sample
,
dithered_sample
,
parity_change
;
int32_t
d
,
mean
,
interval
,
inv
;
int32_t
d
,
mean
,
interval
,
inv
,
sample_difference_abs
;
int64_t
error
;
quantized_sample
=
aptx_bin_search
(
FFABS
(
sample_difference
)
>>
4
,
sample_difference_abs
=
FFABS
(
sample_difference
);
quantized_sample
=
aptx_bin_search
(
sample_difference_abs
>>
4
,
quantization_factor
,
intervals
,
tables
->
tables_size
);
...
...
@@ -477,7 +479,7 @@ static void aptx_quantize_difference(Quantize *quantize,
interval
=
(
intervals
[
1
]
-
intervals
[
0
])
*
(
-
(
sample_difference
<
0
)
|
1
);
dithered_sample
=
rshift64_clip24
(
MUL64
(
dither
,
interval
)
+
((
int64_t
)(
mean
+
d
)
<<
32
),
32
);
error
=
((
int64_t
)
FFABS
(
sample_difference
)
<<
20
)
-
MUL64
(
dithered_sample
,
quantization_factor
);
error
=
((
int64_t
)
sample_difference_abs
<<
20
)
-
MUL64
(
dithered_sample
,
quantization_factor
);
quantize
->
error
=
FFABS
(
rshift64
(
error
,
23
));
parity_change
=
quantized_sample
;
...
...
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