Hacker News front page4 min readintermediate
Memory-Safe WebP Decoding
Summary
wpd is a Rust‑based WebP decoder that replaces most unsafe C code with safe Rust (only zerocopy unsafe) and optional hand‑written SIMD, delivering faster decoding than libwebp. Benchmarks show up to 3.2× speedup in multi‑threaded scenarios while matching libwebp’s feature set and adding extra capabilities.
- Optional hand‑written SIMD gives performance; compiling without it yields fully memory‑safe Rust code (only zerocopy unsafe).
- Benchmarks: 1‑thread lossy 1.19×, lossless 2.74× faster; multi‑thread lossy 2.68×, lossless 3.19× faster than libwebp.
- Provides full libwebp feature parity plus extras: raw subframe inspection, explicit thread‑count, parallel animation decode‑ahead, C ABI and Rust API.
- Safety focus: replaces unsafe C SIMD intrinsics with Rust; memory‑safety bugs like CVE‑2023‑4863 mitigated.
Anyone building software that decodes untrusted WebP images—browsers, messaging apps, or image pipelines—needs a faster, memory‑safe alternative to libwebp.
7/10



