pub struct TargetQuality {
pub metric: QualityMetric,
pub value: f32,
}Expand description
A perceptual quality target used when binary-searching a lossy encode quality.
The search is a binary search over 1..=quality when a quality is given and 1..=100
otherwise, and it assumes the score rises with the quality setting. Encoders do not
promise that: rate control changes quantization as the setting moves, and a perceptual
score against the original can fall a little on the way up. So the quality returned is
one whose score meets value rather than necessarily the least one that would, and where
no probed quality meets it, the top of the range is returned together with a
TransformWarning::TargetQualityNotReached naming the score that encode reached.
Guaranteeing the minimum would mean scanning the range at an encode, a decode, and a
metric per step, against the handful the search makes.
Fields§
§metric: QualityMetricThe requested quality metric.
value: f32The threshold that the encoded output should meet or exceed.
Trait Implementations§
Source§impl Clone for TargetQuality
impl Clone for TargetQuality
Source§fn clone(&self) -> TargetQuality
fn clone(&self) -> TargetQuality
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for TargetQuality
Source§impl Debug for TargetQuality
impl Debug for TargetQuality
Source§impl Display for TargetQuality
impl Display for TargetQuality
Source§impl FromStr for TargetQuality
impl FromStr for TargetQuality
Source§impl PartialEq for TargetQuality
impl PartialEq for TargetQuality
impl StructuralPartialEq for TargetQuality
Auto Trait Implementations§
impl Freeze for TargetQuality
impl RefUnwindSafe for TargetQuality
impl Send for TargetQuality
impl Sync for TargetQuality
impl Unpin for TargetQuality
impl UnsafeUnpin for TargetQuality
impl UnwindSafe for TargetQuality
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
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> ⓘ
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> ⓘ
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