Improve low-latency (uni-directional) compound mode (non-normative)


(1) This patch will allow compound predictions from the same 
    reference;

(2) The code from this patch only takes effect when the sign bias
    values of the two references are allowed to be identical;

(3) A further effort will be taken to combine this effort with
    compound-singleref to finalize a new coding tool for the 
    single reference, compound prediction mode.

Change-Id: I682d9e00c849b02dff76577b2c581e1c1b97770b
diff --git a/av1/encoder/rdopt.c b/av1/encoder/rdopt.c
index 5c60f72..58dacde 100644
--- a/av1/encoder/rdopt.c
+++ b/av1/encoder/rdopt.c
@@ -10080,6 +10080,17 @@
     // This is only used in motion vector unit test.
     if (cpi->oxcf.motion_vector_unit_test && ref_frame == INTRA_FRAME) continue;
 
+#if CONFIG_LOWDELAY_COMPOUND  // Changes LL bitstream
+#if CONFIG_EXT_REFS
+    if (cpi->oxcf.pass == 0) {
+      // Complexity-compression trade-offs
+      // if (ref_frame == ALTREF_FRAME) continue;
+      // if (ref_frame == BWDREF_FRAME) continue;
+      if (second_ref_frame == ALTREF_FRAME) continue;
+      // if (second_ref_frame == BWDREF_FRAME) continue;
+    }
+#endif
+#endif
     comp_pred = second_ref_frame > INTRA_FRAME;
     if (comp_pred) {
       if (!cpi->allow_comp_inter_inter) continue;
@@ -11809,6 +11820,17 @@
     // This is only used in motion vector unit test.
     if (cpi->oxcf.motion_vector_unit_test && ref_frame == INTRA_FRAME) continue;
 
+#if CONFIG_LOWDELAY_COMPOUND  // Changes LL bitstream
+#if CONFIG_EXT_REFS
+    if (cpi->oxcf.pass == 0) {
+      // Complexity-compression trade-offs
+      // if (ref_frame == ALTREF_FRAME) continue;
+      // if (ref_frame == BWDREF_FRAME) continue;
+      if (second_ref_frame == ALTREF_FRAME) continue;
+      // if (second_ref_frame == BWDREF_FRAME) continue;
+    }
+#endif
+#endif
     comp_pred = second_ref_frame > INTRA_FRAME;
     if (comp_pred) {
       if (!cpi->allow_comp_inter_inter) continue;