diff --git a/test/configurable_frame_size_encoder.cc b/test/configurable_frame_size_encoder.cc
index a0a42f0..ba529cb 100644
--- a/test/configurable_frame_size_encoder.cc
+++ b/test/configurable_frame_size_encoder.cc
@@ -74,11 +74,8 @@
   return WEBRTC_VIDEO_CODEC_OK;
 }
 
-int32_t ConfigurableFrameSizeEncoder::SetRateAllocation(
-    const VideoBitrateAllocation& allocation,
-    uint32_t framerate) {
-  return WEBRTC_VIDEO_CODEC_OK;
-}
+void ConfigurableFrameSizeEncoder::SetRates(
+    const RateControlParameters& parameters) {}
 
 int32_t ConfigurableFrameSizeEncoder::SetFrameSize(size_t size) {
   RTC_DCHECK_LE(size, max_frame_size_);
diff --git a/test/configurable_frame_size_encoder.h b/test/configurable_frame_size_encoder.h
index 9daf13e..ddf763f 100644
--- a/test/configurable_frame_size_encoder.h
+++ b/test/configurable_frame_size_encoder.h
@@ -44,8 +44,7 @@
 
   int32_t Release() override;
 
-  int32_t SetRateAllocation(const VideoBitrateAllocation& allocation,
-                            uint32_t framerate) override;
+  void SetRates(const RateControlParameters& parameters) override;
 
   int32_t SetFrameSize(size_t size);
 
diff --git a/test/fake_encoder.cc b/test/fake_encoder.cc
index ac59dfd..7c24b84 100644
--- a/test/fake_encoder.cc
+++ b/test/fake_encoder.cc
@@ -51,7 +51,6 @@
 FakeEncoder::FakeEncoder(Clock* clock)
     : clock_(clock),
       callback_(nullptr),
-      configured_input_framerate_(-1),
       max_target_bitrate_kbps_(-1),
       pending_keyframe_(true),
       counter_(0),
@@ -65,7 +64,7 @@
   RTC_DCHECK_GE(max_kbps, -1);  // max_kbps == -1 disables it.
   rtc::CritScope cs(&crit_sect_);
   max_target_bitrate_kbps_ = max_kbps;
-  SetRateAllocation(target_bitrate_, configured_input_framerate_);
+  SetRates(current_rate_settings_);
 }
 
 int32_t FakeEncoder::InitEncode(const VideoCodec* config,
@@ -73,8 +72,8 @@
                                 size_t max_payload_size) {
   rtc::CritScope cs(&crit_sect_);
   config_ = *config;
-  target_bitrate_.SetBitrate(0, 0, config_.startBitrate * 1000);
-  configured_input_framerate_ = config_.maxFramerate;
+  current_rate_settings_.bitrate.SetBitrate(0, 0, config_.startBitrate * 1000);
+  current_rate_settings_.framerate_fps = config_.maxFramerate;
   pending_keyframe_ = true;
   last_frame_info_ = FrameInfo();
   return 0;
@@ -86,8 +85,7 @@
   unsigned char num_simulcast_streams;
   SimulcastStream simulcast_streams[kMaxSimulcastStreams];
   EncodedImageCallback* callback;
-  VideoBitrateAllocation target_bitrate;
-  int framerate;
+  RateControlParameters rates;
   VideoCodecMode mode;
   bool keyframe;
   uint32_t counter;
@@ -99,12 +97,10 @@
       simulcast_streams[i] = config_.simulcastStream[i];
     }
     callback = callback_;
-    target_bitrate = target_bitrate_;
+    rates = current_rate_settings_;
     mode = config_.mode;
-    if (configured_input_framerate_ > 0) {
-      framerate = configured_input_framerate_;
-    } else {
-      framerate = max_framerate;
+    if (rates.framerate_fps <= 0.0) {
+      rates.framerate_fps = max_framerate;
     }
     keyframe = pending_keyframe_;
     pending_keyframe_ = false;
@@ -112,8 +108,8 @@
   }
 
   FrameInfo frame_info =
