min/max_gf_interval is fixed and can be passed from the command line.
It must satisfy the level constraints.
active_min/max_gf_interval might be changing based on
min/max_gf_interval. It is determined per GOP.
Change-Id: If456c691c97a8b4c946859c05cedd39ca7defa9c
constexpr int kMaxLagInFrames = 25;
constexpr int kDefaultMinGfInterval = 4;
constexpr int kDefaultMaxGfInterval = 16;
-// The two pass rate control does not respect the input
-// min_gf_interval and max_gf_interval.
+// The active gf interval might change for each GOP
// See function "get_active_gf_inverval_range".
// The numbers below are from manual inspection.
constexpr int kReadMinGfInterval = 5;
ToyRateCtrl *toy_rate_ctrl = static_cast<ToyRateCtrl *>(rate_ctrl_model);
EXPECT_EQ(toy_rate_ctrl->magic_number, kModelMagicNumber);
EXPECT_EQ(gop_info->lag_in_frames, kMaxLagInFrames);
- EXPECT_EQ(gop_info->min_gf_interval, kReadMinGfInterval);
- EXPECT_EQ(gop_info->max_gf_interval, kReadMaxGfInterval);
+ EXPECT_EQ(gop_info->min_gf_interval, kDefaultMinGfInterval);
+ EXPECT_EQ(gop_info->max_gf_interval, kDefaultMaxGfInterval);
+ EXPECT_EQ(gop_info->active_min_gf_interval, kReadMinGfInterval);
+ EXPECT_EQ(gop_info->active_max_gf_interval, kReadMaxGfInterval);
EXPECT_EQ(gop_info->allow_alt_ref, 1);
if (gop_info->is_key_frame) {
EXPECT_EQ(gop_info->last_gop_use_alt_ref, 0);
vpx_codec_err_t codec_status;
vpx_rc_gop_decision_t gop_decision;
vpx_rc_gop_info_t gop_info;
- gop_info.min_gf_interval = active_gf_interval.min;
- gop_info.max_gf_interval = active_gf_interval.max;
+ gop_info.min_gf_interval = rc->min_gf_interval;
+ gop_info.max_gf_interval = rc->max_gf_interval;
+ gop_info.active_min_gf_interval = active_gf_interval.min;
+ gop_info.active_max_gf_interval = active_gf_interval.max;
gop_info.allow_alt_ref = allow_alt_ref;
gop_info.is_key_frame = is_key_frame;
gop_info.last_gop_use_alt_ref = rc->source_alt_ref_active;
* types, removing or reassigning enums, adding/removing/rearranging
* fields to structures.
*/
-#define VPX_EXT_RATECTRL_ABI_VERSION (4)
+#define VPX_EXT_RATECTRL_ABI_VERSION (5)
/*!\brief The control type of the inference API.
* In VPX_RC_QP mode, the external rate control model determines the
typedef struct vpx_rc_gop_info {
/*!
* Minimum allowed gf interval, fixed for the whole clip.
+ * Note that it will be modified to match vp9's level constraints
+ * in the encoder.
+ * The level constraint is defined in vp9_encoder.c:
+ * const Vp9LevelSpec vp9_level_defs[VP9_LEVELS].
*/
int min_gf_interval;
/*!
* Maximum allowed gf interval, fixed for the whole clip.
*/
int max_gf_interval;
+ /*!
+ * Minimum allowed gf interval for the current GOP, determined
+ * by the encoder.
+ */
+ int active_min_gf_interval;
+ /*!
+ * Maximum allowed gf interval for the current GOP, determined
+ * by the encoder.
+ */
+ int active_max_gf_interval;
/*!
* Whether to allow the use of alt ref, can be changed per gop.
*/