Fixed nasty Y conversion bug.

git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@591 e3e1d417-86f3-4887-817a-d78f3d33393f
This commit is contained in:
stan 2003-07-04 09:38:15 +00:00
parent e228d5ffbe
commit d601e7a772
1 changed files with 2 additions and 1 deletions

View File

@ -464,7 +464,7 @@ Image *Image::Delta( const Image &image ) const
} }
else else
{ {
static unsigned char red, green, blue; static long red, green, blue;
while( psrc < (buffer+size) ) while( psrc < (buffer+size) )
{ {
if ( ZM_FAST_RGB_DIFFS ) 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 // to YUV conversion. Should still be integer but a bit slower
*pdiff++ = abs(((19595*red)>>16) + ((37159*green)>>16) + ((7471*blue)>>16)); *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) ));
} }
} }
} }