pub struct RansEncoder { /* private fields */ }Expand description
Scalar rANS encoder.
Implementations§
Source§impl RansEncoder
impl RansEncoder
Sourcepub fn encode(&mut self, cdf: &Cdf)
pub fn encode(&mut self, cdf: &Cdf)
Encode a symbol using its CDF bounds.
rANS encoding formula: x’ = (x / freq) << ANS_BITS + (x % freq) + c_lo
Sourcepub fn encode_pdf(&mut self, pdf: &[f64], sym: usize)
pub fn encode_pdf(&mut self, pdf: &[f64], sym: usize)
Encode a symbol given a PDF.
Sourcepub fn size_estimate(&self) -> usize
pub fn size_estimate(&self) -> usize
Get current output size estimate.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RansEncoder
impl RefUnwindSafe for RansEncoder
impl Send for RansEncoder
impl Sync for RansEncoder
impl Unpin for RansEncoder
impl UnwindSafe for RansEncoder
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more