code wiki / _hdl_build / nx_vcodec_multiref_gate.nx

nx_vcodec_multiref_gate.nx

buildroot/runtime/_hdl_build/nx_vcodec_multiref_gate.nx

5882 B96 linesdepth 2pulls 3 transitivereach 0 importersview sourcekind gate/prooftopic vcodec
docsdependenciesstructsconstsfunctions

about

nx_vcodec_multiref_gate.nx -- MEASURES the latency-safe B-frame lever: does predicting from TWO PAST references (multi-ref best-of + COMPOUND averaging) shrink the residual vs single-ref (previous frame only)? This is how low-latency RTC codecs get B-frame-like gains WITHOUT the reorder/latency of classic bidirectional B (which references a FUTURE frame). Per 16x16 block, on real frames, measures total residual SAD for: (1) single-ref = prev frame N-1; (2) multi-ref = best-of {N-1, N-2, N-4 long-term}; (3) compound = average of the two best past predictions. The SAD reduction = the upper-bound prediction gain a multi-ref/ compound generation would win. GREEN reports the measured reduction (build-decision, not pass/fail-of-idea). license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_vmotion.nx nx_vcodec_multiref_gate.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 inb compound_sad gn sys_mmap ↻ sys_write ↻

structs

none

consts

12const NW: i64 = 576
13const NH: i64 = 1024
14const T: i64 = 16
15const R: i64 = 8

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 compound_sad(cur: *u8, r1: *u8, r2: *u8, W: i64, cx: i64, cy: i64, mvx1: i64, mvy1: i64, mvx2: i64, mvy2: i64) -> i64
called by 1: main
36func inb(cx: i64, cy: i64, mvx: i64, mvy: i64) -> i64 { // is the MC block fully in-frame?
called by 1: main
41func main() -> i64