pub struct DerivedTraits {
pub max_val: i32,
pub near: i32,
pub range: i32,
pub bpp: i32,
pub qbpp: i32,
pub limit: i32,
pub reset: i32,
}Expand description
Compute derived traits for the codec from MAXVAL and NEAR.
Fields§
§max_val: i32§near: i32§range: i32§bpp: i32§qbpp: i32§limit: i32§reset: i32Implementations§
Source§impl DerivedTraits
impl DerivedTraits
pub fn new(max_val: i32, near: i32, reset: i32) -> Self
Sourcepub fn quantize_error(&self, e: i32) -> i32
pub fn quantize_error(&self, e: i32) -> i32
Quantize an error value for near-lossless mode.
Sourcepub fn compute_error_val(&self, e: i32) -> i32
pub fn compute_error_val(&self, e: i32) -> i32
Compute the error value: quantize then mod-range.
Sourcepub fn dequantize(&self, err: i32) -> i32
pub fn dequantize(&self, err: i32) -> i32
De-quantize an error value.
Sourcepub fn compute_reconstructed(&self, px: i32, err: i32) -> i32
pub fn compute_reconstructed(&self, px: i32, err: i32) -> i32
Reconstruct the sample from prediction and error.
Sourcepub fn correct_prediction(&self, pxc: i32) -> i32
pub fn correct_prediction(&self, pxc: i32) -> i32
Clamp a predicted value to [0, MAXVAL].
Trait Implementations§
Source§impl Clone for DerivedTraits
impl Clone for DerivedTraits
Source§fn clone(&self) -> DerivedTraits
fn clone(&self) -> DerivedTraits
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 moreSource§impl Debug for DerivedTraits
impl Debug for DerivedTraits
impl Copy for DerivedTraits
Auto Trait Implementations§
impl Freeze for DerivedTraits
impl RefUnwindSafe for DerivedTraits
impl Send for DerivedTraits
impl Sync for DerivedTraits
impl Unpin for DerivedTraits
impl UnsafeUnpin for DerivedTraits
impl UnwindSafe for DerivedTraits
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