Changeset 916 in SHVCSoftware for branches/SHM-upgrade/source/Lib/TLibDecoder/AnnexBread.cpp
- Timestamp:
- 12 Nov 2014, 08:09:17 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-upgrade/source/Lib/TLibDecoder/AnnexBread.cpp
r595 r916 42 42 #include <vector> 43 43 #include "AnnexBread.h" 44 #if RExt__DECODER_DEBUG_BIT_STATISTICS 45 #include "TLibCommon/TComCodingStatistics.h" 46 #endif 44 47 45 48 using namespace std; … … 56 59 * be correct at this point. 57 60 */ 58 static void61 static Void 59 62 _byteStreamNALUnit( 60 63 InputByteStream& bs, … … 70 73 * 0x00000001. 71 74 */ 75 #if RExt__DECODER_DEBUG_BIT_STATISTICS 76 TComCodingStatistics::SStat &statBits=TComCodingStatistics::GetStatisticEP(STATS__NAL_UNIT_PACKING); 77 #endif 72 78 while ((bs.eofBeforeNBytes(24/8) || bs.peekBytes(24/8) != 0x000001) 73 79 && (bs.eofBeforeNBytes(32/8) || bs.peekBytes(32/8) != 0x00000001)) 74 80 { 75 81 uint8_t leading_zero_8bits = bs.readByte(); 82 #if RExt__DECODER_DEBUG_BIT_STATISTICS 83 statBits.bits+=8; statBits.count++; 84 #endif 76 85 assert(leading_zero_8bits == 0); 77 86 stats.m_numLeadingZero8BitsBytes++; … … 89 98 { 90 99 uint8_t zero_byte = bs.readByte(); 100 #if RExt__DECODER_DEBUG_BIT_STATISTICS 101 statBits.bits+=8; statBits.count++; 102 #endif 91 103 assert(zero_byte == 0); 92 104 stats.m_numZeroByteBytes++; … … 100 112 /* NB, (1) guarantees that the next three bytes are 0x00 00 01 */ 101 113 uint32_t start_code_prefix_one_3bytes = bs.readBytes(24/8); 114 #if RExt__DECODER_DEBUG_BIT_STATISTICS 115 statBits.bits+=24; statBits.count+=3; 116 #endif 102 117 assert(start_code_prefix_one_3bytes == 0x000001); 103 118 stats.m_numStartCodePrefixBytes += 3; … … 117 132 */ 118 133 /* NB, (unsigned)x > 2 implies n!=0 && n!=1 */ 119 while (bs.eofBeforeNBytes(24/8) || bs.peekBytes(24/8) > 2) 134 #if RExt__DECODER_DEBUG_BIT_STATISTICS 135 TComCodingStatistics::SStat &bodyStats=TComCodingStatistics::GetStatisticEP(STATS__NAL_UNIT_TOTAL_BODY); 136 #endif 137 while (bs.eofBeforeNBytes(24/8) || bs.peekBytes(24/8) > 2) 120 138 { 139 #if RExt__DECODER_DEBUG_BIT_STATISTICS 140 uint8_t thebyte=bs.readByte();bodyStats.bits+=8;bodyStats.count++; 141 nalUnit.push_back(thebyte); 142 #else 121 143 nalUnit.push_back(bs.readByte()); 144 #endif 122 145 } 123 146 124 147 /* 5. When the current position in the byte stream is: 125 148 * - not at the end of the byte stream (as determined by unspecified means) … … 141 164 { 142 165 uint8_t trailing_zero_8bits = bs.readByte(); 166 #if RExt__DECODER_DEBUG_BIT_STATISTICS 167 statBits.bits+=8; statBits.count++; 168 #endif 143 169 assert(trailing_zero_8bits == 0); 144 170 stats.m_numTrailingZero8BitsBytes++;
Note: See TracChangeset for help on using the changeset viewer.