]> git.sesse.net Git - ffmpeg/commitdiff
avfilter/af_anlmdn: ignore too small values
authorPaul B Mahol <onemda@gmail.com>
Wed, 9 Jan 2019 20:00:16 +0000 (21:00 +0100)
committerPaul B Mahol <onemda@gmail.com>
Wed, 9 Jan 2019 20:16:34 +0000 (21:16 +0100)
libavfilter/af_anlmdn.c

index 62931e37cc430e13ab1e8a51b922d797d8cc3964..a6422c1748ab91f3299dfca052ec40f2b0e0ebf4 100644 (file)
@@ -168,7 +168,10 @@ static int filter_channel(AVFilterContext *ctx, void *arg, int ch, int nb_jobs)
             float w;
 
             av_assert0(distance >= 0.f);
-            w = expf(-distance * sw);
+            w = -distance * sw;
+            if (w < -11.f)
+                continue;
+            w = expf(w);
             P += w * f[i - S + j + (j >= S)];
             Q += w;
         }