Opened 9 years ago

Closed 8 years ago

Last modified 8 years ago

#1038 closed enhancement (fixed)

bitstream check when termination bin is 1

Reported by: PhuongNguyen Owned by:
Priority: minor Milestone: HM-11.0
Component: HM Version: HM-10.0
Keywords: Cc: fbossen, ksuehring, davidf, jct-vc@…

Description (last modified by ksuehring)

I would like to add the following check when termination bin (end_of_slice_segment_flag, pcm_flag and end_of_sub_stream_one_bit) is 1 in the function

Void TDecBinCABAC::decodeBinTrm( UInt& ruiBin )
{
  m_uiRange -= 2;
  UInt scaledRange = m_uiRange << 7;
  if( m_uiValue >= scaledRange )
  {
    ruiBin = 1;
    assert ((m_uiValue >> 7) & 1);
    UInt numBits = m_pcTComBitstream->getNumBitsUntilByteAligned();
    if(numBits)
    {
      assert(numBits <= m_pcTComBitstream->getNumBitsLeft());
      UInt code;
      m_pcTComBitstream->pseudoRead( numBits, code );
      assert(code == 0);
    }
  }
  else
...

Attachments (2)

1038.patch (879 bytes) - added by PhuongNguyen 9 years ago.
Patch for ticket #1038
1038.2.patch (713 bytes) - added by PhuongNguyen 9 years ago.
Patch for ticket #1038

Download all attachments as: .zip

Change History (14)

comment:1 Changed 9 years ago by DefaultCC Plugin

  • Cc fbossen ksuehring davidf jct-vc@… added

comment:2 Changed 9 years ago by ksuehring

  • Description modified (diff)
  • Priority changed from major to minor

comment:3 Changed 9 years ago by ksuehring

Can you please use a patch file to make clear, what lines are changed?

Changed 9 years ago by PhuongNguyen

Patch for ticket #1038

comment:4 Changed 9 years ago by PhuongNguyen

The patch file is attached.

comment:5 Changed 9 years ago by fbossen

assert ((m_uiValue >> 7) & 1) may or may not represent the last bit that was read. The patch looks incorrect to me.

Changed 9 years ago by PhuongNguyen

Patch for ticket #1038

comment:6 Changed 9 years ago by PhuongNguyen

The last bit here is the last bit inserted in ivlOffset described in "9.2.3.2.4 Decoding process for binary decisions before termination" in the text. It is not the last bit inserted in the reference software.

I also realized that the second check for remaining bits was not correct. A new patch file is attached.

comment:7 Changed 9 years ago by fbossen

My point is that bit values may be modified in m_uiValue. ((m_uiValue >> 7) & 1) may thus be different from the value of the last bit inserted.

comment:8 Changed 9 years ago by PhuongNguyen

(m_uiValue >> 7) is equal to ivlOffset and ivlOffset only contains bits from bitstream.

comment:9 Changed 9 years ago by fbossen

Yes, (m_uiValue >> 7) should be ivlOffset. My point is that between the time a bit is inserted into ivlOffset (for example as part of a renormD operation) and the time when you test it, the value of the bit within ivlOffset might have changed. The test is supposed to be with respect to the bit value that was read, not a bit value in ivlOffset.

comment:10 Changed 9 years ago by PhuongNguyen

There is no renormalization when we decode a termination bin and the bin value decoded is 1.

comment:11 Changed 8 years ago by fbossen

  • Milestone changed from HM-10.1 to HM-11.0
  • Resolution set to fixed
  • Status changed from new to closed

Fixed in r3474

comment:12 Changed 8 years ago by PhuongNguyen

The patch does not check the case where we decode pcm_flag, which is also a termination bin, and the result is 1. We should add the assert function in

Void TDecBinCABAC::decodeBinTrm( UInt& ruiBin )

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

  • David Flynn(Subscriber)
  • Frank Bossen(Subscriber, Participant)
  • jct-vc@…(Subscriber)
  • karl.sharman@…(Always)
  • Karsten Suehring(Subscriber, Participant, Always)