Simplify initialization code (we don't have to explicitly initialize a component to 0, because the whole buffer has already been initialized to 0)

git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@621 632fc199-4ca6-4c93-a231-07263d6284db
This commit is contained in:
DRC
2011-05-23 05:50:07 +00:00
parent f962fbb44a
commit 9792ce8947

View File

@@ -121,15 +121,17 @@ void initBuf(unsigned char *buf, int w, int h, int pf, int flags)
else index=row*w+col;
if(((row/8)+(col/8))%2==0)
{
buf[index*ps+roffset]=(row<halfway)? 255:0;
buf[index*ps+goffset]=(row<halfway)? 255:0;
buf[index*ps+boffset]=(row<halfway)? 255:0;
if(row<halfway)
{
buf[index*ps+roffset]=255;
buf[index*ps+goffset]=255;
buf[index*ps+boffset]=255;
}
}
else
{
buf[index*ps+roffset]=(row<halfway)? 255:255;
buf[index*ps+goffset]=(row<halfway)? 0:255;
buf[index*ps+boffset]=0;
buf[index*ps+roffset]=255;
if(row>=halfway) buf[index*ps+goffset]=255;
}
}
}