pub struct ContextModel { /* private fields */ }Expand description
Context model for entropy coding.
Implementations§
Source§impl ContextModel
impl ContextModel
Sourcepub fn update(&mut self, context_idx: usize, symbol: bool)
pub fn update(&mut self, context_idx: usize, symbol: bool)
Updates context state based on symbol.
Sourcepub fn get_probability(&self, context_idx: usize) -> f64
pub fn get_probability(&self, context_idx: usize) -> f64
Gets probability for a context.
Sourcepub fn estimate_bit_cost(&self, context_idx: usize, symbol: bool) -> f64
pub fn estimate_bit_cost(&self, context_idx: usize, symbol: bool) -> f64
Estimates bit cost for a symbol.
Trait Implementations§
Source§impl Clone for ContextModel
impl Clone for ContextModel
Source§fn clone(&self) -> ContextModel
fn clone(&self) -> ContextModel
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ContextModel
impl RefUnwindSafe for ContextModel
impl Send for ContextModel
impl Sync for ContextModel
impl Unpin for ContextModel
impl UnsafeUnpin for ContextModel
impl UnwindSafe for ContextModel
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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