Skip to content

Commit ecce9c1

Browse files
committed
Do not compute the qi if it not going to be used
1 parent 57bafcb commit ecce9c1

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/api/internal.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -597,6 +597,13 @@ impl<T: Pixel> ContextInner<T> {
597597
fn compute_lookahead_motion_vectors(&mut self, output_frameno: u64) {
598598
let qps = {
599599
let frame_data = self.frame_data.get(&output_frameno).unwrap();
600+
// We're only interested in valid frames which are not show-existing-frame.
601+
// Those two don't modify the rec_buffer so there's no need to do anything
602+
// special about it either, it'll propagate on its own.
603+
if frame_data.fi.invalid || frame_data.fi.show_existing_frame {
604+
return;
605+
}
606+
600607
let fti = frame_data.fi.get_frame_subtype();
601608
self.rc_state.select_qi(
602609
self,
@@ -609,13 +616,6 @@ impl<T: Pixel> ContextInner<T> {
609616
let fs = &mut frame_data.fs;
610617
let fi = &mut frame_data.fi;
611618

612-
// We're only interested in valid frames which are not show-existing-frame.
613-
// Those two don't modify the rec_buffer so there's no need to do anything
614-
// special about it either, it'll propagate on its own.
615-
if fi.invalid || fi.show_existing_frame {
616-
return;
617-
}
618-
619619
#[cfg(feature = "dump_lookahead_data")]
620620
{
621621
let data_location = Self::build_dump_properties();

0 commit comments

Comments
 (0)