RAW decoding benchmarks
Every image processing pipeline for RAW development starts from data parcing and decoding. Usually lossless encoding is done at camera hardware, so we need to decode that data on PC later. That decoding is a serious bottleneck for any software, because encoding algorithm is essentially serial and one can do multithreading for tiles only. It's impossiblle to perform parallel data decoding data for particular tile. Nevertheless, the task is very important and we will check how it was solved in different cases and how fast it can be. We will check decoding performance only, without taking into account reading, parsing and further image processing.
Many widespread decoding libraries (dcraw, libraw, libjpeg, etc.) are not optimized for speed, which leads to slow RAW decoding. This is not actually a problem for a single image processing, but it could be not fast enough for batch processing, workflow with high resolution images (up to 50-100 MPix or more) or for Raw Video Player with smooth output in realtime.
For example, decoding of one 16-bit image with 100 MPix resolution with libraw takes around 3 seconds on good PC. This is too slow and we need to do two things: to process each tile in a separate thread and to improve decoding speed for each tile as well.
Hardware specification for testing
- CPU Intel Core i7-6700 (Skylake, 4 cores, 3.4–4.0 GHz)
- GPU NVIDIA GeForce GTX 1080 (Pascal, 20 SMM, 2560 cores, 1.6–1.7 GHz)
- OS Windows 10 (x64)
Lossless JPEG decoders to compare
We will test the following lossless jpeg decoders:
- Standard Lossless JPEG decoder from libjpeg library
- Decoder from RawSpeed library
- Decoder from LibRaw library
- LJ92 Decoder from MlRawViewer (liblj92 library)
- LJ Decoder from Fast CinemaDNG Processor (lossless jpeg library on CPU)
In real use case, multithreaded decoder software is utilized, and each tile is decoded in a separate thread. We've done comparison for single thread applications for the same DNG image and at the same hardware. JPEG decoding is fully done on CPU, no image processing on GPU is implemented. Test image has resolution 16 MPix, 12-bit, two components (just one Huffman table), one tile, demosaic pattern is RGGB, timings include decoding computations only.
DNG decoding benchmarks for single thread applications
- LJ Decoder - 180 ms (75 MPix/s)
- RawSpeed Decoder - 240 ms (66 MPix/s)
- LJ92 (library liblj92) - 340 ms (47 MPix/s)
- LibRaw Decoder - 380 ms (42 MPix/s)
- Libjpeg Lossless Decoder - xxx ms (xx MPix/s)
The fastest result of lossless jpeg decoding could be achieved with LJ Decoder from Fastvideo due to highly optimized implementation of decompression algorithm. We utilize that library to speed up DNG decoding at Fast CinemaDNG Processor software. This is very important issue to ensure smooth video preview from CinemaDNG footages in realtime.
Related GPU software: RawZipper RAW Bayer codec on fastcompression.com.