diff options
author | Pierre Ossman <ossman@cendio.se> | 2009-03-11 16:15:29 +0000 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2009-03-11 16:15:29 +0000 |
commit | c6a445f2ae95c96608705b40a7c15f95d56e1ebf (patch) | |
tree | 4f6f5a50b7a0b33e25342e5b3dad26b20e514f15 /common/rfb/tightEncode.h | |
parent | 3d2ccc4b63f8694f0cae87c5f12afb5b4b749084 (diff) | |
download | tigervnc-c6a445f2ae95c96608705b40a7c15f95d56e1ebf.tar.gz tigervnc-c6a445f2ae95c96608705b40a7c15f95d56e1ebf.zip |
Tweak the quality to JPEG settings mapping a bit.
The percieved quality isn't really linear compared to the actual quality
setting, so make it a bit more top heavy. Also disable color subsampling
at some levels and make the highest quality lossless.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@3660 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'common/rfb/tightEncode.h')
-rw-r--r-- | common/rfb/tightEncode.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/common/rfb/tightEncode.h b/common/rfb/tightEncode.h index cdcb141b..f2192bba 100644 --- a/common/rfb/tightEncode.h +++ b/common/rfb/tightEncode.h @@ -537,6 +537,13 @@ 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->jpegSubSample) { + cinfo.comp_info[0].h_samp_factor = 2; + cinfo.comp_info[0].v_samp_factor = 2; + } else { + cinfo.comp_info[0].h_samp_factor = 1; + cinfo.comp_info[0].v_samp_factor = 1; + } rdr::U8 *dstBuf = new rdr::U8[2048]; JpegSetDstManager(&cinfo, dstBuf, 2048); |