Commit 932b2810 authored by Vignesh Venkatasubramanian's avatar Vignesh Venkatasubramanian Committed by Commit Bot

media/filters/gav1: Update the thread counts

Update the thread counts to match the number of tiles. This
configuration has better performance than the existing
configuration.

Bug: 1102227, 1047051
Change-Id: I5c9723da97ec814bcb3417609a603a4e54610c72
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2359578
Commit-Queue: James Zern <jzern@google.com>
Reviewed-by: default avatarHirokazu Honda <hiroh@chromium.org>
Reviewed-by: default avatarJames Zern <jzern@google.com>
Reviewed-by: default avatarDale Curtis <dalecurtis@chromium.org>
Reviewed-by: default avatarWan-Teh Chang <wtc@google.com>
Cr-Commit-Position: refs/heads/master@{#798940}
parent 95cd9b72
...@@ -71,20 +71,26 @@ VideoPixelFormat Libgav1ImageFormatToVideoPixelFormat( ...@@ -71,20 +71,26 @@ VideoPixelFormat Libgav1ImageFormatToVideoPixelFormat(
} }
int GetDecoderThreadCounts(int coded_height) { int GetDecoderThreadCounts(int coded_height) {
// Tile thread counts based on currently available content. Recommended by // Thread counts based on currently available content. We set the number of
// YouTube, while frame thread values fit within limits::kMaxVideoThreads. // threads to be equal to the general number of tiles for the given
// libgav1 doesn't support parallel frame decoding. // resolution. As of now, YouTube content has the following tile settings:
// We can set the number of tile threads to as many as we like, but not // 240p and below - 1 tile
// greater than limits::kMaxVideoDecodeThreads. // 360p and 480p - 2 tiles
// 720p - 4 tiles
// 1080p - 8 tiles
// libgav1 supports frame parallel decoding, but we do not use it (yet) since
// the performance for this thread configuration is good enough without it.
// Also, the memory usage is much lower in non-frame parallel mode. This can
// be revisited as performance numbers change/evolve.
static const int num_cores = base::SysInfo::NumberOfProcessors(); static const int num_cores = base::SysInfo::NumberOfProcessors();
auto threads_by_height = [](int coded_height) { auto threads_by_height = [](int coded_height) {
if (coded_height >= 1000) if (coded_height >= 1000)
return 8; return 8;
if (coded_height >= 700) if (coded_height >= 700)
return 5; return 4;
if (coded_height >= 300) if (coded_height >= 300)
return 3;
return 2; return 2;
return 1;
}; };
return std::min(threads_by_height(coded_height), num_cores); return std::min(threads_by_height(coded_height), num_cores);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment