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 |
functions
| 26 | func v128_sad16(a: *u8, b: *u8) -> i64 |
| 42 | func vm_sad(cur: *u8, prev: *u8, W: i64, cx: i64, cy: i64, px: i64, py: i64, T: i64) -> i64 |
| 77 | func vm_sad_capped(cur: *u8, prev: *u8, W: i64, cx: i64, cy: i64, px: i64, py: i64, T: i64, cap: i64) -> i64 |
| 110 | func vm_try(cur: *u8, prev: *u8, W: i64, H: i64, cx: i64, cy: i64, T: i64, dx: i64, dy: i64, b: *i64) -> i64 |
| 134 | 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 |
| 166 | func vm_search(cur: *u8, prev: *u8, W: i64, H: i64, bx: i64, by: i64, T: i64, R: i64, mv: *i64, scr3: *i64) -> i64 |
| 184 | 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 called by 10: mainvc_me8vc_rd_part_intervc_rd_part_inter_rcvc_enc_block_packed_ivc_enc_frame_packed_b+4 calls 1: vm_scan |
| 211 | func vm_sad_zero(cur: *u8, prev: *u8, W: i64, bx: i64, by: i64, T: i64) -> i64 called by 16: vc_enc_blockvc_enc_block_packed_evc_enc_block_packed_ivc_enc_frame_packed_rct9runvmain+10 calls 1: vm_sad |
| 218 | func vm_reconstruct(dst: *u8, prev: *u8, residual: *i64, W: i64, bx: i64, by: i64, T: i64, mv: *i64) -> i64 called by 1: main |
| 239 | func vm_residual(cur: *u8, prev: *u8, residual: *i64, W: i64, bx: i64, by: i64, T: i64, mv: *i64) -> i64 called by 1: main |