Remove ONE_SIDED_COMPOUND experimental flag

Always assume ONE_SIDED_COMPOUND is true as it has been adopted
officially. Further, this patch also fixes the cmake setup for
the experiment of EXT_COMP_REFS, as when EXT_COMP_REFS is on, it
shall always have ONE_SIDED_COMPOUND on (but that was not the case
without this patch).

We leave EXT_COMP_REFS for the time being, even though it is also
adopted, since by keeping this flag, it may allow its turning off to
tune the encoder speed. The experiment of EXT_COMP_REFS should be
removed eventually at the closing of the bitstream.

Change-Id: I0644318e522f5b48d5bba4e4391104a24d43cdc3
diff --git a/av1/common/pred_common.c b/av1/common/pred_common.c
index 3222de7..6b943b5 100644
--- a/av1/common/pred_common.c
+++ b/av1/common/pred_common.c
@@ -519,16 +519,11 @@
   const int above_in_image = xd->up_available;
   const int left_in_image = xd->left_available;
 
-// Note:
-// The mode info data structure has a one element border above and to the
-// left of the entries correpsonding to real macroblocks.
-// The prediction flags in these dummy entries are initialised to 0.
-#if CONFIG_ONE_SIDED_COMPOUND || CONFIG_FRAME_SIGN_BIAS
-  // Code seems to assume that signbias of cm->comp_bwd_ref[0] is always 1
+  // Note:
+  // The mode info data structure has a one element border above and to the
+  // left of the entries correpsonding to real macroblocks.
+  // The prediction flags in these dummy entries are initialised to 0.
   const int bwd_ref_sign_idx = 1;
-#else
-  const int bwd_ref_sign_idx = cm->ref_frame_sign_bias[cm->comp_bwd_ref[0]];
-#endif  // CONFIG_ONE_SIDED_COMPOUND || CONFIG_FRAME_SIGN_BIAS
   const int fwd_ref_sign_idx = !bwd_ref_sign_idx;
 
   (void)cm;
@@ -624,16 +619,11 @@
   const int above_in_image = xd->up_available;
   const int left_in_image = xd->left_available;
 
-// Note:
-// The mode info data structure has a one element border above and to the
-// left of the entries correpsonding to real macroblocks.
-// The prediction flags in these dummy entries are initialised to 0.
-#if CONFIG_ONE_SIDED_COMPOUND || CONFIG_FRAME_SIGN_BIAS
-  // Code seems to assume that signbias of cm->comp_bwd_ref[0] is always 1
+  // Note:
+  // The mode info data structure has a one element border above and to the
+  // left of the entries correpsonding to real macroblocks.
+  // The prediction flags in these dummy entries are initialised to 0.
   const int bwd_ref_sign_idx = 1;
-#else
-  const int bwd_ref_sign_idx = cm->ref_frame_sign_bias[cm->comp_bwd_ref[0]];
-#endif  //  CONFIG_ONE_SIDED_COMPOUND || CONFIG_FRAME_SIGN_BIAS
   const int fwd_ref_sign_idx = !bwd_ref_sign_idx;
 
   (void)cm;
@@ -732,15 +722,11 @@
   const int above_in_image = xd->up_available;
   const int left_in_image = xd->left_available;
 
-// Note:
-// The mode info data structure has a one element border above and to the
-// left of the entries correpsonding to real macroblocks.
-// The prediction flags in these dummy entries are initialised to 0.
-#if CONFIG_ONE_SIDED_COMPOUND || CONFIG_FRAME_SIGN_BIAS
+  // Note:
+  // The mode info data structure has a one element border above and to the
+  // left of the entries correpsonding to real macroblocks.
+  // The prediction flags in these dummy entries are initialised to 0.
   const int bwd_ref_sign_idx = 1;
-#else
-  const int bwd_ref_sign_idx = cm->ref_frame_sign_bias[cm->comp_bwd_ref[0]];
-#endif  // CONFIG_ONE_SIDED_COMPOUND || CONFIG_FRAME_SIGN_BIAS
   const int fwd_ref_sign_idx = !bwd_ref_sign_idx;
 
   (void)cm;
