code wiki / _hdl_build / nx_vcodec_mrbits_gate.nx
nx_vcodec_mrbits_gate.nx
buildroot/runtime/_hdl_build/nx_vcodec_mrbits_gate.nx
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
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
structs
| none |
consts
| 14 | const NW: i64 = 576 |
| 15 | const NH: i64 = 1024 |
| 16 | const T: i64 = 16 |
| 17 | const RSEARCH: i64 = 8 |
functions
| 19 | func gw(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 20 | func gn(v: i64) -> i64 |
| 25 | func mvbits(v: i64) -> i64 { return 5 + ve_blen(ve_zze(v)) } // ve_vput MV component cost |
| 29 | func mb_bits(cur: *u8, ref: *u8, W: i64, cx: i64, cy: i64, mvx: i64, mvy: i64, qp: i64, blk: *i64) -> i64 |
| 44 | func 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 |
| 62 | func main() -> i64 |