[FFmpeg-devel] Question about parallelizing h264 decoding

Loren Merritt lorenm
Fri May 11 18:55:01 CEST 2007

On Fri, 11 May 2007, Thorsten Jordan wrote:
> Michael Niedermayer schrieb:
>> what i think is better is frame level parallelism
>> so that thread 1 decode frame 1 and updates a last_decoded_row variable
>> and thread 2 decodes frames 2 and checks if the needed reference is available
>> or if last_decoded_row is still too small in the later case the thread waits
>> a third thread could now work on frame 3 and so on ...
> With row do you mean row of macroblocks?

What matters from the perspective of the thread doing motion compensation 
is which rows of pixels have been decoded. But yes, the variable would be 
updated only when a row of macroblocks finishes.

> About separating CABAC to other CPU: is the part of the h264 bitstream
> that has cabac encoded data identifyable that easily, so it can be
> pre-read? I mean could the decoder know that the next N bits are part of
> cabac and could defer them? Or depends the range of cabac-related bits
> in the encoded bit stream on some bits that have to be decoded before?

The entire bitstream is CABAC (except for headers, which take negligible 

--Loren Merritt

More information about the ffmpeg-devel mailing list