diff options
author | Paul B Mahol <onemda@gmail.com> | 2021-10-03 13:04:17 +0200 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2021-10-03 13:06:57 +0200 |
commit | 9fbe54e4b2db1deef8475713bddadbbd7918c984 (patch) | |
tree | dbeb975fef3856a9284a9c39a7ffa3ef45a5b736 /libavfilter/af_afwtdn.c | |
parent | 24e349c74badd84edf3096beb39ed081497d4da1 (diff) | |
download | ffmpeg-9fbe54e4b2db1deef8475713bddadbbd7918c984.tar.gz |
avfilter/af_afwtdn: add internal timeline support
Diffstat (limited to 'libavfilter/af_afwtdn.c')
-rw-r--r-- | libavfilter/af_afwtdn.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libavfilter/af_afwtdn.c b/libavfilter/af_afwtdn.c index f7e8211bb4..3eaf26a7c3 100644 --- a/libavfilter/af_afwtdn.c +++ b/libavfilter/af_afwtdn.c @@ -998,6 +998,7 @@ static int filter_channel(AVFilterContext *ctx, void *arg, int ch, int nb_jobs) is_noise *= in->sample_rate; is_noise /= s->nb_samples; for (int level = 0; level <= s->levels; level++) { + const double percent = ctx->is_disabled ? 0. : s->percent; const int length = cp->output_length[level]; const double scale = sqrt(2.0 * log(length)); @@ -1008,7 +1009,7 @@ static int filter_channel(AVFilterContext *ctx, void *arg, int ch, int nb_jobs) noise_filter(stddev[level], cp->output_coefs[level], filter, absmean[level], s->softness, new_stddev[level], length); - denoise_level(cp->filter_coefs[level], cp->output_coefs[level], filter, s->percent, length); + denoise_level(cp->filter_coefs[level], cp->output_coefs[level], filter, percent, length); } ret = inverse(s, cp->filter_coefs, cp->filter_length, dst, out->nb_samples, ch, s->sn); @@ -1332,5 +1333,6 @@ const AVFilter ff_af_afwtdn = { FILTER_INPUTS(inputs), FILTER_OUTPUTS(outputs), .process_command = process_command, - .flags = AVFILTER_FLAG_SLICE_THREADS, + .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL | + AVFILTER_FLAG_SLICE_THREADS, }; |