pub struct FseDecoder<'a> { /* private fields */ }Expand description
FSE bitstream decoder.
Reads symbols from a backward bitstream using an FSE table. Zstd uses backward bitstreams - bits are read from high to low.
Implementations§
Source§impl<'a> FseDecoder<'a>
impl<'a> FseDecoder<'a>
Sourcepub fn init_state(&mut self, bits: &mut BitReader<'_>) -> Result<()>
pub fn init_state(&mut self, bits: &mut BitReader<'_>) -> Result<()>
Initialize the decoder state from the bitstream.
Reads accuracy_log bits to set the initial state.
Sourcepub fn decode_symbol(&mut self, bits: &mut BitReader<'_>) -> Result<u8>
pub fn decode_symbol(&mut self, bits: &mut BitReader<'_>) -> Result<u8>
Decode the current symbol and update state.
Returns the decoded symbol.
Sourcepub fn peek_symbol(&self) -> u8
pub fn peek_symbol(&self) -> u8
Peek at the current symbol without advancing state.
Sourcepub fn peek_num_bits(&self) -> u8
pub fn peek_num_bits(&self) -> u8
Peek at how many bits the next decode operation needs.
Sourcepub fn peek_seq_base(&self) -> u32
pub fn peek_seq_base(&self) -> u32
Peek at the direct sequence base value for the current state. Used by predefined sequence tables that store baseValue directly.
Sourcepub fn peek_seq_extra_bits(&self) -> u8
pub fn peek_seq_extra_bits(&self) -> u8
Peek at the number of extra bits for sequence decoding. Used by predefined sequence tables.
Sourcepub fn update_state(&mut self, bits: &mut BitReader<'_>) -> Result<()>
pub fn update_state(&mut self, bits: &mut BitReader<'_>) -> Result<()>
Update state by reading FSE transition bits (without returning symbol).
Call this AFTER reading extra bits, to update state for next symbol. For the last sequence, skip this call (no state update needed).