code wiki / _hdl_build / nx_ts_lumadiff.nx
nx_ts_lumadiff.nx
buildroot/runtime/_hdl_build/nx_ts_lumadiff.nx
about
nx_ts_lumadiff.nx -- VISUAL dead-air measurement.
Byte-rate analysis CANNOT see dead air in this corpus (measured 2026-07-31: audio is CBR AAC,
video is rate-controlled, p25/p50 = 79-94%). But "nothing is happening" IS visible in the
PIXELS. This seeks to NXVI keyframe byte offsets, decodes luma with the gate-proven CAVLC
I-frame decoder, reduces each frame to a 16x9 luma signature, and reports the mean absolute
difference between consecutive sampled frames. Low MAD run = static = dead air.
Reuses nx_ts_es (lifted verbatim from nx_cam_poster, byte-identical proven) + nx_h264_iframe.
nx_ts_lumadiff <in.ts> <in.idx> [max_samples]
license_tier: ORIGINAL
dependencies 6 imports · 0 importers
imports: nx_syscalls.nxnx_itoa_lib.nxnx_ts_es.nxnx_h264_sps.nxnx_h264_pps.nxnx_h264_iframe.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
| 16 | const LD_MAGIC_8388608: i64 = 8388608 |
| 17 | const LD_MAGIC_1048576: i64 = 1048576 |
| 18 | const LD_MAGIC_1024: i64 = 1024 |
| 20 | const LD_WIN: i64 = 3145728 // bytes read at each keyframe offset; one IDR access unit fits |
| 21 | const LD_SIGW: i64 = 16 // signature grid width (cells) |
| 22 | const LD_SIGH: i64 = 9 // signature grid height (cells) |
| 23 | const LD_NALCAP: i64 = 4194304 |
| 24 | const LD_HEAD: i64 = 262144 // head read for SPS/PPS |
| 25 | const LD_DEFSAMP: i64 = 40 // default number of keyframes sampled across the file |
functions
| 27 | func ld_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } |
| 34 | func ld_num(v: i64) -> i64 { nxi_out(v); return 0 } |
| 35 | func ld_atoi(s: *u8) -> i64 called by 1: main |
| 41 | func ld_r32(b: *u8, o: i64) -> i64 called by 1: main |
| 44 | func ld_r64(b: *u8, o: i64) -> i64 called by 1: main |
| 51 | func ld_signature(yf: *u8, W: i64, cropW: i64, cropH: i64, sig: *i64) -> i64 called by 1: main |
| 79 | func main(argc: i64, argv: *i64) -> i64 |