pub struct AllocationConfig {
pub strategy: AllocationStrategy,
pub target_bitrate: u64,
pub framerate_num: u32,
pub framerate_den: u32,
pub i_frame_boost: f64,
pub p_frame_factor: f64,
pub b_frame_factor: f64,
pub complexity_weight: f64,
pub temporal_weight: f64,
}Expand description
Configuration for bitrate allocation.
Fields§
§strategy: AllocationStrategyAllocation strategy.
target_bitrate: u64Target bitrate in bits per second.
framerate_num: u32Frame rate numerator.
framerate_den: u32Frame rate denominator.
i_frame_boost: f64I-frame bit boost factor (1.0-10.0).
p_frame_factor: f64P-frame bit factor (relative to average).
b_frame_factor: f64B-frame bit factor (relative to average).
complexity_weight: f64Complexity weight (0.0-1.0, how much to favor complex frames).
temporal_weight: f64Temporal weight (0.0-1.0, how much to favor temporally important frames).
Implementations§
Source§impl AllocationConfig
impl AllocationConfig
Sourcepub fn new(strategy: AllocationStrategy, target_bitrate: u64) -> Self
pub fn new(strategy: AllocationStrategy, target_bitrate: u64) -> Self
Create a new allocation configuration.
Sourcepub fn with_framerate(self, num: u32, den: u32) -> Self
pub fn with_framerate(self, num: u32, den: u32) -> Self
Set frame rate.
Sourcepub fn bits_per_frame(&self) -> f64
pub fn bits_per_frame(&self) -> f64
Calculate average bits per frame.
Trait Implementations§
Source§impl Clone for AllocationConfig
impl Clone for AllocationConfig
Source§fn clone(&self) -> AllocationConfig
fn clone(&self) -> AllocationConfig
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 AllocationConfig
impl Debug for AllocationConfig
Auto Trait Implementations§
impl Freeze for AllocationConfig
impl RefUnwindSafe for AllocationConfig
impl Send for AllocationConfig
impl Sync for AllocationConfig
impl Unpin for AllocationConfig
impl UnsafeUnpin for AllocationConfig
impl UnwindSafe for AllocationConfig
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