shithub: libvpx

Download patch

ref: 51b3035fc339acbbe0fa039af0d942d78879a4c8
parent: a30ff3458dc2b7017ed9a5f1ce9132564ccc15dd
author: Dmitry Kovalev <dkovalev@google.com>
date: Tue Apr 8 14:59:09 EDT 2014

Adding vp9_inc_frame_in_layer() function.

Change-Id: Idf612c772440158cd1645623241c51ab0d57405c

--- a/vp9/encoder/vp9_onyx_if.c
+++ b/vp9/encoder/vp9_onyx_if.c
@@ -2756,15 +2756,8 @@
     // Don't increment frame counters if this was an altref buffer
     // update not a real frame
     ++cm->current_video_frame;
-    if (cpi->use_svc) {
-      LAYER_CONTEXT *lc;
-      if (cpi->svc.number_temporal_layers > 1) {
-        lc = &cpi->svc.layer_context[cpi->svc.temporal_layer_id];
-      } else {
-        lc = &cpi->svc.layer_context[cpi->svc.spatial_layer_id];
-      }
-      ++lc->current_video_frame_in_layer;
-    }
+    if (cpi->use_svc)
+      vp9_inc_frame_in_layer(&cpi->svc);
   }
 
   // restore prev_mi
--- a/vp9/encoder/vp9_svc_layercontext.c
+++ b/vp9/encoder/vp9_svc_layercontext.c
@@ -215,3 +215,10 @@
   }
   svc->spatial_layer_id = 0;
 }
+
+void vp9_inc_frame_in_layer(SVC *svc) {
+  LAYER_CONTEXT *const lc = (svc->number_temporal_layers > 1)
+      ? &svc->layer_context[svc->temporal_layer_id]
+      : &svc->layer_context[svc->spatial_layer_id];
+  ++lc->current_video_frame_in_layer;
+}
--- a/vp9/encoder/vp9_svc_layercontext.h
+++ b/vp9/encoder/vp9_svc_layercontext.h
@@ -70,6 +70,9 @@
 // Initialize second pass rc for spatial svc.
 void vp9_init_second_pass_spatial_svc(struct VP9_COMP *cpi);
 
+// Increment number of video frames in layer
+void vp9_inc_frame_in_layer(SVC *svc);
+
 #ifdef __cplusplus
 }  // extern "C"
 #endif