summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--vp8/common/onyxc_int.h3
-rw-r--r--vp8/encoder/firstpass.c2
-rw-r--r--vp8/encoder/onyx_if.c18
-rw-r--r--vp8/encoder/onyx_int.h2
-rw-r--r--vp8/encoder/ratectrl.c6
-rw-r--r--vp9/common/vp9_onyxc_int.h3
-rw-r--r--vp9/encoder/vp9_mbgraph.c4
-rw-r--r--vp9/encoder/vp9_onyx_if.c14
-rw-r--r--vp9/encoder/vp9_onyx_int.h2
9 files changed, 26 insertions, 28 deletions
diff --git a/vp8/common/onyxc_int.h b/vp8/common/onyxc_int.h
index a0c97a113..e9bb7af26 100644
--- a/vp8/common/onyxc_int.h
+++ b/vp8/common/onyxc_int.h
@@ -114,9 +114,6 @@ typedef struct VP8Common
int uvdc_delta_q;
int uvac_delta_q;
- unsigned int frames_since_golden;
- unsigned int frames_till_alt_ref_frame;
-
/* We allocate a MODE_INFO struct for each macroblock, together with
an extra row on top and column on the left to simplify prediction. */
diff --git a/vp8/encoder/firstpass.c b/vp8/encoder/firstpass.c
index 4eac3b661..ded0c435d 100644
--- a/vp8/encoder/firstpass.c
+++ b/vp8/encoder/firstpass.c
@@ -2398,7 +2398,7 @@ static void assign_std_frame_bits(VP8_COMP *cpi, FIRSTPASS_STATS *this_frame)
target_frame_size += cpi->min_frame_bandwidth;
/* Every other frame gets a few extra bits */
- if ( (cpi->common.frames_since_golden & 0x01) &&
+ if ( (cpi->frames_since_golden & 0x01) &&
(cpi->frames_till_gf_update_due > 0) )
{
target_frame_size += cpi->twopass.alt_extra_bits;
diff --git a/vp8/encoder/onyx_if.c b/vp8/encoder/onyx_if.c
index c73060f8e..7c0797599 100644
--- a/vp8/encoder/onyx_if.c
+++ b/vp8/encoder/onyx_if.c
@@ -2750,7 +2750,7 @@ static void update_alt_ref_frame_stats(VP8_COMP *cpi)
cpi->gf_active_count = cm->mb_rows * cm->mb_cols;
/* this frame refreshes means next frames don't unless specified by user */
- cpi->common.frames_since_golden = 0;
+ cpi->frames_since_golden = 0;
/* Clear the alternate reference update pending flag. */
cpi->source_alt_ref_pending = 0;
@@ -2802,7 +2802,7 @@ static void update_golden_frame_stats(VP8_COMP *cpi)
* user
*/
cm->refresh_golden_frame = 0;
- cpi->common.frames_since_golden = 0;
+ cpi->frames_since_golden = 0;
cpi->recent_ref_frame_usage[INTRA_FRAME] = 1;
cpi->recent_ref_frame_usage[LAST_FRAME] = 1;
@@ -2834,12 +2834,12 @@ static void update_golden_frame_stats(VP8_COMP *cpi)
if (cpi->frames_till_gf_update_due > 0)
cpi->frames_till_gf_update_due--;
- if (cpi->common.frames_till_alt_ref_frame)
- cpi->common.frames_till_alt_ref_frame --;
+ if (cpi->frames_till_alt_ref_frame)
+ cpi->frames_till_alt_ref_frame --;
- cpi->common.frames_since_golden ++;
+ cpi->frames_since_golden ++;
- if (cpi->common.frames_since_golden > 1)
+ if (cpi->frames_since_golden > 1)
{
cpi->recent_ref_frame_usage[INTRA_FRAME] +=
cpi->mb.count_mb_ref_frame_usage[INTRA_FRAME];
@@ -2890,11 +2890,11 @@ static void update_rd_ref_frame_probs(VP8_COMP *cpi)
cpi->prob_last_coded = 200;
cpi->prob_gf_coded = 1;
}
- else if (cpi->common.frames_since_golden == 0)
+ else if (cpi->frames_since_golden == 0)
{
cpi->prob_last_coded = 214;
}
- else if (cpi->common.frames_since_golden == 1)
+ else if (cpi->frames_since_golden == 1)
{
cpi->prob_last_coded = 192;
cpi->prob_gf_coded = 220;
@@ -4934,7 +4934,7 @@ int vp8_get_compressed_data(VP8_COMP *cpi, unsigned int *frame_flags, unsigned l
cpi->frames_till_gf_update_due);
force_src_buffer = &cpi->alt_ref_buffer;
}
- cm->frames_till_alt_ref_frame = cpi->frames_till_gf_update_due;
+ cpi->frames_till_alt_ref_frame = cpi->frames_till_gf_update_due;
cm->refresh_alt_ref_frame = 1;
cm->refresh_golden_frame = 0;
cm->refresh_last_frame = 0;
diff --git a/vp8/encoder/onyx_int.h b/vp8/encoder/onyx_int.h
index f49cfe39c..3ab0fe8bf 100644
--- a/vp8/encoder/onyx_int.h
+++ b/vp8/encoder/onyx_int.h
@@ -320,6 +320,7 @@ typedef struct VP8_COMP
YV12_BUFFER_CONFIG scaled_source;
YV12_BUFFER_CONFIG *last_frame_unscaled_source;
+ unsigned int frames_till_alt_ref_frame;
/* frame in src_buffers has been identified to be encoded as an alt ref */
int source_alt_ref_pending;
/* an alt ref frame has been encoded and is usable */
@@ -369,6 +370,7 @@ typedef struct VP8_COMP
double key_frame_rate_correction_factor;
double gf_rate_correction_factor;
+ unsigned int frames_since_golden;
/* Count down till next GF */
int frames_till_gf_update_due;
diff --git a/vp8/encoder/ratectrl.c b/vp8/encoder/ratectrl.c
index fd71b9aa1..1e8259cf4 100644
--- a/vp8/encoder/ratectrl.c
+++ b/vp8/encoder/ratectrl.c
@@ -234,7 +234,7 @@ void vp8_save_coding_context(VP8_COMP *cpi)
cc->frames_since_key = cpi->frames_since_key;
cc->filter_level = cpi->common.filter_level;
cc->frames_till_gf_update_due = cpi->frames_till_gf_update_due;
- cc->frames_since_golden = cpi->common.frames_since_golden;
+ cc->frames_since_golden = cpi->frames_since_golden;
vp8_copy(cc->mvc, cpi->common.fc.mvc);
vp8_copy(cc->mvcosts, cpi->rd_costs.mvcosts);
@@ -271,7 +271,7 @@ void vp8_restore_coding_context(VP8_COMP *cpi)
cpi->frames_since_key = cc->frames_since_key;
cpi->common.filter_level = cc->filter_level;
cpi->frames_till_gf_update_due = cc->frames_till_gf_update_due;
- cpi->common.frames_since_golden = cc->frames_since_golden;
+ cpi->frames_since_golden = cc->frames_since_golden;
vp8_copy(cpi->common.fc.mvc, cc->mvc);
@@ -715,7 +715,7 @@ static void calc_pframe_target_size(VP8_COMP *cpi)
if (Adjustment > (cpi->this_frame_target - min_frame_target))
Adjustment = (cpi->this_frame_target - min_frame_target);
- if (cpi->common.frames_since_golden == (cpi->current_gf_interval >> 1))
+ if (cpi->frames_since_golden == (cpi->current_gf_interval >> 1))
cpi->this_frame_target += ((cpi->current_gf_interval - 1) * Adjustment);
else
cpi->this_frame_target -= Adjustment;
diff --git a/vp9/common/vp9_onyxc_int.h b/vp9/common/vp9_onyxc_int.h
index 8d5743bf8..8ee2e2730 100644
--- a/vp9/common/vp9_onyxc_int.h
+++ b/vp9/common/vp9_onyxc_int.h
@@ -192,9 +192,6 @@ typedef struct VP9Common {
int a_ac_delta_q;
#endif
- unsigned int frames_since_golden;
- unsigned int frames_till_alt_ref_frame;
-
/* We allocate a MODE_INFO struct for each macroblock, together with
an extra row on top and column on the left to simplify prediction. */
diff --git a/vp9/encoder/vp9_mbgraph.c b/vp9/encoder/vp9_mbgraph.c
index 9637393f2..7d6db071d 100644
--- a/vp9/encoder/vp9_mbgraph.c
+++ b/vp9/encoder/vp9_mbgraph.c
@@ -406,8 +406,8 @@ void vp9_update_mbgraph_stats(VP9_COMP *cpi) {
// being a GF - so exit if we don't look ahead beyond that
if (n_frames <= cpi->frames_till_gf_update_due)
return;
- if (n_frames > (int)cpi->common.frames_till_alt_ref_frame)
- n_frames = cpi->common.frames_till_alt_ref_frame;
+ if (n_frames > (int)cpi->frames_till_alt_ref_frame)
+ n_frames = cpi->frames_till_alt_ref_frame;
if (n_frames > MAX_LAG_BUFFERS)
n_frames = MAX_LAG_BUFFERS;
diff --git a/vp9/encoder/vp9_onyx_if.c b/vp9/encoder/vp9_onyx_if.c
index 500bdfe0a..a8e0d6768 100644
--- a/vp9/encoder/vp9_onyx_if.c
+++ b/vp9/encoder/vp9_onyx_if.c
@@ -351,7 +351,7 @@ static void configure_static_seg_features(VP9_COMP *cpi) {
// All other frames if segmentation has been enabled
// First normal frame in a valid gf or alt ref group
- if (cpi->common.frames_since_golden == 0) {
+ if (cpi->frames_since_golden == 0) {
// Set up segment features for normal frames in an arf group
if (cpi->source_alt_ref_active) {
xd->seg.update_map = 0;
@@ -2151,7 +2151,7 @@ static void scale_and_extend_frame(YV12_BUFFER_CONFIG *src_fb,
static void update_alt_ref_frame_stats(VP9_COMP *cpi) {
// this frame refreshes means next frames don't unless specified by user
- cpi->common.frames_since_golden = 0;
+ cpi->frames_since_golden = 0;
#if CONFIG_MULTIPLE_ARF
if (!cpi->multi_arf_enabled)
@@ -2167,7 +2167,7 @@ static void update_golden_frame_stats(VP9_COMP *cpi) {
if (cpi->refresh_golden_frame) {
// this frame refreshes means next frames don't unless specified by user
cpi->refresh_golden_frame = 0;
- cpi->common.frames_since_golden = 0;
+ cpi->frames_since_golden = 0;
// ******** Fixed Q test code only ************
// If we are going to use the ALT reference for the next group of frames set a flag to say so.
@@ -2189,10 +2189,10 @@ static void update_golden_frame_stats(VP9_COMP *cpi) {
if (cpi->frames_till_gf_update_due > 0)
cpi->frames_till_gf_update_due--;
- if (cpi->common.frames_till_alt_ref_frame)
- cpi->common.frames_till_alt_ref_frame--;
+ if (cpi->frames_till_alt_ref_frame)
+ cpi->frames_till_alt_ref_frame--;
- cpi->common.frames_since_golden++;
+ cpi->frames_since_golden++;
}
}
@@ -3596,7 +3596,7 @@ int vp9_get_compressed_data(VP9_PTR ptr, unsigned int *frame_flags,
cpi->is_src_frame_alt_ref = 0;
// TODO(agrange) This needs to vary depending on where the next ARF is.
- cm->frames_till_alt_ref_frame = frames_to_arf;
+ cpi->frames_till_alt_ref_frame = frames_to_arf;
#if CONFIG_MULTIPLE_ARF
if (!cpi->multi_arf_enabled)
diff --git a/vp9/encoder/vp9_onyx_int.h b/vp9/encoder/vp9_onyx_int.h
index 19b1e3af5..6c5248ff2 100644
--- a/vp9/encoder/vp9_onyx_int.h
+++ b/vp9/encoder/vp9_onyx_int.h
@@ -313,6 +313,7 @@ typedef struct VP9_COMP {
YV12_BUFFER_CONFIG *un_scaled_source;
YV12_BUFFER_CONFIG scaled_source;
+ unsigned int frames_till_alt_ref_frame;
int source_alt_ref_pending; // frame in src_buffers has been identified to be encoded as an alt ref
int source_alt_ref_active; // an alt ref frame has been encoded and is usable
@@ -395,6 +396,7 @@ typedef struct VP9_COMP {
double key_frame_rate_correction_factor;
double gf_rate_correction_factor;
+ unsigned int frames_since_golden;
int frames_till_gf_update_due; // Count down till next GF
int gf_overspend_bits; // Total bits overspent becasue of GF boost (cumulative)