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 62931e3..a6422c1 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;
         }