code wiki / (root) / nx_h264_ts_probe.nx

nx_h264_ts_probe.nx

buildroot/runtime/nx_h264_ts_probe.nx

11384 B254 linesdepth 4pulls 5 transitivereach 0 importersview sourcekind probetopic h264
docsdependenciesstructsconstsfunctions

about

nx_h264_ts_probe.nx -- STEP 0 decisive probe for the cam-poster build. Reads a real MPEG-TS cam recording, demuxes the video PES (reusing the proven nx_ts2fmp4 PAT->PMT->video-PID->ES logic), NAL-walks the elementary stream for SPS (type 7) + PPS (type 8), and reports the two facts that LOCK the decode path: PPS.entropy_coding_mode_flag (0=CAVLC, 1=CABAC) -> which entropy decoder PPS.transform_8x8_mode_flag (High-profile 8x8) -> which inverse transform plus SPS profile_idc/level/dims. main() is intentionally decomposed into small functions (nx_cc SIGSEGVs on an over-large function body). license_tier: ORIGINAL

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_h264_bits.nx nx_h264_sps.nx nx_h264_pps.nx nx_h264_ts_probe.nx

imports: nx_syscalls.nxnx_h264_bits.nxnx_h264_sps.nxnx_h264_pps.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main pp sys_write sys_mmap read_head sys_openat_rd sys_read sys_close demux_video_es pn sys_mmap ↻ sys_write ↻ find_first_nal report_sps sys_mmap ↻ 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 ↻ pp ↻ pn ↻ nx_h264_is_high ↻ report_pps sys_mmap ↻ nal_to_rbsp ↻ nx_h264_parse_pps sys_mmap ↻ br_init ↻ br_read_ue ↻ br_read_bits ↻

structs

none

consts

13const K_MAGIC_1024: i64 = 1024
15const MAXSCAN: i64 = 8388608 // 8 MiB from head: covers the first IDR + its SPS/PPS

functions

17func pp(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 3: report_spsreport_ppsmain calls 1: sys_write
18func pn(v: i64) -> i64
33func lb_bit(data: *u8, len: i64, pos: *i64) -> i64
called by 2: lb_bitslb_ue
40func lb_bits(data: *u8, len: i64, pos: *i64, n: i64) -> i64
called by 2: lb_ueprobe_parse_pps_full calls 1: lb_bit
46func lb_ue(data: *u8, len: i64, pos: *i64) -> i64
57func lb_se(data: *u8, len: i64, pos: *i64) -> i64
called by 1: probe_parse_pps_full calls 1: lb_ue
66func probe_more_rbsp(data: *u8, len: i64, curpos: i64) -> i64
83func probe_parse_pps_full(rbsp: *u8, len: i64, out: *i64) -> i64
113func read_head(path: *u8, buf: *u8) -> i64
called by 1: main calls 3: sys_openat_rdsys_readsys_close
129func demux_video_es(filebuf: *u8, total: i64, es: *u8, pidout: *i64) -> i64
called by 1: main
177func find_first_nal(es: *u8, eslen: i64, want: i64, dst: *u8, cap: i64) -> i64
called by 1: main
201func nal_to_rbsp(nal: *u8, nallen: i64, rbsp: *u8) -> i64
205func report_sps(nal: *u8, nallen: i64) -> i64
217func report_pps(nal: *u8, nallen: i64) -> i64
233func main(argc: i64, argv: *i64) -> i64