Merge "Using 2 instead of 3 elements for last_q array."

This commit is contained in:
Dmitry Kovalev 2014-05-28 10:57:40 -07:00 committed by Gerrit Code Review
commit 39b9731876
3 changed files with 5 additions and 8 deletions

View File

@ -200,9 +200,8 @@ void vp9_rc_init(const VP9EncoderConfig *oxcf, int pass, RATE_CONTROL *rc) {
oxcf->best_allowed_q) / 2;
}
rc->last_q[0] = oxcf->best_allowed_q;
rc->last_q[1] = oxcf->best_allowed_q;
rc->last_q[2] = oxcf->best_allowed_q;
rc->last_q[KEY_FRAME] = oxcf->best_allowed_q;
rc->last_q[INTER_FRAME] = oxcf->best_allowed_q;
rc->buffer_level = oxcf->starting_buffer_level;
rc->bits_off_target = oxcf->starting_buffer_level;
@ -1090,7 +1089,6 @@ void vp9_rc_postencode_update(VP9_COMP *cpi, uint64_t bytes_used) {
} else if (!rc->is_src_frame_alt_ref &&
(cpi->refresh_golden_frame || cpi->refresh_alt_ref_frame) &&
!(cpi->use_svc && oxcf->rc_mode == RC_MODE_CBR)) {
rc->last_q[2] = qindex;
rc->avg_frame_qindex[2] =
ROUND_POWER_OF_TWO(3 * rc->avg_frame_qindex[2] + qindex, 2);
} else {

View File

@ -30,7 +30,7 @@ typedef struct {
int this_frame_target; // Actual frame target after rc adjustment.
int projected_frame_size;
int sb64_target_rate;
int last_q[3]; // Separate values for Intra/Inter/ARF-GF
int last_q[FRAME_TYPES]; // Separate values for Intra/Inter
int last_boosted_qindex; // Last boosted GF/KF/ARF q
int gfu_boost;

View File

@ -50,9 +50,8 @@ void vp9_init_layer_context(VP9_COMP *const cpi) {
lrc->last_q[INTER_FRAME] = oxcf->worst_allowed_q;
} else {
lc->target_bandwidth = oxcf->ss_target_bitrate[layer];
lrc->last_q[0] = oxcf->best_allowed_q;
lrc->last_q[1] = oxcf->best_allowed_q;
lrc->last_q[2] = oxcf->best_allowed_q;
lrc->last_q[KEY_FRAME] = oxcf->best_allowed_q;
lrc->last_q[INTER_FRAME] = oxcf->best_allowed_q;
}
lrc->buffer_level = vp9_rescale((int)(oxcf->starting_buffer_level),