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
2a801e88
Commit
2a801e88
authored
Jul 08, 2019
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/af_aiir: implement mix option
parent
034a9d25
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
0 deletions
+10
-0
filters.texi
doc/filters.texi
+4
-0
af_aiir.c
libavfilter/af_aiir.c
+6
-0
No files found.
doc/filters.texi
View file @
2a801e88
...
...
@@ -1409,6 +1409,10 @@ single-precision floating-point
16
-
bit
integers
@
end
table
@
item
mix
How
much
to
use
filtered
signal
in
output
.
Default
is
1.
Range
is
between
0
and
1.
@
item
response
Show
IR
frequency
response
,
magnitude
and
phase
in
additional
video
stream
.
By
default
it
is
disabled
.
...
...
libavfilter/af_aiir.c
View file @
2a801e88
...
...
@@ -57,6 +57,7 @@ typedef struct AudioIIRContext {
const
AVClass
*
class
;
char
*
a_str
,
*
b_str
,
*
g_str
;
double
dry_gain
,
wet_gain
;
double
mix
;
int
format
;
int
process
;
int
precision
;
...
...
@@ -124,6 +125,7 @@ static int iir_ch_## name(AVFilterContext *ctx, void *arg, int ch, int nb_jobs)
AudioIIRContext *s = ctx->priv; \
const double ig = s->dry_gain; \
const double og = s->wet_gain; \
const double mix = s->mix; \
ThreadData *td = arg; \
AVFrame *in = td->in, *out = td->out; \
const type *src = (const type *)in->extended_data[ch]; \
...
...
@@ -152,6 +154,7 @@ static int iir_ch_## name(AVFilterContext *ctx, void *arg, int ch, int nb_jobs)
\
oc[0] = sample; \
sample *= og; \
sample = sample * mix + ic[0] * (1. - mix); \
if (need_clipping && sample < min) { \
(*clippings)++; \
dst[n] = min; \
...
...
@@ -177,6 +180,7 @@ static int iir_ch_serial_## name(AVFilterContext *ctx, void *arg, int ch, int nb
AudioIIRContext *s = ctx->priv; \
const double ig = s->dry_gain; \
const double og = s->wet_gain; \
const double mix = s->mix; \
ThreadData *td = arg; \
AVFrame *in = td->in, *out = td->out; \
const type *src = (const type *)in->extended_data[ch]; \
...
...
@@ -207,6 +211,7 @@ static int iir_ch_serial_## name(AVFilterContext *ctx, void *arg, int ch, int nb
o1 = o0; \
o0 *= og; \
\
o0 = o0 * mix + (1. - mix) * sample; \
if (need_clipping && o0 < min) { \
(*clippings)++; \
dst[n] = min; \
...
...
@@ -1074,6 +1079,7 @@ static const AVOption aiir_options[] = {
{
"flt"
,
"single-precision floating-point"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
1
},
0
,
0
,
AF
,
"precision"
},
{
"i32"
,
"32-bit integers"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
2
},
0
,
0
,
AF
,
"precision"
},
{
"i16"
,
"16-bit integers"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
3
},
0
,
0
,
AF
,
"precision"
},
{
"mix"
,
"set mix"
,
OFFSET
(
mix
),
AV_OPT_TYPE_DOUBLE
,
{.
dbl
=
1
},
0
,
1
,
AF
},
{
"response"
,
"show IR frequency response"
,
OFFSET
(
response
),
AV_OPT_TYPE_BOOL
,
{.
i64
=
0
},
0
,
1
,
VF
},
{
"channel"
,
"set IR channel to display frequency response"
,
OFFSET
(
ir_channel
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
0
,
1024
,
VF
},
{
"size"
,
"set video size"
,
OFFSET
(
w
),
AV_OPT_TYPE_IMAGE_SIZE
,
{.
str
=
"hd720"
},
0
,
0
,
VF
},
...
...
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