shithub: libvpx

Download patch

ref: 255241c6d0c35062928c59f363c85e4a75d3aecf
parent: 43b9e785bad9cc39c9bab84fe22fd5afb9efb58b
parent: a0de2692fc5ee69825b35fa6158f116448849e68
author: Marco Paniconi <marpan@google.com>
date: Fri Aug 25 18:00:08 EDT 2017

Merge "vp9: Speed 6 adapt_partition for live/vbr usage."

--- a/vp9/encoder/vp9_encodeframe.c
+++ b/vp9/encoder/vp9_encodeframe.c
@@ -4178,7 +4178,10 @@
       int shift = cpi->Source->y_stride * (mi_row << 3) + (mi_col << 3);
       int sb_offset2 = ((cm->mi_cols + 7) >> 3) * (mi_row >> 3) + (mi_col >> 3);
       int64_t source_sad = avg_source_sad(cpi, x, shift, sb_offset2);
-      if (sf->adapt_partition_source_sad && source_sad > 40000)
+      if (sf->adapt_partition_source_sad &&
+          (cpi->oxcf.rc_mode == VPX_VBR &&
+           source_sad > sf->adapt_partition_thresh &&
+           cpi->refresh_golden_frame))
         partition_search_type = REFERENCE_PARTITION;
     }
 
--- a/vp9/encoder/vp9_speed_features.c
+++ b/vp9/encoder/vp9_speed_features.c
@@ -535,8 +535,9 @@
     if (!cpi->external_resize && cm->width <= 1920) sf->use_source_sad = 1;
 
     if (sf->use_source_sad) {
-      if (cm->width * cm->height <= 640 * 360)
-        sf->adapt_partition_source_sad = 1;
+      sf->adapt_partition_source_sad = 1;
+      sf->adapt_partition_thresh =
+          (cm->width * cm->height <= 640 * 360) ? 40000 : 80000;
       if (cpi->content_state_sb_fd == NULL &&
           (!cpi->use_svc ||
            cpi->svc.spatial_layer_id == cpi->svc.number_spatial_layers - 1)) {
--- a/vp9/encoder/vp9_speed_features.h
+++ b/vp9/encoder/vp9_speed_features.h
@@ -491,9 +491,11 @@
 
   int use_simple_block_yrd;
 
-  // If source sad of superblock is high, will switch from VARIANCE_PARTITION to
-  // REFERENCE_PARTITION (which selects partition based on the nonrd-pickmode).
+  // If source sad of superblock is high (> adapt_partition_thresh), will switch
+  // from VARIANCE_PARTITION to REFERENCE_PARTITION (which selects partition
+  // based on the nonrd-pickmode).
   int adapt_partition_source_sad;
+  int adapt_partition_thresh;
 } SPEED_FEATURES;
 
 struct VP9_COMP;