pub struct PvsModel;Expand description
Simplified psycho-visual sensitivity (PVS) model.
Provides a single visibility_threshold method that returns the minimum
distortion energy that becomes just-noticeable to the human visual system
(HVS) for a given luma level and spatial frequency.
The model is derived from the Watson (1993) DCTune formulation:
- Base threshold from the luma quantization table (frequency-dependent).
- Luminance masking multiplier: brighter or darker regions tolerate more distortion (Weber-Fechner / power-law masking).
§Reference
Watson, A.B. (1993). DCTune.
Implementations§
Source§impl PvsModel
impl PvsModel
Sourcepub fn visibility_threshold(luma: f32, freq: f32) -> f32
pub fn visibility_threshold(luma: f32, freq: f32) -> f32
Compute the visibility threshold (JND) for the given luma and frequency.
§Parameters
luma– mean luminance of the block, normalised [0.0, 1.0] (0 = black, 1 = white).freq– spatial frequency index in [0.0, 1.0] representing low (0) to high (1) frequency DCT coefficients. Linearly interpolated between the DC threshold and the highest AC threshold in the JPEG luma quantization matrix.
§Returns
A positive threshold value. Distortions below this level are perceptually invisible; distortions above may be visible.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PvsModel
impl RefUnwindSafe for PvsModel
impl Send for PvsModel
impl Sync for PvsModel
impl Unpin for PvsModel
impl UnsafeUnpin for PvsModel
impl UnwindSafe for PvsModel
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