Add field trial for vp8 cpu speed configuration for arm.
Bug: none
Change-Id: I90c2475a229a1f10016e2ad84029e19b5a4f9966
Reviewed-on: https://webrtc-review.googlesource.com/c/107340
Commit-Queue: Åsa Persson <asapersson@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25484}
diff --git a/rtc_base/experiments/cpu_speed_experiment.h b/rtc_base/experiments/cpu_speed_experiment.h
new file mode 100644
index 0000000..e6c8340
--- /dev/null
+++ b/rtc_base/experiments/cpu_speed_experiment.h
@@ -0,0 +1,41 @@
+/*
+ * 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"
+
+namespace webrtc {
+
+class CpuSpeedExperiment {
+ public:
+ struct Config {
+ bool operator==(const Config& o) const {
+ return pixels == o.pixels && cpu_speed == o.cpu_speed;
+ }
+
+ int pixels; // The video frame size.
+ int cpu_speed; // The |cpu_speed| to be used if the frame size is less
+ // than or equal to |pixels|.
+ };
+
+ // Returns the configurations from field trial on success.
+ static absl::optional<std::vector<Config>> GetConfigs();
+
+ // Gets the cpu speed from the |configs| based on |pixels|.
+ static int GetValue(int pixels, const std::vector<Config>& configs);
+};
+
+} // namespace webrtc
+
+#endif // RTC_BASE_EXPERIMENTS_CPU_SPEED_EXPERIMENT_H_