summaryrefslogtreecommitdiff
path: root/branches
diff options
context:
space:
mode:
authordcommander <dcommander@3789f03b-4d11-0410-bbf8-ca57d06f2519>2011-02-18 03:19:43 +0000
committerdcommander <dcommander@3789f03b-4d11-0410-bbf8-ca57d06f2519>2011-02-18 03:19:43 +0000
commitdc230d7293f5676a6be16d3886879c50c19887fe (patch)
tree1b6f110f842612169047fb29ed65399f12900f8c /branches
parentd8972a1119d8681244978dde4adb1a49ca56730b (diff)
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: https://libjpeg-turbo.svn.sourceforge.net/svnroot/libjpeg-turbo@381 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'branches')
-rw-r--r--branches/1.0.x/ChangeLog.txt8
-rw-r--r--branches/1.0.x/turbojpegl.c3
2 files changed, 9 insertions, 2 deletions
diff --git a/branches/1.0.x/ChangeLog.txt b/branches/1.0.x/ChangeLog.txt
index d82b0f6..a1ad2e4 100644
--- a/branches/1.0.x/ChangeLog.txt
+++ b/branches/1.0.x/ChangeLog.txt
@@ -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.
diff --git a/branches/1.0.x/turbojpegl.c b/branches/1.0.x/turbojpegl.c
index 2150a2d..eeaedd1 100644
--- a/branches/1.0.x/turbojpegl.c
+++ b/branches/1.0.x/turbojpegl.c
@@ -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;