Reduce QP used in TPL stage in VBR mode

BD-Rate performance results are as follows:

    Instruction Count                BD-Rate Loss(%)
cpu    Reduction(%)   avg.psnr  ovr.psnr  ssim     vmaf   vmaf_neg
 1        -0.3	       0.0082    0.0007   0.1027  -0.1710  -0.1634
 2        -0.3	      -0.0060   -0.0113  -0.0017  -0.1199  -0.1512
 3        -0.1	      -0.0011   -0.0011  -0.0494  -0.2244  -0.1896

STATS_CHANGED

Change-Id: I790702adac2d6625311a56f7e168d98aed81349b
diff --git a/av1/encoder/tpl_model.c b/av1/encoder/tpl_model.c
index 3f7fa88..ba54d55 100644
--- a/av1/encoder/tpl_model.c
+++ b/av1/encoder/tpl_model.c
@@ -1725,7 +1725,14 @@
       *pframe_qindex = gf_group->q_val[gf_index];
       leaf_frame_qindex = *pframe_qindex;
       if (cpi->oxcf.rc_cfg.mode == AOM_VBR) {
-        *pframe_qindex = CLIP(*pframe_qindex, MIN_TPL_Q_INDEX, MAX_TPL_Q_INDEX);
+        const int bit_depth = cm->seq_params->bit_depth;
+        const double q_val = av1_convert_qindex_to_q(*pframe_qindex, bit_depth);
+        const double qindex_ratio = (double)(*pframe_qindex) / MAXQ;
+        const double qstep_ratio = 1.0 - (qindex_ratio * qindex_ratio * 0.5);
+        const int delta_qindex =
+            av1_compute_qdelta(&cpi->rc, q_val, q_val * qstep_ratio, bit_depth);
+        *pframe_qindex = CLIP(*pframe_qindex + delta_qindex, MIN_TPL_Q_INDEX,
+                              MAX_TPL_Q_INDEX);
       }
     }