shithub: libvpx

Download patch

ref: 47922cc140b6293194f4b26a5aa25d31f03bc1a0
parent: fe471693acbf0d5bb61018b38ea11bdc342eec08
author: Jingning Han <[email protected]>
date: Tue Oct 23 16:30:35 EDT 2018

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

--- a/vp9/encoder/vp9_encodeframe.c
+++ b/vp9/encoder/vp9_encodeframe.c
@@ -3561,7 +3561,8 @@
 
 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 @@
 
   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) {