History

avfilter/af_anlms: add support for commands

Paul B Mahol committed 7 years ago

Commit 6023b9f1 parent ffb32d32 files · +22 −1Browse files

Unified · Split

2 files
  1. doc/filters.texi +5 −1
  2. libavfilter/af_anlms.c +17 −0
doc/filters.texi+5−1
@@ -1870,12 +1870,16 @@ Default value is @var{o}. · 1869 unmodified lines
1870@itemize1870@itemize
1871@item1871@item
1872One of many usages of this filter is noise reduction, input audio is filtered1872One of many usages of this filter is noise reduction, input audio is filtered
1873with same samples that are delayed by fixed ammount, one such example for stereo audio is:1873with same samples that are delayed by fixed amount, one such example for stereo audio is:
1874@example1874@example
1875asplit[a][b],[a]adelay=32S|32S[a],[b][a]anlms=order=128:leakage=0.0005:mu=.5:out_mode=o1875asplit[a][b],[a]adelay=32S|32S[a],[b][a]anlms=order=128:leakage=0.0005:mu=.5:out_mode=o
1876@end example1876@end example
1877@end itemize1877@end itemize
1878 1878
1879@subsection Commands
1880
1881This filter supports the same commands as options, excluding option @code{order}.
1882
1879@section anull1883@section anull
1880 1884
1881Pass the audio source unchanged to the output.1885Pass the audio source unchanged to the output.
libavfilter/af_anlms.c+17−0
@@ -281,6 +281,22 @@ static av_cold int init(AVFilterContext *ctx) · 280 unmodified lines
281 return 0;281 return 0;
282}282}
283 283
284static int process_command(AVFilterContext *ctx, const char *cmd, const char *args,
285 char *res, int res_len, int flags)
286{
287 AudioNLMSContext *s = ctx->priv;
288 int ret;
289
290 if ( !strcmp(cmd, "mu") || !strcmp(cmd, "eps")
291 || !strcmp(cmd, "leakage") || !strcmp(cmd, "out_mode")) {
292 ret = av_opt_set(s, cmd, args, 0);
293 } else {
294 ret = AVERROR(ENOSYS);
295 }
296
297 return ret;
298}
299
284static av_cold void uninit(AVFilterContext *ctx)300static av_cold void uninit(AVFilterContext *ctx)
285{301{
286 AudioNLMSContext *s = ctx->priv;302 AudioNLMSContext *s = ctx->priv;
@@ -325,4 +341,5 @@ AVFilter ff_af_anlms = { · 38 unmodified lines
325 .inputs = inputs,341 .inputs = inputs,
326 .outputs = outputs,342 .outputs = outputs,
327 .flags = AVFILTER_FLAG_SLICE_THREADS,343 .flags = AVFILTER_FLAG_SLICE_THREADS,
344 .process_command = process_command,
328};345};

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t