47 #if RExt__DECODER_DEBUG_BIT_STATISTICS
50 #if ENC_DEC_TRACE && DEC_NUH_TRACE
61 vector<uint8_t>::iterator it_read, it_write;
65 for (it_read = it_write = nalUnitBuf.begin(); it_read != nalUnitBuf.end(); it_read++, it_write++, pos++)
67 assert(zeroCount < 2 || *it_read >= 0x03);
68 if (zeroCount == 2 && *it_read == 0x03)
74 #if RExt__DECODER_DEBUG_BIT_STATISTICS
77 if (it_read == nalUnitBuf.end())
81 assert(*it_read <= 0x03);
83 zeroCount = (*it_read == 0x00) ? zeroCount+1 : 0;
86 assert(zeroCount == 0);
93 while (it_write[-1] == 0x00)
101 printf(
"\nDetected %d instances of cabac_zero_word\n", n/2);
105 nalUnitBuf.resize(it_write - nalUnitBuf.begin());
108 #if ENC_DEC_TRACE && DEC_NUH_TRACE
113 fprintf( g_hTrace,
"%8lld ", g_nSymbolCounter++ );
114 fprintf( g_hTrace,
"%-50s u(%d) : %u\n",
"forbidden_zero_bit", 1, 0 );
116 fprintf( g_hTrace,
"%8lld ", g_nSymbolCounter++ );
117 fprintf( g_hTrace,
"%-50s u(%d) : %u\n",
"nal_unit_type", 6, nalu.
m_nalUnitType );
119 fprintf( g_hTrace,
"%8lld ", g_nSymbolCounter++ );
120 fprintf( g_hTrace,
"%-50s u(%d) : %u\n",
"nuh_layer_id", 6, nalu.
m_nuhLayerId );
122 fprintf( g_hTrace,
"%8lld ", g_nSymbolCounter++ );
123 fprintf( g_hTrace,
"%-50s u(%d) : %u\n",
"nuh_temporal_id_plus1", 3, nalu.
m_temporalId + 1 );
133 Bool forbidden_zero_bit = bs.
read(1);
134 assert(forbidden_zero_bit == 0);
138 #if RExt__DECODER_DEBUG_BIT_STATISTICS
142 #if ENC_DEC_TRACE && DEC_NUH_TRACE
143 xTraceNalUnitHeader(nalu);
178 vector<uint8_t>& nalUnitBuf=bitstream.
getFifo();
const TChar * nalUnitTypeToString(NalUnitType type)
reading functionality for NAL units
global variables & functions (header)
Void readNalUnitHeader(InputNALUnit &nalu)
NalUnitType m_nalUnitType
nal_unit_type
static Void convertPayloadToRBSP(vector< uint8_t > &nalUnitBuf, TComInputBitstream *bitstream, Bool isVclNalUnit)
class for handling bitstream (header)
UInt m_nuhLayerId
nuh_layer_id
Void read(InputNALUnit &nalu)
UInt m_temporalId
temporal_id
static Void IncrementStatisticEP(const TComCodingStatisticsClassType &stat, const Int numBits, const Int value)