code wiki / (root) / nx_critvis_lib.nx

nx_critvis_lib.nx

buildroot/runtime/nx_critvis_lib.nx

3761 B86 linesdepth 2pulls 2 transitivereach 2 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_critvis_lib.nx -- IMPORTABLE photoreal-critic scoring axes, extracted verbatim from the gate _hdl_build/nx_critic_visual.nx (which holds a main() and so cannot be imported). Same axes, same scaling, same names -> a future dedupe can swap the gate's local copies for this import with zero behavior change. Axes: fine_detail (1px micro-contrast over foreground) + STRUCTURE (8x8 block-mean variance; rejects noise) + chroma MAD; score = MIN of scaled axes, /1000; verdict PHOTOREAL>=700 / STYLIZED-CG>=400 / CLAY. license_tier: ORIGINAL

dependencies 1 imports · 2 importers

nx_syscalls.nx nx_critvis_lib.nx nx_assetvariant_gate.nx nx_motion_photo_gate.nx

imports: nx_syscalls.nx

imported by: nx_assetvariant_gate.nxnx_motion_photo_gate.nx

structs

none

consts

none

functions

9func cv_lum(g: i64) -> i64 { return ((g & 255) + ((g >> 8) & 255) + ((g >> 16) & 255)) / 3 }
10func cv_pl(g: i64) -> i64 { let r: i64 = g & 255; let b: i64 = (g >> 16) & 255; if r >= b { return 1 } return 0 }
11func cv_chroma(g: i64) -> i64
called by 1: ax_chroma
17func cv_abs(v: i64) -> i64 { if v < 0 { return 0 - v } return v }
18func cv_clamp(v: i64) -> i64 { if v < 0 { return 0 } if v > 1000 { return 1000 } return v }
called by 1: cv_score
20func ax_fine_detail(fb: *i64, w: i64, h: i64) -> i64
called by 1: cv_score calls 3: cv_plcv_lumcv_abs
38func ax_structure(fb: *i64, w: i64, h: i64) -> i64
called by 1: cv_score calls 2: sys_mmapcv_lum
63func ax_chroma(fb: *i64, w: i64, h: i64) -> i64
called by 1: cv_score calls 3: cv_plcv_chromacv_abs
73func cv_score(fb: *i64, w: i64, h: i64) -> i64
82func cv_verdict(s: i64) -> *u8
called by 1: main