cm, cm->frame_contexts,
(FRAME_CONTEXT *)vpx_calloc(FRAME_CONTEXTS, sizeof(*cm->frame_contexts)));
+ cpi->compute_frame_low_motion_onepass = 1;
cpi->use_svc = 0;
cpi->resize_state = ORIG;
cpi->external_resize = 0;
vp9_rc_postencode_update(cpi, *size);
- if (oxcf->pass == 0 && !frame_is_intra_only(cm) &&
+ if (cpi->compute_frame_low_motion_onepass && oxcf->pass == 0 &&
+ !frame_is_intra_only(cm) &&
(!cpi->use_svc ||
(cpi->use_svc &&
!cpi->svc.layer_context[cpi->svc.temporal_layer_id].is_key_frame &&
int compute_source_sad_onepass;
+ int compute_frame_low_motion_onepass;
+
LevelConstraint level_constraint;
uint8_t *count_arf_frame_usage;
return update_extra_cfg(ctx, &extra_cfg);
}
+static vpx_codec_err_t ctrl_set_rtc_external_ratectrl(vpx_codec_alg_priv_t *ctx,
+ va_list args) {
+ VP9_COMP *const cpi = ctx->cpi;
+ const unsigned int data = va_arg(args, unsigned int);
+ if (data) {
+ cpi->compute_frame_low_motion_onepass = 0;
+ cpi->rc.constrain_gf_key_freq_onepass_vbr = 0;
+ cpi->cyclic_refresh->content_mode = 0;
+ }
+ return VPX_CODEC_OK;
+}
+
static vpx_codec_err_t ctrl_enable_motion_vector_unit_test(
vpx_codec_alg_priv_t *ctx, va_list args) {
struct vp9_extracfg extra_cfg = ctx->extra_cfg;
{ VP9E_SET_SVC_SPATIAL_LAYER_SYNC, ctrl_set_svc_spatial_layer_sync },
{ VP9E_SET_DELTA_Q_UV, ctrl_set_delta_q_uv },
{ VP9E_SET_DISABLE_LOOPFILTER, ctrl_set_disable_loopfilter },
+ { VP9E_SET_RTC_EXTERNAL_RATECTRL, ctrl_set_rtc_external_ratectrl },
{ VP9E_SET_EXTERNAL_RATE_CONTROL, ctrl_set_external_rate_control },
// Getters
*/
VP9E_SET_EXTERNAL_RATE_CONTROL,
+ /*!\brief Codec control to disable internal features in rate control.
+ *
+ * This will do 3 things, only for 1 pass:
+ * - Turn off low motion computation
+ * - Turn off gf update constraint on key frame frequency
+ * - Turn off content mode for cyclic refresh
+ *
+ * With those, the rate control is expected to work exactly the same as the
+ * interface provided in ratectrl_rtc.cc/h
+ *
+ * Supported in codecs: VP9
+ */
+ VP9E_SET_RTC_EXTERNAL_RATECTRL,
+
/*!\brief Codec control function to get loopfilter level in the encoder.
*
* Supported in codecs: VP9
VPX_CTRL_USE_TYPE(VP9E_SET_DISABLE_LOOPFILTER, int)
#define VPX_CTRL_VP9E_SET_DISABLE_LOOPFILTER
+VPX_CTRL_USE_TYPE(VP9E_SET_RTC_EXTERNAL_RATECTRL, int)
+#define VPX_CTRL_VP9E_SET_RTC_EXTERNAL_RATECTRL
+
VPX_CTRL_USE_TYPE(VP9E_SET_EXTERNAL_RATE_CONTROL, vpx_rc_funcs_t *)
#define VPX_CTRL_VP9E_SET_EXTERNAL_RATE_CONTROL