pub struct RunModeContext {
pub a: i32,
pub n: i32,
pub nn: i32,
pub ri_type: i32,
pub reset: i32,
}Expand description
Context for run-interruption mode.
When the codec detects a run of identical pixels and the run ends, it uses a separate set of statistics for coding the interruption sample.
Fields§
§a: i32Accumulated |error|.
n: i32Sample count.
nn: i32Count of negative errors (used for map).
ri_type: i32Run interruption type (0 or 1).
reset: i32Reset threshold.
Implementations§
Source§impl RunModeContext
impl RunModeContext
pub fn new(a_init: i32, reset: i32) -> Self
Sourcepub fn get_golomb(&self) -> i32
pub fn get_golomb(&self) -> i32
Compute Golomb parameter for run interruption.
Sourcepub fn compute_map(&self, err_val: i32, k: i32) -> i32
pub fn compute_map(&self, err_val: i32, k: i32) -> i32
Compute the map value (whether to add 1 to the mapped error).
Sourcepub fn compute_map_negative_e(&self, k: i32) -> bool
pub fn compute_map_negative_e(&self, k: i32) -> bool
Compute the mapped error value for Golomb-Rice coding.
Sourcepub fn update_variables(&mut self, err_val: i32, e_mapped: i32)
pub fn update_variables(&mut self, err_val: i32, e_mapped: i32)
Update run-mode statistics after coding an error.
Trait Implementations§
Source§impl Clone for RunModeContext
impl Clone for RunModeContext
Source§fn clone(&self) -> RunModeContext
fn clone(&self) -> RunModeContext
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 RunModeContext
impl RefUnwindSafe for RunModeContext
impl Send for RunModeContext
impl Sync for RunModeContext
impl Unpin for RunModeContext
impl UnsafeUnpin for RunModeContext
impl UnwindSafe for RunModeContext
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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