From 524ee737ea074e5fe29d60b61edaf8b397d3b10b Mon Sep 17 00:00:00 2001 From: sdeng Date: Mon, 29 Apr 2019 09:34:46 -0700 Subject: Call set_error_per_bit in SSIM rdmult update This CL improves objective metrics: (midres) avg_psnr ovr_psnr ssim ms_ssim -0.149 -0.038 -0.108 -0.129 Change-Id: I21f3e478f81ead5a3bcce6041f32fbceb53828f3 --- vp9/encoder/vp9_encodeframe.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'vp9/encoder/vp9_encodeframe.c') diff --git a/vp9/encoder/vp9_encodeframe.c b/vp9/encoder/vp9_encodeframe.c index 0e3737f37..9f9abd20f 100644 --- a/vp9/encoder/vp9_encodeframe.c +++ b/vp9/encoder/vp9_encodeframe.c @@ -257,8 +257,8 @@ static INLINE void set_mode_info_offsets(VP9_COMMON *const cm, x->mbmi_ext = x->mbmi_ext_base + (mi_row * cm->mi_cols + mi_col); } -static void set_ssim_rdmult(VP9_COMP *const cpi, int mi_row, int mi_col, - int *rdmult) { +static void set_ssim_rdmult(VP9_COMP *const cpi, MACROBLOCK *const x, + int mi_row, int mi_col, int *rdmult) { const VP9_COMMON *const cm = &cpi->common; // SSIM rdmult scaling factors are currently 64x64 based. @@ -273,6 +273,7 @@ static void set_ssim_rdmult(VP9_COMP *const cpi, int mi_row, int mi_col, *rdmult = (int)((double)(*rdmult) * cpi->mi_ssim_rdmult_scaling_factors[index]); *rdmult = VPXMAX(*rdmult, 1); + set_error_per_bit(x, *rdmult); vpx_clear_system_state(); } @@ -312,7 +313,7 @@ static void set_offsets(VP9_COMP *cpi, const TileInfo *const tile, x->rddiv = cpi->rd.RDDIV; x->rdmult = cpi->rd.RDMULT; if (oxcf->tuning == VP8_TUNE_SSIM) { - set_ssim_rdmult(cpi, mi_row, mi_col, &x->rdmult); + set_ssim_rdmult(cpi, x, mi_row, mi_col, &x->rdmult); } // required by vp9_append_sub8x8_mvs_for_idx() and vp9_find_best_ref_mvs() @@ -1961,7 +1962,7 @@ static void set_segment_rdmult(VP9_COMP *const cpi, MACROBLOCK *const x, } if (oxcf->tuning == VP8_TUNE_SSIM) { - set_ssim_rdmult(cpi, mi_row, mi_col, &x->rdmult); + set_ssim_rdmult(cpi, x, mi_row, mi_col, &x->rdmult); } } @@ -2204,7 +2205,7 @@ static void encode_b(VP9_COMP *cpi, const TileInfo *const tile, ThreadData *td, const VP9EncoderConfig *const oxcf = &cpi->oxcf; x->rdmult = x->cb_rdmult; if (oxcf->tuning == VP8_TUNE_SSIM) { - set_ssim_rdmult(cpi, mi_row, mi_col, &x->rdmult); + set_ssim_rdmult(cpi, x, mi_row, mi_col, &x->rdmult); } } @@ -3817,7 +3818,7 @@ static void rd_pick_partition(VP9_COMP *cpi, ThreadData *td, int partition_mul = x->cb_rdmult; if (oxcf->tuning == VP8_TUNE_SSIM) { - set_ssim_rdmult(cpi, mi_row, mi_col, &partition_mul); + set_ssim_rdmult(cpi, x, mi_row, mi_col, &partition_mul); } (void)*tp_orig; -- cgit v1.2.3