It could be made a bit faster, but that would require delving into unsafe Rust which people tend to dislike. With no-unsafe / no-simd / portable restrictions, I think it's pretty close to how fast it can get.
A few ideas were borrowed from @zakarumych's implementation (namely, hashing and run-length-1 encoding) and credited accordingly in the source code (however, some adjustments needed to be made to avoid bugs that were uncovered during testing).
Hi all, I finally got to finishing the main work on the Rust crate: https://github.com/aldanor/qoi-rust
@steven-joruk has kindly agreed to hand over the
qoi
crate name, so the Rust crate is available at https://crates.io/crates/qoi (and docs at https://docs.rs/qoi).Here's preliminary benchmarks on the reference image suite:
It could be made a bit faster, but that would require delving into unsafe Rust which people tend to dislike. With no-unsafe / no-simd / portable restrictions, I think it's pretty close to how fast it can get.
A few ideas were borrowed from @zakarumych's implementation (namely, hashing and run-length-1 encoding) and credited accordingly in the source code (however, some adjustments needed to be made to avoid bugs that were uncovered during testing).