]> git.sesse.net Git - ffmpeg/commitdiff
lavfi/gradfun: do not increment DC pointer for odd values.
authorClément Bœsch <ubitux@gmail.com>
Wed, 5 Dec 2012 03:58:03 +0000 (04:58 +0100)
committerAnton Khirnov <anton@khirnov.net>
Thu, 28 Mar 2013 06:58:55 +0000 (07:58 +0100)
First DC is only used once otherwise. This also makes the code
consistent with ASM versions.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
libavfilter/vf_gradfun.c

index ca7ef69144bfef4a3b79b74030d4aa7dabdc8398..80b7e412e31ecb467978752ab63ed60da0ac975c 100644 (file)
@@ -56,7 +56,7 @@ DECLARE_ALIGNED(16, static const uint16_t, dither)[8][8] = {
 void ff_gradfun_filter_line_c(uint8_t *dst, uint8_t *src, uint16_t *dc, int width, int thresh, const uint16_t *dithers)
 {
     int x;
-    for (x = 0; x < width; x++, dc += x & 1) {
+    for (x = 0; x < width; dc += x & 1, x++) {
         int pix = src[x] << 7;
         int delta = dc[0] - pix;
         int m = abs(delta) * thresh >> 16;