nx_jitterbuf.nx
buildroot/runtime/nx_jitterbuf.nx
about
nx_jitterbuf.nx -- sovereign ADAPTIVE PLAYOUT DELAY (jitter buffer) sizing for the snapshot
interpolator (nx_interp). The interp playout delay is the latency/smoothness dial: too small ->
the buffer starves (peer freezes/extrapolates) under jitter; too large -> needless lag. This sizes
it to MEASURED jitter (RFC 3550 interarrival-jitter smoothing) and GROWS FAST / SHRINKS SLOW so a
jitter spike is covered immediately but latency creeps back down as the link calms. 100% nx, no
syscalls -> wasm-friendly. The host only timestamps arrivals; all control logic is here.
State jb[*i64]: [0]=last_recv_ms [1]=jitter_acc(~16x mean|D|) [2]=send_interval [3]=playout_delay
[4]=min_delay [5]=max_delay [6]=count
license_tier: ORIGINAL
dependencies 0 imports · 2 importers
imports: none
imported by: nx_adverse_net_gate.nxnx_jitterbuf_gate.nx
structs
| none |
consts
| none |
functions
| 12 | func jb_init(jb: *i64, send_interval: i64, min_delay: i64, max_delay: i64) -> i64 |
| 16 | func jb_jitter(jb: *i64) -> i64 { return jb[1] / 16 } // smoothed mean deviation of interarrival called by 1: main |
| 17 | func jb_playout(jb: *i64) -> i64 { return jb[3] } |
| 21 | func jb_on_recv(jb: *i64, recv_ms: i64) -> i64 |