pub struct FrameStats {Show 14 fields
pub frame_num: u64,
pub frame_type: FrameType,
pub bits: u64,
pub qp: u8,
pub qp_f: f32,
pub spatial_complexity: f32,
pub temporal_complexity: f32,
pub complexity: f32,
pub psnr: Option<f32>,
pub ssim: Option<f32>,
pub scene_cut: bool,
pub target_bits: u64,
pub bit_accuracy: f32,
pub encode_time_us: u64,
}Expand description
Statistics for a single encoded frame.
Fields§
§frame_num: u64Frame number (display order).
frame_type: FrameTypeFrame type (I/P/B).
bits: u64Bits used for this frame.
qp: u8QP used for this frame.
qp_f: f32QP as floating point for averaging.
spatial_complexity: f32Spatial complexity estimate.
temporal_complexity: f32Temporal complexity estimate (motion).
complexity: f32Combined complexity metric.
psnr: Option<f32>PSNR if calculated.
ssim: Option<f32>SSIM if calculated.
scene_cut: boolWas this frame a scene cut.
target_bits: u64Target bits for this frame.
bit_accuracy: f32Actual bits / target bits ratio.
encode_time_us: u64Encoding time in microseconds.
Implementations§
Source§impl FrameStats
impl FrameStats
Sourcepub fn bits_per_pixel(&self, width: u32, height: u32) -> f32
pub fn bits_per_pixel(&self, width: u32, height: u32) -> f32
Calculate bits per pixel.
Sourcepub fn exceeded_target(&self, threshold: f32) -> bool
pub fn exceeded_target(&self, threshold: f32) -> bool
Check if frame exceeded target significantly.
Sourcepub fn under_target(&self, threshold: f32) -> bool
pub fn under_target(&self, threshold: f32) -> bool
Check if frame was under target significantly.
Trait Implementations§
Source§impl Clone for FrameStats
impl Clone for FrameStats
Source§fn clone(&self) -> FrameStats
fn clone(&self) -> FrameStats
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 FrameStats
impl Debug for FrameStats
Source§impl Default for FrameStats
impl Default for FrameStats
Source§fn default() -> FrameStats
fn default() -> FrameStats
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for FrameStats
impl RefUnwindSafe for FrameStats
impl Send for FrameStats
impl Sync for FrameStats
impl Unpin for FrameStats
impl UnsafeUnpin for FrameStats
impl UnwindSafe for FrameStats
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