]> granicus.if.org Git - libvpx/commitdiff
vp9-screen: Rework the mode skip logic for screen
authorMarco Paniconi <marpan@google.com>
Sat, 9 Mar 2019 05:00:48 +0000 (21:00 -0800)
committerMarco Paniconi <marpan@google.com>
Mon, 11 Mar 2019 01:43:54 +0000 (18:43 -0700)
Don't force skip of zero-golden reference when
zero_temp_sad_source = 0, as it be may the
inter-layer reference. And remove the flatness conditon
when superblock is static.

Change-Id: I6b4b6eac0f6a2abc862c23d0e5467c7cf61995ef

vp9/encoder/vp9_pickmode.c

index 558210c604d81c48c9e4c312af89d2a1e5c9c622..ac98162635ec0a953450e8a077ab951b2b9b0680 100644 (file)
@@ -2029,16 +2029,24 @@ void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, TileDataEnc *tile_data,
 
     if (!(cpi->ref_frame_flags & flag_list[ref_frame])) continue;
 
-    // For screen content on flat blocks: skip non-zero motion check for
-    // stationary blocks, only skip zero motion check for non-stationary blocks.
-    if (cpi->oxcf.content == VP9E_CONTENT_SCREEN &&
-        sf->short_circuit_flat_blocks && x->source_variance == 0 &&
-        cpi->compute_source_sad_onepass && cpi->sf.use_source_sad &&
-        ((frame_mv[this_mode][ref_frame].as_int != 0 &&
-          x->zero_temp_sad_source) ||
-         (frame_mv[this_mode][ref_frame].as_int == 0 &&
-          !x->zero_temp_sad_source))) {
-      continue;
+    // For screen content. If zero_temp_sad source is computed: skip
+    // non-zero motion check for stationary blocks. If the superblock is
+    // non-stationary then for flat blocks skip the zero last check (keep golden
+    // as it may be inter-layer reference). Otherwise (if zero_temp_sad_source
+    // is not computed) skip non-zero motion check for flat blocks.
+    // TODO(marpan): Compute zero_temp_sad_source per coding block.
+    if (cpi->oxcf.content == VP9E_CONTENT_SCREEN) {
+      if (cpi->compute_source_sad_onepass && cpi->sf.use_source_sad) {
+        if ((frame_mv[this_mode][ref_frame].as_int != 0 &&
+             x->zero_temp_sad_source) ||
+            (frame_mv[this_mode][ref_frame].as_int == 0 &&
+             x->source_variance == 0 && ref_frame == LAST_FRAME &&
+             !x->zero_temp_sad_source))
+          continue;
+      } else if (frame_mv[this_mode][ref_frame].as_int != 0 &&
+                 x->source_variance == 0) {
+        continue;
+      }
     }
 
     if (!(cpi->sf.inter_mode_mask[bsize] & (1 << this_mode))) continue;