[x264-devel] Description of Macroblock types in file 'macroblock.h'

Loren Merritt lorenm at u.washington.edu
Fri Oct 19 00:29:32 CEST 2007


On Thu, 18 Oct 2007, Fabrice DELANNAY wrote:

> I hope this question is not inappropriate to be posted in the mailing
> list, but I have some problem to anderstand the definition of the
> macroblock modes in the file macroblock.h.
>
> I know only the following issues for a macroblock with type B:
>
> 1- keep one reference frame in List0
> 2- keep one reference frame in List1

yes

> 3- keep two reference frames in List0
> 4- keep two reference frames in List1

not possible

> 5- keep two reference frames, one in List0 & one in List1

yes

> So I imagine that in the x264 code:
> mb.i_type = B_L0_L0 stands for for case 3,
> mb.i_type = B_L1_L1 stands for for case 4,
> mb.i_type = B_L0_L1 or mb.i_type = B_L1_L0 stands for for case 5,
>
> but thus I can't anderstand what does B_L0_BI,B_L1_BI,...,B_BI_BI stand for??
>
> And what's happen in case of only one reference from List1 used for a
> B-block?? I can't use a simple P-block, because sometimes i want make sure
> that the current frame use a future frame as reference, and the list0 can
> only load past reference.
>
> Any explanation would be greatly appreciated. Thank you.

The macroblock enum uses the same terminology as specified in the 
standard (table 7-14), which is not necessarily the most logical. I've 
been meaning to change it to ffmpeg's system, where all the macroblock 
information (parition size, dct size, interlace, reference lists...) are 
flags rather than separate variables/enums.
The two suffixes refer to different partitions. B_L0_L0 is either a 16x16 
partition predicted from L0, or 16x8 or 8x16 partitions with both 
partitions predicted from L0. BI means this partition uses two reference 
frames, which can only be one from L0 and one from L1.

--Loren Merritt



More information about the x264-devel mailing list