code wiki / _hdl_build / nx_h264_emit.nx

nx_h264_emit.nx

buildroot/runtime/_hdl_build/nx_h264_emit.nx

9940 B249 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind tooltopic h264
docsdependenciesstructsconstsfunctions

about

nx_h264_emit.nx -- emit a VALID H.264 Annex-B bitstream: SPS + PPS + IDR slice of I_PCM macroblocks. argv: <outfile> [mbw] [mbh] WHY I_PCM: it carries raw samples, so a decoder that accepts this stream has exercised our NAL framing, emulation-prevention, exp-golomb writer, SPS, PPS and slice header WITHOUT us needing a transform, prediction or entropy coder. It isolates BITSTREAM CONFORMANCE from compression, which is exactly the axis `video|codec-conformance` declares. The pixels come back bit-exact or the stream was wrong -- there is no "close enough" to hide behind. The whole point is that the judge is EXTERNAL: ffmpeg is the reference decoder and it is installed on this host. Our own gates cannot grade this; a decoder we did not write either accepts the stream or does not. license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 1 imports · 0 importers

nx_seg_store.nx nx_h264_emit.nx

imports: nx_seg_store.nx

imported by: nobody (leaf or entry point)

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

main _p h_atoi bw_put bw_ue bw_bitlen bw_put ↻ bw_trailing bw_put ↻ nal_emit bw_se bw_ue ↻ bw_align0 bw_put ↻ sys_openat_wr _fn

structs

none

consts

55const H_MODE: i64 = 0x1a4
56const H_MAXBUF: i64 = 4194304

functions

20func _p(s: *u8) -> i64
called by 1: main
27func _fn(fd: i64, v: i64) -> i64
called by 1: main
44func h_atoi(s: *u8) -> i64
called by 1: main
59func bw_put(buf: *u8, posbox: *i64, val: i64, nbits: i64) -> i64
73func bw_bitlen(v: i64) -> i64
called by 1: bw_ue
81func bw_ue(buf: *u8, posbox: *i64, v: i64) -> i64
called by 2: bw_semain calls 2: bw_bitlenbw_put
90func bw_se(buf: *u8, posbox: *i64, v: i64) -> i64
called by 1: main calls 1: bw_ue
96func bw_trailing(buf: *u8, posbox: *i64) -> i64
called by 1: main calls 1: bw_put
103func bw_align0(buf: *u8, posbox: *i64) -> i64
called by 1: main calls 1: bw_put
112func nal_emit(out: *u8, obox: *i64, nal_ref_idc: i64, nal_type: i64, rbsp: *u8, rlen: i64) -> i64
called by 1: main
138func main(argc: i64, argv: *i64) -> i64