News:

--

Main Menu

[lavcodec] Multithreaded decoding

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

Previous topic - Next topic

szlldm

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!

eumagga0x2a

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.

szlldm

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.

eumagga0x2a

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.

szlldm

Thank you very much!
Tested with various samples from https://kodi.wiki/view/Samples. 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.