pub struct FirstPassData {
pub frame_complexity: Vec<f32>,
pub spatial_complexity: Vec<f32>,
pub temporal_complexity: Vec<f32>,
pub gop_complexity: Vec<f32>,
pub total_complexity: f32,
pub frame_count: u64,
pub suggested_bits: Vec<u64>,
pub scene_changes: Vec<u64>,
pub gop_boundaries: Vec<u64>,
pub recommended_qp: Vec<f32>,
}Expand description
First pass analysis data.
Fields§
§frame_complexity: Vec<f32>Per-frame complexity values.
spatial_complexity: Vec<f32>Per-frame spatial complexity.
temporal_complexity: Vec<f32>Per-frame temporal complexity.
gop_complexity: Vec<f32>Per-GOP total complexity.
total_complexity: f32Total complexity for the entire sequence.
frame_count: u64Frame count.
suggested_bits: Vec<u64>Suggested bits per frame based on complexity.
scene_changes: Vec<u64>Scene change frame indices.
gop_boundaries: Vec<u64>Optimal GOP boundaries.
recommended_qp: Vec<f32>Per-frame QP recommendations.
Implementations§
Source§impl FirstPassData
impl FirstPassData
Sourcepub fn add_frame(&mut self, spatial: f32, temporal: f32, combined: f32)
pub fn add_frame(&mut self, spatial: f32, temporal: f32, combined: f32)
Add a frame’s complexity data.
Sourcepub fn mark_scene_change(&mut self, frame_num: u64)
pub fn mark_scene_change(&mut self, frame_num: u64)
Mark a frame as scene change.
Sourcepub fn add_gop_boundary(&mut self, frame_num: u64)
pub fn add_gop_boundary(&mut self, frame_num: u64)
Add GOP boundary.
Sourcepub fn finalize_gop(&mut self)
pub fn finalize_gop(&mut self)
Finalize a GOP’s complexity.
Sourcepub fn calculate_bit_allocation(&mut self, total_bits: u64)
pub fn calculate_bit_allocation(&mut self, total_bits: u64)
Calculate suggested bit allocation for second pass.
Sourcepub fn get_suggested_bits(&self, frame_num: u64) -> Option<u64>
pub fn get_suggested_bits(&self, frame_num: u64) -> Option<u64>
Get suggested bits for a frame.
Sourcepub fn get_recommended_qp(&self, frame_num: u64) -> Option<f32>
pub fn get_recommended_qp(&self, frame_num: u64) -> Option<f32>
Get recommended QP for a frame.
Sourcepub fn is_scene_change(&self, frame_num: u64) -> bool
pub fn is_scene_change(&self, frame_num: u64) -> bool
Check if frame is a detected scene change.
Trait Implementations§
Source§impl Clone for FirstPassData
impl Clone for FirstPassData
Source§fn clone(&self) -> FirstPassData
fn clone(&self) -> FirstPassData
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 FirstPassData
impl Debug for FirstPassData
Source§impl Default for FirstPassData
impl Default for FirstPassData
Source§fn default() -> FirstPassData
fn default() -> FirstPassData
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for FirstPassData
impl RefUnwindSafe for FirstPassData
impl Send for FirstPassData
impl Sync for FirstPassData
impl Unpin for FirstPassData
impl UnsafeUnpin for FirstPassData
impl UnwindSafe for FirstPassData
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