summaryrefslogtreecommitdiff
path: root/vp9/encoder/vp9_encodeframe.c
diff options
context:
space:
mode:
authorsdeng <sdeng@google.com>2019-04-29 09:34:46 -0700
committersdeng <sdeng@google.com>2019-04-29 09:34:46 -0700
commit524ee737ea074e5fe29d60b61edaf8b397d3b10b (patch)
tree4a1fc04f7f463fde8cb23bf47f5d59b08203b71d /vp9/encoder/vp9_encodeframe.c
parente779b2f3812954516c780e0ce4f182d581ad6d92 (diff)
downloadlibvpx-524ee737ea074e5fe29d60b61edaf8b397d3b10b.tar
libvpx-524ee737ea074e5fe29d60b61edaf8b397d3b10b.tar.gz
libvpx-524ee737ea074e5fe29d60b61edaf8b397d3b10b.tar.bz2
libvpx-524ee737ea074e5fe29d60b61edaf8b397d3b10b.zip
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
Diffstat (limited to 'vp9/encoder/vp9_encodeframe.c')
-rw-r--r--vp9/encoder/vp9_encodeframe.c13
1 files changed, 7 insertions, 6 deletions
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;