]> granicus.if.org Git - libvpx/commitdiff
Add frame_start/end to gf_group
authorJingning Han <jingning@google.com>
Tue, 18 Sep 2018 15:41:37 +0000 (08:41 -0700)
committerJingning Han <jingning@google.com>
Tue, 18 Sep 2018 22:58:00 +0000 (15:58 -0700)
Keep the start and end frame index for each group of pictures.

Change-Id: I23c0d22e643218cf7486b238c2986101282d3fbe

vp9/encoder/vp9_firstpass.c
vp9/encoder/vp9_firstpass.h

index 82fbcf4a853f4997696bcd8975077fbf3413f940..38e98cd1eb354fb791cdd3739db183e5ea3f6018 100644 (file)
@@ -2184,6 +2184,9 @@ static int define_gf_group_structure(VP9_COMP *cpi) {
 
   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
index 441ef1fd35cac70d41319a3dad1843f885f785b6..da1c61c49ca4d074c8e387771a1d12fcddb8b48b 100644 (file)
@@ -141,6 +141,8 @@ typedef struct {
   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;