[FFmpeg-cvslog] avfilter/af_afwtdn: add internal timeline support

Paul B Mahol git at videolan.org
Sun Oct 3 14:08:04 EEST 2021


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Sun Oct  3 13:04:17 2021 +0200| [9fbe54e4b2db1deef8475713bddadbbd7918c984] | committer: Paul B Mahol

avfilter/af_afwtdn: add internal timeline support

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9fbe54e4b2db1deef8475713bddadbbd7918c984
---

 libavfilter/af_afwtdn.c | 6 ++++--
 1 file 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,
 };



More information about the ffmpeg-cvslog mailing list