code wiki / (root) / nx_webp_decode.nx

nx_webp_decode.nx

buildroot/runtime/nx_webp_decode.nx

5303 B101 linesdepth 7pulls 7 transitivereach 2 importersview sourcekind librarytopic webp
docsdependenciesstructsconstsfunctions

about

nx_webp_decode.nx -- SOVEREIGN WebP decoder, built from the first byte up (operator 2026-07-29: "build all the missing codecs... anything WebKit does and beyond"). WHY IT MATTERS: Wikimedia CONTENT-NEGOTIATES and serves WebP under .png URLs, so with PNG/JPEG/GIF/ BMP only, EVERY image on a wikipedia article decoded to nothing (measured: nsrc=11 spawn=6 dec=0). WebP is not optional in 2026 — it is the default web image format. LAYER 1 (this file, LANDED): RIFF/WEBP container + VP8L header + chunk routing. Exposes exact dimensions and the bitstream span, so the pipeline can size boxes and the KAT can prove the parse. LAYER 2 (next): VP8L LOSSLESS pixel decode -- LSB-first bit reader, canonical prefix (Huffman) code build, meta-prefix groups, colour cache, and the 4 transforms (predictor / colour / subtract-green / colour-indexing). That is what these thumbnails use. LAYER 3: VP8 LOSSY (boolean/arith decoder, DCT, prediction, loop filter) then VP8X/ALPH + animation. ★NOTHING HERE FABRICATES PIXELS: until layer 2 lands, decode_rgb reports NOT-YET (0), never a plausible-looking buffer -- a codec that guesses is worse than one that declines.

dependencies 2 imports · 2 importers

nx_syscalls.nx nx_webp_vp8l.nx nx_webp_decode.nx nx_webp_dump.nx nx_webp_mapdump.nx

imports: nx_syscalls.nxnx_webp_vp8l.nx

imported by: nx_webp_dump.nxnx_webp_mapdump.nx

structs

none

consts

18const NX_WEBP_OK: i64 = 0
19const NX_WEBP_NOT_WEBP: i64 = 1
20const NX_WEBP_TRUNCATED: i64 = 2
21const NX_WEBP_UNSUP: i64 = 3 // a WebP variant whose PIXEL decode is not built yet

functions

25func nx_webp_parse(buf: *u8, len: i64, out: *i64) -> i64
93func nx_webp_decode_rgb(buf: *u8, len: i64, wh: *i64) -> *u8