ref: 21e1661b54e6e25bdea4cc0b5c1c55f6df8245f2
parent: a46bc0268b8d7d73adda1fef937f4310d2e76be8
parent: 21d2273efa35bf41d6e7cb3a300792f00d281e84
author: Hui Su <huisu@google.com>
date: Mon Jun 12 12:38:02 EDT 2017
Merge "vp9 level targeting: more strict constraint on min_gf_interval"
--- 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 <