rtc: Extend sf reduce_mv_pel_precision_highmotion for cpu 7/8

This patch introduces a new conservative level ( = 1) for the
sf reduce_mv_pel_precision_highmotion. This level is tuned for
cpu 7 and 8 for HDRES content. For cpu 7, 8 HDRES max qty. drops
are 0.83% and 0.67% respectively, with no visual quality impact.

The Borg test results of RT preset:
_______________________________________________________________
|cpu | Testset | Instr. Count |         BD-Rate Drop (%)       |
|    |         | Reduction(%) | avg. psnr | ovr.psnr |   ssim  |
|____|_________|______________|___________|__________|_________|
|  7 | HDRES   |    1.160     |  0.0901   |   0.1018 |  0.1482 |
|  8 | HDRES   |    0.605     | -0.0426   |  -0.0152 | -0.0014 |
|____|_________|______________|___________|__________|_________|

No changes to speed 9,10 and other testsets.

STATS_CHANGED

Change-Id: Ib45bea910b1cb099a684daaa8a7038bb9a3a6857
diff --git a/av1/encoder/nonrd_pickmode.c b/av1/encoder/nonrd_pickmode.c
index f85f2f0..ff2a5df 100644
--- a/av1/encoder/nonrd_pickmode.c
+++ b/av1/encoder/nonrd_pickmode.c
@@ -182,7 +182,7 @@
                                 bool fullpel_performed_well) {
   const int frame_lowmotion = cpi->rc.avg_frame_low_motion;
   // Reduce MV precision for higher int MV value & frame-level motion
-  if (cpi->sf.rt_sf.reduce_mv_pel_precision_highmotion >= 2) {
+  if (cpi->sf.rt_sf.reduce_mv_pel_precision_highmotion >= 3) {
     int mv_thresh = 4;
     const int is_low_resoln =
         (cpi->common.width * cpi->common.height <= 320 * 240);
@@ -194,10 +194,15 @@
       return HALF_PEL;
   } else if (cpi->sf.rt_sf.reduce_mv_pel_precision_highmotion >= 1) {
     int mv_thresh;
+    const int th_vals[2][3] = { { 4, 8, 10 }, { 4, 6, 8 } };
+    const int th_idx = cpi->sf.rt_sf.reduce_mv_pel_precision_highmotion - 1;
+    assert(th_idx >= 0 && th_idx < 2);
     if (frame_lowmotion > 0 && frame_lowmotion < 40)
       mv_thresh = 12;
     else
-      mv_thresh = (bsize >= BLOCK_32X32) ? 4 : (bsize >= BLOCK_16X16) ? 6 : 8;
+      mv_thresh = (bsize >= BLOCK_32X32)   ? th_vals[th_idx][0]
+                  : (bsize >= BLOCK_16X16) ? th_vals[th_idx][1]
+                                           : th_vals[th_idx][2];
     if (abs(mv->as_fullmv.row) >= (mv_thresh << 1) ||
         abs(mv->as_fullmv.col) >= (mv_thresh << 1))
       return FULL_PEL;
diff --git a/av1/encoder/speed_features.c b/av1/encoder/speed_features.c
index 7ffcad6..ab3ef83 100644
--- a/av1/encoder/speed_features.c
+++ b/av1/encoder/speed_features.c
@@ -1301,7 +1301,7 @@
       sf->rt_sf.skip_intra_pred = 2;
       sf->rt_sf.hybrid_intra_pickmode = 3;
       sf->rt_sf.reduce_mv_pel_precision_lowcomplex = 1;
-      sf->rt_sf.reduce_mv_pel_precision_highmotion = 1;
+      sf->rt_sf.reduce_mv_pel_precision_highmotion = 2;
     }
   } else {
     sf->rt_sf.prune_intra_mode_based_on_mv_range = 2;
@@ -1326,13 +1326,13 @@
       sf->rt_sf.gf_length_lvl = 1;
       sf->rt_sf.skip_cdef_sb = 1;
       sf->rt_sf.sad_based_adp_altref_lag = 2;
-      sf->rt_sf.reduce_mv_pel_precision_highmotion = 1;
+      sf->rt_sf.reduce_mv_pel_precision_highmotion = 2;
     }
     if (speed >= 10) {
       sf->rt_sf.hybrid_intra_pickmode = 2;
       sf->rt_sf.sad_based_adp_altref_lag = 4;
       sf->rt_sf.tx_size_level_based_on_qstep = 0;
-      sf->rt_sf.reduce_mv_pel_precision_highmotion = 2;
+      sf->rt_sf.reduce_mv_pel_precision_highmotion = 3;
     }
   }
   if (!is_480p_or_larger) {
@@ -1353,12 +1353,19 @@
   } else {
     if (speed >= 6) sf->rt_sf.skip_newmv_mode_based_on_sse = 3;
     if (speed == 7) sf->rt_sf.prefer_large_partition_blocks = 0;
-    if (speed >= 7) sf->rt_sf.reduce_mv_pel_precision_lowcomplex = 2;
+    if (speed >= 7) {
+      sf->rt_sf.reduce_mv_pel_precision_lowcomplex = 2;
+      sf->rt_sf.reduce_mv_pel_precision_highmotion = 1;
+    }
     if (speed >= 9) {
       sf->rt_sf.sad_based_adp_altref_lag = 1;
       sf->rt_sf.reduce_mv_pel_precision_lowcomplex = 0;
+      sf->rt_sf.reduce_mv_pel_precision_highmotion = 2;
     }
-    if (speed >= 10) sf->rt_sf.sad_based_adp_altref_lag = 3;
+    if (speed >= 10) {
+      sf->rt_sf.sad_based_adp_altref_lag = 3;
+      sf->rt_sf.reduce_mv_pel_precision_highmotion = 3;
+    }
   }
   // Setting for SVC, or when the ref_frame_config control is
   // used to set the reference structure.
