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
6023b9fb
Commit
6023b9fb
authored
Oct 08, 2019
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/af_anlms: add support for commands
parent
ffb32d35
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
1 deletion
+22
-1
filters.texi
doc/filters.texi
+5
-1
af_anlms.c
libavfilter/af_anlms.c
+17
-0
No files found.
doc/filters.texi
View file @
6023b9fb
...
@@ -1870,12 +1870,16 @@ Default value is @var{o}.
...
@@ -1870,12 +1870,16 @@ Default value is @var{o}.
@itemize
@itemize
@item
@item
One of many usages of this filter is noise reduction, input audio is filtered
One of many usages of this filter is noise reduction, input audio is filtered
with same samples that are delayed by fixed am
m
ount, one such example for stereo audio is:
with same samples that are delayed by fixed amount, one such example for stereo audio is:
@example
@example
asplit[a][b],[a]adelay=32S|32S[a],[b][a]anlms=order=128:leakage=0.0005:mu=.5:out_mode=o
asplit[a][b],[a]adelay=32S|32S[a],[b][a]anlms=order=128:leakage=0.0005:mu=.5:out_mode=o
@end example
@end example
@end itemize
@end itemize
@subsection Commands
This filter supports the same commands as options, excluding option @code{order}.
@section anull
@section anull
Pass the audio source unchanged to the output.
Pass the audio source unchanged to the output.
...
...
libavfilter/af_anlms.c
View file @
6023b9fb
...
@@ -281,6 +281,22 @@ static av_cold int init(AVFilterContext *ctx)
...
@@ -281,6 +281,22 @@ static av_cold int init(AVFilterContext *ctx)
return
0
;
return
0
;
}
}
static
int
process_command
(
AVFilterContext
*
ctx
,
const
char
*
cmd
,
const
char
*
args
,
char
*
res
,
int
res_len
,
int
flags
)
{
AudioNLMSContext
*
s
=
ctx
->
priv
;
int
ret
;
if
(
!
strcmp
(
cmd
,
"mu"
)
||
!
strcmp
(
cmd
,
"eps"
)
||
!
strcmp
(
cmd
,
"leakage"
)
||
!
strcmp
(
cmd
,
"out_mode"
))
{
ret
=
av_opt_set
(
s
,
cmd
,
args
,
0
);
}
else
{
ret
=
AVERROR
(
ENOSYS
);
}
return
ret
;
}
static
av_cold
void
uninit
(
AVFilterContext
*
ctx
)
static
av_cold
void
uninit
(
AVFilterContext
*
ctx
)
{
{
AudioNLMSContext
*
s
=
ctx
->
priv
;
AudioNLMSContext
*
s
=
ctx
->
priv
;
...
@@ -325,4 +341,5 @@ AVFilter ff_af_anlms = {
...
@@ -325,4 +341,5 @@ AVFilter ff_af_anlms = {
.
inputs
=
inputs
,
.
inputs
=
inputs
,
.
outputs
=
outputs
,
.
outputs
=
outputs
,
.
flags
=
AVFILTER_FLAG_SLICE_THREADS
,
.
flags
=
AVFILTER_FLAG_SLICE_THREADS
,
.
process_command
=
process_command
,
};
};
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