Enable skip mode work with JNT_COMP

This patch updates also the default cdfs for skip mode. It also remove
the unneeded checking on whether the best obtained RD mode aligned
with the skip mode.

For 30 frames, on both AWCY and Google lowres/midres test sets, with
the following config, the coding gain ranges from ~-0.15% to -0.23%:

--disable-ext-partition --disable-ext-partition-types --disable-txmg
--enable-jnt-comp --enable-mfmv

Change-Id: I39aeeb9e7b27ca679c1b3f9c0eea67b5e1f694e2
diff --git a/av1/common/entropymode.c b/av1/common/entropymode.c
index c75a148..633bd2e 100644
--- a/av1/common/entropymode.c
+++ b/av1/common/entropymode.c
@@ -1485,11 +1485,15 @@
 
 #if CONFIG_EXT_SKIP
 static const aom_cdf_prob default_skip_mode_cdfs[SKIP_MODE_CONTEXTS][CDF_SIZE(
-    2)] = { { AOM_CDF2(24576) }, { AOM_CDF2(16384) }, { AOM_CDF2(8192) } };
-#endif  // CONFIG_EXT_SKIP
+    2)] = { { AOM_CDF2(31609) }, { AOM_CDF2(20107) }, { AOM_CDF2(10296) } };
+static const aom_cdf_prob default_skip_cdfs[SKIP_CONTEXTS][CDF_SIZE(2)] = {
+  { AOM_CDF2(30224) }, { AOM_CDF2(16244) }, { AOM_CDF2(4835) }
+};
+#else
 static const aom_cdf_prob default_skip_cdfs[SKIP_CONTEXTS][CDF_SIZE(2)] = {
   { AOM_CDF2(24576) }, { AOM_CDF2(16384) }, { AOM_CDF2(8192) }
 };
+#endif  // CONFIG_EXT_SKIP
 
 #if CONFIG_JNT_COMP
 static const aom_cdf_prob
diff --git a/av1/decoder/decodemv.c b/av1/decoder/decodemv.c
index ebaf3bc..015547d 100644
--- a/av1/decoder/decodemv.c
+++ b/av1/decoder/decodemv.c
@@ -1901,10 +1901,6 @@
   read_ref_frames(cm, xd, r, mbmi->segment_id, mbmi->ref_frame);
   const int is_compound = has_second_ref(mbmi);
 
-#if CONFIG_EXT_SKIP
-// TODO(zoeliu): To work with JNT_COMP
-#endif  // CONFIG_EXT_SKIP
-
   for (int ref = 0; ref < 1 + is_compound; ++ref) {
     MV_REFERENCE_FRAME frame = mbmi->ref_frame[ref];
 
@@ -2238,7 +2234,11 @@
   mbmi->compound_idx = 1;
   mbmi->interinter_compound_type = COMPOUND_AVERAGE;
 
-  if (has_second_ref(mbmi)) {
+  if (has_second_ref(mbmi)
+#if CONFIG_EXT_SKIP
+      && !mbmi->skip_mode
+#endif  // CONFIG_EXT_SKIP
+      ) {
     // Read idx to indicate current compound inter prediction mode group
     const int masked_compound_used =
         is_any_masked_compound_used(bsize) && cm->allow_masked_compound;
diff --git a/av1/encoder/rdopt.c b/av1/encoder/rdopt.c
index 3a8594b..3ad9e39 100644
--- a/av1/encoder/rdopt.c
+++ b/av1/encoder/rdopt.c
@@ -9091,8 +9091,6 @@
         frame_mv[this_mode][second_ref_frame].as_int == INVALID_MV)
       break;
 
-    // TODO(zoeliu): To work with JNT_COMP
-
     mbmi->mode = this_mode;
     mbmi->uv_mode = UV_DC_PRED;
     mbmi->ref_frame[0] = ref_frame;
@@ -9133,6 +9131,10 @@
     mbmi->filter_intra_mode_info.use_filter_intra_mode[1] = 0;
 #endif  // CONFIG_FILTER_INTRA
     mbmi->interintra_mode = (INTERINTRA_MODE)(II_DC_PRED - 1);
+#if CONFIG_JNT_COMP
+    mbmi->comp_group_idx = 0;
+    mbmi->compound_idx = 1;
+#endif  // CONFIG_JNT_COMP
     mbmi->interinter_compound_type = COMPOUND_AVERAGE;
     mbmi->motion_mode = SIMPLE_TRANSLATION;
     mbmi->ref_mv_idx = 0;
@@ -9157,31 +9159,6 @@
     break;
   }
 }
-
-// Check whether the best RD mode satisfies the criteria of skip mode.
-static int check_skip_mode(const AV1_COMMON *const cm,
-                           const MB_MODE_INFO *const best_mbmi) {
-  if (!is_inter_mode(best_mbmi->mode)) return 0;
-
-  if (!has_second_ref(best_mbmi) ||
-      best_mbmi->ref_frame[0] != (cm->ref_frame_idx_0 + LAST_FRAME) ||
-      best_mbmi->ref_frame[1] != (cm->ref_frame_idx_1 + LAST_FRAME) ||
-      best_mbmi->mode != NEAREST_NEARESTMV)
-    return 0;
-
-  if (!best_mbmi->skip) return 0;
-
-  if (best_mbmi->uv_mode != UV_DC_PRED ||
-      best_mbmi->motion_mode != SIMPLE_TRANSLATION ||
-      best_mbmi->interinter_compound_type != COMPOUND_AVERAGE)
-    return 0;
-
-  if (best_mbmi->interp_filters !=
-      av1_broadcast_interp_filter(av1_unswitchable_filter(cm->interp_filter)))
-    return 0;
-
-  return 1;
-}
 #endif  // CONFIG_EXT_SKIP
 
 void av1_rd_pick_inter_mode_sb(const AV1_COMP *cpi, TileDataEnc *tile_data,
@@ -10601,8 +10578,7 @@
           RDCOST(x->rdmult, rd_cost->rate + x->skip_mode_cost[skip_mode_ctx][0],
                  rd_cost->dist);
 
-      if (x->skip_mode_rdcost <= best_intra_inter_mode_cost ||
-          check_skip_mode(cm, &best_mbmode))
+      if (x->skip_mode_rdcost <= best_intra_inter_mode_cost)
         best_mbmode.skip_mode = 1;
     }