Bugfix for frame type with kf min/max dist of 0
All frames should be keyframes when "--kf-min-dist=0 --kf-max-dist=0" is
given.
But earlier, only the 1st frame was keyframe in this case.
BUG=aomedia:2725
Change-Id: I376eda9be242cc8178a59f023bd00a2219c5a74b
diff --git a/av1/encoder/pass2_strategy.c b/av1/encoder/pass2_strategy.c
index 8cae53c..18dd606 100644
--- a/av1/encoder/pass2_strategy.c
+++ b/av1/encoder/pass2_strategy.c
@@ -2646,7 +2646,8 @@
}
// Keyframe and section processing.
- if (rc->frames_to_key == 0 || (frame_flags & FRAMEFLAGS_KEY)) {
+ if (rc->frames_to_key <= 0 || (frame_flags & FRAMEFLAGS_KEY)) {
+ assert(rc->frames_to_key >= -1);
FIRSTPASS_STATS this_frame_copy;
this_frame_copy = this_frame;
frame_params->frame_type = KEY_FRAME;