From c880e02f97df6f7ccd3a99b66dfc97113d5a65fa Mon Sep 17 00:00:00 2001
From: Paul Wilkins <paulwilkins@google.com>
Date: Tue, 4 Jun 2013 15:58:53 +0100
Subject: [PATCH] Turn off compound inter search refinement for good quality.

Turn this feature off for some modes in  "good" quality.

Change-Id: I3f262d62cca8f01736b977af1465291e8be29f0a
---
 vp9/encoder/vp9_onyx_if.c  | 5 +++--
 vp9/encoder/vp9_onyx_int.h | 2 +-
 vp9/encoder/vp9_rdopt.c    | 4 ++--
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/vp9/encoder/vp9_onyx_if.c b/vp9/encoder/vp9_onyx_if.c
index f5e40ef7b3..448c1c4102 100644
--- a/vp9/encoder/vp9_onyx_if.c
+++ b/vp9/encoder/vp9_onyx_if.c
@@ -740,7 +740,7 @@ void vp9_set_speed_features(VP9_COMP *cpi) {
   sf->optimize_coefficients = !cpi->oxcf.lossless;
   sf->first_step = 0;
   sf->max_step_search_steps = MAX_MVSEARCH_STEPS;
-  sf->comp_inter_joint_search = 1;
+  sf->comp_inter_joint_search_thresh = BLOCK_SIZE_AB4X4;
 #if CONFIG_MULTIPLE_ARF
   // Switch segmentation off.
   sf->static_segmentation = 0;
@@ -762,11 +762,12 @@ void vp9_set_speed_features(VP9_COMP *cpi) {
   sf->static_segmentation = 0;
 #endif
       sf->mb16_breakout = 0;
+      sf->comp_inter_joint_search_thresh = BLOCK_SIZE_SB8X8;
 
       if (speed > 0) {
+        sf->comp_inter_joint_search_thresh = BLOCK_SIZE_TYPES;
         sf->optimize_coefficients = 0;
         sf->no_skip_block4x4_search = 0;
-        sf->comp_inter_joint_search = 0;
         sf->first_step = 1;
       }
       break;
diff --git a/vp9/encoder/vp9_onyx_int.h b/vp9/encoder/vp9_onyx_int.h
index c63de69f6d..670f41f3b6 100644
--- a/vp9/encoder/vp9_onyx_int.h
+++ b/vp9/encoder/vp9_onyx_int.h
@@ -217,7 +217,7 @@ typedef struct {
   int search_best_filter;
   int mb16_breakout;
   int static_segmentation;
-  int comp_inter_joint_search;
+  int comp_inter_joint_search_thresh;
 } SPEED_FEATURES;
 
 enum BlockSize {
diff --git a/vp9/encoder/vp9_rdopt.c b/vp9/encoder/vp9_rdopt.c
index c48f34ad75..a8a29d98ab 100644
--- a/vp9/encoder/vp9_rdopt.c
+++ b/vp9/encoder/vp9_rdopt.c
@@ -1402,7 +1402,7 @@ static void rd_check_segment_txsize(VP9_COMP *cpi, MACROBLOCK *x,
 
           // adjust src pointers
           mi_buf_shift(x, i);
-          if (cpi->compressor_speed == 0 && cpi->sf.comp_inter_joint_search) {
+          if (cpi->sf.comp_inter_joint_search_thresh < bsize) {
             iterative_motion_search(cpi, x, bsize, frame_mv[this_mode],
                                     scaled_ref_frame,
                                     mi_row, mi_col, seg_mvs[i]);
@@ -2114,7 +2114,7 @@ static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
         frame_mv[refs[0]].as_int = single_newmv[refs[0]].as_int;
         frame_mv[refs[1]].as_int = single_newmv[refs[1]].as_int;
 
-        if (cpi->sf.comp_inter_joint_search)
+        if (cpi->sf.comp_inter_joint_search_thresh < bsize)
           iterative_motion_search(cpi, x, bsize, frame_mv, scaled_ref_frame,
                                   mi_row, mi_col, single_newmv);
 
-- 
GitLab