Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Unified Diff: tjunittest.c

Issue 8720003: Update libjpeg-turbo to r722. (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/third_party/libjpeg_turbo/
Patch Set: '' Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tjbench.c ('k') | turbojpeg.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tjunittest.c
===================================================================
--- tjunittest.c (revision 106486)
+++ tjunittest.c (working copy)
@@ -68,6 +68,8 @@
"RGB", "BGR", "RGBX", "BGRX", "XBGR", "XRGB", "Grayscale"
};
+const int alphaOffset[TJ_NUMPF] = {-1, -1, 3, 3, 0, 0, -1};
+
const int _3byteFormats[]={TJPF_RGB, TJPF_BGR};
const int _4byteFormats[]={TJPF_RGBX, TJPF_BGRX, TJPF_XBGR, TJPF_XRGB};
const int _onlyGray[]={TJPF_GRAY};
@@ -156,6 +158,7 @@
int roffset=tjRedOffset[pf];
int goffset=tjGreenOffset[pf];
int boffset=tjBlueOffset[pf];
+ int aoffset=alphaOffset[pf];
int ps=tjPixelSize[pf];
int index, row, col, retval=1;
int halfway=16*sf.num/sf.denom;
@@ -165,12 +168,13 @@
{
for(col=0; col<w; col++)
{
- unsigned char r, g, b;
+ unsigned char r, g, b, a;
if(flags&TJFLAG_BOTTOMUP) index=(h-row-1)*w+col;
else index=row*w+col;
r=buf[index*ps+roffset];
g=buf[index*ps+goffset];
b=buf[index*ps+boffset];
+ a=aoffset>=0? buf[index*ps+aoffset]:0xFF;
if(((row/blocksize)+(col/blocksize))%2==0)
{
if(row<halfway)
@@ -207,6 +211,7 @@
}
}
}
+ checkval255(a);
}
}
« no previous file with comments | « tjbench.c ('k') | turbojpeg.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698