From: hui su Date: Wed, 7 Jun 2017 22:50:36 +0000 (-0700) Subject: vp9 level targeting: more strict constraint on min_gf_interval X-Git-Tag: v1.7.0~399^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=21d2273efa35bf41d6e7cb3a300792f00d281e84;p=libvpx vp9 level targeting: more strict constraint on min_gf_interval min_gf_interval should be no less than min_altref_distance + 1, as the encoder may produce bitstream with alt-ref distance being min_gf_interval - 1. BUG=b/38450599 Change-Id: Ifb733daa643ebc668d1b23e1ce92db94b66dabe8 --- diff --git a/vp9/vp9_cx_iface.c b/vp9/vp9_cx_iface.c index 25fc80a9a..bb6b30bd4 100644 --- a/vp9/vp9_cx_iface.c +++ b/vp9/vp9_cx_iface.c @@ -425,10 +425,16 @@ static void config_target_level(VP9EncoderConfig *oxcf) { oxcf->worst_allowed_q = vp9_quantizer_to_qindex(63); // Adjust minimum art-ref distance. - if (oxcf->min_gf_interval < - (int)vp9_level_defs[target_level_index].min_altref_distance) + // min_gf_interval should be no less than min_altref_distance + 1, + // as the encoder may produce bitstream with alt-ref distance being + // min_gf_interval - 1. + if (oxcf->min_gf_interval <= + (int)vp9_level_defs[target_level_index].min_altref_distance) { oxcf->min_gf_interval = - (int)vp9_level_defs[target_level_index].min_altref_distance; + (int)vp9_level_defs[target_level_index].min_altref_distance + 1; + oxcf->max_gf_interval = + VPXMAX(oxcf->max_gf_interval, oxcf->min_gf_interval); + } // Adjust maximum column tiles. if (vp9_level_defs[target_level_index].max_col_tiles <