From 47922cc140b6293194f4b26a5aa25d31f03bc1a0 Mon Sep 17 00:00:00 2001 From: Jingning Han Date: Tue, 23 Oct 2018 20:30:35 -0700 Subject: [PATCH] Enable tpl model to support multi-layer ARF Enable temporal dependency model for the base layer ARF. It improves the multi-layer ARF compression performance (results are tested in speed 0 vbr mode): avg PSNR overall PSNR SSIM lowres -0.40% -0.46% -0.32% midres -0.59% -0.68% -0.45% 720p -0.55% -0.59% -1.07% Change-Id: I7790b89ccfb6e61f9b7965f34d348c7440220dd0 --- vp9/encoder/vp9_encodeframe.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/vp9/encoder/vp9_encodeframe.c b/vp9/encoder/vp9_encodeframe.c index b69ee6181..b7ef88d36 100644 --- a/vp9/encoder/vp9_encodeframe.c +++ b/vp9/encoder/vp9_encodeframe.c @@ -3561,7 +3561,8 @@ static void ml_predict_var_rd_paritioning(VP9_COMP *cpi, MACROBLOCK *x, int get_rdmult_delta(VP9_COMP *cpi, BLOCK_SIZE bsize, int mi_row, int mi_col, int orig_rdmult) { - TplDepFrame *tpl_frame = &cpi->tpl_stats[cpi->twopass.gf_group.index]; + const int gf_group_index = cpi->twopass.gf_group.index; + TplDepFrame *tpl_frame = &cpi->tpl_stats[gf_group_index]; TplDepStats *tpl_stats = tpl_frame->tpl_stats_ptr; int tpl_stride = tpl_frame->stride; int64_t intra_cost = 0; @@ -3576,9 +3577,9 @@ int get_rdmult_delta(VP9_COMP *cpi, BLOCK_SIZE bsize, int mi_row, int mi_col, if (tpl_frame->is_valid == 0) return orig_rdmult; - if (cpi->common.show_frame) return orig_rdmult; + if (cpi->twopass.gf_group.layer_depth[gf_group_index] > 1) return orig_rdmult; - if (cpi->twopass.gf_group.index >= MAX_ARF_GOP_SIZE) return orig_rdmult; + if (gf_group_index >= MAX_ARF_GOP_SIZE) return orig_rdmult; for (row = mi_row; row < mi_row + mi_high; ++row) { for (col = mi_col; col < mi_col + mi_wide; ++col) { -- 2.40.0