Adjust alt-ref selection in define_gf_group()

107de19698 changes the encoder alt-ref selection behavior. Assuming
min_gf_interval = max_gf_interval = 4, the frame order would be
frm_1  arf_1  frm_2  frm_3  frm_4  frm_5  arf_2 before 107de19698;
frm_1  arf_1  frm_2  frm_3  frm_4  arf_2  frm_5 after 107de19698.

This patch reverts such alt-ref placement change.

Change-Id: I93a4a65036575151286f004d455d4fcea88a1550
This commit is contained in:
hui su 2017-04-20 15:49:52 -07:00
parent 29938b3a5a
commit 8069f31076

View File

@ -2370,8 +2370,8 @@ static void define_gf_group(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) {
cpi->common.bit_depth));
active_min_gf_interval =
rc->min_gf_interval + arf_active_or_kf + VPXMIN(2, int_max_q / 200);
if (active_min_gf_interval > rc->max_gf_interval)
active_min_gf_interval = rc->max_gf_interval;
active_min_gf_interval =
VPXMIN(active_min_gf_interval, rc->max_gf_interval + arf_active_or_kf);
if (cpi->multi_arf_allowed) {
active_max_gf_interval = rc->max_gf_interval;
@ -2382,11 +2382,14 @@ static void define_gf_group(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) {
// interval to spread the cost of the GF.
active_max_gf_interval = 12 + arf_active_or_kf + VPXMIN(4, (int_lbq / 6));
// We have: active_min_gf_interval <= rc->max_gf_interval
if (active_max_gf_interval < active_min_gf_interval)
// We have: active_min_gf_interval <=
// rc->max_gf_interval + arf_active_or_kf.
if (active_max_gf_interval < active_min_gf_interval) {
active_max_gf_interval = active_min_gf_interval;
else if (active_max_gf_interval > rc->max_gf_interval)
active_max_gf_interval = rc->max_gf_interval;
} else {
active_max_gf_interval = VPXMIN(active_max_gf_interval,
rc->max_gf_interval + arf_active_or_kf);
}
// Would the active max drop us out just before the near the next kf?
if ((active_max_gf_interval <= rc->frames_to_key) &&