pub struct InterleavedFseEncoder { /* private fields */ }Expand description
Interleaved FSE encoder for Zstd sequences.
Zstd sequences use three interleaved FSE streams:
- Literal Length (LL)
- Offset (OF)
- Match Length (ML)
Each stream maintains its own state, and bits are interleaved in a specific order for optimal decoding performance.
Implementations§
Source§impl InterleavedFseEncoder
impl InterleavedFseEncoder
Sourcepub fn new(
ll_table: &FseTable,
of_table: &FseTable,
ml_table: &FseTable,
) -> Self
pub fn new( ll_table: &FseTable, of_table: &FseTable, ml_table: &FseTable, ) -> Self
Create a new interleaved encoder from the three FSE tables.
Sourcepub fn init_states(&mut self, ll: u8, of: u8, ml: u8)
pub fn init_states(&mut self, ll: u8, of: u8, ml: u8)
Initialize all three encoders with their first symbols.
Sourcepub fn encode_sequence(&mut self, ll: u8, of: u8, ml: u8) -> [(u32, u8); 3]
pub fn encode_sequence(&mut self, ll: u8, of: u8, ml: u8) -> [(u32, u8); 3]
Encode one sequence triplet (LL, OF, ML).
Returns the bits and counts for each stream in the correct order.
Sourcepub fn get_states(&self) -> (usize, usize, usize)
pub fn get_states(&self) -> (usize, usize, usize)
Get the final states for all three encoders.
Sourcepub fn accuracy_logs(&self) -> (u8, u8, u8)
pub fn accuracy_logs(&self) -> (u8, u8, u8)
Get accuracy logs for all three encoders.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for InterleavedFseEncoder
impl RefUnwindSafe for InterleavedFseEncoder
impl Send for InterleavedFseEncoder
impl Sync for InterleavedFseEncoder
impl Unpin for InterleavedFseEncoder
impl UnwindSafe for InterleavedFseEncoder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more