@@ -1379,7 +1386,7 @@
     }
     if (speed >= 8) {
       sf->rt_sf.disable_cdf_update_non_reference_frame = true;
-      sf->rt_sf.reduce_mv_pel_precision_highmotion = 2;
+      sf->rt_sf.reduce_mv_pel_precision_highmotion = 3;
       if (rtc_ref->non_reference_frame) {
         sf->rt_sf.nonrd_agressive_skip = 1;
         sf->mv_sf.subpel_search_method = SUBPEL_TREE_PRUNED_MORE;
@@ -1417,7 +1424,7 @@
       sf->rt_sf.nonrd_prune_ref_frame_search = 3;
       sf->rt_sf.var_part_split_threshold_shift = 10;
       sf->mv_sf.subpel_search_method = SUBPEL_TREE_PRUNED_MORE;
-      sf->rt_sf.reduce_mv_pel_precision_highmotion = 2;
+      sf->rt_sf.reduce_mv_pel_precision_highmotion = 3;
       sf->rt_sf.reduce_mv_pel_precision_lowcomplex = 1;
     }
     if (speed >= 10) {
diff --git a/av1/encoder/speed_features.h b/av1/encoder/speed_features.h
index 60efc14..1ba4550 100644
--- a/av1/encoder/speed_features.h
+++ b/av1/encoder/speed_features.h
@@ -1515,8 +1515,9 @@
 
   // Reduce MV precision to halfpel for higher int MV value & frame-level motion
   // 0: disabled
-  // 1: Reduce precision to halfpel, fullpel based on conservative thresholds
-  // 2: Reduce precision to halfpel using more aggressive thresholds
+  // 1-2: Reduce precision to halfpel, fullpel based on conservative
+  // thresholds, aggressiveness increases with increase in level
+  // 3: Reduce precision to halfpel using more aggressive thresholds
   int reduce_mv_pel_precision_highmotion;
 
   // Reduce MV precision for low complexity blocks