pub struct FrameContentMetrics {
pub frame_index: u64,
pub spatial_complexity: f32,
pub temporal_complexity: f32,
pub normalised_sad: f32,
pub is_scene_cut: bool,
}Expand description
Per-frame content metrics fed to the scene-adaptive allocator.
Fields§
§frame_index: u64Frame index in presentation order.
spatial_complexity: f32Spatial complexity (0.0 = flat, 1.0 = maximally complex).
temporal_complexity: f32Temporal complexity (0.0 = no change, 1.0 = complete scene change).
normalised_sad: f32Average inter-frame SAD normalised to [0, 1].
is_scene_cut: boolTrue when a hard scene cut is suspected.
Implementations§
Source§impl FrameContentMetrics
impl FrameContentMetrics
Sourcepub fn from_raw(
frame_index: u64,
spatial_var: f32,
inter_frame_sad: f64,
frame_pixels: u32,
) -> Self
pub fn from_raw( frame_index: u64, spatial_var: f32, inter_frame_sad: f64, frame_pixels: u32, ) -> Self
Build metrics from raw pixel statistics.
§Arguments
frame_index– Presentation-order indexspatial_var– Spatial variance of the luma plane (raw value)inter_frame_sad– Sum of absolute differences vs previous frameframe_pixels– Total luma pixels in the frame
spatial_var and inter_frame_sad are normalised internally so that
a value of 1.0 represents the worst-case / maximum-complexity signal.
Sourcepub fn classify(&self) -> SceneContentType
pub fn classify(&self) -> SceneContentType
Classify this frame’s content type.
Trait Implementations§
Source§impl Clone for FrameContentMetrics
impl Clone for FrameContentMetrics
Source§fn clone(&self) -> FrameContentMetrics
fn clone(&self) -> FrameContentMetrics
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 moreAuto Trait Implementations§
impl Freeze for FrameContentMetrics
impl RefUnwindSafe for FrameContentMetrics
impl Send for FrameContentMetrics
impl Sync for FrameContentMetrics
impl Unpin for FrameContentMetrics
impl UnsafeUnpin for FrameContentMetrics
impl UnwindSafe for FrameContentMetrics
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