vp9: Nonrd variance partition: increase threshold for using 4x4 avg.
authorMarco <marpan@google.com>
Fri, 21 Oct 2016 18:11:34 +0000 (11:11 -0700)
committerMarco <marpan@google.com>
Fri, 21 Oct 2016 18:51:06 +0000 (11:51 -0700)
In variance partition low resolutions may use varianace based on
4x4 average for better partitioning.
Increase the threshold for doing this at speed = 8.

Improves speed by ~5%, with little loss, < 1%, on RTC_derf set.

Change-Id: Ib5ec420832ccff887a06cb5e1d2c73199b093941

vp9/encoder/vp9_encodeframe.c

index 36e288e..aff7b1d 100644 (file)
@@ -799,6 +799,7 @@ static int choose_partitioning(VP9_COMP *cpi, const TileInfo *const tile,
   int min_var_32x32 = INT_MAX;
   int var_32x32;
   int avg_16x16[4];
+  int64_t threshold_4x4avg;
   NOISE_LEVEL noise_level = kLow;
   uint8_t *s;
   const uint8_t *d;
@@ -833,6 +834,9 @@ static int choose_partitioning(VP9_COMP *cpi, const TileInfo *const tile,
     }
   }
 
+  threshold_4x4avg =
+      (cpi->oxcf.speed < 8) ? thresholds[1] << 1 : thresholds[2] >> 1;
+
   memset(x->variance_low, 0, sizeof(x->variance_low));
 
   if (xd->mb_to_right_edge < 0) pixels_wide += (xd->mb_to_right_edge >> 3);
@@ -999,7 +1003,7 @@ static int choose_partitioning(VP9_COMP *cpi, const TileInfo *const tile,
       }
       if (is_key_frame || (low_res &&
                            vt.split[i].split[j].part_variances.none.variance >
-                               (thresholds[1] << 1))) {
+                               threshold_4x4avg)) {
         force_split[split_index] = 0;
         // Go down to 4x4 down-sampling for variance.
         variance4x4downsample[i2 + j] = 1;