avfilter/vf_atadenoise: compensate for small overall brightness loss
authorPaul B Mahol <onemda@gmail.com>
Wed, 16 Oct 2019 11:16:41 +0000 (13:16 +0200)
committerPaul B Mahol <onemda@gmail.com>
Wed, 16 Oct 2019 11:18:47 +0000 (13:18 +0200)
This is very hard to spot.

libavfilter/vf_atadenoise.c

index be7c4e2..21c9bb3 100644 (file)
@@ -169,7 +169,7 @@ static void filter_row##name(const uint8_t *ssrc, uint8_t *ddst,            \
            sum += srcix;                                                    \
        }                                                                    \
                                                                             \
-       dst[x] = sum / (r + l + 1);                                          \
+       dst[x] = (sum + ((r + l + 1) >> 1)) / (r + l + 1);                   \
    }                                                                        \
 }