shithub: libvpx

Download patch

ref: 8433c8f92df4e6e0e724624c44521de92639f251
parent: 071c95d8a13fbfceb53923122312524b646c22a7
parent: 929001bf22049cb3ec4679d8919237483128ea0a
author: Minghai Shang <minghai@google.com>
date: Fri Jul 25 09:24:27 EDT 2014

Merge "[spatial svc]Fix reference issues"

--- a/vp9/encoder/vp9_encoder.c
+++ b/vp9/encoder/vp9_encoder.c
@@ -131,7 +131,8 @@
   }
 
   if (cm->frame_type == KEY_FRAME) {
-    cpi->refresh_golden_frame = 1;
+    if (!(cpi->use_svc && cpi->svc.number_temporal_layers == 1))
+      cpi->refresh_golden_frame = 1;
     cpi->refresh_alt_ref_frame = 1;
   } else {
     cm->fc = cm->frame_contexts[cm->frame_context_idx];
@@ -2001,7 +2002,8 @@
   if (cpi->gold_is_last)
     cpi->ref_frame_flags &= ~VP9_GOLD_FLAG;
 
-  if (cpi->rc.frames_till_gf_update_due == INT_MAX)
+  if (cpi->rc.frames_till_gf_update_due == INT_MAX &&
+      !(cpi->use_svc && cpi->svc.number_temporal_layers == 1))
     cpi->ref_frame_flags &= ~VP9_GOLD_FLAG;
 
   if (cpi->alt_is_last)
--- a/vp9/encoder/vp9_ratectrl.c
+++ b/vp9/encoder/vp9_ratectrl.c
@@ -1238,6 +1238,7 @@
 
     if (cpi->use_svc && cpi->svc.number_temporal_layers == 1) {
       cpi->svc.layer_context[cpi->svc.spatial_layer_id].is_key_frame = 1;
+      cpi->ref_frame_flags &= (~VP9_ALT_FLAG);
     }
 
     if (cpi->pass == 0 && cpi->oxcf.rc_mode == VPX_CBR) {
@@ -1252,7 +1253,10 @@
         lc->is_key_frame = 0;
       } else {
         lc->is_key_frame = cpi->svc.layer_context[0].is_key_frame;
+        if (lc->is_key_frame)
+          cpi->ref_frame_flags &= (~VP9_LAST_FLAG);
       }
+      cpi->ref_frame_flags &= (~VP9_ALT_FLAG);
     }
 
     if (cpi->pass == 0 && cpi->oxcf.rc_mode == VPX_CBR) {