code wiki / _hdl_build / nx_jpeg_rst_gate.nx

nx_jpeg_rst_gate.nx

buildroot/runtime/_hdl_build/nx_jpeg_rst_gate.nx

9594 B191 linesdepth 9pulls 29 transitivereach 0 importersview sourcekind gate/prooftopic jpeg
docsdependenciesstructsconstsfunctions

about

nx_jpeg_rst_gate.nx -- gate for JPEG restart-marker (DRI/RSTn) support, BOTH sides: jw_write_jpeg_ri EMITS restart intervals and the baseline decoder CONSUMES them (nx_jpeg_decode -> walk_mcus_ri -> _decoder_consume_rst). A synthetic round-trip alone cannot catch a shared wrong assumption (an encoder and a decoder that BOTH forgot the DC-predictor reset still round-trip clean), so T7 decodes a REAL third-party-encoded restart-marker JPEG (knowledge/photoreal_refs/lidia/lidia_nature_02.jpg, ~500 RSTn, previously DECODE_FAIL rc=102 -- debt 1090) as the independent witness. T6 is the bite tooth: a corrupted marker must FAIL the decode while the clean stream passes. Inherits nx_gate_verdict. license_tier: ORIGINAL expect_exit: 0

dependencies 10 imports · 0 importers

nx_syscalls.nx nx_gate_verdict.nx nx_h264_bitwriter.nx nx_dct8.nx nx_quant_table.nx nx_zigzag.nx nx_jpeg_huff_enc.nx nx_jpeg_block_enc.nx nx_jpeg_write.nx nx_jpeg_ascii.nx nx_jpeg_rst_gate.nx

imports: nx_syscalls.nxnx_gate_verdict.nxnx_h264_bitwriter.nxnx_dct8.nxnx_quant_table.nxnx_zigzag.nxnx_jpeg_huff_enc.nxnx_jpeg_block_enc.nxnx_jpeg_write.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 gv_ctr sys_mmap gv_head gv_puts sys_write sys_mmap ↻ jhe_dc_bits jhe_dc_val jhe_ac_bits jhe_ac_val jhe_gen sys_mmap ↻ nx_qt_luma sys_mmap ↻ _qt_luma_base _qt_quality_to_scale _qt_scale nx_zigzag_init nx_dct8_init jw_write_jpeg jw_b jw_u16 sys_mmap ↻ bw_init nx_dct8_forward_2d nx_dct8_forward_1d jw_qround nx_zigzag_scan jbe_encode_block jhe_emit_dc jhe_mag_cat bw_write_bits bw_write_bit jhe_mag_bits jhe_emit_ac jhe_mag_cat ↻ bw_write_bits ↻ jhe_mag_bits ↻ bw_write_bit ↻

structs

none

consts

none

functions

20func rj_abs(v: i64) -> i64 { if v<0 { return 0-v } return v }
called by 1: main
21func rj_u16(b: *u8, o: i64) -> i64 { return ((b[o] as i64)<<8) | (b[o+1] as i64) }
called by 1: main
23func main() -> i64