[FFmpeg-devel] [PATCH] lavc/libaomenc: Add a maximum constraint of 64 encoder threads.
Carl Eugen Hoyos
ceffmpeg at gmail.com
Tue Nov 27 22:46:54 EET 2018
2018-11-27 10:18 GMT+01:00, Jun Zhao <mypopydev at gmail.com>:
> 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: Jun Zhao <mypopydev at gmail.com>
> ---
> libavcodec/libaomenc.c | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/libavcodec/libaomenc.c b/libavcodec/libaomenc.c
> index cb31c55..ccb0cf9 100644
> --- a/libavcodec/libaomenc.c
> +++ b/libavcodec/libaomenc.c
> @@ -504,7 +504,8 @@ static av_cold int aom_init(AVCodecContext *avctx,
> enccfg.g_h = avctx->height;
> enccfg.g_timebase.num = avctx->time_base.num;
> 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);
Is there a limitation in libaom's api that requires users to never set
g_threads >64 that we missed so far?
Or is there a bug in libaom that you would like to fix in FFmpeg?
Please explain, Carl Eugen
More information about the ffmpeg-devel
mailing list