diff --git a/modules/video_coding/codecs/vp9/vp9_impl.cc b/modules/video_coding/codecs/vp9/vp9_impl.cc index 18e146b037..f974932289 100644 --- a/modules/video_coding/codecs/vp9/vp9_impl.cc +++ b/modules/video_coding/codecs/vp9/vp9_impl.cc @@ -54,7 +54,7 @@ constexpr double kLowRateFactor = 1.0; constexpr double kHighRateFactor = 2.0; // These settings correspond to the settings in vpx_codec_enc_cfg. -struct Vp8RateSettings { +struct Vp9RateSettings { uint32_t rc_undershoot_pct; uint32_t rc_overshoot_pct; uint32_t rc_buf_sz; @@ -161,9 +161,9 @@ uint32_t Interpolate(uint32_t low, return static_cast(((1.0 - factor) * low) + (factor * high) + 0.5); } -Vp8RateSettings GetRateSettings(double bandwidth_headroom_factor) { - static const Vp8RateSettings low_settings{1000u, 0u, 100u, 30u, 40u}; - static const Vp8RateSettings high_settings{100u, 15u, 1000u, 600u, 5u}; +Vp9RateSettings GetRateSettings(double bandwidth_headroom_factor) { + static const Vp9RateSettings low_settings{100u, 0u, 100u, 33u, 40u}; + static const Vp9RateSettings high_settings{50u, 50u, 1000u, 700u, 5u}; if (bandwidth_headroom_factor <= kLowRateFactor) { return low_settings; @@ -171,7 +171,7 @@ Vp8RateSettings GetRateSettings(double bandwidth_headroom_factor) { return high_settings; } - Vp8RateSettings settings; + Vp9RateSettings settings; settings.rc_undershoot_pct = Interpolate(low_settings.rc_undershoot_pct, high_settings.rc_undershoot_pct, bandwidth_headroom_factor); @@ -191,7 +191,7 @@ Vp8RateSettings GetRateSettings(double bandwidth_headroom_factor) { } void UpdateRateSettings(vpx_codec_enc_cfg_t* config, - const Vp8RateSettings& new_settings) { + const Vp9RateSettings& new_settings) { config->rc_undershoot_pct = new_settings.rc_undershoot_pct; config->rc_overshoot_pct = new_settings.rc_overshoot_pct; config->rc_buf_sz = new_settings.rc_buf_sz;