Bugfix related to qindex for KF min/max dist of 0 When "--kf-min-dist=0 --kf-max-dist=0" is given, base_qindex of all the frames should be same as the provided cq_level. Earlier, 1st frame was incorrectly using a lower qindex. BUG=aomedia:2725 Change-Id: Ib5f4aee95a8dfe618503108f2853b6898e5b1b50 (cherry picked from commit 8db5ca98460ae4843e657ef53abd26632d6ce07f)
diff --git a/av1/encoder/ratectrl.c b/av1/encoder/ratectrl.c index 433163f..3079e98 100644 --- a/av1/encoder/ratectrl.c +++ b/av1/encoder/ratectrl.c
@@ -907,7 +907,7 @@ int offset_idx = -1; if (update_type == KF_UPDATE) { - if (rc->frames_to_key == 1) { + if (rc->frames_to_key <= 1) { // Image / intra-only coding: ignore offsets. return cq_level; } @@ -1146,7 +1146,7 @@ int active_worst_quality = *active_worst; const int bit_depth = cm->seq_params.bit_depth; - if (rc->frames_to_key == 1 && oxcf->rc_mode == AOM_Q) { + if (rc->frames_to_key <= 1 && oxcf->rc_mode == AOM_Q) { // If the next frame is also a key frame or the current frame is the // only frame in the sequence in AOM_Q mode, just use the cq_level // as q.