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}
This commit is contained in:
Danil Chapovalov 2024-04-16 12:54:22 +02:00 committed by WebRTC LUCI CQ
parent 98604bc7fe
commit de7e4ad1b1
9 changed files with 1 additions and 289 deletions

View file

@ -790,9 +790,6 @@ POLICY_EXEMPT_FIELD_TRIALS: FrozenSet[FieldTrial] = frozenset([
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 @@ POLICY_EXEMPT_FIELD_TRIALS: FrozenSet[FieldTrial] = frozenset([
]) # yapf: disable
POLICY_EXEMPT_FIELD_TRIALS_DIGEST: str = \
'c8a81e2e8f6e55640a1093bddb8efdf668341e2a'
'4b765e142d10eccf80ec58cc9e994463c092cca0'
REGISTERED_FIELD_TRIALS: FrozenSet[FieldTrial] = ACTIVE_FIELD_TRIALS.union(
POLICY_EXEMPT_FIELD_TRIALS)

View file

@ -583,7 +583,6 @@ rtc_library("webrtc_vp8") {
"../../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",

View file

@ -747,13 +747,6 @@ int LibvpxVp8Encoder::GetCpuSpeed(int width, int height) {
// 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;

View file

@ -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 @@ class LibvpxVp8Encoder : public VideoEncoder {
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;

View file

@ -137,19 +137,6 @@ rtc_library("balanced_degradation_settings") {
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 @@ if (rtc_include_tests && !build_with_chromium) {
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 @@ if (rtc_include_tests && !build_with_chromium) {
deps = [
":balanced_degradation_settings",
":bandwidth_quality_scaler_settings",
":cpu_speed_experiment",
":encoder_info_settings",
":field_trial_parser",
":keyframe_interval_settings_experiment",

View file

@ -4,7 +4,6 @@ srte@webrtc.org
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

View file

@ -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

View file

@ -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_

View file

@ -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