code wiki / _hdl_build / nx_vcodec_mrbits_gate.nx

nx_vcodec_mrbits_gate.nx

buildroot/runtime/_hdl_build/nx_vcodec_mrbits_gate.nx

7267 B122 linesdepth 5pulls 14 transitivereach 0 importersview sourcekind gate/prooftopic vcodec
docsdependenciesstructsconstsfunctions

about

nx_vcodec_mrbits_gate.nx -- the REALIZED-BITS test of multi-reference prediction (does the vcv-7 build pay for itself?). The earlier nx_vcodec_multiref_gate measured residual SAD (an upper bound); this measures the ACTUAL CODED BITS: per 16x16 inter MB, ME on each reference -> real DCT+RDOQ residual entropy cost (ve_cost, the range coder's monotone proxy) + MV cost. Single-ref always uses N-1; multi-ref picks the cheaper of {N-1, N-2} and PAYS the 1-bit/MB ref-index. If multi-ref total bits < single-ref AFTER the overhead, the gain is REAL and the vcv-7 build is justified; if not, multi-ref loses to its own signaling and we DON'T build it (measure-first, no half-build). GREEN = reports the realized delta + it's positive. ORIGINAL.

dependencies 5 imports · 0 importers

nx_syscalls.nx nx_vmotion.nx nx_vtransform_dct2.nx nx_ventropy.nx nx_vcodec.nx nx_vcodec_mrbits_gate.nx

imports: nx_syscalls.nxnx_vmotion.nxnx_vtransform_dct2.nxnx_ventropy.nxnx_vcodec.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 mb_bits mvbits ve_blen ve_zze vt2_fwd vt2_1d_fwd vt2_quant_rdoq ve_blen ↻ ve_zze ↻ ve_cost ve_zz_idx ve_blen ↻ ve_zze ↻ mb_bits_compound mvbits ↻ vt2_fwd ↻ vt2_quant_rdoq ↻ ve_cost ↻ gn sys_mmap ↻ sys_write ↻

structs

none

consts

14const NW: i64 = 576
15const NH: i64 = 1024
16const T: i64 = 16
17const RSEARCH: i64 = 8

functions

19func 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
20func gn(v: i64) -> i64
called by 1: main calls 2: sys_mmapsys_write
25func mvbits(v: i64) -> i64 { return 5 + ve_blen(ve_zze(v)) } // ve_vput MV component cost
29func mb_bits(cur: *u8, ref: *u8, W: i64, cx: i64, cy: i64, mvx: i64, mvy: i64, qp: i64, blk: *i64) -> i64
44func mb_bits_compound(cur: *u8, r1: *u8, r2: *u8, W: i64, cx: i64, cy: i64, mvx1: i64, mvy1: i64, mvx2: i64, mvy2: i64, qp: i64, blk: *i64) -> i64
62func main() -> i64