[FFmpeg-devel] [PATCH] pthread: Allow thread_count==0

chetan mathad mathad.chetan
Sun Feb 20 07:43:01 CET 2011


Hi ,

On seeing this thread count i would like to add one more observation i had
was...

If i enable thread_count = 6; or even 1. the H263 1998 - 2000 fails. Encoder
returns -1.
If codec type is 264 then there is no problem.

H264 with thread_count = 0; does it choose the thread count depending on the
resolution or how is it.


Thanks & Regards
Chetan.M


On Sun, Feb 20, 2011 at 6:32 AM, Takashi Mochizuki
<mochi at da2.so-net.ne.jp>wrote:

> Some codec like libx264 uses thread_count==0 as Automatic mode.
>
> But, "Frame-based multithreading framework using pthreads"
>  (commit: 37b00b47cbeecd66bb34c5c7c534d016d6e8da24)
> does not allow thread_count==0.
>
> Here is a tiny patch.
>
> Takashi Mochizuki
>
> //
>
> ---
>  libavcodec/pthread.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/libavcodec/pthread.c b/libavcodec/pthread.c
> index 0e033d3..6b989ac 100644
> --- a/libavcodec/pthread.c
> +++ b/libavcodec/pthread.c
> @@ -877,7 +877,7 @@ int ff_thread_init(AVCodecContext *avctx, int
> thread_count)
>         return -1;
>     }
>
> -    avctx->thread_count = FFMAX(1, thread_count);
> +    avctx->thread_count = FFMAX(0, thread_count);
>
>     if (avctx->codec) {
>         validate_thread_parameters(avctx);
> --
> 1.7.4.1
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at mplayerhq.hu
> https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-devel
>



-- 
Thanks & Regards
Chetan.M



More information about the ffmpeg-devel mailing list