Opened 12 years ago Closed 12 years ago #994 closed defect (fixed)Emulation prevention bytes igonred by HM decoder to calculate entry_point_offset[ i ] when entropy_coding_sync_enabled_flag is enabled.
Description
The section 7.9.4.1 of standard says that emulation prevention bytes are included to calculate entry_point_offset[i] where i = 0 to num_entry_point_offsets, when entropy_coding_sync_enabled_flag is equal to 1. However it seems like HM 9.1 decoder is reading the substream in TComInputBitstream::extractSubstream() (after having removed the emualtion prevention bytes). This means there implementation assumes that entry point offset does not include the number of emulation prevention bytes. Attachments (2)Change History (13)comment:1 Changed 12 years ago by DefaultCC Plugin
comment:2 Changed 12 years ago by chethan879
comment:3 Changed 12 years ago by ksuehringChanged 12 years ago by chethan879
stream with entropy sync enabled in which HM 9.1 decoder crashes after decoding one CTB row. The docoding of second row starts at wrong offset as it ignores the emuation prevention bytes in the first CTB row. comment:4 Changed 12 years ago by chethan879
I am sorry i had attached a wrong file. I have replaced the older file with bitstream which crashes when tried decoding with HM 9.1 and the description holds good for this file. I confirm that i am using unmodified version of HM 9.1 decoder. The following code snippet is used to extract substream based on entry_point_offset.
Function - Void TDecGop::decompressSlice(TComInputBitstream* pcBitstream, TComPic*& rpcPic) UInt uiNumSubstreams = pcSlice->getPPS()->getEntropyCodingSyncEnabledFlag() ? pcSlice->getNumEntryPointOffsets()+1 : pcSlice->getPPS()->getNumSubstreams(); // init each couple {EntropyDecoder, Substream} UInt *puiSubstreamSizes = pcSlice->getSubstreamSizes(); ppcSubstreams = new TComInputBitstream*[uiNumSubstreams]; m_pcSbacDecoders = new TDecSbac[uiNumSubstreams]; m_pcBinCABACs = new TDecBinCABAC[uiNumSubstreams]; for ( UInt ui = 0 ; ui < uiNumSubstreams ; ui++ ) { m_pcSbacDecoders[ui].init(&m_pcBinCABACs[ui]); ppcSubstreams[ui] = pcBitstream->extractSubstream(ui+1 < uiNumSubstreams ? puiSubstreamSizes[ui] : pcBitstream->getNumBitsLeft()); }
The value of entry_point_offset is used to extract the substream and HM 9.1 decoder does not include emulation prevention bytes. comment:5 follow-up: ↓ 6 Changed 12 years ago by kiranmisra
Would it be possible to share the exact location of the emulation prevention bytes (in the NALU) and the CTB row sizes as seen by the encoder (in entropy_sync_enabled.265)? If the bitstream is generated using HM, could you please share the HM version and encoder configuration used so that the problem can be reproduced. comment:6 in reply to: ↑ 5 Changed 12 years ago by chethan879
Replying to kiranmisra:
I am not using HM encoder to generate bitstream. I am using a fixed CTB size of 64x64 and encoding entire frame as single slice. The uploaded file is single IDR frame(blank content) The offset of first emulation prevention bytes in slice data (we can ignore emulation prevention bytes in header data as this will not affect entry_point_offset) is listed below
I have tested our encoder's entropy sync feature for other contents and i dont see any mismatch between our encoder and HM decoder(version 9.1). I did not observe emulation prevention bytes in slice data of streams which passed the test. However when i try to encode blank frame( this increases possiblity of emulation prevention bytes) i see mismatch in trace of decoder at start of second row. The decoder starts decoding the second row at wrong offset, the difference in offset of start of actual second row data and offset where decoder starts decoding is same as number of emulation prevention bytes inserted in first CTB row. comment:7 Changed 12 years ago by kiranmisra
Thank you for the explanation of the contents within the bitstream entropy_sync_enabled.265. Attached is a proposed patch which keeps track of emulation prevention bytes within a NALU. The decoder uses this information to update the entry point information. The proposed patch also updates the encoder to include emulation prevention bytes when determining entry point information for wavefront substreams. comment:8 Changed 12 years ago by chethan879
Thank you for the patch. The problem seems to have got resolved with this patch. Please let me know when this change gets reflected in main release of HM. comment:9 Changed 12 years ago by ksuehring
I have adapted the patch to HM-10.0-dev and applied it in r3363 comment:10 Changed 12 years ago by ksuehring
The applied patch has bug that results in failure to count consecutive start code emulations properly. comment:11 Changed 12 years ago by ksuehring
The code has been fixed in r3376. The fix also resolves the same issue for tiles. 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
|
I just decoded with HM-9.1. As far as I know, these offsets are not used in the decoder. Are you using a modified software like the one in #942?