summaryrefslogtreecommitdiff
path: root/libavfilter/vf_gradfun.c
diff options
context:
space:
mode:
authorClément Bœsch <ubitux@gmail.com>2012-12-05 04:58:03 +0100
committerAnton Khirnov <anton@khirnov.net>2013-03-28 07:58:55 +0100
commit8b9a153ef3673d5847291987fa0dcddeac4a640b (patch)
treed9acbbdc9b06e756f77399066202412270dacea1 /libavfilter/vf_gradfun.c
parentf2a59722d161981c2161ba25f3aea42d65b818f8 (diff)
lavfi/gradfun: do not increment DC pointer for odd values.
First DC is only used once otherwise. This also makes the code consistent with ASM versions. Signed-off-by: Anton Khirnov <anton@khirnov.net>
Diffstat (limited to 'libavfilter/vf_gradfun.c')
-rw-r--r--libavfilter/vf_gradfun.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavfilter/vf_gradfun.c b/libavfilter/vf_gradfun.c
index ca7ef69144..80b7e412e3 100644
--- a/libavfilter/vf_gradfun.c
+++ b/libavfilter/vf_gradfun.c
@@ -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;