Log in

View Full Version : Intra chroma prediction (DC mode)


prrt
12th January 2012, 11:30
I can't understand how to calculate intra chroma prediction samples in DC mode, 4:2:0, 8 bit (intra_chroma_prediction_mode = 0 and
coded_block_pattern = 31).
Pre-LP filter samples (U-plane) of macroblock 1 (i.e. the second macroblock from the beginning) from attached file test.h264 are:
...................... 135 135 135 135
...................... 135 135 135 135
...................... 135 135 135 135
...................... 135 135 135 135
128 128 128 128 block 3 ................
128 128 128 128 ......................
128 128 128 128 ......................
128 128 128 128 ......................
So I expect that predicted samples of block 3 (in raster scan) of this macroblock (bold sample) will be (128 + 128 + 128 + 128 + 135 + 135 + 135 + 135 + 4 ) >> 3 = 132 but it is 128.

Please, could you help me: how to calculate chroma predicted samples? Why is it 128 and not 132 in this test?
I attached this test h264 file.

malikcis
12th January 2012, 14:40
Hi Prrt,
Sorry, I don't have answer to that question.
I just wanted to agree that the H.264 standard does not describe Intra chroma DC very well.
The guy who specified this was probably drunk.

maxlovic
28th January 2012, 07:59
Hi Prrt,

Intra 4x4 DC prediction mode is described in subclause 8.3.1.2.3 of H.264/AVC specification.
The macroblock you mention is a macroblock in the first macroblock row, which doesn't have prediction samples above, so instead of equation 8-48, you should use equation 8-49.
So block 3 will be (128 + 128 + 128 + 128 + 2) >> 2 = 128.

Regards.