]> granicus.if.org Git - libvpx/commitdiff
Set up frame contexts based on frame type
authorDeepa K G <deepa.kg@ittiam.com>
Thu, 20 Jun 2019 13:00:41 +0000 (18:30 +0530)
committerDeepa K G <deepa.kg@ittiam.com>
Mon, 24 Jun 2019 12:46:53 +0000 (18:16 +0530)
In single layer ARF case, use different frame
contexts for KF, ARF/GF, LF, OVERLAY update types.

Change-Id: Iebb7f9bb430e483dea1e75fc122b9b67645ce804

vp9/encoder/vp9_encoder.c

index 35a8a077f846cfd38fabbd4e7430cd018d53a660..11bfd034e9a77207dcfe1a862ed4abf2713fc230 100644 (file)
@@ -814,7 +814,17 @@ static void setup_frame(VP9_COMP *cpi) {
   if (frame_is_intra_only(cm) || cm->error_resilient_mode) {
     vp9_setup_past_independence(cm);
   } else {
-    if (!cpi->use_svc) cm->frame_context_idx = cpi->refresh_alt_ref_frame;
+    if (!cpi->use_svc) {
+      const int boost_frame =
+          !cpi->rc.is_src_frame_alt_ref &&
+          (cpi->refresh_golden_frame || cpi->refresh_alt_ref_frame);
+      if (boost_frame)
+        cm->frame_context_idx = 1;
+      else if (cpi->rc.is_src_frame_alt_ref)
+        cm->frame_context_idx = 2;
+      else
+        cm->frame_context_idx = 3;
+    }
   }
 
   // TODO(jingning): Overwrite the frame_context_idx index in multi-layer ARF