summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerome Jiang <jianj@google.com>2021-07-02 11:28:48 -0700
committerJerome Jiang <jianj@google.com>2021-07-02 11:33:04 -0700
commitc64022fa3c3019da117fbafbe80535a9ffbd8163 (patch)
tree665d8ac4cbe5b00c832861736e6cab0355272f0c
parent40e7b4a5bec4c2f1f482b3db72cbaad22bac901f (diff)
downloadlibvpx-c64022fa3c3019da117fbafbe80535a9ffbd8163.tar
libvpx-c64022fa3c3019da117fbafbe80535a9ffbd8163.tar.gz
libvpx-c64022fa3c3019da117fbafbe80535a9ffbd8163.tar.bz2
libvpx-c64022fa3c3019da117fbafbe80535a9ffbd8163.zip
Add codec control to get loopfilter level
Change-Id: I70d417da900082160e7ba53315af98eceede257c
-rw-r--r--vp9/vp9_cx_iface.c9
-rw-r--r--vpx/vp8cx.h9
2 files changed, 18 insertions, 0 deletions
diff --git a/vp9/vp9_cx_iface.c b/vp9/vp9_cx_iface.c
index 7697806ce..2c09a3992 100644
--- a/vp9/vp9_cx_iface.c
+++ b/vp9/vp9_cx_iface.c
@@ -834,6 +834,14 @@ static vpx_codec_err_t ctrl_get_quantizer64(vpx_codec_alg_priv_t *ctx,
return VPX_CODEC_OK;
}
+static vpx_codec_err_t ctrl_get_loopfilter_level(vpx_codec_alg_priv_t *ctx,
+ va_list args) {
+ int *const arg = va_arg(args, int *);
+ if (arg == NULL) return VPX_CODEC_INVALID_PARAM;
+ *arg = ctx->cpi->common.lf.filter_level;
+ return VPX_CODEC_OK;
+}
+
static vpx_codec_err_t update_extra_cfg(vpx_codec_alg_priv_t *ctx,
const struct vp9_extracfg *extra_cfg) {
const vpx_codec_err_t res = validate_config(ctx, &ctx->cfg, extra_cfg);
@@ -1967,6 +1975,7 @@ static vpx_codec_ctrl_fn_map_t encoder_ctrl_maps[] = {
// Getters
{ VP8E_GET_LAST_QUANTIZER, ctrl_get_quantizer },
{ VP8E_GET_LAST_QUANTIZER_64, ctrl_get_quantizer64 },
+ { VP9E_GET_LOOPFILTER_LEVEL, ctrl_get_loopfilter_level },
{ VP9_GET_REFERENCE, ctrl_get_reference },
{ VP9E_GET_SVC_LAYER_ID, ctrl_get_svc_layer_id },
{ VP9E_GET_ACTIVEMAP, ctrl_get_active_map },
diff --git a/vpx/vp8cx.h b/vpx/vp8cx.h
index 37ad07d33..a5dd324b7 100644
--- a/vpx/vp8cx.h
+++ b/vpx/vp8cx.h
@@ -712,6 +712,12 @@ enum vp8e_enc_control_id {
* Supported in codecs: VP9
*/
VP9E_SET_EXTERNAL_RATE_CONTROL,
+
+ /*!\brief Codec control function to get loopfilter level in the encoder.
+ *
+ * Supported in codecs: VP9
+ */
+ VP9E_GET_LOOPFILTER_LEVEL,
};
/*!\brief vpx 1-D scaling mode
@@ -1037,6 +1043,9 @@ VPX_CTRL_USE_TYPE(VP9E_SET_ROW_MT, unsigned int)
VPX_CTRL_USE_TYPE(VP9E_GET_LEVEL, int *)
#define VPX_CTRL_VP9E_GET_LEVEL
+VPX_CTRL_USE_TYPE(VP9E_GET_LOOPFILTER_LEVEL, int *)
+#define VPX_CTRL_VP9E_GET_LOOPFILTER_LEVEL
+
VPX_CTRL_USE_TYPE(VP9E_ENABLE_MOTION_VECTOR_UNIT_TEST, unsigned int)
#define VPX_CTRL_VP9E_ENABLE_MOTION_VECTOR_UNIT_TEST