Set joint_comp speed 2 feature

This CL is a reduced version of
https://aomedia-review.googlesource.com/c/aom/+/72061
that sets when and how to use joint_comp at different speed levels.
Here, joint_comp was disabled at speed 2 and above. More investigation
will be done later about speed 1 setting.

At speed 2, AWCY showed 0.32% loss, and the encoder speedup is over 11%.

STATS_CHANGED

Change-Id: Ib0225d9e8ae2340d689cfaff317e650974c44397
diff --git a/av1/encoder/rdopt.c b/av1/encoder/rdopt.c
index 7b02cea..54376bf 100644
--- a/av1/encoder/rdopt.c
+++ b/av1/encoder/rdopt.c
@@ -9352,7 +9352,8 @@
 
   int comp_idx;
   const int search_jnt_comp = is_comp_pred & cm->seq_params.enable_jnt_comp &
-                              (mbmi->mode != GLOBAL_GLOBALMV);
+                              (mbmi->mode != GLOBAL_GLOBALMV) &
+                              (cpi->sf.use_jnt_comp_flag != JNT_COMP_DISABLED);
 
   // TODO(jingning): This should be deprecated shortly.
   const int has_nearmv = have_nearmv_in_inter_mode(mbmi->mode) ? 1 : 0;
@@ -9450,7 +9451,8 @@
           newmv_ret_val = args->single_newmv_valid[ref_mv_idx][ref0] ? 0 : 1;
           cur_mv[0] = args->single_newmv[ref_mv_idx][ref0];
           rate_mv = args->single_newmv_rate[ref_mv_idx][ref0];
-        } else if (!(search_jnt_comp && cpi->sf.jnt_comp_skip_mv_search &&
+        } else if (!(search_jnt_comp &&
+                     (cpi->sf.use_jnt_comp_flag == JNT_COMP_SKIP_MV_SEARCH) &&
                      comp_idx == 0)) {
           newmv_ret_val = handle_newmv(cpi, x, bsize, cur_mv, mi_row, mi_col,
                                        &rate_mv, args);
diff --git a/av1/encoder/speed_features.c b/av1/encoder/speed_features.c
index fa12b81..c72a412 100644
--- a/av1/encoder/speed_features.c
+++ b/av1/encoder/speed_features.c
@@ -185,7 +185,7 @@
   sf->ml_prune_ab_partition = 1;
   sf->ml_prune_4_partition = 1;
   sf->adaptive_txb_search_level = 1;
-  sf->jnt_comp_skip_mv_search = 1;
+  sf->use_jnt_comp_flag = JNT_COMP_SKIP_MV_SEARCH;
   sf->model_based_prune_tx_search_level = 1;
   sf->model_based_post_interp_filter_breakout = 1;
   sf->inter_mode_rd_model_estimation = 1;
@@ -253,6 +253,7 @@
     sf->disable_wedge_search_var_thresh = 100;
     sf->fast_wedge_sign_estimate = 1;
     sf->disable_dual_filter = 1;
+    sf->use_jnt_comp_flag = JNT_COMP_DISABLED;
   }
 
   if (speed >= 3) {
@@ -450,7 +451,7 @@
   sf->use_mb_rd_hash = 1;
   sf->optimize_b_precheck = 0;
   sf->jnt_comp_fast_tx_search = 0;
-  sf->jnt_comp_skip_mv_search = 0;
+  sf->use_jnt_comp_flag = JNT_COMP_ENABLED;
   sf->reuse_inter_intra_mode = 0;
 
   for (i = 0; i < TX_SIZES; i++) {
diff --git a/av1/encoder/speed_features.h b/av1/encoder/speed_features.h
index 318e513..3fcda3d 100644
--- a/av1/encoder/speed_features.h
+++ b/av1/encoder/speed_features.h
@@ -250,6 +250,12 @@
   LOW_TXFM_RD,
 } TXFM_RD_MODEL;
 
+typedef enum {
+  JNT_COMP_ENABLED,
+  JNT_COMP_SKIP_MV_SEARCH,
+  JNT_COMP_DISABLED,
+} JNT_COMP_FLAG;
+
 typedef struct SPEED_FEATURES {
   MV_SPEED_FEATURES mv;
 
@@ -531,8 +537,8 @@
   // Use model rd instead of transform search in jnt_comp
   int jnt_comp_fast_tx_search;
 
-  // Skip mv search in jnt_comp
-  int jnt_comp_skip_mv_search;
+  // Decide when and how to use joint_comp.
+  JNT_COMP_FLAG use_jnt_comp_flag;
 
   // Decoder side speed feature to add penalty for use of dual-sgr filters.
   // Takes values 0 - 10, 0 indicating no penalty and each additional level