shithub: libvpx

Download patch

ref: 1e1f78e34cc243bf2eee30081c97ee2944ee4808
parent: 4b058f81faa0335a03afeeb18c928316114557d3
author: Jingning Han <jingning@google.com>
date: Tue Sep 18 08:13:18 EDT 2018

Sync ref frame writing with decoder

Enable the encoder to produce compound reference frame writing
that supports both 2 fwd + 1 bwd and 1 fwd + 2 bwd cases.

Change-Id: I63d2141435e2de7d8115d52b974fc41c2e608405

--- a/vp9/encoder/vp9_bitstream.c
+++ b/vp9/encoder/vp9_bitstream.c
@@ -217,7 +217,8 @@
     }
 
     if (is_compound) {
-      vpx_write(w, mi->ref_frame[0] == GOLDEN_FRAME,
+      const int idx = cm->ref_frame_sign_bias[cm->comp_fixed_ref];
+      vpx_write(w, mi->ref_frame[!idx] == cm->comp_var_ref[1],
                 vp9_get_pred_prob_comp_ref_p(cm, xd));
     } else {
       const int bit0 = mi->ref_frame[0] != LAST_FRAME;