-      NextFrame(frame_types, keyframe, num_simulcast_streams, target_bitrate,
-                simulcast_streams, framerate);
+      NextFrame(frame_types, keyframe, num_simulcast_streams, rates.bitrate,
+                simulcast_streams, static_cast<int>(rates.framerate_fps + 0.5));
   for (uint8_t i = 0; i < frame_info.layers.size(); ++i) {
     constexpr int kMinPayLoadLength = 14;
     if (frame_info.layers[i].size < kMinPayLoadLength) {
@@ -237,12 +233,10 @@
   return 0;
 }
 
-int32_t FakeEncoder::SetRateAllocation(
-    const VideoBitrateAllocation& rate_allocation,
-    uint32_t framerate) {
+void FakeEncoder::SetRates(const RateControlParameters& parameters) {
   rtc::CritScope cs(&crit_sect_);
-  target_bitrate_ = rate_allocation;
-  int allocated_bitrate_kbps = target_bitrate_.get_sum_kbps();
+  current_rate_settings_ = parameters;
+  int allocated_bitrate_kbps = parameters.bitrate.get_sum_kbps();
 
   // Scale bitrate allocation to not exceed the given max target bitrate.
   if (max_target_bitrate_kbps_ > 0 &&
@@ -251,20 +245,19 @@
          ++spatial_idx) {
       for (uint8_t temporal_idx = 0; temporal_idx < kMaxTemporalStreams;
            ++temporal_idx) {
-        if (target_bitrate_.HasBitrate(spatial_idx, temporal_idx)) {
-          uint32_t bitrate =
-              target_bitrate_.GetBitrate(spatial_idx, temporal_idx);
+        if (current_rate_settings_.bitrate.HasBitrate(spatial_idx,
+                                                      temporal_idx)) {
+          uint32_t bitrate = current_rate_settings_.bitrate.GetBitrate(
+              spatial_idx, temporal_idx);
           bitrate = static_cast<uint32_t>(
               (bitrate * int64_t{max_target_bitrate_kbps_}) /
               allocated_bitrate_kbps);
-          target_bitrate_.SetBitrate(spatial_idx, temporal_idx, bitrate);
+          current_rate_settings_.bitrate.SetBitrate(spatial_idx, temporal_idx,
+                                                    bitrate);
         }
       }
     }
   }
-
-  configured_input_framerate_ = framerate;
-  return 0;
 }
 
 const char* FakeEncoder::kImplementationName = "fake_encoder";
@@ -276,7 +269,7 @@
 
 int FakeEncoder::GetConfiguredInputFramerate() const {
   rtc::CritScope cs(&crit_sect_);
-  return configured_input_framerate_;
+  return static_cast<int>(current_rate_settings_.framerate_fps + 0.5);
 }
 
 FakeH264Encoder::FakeH264Encoder(Clock* clock)
diff --git a/test/fake_encoder.h b/test/fake_encoder.h
index 95b4b20..7e1c1a1 100644
--- a/test/fake_encoder.h
+++ b/test/fake_encoder.h
@@ -48,8 +48,7 @@
   int32_t RegisterEncodeCompleteCallback(
       EncodedImageCallback* callback) override;
   int32_t Release() override;
-  int32_t SetRateAllocation(const VideoBitrateAllocation& rate_allocation,
-                            uint32_t framerate) override;
+  void SetRates(const RateControlParameters& parameters) override;
   int GetConfiguredInputFramerate() const;
   EncoderInfo GetEncoderInfo() const override;
 
@@ -89,8 +88,7 @@
 
   VideoCodec config_ RTC_GUARDED_BY(crit_sect_);
   EncodedImageCallback* callback_ RTC_GUARDED_BY(crit_sect_);
-  VideoBitrateAllocation target_bitrate_ RTC_GUARDED_BY(crit_sect_);
-  int configured_input_framerate_ RTC_GUARDED_BY(crit_sect_);
+  RateControlParameters current_rate_settings_ RTC_GUARDED_BY(crit_sect_);
   int max_target_bitrate_kbps_ RTC_GUARDED_BY(crit_sect_);
   bool pending_keyframe_ RTC_GUARDED_BY(crit_sect_);
   uint32_t counter_ RTC_GUARDED_BY(crit_sect_);
diff --git a/test/pc/e2e/analyzer/video/quality_analyzing_video_encoder.cc b/test/pc/e2e/analyzer/video/quality_analyzing_video_encoder.cc
index 39d5701..272f80f 100644
--- a/test/pc/e2e/analyzer/video/quality_analyzing_video_encoder.cc
+++ b/test/pc/e2e/analyzer/video/quality_analyzing_video_encoder.cc
@@ -63,7 +63,9 @@
       bitrate_multiplier_(bitrate_multiplier),
       stream_required_spatial_index_(std::move(stream_required_spatial_index)),
       injector_(injector),
-      analyzer_(analyzer) {}
+      analyzer_(analyzer),
+      mode_(SimulcastMode::kNormal),
+      delegate_callback_(nullptr) {}
 QualityAnalyzingVideoEncoder::~QualityAnalyzingVideoEncoder() = default;
 
 int32_t QualityAnalyzingVideoEncoder::InitEncode(
@@ -147,17 +149,11 @@
   return result;
 }
 
-int32_t QualityAnalyzingVideoEncoder::SetRates(uint32_t bitrate,
-                                               uint32_t framerate) {
-  return delegate_->SetRates(bitrate, framerate);
-}
-
-int32_t QualityAnalyzingVideoEncoder::SetRateAllocation(
-    const VideoBitrateAllocation& allocation,
-    uint32_t framerate) {
+void QualityAnalyzingVideoEncoder::SetRates(
+    const VideoEncoder::RateControlParameters& parameters) {
   RTC_DCHECK_GT(bitrate_multiplier_, 0.0);
   if (fabs(bitrate_multiplier_ - kNoMultiplier) < kEps) {
-    return delegate_->SetRateAllocation(allocation, framerate);
+    return delegate_->SetRates(parameters);
   }
 
   // Simulating encoder overshooting target bitrate, by configuring actual
@@ -166,7 +162,7 @@
   VideoBitrateAllocation multiplied_allocation;
   for (size_t si = 0; si < kMaxSpatialLayers; ++si) {
     const uint32_t spatial_layer_bitrate_bps =
-        allocation.GetSpatialLayerSum(si);
+        parameters.bitrate.GetSpatialLayerSum(si);
     if (spatial_layer_bitrate_bps == 0) {
       continue;
     }
@@ -185,16 +181,18 @@
     }
 
     for (size_t ti = 0; ti < kMaxTemporalStreams; ++ti) {
-      if (allocation.HasBitrate(si, ti)) {
+      if (parameters.bitrate.HasBitrate(si, ti)) {
         multiplied_allocation.SetBitrate(
             si, ti,
             rtc::checked_cast<uint32_t>(bitrate_multiplier *
-                                        allocation.GetBitrate(si, ti)));
+                                        parameters.bitrate.GetBitrate(si, ti)));
       }
     }
   }
 
-  return delegate_->SetRateAllocation(multiplied_allocation, framerate);
+  RateControlParameters adjusted_params = parameters;
+  adjusted_params.bitrate = multiplied_allocation;
+  return delegate_->SetRates(adjusted_params);
 }
 
 VideoEncoder::EncoderInfo QualityAnalyzingVideoEncoder::GetEncoderInfo() const {
diff --git a/test/pc/e2e/analyzer/video/quality_analyzing_video_encoder.h b/test/pc/e2e/analyzer/video/quality_analyzing_video_encoder.h
index d7dd5d1..4861d4c 100644
--- a/test/pc/e2e/analyzer/video/quality_analyzing_video_encoder.h
+++ b/test/pc/e2e/analyzer/video/quality_analyzing_video_encoder.h
@@ -70,9 +70,7 @@
   int32_t Release() override;
   int32_t Encode(const VideoFrame& frame,
                  const std::vector<VideoFrameType>* frame_types) override;
-  int32_t SetRates(uint32_t bitrate, uint32_t framerate) override;
-  int32_t SetRateAllocation(const VideoBitrateAllocation& allocation,
-                            uint32_t framerate) override;
+  void SetRates(const VideoEncoder::RateControlParameters& parameters) override;
   EncoderInfo GetEncoderInfo() const override;
 
   // Methods of EncodedImageCallback interface.
diff --git a/test/video_encoder_proxy_factory.h b/test/video_encoder_proxy_factory.h
index 55a01a1..49a4e2d 100644
--- a/test/video_encoder_proxy_factory.h
+++ b/test/video_encoder_proxy_factory.h
@@ -75,9 +75,8 @@
       return encoder_->RegisterEncodeCompleteCallback(callback);
     }
     int32_t Release() override { return encoder_->Release(); }
-    int32_t SetRateAllocation(const VideoBitrateAllocation& rate_allocation,
-                              uint32_t framerate) override {
-      return encoder_->SetRateAllocation(rate_allocation, framerate);
+    void SetRates(const RateControlParameters& parameters) override {
+      encoder_->SetRates(parameters);
     }
     VideoEncoder::EncoderInfo GetEncoderInfo() const override {
       return encoder_->GetEncoderInfo();
