code wiki / _hdl_build / nx_vcodec_bframe_ceiling.nx

nx_vcodec_bframe_ceiling.nx

buildroot/runtime/_hdl_build/nx_vcodec_bframe_ceiling.nx

5780 B99 linesdepth 2pulls 3 transitivereach 0 importersview sourcekind tooltopic vcodec
docsdependenciesstructsconstsfunctions

about

nx_vcodec_bframe_ceiling.nx -- measure the B-FRAME ceiling, decoder-transparent. B-frames (bidirectional prediction) are x264's single biggest lever and the residual decomposition points here: our P-frames are ~5-9x behind x264 while intra is only 2.6x, and sub-pel (6-tap re-audit) is dead -> the gap is STRUCTURAL prediction. A B-frame predicts each block as the AVERAGE of a best-match in a PAST ref and a best-match in a FUTURE ref: averaging cancels noise, and (the big win) reveal/occlusion regions that one direction cannot predict are covered by the other. This probe, on the aptly named bframe_test, integer-searches each interior 16x16 block against both the previous AND next CLEAN frame, and compares the residual of uni-directional (past-only, what our codec does today) vs bi-directional (past+future avg). A large bi<uni cut = B-frames are THE lever and the (pervasive, VOD-only) enc+dec+reorder build is justified; a small cut = look elsewhere (multi-ref, partitions). Pure measurement on clean originals => no bitstream, no parity risk. license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_vmotion.nx nx_vcodec_bframe_ceiling.nx

imports: nx_syscalls.nxnx_vmotion.nx

imported by: nobody (leaf or entry point)

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

main sys_mmap gw sys_write sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close vm_search vm_scan vm_try vm_sad_capped v128_sad16 bi_sad gn sys_mmap ↻ sys_write ↻

structs

none

consts

12const K_MAGIC_2026: i64 = 2026
14const NW: i64 = 576
15const NH: i64 = 1024

functions

17func gw(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 1: main calls 1: sys_write
18func gn(v: i64) -> i64
called by 1: main calls 2: sys_mmapsys_write
24func bi_sad(cur: *u8, past: *u8, fut: *u8, W: i64, cx: i64, cy: i64,
called by 1: main
43func main() -> i64