code wiki / _hdl_build / nx_png_adam7_gate.nx

nx_png_adam7_gate.nx

buildroot/runtime/_hdl_build/nx_png_adam7_gate.nx

11337 B273 linesdepth 10pulls 46 transitivereach 0 importersview sourcekind gate/prooftopic png
docsdependenciesstructsconstsfunctions

about

nx_png_adam7_gate.nx -- gate for C1 of the codec-chokepoint program (debt 1785903075): PNG Adam7 interlace decode, on top of the already-landed palette + sub-byte rungs. Fixtures are hand-built byte-exact PNGs (zlib STORED blocks + real CRC32/adler32): an 8x8 RGB8 image and an 8x8 palette 4-bit image, each written BOTH linear (il=0) and interlaced (il=1, the seven passes laid out by the canonical tables). The interlaced decode must be byte-identical to the linear decode -- with a wire-difference vacuity guard so the tooth cannot pass on two identical files. Inherits nx_gate_verdict. license_tier: ORIGINAL expect_exit: 0

dependencies 5 imports · 0 importers

nx_syscalls.nx nx_gate_verdict.nx nx_crc32.nx nx_png_decoder.nx nx_img_bytes_to_rgb.nx nx_png_adam7_gate.nx

imports: nx_syscalls.nxnx_gate_verdict.nxnx_crc32.nxnx_png_decoder.nxnx_img_bytes_to_rgb.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main gv_ctr sys_mmap gv_head gv_puts sys_write sys_mmap ↻ pa_pr pa_pg pa_pb pa_col0 pa_coli pa_row0 pa_rowi pa_zlib_store pa_adler pa_be32 pa_png sys_mmap ↻ pa_be32 ↻ pa_chunk pa_be32 ↻ nx_crc32 nx_crc32_update nx_crc32_init nx_crc32_table_at nx_png_decode sys_mmap ↻ _png_check_signature _png_read_u32_be nx_crc32 ↻ _png_n_channels _png_bytes_per_pixel _png_n_channels ↻ _png_a7_expected _png_a7_col0 _png_a7_coli _png_a7_row0 _png_a7_rowi nx_zlib_inflate

structs

none

consts

none

functions

14func pa_adler(d: *u8, n: i64) -> i64
called by 1: pa_zlib_store
22func pa_be32(out: *u8, o: i64, v: i64) -> i64
29func pa_chunk(out: *u8, o: i64, t0: i64, t1: i64, t2: i64, t3: i64, data: *u8, dlen: i64) -> i64
called by 1: pa_png calls 2: pa_be32nx_crc32
42func pa_zlib_store(out: *u8, raw: *u8, rawn: i64) -> i64
called by 1: main calls 2: pa_adlerpa_be32
56func pa_png(out: *u8, w: i64, h: i64, bd: i64, ct: i64, il: i64,
called by 1: main calls 3: sys_mmappa_be32pa_chunk
73func pa_row0(p: i64) -> i64 { if p==0 {return 0} if p==1 {return 0} if p==2 {return 4} if p==3 {return 0} if p==4 {return 2} if p==5 {return 0} return 1 }
called by 1: main
74func pa_col0(p: i64) -> i64 { if p==0 {return 0} if p==1 {return 4} if p==2 {return 0} if p==3 {return 2} if p==4 {return 0} if p==5 {return 1} return 0 }
called by 1: main
75func pa_rowi(p: i64) -> i64 { if p==0 {return 8} if p==1 {return 8} if p==2 {return 8} if p==3 {return 4} if p==4 {return 4} if p==5 {return 2} return 2 }
called by 1: main
76func pa_coli(p: i64) -> i64 { if p==0 {return 8} if p==1 {return 8} if p==2 {return 4} if p==3 {return 4} if p==4 {return 2} if p==5 {return 2} return 1 }
called by 1: main
79func pa_pr(x: i64, y: i64) -> i64 { return x*30+5 }
called by 1: main
80func pa_pg(x: i64, y: i64) -> i64 { return y*30+7 }
called by 1: main
81func pa_pb(x: i64, y: i64) -> i64 { return (x+y)*15+3 }
called by 1: main
83func pa_pidx(x: i64, y: i64) -> i64 { return (x*3+y*5)%16 }
called by 1: main
85func main() -> i64