code wiki / _hdl_build / nx_audio_codec_pack.nx

nx_audio_codec_pack.nx

buildroot/runtime/_hdl_build/nx_audio_codec_pack.nx

4666 B82 linesdepth 4pulls 4 transitivereach 0 importersview sourcekind tooltopic audio
docsdependenciesstructsconstsfunctions

about

nx_audio_codec_pack.nx -- prove the WHOLE /listen audio set runs through OUR OWN lossless codec (operator 2026-06-23: "make sure this is all using our own codec"). For each track WAV: deinterleave L/R Int16, nv1l_encode each channel with our NishiLossless LPC codec (nx_nv1_lpc), then nv1l_decode and assert the reconstruction is BIT-EXACT to the original PCM. Reports the compression ratio per track. GREEN only if every channel of every track round-trips bit-for-bit (zero loss) -- that is the "using our own codec" proof. license_tier: ORIGINAL expect_exit: 0

dependencies 2 imports · 0 importers

nx_nv1_lpc.nx nx_syscalls.nx nx_audio_codec_pack.nx

imports: nx_nv1_lpc.nxnx_syscalls.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main kp sys_write sys_mmap pack_file kf_read sys_openat_rd sys_read sys_close kp ↻ pack_ch nv1l_encode nv1_wr_u32 nv1l_rd_i16 nv1l_residuals nv1l_best_k nv1l_cost_bits nv1l_rice_put nv1l_bit_put nv1l_decode nv1_rd_u32 nv1l_rd_i16 ↻ nv1l_wr_i16 nv1l_rice_get nv1l_bit_get same kpn sys_mmap ↻ sys_write ↻ kpn ↻ sys_exit

structs

none

consts

9const K_MAGIC_524288: i64 = 524288

functions

11func kp(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
called by 2: pack_filemain calls 1: sys_write
12func kpn(v: i64) -> i64
called by 2: pack_filemain calls 2: sys_mmapsys_write
20func kf_read(path: *u8, buf: *u8, cap: i64) -> i64
26func same(a: *u8, b: *u8, n: i64) -> i64 { var i: i64=0; while i<n { if a[i]!=b[i] { return 0 } i=i+1 } return 1 }
called by 1: pack_ch
29func pack_ch(pcm: *u8, nsamp: i64, enc: *u8, dec: *u8, cap: i64) -> i64
39func pack_file(path: *u8, wav: *u8, Lb: *u8, Rb: *u8, enc: *u8, dec: *u8, cap: i64) -> i64
called by 1: main calls 4: kf_readkppack_chkpn
61func main() -> i64