shithub: libvpx

Download patch

ref: bd53f0cc9faefbca2dcb6b21b6849d5e24141c9c
parent: eebc5cd487a89c51ba148f6d6ac45779970f72d7
author: Jerome Jiang <jianj@google.com>
date: Thu Jun 24 09:13:50 EDT 2021

Add constructor to VP9RateControlRtcConfig

Also add max_inter_bitrate_pct

Change-Id: Ie2c0e7f1397ca0bb55214251906412cdf24e42e2

--- a/vp9/ratectrl_rtc.cc
+++ b/vp9/ratectrl_rtc.cc
@@ -90,6 +90,7 @@
       (rc_cfg.ts_number_layers > 1) ? rc_cfg.ts_number_layers : 0);
 
   cpi_->oxcf.rc_max_intra_bitrate_pct = rc_cfg.max_intra_bitrate_pct;
+  cpi_->oxcf.rc_max_inter_bitrate_pct = rc_cfg.max_inter_bitrate_pct;
   cpi_->framerate = rc_cfg.framerate;
   cpi_->svc.number_spatial_layers = rc_cfg.ss_number_layers;
   cpi_->svc.number_temporal_layers = rc_cfg.ts_number_layers;
--- a/vp9/ratectrl_rtc.h
+++ b/vp9/ratectrl_rtc.h
@@ -26,6 +26,36 @@
 namespace libvpx {
 
 struct VP9RateControlRtcConfig {
+ public:
+  VP9RateControlRtcConfig() {
+    width = 1280;
+    height = 720;
+    max_quantizer = 63;
+    min_quantizer = 2;
+    target_bandwidth = 1000;
+    buf_initial_sz = 600;
+    buf_optimal_sz = 600;
+    buf_sz = 1000;
+    undershoot_pct = overshoot_pct = 50;
+    max_intra_bitrate_pct = 50;
+    max_inter_bitrate_pct = 0;
+    framerate = 30.0;
+    ss_number_layers = ts_number_layers = 1;
+    rc_mode = VPX_CBR;
+    vp9_zero(max_quantizers);
+    vp9_zero(min_quantizers);
+    vp9_zero(scaling_factor_den);
+    vp9_zero(scaling_factor_num);
+    vp9_zero(layer_target_bitrate);
+    vp9_zero(ts_rate_decimator);
+    scaling_factor_num[0] = 1;
+    scaling_factor_den[0] = 1;
+    layer_target_bitrate[0] = target_bandwidth;
+    max_quantizers[0] = max_quantizer;
+    min_quantizers[0] = min_quantizer;
+    ts_rate_decimator[0] = 1;
+  }
+
   int width;
   int height;
   // 0-63
@@ -38,6 +68,7 @@
   int undershoot_pct;
   int overshoot_pct;
   int max_intra_bitrate_pct;
+  int max_inter_bitrate_pct;
   double framerate;
   // Number of spatial layers
   int ss_number_layers;