Delete expired field trial WebRTC-VP8-CpuSpeed-Arm
Bug: webrtc:11503
Change-Id: I47d40949443047e58bb4a95bcb8b922eb2cc1c61
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/347644
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#42088}
diff --git a/experiments/field_trials.py b/experiments/field_trials.py
index 5e3521c..d162144 100755
--- a/experiments/field_trials.py
+++ b/experiments/field_trials.py
@@ -790,9 +790,6 @@
FieldTrial('WebRTC-UseTurnServerAsStunServer',
'webrtc:11059',
date(2024, 4, 1)),
- FieldTrial('WebRTC-VP8-CpuSpeed-Arm',
- '',
- date(2024, 4, 1)),
FieldTrial('WebRTC-VP8-ForcePartitionResilience',
'webrtc:11832',
INDEFINITE),
@@ -905,7 +902,7 @@
]) # yapf: disable
POLICY_EXEMPT_FIELD_TRIALS_DIGEST: str = \
- 'c8a81e2e8f6e55640a1093bddb8efdf668341e2a'
+ '4b765e142d10eccf80ec58cc9e994463c092cca0'
REGISTERED_FIELD_TRIALS: FrozenSet[FieldTrial] = ACTIVE_FIELD_TRIALS.union(
POLICY_EXEMPT_FIELD_TRIALS)
diff --git a/modules/video_coding/BUILD.gn b/modules/video_coding/BUILD.gn
index aee6d60..69cca17 100644
--- a/modules/video_coding/BUILD.gn
+++ b/modules/video_coding/BUILD.gn
@@ -583,7 +583,6 @@
"../../rtc_base:logging",
"../../rtc_base:rtc_numerics",
"../../rtc_base:timeutils",
- "../../rtc_base/experiments:cpu_speed_experiment",
"../../rtc_base/experiments:encoder_info_settings",
"../../rtc_base/experiments:field_trial_parser",
"../../rtc_base/experiments:rate_control_settings",
diff --git a/modules/video_coding/codecs/vp8/libvpx_vp8_encoder.cc b/modules/video_coding/codecs/vp8/libvpx_vp8_encoder.cc
index 1708d23..4593ecc 100644
--- a/modules/video_coding/codecs/vp8/libvpx_vp8_encoder.cc
+++ b/modules/video_coding/codecs/vp8/libvpx_vp8_encoder.cc
@@ -747,13 +747,6 @@
// On mobile platform, use a lower speed setting for lower resolutions for
// CPUs with 4 or more cores.
RTC_DCHECK_GT(number_of_cores_, 0);
- if (experimental_cpu_speed_config_arm_
- .GetValue(width * height, number_of_cores_)
- .has_value()) {
- return experimental_cpu_speed_config_arm_
- .GetValue(width * height, number_of_cores_)
- .value();
- }
if (number_of_cores_ <= 3)
return -12;
diff --git a/modules/video_coding/codecs/vp8/libvpx_vp8_encoder.h b/modules/video_coding/codecs/vp8/libvpx_vp8_encoder.h
index c78da36..ed2a86a 100644
--- a/modules/video_coding/codecs/vp8/libvpx_vp8_encoder.h
+++ b/modules/video_coding/codecs/vp8/libvpx_vp8_encoder.h
@@ -31,7 +31,6 @@
#include "modules/video_coding/include/video_codec_interface.h"
#include "modules/video_coding/utility/framerate_controller_deprecated.h"
#include "modules/video_coding/utility/vp8_constants.h"
-#include "rtc_base/experiments/cpu_speed_experiment.h"
#include "rtc_base/experiments/encoder_info_settings.h"
#include "rtc_base/experiments/rate_control_settings.h"
#include "vpx/vp8cx.h"
@@ -114,7 +113,6 @@
const Environment env_;
const std::unique_ptr<LibvpxInterface> libvpx_;
- const CpuSpeedExperiment experimental_cpu_speed_config_arm_;
const RateControlSettings rate_control_settings_;
EncodedImageCallback* encoded_complete_callback_ = nullptr;
diff --git a/rtc_base/experiments/BUILD.gn b/rtc_base/experiments/BUILD.gn
index 57c9fb7..c3e0066 100644
--- a/rtc_base/experiments/BUILD.gn
+++ b/rtc_base/experiments/BUILD.gn
@@ -137,19 +137,6 @@
absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ]
}
-rtc_library("cpu_speed_experiment") {
- sources = [
- "cpu_speed_experiment.cc",
- "cpu_speed_experiment.h",
- ]
- deps = [
- ":field_trial_parser",
- "..:logging",
- "../../system_wrappers:field_trial",
- ]
- absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ]
-}
-
rtc_library("encoder_info_settings") {
sources = [
"encoder_info_settings.cc",
@@ -238,7 +225,6 @@
sources = [
"balanced_degradation_settings_unittest.cc",
"bandwidth_quality_scaler_settings_unittest.cc",
- "cpu_speed_experiment_unittest.cc",
"encoder_info_settings_unittest.cc",
"field_trial_list_unittest.cc",
"field_trial_parser_unittest.cc",
@@ -256,7 +242,6 @@
deps = [
":balanced_degradation_settings",
":bandwidth_quality_scaler_settings",
- ":cpu_speed_experiment",
":encoder_info_settings",
":field_trial_parser",
":keyframe_interval_settings_experiment",
diff --git a/rtc_base/experiments/OWNERS b/rtc_base/experiments/OWNERS
index bb648db..27d5a0f 100644
--- a/rtc_base/experiments/OWNERS
+++ b/rtc_base/experiments/OWNERS
@@ -4,7 +4,6 @@
per-file audio_allocation_settings*=srte@webrtc.org
per-file congestion_controller_experiment*=srte@webrtc.org
-per-file cpu_speed_experiment*=asapersson@webrtc.org
per-file field_trial*=srte@webrtc.org
per-file keyframe_interval_settings*=brandtr@webrtc.org
per-file normalize_simulcast_size_experiment*=asapersson@webrtc.org
diff --git a/rtc_base/experiments/cpu_speed_experiment.cc b/rtc_base/experiments/cpu_speed_experiment.cc
deleted file mode 100644
index 7e61255..0000000
--- a/rtc_base/experiments/cpu_speed_experiment.cc
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright 2018 The WebRTC project authors. All Rights Reserved.
- *
- * Use of this source code is governed by a BSD-style license
- * that can be found in the LICENSE file in the root of the source
- * tree. An additional intellectual property rights grant can be found
- * in the file PATENTS. All contributing project authors may
- * be found in the AUTHORS file in the root of the source tree.
- */
-
-#include "rtc_base/experiments/cpu_speed_experiment.h"
-
-#include <stdio.h>
-
-#include "rtc_base/experiments/field_trial_list.h"
-#include "rtc_base/logging.h"
-#include "system_wrappers/include/field_trial.h"
-
-namespace webrtc {
-namespace {
-constexpr char kFieldTrial[] = "WebRTC-VP8-CpuSpeed-Arm";
-constexpr int kMinSetting = -16;
-constexpr int kMaxSetting = -1;
-
-std::vector<CpuSpeedExperiment::Config> GetValidOrEmpty(
- const std::vector<CpuSpeedExperiment::Config>& configs) {
- if (configs.empty()) {
- return {};
- }
-
- for (const auto& config : configs) {
- if (config.cpu_speed < kMinSetting || config.cpu_speed > kMaxSetting) {
- RTC_LOG(LS_WARNING) << "Unsupported cpu speed setting, value ignored.";
- return {};
- }
- }
-
- for (size_t i = 1; i < configs.size(); ++i) {
- if (configs[i].pixels < configs[i - 1].pixels ||
- configs[i].cpu_speed > configs[i - 1].cpu_speed) {
- RTC_LOG(LS_WARNING) << "Invalid parameter value provided.";
- return {};
- }
- }
-
- return configs;
-}
-
-bool HasLeCores(const std::vector<CpuSpeedExperiment::Config>& configs) {
- for (const auto& config : configs) {
- if (config.cpu_speed_le_cores == 0)
- return false;
- }
- return true;
-}
-} // namespace
-
-CpuSpeedExperiment::CpuSpeedExperiment() : cores_("cores") {
- FieldTrialStructList<Config> configs(
- {FieldTrialStructMember("pixels", [](Config* c) { return &c->pixels; }),
- FieldTrialStructMember("cpu_speed",
- [](Config* c) { return &c->cpu_speed; }),
- FieldTrialStructMember(
- "cpu_speed_le_cores",
- [](Config* c) { return &c->cpu_speed_le_cores; })},
- {});
- ParseFieldTrial({&configs, &cores_}, field_trial::FindFullName(kFieldTrial));
-
- configs_ = GetValidOrEmpty(configs.Get());
-}
-
-CpuSpeedExperiment::~CpuSpeedExperiment() {}
-
-absl::optional<int> CpuSpeedExperiment::GetValue(int pixels,
- int num_cores) const {
- if (configs_.empty())
- return absl::nullopt;
-
- bool use_le = HasLeCores(configs_) && cores_ && num_cores <= cores_.Value();
-
- for (const auto& config : configs_) {
- if (pixels <= config.pixels)
- return use_le ? absl::optional<int>(config.cpu_speed_le_cores)
- : absl::optional<int>(config.cpu_speed);
- }
- return absl::optional<int>(kMinSetting);
-}
-
-} // namespace webrtc
diff --git a/rtc_base/experiments/cpu_speed_experiment.h b/rtc_base/experiments/cpu_speed_experiment.h
deleted file mode 100644
index 24ec0c0..0000000
--- a/rtc_base/experiments/cpu_speed_experiment.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright 2018 The WebRTC project authors. All Rights Reserved.
- *
- * Use of this source code is governed by a BSD-style license
- * that can be found in the LICENSE file in the root of the source
- * tree. An additional intellectual property rights grant can be found
- * in the file PATENTS. All contributing project authors may
- * be found in the AUTHORS file in the root of the source tree.
- */
-
-#ifndef RTC_BASE_EXPERIMENTS_CPU_SPEED_EXPERIMENT_H_
-#define RTC_BASE_EXPERIMENTS_CPU_SPEED_EXPERIMENT_H_
-
-#include <vector>
-
-#include "absl/types/optional.h"
-#include "rtc_base/experiments/field_trial_parser.h"
-
-namespace webrtc {
-
-class CpuSpeedExperiment {
- public:
- CpuSpeedExperiment();
- ~CpuSpeedExperiment();
-
- // Example:
- // WebRTC-VP8-CpuSpeed-Arm/pixels:100|200|300,cpu_speed:-1|-2|-3/
- // pixels <= 100 -> cpu speed: -1
- // pixels <= 200 -> cpu speed: -2
- // pixels <= 300 -> cpu speed: -3
-
- // WebRTC-VP8-CpuSpeed-Arm/pixels:100|200|300,cpu_speed:-1|-2|-3/,
- // cpu_speed_le_cores:-4|-5|-6,cores:3/
- // If `num_cores` > 3
- // pixels <= 100 -> cpu speed: -1
- // pixels <= 200 -> cpu speed: -2
- // pixels <= 300 -> cpu speed: -3
- // else
- // pixels <= 100 -> cpu speed: -4
- // pixels <= 200 -> cpu speed: -5
- // pixels <= 300 -> cpu speed: -6
-
- struct Config {
- int pixels = 0; // The video frame size.
- int cpu_speed = 0; // The `cpu_speed` to be used if the frame size is less
- // than or equal to `pixels`.
- // Optional.
- int cpu_speed_le_cores = 0; // Same as `cpu_speed` above but only used if
- // `num_cores` <= `cores_`.
- };
-
- // Gets the cpu speed based on `pixels` and `num_cores`.
- absl::optional<int> GetValue(int pixels, int num_cores) const;
-
- private:
- std::vector<Config> configs_;
-
- // Threshold for when to use `cpu_speed_le_cores`.
- FieldTrialOptional<int> cores_;
-};
-
-} // namespace webrtc
-
-#endif // RTC_BASE_EXPERIMENTS_CPU_SPEED_EXPERIMENT_H_
diff --git a/rtc_base/experiments/cpu_speed_experiment_unittest.cc b/rtc_base/experiments/cpu_speed_experiment_unittest.cc
deleted file mode 100644
index 2105da3..0000000
--- a/rtc_base/experiments/cpu_speed_experiment_unittest.cc
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Copyright 2018 The WebRTC project authors. All Rights Reserved.
- *
- * Use of this source code is governed by a BSD-style license
- * that can be found in the LICENSE file in the root of the source
- * tree. An additional intellectual property rights grant can be found
- * in the file PATENTS. All contributing project authors may
- * be found in the AUTHORS file in the root of the source tree.
- */
-
-#include "rtc_base/experiments/cpu_speed_experiment.h"
-
-#include "rtc_base/gunit.h"
-#include "test/field_trial.h"
-#include "test/gmock.h"
-
-namespace webrtc {
-
-TEST(CpuSpeedExperimentTest, NoValueIfNotEnabled) {
- CpuSpeedExperiment cpu_speed_config;
- EXPECT_FALSE(cpu_speed_config.GetValue(1, /*num_cores=*/1));
-}
-
-TEST(CpuSpeedExperimentTest, GetValue) {
- webrtc::test::ScopedFieldTrials field_trials(
- "WebRTC-VP8-CpuSpeed-Arm/pixels:1000,cpu_speed:-12,cores:4/");
-
- CpuSpeedExperiment cpu_speed_config;
- EXPECT_EQ(-12, cpu_speed_config.GetValue(1, /*num_cores=*/1));
- EXPECT_EQ(-12, cpu_speed_config.GetValue(1000, /*num_cores=*/1));
- EXPECT_EQ(-16, cpu_speed_config.GetValue(1001, /*num_cores=*/1));
-}
-
-TEST(CpuSpeedExperimentTest, GetValueWithList) {
- webrtc::test::ScopedFieldTrials field_trials(
- "WebRTC-VP8-CpuSpeed-Arm/pixels:1000|2000|3000,cpu_speed:-1|-10|-16/");
-
- CpuSpeedExperiment cpu_speed_config;
- EXPECT_EQ(-1, cpu_speed_config.GetValue(1, /*num_cores=*/1));
- EXPECT_EQ(-1, cpu_speed_config.GetValue(1000, /*num_cores=*/1));
- EXPECT_EQ(-10, cpu_speed_config.GetValue(1001, /*num_cores=*/1));
- EXPECT_EQ(-10, cpu_speed_config.GetValue(2000, /*num_cores=*/1));
- EXPECT_EQ(-16, cpu_speed_config.GetValue(2001, /*num_cores=*/1));
- EXPECT_EQ(-16, cpu_speed_config.GetValue(3000, /*num_cores=*/1));
- EXPECT_EQ(-16, cpu_speed_config.GetValue(3001, /*num_cores=*/1));
-}
-
-TEST(CpuSpeedExperimentTest, GetValueWithCores) {
- webrtc::test::ScopedFieldTrials field_trials(
- "WebRTC-VP8-CpuSpeed-Arm/"
- "pixels:1000|2000|3000,cpu_speed:-1|-10|-16,"
- "cpu_speed_le_cores:-5|-11|-16,cores:2/");
-
- CpuSpeedExperiment cpu_speed_config;
- EXPECT_EQ(-5, cpu_speed_config.GetValue(1000, /*num_cores=*/1));
- EXPECT_EQ(-11, cpu_speed_config.GetValue(2000, /*num_cores=*/2));
- EXPECT_EQ(-1, cpu_speed_config.GetValue(1000, /*num_cores=*/3));
- EXPECT_EQ(-10, cpu_speed_config.GetValue(2000, /*num_cores=*/4));
-}
-
-TEST(CpuSpeedExperimentTest, GetValueWithCoresUnconfigured) {
- webrtc::test::ScopedFieldTrials field_trials(
- "WebRTC-VP8-CpuSpeed-Arm/"
- "pixels:1000|2000|3000,cpu_speed:-1|-10|-16,"
- "cpu_speed_le_cores:-5|-11|-16/");
-
- CpuSpeedExperiment cpu_speed_config;
- EXPECT_EQ(-1, cpu_speed_config.GetValue(1000, /*num_cores=*/1));
- EXPECT_EQ(-10, cpu_speed_config.GetValue(2000, /*num_cores=*/2));
-}
-
-TEST(CpuSpeedExperimentTest, GetValueFailsForTooSmallValue) {
- // Supported range: [-16, -1].
- webrtc::test::ScopedFieldTrials field_trials(
- "WebRTC-VP8-CpuSpeed-Arm/pixels:1000|2000|3000,cpu_speed:-1|-10|-17/");
-
- CpuSpeedExperiment cpu_speed_config;
- EXPECT_FALSE(cpu_speed_config.GetValue(1, /*num_cores=*/1));
-}
-
-TEST(CpuSpeedExperimentTest, GetValueFailsForTooLargeValue) {
- // Supported range: [-16, -1].
- webrtc::test::ScopedFieldTrials field_trials(
- "WebRTC-VP8-CpuSpeed-Arm/pixels:1000|2000|3000,cpu_speed:0|-10|-16/");
-
- CpuSpeedExperiment cpu_speed_config;
- EXPECT_FALSE(cpu_speed_config.GetValue(1, /*num_cores=*/1));
-}
-
-TEST(CpuSpeedExperimentTest, GetValueFailsIfPixelsDecreases) {
- webrtc::test::ScopedFieldTrials field_trials(
- "WebRTC-VP8-CpuSpeed-Arm/pixels:1000|999|3000,cpu_speed:-5|-10|-16/");
-
- CpuSpeedExperiment cpu_speed_config;
- EXPECT_FALSE(cpu_speed_config.GetValue(1, /*num_cores=*/1));
-}
-
-TEST(CpuSpeedExperimentTest, GetValueFailsIfCpuSpeedIncreases) {
- webrtc::test::ScopedFieldTrials field_trials(
- "WebRTC-VP8-CpuSpeed-Arm/pixels:1000|2000|3000,cpu_speed:-5|-4|-16/");
-
- CpuSpeedExperiment cpu_speed_config;
- EXPECT_FALSE(cpu_speed_config.GetValue(1, /*num_cores=*/1));
-}
-
-} // namespace webrtc