rtc: Avoid avg_cdf_symbold in row-mt for rtc mode Speedup for 2 threads for real-time mode: ~7% for speed 8, ~10% for speed 9. Neutral/negligible change in bdrate on rtc and rtc_derf, for --threads=2,--tile-columns=1,--row-mt=1. Change-Id: Ifde82646b0a019428318a9334d67e856944920e1
diff --git a/av1/encoder/encodeframe.c b/av1/encoder/encodeframe.c index 9e826d0..1b2174c 100644 --- a/av1/encoder/encodeframe.c +++ b/av1/encoder/encodeframe.c
@@ -803,15 +803,20 @@ // restore frame context at the 1st column sb memcpy(xd->tile_ctx, x->row_ctx, sizeof(*xd->tile_ctx)); } else { - // update context - int wt_left = AVG_CDF_WEIGHT_LEFT; - int wt_tr = AVG_CDF_WEIGHT_TOP_RIGHT; - if (tile_info->mi_col_end > (mi_col + mib_size)) - av1_avg_cdf_symbols(xd->tile_ctx, x->row_ctx + sb_col_in_tile, - wt_left, wt_tr); - else - av1_avg_cdf_symbols(xd->tile_ctx, x->row_ctx + sb_col_in_tile - 1, - wt_left, wt_tr); + if (!cpi->sf.rt_sf.use_nonrd_pick_mode || + cpi->oxcf.cost_upd_freq.coeff < 2 || + cpi->oxcf.cost_upd_freq.mode < 2 || + cpi->oxcf.cost_upd_freq.mv < 2) { + // update context + int wt_left = AVG_CDF_WEIGHT_LEFT; + int wt_tr = AVG_CDF_WEIGHT_TOP_RIGHT; + if (tile_info->mi_col_end > (mi_col + mib_size)) + av1_avg_cdf_symbols(xd->tile_ctx, x->row_ctx + sb_col_in_tile, + wt_left, wt_tr); + else + av1_avg_cdf_symbols(xd->tile_ctx, x->row_ctx + sb_col_in_tile - 1, + wt_left, wt_tr); + } } }