From 483bcb310dea5a4fcb91af343408b14a9158ae29 Mon Sep 17 00:00:00 2001 From: angiebird Date: Mon, 2 Mar 2020 16:50:39 -0800 Subject: Add key frame group info to SimpleEncode Change-Id: I2c5abbe23c84c6d794e06ed6429136b10fb18683 --- vp9/simple_encode.h | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'vp9/simple_encode.h') diff --git a/vp9/simple_encode.h b/vp9/simple_encode.h index 1a064c854..67007e5c3 100644 --- a/vp9/simple_encode.h +++ b/vp9/simple_encode.h @@ -306,12 +306,11 @@ class SimpleEncode { // This function should be called after StartEncode() or EncodeFrame(). void EndEncode(); - // Given a key_frame_index, computes this key frame group's size. // The key frame group size includes one key frame plus the number of // following inter frames. Note that the key frame group size only counts the // show frames. The number of no show frames like alternate refereces are not // counted. - int GetKeyFrameGroupSize(int key_frame_index) const; + int GetKeyFrameGroupSize() const; // Provides the group of pictures that the next coding frame is in. // Only call this function between StartEncode() and EndEncode() @@ -355,11 +354,29 @@ class SimpleEncode { std::vector external_arf_indexes_; GroupOfPicture group_of_picture_; + // The key frame group size includes one key frame plus the number of + // following inter frames. Note that the key frame group size only counts the + // show frames. The number of no show frames like alternate refereces are not + // counted. + int key_frame_group_size_; + + // The index for the to-be-coded show frame in the key frame group. + int key_frame_group_index_; + + // Update key_frame_group_size_ and reset key_frame_group_index_. + void UpdateKeyFrameGroup(int key_frame_show_index); + + // Update key_frame_group_index_. + void PostUpdateKeyFrameGroupIndex(FrameType frame_type); + // Each show or no show frame is assigned with a coding index based on its // coding order (starting from zero) in the coding process of the entire // video. The coding index of the to-be-coded frame. int frame_coding_index_; + // Number of show frames we have coded so far. + int show_frame_count_; + // TODO(angiebird): Do we need to reset ref_frames_info_ when the next key // frame appears? // Reference frames info of the to-be-coded frame. -- cgit v1.2.3