nx_gif_decode.nx
buildroot/runtime/nx_gif_decode.nx
about
nx_gif_decode.nx -- sovereign GIF87a/89a decoder (LZW). Core decodes to palette INDICES with
de-interlace row permutation (GIF interlace = 4 passes: rows 0,8,.. / 4,12,.. / 2,6,.. / 1,3,..),
then two consumers: gif_decode (w*h Rec.709 grayscale -- the historic perceptual-hash contract) and
gif_decode_rgb (w*h*3 palette COLOR -- the chokepoint/browser path; before this, every GIF lost its
palette to an R=G=B expand and interlaced GIFs rendered visually scrambled). First image descriptor
only (animated GIF = first frame). Returns 0 on non-GIF/failure. All bindings `var` where reassigned
(let is immutable in nx_cc). license_tier: ORIGINAL
dependencies 1 imports · 7 importers
imports: syscalls.nx
imported by: nx_archive_media_recovery.nxnx_gif_color_gate.nxnx_gif_decode_gate.nxnx_image_gray.nxnx_img_bytes_to_rgb.nxnx_media_exclusion_enforce_gate.nxnx_recovery_guard.nx
structs
| none |
consts
| 9 | const K_MAGIC_4096: i64 = 4096 |
functions
| 11 | func gif_u16le(buf: *u8, off: i64) -> i64 { return (buf[off] as i64) | ((buf[off+1] as i64)<<8) } called by 1: gif_decode_core |
| 15 | func gif_decode_core(raw: *u8, n: i64, meta: *i64) -> *u8 |
| 133 | func gif_decode(raw: *u8, n: i64, out_wh: *i64) -> *u8 |
| 157 | func gif_decode_rgb(raw: *u8, n: i64, out_wh: *i64) -> *u8 |