} else if (strncmp(encoder->name, "vp9", 3) == 0) {
vpx_codec_control(&codec, VP8E_SET_CPUUSED, speed);
vpx_codec_control(&codec, VP9E_SET_AQ_MODE, 3);
+ vpx_codec_control(&codec, VP9E_SET_FRAME_PERIODIC_BOOST, 0);
vpx_codec_control(&codec, VP8E_SET_NOISE_SENSITIVITY, 0);
if (vpx_codec_control(&codec, VP9E_SET_SVC, 1)) {
die_codec(&codec, "Failed to set SVC");
int lossless;
AQ_MODE aq_mode; // Adaptive Quantization mode
+ // Enable feature to reduce the frame quantization every x frames.
+ int frame_periodic_boost;
+
// two pass datarate control
int two_pass_vbrbias; // two pass datarate control tweaks
int two_pass_vbrmin_section;
if (cpi->sf.use_nonrd_pick_mode) {
if (q == 0)
q++;
- if (cpi->sf.force_ref_frame == 1)
+ if (cpi->sf.force_frame_boost == 1)
q -= cpi->sf.max_delta_qindex;
if (q < *bottom_index)
sf->min_partition_size = BLOCK_8X8;
sf->partition_check =
(cm->current_video_frame % sf->last_partitioning_redo_frequency == 1);
- sf->force_ref_frame = cm->frame_type == KEY_FRAME ||
+ sf->force_frame_boost = cm->frame_type == KEY_FRAME ||
(cm->current_video_frame %
(sf->last_partitioning_redo_frequency << 1) == 1);
sf->max_delta_qindex = (cm->frame_type == KEY_FRAME) ? 20 : 15;
sf->last_partitioning_redo_frequency = 4;
sf->disable_split_mask = 0;
sf->mode_search_skip_flags = 0;
- sf->force_ref_frame = 0;
+ sf->force_frame_boost = 0;
sf->max_delta_qindex = 0;
sf->disable_split_var_thresh = 0;
sf->disable_filter_search_var_thresh = 0;
if (sf->disable_split_mask == DISABLE_ALL_SPLIT)
sf->adaptive_pred_interp_filter = 0;
+
+ if (!cpi->oxcf.frame_periodic_boost) {
+ sf->max_delta_qindex = 0;
+ }
}
// Use finer quantizer in every other few frames that run variable block
// partition type search.
- int force_ref_frame;
+ int force_frame_boost;
// Maximally allowed base quantization index fluctuation.
int max_delta_qindex;
unsigned int lossless;
unsigned int frame_parallel_decoding_mode;
AQ_MODE aq_mode;
+ unsigned int frame_periodic_boost;
};
struct extraconfig_map {
0, // lossless
0, // frame_parallel_decoding_mode
NO_AQ, // aq_mode
+ 0, // frame_periodic_delta_q
}
}
};
RANGE_CHECK_HI(cfg, rc_min_quantizer, cfg->rc_max_quantizer);
RANGE_CHECK_BOOL(extra_cfg, lossless);
RANGE_CHECK(extra_cfg, aq_mode, 0, AQ_MODE_COUNT - 1);
-
+ RANGE_CHECK(extra_cfg, frame_periodic_boost, 0, 1);
RANGE_CHECK_HI(cfg, g_threads, 64);
RANGE_CHECK_HI(cfg, g_lag_in_frames, MAX_LAG_BUFFERS);
RANGE_CHECK(cfg, rc_end_usage, VPX_VBR, VPX_Q);
oxcf->aq_mode = extra_cfg->aq_mode;
+ oxcf->frame_periodic_boost = extra_cfg->frame_periodic_boost;
+
oxcf->ss_number_layers = cfg->ss_number_layers;
if (oxcf->ss_number_layers > 1) {
MAP(VP9E_SET_FRAME_PARALLEL_DECODING,
extra_cfg.frame_parallel_decoding_mode);
MAP(VP9E_SET_AQ_MODE, extra_cfg.aq_mode);
+ MAP(VP9E_SET_FRAME_PERIODIC_BOOST, extra_cfg.frame_periodic_boost);
}
res = validate_config(ctx, &ctx->cfg, &extra_cfg);
{VP9E_SET_LOSSLESS, set_param},
{VP9E_SET_FRAME_PARALLEL_DECODING, set_param},
{VP9E_SET_AQ_MODE, set_param},
+ {VP9E_SET_FRAME_PERIODIC_BOOST, set_param},
{VP9_GET_REFERENCE, get_reference},
{VP9E_SET_SVC, vp9e_set_svc},
{VP9E_SET_SVC_PARAMETERS, vp9e_set_svc_parameters},
VP9E_SET_TILE_ROWS,
VP9E_SET_FRAME_PARALLEL_DECODING,
VP9E_SET_AQ_MODE,
+ VP9E_SET_FRAME_PERIODIC_BOOST,
VP9E_SET_SVC,
VP9E_SET_SVC_PARAMETERS,
VPX_CTRL_USE_TYPE(VP9E_SET_AQ_MODE, unsigned int)
+VPX_CTRL_USE_TYPE(VP9E_SET_FRAME_PERIODIC_BOOST, unsigned int)
+
/*! @} - end defgroup vp8_encoder */
#ifdef __cplusplus
} // extern "C"
NULL, "frame-parallel", 1, "Enable frame parallel decodability features");
static const arg_def_t aq_mode = ARG_DEF(
NULL, "aq-mode", 1,
- "Adaptive q mode (0: off (by default), 1: variance 2: complexity)");
+ "Adaptive q mode (0: off (by default), 1: variance 2: complexity, "
+ "3: cyclic refresh)");
+static const arg_def_t frame_periodic_boost = ARG_DEF(
+ NULL, "frame_boost", 1,
+ "Enable frame periodic boost (0: off (by default), 1: on)");
static const arg_def_t *vp9_args[] = {
&cpu_used, &auto_altref, &noise_sens, &sharpness, &static_thresh,
&tile_cols, &tile_rows, &arnr_maxframes, &arnr_strength, &arnr_type,
&tune_ssim, &cq_level, &max_intra_rate_pct, &lossless,
- &frame_parallel_decoding, &aq_mode,
+ &frame_parallel_decoding, &aq_mode, &frame_periodic_boost,
NULL
};
static const int vp9_arg_ctrl_map[] = {
VP8E_SET_ARNR_MAXFRAMES, VP8E_SET_ARNR_STRENGTH, VP8E_SET_ARNR_TYPE,
VP8E_SET_TUNING, VP8E_SET_CQ_LEVEL, VP8E_SET_MAX_INTRA_BITRATE_PCT,
VP9E_SET_LOSSLESS, VP9E_SET_FRAME_PARALLEL_DECODING, VP9E_SET_AQ_MODE,
+ VP9E_SET_FRAME_PERIODIC_BOOST,
0
};
#endif