code wiki / (root) / nx_vmotion.nx

nx_vmotion.nx

buildroot/runtime/nx_vmotion.nx

13104 B259 linesdepth 0pulls 0 transitivereach 114 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_vmotion.nx -- sovereign BLOCK MOTION COMPENSATION: the core trick VP8/H.264 use to beat plain tile-delta. When the camera pans or a head moves, EVERY tile's pixels change (tile-delta would resend them all), but the content just SHIFTED -- so for each block we search the PREVIOUS frame for the best-matching block (minimum SAD = sum of absolute differences) and send a tiny MOTION VECTOR (dx,dy) + a small residual instead of the whole block. A pan that costs tile-delta ~100% of the frame costs motion-comp a few vectors + near-zero residual. Pure integer buffer ops (no FPU, no syscalls) -> wasm-friendly sender-side encode. license_tier: ORIGINAL

dependencies 0 imports · 11 importers

nx_vmotion.nx nx_v128_probe.nx nx_vcodec.nx nx_vcodec_bframe_ceiling.nx nx_vcodec_mrbits_gate.nx nx_vcodec_multiref_gate.nx nx_vcodec_predceiling_gate.nx nx_vcodec_seqdiag_gate.nx nx_vcodec_skiprate_gate.nx nx_vcodec_subpel_ceil.nx nx_vcodec_subpel_ceiling.nx

diagram shows first 10 each side; +0 more imports, +1 more importers in the complete lists below.

imports: none

imported by: nx_v128_probe.nxnx_vcodec.nxnx_vcodec_bframe_ceiling.nxnx_vcodec_mrbits_gate.nxnx_vcodec_multiref_gate.nxnx_vcodec_predceiling_gate.nxnx_vcodec_seqdiag_gate.nxnx_vcodec_skiprate_gate.nxnx_vcodec_subpel_ceil.nxnx_vcodec_subpel_ceiling.nxnx_vmotion_gate.nx

structs

none

consts

16const VC_ME_RNEAR: i64 = 8
17const VC_ME_EXTK: i64 = 94

functions

26func v128_sad16(a: *u8, b: *u8) -> i64
42func vm_sad(cur: *u8, prev: *u8, W: i64, cx: i64, cy: i64, px: i64, py: i64, T: i64) -> i64
77func vm_sad_capped(cur: *u8, prev: *u8, W: i64, cx: i64, cy: i64, px: i64, py: i64, T: i64, cap: i64) -> i64
110func vm_try(cur: *u8, prev: *u8, W: i64, H: i64, cx: i64, cy: i64, T: i64, dx: i64, dy: i64, b: *i64) -> i64
called by 1: vm_scan calls 1: vm_sad_capped
134func vm_scan(cur: *u8, prev: *u8, W: i64, H: i64, cx: i64, cy: i64, T: i64, R: i64, b: *i64, vfloor: i64, r0: i64) -> i64
called by 2: vm_searchvm_search_q calls 1: vm_try
184func vm_search_q(cur: *u8, prev: *u8, W: i64, H: i64, bx: i64, by: i64, T: i64, R: i64, mv: *i64, qp: i64, scr3: *i64) -> i64
211func vm_sad_zero(cur: *u8, prev: *u8, W: i64, bx: i64, by: i64, T: i64) -> i64
218func vm_reconstruct(dst: *u8, prev: *u8, residual: *i64, W: i64, bx: i64, by: i64, T: i64, mv: *i64) -> i64
called by 1: main
239func vm_residual(cur: *u8, prev: *u8, residual: *i64, W: i64, bx: i64, by: i64, T: i64, mv: *i64) -> i64
called by 1: main