code wiki / _hdl_build / nx_vcodec_speed_bench.nx
nx_vcodec_speed_bench.nx
buildroot/runtime/_hdl_build/nx_vcodec_speed_bench.nx
about
nx_vcodec_speed_bench.nx -- the GO/NO-GO number for wiring the sovereign video codec into the live
room (operator: "way more than 20fps"; the measured edge fan-out ceiling is ~1.1MB/s, so 60fps x 7
receivers needs SMALL frames = this codec's P-frames). Encodes a keyframe + 30 P-frames of talking-
head-like content at call resolution 320x224, timing ENCODE and DECODE per frame, PLUS RGB-PSNR of the
decoded output vs the raw source (speed claims must carry their quality cost -- no false positives).
TWO PASSES measure the QP-DERIVED SKIP THRESHOLD trade discovered by the 2026-07-03 stage profile
(280/280 blocks failed skip at thresh=64: quantization noise on a STATIC block is ~QP*avg-err*256 SAD,
so the tight threshold ran full ME+qpel+DCT on every block every frame):
PASS A: sad_thresh=64 (the old always-code baseline)
PASS B: sad_thresh=QP*128 (QP-derived: tolerates quant noise, catches real motion) -- encoder-side
ONLY (the skip flag already exists in the bitstream; decoders are agnostic).
Ledger-reported (return-and-report). expect_exit: 0 = measurement sound. license_tier: ORIGINAL
dependencies 4 imports · 0 importers
imports: nx_syscalls.nxnx_vcodec_color_codec.nxnx_quality_metric.nxnx_metric_ledger.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
| 17 | const VB_MAGIC_7919: i64 = 7919 |
| 18 | const VB_MAGIC_1103515245: i64 = 1103515245 |
| 19 | const VB_MAGIC_12345: i64 = 12345 |
| 20 | const VB_MAGIC_4096: i64 = 4096 |
| 21 | const VB_MAGIC_1000000: i64 = 1000000 |
| 22 | const VB_MAGIC_2500: i64 = 2500 |
| 24 | const VB_W: i64 = 320 |
| 25 | const VB_H: i64 = 224 |
| 26 | const VB_QP: i64 = 32 |
| 27 | const VB_PFRAMES: i64 = 30 |
functions
| 29 | func vw2(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 30 | func vn2(v: i64) -> i64 |
| 36 | func vb_background(rgb: *u8, W: i64, H: i64) -> i64 called by 1: bench_pass |
| 57 | func vb_noise(rgb: *u8, W: i64, H: i64, fi: i64, amp: i64) -> i64 called by 1: bench_pass |
| 72 | func vb_face(rgb: *u8, W: i64, H: i64, fi: i64) -> i64 called by 1: bench_pass |
| 94 | func bench_pass(sad_thresh: i64, res: *i64) -> i64 |
| 165 | func pass_report(tag: *u8, r: *i64) -> i64 |
| 175 | func main() -> i64 |