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
97ddc5d1
Commit
97ddc5d1
authored
Jun 03, 2019
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/af_anlmdn: add support for commands
parent
0b7bfa8a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
0 deletions
+38
-0
filters.texi
doc/filters.texi
+13
-0
af_anlmdn.c
libavfilter/af_anlmdn.c
+25
-0
No files found.
doc/filters.texi
View file @
97ddc5d1
...
...
@@ -1806,6 +1806,19 @@ Default value is @var{o}.
Set smooth factor. Default value is @var{11}. Allowed range is from @var{1} to @var{15}.
@end table
@subsection Commands
This filter supports the following commands:
@table @option
@item s
Change denoise strength. Argument is single float number.
Syntax for the command is : "@var{s}"
@item o
Change output mode.
Syntax for the command is : "i", "o" or "n" string.
@end table
@section anull
Pass the audio source unchanged to the output.
...
...
libavfilter/af_anlmdn.c
View file @
97ddc5d1
...
...
@@ -22,6 +22,7 @@
#include "libavutil/avassert.h"
#include "libavutil/audio_fifo.h"
#include "libavutil/avstring.h"
#include "libavutil/opt.h"
#include "avfilter.h"
#include "audio.h"
...
...
@@ -338,6 +339,29 @@ static av_cold void uninit(AVFilterContext *ctx)
av_frame_free
(
&
s
->
cache
);
}
static
int
process_command
(
AVFilterContext
*
ctx
,
const
char
*
cmd
,
const
char
*
args
,
char
*
res
,
int
res_len
,
int
flags
)
{
AudioNLMeansContext
*
s
=
ctx
->
priv
;
if
(
!
strcmp
(
cmd
,
"s"
))
{
float
a
;
if
(
av_sscanf
(
args
,
"%f"
,
&
a
)
==
1
)
s
->
a
=
av_clipf
(
a
,
0
.
00001
,
10
);
}
else
if
(
!
strcmp
(
cmd
,
"o"
))
{
if
(
!
strcmp
(
args
,
"i"
))
{
s
->
om
=
IN_MODE
;
}
else
if
(
!
strcmp
(
args
,
"o"
))
{
s
->
om
=
OUT_MODE
;
}
else
if
(
!
strcmp
(
args
,
"n"
))
{
s
->
om
=
NOISE_MODE
;
}
}
return
0
;
}
static
const
AVFilterPad
inputs
[]
=
{
{
.
name
=
"default"
,
...
...
@@ -366,6 +390,7 @@ AVFilter ff_af_anlmdn = {
.
uninit
=
uninit
,
.
inputs
=
inputs
,
.
outputs
=
outputs
,
.
process_command
=
process_command
,
.
flags
=
AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL
|
AVFILTER_FLAG_SLICE_THREADS
,
};
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