]> granicus.if.org Git - libvpx/commitdiff
Allow codec to skip temporal filter for intermediate ARFs
authorJingning Han <jingning@google.com>
Tue, 21 Aug 2018 19:54:30 +0000 (12:54 -0700)
committerJingning Han <jingning@google.com>
Tue, 21 Aug 2018 23:42:41 +0000 (16:42 -0700)
Allow the encoder to skip temporal filter for intermediate ARFs
that are later used in show_existing_frame mode.

Change-Id: Ieed635bf7672b62f5c287bde43765f80362a345e

vp9/encoder/vp9_temporal_filter.c

index ee4c1d059aee88fd6425a6f15dfbcfc7778a96aa..526d1245c6f102b9a30f53ce0cc4f8d5b1d8e492 100644 (file)
@@ -783,6 +783,7 @@ static void temporal_filter_iterate_c(VP9_COMP *cpi) {
 static void adjust_arnr_filter(VP9_COMP *cpi, int distance, int group_boost,
                                int *arnr_frames, int *arnr_strength) {
   const VP9EncoderConfig *const oxcf = &cpi->oxcf;
+  const GF_GROUP *const gf_group = &cpi->twopass.gf_group;
   const int frames_after_arf =
       vp9_lookahead_depth(cpi->lookahead) - distance - 1;
   int frames_fwd = (cpi->oxcf.arnr_max_frames - 1) >> 1;
@@ -836,12 +837,15 @@ static void adjust_arnr_filter(VP9_COMP *cpi, int distance, int group_boost,
   }
 
   // Adjustments for second level arf in multi arf case.
-  if (cpi->oxcf.pass == 2 && cpi->multi_arf_allowed) {
-    const GF_GROUP *const gf_group = &cpi->twopass.gf_group;
-    if (gf_group->rf_level[gf_group->index] != GF_ARF_STD) {
-      strength >>= 1;
-    }
-  }
+  if (cpi->oxcf.pass == 2 && cpi->multi_arf_allowed)
+    if (gf_group->rf_level[gf_group->index] != GF_ARF_STD) strength >>= 1;
+
+  // TODO(jingning): Skip temporal filtering for intermediate frames that will
+  // be used as show_existing_frame. Need to further explore the possibility to
+  // apply certain filter.
+  if (gf_group->arf_src_offset[gf_group->index] <
+      cpi->rc.baseline_gf_interval - 1)
+    frames = 1;
 
   *arnr_frames = frames;
   *arnr_strength = strength;