summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2022-02-27 12:00:21 +0100
committerPaul B Mahol <onemda@gmail.com>2022-02-27 12:04:21 +0100
commit0d0002cd20b496c96d659b21b7cd462a100ebbc9 (patch)
tree9d7cd310441c19e3bde91215d949f4fc4f539257
parent592cef61353b1712745a121c68df0c26178db86c (diff)
avfilter/af_afftdn: add more verbose options aliases
-rw-r--r--doc/filters.texi32
-rw-r--r--libavfilter/af_afftdn.c15
2 files changed, 31 insertions, 16 deletions
diff --git a/doc/filters.texi b/doc/filters.texi
index 0650879cfa..25a11fcd10 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -1282,64 +1282,64 @@ Denoise audio samples with FFT.
A description of the accepted parameters follows.
@table @option
-@item nr
+@item noise_reduction, nr
Set the noise reduction in dB, allowed range is 0.01 to 97.
Default value is 12 dB.
-@item nf
+@item noise_floor, nf
Set the noise floor in dB, allowed range is -80 to -20.
Default value is -50 dB.
-@item nt
+@item noise_type, nt
Set the noise type.
It accepts the following values:
@table @option
-@item w
+@item white, w
Select white noise.
-@item v
+@item vinyl, v
Select vinyl noise.
-@item s
+@item shellac, s
Select shellac noise.
-@item c
+@item custom, c
Select custom noise, defined in @code{bn} option.
Default value is white noise.
@end table
-@item bn
+@item band_noise, bn
Set custom band noise for every one of 15 bands.
Bands are separated by ' ' or '|'.
-@item rf
+@item residual_floor, rf
Set the residual floor in dB, allowed range is -80 to -20.
Default value is -38 dB.
-@item tn
+@item track_noise, tn
Enable noise tracking. By default is disabled.
With this enabled, noise floor is automatically adjusted.
-@item tr
+@item track_residual, tr
Enable residual tracking. By default is disabled.
-@item om
+@item output_mode, om
Set the output mode.
It accepts the following values:
@table @option
-@item i
+@item input, i
Pass input unchanged.
-@item o
+@item output, o
Pass noise filtered out.
-@item n
+@item noise, n
Pass only noise.
-Default value is @var{o}.
+Default value is @var{output}.
@end table
@end table
diff --git a/libavfilter/af_afftdn.c b/libavfilter/af_afftdn.c
index 628336b18b..2758ae8a8d 100644
--- a/libavfilter/af_afftdn.c
+++ b/libavfilter/af_afftdn.c
@@ -145,20 +145,35 @@ typedef struct AudioFFTDeNoiseContext {
#define AFR AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_RUNTIME_PARAM
static const AVOption afftdn_options[] = {
+ { "noise_reduction", "set the noise reduction",OFFSET(noise_reduction), AV_OPT_TYPE_FLOAT,{.dbl = 12}, .01, 97, AFR },
{ "nr", "set the noise reduction", OFFSET(noise_reduction), AV_OPT_TYPE_FLOAT, {.dbl = 12}, .01, 97, AFR },
+ { "noise_floor", "set the noise floor",OFFSET(noise_floor), AV_OPT_TYPE_FLOAT, {.dbl =-50}, -80,-20, AFR },
{ "nf", "set the noise floor", OFFSET(noise_floor), AV_OPT_TYPE_FLOAT, {.dbl =-50}, -80,-20, AFR },
+ { "noise_type", "set the noise type", OFFSET(noise_type), AV_OPT_TYPE_INT, {.i64 = WHITE_NOISE}, WHITE_NOISE, NB_NOISE-1, AF, "type" },
{ "nt", "set the noise type", OFFSET(noise_type), AV_OPT_TYPE_INT, {.i64 = WHITE_NOISE}, WHITE_NOISE, NB_NOISE-1, AF, "type" },
+ { "white", "white noise", 0, AV_OPT_TYPE_CONST, {.i64 = WHITE_NOISE}, 0, 0, AF, "type" },
{ "w", "white noise", 0, AV_OPT_TYPE_CONST, {.i64 = WHITE_NOISE}, 0, 0, AF, "type" },
+ { "vinyl", "vinyl noise", 0, AV_OPT_TYPE_CONST, {.i64 = VINYL_NOISE}, 0, 0, AF, "type" },
{ "v", "vinyl noise", 0, AV_OPT_TYPE_CONST, {.i64 = VINYL_NOISE}, 0, 0, AF, "type" },
+ { "shellac", "shellac noise", 0, AV_OPT_TYPE_CONST, {.i64 = SHELLAC_NOISE}, 0, 0, AF, "type" },
{ "s", "shellac noise", 0, AV_OPT_TYPE_CONST, {.i64 = SHELLAC_NOISE}, 0, 0, AF, "type" },
+ { "custom", "custom noise", 0, AV_OPT_TYPE_CONST, {.i64 = CUSTOM_NOISE}, 0, 0, AF, "type" },
{ "c", "custom noise", 0, AV_OPT_TYPE_CONST, {.i64 = CUSTOM_NOISE}, 0, 0, AF, "type" },
+ { "band_noise", "set the custom bands noise", OFFSET(band_noise_str), AV_OPT_TYPE_STRING, {.str = 0}, 0, 0, AF },
{ "bn", "set the custom bands noise", OFFSET(band_noise_str), AV_OPT_TYPE_STRING, {.str = 0}, 0, 0, AF },
+ { "residual_floor", "set the residual floor",OFFSET(residual_floor), AV_OPT_TYPE_FLOAT, {.dbl =-38}, -80,-20, AFR },
{ "rf", "set the residual floor", OFFSET(residual_floor), AV_OPT_TYPE_FLOAT, {.dbl =-38}, -80,-20, AFR },
+ { "track_noise", "track noise", OFFSET(track_noise), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, AFR },
{ "tn", "track noise", OFFSET(track_noise), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, AFR },
+ { "track_residuals", "track residual",OFFSET(track_residual), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, AFR },
{ "tr", "track residual", OFFSET(track_residual), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, AFR },
+ { "output_mode", "set output mode", OFFSET(output_mode), AV_OPT_TYPE_INT, {.i64 = OUT_MODE}, 0, NB_MODES-1, AFR, "mode" },
{ "om", "set output mode", OFFSET(output_mode), AV_OPT_TYPE_INT, {.i64 = OUT_MODE}, 0, NB_MODES-1, AFR, "mode" },
+ { "input", "input", 0, AV_OPT_TYPE_CONST, {.i64 = IN_MODE}, 0, 0, AFR, "mode" },
{ "i", "input", 0, AV_OPT_TYPE_CONST, {.i64 = IN_MODE}, 0, 0, AFR, "mode" },
+ { "output", "output", 0, AV_OPT_TYPE_CONST, {.i64 = OUT_MODE}, 0, 0, AFR, "mode" },
{ "o", "output", 0, AV_OPT_TYPE_CONST, {.i64 = OUT_MODE}, 0, 0, AFR, "mode" },
+ { "noise", "noise", 0, AV_OPT_TYPE_CONST, {.i64 = NOISE_MODE}, 0, 0, AFR, "mode" },
{ "n", "noise", 0, AV_OPT_TYPE_CONST, {.i64 = NOISE_MODE}, 0, 0, AFR, "mode" },
{ NULL }
};