nx_vmotion.nx
buildroot/runtime/nx_vmotion.nx
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
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
| 16 | const VC_ME_RNEAR: i64 = 8 |
| 17 | const VC_ME_EXTK: i64 = 94 |
| 18 | const VC_HEX_TRUST_DIV: i64 = 256 // hexagon trust bar divisor (see vm_search_hex); 256 == the far-ring trigger; 512 was measured and rejected |
functions
| 27 | func v128_sad16(a: *u8, b: *u8) -> i64 |
| 43 | func vm_sad(cur: *u8, prev: *u8, W: i64, cx: i64, cy: i64, px: i64, py: i64, T: i64) -> i64 |
| 78 | func vm_sad_capped(cur: *u8, prev: *u8, W: i64, cx: i64, cy: i64, px: i64, py: i64, T: i64, cap: i64) -> i64 |
| 111 | func vm_try(cur: *u8, prev: *u8, W: i64, H: i64, cx: i64, cy: i64, T: i64, dx: i64, dy: i64, b: *i64) -> i64 |
| 135 | func 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 |
| 167 | func vm_search(cur: *u8, prev: *u8, W: i64, H: i64, bx: i64, by: i64, T: i64, R: i64, mv: *i64, scr3: *i64) -> i64 |
| 185 | func 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 |
| 219 | func vm_search_hex(cur: *u8, prev: *u8, W: i64, H: i64, bx: i64, by: i64, T: i64, R: i64, mv: *i64, qp: i64, scr3: *i64) -> i64 |
| 289 | func vm_sad_zero(cur: *u8, prev: *u8, W: i64, bx: i64, by: i64, T: i64) -> i64 |
| 296 | func vm_reconstruct(dst: *u8, prev: *u8, residual: *i64, W: i64, bx: i64, by: i64, T: i64, mv: *i64) -> i64 |
| 317 | func vm_residual(cur: *u8, prev: *u8, residual: *i64, W: i64, bx: i64, by: i64, T: i64, mv: *i64) -> i64 |