Add encoder controls to turn warped motion on/off
For both frame and sequence level.
Change-Id: I593bd53984935d38f978487402aba0f846f47942
diff --git a/aom/aomcx.h b/aom/aomcx.h
index 37ca81d..a88822d 100644
--- a/aom/aomcx.h
+++ b/aom/aomcx.h
@@ -733,10 +733,28 @@
* enabling/disabling at frame level.
*
* This will enable or disable temporal mv predicton. The default value is 1.
+ * If AV1E_SET_ENABLE_REF_FRAME_MVS is 0, then this flag is forced to 0.
*
*/
AV1E_SET_ALLOW_REF_FRAME_MVS,
+ /*!\brief Codec control function to turn on / off warped motion usage
+ * at sequence level.
+ *
+ * This will enable or disable usage of warped motion. The default value is 1.
+ *
+ */
+ AV1E_SET_ENABLE_WARPED_MOTION,
+
+ /*!\brief Codec control function to turn on / off warped motion usage
+ * at frame level.
+ *
+ * This will enable or disable usage of warped motion. The default value is 1.
+ * If AV1E_SET_ENABLE_WARPED_MOTION is 0, then this flag is forced to 0.
+ *
+ */
+ AV1E_SET_ALLOW_WARPED_MOTION,
+
/*!\brief Codec control function to turn on / off frame superresolution.
*
* This will enable or disable frame superresolution. The default value is 1
@@ -1031,6 +1049,12 @@
AOM_CTRL_USE_TYPE(AV1E_SET_ALLOW_REF_FRAME_MVS, unsigned int)
#define AOM_CTRL_AV1E_SET_ALLOW_REF_FRAME_MVS
+AOM_CTRL_USE_TYPE(AV1E_SET_ENABLE_WARPED_MOTION, unsigned int)
+#define AOM_CTRL_AV1E_SET_ENABLE_WARPED_MOTION
+
+AOM_CTRL_USE_TYPE(AV1E_SET_ALLOW_WARPED_MOTION, unsigned int)
+#define AOM_CTRL_AV1E_SET_ALLOW_WARPED_MOTION
+
AOM_CTRL_USE_TYPE(AV1E_SET_ENABLE_SUPERRES, unsigned int)
#define AOM_CTRL_AV1E_SET_ENABLE_SUPERRES
diff --git a/av1/av1_cx_iface.c b/av1/av1_cx_iface.c
index 6e5736f..a2b48b7 100644
--- a/av1/av1_cx_iface.c
+++ b/av1/av1_cx_iface.c
@@ -993,6 +993,20 @@
return update_extra_cfg(ctx, &extra_cfg);
}
+static aom_codec_err_t ctrl_set_enable_warped_motion(aom_codec_alg_priv_t *ctx,
+ va_list args) {
+ struct av1_extracfg extra_cfg = ctx->extra_cfg;
+ extra_cfg.enable_warped_motion = CAST(AV1E_SET_ENABLE_WARPED_MOTION, args);
+ return update_extra_cfg(ctx, &extra_cfg);
+}
+
+static aom_codec_err_t ctrl_set_allow_warped_motion(aom_codec_alg_priv_t *ctx,
+ va_list args) {
+ struct av1_extracfg extra_cfg = ctx->extra_cfg;
+ extra_cfg.allow_warped_motion = CAST(AV1E_SET_ALLOW_WARPED_MOTION, args);
+ return update_extra_cfg(ctx, &extra_cfg);
+}
+
static aom_codec_err_t ctrl_set_enable_superres(aom_codec_alg_priv_t *ctx,
va_list args) {
struct av1_extracfg extra_cfg = ctx->extra_cfg;
@@ -1658,6 +1672,8 @@
{ AV1E_SET_ENABLE_JNT_COMP, ctrl_set_enable_jnt_comp },
{ AV1E_SET_ENABLE_REF_FRAME_MVS, ctrl_set_enable_ref_frame_mvs },
{ AV1E_SET_ALLOW_REF_FRAME_MVS, ctrl_set_allow_ref_frame_mvs },
+ { AV1E_SET_ENABLE_WARPED_MOTION, ctrl_set_enable_warped_motion },
+ { AV1E_SET_ALLOW_WARPED_MOTION, ctrl_set_allow_warped_motion },
{ AV1E_SET_ENABLE_SUPERRES, ctrl_set_enable_superres },
{ AV1E_SET_AQ_MODE, ctrl_set_aq_mode },
#if CONFIG_EXT_DELTA_Q