Opened 12 years ago Closed 12 years ago #904 closed defect (fixed)Mismatch with HM in derivation of ctxIdxInc for coeff_abs_level_greater1_flag
Description
In some corner cases, the text and HM disagree on the value of lastGreater1Ctx.
In 9.2.3.1.5 "Derivation process of ctxIdxInc for the syntax element coeff_abs_level_greater1_flag" the variable lastGreater1Ctx is derived from the value of greater1Ctx in a previous subblock.
In the HM code, greater1Ctx is set to 0 as soon as a nonzero value for coeff_abs_level_greater1_flag is decoded:
See lines 1222->1229 of TDecSbac.cpp:
However, in the text, greater1Ctx is only cleared indirectly via the variable lastGreater1Flag.
The difference occurs when coeff_abs_level_greater1_flag is set and n equals 0 and greater1Ctx is nonzero. The next time the process is called, it now has a different sub-block scan index i, and so the code that would clear greater1Ctx is not invoked.
This means that the reference code ends up with greater1Ctx=0, while the text still has greater1Ctx != 0. Change History (8)comment:1 Changed 12 years ago by DefaultCC Plugin
comment:2 Changed 12 years ago by bbross
comment:3 Changed 12 years ago by bbross
comment:4 Changed 12 years ago by bbross
comment:5 Changed 12 years ago by bbross
comment:6 Changed 12 years ago by bbrosscomment:7 Changed 12 years ago by bbross
After discussion with my colleague Tung and some thoughts, the afore proposed solution has the issue that the current syntax element coeff_abs_level_greater1_flag is currently being parsed and not available yet so you have to update the greater1Ctx at the beginning of the next invocation. That was also the reason why we had to arrange it that way, i.e. a bit different as in HM.
The solution would be to include the missing modification of greater1Ctx also for the first invokation in a sub-block as follows:
"Otherwise, the variable lastGreater1Ctx is set equal to the value of greater1Ctx that has been derived during the last invocation of the process specified in this subclause for the syntax element coeff_abs_level_greater1_flag for the previous sub-block with scan index i + 1."
by
"Otherwise, the following applies:
comment:8 Changed 12 years ago by bbross
Fixed in v31. Note: See
TracTickets for help on using
tickets. | This list contains all users that will be notified about changes made to this ticket. These roles will be notified: Reporter, Owner, Subscriber, Participant
|
Good catch! This will be fixed in the next version (v30) by removing:
"When greater1Ctx is greater than 0, the variable lastGreater1Flag is set equal to the syntax element coeff_abs_level_greater1_flag that has been used during the last invocation of the process specified in this subclause and greater1Ctx is modified as follows:
– If lastGreater1Flag is equal to 1, greater1Ctx is set equal to 0.
– Otherwise (lastGreater1Flag is equal to 0), greater1Ctx is incremented by 1.
"
and adding the following at the end of the sub clause as it is done in HM:
"When greater1Ctx is greater than 0, greater1Ctx is modified as follows:
– If coeff_abs_level_greater1_flag[ n ] is equal to 1, greater1Ctx is set equal to 0.
– Otherwise (If coeff_abs_level_greater1_flag[ n ] is equal to 0), greater1Ctx is incremented by 1.
"