code wiki / (root) / nx_vtransform.nx

nx_vtransform.nx

buildroot/runtime/nx_vtransform.nx

2662 B53 linesdepth 0pulls 0 transitivereach 112 importersview sourcekind librarytopic vtransform
docsdependenciesstructsconstsfunctions

about

nx_vtransform.nx -- sovereign 4x4 integer TRANSFORM + QUANTIZE for the motion-comp residual (V-R2). After motion compensation the residual block is small + smooth; a separable 4x4 Walsh-Hadamard transform compacts its energy into a few coefficients (mostly DC), then quantization zeros the small ones -> very few nonzero values to entropy-code. This is the transform+quant stage VP8/H.264 use (they use an integer DCT; WHT is the integer, EXACTLY-invertible first rung -- integer-DCT is a later refinement). Pure integer ops, no FPU/syscalls. Block = 16 i64 row-major (a 4x4 residual). license_tier: ORIGINAL

dependencies 0 imports · 5 importers

nx_vtransform.nx nx_rd_intra_gate.nx nx_rdcurve_gate.nx nx_vcodec.nx nx_vtransform_dct_gate.nx nx_vtransform_gate.nx

imports: none

imported by: nx_rd_intra_gate.nxnx_rdcurve_gate.nxnx_vcodec.nxnx_vtransform_dct_gate.nxnx_vtransform_gate.nx

structs

none

consts

none

functions

9func vt_wht4(b: *i64, base: i64, st: i64) -> i64
called by 2: vt_fwdvt_inv
25func vt_fwd(blk: *i64) -> i64
31func vt_inv(blk: *i64) -> i64
39func vt_quant(blk: *i64, q: i64) -> i64
51func vt_dequant(blk: *i64, q: i64) -> i64 { var i: i64 = 0; while i < 16 { blk[i] = blk[i] * q; i = i + 1 } return 0 }
53func vt_nonzero(blk: *i64) -> i64 { var nz: i64 = 0; var i: i64 = 0; while i < 16 { if blk[i] != 0 { nz = nz + 1 } i = i + 1 } return nz }
called by 1: main