]> granicus.if.org Git - libvpx/commitdiff
Fix target frame size setting, for 1pass cbr.
authorMarco Paniconi <marpan@google.com>
Thu, 13 Feb 2014 22:02:15 +0000 (14:02 -0800)
committerMarco Paniconi <marpan@google.com>
Thu, 13 Feb 2014 23:21:09 +0000 (15:21 -0800)
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

examples/vpx_temporal_scalable_patterns.c
vp9/encoder/vp9_ratectrl.c

index 464273cea3e094c8eaaa67859c70854634b30e07..28bb7ff4dfcee3da25bf7e1b6430f38c4528ebc1 100644 (file)
@@ -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;
index 2427dbe744bf6285089bad11d2edc2757d1133b3..bc2c3a69a56173af7ac255e6eb4e7c9dd5c4daca 100644 (file)
@@ -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).