That’s is why on MJPEG there is no latency ?

Frame N doesn’t depend on N-1 nor N+1 so  each thread is independent ?





De : [email protected] [mailto:[email protected]] De la 
part de Robin Stevens
Envoyé : mardi 10 février 2015 10:33
À : This list is about using libavcodec, libavformat, libavutil, libavdevice 
and libavfilter.
Objet : Re: [Libav-user] Real time camera IP RTSP H264





On Tuesday, February 10, 2015, Maziar Mehrabi <[email protected]> wrote:

Hi,

I wonder why multithreading causes latency.

My understanding is that having concurrent threads should improve performance.

Is there any explanation for this?

Thanks,





Without any knowledge of the code in question: concurrency can increase overall 
throughput (for particular kinds of task) but increased latency is a common 
payoff.



Imagine each thread as a separate decoder with carefully controlled access to 
some common data/state. To fully decode the Nth frame probably requires at 
least a partial decode (possibly a complete decode) of the N-1 frame. Therefore 
although the decoding for the Nth frame may happen on a separate processor 
core, it's likely not truly independent of the other cores.



So if you have 4 threads, T4 is waiting on T3, which is waiting on T2 and on 
T1. Even though T1 may have finished frame 1, it probably can't fully decode 
frame 5 until 4 is available from T4...



But that's just my guess!



---
Ce courrier électronique ne contient aucun virus ou logiciel malveillant parce 
que la protection avast! Antivirus est active.
http://www.avast.com
_______________________________________________
Libav-user mailing list
[email protected]
http://ffmpeg.org/mailman/listinfo/libav-user

Reply via email to