code wiki / _hdl_build / _codec_bench2.nx
_codec_bench2.nx
buildroot/runtime/_hdl_build/_codec_bench2.nx
about
_codec_bench2.nx -- Nishi-PNG vs real PNG filter set, SAME entropy stage (our deflate), SAME
corpus (no-wave, no external tool, no fabrication). For each frame, prefilter then deflate; PNG's
set = {Sub,Up,Avg,Paeth} whole-image-best; Nishi = MED (JPEG-LS median predictor, NOT in PNG's
set). Exceed iff MED+deflate < PNG-best+deflate. (Honest scope: whole-image filter not per-row;
real PNG does per-row best so this is a slightly-weak PNG -- noted. Synthetic frames are
LZ-friendly/unrepresentative; the real differentiator is photographic images.)
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
| 10 | 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 } |
| 11 | 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 } |
| 12 | func paeth(a: i64, b: i64, c: i64) -> i64 called by 1: apply_filter |
| 21 | func medpred(a: i64, b: i64, c: i64) -> i64 called by 1: apply_filter |
| 29 | func apply_filter(buf: *u8, w: i64, h: i64, res: *u8, mode: i64) -> i64 |
| 55 | func bench_frame(label: *u8, buf: *u8, w: i64, h: i64, res: *u8, dfo: *u8) -> i64 |
| 74 | func main() -> i64 |