MOTION_SEARCH: Disable mesh search for compound mode

The function `full_pixel_exhaustive` does not support compound mode. So
in the current codebase, the encoder outputs incorrect mv when mesh
search run run for compound mode. This commit disables the use of mesh
search when compound mode is being tested.

Performance:
| SPD_SET |    TESTSET     | AVG_PSNR | OVR_PSNR |  SSIM   | ENC_T |
|---------|----------------|----------|----------|---------|-------|
|    0    |     hdres2     | +0.001%  | +0.011%  | +0.005% | -1.4% |
|    0    |    lowres2     | -0.002%  | -0.002%  | -0.011% | -0.7% |
|    0    |    midres2     | -0.011%  | -0.010%  | -0.016% | -1.5% |
|    0    | screen_content | +0.043%  | +0.023%  | +0.063% | -9.7% |
|---------|----------------|----------|----------|---------|-------|
|    1    |     hdres2     | -0.010%  | -0.008%  | -0.002% | -0.5% |
|    1    |    lowres2     | +0.002%  | +0.002%  | +0.005% | -0.2% |
|    1    |    midres2     | -0.002%  | -0.002%  | +0.005% | -0.3% |
|    1    | screen_content | -0.022%  | -0.010%  | +0.140% | -2.9% |
|---------|----------------|----------|----------|---------|-------|
|    2    |     hdres2     | +0.002%  | +0.001%  | +0.005% | -0.1% |
|    2    |    lowres2     | +0.002%  | +0.002%  | +0.002% | +0.0% |
|    2    |    midres2     | -0.002%  | -0.002%  | -0.001% | -0.0% |
|    2    | screen_content | -0.022%  | -0.019%  | -0.030% | -0.3% |

No change is observed on speed 3 and above.

Note that some clips that relies on mesh search got much faster. e.g.
`BalloonFestival_1280x720_24fps_8bit.y4m` averages to 30% encoding time
reduction on speed 0.

STATS_CHANGED

Change-Id: I989bdf59e39aa9c42f53e06fcf785b1beff517bb
diff --git a/av1/encoder/mcomp.c b/av1/encoder/mcomp.c
index 8337592..2dbea2b 100644
--- a/av1/encoder/mcomp.c
+++ b/av1/encoder/mcomp.c
@@ -1596,6 +1596,12 @@
   int range = mesh_patterns[0].range;
   int baseline_interval_divisor;
 
+  // TODO(chiyotsai@google.com): Currently exhaustive search calls single ref
+  // version of sad and variance function. We still need to check the
+  // performance when compound ref exhaustive search is enabled.
+  assert(!ms_params->ms_buffers.second_pred &&
+         "Mesh search does not support compound mode!");
+
   *best_mv = start_mv;
 
   // Trap illegal values for interval and range for this function.
@@ -1793,7 +1799,8 @@
 
   // Should we allow a follow on exhaustive search?
   if (!run_mesh_search &&
-      ((search_method == NSTEP) || (search_method == NSTEP_8PT))) {
+      ((search_method == NSTEP) || (search_method == NSTEP_8PT)) &&
+      !ms_params->ms_buffers.second_pred) {
     int exhaustive_thr = ms_params->force_mesh_thresh;
     exhaustive_thr >>=
         10 - (mi_size_wide_log2[bsize] + mi_size_high_log2[bsize]);