From: DRC Date: Sat, 19 Feb 2011 18:06:09 +0000 (+0000) Subject: Implement "ultra quiet mode" for generating output that is easy to copy/paste into... X-Git-Tag: 1.1.90~225 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b67c2dce8b6e3ab4b7fde79a1fbd622b33ff5599;p=libjpeg-turbo 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 --- b67c2dce8b6e3ab4b7fde79a1fbd622b33ff5599 diff --cc jpgtest.c index a07a999,3ca6a20..318f9bf --- a/jpgtest.c +++ b/jpgtest.c @@@ -391,18 -342,27 +394,18 @@@ void dodecomptest(char *filename if((hnd=tjInitDecompress())==NULL) _throwtj("executing tjInitDecompress()"); if(tjDecompressHeader2(hnd, jpegbuf, jpgbufsize, &w, &h, &jpegsub)==-1) _throwtj("executing tjDecompressHeader2()"); - - hsf=_hsf[jpegsub], vsf=_vsf[jpegsub]; - pw=PAD(w, hsf), ph=PAD(h, vsf); - cw=pw/hsf, ch=ph/vsf; - ypitch=PAD(pw, 4), uvpitch=PAD(cw, 4); - yuvsize=ypitch*ph + (jpegsub==TJ_GRAYSCALE? 0:uvpitch*ch*2); - - pitch=w*ps; + if(tjDestroy(hnd)==-1) _throwtj("executing tjDestroy()"); + 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\tImage Size\tDecomp\n"), - printf("Format\tOrder\t X Y \tPerf\n\n"); - printf("%s\t%s\t%-4d %-4d\t", _pfname[pf], bu?"BU":"TD", w, h); + printf("Bitmap\tBitmap\tJPEG\tImage Size\tDecomp\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", + _subnamel[jpegsub], w, h); } - - if((rgbbuf=(unsigned char *)malloc(max(yuvsize, pitch*h)))==NULL) - _throwunix("allocating image buffer"); - - if(!quiet) + else { if(yuv==YUVDECODE) printf("\n>>>>> JPEG --> YUV %s <<<<<\n", _subnamel[jpegsub]); @@@ -454,12 -450,11 +457,10 @@@ void usage(char *progname int main(int argc, char *argv[]) { - unsigned char *bmpbuf=NULL; int w, h, i, useppm=0; - int qual, dotile=0, quiet=0, hiqual=-1; char *temp; - int pf=BMP_BGR; - int bu=0, minarg=2; + unsigned char *bmpbuf=NULL; int w, h, i; + int qual, hiqual=-1; char *temp; + int minarg=2; - printf("\n"); - if(argc8 || (temp2&(temp2-1))!=0) + usage(argv[0]); + scalefactor=temp2; + } } }