code wiki / (root) / nx_vq.nx

nx_vq.nx

buildroot/runtime/nx_vq.nx

1713 B39 linesdepth 0pulls 0 transitivereach 5 importersview sourcekind librarytopic vq
docsdependenciesstructsconstsfunctions

about

nx_vq.nx -- VECTOR QUANTIZATION, the first rung of the sovereign neural-audio moonshot. Instead of scalar-quantising each LPC reflection coefficient (D coeffs x 8 bits), VQ maps the WHOLE coefficient vector to the nearest entry in a learned codebook and transmits one small index (log2(K) bits). This is the exact classical precursor to the residual vector quant(RVQ) codebooks inside SoundStream / Lyra-v2 -- the lever that takes our DRED redundancy overhead from ~44 kb/s (scalar i8) toward the 12-32 kb/s neural target. The codebook QUALITY (coverage of the space) is the training problem whose ceiling is the neural net; the VQ MECHANISM here is exact + integer. license_tier: ORIGINAL

dependencies 0 imports · 5 importers

nx_vq.nx nx_rvq.nx nx_rvq_gate.nx nx_vq_dred_gate.nx nx_vq_train.nx nx_vq_train_gate.nx

imports: none

imported by: nx_rvq.nxnx_rvq_gate.nxnx_vq_dred_gate.nxnx_vq_train.nxnx_vq_train_gate.nx

structs

none

consts

none

functions

9func vq_dist2(v: *i64, cb: *i64, k: i64, D: i64) -> i64
16func vq_encode(v: *i64, cb: *i64, K: i64, D: i64) -> i64
28func vq_decode(k: i64, cb: *i64, D: i64, out: *i64) -> i64
34func vq_index_bits(K: i64) -> i64
called by 2: mainmain