]> granicus.if.org Git - libvpx/commitdiff
Refactor gop_length use case in tpl model
authorJingning Han <jingning@google.com>
Mon, 22 Oct 2018 17:37:09 +0000 (10:37 -0700)
committerJingning Han <jingning@google.com>
Tue, 23 Oct 2018 17:34:58 +0000 (10:34 -0700)
Make it support both single- and multi-layer ARF GOP structure.

Change-Id: I760a95804d1b583b057120f6d6be65195a0e6c19

vp9/encoder/vp9_ratectrl.c

index 8d1d265f6ba4de6081b7d4557225847957653ce4..81cf8858a9e46274969b8a62aeb87fb0a4baf8d6 100644 (file)
@@ -1481,12 +1481,12 @@ void vp9_configure_buffer_updates(VP9_COMP *cpi, int gf_group_index) {
 }
 
 void vp9_estimate_qp_gop(VP9_COMP *cpi) {
-  int gop_length = cpi->rc.baseline_gf_interval;
+  int gop_length = cpi->twopass.gf_group.gf_group_size;
   int bottom_index, top_index;
   int idx;
   const int gf_index = cpi->twopass.gf_group.index;
 
-  for (idx = 1; idx <= gop_length + 1 && idx < MAX_LAG_BUFFERS; ++idx) {
+  for (idx = 1; idx < gop_length; ++idx) {
     TplDepFrame *tpl_frame = &cpi->tpl_stats[idx];
     int target_rate = cpi->twopass.gf_group.bit_allocation[idx];
     cpi->twopass.gf_group.index = idx;