code wiki / _hdl_build / nx_vcodec_mvbits_probe.nx

nx_vcodec_mvbits_probe.nx

buildroot/runtime/_hdl_build/nx_vcodec_mvbits_probe.nx

7883 B124 linesdepth 6pulls 17 transitivereach 0 importersview sourcekind probetopic vcodec
docsdependenciesstructsconstsfunctions

about

nx_vcodec_mvbits_probe.nx -- MEASURE the MV-coding overhead (handoff doctrine: sensor before build). Our MV syntax is ve_vput = flat [5-bit length][payload] per component + 4 qpel bits, coded ABSOLUTE (no prediction). x264 codes MV DELTAS vs the median of {left, top, top-right} neighbours -- near-zero deltas on smooth motion fields. This probe runs the REAL encoder (emode 4005, recon-chained, key+11P like arm_p) and, per coded MB, re-derives the same skip gate + integer/qpel-free MV the coder finds, tallying: (a) actual ve_vput bits, (b) bits if coded as delta-vs-median with the SAME VLC, (c) delta-vs-median with an exp-golomb VLC (the H.264-class mvd code). Against the frame's REAL total bytes -> MV share % and the measured prize of median prediction. Approximation: 16x16-level only (partition sub-MVs ignored -> UNDER-counts, conservative). license_tier: ORIGINAL

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_video_codec_wasm.nx nx_quality_metric.nx nx_vcodec_mvbits_probe.nx

imports: nx_syscalls.nxnx_video_codec_wasm.nxnx_quality_metric.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 vc_t8_init nx_dct8_init vc_t8p zero seedctxe sys_mmap ↻ vv_enc_rct8 vc_enc_frame_packed_rct8 rc_enc_init nx_bw_put vc_aq_level vc_mb_mad vc_mb_t8_ok vc_enc_block_packed_e vc_enc_block_packed_i vm_sad_zero vm_sad vs_skip nx_bw_put ↻ vc_intra_dc_sad vm_search vm_scan vc_enc_mb4r_intra vc_t8p ↻ vc_gather_edges vc_mpm_pred vc_pred_rich vc_mpm_put vc_coeff_enc vm_sad ↻

structs

none

consts

13const NW: i64 = 576
14const NH: i64 = 1024
15const EMODE: i64 = 4005

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
23func seedctxe(rctx: *i64, emode: i64, est: *i64, probs: *i64, rcbuf: *u8, t8c: *i64) -> i64
called by 1: main calls 1: sys_mmap
26func zero(p: *u8, n: i64) -> i64 { var i: i64=0; while i<n { p[i]=0 as u8; i=i+1 } return 0 }
called by 1: main
27func zze(v: i64) -> i64 { if v < 0 { return ((0 - v) << 1) - 1 } return v << 1 }
called by 2: vbitsgbits
28func blen(z: i64) -> i64 { var n: i64 = 0; var x: i64 = z; while x > 0 { n = n + 1; x = x >> 1 } return n }
called by 2: vbitsgbits
30func vbits(v: i64) -> i64 { return 5 + blen(zze(v)) }
called by 1: main calls 2: blenzze
32func gbits(v: i64) -> i64 { return 2*blen(zze(v)+1) - 1 }
called by 1: main calls 2: blenzze
33func med3(a: i64, b: i64, c: i64) -> i64
called by 1: main
38func main() -> i64