View Single Post
Old 21st April 2020, 09:53   #1  |  Link
prrt
Registered User
 
Join Date: Jan 2008
Posts: 6
JM reference H.264 decoder mismatch the standard?

Hi,

It seems that there is an error in JM H.264 reference decoder in deblocking process of MbAff frames for luma field macroblocks. The following is for JM 11.0 but the same problem also exists in newer versions.

The possible error is in calculating pixQ.pos_y in loopfilter.c. In EdgeLoop() the function getNeighbour() is used for it.
Pos_y calculated in get_mb_pos(), get_mb_block_pos() as

y = (((mb_addr / 2) / PicWidthInMbs) * 2 + (mb_addr % 2)) * 16; i.e.
y = ((mb_addr / 2) / PicWidthInMbs) * 32 + ((mb_addr % 2) * 16)

It is a position of the upper-left luma sample of the macroblock CurrMbAddr and it is determined in the standard (subclause 8.7.1) as inverse macroblock scanning process (6.4.1) and assigned to yI:

y = ((mb_addr / 2) / (PicWidthInSamples / 16)) * 32 + (mb_addr % 2); i.e.
y = ((mb_addr /2) / PicWidthInMbs) * 32 + (mb_addr % 2)

So for odd values of mb_addr the result in JM is wrong.

Any thoughts?
prrt is offline   Reply With Quote