From: angiebird Date: Wed, 11 Dec 2019 21:49:39 +0000 (-0800) Subject: Cosmetic changes for RATE_CTRL related functions X-Git-Tag: v1.9.0-rc1~126 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=204ba94f4b0403a0289a5600fda56e64f89ce67c;p=libvpx Cosmetic changes for RATE_CTRL related functions Move input parameters ahead of output parameters. Change-Id: I384f69523b6be92224535d05373ebb33467a040e --- diff --git a/vp9/encoder/vp9_firstpass.c b/vp9/encoder/vp9_firstpass.c index 48ef8d7ba..4071da5a1 100644 --- a/vp9/encoder/vp9_firstpass.c +++ b/vp9/encoder/vp9_firstpass.c @@ -3643,9 +3643,9 @@ void vp9_twopass_postencode_update(VP9_COMP *cpi) { } #if CONFIG_RATE_CTRL -void vp9_get_next_group_of_picture(int *first_is_key_frame, int *use_alt_ref, - int *coding_frame_count, int *first_show_idx, - const VP9_COMP *cpi) { +void vp9_get_next_group_of_picture(const VP9_COMP *cpi, int *first_is_key_frame, + int *use_alt_ref, int *coding_frame_count, + int *first_show_idx) { // We make a copy of rc here because we want to get information from the // encoder without changing its state. // TODO(angiebird): Avoid copying rc here. diff --git a/vp9/encoder/vp9_firstpass.h b/vp9/encoder/vp9_firstpass.h index 108416b47..f27dfe9a6 100644 --- a/vp9/encoder/vp9_firstpass.h +++ b/vp9/encoder/vp9_firstpass.h @@ -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 * the last group of pictures is just finished. */ -void vp9_get_next_group_of_picture(int *first_is_key_frame, int *use_alt_ref, - int *coding_frame_count, int *first_show_idx, - const struct VP9_COMP *cpi); +void vp9_get_next_group_of_picture(const struct VP9_COMP *cpi, + int *first_is_key_frame, int *use_alt_ref, + int *coding_frame_count, + int *first_show_idx); /*!\brief Call this function before coding a new group of pictures to get * information about it. diff --git a/vp9/simple_encode.cc b/vp9/simple_encode.cc index 3f2f01f79..fc5bb4a6c 100644 --- a/vp9/simple_encode.cc +++ b/vp9/simple_encode.cc @@ -111,9 +111,9 @@ static int IsGroupOfPictureFinished(const GroupOfPicture &group_of_picture) { group_of_picture.encode_frame_list.size(); } -static void SetGroupOfPicture(GroupOfPicture *group_of_picture, - int first_is_key_frame, int use_alt_ref, - int coding_frame_count, int first_show_idx) { +static void SetGroupOfPicture(int first_is_key_frame, int use_alt_ref, + int coding_frame_count, int first_show_idx, + 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; @@ -149,16 +149,16 @@ static void SetGroupOfPicture(GroupOfPicture *group_of_picture, } } -static void UpdateGroupOfPicture(GroupOfPicture *group_of_picture, - const VP9_COMP *cpi) { +static void UpdateGroupOfPicture(const VP9_COMP *cpi, + GroupOfPicture *group_of_picture) { int first_is_key_frame; int use_alt_ref; int coding_frame_count; int first_show_idx; - vp9_get_next_group_of_picture(&first_is_key_frame, &use_alt_ref, - &coding_frame_count, &first_show_idx, cpi); - SetGroupOfPicture(group_of_picture, first_is_key_frame, use_alt_ref, - coding_frame_count, first_show_idx); + vp9_get_next_group_of_picture(cpi, &first_is_key_frame, &use_alt_ref, + &coding_frame_count, &first_show_idx); + SetGroupOfPicture(first_is_key_frame, use_alt_ref, coding_frame_count, + first_show_idx, group_of_picture); } 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); vpx_img_alloc(&impl_ptr_->tmp_img, impl_ptr_->img_fmt, frame_width_, frame_height_, 1); - UpdateGroupOfPicture(&group_of_picture_, impl_ptr_->cpi); + UpdateGroupOfPicture(impl_ptr_->cpi, &group_of_picture_); rewind(file_); } @@ -347,7 +347,7 @@ void SimpleEncode::EncodeFrame(EncodeFrameResult *encode_frame_result) { update_encode_frame_result(encode_frame_result, &encode_frame_info); IncreaseGroupOfPictureIndex(&group_of_picture_); if (IsGroupOfPictureFinished(group_of_picture_)) { - UpdateGroupOfPicture(&group_of_picture_, impl_ptr_->cpi); + UpdateGroupOfPicture(impl_ptr_->cpi, &group_of_picture_); } }