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

Unified Diff: tjbench.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 | « simd/jsimdcfg.inc.h ('k') | tjunittest.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tjbench.c
===================================================================
--- tjbench.c (revision 106486)
+++ tjbench.c (working copy)
@@ -59,6 +59,7 @@
const char *subName[NUMSUBOPT]={"444", "422", "420", "GRAY", "440"};
tjscalingfactor *scalingfactors=NULL, sf={1, 1}; int nsf=0;
int xformop=TJXOP_NONE, xformopt=0;
+int (*customFilter)(short *, tjregion, tjregion, int, int, tjtransform *);
double benchtime=5.0;
@@ -73,6 +74,16 @@
}
+/* Custom DCT filter which produces a negative of the image */
+int dummyDCTFilter(short *coeffs, tjregion arrayRegion, tjregion planeRegion,
+ int componentIndex, int transformIndex, tjtransform *transform)
+{
+ int i;
+ for(i=0; i<arrayRegion.w*arrayRegion.h; i++) coeffs[i]=-coeffs[i];
+ return 0;
+}
+
+
/* Decompression test */
int decomptest(unsigned char *srcbuf, unsigned char **jpegbuf,
unsigned long *jpegsize, unsigned char *dstbuf, int w, int h,
@@ -458,7 +469,7 @@
int w=0, h=0, subsamp=-1, _w, _h, _tilew, _tileh,
_ntilesw, _ntilesh, _subsamp;
char *temp=NULL, tempstr[80], tempstr2[80];
- int row, col, i, tilew, tileh, ntilesw, ntilesh, retval=0;
+ int row, col, i, tilew, tileh, ntilesw=1, ntilesh=1, retval=0;
double start, elapsed;
int ps=tjPixelSize[pf], tile;
@@ -534,7 +545,7 @@
}
_subsamp=subsamp;
- if(dotile || xformop!=TJXOP_NONE || xformopt!=0)
+ if(dotile || xformop!=TJXOP_NONE || xformopt!=0 || customFilter)
{
if((t=(tjtransform *)malloc(sizeof(tjtransform)*ntilesw*ntilesh))
==NULL)
@@ -568,6 +579,11 @@
t[tile].r.y=row*_tileh;
t[tile].op=xformop;
t[tile].options=xformopt|TJXOPT_TRIM;
+ t[tile].customFilter=customFilter;
+ if(t[tile].options&TJXOPT_NOOUTPUT && jpegbuf[tile])
+ {
+ free(jpegbuf[tile]); jpegbuf[tile]=NULL;
+ }
}
}
@@ -611,9 +627,13 @@
if(w==tilew) _tilew=_w;
if(h==tileh) _tileh=_h;
- if(decomptest(NULL, jpegbuf, jpegsize, NULL, _w, _h, _subsamp, 0,
- filename, _tilew, _tileh)==-1)
- goto bailout;
+ if(!(xformopt&TJXOPT_NOOUTPUT))
+ {
+ if(decomptest(NULL, jpegbuf, jpegsize, NULL, _w, _h, _subsamp, 0,
+ filename, _tilew, _tileh)==-1)
+ goto bailout;
+ }
+ else if(quiet==1) printf("N/A\n");
for(i=0; i<ntilesw*ntilesh; i++)
{
@@ -809,6 +829,8 @@
if(!strcasecmp(argv[i], "-rot180")) xformop=TJXOP_ROT180;
if(!strcasecmp(argv[i], "-rot270")) xformop=TJXOP_ROT270;
if(!strcasecmp(argv[i], "-grayscale")) xformopt|=TJXOPT_GRAY;
+ if(!strcasecmp(argv[i], "-custom")) customFilter=dummyDCTFilter;
+ if(!strcasecmp(argv[i], "-nooutput")) xformopt|=TJXOPT_NOOUTPUT;
if(!strcasecmp(argv[i], "-benchtime") && i<argc-1)
{
double temp=atof(argv[++i]);
« no previous file with comments | « simd/jsimdcfg.inc.h ('k') | tjunittest.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698