[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bino-list] Multithreading video decoding

From: Alexey Osipov
Subject: [Bino-list] Multithreading video decoding
Date: Sun, 28 Aug 2011 04:10:58 +0700

Hi Martin and other developers!

I've just noticed that current git master of bino makes incorrect setup
of multithreading decoding, which leads to single-threaded decoding in
all cases. This is relevant for recent versions of ffmpeg and libav.

After commit [1] (h264 decoder was affected later in [2]) in ffmpeg and
same commits [3,4] in libav, count of threads for multithreading
decoding (AVCodecContext::thread_count) must be set _before_ call to

avcodec_open() calls avcodec_open2(), which calls ff_thread_init(),
which calls frame_thread_init(), which calls

validate_thread_parameters() set new AVCodecContext data member named
"active_thread_type" to correct value using values of
AVCodecContext::thread_count and AVCodecContext::thread_type.

If we set AVCodecContext::thread_count _after_ call to avcodec_open(),
then validate_thread_parameters() got AVCodecContext::thread_count = 1
and hence set AVCodecContext::active_thread_type configured for
single-thread decoding.

I attach a dirty patch, which solve this. I think a real fix should be a
little different, because we don't want to set `thread_count =
video_decoding_threads()` for all stream types, but video.

Best regards,


Attachment: mtfix.patch
Description: Text Data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]