pub struct SceneChangeDetector;Expand description
A stateless scene-change detector that classifies a single histogram difference value against a configurable threshold.
This is a lightweight helper for callers that compute histogram differences externally (e.g. from a motion-estimation pass) and just need to decide whether to force an I-frame.
For a stateful, full-featured detector with GOP-boundary management see
SceneChangeIdrController.
Implementations§
Source§impl SceneChangeDetector
impl SceneChangeDetector
Sourcepub fn is_scene_change(hist_diff: f32, threshold: f32) -> bool
pub fn is_scene_change(hist_diff: f32, threshold: f32) -> bool
Classify a pre-computed histogram difference as a scene change.
§Parameters
hist_diff– normalised histogram distance in [0.0, 1.0]. A value of 0.0 means identical frames; 1.0 means maximally different.threshold– decision boundary; values strictly above the threshold are considered scene changes. Typical value:0.45.
§Returns
true if hist_diff > threshold (scene change detected).
Trait Implementations§
Source§impl Clone for SceneChangeDetector
impl Clone for SceneChangeDetector
Source§fn clone(&self) -> SceneChangeDetector
fn clone(&self) -> SceneChangeDetector
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 moreSource§impl Debug for SceneChangeDetector
impl Debug for SceneChangeDetector
Source§impl Default for SceneChangeDetector
impl Default for SceneChangeDetector
Source§fn default() -> SceneChangeDetector
fn default() -> SceneChangeDetector
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SceneChangeDetector
impl RefUnwindSafe for SceneChangeDetector
impl Send for SceneChangeDetector
impl Sync for SceneChangeDetector
impl Unpin for SceneChangeDetector
impl UnsafeUnpin for SceneChangeDetector
impl UnwindSafe for SceneChangeDetector
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