shithub: libvpx

Download patch

ref: 018ffd385f09354b3bd86269168c2885f5b7c4f2
parent: ba1c053df90386696c846807f17375ba8622e6f1
parent: 30c22d842cffc737de00388af972110b89b1547c
author: Jingning Han <jingning@google.com>
date: Wed Sep 5 10:30:13 EDT 2018

Merge "Structure the multi-layer ARF locations"

--- a/vp9/encoder/vp9_firstpass.c
+++ b/vp9/encoder/vp9_firstpass.c
@@ -2335,11 +2335,11 @@
 
 static void find_arf_order(GF_GROUP *gf_group, int *layer_depth,
                            int *index_counter, int depth, int start, int end) {
-  const int mid = (start + end + 1) >> 1;
+  const int mid = (start + end) >> 1;
   const int min_frame_interval = 3;
 
   // Process regular P frames
-  if (end - start <= min_frame_interval) {
+  if (end - start < min_frame_interval) {
     int idx;
     for (idx = start; idx < end; ++idx) {
       gf_group->update_type[*index_counter] = LF_UPDATE;
@@ -2350,7 +2350,7 @@
     return;
   }
 
-  assert(abs(mid - start) > 1 && abs(mid - end) > 1);
+  assert(abs(mid - start) >= 1 && abs(mid - end) >= 1);
 
   // Process ARF frame
   layer_depth[*index_counter] = depth;