pub struct PeakOffset {
per_frame: f64,
buffer: f64,
pub(crate) fill: f64,
pub(crate) offset: f64,
}Expand description
The peak of a capped constant quality held beside an encoder that codes its constant quality
per frame and has no rate control to bind to it (x264, SVT-AV1), where PeakBucket switches
one that does. A leaky bucket of the peak, its buffer the session’s VBV, takes each frame: from
a frame that overflows it the quality index stands offset steps above the session’s, aimed
after each frame at bringing the bucket back to half full in DRAIN_FRAMES frames (a size
halving every six steps) and lowered at most RELEASE_STEP a frame, so a session that never
overflows it codes as an uncapped one.
Fields§
§per_frame: f64Bits a frame drains from the bucket, and the bucket’s buffer.
buffer: f64§fill: f64§offset: f64Quality index steps above the session’s own.
Implementations§
Source§impl PeakOffset
impl PeakOffset
const DRAIN_FRAMES: f64 = 8.0
const RELEASE_STEP: f64 = 2.0
pub fn new(bitrate_kbps: i32, vbv_kbit: i32, fps: f64) -> Self
Sourcepub fn follow(&mut self, bitrate_kbps: i32, vbv_kbit: i32, fps: f64)
pub fn follow(&mut self, bitrate_kbps: i32, vbv_kbit: i32, fps: f64)
Take a live peak and buffer.
Trait Implementations§
Source§impl Clone for PeakOffset
impl Clone for PeakOffset
Source§fn clone(&self) -> PeakOffset
fn clone(&self) -> PeakOffset
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for PeakOffset
Auto Trait Implementations§
impl Freeze for PeakOffset
impl RefUnwindSafe for PeakOffset
impl Send for PeakOffset
impl Sync for PeakOffset
impl Unpin for PeakOffset
impl UnsafeUnpin for PeakOffset
impl UnwindSafe for PeakOffset
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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