shithub: libvpx

Download patch

ref: c73a44c725ab76fdec608fb63c7c22d1e189deef
parent: 43fc0879082e9c010c08c68c6147527f0d859bf9
author: Marco Paniconi <marpan@google.com>
date: Fri Mar 1 17:03:10 EST 2019

vp9-rtc: Adjust force split logic for screen mode

In variance partition for screen content mode:
force split to 32x32 if source pre-process detects
non-zero temporal sad.
Reduce artifacts in scroll motion content.

Change-Id: Ifbe2b500eb03ae853faa28a045ce4f1185443939

--- a/vp9/encoder/vp9_encodeframe.c
+++ b/vp9/encoder/vp9_encodeframe.c
@@ -1265,9 +1265,10 @@
   int pixels_wide = 64, pixels_high = 64;
   int64_t thresholds[4] = { cpi->vbp_thresholds[0], cpi->vbp_thresholds[1],
                             cpi->vbp_thresholds[2], cpi->vbp_thresholds[3] };
-  int scene_change_detected =
+  int force_64_split =
       cpi->rc.high_source_sad ||
-      (cpi->use_svc && cpi->svc.high_source_sad_superframe);
+      (cpi->use_svc && cpi->svc.high_source_sad_superframe) ||
+      (cpi->oxcf.content == VP9E_CONTENT_SCREEN && !x->zero_temp_sad_source);
 
   // For the variance computation under SVC mode, we treat the frame as key if
   // the reference (base layer frame) is key frame (i.e., is_key_frame == 1).
@@ -1330,7 +1331,7 @@
     }
     // If source_sad is low copy the partition without computing the y_sad.
     if (x->skip_low_source_sad && cpi->sf.copy_partition_flag &&
-        !scene_change_detected &&
+        !force_64_split &&
         copy_partitioning(cpi, x, xd, mi_row, mi_col, segment_id, sb_offset)) {
       x->sb_use_mv_part = 1;
       if (cpi->sf.svc_use_lowres_part &&
@@ -1359,7 +1360,7 @@
 
   // Index for force_split: 0 for 64x64, 1-4 for 32x32 blocks,
   // 5-20 for the 16x16 blocks.
-  force_split[0] = scene_change_detected;
+  force_split[0] = force_64_split;
 
   if (!is_key_frame) {
     // In the case of spatial/temporal scalable coding, the assumption here is