code wiki / _hdl_build / nx_vcodec_speed_bench.nx

nx_vcodec_speed_bench.nx

buildroot/runtime/_hdl_build/nx_vcodec_speed_bench.nx

10415 B220 linesdepth 6pulls 19 transitivereach 0 importersview sourcekind benchtopic vcodec
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_vcodec_color_codec.nx nx_quality_metric.nx nx_metric_ledger.nx nx_vcodec_speed_bench.nx

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

main vw2 sys_write sys_mmap bench_pass sys_mmap ↻ vb_background vb_face vb_noise sys_now_us sys_mmap ↻ sys_clock_gettime_mono vc_color_encode_p rgb_frame_to_yuv sys_mmap ↻ rgb_to_ycbcr clamp8 subsample420 vc_enc_frame_packed vc_enc_frame_packed_tf nx_bw_put vc_aq_level vc_mb_mad vc_enc_block_packed vc_enc_block_packed_e vc_aq_qp vc_color_decode_p vc_dec_frame_packed vc_dec_frame_packed_tf nx_br_get vc_dec_block_packed vc_dec_block_packed_e vc_aq_qp ↻ upsample420 ycbcr_to_rgb clamp8 ↻ qm_psnr_cdb qm_mse qm_log2_q16 pass_report

structs

none

consts

17const VB_MAGIC_7919: i64 = 7919
18const VB_MAGIC_1103515245: i64 = 1103515245
19const VB_MAGIC_12345: i64 = 12345
20const VB_MAGIC_4096: i64 = 4096
21const VB_MAGIC_1000000: i64 = 1000000
22const VB_MAGIC_2500: i64 = 2500
24const VB_W: i64 = 320
25const VB_H: i64 = 224
26const VB_QP: i64 = 32
27const VB_PFRAMES: i64 = 30

functions

29func vw2(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
called by 2: pass_reportmain calls 1: sys_write
30func vn2(v: i64) -> i64
called by 2: pass_reportmain calls 2: sys_mmapsys_write
36func vb_background(rgb: *u8, W: i64, H: i64) -> i64
called by 1: bench_pass
57func vb_noise(rgb: *u8, W: i64, H: i64, fi: i64, amp: i64) -> i64
called by 1: bench_pass
72func vb_face(rgb: *u8, W: i64, H: i64, fi: i64) -> i64
called by 1: bench_pass
94func bench_pass(sad_thresh: i64, res: *i64) -> i64
165func pass_report(tag: *u8, r: *i64) -> i64
called by 1: main calls 2: vw2vn2
175func main() -> i64