shithub: libvpx

Download patch

ref: f129e09529e7d9e78acc39c44714d6e5fc2f0008
parent: 91fc730d831a46751fe5adb96f4897085b483313
author: Jerome Jiang <jianj@google.com>
date: Tue Jan 10 07:43:22 EST 2017

vp9: Turn on the partition copy for speed 8. Tune threshold.

For speed 8, it speeds up the encoding on android by 6% for QVGA and
7.4% for VGA with the new threshold. Overall PSNR is improved by 0.667
for rtc.

Change-Id: I4a644560b32c0b5b4e9f49ffb953d000413a3732

--- a/vp9/encoder/vp9_encodeframe.c
+++ b/vp9/encoder/vp9_encodeframe.c
@@ -516,6 +516,7 @@
     // The thresholds below are not changed locally.
     if (is_key_frame) {
       cpi->vbp_threshold_sad = 0;
+      cpi->vbp_threshold_copy = 0;
       cpi->vbp_bsize_min = BLOCK_8X8;
     } else {
       if (cm->width <= 352 && cm->height <= 288)
@@ -525,8 +526,13 @@
                                      ? (cpi->y_dequant[q][1] << 1)
                                      : 1000;
       cpi->vbp_bsize_min = BLOCK_16X16;
+      if (cm->width <= 352 && cm->height <= 288)
+        cpi->vbp_threshold_copy = 40960;
+      else
+        cpi->vbp_threshold_copy = (cpi->y_dequant[q][1] << 6) > 32000
+                                      ? (cpi->y_dequant[q][1] << 6)
+                                      : 32000;
     }
-    cpi->vbp_threshold_copy = cpi->vbp_thresholds[0] << 16;
     cpi->vbp_threshold_minmax = 15 + (q >> 3);
   }
 }
--- a/vp9/encoder/vp9_speed_features.c
+++ b/vp9/encoder/vp9_speed_features.c
@@ -497,8 +497,10 @@
 
   if (speed >= 8) {
     sf->adaptive_rd_thresh = 4;
-    // Disabled for now until the threshold is tuned.
-    sf->copy_partition_flag = 0;
+    // Enable partition copy
+    if (!cpi->use_svc && !cpi->resize_pending && !cpi->resize_state &&
+        !cpi->external_resize)
+      sf->copy_partition_flag = 1;
     if (sf->copy_partition_flag) {
       if (cpi->prev_partition == NULL) {
         cpi->prev_partition = (BLOCK_SIZE *)vpx_calloc(