cpi->oxcf.maximum_buffer_size = 240000;
}
- // Convert target bandwidth from Kbit/s to Bit/s
- cpi->oxcf.target_bandwidth *= 1000;
-
cpi->oxcf.starting_buffer_level =
vp9_rescale(cpi->oxcf.starting_buffer_level,
cpi->oxcf.target_bandwidth, 1000);
lrc->key_frame_rate_correction_factor = 1.0;
if (svc->number_temporal_layers > 1) {
- lc->target_bandwidth = oxcf->ts_target_bitrate[layer] * 1000;
+ lc->target_bandwidth = oxcf->ts_target_bitrate[layer];
lrc->last_q[INTER_FRAME] = oxcf->worst_allowed_q;
} else {
- lc->target_bandwidth = oxcf->ss_target_bitrate[layer] * 1000;
+ 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;
RATE_CONTROL *const lrc = &lc->rc;
if (svc->number_temporal_layers > 1) {
- lc->target_bandwidth = oxcf->ts_target_bitrate[layer] * 1000;
+ lc->target_bandwidth = oxcf->ts_target_bitrate[layer];
} else {
- lc->target_bandwidth = oxcf->ss_target_bitrate[layer] * 1000;
+ lc->target_bandwidth = oxcf->ss_target_bitrate[layer];
}
bitrate_alloc = (float)lc->target_bandwidth / target_bandwidth;
// Update buffer-related quantities.
} else {
const double prev_layer_framerate =
oxcf->framerate / oxcf->ts_rate_decimator[layer - 1];
- const int prev_layer_target_bandwidth =
- oxcf->ts_target_bitrate[layer - 1] * 1000;
+ const int prev_layer_target_bandwidth = oxcf->ts_target_bitrate[layer - 1];
lc->avg_frame_size =
(int)((lc->target_bandwidth - prev_layer_target_bandwidth) /
(lc->framerate - prev_layer_framerate));
else if (cfg->rc_end_usage == VPX_CBR)
oxcf->rc_mode = RC_MODE_CBR;
- oxcf->target_bandwidth = cfg->rc_target_bitrate;
+ // Convert target bandwidth from Kbit/s to Bit/s
+ oxcf->target_bandwidth = 1000 * cfg->rc_target_bitrate;
oxcf->rc_max_intra_bitrate_pct = extra_cfg->rc_max_intra_bitrate_pct;
oxcf->best_allowed_q = vp9_quantizer_to_qindex(cfg->rc_min_quantizer);
oxcf->ss_number_layers = cfg->ss_number_layers;
if (oxcf->ss_number_layers > 1) {
- vp9_copy(oxcf->ss_target_bitrate, cfg->ss_target_bitrate);
+ int i;
+ for (i = 0; i < VPX_SS_MAX_LAYERS; ++i)
+ oxcf->ss_target_bitrate[i] = 1000 * cfg->ss_target_bitrate[i];
} else if (oxcf->ss_number_layers == 1) {
oxcf->ss_target_bitrate[0] = (int)oxcf->target_bandwidth;
}
oxcf->ts_number_layers = cfg->ts_number_layers;
if (oxcf->ts_number_layers > 1) {
- vp9_copy(oxcf->ts_target_bitrate, cfg->ts_target_bitrate);
- vp9_copy(oxcf->ts_rate_decimator, cfg->ts_rate_decimator);
+ int i;
+ for (i = 0; i < VPX_TS_MAX_LAYERS; ++i) {
+ oxcf->ts_target_bitrate[i] = 1000 * cfg->ts_target_bitrate[i];
+ oxcf->ts_rate_decimator[i] = cfg->ts_rate_decimator[i];
+ }
} else if (oxcf->ts_number_layers == 1) {
oxcf->ts_target_bitrate[0] = (int)oxcf->target_bandwidth;
oxcf->ts_rate_decimator[0] = 1;