Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Releases
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Stefan Westerfeld
ffmpeg
Commits
15a1104d
Commit
15a1104d
authored
Feb 24, 2022
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/f_ebur128: multiply is usually faster than divide
Also guard against overflow when subtracting from unsigned.
parent
d5ad1d78
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
f_ebur128.c
libavfilter/f_ebur128.c
+3
-3
No files found.
libavfilter/f_ebur128.c
View file @
15a1104d
...
...
@@ -762,7 +762,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
/* get lower loudness to consider */
n
=
0
;
nb_pow
=
LRA_LOWER_PRC
*
nb_powers
/
100
.
+
0
.
5
;
nb_pow
=
LRA_LOWER_PRC
*
0
.
01
*
nb_powers
+
0
.
5
;
for
(
i
=
gate_hist_pos
;
i
<
HIST_SIZE
;
i
++
)
{
n
+=
ebur128
->
i3000
.
histogram
[
i
].
count
;
if
(
n
>=
nb_pow
)
{
...
...
@@ -773,9 +773,9 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
/* get higher loudness to consider */
n
=
nb_powers
;
nb_pow
=
LRA_HIGHER_PRC
*
nb_powers
/
100
.
+
0
.
5
;
nb_pow
=
LRA_HIGHER_PRC
*
0
.
01
*
nb_powers
+
0
.
5
;
for
(
i
=
HIST_SIZE
-
1
;
i
>=
0
;
i
--
)
{
n
-=
ebur128
->
i3000
.
histogram
[
i
].
count
;
n
-=
FFMIN
(
n
,
ebur128
->
i3000
.
histogram
[
i
].
count
)
;
if
(
n
<
nb_pow
)
{
ebur128
->
lra_high
=
ebur128
->
i3000
.
histogram
[
i
].
loudness
;
break
;
...
...
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