Re:QOI – The “Quite OK Image Format” for fast, lossless imag...
by sakras on Thursday December 23, 2021 @03:33PM
(#29666136)
I think fundamentally it’s faster just because it’s dead simple. It’s just a mash of RLE, dictionary encoding, and delta encoding, and it does it all in a single pass. PNG has to break things into chunks, apply a filter, deflate, etc.
Re:QOI – The “Quite OK Image Format” for fast, lossless imag...
by pornel on Friday December 24, 2021 @05:49AM
(#29672501)
Filters are a form of delta encoding, and are optional for PNG encoders. Deflate is a form of dictionary encoding with RLE. There's no "breaking into chunks" in PNG — PNG can encode the entire image as a single iDAT chunk (and chunks themselves are so trivial they have no impact on speed).
You can choose not to do filtering when encoding PNG. Fast deflate settings are literally RLE-only, and you can see elsewhere in this thread people have developed specialized encoders that ignore most deflate features.
The only misfeature PNG has that slows down encoding is CRC. Decoders don't have to check the CRC, but encoders need to put one in to be spec-compliant.
I think the rust png library is ~4x faster than libpng which could erase the decompression advantage but that 50x faster compression speed is extremely impressive.
Can anybody tell if there's any significant feature differentials that might explain the difference (color space, pixel formats, .. etc)?