diff --git a/av1/decoder/decodeframe.c b/av1/decoder/decodeframe.c
index bf54993..5a5bb9a 100644
--- a/av1/decoder/decodeframe.c
+++ b/av1/decoder/decodeframe.c
@@ -95,16 +95,7 @@
                                        struct aom_read_bit_buffer *rb);
 
 static int is_compound_reference_allowed(const AV1_COMMON *cm) {
-#if CONFIG_ONE_SIDED_COMPOUND  // Normative in decoder
   return !frame_is_intra_only(cm);
-#else
-  int i;
-  if (frame_is_intra_only(cm)) return 0;
-  for (i = 1; i < INTER_REFS_PER_FRAME; ++i)
-    if (cm->ref_frame_sign_bias[i + 1] != cm->ref_frame_sign_bias[1]) return 1;
-
-  return 0;
-#endif  // CONFIG_ONE_SIDED_COMPOUND
 }
 
 static void setup_compound_reference_mode(AV1_COMMON *cm) {
diff --git a/av1/decoder/decodemv.c b/av1/decoder/decodemv.c
index e30bcee..14fd853 100644
--- a/av1/decoder/decodemv.c
+++ b/av1/decoder/decodemv.c
@@ -1505,12 +1505,7 @@
       assert(comp_ref_type == BIDIR_COMP_REFERENCE);
 #endif  // CONFIG_EXT_COMP_REFS
 
-// Normative in decoder (for low delay)
-#if CONFIG_ONE_SIDED_COMPOUND || CONFIG_FRAME_SIGN_BIAS
       const int idx = 1;
-#else   // !(CONFIG_ONE_SIDED_COMPOUND || CONFIG_FRAME_SIGN_BIAS)
-      const int idx = cm->ref_frame_sign_bias[cm->comp_bwd_ref[0]];
-#endif  // CONFIG_ONE_SIDED_COMPOUND || CONFIG_FRAME_SIGN_BIAS)
 
       const int ctx = av1_get_pred_context_comp_ref_p(cm, xd);
       const int bit = READ_REF_BIT(comp_ref_p);
diff --git a/av1/encoder/encodeframe.c b/av1/encoder/encodeframe.c
index 426dc19..ae061e5 100644
--- a/av1/encoder/encodeframe.c
+++ b/av1/encoder/encodeframe.c
@@ -4177,25 +4177,14 @@
   // side behavior is where the ALT ref buffer has opposite sign bias to
   // the other two.
   if (!frame_is_intra_only(cm)) {
-#if !CONFIG_ONE_SIDED_COMPOUND
-    if ((cm->ref_frame_sign_bias[ALTREF_FRAME] ==
-         cm->ref_frame_sign_bias[GOLDEN_FRAME]) ||
-        (cm->ref_frame_sign_bias[ALTREF_FRAME] ==
-         cm->ref_frame_sign_bias[LAST_FRAME])) {
-      cpi->allow_comp_inter_inter = 0;
-    } else {
-#endif  // !CONFIG_ONE_SIDED_COMPOUND
-      cpi->allow_comp_inter_inter = 1;
-      cm->comp_fwd_ref[0] = LAST_FRAME;
-      cm->comp_fwd_ref[1] = LAST2_FRAME;
-      cm->comp_fwd_ref[2] = LAST3_FRAME;
-      cm->comp_fwd_ref[3] = GOLDEN_FRAME;
-      cm->comp_bwd_ref[0] = BWDREF_FRAME;
-      cm->comp_bwd_ref[1] = ALTREF2_FRAME;
-      cm->comp_bwd_ref[2] = ALTREF_FRAME;
-#if !CONFIG_ONE_SIDED_COMPOUND  // Normative in encoder
-    }
-#endif  // !CONFIG_ONE_SIDED_COMPOUND
+    cpi->allow_comp_inter_inter = 1;
+    cm->comp_fwd_ref[0] = LAST_FRAME;
+    cm->comp_fwd_ref[1] = LAST2_FRAME;
+    cm->comp_fwd_ref[2] = LAST3_FRAME;
+    cm->comp_fwd_ref[3] = GOLDEN_FRAME;
+    cm->comp_bwd_ref[0] = BWDREF_FRAME;
+    cm->comp_bwd_ref[1] = ALTREF2_FRAME;
+    cm->comp_bwd_ref[2] = ALTREF_FRAME;
   } else {
     cpi->allow_comp_inter_inter = 0;
   }
diff --git a/av1/encoder/encoder.c b/av1/encoder/encoder.c
index c7789a3..4926d40 100644
--- a/av1/encoder/encoder.c
+++ b/av1/encoder/encoder.c
@@ -374,13 +374,12 @@
 #endif  // CONFIG_NO_FRAME_CONTEXT_SIGNALING
     av1_zero(cpi->interp_filter_selected[0]);
   }
