code wiki / (root) / nx_h264_cabac_gate.nx

nx_h264_cabac_gate.nx

buildroot/runtime/nx_h264_cabac_gate.nx

4423 B93 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind gate/prooftopic h264
docsdependenciesstructsconstsfunctions

about

nx_h264_cabac_gate.nx -- REFEREE for the H.264 CABAC arithmetic engine (STEP 1 core). Three known-answer checks: (1) tables: rangeTabLps/transIdxLps/transIdxMps parse to 256/64/64 (fail-closed loader). (2) engine KAT: the arithmetic engine is byte-identical to the GATED nx_hevc_cabac engine, so on the SAME self-test (buf[i]=(i*37+11)&0xff, ctxInit initValue=154 @ QP26) it MUST reproduce the exact captured answer: init range=510 offset=22; ctx0 pState=0 mps=1; 16 bypass bins = 0x0B3B; 16 decision bins = 0x0708; terminate=0; range stays in [256,510]. (3) (m,n) context init: two hand-computed vectors verify the H.264 clause-9.3.1.1 formula (m=20,n=-15,QP26 -> pre=17 -> pState=46,mps=0) and (m=20,n=60,QP40 -> pre=110 -> pState=46,mps=1). stdout + knowledge/status/h264_cabac_gate.log. Exit 0/1. Sovereign. license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_h264_cabac.nx nx_h264_cabac_gate.nx

imports: nx_syscalls.nxnx_h264_cabac.nx

imported by: nobody (leaf or entry point)

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

main sys_openat_append gp sys_write sys_mmap cab_load_tables cab_parse_nums kat_engine sys_mmap ↻ cab_init cab_bit cab_ctx_init_iv cab_clip3 cab_bypass cab_bit ↻ cab_decision cab_renorm cab_bit ↻ cab_terminate cab_renorm ↻ kat_ctxinit_mn sys_mmap ↻ cab_ctx_init_mn cab_clip3 ↻ gn sys_mmap ↻ sys_write ↻ sys_close sys_exit

structs

none

consts

none

functions

14func gp(logfd: i64, s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); if logfd > 0 { sys_write(logfd, s, n) } return 0 }
called by 1: main calls 1: sys_write
15func gn(logfd: i64, v: i64) -> i64
called by 1: main calls 2: sys_mmapsys_write
28func kat_engine(rlps: *i64, tlps: *i64, tmps: *i64) -> i64
60func kat_ctxinit_mn() -> i64
called by 1: main calls 2: sys_mmapcab_ctx_init_mn
72func main() -> i64