rtc: Extract some speed features used in screen Extract some features used for screen and add speed features for them: newmv skip for flat blocks, usage of idtx, and the min_thresh for scene detection. This is to allow for better control for content with mixed screen and video; also some of these may be used for non-screen input. No change in behavior. Change-Id: I29307032a283d19f8899d980baa61a7d9b0748a4
diff --git a/av1/encoder/nonrd_pickmode.c b/av1/encoder/nonrd_pickmode.c index 08ecb84..dcaf13f 100644 --- a/av1/encoder/nonrd_pickmode.c +++ b/av1/encoder/nonrd_pickmode.c
@@ -2469,7 +2469,9 @@ return true; } // Skip NEWMV search for flat blocks. - if (*this_mode == NEWMV && x->source_variance < 100) return true; + if (rt_sf->skip_newmv_flat_blocks_screen && *this_mode == NEWMV && + x->source_variance < 100) + return true; // Skip non-LAST for color on flat blocks. if (*ref_frame > LAST_FRAME && x->source_variance == 0 && (x->color_sensitivity[COLOR_SENS_IDX(AOM_PLANE_U)] == 1 || @@ -2960,9 +2962,9 @@ // TODO(marpan): Only allow for 8 bit-depth for now, re-enable for 10/12 bit // when issue 3359 is fixed. - if (cm->seq_params->bit_depth == 8 && - cpi->oxcf.tune_cfg.content == AOM_CONTENT_SCREEN && !skip_idtx_palette && - !cpi->oxcf.txfm_cfg.use_inter_dct_only && !x->force_zeromv_skip_for_blk && + if (cm->seq_params->bit_depth == 8 && rt_sf->use_idtx_nonrd && + !skip_idtx_palette && !cpi->oxcf.txfm_cfg.use_inter_dct_only && + !x->force_zeromv_skip_for_blk && is_inter_mode(best_pickmode->best_mode) && best_pickmode->best_pred != NULL && (!rt_sf->prune_idtx_nonrd ||
diff --git a/av1/encoder/ratectrl.c b/av1/encoder/ratectrl.c index 7639484..9daeb45 100644 --- a/av1/encoder/ratectrl.c +++ b/av1/encoder/ratectrl.c
@@ -3073,7 +3073,7 @@ } int num_zero_temp_sad = 0; uint32_t min_thresh = 10000; - if (cpi->oxcf.tune_cfg.content != AOM_CONTENT_SCREEN) { + if (cpi->sf.rt_sf.higher_thresh_scene_detection) { min_thresh = cm->width * cm->height <= 320 * 240 && cpi->framerate < 10.0 ? 50000 : 100000;
diff --git a/av1/encoder/speed_features.c b/av1/encoder/speed_features.c index 9a00042..b0ab7fe 100644 --- a/av1/encoder/speed_features.c +++ b/av1/encoder/speed_features.c
@@ -1586,6 +1586,9 @@ sf->rt_sf.prune_palette_nonrd = 1; sf->rt_sf.increase_color_thresh_palette = 0; } + sf->rt_sf.skip_newmv_flat_blocks_screen = 1; + sf->rt_sf.use_idtx_nonrd = 1; + sf->rt_sf.higher_thresh_scene_detection = 0; sf->rt_sf.use_nonrd_altref_frame = 0; sf->rt_sf.use_rtc_tf = 0; sf->rt_sf.use_comp_ref_nonrd = 0; @@ -2270,6 +2273,7 @@ rt_sf->var_part_split_threshold_shift = 7; rt_sf->gf_refresh_based_on_qp = 0; rt_sf->use_rtc_tf = 0; + rt_sf->use_idtx_nonrd = 0; rt_sf->prune_idtx_nonrd = 0; rt_sf->prune_palette_nonrd = 0; rt_sf->dct_only_palette_nonrd = 0; @@ -2299,6 +2303,8 @@ rt_sf->increase_color_thresh_palette = false; rt_sf->selective_cdf_update = 0; rt_sf->force_only_last_ref = 0; + rt_sf->higher_thresh_scene_detection = 1; + rt_sf->skip_newmv_flat_blocks_screen = 0; } static fractional_mv_step_fp
diff --git a/av1/encoder/speed_features.h b/av1/encoder/speed_features.h index d59cb38..d6b2949 100644 --- a/av1/encoder/speed_features.h +++ b/av1/encoder/speed_features.h
@@ -1754,10 +1754,12 @@ // Must be off for lossless mode. int use_rtc_tf; - // Prune the use of the identity transform in nonrd_pickmode, - // used for screen content mode: only for smaller blocks - // and higher spatial variance, and when skip_txfm is not - // already set. + // Use of the identity transform in nonrd_pickmode, + int use_idtx_nonrd; + + // Prune the use of the identity transform in nonrd_pickmode: + // only for smaller blocks and higher spatial variance, and when skip_txfm + // is not already set. int prune_idtx_nonrd; // Prune the use of paletter mode in nonrd pickmode. @@ -1902,6 +1904,12 @@ // This generally leads to better coding efficiency but with some speed loss. // Only used for screen content and for nonrd_pickmode. bool increase_color_thresh_palette; + + // Flag to indicate selecting of higher threshold for scenee change detection. + int higher_thresh_scene_detection; + + // FLag to indicate skip testing of NEWMV for flat blocks. + int skip_newmv_flat_blocks_screen; } REAL_TIME_SPEED_FEATURES; /*!\endcond */