shithub: libvpx

Download patch

ref: 5512dbb889647c35ef229d957f3e6570a916f0bc
parent: 753fd86e86ac727dccac88376260b8f54502f2a3
author: Jingning Han <jingning@google.com>
date: Wed Aug 22 08:03:39 EDT 2018

Add element stack operations for arf index control

Support arf index stack operation.

Change-Id: Ifcf521ffc95a520344824ffc159883b71e8fc7a0

--- a/vp9/encoder/vp9_encoder.h
+++ b/vp9/encoder/vp9_encoder.h
@@ -818,6 +818,22 @@
 
 void vp9_set_svc(VP9_COMP *cpi, int use_svc);
 
+static INLINE int stack_pop(int *stack, int stack_size) {
+  int idx;
+  const int r = stack[0];
+  for (idx = 1; idx < stack_size; ++idx) stack[idx - 1] = stack[idx];
+
+  return r;
+}
+
+static INLINE int stack_top(const int *stack) { return stack[0]; }
+
+static INLINE void stack_push(int *stack, int new_item, int stack_size) {
+  int idx;
+  for (idx = stack_size; idx > 0; --idx) stack[idx] = stack[idx - 1];
+  stack[0] = new_item;
+}
+
 int vp9_get_quantizer(struct VP9_COMP *cpi);
 
 static INLINE int frame_is_kf_gf_arf(const VP9_COMP *cpi) {