Allow 3 encoder threads in libvpx for HD on > 6 core cpus
Bug: webrtc:4172
Change-Id: I50446779403eff0fe2e840afc6cfab9f8a310b1a
Reviewed-on: https://webrtc-review.googlesource.com/77981
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23511}
diff --git a/modules/video_coding/codecs/vp8/libvpx_vp8_encoder.cc b/modules/video_coding/codecs/vp8/libvpx_vp8_encoder.cc
index 8410e37..40d68c1 100644
--- a/modules/video_coding/codecs/vp8/libvpx_vp8_encoder.cc
+++ b/modules/video_coding/codecs/vp8/libvpx_vp8_encoder.cc
@@ -606,7 +606,12 @@
// 3 threads for 1080p.
return 3;
} else if (width * height > 640 * 480 && cpus >= 3) {
- // 2 threads for qHD/HD.
+ // Default 2 threads for qHD/HD, but allow 3 if core count is high enough,
+ // as this will allow more margin for high-core/low clock machines or if
+ // not built with highest optimization.
+ if (cpus >= 6) {
+ return 3;
+ }
return 2;
} else {
// 1 thread for VGA or less.