pub struct FirstPassFrameStats {
pub frame_index: u64,
pub intra_cost: f32,
pub inter_cost: f32,
pub intra_inter_ratio: f32,
pub mean_sad: f32,
pub key_frame_bits: u64,
pub is_scene_change: bool,
}Expand description
Per-frame statistics recorded during the first encoding pass.
Fields§
§frame_index: u64Frame index (display order).
intra_cost: f32Mean intra cost (bits per pixel at a reference QP).
inter_cost: f32Mean inter cost (bits per pixel for the best motion prediction).
intra_inter_ratio: f32Intra/inter cost ratio; values > 1.0 indicate scene-change candidates.
mean_sad: f32Motion-compensated average block SAD.
key_frame_bits: u64Estimated number of bits if encoded as a key frame.
is_scene_change: boolWhether this frame was marked as a scene change in the first pass.
Implementations§
Source§impl FirstPassFrameStats
impl FirstPassFrameStats
Sourcepub fn new(frame_index: u64, intra_cost: f32, inter_cost: f32) -> Self
pub fn new(frame_index: u64, intra_cost: f32, inter_cost: f32) -> Self
Create a minimal stats record for a frame.
Sourcepub fn complexity_weight(&self) -> f32
pub fn complexity_weight(&self) -> f32
Effective complexity weight for bit allocation.
Uses the inter cost as the primary signal; scene-change frames get a boost so that the I-frame receives proportionally more bits.
Trait Implementations§
Source§impl Clone for FirstPassFrameStats
impl Clone for FirstPassFrameStats
Source§fn clone(&self) -> FirstPassFrameStats
fn clone(&self) -> FirstPassFrameStats
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 moreAuto Trait Implementations§
impl Freeze for FirstPassFrameStats
impl RefUnwindSafe for FirstPassFrameStats
impl Send for FirstPassFrameStats
impl Sync for FirstPassFrameStats
impl Unpin for FirstPassFrameStats
impl UnsafeUnpin for FirstPassFrameStats
impl UnwindSafe for FirstPassFrameStats
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