Fix keyframe filter length, keyframe-filtering=2

Without this patch, I saw a 0.3% drop in terms of compression
efficiency with
speed 3 q mode --limit=17 --enable-keyframe-filtering=2

After this patch, the overall improvement of this series of bug
fix is as follows. (negative means improvement)
speed 3 q mode --limit=17 --enable-keyframe-filtering=2
        AVG-PSNR  SSIM
lowres  -0.36%    -0.25%
midres  -0.29%    -0.20%
hdres   -0.30%    -0.31%
ugc360p -0.42%    -0.28%

speed 3 q mode --limit=150 --enable-keyframe-filtering=2
        AVG-PSNR  SSIM
lowres  -0.48%    -0.39%
midres  -0.45%    -0.37%
hdres   -0.57%    -0.48%
ugc360p -0.48%    -0.44%

Bug: webm:1715

STATS_CHANGED

Change-Id: Ifd967d1438db2b492e008b4ab8eabcfc2390af19
diff --git a/av1/encoder/temporal_filter.c b/av1/encoder/temporal_filter.c
index 608c5a5..58142cc 100644
--- a/av1/encoder/temporal_filter.c
+++ b/av1/encoder/temporal_filter.c
@@ -940,6 +940,7 @@
       av1_lookahead_depth(cpi->lookahead, cpi->compressor_stage);
 
   int arf_src_offset = cpi->gf_group.arf_src_offset[cpi->gf_group.index];
+  const FRAME_TYPE frame_type = cpi->gf_group.frame_type[cpi->gf_group.index];
 
   // Temporal filtering should not go beyond key frames
   const int key_to_curframe =
@@ -1000,7 +1001,7 @@
   }
   num_frames = AOMMIN(num_frames + adjust_num, lookahead_depth);
 
-  if (update_type == KF_UPDATE && !is_forward_keyframe) {
+  if (frame_type == KEY_FRAME && !is_forward_keyframe) {
     num_before = 0;
     num_after = AOMMIN(num_frames - 1, max_after);
   } else if (is_forward_keyframe) {  // Key frame in one-pass mode.