From d7b14624cbb9ed7b9df3532658e1edba8da606a6 Mon Sep 17 00:00:00 2001 From: DRC Date: Mon, 6 Nov 2017 17:25:41 -0600 Subject: Include Tight decoding optimizations from TurboVNC - As with the encoder, the decoder now uses the TurboJPEG wrapper, which allows it to decode JPEG images directly into the framebuffer. This eliminates a buffer copy (CopyRectangle()) as well as the expensive RGB pixel conversion in DecompressJpegRectBPP(). The TurboJPEG wrapper performs RGB pixel conversion more optimally, and only when necessary (it uses the libjpeg-turbo colorspace extensions when available, in order to avoid RGB conversion.) - The other Tight subencoding types are also now decoded directly into the framebuffer, which eliminates buffer copies. - The Tight decoder now supports the rfbTightNoZlib extension, which allows the server to bypass zlib compression when Compression Level 0 is selected. The encoder already supports this extension. Passing the data stream through zlib when Compression Level 0 is selected needlessly wastes CPU time, since all zlib is doing is copying the data internally into its own structures. --- rfb/rfbclient.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'rfb') diff --git a/rfb/rfbclient.h b/rfb/rfbclient.h index 72d672a..ec6ee55 100644 --- a/rfb/rfbclient.h +++ b/rfb/rfbclient.h @@ -7,6 +7,7 @@ */ /* + * Copyright (C) 2017 D. R. Commander. All Rights Reserved. * Copyright (C) 2000, 2001 Const Kaplinsky. All Rights Reserved. * Copyright (C) 2000 Tridia Corporation. All Rights Reserved. * Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved. @@ -51,6 +52,7 @@ #endif #include #include +#include "turbojpeg.h" #ifdef LIBVNCSERVER_HAVE_SASL #include @@ -295,7 +297,7 @@ typedef struct _rfbClient { uint8_t tightPrevRow[2048*3*sizeof(uint16_t)]; #ifdef LIBVNCSERVER_HAVE_LIBJPEG - /** JPEG decoder state. */ + /** JPEG decoder state (obsolete-- do not use). */ rfbBool jpegError; struct jpeg_source_mgr* jpegSrcManager; @@ -422,6 +424,14 @@ typedef struct _rfbClient { GetUserProc GetUser; #endif /* LIBVNCSERVER_HAVE_SASL */ + +#ifdef LIBVNCSERVER_HAVE_LIBZ +#ifdef LIBVNCSERVER_HAVE_LIBJPEG + /** JPEG decoder state. */ + tjhandle tjhnd; + +#endif +#endif } rfbClient; /* cursor.c */ -- cgit v1.2.3