pub struct CoeffStats {
pub zero_count: u32,
pub level1_count: u32,
pub level2_count: u32,
pub high_level_count: u32,
pub level_sum: u64,
pub max_level: u32,
}Expand description
Statistics about coefficients in a block.
Fields§
§zero_count: u32Number of zero coefficients.
level1_count: u32Number of coefficients with level 1.
level2_count: u32Number of coefficients with level 2.
high_level_count: u32Number of coefficients with level > 2.
level_sum: u64Sum of absolute levels.
max_level: u32Maximum absolute level.
Implementations§
Source§impl CoeffStats
impl CoeffStats
Sourcepub fn from_coeffs(coeffs: &[i32]) -> Self
pub fn from_coeffs(coeffs: &[i32]) -> Self
Compute statistics from coefficient buffer.
Sourcepub fn nonzero_count(&self) -> u32
pub fn nonzero_count(&self) -> u32
Get total non-zero count.
Sourcepub fn average_level(&self) -> f64
pub fn average_level(&self) -> f64
Get average level (for non-zero coefficients).
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