Expand description
Pure-Rust CCSDS 121.0-B-3 Adaptive Entropy Coding (AEC/SZIP).
This crate provides encode, decode, and range-decode functions with
the same AecParams interface as the C libaec library. It can be
used as a drop-in replacement for libaec-sys in environments where
C FFI is unavailable (e.g. WebAssembly).
§Example
use tensogram_szip::{aec_compress, aec_decompress, AecParams, AEC_DATA_PREPROCESS};
let data: Vec<u8> = (0..1024).map(|i| (i % 256) as u8).collect();
let params = AecParams {
bits_per_sample: 8,
block_size: 16,
rsi: 128,
flags: AEC_DATA_PREPROCESS,
};
let (compressed, offsets) = aec_compress(&data, ¶ms).unwrap();
let decompressed = aec_decompress(&compressed, data.len(), ¶ms).unwrap();
assert_eq!(decompressed, data);Re-exports§
pub use params::AEC_ALLOW_K13;pub use params::AEC_DATA_3BYTE;pub use params::AEC_DATA_MSB;pub use params::AEC_DATA_PREPROCESS;pub use params::AEC_DATA_SIGNED;pub use params::AEC_NOT_ENFORCE;pub use params::AEC_PAD_RSI;pub use params::AEC_RESTRICTED;pub use params::AecParams;
Modules§
- params
- AEC parameters and flag constants matching the libaec C API.
Enums§
Functions§
- aec_
compress - Compress data using CCSDS 121.0-B-3 adaptive entropy coding.
- aec_
compress_ no_ offsets - Compress data without tracking RSI block offsets (slightly faster).
- aec_
decompress - Decompress an entire AEC-compressed stream.
- aec_
decompress_ range - Decompress a partial byte range from AEC-compressed data using pre-computed RSI block bit offsets.