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
337b6d3b
Commit
337b6d3b
authored
Nov 29, 2015
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/af_sidechaincompress: fix output gain for rms(default) detection
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
88e498a8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
af_sidechaincompress.c
libavfilter/af_sidechaincompress.c
+3
-1
No files found.
libavfilter/af_sidechaincompress.c
View file @
337b6d3b
...
...
@@ -50,6 +50,7 @@ typedef struct SidechainCompressContext {
double
knee_start
;
double
knee_stop
;
double
lin_knee_start
;
double
adj_knee_start
;
double
compressed_knee_stop
;
int
link
;
int
detection
;
...
...
@@ -87,6 +88,7 @@ static av_cold int init(AVFilterContext *ctx)
s
->
thres
=
log
(
s
->
threshold
);
s
->
lin_knee_start
=
s
->
threshold
/
sqrt
(
s
->
knee
);
s
->
adj_knee_start
=
s
->
lin_knee_start
*
s
->
lin_knee_start
;
s
->
knee_start
=
log
(
s
->
lin_knee_start
);
s
->
knee_stop
=
log
(
s
->
threshold
*
sqrt
(
s
->
knee
));
s
->
compressed_knee_stop
=
(
s
->
knee_stop
-
s
->
thres
)
/
s
->
ratio
+
s
->
thres
;
...
...
@@ -166,7 +168,7 @@ static void compressor(SidechainCompressContext *s,
s
->
lin_slope
+=
(
abs_sample
-
s
->
lin_slope
)
*
(
abs_sample
>
s
->
lin_slope
?
s
->
attack_coeff
:
s
->
release_coeff
);
if
(
s
->
lin_slope
>
0
.
0
&&
s
->
lin_slope
>
s
->
lin_knee_start
)
if
(
s
->
lin_slope
>
0
.
0
&&
s
->
lin_slope
>
(
s
->
detection
?
s
->
adj_knee_start
:
s
->
lin_knee_start
)
)
gain
=
output_gain
(
s
->
lin_slope
,
s
->
ratio
,
s
->
thres
,
s
->
knee
,
s
->
knee_start
,
s
->
knee_stop
,
s
->
compressed_knee_stop
,
s
->
detection
);
...
...
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