From: Marco Paniconi Date: Fri, 15 Mar 2019 00:27:58 +0000 (-0700) Subject: vp9-rtc: Some adjustments for low-resolns real-time X-Git-Tag: v1.8.1~186^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3134b502118bb4dfad04ffcdae04b1d6e1c9b62b;p=platform%2Fupstream%2Flibvpx.git vp9-rtc: Some adjustments for low-resolns real-time Force smooth_interpol filter for low resolutions at high Q, avoid the loopfilter strength reduction for similar conditon, and reduce thresh_motion for cyclic refresh turnoff. Change-Id: I4e9121d1cdc7d1b04992c741dc4f0cec281592f7 --- diff --git a/vp9/encoder/vp9_aq_cyclicrefresh.c b/vp9/encoder/vp9_aq_cyclicrefresh.c index ef8cd46..5cc0e03 100644 --- a/vp9/encoder/vp9_aq_cyclicrefresh.c +++ b/vp9/encoder/vp9_aq_cyclicrefresh.c @@ -478,7 +478,7 @@ void vp9_cyclic_refresh_update_parameters(VP9_COMP *const cpi) { int target_refresh = 0; double weight_segment_target = 0; double weight_segment = 0; - int thresh_low_motion = (cm->width < 720) ? 55 : 20; + int thresh_low_motion = 20; int qp_thresh = VPXMIN((cpi->oxcf.content == VP9E_CONTENT_SCREEN) ? 35 : 20, rc->best_quality << 1); cr->apply_cyclic_refresh = 1; diff --git a/vp9/encoder/vp9_picklpf.c b/vp9/encoder/vp9_picklpf.c index f3c1170..a81e527 100644 --- a/vp9/encoder/vp9_picklpf.c +++ b/vp9/encoder/vp9_picklpf.c @@ -179,6 +179,7 @@ void vp9_pick_filter_level(const YV12_BUFFER_CONFIG *sd, VP9_COMP *cpi, #endif // CONFIG_VP9_HIGHBITDEPTH if (cpi->oxcf.pass == 0 && cpi->oxcf.rc_mode == VPX_CBR && cpi->oxcf.aq_mode == CYCLIC_REFRESH_AQ && cm->seg.enabled && + (cm->base_qindex < 200 || cm->width * cm->height > 320 * 240) && cpi->oxcf.content != VP9E_CONTENT_SCREEN && cm->frame_type != KEY_FRAME) filt_guess = 5 * filt_guess >> 3; diff --git a/vp9/encoder/vp9_pickmode.c b/vp9/encoder/vp9_pickmode.c index ac98162..b69b269 100644 --- a/vp9/encoder/vp9_pickmode.c +++ b/vp9/encoder/vp9_pickmode.c @@ -1442,7 +1442,7 @@ static void search_filter_ref(VP9_COMP *cpi, MACROBLOCK *x, RD_COST *this_rdc, int mi_row, int mi_col, PRED_BUFFER *tmp, BLOCK_SIZE bsize, int reuse_inter_pred, PRED_BUFFER **this_mode_pred, unsigned int *var_y, - unsigned int *sse_y) { + unsigned int *sse_y, int force_smooth_filter) { MACROBLOCKD *const xd = &x->e_mbd; MODE_INFO *const mi = xd->mi[0]; struct macroblockd_plane *const pd = &xd->plane[0]; @@ -1458,8 +1458,8 @@ static void search_filter_ref(VP9_COMP *cpi, MACROBLOCK *x, RD_COST *this_rdc, INTERP_FILTER best_filter = SWITCHABLE, filter; PRED_BUFFER *current_pred = *this_mode_pred; uint8_t skip_txfm = SKIP_TXFM_NONE; - - for (filter = EIGHTTAP; filter <= EIGHTTAP_SMOOTH; ++filter) { + INTERP_FILTER filter_start = force_smooth_filter ? EIGHTTAP_SMOOTH : EIGHTTAP; + for (filter = filter_start; filter <= EIGHTTAP_SMOOTH; ++filter) { int64_t cost; mi->interp_filter = filter; vp9_build_inter_predictors_sby(xd, mi_row, mi_col, bsize); @@ -1700,6 +1700,11 @@ void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, TileDataEnc *tile_data, int no_scaling = 0; unsigned int thresh_svc_skip_golden = 500; unsigned int thresh_skip_golden = 500; + int force_smooth_filter = + (cpi->oxcf.speed >= 8 && cm->width * cm->height <= 320 * 240 && + cm->base_qindex >= 200) + ? 1 + : 0; int scene_change_detected = cpi->rc.high_source_sad || (cpi->use_svc && cpi->svc.high_source_sad_superframe); @@ -2225,7 +2230,8 @@ void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, TileDataEnc *tile_data, (((mi->mv[0].as_mv.row | mi->mv[0].as_mv.col) & 0x07) != 0)) { rd_computed = 1; search_filter_ref(cpi, x, &this_rdc, mi_row, mi_col, tmp, bsize, - reuse_inter_pred, &this_mode_pred, &var_y, &sse_y); + reuse_inter_pred, &this_mode_pred, &var_y, &sse_y, + force_smooth_filter); } else { // For low motion content use x->sb_is_skin in addition to VeryHighSad // for setting large_block.