pub struct RdCurve {
pub label: String,
pub metric: QualityMetric,
/* private fields */
}Expand description
An RD curve consisting of multiple measurement points.
Fields§
§label: StringLabel for this curve (e.g. codec name, preset).
metric: QualityMetricQuality metric used.
Implementations§
Source§impl RdCurve
impl RdCurve
Sourcepub fn new(label: impl Into<String>, metric: QualityMetric) -> Self
pub fn new(label: impl Into<String>, metric: QualityMetric) -> Self
Create a new empty RD curve.
Sourcepub fn point_count(&self) -> usize
pub fn point_count(&self) -> usize
Return the number of points.
Sourcepub fn best_quality(&self) -> Option<&RdPoint>
pub fn best_quality(&self) -> Option<&RdPoint>
Find the point with the highest quality.
Sourcepub fn lowest_bitrate(&self) -> Option<&RdPoint>
pub fn lowest_bitrate(&self) -> Option<&RdPoint>
Find the point with the lowest bitrate.
Sourcepub fn find_nearest_quality(&self, target: f64) -> Option<&RdPoint>
pub fn find_nearest_quality(&self, target: f64) -> Option<&RdPoint>
Find the operating point closest to a target quality.
Sourcepub fn find_nearest_bitrate(&self, target_kbps: f64) -> Option<&RdPoint>
pub fn find_nearest_bitrate(&self, target_kbps: f64) -> Option<&RdPoint>
Find the operating point closest to a target bitrate.
Sourcepub fn interpolate_quality(&self, bitrate_kbps: f64) -> Option<f64>
pub fn interpolate_quality(&self, bitrate_kbps: f64) -> Option<f64>
Linearly interpolate quality at a given bitrate.
Returns None if outside the curve range or fewer than 2 points.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RdCurve
impl RefUnwindSafe for RdCurve
impl Send for RdCurve
impl Sync for RdCurve
impl Unpin for RdCurve
impl UnsafeUnpin for RdCurve
impl UnwindSafe for RdCurve
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