nx_jpeg_entropy_test.nx
buildroot/runtime/nx_jpeg_entropy_test.nx
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
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
structs
| none |
consts
| none |
functions
| 37 | func _fail(n: i64) -> i64 |
| 57 | func main() -> i64 |