avfilter/af_afwtdn: add internal timeline support

This commit is contained in:
Paul B Mahol 2021-10-03 13:04:17 +02:00
parent 24e349c74b
commit 9fbe54e4b2

View File

@ -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,
};