From 4b058f81faa0335a03afeeb18c928316114557d3 Mon Sep 17 00:00:00 2001 From: Jingning Han Date: Tue, 18 Sep 2018 08:41:37 -0700 Subject: [PATCH] Add frame_start/end to gf_group Keep the start and end frame index for each group of pictures. Change-Id: I23c0d22e643218cf7486b238c2986101282d3fbe --- vp9/encoder/vp9_firstpass.c | 3 +++ vp9/encoder/vp9_firstpass.h | 2 ++ 2 files changed, 5 insertions(+) diff --git a/vp9/encoder/vp9_firstpass.c b/vp9/encoder/vp9_firstpass.c index 82fbcf4a8..38e98cd1e 100644 --- a/vp9/encoder/vp9_firstpass.c +++ b/vp9/encoder/vp9_firstpass.c @@ -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 diff --git a/vp9/encoder/vp9_firstpass.h b/vp9/encoder/vp9_firstpass.h index 441ef1fd3..da1c61c49 100644 --- a/vp9/encoder/vp9_firstpass.h +++ b/vp9/encoder/vp9_firstpass.h @@ -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; -- 2.40.0