TurboVNC / turbovnc

Main TurboVNC repository
https://TurboVNC.org
GNU General Public License v2.0
746 stars 136 forks source link

Pure JPEG encoding #376

Open dcommander opened 10 months ago

dcommander commented 10 months ago

Referring to this thread, there is some benefit to a pure JPEG RFB encoding, as opposed to the hybrid Tight + JPEG encoding methods that TurboVNC currently uses. This is particularly true for medium-quality and low-quality JPEG and with applications that use heavily image-based rendering techniques (including 3D applications running with VirtualGL) and/or render a large number of unique colors and/or render few areas of solid color. However, in order to realize that benefit in many cases, it is necessary to modify the TurboJPEG API library so that it can generate "abbreviated image datastreams", i.e. JPEG images without embedded tables (the equivalent of motion-JPEG frames.)

Tasks:

  1. Add a new parameter (working title: TJPARAM_NOTABLES/TJ.PARAM_NOTABLES) to the TurboJPEG API that, when set, will cause the compression and transformation functions to call jpeg_suppress_tables(cinfo, TRUE);. Document the parameter. Since this is a non-disruptive API extension that doesn't affect ABI compatibility, it may be possible to introduce it in libjpeg-turbo 3.0.x rather than wait for libjpeg-turbo 3.1.
  2. Add support for the pure JPEG RFB encoding (RFB encoding number 21) to the TurboVNC Server. The pure JPEG encoder would simply pass all framebuffer update rectangles directly to libjpeg-turbo, setting the aforementioned TurboJPEG parameter. It would respond to the JPEG Quality Level, JPEG Fine-Grained Quality Level, and JPEG Subsampling Level pseudo-encodings, as the TurboVNC encoder currently does. Document the pure JPEG encoding in the man pages. (It probably won't be documented in the User's Guide initially, since it is an advanced use case.) Bonus points for multithreading it.
  3. Add support for the pure JPEG RFB encoding (RFB encoding number 21) to the TurboVNC Viewer. The pure JPEG decoder could reuse the existing TightDecoder native methods, which provide a Java interface for the TurboJPEG C decompress function. Document the new encoding in the TurboVNC Viewer usage screen and man page.