I'm at a point where I'd like to merge the optimised JPEG code, and here's why:
This is a profile of Xvnc before the pixel conversion fixes I committed today: samples % image name symbol name 38131 37.0028 Xvnc _ZN3rfbL16encodeJpegRect32EPN3rdr9OutStreamEPjRKNS_11PixelFormatERKNS_4RectE 16731 16.2360 Xvnc forward_DCT 14752 14.3155 Xvnc rgb_ycc_convert 10187 9.8856 Xvnc encode_mcu_huff 8423 8.1738 Xvnc jpeg_fdct_islow That odd thing at the top is the TightVNC JPEG encoding routine. After some digging the bottle neck was identified as the conversion from the server's BGR32 format to libjpeg's RGB24. After some basic cleanup and removal of particularly inefficient routines, we have this in trunk right now: samples % image name symbol name 15774 23.2052 Xvnc forward_DCT 13696 20.1483 Xvnc rgb_ycc_convert 9465 13.9240 Xvnc encode_mcu_huff 8415 12.3794 Xvnc rfb::PixelFormat::rgbFromBuffer(unsigned char*, unsigned char const*, int, rfb::ColourMap*) const 7826 11.5129 Xvnc jpeg_fdct_islow A major improvement (even though there is room for more as the new conversion routine is still in the top five). The next problem is the JPEG encoding. The other four entries there are all from libjpeg. Applying the SIMD optimised libjpeg, we reduce the cost of these substantially: samples % image name symbol name 28436 29.4101 Xvnc rfb::PixelFormat::rgbFromBuffer(unsigned char*, unsigned char const*, int, rfb::ColourMap*) const 25430 26.3011 Xvnc encode_mcu_huff 11795 12.1990 Xvnc jsimd_rgb_ycc_convert_sse2.rgb_ycc_cnv 10485 10.8442 Xvnc ....@11.done 2801 2.8969 Xvnc ....@7.bs I hope that considering this, everyone thinks it's worth merging this code. :) For kicks, this is how the vncviewer is affected: Without SIMD: samples % image name symbol name 23277 29.6277 vncviewer ycc_rgb_convert 22918 29.1708 vncviewer rfb::PixelFormat::pixelFromRGB(unsigned char, unsigned char, unsigned char, rfb::ColourMap*) const 11666 14.8489 vncviewer jpeg_idct_islow 7560 9.6226 vncviewer h2v2_fancy_upsample 5928 7.5453 vncviewer _ZN3rfbL18DecompressJpegRectERKNS_4RectEPN3rdr8InStreamEPjPNS_11CMsgHandlerE With SIMD: samples % image name symbol name 45918 49.0195 vncviewer rfb::PixelFormat::pixelFromRGB(unsigned char, unsigned char, unsigned char, rfb::ColourMap*) const 13569 14.4855 vncviewer _ZN3rfbL18DecompressJpegRectERKNS_4RectEPN3rdr8InStreamEPjPNS_11CMsgHandlerE 8254 8.8115 vncviewer ....@16.bs 5833 6.2270 vncviewer jsimd_idct_islow_sse2.column_end 4667 4.9822 vncviewer decode_mcu Rgds -- Pierre Ossman OpenSource-based Thin Client Technology System Developer Telephone: +46-13-21 46 00 Cendio AB Web: http://www.cendio.com
signature.asc
Description: PGP signature
------------------------------------------------------------------------------ Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H
_______________________________________________ Tigervnc-devel mailing list Tigervnc-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tigervnc-devel