Implement "ultra quiet mode" for generating output that is easy to copy/paste into a spreadsheet
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@417 632fc199-4ca6-4c93-a231-07263d6284db
This commit is contained in:
22
jpgtest.c
22
jpgtest.c
@@ -262,7 +262,7 @@ void dotest(unsigned char *srcbuf, int w, int h, int jpegsub, int qual,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Compression test
|
// Compression test
|
||||||
if(quiet) printf("%s\t%s\t%s\t%d\t", _pfname[pf], bu?"BU":"TD",
|
if(quiet==1) printf("%s\t%s\t%s\t%d\t", _pfname[pf], bu?"BU":"TD",
|
||||||
_subnamel[jpegsub], qual);
|
_subnamel[jpegsub], qual);
|
||||||
for(i=0; i<h; i++) memcpy(&rgbbuf[pitch*i], &srcbuf[w*ps*i], w*ps);
|
for(i=0; i<h; i++) memcpy(&rgbbuf[pitch*i], &srcbuf[w*ps*i], w*ps);
|
||||||
if((hnd=tjInitCompress())==NULL)
|
if((hnd=tjInitCompress())==NULL)
|
||||||
@@ -292,14 +292,17 @@ void dotest(unsigned char *srcbuf, int w, int h, int jpegsub, int qual,
|
|||||||
} while((elapsed=rrtime()-start)<5.);
|
} while((elapsed=rrtime()-start)<5.);
|
||||||
if(tjDestroy(hnd)==-1) _throwtj("executing tjDestroy()");
|
if(tjDestroy(hnd)==-1) _throwtj("executing tjDestroy()");
|
||||||
hnd=NULL;
|
hnd=NULL;
|
||||||
if(quiet)
|
if(quiet==1)
|
||||||
{
|
{
|
||||||
if(tilesizex==w && tilesizey==h) printf("Full \t");
|
if(tilesizex==w && tilesizey==h) printf("Full \t");
|
||||||
else printf("%-4d %-4d\t", tilesizex, tilesizey);
|
else printf("%-4d %-4d\t", tilesizex, tilesizey);
|
||||||
|
}
|
||||||
|
if(quiet)
|
||||||
|
{
|
||||||
printsigfig((double)(w*h)/1000000.*(double)ITER/elapsed, 4);
|
printsigfig((double)(w*h)/1000000.*(double)ITER/elapsed, 4);
|
||||||
printf("\t");
|
printf("%c", quiet==2? '\n':'\t');
|
||||||
printsigfig((double)(w*h*ps)/(double)jpgbufsize, 4);
|
printsigfig((double)(w*h*ps)/(double)jpgbufsize, 4);
|
||||||
printf("\t");
|
printf("%c", quiet==2? '\n':'\t');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -394,9 +397,9 @@ void dodecomptest(char *filename)
|
|||||||
if(tjDestroy(hnd)==-1) _throwtj("executing tjDestroy()");
|
if(tjDestroy(hnd)==-1) _throwtj("executing tjDestroy()");
|
||||||
hnd=NULL;
|
hnd=NULL;
|
||||||
|
|
||||||
if(quiet)
|
if(quiet==1)
|
||||||
{
|
{
|
||||||
printf("All performance values in Mpixels/sec\n\n");
|
printf("\nAll performance values in Mpixels/sec\n\n");
|
||||||
printf("Bitmap\tBitmap\tJPEG\tImage Size\tDecomp\n"),
|
printf("Bitmap\tBitmap\tJPEG\tImage Size\tDecomp\n"),
|
||||||
printf("Format\tOrder\tFormat\t X Y \tPerf\n\n");
|
printf("Format\tOrder\tFormat\t X Y \tPerf\n\n");
|
||||||
printf("%s\t%s\t%s\t%-4d %-4d\t", _pfname[pf], bu?"BU":"TD",
|
printf("%s\t%s\t%s\t%-4d %-4d\t", _pfname[pf], bu?"BU":"TD",
|
||||||
@@ -458,8 +461,6 @@ int main(int argc, char *argv[])
|
|||||||
int qual, hiqual=-1; char *temp;
|
int qual, hiqual=-1; char *temp;
|
||||||
int minarg=2;
|
int minarg=2;
|
||||||
|
|
||||||
printf("\n");
|
|
||||||
|
|
||||||
if(argc<minarg) usage(argv[0]);
|
if(argc<minarg) usage(argv[0]);
|
||||||
|
|
||||||
temp=strrchr(argv[1], '.');
|
temp=strrchr(argv[1], '.');
|
||||||
@@ -539,6 +540,7 @@ int main(int argc, char *argv[])
|
|||||||
if(!stricmp(argv[i], "-argb")) pf=BMP_ARGB;
|
if(!stricmp(argv[i], "-argb")) pf=BMP_ARGB;
|
||||||
if(!stricmp(argv[i], "-bottomup")) bu=1;
|
if(!stricmp(argv[i], "-bottomup")) bu=1;
|
||||||
if(!stricmp(argv[i], "-quiet")) quiet=1;
|
if(!stricmp(argv[i], "-quiet")) quiet=1;
|
||||||
|
if(!stricmp(argv[i], "-qq")) quiet=2;
|
||||||
if(!stricmp(argv[i], "-scale") && i<argc-1)
|
if(!stricmp(argv[i], "-scale") && i<argc-1)
|
||||||
{
|
{
|
||||||
int temp1=0, temp2=0;
|
int temp1=0, temp2=0;
|
||||||
@@ -565,9 +567,9 @@ int main(int argc, char *argv[])
|
|||||||
if(temp!=NULL) *temp='\0';
|
if(temp!=NULL) *temp='\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
if(quiet && !decomponly)
|
if(quiet==1 && !decomponly)
|
||||||
{
|
{
|
||||||
printf("All performance values in Mpixels/sec\n\n");
|
printf("\nAll performance values in Mpixels/sec\n\n");
|
||||||
printf("Bitmap\tBitmap\tJPEG\tJPEG\tTile Size\tCompr\tCompr\tDecomp\n");
|
printf("Bitmap\tBitmap\tJPEG\tJPEG\tTile Size\tCompr\tCompr\tDecomp\n");
|
||||||
printf("Format\tOrder\tFormat\tQual\t X Y \tPerf \tRatio\tPerf\n\n");
|
printf("Format\tOrder\tFormat\tQual\t X Y \tPerf \tRatio\tPerf\n\n");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user