int tile_columns;
int tile_rows;
+ int enable_tpl_model;
+
int max_threads;
unsigned int target_level;
sf->allow_acl = 1;
#if CONFIG_VP9_HIGHBITDEPTH
// TODO(jingning): Make the model support high bit-depth route.
- sf->enable_tpl_model = !cm->use_highbitdepth;
+ sf->enable_tpl_model = !cm->use_highbitdepth && oxcf->enable_tpl_model;
#else
- sf->enable_tpl_model = 1;
+ sf->enable_tpl_model = oxcf->enable_tpl_model;
#endif
sf->prune_ref_frame_for_rect_partitions = 0;
unsigned int static_thresh;
unsigned int tile_columns;
unsigned int tile_rows;
+ unsigned int enable_tpl_model;
unsigned int arnr_max_frames;
unsigned int arnr_strength;
unsigned int min_gf_interval;
0, // static_thresh
6, // tile_columns
0, // tile_rows
+ 1, // enable_tpl_model
7, // arnr_max_frames
5, // arnr_strength
0, // min_gf_interval; 0 -> default decision
oxcf->tile_columns = extra_cfg->tile_columns;
+ oxcf->enable_tpl_model = extra_cfg->enable_tpl_model;
+
// TODO(yunqing): The dependencies between row tiles cause error in multi-
// threaded encoding. For now, tile_rows is forced to be 0 in this case.
// The further fix can be done by adding synchronizations after a tile row
return update_extra_cfg(ctx, &extra_cfg);
}
+static vpx_codec_err_t ctrl_set_tpl_model(vpx_codec_alg_priv_t *ctx,
+ va_list args) {
+ struct vp9_extracfg extra_cfg = ctx->extra_cfg;
+ extra_cfg.enable_tpl_model = CAST(VP9E_SET_TPL, args);
+ return update_extra_cfg(ctx, &extra_cfg);
+}
+
static vpx_codec_err_t ctrl_set_arnr_max_frames(vpx_codec_alg_priv_t *ctx,
va_list args) {
struct vp9_extracfg extra_cfg = ctx->extra_cfg;
{ VP8E_SET_STATIC_THRESHOLD, ctrl_set_static_thresh },
{ VP9E_SET_TILE_COLUMNS, ctrl_set_tile_columns },
{ VP9E_SET_TILE_ROWS, ctrl_set_tile_rows },
+ { VP9E_SET_TPL, ctrl_set_tpl_model },
{ VP8E_SET_ARNR_MAXFRAMES, ctrl_set_arnr_max_frames },
{ VP8E_SET_ARNR_STRENGTH, ctrl_set_arnr_strength },
{ VP8E_SET_ARNR_TYPE, ctrl_set_arnr_type },
* Supported in codecs: VP9
*/
VP9E_SET_SVC_SPATIAL_LAYER_SYNC,
+
+ /*!\brief Codec control function to enable temporal dependency model.
+ *
+ * Vp9 allows the encoder to run temporal dependency model and use it to
+ * improve the compression performance. To enable, set this parameter to be
+ * 1. The default value is set to be 1.
+ */
+ VP9E_SET_TPL,
};
/*!\brief vpx 1-D scaling mode
VPX_CTRL_USE_TYPE(VP9E_SET_TILE_ROWS, int)
#define VPX_CTRL_VP9E_SET_TILE_ROWS
+VPX_CTRL_USE_TYPE(VP9E_SET_TPL, int)
+#define VPX_CTRL_VP9E_SET_TPL
+
VPX_CTRL_USE_TYPE(VP8E_GET_LAST_QUANTIZER, int *)
#define VPX_CTRL_VP8E_GET_LAST_QUANTIZER
VPX_CTRL_USE_TYPE(VP8E_GET_LAST_QUANTIZER_64, int *)
static const arg_def_t tile_rows =
ARG_DEF(NULL, "tile-rows", 1,
"Number of tile rows to use, log2 (set to 0 while threads > 1)");
+
+static const arg_def_t enable_tpl_model =
+ ARG_DEF(NULL, "enable-tpl", 1, "Enable temporal dependency model");
+
static const arg_def_t lossless =
ARG_DEF(NULL, "lossless", 1, "Lossless mode (0: false (default), 1: true)");
static const arg_def_t frame_parallel_decoding = ARG_DEF(
&static_thresh,
&tile_cols,
&tile_rows,
+ &enable_tpl_model,
&arnr_maxframes,
&arnr_strength,
&arnr_type,
VP8E_SET_STATIC_THRESHOLD,
VP9E_SET_TILE_COLUMNS,
VP9E_SET_TILE_ROWS,
+ VP9E_SET_TPL,
VP8E_SET_ARNR_MAXFRAMES,
VP8E_SET_ARNR_STRENGTH,
VP8E_SET_ARNR_TYPE,