March 02, 2021, 01:25:01 PM



[lavcodec] Multithreaded decoding

Started by szlldm, January 21, 2021, 03:56:12 PM

Previous topic - Next topic


Is there a particular reason, that multithreading is not enabled in decoding?
I tried MT with h.265 and 264, didnt see any error. But decoding speed was way faster.
(Only have sw decoding capabilities, no HW accel.)

Thank you!


Multithreading is incompatible with HW accel implementation in Avidemux. It would be trivial to avoid using HW decoder when MT is enabled, but this easy solution collapses when MT gets enabled prior to appending a video but after the first video was loaded (with hw decoder used). The preview is not refreshed. Trying to find out why.


So it would be possible, to create a copy of preferences at Avidemux start, then decide from these parameters, if MT can be enabled (HW decoder disabled and/or HW decoder not available)?
Only drawback, that changing these parameters would require restart.


I've pushed a highly experimental change which enables lavc MT by default to speed up evaluation on different platforms. I'll back it out at the first sign of trouble.


Thank you very much!
Tested with various samples from Did not encounter errors yet.
Also tested appending, i patched up very different samples together (x264, x265, vp9 (this uses single thread decoder),  also 8bit and 10bit hdr).

Unrelated to the topic:
Among the sample videos, the 4k / 21. ProRes HDR DCI-P3 Strobe Scientist is loading but decoded into garbage (rainbow noise), regardless of this commit.