Part 1: Lossless SmartScale
artificial.ppm: Ray-traced scene from http://www.imagecompression.info/test_images/ (8-bit version, 3072 x 2048 pixels.)
nightshot_iso_100.ppm: Photographic content from http://www.imagecompression.info/test_images/ (8-bit version, 3136 x 2352 pixels.)
vgl_6434_0018.ppm: A frame capture from the Pro/ENGINEER Viewperf test. This frame represents an exploded rendering of a race car with smooth shading and lighting (1240 x 960 pixels.)
The collection of photographic images from http://www.r0k.us/graphics/kodak/kodak/, tested as an aggregate group (768 x 512 or 512 x 768 pixels, 24 images.)
jpeg-8d was used to encode each test image into a lossless SmartScale file, using the IJG's recommended switches:
cjpeg -rgb -block 1 -arithmetic
With jpeg-9, an additional color transform was added which claims to significantly improve the compression, so this was evaluated as well. The switches used in jpeg-9 were:
cjpeg -rgb1 -block 1 -arithmetic
The performance/compression ratio tradeoff of arithmetic encoding was also evaluated. In all cases, the
cwebp -lossless -q 0 -m 0
For comparison, Thomas Richter's JPEG-LS implementation, hereafter referred to as "jpeg-ls", was used to compress the source images into the JPEG-LS format. The following settings were used:
jpeg -c -ls 0 -cls
For comparison, Microsoft's jxrlib was used to compress the source images into the JPEG XR format. The default settings in
For the performance metrics, the execution time of the encoder program was measured using the Un*x
To obtain the most consistent performance, only 1 CPU core was used.
jpeg-8d, jpeg-9, jpeg-ls, libwebp, and jxrlib were built with 64-bit code and maximum compiler optimizations (
With the exception of the Kodak images, it was always possible to find a PNG mode that compressed both better and faster than lossless SmartScale, although doing so required some foreknowledge of the image type. Apparently, the computer-generated content responded better to higher zlib levels, and the photographic content responded better to a higher level of filtering. The overall level of compression with the jpeg-9 implementation of lossless SmartScale was, in the aggregate, similar to that of the "default" PNG settings in ImageMagick, so this newest iteration of lossless SmartScale does at least demonstrate an adequate compression ratio to compete with PNG. However, it should be noted that this newest lossless SmartScale variant requires jpeg-9. It and the previous iteration of the SmartScale format are not standards, and no one really knows whether or how they might change in the future.
Further, comparison with JPEG-LS, which is a standard, revealed only one case in which lossless SmartScale produced a higher compression ratio-- 12% higher on vgl_6434_0018.ppm, and jpeg-9 took twice as long as jpeg-ls to achieve this. There was also only one case in which jpeg-9 was able to compress significantly faster than jpeg-ls-- 18% on nightshot_iso_100.ppm, but jpeg-9 also produced a proportionally lower compression ratio on the same test.
jpeg-9 generally compressed the computer-generated content quite a bit better than JPEG XR did, but it was also proportionally slower. On the photographic content, the compression ratios were similar between jpeg-9 and JPEG XR, but JPEG XR was 3-5 times as fast as jpeg-9
The performance of the SmartScale encoder needs a lot of improvement before lossless SmartScale could reasonably be used as a substitute for PNG. Theoretically, this could be done by implementing similar types of SIMD optimizations to the ones used in libjpeg-turbo or even by extending the existing SIMD extensions to accommodate the new block sizes. Accelerating the arithmetic entropy codec would also be necessary. This work, although feasible, would represent a significant undertaking. Even if it were possible to accelerate the encoding of SmartScale by 2-4x, as was achieved with baseline JPEG in libjpeg-turbo, the resulting performance for the above images would still only be in the range of 3-7 Megapixels/second, which is not sufficient for streaming or remote display purposes. The resulting performance would also be no better than libpng.
webp proved to be the codec to beat in terms of compression ratio. Its performance was significantly slower than libjpeg on nightshot_iso_100, but on the rest of the images, it performed in the ballpark of libjpeg, and it compressed much better in all cases.
Lossless SmartScale is clever, but it does not generally accomplish anything that can't already be accomplished better with webp, and in most cases, the same task can also be accomplished as well or better, and more quickly, using PNG. Further, the performance and compression ratio of lossless SmartScale are generally worse than that of the JPEG-LS standard, and in the isolated cases in which they aren't, lossless SmartScale provides either an equal or worse performance vs. compression ratio tradeoff.
Given that the new structure field in jpeg-9 was added solely to support the "subtract green" color transform for lossless SmartScale, the above research calls into question whether that feature was worth breaking backward ABI compatibility with jpeg-8. In fact, the new color transform could have been implemented as an additional JPEG colorspace constant without breaking ABI compatibility.
|All content on this web site is licensed under the Creative Commons Attribution 2.5 License. Any works containing material derived from this web site must cite The libjpeg-turbo Project as the source of the material and list the current URL for the libjpeg-turbo web site.|