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
76570349
Commit
76570349
authored
Jun 07, 2016
by
Kyle Swanson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/af_loudnorm: add dual_mono option
Signed-off-by:
Kyle Swanson
<
k@ylo.ph
>
parent
6826f16e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
0 deletions
+14
-0
filters.texi
doc/filters.texi
+7
-0
af_loudnorm.c
libavfilter/af_loudnorm.c
+7
-0
No files found.
doc/filters.texi
View file @
76570349
...
...
@@ -2765,6 +2765,13 @@ measured_I, measured_LRA, measured_TP, and measured_thresh must also
to be specified in order to use this mode.
Options are true or false. Default is true.
@item dual_mono
Treat mono input files as "dual-mono". If a mono file is intended for playback
on a stereo system, its EBU R128 measurement will be perceptually incorrect.
If set to @code{true}, this option will compensate for this effect.
Multi-channel input files are not affected by this option.
Options are true or false. Default is false.
@item print_format
Set print format for stats. Options are summary, json, or none.
Default value is none.
...
...
libavfilter/af_loudnorm.c
View file @
76570349
...
...
@@ -60,6 +60,7 @@ typedef struct LoudNormContext {
double
measured_thresh
;
double
offset
;
int
linear
;
int
dual_mono
;
enum
PrintFormat
print_format
;
double
*
buf
;
...
...
@@ -113,6 +114,7 @@ static const AVOption loudnorm_options[] = {
{
"measured_thresh"
,
"measured threshold of input file"
,
OFFSET
(
measured_thresh
),
AV_OPT_TYPE_DOUBLE
,
{.
dbl
=
-
70
.},
-
99
.,
0
.,
FLAGS
},
{
"offset"
,
"set offset gain"
,
OFFSET
(
offset
),
AV_OPT_TYPE_DOUBLE
,
{.
dbl
=
0
.},
-
99
.,
99
.,
FLAGS
},
{
"linear"
,
"normalize linearly if possible"
,
OFFSET
(
linear
),
AV_OPT_TYPE_BOOL
,
{.
i64
=
1
},
0
,
1
,
FLAGS
},
{
"dual_mono"
,
"treat mono input as dual-mono"
,
OFFSET
(
dual_mono
),
AV_OPT_TYPE_BOOL
,
{.
i64
=
0
},
0
,
1
,
FLAGS
},
{
"print_format"
,
"set print format for stats"
,
OFFSET
(
print_format
),
AV_OPT_TYPE_INT
,
{.
i64
=
NONE
},
NONE
,
PF_NB
-
1
,
FLAGS
,
"print_format"
},
{
"none"
,
0
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
NONE
},
0
,
0
,
FLAGS
,
"print_format"
},
{
"json"
,
0
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
JSON
},
0
,
0
,
FLAGS
,
"print_format"
},
...
...
@@ -731,6 +733,11 @@ static int config_input(AVFilterLink *inlink)
if
(
!
s
->
r128_out
)
return
AVERROR
(
ENOMEM
);
if
(
inlink
->
channels
==
1
&&
s
->
dual_mono
)
{
ebur128_set_channel
(
s
->
r128_in
,
0
,
EBUR128_DUAL_MONO
);
ebur128_set_channel
(
s
->
r128_out
,
0
,
EBUR128_DUAL_MONO
);
}
s
->
buf_size
=
frame_size
(
inlink
->
sample_rate
,
3000
)
*
inlink
->
channels
;
s
->
buf
=
av_malloc_array
(
s
->
buf_size
,
sizeof
(
*
s
->
buf
));
if
(
!
s
->
buf
)
...
...
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