code wiki / (root) / nx_h264_nal.nx

nx_h264_nal.nx

buildroot/runtime/nx_h264_nal.nx

2689 B65 linesdepth 2pulls 2 transitivereach 14 importersview sourcekind librarytopic h264
docsdependenciesstructsconstsfunctions

about

nx_h264_nal.nx -- H.264 NAL unit splitter + header decode (rung 2b). A coded video sample is a sequence of NAL (Network Abstraction Layer) units. Two framings: AVCC (MP4 sample): [length:lenSize BE][NAL bytes] repeated. lenSize comes from the avcC config (lengthSizeMinusOne+1), usually 4. Annex B (raw .h264): start code 00 00 01 (or 00 00 00 01) before each NAL. First NAL byte = forbidden_zero(1) + nal_ref_idc(2) + nal_unit_type(5): type 7=SPS 8=PPS 6=SEI 5=IDR-slice 1=non-IDR-slice 9=AUD. This locates each NAL + its type so the SPS/PPS/slice parsers (next rungs, which use nx_h264_bits) know what to read. Settled framing; KAT-gated. genealogy_id: itu_t_h264_nal_framing + iso_bmff_avcc_length_prefix lineage_id: nal_split_avcc + nal_split_annexb + nal_header_decode license_tier: ORIGINAL

dependencies 1 imports · 13 importers

nx_syscalls.nx nx_h264_nal.nx nx_h264_bframe_probe.nx nx_h264_bframe_reflist_gate.nx nx_h264_bframe_walk.nx nx_h264_brecon.nx nx_h264_colmv_gate.nx nx_h264_decode_frame.nx nx_h264_mv_recon_gate.nx nx_h264_nal_gate.nx nx_h264_pframe_probe.nx nx_h264_pframe_recon.nx

diagram shows first 10 each side; +0 more imports, +3 more importers in the complete lists below.

imports: nx_syscalls.nx

imported by: nx_h264_bframe_probe.nxnx_h264_bframe_reflist_gate.nxnx_h264_bframe_walk.nxnx_h264_brecon.nxnx_h264_colmv_gate.nxnx_h264_decode_frame.nxnx_h264_mv_recon_gate.nxnx_h264_nal_gate.nxnx_h264_pframe_probe.nxnx_h264_pframe_recon.nxnx_h264_pframe_walk.nxnx_h264_slice_extract.nxnx_mp4_es.nx

structs

none

consts

none

functions

17func nx_nal_type(first_byte: i64) -> i64 { return first_byte & 31 }
called by 1: main
18func nx_nal_ref_idc(first_byte: i64) -> i64 { return (first_byte >> 5) & 3 }
called by 1: main
21func nal_be(d: *u8, o: i64, n: i64) -> i64
called by 1: nx_nal_split_avcc
31func nx_nal_split_avcc(d: *u8, start: i64, end: i64, len_size: i64, offs: *i64, types: *i64, max: i64) -> i64
called by 8: mainmainmainmainmainmain+2 calls 1: nal_be
51func nx_nal_split_annexb(d: *u8, start: i64, end: i64, offs: *i64, types: *i64, max: i64) -> i64