code wiki / _hdl_build / nx_ts_lumadiff.nx

nx_ts_lumadiff.nx

buildroot/runtime/_hdl_build/nx_ts_lumadiff.nx

10633 B231 linesdepth 6pulls 28 transitivereach 0 importersview sourcekind tooltopic ts
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_itoa_lib.nx nx_ts_es.nx nx_h264_sps.nx nx_h264_pps.nx nx_h264_iframe.nx nx_ts_lumadiff.nx

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

main ld_puts sys_write ld_atoi sys_openat_rd sys_mmap sys_read sys_close ld_r32 ld_r64 demux_video_es tsn_codec_of_stream_type find_first_nal nal_to_rbsp nx_h264_unescape_rbsp nx_h264_parse_sps sys_mmap ↻ br_init sys_mmap ↻ br_read_bits br_read_bit br_read_ue br_read_bit ↻ br_read_bits ↻ nx_h264_is_high br_read_se br_read_ue ↻ nx_h264_parse_pps sys_mmap ↻ br_init ↻ br_read_ue ↻ br_read_bits ↻ br_read_se ↻ ld_num nxi_out nxi_fd sys_mmap ↻ ccz_cat_num sys_write ↻ sys_munmap

structs

none

consts

16const LD_MAGIC_8388608: i64 = 8388608
17const LD_MAGIC_1048576: i64 = 1048576
18const LD_MAGIC_1024: i64 = 1024
20const LD_WIN: i64 = 3145728 // bytes read at each keyframe offset; one IDR access unit fits
21const LD_SIGW: i64 = 16 // signature grid width (cells)
22const LD_SIGH: i64 = 9 // signature grid height (cells)
23const LD_NALCAP: i64 = 4194304
24const LD_HEAD: i64 = 262144 // head read for SPS/PPS
25const LD_DEFSAMP: i64 = 40 // default number of keyframes sampled across the file

functions

27func 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 }
called by 1: main calls 1: sys_write
34func ld_num(v: i64) -> i64 { nxi_out(v); return 0 }
called by 1: main calls 1: nxi_out
35func ld_atoi(s: *u8) -> i64
called by 1: main
41func ld_r32(b: *u8, o: i64) -> i64
called by 1: main
44func ld_r64(b: *u8, o: i64) -> i64
called by 1: main
51func ld_signature(yf: *u8, W: i64, cropW: i64, cropH: i64, sig: *i64) -> i64
called by 1: main
79func main(argc: i64, argv: *i64) -> i64