code wiki / (root) / nx_jpeg_entropy_test.nx

nx_jpeg_entropy_test.nx

buildroot/runtime/nx_jpeg_entropy_test.nx

5976 B154 linesdepth 4pulls 4 transitivereach 0 importersview sourcekind gate/prooftopic jpeg
docsdependenciesstructsconstsfunctions

about

nx_jpeg_entropy_test.nx -- KAT for baseline JPEG entropy decoder. Designs hand-built Huffman tables + a known bitstream that should decode to a specific 64-entry zig-zag-ordered block, then verifies. Tables: DC: BITS={1,1,1,0,...}, HUFFVAL={0,1,2} symbol 0 = code "0" (1 bit) symbol 1 = code "10" (2 bits) symbol 2 = code "110" (3 bits) AC: BITS={2,0,...}, HUFFVAL={0x00, 0x01} symbol 0x00 = code "0" (EOB) symbol 0x01 = code "1" (run=0 size=1) Block 1: DC=+1, AC[1]=+1, EOB. DC stream: symbol 1 "10" + 1 mag bit "1" = "101" AC stream: symbol 0x01 "1" + 1 mag bit "1" = "11" EOB: symbol 0x00 "0" = "0" total: "101110" = 6 bits Block 2: DC delta=+3 (prev_dc was 1, want 4), then EOB. DC stream: symbol 2 "110" + 2 mag bits "11" = "11011" EOB: symbol 0x00 "0" = "0" total: "110110" = 6 bits Combined 12 bits, packed MSB-first: byte 0 = 0b10111011 = 0xBB byte 1 = 0b01100000 = 0x60 expect_exit: 0 license_tier: ORIGINAL

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_jpeg_dht.nx nx_jpeg_entropy.nx nx_jpeg_entropy_test.nx

imports: nx_syscalls.nxnx_jpeg_dht.nxnx_jpeg_entropy.nx

imported by: nobody (leaf or entry point)

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

main nx_jpeg_ent_extend _fail sys_mmap sys_write sys_mmap ↻ nx_jpeg_dht_parse nx_jpeg_dht_build_decode_t nx_jpeg_ent_decode_block nx_jpeg_huff_decode_symbol nx_jpeg_ent_receive nx_jpeg_ent_extend ↻ sys_write ↻

structs

none

consts

none

functions

37func _fail(n: i64) -> i64
called by 1: main calls 2: sys_mmapsys_write
57func main() -> i64