Opened 11 years ago

Closed 11 years ago

#904 closed defect (fixed)

Mismatch with HM in derivation of ctxIdxInc for coeff_abs_level_greater1_flag

Reported by: peterderivaz Owned by: bbross
Priority: minor Milestone: D10
Component: Text Version: D10 (L1003) v28
Keywords: Cc: bbross, wjhan, jct-vc@…

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:

if( uiBin == 1 )
{

c1 = 0;
if (firstC2FlagIdx == -1)
{

firstC2FlagIdx = idx;

}

}

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 11 years ago by DefaultCC Plugin

  • Cc bbross wjhan jct-vc@… added

comment:2 Changed 11 years ago by bbross

  • Version changed from D9 (K1003) v11 to D10 (L1003) v1

comment:3 Changed 11 years ago by bbross

  • Milestone set to D10

comment:4 Changed 11 years ago by bbross

  • Version changed from D10 (L1003) v1 to D10 (L1003) v2

comment:5 Changed 11 years ago by bbross

  • Version changed from D10 (L1003) v2 to D10 (L1003) v28

comment:6 Changed 11 years ago by bbross

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.
"

comment:7 Changed 11 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:
Replace:

"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:

– 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 a previous sub-block.
– When lastGreater1Ctx 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 for a previous sub-block and lastGreater1Ctx is modified as follows:

o If lastGreater1Flag is equal to 1, lastGreater1Ctx is set equal to 0.
o Otherwise (lastGreater1Flag is equal to 0), lastGreater1Ctx is incremented by 1."

comment:8 Changed 11 years ago by bbross

  • Resolution set to fixed
  • Status changed from new to closed

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

  • Benjamin Bross(Owner, Subscriber, Participant)
  • jct-vc@…(Subscriber)
  • karl.sharman@…(Always)
  • Karsten Suehring(Always)
  • Peter de Rivaz(Reporter)
  • Woo-Jin Han(Subscriber)