Add ALLOW_RECODE_FIRST speed mode.

This patch is to address concerns that changes to allow
recodes on the first frame in each ARF group do not give a
good enough speed quality trade off for speed 2. Though the
average impact  on encode speed is 1-2%, for some hard clips
it is > 5% rise.  For speed 1 this is less an issue and for Speed 0
the previous patch actually  improves speed.

Change-Id: Ie1bcefdbfdf846d3f4428590173f621465dffe3a
This commit is contained in:
paulwilkins 2016-08-26 11:43:47 +01:00
parent bf7a02a4cf
commit dc42f343ae
3 changed files with 8 additions and 5 deletions

View File

@ -2418,8 +2418,9 @@ static int recode_loop_test(VP9_COMP *cpi, int high_limit, int low_limit, int q,
if ((rc->projected_frame_size >= rc->max_frame_bandwidth) || if ((rc->projected_frame_size >= rc->max_frame_bandwidth) ||
big_rate_miss(cpi, high_limit, low_limit) || big_rate_miss(cpi, high_limit, low_limit) ||
(cpi->sf.recode_loop == ALLOW_RECODE) || (cpi->sf.recode_loop == ALLOW_RECODE) ||
((frame_is_kfgfarf || two_pass_first_group_inter(cpi)) && (two_pass_first_group_inter(cpi) &&
(cpi->sf.recode_loop == ALLOW_RECODE_KFARFGF))) { (cpi->sf.recode_loop == ALLOW_RECODE_FIRST)) ||
(frame_is_kfgfarf && (cpi->sf.recode_loop >= ALLOW_RECODE_KFARFGF))) {
if (frame_is_kfgfarf && (oxcf->resize_mode == RESIZE_DYNAMIC) && if (frame_is_kfgfarf && (oxcf->resize_mode == RESIZE_DYNAMIC) &&
scale_down(cpi, q)) { scale_down(cpi, q)) {
// Code this group at a lower resolution. // Code this group at a lower resolution.

View File

@ -169,7 +169,6 @@ static void set_good_speed_feature(VP9_COMP *cpi, VP9_COMMON *cm,
sf->mode_skip_start = 10; sf->mode_skip_start = 10;
sf->adaptive_pred_interp_filter = 1; sf->adaptive_pred_interp_filter = 1;
sf->recode_loop = ALLOW_RECODE_KFARFGF;
sf->intra_y_mode_mask[TX_32X32] = INTRA_DC_H_V; sf->intra_y_mode_mask[TX_32X32] = INTRA_DC_H_V;
sf->intra_uv_mode_mask[TX_32X32] = INTRA_DC_H_V; sf->intra_uv_mode_mask[TX_32X32] = INTRA_DC_H_V;
sf->intra_y_mode_mask[TX_16X16] = INTRA_DC_H_V; sf->intra_y_mode_mask[TX_16X16] = INTRA_DC_H_V;
@ -179,6 +178,7 @@ static void set_good_speed_feature(VP9_COMP *cpi, VP9_COMMON *cm,
} }
if (speed >= 2) { if (speed >= 2) {
sf->recode_loop = ALLOW_RECODE_KFARFGF;
sf->tx_size_search_method = sf->tx_size_search_method =
frame_is_boosted(cpi) ? USE_FULL_RD : USE_LARGESTALL; frame_is_boosted(cpi) ? USE_FULL_RD : USE_LARGESTALL;
@ -528,7 +528,7 @@ void vp9_set_speed_features_framesize_independent(VP9_COMP *cpi) {
// best quality defaults // best quality defaults
sf->frame_parameter_update = 1; sf->frame_parameter_update = 1;
sf->mv.search_method = NSTEP; sf->mv.search_method = NSTEP;
sf->recode_loop = ALLOW_RECODE_KFARFGF; sf->recode_loop = ALLOW_RECODE_FIRST;
sf->mv.subpel_search_method = SUBPEL_TREE; sf->mv.subpel_search_method = SUBPEL_TREE;
sf->mv.subpel_iters_per_step = 2; sf->mv.subpel_iters_per_step = 2;
sf->mv.subpel_force_stop = 0; sf->mv.subpel_force_stop = 0;

View File

@ -67,8 +67,10 @@ typedef enum {
ALLOW_RECODE_KFMAXBW = 1, ALLOW_RECODE_KFMAXBW = 1,
// Allow recode only for KF/ARF/GF frames. // Allow recode only for KF/ARF/GF frames.
ALLOW_RECODE_KFARFGF = 2, ALLOW_RECODE_KFARFGF = 2,
// Allow recode for ARF/GF/KF and first normal frame in each group.
ALLOW_RECODE_FIRST = 3,
// Allow recode for all frames based on bitrate constraints. // Allow recode for all frames based on bitrate constraints.
ALLOW_RECODE = 3, ALLOW_RECODE = 4,
} RECODE_LOOP_TYPE; } RECODE_LOOP_TYPE;
typedef enum { typedef enum {