Extend speed feature txfm_rd_gate_level to speed 2

The speed feature txfm_rd_gate_level is made slightly more aggressive
for value of 1, and extended to speed 2.

          Instruction Count       BD-Rate Loss(%)
cpu-used    Reduction(%)     avg.psnr  ovr.psnr   ssim
   2          1.242          -0.0055    0.0007   -0.0033

There is negligible impact on speed/quality at speed 3.

STATS_CHANGED

Change-Id: I459c573c9601d1e89b680c0972a838815a679368
diff --git a/av1/encoder/rdopt_utils.h b/av1/encoder/rdopt_utils.h
index a130ffe..c8520bb 100644
--- a/av1/encoder/rdopt_utils.h
+++ b/av1/encoder/rdopt_utils.h
@@ -337,11 +337,12 @@
   const int scale[6] = { INT_MAX, 4, 3, 3, 2, 2 };
   const int qslope = 2 * (!is_luma_only);
   const int level_to_qindex_map[6] = { 0, 0, 0, 0, 80, 100 };
-  int aggr_factor = 1;
+  int aggr_factor = 4;
   const int pred_qindex_thresh = level_to_qindex_map[level];
   if (!is_luma_only && level <= 3) {
-    aggr_factor = AOMMAX(
-        1, ((MAXQ - x->qindex) * qslope + QINDEX_RANGE / 2) >> QINDEX_BITS);
+    aggr_factor =
+        4 * AOMMAX(1, ((MAXQ - x->qindex) * qslope + QINDEX_RANGE / 2) >>
+                          QINDEX_BITS);
   }
   if ((best_skip_rd >
        (x->source_variance << (num_pels_log2_lookup[bsize] + RDDIV_BITS))) &&
@@ -350,7 +351,7 @@
   // For level setting 1, be more conservative for non-luma-only case even when
   // prediction is good.
   else if ((level <= 1) && !is_luma_only)
-    aggr_factor *= 2;
+    aggr_factor = (aggr_factor >> 2) * 6;
 
   // Be more conservative for luma only cases (called from compound type rd)
   // since best_skip_rd is computed after and skip_rd is computed (with 8-bit
@@ -361,7 +362,7 @@
   int64_t rd_thresh =
       (best_skip_rd == INT64_MAX)
           ? best_skip_rd
-          : (int64_t)(best_skip_rd * aggr_factor * mul_factor >> 4);
+          : (int64_t)(best_skip_rd * aggr_factor * mul_factor >> 6);
   if (skip_rd > rd_thresh) eval_txfm = 0;
   return eval_txfm;
 }
diff --git a/av1/encoder/speed_features.c b/av1/encoder/speed_features.c
index be123f1..64495e5 100644
--- a/av1/encoder/speed_features.c
+++ b/av1/encoder/speed_features.c
@@ -824,6 +824,7 @@
     // Enable fast search only for COMPOUND_DIFFWTD type.
     sf->inter_sf.enable_fast_compound_mode_search = 1;
     sf->inter_sf.reuse_mask_search_results = 1;
+    sf->inter_sf.txfm_rd_gate_level = boosted ? 0 : 1;
 
     // TODO(Sachin): Enable/Enhance this speed feature for speed 2 & 3
     sf->interp_sf.adaptive_interp_filter_search = 1;