silk.compress.lzma_decode.
Shared LZMA range decoder and probability models for LZMA, LZMA2, and XZ.
Import as LzmaState with import silk.compress.lzma_decode { LzmaState }.
Public declarations: 1.
LzmaState#
pub struct LzmaStateInternal range and dictionary state. The output buffer also holds dictionary history.
Field ip#
pub ip: usizeCurrent input offset.
Field inputEnd#
pub inputEnd: usizeExclusive input bound for the current chunk.
Field op#
pub op: usizeCurrent output offset.
Field outputEnd#
pub outputEnd: usizeExclusive output bound for the current stream or chunk.
Field dictionaryStart#
pub dictionaryStart: usizeOutput offset of the most recent dictionary reset.
Field dictionarySize#
pub dictionarySize: u64Maximum permitted match distance.
Field failed#
pub failed: boolFirst failure, if any.
Field reason#
pub reason: DecodeReasonFailure reason, meaningful only when failed is true.
Field ended#
pub ended: boolWhether an LZMA end marker was decoded.
Field range#
pub range: u32Current arithmetic range.
Field code#
pub code: u32Current arithmetic code.
Implementation LzmaState#
impl LzmaStateAssociated function make#
pub fn make(inputEnd: usize, outputEnd: usize) -> LzmaStateCreates empty state; probability storage is allocated by configure.
Method reject#
pub fn reject(self: &mut Self, reason: DecodeReason) -> ()Records only the first failure.
Method error#
pub fn error(self: &Self) -> DecodeErrorReturns the current failure with progress offsets.
Method byte#
pub fn byte(self: &mut Self, input: &[u8]) -> u32Reads one byte without crossing the current chunk's input boundary.
Method little#
pub fn little(self: &mut Self, input: &[u8], count: u32) -> u64Reads a little-endian integer of at most eight bytes.
Method configure#
pub effect fn configure(self: &mut Self, property: u32, lzma2: bool, workspace: usize) -> ()
! OutOfMemoryError
? &mut AllocatorValidates properties and resets all probability models within the workspace limit.
Method reset#
pub fn reset(self: &mut Self) -> ()Resets probabilities and repeat distances without changing dictionary history.
Method startRange#
pub fn startRange(self: &mut Self, input: &[u8]) -> ()Starts a five-byte range-coded chunk and validates its reserved byte.
Method put#
pub fn put(self: &mut Self, output: &mut [u8], value: u8) -> ()Appends a byte, respecting the caller's output bound.
Method symbol#
pub fn symbol(self: &mut Self, input: &[u8], output: &mut [u8]) -> ()Decodes one literal, match, or end marker with bounded input and output access.
Category: Data formats.
Profiles: aarch64-apple-darwin, aarch64-unknown-linux-gnu, aarch64-unknown-linux-gnu-no-libc, x86_64-unknown-linux-gnu, x86_64-unknown-linux-gnu-no-libc, wasm32-unknown-unknown, wasm32-wasip1, wasm32-wasip2.