Changeset 1412 in 3DVCSoftware for branches/HTM-16.2-dev/source/Lib/TLibDecoder/SyntaxElementParser.cpp
- Timestamp:
- 12 Apr 2018, 11:12:21 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-16.2-dev/source/Lib/TLibDecoder/SyntaxElementParser.cpp
r1405 r1412 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 6, ITU/ISO/IEC6 * Copyright (c) 2010-2017, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 49 49 #if ENC_DEC_TRACE 50 50 51 Void xTraceAccessUnitDelimiter () 52 { 53 fprintf( g_hTrace, "=========== Access Unit Delimiter ===========\n"); 54 } 55 56 Void xTraceFillerData () 57 { 58 fprintf( g_hTrace, "=========== Filler Data ===========\n"); 59 } 60 61 #endif 62 63 #if DECODER_PARTIAL_CONFORMANCE_CHECK!=0 64 Void 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 51 71 Void SyntaxElementParser::xReadCodeTr (UInt length, UInt& rValue, const TChar *pSymbolName) 52 72 { … … 175 195 } 176 196 177 #endif178 179 197 180 198 // ==================================================================================================================== … … 194 212 } 195 213 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 216 Void 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 222 Void 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 228 Void 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 240 Void SyntaxElementParser::xReadCode (UInt uiLength, UInt& rValue, const TChar *pSymbolName) 241 #else 242 Void 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 266 Void SyntaxElementParser::xReadUvlc( UInt& rValue, const TChar *pSymbolName) 267 #else 268 Void SyntaxElementParser::xReadUvlc( UInt& rValue) 200 269 #endif 201 270 { … … 226 295 } 227 296 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 310 Void SyntaxElementParser::xReadSvlc( Int& rValue, const TChar *pSymbolName) 311 #else 312 Void SyntaxElementParser::xReadSvlc( Int& rValue) 238 313 #endif 239 314 { … … 256 331 257 332 uiBits += (1 << uiLength); 258 r iVal= ( uiBits & 1) ? -(Int)(uiBits>>1) : (Int)(uiBits>>1);333 rValue = ( uiBits & 1) ? -(Int)(uiBits>>1) : (Int)(uiBits>>1); 259 334 #if RExt__DECODER_DEBUG_BIT_STATISTICS 260 335 totalLen+=uiLength+uiLength; … … 263 338 else 264 339 { 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 355 Void SyntaxElementParser::xReadFlag (UInt& rValue, const TChar *pSymbolName) 356 #else 357 Void 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 ); 281 369 #endif 282 370 } 283 371 284 372 #if NH_MV 285 #if RExt__DECODER_DEBUG_BIT_STATISTICS 373 #if RExt__DECODER_DEBUG_BIT_STATISTICS || ENC_DEC_TRACE 286 374 Void SyntaxElementParser::xReadString (UInt bufSize, UChar *pVal, UInt& rLength, const TChar *pSymbolName) 287 375 #else 288 Void SyntaxElementParser::xReadString (UInt bufSize, UChar *pVal, UInt& rLength )376 Void SyntaxElementParser::xReadString (UInt bufSize, UChar *pVal, UInt& rLength ) 289 377 #endif 290 378 {
Note: See TracChangeset for help on using the changeset viewer.