#1038 closed enhancement (fixed)bitstream check when termination bin is 1
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)Change History (14)comment:1 Changed 12 years ago by DefaultCC Plugin
comment:2 Changed 12 years ago by ksuehring
comment:3 Changed 12 years ago by ksuehringcomment:4 Changed 12 years ago by PhuongNguyen
The patch file is attached. comment:5 Changed 12 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. comment:6 Changed 12 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 12 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 12 years ago by PhuongNguyen
(m_uiValue >> 7) is equal to ivlOffset and ivlOffset only contains bits from bitstream. comment:9 Changed 12 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 12 years ago by PhuongNguyen
There is no renormalization when we decode a termination bin and the bin value decoded is 1. comment:11 Changed 12 years ago by fbossen
Fixed in r3474 comment:12 Changed 12 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
|
Can you please use a patch file to make clear, what lines are changed?