code wiki / _hdl_build / nx_colorspace_gate.nx
nx_colorspace_gate.nx
buildroot/runtime/_hdl_build/nx_colorspace_gate.nx
about
nx_colorspace_gate.nx -- proves + MEASURES sovereign RGB<->YCbCr + 4:2:0 (nx_colorspace). Native, no node.
1) round-trip RGB->YCbCr->RGB within a bounded integer error (MEASURED)
2) neutral gray -> Cb=Cr=128 (correct chroma centering)
3) pure red -> Cr>128 (red chroma) + round-trips back to red
4) 4:2:0 subsample->upsample on smooth chroma is near-lossless (MEASURED)
5) anti-tautology: distinct colours -> distinct YCbCr
license_tier: ORIGINAL
dependencies 3 imports · 0 importers
imports: nx_syscalls.nxnx_gate_emit_lib.nxnx_colorspace.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
| 12 | func g_abs(v: i64) -> i64 { if v < 0 { return 0 - v } return v } |
| 13 | func planemax(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 } |
| 15 | func main() -> i64 |