Use multiple tilethreads with dav1d
Categories
(Core :: Audio/Video: Playback, defect, P3)
Tracking
()
People
(Reporter: E.M.terHoeven, Assigned: achronop)
References
Details
Attachments
(1 file)
(deleted),
text/x-phabricator-request
|
pascalc
:
approval-mozilla-beta+
|
Details |
Playback of AV1 content with the dav1d decoder is unnecessarily slow because only a single tilethread is used. Using multiple tilethread speeds up decoding and reduces latency. At least 2 tilethreads should be used by default, and 4 on systems with 4+ cores.
In general it's better with dav1d to use tilethreads instead of framethreads, because they have a smaller impact on latency and memory usage than framethreads.
My suggestions would be:
- Tilethreads:
min(4, logical_processors)
- Framethreads:
logical_processors/2
Here's a playlist with 4K and 8K AV1 videos to test: https://www.youtube.com/playlist?list=PLvndfuQ5JldKMffLOhQ6pLdO0euZfq_40
Reporter | ||
Updated•6 years ago
|
Updated•6 years ago
|
Assignee | ||
Comment 1•6 years ago
|
||
This is a snapshot from dav1d channel in IRC:
<nevcairiel> I would generally recommend 2 tile threads and as many frame threads as you can comfortably accept latency for (up to num of logical cores)
15:55
<nevcairiel> that seems to best match the way current videos are being encoded
15:56
<unlord> but I was testing Nightly last night with 0.2.1 and also saw that it wasn't performing better than libaom
15:57
<jamrial> i'm with nevcairiel, i haven't really seen much improvement with more than two tile threads, at least with the stuff being currently served on youtube and such
15:59
<nevcairiel> tile threads matching tile count would probably be ideal, maybe dav1d can help to do that in the future, but until then, 2 is what current content uses mostly
15:59
<BBB> it sounds like the content has 2 tiles then?
15:59
<BBB> or maybe even 1
15:59
<nevcairiel> afaik youtube encodes with 2 tiles
I think using 2 tile threads would be sufficient for now, given that the ideal number depends on the number of tiles that a video has rather than the number of logical processors. When dav1d is able to set a dynamic number of tile threads according to the content we can optimize it further.
Assignee | ||
Updated•6 years ago
|
Reporter | ||
Comment 2•6 years ago
|
||
(In reply to Alex Chronopoulos [:achronop] from comment #1)
There is indeed some discussion about how many tilethreads are optimal on certain systems on certain content. But in each case, 2 tilethreads are (way) better than 1 tilethread, making it the dominant strategy. For now using two tilethreads would be fine, later we can decide a even more near-optimal implementation.
Assignee | ||
Comment 3•6 years ago
|
||
Comment 5•6 years ago
|
||
bugherder |
Assignee | ||
Comment 7•6 years ago
|
||
Comment on attachment 9052525 [details]
Bug 1536783 - Use two tile threads in dav1d decoder for performance improvement. r?TD-Linux
Beta/Release Uplift Approval Request
- Feature/Bug causing the regression: None
- User impact if declined: Increase performance of dav1d decoder. It's one line change that will give us performance boost on AV1 video playback.
- Is this code covered by automated tests?: Yes
- Has the fix been verified in Nightly?: Yes
- Needs manual test from QE?: No
- If yes, steps to reproduce:
- List of other uplifts needed: None
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): Very low risk. It has been working on Nightly for some day without an issue. It one line change.
- String changes made/needed:
Comment 8•6 years ago
|
||
Comment on attachment 9052525 [details]
Bug 1536783 - Use two tile threads in dav1d decoder for performance improvement. r?TD-Linux
Limited & safe patch improving significantly the performance of AV1 video playback, uplift approved for 67 beta 6, thanks.
Comment 9•6 years ago
|
||
bugherder uplift |
Updated•6 years ago
|
Description
•