-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ignore checksums more often #9
Comments
Tangentially, if you're using Wuffs from C++ (instead of C), you can replace wuffs_png__decoder__set_quirk_enabled(pDec, etc); with pDec->set_quirk_enabled(etc); and similarly for other Wuffs' C API calls. |
Cool- I will hook this up to see how wuffs compares. |
I disabled Wuffs checksum checking. Also I updated the README. I didn't conduct exhaustive benchmarking yet, but I will. So far Wuffs's PNG decoder is extremely fast. fpng seems a bit faster (within 10-20%, depending on whether you disable Wuffs checksums), but it's not a general purpose decoder. FPNG is really just existence proof and a push to others to make their PNG libraries faster. The real competition is QOI. |
Also tangential, but if you haven't already seen it, nigeltao/qoi2-bikeshed#28 has some numbers for unofficial, experimental QOI variants. The highlights:
It looks like QOI can get a 1.1x - 1.2x decode speed improvement above the current official implementation, without any file format changes. With file format changes, something QOI-like can keep that higher speed but also improve the compression ratio, closing the gap on PNG. nigeltao/qoi2-bikeshed#31 and nigeltao/qoi2-bikeshed#34 also suggests that there may be further compression-ratio gains from tweaking a QOI-like file format. |
You (@richgel999) are already mentioned in the tweet but for anyone else coming here: @veluca93 and @jonsneyers have a standalone JpegXL lossless encoder that's about 1000 lines of code (https://github.com/libjxl/libjxl/tree/f413c429cfd5f2e1f65b5ebfc0c969b67ddbcbaf/experimental/fast_lossless) and https://twitter.com/jonsneyers/status/1472959101416226823 suggests that it's 2x faster than QOI (for roughly equivalent compression ratio). |
See also: Anyway, happy to see healthy competition making everyone faster. :-) |
Adler-32 and CRC-32 computations are fast with SIMD, but if you just want the fastest possible PNG decoder (e.g. to compare to QOI's speed), ignoring the checksums can be even faster.
For decode (not encode, obviously), IIUC fpng already skips computing/verifying Adler-32 always and CRC-32 sometimes (depending on FPNG_DISABLE_DECODE_CRC32_CHECKS).
Some of the other libraries (lodepng and stb_image) also do this automatically. Wuffs needs to opt in, with a one-liner patch:
The text was updated successfully, but these errors were encountered: