summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Grange <agrange@google.com>2014-04-24 07:44:41 -0700
committerGerrit Code Review <gerrit@gerrit.golo.chromium.org>2014-04-24 07:44:41 -0700
commit025969d910c39ad43b95447efa2fdd46a335276a (patch)
treefc5bc0220250029975899443cba8a93d17018d87
parent910136320ca136c17bfe57686c3073475416bbad (diff)
parent086ae992356b091f555479d41fe23ec34307620f (diff)
downloadlibvpx-025969d910c39ad43b95447efa2fdd46a335276a.tar
libvpx-025969d910c39ad43b95447efa2fdd46a335276a.tar.gz
libvpx-025969d910c39ad43b95447efa2fdd46a335276a.tar.bz2
libvpx-025969d910c39ad43b95447efa2fdd46a335276a.zip
Merge "Fixed handling of regularly placed keyframes"
-rw-r--r--vp9/encoder/vp9_firstpass.c6
-rw-r--r--vp9/vp9_cx_iface.c2
2 files changed, 5 insertions, 3 deletions
diff --git a/vp9/encoder/vp9_firstpass.c b/vp9/encoder/vp9_firstpass.c
index 314f8ab84..1879b15e2 100644
--- a/vp9/encoder/vp9_firstpass.c
+++ b/vp9/encoder/vp9_firstpass.c
@@ -1935,7 +1935,8 @@ static void find_next_key_frame(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) {
// Find the next keyframe.
i = 0;
- while (twopass->stats_in < twopass->stats_in_end) {
+ while (twopass->stats_in < twopass->stats_in_end &&
+ rc->frames_to_key < cpi->key_frame_frequency) {
// Accumulate kf group error.
kf_group_err += calculate_modified_err(cpi, this_frame);
@@ -2003,7 +2004,8 @@ static void find_next_key_frame(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) {
input_stats(twopass, &tmp_frame);
}
rc->next_key_frame_forced = 1;
- } else if (twopass->stats_in == twopass->stats_in_end) {
+ } else if (twopass->stats_in == twopass->stats_in_end ||
+ rc->frames_to_key >= cpi->key_frame_frequency) {
rc->next_key_frame_forced = 1;
} else {
rc->next_key_frame_forced = 0;
diff --git a/vp9/vp9_cx_iface.c b/vp9/vp9_cx_iface.c
index 1d82b1955..1ca9fb93a 100644
--- a/vp9/vp9_cx_iface.c
+++ b/vp9/vp9_cx_iface.c
@@ -185,7 +185,7 @@ static vpx_codec_err_t validate_config(vpx_codec_alg_priv_t *ctx,
ERROR("ts_rate_decimator factors are not powers of 2");
}
- // VP8 does not support a lower bound on the keyframe interval in
+ // VP9 does not support a lower bound on the keyframe interval in
// automatic keyframe placement mode.
if (cfg->kf_mode != VPX_KF_DISABLED &&
cfg->kf_min_dist != cfg->kf_max_dist &&