From: Deb Mukherjee <debargha@google.com>
Date: Wed, 12 Nov 2014 00:09:07 +0000 (-0800)
Subject: Vidyo: Turn off keyframes in higher spatial layers
X-Git-Tag: v1.4.0~510^2
X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=48a762731695c14d3810f0396b5aa53ba0c725dc;p=libvpx

Vidyo: Turn off keyframes in higher spatial layers

Change-Id: Icdd5e71cd6a2b59bc4b3b972af9e4d4a36821792
---

diff --git a/vp9/encoder/vp9_encoder.c b/vp9/encoder/vp9_encoder.c
index 72e11d668..fd7c974aa 100644
--- a/vp9/encoder/vp9_encoder.c
+++ b/vp9/encoder/vp9_encoder.c
@@ -3635,6 +3635,13 @@ int vp9_get_compressed_data(VP9_COMP *cpi, unsigned int *frame_flags,
     if (source != NULL) {
       cm->show_frame = 1;
       cm->intra_only = 0;
+      // if the flags indicate intra frame, but if the current picture is for
+      // non-zero spatial layer, it should not be an intra picture.
+      // TODO(Won Kap): this needs to change if per-layer intra frame is
+      // allowed.
+      if ((source->flags | VPX_EFLAG_FORCE_KF) && cpi->svc.spatial_layer_id) {
+        source->flags &= ~(unsigned int)(VPX_EFLAG_FORCE_KF);
+      }
 
       // Check to see if the frame should be encoded as an arf overlay.
       check_src_altref(cpi, source);