code wiki / (root) / nx_jpeg_pgm_dump_test.nx

nx_jpeg_pgm_dump_test.nx

buildroot/runtime/nx_jpeg_pgm_dump_test.nx

3465 B99 linesdepth 9pulls 21 transitivereach 0 importersview sourcekind gate/prooftopic jpeg
docsdependenciesstructsconstsfunctions

about

nx_jpeg_pgm_dump_test.nx -- PROOF dumper for the bits-up JPEG decoder. Reads the real source.jpg staged in the proof folder, decodes it through nx_jpeg_decode_luma (the SAME decode path the ASCII renderer uses), and writes the full-resolution luma (Y) plane as a binary PGM (P5) so an INDEPENDENT decoder (Windows GDI+ via PowerShell) can be diffed against it pixel-for-pixel. This exists because "assertions PASS" is not proof. The PGM this writes is compared, off-box, to a third-party decode of the same bytes; the MAE / PSNR is the proof. Asserts the decoded dimensions equal the known 239x178 (so a silent SOF mis-parse can't pass), then emits the PGM. expect_exit: 0 license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_jpeg_ascii.nx nx_jpeg_pgm_dump_test.nx

imports: nx_syscalls.nxnx_jpeg_ascii.nx

imported by: nobody (leaf or entry point)

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

main sys_mmap sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close nx_jpeg_decode_luma sys_mmap ↻ nx_jpeg_dec_ctx_init sys_mmap ↻ _jpeg_ascii_probe_sof sys_mmap ↻ nx_jpeg_seg_init nx_jpeg_seg_next nx_jpeg_classify_marker nx_jpeg_marker_is_lengthle nx_jpeg_sof_parse nx_jpeg_is_progressive prog_be16 nx_jpeg_prog_decode sys_mmap ↻ prog_be16 ↻ nx_jpeg_dqt_parse nx_jpeg_dht_parse nx_jpeg_dht_build_decode_t nx_jpeg_sos_parse prog_next_marker prog_scan sys_mmap ↻ nx_jpeg_huff_decode_symbol nx_jpeg_ent_extend nx_jpeg_ent_receive prog_refine_nz nx_jpeg_mcu_scratch_init sys_mmap ↻ nx_jpeg_idct_init_cos_tabl nx_jpeg_dequant_un_zigzag sys_mmap ↻

structs

none

consts

none

functions

21func _put_dec(buf: *u8, pos: i64, v: i64) -> i64
called by 1: main calls 1: sys_mmap
33func main() -> i64