pub struct RangeEncoder { /* private fields */ }Expand description
Range coder (arithmetic encoder) for entropy coding.
Implementations§
Source§impl RangeEncoder
impl RangeEncoder
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Creates a new range encoder with pre-allocated capacity.
Sourcepub fn bytes_written(&self) -> usize
pub fn bytes_written(&self) -> usize
Returns the number of bytes written so far.
Sourcepub fn into_output(self) -> Vec<u8> ⓘ
pub fn into_output(self) -> Vec<u8> ⓘ
Consumes and returns the output buffer without finishing.
Sourcepub fn encode_bit(&mut self, bit: bool)
pub fn encode_bit(&mut self, bit: bool)
Encodes a single bit.
Sourcepub fn encode_with_model(&mut self, symbol: u32, model: &mut RCQsModel)
pub fn encode_with_model(&mut self, symbol: u32, model: &mut RCQsModel)
Encodes a symbol using a probability model.
Sourcepub fn encode_uint(&mut self, s: u32, n: i32)
pub fn encode_uint(&mut self, s: u32, n: i32)
Encodes an n-bit unsigned integer (0 <= s < 2^n).
Sourcepub fn encode_ulong(&mut self, s: u64, n: i32)
pub fn encode_ulong(&mut self, s: u64, n: i32)
Encodes a 64-bit unsigned integer with n bits.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RangeEncoder
impl RefUnwindSafe for RangeEncoder
impl Send for RangeEncoder
impl Sync for RangeEncoder
impl Unpin for RangeEncoder
impl UnsafeUnpin for RangeEncoder
impl UnwindSafe for RangeEncoder
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