code wiki / _hdl_build / _codec_bench_med.nx
_codec_bench_med.nx
buildroot/runtime/_hdl_build/_codec_bench_med.nx
about
_codec_bench_med.nx -- X-CDC-FRAME-LZ-001 rung: sovereign-PREDICTOR PNG-style head-to-head.
Measured finding (X-BENCH-CODEC-002): fc loses to PNG-class because it has no LZ stage. But fc
owns the MED (LOCO-I/JPEG-LS) predictor, while PNG offers only fixed filters (None/Sub/Up/Avg/
Paeth). This rung ISOLATES PREDICTOR QUALITY: feed BOTH the MED residual and the PNG-Sub residual
to the SAME sovereign deflate, on the SAME corpus. MED+deflate < Sub+deflate => the MED prefilter
EXCEEDS PNG's Sub filter (no-wave: only the prefilter differs; both sides our deflate; both sovereign).
No-false-green: each frame's MED+deflate pipeline is end-to-end round-trip verified
(MED-residual -> deflate -> our inflate -> un-MED == original), plus a tamper check that MUST fail.
GREEN iff round-trip exact on all 5 AND tamper detected; the exceed COUNT is reported, never forced.
dependencies 3 imports · 0 importers
imports: nx_frame_codec.nxnx_deflate_fixed.nxnx_syscalls.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
| 14 | func bp(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 15 | func bn(v: i64) -> i64 { let b: *u8=sys_mmap(28); var m: i64=v; var k: i64=0; let t: *u8=sys_mmap(28); if m==0{t[0]=48;k=1}; while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1}; var i: i64=0; while i<k{b[i]=t[k-1-i];i=i+1}; sys_write(1,b,k); return 0 } |
| 16 | func lw(fd: i64, s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(fd,s,n); return 0 } |
| 17 | func ln(fd: i64, v: i64) -> i64 { let b: *u8=sys_mmap(28); var m: i64=v; var k: i64=0; let t: *u8=sys_mmap(28); if m==0{t[0]=48;k=1}; while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1}; var i: i64=0; while i<k{b[i]=t[k-1-i];i=i+1}; sys_write(fd,b,k); return 0 } |
| 20 | func sub_filter(buf: *u8, w: i64, h: i64, res: *u8) -> i64 |
| 34 | func med_filter(buf: *u8, w: i64, h: i64, res: *u8) -> i64 |
| 48 | func med_unfilter(res: *u8, w: i64, h: i64, out: *u8) -> i64 |
| 63 | func bench_buf(label: *u8, buf: *u8, w: i64, h: i64, scratch: *u8, cap: i64, rt: *i64) -> i64 |
| 91 | func main() -> i64 |