[FFmpeg-cvslog] avfilter/af_anlmdn: do not trim first samples

Paul B Mahol git at videolan.org
Fri Jan 11 12:56:21 EET 2019


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Fri Jan 11 11:23:59 2019 +0100| [b5ae61d2c0ae3b7609bfc896d71b88bdba76e7b3] | committer: Paul B Mahol

avfilter/af_anlmdn: do not trim first samples

Instead denoise from start, assumming missing samples are silence.

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

 libavfilter/af_anlmdn.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavfilter/af_anlmdn.c b/libavfilter/af_anlmdn.c
index cc7765702b..efc261e16a 100644
--- a/libavfilter/af_anlmdn.c
+++ b/libavfilter/af_anlmdn.c
@@ -135,6 +135,7 @@ static int config_output(AVFilterLink *outlink)
 {
     AVFilterContext *ctx = outlink->src;
     AudioNLMeansContext *s = ctx->priv;
+    int ret;
 
     s->K = av_rescale(s->pd, outlink->sample_rate, AV_TIME_BASE);
     s->S = av_rescale(s->rd, outlink->sample_rate, AV_TIME_BASE);
@@ -159,6 +160,10 @@ static int config_output(AVFilterLink *outlink)
     if (!s->fifo)
         return AVERROR(ENOMEM);
 
+    ret = av_audio_fifo_write(s->fifo, (void **)s->in->extended_data, s->K + s->S);
+    if (ret < 0)
+        return ret;
+
     s->pdiff_lut_scale = 1.f / MAX_DIFF * WEIGHT_LUT_SIZE;
     for (int i = 0; i < WEIGHT_LUT_SIZE; i++) {
         float w = -i / s->pdiff_lut_scale;



More information about the ffmpeg-cvslog mailing list