Ignore:
Timestamp:
12 Apr 2018, 11:12:21 (7 years ago)
Author:
tech
Message:
  • Update HM-16.18
  • Cleanups
  • Encoder Extension

-- Representation formats
-- Parameter set sharing
-- GOP configuration

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-16.2-dev/source/Lib/TLibDecoder/SyntaxElementParser.cpp

    r1405 r1412  
    44* granted under this license.
    55*
    6 * Copyright (c) 2010-2016, ITU/ISO/IEC
     6* Copyright (c) 2010-2017, ITU/ISO/IEC
    77* All rights reserved.
    88*
     
    4949#if ENC_DEC_TRACE
    5050
     51Void  xTraceAccessUnitDelimiter ()
     52{
     53  fprintf( g_hTrace, "=========== Access Unit Delimiter ===========\n");
     54}
     55
     56Void xTraceFillerData ()
     57{
     58  fprintf( g_hTrace, "=========== Filler Data ===========\n");
     59}
     60
     61#endif
     62
     63#if DECODER_PARTIAL_CONFORMANCE_CHECK!=0
     64Void SyntaxElementParser::xReadCodeChk ( UInt   length, UInt& val, const TChar *pSymbolName, const UInt minValIncl, const UInt maxValIncl )
     65{
     66  READ_CODE(length, val, pSymbolName);
     67  TDecConformanceCheck::checkRange(val, pSymbolName, minValIncl, maxValIncl);
     68}
     69#if NH_MV
     70
    5171Void  SyntaxElementParser::xReadCodeTr           (UInt length, UInt& rValue, const TChar *pSymbolName)
    5272{
     
    175195}
    176196
    177 #endif
    178 
    179197
    180198// ====================================================================================================================
     
    194212}
    195213
    196 #if RExt__DECODER_DEBUG_BIT_STATISTICS
    197 Void SyntaxElementParser::xReadUvlc( UInt& ruiVal, const TChar *pSymbolName)
    198 #else
    199 Void SyntaxElementParser::xReadUvlc( UInt& ruiVal)
     214#else
     215
     216Void SyntaxElementParser::xReadUvlcChk ( UInt&  val, const TChar *pSymbolName, const UInt minValIncl, const UInt maxValIncl )
     217{
     218  READ_UVLC(val, pSymbolName);
     219  TDecConformanceCheck::checkRange(val, pSymbolName, minValIncl, maxValIncl);
     220}
     221
     222Void SyntaxElementParser::xReadSvlcChk ( Int&   val, const TChar *pSymbolName, const Int  minValIncl, const Int  maxValIncl )
     223{
     224  READ_SVLC(val, pSymbolName);
     225  TDecConformanceCheck::checkRange(val, pSymbolName, minValIncl, maxValIncl);
     226}
     227
     228Void SyntaxElementParser::xReadFlagChk ( UInt&  val, const TChar *pSymbolName, const UInt minValIncl, const UInt maxValIncl )
     229{
     230  READ_FLAG(val, pSymbolName);
     231  TDecConformanceCheck::checkRange(val, pSymbolName, minValIncl, maxValIncl);
     232}
     233#endif
     234#endif
     235
     236// ====================================================================================================================
     237// Protected member functions
     238// ====================================================================================================================
     239#if RExt__DECODER_DEBUG_BIT_STATISTICS || ENC_DEC_TRACE
     240Void SyntaxElementParser::xReadCode (UInt uiLength, UInt& rValue, const TChar *pSymbolName)
     241#else
     242Void SyntaxElementParser::xReadCode (UInt uiLength, UInt& rValue)
     243#endif
     244{
     245  assert ( uiLength > 0 );
     246  m_pcBitstream->read (uiLength, rValue);
     247#if RExt__DECODER_DEBUG_BIT_STATISTICS
     248  TComCodingStatistics::IncrementStatisticEP(pSymbolName, uiLength, rValue);
     249#endif
     250#if ENC_DEC_TRACE
     251  fprintf( g_hTrace, "%8lld  ", g_nSymbolCounter++ );
     252  if (uiLength < 10)
     253  {
     254    fprintf( g_hTrace, "%-50s u(%d)  : %u\n", pSymbolName, uiLength, rValue );
     255  }
     256  else
     257  {
     258    fprintf( g_hTrace, "%-50s u(%d) : %u\n", pSymbolName, uiLength, rValue );
     259  }
     260  fflush ( g_hTrace );
     261#endif
     262}
     263
     264
     265#if RExt__DECODER_DEBUG_BIT_STATISTICS || ENC_DEC_TRACE
     266Void SyntaxElementParser::xReadUvlc( UInt& rValue, const TChar *pSymbolName)
     267#else
     268Void SyntaxElementParser::xReadUvlc( UInt& rValue)
    200269#endif
    201270{
     
    226295  }
    227296
    228   ruiVal = uiVal;
    229 #if RExt__DECODER_DEBUG_BIT_STATISTICS
    230   TComCodingStatistics::IncrementStatisticEP(pSymbolName, Int(totalLen), ruiVal);
    231 #endif
    232 }
    233 
    234 #if RExt__DECODER_DEBUG_BIT_STATISTICS
    235 Void SyntaxElementParser::xReadSvlc( Int& riVal, const TChar *pSymbolName)
    236 #else
    237 Void SyntaxElementParser::xReadSvlc( Int& riVal)
     297  rValue = uiVal;
     298#if RExt__DECODER_DEBUG_BIT_STATISTICS
     299  TComCodingStatistics::IncrementStatisticEP(pSymbolName, Int(totalLen), rValue);
     300#endif
     301
     302#if ENC_DEC_TRACE
     303  fprintf( g_hTrace, "%8lld  ", g_nSymbolCounter++ );
     304  fprintf( g_hTrace, "%-50s ue(v) : %u\n", pSymbolName, rValue );
     305  fflush ( g_hTrace );
     306#endif
     307}
     308
     309#if RExt__DECODER_DEBUG_BIT_STATISTICS || ENC_DEC_TRACE
     310Void SyntaxElementParser::xReadSvlc( Int& rValue, const TChar *pSymbolName)
     311#else
     312Void SyntaxElementParser::xReadSvlc( Int& rValue)
    238313#endif
    239314{
     
    256331
    257332    uiBits += (1 << uiLength);
    258     riVal = ( uiBits & 1) ? -(Int)(uiBits>>1) : (Int)(uiBits>>1);
     333    rValue = ( uiBits & 1) ? -(Int)(uiBits>>1) : (Int)(uiBits>>1);
    259334#if RExt__DECODER_DEBUG_BIT_STATISTICS
    260335    totalLen+=uiLength+uiLength;
     
    263338  else
    264339  {
    265     riVal = 0;
    266   }
    267 #if RExt__DECODER_DEBUG_BIT_STATISTICS
    268   TComCodingStatistics::IncrementStatisticEP(pSymbolName, Int(totalLen), riVal);
    269 #endif
    270 }
    271 
    272 #if RExt__DECODER_DEBUG_BIT_STATISTICS
    273 Void SyntaxElementParser::xReadFlag (UInt& ruiCode, const TChar *pSymbolName)
    274 #else
    275 Void SyntaxElementParser::xReadFlag (UInt& ruiCode)
    276 #endif
    277 {
    278   m_pcBitstream->read( 1, ruiCode );
    279 #if RExt__DECODER_DEBUG_BIT_STATISTICS
    280   TComCodingStatistics::IncrementStatisticEP(pSymbolName, 1, Int(ruiCode));
     340    rValue = 0;
     341  }
     342#if RExt__DECODER_DEBUG_BIT_STATISTICS
     343  TComCodingStatistics::IncrementStatisticEP(pSymbolName, Int(totalLen), rValue);
     344#endif
     345
     346#if ENC_DEC_TRACE
     347  fprintf( g_hTrace, "%8lld  ", g_nSymbolCounter++ );
     348  fprintf( g_hTrace, "%-50s se(v) : %d\n", pSymbolName, rValue );
     349  fflush ( g_hTrace );
     350#endif
     351
     352}
     353
     354#if RExt__DECODER_DEBUG_BIT_STATISTICS || ENC_DEC_TRACE
     355Void SyntaxElementParser::xReadFlag (UInt& rValue, const TChar *pSymbolName)
     356#else
     357Void SyntaxElementParser::xReadFlag (UInt& rValue)
     358#endif
     359{
     360  m_pcBitstream->read( 1, rValue );
     361#if RExt__DECODER_DEBUG_BIT_STATISTICS
     362  TComCodingStatistics::IncrementStatisticEP(pSymbolName, 1, Int(rValue));
     363#endif
     364
     365#if ENC_DEC_TRACE
     366  fprintf( g_hTrace, "%8lld  ", g_nSymbolCounter++ );
     367  fprintf( g_hTrace, "%-50s u(1)  : %d\n", pSymbolName, rValue );
     368  fflush ( g_hTrace );
    281369#endif
    282370}
    283371
    284372#if NH_MV
    285 #if RExt__DECODER_DEBUG_BIT_STATISTICS
     373#if RExt__DECODER_DEBUG_BIT_STATISTICS || ENC_DEC_TRACE
    286374Void  SyntaxElementParser::xReadString  (UInt bufSize, UChar *pVal, UInt& rLength, const TChar *pSymbolName)
    287375#else
    288 Void  SyntaxElementParser::xReadString  (UInt bufSize, UChar *pVal, UInt& rLength)
     376Void  SyntaxElementParser::xReadString  (UInt bufSize, UChar *pVal, UInt& rLength )
    289377#endif
    290378{
Note: See TracChangeset for help on using the changeset viewer.