code wiki / _hdl_build / nx_cam_poster.nx
nx_cam_poster.nx
buildroot/runtime/_hdl_build/nx_cam_poster.nx
about
nx_cam_poster.nx -- SOVEREIGN cam-recording POSTER generator (STEP 4 glue), CAVLC path.
TS -> first IDR (reuse nx_ts2fmp4's PAT/PMT/vidPID demux logic) -> nx_h264_decode_iframe (CAVLC full-YUV
recon) -> YUV420->RGB (BT.601) -> integer box-average downscale (reuse nx_galx_thumb's scaler) ->
jcw_write_color -> baseline JPEG on disk. No ffmpeg, no external calls. For CABAC streams it skips
gracefully (the CABAC decoder is a separate rung). Usage: nx_cam_poster <in.ts> <out.jpg>
license_tier: ORIGINAL
dependencies 15 imports · 0 importers
diagram shows first 10 each side; +5 more imports, +0 more importers in the complete lists below.
imports: nx_syscalls.nxnx_ts_nal.nxnx_h264_sps.nxnx_h264_pps.nxnx_h264_iframe.nxnx_h264_bitwriter.nxnx_dct8.nxnx_quant_table.nxnx_zigzag.nxnx_jpeg_huff_enc.nxnx_jpeg_block_enc.nxnx_jpeg_write.nxnx_jpeg_color_write.nxnx_ts_es.nxnx_mp4_es.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
| 22 | const POSTER_MAGIC_2026: i64 = 2026 |
| 23 | const POSTER_MAGIC_91881: i64 = 91881 |
| 24 | const POSTER_MAGIC_22554: i64 = 22554 |
| 25 | const POSTER_MAGIC_46802: i64 = 46802 |
| 26 | const POSTER_MAGIC_116130: i64 = 116130 |
| 27 | const POSTER_MAGIC_1024: i64 = 1024 |
| 28 | const POSTER_MAGIC_8192: i64 = 8192 |
| 30 | const PRECHECK: i64 = 262144 // phase-1 read: covers PAT/PMT/SPS/PPS -> fast CABAC skip (rule 11) |
| 31 | const POSTER_MAX: i64 = 480 // longest poster side in px (data-driven cap, rule 11) |
| 32 | const JPEG_QUALITY: i64 = 80 |
| 38 | const CP_MAX_MB_DIM: i64 = 1024 // per-axis MB cap (16384 px, above 8K) -- also prevents mbW*mbH i64 overflow |
| 39 | const CP_MAX_MBS: i64 = 696320 // H.264 Level 6.2 MaxFS (largest legal coded frame, in macroblocks) |
functions
| 41 | func cp_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } |
| 42 | func cp_num(v: i64) -> i64 |
| 56 | func read_head(path: *u8, buf: *u8) -> i64 |
| 70 | func build_poster_rgb(yf: *u8, uf: *u8, vf: *u8, W: i64, cpW: i64, cropW: i64, cropH: i64, dstW: i64, dstH: i64, dst: *u8) -> i64 called by 1: main |
| 118 | func encode_jpeg(out: *u8, dstW: i64, dstH: i64, rgb: *u8) -> i64 |
| 148 | func rd8(v: i64) -> i64 { var r: i64 = (v/8)*8; if r < 8 { r = 8 } return r } called by 1: main |
| 150 | func main(argc: i64, argv: *i64) -> i64 |