Conditionally skip using inter frames in speed features
authorJingning Han <jingning@google.com>
Wed, 22 Nov 2023 23:06:08 +0000 (15:06 -0800)
committerJingning Han <jingning@google.com>
Wed, 22 Nov 2023 23:06:29 +0000 (15:06 -0800)
When the reference frame's scaling factor is not in the supported
range, skip using it for motion compensation prediction in the
partition speed features.

BUG=b/312517065

Change-Id: Ie3687186521ad2616be258e80d3e5b16e5f2d5e9

vp9/encoder/vp9_encodeframe.c

index 63306ac..d0863b7 100644 (file)
@@ -1301,6 +1301,13 @@ static int choose_partitioning(VP9_COMP *cpi, const TileInfo *const tile,
       (frame_is_intra_only(cm) ||
        (is_one_pass_svc(cpi) &&
         cpi->svc.layer_context[cpi->svc.temporal_layer_id].is_key_frame));
+
+  if (!is_key_frame) {
+    if (cm->frame_refs[LAST_FRAME - 1].sf.x_scale_fp == REF_INVALID_SCALE ||
+        cm->frame_refs[LAST_FRAME - 1].sf.y_scale_fp == REF_INVALID_SCALE)
+      is_key_frame = 1;
+  }
+
   // Always use 4x4 partition for key frame.
   const int use_4x4_partition = frame_is_intra_only(cm);
   const int low_res = (cm->width <= 352 && cm->height <= 288);