From d601e7a77230e07b98da768bc8d8afe90af71978 Mon Sep 17 00:00:00 2001 From: stan Date: Fri, 4 Jul 2003 09:38:15 +0000 Subject: [PATCH] Fixed nasty Y conversion bug. git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@591 e3e1d417-86f3-4887-817a-d78f3d33393f --- src/zm_image.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/zm_image.cpp b/src/zm_image.cpp index ea208b473..070135c49 100644 --- a/src/zm_image.cpp +++ b/src/zm_image.cpp @@ -464,7 +464,7 @@ Image *Image::Delta( const Image &image ) const } else { - static unsigned char red, green, blue; + static long red, green, blue; while( psrc < (buffer+size) ) { if ( ZM_FAST_RGB_DIFFS ) @@ -490,6 +490,7 @@ Image *Image::Delta( const Image &image ) const // to YUV conversion. Should still be integer but a bit slower *pdiff++ = abs(((19595*red)>>16) + ((37159*green)>>16) + ((7471*blue)>>16)); + //Info(( "R1:%d, R2:%d, G1:%d, G2:%d, B1:%d, B2:%d, DR: %d, DG: %d, DB: %d, Diff = %d", *(psrc-3), *(pref-3), *(psrc-2), *(pref-2), *(psrc-1), *(pref-1), ((19595*red)>>16), ((37159*green)>>16), ((7471*blue)>>16), *(pdiff-1) )); } } }