mirror of
https://github.com/outbackdingo/UltraGrid.git
synced 2026-03-22 12:40:31 +00:00
lavc: do not enable MT with CAP_OTHER_THREADS
Only enable for libvpx*. Codecs must be individually evaluated - for libx265, it increases latency because it uses frame threading parallelism internally. For libsvt_hevc and libx264, the performance boost is not noticeable.
This commit is contained in:
@@ -1692,8 +1692,10 @@ static void set_codec_thread_mode(AVCodecContext *codec_ctx, struct setparam_par
|
||||
if (req_thread_count != -1) {
|
||||
codec_ctx->thread_count = req_thread_count;
|
||||
} else if ((codec_ctx->codec->capabilities & AV_CODEC_CAP_OTHER_THREADS) != 0) {
|
||||
// mainly for libvpx-vp9, libx264 has thread_count set implicitly to 0 (auto)
|
||||
codec_ctx->thread_count = 0;
|
||||
// do not enable MT for eg. libx265 - libx265 uses frame threads
|
||||
if (strncmp(codec_ctx->codec->name, "libvpx", 6)) {
|
||||
codec_ctx->thread_count = 0;
|
||||
}
|
||||
} else if (codec_ctx->thread_type != 0) {
|
||||
codec_ctx->thread_count = thread::hardware_concurrency();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user