Commit b87063c0 authored by Jun Zhao's avatar Jun Zhao Committed by James Almer

lavc/libaomenc: Add a maximum constraint of 64 encoder threads.

fixed the error in Intel(R) Xeon(R) Gold 6152 CPU like:
[libaom-av1 @ 0x469f340] Failed to initialize encoder: Invalid parameter
[libaom-av1 @ 0x469f340]   Additional information: g_threads out of range [..MAX_NUM_THREADS]
Signed-off-by: 's avatarJun Zhao <mypopydev@gmail.com>
Signed-off-by: 's avatarJames Almer <jamrial@gmail.com>
parent e695b0be
...@@ -504,7 +504,8 @@ static av_cold int aom_init(AVCodecContext *avctx, ...@@ -504,7 +504,8 @@ static av_cold int aom_init(AVCodecContext *avctx,
enccfg.g_h = avctx->height; enccfg.g_h = avctx->height;
enccfg.g_timebase.num = avctx->time_base.num; enccfg.g_timebase.num = avctx->time_base.num;
enccfg.g_timebase.den = avctx->time_base.den; enccfg.g_timebase.den = avctx->time_base.den;
enccfg.g_threads = avctx->thread_count ? avctx->thread_count : av_cpu_count(); enccfg.g_threads =
FFMIN(avctx->thread_count ? avctx->thread_count : av_cpu_count(), 64);
if (ctx->lag_in_frames >= 0) if (ctx->lag_in_frames >= 0)
enccfg.g_lag_in_frames = ctx->lag_in_frames; enccfg.g_lag_in_frames = ctx->lag_in_frames;
......
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