Changeset 1413 in 3DVCSoftware for trunk/source/Lib/TLibDecoder
- Timestamp:
- 11 Jul 2018, 15:19:49 (7 years ago)
- Location:
- trunk/source/Lib/TLibDecoder
- Files:
-
- 2 added
- 25 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/Lib/TLibDecoder/AnnexBread.cpp
r1405 r1413 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 * -
trunk/source/Lib/TLibDecoder/AnnexBread.h
r1405 r1413 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 * -
trunk/source/Lib/TLibDecoder/NALread.cpp
r1405 r1413 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 * -
trunk/source/Lib/TLibDecoder/NALread.h
r1405 r1413 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 * -
trunk/source/Lib/TLibDecoder/SEIread.cpp
r1405 r1413 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 * … … 201 201 switch (payloadType) 202 202 { 203 case SEI::BUFFERING_PERIOD: 204 if (!sps) 205 { 206 printf ("Warning: Found Buffering period SEI message, but no active SPS is available. Ignoring."); 207 } 208 else 209 { 210 sei = new SEIBufferingPeriod; 211 xParseSEIBufferingPeriod((SEIBufferingPeriod&) *sei, payloadSize, sps, pDecodedMessageOutputStream); 212 } 213 break; 214 case SEI::PICTURE_TIMING: 215 if (!sps) 216 { 217 printf ("Warning: Found Picture timing SEI message, but no active SPS is available. Ignoring."); 218 } 219 else 220 { 221 sei = new SEIPictureTiming; 222 xParseSEIPictureTiming((SEIPictureTiming&)*sei, payloadSize, sps, pDecodedMessageOutputStream); 223 } 224 break; 225 case SEI::PAN_SCAN_RECT: 226 sei = new SEIPanScanRect; 227 xParseSEIPanScanRect((SEIPanScanRect&) *sei, payloadSize, pDecodedMessageOutputStream); 228 break; 229 case SEI::FILLER_PAYLOAD: 230 sei = new SEIFillerPayload; 231 xParseSEIFillerPayload((SEIFillerPayload&) *sei, payloadSize, pDecodedMessageOutputStream); 232 break; 233 case SEI::USER_DATA_REGISTERED_ITU_T_T35: 234 sei = new SEIUserDataRegistered; 235 xParseSEIUserDataRegistered((SEIUserDataRegistered&) *sei, payloadSize, pDecodedMessageOutputStream); 236 break; 203 237 case SEI::USER_DATA_UNREGISTERED: 204 sei = new SEIuserDataUnregistered; 205 xParseSEIuserDataUnregistered((SEIuserDataUnregistered&) *sei, payloadSize, pDecodedMessageOutputStream); 238 sei = new SEIUserDataUnregistered; 239 xParseSEIUserDataUnregistered((SEIUserDataUnregistered&) *sei, payloadSize, pDecodedMessageOutputStream); 240 break; 241 case SEI::RECOVERY_POINT: 242 sei = new SEIRecoveryPoint; 243 xParseSEIRecoveryPoint((SEIRecoveryPoint&) *sei, payloadSize, pDecodedMessageOutputStream); 244 break; 245 case SEI::SCENE_INFO: 246 sei = new SEISceneInfo; 247 xParseSEISceneInfo((SEISceneInfo&) *sei, payloadSize, pDecodedMessageOutputStream); 248 break; 249 case SEI::PICTURE_SNAPSHOT: 250 sei = new SEIPictureSnapshot; 251 xParseSEIPictureSnapshot((SEIPictureSnapshot&) *sei, payloadSize, pDecodedMessageOutputStream); 252 break; 253 case SEI::PROGRESSIVE_REFINEMENT_SEGMENT_START: 254 sei = new SEIProgressiveRefinementSegmentStart; 255 xParseSEIProgressiveRefinementSegmentStart((SEIProgressiveRefinementSegmentStart&) *sei, payloadSize, pDecodedMessageOutputStream); 256 break; 257 case SEI::PROGRESSIVE_REFINEMENT_SEGMENT_END: 258 sei = new SEIProgressiveRefinementSegmentEnd; 259 xParseSEIProgressiveRefinementSegmentEnd((SEIProgressiveRefinementSegmentEnd&) *sei, payloadSize, pDecodedMessageOutputStream); 260 break; 261 case SEI::FILM_GRAIN_CHARACTERISTICS: 262 sei = new SEIFilmGrainCharacteristics; 263 xParseSEIFilmGrainCharacteristics((SEIFilmGrainCharacteristics&) *sei, payloadSize, pDecodedMessageOutputStream); 264 break; 265 case SEI::POST_FILTER_HINT: 266 if (!sps) 267 { 268 printf ("Warning: post filter hint SEI message, but no active SPS is available. Ignoring."); 269 } 270 else 271 { 272 sei = new SEIPostFilterHint; 273 xParseSEIPostFilterHint((SEIPostFilterHint&) *sei, payloadSize, sps, pDecodedMessageOutputStream); 274 } 275 break; 276 case SEI::TONE_MAPPING_INFO: 277 sei = new SEIToneMappingInfo; 278 xParseSEIToneMappingInfo((SEIToneMappingInfo&) *sei, payloadSize, pDecodedMessageOutputStream); 279 break; 280 case SEI::FRAME_PACKING: 281 sei = new SEIFramePacking; 282 xParseSEIFramePacking((SEIFramePacking&) *sei, payloadSize, pDecodedMessageOutputStream); 283 break; 284 case SEI::DISPLAY_ORIENTATION: 285 sei = new SEIDisplayOrientation; 286 xParseSEIDisplayOrientation((SEIDisplayOrientation&) *sei, payloadSize, pDecodedMessageOutputStream); 287 break; 288 case SEI::GREEN_METADATA: 289 sei = new SEIGreenMetadataInfo; 290 xParseSEIGreenMetadataInfo((SEIGreenMetadataInfo&) *sei, payloadSize, pDecodedMessageOutputStream); 291 break; 292 case SEI::SOP_DESCRIPTION: 293 sei = new SEISOPDescription; 294 xParseSEISOPDescription((SEISOPDescription&) *sei, payloadSize, pDecodedMessageOutputStream); 206 295 break; 207 296 case SEI::ACTIVE_PARAMETER_SETS: … … 220 309 } 221 310 break; 222 case SEI::BUFFERING_PERIOD: 223 if (!sps) 224 { 225 printf ("Warning: Found Buffering period SEI message, but no active SPS is available. Ignoring."); 226 } 227 else 228 { 229 sei = new SEIBufferingPeriod; 230 xParseSEIBufferingPeriod((SEIBufferingPeriod&) *sei, payloadSize, sps, pDecodedMessageOutputStream); 231 } 232 break; 233 case SEI::PICTURE_TIMING: 234 if (!sps) 235 { 236 printf ("Warning: Found Picture timing SEI message, but no active SPS is available. Ignoring."); 237 } 238 else 239 { 240 sei = new SEIPictureTiming; 241 xParseSEIPictureTiming((SEIPictureTiming&)*sei, payloadSize, sps, pDecodedMessageOutputStream); 242 } 243 break; 244 case SEI::RECOVERY_POINT: 245 sei = new SEIRecoveryPoint; 246 xParseSEIRecoveryPoint((SEIRecoveryPoint&) *sei, payloadSize, pDecodedMessageOutputStream); 247 break; 248 case SEI::FRAME_PACKING: 249 sei = new SEIFramePacking; 250 xParseSEIFramePacking((SEIFramePacking&) *sei, payloadSize, pDecodedMessageOutputStream); 311 case SEI::TEMPORAL_LEVEL0_INDEX: 312 sei = new SEITemporalLevel0Index; 313 xParseSEITemporalLevel0Index((SEITemporalLevel0Index&) *sei, payloadSize, pDecodedMessageOutputStream); 314 break; 315 #if NH_MV 316 xParseSEIScalableNesting((SEIScalableNesting&) *sei, nalUnitType, payloadSize, vps, sps, pDecodedMessageOutputStream); 317 #else 318 case SEI::SCALABLE_NESTING: 319 sei = new SEIScalableNesting; 320 xParseSEIScalableNesting((SEIScalableNesting&) *sei, nalUnitType, payloadSize, sps, pDecodedMessageOutputStream); 321 #endif 322 break; 323 case SEI::REGION_REFRESH_INFO: 324 sei = new SEIRegionRefreshInfo; 325 xParseSEIRegionRefreshInfo((SEIRegionRefreshInfo&) *sei, payloadSize, pDecodedMessageOutputStream); 326 break; 327 case SEI::NO_DISPLAY: 328 sei = new SEINoDisplay; 329 xParseSEINoDisplay((SEINoDisplay&) *sei, payloadSize, pDecodedMessageOutputStream); 330 break; 331 case SEI::TIME_CODE: 332 sei = new SEITimeCode; 333 xParseSEITimeCode((SEITimeCode&) *sei, payloadSize, pDecodedMessageOutputStream); 334 break; 335 case SEI::MASTERING_DISPLAY_COLOUR_VOLUME: 336 sei = new SEIMasteringDisplayColourVolume; 337 xParseSEIMasteringDisplayColourVolume((SEIMasteringDisplayColourVolume&) *sei, payloadSize, pDecodedMessageOutputStream); 251 338 break; 252 339 case SEI::SEGM_RECT_FRAME_PACKING: … … 254 341 xParseSEISegmentedRectFramePacking((SEISegmentedRectFramePacking&) *sei, payloadSize, pDecodedMessageOutputStream); 255 342 break; 256 case SEI::DISPLAY_ORIENTATION:257 sei = new SEIDisplayOrientation;258 xParseSEIDisplayOrientation((SEIDisplayOrientation&) *sei, payloadSize, pDecodedMessageOutputStream);259 break;260 case SEI::TEMPORAL_LEVEL0_INDEX:261 sei = new SEITemporalLevel0Index;262 xParseSEITemporalLevel0Index((SEITemporalLevel0Index&) *sei, payloadSize, pDecodedMessageOutputStream);263 break;264 case SEI::REGION_REFRESH_INFO:265 sei = new SEIGradualDecodingRefreshInfo;266 xParseSEIRegionRefreshInfo((SEIGradualDecodingRefreshInfo&) *sei, payloadSize, pDecodedMessageOutputStream);267 break;268 case SEI::NO_DISPLAY:269 sei = new SEINoDisplay;270 xParseSEINoDisplay((SEINoDisplay&) *sei, payloadSize, pDecodedMessageOutputStream);271 break;272 case SEI::TONE_MAPPING_INFO:273 sei = new SEIToneMappingInfo;274 xParseSEIToneMappingInfo((SEIToneMappingInfo&) *sei, payloadSize, pDecodedMessageOutputStream);275 break;276 case SEI::SOP_DESCRIPTION:277 sei = new SEISOPDescription;278 xParseSEISOPDescription((SEISOPDescription&) *sei, payloadSize, pDecodedMessageOutputStream);279 break;280 case SEI::SCALABLE_NESTING:281 sei = new SEIScalableNesting;282 #if NH_MV283 xParseSEIScalableNesting((SEIScalableNesting&) *sei, nalUnitType, payloadSize, vps, sps, pDecodedMessageOutputStream);284 #else285 xParseSEIScalableNesting((SEIScalableNesting&) *sei, nalUnitType, payloadSize, sps, pDecodedMessageOutputStream);286 #endif287 break;288 343 case SEI::TEMP_MOTION_CONSTRAINED_TILE_SETS: 289 344 sei = new SEITempMotionConstrainedTileSets; 290 345 xParseSEITempMotionConstraintsTileSets((SEITempMotionConstrainedTileSets&) *sei, payloadSize, pDecodedMessageOutputStream); 291 346 break; 292 case SEI::TIME_CODE:293 sei = new SEITimeCode;294 xParseSEITimeCode((SEITimeCode&) *sei, payloadSize, pDecodedMessageOutputStream);295 break;296 347 case SEI::CHROMA_RESAMPLING_FILTER_HINT: 297 348 sei = new SEIChromaResamplingFilterHint; 298 349 xParseSEIChromaResamplingFilterHint((SEIChromaResamplingFilterHint&) *sei, payloadSize, pDecodedMessageOutputStream); 299 //}300 350 break; 301 351 case SEI::KNEE_FUNCTION_INFO: … … 307 357 xParseSEIColourRemappingInfo((SEIColourRemappingInfo&) *sei, payloadSize, pDecodedMessageOutputStream); 308 358 break; 309 case SEI::MASTERING_DISPLAY_COLOUR_VOLUME: 310 sei = new SEIMasteringDisplayColourVolume; 311 xParseSEIMasteringDisplayColourVolume((SEIMasteringDisplayColourVolume&) *sei, payloadSize, pDecodedMessageOutputStream); 312 break; 313 #if U0033_ALTERNATIVE_TRANSFER_CHARACTERISTICS_SEI 359 case SEI::DEINTERLACE_FIELD_IDENTIFICATION: 360 sei = new SEIDeinterlaceFieldIdentification; 361 xParseSEIDeinterlaceFieldIdentification((SEIDeinterlaceFieldIdentification&) *sei, payloadSize, pDecodedMessageOutputStream); 362 break; 363 case SEI::CONTENT_LIGHT_LEVEL_INFO: 364 sei = new SEIContentLightLevelInfo; 365 xParseSEIContentLightLevelInfo((SEIContentLightLevelInfo&) *sei, payloadSize, pDecodedMessageOutputStream); 366 break; 367 case SEI::DEPENDENT_RAP_INDICATION: 368 sei = new SEIDependentRAPIndication; 369 xParseSEIDependentRAPIndication((SEIDependentRAPIndication&) *sei, payloadSize, pDecodedMessageOutputStream); 370 break; 371 case SEI::CODED_REGION_COMPLETION: 372 sei = new SEICodedRegionCompletion; 373 xParseSEICodedRegionCompletion((SEICodedRegionCompletion&) *sei, payloadSize, pDecodedMessageOutputStream); 374 break; 314 375 case SEI::ALTERNATIVE_TRANSFER_CHARACTERISTICS: 315 376 sei = new SEIAlternativeTransferCharacteristics; 316 377 xParseSEIAlternativeTransferCharacteristics((SEIAlternativeTransferCharacteristics&) *sei, payloadSize, pDecodedMessageOutputStream); 317 378 break; 318 #endif 379 case SEI::AMBIENT_VIEWING_ENVIRONMENT: 380 sei = new SEIAmbientViewingEnvironment; 381 xParseSEIAmbientViewingEnvironment((SEIAmbientViewingEnvironment&) *sei, payloadSize, pDecodedMessageOutputStream); 382 break; 319 383 #if NH_MV 320 384 case SEI::LAYERS_NOT_PRESENT: … … 412 476 switch (payloadType) 413 477 { 478 case SEI::FILLER_PAYLOAD: 479 sei = new SEIFillerPayload; 480 xParseSEIFillerPayload((SEIFillerPayload&) *sei, payloadSize, pDecodedMessageOutputStream); 481 break; 482 case SEI::USER_DATA_REGISTERED_ITU_T_T35: 483 sei = new SEIUserDataRegistered; 484 xParseSEIUserDataRegistered((SEIUserDataRegistered&) *sei, payloadSize, pDecodedMessageOutputStream); 485 break; 414 486 case SEI::USER_DATA_UNREGISTERED: 415 sei = new SEIuserDataUnregistered; 416 xParseSEIuserDataUnregistered((SEIuserDataUnregistered&) *sei, payloadSize, pDecodedMessageOutputStream); 487 sei = new SEIUserDataUnregistered; 488 xParseSEIUserDataUnregistered((SEIUserDataUnregistered&) *sei, payloadSize, pDecodedMessageOutputStream); 489 break; 490 case SEI::PROGRESSIVE_REFINEMENT_SEGMENT_END: 491 sei = new SEIProgressiveRefinementSegmentEnd; 492 xParseSEIProgressiveRefinementSegmentEnd((SEIProgressiveRefinementSegmentEnd&) *sei, payloadSize, pDecodedMessageOutputStream); 493 break; 494 case SEI::POST_FILTER_HINT: 495 if (!sps) 496 { 497 printf ("Warning: post filter hint SEI message, but no active SPS is available. Ignoring."); 498 } 499 else 500 { 501 sei = new SEIPostFilterHint; 502 xParseSEIPostFilterHint((SEIPostFilterHint&) *sei, payloadSize, sps, pDecodedMessageOutputStream); 503 } 417 504 break; 418 505 case SEI::DECODED_PICTURE_HASH: 419 506 sei = new SEIDecodedPictureHash; 420 507 xParseSEIDecodedPictureHash((SEIDecodedPictureHash&) *sei, payloadSize, pDecodedMessageOutputStream); 508 break; 509 case SEI::CODED_REGION_COMPLETION: 510 sei = new SEICodedRegionCompletion; 511 xParseSEICodedRegionCompletion((SEICodedRegionCompletion&) *sei, payloadSize, pDecodedMessageOutputStream); 421 512 break; 422 513 default: … … 484 575 } 485 576 486 /**487 * parse bitstream bs and unpack a user_data_unregistered SEI message488 * of payloasSize bytes into sei.489 */490 491 Void SEIReader::xParseSEIuserDataUnregistered(SEIuserDataUnregistered &sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream)492 {493 assert(payloadSize >= ISO_IEC_11578_LEN);494 UInt val;495 output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize);496 497 for (UInt i = 0; i < ISO_IEC_11578_LEN; i++)498 {499 sei_read_code( pDecodedMessageOutputStream, 8, val, "uuid_iso_iec_11578");500 sei.uuid_iso_iec_11578[i] = val;501 }502 503 sei.userDataLength = payloadSize - ISO_IEC_11578_LEN;504 if (!sei.userDataLength)505 {506 sei.userData = 0;507 return;508 }509 510 sei.userData = new UChar[sei.userDataLength];511 for (UInt i = 0; i < sei.userDataLength; i++)512 {513 sei_read_code( NULL, 8, val, "user_data_payload_byte" );514 sei.userData[i] = val;515 }516 if (pDecodedMessageOutputStream)517 {518 (*pDecodedMessageOutputStream) << " User data payload size: " << sei.userDataLength << "\n";519 }520 }521 522 /**523 * parse bitstream bs and unpack a decoded picture hash SEI message524 * of payloadSize bytes into sei.525 */526 Void SEIReader::xParseSEIDecodedPictureHash(SEIDecodedPictureHash& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream)527 {528 UInt bytesRead = 0;529 output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize);530 531 UInt val;532 sei_read_code( pDecodedMessageOutputStream, 8, val, "hash_type");533 sei.method = static_cast<HashType>(val); bytesRead++;534 535 const TChar *traceString="\0";536 switch (sei.method)537 {538 case HASHTYPE_MD5: traceString="picture_md5"; break;539 case HASHTYPE_CRC: traceString="picture_crc"; break;540 case HASHTYPE_CHECKSUM: traceString="picture_checksum"; break;541 default: assert(false); break;542 }543 544 if (pDecodedMessageOutputStream)545 {546 (*pDecodedMessageOutputStream) << " " << std::setw(55) << traceString << ": " << std::hex << std::setfill('0');547 }548 549 sei.m_pictureHash.hash.clear();550 for(;bytesRead < payloadSize; bytesRead++)551 {552 sei_read_code( NULL, 8, val, traceString);553 sei.m_pictureHash.hash.push_back((UChar)val);554 if (pDecodedMessageOutputStream)555 {556 (*pDecodedMessageOutputStream) << std::setw(2) << val;557 }558 }559 560 if (pDecodedMessageOutputStream)561 {562 (*pDecodedMessageOutputStream) << std::dec << std::setfill(' ') << "\n";563 }564 }565 566 Void SEIReader::xParseSEIActiveParameterSets(SEIActiveParameterSets& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream)567 {568 UInt val;569 output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize);570 571 sei_read_code( pDecodedMessageOutputStream, 4, val, "active_video_parameter_set_id"); sei.activeVPSId = val;572 sei_read_flag( pDecodedMessageOutputStream, val, "self_contained_cvs_flag"); sei.m_selfContainedCvsFlag = (val != 0);573 sei_read_flag( pDecodedMessageOutputStream, val, "no_parameter_set_update_flag"); sei.m_noParameterSetUpdateFlag = (val != 0);574 sei_read_uvlc( pDecodedMessageOutputStream, val, "num_sps_ids_minus1"); sei.numSpsIdsMinus1 = val;575 576 sei.activeSeqParameterSetId.resize(sei.numSpsIdsMinus1 + 1);577 for (Int i=0; i < (sei.numSpsIdsMinus1 + 1); i++)578 {579 sei_read_uvlc( pDecodedMessageOutputStream, val, "active_seq_parameter_set_id[i]"); sei.activeSeqParameterSetId[i] = val;580 }581 }582 583 Void SEIReader::xParseSEIDecodingUnitInfo(SEIDecodingUnitInfo& sei, UInt payloadSize, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream)584 {585 UInt val;586 output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize);587 sei_read_uvlc( pDecodedMessageOutputStream, val, "decoding_unit_idx");588 sei.m_decodingUnitIdx = val;589 590 const TComVUI *vui = sps->getVuiParameters();591 if(vui->getHrdParameters()->getSubPicCpbParamsInPicTimingSEIFlag())592 {593 sei_read_code( pDecodedMessageOutputStream, ( vui->getHrdParameters()->getDuCpbRemovalDelayLengthMinus1() + 1 ), val, "du_spt_cpb_removal_delay_increment");594 sei.m_duSptCpbRemovalDelay = val;595 }596 else597 {598 sei.m_duSptCpbRemovalDelay = 0;599 }600 sei_read_flag( pDecodedMessageOutputStream, val, "dpb_output_du_delay_present_flag"); sei.m_dpbOutputDuDelayPresentFlag = (val != 0);601 if(sei.m_dpbOutputDuDelayPresentFlag)602 {603 sei_read_code( pDecodedMessageOutputStream, vui->getHrdParameters()->getDpbOutputDelayDuLengthMinus1() + 1, val, "pic_spt_dpb_output_du_delay");604 sei.m_picSptDpbOutputDuDelay = val;605 }606 }607 577 608 578 Void SEIReader::xParseSEIBufferingPeriod(SEIBufferingPeriod& sei, UInt payloadSize, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream) … … 713 683 } 714 684 685 Void SEIReader::xParseSEIPanScanRect(SEIPanScanRect& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream) 686 { 687 UInt code; 688 output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize); 689 sei_read_uvlc( pDecodedMessageOutputStream, code, "pan_scan_rect_id" ); sei.m_panScanRectId = code; 690 sei_read_flag( pDecodedMessageOutputStream, code, "pan_scan_rect_cancel_flag" ); sei.m_panScanRectCancelFlag = code!=0; 691 if (!sei.m_panScanRectCancelFlag) 692 { 693 UInt numRegions; 694 sei_read_uvlc( pDecodedMessageOutputStream, numRegions, "pan_scan_cnt_minus1" ); numRegions++; 695 sei.m_panScanRectRegions.resize(numRegions); 696 for(UInt region=0; region<numRegions; region++) 697 { 698 SEIPanScanRect::PanScanRect &rect=sei.m_panScanRectRegions[region]; 699 Int i; 700 sei_read_svlc( pDecodedMessageOutputStream, i, "pan_scan_rect_left_offset[i]" ); rect.leftOffset = i; 701 sei_read_svlc( pDecodedMessageOutputStream, i, "pan_scan_rect_right_offset[i]" ); rect.rightOffset = i; 702 sei_read_svlc( pDecodedMessageOutputStream, i, "pan_scan_rect_top_offset[i]" ); rect.topOffset = i; 703 sei_read_svlc( pDecodedMessageOutputStream, i, "pan_scan_rect_bottom_offset[i]" ); rect.bottomOffset = i; 704 } 705 sei_read_flag( pDecodedMessageOutputStream, code, "pan_scan_rect_persistence_flag" ); sei.m_panScanRectPersistenceFlag = code!=0; 706 } 707 else 708 { 709 sei.m_panScanRectRegions.clear(); 710 sei.m_panScanRectPersistenceFlag=false; 711 } 712 } 713 714 Void SEIReader::xParseSEIFillerPayload(SEIFillerPayload& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream) 715 { 716 output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize); 717 sei.m_numFillerFFBytes = payloadSize; 718 Bool allBytesWereFF=true; 719 for(UInt k=0; k<payloadSize; k++) 720 { 721 UInt code; 722 sei_read_code( NULL, 8, code, "ff_byte" ); 723 if (code!=0xff) allBytesWereFF=false; 724 } 725 if (pDecodedMessageOutputStream && !allBytesWereFF) 726 { 727 (*pDecodedMessageOutputStream) << " not all filler payload bytes were 0xff\n"; 728 } 729 } 730 731 732 Void SEIReader::xParseSEIUserDataRegistered(SEIUserDataRegistered& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream) 733 { 734 output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize); 735 736 UInt code; 737 assert(payloadSize>0); 738 sei_read_code( pDecodedMessageOutputStream, 8, code, "itu_t_t35_country_code" ); payloadSize--; 739 if (code == 255) 740 { 741 assert(payloadSize>0); 742 sei_read_code( pDecodedMessageOutputStream, 8, code, "itu_t_t35_country_code_extension_byte" ); payloadSize--; 743 code+=255; 744 } 745 sei.m_ituCountryCode = code; 746 sei.m_userData.resize(payloadSize); 747 for (UInt i = 0; i < sei.m_userData.size(); i++) 748 { 749 sei_read_code( NULL, 8, code, "itu_t_t35_payload_byte" ); 750 sei.m_userData[i] = code; 751 } 752 if (pDecodedMessageOutputStream) 753 { 754 (*pDecodedMessageOutputStream) << " itu_t_t35 payload size: " << sei.m_userData.size() << "\n"; 755 } 756 } 757 758 Void SEIReader::xParseSEIUserDataUnregistered(SEIUserDataUnregistered &sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream) 759 { 760 assert(payloadSize >= ISO_IEC_11578_LEN); 761 UInt val; 762 output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize); 763 764 for (UInt i = 0; i < ISO_IEC_11578_LEN; i++) 765 { 766 sei_read_code( pDecodedMessageOutputStream, 8, val, "uuid_iso_iec_11578"); 767 sei.m_uuid_iso_iec_11578[i] = val; 768 } 769 sei.m_userData.resize(payloadSize - ISO_IEC_11578_LEN); 770 for (UInt i = 0; i < sei.m_userData.size(); i++) 771 { 772 sei_read_code( NULL, 8, val, "user_data_payload_byte" ); 773 sei.m_userData[i] = val; 774 } 775 if (pDecodedMessageOutputStream) 776 { 777 (*pDecodedMessageOutputStream) << " User data payload size: " << sei.m_userData.size() << "\n"; 778 } 779 } 780 781 715 782 Void SEIReader::xParseSEIRecoveryPoint(SEIRecoveryPoint& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream) 716 783 { … … 724 791 } 725 792 726 Void SEIReader::xParseSEIFramePacking(SEIFramePacking& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream) 727 { 728 UInt val; 729 output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize); 730 731 sei_read_uvlc( pDecodedMessageOutputStream, val, "frame_packing_arrangement_id" ); sei.m_arrangementId = val; 732 sei_read_flag( pDecodedMessageOutputStream, val, "frame_packing_arrangement_cancel_flag" ); sei.m_arrangementCancelFlag = val; 733 734 if ( !sei.m_arrangementCancelFlag ) 735 { 736 sei_read_code( pDecodedMessageOutputStream, 7, val, "frame_packing_arrangement_type" ); sei.m_arrangementType = val; 737 assert((sei.m_arrangementType > 2) && (sei.m_arrangementType < 6) ); 738 739 sei_read_flag( pDecodedMessageOutputStream, val, "quincunx_sampling_flag" ); sei.m_quincunxSamplingFlag = val; 740 741 sei_read_code( pDecodedMessageOutputStream, 6, val, "content_interpretation_type" ); sei.m_contentInterpretationType = val; 742 sei_read_flag( pDecodedMessageOutputStream, val, "spatial_flipping_flag" ); sei.m_spatialFlippingFlag = val; 743 sei_read_flag( pDecodedMessageOutputStream, val, "frame0_flipped_flag" ); sei.m_frame0FlippedFlag = val; 744 sei_read_flag( pDecodedMessageOutputStream, val, "field_views_flag" ); sei.m_fieldViewsFlag = val; 745 sei_read_flag( pDecodedMessageOutputStream, val, "current_frame_is_frame0_flag" ); sei.m_currentFrameIsFrame0Flag = val; 746 sei_read_flag( pDecodedMessageOutputStream, val, "frame0_self_contained_flag" ); sei.m_frame0SelfContainedFlag = val; 747 sei_read_flag( pDecodedMessageOutputStream, val, "frame1_self_contained_flag" ); sei.m_frame1SelfContainedFlag = val; 748 749 if ( sei.m_quincunxSamplingFlag == 0 && sei.m_arrangementType != 5) 750 { 751 sei_read_code( pDecodedMessageOutputStream, 4, val, "frame0_grid_position_x" ); sei.m_frame0GridPositionX = val; 752 sei_read_code( pDecodedMessageOutputStream, 4, val, "frame0_grid_position_y" ); sei.m_frame0GridPositionY = val; 753 sei_read_code( pDecodedMessageOutputStream, 4, val, "frame1_grid_position_x" ); sei.m_frame1GridPositionX = val; 754 sei_read_code( pDecodedMessageOutputStream, 4, val, "frame1_grid_position_y" ); sei.m_frame1GridPositionY = val; 755 } 756 757 sei_read_code( pDecodedMessageOutputStream, 8, val, "frame_packing_arrangement_reserved_byte" ); sei.m_arrangementReservedByte = val; 758 sei_read_flag( pDecodedMessageOutputStream, val, "frame_packing_arrangement_persistence_flag" ); sei.m_arrangementPersistenceFlag = (val != 0); 759 } 760 sei_read_flag( pDecodedMessageOutputStream, val, "upsampled_aspect_ratio_flag" ); sei.m_upsampledAspectRatio = val; 761 } 762 763 Void SEIReader::xParseSEISegmentedRectFramePacking(SEISegmentedRectFramePacking& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream) 764 { 765 UInt val; 766 output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize); 767 sei_read_flag( pDecodedMessageOutputStream, val, "segmented_rect_frame_packing_arrangement_cancel_flag" ); sei.m_arrangementCancelFlag = val; 768 if( !sei.m_arrangementCancelFlag ) 769 { 770 sei_read_code( pDecodedMessageOutputStream, 2, val, "segmented_rect_content_interpretation_type" ); sei.m_contentInterpretationType = val; 771 sei_read_flag( pDecodedMessageOutputStream, val, "segmented_rect_frame_packing_arrangement_persistence" ); sei.m_arrangementPersistenceFlag = val; 772 } 773 } 774 775 Void SEIReader::xParseSEIDisplayOrientation(SEIDisplayOrientation& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream) 776 { 777 UInt val; 778 output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize); 779 sei_read_flag( pDecodedMessageOutputStream, val, "display_orientation_cancel_flag" ); sei.cancelFlag = val; 780 if( !sei.cancelFlag ) 781 { 782 sei_read_flag( pDecodedMessageOutputStream, val, "hor_flip" ); sei.horFlip = val; 783 sei_read_flag( pDecodedMessageOutputStream, val, "ver_flip" ); sei.verFlip = val; 784 sei_read_code( pDecodedMessageOutputStream, 16, val, "anticlockwise_rotation" ); sei.anticlockwiseRotation = val; 785 sei_read_flag( pDecodedMessageOutputStream, val, "display_orientation_persistence_flag" ); sei.persistenceFlag = val; 786 } 787 } 788 789 Void SEIReader::xParseSEITemporalLevel0Index(SEITemporalLevel0Index& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream) 790 { 791 UInt val; 792 output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize); 793 sei_read_code( pDecodedMessageOutputStream, 8, val, "temporal_sub_layer_zero_idx" ); sei.tl0Idx = val; 794 sei_read_code( pDecodedMessageOutputStream, 8, val, "irap_pic_id" ); sei.rapIdx = val; 795 } 796 797 Void SEIReader::xParseSEIRegionRefreshInfo(SEIGradualDecodingRefreshInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream) 798 { 799 UInt val; 800 output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize); 801 sei_read_flag( pDecodedMessageOutputStream, val, "refreshed_region_flag" ); sei.m_gdrForegroundFlag = val ? 1 : 0; 802 } 803 804 Void SEIReader::xParseSEINoDisplay(SEINoDisplay& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream) 805 { 806 output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize); 807 sei.m_noDisplay = true; 808 } 793 794 Void SEIReader::xParseSEISceneInfo(SEISceneInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream) 795 { 796 UInt code; 797 output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize); 798 799 sei_read_flag( pDecodedMessageOutputStream, code, "scene_info_present_flag" ); sei.m_bSceneInfoPresentFlag = code!=0; 800 if (sei.m_bSceneInfoPresentFlag) 801 { 802 sei_read_flag( pDecodedMessageOutputStream, code, "prev_scene_id_valid_flag" ); sei.m_bPrevSceneIdValidFlag = code!=0; 803 sei_read_uvlc( pDecodedMessageOutputStream, code, "scene_id" ); sei.m_sceneId = code; 804 sei_read_uvlc( pDecodedMessageOutputStream, code, "scene_transition_type" ); sei.m_sceneTransitionType = code; 805 if (sei.m_sceneTransitionType > 3) 806 { 807 sei_read_uvlc( pDecodedMessageOutputStream, code, "second_scene_id" ); sei.m_secondSceneId = code; 808 } 809 else 810 { 811 sei.m_secondSceneId = 0; // set to known value. 812 } 813 } 814 } 815 816 Void SEIReader::xParseSEIPictureSnapshot(SEIPictureSnapshot& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream) 817 { 818 UInt code; 819 output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize); 820 821 sei_read_uvlc( pDecodedMessageOutputStream, code, "snapshot_id" ); sei.m_snapshotId = code; 822 } 823 824 825 Void SEIReader::xParseSEIProgressiveRefinementSegmentStart(SEIProgressiveRefinementSegmentStart& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream) 826 { 827 UInt code; 828 output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize); 829 830 sei_read_uvlc( pDecodedMessageOutputStream, code, "progressive_refinement_id" ); sei.m_progressiveRefinementId = code; 831 sei_read_uvlc( pDecodedMessageOutputStream, code, "pic_order_cnt_delta" ); sei.m_picOrderCntDelta = code; 832 } 833 834 835 Void SEIReader::xParseSEIProgressiveRefinementSegmentEnd(SEIProgressiveRefinementSegmentEnd& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream) 836 { 837 UInt code; 838 output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize); 839 840 sei_read_uvlc( pDecodedMessageOutputStream, code, "progressive_refinement_id" ); sei.m_progressiveRefinementId = code; 841 } 842 843 844 Void SEIReader::xParseSEIFilmGrainCharacteristics(SEIFilmGrainCharacteristics& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream) 845 { 846 UInt code; 847 output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize); 848 849 sei_read_flag( pDecodedMessageOutputStream, code, "film_grain_characteristics_cancel_flag" ); sei.m_filmGrainCharacteristicsCancelFlag = code!=0; 850 if (!sei.m_filmGrainCharacteristicsCancelFlag) 851 { 852 sei_read_code( pDecodedMessageOutputStream, 2, code, "film_grain_model_id" ); sei.m_filmGrainModelId = code; 853 sei_read_flag( pDecodedMessageOutputStream, code, "separate_colour_description_present_flag" ); sei.m_separateColourDescriptionPresentFlag = code!=0; 854 if (sei.m_separateColourDescriptionPresentFlag) 855 { 856 sei_read_code( pDecodedMessageOutputStream, 3, code, "film_grain_bit_depth_luma_minus8" ); sei.m_filmGrainBitDepthLumaMinus8 = code; 857 sei_read_code( pDecodedMessageOutputStream, 3, code, "film_grain_bit_depth_chroma_minus8" ); sei.m_filmGrainBitDepthChromaMinus8 = code; 858 sei_read_flag( pDecodedMessageOutputStream, code, "film_grain_full_range_flag" ); sei.m_filmGrainFullRangeFlag = code!=0; 859 sei_read_code( pDecodedMessageOutputStream, 8, code, "film_grain_colour_primaries" ); sei.m_filmGrainColourPrimaries = code; 860 sei_read_code( pDecodedMessageOutputStream, 8, code, "film_grain_transfer_characteristics" ); sei.m_filmGrainTransferCharacteristics = code; 861 sei_read_code( pDecodedMessageOutputStream, 8, code, "film_grain_matrix_coeffs" ); sei.m_filmGrainMatrixCoeffs = code; 862 } 863 sei_read_code( pDecodedMessageOutputStream, 2, code, "blending_mode_id" ); sei.m_blendingModeId = code; 864 sei_read_code( pDecodedMessageOutputStream, 4, code, "log2_scale_factor" ); sei.m_log2ScaleFactor = code; 865 for(Int c=0; c<3; c++) 866 { 867 sei_read_flag( pDecodedMessageOutputStream, code, "comp_model_present_flag[c]" ); sei.m_compModel[c].bPresentFlag = code!=0; 868 } 869 for(Int c=0; c<3; c++) 870 { 871 SEIFilmGrainCharacteristics::CompModel &cm=sei.m_compModel[c]; 872 if (cm.bPresentFlag) 873 { 874 UInt numIntensityIntervals; 875 sei_read_code( pDecodedMessageOutputStream, 8, code, "num_intensity_intervals_minus1[c]" ); numIntensityIntervals = code+1; 876 sei_read_code( pDecodedMessageOutputStream, 3, code, "num_model_values_minus1[c]" ); cm.numModelValues = code+1; 877 cm.intensityValues.resize(numIntensityIntervals); 878 for(UInt interval=0; interval<numIntensityIntervals; interval++) 879 { 880 SEIFilmGrainCharacteristics::CompModelIntensityValues &cmiv=cm.intensityValues[interval]; 881 sei_read_code( pDecodedMessageOutputStream, 8, code, "intensity_interval_lower_bound[c][i]" ); cmiv.intensityIntervalLowerBound=code; 882 sei_read_code( pDecodedMessageOutputStream, 8, code, "intensity_interval_upper_bound[c][i]" ); cmiv.intensityIntervalUpperBound=code; 883 cmiv.compModelValue.resize(cm.numModelValues); 884 for(UInt j=0; j<cm.numModelValues; j++) 885 { 886 sei_read_svlc( pDecodedMessageOutputStream, cmiv.compModelValue[j], "comp_model_value[c][i]" ); 887 } 888 } 889 } 890 } // for c 891 sei_read_flag( pDecodedMessageOutputStream, code, "film_grain_characteristics_persistence_flag" ); sei.m_filmGrainCharacteristicsPersistenceFlag = code!=0; 892 } // cancel flag 893 } 894 895 Void SEIReader::xParseSEIPostFilterHint(SEIPostFilterHint& sei, UInt payloadSize, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream) 896 { 897 UInt code; 898 output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize); 899 900 sei_read_uvlc( pDecodedMessageOutputStream, code, "filter_hint_size_y" ); sei.m_filterHintSizeY = code; 901 sei_read_uvlc( pDecodedMessageOutputStream, code, "filter_hint_size_x" ); sei.m_filterHintSizeX = code; 902 sei_read_code( pDecodedMessageOutputStream, 2, code, "filter_hint_type" ); sei.m_filterHintType = code; 903 904 sei.m_bIsMonochrome = (sps->getChromaFormatIdc() == CHROMA_400); 905 const UInt numChromaChannels = sei.m_bIsMonochrome ? 1:3; 906 907 sei.m_filterHintValues.resize(numChromaChannels * sei.m_filterHintSizeX * sei.m_filterHintSizeY); 908 for(std::size_t i=0; i<sei.m_filterHintValues.size(); i++) 909 { 910 Int v; 911 sei_read_svlc( pDecodedMessageOutputStream, v, "filter_hint_value[][][]" ); sei.m_filterHintValues[i] = code; 912 913 } 914 } 915 809 916 810 917 Void SEIReader::xParseSEIToneMappingInfo(SEIToneMappingInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream) … … 893 1000 } 894 1001 1002 1003 Void SEIReader::xParseSEIFramePacking(SEIFramePacking& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream) 1004 { 1005 UInt val; 1006 output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize); 1007 1008 sei_read_uvlc( pDecodedMessageOutputStream, val, "frame_packing_arrangement_id" ); sei.m_arrangementId = val; 1009 sei_read_flag( pDecodedMessageOutputStream, val, "frame_packing_arrangement_cancel_flag" ); sei.m_arrangementCancelFlag = val; 1010 1011 if ( !sei.m_arrangementCancelFlag ) 1012 { 1013 sei_read_code( pDecodedMessageOutputStream, 7, val, "frame_packing_arrangement_type" ); sei.m_arrangementType = val; 1014 assert((sei.m_arrangementType > 2) && (sei.m_arrangementType < 6) ); 1015 1016 sei_read_flag( pDecodedMessageOutputStream, val, "quincunx_sampling_flag" ); sei.m_quincunxSamplingFlag = val; 1017 1018 sei_read_code( pDecodedMessageOutputStream, 6, val, "content_interpretation_type" ); sei.m_contentInterpretationType = val; 1019 sei_read_flag( pDecodedMessageOutputStream, val, "spatial_flipping_flag" ); sei.m_spatialFlippingFlag = val; 1020 sei_read_flag( pDecodedMessageOutputStream, val, "frame0_flipped_flag" ); sei.m_frame0FlippedFlag = val; 1021 sei_read_flag( pDecodedMessageOutputStream, val, "field_views_flag" ); sei.m_fieldViewsFlag = val; 1022 sei_read_flag( pDecodedMessageOutputStream, val, "current_frame_is_frame0_flag" ); sei.m_currentFrameIsFrame0Flag = val; 1023 sei_read_flag( pDecodedMessageOutputStream, val, "frame0_self_contained_flag" ); sei.m_frame0SelfContainedFlag = val; 1024 sei_read_flag( pDecodedMessageOutputStream, val, "frame1_self_contained_flag" ); sei.m_frame1SelfContainedFlag = val; 1025 1026 if ( sei.m_quincunxSamplingFlag == 0 && sei.m_arrangementType != 5) 1027 { 1028 sei_read_code( pDecodedMessageOutputStream, 4, val, "frame0_grid_position_x" ); sei.m_frame0GridPositionX = val; 1029 sei_read_code( pDecodedMessageOutputStream, 4, val, "frame0_grid_position_y" ); sei.m_frame0GridPositionY = val; 1030 sei_read_code( pDecodedMessageOutputStream, 4, val, "frame1_grid_position_x" ); sei.m_frame1GridPositionX = val; 1031 sei_read_code( pDecodedMessageOutputStream, 4, val, "frame1_grid_position_y" ); sei.m_frame1GridPositionY = val; 1032 } 1033 1034 sei_read_code( pDecodedMessageOutputStream, 8, val, "frame_packing_arrangement_reserved_byte" ); sei.m_arrangementReservedByte = val; 1035 sei_read_flag( pDecodedMessageOutputStream, val, "frame_packing_arrangement_persistence_flag" ); sei.m_arrangementPersistenceFlag = (val != 0); 1036 } 1037 sei_read_flag( pDecodedMessageOutputStream, val, "upsampled_aspect_ratio_flag" ); sei.m_upsampledAspectRatio = val; 1038 } 1039 1040 1041 Void SEIReader::xParseSEIDisplayOrientation(SEIDisplayOrientation& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream) 1042 { 1043 UInt val; 1044 output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize); 1045 sei_read_flag( pDecodedMessageOutputStream, val, "display_orientation_cancel_flag" ); sei.cancelFlag = val; 1046 if( !sei.cancelFlag ) 1047 { 1048 sei_read_flag( pDecodedMessageOutputStream, val, "hor_flip" ); sei.horFlip = val; 1049 sei_read_flag( pDecodedMessageOutputStream, val, "ver_flip" ); sei.verFlip = val; 1050 sei_read_code( pDecodedMessageOutputStream, 16, val, "anticlockwise_rotation" ); sei.anticlockwiseRotation = val; 1051 sei_read_flag( pDecodedMessageOutputStream, val, "display_orientation_persistence_flag" ); sei.persistenceFlag = val; 1052 } 1053 } 1054 1055 1056 Void SEIReader::xParseSEIGreenMetadataInfo(SEIGreenMetadataInfo& sei, UInt payloadSize, ostream* pDecodedMessageOutputStream) 1057 { 1058 UInt code; 1059 output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize); 1060 1061 sei_read_code(pDecodedMessageOutputStream, 8, code, "green_metadata_type"); 1062 sei.m_greenMetadataType = code; 1063 1064 sei_read_code(pDecodedMessageOutputStream, 8, code, "xsd_metric_type"); 1065 sei.m_xsdMetricType = code; 1066 1067 sei_read_code(pDecodedMessageOutputStream, 16, code, "xsd_metric_value"); 1068 sei.m_xsdMetricValue = code; 1069 } 1070 1071 895 1072 Void SEIReader::xParseSEISOPDescription(SEISOPDescription &sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream) 896 1073 { … … 913 1090 sei_read_svlc( pDecodedMessageOutputStream, iCode, "sop_poc_delta[i]" ); sei.m_sopDescPocDelta[i] = iCode; 914 1091 } 1092 } 1093 } 1094 1095 Void SEIReader::xParseSEIActiveParameterSets(SEIActiveParameterSets& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream) 1096 { 1097 UInt val; 1098 output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize); 1099 1100 sei_read_code( pDecodedMessageOutputStream, 4, val, "active_video_parameter_set_id"); sei.activeVPSId = val; 1101 sei_read_flag( pDecodedMessageOutputStream, val, "self_contained_cvs_flag"); sei.m_selfContainedCvsFlag = (val != 0); 1102 sei_read_flag( pDecodedMessageOutputStream, val, "no_parameter_set_update_flag"); sei.m_noParameterSetUpdateFlag = (val != 0); 1103 sei_read_uvlc( pDecodedMessageOutputStream, val, "num_sps_ids_minus1"); sei.numSpsIdsMinus1 = val; 1104 1105 sei.activeSeqParameterSetId.resize(sei.numSpsIdsMinus1 + 1); 1106 for (Int i=0; i < (sei.numSpsIdsMinus1 + 1); i++) 1107 { 1108 sei_read_uvlc( pDecodedMessageOutputStream, val, "active_seq_parameter_set_id[i]"); sei.activeSeqParameterSetId[i] = val; 1109 } 1110 } 1111 1112 1113 Void SEIReader::xParseSEIDecodingUnitInfo(SEIDecodingUnitInfo& sei, UInt payloadSize, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream) 1114 { 1115 UInt val; 1116 output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize); 1117 sei_read_uvlc( pDecodedMessageOutputStream, val, "decoding_unit_idx"); 1118 sei.m_decodingUnitIdx = val; 1119 1120 const TComVUI *vui = sps->getVuiParameters(); 1121 if(vui->getHrdParameters()->getSubPicCpbParamsInPicTimingSEIFlag()) 1122 { 1123 sei_read_code( pDecodedMessageOutputStream, ( vui->getHrdParameters()->getDuCpbRemovalDelayLengthMinus1() + 1 ), val, "du_spt_cpb_removal_delay_increment"); 1124 sei.m_duSptCpbRemovalDelay = val; 1125 } 1126 else 1127 { 1128 sei.m_duSptCpbRemovalDelay = 0; 1129 } 1130 sei_read_flag( pDecodedMessageOutputStream, val, "dpb_output_du_delay_present_flag"); sei.m_dpbOutputDuDelayPresentFlag = (val != 0); 1131 if(sei.m_dpbOutputDuDelayPresentFlag) 1132 { 1133 sei_read_code( pDecodedMessageOutputStream, vui->getHrdParameters()->getDpbOutputDelayDuLengthMinus1() + 1, val, "pic_spt_dpb_output_du_delay"); 1134 sei.m_picSptDpbOutputDuDelay = val; 1135 } 1136 } 1137 1138 1139 Void SEIReader::xParseSEITemporalLevel0Index(SEITemporalLevel0Index& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream) 1140 { 1141 UInt val; 1142 output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize); 1143 sei_read_code( pDecodedMessageOutputStream, 8, val, "temporal_sub_layer_zero_idx" ); sei.tl0Idx = val; 1144 sei_read_code( pDecodedMessageOutputStream, 8, val, "irap_pic_id" ); sei.rapIdx = val; 1145 } 1146 1147 1148 Void SEIReader::xParseSEIDecodedPictureHash(SEIDecodedPictureHash& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream) 1149 { 1150 UInt bytesRead = 0; 1151 output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize); 1152 1153 UInt val; 1154 sei_read_code( pDecodedMessageOutputStream, 8, val, "hash_type"); 1155 sei.method = static_cast<HashType>(val); bytesRead++; 1156 1157 const TChar *traceString="\0"; 1158 switch (sei.method) 1159 { 1160 case HASHTYPE_MD5: traceString="picture_md5"; break; 1161 case HASHTYPE_CRC: traceString="picture_crc"; break; 1162 case HASHTYPE_CHECKSUM: traceString="picture_checksum"; break; 1163 default: assert(false); break; 1164 } 1165 1166 if (pDecodedMessageOutputStream) 1167 { 1168 (*pDecodedMessageOutputStream) << " " << std::setw(55) << traceString << ": " << std::hex << std::setfill('0'); 1169 } 1170 1171 sei.m_pictureHash.hash.clear(); 1172 for(;bytesRead < payloadSize; bytesRead++) 1173 { 1174 sei_read_code( NULL, 8, val, traceString); 1175 sei.m_pictureHash.hash.push_back((UChar)val); 1176 if (pDecodedMessageOutputStream) 1177 { 1178 (*pDecodedMessageOutputStream) << std::setw(2) << val; 1179 } 1180 } 1181 1182 if (pDecodedMessageOutputStream) 1183 { 1184 (*pDecodedMessageOutputStream) << std::dec << std::setfill(' ') << "\n"; 915 1185 } 916 1186 } … … 976 1246 977 1247 978 Void SEIReader::xParseSEITempMotionConstraintsTileSets(SEITempMotionConstrainedTileSets& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream) 979 { 980 UInt code; 981 output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize); 982 sei_read_flag( pDecodedMessageOutputStream, code, "mc_all_tiles_exact_sample_value_match_flag"); sei.m_mc_all_tiles_exact_sample_value_match_flag = (code != 0); 983 sei_read_flag( pDecodedMessageOutputStream, code, "each_tile_one_tile_set_flag"); sei.m_each_tile_one_tile_set_flag = (code != 0); 984 985 if(!sei.m_each_tile_one_tile_set_flag) 986 { 987 sei_read_flag( pDecodedMessageOutputStream, code, "limited_tile_set_display_flag"); sei.m_limited_tile_set_display_flag = (code != 0); 988 sei_read_uvlc( pDecodedMessageOutputStream, code, "num_sets_in_message_minus1"); sei.setNumberOfTileSets(code + 1); 989 990 if(sei.getNumberOfTileSets() != 0) 991 { 992 for(Int i = 0; i < sei.getNumberOfTileSets(); i++) 993 { 994 sei_read_uvlc( pDecodedMessageOutputStream, code, "mcts_id"); sei.tileSetData(i).m_mcts_id = code; 995 996 if(sei.m_limited_tile_set_display_flag) 997 { 998 sei_read_flag( pDecodedMessageOutputStream, code, "display_tile_set_flag"); sei.tileSetData(i).m_display_tile_set_flag = (code != 1); 999 } 1000 1001 sei_read_uvlc( pDecodedMessageOutputStream, code, "num_tile_rects_in_set_minus1"); sei.tileSetData(i).setNumberOfTileRects(code + 1); 1002 1003 for(Int j=0; j<sei.tileSetData(i).getNumberOfTileRects(); j++) 1004 { 1005 sei_read_uvlc( pDecodedMessageOutputStream, code, "top_left_tile_index"); sei.tileSetData(i).topLeftTileIndex(j) = code; 1006 sei_read_uvlc( pDecodedMessageOutputStream, code, "bottom_right_tile_index"); sei.tileSetData(i).bottomRightTileIndex(j) = code; 1007 } 1008 1009 if(!sei.m_mc_all_tiles_exact_sample_value_match_flag) 1010 { 1011 sei_read_flag( pDecodedMessageOutputStream, code, "exact_sample_value_match_flag"); sei.tileSetData(i).m_exact_sample_value_match_flag = (code != 0); 1012 } 1013 sei_read_flag( pDecodedMessageOutputStream, code, "mcts_tier_level_idc_present_flag"); sei.tileSetData(i).m_mcts_tier_level_idc_present_flag = (code != 0); 1014 1015 if(sei.tileSetData(i).m_mcts_tier_level_idc_present_flag) 1016 { 1017 sei_read_flag( pDecodedMessageOutputStream, code, "mcts_tier_flag"); sei.tileSetData(i).m_mcts_tier_flag = (code != 0); 1018 sei_read_code( pDecodedMessageOutputStream, 8, code, "mcts_level_idc"); sei.tileSetData(i).m_mcts_level_idc = code; 1019 } 1020 } 1021 } 1022 } 1023 else 1024 { 1025 sei_read_flag( pDecodedMessageOutputStream, code, "max_mcs_tier_level_idc_present_flag"); sei.m_max_mcs_tier_level_idc_present_flag = code; 1026 if(sei.m_max_mcs_tier_level_idc_present_flag) 1027 { 1028 sei_read_flag( pDecodedMessageOutputStream, code, "max_mcts_tier_flag"); sei.m_max_mcts_tier_flag = code; 1029 sei_read_code( pDecodedMessageOutputStream, 8, code, "max_mcts_level_idc"); sei.m_max_mcts_level_idc = code; 1030 } 1031 } 1032 } 1248 Void SEIReader::xParseSEIRegionRefreshInfo(SEIRegionRefreshInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream) 1249 { 1250 UInt val; 1251 output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize); 1252 sei_read_flag( pDecodedMessageOutputStream, val, "refreshed_region_flag" ); sei.m_gdrForegroundFlag = val ? 1 : 0; 1253 } 1254 1255 1256 Void SEIReader::xParseSEINoDisplay(SEINoDisplay& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream) 1257 { 1258 output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize); 1259 sei.m_noDisplay = true; 1260 } 1261 1033 1262 1034 1263 Void SEIReader::xParseSEITimeCode(SEITimeCode& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream) … … 1092 1321 } 1093 1322 1323 1324 Void SEIReader::xParseSEIMasteringDisplayColourVolume(SEIMasteringDisplayColourVolume& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream) 1325 { 1326 UInt code; 1327 output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize); 1328 1329 sei_read_code( pDecodedMessageOutputStream, 16, code, "display_primaries_x[0]" ); sei.values.primaries[0][0] = code; 1330 sei_read_code( pDecodedMessageOutputStream, 16, code, "display_primaries_y[0]" ); sei.values.primaries[0][1] = code; 1331 1332 sei_read_code( pDecodedMessageOutputStream, 16, code, "display_primaries_x[1]" ); sei.values.primaries[1][0] = code; 1333 sei_read_code( pDecodedMessageOutputStream, 16, code, "display_primaries_y[1]" ); sei.values.primaries[1][1] = code; 1334 1335 sei_read_code( pDecodedMessageOutputStream, 16, code, "display_primaries_x[2]" ); sei.values.primaries[2][0] = code; 1336 sei_read_code( pDecodedMessageOutputStream, 16, code, "display_primaries_y[2]" ); sei.values.primaries[2][1] = code; 1337 1338 1339 sei_read_code( pDecodedMessageOutputStream, 16, code, "white_point_x" ); sei.values.whitePoint[0] = code; 1340 sei_read_code( pDecodedMessageOutputStream, 16, code, "white_point_y" ); sei.values.whitePoint[1] = code; 1341 1342 sei_read_code( pDecodedMessageOutputStream, 32, code, "max_display_mastering_luminance" ); sei.values.maxLuminance = code; 1343 sei_read_code( pDecodedMessageOutputStream, 32, code, "min_display_mastering_luminance" ); sei.values.minLuminance = code; 1344 } 1345 1346 1347 Void SEIReader::xParseSEISegmentedRectFramePacking(SEISegmentedRectFramePacking& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream) 1348 { 1349 UInt val; 1350 output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize); 1351 sei_read_flag( pDecodedMessageOutputStream, val, "segmented_rect_frame_packing_arrangement_cancel_flag" ); sei.m_arrangementCancelFlag = val; 1352 if( !sei.m_arrangementCancelFlag ) 1353 { 1354 sei_read_code( pDecodedMessageOutputStream, 2, val, "segmented_rect_content_interpretation_type" ); sei.m_contentInterpretationType = val; 1355 sei_read_flag( pDecodedMessageOutputStream, val, "segmented_rect_frame_packing_arrangement_persistence" ); sei.m_arrangementPersistenceFlag = val; 1356 } 1357 } 1358 1359 1360 Void SEIReader::xParseSEITempMotionConstraintsTileSets(SEITempMotionConstrainedTileSets& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream) 1361 { 1362 UInt code; 1363 output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize); 1364 sei_read_flag( pDecodedMessageOutputStream, code, "mc_all_tiles_exact_sample_value_match_flag"); sei.m_mc_all_tiles_exact_sample_value_match_flag = (code != 0); 1365 sei_read_flag( pDecodedMessageOutputStream, code, "each_tile_one_tile_set_flag"); sei.m_each_tile_one_tile_set_flag = (code != 0); 1366 1367 if(!sei.m_each_tile_one_tile_set_flag) 1368 { 1369 sei_read_flag( pDecodedMessageOutputStream, code, "limited_tile_set_display_flag"); sei.m_limited_tile_set_display_flag = (code != 0); 1370 sei_read_uvlc( pDecodedMessageOutputStream, code, "num_sets_in_message_minus1"); sei.setNumberOfTileSets(code + 1); 1371 1372 if(sei.getNumberOfTileSets() != 0) 1373 { 1374 for(Int i = 0; i < sei.getNumberOfTileSets(); i++) 1375 { 1376 sei_read_uvlc( pDecodedMessageOutputStream, code, "mcts_id"); sei.tileSetData(i).m_mcts_id = code; 1377 1378 if(sei.m_limited_tile_set_display_flag) 1379 { 1380 sei_read_flag( pDecodedMessageOutputStream, code, "display_tile_set_flag"); sei.tileSetData(i).m_display_tile_set_flag = (code != 1); 1381 } 1382 1383 sei_read_uvlc( pDecodedMessageOutputStream, code, "num_tile_rects_in_set_minus1"); sei.tileSetData(i).setNumberOfTileRects(code + 1); 1384 1385 for(Int j=0; j<sei.tileSetData(i).getNumberOfTileRects(); j++) 1386 { 1387 sei_read_uvlc( pDecodedMessageOutputStream, code, "top_left_tile_index"); sei.tileSetData(i).topLeftTileIndex(j) = code; 1388 sei_read_uvlc( pDecodedMessageOutputStream, code, "bottom_right_tile_index"); sei.tileSetData(i).bottomRightTileIndex(j) = code; 1389 } 1390 1391 if(!sei.m_mc_all_tiles_exact_sample_value_match_flag) 1392 { 1393 sei_read_flag( pDecodedMessageOutputStream, code, "exact_sample_value_match_flag"); sei.tileSetData(i).m_exact_sample_value_match_flag = (code != 0); 1394 } 1395 sei_read_flag( pDecodedMessageOutputStream, code, "mcts_tier_level_idc_present_flag"); sei.tileSetData(i).m_mcts_tier_level_idc_present_flag = (code != 0); 1396 1397 if(sei.tileSetData(i).m_mcts_tier_level_idc_present_flag) 1398 { 1399 sei_read_flag( pDecodedMessageOutputStream, code, "mcts_tier_flag"); sei.tileSetData(i).m_mcts_tier_flag = (code != 0); 1400 sei_read_code( pDecodedMessageOutputStream, 8, code, "mcts_level_idc"); sei.tileSetData(i).m_mcts_level_idc = code; 1401 } 1402 } 1403 } 1404 } 1405 else 1406 { 1407 sei_read_flag( pDecodedMessageOutputStream, code, "max_mcs_tier_level_idc_present_flag"); sei.m_max_mcs_tier_level_idc_present_flag = code; 1408 if(sei.m_max_mcs_tier_level_idc_present_flag) 1409 { 1410 sei_read_flag( pDecodedMessageOutputStream, code, "max_mcts_tier_flag"); sei.m_max_mcts_tier_flag = code; 1411 sei_read_code( pDecodedMessageOutputStream, 8, code, "max_mcts_level_idc"); sei.m_max_mcts_level_idc = code; 1412 } 1413 } 1414 } 1415 1416 1094 1417 Void SEIReader::xParseSEIChromaResamplingFilterHint(SEIChromaResamplingFilterHint& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream) 1095 1418 { … … 1256 1579 } 1257 1580 1258 1259 Void SEIReader::xParseSEIMasteringDisplayColourVolume(SEIMasteringDisplayColourVolume& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream) 1260 { 1261 UInt code; 1262 output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize); 1263 1264 sei_read_code( pDecodedMessageOutputStream, 16, code, "display_primaries_x[0]" ); sei.values.primaries[0][0] = code; 1265 sei_read_code( pDecodedMessageOutputStream, 16, code, "display_primaries_y[0]" ); sei.values.primaries[0][1] = code; 1266 1267 sei_read_code( pDecodedMessageOutputStream, 16, code, "display_primaries_x[1]" ); sei.values.primaries[1][0] = code; 1268 sei_read_code( pDecodedMessageOutputStream, 16, code, "display_primaries_y[1]" ); sei.values.primaries[1][1] = code; 1269 1270 sei_read_code( pDecodedMessageOutputStream, 16, code, "display_primaries_x[2]" ); sei.values.primaries[2][0] = code; 1271 sei_read_code( pDecodedMessageOutputStream, 16, code, "display_primaries_y[2]" ); sei.values.primaries[2][1] = code; 1272 1273 1274 sei_read_code( pDecodedMessageOutputStream, 16, code, "white_point_x" ); sei.values.whitePoint[0] = code; 1275 sei_read_code( pDecodedMessageOutputStream, 16, code, "white_point_y" ); sei.values.whitePoint[1] = code; 1276 1277 sei_read_code( pDecodedMessageOutputStream, 32, code, "max_display_mastering_luminance" ); sei.values.maxLuminance = code; 1278 sei_read_code( pDecodedMessageOutputStream, 32, code, "min_display_mastering_luminance" ); sei.values.minLuminance = code; 1279 } 1280 1281 #if U0033_ALTERNATIVE_TRANSFER_CHARACTERISTICS_SEI 1581 Void SEIReader::xParseSEIDeinterlaceFieldIdentification( SEIDeinterlaceFieldIdentification& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream ) 1582 { 1583 UInt code; 1584 output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize); 1585 1586 sei_read_flag(pDecodedMessageOutputStream, code, "deinterlaced_picture_source_parity_flag"); sei.m_deinterlacedPictureSourceParityFlag = code!=0; 1587 } 1588 1589 1590 Void SEIReader::xParseSEIContentLightLevelInfo( SEIContentLightLevelInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream ) 1591 { 1592 UInt code; 1593 output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize); 1594 1595 sei_read_code(pDecodedMessageOutputStream, 16, code, "max_content_light_level"); sei.m_maxContentLightLevel = code; 1596 sei_read_code(pDecodedMessageOutputStream, 16, code, "max_pic_average_light_level"); sei.m_maxPicAverageLightLevel = code; 1597 } 1598 1599 1600 Void SEIReader::xParseSEIDependentRAPIndication( SEIDependentRAPIndication& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream ) 1601 { 1602 output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize); 1603 } 1604 1605 1606 Void SEIReader::xParseSEICodedRegionCompletion( SEICodedRegionCompletion& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream ) 1607 { 1608 UInt code; 1609 output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize); 1610 1611 sei_read_uvlc(pDecodedMessageOutputStream, code, "next_segment_address"); sei.m_nextSegmentAddress= code; 1612 if (code) 1613 { 1614 sei_read_flag(pDecodedMessageOutputStream, code, "independent_slice_segment_flag"); sei.m_independentSliceSegmentFlag = code!=0; 1615 } 1616 else 1617 { 1618 sei.m_independentSliceSegmentFlag=false; // initialise to known value. 1619 } 1620 } 1621 1622 1282 1623 Void SEIReader::xParseSEIAlternativeTransferCharacteristics(SEIAlternativeTransferCharacteristics& sei, UInt payloadSize, ostream* pDecodedMessageOutputStream) 1283 1624 { … … 1287 1628 sei_read_code(pDecodedMessageOutputStream, 8, code, "preferred_transfer_characteristics"); sei.m_preferredTransferCharacteristics = code; 1288 1629 } 1289 #endif 1630 1631 1632 Void SEIReader::xParseSEIAmbientViewingEnvironment( SEIAmbientViewingEnvironment& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream ) 1633 { 1634 UInt code; 1635 output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize); 1636 1637 sei_read_code(pDecodedMessageOutputStream, 32, code, "ambient_illuminance"); sei.m_ambientIlluminance= code; 1638 sei_read_code(pDecodedMessageOutputStream, 16, code, "ambient_light_x"); sei.m_ambientLightX = (UShort)code; 1639 sei_read_code(pDecodedMessageOutputStream, 16, code, "ambient_light_y"); sei.m_ambientLightY = (UShort)code; 1640 } 1641 1290 1642 1291 1643 #if NH_MV -
trunk/source/Lib/TLibDecoder/SEIread.h
r1405 r1413 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 * … … 69 69 Void xReadSEImessage (SEIMessages& seis, const NalUnitType nalUnitType, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream); 70 70 #endif 71 Void xParseSEIuserDataUnregistered (SEIuserDataUnregistered &sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 71 Void xParseSEIBufferingPeriod (SEIBufferingPeriod& sei, UInt payloadSize, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream); 72 Void xParseSEIPictureTiming (SEIPictureTiming& sei, UInt payloadSize, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream); 73 Void xParseSEIPanScanRect (SEIPanScanRect& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 74 Void xParseSEIFillerPayload (SEIFillerPayload& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 75 Void xParseSEIUserDataRegistered (SEIUserDataRegistered& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 76 Void xParseSEIUserDataUnregistered (SEIUserDataUnregistered &sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 77 Void xParseSEIRecoveryPoint (SEIRecoveryPoint& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 78 Void xParseSEISceneInfo (SEISceneInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 79 Void xParseSEIPictureSnapshot (SEIPictureSnapshot& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 80 Void xParseSEIProgressiveRefinementSegmentStart(SEIProgressiveRefinementSegmentStart& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 81 Void xParseSEIProgressiveRefinementSegmentEnd(SEIProgressiveRefinementSegmentEnd& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 82 Void xParseSEIFilmGrainCharacteristics (SEIFilmGrainCharacteristics& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 83 Void xParseSEIPostFilterHint (SEIPostFilterHint& sei, UInt payloadSize, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream); 84 Void xParseSEIToneMappingInfo (SEIToneMappingInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 85 Void xParseSEIFramePacking (SEIFramePacking& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 86 Void xParseSEIDisplayOrientation (SEIDisplayOrientation &sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 87 Void xParseSEIGreenMetadataInfo (SEIGreenMetadataInfo& sei, UInt payLoadSize, std::ostream *pDecodedMessageOutputStream); 88 Void xParseSEISOPDescription (SEISOPDescription &sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 72 89 Void xParseSEIActiveParameterSets (SEIActiveParameterSets &sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 73 90 Void xParseSEIDecodingUnitInfo (SEIDecodingUnitInfo& sei, UInt payloadSize, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream); 91 Void xParseSEITemporalLevel0Index (SEITemporalLevel0Index &sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 74 92 Void xParseSEIDecodedPictureHash (SEIDecodedPictureHash& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 75 Void xParseSEIBufferingPeriod (SEIBufferingPeriod& sei, UInt payloadSize, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream);76 Void xParseSEIPictureTiming (SEIPictureTiming& sei, UInt payloadSize, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream);77 Void xParseSEIRecoveryPoint (SEIRecoveryPoint& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);78 Void xParseSEIFramePacking (SEIFramePacking& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);79 Void xParseSEISegmentedRectFramePacking (SEISegmentedRectFramePacking& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);80 Void xParseSEIDisplayOrientation (SEIDisplayOrientation &sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);81 Void xParseSEITemporalLevel0Index (SEITemporalLevel0Index &sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);82 Void xParseSEIRegionRefreshInfo (SEIGradualDecodingRefreshInfo &sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);83 Void xParseSEINoDisplay (SEINoDisplay &sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);84 Void xParseSEIToneMappingInfo (SEIToneMappingInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);85 Void xParseSEISOPDescription (SEISOPDescription &sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);86 93 #if NH_MV 87 94 Void xParseSEIScalableNesting (SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, const TComVPS *vps, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream); … … 89 96 Void xParseSEIScalableNesting (SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream); 90 97 #endif 98 Void xParseSEIRegionRefreshInfo (SEIRegionRefreshInfo &sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 99 Void xParseSEINoDisplay (SEINoDisplay &sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 100 Void xParseSEITimeCode (SEITimeCode& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 101 Void xParseSEIMasteringDisplayColourVolume (SEIMasteringDisplayColourVolume& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 102 Void xParseSEISegmentedRectFramePacking (SEISegmentedRectFramePacking& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 91 103 Void xParseSEITempMotionConstraintsTileSets (SEITempMotionConstrainedTileSets& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 92 Void xParseSEITimeCode (SEITimeCode& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);93 104 Void xParseSEIChromaResamplingFilterHint (SEIChromaResamplingFilterHint& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 94 105 Void xParseSEIKneeFunctionInfo (SEIKneeFunctionInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 95 Void xParseSEIMasteringDisplayColourVolume (SEIMasteringDisplayColourVolume& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);96 106 Void xParseSEIColourRemappingInfo (SEIColourRemappingInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 97 #if U0033_ALTERNATIVE_TRANSFER_CHARACTERISTICS_SEI 98 Void xParseSEIAlternativeTransferCharacteristics(SEIAlternativeTransferCharacteristics& sei, UInt payLoadSize, std::ostream *pDecodedMessageOutputStream); 99 #endif 107 Void xParseSEIDeinterlaceFieldIdentification(SEIDeinterlaceFieldIdentification& sei,UInt payLoadSize, std::ostream *pDecodedMessageOutputStream); 108 Void xParseSEIContentLightLevelInfo (SEIContentLightLevelInfo& sei, UInt payLoadSize, std::ostream *pDecodedMessageOutputStream); 109 Void xParseSEIDependentRAPIndication (SEIDependentRAPIndication& sei, UInt payLoadSize, std::ostream *pDecodedMessageOutputStream); 110 Void xParseSEICodedRegionCompletion (SEICodedRegionCompletion& sei, UInt payLoadSize, std::ostream *pDecodedMessageOutputStream); 111 Void xParseSEIAlternativeTransferCharacteristics(SEIAlternativeTransferCharacteristics& sei, UInt payLoadSize, std::ostream *pDecodedMessageOutputStream); 112 Void xParseSEIAmbientViewingEnvironment (SEIAmbientViewingEnvironment& sei, UInt payLoadSize, std::ostream *pDecodedMessageOutputStream); 100 113 #if NH_MV 101 114 Void xParseSEILayersNotPresent (SEILayersNotPresent &sei, UInt payloadSize, const TComVPS *vps ,std::ostream *pDecodedMessageOutputStream); -
trunk/source/Lib/TLibDecoder/SyntaxElementParser.cpp
r1405 r1413 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 { -
trunk/source/Lib/TLibDecoder/SyntaxElementParser.h
r1405 r1413 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 * … … 43 43 #endif // _MSC_VER > 1000 44 44 #include "TLibCommon/TComRom.h" 45 #i f ENC_DEC_TRACE45 #include "TDecConformance.h" 46 46 47 #define READ_CODE(length, code, name) xReadCodeTr ( length, code, name ) 48 #define READ_UVLC( code, name) xReadUvlcTr ( code, name ) 49 #define READ_SVLC( code, name) xReadSvlcTr ( code, name ) 50 #define READ_FLAG( code, name) xReadFlagTr ( code, name ) 51 #if NH_MV 52 #define READ_STRING(bufSize, code, length, name) xReadStringTr ( bufSize, code, length, name ) 47 #if DECODER_PARTIAL_CONFORMANCE_CHECK!=0 48 #define READ_CODE_CHK(length, code, name, minValIncl, maxValIncl) xReadCodeChk ( length, code, name, minValIncl, maxValIncl ) 49 #define READ_UVLC_CHK( code, name, minValIncl, maxValIncl) xReadUvlcChk ( code, name, minValIncl, maxValIncl ) 50 #define READ_SVLC_CHK( code, name, minValIncl, maxValIncl) xReadSvlcChk ( code, name, minValIncl, maxValIncl ) 51 #define READ_FLAG_CHK( code, name, minValIncl, maxValIncl) xReadFlagChk ( code, name, minValIncl, maxValIncl ) 52 #elif RExt__DECODER_DEBUG_BIT_STATISTICS || ENC_DEC_TRACE 53 #define READ_CODE_CHK(length, code, name, minValIncl, maxValIncl) xReadCode ( length, code, name ) 54 #define READ_UVLC_CHK( code, name, minValIncl, maxValIncl) xReadUvlc ( code, name ) 55 #define READ_SVLC_CHK( code, name, minValIncl, maxValIncl) xReadSvlc ( code, name ) 56 #define READ_FLAG_CHK( code, name, minValIncl, maxValIncl) xReadFlag ( code, name ) 57 #else 58 #define READ_CODE_CHK(length, code, name, minValIncl, maxValIncl) xReadCode ( length, code ) 59 #define READ_UVLC_CHK( code, name, minValIncl, maxValIncl) xReadUvlc ( code ) 60 #define READ_SVLC_CHK( code, name, minValIncl, maxValIncl) xReadSvlc ( code ) 61 #define READ_FLAG_CHK( code, name, minValIncl, maxValIncl) xReadFlag ( code ) 53 62 #endif 54 #else 55 56 #if RExt__DECODER_DEBUG_BIT_STATISTICS 57 63 #if RExt__DECODER_DEBUG_BIT_STATISTICS || ENC_DEC_TRACE 58 64 #define READ_CODE(length, code, name) xReadCode ( length, code, name ) 59 65 #define READ_UVLC( code, name) xReadUvlc ( code, name ) … … 64 70 #endif 65 71 #else 66 67 72 #define READ_CODE(length, code, name) xReadCode ( length, code ) 68 73 #define READ_UVLC( code, name) xReadUvlc ( code ) … … 71 76 #if NH_MV 72 77 #define READ_STRING(bufSize, code, length, name) xReadString ( bufSize, code, length ) 73 #endif74 75 78 #endif 76 79 … … 94 97 virtual ~SyntaxElementParser() {}; 95 98 96 #if RExt__DECODER_DEBUG_BIT_STATISTICS 99 #if DECODER_PARTIAL_CONFORMANCE_CHECK!=0 100 Void xReadCodeChk ( UInt length, UInt& val, const TChar *pSymbolName, const UInt minValIncl, const UInt maxValIncl ); 101 Void xReadUvlcChk ( UInt& val, const TChar *pSymbolName, const UInt minValIncl, const UInt maxValIncl ); 102 Void xReadSvlcChk ( Int& val, const TChar *pSymbolName, const Int minValIncl, const Int maxValIncl ); 103 Void xReadFlagChk ( UInt& val, const TChar *pSymbolName, const UInt minValIncl, const UInt maxValIncl ); 104 #endif 105 106 107 #if RExt__DECODER_DEBUG_BIT_STATISTICS || ENC_DEC_TRACE 97 108 Void xReadCode ( UInt length, UInt& val, const TChar *pSymbolName ); 98 109 Void xReadUvlc ( UInt& val, const TChar *pSymbolName ); … … 109 120 #if NH_MV 110 121 Void xReadString ( UInt bufSize, UChar *val, UInt& length); 111 #endif112 #endif113 #if ENC_DEC_TRACE114 Void xReadCodeTr (UInt length, UInt& rValue, const TChar *pSymbolName);115 Void xReadUvlcTr ( UInt& rValue, const TChar *pSymbolName);116 Void xReadSvlcTr ( Int& rValue, const TChar *pSymbolName);117 Void xReadFlagTr ( UInt& rValue, const TChar *pSymbolName);118 #if NH_MV119 122 Void xReadStringTr(UInt bufSize, UChar *pValue, UInt& rLength, const TChar *pSymbolName); 120 123 #endif -
trunk/source/Lib/TLibDecoder/TDecBinCoder.h
r1405 r1413 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 * -
trunk/source/Lib/TLibDecoder/TDecBinCoderCABAC.cpp
r1405 r1413 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 * -
trunk/source/Lib/TLibDecoder/TDecBinCoderCABAC.h
r1405 r1413 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 * -
trunk/source/Lib/TLibDecoder/TDecCAVLC.cpp
r1405 r1413 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 * … … 43 43 #include "TLibCommon/TComCodingStatistics.h" 44 44 #endif 45 #include "TDecConformance.h" 46 45 47 #if NH_MV 46 48 #include "TDecTop.h" … … 244 246 Int iCode; 245 247 246 READ_UVLC ( uiCode, "pps_pic_parameter_set_id");248 READ_UVLC_CHK( uiCode, "pps_pic_parameter_set_id", 0, 63); 247 249 assert(uiCode <= 63); 248 250 pcPPS->setPPSId (uiCode); 249 251 250 READ_UVLC ( uiCode, "pps_seq_parameter_set_id");252 READ_UVLC_CHK( uiCode, "pps_seq_parameter_set_id", 0, 15); 251 253 assert(uiCode <= 15); 252 254 pcPPS->setSPSId (uiCode); … … 258 260 READ_CODE(3, uiCode, "num_extra_slice_header_bits"); pcPPS->setNumExtraSliceHeaderBits(uiCode); 259 261 260 READ_FLAG ( uiCode, "sign_data_hiding_ flag" ); pcPPS->setSignHideFlag( uiCode );262 READ_FLAG ( uiCode, "sign_data_hiding_enabled_flag" ); pcPPS->setSignDataHidingEnabledFlag( uiCode ); 261 263 262 264 READ_FLAG( uiCode, "cabac_init_present_flag" ); pcPPS->setCabacInitPresentFlag( uiCode ? true : false ); 263 265 264 READ_UVLC (uiCode, "num_ref_idx_l0_default_active_minus1");266 READ_UVLC_CHK(uiCode, "num_ref_idx_l0_default_active_minus1", 0, 14); 265 267 assert(uiCode <= 14); 266 268 pcPPS->setNumRefIdxL0DefaultActive(uiCode+1); 267 269 268 READ_UVLC (uiCode, "num_ref_idx_l1_default_active_minus1");270 READ_UVLC_CHK(uiCode, "num_ref_idx_l1_default_active_minus1", 0, 14); 269 271 assert(uiCode <= 14); 270 272 pcPPS->setNumRefIdxL1DefaultActive(uiCode+1); 271 273 272 READ_SVLC (iCode, "init_qp_minus26" );pcPPS->setPicInitQPMinus26(iCode);274 READ_SVLC_CHK(iCode, "init_qp_minus26", std::numeric_limits<Int>::min(), 25 ); pcPPS->setPicInitQPMinus26(iCode); 273 275 READ_FLAG( uiCode, "constrained_intra_pred_flag" ); pcPPS->setConstrainedIntraPred( uiCode ? true : false ); 274 276 READ_FLAG( uiCode, "transform_skip_enabled_flag" ); … … 285 287 pcPPS->setMaxCuDQPDepth( 0 ); 286 288 } 287 READ_SVLC ( iCode, "pps_cb_qp_offset");289 READ_SVLC_CHK( iCode, "pps_cb_qp_offset", -12, 12); 288 290 pcPPS->setQpOffset(COMPONENT_Cb, iCode); 289 291 assert( pcPPS->getQpOffset(COMPONENT_Cb) >= -12 ); 290 292 assert( pcPPS->getQpOffset(COMPONENT_Cb) <= 12 ); 291 293 292 READ_SVLC ( iCode, "pps_cr_qp_offset");294 READ_SVLC_CHK( iCode, "pps_cr_qp_offset", -12, 12); 293 295 pcPPS->setQpOffset(COMPONENT_Cr, iCode); 294 296 assert( pcPPS->getQpOffset(COMPONENT_Cr) >= -12 ); … … 305 307 pcPPS->setWPBiPred( uiCode==1 ); 306 308 307 READ_FLAG( uiCode, "transquant_bypass_enable _flag");308 pcPPS->setTransquantBypassEnable Flag(uiCode ? true : false);309 READ_FLAG( uiCode, "transquant_bypass_enabled_flag"); 310 pcPPS->setTransquantBypassEnabledFlag(uiCode ? true : false); 309 311 READ_FLAG( uiCode, "tiles_enabled_flag" ); pcPPS->setTilesEnabledFlag ( uiCode == 1 ); 310 312 READ_FLAG( uiCode, "entropy_coding_sync_enabled_flag" ); pcPPS->setEntropyCodingSyncEnabledFlag( uiCode == 1 ); … … 344 346 } 345 347 346 if ((tileColumnsMinus1 + tileRowsMinus1) != 0) 347 { 348 assert ((tileColumnsMinus1 + tileRowsMinus1) != 0); 348 349 READ_FLAG ( uiCode, "loop_filter_across_tiles_enabled_flag" ); pcPPS->setLoopFilterAcrossTilesEnabledFlag( uiCode ? true : false ); 349 350 } 350 }351 351 READ_FLAG( uiCode, "pps_loop_filter_across_slices_enabled_flag" ); pcPPS->setLoopFilterAcrossSlicesEnabledFlag( uiCode ? true : false ); 352 352 READ_FLAG( uiCode, "deblocking_filter_control_present_flag" ); pcPPS->setDeblockingFilterControlPresentFlag( uiCode ? true : false ); … … 354 354 { 355 355 READ_FLAG( uiCode, "deblocking_filter_override_enabled_flag" ); pcPPS->setDeblockingFilterOverrideEnabledFlag( uiCode ? true : false ); 356 READ_FLAG( uiCode, "pps_d isable_deblocking_filter_flag" ); pcPPS->setPicDisableDeblockingFilterFlag(uiCode ? true : false );357 if(!pcPPS->getP icDisableDeblockingFilterFlag())356 READ_FLAG( uiCode, "pps_deblocking_filter_disabled_flag" ); pcPPS->setPPSDeblockingFilterDisabledFlag(uiCode ? true : false ); 357 if(!pcPPS->getPPSDeblockingFilterDisabledFlag()) 358 358 { 359 359 READ_SVLC ( iCode, "pps_beta_offset_div2" ); pcPPS->setDeblockingFilterBetaOffsetDiv2( iCode ); … … 502 502 READ_UVLC(uiCode, "diff_cu_chroma_qp_offset_depth"); ppsRangeExtension.setDiffCuChromaQpOffsetDepth(uiCode); 503 503 UInt tableSizeMinus1 = 0; 504 READ_UVLC(tableSizeMinus1, "chroma_qp_offset_list_len_minus1");504 READ_UVLC_CHK(tableSizeMinus1, "chroma_qp_offset_list_len_minus1", 0, MAX_QP_OFFSET_LIST_SIZE-1); 505 505 assert(tableSizeMinus1 < MAX_QP_OFFSET_LIST_SIZE); 506 506 … … 509 509 Int cbOffset; 510 510 Int crOffset; 511 READ_SVLC(cbOffset, "cb_qp_offset_list[i]");511 READ_SVLC_CHK(cbOffset, "cb_qp_offset_list[i]", -12, 12); 512 512 assert(cbOffset >= -12 && cbOffset <= 12); 513 READ_SVLC(crOffset, "cr_qp_offset_list[i]");513 READ_SVLC_CHK(crOffset, "cr_qp_offset_list[i]", -12, 12); 514 514 assert(crOffset >= -12 && crOffset <= 12); 515 515 // table uses +1 for index (see comment inside the function) … … 546 546 Void TDecCavlc::parsePps3dExtension( TComPPS* pcPPS ) 547 547 { 548 #if NH_3D_DLT549 548 UInt uiCode = 0; 550 549 // … … 679 678 } 680 679 } 681 #endif 680 682 681 } 683 682 #endif … … 885 884 { 886 885 #endif 887 READ_CODE ( 3, uiCode, "sps_max_sub_layers_minus1" );pcSPS->setMaxTLayers ( uiCode+1 );886 READ_CODE_CHK( 3, uiCode, "sps_max_sub_layers_minus1", 0, 6 ); pcSPS->setMaxTLayers ( uiCode+1 ); 888 887 assert(uiCode <= 6); 889 888 #if NH_MV … … 902 901 { 903 902 // sps_temporal_id_nesting_flag must be 1 when sps_max_sub_layers_minus1 is 0 903 TDecConformanceCheck::checkRange(uiCode, "sps_temporal_id_nesting_flag", 1U, 1U); 904 904 assert( uiCode == 1 ); 905 905 } … … 911 911 } 912 912 #endif 913 READ_UVLC ( uiCode, "sps_seq_parameter_set_id"); pcSPS->setSPSId( uiCode );913 READ_UVLC_CHK( uiCode, "sps_seq_parameter_set_id", 0, 15 ); pcSPS->setSPSId( uiCode ); 914 914 assert(uiCode <= 15); 915 915 #if NH_MV … … 926 926 #endif 927 927 928 READ_UVLC ( uiCode, "chroma_format_idc" );pcSPS->setChromaFormatIdc( ChromaFormat(uiCode) );928 READ_UVLC_CHK( uiCode, "chroma_format_idc", 0, 3 ); pcSPS->setChromaFormatIdc( ChromaFormat(uiCode) ); 929 929 assert(uiCode <= 3); 930 930 if( pcSPS->getChromaFormatIdc() == CHROMA_444 ) 931 931 { 932 READ_FLAG( uiCode, "separate_colour_plane_flag"); assert(uiCode == 0); 933 } 934 935 READ_UVLC ( uiCode, "pic_width_in_luma_samples" ); pcSPS->setPicWidthInLumaSamples ( uiCode ); 936 READ_UVLC ( uiCode, "pic_height_in_luma_samples" ); pcSPS->setPicHeightInLumaSamples( uiCode ); 932 READ_FLAG_CHK( uiCode, "separate_colour_plane_flag", 0, 0); 933 assert(uiCode == 0); 934 } 935 936 // pic_width_in_luma_samples and pic_height_in_luma_samples needs conformance checking - multiples of MinCbSizeY 937 READ_UVLC_CHK ( uiCode, "pic_width_in_luma_samples", 1, std::numeric_limits<UInt>::max() ); pcSPS->setPicWidthInLumaSamples ( uiCode ); 938 READ_UVLC_CHK ( uiCode, "pic_height_in_luma_samples", 1, std::numeric_limits<UInt>::max() ); pcSPS->setPicHeightInLumaSamples( uiCode ); 937 939 READ_FLAG( uiCode, "conformance_window_flag"); 938 940 if (uiCode != 0) … … 948 950 } 949 951 #else 950 READ_UVLC( uiCode, "conf_win_left_offset" ); conf.setWindowLeftOffset ( uiCode * TComSPS::getWinUnitX( pcSPS->getChromaFormatIdc() ) ); 951 READ_UVLC( uiCode, "conf_win_right_offset" ); conf.setWindowRightOffset ( uiCode * TComSPS::getWinUnitX( pcSPS->getChromaFormatIdc() ) ); 952 READ_UVLC( uiCode, "conf_win_top_offset" ); conf.setWindowTopOffset ( uiCode * TComSPS::getWinUnitY( pcSPS->getChromaFormatIdc() ) ); 953 READ_UVLC( uiCode, "conf_win_bottom_offset" ); conf.setWindowBottomOffset( uiCode * TComSPS::getWinUnitY( pcSPS->getChromaFormatIdc() ) ); 952 const UInt subWidthC = TComSPS::getWinUnitX( pcSPS->getChromaFormatIdc() ); 953 const UInt subHeightC = TComSPS::getWinUnitY( pcSPS->getChromaFormatIdc() ); 954 READ_UVLC( uiCode, "conf_win_left_offset" ); conf.setWindowLeftOffset ( uiCode * subWidthC ); 955 READ_UVLC( uiCode, "conf_win_right_offset" ); conf.setWindowRightOffset ( uiCode * subWidthC ); 956 READ_UVLC( uiCode, "conf_win_top_offset" ); conf.setWindowTopOffset ( uiCode * subHeightC ); 957 READ_UVLC( uiCode, "conf_win_bottom_offset" ); conf.setWindowBottomOffset( uiCode * subHeightC ); 958 TDecConformanceCheck::checkRange<UInt>(conf.getWindowLeftOffset()+conf.getWindowRightOffset(), "conformance window width in pixels", 0, pcSPS->getPicWidthInLumaSamples()-1); 954 959 #endif 955 960 } … … 960 965 #endif 961 966 962 READ_UVLC( uiCode, "bit_depth_luma_minus8" ); 967 READ_UVLC_CHK( uiCode, "bit_depth_luma_minus8", 0, 8 ); 968 assert(uiCode <= 8); 963 969 #if O0043_BEST_EFFORT_DECODING 964 970 pcSPS->setStreamBitDepth(CHANNEL_TYPE_LUMA, 8 + uiCode); … … 968 974 uiCode = forceDecodeBitDepth - 8; 969 975 } 970 #endif971 976 assert(uiCode <= 8); 977 #endif 972 978 pcSPS->setBitDepth(CHANNEL_TYPE_LUMA, 8 + uiCode); 973 979 … … 978 984 #endif 979 985 980 READ_UVLC( uiCode, "bit_depth_chroma_minus8" ); 986 READ_UVLC_CHK( uiCode, "bit_depth_chroma_minus8", 0, 8 ); 987 assert(uiCode <= 8); 981 988 #if O0043_BEST_EFFORT_DECODING 982 989 pcSPS->setStreamBitDepth(CHANNEL_TYPE_CHROMA, 8 + uiCode); … … 985 992 uiCode = forceDecodeBitDepth - 8; 986 993 } 987 #endif988 994 assert(uiCode <= 8); 995 #endif 989 996 pcSPS->setBitDepth(CHANNEL_TYPE_CHROMA, 8 + uiCode); 990 997 #if O0043_BEST_EFFORT_DECODING … … 997 1004 #endif 998 1005 999 READ_UVLC( uiCode, "log2_max_pic_order_cnt_lsb_minus4" ); pcSPS->setBitsForPOC( 4 + uiCode ); 1000 assert(uiCode <= 12); 1006 READ_UVLC_CHK( uiCode, "log2_max_pic_order_cnt_lsb_minus4", 0, 12 ); pcSPS->setBitsForPOC( 4 + uiCode ); 1001 1007 1002 1008 #if NH_MV … … 1039 1045 #endif 1040 1046 1041 READ_UVLC( uiCode, "log2_min_luma_coding_block_size_minus3" ); 1042 Int log2MinCUSize = uiCode + 3; 1043 pcSPS->setLog2MinCodingBlockSize(log2MinCUSize); 1044 READ_UVLC( uiCode, "log2_diff_max_min_luma_coding_block_size" ); 1047 const UInt maxLog2CtbSize = TDecConformanceCheck::getMaxLog2CtbSize(*(pcSPS->getPTL())); 1048 const UInt minLog2CtbSize = TDecConformanceCheck::getMinLog2CtbSize(*(pcSPS->getPTL())); 1049 READ_UVLC_CHK( uiCode, "log2_min_luma_coding_block_size_minus3", 0, maxLog2CtbSize-3 ); 1050 assert(uiCode <= maxLog2CtbSize-3); 1051 Int minCbLog2SizeY = uiCode + 3; 1052 pcSPS->setLog2MinCodingBlockSize(minCbLog2SizeY); 1053 1054 // Difference + log2MinCUSize must be <= maxLog2CtbSize 1055 // Difference + log2MinCUSize must be >= minLog2CtbSize 1056 const UInt minLog2DiffMaxMinLumaCodingBlockSize = minLog2CtbSize < minCbLog2SizeY ? 0 : minLog2CtbSize - minCbLog2SizeY; 1057 const UInt maxLog2DiffMaxMinLumaCodingBlockSize = maxLog2CtbSize - minCbLog2SizeY; 1058 1059 READ_UVLC_CHK( uiCode, "log2_diff_max_min_luma_coding_block_size", minLog2DiffMaxMinLumaCodingBlockSize, maxLog2DiffMaxMinLumaCodingBlockSize); 1060 assert(uiCode >= minLog2DiffMaxMinLumaCodingBlockSize && uiCode <= maxLog2DiffMaxMinLumaCodingBlockSize); 1045 1061 pcSPS->setLog2DiffMaxMinCodingBlockSize(uiCode); 1046 1047 if (pcSPS->getPTL()->getGeneralPTL()->getLevelIdc() >= Level::LEVEL5)1048 {1049 assert(log2MinCUSize + pcSPS->getLog2DiffMaxMinCodingBlockSize() >= 5);1050 }1051 1052 Int maxCUDepthDelta = uiCode;1053 pcSPS->set MaxCUWidth ( 1<<(log2MinCUSize + maxCUDepthDelta));1054 pcSPS->setMaxCUHeight ( 1<<(log2MinCUSize + maxCUDepthDelta) ); 1055 READ_UVLC( uiCode, "log2_min_luma_transform_block_size_minus2" ); pcSPS->setQuadtreeTULog2MinSize( uiCode + 2 );1056 1057 READ_UVLC( uiCode, "log2_diff_max_min_luma_transform_block_size" );pcSPS->setQuadtreeTULog2MaxSize( uiCode + pcSPS->getQuadtreeTULog2MinSize() );1062 1063 const Int maxCUDepthDelta = uiCode; 1064 const Int ctbLog2SizeY = minCbLog2SizeY + maxCUDepthDelta; 1065 pcSPS->setMaxCUWidth ( 1<<ctbLog2SizeY ); 1066 pcSPS->setMaxCUHeight ( 1<<ctbLog2SizeY ); 1067 READ_UVLC_CHK( uiCode, "log2_min_luma_transform_block_size_minus2", 0, minCbLog2SizeY-1-2 ); 1068 const UInt minTbLog2SizeY = uiCode + 2; 1069 pcSPS->setQuadtreeTULog2MinSize( minTbLog2SizeY ); 1070 1071 // log2_diff <= Min(CtbLog2SizeY, 5) - minTbLog2SizeY 1072 READ_UVLC_CHK( uiCode, "log2_diff_max_min_luma_transform_block_size", 0, min<UInt>(5U, ctbLog2SizeY) - minTbLog2SizeY ); 1073 pcSPS->setQuadtreeTULog2MaxSize( uiCode + pcSPS->getQuadtreeTULog2MinSize() ); 1058 1074 pcSPS->setMaxTrSize( 1<<(uiCode + pcSPS->getQuadtreeTULog2MinSize()) ); 1059 1075 1060 READ_UVLC ( uiCode, "max_transform_hierarchy_depth_inter"); pcSPS->setQuadtreeTUMaxDepthInter( uiCode+1 );1061 READ_UVLC ( uiCode, "max_transform_hierarchy_depth_intra"); pcSPS->setQuadtreeTUMaxDepthIntra( uiCode+1 );1062 1063 Int addCuDepth = max (0, log2MinCUSize- (Int)pcSPS->getQuadtreeTULog2MinSize() );1076 READ_UVLC_CHK( uiCode, "max_transform_hierarchy_depth_inter", 0, ctbLog2SizeY - minTbLog2SizeY); pcSPS->setQuadtreeTUMaxDepthInter( uiCode+1 ); 1077 READ_UVLC_CHK( uiCode, "max_transform_hierarchy_depth_intra", 0, ctbLog2SizeY - minTbLog2SizeY); pcSPS->setQuadtreeTUMaxDepthIntra( uiCode+1 ); 1078 1079 Int addCuDepth = max (0, minCbLog2SizeY - (Int)pcSPS->getQuadtreeTULog2MinSize() ); 1064 1080 pcSPS->setMaxTotalCUDepth( maxCUDepthDelta + addCuDepth + getMaxCUDepthOffset(pcSPS->getChromaFormatIdc(), pcSPS->getQuadtreeTULog2MinSize()) ); 1065 1081 … … 1095 1111 if( pcSPS->getUsePCM() ) 1096 1112 { 1097 READ_CODE( 4, uiCode, "pcm_sample_bit_depth_luma_minus1" ); pcSPS->setPCMBitDepth ( CHANNEL_TYPE_LUMA, 1 + uiCode ); 1098 READ_CODE( 4, uiCode, "pcm_sample_bit_depth_chroma_minus1" ); pcSPS->setPCMBitDepth ( CHANNEL_TYPE_CHROMA, 1 + uiCode ); 1099 READ_UVLC( uiCode, "log2_min_pcm_luma_coding_block_size_minus3" ); pcSPS->setPCMLog2MinSize (uiCode+3); 1100 READ_UVLC( uiCode, "log2_diff_max_min_pcm_luma_coding_block_size" ); pcSPS->setPCMLog2MaxSize ( uiCode+pcSPS->getPCMLog2MinSize() ); 1113 #if O0043_BEST_EFFORT_DECODING 1114 READ_CODE_CHK( 4, uiCode, "pcm_sample_bit_depth_luma_minus1", 0, pcSPS->getStreamBitDepth(CHANNEL_TYPE_LUMA) ); pcSPS->setPCMBitDepth ( CHANNEL_TYPE_LUMA, 1 + uiCode ); 1115 READ_CODE_CHK( 4, uiCode, "pcm_sample_bit_depth_chroma_minus1", 0, pcSPS->getStreamBitDepth(CHANNEL_TYPE_LUMA) ); pcSPS->setPCMBitDepth ( CHANNEL_TYPE_CHROMA, 1 + uiCode ); 1116 #else 1117 READ_CODE_CHK( 4, uiCode, "pcm_sample_bit_depth_luma_minus1", 0, pcSPS->getBitDepth(CHANNEL_TYPE_LUMA) ); pcSPS->setPCMBitDepth ( CHANNEL_TYPE_LUMA, 1 + uiCode ); 1118 READ_CODE_CHK( 4, uiCode, "pcm_sample_bit_depth_chroma_minus1", 0, pcSPS->getBitDepth(CHANNEL_TYPE_CHROMA) ); pcSPS->setPCMBitDepth ( CHANNEL_TYPE_CHROMA, 1 + uiCode ); 1119 #endif 1120 READ_UVLC_CHK( uiCode, "log2_min_pcm_luma_coding_block_size_minus3", std::min<UInt>(minCbLog2SizeY, 5 )-3, std::min<UInt>(ctbLog2SizeY, 5)-3); 1121 const UInt log2MinIpcmCbSizeY = uiCode+3; 1122 pcSPS->setPCMLog2MinSize (log2MinIpcmCbSizeY); 1123 READ_UVLC_CHK( uiCode, "log2_diff_max_min_pcm_luma_coding_block_size", 0, (std::min<UInt>(ctbLog2SizeY,5) - log2MinIpcmCbSizeY) ); 1124 pcSPS->setPCMLog2MaxSize ( uiCode+pcSPS->getPCMLog2MinSize() ); 1101 1125 READ_FLAG( uiCode, "pcm_loop_filter_disable_flag" ); pcSPS->setPCMFilterDisableFlag ( uiCode ? true : false ); 1102 1126 } 1103 1127 1104 READ_UVLC ( uiCode, "num_short_term_ref_pic_sets");1128 READ_UVLC_CHK( uiCode, "num_short_term_ref_pic_sets", 0, 64 ); 1105 1129 1106 1130 assert(uiCode <= 64); … … 1132 1156 #endif 1133 1157 { 1134 READ_UVLC ( uiCode, "num_long_term_ref_pics_sps");1158 READ_UVLC_CHK( uiCode, "num_long_term_ref_pics_sps", 0, 32 ); 1135 1159 pcSPS->setNumLongTermRefPicSPS(uiCode); 1136 1160 for (UInt k = 0; k < pcSPS->getNumLongTermRefPicSPS(); k++) … … 1142 1166 } 1143 1167 } 1144 READ_FLAG( uiCode, "sps_temporal_mvp_enable _flag" ); pcSPS->setTMVPFlagsPresent(uiCode);1145 1146 READ_FLAG( uiCode, "s ps_strong_intra_smoothing_enable_flag" );pcSPS->setUseStrongIntraSmoothing(uiCode);1168 READ_FLAG( uiCode, "sps_temporal_mvp_enabled_flag" ); pcSPS->setSPSTemporalMVPEnabledFlag(uiCode); 1169 1170 READ_FLAG( uiCode, "strong_intra_smoothing_enable_flag" ); pcSPS->setUseStrongIntraSmoothing(uiCode); 1147 1171 1148 1172 READ_FLAG( uiCode, "vui_parameters_present_flag" ); pcSPS->setVuiParametersPresentFlag(uiCode); … … 2135 2159 for( Int j = 0; j <= vps->getMaxSubLayersInLayerSetMinus1( currLsIdx ); j++ ) 2136 2160 { 2137 #if NH_3D_FIX_TICKET_1142138 2161 if( j > 0 && dpbSize.getSubLayerFlagInfoPresentFlag( i ) ) 2139 #else2140 if( j > 0 && dpbSize.getSubLayerDpbInfoPresentFlag( i, j ) )2141 #endif2142 2162 { 2143 2163 READ_FLAG( uiCode, "sub_layer_dpb_info_present_flag" ); dpbSize.setSubLayerDpbInfoPresentFlag( i, j, uiCode == 1 ); … … 2611 2631 pcSlice->setRPS(rps); 2612 2632 } 2613 if (sps->getTMVPFlagsPresent())2633 if (sps->getSPSTemporalMVPEnabledFlag()) 2614 2634 { 2615 2635 READ_FLAG( uiCode, "slice_temporal_mvp_enabled_flag" ); … … 2881 2901 } 2882 2902 2883 #if NH_3D _IC2903 #if NH_3D 2884 2904 else if( pcSlice->getViewIndex() && ( pcSlice->getSliceType() == P_SLICE || pcSlice->getSliceType() == B_SLICE ) 2885 2905 && !pcSlice->getIsDepth() && vps->getNumRefListLayers( layerId ) > 0 … … 2903 2923 { 2904 2924 READ_UVLC( uiCode, "five_minus_max_num_merge_cand"); 2905 #if NH_3D _IV_MERGE2925 #if NH_3D 2906 2926 pcSlice->setMaxNumMergeCand(( ( pcSlice->getMpiFlag() || pcSlice->getIvMvPredFlag() || pcSlice->getViewSynthesisPredFlag() ) ? MRG_MAX_NUM_CANDS_MEM : MRG_MAX_NUM_CANDS) - uiCode); 2907 2927 #else … … 2960 2980 if(pcSlice->getDeblockingFilterOverrideFlag()) 2961 2981 { 2962 READ_FLAG ( uiCode, "slice_d isable_deblocking_filter_flag" ); pcSlice->setDeblockingFilterDisable(uiCode ? 1 : 0);2982 READ_FLAG ( uiCode, "slice_deblocking_filter_disabled_flag" ); pcSlice->setDeblockingFilterDisable(uiCode ? 1 : 0); 2963 2983 if(!pcSlice->getDeblockingFilterDisable()) 2964 2984 { … … 2973 2993 else 2974 2994 { 2975 pcSlice->setDeblockingFilterDisable ( pps->getPicDisableDeblockingFilterFlag() );2995 pcSlice->setDeblockingFilterDisable ( pps->getPPSDeblockingFilterDisabledFlag() ); 2976 2996 pcSlice->setDeblockingFilterBetaOffsetDiv2( pps->getDeblockingFilterBetaOffsetDiv2() ); 2977 2997 pcSlice->setDeblockingFilterTcOffsetDiv2 ( pps->getDeblockingFilterTcOffsetDiv2() ); … … 3298 3318 ptl->setIntraConstraintFlag(false); 3299 3319 ptl->setLowerBitRateConstraintFlag(true); 3320 if (ptl->getProfileIdc() == Profile::MAIN10 || ptl->getProfileCompatibilityFlag(Profile::MAIN10)) 3321 { 3322 READ_CODE(7, uiCode, PTL_TRACE_TEXT("reserved_zero_7bits" )); 3323 READ_FLAG( uiCode, PTL_TRACE_TEXT("one_picture_only_constraint_flag")); ptl->setOnePictureOnlyConstraintFlag(uiCode != 0); 3324 READ_CODE(16, uiCode, PTL_TRACE_TEXT("reserved_zero_35bits[0..15]" )); 3325 READ_CODE(16, uiCode, PTL_TRACE_TEXT("reserved_zero_35bits[16..31]" )); 3326 READ_CODE(3, uiCode, PTL_TRACE_TEXT("reserved_zero_35bits[32..34]" )); 3327 } 3328 else 3329 { 3300 3330 READ_CODE(16, uiCode, PTL_TRACE_TEXT("reserved_zero_43bits[0..15]" )); 3301 3331 READ_CODE(16, uiCode, PTL_TRACE_TEXT("reserved_zero_43bits[16..31]" )); 3302 3332 READ_CODE(11, uiCode, PTL_TRACE_TEXT("reserved_zero_43bits[32..42]" )); 3333 } 3303 3334 } 3304 3335 … … 3355 3386 } 3356 3387 3357 #if NH_3D _DIS3388 #if NH_3D 3358 3389 Void TDecCavlc::parseDIS( TComDataCU* /*pcCU*/, UInt /*uiAbsPartIdx*/, UInt /*uiDepth*/ ) 3359 3390 { … … 3439 3470 Int iDQp; 3440 3471 3441 #if RExt__DECODER_DEBUG_BIT_STATISTICS 3472 #if RExt__DECODER_DEBUG_BIT_STATISTICS || ENC_DEC_TRACE 3442 3473 READ_SVLC(iDQp, "delta_qp"); 3443 3474 #else … … 3497 3528 } 3498 3529 3499 #if NH_3D _ARP3530 #if NH_3D 3500 3531 Void TDecCavlc::parseARPW( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 3501 3532 { 3502 3533 assert(0); 3503 3534 } 3504 #endif 3505 #if NH_3D_IC 3535 3506 3536 Void TDecCavlc::parseICFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 3507 3537 { 3508 3538 assert(0); 3509 3539 } 3510 #endif 3511 #if NH_3D_SDC_INTRA || NH_3D_SDC_INTER 3540 3512 3541 Void TDecCavlc::parseSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 3513 3542 { … … 3515 3544 } 3516 3545 3517 #endif 3518 #if NH_3D_DBBP 3519 Void TDecCavlc::parseDBBPFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 3520 { 3521 assert(0); 3522 } 3546 Void TDecCavlc::parseDBBPFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 3547 { 3548 assert(0); 3549 } 3523 3550 #endif 3524 3551 // ==================================================================================================================== -
trunk/source/Lib/TLibDecoder/TDecCAVLC.h
r1405 r1413 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 * … … 121 121 122 122 Void parseSkipFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 123 #if NH_3D _DIS123 #if NH_3D 124 124 Void parseDIS ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 125 125 #endif … … 127 127 Void parseMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPUIdx ); 128 128 Void parseMergeIndex ( TComDataCU* pcCU, UInt& ruiMergeIndex ); 129 #if NH_3D _ARP129 #if NH_3D 130 130 Void parseARPW ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 131 #endif132 #if NH_3D_IC133 131 Void parseICFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 134 #endif135 #if NH_3D_DMM || NH_3D_SDC_INTRA || NH_3D_SDC_INTER136 132 Void parseDeltaDC ( TComDataCU* /*pcCU*/, UInt /*absPartIdx*/, UInt /*depth*/ ) { assert(0); }; 137 #endif138 #if NH_3D_SDC_INTRA || NH_3D_SDC_INTER139 133 Void parseSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 140 #endif141 #if NH_3D_DBBP142 134 Void parseDBBPFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 143 135 #endif -
trunk/source/Lib/TLibDecoder/TDecCu.cpp
r1405 r1413 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 * … … 52 52 m_ppcYuvReco = NULL; 53 53 m_ppcCU = NULL; 54 #if NH_3D _DBBP54 #if NH_3D 55 55 m_ppcYuvRecoDBBP = NULL; 56 56 #endif … … 61 61 } 62 62 63 #if MCTS_ENC_CHECK 64 Void TDecCu::init( TDecEntropy* pcEntropyDecoder, TComTrQuant* pcTrQuant, TComPrediction* pcPrediction, TDecConformanceCheck* pConformanceCheck) 65 #else 63 66 Void TDecCu::init( TDecEntropy* pcEntropyDecoder, TComTrQuant* pcTrQuant, TComPrediction* pcPrediction) 67 #endif 64 68 { 65 69 m_pcEntropyDecoder = pcEntropyDecoder; 66 70 m_pcTrQuant = pcTrQuant; 67 71 m_pcPrediction = pcPrediction; 72 #if MCTS_ENC_CHECK 73 m_pConformanceCheck = pConformanceCheck; 74 #endif 68 75 } 69 76 … … 81 88 m_ppcYuvReco = new TComYuv*[m_uiMaxDepth-1]; 82 89 m_ppcCU = new TComDataCU*[m_uiMaxDepth-1]; 83 #if NH_3D _DBBP90 #if NH_3D 84 91 m_ppcYuvRecoDBBP = new TComYuv*[m_uiMaxDepth-1]; 85 92 #endif … … 102 109 m_ppcYuvReco[ui] = new TComYuv; m_ppcYuvReco[ui]->create( uiWidth, uiHeight, chromaFormatIDC ); 103 110 m_ppcCU [ui] = new TComDataCU; m_ppcCU [ui]->create( chromaFormatIDC, uiNumPartitions, uiWidth, uiHeight, true, uiMaxWidth >> (m_uiMaxDepth - 1) ); 104 #if NH_3D _DBBP111 #if NH_3D 105 112 m_ppcYuvRecoDBBP[ui] = new TComYuv; m_ppcYuvRecoDBBP[ui]->create( uiWidth, uiHeight, chromaFormatIDC ); 106 113 #endif … … 126 133 m_ppcYuvReco[ui]->destroy(); delete m_ppcYuvReco[ui]; m_ppcYuvReco[ui] = NULL; 127 134 m_ppcCU [ui]->destroy(); delete m_ppcCU [ui]; m_ppcCU [ui] = NULL; 128 #if NH_3D _DBBP135 #if NH_3D 129 136 m_ppcYuvRecoDBBP[ui]->destroy(); delete m_ppcYuvRecoDBBP[ui]; m_ppcYuvRecoDBBP[ui] = NULL; 130 137 #endif … … 134 141 delete [] m_ppcYuvReco; m_ppcYuvReco = NULL; 135 142 delete [] m_ppcCU ; m_ppcCU = NULL; 136 #if NH_3D _DBBP143 #if NH_3D 137 144 delete [] m_ppcYuvRecoDBBP; m_ppcYuvRecoDBBP = NULL; 138 145 #endif … … 170 177 Void TDecCu::decompressCtu( TComDataCU* pCtu ) 171 178 { 172 #if !NH_3D _IV_MERGE179 #if !NH_3D 173 180 xDecompressCU( pCtu, 0, 0 ); 174 181 #endif … … 290 297 pcCU->setQPSubParts( pcCU->getRefQP(uiAbsPartIdx), uiAbsPartIdx, uiDepth ); // set QP to default QP 291 298 } 292 #if NH_3D _NBDV299 #if NH_3D 293 300 DisInfo DvInfo; 294 301 DvInfo.m_acNBDV.setZero(); 295 302 DvInfo.m_aVIdxCan = 0; 296 #if NH_3D_NBDV_REF297 303 DvInfo.m_acDoNBDV.setZero(); 298 #endif 299 300 if(!pcCU->getSlice()->isIntra()) 301 { 302 #if NH_3D_ARP && NH_3D_IV_MERGE && NH_3D_VSP 304 305 if(!pcCU->getSlice()->isIntra()) 306 { 303 307 if( pcCU->getSlice()->getIvResPredFlag() || pcCU->getSlice()->getIvMvPredFlag() || pcCU->getSlice()->getViewSynthesisPredFlag() ) 304 #else305 #if NH_3D_IV_MERGE && NH_3D_VSP306 if( pcCU->getSlice()->getIvMvPredFlag() || pcCU->getSlice()->getViewSynthesisPredFlag() )307 #else308 #if NH_3D_ARP && NH_3D_VSP309 if( pcCU->getSlice()->getIvResPredFlag() || pcCU->getSlice()->getViewSynthesisPredFlag() )310 #else311 #if NH_3D_VSP312 if( pcCU->getSlice()->getViewSynthesisPredFlag() )313 #else314 #if H_3D_ARP315 if( pcCU->getSlice()->getIvResPredFlag( ) )316 #else317 #if H_3D_IV_MERGE318 if( pcCU->getSlice()->getVPS()->getIvMvPredFlag(pcCU->getSlice()->getLayerId()) )319 #else320 #if NH_3D_DBBP321 if( pcCU->getSlice()->getDepthBasedBlkPartFlag() )322 #else323 if (0)324 #endif325 #endif326 #endif327 #endif328 #endif329 #endif330 #endif331 308 { 332 309 m_ppcCU[uiDepth]->copyInterPredInfoFrom(pcCU, uiAbsPartIdx, REF_PIC_LIST_0, true); … … 338 315 m_ppcCU[uiDepth]->setHeight(0, pcCU->getSlice()->getSPS()->getMaxCUHeight() / (1 << uiDepth)); 339 316 m_ppcCU[uiDepth]->setPartSizeSubParts(SIZE_2Nx2N, 0, uiDepth); 340 #if NH_3D_IV_MERGE341 317 if( pcCU->getSlice()->getIsDepth()) 342 318 { … … 345 321 else 346 322 { 347 #endif 348 #if NH_3D_NBDV_REF 349 if( pcCU->getSlice()->getDepthBasedBlkPartFlag() ) //Notes from QC: please check the condition for DoNBDV. Remove this comment once it is done. 350 { 351 m_ppcCU[uiDepth]->getDisMvpCandNBDV(&DvInfo, true); 352 } 353 else 354 #endif 355 { 356 m_ppcCU[uiDepth]->getDisMvpCandNBDV(&DvInfo); 357 } 358 #if NH_3D_IV_MERGE 359 } 360 #endif 323 if( pcCU->getSlice()->getDepthBasedBlkPartFlag() ) //Notes from QC: please check the condition for DoNBDV. Remove this comment once it is done. 324 { 325 m_ppcCU[uiDepth]->getDisMvpCandNBDV(&DvInfo, true); 326 } 327 else 328 { 329 m_ppcCU[uiDepth]->getDisMvpCandNBDV(&DvInfo); 330 } 331 } 361 332 #if ENC_DEC_TRACE && NH_MV_ENC_DEC_TRAC 362 333 if ( g_decTraceDispDer ) … … 373 344 m_ppcCU[uiDepth]->setWidth(0, cWidTemp); 374 345 m_ppcCU[uiDepth]->setHeight(0, cHeightTemp); 375 346 } 376 347 } 377 348 #endif … … 382 353 } 383 354 384 if (pps.getTransquantBypassEnable Flag())355 if (pps.getTransquantBypassEnabledFlag()) 385 356 { 386 357 m_pcEntropyDecoder->decodeCUTransquantBypassFlag( pcCU, uiAbsPartIdx, uiDepth ); … … 403 374 m_ppcCU[uiDepth]->copyInterPredInfoFrom( pcCU, uiAbsPartIdx, REF_PIC_LIST_0 ); 404 375 m_ppcCU[uiDepth]->copyInterPredInfoFrom( pcCU, uiAbsPartIdx, REF_PIC_LIST_1 ); 405 #if NH_3D _IV_MERGE376 #if NH_3D 406 377 m_ppcCU[uiDepth]->copyDVInfoFrom(pcCU, uiAbsPartIdx); 407 TComMvField cMvFieldNeighbours[MRG_MAX_NUM_CANDS_MEM << 1]; // double length for mv of both lists408 UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS_MEM];409 #else410 #if NH_3D_MLC411 378 TComMvField cMvFieldNeighbours[MRG_MAX_NUM_CANDS_MEM << 1]; // double length for mv of both lists 412 379 UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS_MEM]; … … 415 382 UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS]; 416 383 #endif 417 #endif418 384 Int numValidMergeCand = 0; 419 385 for( UInt ui = 0; ui < m_ppcCU[uiDepth]->getSlice()->getMaxNumMergeCand(); ++ui ) … … 423 389 m_pcEntropyDecoder->decodeMergeIndex( pcCU, 0, uiAbsPartIdx, uiDepth ); 424 390 UInt uiMergeIndex = pcCU->getMergeIndex(uiAbsPartIdx); 425 #if NH_3D _ARP391 #if NH_3D 426 392 m_pcEntropyDecoder->decodeARPW( pcCU , uiAbsPartIdx , uiDepth ); 427 #endif428 #if NH_3D_IC429 393 m_pcEntropyDecoder->decodeICFlag( pcCU, uiAbsPartIdx, uiDepth ); 430 #endif 431 432 433 #if NH_3D_VSP 394 434 395 Int vspFlag[MRG_MAX_NUM_CANDS_MEM]; 435 396 memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM); 436 #endif 437 #if NH_3D_SPIVMP 397 438 398 Bool bSPIVMPFlag[MRG_MAX_NUM_CANDS_MEM]; 439 399 memset(bSPIVMPFlag, false, sizeof(Bool)*MRG_MAX_NUM_CANDS_MEM); … … 442 402 pcMvFieldSP = new TComMvField[pcCU->getPic()->getPicSym()->getNumPartitionsInCtu()*2]; 443 403 puhInterDirSP = new UChar[pcCU->getPic()->getPicSym()->getNumPartitionsInCtu()]; 444 #endif445 446 #if NH_3D_MLC447 404 m_ppcCU[uiDepth]->initAvailableFlags(); 448 405 #endif 406 #if MCTS_ENC_CHECK 407 UInt numSpatialMergeCandidates = 0; 408 m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, numSpatialMergeCandidates, uiMergeIndex ); 409 #if MCTS_ENC_CHECK 410 if ( m_pConformanceCheck->getTMctsCheck() && m_ppcCU[uiDepth]->isLastColumnCTUInTile() && (uiMergeIndex >= numSpatialMergeCandidates) ) 411 { 412 m_pConformanceCheck->flagTMctsError("Merge Index using non-spatial merge candidate (Skip)"); 413 } 414 #endif 415 #else 449 416 m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex ); 450 #if NH_3D_MLC 451 m_ppcCU[uiDepth]->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours 452 #if NH_3D_SPIVMP 453 , pcMvFieldSP, puhInterDirSP 454 #endif 455 , numValidMergeCand, uiMergeIndex ); 456 457 m_ppcCU[uiDepth]->buildMCL( cMvFieldNeighbours, uhInterDirNeighbours 458 #if NH_3D_VSP 459 , vspFlag 460 #endif 461 #if NH_3D_SPIVMP 462 , bSPIVMPFlag 463 #endif 464 , numValidMergeCand ); 465 #endif 466 #if NH_3D_VSP 417 #endif 418 #if NH_3D 419 m_ppcCU[uiDepth]->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, pcMvFieldSP, puhInterDirSP, numValidMergeCand, uiMergeIndex ); 420 m_ppcCU[uiDepth]->buildMCL( cMvFieldNeighbours, uhInterDirNeighbours, vspFlag, bSPIVMPFlag, numValidMergeCand ); 467 421 pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiAbsPartIdx, 0, uiDepth ); 468 422 #endif … … 479 433 pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvd( cTmpMv, SIZE_2Nx2N, uiAbsPartIdx, uiDepth ); 480 434 pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvField( cMvFieldNeighbours[ 2*uiMergeIndex + uiRefListIdx ], SIZE_2Nx2N, uiAbsPartIdx, uiDepth ); 481 #if NH_3D _VSP435 #if NH_3D 482 436 if( pcCU->getVSPFlag( uiAbsPartIdx ) != 0 ) 483 437 { … … 512 466 } 513 467 } 514 #if NH_3D _SPIVMP468 #if NH_3D 515 469 pcCU->setSPIVMPFlagSubParts(bSPIVMPFlag[uiMergeIndex], uiAbsPartIdx, 0, uiDepth ); 516 470 if (bSPIVMPFlag[uiMergeIndex]) … … 570 524 571 525 xFinishDecodeCU( pcCU, uiAbsPartIdx, uiDepth, isLastCtuOfSliceSegment ); 572 #if NH_3D _IV_MERGE526 #if NH_3D 573 527 xDecompressCU(pcCU, uiAbsPartIdx, uiDepth ); 574 528 #endif … … 576 530 return; 577 531 } 578 #if NH_3D _DIS532 #if NH_3D 579 533 m_pcEntropyDecoder->decodeDIS( pcCU, uiAbsPartIdx, uiDepth ); 580 534 if(!pcCU->getDISFlag(uiAbsPartIdx)) … … 582 536 #endif 583 537 584 m_pcEntropyDecoder->decodePredMode( pcCU, uiAbsPartIdx, uiDepth );585 m_pcEntropyDecoder->decodePartSize( pcCU, uiAbsPartIdx, uiDepth );586 587 if (pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N )588 {589 m_pcEntropyDecoder->decodeIPCMInfo( pcCU, uiAbsPartIdx, uiDepth );590 591 if(pcCU->getIPCMFlag(uiAbsPartIdx))592 {593 #if NH_3D _SDC_INTRA594 m_pcEntropyDecoder->decodeSDCFlag( pcCU, uiAbsPartIdx, uiDepth );595 #endif 596 xFinishDecodeCU( pcCU, uiAbsPartIdx, uiDepth, isLastCtuOfSliceSegment );597 #if NH_3D _IV_MERGE598 xDecompressCU(pcCU, uiAbsPartIdx, uiDepth );599 #endif 600 return;601 }602 }603 604 // prediction mode ( Intra : direction mode, Inter : Mv, reference idx )605 m_pcEntropyDecoder->decodePredInfo( pcCU, uiAbsPartIdx, uiDepth, m_ppcCU[uiDepth]);606 607 // Coefficient decoding608 Bool bCodeDQP = getdQPFlag();609 Bool isChromaQpAdjCoded = getIsChromaQpAdjCoded();610 m_pcEntropyDecoder->decodeCoeff( pcCU, uiAbsPartIdx, uiDepth, bCodeDQP, isChromaQpAdjCoded );611 setIsChromaQpAdjCoded( isChromaQpAdjCoded );612 setdQPFlag( bCodeDQP );613 #if NH_3D _DIS538 m_pcEntropyDecoder->decodePredMode( pcCU, uiAbsPartIdx, uiDepth ); 539 m_pcEntropyDecoder->decodePartSize( pcCU, uiAbsPartIdx, uiDepth ); 540 541 if (pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N ) 542 { 543 m_pcEntropyDecoder->decodeIPCMInfo( pcCU, uiAbsPartIdx, uiDepth ); 544 545 if(pcCU->getIPCMFlag(uiAbsPartIdx)) 546 { 547 #if NH_3D 548 m_pcEntropyDecoder->decodeSDCFlag( pcCU, uiAbsPartIdx, uiDepth ); 549 #endif 550 xFinishDecodeCU( pcCU, uiAbsPartIdx, uiDepth, isLastCtuOfSliceSegment ); 551 #if NH_3D 552 xDecompressCU(pcCU, uiAbsPartIdx, uiDepth ); 553 #endif 554 return; 555 } 556 } 557 558 // prediction mode ( Intra : direction mode, Inter : Mv, reference idx ) 559 m_pcEntropyDecoder->decodePredInfo( pcCU, uiAbsPartIdx, uiDepth, m_ppcCU[uiDepth]); 560 561 // Coefficient decoding 562 Bool bCodeDQP = getdQPFlag(); 563 Bool isChromaQpAdjCoded = getIsChromaQpAdjCoded(); 564 m_pcEntropyDecoder->decodeCoeff( pcCU, uiAbsPartIdx, uiDepth, bCodeDQP, isChromaQpAdjCoded ); 565 setIsChromaQpAdjCoded( isChromaQpAdjCoded ); 566 setdQPFlag( bCodeDQP ); 567 #if NH_3D 614 568 } 615 569 #endif 616 570 xFinishDecodeCU( pcCU, uiAbsPartIdx, uiDepth, isLastCtuOfSliceSegment ); 617 #if NH_3D _IV_MERGE571 #if NH_3D 618 572 xDecompressCU(pcCU, uiAbsPartIdx, uiDepth ); 619 573 #endif … … 638 592 { 639 593 TComPic* pcPic = pCtu->getPic(); 640 #if !NH_3D _IV_MERGE594 #if !NH_3D 641 595 TComSlice * pcSlice = pCtu->getSlice(); 642 596 const TComSPS &sps=*(pcSlice->getSPS()); … … 681 635 { 682 636 case MODE_INTER: 683 #if NH_3D _DBBP637 #if NH_3D 684 638 if( m_ppcCU[uiDepth]->getDBBPFlag(0) ) 685 639 { … … 688 642 else 689 643 { 690 #endif691 #if NH_3D_SDC_INTER692 644 if( m_ppcCU[uiDepth]->getSDCFlag( 0 ) ) 693 645 { … … 698 650 #endif 699 651 xReconInter( m_ppcCU[uiDepth], uiDepth ); 700 #if NH_3D_SDC_INTER 701 } 702 #endif 703 #if NH_3D_DBBP 652 #if NH_3D 653 } 704 654 } 705 655 #endif … … 707 657 case MODE_INTRA: 708 658 #if NH_3D 709 #if NH_3D_DIS710 659 if( m_ppcCU[uiDepth]->getDISFlag(0) ) 711 660 { 712 661 xReconDIS( m_ppcCU[uiDepth], 0, uiDepth ); 713 662 } 714 #else715 if(false )716 {717 // xReconDIS( m_ppcCU[uiDepth], 0, uiDepth );718 }719 #endif720 #if NH_3D_SDC_INTRA721 663 else if( m_ppcCU[uiDepth]->getSDCFlag(0) ) 722 664 { 723 665 xReconIntraSDC( m_ppcCU[uiDepth], 0, uiDepth ); 724 666 } 725 #endif726 667 else 727 668 #endif … … 756 697 757 698 // inter prediction 699 #if MCTS_ENC_CHECK 700 if (m_pConformanceCheck->getTMctsCheck() && !m_pcPrediction->checkTMctsMvp(pcCU)) 701 { 702 m_pConformanceCheck->flagTMctsError("motion vector across tile boundaries"); 703 } 704 #endif 758 705 m_pcPrediction->motionCompensation( pcCU, m_ppcYuvReco[uiDepth] ); 759 706 … … 794 741 } 795 742 796 #if NH_3D _DIS743 #if NH_3D 797 744 Void TDecCu::xReconDIS( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 798 745 { … … 869 816 } 870 817 } 871 #endif 872 #if NH_3D_SDC_INTER 818 873 819 Void TDecCu::xReconInterSDC( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 874 820 { … … 913 859 } 914 860 } 915 #endif 916 917 #if NH_3D_DBBP 861 918 862 Void TDecCu::xReconInterDBBP( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 919 863 { … … 926 870 // get collocated depth block 927 871 UInt uiDepthStride = 0; 928 #if H_3D_FCO929 Pel* pDepthPels = pcCU->getVirtualDepthBlock(pcCU->getZorderIdxInCU(), pcCU->getWidth(0), pcCU->getHeight(0), uiDepthStride);930 #else931 872 Pel* pDepthPels = pcCU->getVirtualDepthBlock(0, pcCU->getWidth(0), pcCU->getHeight(0), uiDepthStride); 932 #endif933 873 AOF( pDepthPels != NULL ); 934 874 AOF( uiDepthStride != 0 ); … … 956 896 pcCU->getMvField(pcCU, uiPartAddr, eRefList, pDBBPTmpData->acMvField[uiSegment][eRefList]); 957 897 } 958 959 #if NH_3D 898 960 899 AOF( pcCU->getARPW(uiPartAddr) == 0 ); 961 900 AOF( pcCU->getICFlag(uiPartAddr) == false ); 962 901 AOF( pcCU->getSPIVMPFlag(uiPartAddr) == false ); 963 902 AOF( pcCU->getVSPFlag(uiPartAddr) == 0 ); 964 #endif965 903 } 966 904 … … 1081 1019 1082 1020 //===== get prediction signal ===== 1083 #if NH_3D _DMM1021 #if NH_3D 1084 1022 if( bIsLuma && isDmmMode( uiChFinalMode ) ) 1085 1023 { … … 1090 1028 #endif 1091 1029 m_pcPrediction->predIntraAng( compID, uiChFinalMode, 0 /* Decoder does not have an original image */, 0, piPred, uiStride, rTu, bUseFilteredPredictions ); 1092 #if NH_3D _DMM1030 #if NH_3D 1093 1031 } 1094 1032 #endif … … 1255 1193 } 1256 1194 1257 #if NH_3D _SDC_INTRA1195 #if NH_3D 1258 1196 Void TDecCu::xReconIntraSDC( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 1259 1197 { … … 1284 1222 UInt uiMaskStride = 0; 1285 1223 1286 #if NH_3D_DMM1287 1224 if( isDmmMode( uiLumaPredMode ) ) 1288 1225 { … … 1330 1267 else // regular HEVC intra modes 1331 1268 { 1332 #endif 1269 1333 1270 uiNumSegments = 1; 1334 1271 … … 1389 1326 1390 1327 m_pcPrediction->predConstantSDC( piPred, uiStride, uiWidth, apDCPredValues[0] ); apDCPredValues[1] = 0; 1391 #if NH_3D_DMM 1392 } 1393 #endif 1394 1328 } 1329 1395 1330 // reconstruct residual based on mask + DC residuals 1396 1331 Pel apDCResiValues[2]; 1397 1332 for( UInt uiSegment = 0; uiSegment < uiNumSegments; uiSegment++ ) 1398 1333 { 1399 #if NH_3D_DLT1400 1334 Pel pPredIdx = pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), apDCPredValues[uiSegment] ); 1401 1335 Pel pResiIdx = pcCU->getSDCSegmentDCOffset(uiSegment, uiAbsPartIdx); … … 1403 1337 1404 1338 apDCResiValues[uiSegment] = pRecoValue - apDCPredValues[uiSegment]; 1405 #else1406 apDCResiValues[uiSegment] = pcCU->getSDCSegmentDCOffset(uiSegment, uiAbsPartIdx);1407 #endif1408 1339 } 1409 1340 … … 1450 1381 pRecCr += uiStrideC; 1451 1382 } 1452 #if NH_3D_DMM1453 1383 if( pbMask ) { delete[] pbMask; } 1454 #endif1455 1384 } 1456 1385 #endif -
trunk/source/Lib/TLibDecoder/TDecCu.h
r1405 r1413 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 * … … 45 45 #include "TLibCommon/TComTrQuant.h" 46 46 #include "TDecEntropy.h" 47 #include "TDecConformance.h" 47 48 48 49 //! \ingroup TLibDecoder … … 62 63 TComDataCU** m_ppcCU; ///< CU data array 63 64 64 #if NH_3D _DBBP65 #if NH_3D 65 66 TComYuv** m_ppcYuvRecoDBBP; 66 67 #endif … … 70 71 TComPrediction* m_pcPrediction; 71 72 TDecEntropy* m_pcEntropyDecoder; 73 #if MCTS_ENC_CHECK 74 TDecConformanceCheck* m_pConformanceCheck; 75 #endif 72 76 73 77 Bool m_bDecodeDQP; … … 79 83 80 84 /// initialize access channels 85 #if MCTS_ENC_CHECK 86 Void init (TDecEntropy* pcEntropyDecoder, TComTrQuant* pcTrQuant, TComPrediction* pcPrediction, TDecConformanceCheck* pConformanceCheck); 87 #else 81 88 Void init ( TDecEntropy* pcEntropyDecoder, TComTrQuant* pcTrQuant, TComPrediction* pcPrediction ); 89 #endif 82 90 83 91 /// create internal buffers … … 102 110 Void xReconInter ( TComDataCU* pcCU, UInt uiDepth ); 103 111 104 #if NH_3D _DBBP112 #if NH_3D 105 113 Void xReconInterDBBP ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 106 114 #endif … … 124 132 Void xFillPCMBuffer (TComDataCU* pCU, UInt depth); 125 133 126 #if NH_3D _DIS134 #if NH_3D 127 135 Void xReconDIS ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 128 #endif129 #if NH_3D_SDC_INTRA130 136 Void xReconIntraSDC ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 131 #endif132 #if NH_3D_SDC_INTER133 137 Void xReconInterSDC ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 134 138 #endif -
trunk/source/Lib/TLibDecoder/TDecEntropy.cpp
r1405 r1413 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 * … … 60 60 m_pcEntropyDecoderIf->parseSkipFlag( pcCU, uiAbsPartIdx, uiDepth ); 61 61 } 62 #if NH_3D _DIS62 #if NH_3D 63 63 Void TDecEntropy::decodeDIS( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 64 64 { … … 104 104 } 105 105 106 #if NH_3D _ARP106 #if NH_3D 107 107 Void TDecEntropy::decodeARPW( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 108 108 { … … 121 121 } 122 122 } 123 #endif 124 125 #if NH_3D_IC 123 126 124 Void TDecEntropy::decodeICFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 127 125 { 128 126 pcCU->setICFlagSubParts( false , uiAbsPartIdx, 0, uiDepth ); 129 127 130 #if NH_3D_ARP131 128 if ( pcCU->isIntra( uiAbsPartIdx ) || ( pcCU->getSlice()->getViewIndex() == 0 ) || pcCU->getSlice()->getIsDepth() || pcCU->getARPW( uiAbsPartIdx ) > 0 ) 132 #else133 if ( pcCU->isIntra( uiAbsPartIdx ) || ( pcCU->getSlice()->getViewIndex() == 0 ) || pcCU->getSlice()->getIsDepth() )134 #endif135 129 { 136 130 return; … … 165 159 { 166 160 decodeIntraDirModeLuma ( pcCU, uiAbsPartIdx, uiDepth ); 167 #if NH_3D _SDC_INTRA161 #if NH_3D 168 162 decodeSDCFlag ( pcCU, uiAbsPartIdx, uiDepth ); 169 163 #endif … … 239 233 UInt uiPUOffset = ( g_auiPUOffset[UInt( ePartSize )] << ( ( pcCU->getSlice()->getSPS()->getMaxTotalCUDepth() - uiDepth ) << 1 ) ) >> 4; 240 234 241 #if NH_3D_MLC 242 //#if H_3D_IV_MERGE 235 #if NH_3D 243 236 TComMvField cMvFieldNeighbours[MRG_MAX_NUM_CANDS_MEM << 1]; // double length for mv of both lists 244 237 UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS_MEM]; … … 247 240 UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS]; 248 241 #endif 249 #if NH_3D _SPIVMP242 #if NH_3D 250 243 Bool bSPIVMPFlag[MRG_MAX_NUM_CANDS_MEM]; 251 244 TComMvField* pcMvFieldSP = new TComMvField[pcCU->getPic()->getPicSym()->getNumPartitionsInCtu()*2]; 252 245 UChar* puhInterDirSP = new UChar[pcCU->getPic()->getPicSym()->getNumPartitionsInCtu()]; 253 #endif254 #if NH_3D_IV_MERGE255 246 pcSubCU->copyDVInfoFrom( pcCU, uiAbsPartIdx); 256 247 #endif … … 262 253 Bool hasMergedCandList = false; 263 254 255 #if MCTS_ENC_CHECK 256 UInt numSpatialMergeCandidates = 0; 257 #endif 264 258 pcSubCU->copyInterPredInfoFrom( pcCU, uiAbsPartIdx, REF_PIC_LIST_0 ); 265 259 pcSubCU->copyInterPredInfoFrom( pcCU, uiAbsPartIdx, REF_PIC_LIST_1 ); … … 296 290 297 291 ////// Parse CUs extension syntax 298 #if NH_3D_DBBP299 292 decodeDBBPFlag( pcCU, uiAbsPartIdx, uiDepth ); 300 #endif301 #if NH_3D_SDC_INTER302 293 decodeSDCFlag ( pcCU, uiAbsPartIdx, uiDepth ); 303 #endif 304 #if NH_3D_ARP 305 decodeARPW ( pcCU, uiAbsPartIdx, uiDepth ); 306 #endif 307 #if NH_3D_IC 308 decodeICFlag( pcCU, uiAbsPartIdx, uiDepth ); 309 #endif 294 decodeARPW ( pcCU, uiAbsPartIdx, uiDepth ); 295 decodeICFlag ( pcCU, uiAbsPartIdx, uiDepth ); 310 296 311 297 ////// Decode motion vectors … … 323 309 #endif 324 310 325 #if NH_3D_DBBP326 311 if ( pcCU->getSlice()->getPPS()->getLog2ParallelMergeLevelMinus2() && ePartSize != SIZE_2Nx2N && pcSubCU->getWidth( 0 ) <= 8 && pcCU->getDBBPFlag(uiAbsPartIdx) == false ) 327 #else328 if ( pcCU->getSlice()->getPPS()->getLog2ParallelMergeLevelMinus2() && ePartSize != SIZE_2Nx2N && pcSubCU->getWidth( 0 ) <= 8 )329 #endif330 312 { 331 313 if ( !hasMergedCandList ) 332 314 { 333 315 pcSubCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uiDepth ); // temporarily set. 334 335 #if NH_3D_MLC336 #if NH_3D_VSP337 316 Int vspFlag[MRG_MAX_NUM_CANDS_MEM]; 338 317 memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM); 339 #endif340 #if NH_3D_SPIVMP341 318 memset(bSPIVMPFlag, false, sizeof(Bool)*MRG_MAX_NUM_CANDS_MEM); 342 #endif343 319 pcSubCU->initAvailableFlags(); 344 #endif 320 #if MCTS_ENC_CHECK 321 numSpatialMergeCandidates = 0; 322 pcSubCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, numSpatialMergeCandidates ); 323 #else 345 324 pcSubCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand ); 346 #if NH_3D_MLC 347 pcSubCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours 348 #if NH_3D_SPIVMP 349 , pcMvFieldSP, puhInterDirSP 350 #endif 351 , numValidMergeCand ); 352 pcSubCU->buildMCL( cMvFieldNeighbours, uhInterDirNeighbours 353 #if NH_3D_VSP 354 , vspFlag 355 #endif 356 #if NH_3D_SPIVMP 357 , bSPIVMPFlag 358 #endif 359 , numValidMergeCand ); 360 #if NH_3D_VSP 325 #endif 326 327 pcSubCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, pcMvFieldSP, puhInterDirSP, numValidMergeCand ); 328 pcSubCU->buildMCL( cMvFieldNeighbours, uhInterDirNeighbours, vspFlag, bSPIVMPFlag, numValidMergeCand ); 361 329 pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth ); 362 #endif363 #endif364 330 pcSubCU->setPartSizeSubParts( ePartSize, 0, uiDepth ); // restore. 365 331 hasMergedCandList = true; … … 368 334 else 369 335 { 370 #if NH_3D_MLC371 #if NH_3D_VSP372 336 Int vspFlag[MRG_MAX_NUM_CANDS_MEM]; 373 337 memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM); 374 #endif375 #if NH_3D_SPIVMP376 338 memset(bSPIVMPFlag, false, sizeof(Bool)*MRG_MAX_NUM_CANDS_MEM); 377 #endif378 339 pcSubCU->initAvailableFlags(); 379 #endif 340 #if MCTS_ENC_CHECK 341 numSpatialMergeCandidates = 0; 342 pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, numSpatialMergeCandidates, uiMergeIndex ); 343 #else 380 344 pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex ); 381 #if NH_3D_MLC 382 pcSubCU->xGetInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours 383 #if NH_3D_SPIVMP 384 , pcMvFieldSP, puhInterDirSP 385 #endif 386 ,numValidMergeCand, uiMergeIndex ); 387 pcSubCU->buildMCL( cMvFieldNeighbours, uhInterDirNeighbours 388 #if NH_3D_VSP 389 , vspFlag 390 #endif 391 #if NH_3D_SPIVMP 392 , bSPIVMPFlag 393 #endif 394 ,numValidMergeCand ); 395 #if NH_3D_VSP 345 #endif 346 pcSubCU->xGetInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, pcMvFieldSP, puhInterDirSP ,numValidMergeCand, uiMergeIndex ); 347 pcSubCU->buildMCL( cMvFieldNeighbours, uhInterDirNeighbours , vspFlag, bSPIVMPFlag ,numValidMergeCand ); 396 348 pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth ); 397 #endif398 #endif399 349 } 400 350 pcCU->setInterDirSubParts( uhInterDirNeighbours[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth ); … … 409 359 pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvd( cTmpMv, ePartSize, uiSubPartIdx, uiDepth, uiPartIdx ); 410 360 pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvField( cMvFieldNeighbours[ 2*uiMergeIndex + uiRefListIdx ], ePartSize, uiSubPartIdx, uiDepth, uiPartIdx ); 411 #if NH_3D_VSP412 #if NH_3D_DBBP413 361 if( pcCU->getVSPFlag( uiSubPartIdx ) != 0 && !pcCU->getDBBPFlag( uiAbsPartIdx ) ) 414 #else415 if( pcCU->getVSPFlag( uiSubPartIdx ) != 0 )416 #endif417 362 { 418 363 if ( uhInterDirNeighbours[ uiMergeIndex ] & (1<<uiRefListIdx) ) … … 426 371 } 427 372 } 428 #endif 429 } 430 } 431 #if NH_3D_SPIVMP 373 } 374 } 432 375 pcCU->setSPIVMPFlagSubParts(bSPIVMPFlag[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth ); 433 376 if (bSPIVMPFlag[uiMergeIndex] != 0) … … 451 394 } 452 395 } 453 #endif454 396 } 455 397 else … … 481 423 } 482 424 } 425 426 delete[] pcMvFieldSP; 427 delete[] puhInterDirSP; 428 483 429 #else 484 430 for ( UInt uiPartIdx = 0, uiSubPartIdx = uiAbsPartIdx; uiPartIdx < uiNumPU; uiPartIdx++, uiSubPartIdx += uiPUOffset ) … … 501 447 } 502 448 #endif 503 #if NH_3D_IC504 decodeICFlag( pcCU, uiAbsPartIdx, uiDepth );505 #endif506 507 449 const UInt uiMergeIndex = pcCU->getMergeIndex(uiSubPartIdx); 508 450 if ( pcCU->getSlice()->getPPS()->getLog2ParallelMergeLevelMinus2() && ePartSize != SIZE_2Nx2N && pcSubCU->getWidth( 0 ) <= 8 ) … … 512 454 pcSubCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uiDepth ); // temporarily set. 513 455 514 #if NH_3D_MLC 515 #if NH_3D_VSP 516 Int vspFlag[MRG_MAX_NUM_CANDS_MEM]; 517 memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM); 518 #endif 519 #if NH_3D_SPIVMP 520 memset(bSPIVMPFlag, false, sizeof(Bool)*MRG_MAX_NUM_CANDS_MEM); 521 #endif 522 pcSubCU->initAvailableFlags(); 523 #endif 456 #if MCTS_ENC_CHECK 457 numSpatialMergeCandidates = 0; 458 pcSubCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, numSpatialMergeCandidates ); 459 #else 524 460 pcSubCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand ); 525 #if NH_3D_MLC526 pcSubCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours527 #if NH_3D_SPIVMP528 , pcMvFieldSP, puhInterDirSP529 #endif530 , numValidMergeCand );531 pcSubCU->buildMCL( cMvFieldNeighbours, uhInterDirNeighbours532 #if NH_3D_VSP533 , vspFlag534 #endif535 #if NH_3D_SPIVMP536 , bSPIVMPFlag537 #endif538 , numValidMergeCand );539 #if NH_3D_VSP540 pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth );541 #endif542 461 #endif 543 462 pcSubCU->setPartSizeSubParts( ePartSize, 0, uiDepth ); // restore. … … 547 466 else 548 467 { 549 550 #if NH_3D_MLC 551 #if NH_3D_VSP 552 Int vspFlag[MRG_MAX_NUM_CANDS_MEM]; 553 memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM); 554 #endif 555 #if NH_3D_SPIVMP 556 memset(bSPIVMPFlag, false, sizeof(Bool)*MRG_MAX_NUM_CANDS_MEM); 557 #endif 558 pcSubCU->initAvailableFlags(); 559 #endif 468 #if MCTS_ENC_CHECK 469 numSpatialMergeCandidates = 0; 470 pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, numSpatialMergeCandidates, uiMergeIndex ); 471 #else 472 560 473 pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex ); 561 #if NH_3D_MLC 562 pcSubCU->xGetInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours 563 #if NH_3D_SPIVMP 564 , pcMvFieldSP, puhInterDirSP 565 #endif 566 ,numValidMergeCand, uiMergeIndex ); 567 pcSubCU->buildMCL( cMvFieldNeighbours, uhInterDirNeighbours 568 #if NH_3D_VSP 569 , vspFlag 570 #endif 571 #if NH_3D_SPIVMP 572 , bSPIVMPFlag 573 #endif 574 ,numValidMergeCand ); 575 #if NH_3D_VSP 576 pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth ); 577 #endif 578 #endif 579 } 580 474 #endif 475 } 476 #if MCTS_ENC_CHECK 477 if (m_pConformanceCheck->getTMctsCheck() && pcSubCU->isLastColumnCTUInTile() && (uiMergeIndex >= numSpatialMergeCandidates) ) 478 { 479 m_pConformanceCheck->flagTMctsError("Merge Index using non-spatial merge candidate (Merge)"); 480 } 481 482 #endif 581 483 pcCU->setInterDirSubParts( uhInterDirNeighbours[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth ); 582 484 … … 590 492 pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvd( cTmpMv, ePartSize, uiSubPartIdx, uiDepth, uiPartIdx ); 591 493 pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvField( cMvFieldNeighbours[ 2*uiMergeIndex + uiRefListIdx ], ePartSize, uiSubPartIdx, uiDepth, uiPartIdx ); 592 #if NH_3D_VSP 593 if( pcCU->getVSPFlag( uiSubPartIdx ) != 0 ) 594 { 595 if ( uhInterDirNeighbours[ uiMergeIndex ] & (1<<uiRefListIdx) ) 596 { 597 UInt dummy; 598 Int vspSize; 599 Int width, height; 600 pcCU->getPartIndexAndSize( uiPartIdx, dummy, width, height, uiSubPartIdx, pcCU->getTotalNumPart()==256 ); 601 pcCU->setMvFieldPUForVSP( pcCU, uiSubPartIdx, width, height, RefPicList( uiRefListIdx ), cMvFieldNeighbours[ 2*uiMergeIndex + uiRefListIdx ].getRefIdx(), vspSize ); 602 pcCU->setVSPFlag( uiSubPartIdx, vspSize ); 603 } 604 } 605 #endif 606 } 607 } 608 #if NH_3D_SPIVMP 609 pcCU->setSPIVMPFlagSubParts(bSPIVMPFlag[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth ); 610 if (bSPIVMPFlag[uiMergeIndex] != 0) 611 { 612 Int iWidth, iHeight; 613 UInt uiIdx; 614 pcCU->getPartIndexAndSize( uiPartIdx, uiIdx, iWidth, iHeight, uiSubPartIdx, true ); 615 616 UInt uiSPAddr; 617 618 Int iNumSPInOneLine, iNumSP, iSPWidth, iSPHeight; 619 620 pcCU->getSPPara(iWidth, iHeight, iNumSP, iNumSPInOneLine, iSPWidth, iSPHeight); 621 622 for (Int iPartitionIdx = 0; iPartitionIdx < iNumSP; iPartitionIdx++) 623 { 624 pcCU->getSPAbsPartIdx(uiSubPartIdx, iSPWidth, iSPHeight, iPartitionIdx, iNumSPInOneLine, uiSPAddr); 625 pcCU->setInterDirSP(puhInterDirSP[iPartitionIdx], uiSPAddr, iSPWidth, iSPHeight); 626 pcCU->getCUMvField( REF_PIC_LIST_0 )->setMvFieldSP(pcCU, uiSPAddr, pcMvFieldSP[2*iPartitionIdx], iSPWidth, iSPHeight); 627 pcCU->getCUMvField( REF_PIC_LIST_1 )->setMvFieldSP(pcCU, uiSPAddr, pcMvFieldSP[2*iPartitionIdx + 1], iSPWidth, iSPHeight); 628 } 629 } 630 #endif 494 } 495 } 631 496 } 632 497 else … … 652 517 } 653 518 } 654 #if NH_3D_IC655 decodeICFlag( pcCU, uiAbsPartIdx, uiDepth );656 #endif657 519 } 658 520 … … 664 526 } 665 527 } 666 #endif667 #if NH_3D_SPIVMP668 delete[] pcMvFieldSP;669 delete[] puhInterDirSP;670 528 #endif 671 529 return; … … 812 670 } 813 671 pcSubCU->fillMvpCand(uiPartIdx, uiPartAddr, eRefList, iRefIdx, pAMVPInfo); 672 #if MCTS_ENC_CHECK 673 if ((iRefIdx >= 0) && m_pConformanceCheck->getTMctsCheck() && pcSubCU->isLastColumnCTUInTile() && (iMVPIdx == pAMVPInfo->numSpatialMVPCandidates)) 674 { 675 m_pConformanceCheck->flagTMctsError("Merge Index using non-spatial merge candidate (AMVP)"); 676 } 677 #endif 678 814 679 pcSubCU->setMVPNumSubParts(pAMVPInfo->iN, eRefList, uiPartAddr, uiPartIdx, uiDepth); 815 680 pcSubCU->setMVPIdxSubParts( iMVPIdx, eRefList, uiPartAddr, uiPartIdx, uiDepth ); … … 1085 950 Void TDecEntropy::decodeCoeff( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, Bool& bCodeDQP, Bool& isChromaQpAdjCoded ) 1086 951 { 1087 #if NH_3D _SDC_INTRA952 #if NH_3D 1088 953 if( pcCU->getSDCFlag( uiAbsPartIdx ) && pcCU->isIntra( uiAbsPartIdx) ) 1089 954 { … … 1092 957 assert( pcCU->getCbf(uiAbsPartIdx, COMPONENT_Y) == 1 ); 1093 958 } 1094 #endif1095 #if NH_3D_SDC_INTER1096 959 if( pcCU->getSDCFlag( uiAbsPartIdx ) && !pcCU->isIntra( uiAbsPartIdx) ) 1097 960 { … … 1100 963 assert( pcCU->getSlice()->getIsDepth() ); 1101 964 } 1102 #endif1103 #if NH_3D1104 965 if( pcCU->getSlice()->getIsDepth() ) 1105 966 { 1106 #if NH_3D_SDC_INTRA || NH_3D_SDC_INTER1107 967 if( pcCU->getSDCFlag( uiAbsPartIdx ) ) 1108 968 { … … 1110 970 return; 1111 971 } 1112 #endif1113 #if NH_3D_DMM1114 972 if( pcCU->isIntra( uiAbsPartIdx ) ) 1115 973 { … … 1124 982 } 1125 983 } 1126 #endif1127 984 } 1128 985 #endif … … 1162 1019 } 1163 1020 1164 #if NH_3D _SDC_INTRA || NH_3D_SDC_INTER1021 #if NH_3D 1165 1022 Void TDecEntropy::decodeSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 1166 1023 { … … 1186 1043 m_pcEntropyDecoderIf->parseSDCFlag( pcCU, uiAbsPartIdx, uiDepth ); 1187 1044 } 1188 #endif 1189 #if NH_3D_DBBP 1045 1190 1046 Void TDecEntropy::decodeDBBPFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 1191 1047 { -
trunk/source/Lib/TLibDecoder/TDecEntropy.h
r1405 r1413 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 * … … 44 44 #include "TLibCommon/TComSampleAdaptiveOffset.h" 45 45 #include "TLibCommon/TComRectangle.h" 46 #include "TDecConformance.h" 47 46 48 class TDecSbac; 47 49 class TDecCavlc; … … 81 83 public: 82 84 virtual Void parseSkipFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; 83 #if NH_3D _DIS85 #if NH_3D 84 86 virtual Void parseDIS ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; 85 87 #endif … … 88 90 virtual Void parseMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPUIdx ) = 0; 89 91 virtual Void parseMergeIndex ( TComDataCU* pcCU, UInt& ruiMergeIndex ) = 0; 90 #if NH_3D _ARP92 #if NH_3D 91 93 virtual Void parseARPW ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; 92 #endif93 #if NH_3D_IC94 94 virtual Void parseICFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; 95 #endif96 #if NH_3D_DMM || NH_3D_SDC_INTRA || NH_3D_SDC_INTER97 95 virtual Void parseDeltaDC ( TComDataCU* pcCU, UInt absPartIdx, UInt depth ) = 0; 98 #endif99 #if NH_3D_SDC_INTRA || NH_3D_SDC_INTER100 96 virtual Void parseSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; 101 #endif102 #if NH_3D_DBBP103 97 virtual Void parseDBBPFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; 104 98 #endif … … 139 133 TDecEntropyIf* m_pcEntropyDecoderIf; 140 134 TComPrediction* m_pcPrediction; 135 #if MCTS_ENC_CHECK 136 TDecConformanceCheck* m_pConformanceCheck; 137 #endif 141 138 //UInt m_uiBakAbsPartIdx; 142 139 //UInt m_uiBakChromaOffset; … … 144 141 145 142 public: 143 #if MCTS_ENC_CHECK 144 Void init (TComPrediction* p, TDecConformanceCheck* pConformanceCheck) {m_pcPrediction = p; m_pConformanceCheck=pConformanceCheck;} 145 #else 146 146 Void init (TComPrediction* p) {m_pcPrediction = p;} 147 #endif 147 148 Void decodePUWise ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, TComDataCU* pcSubCU ); 148 149 Void decodeInterDirPU ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPartIdx ); … … 177 178 Void decodeSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 178 179 Void decodeSkipFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 179 #if NH_3D _DIS180 #if NH_3D 180 181 Void decodeDIS ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) ; 181 182 #endif … … 186 187 Void decodePartSize ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 187 188 188 #if NH_3D _ARP189 #if NH_3D 189 190 Void decodeARPW ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 190 #endif191 #if NH_3D_IC192 191 Void decodeICFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 193 #endif194 195 #if NH_3D_SDC_INTRA || NH_3D_SDC_INTER196 192 Void decodeSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 197 #endif198 #if NH_3D_DBBP199 193 Void decodeDBBPFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 200 194 #endif -
trunk/source/Lib/TLibDecoder/TDecGop.cpp
r1405 r1413 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 * … … 122 122 } 123 123 124 #if NH_3D _NBDV124 #if NH_3D 125 125 if(pcSlice->getViewIndex() && !pcSlice->getIsDepth()) //Notes from QC: this condition shall be changed once the configuration is completed, e.g. in pcSlice->getSPS()->getMultiviewMvPredMode() || ARP in prev. HTM. Remove this comment once it is done. 126 126 { -
trunk/source/Lib/TLibDecoder/TDecGop.h
r1405 r1413 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 * -
trunk/source/Lib/TLibDecoder/TDecSbac.cpp
r1405 r1413 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 * … … 67 67 , m_cCUSplitFlagSCModel ( 1, 1, NUM_SPLIT_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 68 68 , m_cCUSkipFlagSCModel ( 1, 1, NUM_SKIP_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 69 #if NH_3D _DIS69 #if NH_3D 70 70 , m_cCUDISFlagSCModel ( 1, 1, NUM_DIS_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 71 71 , m_cCUDISTypeSCModel ( 1, 1, NUM_DIS_TYPE_CTX , m_contextModels + m_numContextModels, m_numContextModels) … … 73 73 , m_cCUMergeFlagExtSCModel ( 1, 1, NUM_MERGE_FLAG_EXT_CTX , m_contextModels + m_numContextModels, m_numContextModels) 74 74 , m_cCUMergeIdxExtSCModel ( 1, 1, NUM_MERGE_IDX_EXT_CTX , m_contextModels + m_numContextModels, m_numContextModels) 75 #if NH_3D _ARP75 #if NH_3D 76 76 , m_cCUPUARPWSCModel ( 1, 1, NUM_ARPW_CTX , m_contextModels + m_numContextModels, m_numContextModels) 77 #endif78 #if NH_3D_IC79 77 , m_cCUICFlagSCModel ( 1, 1, NUM_IC_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 80 78 #endif … … 107 105 , m_ChromaQpAdjIdcSCModel ( 1, 1, NUM_CHROMA_QP_ADJ_IDC_CTX , m_contextModels + m_numContextModels, m_numContextModels) 108 106 109 #if NH_3D _DMM107 #if NH_3D 110 108 , m_cNotDmmFlagSCModel ( 1, 1, NUM_NOTDMM_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 111 109 , m_cDmmModeSCModel ( 1, 1, NUM_DMM_MODE_CTX , m_contextModels + m_numContextModels, m_numContextModels) 112 #endif113 #if NH_3D_DMM || NH_3D_SDC_INTRA || NH_3D_SDC_INTER114 110 , m_cDdcDataSCModel ( 1, 1, NUM_DDC_DATA_CTX , m_contextModels + m_numContextModels, m_numContextModels) 115 111 , m_cSDCFlagSCModel ( 1, 1, NUM_SDC_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 116 #endif117 #if NH_3D_SDC_INTRA118 112 , m_cSDCResidualFlagSCModel ( 1, 1, SDC_NUM_RESIDUAL_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 119 113 , m_cSDCResidualSCModel ( 1, 1, SDC_NUM_RESIDUAL_CTX , m_contextModels + m_numContextModels, m_numContextModels) 120 114 , m_cDdcFlagSCModel ( 1, 1, NUM_DDC_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 121 #endif122 #if NH_3D_DBBP123 115 , m_cDBBPFlagSCModel ( 1, 1, DBBP_NUM_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 124 116 #endif … … 159 151 m_cCUSplitFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_SPLIT_FLAG ); 160 152 m_cCUSkipFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_SKIP_FLAG ); 161 #if NH_3D _DIS153 #if NH_3D 162 154 m_cCUDISFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_DIS_FLAG ); 163 155 m_cCUDISTypeSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_DIS_TYPE ); … … 165 157 m_cCUMergeFlagExtSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_MERGE_FLAG_EXT ); 166 158 m_cCUMergeIdxExtSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_MERGE_IDX_EXT ); 167 #if NH_3D _ARP159 #if NH_3D 168 160 m_cCUPUARPWSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_ARPW ); 169 #endif170 #if NH_3D_IC171 161 m_cCUICFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_IC_FLAG ); 172 162 #endif … … 198 188 m_ChromaQpAdjFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_CHROMA_QP_ADJ_FLAG ); 199 189 m_ChromaQpAdjIdcSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_CHROMA_QP_ADJ_IDC ); 200 #if NH_3D _DMM190 #if NH_3D 201 191 m_cNotDmmFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_NOTDMM_FLAG ); 202 192 m_cDmmModeSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_DMM_MODE ); 203 #endif204 #if NH_3D_DMM || NH_3D_SDC_INTRA || NH_3D_SDC_INTER205 193 m_cDdcDataSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_DDC_DATA ); 206 194 m_cSDCFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_SDC_FLAG ); 207 #endif208 #if NH_3D_SDC_INTRA209 195 m_cSDCResidualFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_SDC_RESIDUAL_FLAG ); 210 196 m_cSDCResidualSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_SDC_RESIDUAL ); 211 197 m_cDdcFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_DDC_FLAG ); 212 #endif213 #if NH_3D_DBBP214 198 m_cDBBPFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_DBBP_FLAG ); 215 199 #endif … … 512 496 513 497 } 514 #if NH_3D _DIS498 #if NH_3D 515 499 Void TDecSbac::parseDIS( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 516 500 { … … 642 626 643 627 UInt uiSymbol; 644 #if NH_3D _QTLPC628 #if NH_3D 645 629 Bool bParseSplitFlag = true; 646 630 Bool bLimQtPredFlag = pcCU->getPic()->getSlice(0)->getQtPredFlag(); … … 651 635 Bool rapPic = (pcCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || pcCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP || pcCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA); 652 636 653 #if H_3D_FCO654 if(bDepthMapDetect && !bIntraSliceDetect && !rapPic && bLimQtPredFlag && pcTexture->getReconMark())655 #else656 637 if(bDepthMapDetect && !bIntraSliceDetect && !rapPic && bLimQtPredFlag) 657 #endif658 638 { 659 639 TComDataCU *pcTextureCU = pcTexture->getCtu(pcCU->getCtuRsAddr()); … … 672 652 DTRACE_CABAC_T( "\tSplitFlag\n" ) 673 653 #endif 674 #if NH_3D _QTLPC654 #if NH_3D 675 655 } 676 656 else … … 704 684 assert ( pcCU->getSlice()->getSPS()->getLog2DiffMaxMinCodingBlockSize() == log2DiffMaxMinCodingBlockSize); 705 685 706 #if NH_3D _QTLPC686 #if NH_3D 707 687 Bool bParsePartSize = true; 708 688 … … 717 697 UInt uiTexturePart = uiMode; 718 698 719 #if H_3D_FCO720 if(bDepthMapDetect && !bIntraSliceDetect && !rapPic && bLimQtPredFlag && pcTexture->getReconMark())721 #else722 699 if(bDepthMapDetect && !bIntraSliceDetect && !rapPic && bLimQtPredFlag ) 723 #endif724 700 { 725 701 TComDataCU *pcTextureCU = pcTexture->getCtu(pcCU->getCtuRsAddr()); … … 740 716 if ( pcCU->isIntra( uiAbsPartIdx ) ) 741 717 { 742 #if NH_3D _QTLPC718 #if NH_3D 743 719 if(bParsePartSize) 744 720 { 745 721 #endif 746 uiSymbol = 1;747 if( uiDepth == log2DiffMaxMinCodingBlockSize )748 {749 m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUPartSizeSCModel.get( 0, 0, 0) RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(ctype) );722 uiSymbol = 1; 723 if( uiDepth == log2DiffMaxMinCodingBlockSize ) 724 { 725 m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUPartSizeSCModel.get( 0, 0, 0) RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(ctype) ); 750 726 #if NH_MV_ENC_DEC_TRAC 751 727 DTRACE_CU("part_mode", uiSymbol) 752 728 #endif 753 }754 eMode = uiSymbol ? SIZE_2Nx2N : SIZE_NxN;755 #if NH_3D _QTLPC729 } 730 eMode = uiSymbol ? SIZE_2Nx2N : SIZE_NxN; 731 #if NH_3D 756 732 } 757 733 #endif … … 771 747 else 772 748 { 773 #if NH_3D _QTLPC749 #if NH_3D 774 750 if(bParsePartSize) 775 751 { … … 777 753 { 778 754 #endif 779 UInt uiMaxNumBits = 2; 780 781 if( uiDepth == log2DiffMaxMinCodingBlockSize && !( cuWidth == 8 && cuHeight == 8 ) ) 782 { 783 uiMaxNumBits ++; 784 } 785 786 for ( UInt ui = 0; ui < uiMaxNumBits; ui++ ) 787 { 788 m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUPartSizeSCModel.get( 0, 0, ui) RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(ctype) ); 789 if ( uiSymbol ) 790 { 791 break; 792 } 793 uiMode++; 794 } 795 eMode = (PartSize) uiMode; 796 if ( pcCU->getSlice()->getSPS()->getUseAMP() && uiDepth < log2DiffMaxMinCodingBlockSize ) 797 { 798 if (eMode == SIZE_2NxN) 799 { 800 m_pcTDecBinIf->decodeBin(uiSymbol, m_cCUPartSizeSCModel.get( 0, 0, 3 ) RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(ctype)); 801 if (uiSymbol == 0) 802 { 803 m_pcTDecBinIf->decodeBinEP(uiSymbol RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(ctype) ); 804 eMode = (uiSymbol == 0? SIZE_2NxnU : SIZE_2NxnD); 805 } 806 } 807 else if (eMode == SIZE_Nx2N) 808 { 809 m_pcTDecBinIf->decodeBin(uiSymbol, m_cCUPartSizeSCModel.get( 0, 0, 3 ) RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(ctype) ); 810 if (uiSymbol == 0) 811 { 812 m_pcTDecBinIf->decodeBinEP(uiSymbol RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(ctype) ); 813 eMode = (uiSymbol == 0? SIZE_nLx2N : SIZE_nRx2N); 814 } 815 } 816 } 817 #if NH_3D_QTLPC 818 } 819 else if(uiTexturePart == SIZE_2NxN || uiTexturePart == SIZE_2NxnU || uiTexturePart == SIZE_2NxnD) 820 { 821 UInt uiMaxNumBits = 1; 822 if ( ( pcCU->getSlice()->getSPS()->getUseAMP() && uiDepth < log2DiffMaxMinCodingBlockSize ) && uiDepth < log2DiffMaxMinCodingBlockSize ) 755 UInt uiMaxNumBits = 2; 756 757 if( uiDepth == log2DiffMaxMinCodingBlockSize && !( cuWidth == 8 && cuHeight == 8 ) ) 823 758 { 824 759 uiMaxNumBits ++; 825 760 } 761 826 762 for ( UInt ui = 0; ui < uiMaxNumBits; ui++ ) 827 763 { … … 834 770 } 835 771 eMode = (PartSize) uiMode; 772 if ( pcCU->getSlice()->getSPS()->getUseAMP() && uiDepth < log2DiffMaxMinCodingBlockSize ) 773 { 774 if (eMode == SIZE_2NxN) 775 { 776 m_pcTDecBinIf->decodeBin(uiSymbol, m_cCUPartSizeSCModel.get( 0, 0, 3 ) RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(ctype)); 777 if (uiSymbol == 0) 778 { 779 m_pcTDecBinIf->decodeBinEP(uiSymbol RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(ctype) ); 780 eMode = (uiSymbol == 0? SIZE_2NxnU : SIZE_2NxnD); 781 } 782 } 783 else if (eMode == SIZE_Nx2N) 784 { 785 m_pcTDecBinIf->decodeBin(uiSymbol, m_cCUPartSizeSCModel.get( 0, 0, 3 ) RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(ctype) ); 786 if (uiSymbol == 0) 787 { 788 m_pcTDecBinIf->decodeBinEP(uiSymbol RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(ctype) ); 789 eMode = (uiSymbol == 0? SIZE_nLx2N : SIZE_nRx2N); 790 } 791 } 792 } 793 #if NH_3D 794 } 795 else if(uiTexturePart == SIZE_2NxN || uiTexturePart == SIZE_2NxnU || uiTexturePart == SIZE_2NxnD) 796 { 797 UInt uiMaxNumBits = 1; 798 if ( ( pcCU->getSlice()->getSPS()->getUseAMP() && uiDepth < log2DiffMaxMinCodingBlockSize ) && uiDepth < log2DiffMaxMinCodingBlockSize ) 799 { 800 uiMaxNumBits ++; 801 } 802 for ( UInt ui = 0; ui < uiMaxNumBits; ui++ ) 803 { 804 m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUPartSizeSCModel.get( 0, 0, ui) RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(ctype) ); 805 if ( uiSymbol ) 806 { 807 break; 808 } 809 uiMode++; 810 } 811 eMode = (PartSize) uiMode; 836 812 if(uiMode && ( ( pcCU->getSlice()->getSPS()->getUseAMP() && uiDepth < log2DiffMaxMinCodingBlockSize ) && uiDepth < log2DiffMaxMinCodingBlockSize ) && uiSymbol==1 ) 837 813 { … … 887 863 DTRACE_CU("part_mode", eMode ) 888 864 #endif 889 #if NH_3D _QTLPC865 #if NH_3D 890 866 } 891 867 #endif … … 937 913 for (j=0;j<partNum;j++) 938 914 { 939 #if NH_3D _DMM915 #if NH_3D 940 916 if( pcCU->getSlice()->getIntraSdcWedgeFlag() || pcCU->getSlice()->getIntraContourFlag() ) 941 917 { … … 946 922 { 947 923 #endif 948 m_pcTDecBinIf->decodeBin( symbol, m_cCUIntraPredSCModel.get( 0, 0, 0) RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(ctype) );949 mpmPred[j] = symbol;924 m_pcTDecBinIf->decodeBin( symbol, m_cCUIntraPredSCModel.get( 0, 0, 0) RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(ctype) ); 925 mpmPred[j] = symbol; 950 926 #if NH_MV_ENC_DEC_TRAC 951 927 DTRACE_CU("prev_intra_luma_pred_flag", symbol) 952 928 #endif 953 #if NH_3D _DMM929 #if NH_3D 954 930 } 955 931 #endif … … 957 933 for (j=0;j<partNum;j++) 958 934 { 959 #if NH_3D _DMM935 #if NH_3D 960 936 if( pcCU->getIntraDir( CHANNEL_TYPE_LUMA, absPartIdx+partOffset*j ) < NUM_INTRA_MODE ) 961 937 { 962 938 #endif 963 Int preds[NUM_MOST_PROBABLE_MODES] = {-1, -1, -1}; 964 pcCU->getIntraDirPredictor(absPartIdx+partOffset*j, preds, COMPONENT_Y); 965 if (mpmPred[j]) 966 { 967 m_pcTDecBinIf->decodeBinEP( symbol RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(ctype) ); 968 if (symbol) 939 Int preds[NUM_MOST_PROBABLE_MODES] = {-1, -1, -1}; 940 pcCU->getIntraDirPredictor(absPartIdx+partOffset*j, preds, COMPONENT_Y); 941 if (mpmPred[j]) 969 942 { 970 943 m_pcTDecBinIf->decodeBinEP( symbol RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(ctype) ); 971 symbol++; 972 } 944 if (symbol) 945 { 946 m_pcTDecBinIf->decodeBinEP( symbol RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(ctype) ); 947 symbol++; 948 } 973 949 #if NH_MV_ENC_DEC_TRAC 974 950 DTRACE_CU("mpm_idx", symbol) 975 951 #endif 976 intraPredMode = preds[symbol];977 }978 else979 {980 m_pcTDecBinIf->decodeBinsEP( symbol, 5 RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(ctype) );981 intraPredMode = symbol;952 intraPredMode = preds[symbol]; 953 } 954 else 955 { 956 m_pcTDecBinIf->decodeBinsEP( symbol, 5 RExt__DECODER_DEBUG_BIT_STATISTICS_PASS_OPT_ARG(ctype) ); 957 intraPredMode = symbol; 982 958 #if NH_MV_ENC_DEC_TRAC 983 959 DTRACE_CU("rem_intra_luma_pred_mode", symbol) 984 960 #endif 985 961 986 //postponed sorting of MPMs (only in remaining branch)987 if (preds[0] > preds[1])988 {989 std::swap(preds[0], preds[1]);990 }991 if (preds[0] > preds[2])992 {993 std::swap(preds[0], preds[2]);994 }995 if (preds[1] > preds[2])996 {997 std::swap(preds[1], preds[2]);998 }999 for ( UInt i = 0; i < NUM_MOST_PROBABLE_MODES; i++ )1000 {1001 intraPredMode += ( intraPredMode >= preds[i] );1002 }1003 }1004 pcCU->setIntraDirSubParts(CHANNEL_TYPE_LUMA, (UChar)intraPredMode, absPartIdx+partOffset*j, depth );1005 #if NH_3D _DMM962 //postponed sorting of MPMs (only in remaining branch) 963 if (preds[0] > preds[1]) 964 { 965 std::swap(preds[0], preds[1]); 966 } 967 if (preds[0] > preds[2]) 968 { 969 std::swap(preds[0], preds[2]); 970 } 971 if (preds[1] > preds[2]) 972 { 973 std::swap(preds[1], preds[2]); 974 } 975 for ( UInt i = 0; i < NUM_MOST_PROBABLE_MODES; i++ ) 976 { 977 intraPredMode += ( intraPredMode >= preds[i] ); 978 } 979 } 980 pcCU->setIntraDirSubParts(CHANNEL_TYPE_LUMA, (UChar)intraPredMode, absPartIdx+partOffset*j, depth ); 981 #if NH_3D 1006 982 } 1007 983 #endif … … 1679 1655 else 1680 1656 { 1681 beValid = pcCU->getSlice()->getPPS()->getSign HideFlag();1657 beValid = pcCU->getSlice()->getPPS()->getSignDataHidingEnabledFlag(); 1682 1658 } 1683 1659 … … 2269 2245 } 2270 2246 2271 #if NH_3D _ARP2247 #if NH_3D 2272 2248 Void TDecSbac::parseARPW( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 2273 2249 { … … 2289 2265 pcCU->setARPWSubParts( ( UChar )( uiW ) , uiAbsPartIdx, uiDepth ); 2290 2266 } 2291 #endif 2292 2293 #if NH_3D_IC 2267 2294 2268 /** parse illumination compensation flag 2295 2269 * \param pcCU … … 2317 2291 pcCU->setICFlagSubParts( uiSymbol ? true : false , uiAbsPartIdx, 0, uiDepth ); 2318 2292 } 2319 #endif 2320 2321 #if NH_3D_DMM || NH_3D_SDC_INTRA || NH_3D_SDC_INTER 2293 2322 2294 Void TDecSbac::parseDeltaDC( TComDataCU* pcCU, UInt absPartIdx, UInt depth ) 2323 2295 { 2324 #if NH_3D_SDC_INTRA || NH_3D_SDC_INTER2325 2296 if( !(pcCU->getSDCFlag( absPartIdx )) ) 2326 #endif 2327 #if NH_3D_DMM 2328 if( !(pcCU->isIntra( absPartIdx ) && isDmmMode( pcCU->getIntraDir( CHANNEL_TYPE_LUMA, absPartIdx ) )) ) 2329 #endif 2330 assert( 0 ); 2297 if( !(pcCU->isIntra( absPartIdx ) && isDmmMode( pcCU->getIntraDir( CHANNEL_TYPE_LUMA, absPartIdx ) )) ) 2298 assert( 0 ); 2331 2299 2332 2300 UInt symbol = 1; 2333 #if NH_3D_SDC_INTRA2334 2301 if( pcCU->isIntra( absPartIdx ) && pcCU->getSDCFlag( absPartIdx )) 2335 2302 { … … 2338 2305 assert( pcCU->getTransformIdx(absPartIdx) == 0 ); 2339 2306 assert( pcCU->getCbf(absPartIdx, COMPONENT_Y) == 1 ); 2340 } 2341 #endif 2342 UInt uiNumSegments = 1; 2343 #if NH_3D_DMM 2344 uiNumSegments = isDmmMode( pcCU->getIntraDir( CHANNEL_TYPE_LUMA, absPartIdx ) ) ? 2 : 1; 2345 #endif 2307 } 2308 UInt uiNumSegments = isDmmMode( pcCU->getIntraDir( CHANNEL_TYPE_LUMA, absPartIdx ) ) ? 2 : 1; 2346 2309 2347 2310 for( UInt segment = 0; segment < uiNumSegments; segment++ ) … … 2355 2318 if( pcCU->isIntra( absPartIdx ) ) 2356 2319 { 2357 #if NH_3D_SDC_INTRA2358 2320 if( pcCU->getSDCFlag( absPartIdx ) ) 2359 2321 { … … 2362 2324 else 2363 2325 { 2364 #endif2365 #if NH_3D_DMM2366 2326 pcCU->setDmmDeltaDC( getDmmType( pcCU->getIntraDir( CHANNEL_TYPE_LUMA, absPartIdx ) ), segment, absPartIdx, valDeltaDC ); 2367 #endif 2368 #if NH_3D_SDC_INTRA 2369 } 2370 #endif 2371 } 2372 #if NH_3D_SDC_INTER 2327 } 2328 } 2373 2329 else 2374 2330 { 2375 2331 pcCU->setSDCSegmentDCOffset( valDeltaDC, segment, absPartIdx ); 2376 2332 } 2377 #endif2378 2333 } 2379 2334 } … … 2419 2374 return; 2420 2375 } 2421 #endif 2422 #if NH_3D_DMM 2376 2423 2377 Void TDecSbac::xParseIntraDepthMode( TComDataCU* pcCU, UInt absPartIdx, UInt depth ) 2424 2378 { … … 2488 2442 ruiTabIdx = uiIdx; 2489 2443 } 2490 #endif 2491 #if NH_3D_SDC_INTRA || NH_3D_SDC_INTER 2444 2492 2445 Void TDecSbac::parseSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 2493 2446 { … … 2510 2463 } 2511 2464 2512 #endif2513 2514 #if NH_3D_DBBP2515 2465 Void TDecSbac::parseDBBPFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 2516 2466 { -
trunk/source/Lib/TLibDecoder/TDecSbac.h
r1405 r1413 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 * … … 108 108 Void xReadCoefRemainExGolomb ( UInt &rSymbol, UInt &rParam, const Bool useLimitedPrefixLength, const Int maxLog2TrDynamicRange ); 109 109 #endif 110 #if NH_3D _DMM || NH_3D_SDC_INTRA || NH_3D_SDC_INTER110 #if NH_3D 111 111 Void xReadExGolombLevelDdc( UInt& ruiSymbol ); 112 112 Void xParseDeltaDC ( Pel& rValDeltaDC, UInt uiNumSeg ); 113 #endif114 #if NH_3D_DMM115 113 Void xParseIntraDepthMode ( TComDataCU* pcCU, UInt absPartIdx, UInt depth ); 116 114 Void xParseDmmData ( TComDataCU* pcCU, UInt absPartIdx, UInt depth ); 117 115 Void xParseDmm1WedgeIdx ( UInt& ruiTabIdx, Int iNumBit ); 118 #endif119 #if NH_3D_SDC_INTRA120 116 Void xParseSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPart ); 121 #endif122 #if NH_3D_SDC_INTRA || NH_3D_SDC_INTER123 117 Void parseSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 124 #endif 125 #if NH_3D_DBBP 126 Void parseDBBPFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 118 Void parseDBBPFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 127 119 #endif 128 120 … … 134 126 135 127 Void parseSkipFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 136 #if NH_3D _DIS128 #if NH_3D 137 129 Void parseDIS ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 138 #endif139 #if NH_3D_DMM || NH_3D_SDC_INTRA || NH_3D_SDC_INTER140 130 Void parseDeltaDC ( TComDataCU* pcCU, UInt absPartIdx, UInt depth ); 141 131 #endif … … 144 134 Void parseMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPUIdx ); 145 135 Void parseMergeIndex ( TComDataCU* pcCU, UInt& ruiMergeIndex ); 146 #if NH_3D _ARP136 #if NH_3D 147 137 Void parseARPW ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 148 #endif149 #if NH_3D_IC150 138 Void parseICFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 151 139 #endif … … 183 171 ContextModel3DBuffer m_cCUSplitFlagSCModel; 184 172 ContextModel3DBuffer m_cCUSkipFlagSCModel; 185 #if NH_3D _DIS173 #if NH_3D 186 174 ContextModel3DBuffer m_cCUDISFlagSCModel; 187 175 ContextModel3DBuffer m_cCUDISTypeSCModel; … … 189 177 ContextModel3DBuffer m_cCUMergeFlagExtSCModel; 190 178 ContextModel3DBuffer m_cCUMergeIdxExtSCModel; 191 #if NH_3D _ARP179 #if NH_3D 192 180 ContextModel3DBuffer m_cCUPUARPWSCModel; 193 #endif194 #if NH_3D_IC195 181 ContextModel3DBuffer m_cCUICFlagSCModel; 196 182 #endif … … 226 212 ContextModel3DBuffer m_ChromaQpAdjFlagSCModel; 227 213 ContextModel3DBuffer m_ChromaQpAdjIdcSCModel; 228 #if NH_3D _DMM214 #if NH_3D 229 215 ContextModel3DBuffer m_cNotDmmFlagSCModel; 230 216 ContextModel3DBuffer m_cDmmModeSCModel; 231 #endif232 #if NH_3D_DMM || NH_3D_SDC_INTRA || NH_3D_SDC_INTER233 217 ContextModel3DBuffer m_cDdcDataSCModel; 234 218 ContextModel3DBuffer m_cSDCFlagSCModel; 235 #endif236 #if NH_3D_SDC_INTRA237 219 ContextModel3DBuffer m_cSDCResidualFlagSCModel; 238 220 ContextModel3DBuffer m_cSDCResidualSCModel; 239 221 ContextModel3DBuffer m_cDdcFlagSCModel; 240 #endif241 #if NH_3D_DBBP242 222 ContextModel3DBuffer m_cDBBPFlagSCModel; 243 223 #endif -
trunk/source/Lib/TLibDecoder/TDecSlice.cpp
r1405 r1413 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 * … … 37 37 38 38 #include "TDecSlice.h" 39 #include "TDecConformance.h" 39 40 40 41 //! \ingroup TLibDecoder … … 61 62 } 62 63 63 Void TDecSlice::init(TDecEntropy* pcEntropyDecoder, TDecCu* pcCuDecoder )64 Void TDecSlice::init(TDecEntropy* pcEntropyDecoder, TDecCu* pcCuDecoder, TDecConformanceCheck *pDecConformanceCheck) 64 65 { 65 66 m_pcEntropyDecoder = pcEntropyDecoder; 66 67 m_pcCuDecoder = pcCuDecoder; 68 m_pDecConformanceCheck = pDecConformanceCheck; 67 69 } 68 70 … … 130 132 } 131 133 } 132 #if NH_3D _DLT134 #if NH_3D 133 135 if( pcSlice->getPPS()->getDLT() != NULL ) 134 136 { … … 186 188 #endif 187 189 190 #if DECODER_PARTIAL_CONFORMANCE_CHECK != 0 191 const UInt numRemainingBitsPriorToCtu=ppcSubstreams[uiSubStrm]->getNumBitsLeft(); 192 #endif 193 188 194 if ( pcSlice->getSPS()->getUseSAO() ) 189 195 { … … 224 230 225 231 m_pcCuDecoder->decodeCtu ( pCtu, isLastCtuOfSliceSegment ); 232 233 #if DECODER_PARTIAL_CONFORMANCE_CHECK != 0 234 const UInt numRemainingBitsPostCtu=ppcSubstreams[uiSubStrm]->getNumBitsLeft(); // NOTE: Does not account for changes in buffered bits in CABAC decoder, although it's probably good enough. 235 if (TDecConformanceCheck::doChecking() && m_pDecConformanceCheck) 236 { 237 m_pDecConformanceCheck->checkCtuDecoding(numRemainingBitsPriorToCtu-numRemainingBitsPostCtu); 238 } 239 #endif 240 226 241 m_pcCuDecoder->decompressCtu ( pCtu ); 227 242 -
trunk/source/Lib/TLibDecoder/TDecSlice.h
r1405 r1413 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 * … … 58 58 // ==================================================================================================================== 59 59 60 class TDecConformanceCheck; 61 60 62 /// slice decoder class 61 63 class TDecSlice … … 65 67 TDecEntropy* m_pcEntropyDecoder; 66 68 TDecCu* m_pcCuDecoder; 69 TDecConformanceCheck *m_pDecConformanceCheck; 67 70 68 71 TDecSbac m_lastSliceSegmentEndContextState; ///< context storage for state at the end of the previous slice-segment (used for dependent slices only). … … 73 76 virtual ~TDecSlice(); 74 77 75 Void init ( TDecEntropy* pcEntropyDecoder, TDecCu* pcMbDecoder );78 Void init ( TDecEntropy* pcEntropyDecoder, TDecCu* pcMbDecoder, TDecConformanceCheck *pDecConformanceCheck ); 76 79 Void create (); 77 80 Void destroy (); -
trunk/source/Lib/TLibDecoder/TDecTop.cpp
r1405 r1413 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 * … … 37 37 #include "NALread.h" 38 38 #include "TDecTop.h" 39 #include "TDecConformance.h" 40 39 41 #if NH_MV 40 42 ParameterSetManager TDecTop::m_parameterSetManager; … … 227 229 } 228 230 229 #if !H_3D_FCO230 231 if ( pcSlice->getIsDepth()) 231 232 { 232 233 return; 233 234 } 234 #endif235 235 236 236 Int curPoc = pcSlice->getPOC(); … … 376 376 , m_warningMessageSkipPicture(false) 377 377 #endif 378 #if MCTS_ENC_CHECK 379 , m_tmctsCheckEnabled(false) 380 #endif 378 381 , m_prefixSEINALUs() 379 382 { … … 471 474 #endif 472 475 m_cGopDecoder.init( &m_cEntropyDecoder, &m_cSbacDecoder, &m_cBinCABAC, &m_cCavlcDecoder, &m_cSliceDecoder, &m_cLoopFilter, &m_cSAO); 473 m_cSliceDecoder.init( &m_cEntropyDecoder, &m_cCuDecoder ); 476 m_cSliceDecoder.init( &m_cEntropyDecoder, &m_cCuDecoder, &m_conformanceCheck ); 477 #if MCTS_ENC_CHECK 478 m_cEntropyDecoder.init(&m_cPrediction, &m_conformanceCheck ); 479 #else 474 480 m_cEntropyDecoder.init(&m_cPrediction); 481 #endif 475 482 } 476 483 … … 506 513 rpcPic = new TComPic(); 507 514 515 #if REDUCED_ENCODER_MEMORY 516 rpcPic->create ( sps, pps, false, true); 517 #else 508 518 rpcPic->create ( sps, pps, true); 519 #endif 509 520 510 521 m_cListPic.pushBack( rpcPic ); … … 543 554 } 544 555 rpcPic->destroy(); 556 #if REDUCED_ENCODER_MEMORY 557 rpcPic->create ( sps, pps, false, true); 558 #else 545 559 rpcPic->create ( sps, pps, true); 560 #endif 546 561 } 547 562 … … 692 707 693 708 xParsePrefixSEImessages(); 709 #if MCTS_ENC_CHECK 710 xAnalysePrefixSEImessages(); 711 #endif 694 712 695 713 #if RExt__HIGH_BIT_DEPTH_SUPPORT==0 … … 726 744 sps=pSlice->getSPS(); 727 745 728 #if NH_MV 746 #if NH_MV 729 747 pSlice->setPic( m_pcPic ); 730 748 vps=pSlice->getVPS(); … … 772 790 // Recursive structure 773 791 m_cCuDecoder.create ( sps->getMaxTotalCUDepth(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getChromaFormatIdc() ); 792 #if MCTS_ENC_CHECK 793 m_cCuDecoder.init ( &m_cEntropyDecoder, &m_cTrQuant, &m_cPrediction, &m_conformanceCheck ); 794 #else 774 795 m_cCuDecoder.init ( &m_cEntropyDecoder, &m_cTrQuant, &m_cPrediction ); 796 #endif 775 797 m_cTrQuant.init ( sps->getMaxTrSize() ); 776 798 … … 807 829 xParsePrefixSEImessages(); 808 830 831 #if MCTS_ENC_CHECK 832 xAnalysePrefixSEImessages(); 833 #endif 809 834 // Check if any new SEI has arrived 810 835 if(!m_SEIs.empty()) … … 845 870 } 846 871 } 872 873 #if MCTS_ENC_CHECK 874 Void TDecTop::xAnalysePrefixSEImessages() 875 { 876 if (m_tmctsCheckEnabled) 877 { 878 SEIMessages mctsSEIs = getSeisByType(m_SEIs, SEI::TEMP_MOTION_CONSTRAINED_TILE_SETS); 879 for (SEIMessages::iterator it = mctsSEIs.begin(); it != mctsSEIs.end(); it++) 880 { 881 SEITempMotionConstrainedTileSets *mcts = (SEITempMotionConstrainedTileSets*)(*it); 882 if (!mcts->m_each_tile_one_tile_set_flag) 883 { 884 printf("cannot (yet) check Temporal constrained MCTS if each_tile_one_tile_set_flag is not enabled\n"); 885 exit(1); 886 } 887 else 888 { 889 printf("MCTS check enabled!\n"); 890 m_conformanceCheck.enableTMctsCheck(true); 891 } 892 } 893 } 894 } 895 #endif 896 847 897 848 898 #if !NH_MV … … 1023 1073 xActivateParameterSets(); 1024 1074 1075 1076 1077 TComSlice* pcSlice = m_pcPic->getPicSym()->getSlice(m_uiSliceIdx); 1078 1079 if (TDecConformanceCheck::doChecking()) 1080 { 1081 m_conformanceCheck.checkSliceActivation(*pcSlice, nalu, *m_pcPic, m_bFirstSliceInBitstream, m_bFirstSliceInSequence, m_bFirstSliceInPicture); 1082 } 1083 1025 1084 m_bFirstSliceInSequence = false; 1026 1085 m_bFirstSliceInBitstream = false; 1027 1028 1029 TComSlice* pcSlice = m_pcPic->getPicSym()->getSlice(m_uiSliceIdx);1030 1086 1031 1087 #endif … … 1105 1161 } 1106 1162 } 1107 #if NH_3D _NBDV1163 #if NH_3D 1108 1164 pcSlice->setDefaultRefView(); 1109 #endif1110 #if NH_3D_ARP1111 1165 pcSlice->setPocsInCurrRPSs(); 1112 1166 pcSlice->setARPStepNum(m_dpb); … … 1155 1209 //--------------- 1156 1210 pcSlice->setRefPOCList(); 1157 #if NH_3D _TMVP1211 #if NH_3D 1158 1212 if(pcSlice->getLayerId()) 1159 1213 { … … 1253 1307 pps->setLayerId( getLayerId() ); 1254 1308 #endif 1255 #if NH_3D _DLT1309 #if NH_3D 1256 1310 // create mapping from depth layer indexes to layer ids 1257 1311 Int j=0; … … 1863 1917 { 1864 1918 Int profileIdc = vps->getPTL( vps->getProfileTierLevelIdx( m_targetOlsIdx, lIdx ) )->getGeneralPTL()->getProfileIdc(); 1865 assert( profileIdc == 1 || profileIdc == 6 || profileIdc == 8 ); 1866 1867 if ( profileIdc == 6 ) 1919 1920 #if !NH_MV_ALLOW_NON_CONFORMING 1921 assert( profileIdc == Profile::MAIN || profileIdc == Profile::MULTIVIEWMAIN|| profileIdc == Profile::MAIN3D ); 1922 #else 1923 assert( profileIdc == Profile::MAIN || profileIdc == Profile::MAIN10 || profileIdc == Profile::MULTIVIEWMAIN|| profileIdc == Profile::MAIN3D || profileIdc == Profile::NONE || profileIdc == Profile::MULTIVIEWMAIN_NONCONFORMING || profileIdc == Profile::MAIN3D_NONCONFORMING ); 1924 #endif 1925 1926 if ( profileIdc == Profile::MULTIVIEWMAIN 1927 #if NH_MV_ALLOW_NON_CONFORMING 1928 || profileIdc == Profile::MULTIVIEWMAIN_NONCONFORMING 1929 #endif 1930 ) 1868 1931 { 1869 1932 m_decodingProcess = ANNEX_G; … … 1873 1936 m_decodingProcess = ANNEX_H; 1874 1937 } 1875 else if (profileIdc == 8 ) 1938 else if (profileIdc == Profile::MAIN3D 1939 #if NH_MV_ALLOW_NON_CONFORMING 1940 || profileIdc == Profile::MAIN3D_NONCONFORMING 1941 #endif 1942 ) 1876 1943 { 1877 1944 m_decodingProcess = ANNEX_I; -
trunk/source/Lib/TLibDecoder/TDecTop.h
r1405 r1413 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 * … … 52 52 #include "TDecCAVLC.h" 53 53 #include "SEIread.h" 54 #include "TDecConformance.h" 54 55 55 56 class InputNALUnit; … … 204 205 TComLoopFilter m_cLoopFilter; 205 206 TComSampleAdaptiveOffset m_cSAO; 207 TDecConformanceCheck m_conformanceCheck; 206 208 207 209 Bool isSkipPictureForBLA(Int& iPOCLastDisplay); … … 236 238 #endif 237 239 240 #if MCTS_ENC_CHECK 241 Bool m_tmctsCheckEnabled; 242 243 #endif 244 238 245 #if NH_MV 239 246 // Class interface … … 286 293 287 294 Void setDecodedPictureHashSEIEnabled(Int enabled) { m_cGopDecoder.setDecodedPictureHashSEIEnabled(enabled); } 288 295 #if MCTS_ENC_CHECK 296 Void setTMctsCheckEnabled(Bool enabled) { m_tmctsCheckEnabled = enabled; } 297 #endif 289 298 Void init(); 290 299 #if !NH_MV … … 405 414 406 415 Void xParsePrefixSEImessages(); 416 #if MCTS_ENC_CHECK 417 Void xAnalysePrefixSEImessages(); 418 #endif 407 419 Void xParsePrefixSEIsForUnknownVCLNal(); 408 420
Note: See TracChangeset for help on using the changeset viewer.