summaryrefslogtreecommitdiff
path: root/vpx
diff options
context:
space:
mode:
authorCheng Chen <chengchen@google.com>2022-06-06 16:46:55 -0700
committerCheng Chen <chengchen@google.com>2022-06-07 11:42:25 -0700
commit7b1b9f7cd23e085d97c26ed026d2c817d78a14d6 (patch)
tree05799aadc817f4244af4530fa0d064d8f7807b46 /vpx
parent7bb4bd36122e55236148190625507efc90ec5b75 (diff)
downloadlibvpx-7b1b9f7cd23e085d97c26ed026d2c817d78a14d6.tar
libvpx-7b1b9f7cd23e085d97c26ed026d2c817d78a14d6.tar.gz
libvpx-7b1b9f7cd23e085d97c26ed026d2c817d78a14d6.tar.bz2
libvpx-7b1b9f7cd23e085d97c26ed026d2c817d78a14d6.zip
L2E: Use libvpx's default q in case of invalid external value
If the external model recommends an invalid q value, we use the default q selected by libvpx's rate control strategy. We update the test so that when the external model wants to control GOP decision, it could get per frame information and just recommend an invalid q. Change-Id: I69be4b0ee0800e7ab0706d305242bb87f001b1f7
Diffstat (limited to 'vpx')
-rw-r--r--vpx/vpx_ext_ratectrl.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/vpx/vpx_ext_ratectrl.h b/vpx/vpx_ext_ratectrl.h
index 6e41abaf4..b57148c69 100644
--- a/vpx/vpx_ext_ratectrl.h
+++ b/vpx/vpx_ext_ratectrl.h
@@ -48,11 +48,20 @@ typedef enum vpx_rc_type {
*/
typedef void *vpx_rc_model_t;
+/*!\brief A reserved value for the q index.
+ * If the external rate control model returns this value,
+ * the encoder will use the default q selected by libvpx's rate control
+ * system.
+ */
+#define VPX_DEFAULT_Q -1
+
/*!\brief Encode frame decision made by the external rate control model
*
* The encoder will receive the decision from the external rate control model
* through get_encodeframe_decision() defined in vpx_rc_funcs_t.
*
+ * If q_index = VPX_DEFAULT_Q, the encoder will use libvpx's default q.
+ *
* If max_frame_size = 0, the encoding ignores max frame size limit.
* If max_frame_size = -1, the encoding uses VP9's max frame size as the limit.
* If the encoded frame size is larger than max_frame_size, the frame is