ref: 21d2273efa35bf41d6e7cb3a300792f00d281e84
parent: 9cea3a3c4efc25e03781c60d34f867ff4f35e73e
author: hui su <huisu@google.com>
date: Wed Jun 7 11:50:36 EDT 2017
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
--- a/vp9/vp9_cx_iface.c
+++ b/vp9/vp9_cx_iface.c
@@ -425,10 +425,16 @@
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 <