Make LibvpxVp8Encoder::GetCpuSpeed() to always read from CpuSpeedExperiment for arm.

CpuSpeedExperiment: Add option to have a separate config for cores below a configurable threshold.

Bug: none
Change-Id: I51562979f3a89a949d014a1ee6fc0802f3c1dae5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/184926
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32154}
This commit is contained in:
Åsa Persson
2020-09-21 14:57:04 +02:00
committed by Commit Bot
parent edd7f9e94d
commit ceab7547f0
4 changed files with 89 additions and 29 deletions

View File

@ -729,13 +729,17 @@ 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;
if (experimental_cpu_speed_config_arm_.GetValue(width * height).has_value()) {
return experimental_cpu_speed_config_arm_.GetValue(width * height).value();
}
if (width * height <= 352 * 288)
return -8;
else if (width * height <= 640 * 480)