summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCheng Chen <chengchen@google.com>2022-06-06 15:46:41 -0700
committerCheng Chen <chengchen@google.com>2022-06-06 22:38:10 -0700
commit7bb4bd36122e55236148190625507efc90ec5b75 (patch)
treeeb118bc028bc2819de2ab8fc0b79648213ff87e1
parentb21634073652cb7e73e52168dc2fa9c1b9a30adf (diff)
downloadlibvpx-7bb4bd36122e55236148190625507efc90ec5b75.tar
libvpx-7bb4bd36122e55236148190625507efc90ec5b75.tar.gz
libvpx-7bb4bd36122e55236148190625507efc90ec5b75.tar.bz2
libvpx-7bb4bd36122e55236148190625507efc90ec5b75.zip
L2E: rename 'gop_index' to 'gop_global_index'
'gop_index' has already been used in vpx_rc_encodeframe_info_t, which represents the frame index inside the current group of picture (gop). We therefore use 'gop_global_index' to represent the index of the current gop to avoid duplicate names. Change-Id: I3eb8987dd878f650649b013e0036e23d0846b5f0
-rw-r--r--test/vp9_ext_ratectrl_test.cc12
-rw-r--r--vp9/encoder/vp9_firstpass.c6
-rw-r--r--vp9/encoder/vp9_ratectrl.h2
-rw-r--r--vpx/vpx_ext_ratectrl.h4
4 files changed, 12 insertions, 12 deletions
diff --git a/test/vp9_ext_ratectrl_test.cc b/test/vp9_ext_ratectrl_test.cc
index 1289e2db8..a3af4e98f 100644
--- a/test/vp9_ext_ratectrl_test.cc
+++ b/test/vp9_ext_ratectrl_test.cc
@@ -44,7 +44,7 @@ struct ToyRateCtrl {
int magic_number;
int coding_index;
- int gop_index;
+ int gop_global_index;
int frames_since_key;
int show_index;
};
@@ -73,7 +73,7 @@ vpx_rc_status_t rc_create_model_gop(void *priv,
ToyRateCtrl *toy_rate_ctrl = new (std::nothrow) ToyRateCtrl;
if (toy_rate_ctrl == nullptr) return VPX_RC_ERROR;
toy_rate_ctrl->magic_number = kModelMagicNumber;
- toy_rate_ctrl->gop_index = 0;
+ toy_rate_ctrl->gop_global_index = 0;
toy_rate_ctrl->frames_since_key = 0;
toy_rate_ctrl->show_index = 0;
toy_rate_ctrl->coding_index = 0;
@@ -198,13 +198,13 @@ vpx_rc_status_t rc_get_gop_decision(vpx_rc_model_t rate_ctrl_model,
if (gop_info->is_key_frame) {
EXPECT_EQ(gop_info->last_gop_use_alt_ref, 0);
EXPECT_EQ(gop_info->frames_since_key, 0);
- EXPECT_EQ(gop_info->gop_index, 0);
- toy_rate_ctrl->gop_index = 0;
+ EXPECT_EQ(gop_info->gop_global_index, 0);
+ toy_rate_ctrl->gop_global_index = 0;
toy_rate_ctrl->frames_since_key = 0;
} else {
EXPECT_EQ(gop_info->last_gop_use_alt_ref, 1);
}
- EXPECT_EQ(gop_info->gop_index, toy_rate_ctrl->gop_index);
+ EXPECT_EQ(gop_info->gop_global_index, toy_rate_ctrl->gop_global_index);
EXPECT_EQ(gop_info->frames_since_key, toy_rate_ctrl->frames_since_key);
EXPECT_EQ(gop_info->show_index, toy_rate_ctrl->show_index);
EXPECT_EQ(gop_info->coding_index, toy_rate_ctrl->coding_index);
@@ -217,7 +217,7 @@ vpx_rc_status_t rc_get_gop_decision(vpx_rc_model_t rate_ctrl_model,
toy_rate_ctrl->show_index +=
gop_decision->gop_coding_frames - gop_decision->use_alt_ref;
toy_rate_ctrl->coding_index += gop_decision->gop_coding_frames;
- ++toy_rate_ctrl->gop_index;
+ ++toy_rate_ctrl->gop_global_index;
return VPX_RC_OK;
}
diff --git a/vp9/encoder/vp9_firstpass.c b/vp9/encoder/vp9_firstpass.c
index 44a4cec0f..e121ac80e 100644
--- a/vp9/encoder/vp9_firstpass.c
+++ b/vp9/encoder/vp9_firstpass.c
@@ -2714,9 +2714,9 @@ static void define_gf_group(VP9_COMP *cpi, int gf_start_show_idx) {
// frame in which case it will already have been done.
if (is_key_frame == 0) {
vp9_zero(twopass->gf_group);
- ++rc->gop_index;
+ ++rc->gop_global_index;
} else {
- rc->gop_index = 0;
+ rc->gop_global_index = 0;
}
vpx_clear_system_state();
@@ -2772,7 +2772,7 @@ static void define_gf_group(VP9_COMP *cpi, int gf_start_show_idx) {
gop_info.lag_in_frames = cpi->oxcf.lag_in_frames;
gop_info.show_index = cm->current_video_frame;
gop_info.coding_index = cm->current_frame_coding_index;
- gop_info.gop_index = rc->gop_index;
+ gop_info.gop_global_index = rc->gop_global_index;
codec_status = vp9_extrc_get_gop_decision(&cpi->ext_ratectrl, &gop_info,
&gop_decision);
diff --git a/vp9/encoder/vp9_ratectrl.h b/vp9/encoder/vp9_ratectrl.h
index 48a21bd1c..96a8fd3f1 100644
--- a/vp9/encoder/vp9_ratectrl.h
+++ b/vp9/encoder/vp9_ratectrl.h
@@ -214,7 +214,7 @@ typedef struct {
// The index of the current GOP. Start from zero.
// When a key frame is inserted, it resets to zero.
- int gop_index;
+ int gop_global_index;
} RATE_CONTROL;
struct VP9_COMP;
diff --git a/vpx/vpx_ext_ratectrl.h b/vpx/vpx_ext_ratectrl.h
index c3feac55e..6e41abaf4 100644
--- a/vpx/vpx_ext_ratectrl.h
+++ b/vpx/vpx_ext_ratectrl.h
@@ -81,7 +81,7 @@ typedef struct vpx_rc_encodeframe_info {
int show_index; /**< display index, starts from zero*/
int coding_index; /**< coding index, starts from zero*/
/*!
- * index in group of picture, starts from zero.
+ * index of the current frame in this group of picture, starts from zero.
*/
int gop_index;
int ref_frame_coding_indexes[3]; /**< three reference frames' coding indices*/
@@ -323,7 +323,7 @@ typedef struct vpx_rc_gop_info {
* The index of the current gop, starts from zero, resets to zero
* when a keyframe is set.
*/
- int gop_index;
+ int gop_global_index;
} vpx_rc_gop_info_t;
/*!\brief The decision made by the external rate control model to set the