nx_critvis_lib.nx
buildroot/runtime/nx_critvis_lib.nx
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
imports: nx_syscalls.nx
imported by: nx_assetvariant_gate.nxnx_motion_photo_gate.nx
structs
| none |
consts
| none |
functions
| 9 | func cv_lum(g: i64) -> i64 { return ((g & 255) + ((g >> 8) & 255) + ((g >> 16) & 255)) / 3 } |
| 10 | func cv_pl(g: i64) -> i64 { let r: i64 = g & 255; let b: i64 = (g >> 16) & 255; if r >= b { return 1 } return 0 } |
| 11 | func cv_chroma(g: i64) -> i64 called by 1: ax_chroma |
| 17 | func cv_abs(v: i64) -> i64 { if v < 0 { return 0 - v } return v } |
| 18 | func cv_clamp(v: i64) -> i64 { if v < 0 { return 0 } if v > 1000 { return 1000 } return v } called by 1: cv_score |
| 20 | func ax_fine_detail(fb: *i64, w: i64, h: i64) -> i64 |
| 38 | func ax_structure(fb: *i64, w: i64, h: i64) -> i64 |
| 63 | func ax_chroma(fb: *i64, w: i64, h: i64) -> i64 |
| 73 | func cv_score(fb: *i64, w: i64, h: i64) -> i64 |
| 82 | func cv_verdict(s: i64) -> *u8 called by 1: main |