[FFmpeg-devel] [PATCH] Indeo5 decoder

Maxim max_pole
Mon Mar 30 13:50:23 CEST 2009

Kostya schrieb:
> On Mon, Mar 30, 2009 at 12:57:42PM +0200, Maxim wrote:
>> John Cox schrieb:
>>>> Hmm, there are three different macroblock sizes: 16x16, 8x8 and 4x4.
>>>> Otherwise the term "macroblock" has the same meaning as by the MPEG...
>>>> No idea how to make it more descriptive...
>>> In which standard is a Macroblock not 16x16?  I'll certainly grant block sizes
>>> of 8x8 and 4x4 but in MPEG-1/2, MPEG4-2, H.263, H.264 they all combine to give
>>> a macroblock size of 16x16.
>> It's abit different in the Indeo5: there are 3 macroblock sizes as I
>> mentioned above. A macroblock can include one or four blocks depending
>> on its size. The relation between macroblocks and blocks is the following:
>> For luminance plane
>> mb_size = 16x16 -> block_size = 8x8 -> blocks_per_mb = 4
>> mb_size = 8x8     -> block_size = 8x8 -> blocks_per_mb = 1
>> For chrominance planes
>> mb_size = 8x8     -> block_size = 4x4 -> blocks_per_mb = 4
>> mb_size = 4x4     -> block_size = 8x8 -> blocks_per_mb = 1
>> As you can see above there are two cases where mb_size == block_size.
>> The main difference between those is that a macroblock can have a motion
>> vector/quant delta associated with it and these are shared between all
>> blocks in the same mb...
> sounds like typical motion partitioning - you have 16x16 macroblock but motion
> vector may be one for 4, 2 or one 8x8 block.

Not exact, but the idea is correct. The main difference is that the
chrominance planes are coded using 4x4 blocks.
I think it was done in order to allow the algorithm to adapt on
different kinds of videos. An encoder can choose between different
mb/block sizes according to the user constraints like quality, picture
size, speed an so on. For example:

- big picture, normal quality, few motion:
mb_size = 16, blk_size = 8 for luminance
mb_size = 8,   blk_size = 4 for chrominance

- small picture, high quality, lot of motion:
mb_size = 8, blk_size = 8 for luminance
mb_size = 4, blk_size = 4 for chrominance

Note that the color planes are coded independently and not intermixed in
the bitstream as in the MPEG1... Chrominance mbs usually inherit motion
vectors from the corresponding mbs in the luminance plane.
The most videos I have uses mb_size = 16x16 for luminance and mb_size =
4x4 for chrominance and the motion resolution = halfpel.
But I have two videos captured probably using a webcam as well that use
only the fullpel motion resolution...


More information about the ffmpeg-devel mailing list