Commit e404eee1 authored by Michael Niedermayer's avatar Michael Niedermayer

pthread: Limit automatic threads to mb_height.

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 9c1f0493
...@@ -189,6 +189,10 @@ static int get_logical_cpus(AVCodecContext *avctx) ...@@ -189,6 +189,10 @@ static int get_logical_cpus(AVCodecContext *avctx)
nb_cpus = sysconf(_SC_NPROCESSORS_ONLN); nb_cpus = sysconf(_SC_NPROCESSORS_ONLN);
#endif #endif
av_log(avctx, AV_LOG_DEBUG, "detected %d logical cores\n", nb_cpus); av_log(avctx, AV_LOG_DEBUG, "detected %d logical cores\n", nb_cpus);
if (avctx->height)
nb_cpus = FFMIN(nb_cpus, (avctx->height+15)/16);
return FFMIN(nb_cpus, MAX_AUTO_THREADS); return FFMIN(nb_cpus, MAX_AUTO_THREADS);
} }
......
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