ref: 1aa2d1a44409dfb6e02f1a5fe8f0f0a04fbcdc9f
parent: 109f58acfd8d46deec1e0bd4d0f82daa36cd6b8e
author: Adrian Grange <agrange@google.com>
date: Wed Apr 23 07:11:23 EDT 2014
Remove key_frame_frequency variable from VP9_COMP This member of VP9_COMP seemed unnecessary since it only shadowed VP9EncoderConfig.key_freq that is accessible through VP9_COMP. Change-Id: Ib751bb1cf1b0b3c50a2a527d7c34f6829dd6fee3
--- a/vp9/encoder/vp9_encoder.c
+++ b/vp9/encoder/vp9_encoder.c
@@ -829,7 +829,6 @@
sizeof(*cpi->mbgraph_stats[i].mb_stats), 1));
}
- cpi->key_frame_frequency = cpi->oxcf.key_freq;
cpi->refresh_alt_ref_frame = 0;
#if CONFIG_MULTIPLE_ARF
--- a/vp9/encoder/vp9_encoder.h
+++ b/vp9/encoder/vp9_encoder.h
@@ -337,8 +337,6 @@
YV12_BUFFER_CONFIG *unscaled_last_source;
YV12_BUFFER_CONFIG scaled_last_source;
- int key_frame_frequency;
-
int gold_is_last; // gold same as last frame ( short circuit gold searches)
int alt_is_last; // Alt same as last ( short circuit altref search)
int gold_is_alt; // don't do both alt and gold search ( just do gold).
--- a/vp9/encoder/vp9_firstpass.c
+++ b/vp9/encoder/vp9_firstpass.c
@@ -1936,7 +1936,7 @@
// Find the next keyframe.
i = 0;
while (twopass->stats_in < twopass->stats_in_end &&
- rc->frames_to_key < cpi->key_frame_frequency) {
+ rc->frames_to_key < cpi->oxcf.key_freq) {
// Accumulate kf group error.
kf_group_err += calculate_modified_err(cpi, this_frame);
@@ -1966,7 +1966,7 @@
// Special check for transition or high motion followed by a
// static scene.
- if (detect_transition_to_still(twopass, i, cpi->key_frame_frequency - i,
+ if (detect_transition_to_still(twopass, i, cpi->oxcf.key_freq - i,
loop_decay_rate, decay_accumulator))
break;
@@ -1974,8 +1974,8 @@
++rc->frames_to_key;
// If we don't have a real key frame within the next two
- // key_frame_frequency intervals then break out of the loop.
- if (rc->frames_to_key >= 2 * (int)cpi->key_frame_frequency)
+ // key_freq intervals then break out of the loop.
+ if (rc->frames_to_key >= 2 * cpi->oxcf.key_freq)
break;
} else {
++rc->frames_to_key;
@@ -1988,7 +1988,7 @@
// This code centers the extra kf if the actual natural interval
// is between 1x and 2x.
if (cpi->oxcf.auto_key &&
- rc->frames_to_key > (int)cpi->key_frame_frequency) {
+ rc->frames_to_key > cpi->oxcf.key_freq) {
FIRSTPASS_STATS tmp_frame = first_frame;
rc->frames_to_key /= 2;
@@ -2005,7 +2005,7 @@
}
rc->next_key_frame_forced = 1;
} else if (twopass->stats_in == twopass->stats_in_end ||
- rc->frames_to_key >= cpi->key_frame_frequency) {
+ rc->frames_to_key >= cpi->oxcf.key_freq) {
rc->next_key_frame_forced = 1;
} else {
rc->next_key_frame_forced = 0;
--- a/vp9/encoder/vp9_ratectrl.c
+++ b/vp9/encoder/vp9_ratectrl.c
@@ -1215,7 +1215,7 @@
cm->frame_type = KEY_FRAME;
rc->this_key_frame_forced = cm->current_video_frame != 0 &&
rc->frames_to_key == 0;
- rc->frames_to_key = cpi->key_frame_frequency;
+ rc->frames_to_key = cpi->oxcf.key_freq;
rc->kf_boost = DEFAULT_KF_BOOST;
rc->source_alt_ref_active = 0;
} else {
@@ -1302,7 +1302,7 @@
if ((cm->current_video_frame == 0) ||
(cpi->frame_flags & FRAMEFLAGS_KEY) ||
(cpi->oxcf.auto_key && (rc->frames_since_key %
- cpi->key_frame_frequency == 0))) {
+ cpi->oxcf.key_freq == 0))) {
cm->frame_type = KEY_FRAME;
rc->source_alt_ref_active = 0;
if (cpi->pass == 0 && cpi->oxcf.rc_mode == RC_MODE_CBR) {
@@ -1330,7 +1330,7 @@
cm->frame_type = KEY_FRAME;
rc->this_key_frame_forced = cm->current_video_frame != 0 &&
rc->frames_to_key == 0;
- rc->frames_to_key = cpi->key_frame_frequency;
+ rc->frames_to_key = cpi->oxcf.key_freq;
rc->kf_boost = DEFAULT_KF_BOOST;
rc->source_alt_ref_active = 0;
target = calc_iframe_target_size_one_pass_cbr(cpi);
@@ -1415,7 +1415,7 @@
rc->max_gf_interval = 16;
// Extended interval for genuinely static scenes
- rc->static_scene_max_gf_interval = cpi->key_frame_frequency >> 1;
+ rc->static_scene_max_gf_interval = cpi->oxcf.key_freq >> 1;
// Special conditions when alt ref frame enabled in lagged compress mode
if (oxcf->play_alternate && oxcf->lag_in_frames) {
--- a/vp9/encoder/vp9_svc_layercontext.c
+++ b/vp9/encoder/vp9_svc_layercontext.c
@@ -153,7 +153,7 @@
oxcf->two_pass_vbrmax_section) / 100);
lrc->max_gf_interval = 16;
- lrc->static_scene_max_gf_interval = cpi->key_frame_frequency >> 1;
+ lrc->static_scene_max_gf_interval = cpi->oxcf.key_freq >> 1;
if (oxcf->play_alternate && oxcf->lag_in_frames) {
if (lrc->max_gf_interval > oxcf->lag_in_frames - 1)
--
⑨