shithub: libvpx

Download patch

ref: 32c4fdec7862657bc3865ca0f2dd151ee0e45646
parent: 2b06bf20ce7e6ead8ea43dc9ad5bcc6674fee8d8
author: Paul Wilkins <paulwilkins@google.com>
date: Fri Mar 21 12:14:46 EDT 2014

Experimental change to speed 1 settings.

Allow tx search for ARF and GF helps quality but a little slower.
Setting subpel_iters_per_step to 1 improves encode speed.
Setting sf->mode_skip_start = 10 improves speed.

Initial local results suggest overall impact on quality is neutral
but encode is up to 15% faster.

Change-Id: Ibde02cae6626a44c10a1da0cefe888afbb51f037

--- a/vp9/encoder/vp9_onyx_if.c
+++ b/vp9/encoder/vp9_onyx_if.c
@@ -541,7 +541,16 @@
     sf->thresh_mult_sub8x8[THR_COMP_GA] = INT_MAX;
 }
 
-static void set_good_speed_feature(VP9_COMMON *cm,
+// Intra only frames, golden frames (except alt ref overlays) and
+// alt ref frames tend to be coded at a higher than ambient quality
+static INLINE int frame_is_boosted(const VP9_COMP *cpi,
+                                   const VP9_COMMON *const cm) {
+  return frame_is_intra_only(cm) || cpi->refresh_alt_ref_frame ||
+         (cpi->refresh_golden_frame && !cpi->rc.is_src_frame_alt_ref);
+}
+
+static void set_good_speed_feature(VP9_COMP *cpi,
+                                   VP9_COMMON *cm,
                                    SPEED_FEATURES *sf,
                                    int speed) {
   int i;
@@ -551,7 +560,7 @@
   if (speed == 1) {
     sf->use_square_partition_only = !frame_is_intra_only(cm);
     sf->less_rectangular_check  = 1;
-    sf->tx_size_search_method = frame_is_intra_only(cm)
+    sf->tx_size_search_method = frame_is_boosted(cpi, cm)
       ? USE_FULL_RD : USE_LARGESTALL;
 
     if (MIN(cm->width, cm->height) >= 720)
@@ -568,6 +577,8 @@
     sf->intra_y_mode_mask[TX_32X32] = INTRA_DC_H_V;
     sf->intra_uv_mode_mask[TX_32X32] = INTRA_DC_H_V;
     sf->intra_uv_mode_mask[TX_16X16] = INTRA_DC_H_V;
+    sf->subpel_iters_per_step = 1;
+    sf->mode_skip_start = 10;
   }
   if (speed == 2) {
     sf->use_square_partition_only = !frame_is_intra_only(cm);
@@ -937,7 +948,7 @@
     case MODE_FIRSTPASS:
     case MODE_GOODQUALITY:
     case MODE_SECONDPASS:
-      set_good_speed_feature(cm, sf, speed);
+      set_good_speed_feature(cpi, cm, sf, speed);
       break;
     case MODE_REALTIME:
       set_rt_speed_feature(cm, sf, speed);