﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
830	mismatch between WD and HM for inferring significant_coeff_flag at last position in TU	vsze	bbross	"There seems to be a mis-match between semantics, syntax table and HM regarding whether significant_coeff_flag should be inferred for the last position in the TU. 

In the WD semantics it says that significant_coeff_flag is inferred for the last position; however, this is not the case in HM-9.0.  

Note that this also means the ctxIdxMap must be defined for i=15 (ctxIdxMap[15]=8), since there can be a possible to signal significant_coeff_flag at (3,3) position of 4x4 TU.

In WD9 (7.4.9.11 Residual coding semantics):
When significant_coeff_flag[ xC ][ yC ] is not present, it is inferred as follows.
–	'''If ( xC, yC ) is the last significant location ( LastSignificantCoeffX, LastSignificantCoeffY ) in scan order''' or both of the following conditions are true, significant_coeff_flag[ xC ][ yC ] is inferred to be equal to 1.

In HM-9.0, significant_coeff_flag is only inferred when numNonzero=0; however, for last position numNonZero is set to 1.

    if( iScanPosSig == (Int) uiScanPosLast )
    {
      lastNZPosInCG  = iScanPosSig;
      firstNZPosInCG = iScanPosSig;
      iScanPosSig--;
      pos[ numNonZero ] = uiBlkPosLast;
      '''numNonZero = 1;''' 
    }

...

if( uiSigCoeffGroupFlag[ iCGBlkPos ] )
      {
        if( iScanPosSig > iSubPos | | iSubSet == 0  | | '''numNonZero''' )
        {
          uiCtxSig  = TComTrQuant::getSigCtxInc( patternSigCtx, uiScanIdx, uiPosX, uiPosY, blockType, uiWidth, uiHeight, eTType );
          m_pcTDecBinIf->decodeBin( uiSig, baseCtx[ uiCtxSig ] );
        }
        else
        {
          uiSig = 1;
        }
      }"	defect	closed	minor	HM-9.1	Text	D9 (K1003) v4	fixed		bbross wjhan jct-vc@…
