pub struct TransformCoeffStats {
pub total_coeffs: usize,
pub zero_coeffs: usize,
pub skip_blocks: usize,
pub total_bits: usize,
}Expand description
Statistics for coefficient encoding.
Fields§
§total_coeffs: usizeTotal number of coefficients.
zero_coeffs: usizeNumber of zero coefficients.
skip_blocks: usizeNumber of blocks skipped.
total_bits: usizeTotal bits used.
Implementations§
Source§impl CoeffStats
impl CoeffStats
Sourcepub fn update(&mut self, coeffs: &[i32], bits_used: usize)
pub fn update(&mut self, coeffs: &[i32], bits_used: usize)
Update statistics from coefficient block.
Sourcepub fn avg_bits_per_coeff(&self) -> f32
pub fn avg_bits_per_coeff(&self) -> f32
Get average bits per coefficient.
Sourcepub fn zero_ratio(&self) -> f32
pub fn zero_ratio(&self) -> f32
Get zero coefficient ratio.
Trait Implementations§
Source§impl Clone for CoeffStats
impl Clone for CoeffStats
Source§fn clone(&self) -> CoeffStats
fn clone(&self) -> CoeffStats
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 CoeffStats
impl Debug for CoeffStats
Source§impl Default for CoeffStats
impl Default for CoeffStats
Source§fn default() -> CoeffStats
fn default() -> CoeffStats
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for CoeffStats
impl RefUnwindSafe for CoeffStats
impl Send for CoeffStats
impl Sync for CoeffStats
impl Unpin for CoeffStats
impl UnsafeUnpin for CoeffStats
impl UnwindSafe for CoeffStats
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