From df7039cf9afb8ef40c55f76ce9cad122f544505e Mon Sep 17 00:00:00 2001 From: Marco Paniconi Date: Wed, 6 Mar 2019 10:40:42 -0800 Subject: [PATCH] vp9-denoiser: Bias to last for golden long term If golden referene is selected as long-term reference, bias the denoiser filter to use last reference. Fixes visual artifact. And reduce the thresh_svc_golden, which was used to reduce the artifact occurrence. Change-Id: I08f24160ca11bd8f5f70acaefe989d5f92988132 --- vp9/encoder/vp9_denoiser.c | 5 ++--- vp9/encoder/vp9_pickmode.c | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/vp9/encoder/vp9_denoiser.c b/vp9/encoder/vp9_denoiser.c index 3d171c7da..2885223b5 100644 --- a/vp9/encoder/vp9_denoiser.c +++ b/vp9/encoder/vp9_denoiser.c @@ -219,9 +219,7 @@ static VP9_DENOISER_DECISION perform_motion_compensation( // If the best reference frame uses inter-prediction and there is enough of a // difference in sum-squared-error, use it. - if (frame != INTRA_FRAME && frame != ALTREF_FRAME && - (frame != GOLDEN_FRAME || num_spatial_layers == 1 || - use_gf_temporal_ref) && + if (frame != INTRA_FRAME && frame != ALTREF_FRAME && frame != GOLDEN_FRAME && sse_diff > sse_diff_thresh(bs, increase_denoising, motion_magnitude)) { mi->ref_frame[0] = ctx->best_reference_frame; mi->mode = ctx->best_sse_inter_mode; @@ -233,6 +231,7 @@ static VP9_DENOISER_DECISION perform_motion_compensation( // Bias to last reference. if ((num_spatial_layers > 1 && !use_gf_temporal_ref) || frame == ALTREF_FRAME || + (frame == GOLDEN_FRAME && use_gf_temporal_ref) || (frame != LAST_FRAME && ((ctx->zeromv_lastref_sse<(5 * ctx->zeromv_sse)>> 2) || denoiser->denoising_level >= kDenHigh))) { diff --git a/vp9/encoder/vp9_pickmode.c b/vp9/encoder/vp9_pickmode.c index 0de3c9a4c..d874ca27c 100644 --- a/vp9/encoder/vp9_pickmode.c +++ b/vp9/encoder/vp9_pickmode.c @@ -1699,7 +1699,7 @@ void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, TileDataEnc *tile_data, int svc_mv_row = 0; int no_scaling = 0; unsigned int thresh_svc_skip_golden = 500; - unsigned int thresh_skip_golden = (bsize >= BLOCK_32X32) ? 2500 : 500; + unsigned int thresh_skip_golden = 500; int scene_change_detected = cpi->rc.high_source_sad || (cpi->use_svc && cpi->svc.high_source_sad_superframe); -- 2.40.0