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

git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.0.x@381 632fc199-4ca6-4c93-a231-07263d6284db
This commit is contained in:
DRC
2011-02-18 03:19:43 +00:00
parent e2f3718d39
commit e1716b8507
2 changed files with 9 additions and 2 deletions

View File

@@ -3,7 +3,13 @@
[1] Added further protections against invalid Huffman codes.
[2] Fixed visual artifacts in grayscale JPEG compression caused by a typo in
[2] Since the fast integer forward DCT seems to degrade for JPEG qualities
greater than 95, TurboJPEG/OSS will now automatically use the slow integer
forward DCT when generating JPEG images of quality 96 or greater. This
reduces compression performance by as much as 15% for these high-quality images
but is necessary to ensure that the images are perceptually lossless.
[3] Fixed visual artifacts in grayscale JPEG compression caused by a typo in
the RGB-to-chrominance lookup tables.

View File

@@ -166,7 +166,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;