Applying q_trans[] inside set_encoder_config().
Change-Id: Ib64edeb58b3e25488fb85bbe85c9decb15b4d0a1
This commit is contained in:
parent
c27bdb9bc1
commit
5db5154029
@ -821,10 +821,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
|
||||
|
@ -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),
|
||||
|
@ -313,9 +313,9 @@ static vpx_codec_err_t set_encoder_config(VP9_CONFIG *oxcf,
|
||||
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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user