aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerome Jiang <jianj@google.com>2024-03-18 21:32:36 -0400
committerJerome Jiang <jianj@google.com>2024-03-20 16:17:23 +0000
commit6641e9e03c6ee96552957c01f416f4e1863c34cb (patch)
tree5c4d2a7d91b2daa37dd5001afb0344881873daf1
parent458e1c6875e93eb29bca2548aff430c9db08ab10 (diff)
downloadlibvpx-6641e9e03c6ee96552957c01f416f4e1863c34cb.tar.gz
Add update type and ref update idx to gop decision
Bug: b/329483680 Change-Id: Ifc82ad79415400bbec4efe6ab9b78496d5f73ee7
-rw-r--r--vpx/vpx_ext_ratectrl.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/vpx/vpx_ext_ratectrl.h b/vpx/vpx_ext_ratectrl.h
index ba12e4f83..bbf45288a 100644
--- a/vpx/vpx_ext_ratectrl.h
+++ b/vpx/vpx_ext_ratectrl.h
@@ -28,6 +28,11 @@ extern "C" {
*/
#define VPX_EXT_RATECTRL_ABI_VERSION (5 + VPX_TPL_ABI_VERSION)
+/*!\brief This is correspondent to MAX_STATIC_GF_GROUP_LENGTH defined in
+ * vp9_ratectrl.h
+ */
+#define VPX_RC_MAX_STATIC_GF_GROUP_LENGTH 250
+
/*!\brief The control type of the inference API.
* In VPX_RC_QP mode, the external rate control model determines the
* quantization parameter (QP) for each frame.
@@ -56,6 +61,18 @@ typedef enum vpx_ext_rc_mode {
VPX_RC_CQ = 2,
} vpx_ext_rc_mode_t;
+/*!\brief This is correspondent to FRAME_UPDATE_TYPE defined in vp9_firstpass.h.
+ */
+typedef enum vpx_rc_frame_update_type {
+ VPX_RC_KF_UPDATE = 0,
+ VPX_RC_LF_UPDATE = 1,
+ VPX_RC_GF_UPDATE = 2,
+ VPX_RC_ARF_UPDATE = 3,
+ VPX_RC_OVERLAY_UPDATE = 4,
+ VPX_RC_MID_OVERLAY_UPDATE = 5,
+ VPX_RC_USE_BUF_FRAME = 6,
+} vpx_rc_frame_update_type_t;
+
/*!\brief Abstract rate control model handler
*
* The encoder will receive the model handler from create_model() defined in
@@ -395,6 +412,12 @@ typedef struct vpx_rc_gop_decision {
int gop_coding_frames; /**< The number of frames of this GOP */
int use_alt_ref; /**< Whether to use alt ref for this GOP */
int use_key_frame; /**< Whether to set key frame for this GOP */
+ // Frame type for each frame in this GOP.
+ // This will be populated to |update_type| in GF_GROUP defined in
+ // vp9_firstpass.h
+ vpx_rc_frame_update_type_t update_type[VPX_RC_MAX_STATIC_GF_GROUP_LENGTH + 2];
+ // Ref frame buffer index to be updated for each frame in this GOP.
+ int update_ref_index[VPX_RC_MAX_STATIC_GF_GROUP_LENGTH + 2];
} vpx_rc_gop_decision_t;
/*!\brief Create an external rate control model callback prototype