Cosmetic changes for RATE_CTRL related functions

Move input parameters ahead of output parameters.

Change-Id: I384f69523b6be92224535d05373ebb33467a040e
This commit is contained in:
angiebird
2019-12-11 13:49:39 -08:00
parent fa370c32e7
commit 204ba94f4b
3 changed files with 18 additions and 17 deletions

View File

@@ -3643,9 +3643,9 @@ void vp9_twopass_postencode_update(VP9_COMP *cpi) {
} }
#if CONFIG_RATE_CTRL #if CONFIG_RATE_CTRL
void vp9_get_next_group_of_picture(int *first_is_key_frame, int *use_alt_ref, void vp9_get_next_group_of_picture(const VP9_COMP *cpi, int *first_is_key_frame,
int *coding_frame_count, int *first_show_idx, int *use_alt_ref, int *coding_frame_count,
const VP9_COMP *cpi) { int *first_show_idx) {
// We make a copy of rc here because we want to get information from the // We make a copy of rc here because we want to get information from the
// encoder without changing its state. // encoder without changing its state.
// TODO(angiebird): Avoid copying rc here. // TODO(angiebird): Avoid copying rc here.

View File

@@ -258,9 +258,10 @@ int vp9_get_frames_to_next_key(const struct VP9EncoderConfig *oxcf,
* starts or after vp9_get_compressed_data() when the encoding process of * starts or after vp9_get_compressed_data() when the encoding process of
* the last group of pictures is just finished. * the last group of pictures is just finished.
*/ */
void vp9_get_next_group_of_picture(int *first_is_key_frame, int *use_alt_ref, void vp9_get_next_group_of_picture(const struct VP9_COMP *cpi,
int *coding_frame_count, int *first_show_idx, int *first_is_key_frame, int *use_alt_ref,
const struct VP9_COMP *cpi); int *coding_frame_count,
int *first_show_idx);
/*!\brief Call this function before coding a new group of pictures to get /*!\brief Call this function before coding a new group of pictures to get
* information about it. * information about it.

View File

@@ -111,9 +111,9 @@ static int IsGroupOfPictureFinished(const GroupOfPicture &group_of_picture) {
group_of_picture.encode_frame_list.size(); group_of_picture.encode_frame_list.size();
} }
static void SetGroupOfPicture(GroupOfPicture *group_of_picture, static void SetGroupOfPicture(int first_is_key_frame, int use_alt_ref,
int first_is_key_frame, int use_alt_ref, int coding_frame_count, int first_show_idx,
int coding_frame_count, int first_show_idx) { GroupOfPicture *group_of_picture) {
// Clean up the state of previous group of picture. // Clean up the state of previous group of picture.
group_of_picture->encode_frame_list.clear(); group_of_picture->encode_frame_list.clear();
group_of_picture->encode_frame_index = 0; group_of_picture->encode_frame_index = 0;
@@ -149,16 +149,16 @@ static void SetGroupOfPicture(GroupOfPicture *group_of_picture,
} }
} }
static void UpdateGroupOfPicture(GroupOfPicture *group_of_picture, static void UpdateGroupOfPicture(const VP9_COMP *cpi,
const VP9_COMP *cpi) { GroupOfPicture *group_of_picture) {
int first_is_key_frame; int first_is_key_frame;
int use_alt_ref; int use_alt_ref;
int coding_frame_count; int coding_frame_count;
int first_show_idx; int first_show_idx;
vp9_get_next_group_of_picture(&first_is_key_frame, &use_alt_ref, vp9_get_next_group_of_picture(cpi, &first_is_key_frame, &use_alt_ref,
&coding_frame_count, &first_show_idx, cpi); &coding_frame_count, &first_show_idx);
SetGroupOfPicture(group_of_picture, first_is_key_frame, use_alt_ref, SetGroupOfPicture(first_is_key_frame, use_alt_ref, coding_frame_count,
coding_frame_count, first_show_idx); first_show_idx, group_of_picture);
} }
SimpleEncode::SimpleEncode(int frame_width, int frame_height, SimpleEncode::SimpleEncode(int frame_width, int frame_height,
@@ -270,7 +270,7 @@ void SimpleEncode::StartEncode() {
impl_ptr_->cpi = init_encoder(&oxcf, impl_ptr_->img_fmt); impl_ptr_->cpi = init_encoder(&oxcf, impl_ptr_->img_fmt);
vpx_img_alloc(&impl_ptr_->tmp_img, impl_ptr_->img_fmt, frame_width_, vpx_img_alloc(&impl_ptr_->tmp_img, impl_ptr_->img_fmt, frame_width_,
frame_height_, 1); frame_height_, 1);
UpdateGroupOfPicture(&group_of_picture_, impl_ptr_->cpi); UpdateGroupOfPicture(impl_ptr_->cpi, &group_of_picture_);
rewind(file_); rewind(file_);
} }
@@ -347,7 +347,7 @@ void SimpleEncode::EncodeFrame(EncodeFrameResult *encode_frame_result) {
update_encode_frame_result(encode_frame_result, &encode_frame_info); update_encode_frame_result(encode_frame_result, &encode_frame_info);
IncreaseGroupOfPictureIndex(&group_of_picture_); IncreaseGroupOfPictureIndex(&group_of_picture_);
if (IsGroupOfPictureFinished(group_of_picture_)) { if (IsGroupOfPictureFinished(group_of_picture_)) {
UpdateGroupOfPicture(&group_of_picture_, impl_ptr_->cpi); UpdateGroupOfPicture(impl_ptr_->cpi, &group_of_picture_);
} }
} }