shithub: libvpx

Download patch

ref: 354836692012619e2d7e7c56e1d80984f38b0ca8
parent: 94ec37097ed75116f04b59f451509e135d447a2b
parent: 5512dbb889647c35ef229d957f3e6570a916f0bc
author: Jingning Han <jingning@google.com>
date: Fri Aug 31 14:19:07 EDT 2018

Merge "Add element stack operations for arf index control"

--- 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) {