Merge "Applying q_trans[] inside set_encoder_config()."

This commit is contained in:
Dmitry Kovalev 2014-04-09 10:25:59 -07:00 committed by Gerrit Code Review
commit a30ff3458d
3 changed files with 9 additions and 13 deletions

View File

@ -828,10 +828,6 @@ void vp9_change_config(struct VP9_COMP *cpi, const VP9_CONFIG *oxcf) {
break;
}
cpi->oxcf.worst_allowed_q = q_trans[oxcf->worst_allowed_q];
cpi->oxcf.best_allowed_q = q_trans[oxcf->best_allowed_q];
cpi->oxcf.cq_level = q_trans[cpi->oxcf.cq_level];
cpi->oxcf.lossless = oxcf->lossless;
if (cpi->oxcf.lossless) {
// In lossless mode, make sure right quantizer range and correct transform

View File

@ -32,8 +32,8 @@ void vp9_init_layer_context(VP9_COMP *const cpi) {
LAYER_CONTEXT *const lc = &svc->layer_context[layer];
RATE_CONTROL *const lrc = &lc->rc;
lc->current_video_frame_in_layer = 0;
lrc->avg_frame_qindex[INTER_FRAME] = q_trans[oxcf->worst_allowed_q];
lrc->ni_av_qi = q_trans[oxcf->worst_allowed_q];
lrc->avg_frame_qindex[INTER_FRAME] = oxcf->worst_allowed_q;
lrc->ni_av_qi = oxcf->worst_allowed_q;
lrc->total_actual_bits = 0;
lrc->total_target_vs_actual = 0;
lrc->ni_tot_qi = 0;
@ -47,12 +47,12 @@ void vp9_init_layer_context(VP9_COMP *const cpi) {
if (svc->number_temporal_layers > 1) {
lc->target_bandwidth = oxcf->ts_target_bitrate[layer] * 1000;
lrc->last_q[INTER_FRAME] = q_trans[oxcf->worst_allowed_q];
lrc->last_q[INTER_FRAME] = oxcf->worst_allowed_q;
} else {
lc->target_bandwidth = oxcf->ss_target_bitrate[layer] * 1000;
lrc->last_q[0] = q_trans[oxcf->best_allowed_q];
lrc->last_q[1] = q_trans[oxcf->best_allowed_q];
lrc->last_q[2] = q_trans[oxcf->best_allowed_q];
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->buffer_level = vp9_rescale((int)(oxcf->starting_buffer_level),

View File

@ -324,9 +324,9 @@ static vpx_codec_err_t set_encoder_config(
oxcf->target_bandwidth = cfg->rc_target_bitrate;
oxcf->rc_max_intra_bitrate_pct = extra_cfg->rc_max_intra_bitrate_pct;
oxcf->best_allowed_q = cfg->rc_min_quantizer;
oxcf->worst_allowed_q = cfg->rc_max_quantizer;
oxcf->cq_level = extra_cfg->cq_level;
oxcf->best_allowed_q = q_trans[cfg->rc_min_quantizer];
oxcf->worst_allowed_q = q_trans[cfg->rc_max_quantizer];
oxcf->cq_level = q_trans[extra_cfg->cq_level];
oxcf->fixed_q = -1;
oxcf->under_shoot_pct = cfg->rc_undershoot_pct;