[Ffmpeg-devel] Threading in libavcodec

Mathieu Monnier m.monnier
Mon Jan 23 14:17:00 CET 2006

 > wait, you can always implement anything with 2 threads what can be done
 > with 1 binary identically, the question is how fast it is

Here are figures that can be found here : 

> Fourth, some random speed results (defaults, vhq4, NO bframes. X2 
> 4200+ CPU).
> 1 thread : 1:48
> 2 threads : 1:05
> 3 threads : 1:06
> 4 threads : 1:08
> 16 threads: 1:11

So, as I said, it scales pretty well.

>i cant find any multithreaded code in cvs
>am i blind? IIRC there was some patch for multithreaded motion estimation
>on the xvid-dev list, is that what you are talking about?
I don't know where / how Radek posted his patches, and I'm not reading 
xvid-devel ml.

>and last, keep in mind that the way lavc splits the image during 
>multithreaded encoding has the advantage that it could also be decoded with
>multiple threads
Indeed, but you don't necessarily control who and with what it will be 
decoded. And if we reverse the problem, if you have only a decoder, you 
don't necessarily have control over how the encoding is done. So 
multithreaded decoding on a slice basis isn't imho that useful, because 
it needs control over both encoding and decoding. I'll admit however 
that on low end computers - or with high definition AVC content - it 
might be the only way to ensure realtime decoding.



More information about the ffmpeg-devel mailing list