Commit e590e087 authored by Marco Paniconi's avatar Marco Paniconi
Browse files

Fix target frame size setting, for 1pass cbr.

Only use layered average size if number_temporal_layers > 1.

Also removed unneeded commented-out line, and change some parameter
setting in vpx_temporal_scalable_patterns.c

Change-Id: Ic86e43e7daf0313e8c5a4aba1497299158111955
parent e25fbed4
......@@ -502,8 +502,8 @@ int main(int argc, char **argv) {
cfg.rc_resize_allowed = 0;
cfg.rc_min_quantizer = 2;
cfg.rc_max_quantizer = 56;
cfg.rc_undershoot_pct = 100;
cfg.rc_overshoot_pct = 15;
cfg.rc_undershoot_pct = 50;
cfg.rc_overshoot_pct = 50;
cfg.rc_buf_initial_sz = 500;
cfg.rc_buf_optimal_sz = 600;
cfg.rc_buf_sz = 1000;
......
......@@ -499,8 +499,6 @@ static int calc_active_worst_quality_one_pass_cbr(const VP9_COMP *cpi) {
// (at buffer = critical level).
const VP9_CONFIG *oxcf = &cpi->oxcf;
const RATE_CONTROL *rc = &cpi->rc;
// int active_worst_quality = rc->active_worst_quality;
// Maximum limit for down adjustment, ~20%.
// Buffer level below which we push active_worst to worst_quality.
int critical_level = oxcf->optimal_buffer_level >> 2;
int adjustment = 0;
......@@ -516,6 +514,7 @@ static int calc_active_worst_quality_one_pass_cbr(const VP9_COMP *cpi) {
rc->avg_frame_qindex[KEY_FRAME] * 3 / 2);
if (rc->buffer_level > oxcf->optimal_buffer_level) {
// Adjust down.
// Maximum limit for down adjustment, ~30%.
int max_adjustment_down = active_worst_quality / 3;
if (max_adjustment_down) {
buff_lvl_step = (int)((oxcf->maximum_buffer_size -
......@@ -1314,7 +1313,8 @@ static int calc_pframe_target_size_one_pass_cbr(const VP9_COMP *cpi) {
int min_frame_target = MAX(rc->av_per_frame_bandwidth >> 4,
FRAME_OVERHEAD_BITS);
int target = rc->av_per_frame_bandwidth;
if (cpi->use_svc && cpi->oxcf.end_usage == USAGE_STREAM_FROM_SERVER) {
if (cpi->svc.number_temporal_layers > 1 &&
cpi->oxcf.end_usage == USAGE_STREAM_FROM_SERVER) {
// Note that for layers, av_per_frame_bandwidth is the cumulative
// per-frame-bandwidth. For the target size of this frame, use the
// layer average frame size (i.e., non-cumulative per-frame-bw).
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment