shithub: libvpx

Download patch

ref: 4b058f81faa0335a03afeeb18c928316114557d3
parent: 0aa83d61a18fbdd5921247e0401b0fbba443cf35
author: Jingning Han <jingning@google.com>
date: Tue Sep 18 04:41:37 EDT 2018

Add frame_start/end to gf_group

Keep the start and end frame index for each group of pictures.

Change-Id: I23c0d22e643218cf7486b238c2986101282d3fbe

--- a/vp9/encoder/vp9_firstpass.c
+++ b/vp9/encoder/vp9_firstpass.c
@@ -2184,6 +2184,9 @@
 
   key_frame = cpi->common.frame_type == KEY_FRAME;
 
+  gf_group->frame_start = cpi->common.current_video_frame;
+  gf_group->frame_end = gf_group->frame_start + rc->baseline_gf_interval - 1;
+
   get_arf_buffer_indices(arf_buffer_indices);
 
   // For key frames the frame target rate is already set and it
--- a/vp9/encoder/vp9_firstpass.h
+++ b/vp9/encoder/vp9_firstpass.h
@@ -141,6 +141,8 @@
   int bit_allocation[MAX_STATIC_GF_GROUP_LENGTH + 2];
   int gfu_boost[MAX_STATIC_GF_GROUP_LENGTH + 2];
 
+  int frame_start;
+  int frame_end;
   // TODO(jingning): The array size of arf_stack could be reduced.
   int arf_index_stack[MAX_LAG_BUFFERS * 2];
   int top_arf_idx;