code wiki / _hdl_build / nx_vcodec_gate.nx

nx_vcodec_gate.nx

buildroot/runtime/_hdl_build/nx_vcodec_gate.nx

6777 B103 linesdepth 5pulls 15 transitivereach 0 importersview sourcekind gate/prooftopic vcodec
docsdependenciesstructsconstsfunctions

about

nx_vcodec_gate.nx -- V-R5: drives the reusable sovereign video codec MODULE (nx_vcodec: motion + transform + quant + entropy + intra DC prediction) through a talking-head SEQUENCE and MEASURES it against the full-frame baseline the current vroom uses. Native nx_cc->nxasm, no node. No-wave: reports absolute numbers + the inter-prediction win (the same mechanism H.264 uses) + reconstruction error; a literal libvpx/x264 RD head-to-head needs those codecs as a FLAGGED external benchmark (cannot run sovereignly here) -- the exceed claimed here is the measured inter-frame win vs full-frame + footprint/sovereignty/latency. 1) inter-frame bytes << keyframe bytes << raw frame (the motion+transform+entropy win, MEASURED) 2) reconstruction error bounded (lossy but faithful) 3) a STATIC frame costs almost nothing (near-zero uplink between changes) 4) sequence total << "full JPEG every frame" (the current 8fps approach), MEASURED The codec itself now lives in nx_vcodec.nx (DRY: same organ the vroom daemon will import); this gate only builds the test frames + measures. license_tier: ORIGINAL

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_gate_emit_lib.nx nx_vcodec.nx nx_vcodec_gate.nx

imports: nx_syscalls.nxnx_gate_emit_lib.nxnx_vcodec.nx

imported by: nobody (leaf or entry point)

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

main g_puts sys_write sys_mmap mkframe vc_enc_frame vc_enc_block vs_skip vm_sad_zero vm_sad v128_sad16 vm_search vm_scan vm_try vm_sad_capped vc_vbits ve_blen ve_zze vc_dc_pred vc_enc_sub vt_fwd vt_wht4 vt_quant ve_encode ve_encode_at ve_zz_idx nx_bw_put ve_vput vt_dequant vt_inv vt_wht4 ↻ frame_meanerr g_abs frame_maxerr g_abs ↻ g_pn sys_mmap ↻ sys_write ↻ g_check g_puts ↻

structs

none

consts

none

functions

17func g_abs(v: i64) -> i64 { if v < 0 { return 0 - v } return v }
24func mkframe(f: *u8, W: i64, H: i64, t: i64) -> i64
called by 1: main
34func frame_maxerr(a: *u8, b: *u8, n: i64) -> i64 { var m: i64=0; var i: i64=0; while i<n { let e: i64=g_abs((a[i] as i64)-(b[i] as i64)); if e>m { m=e } i=i+1 } return m }
called by 1: main calls 1: g_abs
35func frame_meanerr(a: *u8, b: *u8, n: i64) -> i64 { var s: i64=0; var i: i64=0; while i<n { s=s+g_abs((a[i] as i64)-(b[i] as i64)); i=i+1 } return s/n }
called by 1: main calls 1: g_abs
37func main() -> i64