﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
297	Context increment for coeff_abs_level_greater1_flag does not match HM-5.1	pieterkapsenberg	bbross	"I have noticed what looks like a discrepancy between the draft spec and HM-5.1. It is regarding the context increment derivation of coeff_abs_level_greater1_flag.
	
The spec says the following:
- If n is equal to 15 or all previous syntax elements coeff_abs_level_greater1_flag[pos] with pos greater than n are derived to be equal to 0 instead of being explicitly parsed, the following applies.
  - ....
  - When the subset i is not the first one to be processed in this subclause, the following applies.
    - The variable numGreater1 is set equal to the variable numGreater1 that has been derived during the last invocation of subclause 9.3.3.1.1.6 for the syntax element coeff_abs_level_greater2_flag for the subset i + 1.
    - When (numGreater1 >> 1) is greater than 0, ctxSet is incremented by one as follows.
      ctxSet  =  ctxSet + 1


In HM-5.1, the comparison above is done before the downshift (TDecSbac.cpp, line 1937):
      UInt uiCtxSet    = (iSubSet > 0 && eTType==TEXT_LUMA) ? 3 : 0;
      if( uiNumOne > 0 )
      {
        uiCtxSet++;
        if(eTType==TEXT_LUMA && uiNumOne > 3)
        {
          uiCtxSet++;
        }
      }
	      
      uiNumOne       >>= 1;

I think this can be fixed in the working draft by simply removing the downshift in the comparison
"	defect	closed	minor	D7	Text	D6 (H1003) dG	fixed	coeff_abs_level_greater1_flag context increment	jct-vc@… bbross wjhan
