pub struct CrfOptimizer;Expand description
CRF optimizer using binary search over the CRF space.
Implementations§
Source§impl CrfOptimizer
impl CrfOptimizer
Sourcepub fn find_optimal(
target: &QualityTarget,
crf_range: CrfRange,
content_complexity: f32,
) -> CrfOptimizerResult
pub fn find_optimal( target: &QualityTarget, crf_range: CrfRange, content_complexity: f32, ) -> CrfOptimizerResult
Finds the optimal CRF for the given quality target using binary search.
The bitrate model is: bitrate = complexity * base * 2^((28 - crf) / 6).
Higher CRF → lower quality → lower bitrate.
Searches for the lowest CRF (best quality) that keeps bitrate ≤ max_bitrate_kbps.
Sourcepub fn estimate_psnr(crf: u8, _complexity: f32) -> f32
pub fn estimate_psnr(crf: u8, _complexity: f32) -> f32
Estimates PSNR for a given CRF.
Simple heuristic: lower CRF → higher PSNR. CRF=0 → ~50dB, CRF=51 → ~30dB.
Trait Implementations§
Source§impl Clone for CrfOptimizer
impl Clone for CrfOptimizer
Source§fn clone(&self) -> CrfOptimizer
fn clone(&self) -> CrfOptimizer
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 moreSource§impl Debug for CrfOptimizer
impl Debug for CrfOptimizer
Source§impl Default for CrfOptimizer
impl Default for CrfOptimizer
Source§fn default() -> CrfOptimizer
fn default() -> CrfOptimizer
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for CrfOptimizer
impl RefUnwindSafe for CrfOptimizer
impl Send for CrfOptimizer
impl Sync for CrfOptimizer
impl Unpin for CrfOptimizer
impl UnsafeUnpin for CrfOptimizer
impl UnwindSafe for CrfOptimizer
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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