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
7a6d88ee
Commit
7a6d88ee
authored
Oct 10, 2018
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/af_afir: remove again option, merge it with gtype
parent
a628fa1f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
38 deletions
+39
-38
filters.texi
doc/filters.texi
+5
-4
af_afir.c
libavfilter/af_afir.c
+34
-33
af_afir.h
libavfilter/af_afir.h
+0
-1
No files found.
doc/filters.texi
View file @
7a6d88ee
...
@@ -1173,14 +1173,15 @@ Set wet gain. This sets final output gain.
...
@@ -1173,14 +1173,15 @@ Set wet gain. This sets final output gain.
@
item
length
@
item
length
Set
Impulse
Response
filter
length
.
Default
is
1
,
which
means
whole
IR
is
processed
.
Set
Impulse
Response
filter
length
.
Default
is
1
,
which
means
whole
IR
is
processed
.
@
item
again
Enable
applying
gain
measured
from
power
of
IR
.
For
approach
to
use
for
measuring
power
of
IR
see
next
option
.
@
item
gtype
@
item
gtype
Enable
applying
gain
measured
from
power
of
IR
.
Set
which
approach
to
use
for
auto
gain
measurement
.
Set
which
approach
to
use
for
auto
gain
measurement
.
@
table
@
option
@
table
@
option
@
item
none
Do
not
apply
any
gain
.
@
item
peak
@
item
peak
select
peak
gain
,
very
conservative
approach
.
This
is
default
value
.
select
peak
gain
,
very
conservative
approach
.
This
is
default
value
.
...
...
libavfilter/af_afir.c
View file @
7a6d88ee
...
@@ -335,38 +335,39 @@ static int convert_coeffs(AVFilterContext *ctx)
...
@@ -335,38 +335,39 @@ static int convert_coeffs(AVFilterContext *ctx)
s
->
gain
=
1
;
s
->
gain
=
1
;
if
(
s
->
again
)
{
switch
(
s
->
gtype
)
{
switch
(
s
->
gtype
)
{
case
-
1
:
case
0
:
/* nothinkg to do */
for
(
ch
=
0
;
ch
<
ctx
->
inputs
[
1
]
->
channels
;
ch
++
)
{
break
;
float
*
time
=
(
float
*
)
s
->
in
[
1
]
->
extended_data
[
!
s
->
one2many
*
ch
];
case
0
:
for
(
ch
=
0
;
ch
<
ctx
->
inputs
[
1
]
->
channels
;
ch
++
)
{
for
(
i
=
0
;
i
<
s
->
nb_taps
;
i
++
)
float
*
time
=
(
float
*
)
s
->
in
[
1
]
->
extended_data
[
!
s
->
one2many
*
ch
];
power
+=
FFABS
(
time
[
i
]);
}
for
(
i
=
0
;
i
<
s
->
nb_taps
;
i
++
)
s
->
gain
=
ctx
->
inputs
[
1
]
->
channels
/
power
;
power
+=
FFABS
(
time
[
i
]);
break
;
}
case
1
:
s
->
gain
=
ctx
->
inputs
[
1
]
->
channels
/
power
;
for
(
ch
=
0
;
ch
<
ctx
->
inputs
[
1
]
->
channels
;
ch
++
)
{
break
;
float
*
time
=
(
float
*
)
s
->
in
[
1
]
->
extended_data
[
!
s
->
one2many
*
ch
];
case
1
:
for
(
ch
=
0
;
ch
<
ctx
->
inputs
[
1
]
->
channels
;
ch
++
)
{
for
(
i
=
0
;
i
<
s
->
nb_taps
;
i
++
)
float
*
time
=
(
float
*
)
s
->
in
[
1
]
->
extended_data
[
!
s
->
one2many
*
ch
];
power
+=
time
[
i
];
}
for
(
i
=
0
;
i
<
s
->
nb_taps
;
i
++
)
s
->
gain
=
ctx
->
inputs
[
1
]
->
channels
/
power
;
power
+=
time
[
i
];
break
;
case
2
:
for
(
ch
=
0
;
ch
<
ctx
->
inputs
[
1
]
->
channels
;
ch
++
)
{
float
*
time
=
(
float
*
)
s
->
in
[
1
]
->
extended_data
[
!
s
->
one2many
*
ch
];
for
(
i
=
0
;
i
<
s
->
nb_taps
;
i
++
)
power
+=
time
[
i
]
*
time
[
i
];
}
s
->
gain
=
sqrtf
(
ch
/
power
);
break
;
default:
return
AVERROR_BUG
;
}
}
s
->
gain
=
ctx
->
inputs
[
1
]
->
channels
/
power
;
break
;
case
2
:
for
(
ch
=
0
;
ch
<
ctx
->
inputs
[
1
]
->
channels
;
ch
++
)
{
float
*
time
=
(
float
*
)
s
->
in
[
1
]
->
extended_data
[
!
s
->
one2many
*
ch
];
for
(
i
=
0
;
i
<
s
->
nb_taps
;
i
++
)
power
+=
time
[
i
]
*
time
[
i
];
}
s
->
gain
=
sqrtf
(
ch
/
power
);
break
;
default:
return
AVERROR_BUG
;
}
}
s
->
gain
=
FFMIN
(
s
->
gain
*
s
->
ir_gain
,
1
.
f
);
s
->
gain
=
FFMIN
(
s
->
gain
*
s
->
ir_gain
,
1
.
f
);
...
@@ -738,8 +739,8 @@ static const AVOption afir_options[] = {
...
@@ -738,8 +739,8 @@ static const AVOption afir_options[] = {
{
"dry"
,
"set dry gain"
,
OFFSET
(
dry_gain
),
AV_OPT_TYPE_FLOAT
,
{.
dbl
=
1
},
0
,
10
,
AF
},
{
"dry"
,
"set dry gain"
,
OFFSET
(
dry_gain
),
AV_OPT_TYPE_FLOAT
,
{.
dbl
=
1
},
0
,
10
,
AF
},
{
"wet"
,
"set wet gain"
,
OFFSET
(
wet_gain
),
AV_OPT_TYPE_FLOAT
,
{.
dbl
=
1
},
0
,
10
,
AF
},
{
"wet"
,
"set wet gain"
,
OFFSET
(
wet_gain
),
AV_OPT_TYPE_FLOAT
,
{.
dbl
=
1
},
0
,
10
,
AF
},
{
"length"
,
"set IR length"
,
OFFSET
(
length
),
AV_OPT_TYPE_FLOAT
,
{.
dbl
=
1
},
0
,
1
,
AF
},
{
"length"
,
"set IR length"
,
OFFSET
(
length
),
AV_OPT_TYPE_FLOAT
,
{.
dbl
=
1
},
0
,
1
,
AF
},
{
"
again"
,
"enable auto gain"
,
OFFSET
(
again
),
AV_OPT_TYPE_BOOL
,
{.
i64
=
1
},
0
,
1
,
AF
},
{
"
gtype"
,
"set IR auto gain type"
,
OFFSET
(
gtype
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
-
1
,
2
,
AF
,
"gtype"
},
{
"gtype"
,
"set auto gain type"
,
OFFSET
(
gtype
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
0
,
2
,
AF
,
"gtype"
},
{
"none"
,
"without auto gain"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=-
1
},
0
,
0
,
AF
,
"gtype"
},
{
"peak"
,
"peak gain"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
0
},
0
,
0
,
AF
,
"gtype"
},
{
"peak"
,
"peak gain"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
0
},
0
,
0
,
AF
,
"gtype"
},
{
"dc"
,
"DC gain"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
1
},
0
,
0
,
AF
,
"gtype"
},
{
"dc"
,
"DC gain"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
1
},
0
,
0
,
AF
,
"gtype"
},
{
"gn"
,
"gain to noise"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
2
},
0
,
0
,
AF
,
"gtype"
},
{
"gn"
,
"gain to noise"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
2
},
0
,
0
,
AF
,
"gtype"
},
...
...
libavfilter/af_afir.h
View file @
7a6d88ee
...
@@ -38,7 +38,6 @@ typedef struct AudioFIRContext {
...
@@ -38,7 +38,6 @@ typedef struct AudioFIRContext {
float
wet_gain
;
float
wet_gain
;
float
dry_gain
;
float
dry_gain
;
float
length
;
float
length
;
int
again
;
int
gtype
;
int
gtype
;
float
ir_gain
;
float
ir_gain
;
int
ir_format
;
int
ir_format
;
...
...
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