pub struct PsychoVisualModel { /* private fields */ }Expand description
Psycho-visual masking model that computes per-block QP deltas.
Implementations§
Source§impl PsychoVisualModel
impl PsychoVisualModel
Sourcepub fn new(cfg: PsychoVisualConfig) -> Self
pub fn new(cfg: PsychoVisualConfig) -> Self
Create a new masking model with the given configuration.
Sourcepub fn default_model() -> Self
pub fn default_model() -> Self
Create a masking model with default configuration.
Sourcepub fn compute_qp_delta(&self, stats: &BlockMaskStats) -> i32
pub fn compute_qp_delta(&self, stats: &BlockMaskStats) -> i32
Compute a QP delta for a single block.
Positive values allow higher QP (more compression); negative values force lower QP (higher quality).
The block statistics should be gathered before calling this function.
Sourcepub fn compute_frame_qp_map(
&self,
luma_plane: &[u8],
width: usize,
height: usize,
motion_sad_map: Option<&[f32]>,
) -> Vec<i32>
pub fn compute_frame_qp_map( &self, luma_plane: &[u8], width: usize, height: usize, motion_sad_map: Option<&[f32]>, ) -> Vec<i32>
Build a QP delta map for an entire frame.
luma_plane is the raw luma data (row-major, 8-bit), width and height
are the frame dimensions. Blocks are 8×8 pixels. The returned vector
has one entry per block in raster-scan order.
Sourcepub fn config(&self) -> &PsychoVisualConfig
pub fn config(&self) -> &PsychoVisualConfig
Return the current configuration.
Trait Implementations§
Source§impl Clone for PsychoVisualModel
impl Clone for PsychoVisualModel
Source§fn clone(&self) -> PsychoVisualModel
fn clone(&self) -> PsychoVisualModel
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 PsychoVisualModel
impl RefUnwindSafe for PsychoVisualModel
impl Send for PsychoVisualModel
impl Sync for PsychoVisualModel
impl Unpin for PsychoVisualModel
impl UnsafeUnpin for PsychoVisualModel
impl UnwindSafe for PsychoVisualModel
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