shithub: libvpx

Download patch

ref: 4770f851a893123b76b204dad85a7a09dfb1b6ed
parent: d7ed861ce3b1751d666d0cd942582eff48d310bf
author: Jingning Han <[email protected]>
date: Tue Sep 18 11:26:26 EDT 2018

Update the comp_refs counts

Generalize the comp_refs counts update support the case where one
has 1 fwd and 2 bwd reference frames too.

Change-Id: I979216a95d45efef51026158f94612bef39d3c6d

--- a/vp9/encoder/vp9_encodeframe.c
+++ b/vp9/encoder/vp9_encodeframe.c
@@ -2027,8 +2027,10 @@
                             [has_second_ref(mi)]++;
 
         if (has_second_ref(mi)) {
-          counts->comp_ref[vp9_get_pred_context_comp_ref_p(cm, xd)]
-                          [ref0 == GOLDEN_FRAME]++;
+          const int idx = cm->ref_frame_sign_bias[cm->comp_fixed_ref];
+          const int ctx = vp9_get_pred_context_comp_ref_p(cm, xd);
+          const int bit = mi->ref_frame[!idx] == cm->comp_var_ref[1];
+          counts->comp_ref[ctx][bit]++;
         } else {
           counts->single_ref[vp9_get_pred_context_single_ref_p1(xd)][0]
                             [ref0 != LAST_FRAME]++;