code wiki / _hdl_build / nx_vcodec_gate.nx
nx_vcodec_gate.nx
buildroot/runtime/_hdl_build/nx_vcodec_gate.nx
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
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
structs
| none |
consts
| none |
functions
| 17 | func g_abs(v: i64) -> i64 { if v < 0 { return 0 - v } return v } |
| 24 | func mkframe(f: *u8, W: i64, H: i64, t: i64) -> i64 called by 1: main |
| 34 | func 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 } |
| 35 | func 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 } |
| 37 | func main() -> i64 |