Expand description
Pure-Rust StreamVByte covering u16, u32, and u64 integer codecs with optional SIMD acceleration.
§Codec variants
| Type | Struct | Tag | Byte widths | Notes |
|---|---|---|---|---|
| u16 | u16::Svb16 | 1-bit | 1/2 | ONT VBZ format |
| u32 | u32::U32Classic | 2-bit | 1/2/3/4 | Lemire reference-compatible |
| u32 | u32::U32Variant0124 | 2-bit | 0/1/2/4 | Sparse-data variant |
| u64 | u64::U64Coder1234 | 2-bit | 1/2/3/4 | Values must fit in u32 |
| u64 | u64::U64Coder1248 | 2-bit | 1/2/4/8 | Full u64 range |
Delta and zigzag transforms are composable layers in delta and zigzag.
§Feature flags
Enable simd-auto for runtime CPU detection (recommended). Use simd-avx2,
simd-ssse3, or simd-neon for compile-time SIMD when the target is known.
Disable std and enable alloc for no_std use; all codec functionality
requires at least the alloc feature.
no_std note: simd-auto on x86-64 requires std for
is_x86_feature_detected!. When std is disabled, simd-auto compiles
but silently falls back to scalar regardless of the CPU’s actual capabilities.
Use simd-avx2 or simd-ssse3 with a compile-time target-feature flag
(RUSTFLAGS="-C target-feature=+avx2") for SIMD in no_std builds.
Re-exports§
pub use error::DecodeError;
Modules§
- delta
- Delta encoding and decoding as a composable layer over any integer type.
- error
- u16
- StreamVByte codec for
u16values using 1-bit control tags. - u32
- StreamVByte codecs for
u32values using 2-bit control tags. - u64
- StreamVByte codecs for
u64values using 2-bit control tags. - zigzag
- Zigzag encoding and decoding as a composable layer over signed integer types.
Functions§
- decode_
vbz - Decode exactly
ni16samples from SVB16 bytes (after zstd decompression). - decode_
vbz2 Deprecated - Decode VBZ2-encoded data (format produced by
encode_vbz2). - decode_
vbz2_ into Deprecated - Decode VBZ2-encoded data into an existing Vec (avoids allocation if capacity is sufficient).
- decode_
vbz_ fused - Decode a VBZ-encoded byte stream into
i16samples using a fused single-pass decoder. - decode_
vbz_ fused_ from - Decode a VBZ half-stream starting from an arbitrary
initial_carryvalue. - decode_
vbz_ fused_ from_ into - Decode a VBZ half-stream starting from
initial_carry, appending toout. - decode_
vbz_ fused_ into - Decode a VBZ-encoded byte stream, appending to
out. Seedecode_vbz_fused. - decode_
vbz_ into - Decode exactly
ni16samples from SVB16 bytes, appending them toout. - decode_
vbzk - Decode VBZ-K encoded data, returning a new
Vec<i16>. - decode_
vbzk_ into - Decode VBZ-K encoded data sequentially (one sub-stream at a time), appending to
out. - decode_
vbzk_ parallel - Decode VBZ-K encoded data in parallel using
kthreads, returning a newVec<i16>. - decode_
vbzk_ parallel_ into - Decode VBZ-K encoded data in parallel using
kthreads, appending toout. - encode_
vbz - Encode
i16samples through delta, zigzag, then SVB16, returning raw bytes ready to pass to zstd. - encode_
vbz2 Deprecated - Encode samples to VBZ2 format (standard VBZ with a 6-byte header enabling 2-chain decode).
- encode_
vbz_ into - Encode
i16samples through delta, zigzag, then SVB16, appending the result toout. - encode_
vbzk - Encode samples to VBZ-K format —
kindependent sub-streams decodable in parallel.