shithub: libvpx

Download patch

ref: d96ed96c0fb125f0369b48910f24ed85dccc39b2
parent: 492d52b9cc549f0d8d8d6f370425a0cee16237eb
author: hui su <huisu@google.com>
date: Tue Jun 20 12:26:00 EDT 2017

VP9 level targeting: properly handle max_gf_interval

Don't overide max_gf_interval if it's not specified. It will
be assigned with a default value in vp9_rc_set_gf_interval_range().

BUG=b/62803416

Change-Id: Ide46ce00279ed076865fc54ce98c55a994f0c798

--- a/vp9/vp9_cx_iface.c
+++ b/vp9/vp9_cx_iface.c
@@ -432,8 +432,12 @@
       (int)vp9_level_defs[target_level_index].min_altref_distance) {
     oxcf->min_gf_interval =
         (int)vp9_level_defs[target_level_index].min_altref_distance + 1;
-    oxcf->max_gf_interval =
-        VPXMAX(oxcf->max_gf_interval, oxcf->min_gf_interval);
+    // If oxcf->max_gf_interval == 0, it will be assigned with a default value
+    // in vp9_rc_set_gf_interval_range().
+    if (oxcf->max_gf_interval != 0) {
+      oxcf->max_gf_interval =
+          VPXMAX(oxcf->max_gf_interval, oxcf->min_gf_interval);
+    }
   }
 
   // Adjust maximum column tiles.