From: Jerome Jiang Date: Thu, 24 Jun 2021 20:13:50 +0000 (-0700) Subject: Add constructor to VP9RateControlRtcConfig X-Git-Tag: v1.11.0-rc1~22 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bd53f0cc9faefbca2dcb6b21b6849d5e24141c9c;p=libvpx Add constructor to VP9RateControlRtcConfig Also add max_inter_bitrate_pct Change-Id: Ie2c0e7f1397ca0bb55214251906412cdf24e42e2 --- diff --git a/vp9/ratectrl_rtc.cc b/vp9/ratectrl_rtc.cc index 2595a2bc0..b38a0db9c 100644 --- a/vp9/ratectrl_rtc.cc +++ b/vp9/ratectrl_rtc.cc @@ -90,6 +90,7 @@ void VP9RateControlRTC::UpdateRateControl( (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; diff --git a/vp9/ratectrl_rtc.h b/vp9/ratectrl_rtc.h index c7c0505e3..a30ec1da2 100644 --- 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 @@ struct VP9RateControlRtcConfig { 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;