-#if CONFIG_ONE_SIDED_COMPOUND && \
-    !CONFIG_EXT_COMP_REFS  // No change to bitstream
+#if !CONFIG_EXT_COMP_REFS  // No change to bitstream
   if (cpi->sf.recode_loop == DISALLOW_RECODE) {
     cpi->refresh_bwd_ref_frame = cpi->refresh_last_frame;
     cpi->rc.is_bipred_frame = 1;
   }
-#endif  // CONFIG_ONE_SIDED_COMPOUND && !CONFIG_EXT_COMP_REFS
+#endif  // !CONFIG_EXT_COMP_REFS
 #if CONFIG_NO_FRAME_CONTEXT_SIGNALING
   if (frame_is_intra_only(cm) || cm->error_resilient_mode ||
       cm->frame_refs[0].idx < 0) {
diff --git a/av1/encoder/rdopt.c b/av1/encoder/rdopt.c
index 682f568..18045e6 100644
--- a/av1/encoder/rdopt.c
+++ b/av1/encoder/rdopt.c
@@ -9579,7 +9579,7 @@
     // This is only used in motion vector unit test.
     if (cpi->oxcf.motion_vector_unit_test && ref_frame == INTRA_FRAME) continue;
 
-#if CONFIG_ONE_SIDED_COMPOUND && !CONFIG_EXT_COMP_REFS  // Changes LL bitstream
+#if !CONFIG_EXT_COMP_REFS  // Changes LL bitstream
     if (cpi->oxcf.pass == 0) {
       // Complexity-compression trade-offs
       // if (ref_frame == ALTREF_FRAME) continue;
@@ -9587,7 +9587,7 @@
       if (second_ref_frame == ALTREF_FRAME) continue;
       // if (second_ref_frame == BWDREF_FRAME) continue;
     }
-#endif  // CONFIG_ONE_SIDED_COMPOUND && !CONFIG_EXT_COMP_REFS
+#endif  // !CONFIG_EXT_COMP_REFS
     comp_pred = second_ref_frame > INTRA_FRAME;
     if (comp_pred) {
       if (!cpi->allow_comp_inter_inter) continue;
diff --git a/build/cmake/aom_config_defaults.cmake b/build/cmake/aom_config_defaults.cmake
index 9f65fbb..6e15b13 100644
--- a/build/cmake/aom_config_defaults.cmake
+++ b/build/cmake/aom_config_defaults.cmake
@@ -172,7 +172,6 @@
 set(CONFIG_NEW_QUANT 0 CACHE NUMBER "AV1 experiment flag.")
 set(CONFIG_NO_FRAME_CONTEXT_SIGNALING 0 CACHE NUMBER "AV1 experiment flag.")
 set(CONFIG_OBU 0 CACHE NUMBER "AV1 experiment flag.")
-set(CONFIG_ONE_SIDED_COMPOUND 1 CACHE NUMBER "AV1 experiment flag.")
 set(CONFIG_OPT_REF_MV 0 CACHE NUMBER "AV1 experiment flag.")
 set(CONFIG_PALETTE_DELTA_ENCODING 0 CACHE NUMBER "AV1 experiment flag.")
 set(CONFIG_PALETTE_THROUGHPUT 1 CACHE NUMBER "AV1 experiment flag.")
diff --git a/configure b/configure
index f7c7ae1..31a4fe2 100755
--- a/configure
+++ b/configure
@@ -309,7 +309,6 @@
     new_multisymbol
     compound_singleref
     aom_qm
-    one_sided_compound
     ext_comp_refs
     smooth_hv
     lgt
@@ -500,7 +499,6 @@
       soft_enable intra_edge
       soft_enable mv_compress
       soft_enable dual_filter
-      soft_enable one_sided_compound
       soft_enable convolve_round
       soft_enable aom_qm
       soft_enable dist_8x8
@@ -542,7 +540,6 @@
     enabled compound_round && soft_enable convolve_round
     enabled ext_intra_mod && enable_feature intra_edge
     enabled intra_edge && enable_feature ext_intra
-    enabled ext_comp_refs && enable_feature one_sided_compound
     enabled cfl && enable_feature smooth_hv
     enabled cdef_singlepass && enable_feature cdef
     enabled mfmv && enable_feature frame_marker