ref: 5db5154029071b9c611432db246ade4d507d15b5
parent: c27bdb9bc1d8313daee99e46955361544109192f
author: Dmitry Kovalev <dkovalev@google.com>
date: Tue Apr 8 15:43:08 EDT 2014
Applying q_trans[] inside set_encoder_config(). Change-Id: Ib64edeb58b3e25488fb85bbe85c9decb15b4d0a1
--- a/vp9/encoder/vp9_onyx_if.c
+++ b/vp9/encoder/vp9_onyx_if.c
@@ -821,10 +821,6 @@
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
--- a/vp9/encoder/vp9_svc_layercontext.c
+++ b/vp9/encoder/vp9_svc_layercontext.c
@@ -32,8 +32,8 @@
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 @@
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),
--- a/vp9/vp9_cx_iface.c
+++ b/vp9/vp9_cx_iface.c
@@ -313,9 +313,9 @@
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;
--
⑨