Changeset 189 in SHVCSoftware for trunk/source/Lib/TLibDecoder/NALread.cpp
- Timestamp:
- 13 May 2013, 16:58:44 (12 years ago)
- Location:
- trunk/source
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source
- Property svn:mergeinfo changed
/branches/SHM-2.0-dev/source (added) merged: 133-167,169-182,184-188
- Property svn:mergeinfo changed
-
trunk/source/Lib/TLibDecoder/NALread.cpp
r125 r189 50 50 //! \ingroup TLibDecoder 51 51 //! \{ 52 static void convertPayloadToRBSP(vector<uint8_t>& nalUnitBuf, Bool isVclNalUnit)52 static void convertPayloadToRBSP(vector<uint8_t>& nalUnitBuf, TComInputBitstream *bitstream, Bool isVclNalUnit) 53 53 { 54 54 UInt zeroCount = 0; 55 55 vector<uint8_t>::iterator it_read, it_write; 56 56 57 for (it_read = it_write = nalUnitBuf.begin(); it_read != nalUnitBuf.end(); it_read++, it_write++) 57 UInt pos = 0; 58 bitstream->clearEmulationPreventionByteLocation(); 59 for (it_read = it_write = nalUnitBuf.begin(); it_read != nalUnitBuf.end(); it_read++, it_write++, pos++) 58 60 { 59 61 assert(zeroCount < 2 || *it_read >= 0x03); 60 62 if (zeroCount == 2 && *it_read == 0x03) 61 63 { 64 bitstream->pushEmulationPreventionByteLocation( pos ); 65 pos++; 62 66 it_read++; 63 67 zeroCount = 0; … … 109 113 if ( nalu.m_temporalId ) 110 114 { 111 assert( nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_BLA 112 && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_BLA NT115 assert( nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_BLA_W_LP 116 && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_BLA_W_RADL 113 117 && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_BLA_N_LP 114 && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_IDR 118 && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_IDR_W_RADL 115 119 && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_IDR_N_LP 116 120 && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_CRA … … 122 126 else 123 127 { 124 assert( nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_TLA 128 assert( nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_TLA_R 125 129 && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_TSA_N 126 130 && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_STSA_R … … 136 140 /* perform anti-emulation prevention */ 137 141 TComInputBitstream *pcBitstream = new TComInputBitstream(NULL); 138 convertPayloadToRBSP(nalUnitBuf, (nalUnitBuf[0] & 64) == 0);142 convertPayloadToRBSP(nalUnitBuf, pcBitstream, (nalUnitBuf[0] & 64) == 0); 139 143 140 144 nalu.m_Bitstream = new TComInputBitstream(&nalUnitBuf); 145 nalu.m_Bitstream->setEmulationPreventionByteLocation(pcBitstream->getEmulationPreventionByteLocation()); 141 146 delete pcBitstream; 142 147 readNalUnitHeader(nalu);
Note: See TracChangeset for help on using the changeset viewer.