Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(110)

Unified Diff: webrtc/modules/video_coding/codecs/vp8/vp8_impl.cc

Issue 2058753003: Adjust the amount of VP8 encoder threads for Android builds. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/video_coding/codecs/vp8/vp8_impl.cc
diff --git a/webrtc/modules/video_coding/codecs/vp8/vp8_impl.cc b/webrtc/modules/video_coding/codecs/vp8/vp8_impl.cc
index 4c9a37cbf863aedb51054ef64b689a7857a6e203..8777375996fab2975881d874509168047ae790e2 100644
--- a/webrtc/modules/video_coding/codecs/vp8/vp8_impl.cc
+++ b/webrtc/modules/video_coding/codecs/vp8/vp8_impl.cc
@@ -633,6 +633,20 @@ int VP8EncoderImpl::SetCpuSpeed(int width, int height) {
}
int VP8EncoderImpl::NumberOfThreads(int width, int height, int cpus) {
+#if defined(ANDROID)
+ if (width * height >= 320 * 180) {
+ if (cpus >= 4) {
+ // 3 threads for CPUs with 4 and more cores since most of times only 4
+ // cores will be active.
+ return 3;
+ } else if (cpus == 3 || cpus == 2) {
+ return 2;
+ } else {
+ return 1;
+ }
+ }
+ return 1;
+#else
if (width * height >= 1920 * 1080 && cpus > 8) {
return 8; // 8 threads for 1080p on high perf machines.
} else if (width * height > 1280 * 960 && cpus >= 6) {
@@ -645,6 +659,7 @@ int VP8EncoderImpl::NumberOfThreads(int width, int height, int cpus) {
// 1 thread for VGA or less.
return 1;
}
+#endif
}
int VP8EncoderImpl::InitAndSetControlSettings() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698