code wiki / _hdl_build / nx_h264_emit.nx
nx_h264_emit.nx
buildroot/runtime/_hdl_build/nx_h264_emit.nx
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
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
structs
| none |
consts
| 55 | const H_MODE: i64 = 0x1a4 |
| 56 | const H_MAXBUF: i64 = 4194304 |
functions
| 20 | func _p(s: *u8) -> i64 called by 1: main |
| 27 | func _fn(fd: i64, v: i64) -> i64 called by 1: main |
| 44 | func h_atoi(s: *u8) -> i64 called by 1: main |
| 59 | func bw_put(buf: *u8, posbox: *i64, val: i64, nbits: i64) -> i64 |
| 73 | func bw_bitlen(v: i64) -> i64 called by 1: bw_ue |
| 81 | func bw_ue(buf: *u8, posbox: *i64, v: i64) -> i64 |
| 90 | func bw_se(buf: *u8, posbox: *i64, v: i64) -> i64 |
| 96 | func bw_trailing(buf: *u8, posbox: *i64) -> i64 |
| 103 | func bw_align0(buf: *u8, posbox: *i64) -> i64 |
| 112 | func nal_emit(out: *u8, obox: *i64, nal_ref_idc: i64, nal_type: i64, rbsp: *u8, rlen: i64) -> i64 called by 1: main |
| 138 | func main(argc: i64, argv: *i64) -> i64 |