The fast integer DCT degrades for qualities > 95, so use the slow integer DCT instead to ensure that perceptually lossless performance is maintained.

This commit is contained in:
DRC
2011-01-25 06:52:31 +00:00
parent 9ca11b80fc
commit 21b5c4bc4d
2 changed files with 12 additions and 1 deletions

View File

@@ -193,7 +193,8 @@ DLLEXPORT int DLLCALL tjCompress(tjhandle h,
jpeg_set_colorspace(&j->cinfo, JCS_GRAYSCALE);
else
jpeg_set_colorspace(&j->cinfo, JCS_YCbCr);
j->cinfo.dct_method = JDCT_FASTEST;
if(qual>=96) j->cinfo.dct_method=JDCT_ISLOW;
else j->cinfo.dct_method=JDCT_FASTEST;
j->cinfo.comp_info[0].h_samp_factor=hsampfactor[jpegsub];
j->cinfo.comp_info[1].h_samp_factor=1;