]> granicus.if.org Git - libvpx/commitdiff
Sync ref frame writing with decoder
authorJingning Han <jingning@google.com>
Tue, 18 Sep 2018 19:13:18 +0000 (12:13 -0700)
committerJingning Han <jingning@google.com>
Tue, 18 Sep 2018 22:58:00 +0000 (15:58 -0700)
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

vp9/encoder/vp9_bitstream.c

index b96f59f0c63d658ea1c21b1504858929334f6940..76b7b123db4cf1e4cc31634544e0d665853290bc 100644 (file)
@@ -217,7 +217,8 @@ static void write_ref_frames(const VP9_COMMON *cm, const MACROBLOCKD *const xd,
     }
 
     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;