]> granicus.if.org Git - libvpx/commitdiff
Separate EXT_ARFs' frame context index
authorWei-ting Lin <weitinglin@google.com>
Mon, 22 Aug 2016 22:52:32 +0000 (15:52 -0700)
committerWei-ting Lin <weitinglin@google.com>
Thu, 25 Aug 2016 16:31:00 +0000 (09:31 -0700)
This commit separate the frame index of EXT_ARFs' from other frame
types in the ext-refs setting.

It improves the average RD performance by

0.206% in the lowres, and
0.173% in the midres.

The overall gains for the ext-refs compared to the baseline are

5.665% in the lowres, and
4.883% in the midres.

Change-Id: I6591ad29120880c1aef0bd0b7cf15238c3f3b8f3

vp10/encoder/encoder.c
vp10/encoder/encoder.h

index caac3eecbe9fc07cb9d897b07beead3fdbe726a3..3f28008ad976bd2bf370bf612aca681d9a8cc4d3 100644 (file)
@@ -283,8 +283,16 @@ static void setup_frame(VP10_COMP *cpi) {
   if (frame_is_intra_only(cm) || cm->error_resilient_mode) {
     vp10_setup_past_independence(cm);
   } else {
+#if CONFIG_EXT_REFS
+    const GF_GROUP *gf_group = &cpi->twopass.gf_group;
+    if (gf_group->rf_level[gf_group->index] == GF_ARF_LOW)
+      cm->frame_context_idx = EXT_ARF_FRAME;
+    else if (cpi->refresh_alt_ref_frame)
+      cm->frame_context_idx = ARF_FRAME;
+#else
     if (cpi->refresh_alt_ref_frame)
       cm->frame_context_idx = ARF_FRAME;
+#endif
     else if (cpi->rc.is_src_frame_alt_ref)
       cm->frame_context_idx = OVERLAY_FRAME;
     else if (cpi->refresh_golden_frame)
index fca8b6fbecde625cd984b4fe51a7c2b826c35eda..b1b585518f662a831ef7c5d7c9ea9de57b4e5d32 100644 (file)
@@ -81,6 +81,8 @@ typedef enum {
 #if CONFIG_EXT_REFS
   // backward reference frame
   BRF_FRAME = 4,
+  // extra alternate reference frame
+  EXT_ARF_FRAME = 5
 #endif
 } FRAME_CONTEXT_INDEX;