]> granicus.if.org Git - libvpx/commitdiff
Call tpl model build at the beginning of a GOP
authorJingning Han <jingning@google.com>
Wed, 10 Oct 2018 21:52:30 +0000 (14:52 -0700)
committerJingning Han <jingning@google.com>
Wed, 10 Oct 2018 21:52:30 +0000 (14:52 -0700)
The gop index 0 is default as kf / gf. The effective first coding
frame controlled by the current GOP rate allocation is indexed 1.
Call the tpl model build for the current GOP once at index 1
position. This would unify the calling system for single/multi-layer
ARF GOP structure.

Change-Id: I4ce69337e04646098d5513c0aa56b4e0b4483337

vp9/encoder/vp9_encoder.c

index 4a55e08a4798c3578e386ff0d72babea87abd652..8e35a8bad0c7030853374746897889e811cd954f 100644 (file)
@@ -6373,7 +6373,7 @@ int vp9_get_compressed_data(VP9_COMP *cpi, unsigned int *frame_flags,
     for (i = 0; i < MAX_REF_FRAMES; ++i) cpi->scaled_ref_idx[i] = INVALID_IDX;
   }
 
-  if (arf_src_index && cpi->sf.enable_tpl_model) {
+  if (cpi->twopass.gf_group.index == 1 && cpi->sf.enable_tpl_model) {
     vp9_estimate_qp_gop(cpi);
     setup_tpl_stats(cpi);
   }