Commit 0c9c2c04 authored by Luca Barbato's avatar Luca Barbato Committed by Luca Barbato

Explicitly set the last_frame in the scene detector

parent 1eb81a66
......@@ -891,9 +891,7 @@ impl<T: Pixel> Context<T> {
let distance = frame_number - prev_keyframe;
if distance < self.config.enc.min_key_frame_interval {
if distance + 1 == self.config.enc.min_key_frame_interval {
// Run the detector for the current frame, so that it will contain this frame's information
// to compare against the next frame. We can ignore the results for this frame.
self.keyframe_detector.detect_scene_change(frame, frame_number as usize);
self.keyframe_detector.set_last_frame(frame, frame_number as usize);
}
return FrameType::INTER;
}
......
......@@ -47,6 +47,10 @@ impl<T: Pixel> SceneChangeDetector<T> {
detector
}
pub fn set_last_frame(&mut self, ref_frame: Arc<Frame<T>>, frame_num: usize) {
self.last_frame = Some((frame_num, ref_frame));
}
pub fn detect_scene_change(&mut self, curr_frame: Arc<Frame<T>>, frame_num: usize) -> bool {
let mut is_change = false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment