Source code

Revision control

Copy as Markdown

Other Tools

From: Wang Qing <wangqing-hf@loongson.cn>
Date: Wed, 25 Sep 2019 14:15:00 +0000
Subject: Bug 1579834 - [WebRTC] Add mips64 support; r=dminor
---
modules/video_coding/codecs/vp8/libvpx_vp8_decoder.cc | 2 +-
modules/video_coding/codecs/vp8/libvpx_vp8_encoder.cc | 8 ++++++--
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/modules/video_coding/codecs/vp8/libvpx_vp8_decoder.cc b/modules/video_coding/codecs/vp8/libvpx_vp8_decoder.cc
index fc6cad6167..06422aaf5a 100644
--- a/modules/video_coding/codecs/vp8/libvpx_vp8_decoder.cc
+++ b/modules/video_coding/codecs/vp8/libvpx_vp8_decoder.cc
@@ -47,7 +47,7 @@ const char kVp8PostProcArmFieldTrial[] = "WebRTC-VP8-Postproc-Config-Arm";
const char kVp8PostProcFieldTrial[] = "WebRTC-VP8-Postproc-Config";
#if defined(WEBRTC_ARCH_ARM) || defined(WEBRTC_ARCH_ARM64) || \
- defined(WEBRTC_ANDROID)
+ defined(WEBRTC_ANDROID) || defined(WEBRTC_ARCH_MIPS)
constexpr bool kIsArm = true;
#else
constexpr bool kIsArm = false;
diff --git a/modules/video_coding/codecs/vp8/libvpx_vp8_encoder.cc b/modules/video_coding/codecs/vp8/libvpx_vp8_encoder.cc
index 7edd3feb48..52511cc884 100644
--- a/modules/video_coding/codecs/vp8/libvpx_vp8_encoder.cc
+++ b/modules/video_coding/codecs/vp8/libvpx_vp8_encoder.cc
@@ -746,7 +746,7 @@ int LibvpxVp8Encoder::InitEncode(const VideoCodec* inst,
}
int LibvpxVp8Encoder::GetCpuSpeed(int width, int height) {
-#ifdef MOBILE_ARM
+#if defined(MOBILE_ARM) || defined(WEBRTC_ARCH_MIPS)
// 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);
@@ -774,6 +774,8 @@ int LibvpxVp8Encoder::GetCpuSpeed(int width, int height) {
int LibvpxVp8Encoder::NumberOfThreads(int width, int height, int cpus) {
#if defined(WEBRTC_ANDROID)
if (android_specific_threading_settings_) {
+#endif
+#if defined(WEBRTC_ANDROID) || defined(WEBRTC_ARCH_MIPS)
if (width * height >= 320 * 180) {
if (cpus >= 4) {
// 3 threads for CPUs with 4 and more cores since most of times only 4
@@ -786,7 +788,9 @@ int LibvpxVp8Encoder::NumberOfThreads(int width, int height, int cpus) {
}
}
return 1;
+#if defined(WEBRTC_ANDROID)
}
+#endif
#elif defined(WEBRTC_IOS)
std::string trial_string =
env_.field_trials().Lookup(kVP8IosMaxNumberOfThreadFieldTrial);
@@ -844,7 +848,7 @@ int LibvpxVp8Encoder::InitAndSetControlSettings() {
// for getting the denoised frame from the encoder and using that
// when encoding lower resolution streams. Would it work with the
// multi-res encoding feature?
-#ifdef MOBILE_ARM
+#if defined(MOBILE_ARM) || defined(WEBRTC_ARCH_MIPS)
denoiserState denoiser_state = kDenoiserOnYOnly;
#else
denoiserState denoiser_state = kDenoiserOnAdaptive;