Clarify logic to enable tpl build

Explicitly check the update frame type to decide if to enable
tpl model.

Change-Id: Iaab78a3c95ef8350d309173c4b818ab65f1f66c0
(cherry picked from commit d5a40c92993bbcc399177d27994a327e79e98dbc)
diff --git a/av1/encoder/encode_strategy.c b/av1/encoder/encode_strategy.c
index 3b69cb2..84922cc 100644
--- a/av1/encoder/encode_strategy.c
+++ b/av1/encoder/encode_strategy.c
@@ -1186,8 +1186,9 @@
     // Do tpl after ARF is filtered, or if no ARF, at the second frame of GF
     // group.
     // TODO(bohanli): if no ARF, just do it at the first frame.
-    int which_frame_tpl = AOMMAX(cpi->gf_group.arf_index, 1);
-    allow_tpl = allow_tpl && (cpi->gf_group.index == which_frame_tpl);
+    int gf_index = gf_group->index;
+    allow_tpl = allow_tpl && (gf_group->update_type[gf_index] == ARF_UPDATE ||
+                              gf_group->update_type[gf_index] == GF_UPDATE);
     if (allow_tpl) {
       // Need to set the size for TPL for ARF
       // TODO(bohanli): Why is this? what part of it is necessary?