pub struct AnsEncoder { /* private fields */ }Expand description
ANS encoder state.
Implementations§
Source§impl AnsEncoder
impl AnsEncoder
Sourcepub fn with_capacity(num_tokens: usize) -> Self
pub fn with_capacity(num_tokens: usize) -> Self
Creates a new ANS encoder with pre-allocated capacity for num_tokens tokens.
Sourcepub fn put_symbol(&mut self, info: &AnsEncSymbolInfo)
pub fn put_symbol(&mut self, info: &AnsEncSymbolInfo)
Encodes a single symbol using precomputed symbol info.
Returns the bits that should be output (if any).
Sourcepub fn push_bits(&mut self, bits: u32, nbits: u8)
pub fn push_bits(&mut self, bits: u32, nbits: u8)
Pushes extra bits into the encoder’s output buffer.
Used for HybridUint extra bits that are interleaved with ANS symbols. These bits are stored in the same reversed buffer and will be emitted in proper order during finalize().
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AnsEncoder
impl RefUnwindSafe for AnsEncoder
impl Send for AnsEncoder
impl Sync for AnsEncoder
impl Unpin for AnsEncoder
impl UnwindSafe for AnsEncoder
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