From 27198cecda2903a59d3a3c5e75682d14b1f35a05 Mon Sep 17 00:00:00 2001 From: DRC Date: Tue, 8 Feb 2011 18:10:24 +0000 Subject: [PATCH] libjpeg-turbo produces about the same image quality with the fast integer DCT if the JPEG quality is <= 95, and it's a lot faster. Slow integer DCT is retained for quality >= 96, because fast integer degrades at those quality levels. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4259 3789f03b-4d11-0410-bbf8-ca57d06f2519 --- common/rfb/tightEncode.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common/rfb/tightEncode.h b/common/rfb/tightEncode.h index 0c6b364c..2e6d0d88 100644 --- a/common/rfb/tightEncode.h +++ b/common/rfb/tightEncode.h @@ -574,6 +574,8 @@ static void ENCODE_JPEG_RECT (rdr::OutStream *os, PIXEL_T *buf, jpeg_set_defaults(&cinfo); jpeg_set_quality(&cinfo, s_pjconf->jpegQuality, TRUE); + if(s_pjconf->jpegQuality >= 96) cinfo.dct_method = JDCT_ISLOW; + else cinfo.dct_method = JDCT_FASTEST; switch (s_pjconf->jpegSubSample) { case SUBSAMP_420: -- 2.39.5