Expand description
Lossless wire compression for numeric LSL streams (comp/1).
docs/extensions.md, section comp. docs/roadmap.md, step 7.
Each numeric channel passes through a bit-exact bijection to an unsigned
integer of the channel width (identity for integer formats, order-preserving
IEEE-754 mapping for Float32 and Double64), a wrapping first-order delta
against the previous sample on the same channel, ZigZag sign folding, and an
adaptive LSB-first Golomb-Rice coder.
On TCP, a connection keeps one CompState across frames and emits either
a compressed sample (0xF9 deduced timestamp, 0xFA transmitted timestamp)
or a plain LSL sample (0x01 or 0x02) when compression does not save
bytes. Worst-case expansion on incompressible data is zero bytes.
On UDP (dgram/1), each crate::dgram::DATA_COMP datagram is
self-contained with its own anchor sample and delta-coded timestamps, so a
lost or reordered datagram never corrupts later datagrams.
Structs§
- Comp
State - Per-channel delta + adaptive Rice state for
comp/1. - Dgram
Comp Encoder - Incremental single-pass encoder for one self-contained
DATA_COMPUDP datagram payload (docs/extensions.md, sectioncomp).
Constants§
- COMP_
DEDUCED_ TAG - Tag byte of a compressed TCP sample with a deduced timestamp (
comp/1). - COMP_
TIMESTAMP_ TAG - Tag byte of a compressed TCP sample with a transmitted
f64timestamp (comp/1).
Functions§
- decode_
dgram_ payload - Decode a self-contained
DATA_COMPUDP datagram payload holdingcountsamples, appending decodedPackedSamples intoout.