From aa5c1e8fd23029ca82836138d8e447f7f76913b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Spr=C3=A5ng?= Date: Mon, 15 Jun 2020 07:20:47 +0000 Subject: [PATCH] Revert "Adjusts allowable thread count for vp9 decoders." MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 26e50469513a3df2abb88c9ae2a5af70de0b029c. Reason for revert: Part of change that may cause crashes. Original change's description: > Adjusts allowable thread count for vp9 decoders. > > Set 2 thread as target for 1280x720 pixel count, and then scale up > linearly from there - but cap at physical core count. > For common resolutions this results in: > 1 for 360p > 2 for 720p > 4 for 1080p > 8 for 1440p > 18 for 4K > > Bug: webrtc:11551 > Change-Id: I666bd971eccddee096749f20d3b08eb40fe868ad > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/177012 > Reviewed-by: Johannes Kron > Cr-Commit-Position: refs/heads/master@{#31513} TBR=sprang@webrtc.org,kron@webrtc.org # Not skipping CQ checks because original CL landed > 1 day ago. Bug: webrtc:11551 Change-Id: I4ea5166efeed3d55255a0243a69deb584a0e19e2 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/177240 Reviewed-by: Erik Språng Commit-Queue: Erik Språng Cr-Commit-Position: refs/heads/master@{#31517} --- modules/video_coding/codecs/vp9/vp9_impl.cc | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/modules/video_coding/codecs/vp9/vp9_impl.cc b/modules/video_coding/codecs/vp9/vp9_impl.cc index 318b704ae0..3ac46f627e 100644 --- a/modules/video_coding/codecs/vp9/vp9_impl.cc +++ b/modules/video_coding/codecs/vp9/vp9_impl.cc @@ -1671,16 +1671,10 @@ int VP9DecoderImpl::InitDecode(const VideoCodec* inst, int number_of_cores) { // We want to use multithreading when decoding high resolution videos. But not // too many in order to avoid overhead when many stream are decoded // concurrently. - // Set 2 thread as target for 1280x720 pixel count, and then scale up linearly + // Set 1280x720 pixel count as target for one core, and then scale up linearly // from there - but cap at physical core count. - // For common resolutions this results in: - // 1 for 360p - // 2 for 720p - // 4 for 1080p - // 8 for 1440p - // 18 for 4K - int num_threads = - std::max(1, 2 * (inst->width * inst->height) / (1280 * 720)); + // This results in 2 for 1080p, 4 for 1440p and 8 for 4K. + int num_threads = std::max(1, (inst->width * inst->height) / (1280 * 720)); cfg.threads = std::min(number_of_cores, num_threads); #endif current_codec_ = *inst;