From 831af370fe65cd330df7d41a7f10a5ac17f0a12c Mon Sep 17 00:00:00 2001 From: Jerome Jiang Date: Tue, 5 Dec 2017 10:44:35 -0800 Subject: [PATCH] VP9: Use 2 threads on low res on ARM. WebRTC standalone tests show 24% speed up on foreman_cif, 16% speed up on a 240p clip and 11% speed up on Bridge_r180. Bug: None Change-Id: I433b7a8841bd9df2402575f72dd1984cc5e011a9 Reviewed-on: https://webrtc-review.googlesource.com/29260 Commit-Queue: Jerome Jiang Reviewed-by: Magnus Flodman Reviewed-by: Rasmus Brandt Cr-Commit-Position: refs/heads/master@{#21096} --- modules/video_coding/codecs/vp9/vp9_impl.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/video_coding/codecs/vp9/vp9_impl.cc b/modules/video_coding/codecs/vp9/vp9_impl.cc index 5fa45370a5..22993eb66a 100644 --- a/modules/video_coding/codecs/vp9/vp9_impl.cc +++ b/modules/video_coding/codecs/vp9/vp9_impl.cc @@ -385,6 +385,13 @@ int VP9EncoderImpl::NumberOfThreads(int width, } else if (width * height >= 640 * 360 && number_of_cores > 2) { return 2; } else { + // Use 2 threads for low res on ARM. +#if defined(WEBRTC_ARCH_ARM) || defined(WEBRTC_ARCH_ARM64) || \ + defined(WEBRTC_ANDROID) + if (width * height >= 320 * 180 && number_of_cores > 2) { + return 2; + } +#endif // 1 thread less than VGA. return 1; }