Reset frame udpate flags after qp estimate in tpl
authorJingning Han <jingning@google.com>
Tue, 23 Oct 2018 23:24:28 +0000 (16:24 -0700)
committerJingning Han <jingning@google.com>
Tue, 23 Oct 2018 23:24:28 +0000 (16:24 -0700)
After the frame quantizer estimate run in tpl model, reset the
actual value assigned to the current coding frame. This would
avoid certain frame update flags being overwritten by different
frame types' update.

Change-Id: Idde2ba1108f1f68747b14149b211f882965c99f0

vp9/encoder/vp9_ratectrl.c

index e0d7190..dc43bb1 100644 (file)
@@ -1485,6 +1485,8 @@ void vp9_estimate_qp_gop(VP9_COMP *cpi) {
   int bottom_index, top_index;
   int idx;
   const int gf_index = cpi->twopass.gf_group.index;
+  const int is_src_frame_alt_ref = cpi->rc.is_src_frame_alt_ref;
+  const int refresh_frame_context = cpi->common.refresh_frame_context;
 
   for (idx = 1; idx <= gop_length; ++idx) {
     TplDepFrame *tpl_frame = &cpi->tpl_stats[idx];
@@ -1498,6 +1500,8 @@ void vp9_estimate_qp_gop(VP9_COMP *cpi) {
   }
   // Reset the actual index and frame update
   cpi->twopass.gf_group.index = gf_index;
+  cpi->rc.is_src_frame_alt_ref = is_src_frame_alt_ref;
+  cpi->common.refresh_frame_context = refresh_frame_context;
   vp9_configure_buffer_updates(cpi, gf_index);
 }