From 96c8f92883322a785fa9fa55de93b8eb56afab64 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 22 Aug 2006 22:00:58 -0400 Subject: [PATCH] [test] bufferdiff: take abs of the pixel diffs. Oops! --- test/buffer-diff.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/buffer-diff.c b/test/buffer-diff.c index 5463c2987..45942c498 100644 --- a/test/buffer-diff.c +++ b/test/buffer-diff.c @@ -28,6 +28,7 @@ #endif #include +#include #ifdef HAVE_UNISTD_H #include #endif @@ -93,7 +94,7 @@ buffer_diff_core (unsigned char *_buf_a, unsigned char value_a = (row_a[x] >> (channel*8)); unsigned char value_b = (row_b[x] >> (channel*8)); unsigned int diff; - diff = value_a - value_b; + diff = abs (value_a - value_b); diff *= 4; /* emphasize */ if (diff > 255) diff = 255;