pub struct RateControlVerifier { /* private fields */ }Expand description
Verifies that an encoder’s rate control meets its targets.
Implementations§
Source§impl RateControlVerifier
impl RateControlVerifier
Sourcepub fn new(target_bitrate: u64, framerate: f64, mode: RcVerifyMode) -> Self
pub fn new(target_bitrate: u64, framerate: f64, mode: RcVerifyMode) -> Self
Create a new rate control verifier.
Sourcepub fn record_frame(&mut self, size_bytes: u32, is_keyframe: bool)
pub fn record_frame(&mut self, size_bytes: u32, is_keyframe: bool)
Record one encoded frame.
Sourcepub fn record_frame_with_qp(
&mut self,
size_bytes: u32,
is_keyframe: bool,
qp: u8,
)
pub fn record_frame_with_qp( &mut self, size_bytes: u32, is_keyframe: bool, qp: u8, )
Record one encoded frame with its QP value (for CRF mode).
Sourcepub fn frame_count(&self) -> usize
pub fn frame_count(&self) -> usize
Get the total number of recorded frames.
Sourcepub fn average_bitrate(&self) -> f64
pub fn average_bitrate(&self) -> f64
Compute the overall average bitrate of the recorded sequence.
Sourcepub fn bitrate_deviation(&self) -> f64
pub fn bitrate_deviation(&self) -> f64
Compute the deviation of average bitrate from target.
Returns a fraction: (actual - target) / target.
Positive means over-target, negative means under-target.
Sourcepub fn verify(&self) -> VerificationResult
pub fn verify(&self) -> VerificationResult
Run verification and return a detailed result.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RateControlVerifier
impl RefUnwindSafe for RateControlVerifier
impl Send for RateControlVerifier
impl Sync for RateControlVerifier
impl Unpin for RateControlVerifier
impl UnsafeUnpin for RateControlVerifier
impl UnwindSafe for RateControlVerifier
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> 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