From ad7e76531950869be24ed3679b9c802bafa85d04 Mon Sep 17 00:00:00 2001 From: Marco Date: Mon, 30 Nov 2015 08:57:49 -0800 Subject: [PATCH] vp9 denoiser: Fix to re-evaluate mode selection. This fix allows to enable reuse_inter_pred. Change-Id: I53f2bf1163bb0036ffb6df92117a86debdca11d1 --- vp9/encoder/vp9_pickmode.c | 4 ++-- vp9/encoder/vp9_speed_features.c | 10 ---------- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/vp9/encoder/vp9_pickmode.c b/vp9/encoder/vp9_pickmode.c index 02e967401..095847a23 100644 --- a/vp9/encoder/vp9_pickmode.c +++ b/vp9/encoder/vp9_pickmode.c @@ -1703,8 +1703,7 @@ void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, decision == FILTER_BLOCK && cpi->noise_estimate.enabled && cpi->noise_estimate.level > kLow && - zero_last_cost_orig < (best_rdc.rdcost << 2) && - !reuse_inter_pred) { + zero_last_cost_orig < (best_rdc.rdcost << 2)) { // Check if we should pick ZEROMV on denoised signal. int rate = 0; int64_t dist = 0; @@ -1713,6 +1712,7 @@ void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, mbmi->ref_frame[1] = NONE; mbmi->mv[0].as_int = 0; mbmi->interp_filter = EIGHTTAP; + xd->plane[0].pre[0] = yv12_mb[LAST_FRAME][0]; vp9_build_inter_predictors_sby(xd, mi_row, mi_col, bsize); model_rd_for_sb_y(cpi, bsize, x, xd, &rate, &dist, &var_y, &sse_y); this_rdc.rate = rate + ref_frame_cost[LAST_FRAME] + diff --git a/vp9/encoder/vp9_speed_features.c b/vp9/encoder/vp9_speed_features.c index 20516a0c9..318d8100c 100644 --- a/vp9/encoder/vp9_speed_features.c +++ b/vp9/encoder/vp9_speed_features.c @@ -380,16 +380,6 @@ static void set_rt_speed_feature(VP9_COMP *cpi, SPEED_FEATURES *sf, sf->adaptive_rd_thresh = 2; // This feature is only enabled when partition search is disabled. sf->reuse_inter_pred_sby = 1; - // TODO(marpan): When denoising, we may re-evaluate the mode selection and - // this seems to cause problems when reuse_inter_pred_sby is enabled. - // Disabling reuse_inter_pred_sby for now (under denoising conditions), and - // will look into re-enabling it. -#if CONFIG_VP9_TEMPORAL_DENOISING - if (cpi->oxcf.noise_sensitivity > 0 && - cpi->noise_estimate.enabled && - cpi->noise_estimate.level > kLow) - sf->reuse_inter_pred_sby = 0; -#endif sf->partition_search_breakout_rate_thr = 200; sf->coeff_prob_appx_step = 4; sf->use_fast_coef_updates = is_keyframe ? TWO_LOOP : ONE_LOOP_REDUCED;