code wiki / _hdl_build / nx_audio_wire_exceed.nx

nx_audio_wire_exceed.nx

buildroot/runtime/_hdl_build/nx_audio_wire_exceed.nx

8165 B120 linesdepth 4pulls 4 transitivereach 0 importersview sourcekind tooltopic audio
docsdependenciesstructsconstsfunctions

about

nx_audio_wire_exceed.nx -- R3: MEASURED audio-codec head-to-head, closing the census's "audio codec vs Opus = UNMEASURED" axis HONESTLY. The live room ships RAW Int16 PCM (~768 kbps @48kHz). We REUSE the proven lossless codec nx_nv1_lpc (nv1l_encode/decode, bit-exact, FLAC-class) and measure it on a realistic talk-spurt signal (50% speech-ish / 50% silence, like a real conversation), then grade per-axis vs TWO baselines: - the CURRENT live wire (raw Int16): we WIN -- lossless compression of the deployed wire. - Opus voice (~32 kbps wideband, NAMED YARDSTICK): we are BIGGER -- lossless tax, reported HONESTLY (Opus is LOSSY-transparent; we are bit-exact). Our exceed there = fidelity (bit-exact) + sovereign implementation (no libopus), NOT bitrate or patent-freedom (Opus is already royalty-free/RFC 6716). The anti-wave check REFUSES any "we match Opus's lossy bitrate" claim. Program law: "lossless is default" -- the bird-test (record, play back, sounds like real life). main() is the SELF-VALIDATING GATE. Evidence -> knowledge/status/audio_wire_exceed.log. license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_nv1_lpc.nx nx_audio_wire_exceed.nx

imports: nx_syscalls.nxnx_nv1_lpc.nx

imported by: nobody (leaf or entry point)

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

main sys_mmap wr_i16 tri rt 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 nv1l_encode ↻ aw sys_write awn sys_mmap ↻ sys_write ↻ sys_openat_append sys_close sys_exit

structs

none

consts

17const AWE_MAGIC_65536: i64 = 65536
18const AWE_MAGIC_8128: i64 = 8128
19const AWE_MAGIC_4096: i64 = 4096
20const AWE_MAGIC_1103515245: i64 = 1103515245
21const AWE_MAGIC_12345: i64 = 12345
22const AWE_MAGIC_1024: i64 = 1024
23const AWE_MAGIC_32768: i64 = 32768
25const AWE_LOG: *u8 = "knowledge/status/audio_wire_exceed.log"
26const OPUS_VOICE_KBPS: i64 = 32 // Opus wideband voice typical operating point (named yardstick)

functions

28func aw(fd: i64, s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(fd,s,n); return 0 }
called by 1: main calls 1: sys_write
29func awn(fd: i64, v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m;sys_write(fd,"-" as *u8,1)} let t: *u8=sys_mmap(28); var k: i64=0; if m==0{t[0]=48 as u8;k=1} while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1} var i: i64=0; while i<k{bb[i]=t[k-1-i];i=i+1} sys_write(fd,bb,k); return 0 }
called by 1: main calls 2: sys_mmapsys_write
31func wr_i16(b: *u8, idx: i64, v: i64) -> i64 { var u: i64=v; if u<0 { u=u+AWE_MAGIC_65536 } b[idx*2]=(u & 255) as u8; b[idx*2+1]=((u/256) & 255) as u8; return 0 }
called by 1: main
32func tri(i: i64) -> i64 { let ph: i64=i % 256; if ph>=128 { return AWE_MAGIC_8128 - (ph-128)*127 } return ph*127 - AWE_MAGIC_8128 }
called by 1: main
35func rt(pcm: *u8, n: i64, pay: *u8, dec: *u8) -> i64
called by 1: main calls 2: nv1l_encodenv1l_decode
45func main() -> i64