﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
290	Mismatch on collocated subblock location in SbTMVP between VTM and spec	chhuanb		"In specification, the collocated location of each sub-block is derived as follow (in clause 8.5.5.3):

{{{
–	The luma location ( xSb, ySb ) specifying the top-left sample of the current coding subblock relative to the top left luma sample of the current picture is derived as follows:
xSb  =  xCb + xSbIdx * sbWidth		(8 538)
ySb  =  yCb + ySbIdx * sbHeight		(8 539)
–	The location ( xColSb, yColSb ) of the collocated subblock inside ColPic is derived as follows.
xColSb = Clip3( xCtb, 
	Min( CurPicWidthInSamplesY − 1, xCtb + ( 1  <<  CtbLog2SizeY ) + 3 ),	(8 540)
 	xSb + ( tempMv[0]  >>  4 ) )
yColSb = Clip3( yCtb, 
	Min( CurPicHeightInSamplesY − 1, yCtb + ( 1  <<  CtbLog2SizeY ) − 1 ),	(8 541)
 	ySb + ( tempMv[1]  >>  4 ) )
}}}
which means the collocated location is equal to ""top-left sample location + temporal motion vector"".

In VTM, the collocated location of each sub-block is derived as follow (in function getInterMergeSubPuMvpCand):

{{{
  int xOff = (puWidth >> 1) + tempX;
  int yOff = (puHeight >> 1) + tempY;

  MotionBuf& mb = mrgCtx.subPuMvpMiBuf;

  const bool isBiPred = isBipredRestriction(pu);

  for (int y = puPos.y; y < puPos.y + puSize.height; y += puHeight)
  {
    for (int x = puPos.x; x < puPos.x + puSize.width; x += puWidth)
    {
      Position colPos{ x + xOff, y + yOff };
      clipColPos(colPos.x, colPos.y, pu);
      ...
      ...
    }
  }
}}}
which means the collocated location is equal to ""below-right center sample location + temporal motion vector"".

It is suggested to align spec to software as follow:

{{{
–	The luma location ( xSb, ySb ) specifying the below-right center sample of the current coding subblock relative to the top left luma sample of the current picture is derived as follows:
xSb  =  xCb + xSbIdx * sbWidth + (sbWidth >> 1)		        (8 538)
ySb  =  yCb + ySbIdx * sbHeight + (sbHeight >> 1)		(8 539)
–	The location ( xColSb, yColSb ) of the collocated subblock inside ColPic is derived as follows.
xColSb = Clip3( xCtb, 
	Min( CurPicWidthInSamplesY − 1, xCtb + ( 1  <<  CtbLog2SizeY ) + 3 ),	(8 540)
 	xSb + ( tempMv[0]  >>  4 ) )
yColSb = Clip3( yCtb, 
	Min( CurPicHeightInSamplesY − 1, yCtb + ( 1  <<  CtbLog2SizeY ) − 1 ),	(8 541)
 	ySb + ( tempMv[1]  >>  4 ) )
}}}
"	defect	closed	minor		spec	VVC D5 v10	fixed		ksuehring bbross XiangLi fbossen jvet@…
