From ace8ab89b7fdd8d43716abc2f38f1f673b3a5ee7 Mon Sep 17 00:00:00 2001 From: angiebird Date: Mon, 16 Dec 2019 15:19:35 -0800 Subject: [PATCH] Rename encode_frame_index to next_encode_frame_index Change-Id: Id9bd2a0f6c4278bf0f0c270eb937a317232dead6 --- vp9/simple_encode.cc | 8 ++++---- vp9/simple_encode.h | 11 ++++++----- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/vp9/simple_encode.cc b/vp9/simple_encode.cc index 61a6bcc22..80f238447 100644 --- a/vp9/simple_encode.cc +++ b/vp9/simple_encode.cc @@ -103,11 +103,11 @@ static void update_encode_frame_result( } static void IncreaseGroupOfPictureIndex(GroupOfPicture *group_of_picture) { - ++group_of_picture->encode_frame_index; + ++group_of_picture->next_encode_frame_index; } static int IsGroupOfPictureFinished(const GroupOfPicture &group_of_picture) { - return static_cast(group_of_picture.encode_frame_index) == + return static_cast(group_of_picture.next_encode_frame_index) == group_of_picture.encode_frame_list.size(); } @@ -116,7 +116,7 @@ static void SetGroupOfPicture(int first_is_key_frame, int use_alt_ref, GroupOfPicture *group_of_picture) { // Clean up the state of previous group of picture. group_of_picture->encode_frame_list.clear(); - group_of_picture->encode_frame_index = 0; + group_of_picture->next_encode_frame_index = 0; group_of_picture->show_frame_count = coding_frame_count - use_alt_ref; group_of_picture->start_show_index = first_show_idx; { @@ -296,7 +296,7 @@ GroupOfPicture SimpleEncode::ObserveGroupOfPicture() const { EncodeFrameInfo SimpleEncode::GetNextEncodeFrameInfo() const { return group_of_picture_ - .encode_frame_list[group_of_picture_.encode_frame_index]; + .encode_frame_list[group_of_picture_.next_encode_frame_index]; } void SimpleEncode::EncodeFrame(EncodeFrameResult *encode_frame_result) { diff --git a/vp9/simple_encode.h b/vp9/simple_encode.h index 286b66f02..4bee7c757 100644 --- a/vp9/simple_encode.h +++ b/vp9/simple_encode.h @@ -52,11 +52,12 @@ struct GroupOfPicture { std::vector encode_frame_list; // Indicates the index of the next coding frame in encode_frame_list. // In other words, EncodeFrameInfo of the next coding frame can be - // obtained with encode_frame_list[encode_frame_index]. - // Internally, encode_frame_index will be set to zero after the last frame of - // the group of pictures is coded. Otherwise, encode_frame_index will be - // increased after each EncodeFrame()/EncodeFrameWithQuantizeIndex() call. - int encode_frame_index; + // obtained with encode_frame_list[next_encode_frame_index]. + // Internally, next_encode_frame_index will be set to zero after the last + // frame of the group of pictures is coded. Otherwise, next_encode_frame_index + // will be increased after each EncodeFrame()/EncodeFrameWithQuantizeIndex() + // call. + int next_encode_frame_index; // Number of show frames in this group of pictures. int show_frame_count; // The show index/timestamp of the earliest show frame in the group of -- 2.40.0