code wiki / _hdl_build / nx_vq_dred_gate.nx

nx_vq_dred_gate.nx

buildroot/runtime/_hdl_build/nx_vq_dred_gate.nx

5923 B95 linesdepth 4pulls 7 transitivereach 0 importersview sourcekind gate/prooftopic vq
docsdependenciesstructsconstsfunctions

about

nx_vq_dred_gate.nx -- proves the VQ moonshot rung (nx_vq): vector-quantising the LPC reflection envelope to a codebook index collapses the DRED redundancy bitrate toward the 12-32 kb/s neural target, with bounded distortion. Builds a codebook from period-varied LPC analyses (the classical stand-in for a trained codebook), VQ-encodes an in-codebook vector (exact) and a held-out vector (generalisation), and measures bits + distortion + the DRED tail at VQ rates.

dependencies 5 imports · 0 importers

nx_syscalls_x86_64.nx nx_lpc_autocorr.nx nx_lpc_levinson.nx nx_vq.nx nx_gate_verdict.nx nx_vq_dred_gate.nx

imports: nx_syscalls_x86_64.nxnx_lpc_autocorr.nxnx_lpc_levinson.nxnx_vq.nxnx_gate_verdict.nx

imported by: nobody (leaf or entry point)

structs

none

consts

none

functions

11func g_puts(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
12func g_pn(v: i64) -> i64
22func g_check(name: *u8, cond: i64) -> i64
26func st16(buf: *u8, idx: i64, v: i64) -> i64 { var x: i64 = v; if x < 0 { x = x + 65536 } buf[idx*2] = x & 0xff; buf[idx*2+1] = (x >> 8) & 0xff; return 0 }
27func ld64(buf: *u8, byteoff: i64) -> i64 { var v: i64 = 0; var b: i64 = 0; while b < 8 { v = v | (buf[byteoff + b] << (b*8)); b = b + 1 } return v }
29func fill_parabola(s: *u8, n: i64, period: i64) -> i64 { var i: i64=0; while i<n { let p: i64 = i % period; st16(s, i, 40 + p*(period-p)*2); i=i+1 } return 0 }
30func fill_triangle(s: *u8, n: i64, period: i64) -> i64 { var i: i64=0; while i<n { let p: i64 = i % period; var tri: i64 = p; if p*2 > period { tri = period - p } st16(s, i, 40 + tri*6); i=i+1 } return 0 }
32func main() -> i64