pub struct MvCost {
pub lambda: f32,
pub mv_weight: f32,
pub ref_mv: MotionVector,
}Expand description
Motion vector cost calculator for rate-distortion optimization.
Fields§
§lambda: f32Lambda for rate-distortion tradeoff.
mv_weight: f32Weight for MV bits.
ref_mv: MotionVectorReference motion vector for differential coding.
Implementations§
Source§impl MvCost
impl MvCost
Sourcepub const fn with_ref_mv(lambda: f32, ref_mv: MotionVector) -> Self
pub const fn with_ref_mv(lambda: f32, ref_mv: MotionVector) -> Self
Creates with a reference motion vector.
Sourcepub fn estimate_bits(&self, mv: &MotionVector) -> f32
pub fn estimate_bits(&self, mv: &MotionVector) -> f32
Estimates the bit cost of a motion vector.
Sourcepub fn rd_cost(&self, mv: &MotionVector, sad: u32) -> u32
pub fn rd_cost(&self, mv: &MotionVector, sad: u32) -> u32
Calculates the rate-distortion cost.
Sourcepub fn set_ref_mv(&mut self, ref_mv: MotionVector)
pub fn set_ref_mv(&mut self, ref_mv: MotionVector)
Updates the reference motion vector.
Trait Implementations§
impl Copy for MvCost
Auto Trait Implementations§
impl Freeze for MvCost
impl RefUnwindSafe for MvCost
impl Send for MvCost
impl Sync for MvCost
impl Unpin for MvCost
impl UnsafeUnpin for MvCost
impl UnwindSafe for MvCost
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