]> git.sesse.net Git - ffmpeg/commitdiff
avfilter/vf_vaguedenoiser: remove excessive code from soft thresholding
authorPaul B Mahol <onemda@gmail.com>
Sun, 7 Jun 2020 11:12:34 +0000 (13:12 +0200)
committerPaul B Mahol <onemda@gmail.com>
Sun, 7 Jun 2020 13:20:11 +0000 (15:20 +0200)
libavfilter/vf_vaguedenoiser.c

index 023bd5d16ab7eb13f686a6b42a9d30935283408e..e3d4d30f25e2c1c6c1ef2a792866fc51cb2823f4 100644 (file)
@@ -352,18 +352,10 @@ static void soft_thresholding(float *block, const int width, const int height, c
 {
     const float frac = 1.f - percent * 0.01f;
     const float shift = threshold * 0.01f * percent;
-    int w = width;
-    int h = height;
-    int y, x, l;
-
-    for (l = 0; l < nsteps; l++) {
-        w = (w + 1) >> 1;
-        h = (h + 1) >> 1;
-    }
+    int y, x;
 
     for (y = 0; y < height; y++) {
-        const int x0 = (y < h) ? w : 0;
-        for (x = x0; x < width; x++) {
+        for (x = 0; x < width; x++) {
             const float temp = FFABS(block[x]);
             if (temp <= threshold)
                 block[x] *= frac;