Disable obmc at speed 5

Disabled obmc at speed 5 for fast encoding.

Borg test result:
                         avg_psnr: ovr_psnr: ssim: avg speedup:
objective-1-fast(fixed-q): 0.446    0.452    0.484   5.3%
midres(vbr):               0.489    0.476    0.501   5.7%
hdres(vbr):                0.468    0.471    0.450   7.8%

STATS_CHANGED

Change-Id: I574f1ca7215f561bc17551332cfab33febf2ab95
diff --git a/av1/encoder/encodeframe.c b/av1/encoder/encodeframe.c
index 6e00bd4..54aea3e 100644
--- a/av1/encoder/encodeframe.c
+++ b/av1/encoder/encodeframe.c
@@ -1625,7 +1625,7 @@
     }
 
     // Gather obmc count to update the probability.
-    if (cpi->sf.prune_obmc_prob_thresh > 0) {
+    if (!cpi->sf.disable_obmc && cpi->sf.prune_obmc_prob_thresh > 0) {
       const int inter_block = is_inter_block(mbmi);
       const int seg_ref_active =
           segfeature_active(&cm->seg, mbmi->segment_id, SEG_LVL_REF_FRAME);
@@ -5374,7 +5374,7 @@
     }
   }
 
-  if (cpi->sf.prune_obmc_prob_thresh > 0) {
+  if (!cpi->sf.disable_obmc && cpi->sf.prune_obmc_prob_thresh > 0) {
     const FRAME_UPDATE_TYPE update_type = get_frame_update_type(&cpi->gf_group);
 
     for (i = 0; i < BLOCK_SIZES_ALL; i++) {
diff --git a/av1/encoder/encoder.c b/av1/encoder/encoder.c
index 620a4e2..62a5340 100644
--- a/av1/encoder/encoder.c
+++ b/av1/encoder/encoder.c
@@ -5058,7 +5058,7 @@
     }
   }
 
-  if (cpi->sf.prune_obmc_prob_thresh > 0 &&
+  if (!cpi->sf.disable_obmc && cpi->sf.prune_obmc_prob_thresh > 0 &&
       cm->current_frame.frame_type == KEY_FRAME) {
     av1_copy(cpi->obmc_probs, default_obmc_probs);
   }
diff --git a/av1/encoder/rdopt.c b/av1/encoder/rdopt.c
index f970e24..d6ff46a 100644
--- a/av1/encoder/rdopt.c
+++ b/av1/encoder/rdopt.c
@@ -9846,8 +9846,8 @@
     const FRAME_UPDATE_TYPE update_type = get_frame_update_type(&cpi->gf_group);
     const int prune_obmc =
         cpi->obmc_probs[update_type][bsize] < cpi->sf.prune_obmc_prob_thresh;
-    if ((cpi->oxcf.enable_obmc == 0 || cpi->sf.use_nonrd_pick_mode ||
-         prune_obmc) &&
+    if ((cpi->oxcf.enable_obmc == 0 || cpi->sf.disable_obmc ||
+         cpi->sf.use_nonrd_pick_mode || prune_obmc) &&
         mbmi->motion_mode == OBMC_CAUSAL)
       continue;
 
@@ -12011,7 +12011,7 @@
   const FRAME_UPDATE_TYPE update_type = get_frame_update_type(&cpi->gf_group);
   const int prune_obmc =
       cpi->obmc_probs[update_type][bsize] < cpi->sf.prune_obmc_prob_thresh;
-  if (cpi->oxcf.enable_obmc && !prune_obmc) {
+  if (cpi->oxcf.enable_obmc && !cpi->sf.disable_obmc && !prune_obmc) {
     if (check_num_overlappable_neighbors(mbmi) &&
         is_motion_variation_allowed_bsize(bsize)) {
       int dst_width1[MAX_MB_PLANE] = { MAX_SB_SIZE, MAX_SB_SIZE, MAX_SB_SIZE };
diff --git a/av1/encoder/speed_features.c b/av1/encoder/speed_features.c
index 16ea7e8..ce40491 100644
--- a/av1/encoder/speed_features.c
+++ b/av1/encoder/speed_features.c
@@ -467,6 +467,7 @@
 
   if (speed >= 5) {
     sf->disable_lr_filter = 1;
+    sf->disable_obmc = 1;
   }
 }
 
@@ -926,6 +927,7 @@
   sf->disable_smooth_intra = 0;
   sf->perform_best_rd_based_gating_for_chroma = 0;
   sf->prune_obmc_prob_thresh = 0;
+  sf->disable_obmc = 0;
   sf->nonrd_merge_partition = 0;
 
   if (oxcf->mode == GOOD)
diff --git a/av1/encoder/speed_features.h b/av1/encoder/speed_features.h
index ef22c87..027020d 100644
--- a/av1/encoder/speed_features.h
+++ b/av1/encoder/speed_features.h
@@ -792,6 +792,9 @@
   // Prune obmc search using previous frame stats.
   int prune_obmc_prob_thresh;
 
+  // Disable obmc.
+  int disable_obmc;
+
   // Use ALTREF frame in non-RD mode decision.
   int use_nonrd_altref_frame;