shithub: libvpx

Download patch

ref: 5b6203aa59d3aaf2c219dcf95f4412ea258e3f74
parent: 07507c830b3bea3b71cb30aeef569e6528a44cab
author: Jingning Han <jingning@google.com>
date: Mon Jul 16 10:31:51 EDT 2018

Assign estimate qp for overlay frame

Assign the estimated qp for the overlay frame too. Cap the minimum
quantization parameter to be 1 to avoid lossless coding in the
temporal dependency model setup.

Change-Id: I8acbc7182045dbf3017b6712a119b18407b76ab0

--- a/vp9/encoder/vp9_ratectrl.c
+++ b/vp9/encoder/vp9_ratectrl.c
@@ -1443,7 +1443,7 @@
   int idx;
   const int gf_index = cpi->twopass.gf_group.index;
 
-  for (idx = 1; idx <= gop_length; ++idx) {
+  for (idx = 1; idx <= gop_length + 1 && idx < MAX_LAG_BUFFERS; ++idx) {
     TplDepFrame *tpl_frame = &cpi->tpl_stats[idx];
     int target_rate = cpi->twopass.gf_group.bit_allocation[idx];
     cpi->twopass.gf_group.index = idx;
@@ -1451,6 +1451,7 @@
     vp9_configure_buffer_updates(cpi, idx);
     tpl_frame->base_qindex =
         rc_pick_q_and_bounds_two_pass(cpi, &bottom_index, &top_index, idx);
+    tpl_frame->base_qindex = VPXMAX(tpl_frame->base_qindex, 1);
   }
   // Reset the actual index and frame update
   cpi->twopass.gf_group.index = gf_index;