Move per-format flag assignments to the actual TurboJPEG function calls

git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@492 632fc199-4ca6-4c93-a231-07263d6284db
This commit is contained in:
DRC
2011-03-02 10:30:29 +00:00
parent 9977e28a09
commit 3c2d7f21a4

View File

@@ -346,13 +346,14 @@ void gentestjpeg(tjhandle hnd, unsigned char *jpegbuf, unsigned long *size,
t=rrtime();
if(yuv==YUVENCODE)
{
_catch(tjEncodeYUV(hnd, bmpbuf, w, 0, h, ps, jpegbuf, subsamp, flags));
_catch(tjEncodeYUV(hnd, bmpbuf, w, 0, h, ps, jpegbuf, subsamp,
flags|_flags[pf]));
*size=TJBUFSIZEYUV(w, h, subsamp);
}
else
{
_catch(tjCompress(hnd, bmpbuf, w, 0, h, ps, jpegbuf, size, subsamp, qual,
flags));
flags|_flags[pf]));
}
t=rrtime()-t;
@@ -417,12 +418,13 @@ void _gentestbmp(tjhandle hnd, unsigned char *jpegbuf, unsigned long jpegsize,
t=rrtime();
if(yuv==YUVDECODE)
{
_catch(tjDecompressToYUV(hnd, jpegbuf, jpegsize, bmpbuf, flags));
_catch(tjDecompressToYUV(hnd, jpegbuf, jpegsize, bmpbuf,
flags|_flags[pf]));
}
else
{
_catch(tjDecompress(hnd, jpegbuf, jpegsize, bmpbuf, scaledw, 0, scaledh,
ps, flags));
ps, flags|_flags[pf]));
}
t=rrtime()-t;
@@ -497,9 +499,8 @@ void dotest(int w, int h, const int *formats, int nformats, int subsamp,
}
pf=formats[pfi];
gentestjpeg(hnd, jpegbuf, &size, w, h, pf, basefilename, subsamp, 100,
flags|_flags[pf]);
gentestbmp(dhnd, jpegbuf, size, w, h, pf, basefilename, subsamp,
flags|_flags[pf]);
flags);
gentestbmp(dhnd, jpegbuf, size, w, h, pf, basefilename, subsamp, flags);
}
}