Changeset 1235 in SHVCSoftware for branches/SHM-dev/source/Lib/TLibDecoder
- Timestamp:
- 13 Jul 2015, 20:38:11 (10 years ago)
- Location:
- branches/SHM-dev/source/Lib/TLibDecoder
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev/source/Lib/TLibDecoder/SEIread.cpp
r1218 r1235 106 106 */ 107 107 #if LAYERS_NOT_PRESENT_SEI 108 Void SEIReader::parseSEImessage(TComInputBitstream* bs, SEIMessages& seis, const NalUnitType nalUnitType, TComVPS *vps,TComSPS *sps, std::ostream *pDecodedMessageOutputStream)109 #else 110 Void SEIReader::parseSEImessage(TComInputBitstream* bs, SEIMessages& seis, const NalUnitType nalUnitType, TComSPS *sps, std::ostream *pDecodedMessageOutputStream)108 Void SEIReader::parseSEImessage(TComInputBitstream* bs, SEIMessages& seis, const NalUnitType nalUnitType, const TComVPS *vps, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream) 109 #else 110 Void SEIReader::parseSEImessage(TComInputBitstream* bs, SEIMessages& seis, const NalUnitType nalUnitType, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream) 111 111 #endif 112 112 { … … 133 133 #if O0164_MULTI_LAYER_HRD 134 134 #if LAYERS_NOT_PRESENT_SEI 135 Void SEIReader::xReadSEImessage(SEIMessages& seis, const NalUnitType nalUnitType, TComVPS *vps,TComSPS *sps, std::ostream *pDecodedMessageOutputStream, const SEIScalableNesting *nestingSei, const SEIBspNesting *bspNestingSei)136 #else 137 Void SEIReader::xReadSEImessage(SEIMessages& seis, const NalUnitType nalUnitType, TComSPS *sps, std::ostream *pDecodedMessageOutputStream, const SEIScalableNesting *nestingSei)135 Void SEIReader::xReadSEImessage(SEIMessages& seis, const NalUnitType nalUnitType, const TComVPS *vps, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream, const SEIScalableNesting *nestingSei, const SEIBspNesting *bspNestingSei) 136 #else 137 Void SEIReader::xReadSEImessage(SEIMessages& seis, const NalUnitType nalUnitType, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream, const SEIScalableNesting *nestingSei) 138 138 #endif 139 139 #else 140 140 #if LAYERS_NOT_PRESENT_SEI 141 Void SEIReader::xReadSEImessage(SEIMessages& seis, const NalUnitType nalUnitType, TComVPS *vps,TComSPS *sps, std::ostream *pDecodedMessageOutputStream)142 #else 143 Void SEIReader::xReadSEImessage(SEIMessages& seis, const NalUnitType nalUnitType, TComSPS *sps, std::ostream *pDecodedMessageOutputStream)141 Void SEIReader::xReadSEImessage(SEIMessages& seis, const NalUnitType nalUnitType, const TComVPS *vps, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream) 142 #else 143 Void SEIReader::xReadSEImessage(SEIMessages& seis, const NalUnitType nalUnitType, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream) 144 144 #endif 145 145 #endif … … 557 557 558 558 #if SVC_EXTENSION 559 Void SEIReader::xParseSEIDecodingUnitInfo(SEIDecodingUnitInfo& sei, UInt payloadSize, TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, TComVPS *vps,std::ostream *pDecodedMessageOutputStream)560 #else 561 Void SEIReader::xParseSEIDecodingUnitInfo(SEIDecodingUnitInfo& sei, UInt payloadSize, TComSPS *sps, std::ostream *pDecodedMessageOutputStream)559 Void SEIReader::xParseSEIDecodingUnitInfo(SEIDecodingUnitInfo& sei, UInt payloadSize, const TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, const TComVPS *vps, std::ostream *pDecodedMessageOutputStream) 560 #else 561 Void SEIReader::xParseSEIDecodingUnitInfo(SEIDecodingUnitInfo& sei, UInt payloadSize, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream) 562 562 #endif 563 563 { … … 568 568 569 569 #if SVC_EXTENSION 570 TComHRD *hrd;570 const TComHRD *hrd; 571 571 if( bspNestingSei ) // If DU info SEI contained inside a BSP nesting SEI message 572 572 { … … 577 577 Int maxValues = vps->getNumBspSchedulesMinus1(seiOlsIdx, psIdx, maxTemporalId) + 1; 578 578 std::vector<Int> hrdIdx(maxValues, 0); 579 std::vector< TComHRD*> hrdVec;579 std::vector<const TComHRD*> hrdVec; 580 580 std::vector<Int> syntaxElemLen(maxValues, 0); 581 581 for(Int i = 0; i < maxValues; i++) … … 601 601 else 602 602 { 603 TComVUI *vui = sps->getVuiParameters();603 const TComVUI *vui = sps->getVuiParameters(); 604 604 hrd = vui->getHrdParameters(); 605 605 } … … 621 621 } 622 622 #else 623 TComVUI *vui = sps->getVuiParameters();623 const TComVUI *vui = sps->getVuiParameters(); 624 624 625 625 if(vui->getHrdParameters()->getSubPicCpbParamsInPicTimingSEIFlag()) … … 642 642 643 643 #if SVC_EXTENSION 644 Void SEIReader::xParseSEIBufferingPeriod(SEIBufferingPeriod& sei, UInt payloadSize, TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei,TComVPS *vps, std::ostream *pDecodedMessageOutputStream)645 #else 646 Void SEIReader::xParseSEIBufferingPeriod(SEIBufferingPeriod& sei, UInt payloadSize, TComSPS *sps, std::ostream *pDecodedMessageOutputStream)644 Void SEIReader::xParseSEIBufferingPeriod(SEIBufferingPeriod& sei, UInt payloadSize, const TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, const TComVPS *vps, std::ostream *pDecodedMessageOutputStream) 645 #else 646 Void SEIReader::xParseSEIBufferingPeriod(SEIBufferingPeriod& sei, UInt payloadSize, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream) 647 647 #endif 648 648 { … … 651 651 652 652 #if SVC_EXTENSION 653 TComHRD *pHRD;653 const TComHRD *pHRD; 654 654 if( bspNestingSei ) // If BP SEI contained inside a BSP nesting SEI message 655 655 { … … 660 660 Int maxValues = vps->getNumBspSchedulesMinus1(seiOlsIdx, psIdx, maxTemporalId) + 1; 661 661 std::vector<Int> hrdIdx(maxValues, 0); 662 std::vector< TComHRD*> hrdVec;662 std::vector<const TComHRD*> hrdVec; 663 663 std::vector<Int> syntaxElemLen(maxValues, 0); 664 664 for(i = 0; i < maxValues; i++) … … 683 683 else 684 684 { 685 TComVUI *vui = sps->getVuiParameters();685 const TComVUI *vui = sps->getVuiParameters(); 686 686 pHRD = vui->getHrdParameters(); 687 687 } 688 688 // To be done: When contained in an BSP HRD SEI message, the hrd structure is to be chosen differently. 689 689 #else 690 TComVUI *pVUI = sps->getVuiParameters();691 TComHRD *pHRD = pVUI->getHrdParameters();690 const TComVUI *pVUI = sps->getVuiParameters(); 691 const TComHRD *pHRD = pVUI->getHrdParameters(); 692 692 #endif 693 693 … … 746 746 747 747 #if SVC_EXTENSION 748 Void SEIReader::xParseSEIPictureTiming(SEIPictureTiming& sei, UInt payloadSize, TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei,TComVPS *vps, std::ostream *pDecodedMessageOutputStream)749 #else 750 Void SEIReader::xParseSEIPictureTiming(SEIPictureTiming& sei, UInt payloadSize, TComSPS *sps, std::ostream *pDecodedMessageOutputStream)748 Void SEIReader::xParseSEIPictureTiming(SEIPictureTiming& sei, UInt payloadSize, const TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, const TComVPS *vps, std::ostream *pDecodedMessageOutputStream) 749 #else 750 Void SEIReader::xParseSEIPictureTiming(SEIPictureTiming& sei, UInt payloadSize, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream) 751 751 #endif 752 752 { … … 755 755 756 756 #if SVC_EXTENSION 757 TComHRD *hrd;758 TComVUI *vui = sps->getVuiParameters();757 const TComHRD *hrd; 758 const TComVUI *vui = sps->getVuiParameters(); 759 759 if( bspNestingSei ) // If BP SEI contained inside a BSP nesting SEI message 760 760 { … … 765 765 Int maxValues = vps->getNumBspSchedulesMinus1(seiOlsIdx, psIdx, maxTemporalId) + 1; 766 766 std::vector<Int> hrdIdx(maxValues, 0); 767 std::vector< TComHRD*> hrdVec;767 std::vector<const TComHRD*> hrdVec; 768 768 std::vector<Int> syntaxElemLen(maxValues, 0); 769 769 for(i = 0; i < maxValues; i++) … … 796 796 // To be done: When contained in an BSP HRD SEI message, the hrd structure is to be chosen differently. 797 797 #else 798 TComVUI *vui = sps->getVuiParameters();799 TComHRD *hrd = vui->getHrdParameters();798 const TComVUI *vui = sps->getVuiParameters(); 799 const TComHRD *hrd = vui->getHrdParameters(); 800 800 #endif 801 801 output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize); … … 1061 1061 1062 1062 #if LAYERS_NOT_PRESENT_SEI 1063 Void SEIReader::xParseSEIScalableNesting(SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, TComVPS *vps,TComSPS *sps, std::ostream *pDecodedMessageOutputStream)1064 #else 1065 Void SEIReader::xParseSEIScalableNesting(SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, TComSPS *sps, std::ostream *pDecodedMessageOutputStream)1063 Void SEIReader::xParseSEIScalableNesting(SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, const TComVPS *vps, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream) 1064 #else 1065 Void SEIReader::xParseSEIScalableNesting(SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream) 1066 1066 #endif 1067 1067 { … … 1423 1423 #if SVC_EXTENSION 1424 1424 #if LAYERS_NOT_PRESENT_SEI 1425 Void SEIReader::xParseSEILayersNotPresent(SEILayersNotPresent &sei, UInt payloadSize, TComVPS *vps, std::ostream *pDecodedMessageOutputStream)1425 Void SEIReader::xParseSEILayersNotPresent(SEILayersNotPresent &sei, UInt payloadSize, const TComVPS *vps, std::ostream *pDecodedMessageOutputStream) 1426 1426 { 1427 1427 UInt uiCode; … … 1485 1485 1486 1486 #if SUB_BITSTREAM_PROPERTY_SEI 1487 Void SEIReader::xParseSEISubBitstreamProperty(SEISubBitstreamProperty &sei, TComVPS *vps, std::ostream *pDecodedMessageOutputStream)1487 Void SEIReader::xParseSEISubBitstreamProperty(SEISubBitstreamProperty &sei, const TComVPS *vps, std::ostream *pDecodedMessageOutputStream) 1488 1488 { 1489 1489 UInt uiCode; … … 1510 1510 #if O0164_MULTI_LAYER_HRD 1511 1511 #if LAYERS_NOT_PRESENT_SEI 1512 Void SEIReader::xParseSEIBspNesting(SEIBspNesting &sei, const NalUnitType nalUnitType, TComVPS *vps,TComSPS *sps, const SEIScalableNesting &nestingSei, std::ostream *pDecodedMessageOutputStream)1513 #else 1514 Void SEIReader::xParseSEIBspNesting(SEIBspNesting &sei, const NalUnitType nalUnitType, TComSPS *sps, const SEIScalableNesting &nestingSei, std::ostream *pDecodedMessageOutputStream)1512 Void SEIReader::xParseSEIBspNesting(SEIBspNesting &sei, const NalUnitType nalUnitType, const TComVPS *vps, const TComSPS *sps, const SEIScalableNesting &nestingSei, std::ostream *pDecodedMessageOutputStream) 1513 #else 1514 Void SEIReader::xParseSEIBspNesting(SEIBspNesting &sei, const NalUnitType nalUnitType, const TComSPS *sps, const SEIScalableNesting &nestingSei, std::ostream *pDecodedMessageOutputStream) 1515 1515 #endif 1516 1516 { … … 1537 1537 } 1538 1538 1539 Void SEIReader::xParseSEIBspInitialArrivalTime(SEIBspInitialArrivalTime &sei, TComVPS *vps,TComSPS *sps, const SEIScalableNesting &nestingSei, const SEIBspNesting &bspNestingSei, std::ostream *pDecodedMessageOutputStream)1539 Void SEIReader::xParseSEIBspInitialArrivalTime(SEIBspInitialArrivalTime &sei, const TComVPS *vps, const TComSPS *sps, const SEIScalableNesting &nestingSei, const SEIBspNesting &bspNestingSei, std::ostream *pDecodedMessageOutputStream) 1540 1540 { 1541 1541 assert(vps->getVpsVuiPresentFlag()); 1542 1542 1543 #if SVC_EXTENSION1544 1543 UInt uiCode; 1545 1544 Int psIdx = bspNestingSei.m_seiPartitioningSchemeIdx; … … 1548 1547 Int maxValues = vps->getNumBspSchedulesMinus1(seiOlsIdx, psIdx, maxTemporalId) + 1; 1549 1548 std::vector<Int> hrdIdx(0, maxValues); 1550 std::vector< TComHRD*> hrdVec;1549 std::vector<const TComHRD*> hrdVec; 1551 1550 std::vector<Int> syntaxElemLen; 1552 1551 for(Int i = 0; i < maxValues; i++) … … 1580 1579 } 1581 1580 } 1582 #else1583 UInt schedCombCnt = vps->getNumBspSchedCombinations(nestingSei.m_nestingOpIdx[0]);1584 UInt len;1585 UInt hrdIdx;1586 UInt uiCode;1587 1588 if (schedCombCnt > 0)1589 {1590 hrdIdx = vps->getBspCombHrdIdx(nestingSei.m_nestingOpIdx[0], 0, bspNestingSei.m_bspIdx);1591 }1592 else1593 {1594 hrdIdx = 0;1595 }1596 1597 TComHRD *hrd = vps->getBspHrd(hrdIdx);1598 1599 if (hrd->getNalHrdParametersPresentFlag() || hrd->getVclHrdParametersPresentFlag())1600 {1601 len = hrd->getInitialCpbRemovalDelayLengthMinus1() + 1;1602 }1603 else1604 {1605 len = 23 + 1;1606 }1607 1608 if (hrd->getNalHrdParametersPresentFlag())1609 {1610 for(UInt i = 0; i < schedCombCnt; i++)1611 {1612 sei_read_code( pDecodedMessageOutputStream, len, uiCode, "nal_initial_arrival_delay" ); sei.m_nalInitialArrivalDelay[i] = uiCode;1613 }1614 }1615 #if BSP_INIT_ARRIVAL_SEI1616 if( hrd->getVclHrdParametersPresentFlag() )1617 #else1618 else1619 #endif1620 {1621 for(UInt i = 0; i < schedCombCnt; i++)1622 {1623 sei_read_code( pDecodedMessageOutputStream, len, uiCode, "vcl_initial_arrival_delay" ); sei.m_vclInitialArrivalDelay[i] = uiCode;1624 }1625 }1626 #endif1627 1581 } 1628 1582 -
branches/SHM-dev/source/Lib/TLibDecoder/SEIread.h
r1218 r1235 57 57 virtual ~SEIReader() {}; 58 58 #if LAYERS_NOT_PRESENT_SEI 59 Void parseSEImessage(TComInputBitstream* bs, SEIMessages& seis, const NalUnitType nalUnitType, TComVPS *vps,TComSPS *sps, std::ostream *pDecodedMessageOutputStream);59 Void parseSEImessage(TComInputBitstream* bs, SEIMessages& seis, const NalUnitType nalUnitType, const TComVPS *vps, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream); 60 60 #else 61 Void parseSEImessage(TComInputBitstream* bs, SEIMessages& seis, const NalUnitType nalUnitType, TComSPS *sps, std::ostream *pDecodedMessageOutputStream);61 Void parseSEImessage(TComInputBitstream* bs, SEIMessages& seis, const NalUnitType nalUnitType, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream); 62 62 #endif 63 63 protected: 64 64 #if O0164_MULTI_LAYER_HRD 65 65 #if LAYERS_NOT_PRESENT_SEI 66 Void xReadSEImessage (SEIMessages& seis, const NalUnitType nalUnitType, TComVPS *vps,TComSPS *sps, std::ostream *pDecodedMessageOutputStream, const SEIScalableNesting *nestingSei=NULL, const SEIBspNesting *bspNestingSei=NULL);66 Void xReadSEImessage (SEIMessages& seis, const NalUnitType nalUnitType, const TComVPS *vps, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream, const SEIScalableNesting *nestingSei=NULL, const SEIBspNesting *bspNestingSei=NULL); 67 67 #else 68 Void xReadSEImessage (SEIMessages& seis, const NalUnitType nalUnitType, TComSPS *sps,, std::ostream *pDecodedMessageOutputStream, const SEIScalableNesting *nestingSei=NULL);68 Void xReadSEImessage (SEIMessages& seis, const NalUnitType nalUnitType, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream, const SEIScalableNesting *nestingSei=NULL); 69 69 #endif 70 70 #else 71 71 #if LAYERS_NOT_PRESENT_SEI 72 Void xReadSEImessage (SEIMessages& seis, const NalUnitType nalUnitType, TComVPS *vps,TComSPS *sps, std::ostream *pDecodedMessageOutputStream);72 Void xReadSEImessage (SEIMessages& seis, const NalUnitType nalUnitType, const TComVPS *vps, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream); 73 73 #else 74 Void xReadSEImessage (SEIMessages& seis, const NalUnitType nalUnitType, TComSPS *sps, std::ostream *pDecodedMessageOutputStream);74 Void xReadSEImessage (SEIMessages& seis, const NalUnitType nalUnitType, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream); 75 75 #endif 76 76 #endif 77 Void xParseSEIuserDataUnregistered (SEIuserDataUnregistered &sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);78 Void xParseSEIActiveParameterSets (SEIActiveParameterSets &sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);79 Void xParseSEIDecodedPictureHash (SEIDecodedPictureHash& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);77 Void xParseSEIuserDataUnregistered (SEIuserDataUnregistered &sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 78 Void xParseSEIActiveParameterSets (SEIActiveParameterSets &sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 79 Void xParseSEIDecodedPictureHash (SEIDecodedPictureHash& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 80 80 #if SVC_EXTENSION 81 Void xParseSEIDecodingUnitInfo (SEIDecodingUnitInfo& sei, UInt payloadSize, TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei,TComVPS *vps, std::ostream *pDecodedMessageOutputStream);82 Void xParseSEIBufferingPeriod (SEIBufferingPeriod& sei, UInt payloadSize, TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei,TComVPS *vps, std::ostream *pDecodedMessageOutputStream);83 Void xParseSEIPictureTiming (SEIPictureTiming& sei, UInt payloadSize, TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei,TComVPS *vps, std::ostream *pDecodedMessageOutputStream);81 Void xParseSEIDecodingUnitInfo (SEIDecodingUnitInfo& sei, UInt payloadSize, const TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, const TComVPS *vps, std::ostream *pDecodedMessageOutputStream); 82 Void xParseSEIBufferingPeriod (SEIBufferingPeriod& sei, UInt payloadSize, const TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, const TComVPS *vps, std::ostream *pDecodedMessageOutputStream); 83 Void xParseSEIPictureTiming (SEIPictureTiming& sei, UInt payloadSize, const TComSPS *sps, const SEIScalableNesting* nestingSei, const SEIBspNesting* bspNestingSei, const TComVPS *vps, std::ostream *pDecodedMessageOutputStream); 84 84 #else 85 Void xParseSEIDecodingUnitInfo (SEIDecodingUnitInfo& sei, UInt payloadSize, TComSPS *sps, std::ostream *pDecodedMessageOutputStream);86 Void xParseSEIBufferingPeriod (SEIBufferingPeriod& sei, UInt payloadSize, TComSPS *sps, std::ostream *pDecodedMessageOutputStream);87 Void xParseSEIPictureTiming (SEIPictureTiming& sei, UInt payloadSize, TComSPS *sps, std::ostream *pDecodedMessageOutputStream);85 Void xParseSEIDecodingUnitInfo (SEIDecodingUnitInfo& sei, UInt payloadSize, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream); 86 Void xParseSEIBufferingPeriod (SEIBufferingPeriod& sei, UInt payloadSize, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream); 87 Void xParseSEIPictureTiming (SEIPictureTiming& sei, UInt payloadSize, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream); 88 88 #endif 89 Void xParseSEIRecoveryPoint (SEIRecoveryPoint& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);90 Void xParseSEIFramePacking (SEIFramePacking& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);91 Void xParseSEISegmentedRectFramePacking (SEISegmentedRectFramePacking& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);92 Void xParseSEIDisplayOrientation (SEIDisplayOrientation &sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);93 Void xParseSEITemporalLevel0Index (SEITemporalLevel0Index &sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);94 Void xParseSEIRegionRefreshInfo (SEIGradualDecodingRefreshInfo &sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);95 Void xParseSEINoDisplay (SEINoDisplay &sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);96 Void xParseSEIToneMappingInfo (SEIToneMappingInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);97 Void xParseSEISOPDescription (SEISOPDescription &sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);89 Void xParseSEIRecoveryPoint (SEIRecoveryPoint& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 90 Void xParseSEIFramePacking (SEIFramePacking& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 91 Void xParseSEISegmentedRectFramePacking (SEISegmentedRectFramePacking& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 92 Void xParseSEIDisplayOrientation (SEIDisplayOrientation &sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 93 Void xParseSEITemporalLevel0Index (SEITemporalLevel0Index &sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 94 Void xParseSEIRegionRefreshInfo (SEIGradualDecodingRefreshInfo &sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 95 Void xParseSEINoDisplay (SEINoDisplay &sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 96 Void xParseSEIToneMappingInfo (SEIToneMappingInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 97 Void xParseSEISOPDescription (SEISOPDescription &sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 98 98 #if !LAYERS_NOT_PRESENT_SEI 99 Void xParseSEIScalableNesting (SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, TComSPS *sps, std::ostream *pDecodedMessageOutputStream);99 Void xParseSEIScalableNesting (SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream); 100 100 #endif 101 Void xParseSEITempMotionConstraintsTileSets (SEITempMotionConstrainedTileSets& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);102 Void xParseSEITimeCode (SEITimeCode& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);103 Void xParseSEIChromaSamplingFilterHint (SEIChromaSamplingFilterHint& sei, UInt payloadSize/*,TComSPS* */, std::ostream *pDecodedMessageOutputStream);104 Void xParseSEIKneeFunctionInfo (SEIKneeFunctionInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);105 Void xParseSEIMasteringDisplayColourVolume (SEIMasteringDisplayColourVolume& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);101 Void xParseSEITempMotionConstraintsTileSets (SEITempMotionConstrainedTileSets& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 102 Void xParseSEITimeCode (SEITimeCode& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 103 Void xParseSEIChromaSamplingFilterHint (SEIChromaSamplingFilterHint& sei, UInt payloadSize/*,TComSPS* */, std::ostream *pDecodedMessageOutputStream); 104 Void xParseSEIKneeFunctionInfo (SEIKneeFunctionInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 105 Void xParseSEIMasteringDisplayColourVolume (SEIMasteringDisplayColourVolume& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 106 106 107 107 Void sei_read_code(std::ostream *pOS, UInt uiLength, UInt& ruiCode, const Char *pSymbolName); … … 111 111 112 112 #if Q0074_COLOUR_REMAPPING_SEI 113 Void xParseSEIColourRemappingInfo (SEIColourRemappingInfo& sei, UInt payloadSize,std::ostream *pDecodedMessageOutputStream);113 Void xParseSEIColourRemappingInfo (SEIColourRemappingInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 114 114 #endif 115 115 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 116 Void xParseSEIInterLayerConstrainedTileSets (SEIInterLayerConstrainedTileSets &sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream);116 Void xParseSEIInterLayerConstrainedTileSets (SEIInterLayerConstrainedTileSets &sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 117 117 #endif 118 118 #if SUB_BITSTREAM_PROPERTY_SEI 119 Void xParseSEISubBitstreamProperty (SEISubBitstreamProperty &sei, TComVPS *vps,std::ostream *pDecodedMessageOutputStream);119 Void xParseSEISubBitstreamProperty (SEISubBitstreamProperty &sei, const TComVPS *vps, std::ostream *pDecodedMessageOutputStream); 120 120 #endif 121 121 #if LAYERS_NOT_PRESENT_SEI 122 Void xParseSEILayersNotPresent (SEILayersNotPresent &sei, UInt payloadSize, TComVPS *vps ,std::ostream *pDecodedMessageOutputStream);123 Void xParseSEIScalableNesting (SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, TComVPS *vps,TComSPS *sps, std::ostream *pDecodedMessageOutputStream);122 Void xParseSEILayersNotPresent (SEILayersNotPresent &sei, UInt payloadSize, const TComVPS *vps, std::ostream *pDecodedMessageOutputStream); 123 Void xParseSEIScalableNesting (SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, const TComVPS *vps, const TComSPS *sps, std::ostream *pDecodedMessageOutputStream); 124 124 #endif 125 125 #if O0164_MULTI_LAYER_HRD 126 126 #if LAYERS_NOT_PRESENT_SEI 127 Void xParseSEIBspNesting (SEIBspNesting &sei, const NalUnitType nalUnitType, TComVPS *vps,TComSPS *sps, const SEIScalableNesting &nestingSei, std::ostream *pDecodedMessageOutputStream);127 Void xParseSEIBspNesting (SEIBspNesting &sei, const NalUnitType nalUnitType, const TComVPS *vps, const TComSPS *sps, const SEIScalableNesting &nestingSei, std::ostream *pDecodedMessageOutputStream); 128 128 #else 129 Void xParseSEIBspNesting (SEIBspNesting &sei, const NalUnitType nalUnitType, TComSPS *sps, const SEIScalableNesting &nestingSei ,std::ostream *pDecodedMessageOutputStream);129 Void xParseSEIBspNesting (SEIBspNesting &sei, const NalUnitType nalUnitType, const TComSPS *sps, const SEIScalableNesting &nestingSei ,std::ostream *pDecodedMessageOutputStream); 130 130 #endif 131 Void xParseSEIBspInitialArrivalTime (SEIBspInitialArrivalTime &sei, TComVPS *vps,TComSPS *sps, const SEIScalableNesting &nestingSei, const SEIBspNesting &bspNestingSei, std::ostream *pDecodedMessageOutputStream);132 Void xParseHrdParameters (TComHRD *hrd, Bool commonInfPresentFlag, UInt maxNumSubLayersMinus1,std::ostream *pDecodedMessageOutputStream);131 Void xParseSEIBspInitialArrivalTime (SEIBspInitialArrivalTime &sei, const TComVPS *vps, const TComSPS *sps, const SEIScalableNesting &nestingSei, const SEIBspNesting &bspNestingSei, std::ostream *pDecodedMessageOutputStream); 132 Void xParseHrdParameters (TComHRD *hrd, Bool commonInfPresentFlag, UInt maxNumSubLayersMinus1, std::ostream *pDecodedMessageOutputStream); 133 133 #endif 134 134 #if Q0189_TMVP_CONSTRAINTS 135 Void xParseSEITMVPConstraints (SEITMVPConstrains& sei, UInt payloadSize,std::ostream *pDecodedMessageOutputStream);135 Void xParseSEITMVPConstraints (SEITMVPConstrains& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 136 136 #endif 137 137 #if Q0247_FRAME_FIELD_INFO 138 Void xParseSEIFrameFieldInfo (SEIFrameFieldInfo& sei, UInt payloadSize,std::ostream *pDecodedMessageOutputStream);138 Void xParseSEIFrameFieldInfo (SEIFrameFieldInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 139 139 #endif 140 140 #if P0123_ALPHA_CHANNEL_SEI 141 Void xParseSEIAlphaChannelInfo (SEIAlphaChannelInfo& sei, UInt payloadSize,std::ostream *pDecodedMessageOutputStream);141 Void xParseSEIAlphaChannelInfo (SEIAlphaChannelInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 142 142 #endif 143 143 #if Q0096_OVERLAY_SEI 144 Void xParseSEIOverlayInfo (SEIOverlayInfo& sei, UInt payloadSize,std::ostream *pDecodedMessageOutputStream);144 Void xParseSEIOverlayInfo (SEIOverlayInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 145 145 #endif 146 146 #if P0138_USE_ALT_CPB_PARAMS_FLAG 147 Bool xPayloadExtensionPresent 147 Bool xPayloadExtensionPresent(); 148 148 #endif 149 149 }; -
branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp
r1230 r1235 316 316 if(pcPPS->getScalingListPresentFlag ()) 317 317 { 318 parseScalingList( pcPPS->getScalingList() );318 parseScalingList( &(pcPPS->getScalingList()) ); 319 319 } 320 320 … … 379 379 Int cbOffset; 380 380 Int crOffset; 381 READ_SVLC(cbOffset, "cb_qp_adjust nemt[i]");382 READ_SVLC(crOffset, "cr_qp_adjust nemt[i]");381 READ_SVLC(cbOffset, "cb_qp_adjustment[i]"); 382 READ_SVLC(crOffset, "cr_qp_adjustment[i]"); 383 383 pcPPS->setChromaQpAdjTableAt(chromaQpAdjustmentIndex, cbOffset, crOffset); 384 384 } … … 879 879 if(pcSPS->getScalingListPresentFlag ()) 880 880 { 881 parseScalingList( pcSPS->getScalingList() );881 parseScalingList( &(pcSPS->getScalingList()) ); 882 882 } 883 883 #if SVC_EXTENSION … … 1141 1141 } 1142 1142 1143 Void TDecCavlc::parseSliceHeader (TComSlice* pcSlice, ParameterSetManager Decoder*parameterSetManager)1143 Void TDecCavlc::parseSliceHeader (TComSlice* pcSlice, ParameterSetManager *parameterSetManager) 1144 1144 { 1145 1145 UInt uiCode; … … 1165 1165 } 1166 1166 READ_UVLC ( uiCode, "slice_pic_parameter_set_id" ); pcSlice->setPPSId(uiCode); 1167 pps = parameterSetManager->getP refetchedPPS(uiCode);1167 pps = parameterSetManager->getPPS(uiCode); 1168 1168 //!KS: need to add error handling code here, if PPS is not available 1169 1169 assert(pps!=0); 1170 sps = parameterSetManager->get PrefetchedSPS(pps->getSPSId());1170 sps = parameterSetManager->getSPS(pps->getSPSId()); 1171 1171 //!KS: need to add error handling code here, if SPS is not available 1172 1172 assert(sps!=0); 1173 1173 pcSlice->setSPS(sps); 1174 1174 pcSlice->setPPS(pps); 1175 1176 #if SVC_EXTENSION 1177 TComVPS* vps = parameterSetManager->getVPS(sps->getVPSId()); 1178 pcSlice->setVPS(vps); 1179 1180 Int iPOClsb = 0; 1181 #endif 1175 1182 1176 1183 const ChromaFormat chFmt = sps->getChromaFormatIdc(); … … 1212 1219 } 1213 1220 1214 #if SVC_EXTENSION1215 Int iPOClsb = 0;1216 #endif1217 1218 1221 if(!pcSlice->getDependentSliceSegmentFlag()) 1219 1222 { 1220 1223 #if SVC_EXTENSION 1221 1224 Int iBits = 0; 1222 if(p cSlice->getPPS()->getNumExtraSliceHeaderBits() > iBits)1225 if(pps->getNumExtraSliceHeaderBits() > iBits) 1223 1226 { 1224 1227 READ_FLAG(uiCode, "discardable_flag"); … … 1237 1240 } 1238 1241 1239 if(p cSlice->getPPS()->getNumExtraSliceHeaderBits() > iBits)1242 if(pps->getNumExtraSliceHeaderBits() > iBits) 1240 1243 { 1241 1244 READ_FLAG(uiCode, "cross_layer_bla_flag"); pcSlice->setCrossLayerBLAFlag( uiCode ? true : false ); … … 1243 1246 } 1244 1247 1245 for ( ; iBits < p cSlice->getPPS()->getNumExtraSliceHeaderBits(); iBits++)1248 for ( ; iBits < pps->getNumExtraSliceHeaderBits(); iBits++) 1246 1249 { 1247 1250 READ_FLAG(uiCode, "slice_reserved_undetermined_flag[]"); // ignored 1248 1251 } 1249 1252 #else //SVC_EXTENSION 1250 for (Int i = 0; i < p cSlice->getPPS()->getNumExtraSliceHeaderBits(); i++)1253 for (Int i = 0; i < pps->getNumExtraSliceHeaderBits(); i++) 1251 1254 { 1252 1255 READ_FLAG(uiCode, "slice_reserved_undetermined_flag[]"); // ignored … … 1276 1279 1277 1280 #if SVC_EXTENSION 1278 if( ( pcSlice->getLayerId() > 0 && ! pcSlice->getVPS()->getPocLsbNotPresentFlag( pcSlice->getVPS()->getLayerIdxInVps(pcSlice->getLayerId())) ) || !pcSlice->getIdrPicFlag() )1281 if( ( pcSlice->getLayerId() > 0 && !vps->getPocLsbNotPresentFlag( vps->getLayerIdxInVps(pcSlice->getLayerId())) ) || !pcSlice->getIdrPicFlag() ) 1279 1282 #else 1280 1283 else … … 1336 1339 { 1337 1340 Int numBits = 0; 1338 while ((1 << numBits) < pcSlice->getSPS()->getRPSList()->getNumberOfReferencePictureSets())1341 while ((1 << numBits) < sps->getRPSList()->getNumberOfReferencePictureSets()) 1339 1342 { 1340 1343 numBits++; … … 1356 1359 UInt numOfLtrp = 0; 1357 1360 UInt numLtrpInSPS = 0; 1358 if ( pcSlice->getSPS()->getNumLongTermRefPicSPS() > 0)1361 if (sps->getNumLongTermRefPicSPS() > 0) 1359 1362 { 1360 1363 READ_UVLC( uiCode, "num_long_term_sps"); … … 1364 1367 } 1365 1368 Int bitsForLtrpInSPS = 0; 1366 while ( pcSlice->getSPS()->getNumLongTermRefPicSPS() > (1 << bitsForLtrpInSPS))1369 while (sps->getNumLongTermRefPicSPS() > (1 << bitsForLtrpInSPS)) 1367 1370 { 1368 1371 bitsForLtrpInSPS++; … … 1371 1374 numOfLtrp += uiCode; 1372 1375 rps->setNumberOfLongtermPictures(numOfLtrp); 1373 Int maxPicOrderCntLSB = 1 << pcSlice->getSPS()->getBitsForPOC();1376 Int maxPicOrderCntLSB = 1 << sps->getBitsForPOC(); 1374 1377 Int prevDeltaMSB = 0, deltaPocMSBCycleLT = 0; 1375 1378 for(Int j=offset+rps->getNumberOfLongtermPictures()-1, k = 0; k < numOfLtrp; j--, k++) … … 1383 1386 READ_CODE(bitsForLtrpInSPS, uiCode, "lt_idx_sps[i]"); 1384 1387 } 1385 Bool usedByCurrFromSPS= pcSlice->getSPS()->getUsedByCurrPicLtSPSFlag(uiCode);1386 1387 pocLsbLt = pcSlice->getSPS()->getLtRefPicPocLsbSps(uiCode);1388 Bool usedByCurrFromSPS=sps->getUsedByCurrPicLtSPSFlag(uiCode); 1389 1390 pocLsbLt = sps->getLtRefPicPocLsbSps(uiCode); 1388 1391 rps->setUsed(j,usedByCurrFromSPS); 1389 1392 } 1390 1393 else 1391 1394 { 1392 READ_CODE( pcSlice->getSPS()->getBitsForPOC(), uiCode, "poc_lsb_lt"); pocLsbLt= uiCode;1395 READ_CODE(sps->getBitsForPOC(), uiCode, "poc_lsb_lt"); pocLsbLt= uiCode; 1393 1396 READ_FLAG( uiCode, "used_by_curr_pic_lt_flag"); rps->setUsed(j,uiCode); 1394 1397 } … … 1483 1486 pcSlice->setRPS(rps); 1484 1487 } 1485 if ( pcSlice->getSPS()->getTMVPFlagsPresent())1488 if (sps->getTMVPFlagsPresent()) 1486 1489 { 1487 1490 READ_FLAG( uiCode, "slice_temporal_mvp_enable_flag" ); … … 1496 1499 #if SVC_EXTENSION 1497 1500 pcSlice->setActiveNumILRRefIdx(0); 1498 if((pcSlice->getLayerId() > 0) && !( pcSlice->getVPS()->getIlpSshSignalingEnabledFlag()) && (pcSlice->getNumILRRefIdx() > 0) )1501 if((pcSlice->getLayerId() > 0) && !(vps->getIlpSshSignalingEnabledFlag()) && (pcSlice->getNumILRRefIdx() > 0) ) 1499 1502 { 1500 1503 READ_FLAG(uiCode,"inter_layer_pred_enabled_flag"); … … 1509 1512 numBits++; 1510 1513 } 1511 if( ! pcSlice->getVPS()->getMaxOneActiveRefLayerFlag())1514 if( !vps->getMaxOneActiveRefLayerFlag()) 1512 1515 { 1513 1516 READ_CODE( numBits, uiCode,"num_inter_layer_ref_pics_minus1" ); … … 1518 1521 for( Int i = 0; i < pcSlice->getNumILRRefIdx(); i++ ) 1519 1522 { 1520 if( ( pcSlice->getVPS()->getMaxTidIlRefPicsPlus1(pcSlice->getVPS()->getLayerIdxInVps(i), pcSlice->getLayerIdx()) > pcSlice->getTLayer() || pcSlice->getTLayer()==0 ) &&1521 pcSlice->getVPS()->getMaxTSLayersMinus1(pcSlice->getVPS()->getLayerIdxInVps(i)) >= pcSlice->getTLayer() )1523 if( ( vps->getMaxTidIlRefPicsPlus1(vps->getLayerIdxInVps(i), pcSlice->getLayerIdx()) > pcSlice->getTLayer() || pcSlice->getTLayer()==0 ) && 1524 vps->getMaxTSLayersMinus1(vps->getLayerIdxInVps(i)) >= pcSlice->getTLayer() ) 1522 1525 { 1523 1526 pcSlice->setActiveNumILRRefIdx(1); … … 1545 1548 else 1546 1549 { 1547 Int refLayerId = pcSlice->getVPS()->getRefLayerId(pcSlice->getLayerId(), 0);1548 Int refLayerIdx = pcSlice->getVPS()->getLayerIdxInVps(refLayerId);1549 1550 if( ( pcSlice->getVPS()->getMaxTidIlRefPicsPlus1(refLayerIdx, pcSlice->getLayerIdx()) > pcSlice->getTLayer() || pcSlice->getTLayer()==0 ) &&1551 pcSlice->getVPS()->getMaxTSLayersMinus1(refLayerIdx) >= pcSlice->getTLayer() )1550 Int refLayerId = vps->getRefLayerId(pcSlice->getLayerId(), 0); 1551 Int refLayerIdx = vps->getLayerIdxInVps(refLayerId); 1552 1553 if( ( vps->getMaxTidIlRefPicsPlus1(refLayerIdx, pcSlice->getLayerIdx()) > pcSlice->getTLayer() || pcSlice->getTLayer()==0 ) && 1554 vps->getMaxTSLayersMinus1(refLayerIdx) >= pcSlice->getTLayer() ) 1552 1555 { 1553 1556 pcSlice->setActiveNumILRRefIdx(1); … … 1557 1560 } 1558 1561 } 1559 else if( pcSlice->getVPS()->getIlpSshSignalingEnabledFlag() == true && (pcSlice->getLayerId() > 0 ))1562 else if( vps->getIlpSshSignalingEnabledFlag() == true && (pcSlice->getLayerId() > 0 )) 1560 1563 { 1561 1564 pcSlice->setInterLayerPredEnabledFlag(true); … … 1566 1569 for(i = 0, numRefLayerPics = 0; i < pcSlice->getNumILRRefIdx(); i++ ) 1567 1570 { 1568 if( ( pcSlice->getVPS()->getMaxTidIlRefPicsPlus1(pcSlice->getVPS()->getLayerIdxInVps(i), pcSlice->getLayerIdx()) > pcSlice->getTLayer() || pcSlice->getTLayer()==0 ) &&1569 pcSlice->getVPS()->getMaxTSLayersMinus1(pcSlice->getVPS()->getLayerIdxInVps(i)) >= pcSlice->getTLayer() )1571 if( ( vps->getMaxTidIlRefPicsPlus1(vps->getLayerIdxInVps(i), pcSlice->getLayerIdx()) > pcSlice->getTLayer() || pcSlice->getTLayer()==0 ) && 1572 vps->getMaxTSLayersMinus1(vps->getLayerIdxInVps(i)) >= pcSlice->getTLayer() ) 1570 1573 { 1571 1574 refLayerPicIdc[ numRefLayerPics++ ] = i; … … 1591 1594 else 1592 1595 { 1593 format = pcSlice->getVPS()->getVpsRepFormat( sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : pcSlice->getVPS()->getVpsRepFormatIdx( pcSlice->getVPS()->getLayerIdxInVps(sps->getLayerId()) ) )->getChromaFormatVpsIdc();1596 format = vps->getVpsRepFormat( sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : vps->getVpsRepFormatIdx( vps->getLayerIdxInVps(sps->getLayerId()) ) )->getChromaFormatVpsIdc(); 1594 1597 1595 1598 // conformance check 1596 assert( (sps->getUpdateRepFormatFlag()==false && pcSlice->getVPS()->getVpsNumRepFormats()==1) || pcSlice->getVPS()->getVpsNumRepFormats() > 1 );1599 assert( (sps->getUpdateRepFormatFlag()==false && vps->getVpsNumRepFormats()==1) || vps->getVpsNumRepFormats() > 1 ); 1597 1600 } 1598 1601 if (format != CHROMA_400) … … 1633 1636 else 1634 1637 { 1635 pcSlice->setNumRefIdx(REF_PIC_LIST_0, p cSlice->getPPS()->getNumRefIdxL0DefaultActive());1638 pcSlice->setNumRefIdx(REF_PIC_LIST_0, pps->getNumRefIdxL0DefaultActive()); 1636 1639 if (pcSlice->isInterB()) 1637 1640 { 1638 pcSlice->setNumRefIdx(REF_PIC_LIST_1, p cSlice->getPPS()->getNumRefIdxL1DefaultActive());1641 pcSlice->setNumRefIdx(REF_PIC_LIST_1, pps->getNumRefIdxL1DefaultActive()); 1639 1642 } 1640 1643 else … … 1648 1651 if(!pcSlice->isIntra()) 1649 1652 { 1650 if( !p cSlice->getPPS()->getListsModificationPresentFlag() || pcSlice->getNumRpsCurrTempList() <= 1 )1653 if( !pps->getListsModificationPresentFlag() || pcSlice->getNumRpsCurrTempList() <= 1 ) 1651 1654 { 1652 1655 refPicListModification->setRefPicListModificationFlagL0( 0 ); … … 1691 1694 if(pcSlice->isInterB()) 1692 1695 { 1693 if( !p cSlice->getPPS()->getListsModificationPresentFlag() || pcSlice->getNumRpsCurrTempList() <= 1 )1696 if( !pps->getListsModificationPresentFlag() || pcSlice->getNumRpsCurrTempList() <= 1 ) 1694 1697 { 1695 1698 refPicListModification->setRefPicListModificationFlagL1( 0 ); … … 1773 1776 if ( (pps->getUseWP() && pcSlice->getSliceType()==P_SLICE) || (pps->getWPBiPred() && pcSlice->getSliceType()==B_SLICE) ) 1774 1777 { 1775 xParsePredWeightTable(pcSlice );1776 pcSlice->initWpScaling( );1778 xParsePredWeightTable(pcSlice, sps); 1779 pcSlice->initWpScaling(sps); 1777 1780 } 1778 1781 if (!pcSlice->isIntra()) … … 1795 1798 assert( pcSlice->getSliceQp() <= 51 ); 1796 1799 1797 if (p cSlice->getPPS()->getSliceChromaQpFlag())1800 if (pps->getSliceChromaQpFlag()) 1798 1801 { 1799 1802 if (numValidComp>COMPONENT_Cb) … … 1803 1806 assert( pcSlice->getSliceChromaQpDelta(COMPONENT_Cb) >= -12 ); 1804 1807 assert( pcSlice->getSliceChromaQpDelta(COMPONENT_Cb) <= 12 ); 1805 assert( (p cSlice->getPPS()->getQpOffset(COMPONENT_Cb) + pcSlice->getSliceChromaQpDelta(COMPONENT_Cb)) >= -12 );1806 assert( (p cSlice->getPPS()->getQpOffset(COMPONENT_Cb) + pcSlice->getSliceChromaQpDelta(COMPONENT_Cb)) <= 12 );1808 assert( (pps->getQpOffset(COMPONENT_Cb) + pcSlice->getSliceChromaQpDelta(COMPONENT_Cb)) >= -12 ); 1809 assert( (pps->getQpOffset(COMPONENT_Cb) + pcSlice->getSliceChromaQpDelta(COMPONENT_Cb)) <= 12 ); 1807 1810 } 1808 1811 … … 1813 1816 assert( pcSlice->getSliceChromaQpDelta(COMPONENT_Cr) >= -12 ); 1814 1817 assert( pcSlice->getSliceChromaQpDelta(COMPONENT_Cr) <= 12 ); 1815 assert( (p cSlice->getPPS()->getQpOffset(COMPONENT_Cr) + pcSlice->getSliceChromaQpDelta(COMPONENT_Cr)) >= -12 );1816 assert( (p cSlice->getPPS()->getQpOffset(COMPONENT_Cr) + pcSlice->getSliceChromaQpDelta(COMPONENT_Cr)) <= 12 );1817 } 1818 } 1819 1820 if (p cSlice->getPPS()->getChromaQpAdjTableSize() > 0)1818 assert( (pps->getQpOffset(COMPONENT_Cr) + pcSlice->getSliceChromaQpDelta(COMPONENT_Cr)) >= -12 ); 1819 assert( (pps->getQpOffset(COMPONENT_Cr) + pcSlice->getSliceChromaQpDelta(COMPONENT_Cr)) <= 12 ); 1820 } 1821 } 1822 1823 if (pps->getChromaQpAdjTableSize() > 0) 1821 1824 { 1822 1825 READ_FLAG(uiCode, "slice_chroma_qp_adjustment_enabled_flag"); pcSlice->setUseChromaQpAdj(uiCode != 0); … … 1824 1827 else pcSlice->setUseChromaQpAdj(false); 1825 1828 1826 if (p cSlice->getPPS()->getDeblockingFilterControlPresentFlag())1827 { 1828 if(p cSlice->getPPS()->getDeblockingFilterOverrideEnabledFlag())1829 if (pps->getDeblockingFilterControlPresentFlag()) 1830 { 1831 if(pps->getDeblockingFilterOverrideEnabledFlag()) 1829 1832 { 1830 1833 READ_FLAG ( uiCode, "deblocking_filter_override_flag" ); pcSlice->setDeblockingFilterOverrideFlag(uiCode ? true : false); … … 1849 1852 else 1850 1853 { 1851 pcSlice->setDeblockingFilterDisable ( p cSlice->getPPS()->getPicDisableDeblockingFilterFlag() );1852 pcSlice->setDeblockingFilterBetaOffsetDiv2( p cSlice->getPPS()->getDeblockingFilterBetaOffsetDiv2() );1853 pcSlice->setDeblockingFilterTcOffsetDiv2 ( p cSlice->getPPS()->getDeblockingFilterTcOffsetDiv2() );1854 pcSlice->setDeblockingFilterDisable ( pps->getPicDisableDeblockingFilterFlag() ); 1855 pcSlice->setDeblockingFilterBetaOffsetDiv2( pps->getDeblockingFilterBetaOffsetDiv2() ); 1856 pcSlice->setDeblockingFilterTcOffsetDiv2 ( pps->getDeblockingFilterTcOffsetDiv2() ); 1854 1857 } 1855 1858 } … … 1861 1864 } 1862 1865 1863 Bool isSAOEnabled = pcSlice->getSPS()->getUseSAO() && (pcSlice->getSaoEnabledFlag(CHANNEL_TYPE_LUMA) || (bChroma && pcSlice->getSaoEnabledFlag(CHANNEL_TYPE_CHROMA)));1866 Bool isSAOEnabled = sps->getUseSAO() && (pcSlice->getSaoEnabledFlag(CHANNEL_TYPE_LUMA) || (bChroma && pcSlice->getSaoEnabledFlag(CHANNEL_TYPE_CHROMA))); 1864 1867 Bool isDBFEnabled = (!pcSlice->getDeblockingFilterDisable()); 1865 1868 1866 if(p cSlice->getPPS()->getLoopFilterAcrossSlicesEnabledFlag() && ( isSAOEnabled || isDBFEnabled ))1869 if(pps->getLoopFilterAcrossSlicesEnabledFlag() && ( isSAOEnabled || isDBFEnabled )) 1867 1870 { 1868 1871 READ_FLAG( uiCode, "slice_loop_filter_across_slices_enabled_flag"); … … 1870 1873 else 1871 1874 { 1872 uiCode = p cSlice->getPPS()->getLoopFilterAcrossSlicesEnabledFlag()?1:0;1875 uiCode = pps->getLoopFilterAcrossSlicesEnabledFlag()?1:0; 1873 1876 } 1874 1877 pcSlice->setLFCrossSliceBoundaryFlag( (uiCode==1)?true:false); … … 2379 2382 * \returns Void 2380 2383 */ 2381 Void TDecCavlc::xParsePredWeightTable( TComSlice* pcSlice )2384 Void TDecCavlc::xParsePredWeightTable( TComSlice* pcSlice, const TComSPS *sps ) 2382 2385 { 2383 2386 WPScalingParam *wp; 2384 TComSPS *sps = pcSlice->getSPS();2385 2387 const ChromaFormat chFmt = sps->getChromaFormatIdc(); 2386 2388 const Int numValidComp = Int(getNumberValidComponents(chFmt)); … … 2526 2528 READ_FLAG( code, "scaling_list_pred_mode_flag"); 2527 2529 scalingListPredModeFlag = (code) ? true : false; 2530 scalingList->setScalingListPredModeFlag(sizeId, listId, scalingListPredModeFlag); 2528 2531 if(!scalingListPredModeFlag) //Copy Mode 2529 2532 { … … 3733 3736 } 3734 3737 3735 READ_CODE(numBits, uiCode, "bsp_ comb_hrd_idx[h][i][t][j][k]"); vps->setBspHrdIdx(h, i, t, j, k, uiCode);3738 READ_CODE(numBits, uiCode, "bsp_hrd_idx[h][i][t][j][k]"); vps->setBspHrdIdx(h, i, t, j, k, uiCode); 3736 3739 } 3737 3740 3738 READ_UVLC(uiCode, "bsp_ comb_sched_idx[h][i][t][j][k]"); vps->setBspSchedIdx(h, i, t, j, k, uiCode);3741 READ_UVLC(uiCode, "bsp_sched_idx[h][i][t][j][k]"); vps->setBspSchedIdx(h, i, t, j, k, uiCode); 3739 3742 } 3740 3743 } -
branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.h
r1224 r1235 85 85 Void parseProfileTier (ProfileTierLevel *ptl); 86 86 Void parseHrdParameters (TComHRD *hrd, Bool cprms_present_flag, UInt tempLevelHigh); 87 Void parseSliceHeader ( TComSlice* pcSlice, ParameterSetManager Decoder*parameterSetManager);87 Void parseSliceHeader ( TComSlice* pcSlice, ParameterSetManager *parameterSetManager); 88 88 Void parseTerminatingBit ( UInt& ruiBit ); 89 89 Void parseRemainingBytes ( Bool noTrailingBytesExpected ); … … 117 117 Void parseIPCMInfo ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth); 118 118 119 Void xParsePredWeightTable ( TComSlice* pcSlice );119 Void xParsePredWeightTable ( TComSlice* pcSlice, const TComSPS *sps ); 120 120 Void parseScalingList ( TComScalingList* scalingList ); 121 121 Void xDecodeScalingList ( TComScalingList *scalingList, UInt sizeId, UInt listId); -
branches/SHM-dev/source/Lib/TLibDecoder/TDecCu.cpp
r1203 r1235 239 239 { 240 240 UInt uiIdx = uiAbsPartIdx; 241 if( (g_uiMaxCUWidth>>uiDepth) == pcCU->getSlice()->getPPS()->getMinCuDQPSize() && pcCU->getSlice()->getPPS()->getUseDQP())241 if( (g_uiMaxCUWidth>>uiDepth) == (g_uiMaxCUWidth >> ( pcCU->getSlice()->getPPS()->getMaxCuDQPDepth())) && pcCU->getSlice()->getPPS()->getUseDQP()) 242 242 { 243 243 setdQPFlag(true); … … 245 245 } 246 246 247 if( (g_uiMaxCUWidth>>uiDepth) == pcCU->getSlice()->getPPS()->getMinCuChromaQpAdjSize() && pcCU->getSlice()->getUseChromaQpAdj() )247 if( (g_uiMaxCUWidth>>uiDepth) == (g_uiMaxCUWidth >> ( pcCU->getSlice()->getPPS()->getMaxCuChromaQpAdjDepth())) && pcCU->getSlice()->getUseChromaQpAdj() ) 248 248 { 249 249 setIsChromaQpAdjCoded(true); … … 270 270 uiIdx += uiQNumParts; 271 271 } 272 if( (g_uiMaxCUWidth>>uiDepth) == pcCU->getSlice()->getPPS()->getMinCuDQPSize() && pcCU->getSlice()->getPPS()->getUseDQP())272 if( (g_uiMaxCUWidth>>uiDepth) == (g_uiMaxCUWidth >> ( pcCU->getSlice()->getPPS()->getMaxCuDQPDepth())) && pcCU->getSlice()->getPPS()->getUseDQP()) 273 273 { 274 274 if ( getdQPFlag() ) … … 281 281 } 282 282 283 if( (g_uiMaxCUWidth>>uiDepth) >= pcCU->getSlice()->getPPS()->getMinCuDQPSize() && pcCU->getSlice()->getPPS()->getUseDQP())283 if( (g_uiMaxCUWidth>>uiDepth) >= (g_uiMaxCUWidth >> ( pcCU->getSlice()->getPPS()->getMaxCuDQPDepth())) && pcCU->getSlice()->getPPS()->getUseDQP()) 284 284 { 285 285 setdQPFlag(true); … … 287 287 } 288 288 289 if( (g_uiMaxCUWidth>>uiDepth) >= pcCU->getSlice()->getPPS()->getMinCuChromaQpAdjSize() && pcCU->getSlice()->getUseChromaQpAdj() )289 if( (g_uiMaxCUWidth>>uiDepth) >= (g_uiMaxCUWidth >> ( pcCU->getSlice()->getPPS()->getMaxCuChromaQpAdjDepth())) && pcCU->getSlice()->getUseChromaQpAdj() ) 290 290 { 291 291 setIsChromaQpAdjCoded(true); -
branches/SHM-dev/source/Lib/TLibDecoder/TDecEntropy.h
r1212 r1235 77 77 #endif 78 78 79 virtual Void parseSliceHeader ( TComSlice* pcSlice, ParameterSetManager Decoder*parameterSetManager) = 0;79 virtual Void parseSliceHeader ( TComSlice* pcSlice, ParameterSetManager *parameterSetManager) = 0; 80 80 81 81 virtual Void parseTerminatingBit ( UInt& ruilsLast ) = 0; … … 150 150 Void decodePPS ( TComPPS* pcPPS ) { m_pcEntropyDecoderIf->parsePPS(pcPPS); } 151 151 #endif 152 Void decodeSliceHeader ( TComSlice* pcSlice, ParameterSetManager Decoder*parameterSetManager) { m_pcEntropyDecoderIf->parseSliceHeader(pcSlice, parameterSetManager); }152 Void decodeSliceHeader ( TComSlice* pcSlice, ParameterSetManager *parameterSetManager) { m_pcEntropyDecoderIf->parseSliceHeader(pcSlice, parameterSetManager); } 153 153 154 154 Void decodeTerminatingBit ( UInt& ruiIsLast ) { m_pcEntropyDecoderIf->parseTerminatingBit(ruiIsLast); } -
branches/SHM-dev/source/Lib/TLibDecoder/TDecSbac.cpp
r1230 r1235 584 584 } 585 585 eMode = (PartSize) uiMode; 586 if ( pcCU->getSlice()->getSPS()->get AMPAcc( uiDepth ))586 if ( pcCU->getSlice()->getSPS()->getUseAMP() && uiDepth < g_uiMaxCUDepth-g_uiAddCUDepth ) 587 587 { 588 588 if (eMode == SIZE_2NxN) -
branches/SHM-dev/source/Lib/TLibDecoder/TDecSbac.h
r1212 r1235 85 85 ) {} 86 86 87 Void parseSliceHeader ( TComSlice* /*pcSlice*/, ParameterSetManager Decoder* /*parameterSetManager*/) {}87 Void parseSliceHeader ( TComSlice* /*pcSlice*/, ParameterSetManager* /*parameterSetManager*/) {} 88 88 Void parseTerminatingBit ( UInt& ruiBit ); 89 89 Void parseRemainingBytes ( Bool noTrailingBytesExpected); -
branches/SHM-dev/source/Lib/TLibDecoder/TDecSlice.cpp
r1029 r1235 40 40 //! \ingroup TLibDecoder 41 41 //! \{ 42 43 #if SVC_EXTENSION44 ParameterSetMap<TComVPS> ParameterSetManagerDecoder::m_vpsBuffer(MAX_NUM_VPS);45 ParameterSetMap<TComSPS> ParameterSetManagerDecoder::m_spsBuffer(MAX_NUM_SPS);46 ParameterSetMap<TComPPS> ParameterSetManagerDecoder::m_ppsBuffer(MAX_NUM_PPS);47 #endif48 42 49 43 ////////////////////////////////////////////////////////////////////// … … 271 265 } 272 266 273 ParameterSetManagerDecoder::ParameterSetManagerDecoder()274 #if !SVC_EXTENSION275 : m_vpsBuffer(MAX_NUM_VPS)276 , m_spsBuffer(MAX_NUM_SPS)277 , m_ppsBuffer(MAX_NUM_PPS)278 #endif279 {280 }281 282 ParameterSetManagerDecoder::~ParameterSetManagerDecoder()283 {284 285 }286 287 TComVPS* ParameterSetManagerDecoder::getPrefetchedVPS (Int vpsId)288 {289 if (m_vpsBuffer.getPS(vpsId) != NULL )290 {291 return m_vpsBuffer.getPS(vpsId);292 }293 else294 {295 return getVPS(vpsId);296 }297 }298 299 300 TComSPS* ParameterSetManagerDecoder::getPrefetchedSPS (Int spsId)301 {302 if (m_spsBuffer.getPS(spsId) != NULL )303 {304 return m_spsBuffer.getPS(spsId);305 }306 else307 {308 return getSPS(spsId);309 }310 }311 312 TComPPS* ParameterSetManagerDecoder::getPrefetchedPPS (Int ppsId)313 {314 if (m_ppsBuffer.getPS(ppsId) != NULL )315 {316 return m_ppsBuffer.getPS(ppsId);317 }318 else319 {320 return getPPS(ppsId);321 }322 }323 324 Void ParameterSetManagerDecoder::applyPrefetchedPS()325 {326 m_vpsMap.mergePSList(m_vpsBuffer);327 m_ppsMap.mergePSList(m_ppsBuffer);328 m_spsMap.mergePSList(m_spsBuffer);329 }330 331 267 //! \} -
branches/SHM-dev/source/Lib/TLibDecoder/TDecSlice.h
r1029 r1235 88 88 }; 89 89 90 91 class ParameterSetManagerDecoder:public ParameterSetManager92 {93 public:94 ParameterSetManagerDecoder();95 virtual ~ParameterSetManagerDecoder();96 Void storePrefetchedVPS(TComVPS *vps) { m_vpsBuffer.storePS( vps->getVPSId(), vps); };97 TComVPS* getPrefetchedVPS (Int vpsId);98 Void storePrefetchedSPS(TComSPS *sps) { m_spsBuffer.storePS( sps->getSPSId(), sps); };99 TComSPS* getPrefetchedSPS (Int spsId);100 Void storePrefetchedPPS(TComPPS *pps) { m_ppsBuffer.storePS( pps->getPPSId(), pps); };101 TComPPS* getPrefetchedPPS (Int ppsId);102 Void applyPrefetchedPS();103 104 private:105 #if SVC_EXTENSION106 static ParameterSetMap<TComVPS> m_vpsBuffer;107 static ParameterSetMap<TComSPS> m_spsBuffer;108 static ParameterSetMap<TComPPS> m_ppsBuffer;109 #else110 ParameterSetMap<TComVPS> m_vpsBuffer;111 ParameterSetMap<TComSPS> m_spsBuffer;112 ParameterSetMap<TComPPS> m_ppsBuffer;113 #endif114 };115 116 117 90 //! \} 118 91 -
branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp
r1229 r1235 223 223 } 224 224 225 Void TDecTop::xGetNewPicBuffer ( TComSlice* pcSlice, TComPic*& rpcPic ) 226 { 227 Int numReorderPics[MAX_TLAYER]; 228 #if SVC_EXTENSION 229 Window &conformanceWindow = pcSlice->getConformanceWindow(); 225 #if SVC_EXTENSION 226 Void TDecTop::xGetNewPicBuffer( const TComVPS &vps, const TComSPS &sps, const TComPPS &pps, TComPic*& rpcPic, const UInt temporalLayer ) 230 227 #else 231 Window &conformanceWindow = pcSlice->getSPS()->getConformanceWindow(); 232 #endif 233 Window defaultDisplayWindow = pcSlice->getSPS()->getVuiParametersPresentFlag() ? pcSlice->getSPS()->getVuiParameters()->getDefaultDisplayWindow() : Window(); 234 235 for( Int temporalLayer=0; temporalLayer < MAX_TLAYER; temporalLayer++) 236 { 237 #if SVC_EXTENSION 238 if( m_commonDecoderParams->getTargetOutputLayerSetIdx() == 0 ) 239 { 240 assert( this->getLayerId() == 0 ); 241 numReorderPics[temporalLayer] = pcSlice->getSPS()->getNumReorderPics(temporalLayer); 242 } 243 else 244 { 245 TComVPS *vps = pcSlice->getVPS(); 246 // SHM decoders will use DPB size table in the VPS to determine the number of reorder pictures. 247 numReorderPics[temporalLayer] = vps->getMaxVpsNumReorderPics( getCommonDecoderParams()->getTargetOutputLayerSetIdx() , temporalLayer); 248 } 249 #else 250 numReorderPics[temporalLayer] = pcSlice->getSPS()->getNumReorderPics(temporalLayer); 251 #endif 252 } 253 228 Void TDecTop::xGetNewPicBuffer ( const TComSPS &sps, const TComPPS &pps, TComPic*& rpcPic, const UInt temporalLayer ) 229 #endif 230 { 254 231 #if SVC_EXTENSION 255 232 if( m_commonDecoderParams->getTargetOutputLayerSetIdx() == 0 ) 256 233 { 257 assert( this->getLayerId()== 0 );258 m_iMaxRefPicNum = pcSlice->getSPS()->getMaxDecPicBuffering(pcSlice->getTLayer()); // m_uiMaxDecPicBuffering has the space for the picture currently being decoded234 assert( m_layerId == 0 ); 235 m_iMaxRefPicNum = sps.getMaxDecPicBuffering(temporalLayer); // m_uiMaxDecPicBuffering has the space for the picture currently being decoded 259 236 } 260 237 else 261 238 { 262 m_iMaxRefPicNum = pcSlice->getVPS()->getMaxVpsDecPicBufferingMinus1( m_commonDecoderParams->getTargetOutputLayerSetIdx(), pcSlice->getVPS()->getLayerIdcForOls( pcSlice->getVPS()->getOutputLayerSetIdx( m_commonDecoderParams->getTargetOutputLayerSetIdx()), pcSlice->getLayerId() ), pcSlice->getTLayer()) + 1; // m_uiMaxDecPicBuffering has the space for the picture currently being decoded239 m_iMaxRefPicNum = vps.getMaxVpsDecPicBufferingMinus1( m_commonDecoderParams->getTargetOutputLayerSetIdx(), vps.getLayerIdcForOls( vps.getOutputLayerSetIdx( m_commonDecoderParams->getTargetOutputLayerSetIdx()), m_layerId ), temporalLayer ) + 1; // m_uiMaxDecPicBuffering has the space for the picture currently being decoded 263 240 } 264 241 265 242 m_iMaxRefPicNum += 1; // it should be updated if more than 1 resampling picture is used 266 243 #else 267 m_iMaxRefPicNum = pcSlice->getSPS()->getMaxDecPicBuffering(pcSlice->getTLayer()); // m_uiMaxDecPicBuffering has the space for the picture currently being decoded244 m_iMaxRefPicNum = sps.getMaxDecPicBuffering(temporalLayer); // m_uiMaxDecPicBuffering has the space for the picture currently being decoded 268 245 #endif 269 246 … … 275 252 if(m_layerId > 0) 276 253 { 277 xSetSpatialEnhLayerFlag( pcSlice, rpcPic ); 278 } 279 280 rpcPic->create ( pcSlice->getPicWidthInLumaSamples(), pcSlice->getPicHeightInLumaSamples(), pcSlice->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 281 conformanceWindow, defaultDisplayWindow, numReorderPics, pcSlice->getSPS(), true); 254 xSetSpatialEnhLayerFlag( vps, sps, pps, rpcPic ); 255 } 256 257 rpcPic->create( vps, sps, pps, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, true, m_layerId); 282 258 #else //SVC_EXTENSION 283 rpcPic->create ( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), pcSlice->getSPS()->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 284 conformanceWindow, defaultDisplayWindow, numReorderPics, true); 259 rpcPic->create ( sps, pps, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, true); 285 260 #endif //SVC_EXTENSION 286 261 … … 326 301 if( m_layerId > 0 ) 327 302 { 328 xSetSpatialEnhLayerFlag( pcSlice, rpcPic ); 329 } 330 331 rpcPic->create ( pcSlice->getPicWidthInLumaSamples(), pcSlice->getPicHeightInLumaSamples(), pcSlice->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 332 conformanceWindow, defaultDisplayWindow, numReorderPics, pcSlice->getSPS(), true); 303 xSetSpatialEnhLayerFlag( vps, sps, pps, rpcPic ); 304 } 305 306 rpcPic->create( vps, sps, pps, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, true, m_layerId); 333 307 #else //SVC_EXTENSION 334 rpcPic->create ( pcSlice->getSPS()->getPicWidthInLumaSamples(), pcSlice->getSPS()->getPicHeightInLumaSamples(), pcSlice->getSPS()->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, 335 conformanceWindow, defaultDisplayWindow, numReorderPics, true); 308 rpcPic->create ( sps, pps, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, true); 336 309 #endif //SVC_EXTENSION 337 310 } … … 386 359 { 387 360 printf("\ninserting lost poc : %d\n",iLostPoc); 388 TComSlice cFillSlice;389 cFillSlice.setSPS( m_parameterSetManagerDecoder.getFirstSPS() );390 cFillSlice.setPPS( m_parameterSetManagerDecoder.getFirstPPS() );391 #if SVC_EXTENSION392 cFillSlice.setVPS( m_parameterSetManagerDecoder.getFirstVPS() );393 cFillSlice.initSlice( m_layerId );394 #else395 cFillSlice.initSlice();396 #endif397 361 TComPic *cFillPic; 398 xGetNewPicBuffer(&cFillSlice,cFillPic); 399 cFillPic->getSlice(0)->setSPS( m_parameterSetManagerDecoder.getFirstSPS() ); 400 cFillPic->getSlice(0)->setPPS( m_parameterSetManagerDecoder.getFirstPPS() ); 401 #if SVC_EXTENSION 402 cFillPic->getSlice(0)->setVPS( m_parameterSetManagerDecoder.getFirstVPS() ); 362 #if SVC_EXTENSION 363 xGetNewPicBuffer(*(m_parameterSetManager.getFirstVPS()), *(m_parameterSetManager.getFirstSPS()), *(m_parameterSetManager.getFirstPPS()), cFillPic, 0); 403 364 cFillPic->getSlice(0)->initSlice( m_layerId ); 404 365 #else 366 xGetNewPicBuffer(*(m_parameterSetManager.getFirstSPS()), *(m_parameterSetManager.getFirstPPS()), cFillPic, 0); 405 367 cFillPic->getSlice(0)->initSlice(); 406 368 #endif … … 445 407 Void TDecTop::xActivateParameterSets() 446 408 { 447 m_parameterSetManagerDecoder.applyPrefetchedPS(); 448 449 TComPPS *pps = m_parameterSetManagerDecoder.getPPS(m_apcSlicePilot->getPPSId()); 450 assert (pps != 0); 451 452 TComSPS *sps = m_parameterSetManagerDecoder.getSPS(pps->getSPSId()); 453 assert (sps != 0); 454 455 if (false == m_parameterSetManagerDecoder.activatePPS(m_apcSlicePilot->getPPSId(),m_apcSlicePilot->isIRAP())) 456 { 457 printf ("Parameter set activation failed!"); 458 assert (0); 459 } 460 461 #if SVC_EXTENSION 462 // scaling list settings and checks 463 TComVPS *activeVPS = m_parameterSetManagerDecoder.getActiveVPS(); 464 TComSPS *activeSPS = m_parameterSetManagerDecoder.getActiveSPS(); 465 TComPPS *activePPS = m_parameterSetManagerDecoder.getActivePPS(); 466 467 if( activeSPS->getInferScalingListFlag() ) 468 { 469 UInt refLayerId = activeSPS->getScalingListRefLayerId(); 470 TComSPS *refSps = m_ppcTDecTop[refLayerId]->getParameterSetManager()->getActiveSPS(); assert( refSps != NULL ); 471 472 // When avc_base_layer_flag is equal to 1, it is a requirement of bitstream conformance that the value of sps_scaling_list_ref_layer_id shall be greater than 0 473 if( activeVPS->getNonHEVCBaseLayerFlag() ) 474 { 475 assert( refLayerId > 0 ); 476 } 477 478 // It is a requirement of bitstream conformance that, when an SPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB and 479 // sps_infer_scaling_list_flag in the SPS is equal to 1, sps_infer_scaling_list_flag shall be equal to 0 for the SPS that is active for the layer with nuh_layer_id equal to sps_scaling_list_ref_layer_id 480 assert( refSps->getInferScalingListFlag() == false ); 481 482 // It is a requirement of bitstream conformance that, when an SPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB, 483 // the layer with nuh_layer_id equal to sps_scaling_list_ref_layer_id shall be a direct or indirect reference layer of the layer with nuh_layer_id equal to nuhLayerIdB 484 assert( activeVPS->getRecursiveRefLayerFlag( activeSPS->getLayerId(), refLayerId ) == true ); 485 486 if( activeSPS->getScalingList() != refSps->getScalingList() ) 487 { 488 // delete created instance of scaling list since it will be inferred 489 delete activeSPS->getScalingList(); 490 491 // infer scaling list 492 activeSPS->setScalingList( refSps->getScalingList() ); 493 } 494 } 495 496 if( activePPS->getInferScalingListFlag() ) 497 { 498 UInt refLayerId = activePPS->getScalingListRefLayerId(); 499 TComPPS *refPps = m_ppcTDecTop[refLayerId]->getParameterSetManager()->getActivePPS(); assert( refPps != NULL ); 500 501 // When avc_base_layer_flag is equal to 1, it is a requirement of bitstream conformance that the value of sps_scaling_list_ref_layer_id shall be greater than 0 502 if( activeVPS->getNonHEVCBaseLayerFlag() ) 503 { 504 assert( refLayerId > 0 ); 505 } 506 507 // It is a requirement of bitstream conformance that, when an PPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB and 508 // pps_infer_scaling_list_flag in the PPS is equal to 1, pps_infer_scaling_list_flag shall be equal to 0 for the PPS that is active for the layer with nuh_layer_id equal to pps_scaling_list_ref_layer_id 509 assert( refPps->getInferScalingListFlag() == false ); 510 511 // It is a requirement of bitstream conformance that, when an PPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB, 512 // the layer with nuh_layer_id equal to pps_scaling_list_ref_layer_id shall be a direct or indirect reference layer of the layer with nuh_layer_id equal to nuhLayerIdB 513 assert( activeVPS->getRecursiveRefLayerFlag( activePPS->getLayerId(), refLayerId ) == true ); 514 515 if( activePPS->getScalingList() != refPps->getScalingList() ) 516 { 517 // delete created instance of scaling list since it will be inferred 518 delete activePPS->getScalingList(); 519 520 // infer scaling list 521 activePPS->setScalingList( refPps->getScalingList() ); 522 } 523 524 } 409 if (m_bFirstSliceInPicture) 410 { 411 const TComPPS *pps = m_parameterSetManager.getPPS(m_apcSlicePilot->getPPSId()); // this is a temporary PPS object. Do not store this value 412 assert (pps != 0); 413 414 #if SVC_EXTENSION 415 TComSPS *updateSPS = m_parameterSetManager.getSPS(pps->getSPSId()); // this is a temporary SPS object. Do not store this value 416 #endif 417 const TComSPS *sps = m_parameterSetManager.getSPS(pps->getSPSId()); // this is a temporary SPS object. Do not store this value 418 assert (sps != 0); 419 420 m_parameterSetManager.clearSPSChangedFlag(sps->getSPSId()); 421 m_parameterSetManager.clearPPSChangedFlag(pps->getPPSId()); 422 423 if (false == m_parameterSetManager.activatePPS(m_apcSlicePilot->getPPSId(),m_apcSlicePilot->isIRAP())) 424 { 425 printf ("Parameter set activation failed!"); 426 assert (0); 427 } 428 429 #if SVC_EXTENSION 430 // scaling list settings and checks 431 TComVPS *vps = m_parameterSetManager.getVPS(sps->getVPSId()); 432 assert (vps != 0); 433 434 m_parameterSetManager.clearVPSChangedFlag(sps->getVPSId()); 435 436 if( sps->getInferScalingListFlag() ) 437 { 438 UInt refLayerId = sps->getScalingListRefLayerId(); 439 const TComSPS *refSps = m_ppcTDecTop[refLayerId]->getParameterSetManager()->getActiveSPS(); assert( refSps != NULL ); 440 441 // When avc_base_layer_flag is equal to 1, it is a requirement of bitstream conformance that the value of sps_scaling_list_ref_layer_id shall be greater than 0 442 if( vps->getNonHEVCBaseLayerFlag() ) 443 { 444 assert( refLayerId > 0 ); 445 } 446 447 // It is a requirement of bitstream conformance that, when an SPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB and 448 // sps_infer_scaling_list_flag in the SPS is equal to 1, sps_infer_scaling_list_flag shall be equal to 0 for the SPS that is active for the layer with nuh_layer_id equal to sps_scaling_list_ref_layer_id 449 assert( refSps->getInferScalingListFlag() == false ); 450 451 // It is a requirement of bitstream conformance that, when an SPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB, 452 // the layer with nuh_layer_id equal to sps_scaling_list_ref_layer_id shall be a direct or indirect reference layer of the layer with nuh_layer_id equal to nuhLayerIdB 453 assert( vps->getRecursiveRefLayerFlag( sps->getLayerId(), refLayerId ) == true ); 454 } 455 456 if( pps->getInferScalingListFlag() ) 457 { 458 UInt refLayerId = pps->getScalingListRefLayerId(); 459 const TComPPS *refPps = m_ppcTDecTop[refLayerId]->getParameterSetManager()->getActivePPS(); assert( refPps != NULL ); 460 461 // When avc_base_layer_flag is equal to 1, it is a requirement of bitstream conformance that the value of sps_scaling_list_ref_layer_id shall be greater than 0 462 if( vps->getNonHEVCBaseLayerFlag() ) 463 { 464 assert( refLayerId > 0 ); 465 } 466 467 // It is a requirement of bitstream conformance that, when an PPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB and 468 // pps_infer_scaling_list_flag in the PPS is equal to 1, pps_infer_scaling_list_flag shall be equal to 0 for the PPS that is active for the layer with nuh_layer_id equal to pps_scaling_list_ref_layer_id 469 assert( refPps->getInferScalingListFlag() == false ); 470 471 // It is a requirement of bitstream conformance that, when an PPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB, 472 // the layer with nuh_layer_id equal to pps_scaling_list_ref_layer_id shall be a direct or indirect reference layer of the layer with nuh_layer_id equal to nuhLayerIdB 473 assert( vps->getRecursiveRefLayerFlag( pps->getLayerId(), refLayerId ) == true ); 474 } 525 475 526 476 #if AVC_BASE 527 if( activeVPS->getNonHEVCBaseLayerFlag() ) 528 { 529 TComPic* pBLPic = (*m_ppcTDecTop[0]->getListPic()->begin()); 530 if( m_layerId > 0 && pBLPic->getPicYuvRec() == NULL ) 531 { 532 UInt refLayerId = 0; 533 RepFormat* repFormat = activeVPS->getVpsRepFormat( activeVPS->getVpsRepFormatIdx(refLayerId) ); 534 535 Int numReorderPics[MAX_TLAYER]; 536 Window defaultDisplayWindow; 537 538 #if AUXILIARY_PICTURES 539 pBLPic->create( repFormat->getPicWidthVpsInLumaSamples(), repFormat->getPicHeightVpsInLumaSamples(), repFormat->getChromaFormatVpsIdc(), activeSPS->getMaxCUWidth(), activeSPS->getMaxCUHeight(), activeSPS->getMaxCUDepth(), repFormat->getConformanceWindowVps(), defaultDisplayWindow, numReorderPics, NULL, true); 477 if( vps->getNonHEVCBaseLayerFlag() ) 478 { 479 TComPic* pBLPic = (*m_ppcTDecTop[0]->getListPic()->begin()); 480 if( m_layerId > 0 && pBLPic->getPicYuvRec() == NULL ) 481 { 482 UInt refLayerId = 0; 483 const RepFormat* repFormat = vps->getVpsRepFormat( vps->getVpsRepFormatIdx(refLayerId) ); 484 485 pBLPic->create( *vps, *sps, *pps, sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxCUDepth(), true, refLayerId); 486 487 // it is needed where the VPS is accessed through the slice 488 pBLPic->getSlice(0)->setVPS( vps ); 489 490 g_bitDepthLayer[CHANNEL_TYPE_LUMA][0] = repFormat->getBitDepthVpsLuma(); 491 g_bitDepthLayer[CHANNEL_TYPE_CHROMA][0] = repFormat->getBitDepthVpsChroma(); 492 } 493 } 494 #endif 495 496 if( m_layerId > 0 ) 497 { 498 // When not present sps_max_sub_layers_minus1 is inferred to be equal to vps_max_sub_layers_minus1. 499 updateSPS->setMaxTLayers( vps->getMaxTLayers() ); 500 501 // When not present sps_temporal_id_nesting_flag is inferred to be equal to vps_temporal_id_nesting_flag 502 updateSPS->setTemporalIdNestingFlag( (sps->getMaxTLayers() > 1) ? vps->getTemporalNestingFlag() : true ); 503 504 // When sps_max_dec_pic_buffering_minus1[ i ] is not present for i in the range of 0 to sps_max_sub_layers_minus1, inclusive, due to nuh_layer_id being greater than 0, 505 // it is inferred to be equal to max_vps_dec_pic_buffering_minus1[ TargetOptLayerSetIdx ][ currLayerId ][ i ] of the active VPS, where currLayerId is the nuh_layer_id of the layer that refers to the SPS. 506 for(UInt i=0; i < sps->getMaxTLayers(); i++) 507 { 508 // to avoid compiler warning "array subscript is above array bounds" 509 assert( i < MAX_TLAYER ); 510 511 // When sps_max_dec_pic_buffering_minus1[ i ] is not present for i in the range of 0 to sps_max_sub_layers_minus1, inclusive, 512 // due to MultiLayerExtSpsFlag being equal to 1, for a layer that refers to the SPS and has nuh_layer_id equal to currLayerId, 513 // the value of sps_max_dec_pic_buffering_minus1[ i ] is inferred to be equal to max_vps_dec_pic_buffering_minus1[ TargetOlsIdx ][ layerIdx ][ i ] of the active VPS, 514 // where layerIdx is equal to the value such that LayerSetLayerIdList[ TargetDecLayerSetIdx ][ layerIdx ] is equal to currLayerId. 515 if( sps->getMultiLayerExtSpsFlag() ) 516 { 517 updateSPS->setMaxDecPicBuffering( vps->getMaxVpsDecPicBufferingMinus1( m_commonDecoderParams->getTargetOutputLayerSetIdx(), vps->getLayerIdcForOls( vps->getOutputLayerSetIdx( m_commonDecoderParams->getTargetOutputLayerSetIdx() ), m_layerId ), i) + 1, i); 518 } 519 520 // The value of sps_max_dec_pic_buffering_minus1[ i ] shall be less than or equal to vps_max_dec_pic_buffering_minus1[ i ] for each value of i. 521 assert( sps->getMaxDecPicBuffering(i) <= vps->getMaxDecPicBuffering(i) ); 522 } 523 524 UInt layerIdx = vps->getLayerIdxInVps( m_layerId ); 525 526 if( vps->getBaseLayerPSCompatibilityFlag(layerIdx) ) 527 { 528 const RepFormat* repFormat = vps->getVpsRepFormat(vps->getVpsRepFormatIdx(layerIdx)); 529 530 assert( pps->getLayerId() == 0 ); 531 assert( sps->getLayerId() == 0 ); 532 assert( repFormat->getChromaFormatVpsIdc() == sps->getChromaFormatIdc() ); 533 assert( repFormat->getSeparateColourPlaneVpsFlag() == 0 ); 534 assert( repFormat->getPicHeightVpsInLumaSamples() == sps->getPicHeightInLumaSamples() ); 535 assert( repFormat->getPicWidthVpsInLumaSamples() == sps->getPicWidthInLumaSamples() ); 536 assert( repFormat->getBitDepthVpsLuma() == sps->getBitDepth(CHANNEL_TYPE_LUMA) ); 537 assert( repFormat->getBitDepthVpsChroma() == sps->getBitDepth(CHANNEL_TYPE_CHROMA) ); 538 assert( repFormat->getConformanceWindowVps().getWindowLeftOffset() == sps->getConformanceWindow().getWindowLeftOffset() ); 539 assert( repFormat->getConformanceWindowVps().getWindowRightOffset() == sps->getConformanceWindow().getWindowRightOffset() ); 540 assert( repFormat->getConformanceWindowVps().getWindowTopOffset() == sps->getConformanceWindow().getWindowTopOffset() ); 541 assert( repFormat->getConformanceWindowVps().getWindowBottomOffset() == sps->getConformanceWindow().getWindowBottomOffset() ); 542 } 543 } 544 545 //Conformance checking for rep format -- rep format of current picture of current layer shall never be greater rep format defined in VPS for the current layer 546 UInt layerIdx = vps->getLayerIdxInVps(m_apcSlicePilot->getLayerId()); 547 548 if ( vps->getVpsExtensionFlag() == 1 && (m_apcSlicePilot->getLayerId() == 0 || sps->getV1CompatibleSPSFlag() == 1) ) 549 { 550 assert( sps->getPicWidthInLumaSamples() <= vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerIdx) )->getPicWidthVpsInLumaSamples() ); 551 assert( sps->getPicHeightInLumaSamples() <= vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerIdx) )->getPicHeightVpsInLumaSamples() ); 552 assert( sps->getChromaFormatIdc() <= vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerIdx) )->getChromaFormatVpsIdc() ); 553 assert( sps->getBitDepth(CHANNEL_TYPE_LUMA) <= vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerIdx) )->getBitDepthVpsLuma() ); 554 assert( sps->getBitDepth(CHANNEL_TYPE_CHROMA) <= vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerIdx) )->getBitDepthVpsChroma() ); 555 } 556 else if ( vps->getVpsExtensionFlag() == 1 ) 557 { 558 assert( vps->getVpsRepFormat( sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : vps->getVpsRepFormatIdx(layerIdx))->getPicWidthVpsInLumaSamples() <= vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerIdx))->getPicWidthVpsInLumaSamples()); 559 assert( vps->getVpsRepFormat( sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : vps->getVpsRepFormatIdx(layerIdx))->getPicHeightVpsInLumaSamples() <= vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerIdx))->getPicHeightVpsInLumaSamples()); 560 assert( vps->getVpsRepFormat( sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : vps->getVpsRepFormatIdx(layerIdx))->getChromaFormatVpsIdc() <= vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerIdx))->getChromaFormatVpsIdc()); 561 assert( vps->getVpsRepFormat( sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : vps->getVpsRepFormatIdx(layerIdx))->getBitDepthVpsLuma() <= vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerIdx))->getBitDepthVpsLuma()); 562 assert( vps->getVpsRepFormat( sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : vps->getVpsRepFormatIdx(layerIdx))->getBitDepthVpsChroma() <= vps->getVpsRepFormat( vps->getVpsRepFormatIdx(layerIdx))->getBitDepthVpsChroma()); 563 } 564 #endif //SVC_EXTENSION 565 566 // TODO: remove the use of the following globals: 567 for (UInt channel = 0; channel < MAX_NUM_CHANNEL_TYPE; channel++) 568 { 569 #if SVC_EXTENSION 570 g_bitDepth[channel] = isLuma(ChannelType(channel)) ? vps->getBitDepthY(sps, m_apcSlicePilot->getLayerId()) : vps->getBitDepthC(sps, m_apcSlicePilot->getLayerId()); 540 571 #else 541 pBLPic->create( repFormat->getPicWidthVpsInLumaSamples(), repFormat->getPicHeightVpsInLumaSamples(), activeSPS->getMaxCUWidth(), activeSPS->getMaxCUHeight(), activeSPS->getMaxCUDepth(), repFormat->getConformanceWindowVps(), defaultDisplayWindow, numReorderPics, NULL, true); 542 #endif 543 // it is needed where the VPS is accessed through the slice 544 pBLPic->getSlice(0)->setVPS( activeVPS ); 545 546 g_bitDepthLayer[CHANNEL_TYPE_LUMA][0] = repFormat->getBitDepthVpsLuma(); 547 g_bitDepthLayer[CHANNEL_TYPE_CHROMA][0] = repFormat->getBitDepthVpsChroma(); 548 } 549 } 550 #endif 551 552 if( m_layerId > 0 ) 553 { 554 // When not present sps_max_sub_layers_minus1 is inferred to be equal to vps_max_sub_layers_minus1. 555 sps->setMaxTLayers( activeVPS->getMaxTLayers() ); 556 557 // When not present sps_temporal_id_nesting_flag is inferred to be equal to vps_temporal_id_nesting_flag 558 sps->setTemporalIdNestingFlag( (sps->getMaxTLayers() > 1) ? activeVPS->getTemporalNestingFlag() : true ); 559 560 // When sps_max_dec_pic_buffering_minus1[ i ] is not present for i in the range of 0 to sps_max_sub_layers_minus1, inclusive, due to nuh_layer_id being greater than 0, 561 // it is inferred to be equal to max_vps_dec_pic_buffering_minus1[ TargetOptLayerSetIdx ][ currLayerId ][ i ] of the active VPS, where currLayerId is the nuh_layer_id of the layer that refers to the SPS. 562 for(UInt i=0; i < sps->getMaxTLayers(); i++) 563 { 564 // to avoid compiler warning "array subscript is above array bounds" 565 assert( i < MAX_TLAYER ); 566 567 // When sps_max_dec_pic_buffering_minus1[ i ] is not present for i in the range of 0 to sps_max_sub_layers_minus1, inclusive, 568 // due to MultiLayerExtSpsFlag being equal to 1, for a layer that refers to the SPS and has nuh_layer_id equal to currLayerId, 569 // the value of sps_max_dec_pic_buffering_minus1[ i ] is inferred to be equal to max_vps_dec_pic_buffering_minus1[ TargetOlsIdx ][ layerIdx ][ i ] of the active VPS, 570 // where layerIdx is equal to the value such that LayerSetLayerIdList[ TargetDecLayerSetIdx ][ layerIdx ] is equal to currLayerId. 571 if( sps->getMultiLayerExtSpsFlag() ) 572 { 573 sps->setMaxDecPicBuffering( activeVPS->getMaxVpsDecPicBufferingMinus1( m_commonDecoderParams->getTargetOutputLayerSetIdx(), activeVPS->getLayerIdcForOls( activeVPS->getOutputLayerSetIdx( m_commonDecoderParams->getTargetOutputLayerSetIdx() ), m_layerId ), i) + 1, i); 574 } 575 576 // The value of sps_max_dec_pic_buffering_minus1[ i ] shall be less than or equal to vps_max_dec_pic_buffering_minus1[ i ] for each value of i. 577 assert( sps->getMaxDecPicBuffering(i) <= activeVPS->getMaxDecPicBuffering(i) ); 578 } 579 580 UInt layerIdx = activeVPS->getLayerIdxInVps( m_layerId ); 581 582 if( activeVPS->getBaseLayerPSCompatibilityFlag(layerIdx) ) 583 { 584 RepFormat* repFormat = activeVPS->getVpsRepFormat(activeVPS->getVpsRepFormatIdx(layerIdx)); 585 586 assert( pps->getLayerId() == 0 ); 587 assert( sps->getLayerId() == 0 ); 588 assert( repFormat->getChromaFormatVpsIdc() == sps->getChromaFormatIdc() ); 589 assert( repFormat->getSeparateColourPlaneVpsFlag() == 0 ); 590 assert( repFormat->getPicHeightVpsInLumaSamples() == sps->getPicHeightInLumaSamples() ); 591 assert( repFormat->getPicWidthVpsInLumaSamples() == sps->getPicWidthInLumaSamples() ); 592 assert( repFormat->getBitDepthVpsLuma() == sps->getBitDepth(CHANNEL_TYPE_LUMA) ); 593 assert( repFormat->getBitDepthVpsChroma() == sps->getBitDepth(CHANNEL_TYPE_CHROMA) ); 594 assert( repFormat->getConformanceWindowVps().getWindowLeftOffset() == sps->getConformanceWindow().getWindowLeftOffset() ); 595 assert( repFormat->getConformanceWindowVps().getWindowRightOffset() == sps->getConformanceWindow().getWindowRightOffset() ); 596 assert( repFormat->getConformanceWindowVps().getWindowTopOffset() == sps->getConformanceWindow().getWindowTopOffset() ); 597 assert( repFormat->getConformanceWindowVps().getWindowBottomOffset() == sps->getConformanceWindow().getWindowBottomOffset() ); 598 } 599 } 600 601 //Conformance checking for rep format -- rep format of current picture of current layer shall never be greater rep format defined in VPS for the current layer 602 UInt layerIdx = activeVPS->getLayerIdxInVps(m_apcSlicePilot->getLayerId()); 603 604 if ( activeVPS->getVpsExtensionFlag() == 1 && (m_apcSlicePilot->getLayerId() == 0 || sps->getV1CompatibleSPSFlag() == 1) ) 605 { 606 assert( sps->getPicWidthInLumaSamples() <= activeVPS->getVpsRepFormat( activeVPS->getVpsRepFormatIdx(layerIdx) )->getPicWidthVpsInLumaSamples() ); 607 assert( sps->getPicHeightInLumaSamples() <= activeVPS->getVpsRepFormat( activeVPS->getVpsRepFormatIdx(layerIdx) )->getPicHeightVpsInLumaSamples() ); 608 assert( sps->getChromaFormatIdc() <= activeVPS->getVpsRepFormat( activeVPS->getVpsRepFormatIdx(layerIdx) )->getChromaFormatVpsIdc() ); 609 assert( sps->getBitDepth(CHANNEL_TYPE_LUMA) <= activeVPS->getVpsRepFormat( activeVPS->getVpsRepFormatIdx(layerIdx) )->getBitDepthVpsLuma() ); 610 assert( sps->getBitDepth(CHANNEL_TYPE_CHROMA) <= activeVPS->getVpsRepFormat( activeVPS->getVpsRepFormatIdx(layerIdx) )->getBitDepthVpsChroma() ); 611 } 612 else if ( activeVPS->getVpsExtensionFlag() == 1 ) 613 { 614 assert( activeVPS->getVpsRepFormat( sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : activeVPS->getVpsRepFormatIdx(layerIdx))->getPicWidthVpsInLumaSamples() <= activeVPS->getVpsRepFormat( activeVPS->getVpsRepFormatIdx(layerIdx))->getPicWidthVpsInLumaSamples()); 615 assert( activeVPS->getVpsRepFormat( sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : activeVPS->getVpsRepFormatIdx(layerIdx))->getPicHeightVpsInLumaSamples() <= activeVPS->getVpsRepFormat( activeVPS->getVpsRepFormatIdx(layerIdx))->getPicHeightVpsInLumaSamples()); 616 assert( activeVPS->getVpsRepFormat( sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : activeVPS->getVpsRepFormatIdx(layerIdx))->getChromaFormatVpsIdc() <= activeVPS->getVpsRepFormat( activeVPS->getVpsRepFormatIdx(layerIdx))->getChromaFormatVpsIdc()); 617 assert( activeVPS->getVpsRepFormat( sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : activeVPS->getVpsRepFormatIdx(layerIdx))->getBitDepthVpsLuma() <= activeVPS->getVpsRepFormat( activeVPS->getVpsRepFormatIdx(layerIdx))->getBitDepthVpsLuma()); 618 assert( activeVPS->getVpsRepFormat( sps->getUpdateRepFormatFlag() ? sps->getUpdateRepFormatIndex() : activeVPS->getVpsRepFormatIdx(layerIdx))->getBitDepthVpsChroma() <= activeVPS->getVpsRepFormat( activeVPS->getVpsRepFormatIdx(layerIdx))->getBitDepthVpsChroma()); 619 } 620 #endif //SVC_EXTENSION 621 622 m_apcSlicePilot->setPPS(pps); 623 m_apcSlicePilot->setSPS(sps); 624 pps->setSPS(sps); 625 pps->setNumSubstreams(pps->getEntropyCodingSyncEnabledFlag() ? ((sps->getPicHeightInLumaSamples() + sps->getMaxCUHeight() - 1) / sps->getMaxCUHeight()) * (pps->getNumTileColumnsMinus1() + 1) : ((pps->getNumTileRowsMinus1() + 1)*(pps->getNumTileColumnsMinus1() + 1))); 626 pps->setMinCuDQPSize( sps->getMaxCUWidth() >> ( pps->getMaxCuDQPDepth()) ); 627 pps->setMinCuChromaQpAdjSize( sps->getMaxCUWidth() >> ( pps->getMaxCuChromaQpAdjDepth()) ); 628 629 for (UInt channel = 0; channel < MAX_NUM_CHANNEL_TYPE; channel++) 630 { 631 #if SVC_EXTENSION 632 g_bitDepth[channel] = isLuma(ChannelType(channel)) ? m_apcSlicePilot->getBitDepthY() : m_apcSlicePilot->getBitDepthC(); 572 g_bitDepth[channel] = sps->getBitDepth(ChannelType(channel)); 573 #endif 574 g_maxTrDynamicRange[channel] = (sps->getUseExtendedPrecision()) ? std::max<Int>(15, (g_bitDepth[channel] + 6)) : 15; 575 } 576 g_uiMaxCUWidth = sps->getMaxCUWidth(); 577 g_uiMaxCUHeight = sps->getMaxCUHeight(); 578 g_uiMaxCUDepth = sps->getMaxCUDepth(); 579 #if SVC_EXTENSION 580 g_uiAddCUDepth = max (0, sps->getLog2MinCodingBlockSize() - (Int)sps->getQuadtreeTULog2MinSize() + (Int)getMaxCUDepthOffset(vps->getChromaFormatIdc(sps, m_apcSlicePilot->getLayerId()), sps->getQuadtreeTULog2MinSize())); 633 581 #else 634 g_bitDepth[channel] = sps->getBitDepth(ChannelType(channel)); 635 #endif 636 637 if (sps->getUseExtendedPrecision()) g_maxTrDynamicRange[channel] = std::max<Int>(15, (g_bitDepth[channel] + 6)); 638 else g_maxTrDynamicRange[channel] = 15; 639 } 640 g_uiMaxCUWidth = sps->getMaxCUWidth(); 641 g_uiMaxCUHeight = sps->getMaxCUHeight(); 642 g_uiMaxCUDepth = sps->getMaxCUDepth(); 643 g_uiAddCUDepth = max (0, sps->getLog2MinCodingBlockSize() - (Int)sps->getQuadtreeTULog2MinSize() + (Int)getMaxCUDepthOffset(sps->getChromaFormatIdc(), sps->getQuadtreeTULog2MinSize())); 644 645 for (Int i = 0; i < sps->getLog2DiffMaxMinCodingBlockSize(); i++) 646 { 647 sps->setAMPAcc( i, sps->getUseAMP() ); 648 } 649 650 for (Int i = sps->getLog2DiffMaxMinCodingBlockSize(); i < sps->getMaxCUDepth(); i++) 651 { 652 sps->setAMPAcc( i, 0 ); 653 } 654 655 m_cSAO.destroy(); 656 #if SVC_EXTENSION 657 m_cSAO.create( m_apcSlicePilot->getPicWidthInLumaSamples(), m_apcSlicePilot->getPicHeightInLumaSamples(), sps->getChromaFormatIdc(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxCUDepth(), pps->getSaoOffsetBitShift(CHANNEL_TYPE_LUMA), pps->getSaoOffsetBitShift(CHANNEL_TYPE_CHROMA) ); 582 g_uiAddCUDepth = max (0, sps->getLog2MinCodingBlockSize() - (Int)sps->getQuadtreeTULog2MinSize() + (Int)getMaxCUDepthOffset(sps->getChromaFormatIdc(), sps->getQuadtreeTULog2MinSize())); 583 #endif 584 585 // Get a new picture buffer. This will also set up m_pcPic, and therefore give us a SPS and PPS pointer that we can use. 586 #if SVC_EXTENSION 587 xGetNewPicBuffer( *(vps), *(sps), *(pps), m_pcPic, m_apcSlicePilot->getTLayer() ); 658 588 #else 659 m_cSAO.create( sps->getPicWidthInLumaSamples(), sps->getPicHeightInLumaSamples(), sps->getChromaFormatIdc(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxCUDepth(), pps->getSaoOffsetBitShift(CHANNEL_TYPE_LUMA), pps->getSaoOffsetBitShift(CHANNEL_TYPE_CHROMA) ); 660 #endif 661 m_cLoopFilter.create( sps->getMaxCUDepth() ); 589 xGetNewPicBuffer (*(sps), *(pps), m_pcPic, m_apcSlicePilot->getTLayer()); 590 #endif 591 592 #if ALIGNED_BUMPING 593 m_apcSlicePilot->checkLeadingPictureRestrictions(m_cListPic); 594 #else 595 m_apcSlicePilot->applyReferencePictureSet(m_cListPic, m_apcSlicePilot->getRPS()); 596 #endif 597 598 // make the slice-pilot a real slice, and set up the slice-pilot for the next slice 599 assert(m_pcPic->getNumAllocatedSlice() == (m_uiSliceIdx + 1)); 600 m_apcSlicePilot = m_pcPic->getPicSym()->swapSliceObject(m_apcSlicePilot, m_uiSliceIdx); 601 602 // we now have a real slice: 603 TComSlice *pSlice = m_pcPic->getSlice(m_uiSliceIdx); 604 605 // Update the PPS and SPS pointers with the ones of the picture. 606 pps=pSlice->getPPS(); 607 sps=pSlice->getSPS(); 608 609 // Initialise the various objects for the new set of settings 610 #if SVC_EXTENSION 611 m_cSAO.create( pSlice->getPicWidthInLumaSamples(), pSlice->getPicHeightInLumaSamples(), pSlice->getChromaFormatIdc(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxCUDepth(), pps->getSaoOffsetBitShift(CHANNEL_TYPE_LUMA), pps->getSaoOffsetBitShift(CHANNEL_TYPE_CHROMA) ); 612 #else 613 m_cSAO.create( sps->getPicWidthInLumaSamples(), sps->getPicHeightInLumaSamples(), sps->getChromaFormatIdc(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxCUDepth(), pps->getSaoOffsetBitShift(CHANNEL_TYPE_LUMA), pps->getSaoOffsetBitShift(CHANNEL_TYPE_CHROMA) ); 614 #endif 615 m_cLoopFilter.create( sps->getMaxCUDepth() ); 616 m_cPrediction.initTempBuff(sps->getChromaFormatIdc()); 617 618 Bool isField = false; 619 Bool isTopField = false; 620 621 if(!m_SEIs.empty()) 622 { 623 // Check if any new Picture Timing SEI has arrived 624 SEIMessages pictureTimingSEIs = extractSeisByType (m_SEIs, SEI::PICTURE_TIMING); 625 if (pictureTimingSEIs.size()>0) 626 { 627 SEIPictureTiming* pictureTiming = (SEIPictureTiming*) *(pictureTimingSEIs.begin()); 628 isField = (pictureTiming->m_picStruct == 1) || (pictureTiming->m_picStruct == 2) || (pictureTiming->m_picStruct == 9) || (pictureTiming->m_picStruct == 10) || (pictureTiming->m_picStruct == 11) || (pictureTiming->m_picStruct == 12); 629 isTopField = (pictureTiming->m_picStruct == 1) || (pictureTiming->m_picStruct == 9) || (pictureTiming->m_picStruct == 11); 630 } 631 632 #if Q0189_TMVP_CONSTRAINTS 633 // Check if any new temporal motion vector prediction constraints SEI has arrived 634 SEIMessages seiTMVPConstrainsList = extractSeisByType (m_SEIs, SEI::TMVP_CONSTRAINTS); 635 if (seiTMVPConstrainsList.size() > 0) 636 { 637 assert ( m_pcPic->getTLayer() == 0 ); //this SEI can present only for AU with Tid equal to 0 638 SEITMVPConstrains* tmvpConstraintSEI = (SEITMVPConstrains*) *(seiTMVPConstrainsList.begin()); 639 if ( tmvpConstraintSEI->prev_pics_not_used_flag == 1 ) 640 { 641 //update all pics in the DPB such that they cannot be used for TMPV ref 642 TComList<TComPic*>::iterator iterRefPic = m_cListPic.begin(); 643 while( iterRefPic != m_cListPic.end() ) 644 { 645 TComPic *refPic = *iterRefPic; 646 if( ( refPic->getLayerId() == m_pcPic->getLayerId() ) && refPic->getReconMark() ) 647 { 648 for(Int i = refPic->getNumAllocatedSlice()-1; i >= 0; i--) 649 { 650 TComSlice *refSlice = refPic->getSlice(i); 651 refSlice->setAvailableForTMVPRefFlag( false ); 652 } 653 } 654 iterRefPic++; 655 } 656 } 657 } 658 #endif 659 } 660 661 //Set Field/Frame coding mode 662 m_pcPic->setField(isField); 663 m_pcPic->setTopField(isTopField); 664 665 // transfer any SEI messages that have been received to the picture 666 m_pcPic->setSEIs(m_SEIs); 667 m_SEIs.clear(); 668 669 // Recursive structure 670 #if SVC_EXTENSION 671 m_cCuDecoder.create ( sps->getMaxCUDepth(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), pSlice->getChromaFormatIdc() ); 672 m_cCuDecoder.init ( m_ppcTDecTop, &m_cEntropyDecoder, &m_cTrQuant, &m_cPrediction, m_layerId ); 673 #else 674 m_cCuDecoder.create ( sps->getMaxCUDepth(), sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getChromaFormatIdc() ); 675 m_cCuDecoder.init ( &m_cEntropyDecoder, &m_cTrQuant, &m_cPrediction ); 676 #endif 677 m_cTrQuant.init ( sps->getMaxCUWidth(), sps->getMaxCUHeight(), sps->getMaxTrSize()); 678 679 m_cSliceDecoder.create(); 680 } 681 else 682 { 683 // make the slice-pilot a real slice, and set up the slice-pilot for the next slice 684 m_pcPic->allocateNewSlice(); 685 assert(m_pcPic->getNumAllocatedSlice() == (m_uiSliceIdx + 1)); 686 m_apcSlicePilot = m_pcPic->getPicSym()->swapSliceObject(m_apcSlicePilot, m_uiSliceIdx); 687 688 TComSlice *pSlice = m_pcPic->getSlice(m_uiSliceIdx); // we now have a real slice. 689 690 const TComSPS *sps = pSlice->getSPS(); 691 const TComPPS *pps = pSlice->getPPS(); 692 693 // check that the current active PPS has not changed... 694 if (m_parameterSetManager.getSPSChangedFlag(sps->getSPSId()) ) 695 { 696 printf("Error - a new SPS has been decoded while processing a picture\n"); 697 exit(1); 698 } 699 if (m_parameterSetManager.getPPSChangedFlag(pps->getPPSId()) ) 700 { 701 printf("Error - a new PPS has been decoded while processing a picture\n"); 702 exit(1); 703 } 704 705 // Check if any new SEI has arrived 706 if(!m_SEIs.empty()) 707 { 708 // Currently only decoding Unit SEI message occurring between VCL NALUs copied 709 SEIMessages &picSEI = m_pcPic->getSEIs(); 710 SEIMessages decodingUnitInfos = extractSeisByType (m_SEIs, SEI::DECODING_UNIT_INFO); 711 picSEI.insert(picSEI.end(), decodingUnitInfos.begin(), decodingUnitInfos.end()); 712 deleteSEIs(m_SEIs); 713 } 714 } 715 662 716 } 663 717 … … 669 723 { 670 724 #if SVC_EXTENSION 671 m_apcSlicePilot->setVPS( m_parameterSetManagerDecoder.getPrefetchedVPS(0) );672 673 // Following check should go wherever the VPS is activated674 if( !m_apcSlicePilot->getVPS()->getBaseLayerAvailableFlag() )675 {676 assert(nalu.m_layerId != 0);677 assert(m_apcSlicePilot->getVPS()->getNumAddLayerSets() > 0);678 679 if( m_commonDecoderParams->getTargetOutputLayerSetIdx() >= 0 )680 {681 UInt layerIdx = m_apcSlicePilot->getVPS()->getOutputLayerSetIdx(getCommonDecoderParams()->getTargetOutputLayerSetIdx());682 assert(layerIdx > m_apcSlicePilot->getVPS()->getVpsNumLayerSetsMinus1());683 }684 }685 686 725 m_apcSlicePilot->initSlice( nalu.m_layerId ); 726 m_apcSlicePilot->setTLayer( nalu.m_temporalId ); 687 727 #else //SVC_EXTENSION 688 m_apcSlicePilot->initSlice(); 728 m_apcSlicePilot->initSlice(); // the slice pilot is an object to prepare for a new slice 729 // it is not associated with picture, sps or pps structures. 689 730 #endif 690 731 … … 700 741 701 742 m_apcSlicePilot->setNalUnitType(nalu.m_nalUnitType); 702 #if SVC_EXTENSION 703 m_apcSlicePilot->setTLayer( nalu.m_temporalId ); 704 #endif 743 705 744 Bool nonReferenceFlag = (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_TRAIL_N || 706 745 m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_TSA_N || … … 716 755 #endif 717 756 718 #if SVC_EXTENSION 719 setRefLayerParams(m_apcSlicePilot->getVPS()); 757 m_cEntropyDecoder.decodeSliceHeader (m_apcSlicePilot, &m_parameterSetManager); 758 759 #if SVC_EXTENSION 760 const TComPPS *pps = m_parameterSetManager.getPPS(m_apcSlicePilot->getPPSId()); 761 assert (pps != 0); 762 const TComSPS *sps = m_parameterSetManager.getSPS(pps->getSPSId()); 763 assert (sps != 0); 764 const TComVPS *vps = m_parameterSetManager.getVPS(sps->getVPSId()); 765 assert (vps != 0); 766 767 // Following check should go wherever the VPS is activated 768 if( !vps->getBaseLayerAvailableFlag() ) 769 { 770 assert( nalu.m_layerId != 0 ); 771 assert( vps->getNumAddLayerSets() > 0 ); 772 773 if( m_commonDecoderParams->getTargetOutputLayerSetIdx() >= 0 ) 774 { 775 UInt layerIdx = vps->getOutputLayerSetIdx( getCommonDecoderParams()->getTargetOutputLayerSetIdx() ); 776 assert( layerIdx > vps->getVpsNumLayerSetsMinus1() ); 777 } 778 } 779 780 setRefLayerParams(vps); 720 781 m_apcSlicePilot->setNumMotionPredRefLayers(m_numMotionPredRefLayers); 721 782 #endif 722 m_cEntropyDecoder.decodeSliceHeader (m_apcSlicePilot, &m_parameterSetManagerDecoder);723 783 724 784 // set POC for dependent slices in skipped pictures … … 779 839 if (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA && m_craNoRaslOutputFlag) //Reset POC MSB when CRA has NoRaslOutputFlag equal to 1 780 840 { 781 Int iMaxPOClsb = 1 << m_apcSlicePilot->getSPS()->getBitsForPOC(); 841 #if !SVC_EXTENSION 842 TComPPS *pps = m_parameterSetManager.getPPS(m_apcSlicePilot->getPPSId()); 843 assert (pps != 0); 844 TComSPS *sps = m_parameterSetManager.getSPS(pps->getSPSId()); 845 assert (sps != 0); 846 #endif 847 Int iMaxPOClsb = 1 << sps->getBitsForPOC(); 782 848 m_apcSlicePilot->setPOC( m_apcSlicePilot->getPOC() & (iMaxPOClsb - 1) ); 783 849 } … … 892 958 if( m_apcSlicePilot->getPocResetIdc() != 0 ) 893 959 { 894 if( m_apcSlicePilot->getVPS()->getVpsPocLsbAlignedFlag() )960 if( vps->getVpsPocLsbAlignedFlag() ) 895 961 { 896 962 m_pocResettingFlag = true; … … 956 1022 numAffectedLayers = 1; 957 1023 958 if( m_apcSlicePilot->getVPS()->getVpsPocLsbAlignedFlag() )959 { 960 for( UInt j = 0; j < m_apcSlicePilot->getVPS()->getNumPredictedLayers(m_apcSlicePilot->getLayerId()); j++ )961 { 962 affectedLayerList[j + 1] = m_apcSlicePilot->getVPS()->getPredictedLayerId(m_apcSlicePilot->getLayerId(), j);963 } 964 numAffectedLayers = m_apcSlicePilot->getVPS()->getNumPredictedLayers(m_apcSlicePilot->getLayerId()) + 1;1024 if( vps->getVpsPocLsbAlignedFlag() ) 1025 { 1026 for( UInt j = 0; j < vps->getNumPredictedLayers(m_apcSlicePilot->getLayerId()); j++ ) 1027 { 1028 affectedLayerList[j + 1] = vps->getPredictedLayerId(m_apcSlicePilot->getLayerId(), j); 1029 } 1030 numAffectedLayers = vps->getNumPredictedLayers(m_apcSlicePilot->getLayerId()) + 1; 965 1031 } 966 1032 … … 1167 1233 m_apcSlicePilot->setAvailableForTMVPRefFlag( true ); 1168 1234 1169 // actual decoding starts here1170 xActivateParameterSets();1171 1172 1235 // Initialize ILRP if needed, only for the current layer 1173 1236 // ILRP intialization should go along with activation of parameters sets, … … 1175 1238 xInitILRP(m_apcSlicePilot); 1176 1239 1177 if (!m_apcSlicePilot->getDependentSliceSegmentFlag())1178 {1179 m_prevPOC = m_apcSlicePilot->getPOC();1180 curLayerId = m_layerId;1181 m_uiPrevLayerId = m_layerId;1182 }1183 m_bFirstSliceInSequence = false;1184 m_bFirstSliceInBitstream = false;1185 1186 1240 #else //SVC_EXTENSION 1187 1241 //we should only get a different poc for a new picture (with CTU address==0) … … 1205 1259 m_prevPOC = m_apcSlicePilot->getPOC(); 1206 1260 } 1261 #endif //SVC_EXTENSION 1262 1263 //detect lost reference picture and insert copy of earlier frame. 1264 { 1265 Int lostPoc; 1266 while((lostPoc=m_apcSlicePilot->checkThatAllRefPicsAreAvailable(m_cListPic, m_apcSlicePilot->getRPS(), true, m_pocRandomAccess)) > 0) 1267 { 1268 xCreateLostPicture(lostPoc-1); 1269 } 1270 } 1271 1272 if (!m_apcSlicePilot->getDependentSliceSegmentFlag()) 1273 { 1274 m_prevPOC = m_apcSlicePilot->getPOC(); 1275 #if SVC_EXTENSION 1276 curLayerId = m_layerId; 1277 m_uiPrevLayerId = m_layerId; 1278 #endif 1279 } 1207 1280 1208 1281 // actual decoding starts here 1209 1282 xActivateParameterSets(); 1210 1283 1211 if (!m_apcSlicePilot->getDependentSliceSegmentFlag())1212 {1213 m_prevPOC = m_apcSlicePilot->getPOC();1214 }1215 1284 m_bFirstSliceInSequence = false; 1216 1285 m_bFirstSliceInBitstream = false; 1217 #endif //SVC_EXTENSION 1218 1219 //detect lost reference picture and insert copy of earlier frame. 1220 Int lostPoc; 1221 while((lostPoc=m_apcSlicePilot->checkThatAllRefPicsAreAvailable(m_cListPic, m_apcSlicePilot->getRPS(), true, m_pocRandomAccess)) > 0) 1222 { 1223 xCreateLostPicture(lostPoc-1); 1224 } 1286 1287 TComSlice* pcSlice = m_pcPic->getPicSym()->getSlice(m_uiSliceIdx); 1288 1289 #if SVC_EXTENSION 1225 1290 if (m_bFirstSliceInPicture) 1226 1291 { 1227 #if SVC_EXTENSION1228 1292 #if AVC_BASE 1229 if( m_layerId > 0 && m_parameterSetManagerDecoder.getPrefetchedVPS(0)->getNonHEVCBaseLayerFlag() )1293 if( m_layerId > 0 && vps->getNonHEVCBaseLayerFlag() ) 1230 1294 { 1231 1295 TComPic* pBLPic = (*m_ppcTDecTop[0]->getListPic()->begin()); … … 1336 1400 if ( m_layerId == 0 && m_apcSlicePilot->getRapPicFlag() && getNoClrasOutputFlag() ) 1337 1401 { 1338 for (UInt i = 0; i < m_apcSlicePilot->getVPS()->getMaxLayers(); i++)1402 for (UInt i = 0; i < vps->getMaxLayers(); i++) 1339 1403 { 1340 1404 m_ppcTDecTop[i]->setLayerInitializedFlag(false); … … 1345 1409 xCheckLayerReset(); 1346 1410 xSetLayerInitializedFlag(); 1347 #endif 1348 1349 // Buffer initialize for prediction. 1350 m_cPrediction.initTempBuff(m_apcSlicePilot->getSPS()->getChromaFormatIdc()); 1351 #if ALIGNED_BUMPING 1352 m_apcSlicePilot->checkLeadingPictureRestrictions(m_cListPic); 1353 #else 1354 m_apcSlicePilot->applyReferencePictureSet(m_cListPic, m_apcSlicePilot->getRPS()); 1355 #endif 1356 // Get a new picture buffer 1357 xGetNewPicBuffer (m_apcSlicePilot, m_pcPic); 1358 1411 1359 1412 #if SVC_POC 1360 1413 m_pcPic->setCurrAuFlag( true ); … … 1399 1452 else 1400 1453 { 1401 if( m_apcSlicePilot->getVPS()->getBaseLayerInternalFlag())1454 if( vps->getBaseLayerInternalFlag()) 1402 1455 { 1403 1456 /* When the picture with nuh_layer_id equal to 0 in an access unit is not an IDR picture … … 1417 1470 and there is at least one other picture in the same access unit that is not an IRAP picture, 1418 1471 the value of poc_reset_idc shall be equal to 1 or 2 for all pictures in the access unit. */ 1419 if( m_baseLayerPicPresentFlag && m_baseLayerIrapFlag && !m_apcSlicePilot->isIRAP() && m_apcSlicePilot->getVPS()->getBaseLayerInternalFlag() )1472 if( m_baseLayerPicPresentFlag && m_baseLayerIrapFlag && !m_apcSlicePilot->isIRAP() && vps->getBaseLayerInternalFlag() ) 1420 1473 { 1421 1474 assert( m_apcSlicePilot->getPocResetIdc() == 1 || m_apcSlicePilot->getPocResetIdc() == 2 ); … … 1425 1478 vps_base_layer_internal_flag is equal to 1 and there is at least one non-IDR picture in the same access unit, 1426 1479 the value of poc_reset_idc shall be equal to 2 for all pictures in the access unit. */ 1427 if( m_baseLayerPicPresentFlag && m_baseLayerIdrFlag && !m_apcSlicePilot->isIDR() && m_apcSlicePilot->getVPS()->getBaseLayerInternalFlag() )1480 if( m_baseLayerPicPresentFlag && m_baseLayerIdrFlag && !m_apcSlicePilot->isIDR() && vps->getBaseLayerInternalFlag() ) 1428 1481 { 1429 1482 assert( m_apcSlicePilot->getPocResetIdc() == 2 ); … … 1443 1496 } 1444 1497 #endif 1445 1446 Bool isField = false; 1447 Bool isTopField = false; 1448 1449 if(!m_SEIs.empty()) 1450 { 1451 // Check if any new Picture Timing SEI has arrived 1452 SEIMessages pictureTimingSEIs = extractSeisByType (m_SEIs, SEI::PICTURE_TIMING); 1453 if (pictureTimingSEIs.size()>0) 1454 { 1455 SEIPictureTiming* pictureTiming = (SEIPictureTiming*) *(pictureTimingSEIs.begin()); 1456 isField = (pictureTiming->m_picStruct == 1) || (pictureTiming->m_picStruct == 2) || (pictureTiming->m_picStruct == 9) || (pictureTiming->m_picStruct == 10) || (pictureTiming->m_picStruct == 11) || (pictureTiming->m_picStruct == 12); 1457 isTopField = (pictureTiming->m_picStruct == 1) || (pictureTiming->m_picStruct == 9) || (pictureTiming->m_picStruct == 11); 1458 } 1459 1460 #if Q0189_TMVP_CONSTRAINTS 1461 // Check if any new temporal motion vector prediction constraints SEI has arrived 1462 SEIMessages seiTMVPConstrainsList = extractSeisByType (m_SEIs, SEI::TMVP_CONSTRAINTS); 1463 if (seiTMVPConstrainsList.size() > 0) 1464 { 1465 assert ( m_pcPic->getTLayer() == 0 ); //this SEI can present only for AU with Tid equal to 0 1466 SEITMVPConstrains* tmvpConstraintSEI = (SEITMVPConstrains*) *(seiTMVPConstrainsList.begin()); 1467 if ( tmvpConstraintSEI->prev_pics_not_used_flag == 1 ) 1468 { 1469 //update all pics in the DPB such that they cannot be used for TMPV ref 1470 TComList<TComPic*>::iterator iterRefPic = m_cListPic.begin(); 1471 while( iterRefPic != m_cListPic.end() ) 1472 { 1473 TComPic *refPic = *iterRefPic; 1474 if( ( refPic->getLayerId() == m_pcPic->getLayerId() ) && refPic->getReconMark() ) 1475 { 1476 for(Int i = refPic->getNumAllocatedSlice()-1; i >= 0; i--) 1477 { 1478 TComSlice *refSlice = refPic->getSlice(i); 1479 refSlice->setAvailableForTMVPRefFlag( false ); 1480 } 1481 } 1482 iterRefPic++; 1483 } 1484 } 1485 } 1486 #endif 1487 } 1488 1489 //Set Field/Frame coding mode 1490 m_pcPic->setField(isField); 1491 m_pcPic->setTopField(isTopField); 1492 1493 // transfer any SEI messages that have been received to the picture 1494 m_pcPic->setSEIs(m_SEIs); 1495 m_SEIs.clear(); 1496 1497 // Recursive structure 1498 m_cCuDecoder.create ( g_uiMaxCUDepth, g_uiMaxCUWidth, g_uiMaxCUHeight, m_apcSlicePilot->getSPS()->getChromaFormatIdc() ); 1499 #if SVC_EXTENSION 1500 m_cCuDecoder.init ( m_ppcTDecTop,&m_cEntropyDecoder, &m_cTrQuant, &m_cPrediction, curLayerId ); 1501 #else 1502 m_cCuDecoder.init ( &m_cEntropyDecoder, &m_cTrQuant, &m_cPrediction ); 1503 #endif 1504 m_cTrQuant.init ( g_uiMaxCUWidth, g_uiMaxCUHeight, m_apcSlicePilot->getSPS()->getMaxTrSize()); 1505 1506 m_cSliceDecoder.create(); 1507 } 1508 else 1509 { 1510 // Check if any new SEI has arrived 1511 if(!m_SEIs.empty()) 1512 { 1513 // Currently only decoding Unit SEI message occurring between VCL NALUs copied 1514 SEIMessages &picSEI = m_pcPic->getSEIs(); 1515 SEIMessages decodingUnitInfos = extractSeisByType (m_SEIs, SEI::DECODING_UNIT_INFO); 1516 picSEI.insert(picSEI.end(), decodingUnitInfos.begin(), decodingUnitInfos.end()); 1517 deleteSEIs(m_SEIs); 1518 } 1519 } 1520 1521 // Set picture slice pointer 1522 TComSlice* pcSlice = m_apcSlicePilot; 1523 1524 m_pcPic->getPicSym()->initTiles(pcSlice->getPPS()); 1525 m_pcPic->getPicSym()->initCtuTsRsAddrMaps(); 1526 1498 } 1499 #endif //SVC_EXTENSION 1500 1527 1501 // When decoding the slice header, the stored start and end addresses were actually RS addresses, not TS addresses. 1528 1502 // Now, having set up the maps, convert them to the correct form. … … 1534 1508 pcSlice->setSliceCurEndCtuTsAddr(m_pcPic->getPicSym()->getCtuRsToTsAddrMap(pcSlice->getSliceCurEndCtuTsAddr())); 1535 1509 } 1536 1537 if (m_bFirstSliceInPicture) 1538 { 1539 if(m_pcPic->getNumAllocatedSlice() != 1) 1540 { 1541 m_pcPic->clearSliceBuffer(); 1542 } 1543 } 1544 else 1545 { 1546 m_pcPic->allocateNewSlice(); 1547 } 1548 assert(m_pcPic->getNumAllocatedSlice() == (m_uiSliceIdx + 1)); 1549 m_apcSlicePilot = m_pcPic->getPicSym()->getSlice(m_uiSliceIdx); 1550 m_pcPic->getPicSym()->setSlice(pcSlice, m_uiSliceIdx); 1551 1510 1552 1511 m_pcPic->setTLayer(nalu.m_temporalId); 1553 1512 … … 1577 1536 UInt refLayerId = pcSlice->getVPS()->getRefLayerId(m_layerId, refLayerIdc); 1578 1537 #if AVC_BASE 1579 if( refLayerId == 0 && m_parameterSetManager Decoder.getActiveVPS()->getNonHEVCBaseLayerFlag() )1538 if( refLayerId == 0 && m_parameterSetManager.getActiveVPS()->getNonHEVCBaseLayerFlag() ) 1580 1539 { 1581 1540 TComPic* pic = *m_ppcTDecTop[0]->getListPic()->begin(); … … 1619 1578 1620 1579 // conformance check: when ScaledRefRegionWidthInSamplesY is equal to RefLayerRegionWidthInSamplesY, PhaseHorY shall be equal to 0, when ScaledRefRegionWidthInSamplesC is equal to RefLayerRegionWidthInSamplesC, PhaseHorC shall be equal to 0, when ScaledRefRegionHeightInSamplesY is equal to RefLayerRegionHeightInSamplesY, PhaseVerY shall be equal to 0, and when ScaledRefRegionHeightInSamplesC is equal to RefLayerRegionHeightInSamplesC, PhaseVerC shall be equal to 0. 1621 Bool phaseSetPresentFlag; 1622 Int phaseHorLuma, phaseVerLuma, phaseHorChroma, phaseVerChroma; 1623 pcSlice->getPPS()->getResamplingPhase( refLayerId, phaseSetPresentFlag, phaseHorLuma, phaseVerLuma, phaseHorChroma, phaseVerChroma ); 1624 1625 assert( ( (widthEL != widthBL) || (phaseHorLuma == 0 && phaseHorChroma == 0) ) 1626 && ( (heightEL != heightBL) || (phaseVerLuma == 0 && phaseVerChroma == 0) ) ); 1580 const ResamplingPhase &resamplingPhase = pcSlice->getPPS()->getResamplingPhase( refLayerId ); 1581 1582 assert( ( (widthEL != widthBL) || (resamplingPhase.phaseHorLuma == 0 && resamplingPhase.phaseHorChroma == 0) ) 1583 && ( (heightEL != heightBL) || (resamplingPhase.phaseVerLuma == 0 && resamplingPhase.phaseVerChroma == 0) ) ); 1627 1584 1628 1585 g_mvScalingFactor[refLayerIdc][0] = widthEL == widthBL ? 4096 : Clip3(-4096, 4095, ((widthEL << 8) + (widthBL >> 1)) / widthBL); … … 1673 1630 UInt refLayerIdc = pcSlice->getInterLayerPredLayerIdc(i); 1674 1631 #if AVC_BASE 1675 if( pcSlice->getVPS()->getRefLayerId( m_layerId, refLayerIdc ) == 0 && m_parameterSetManagerDecoder.getActiveVPS()->getNonHEVCBaseLayerFlag() )1632 if( pcSlice->getVPS()->getRefLayerId( m_layerId, refLayerIdc ) == 0 && pcSlice->getVPS()->getNonHEVCBaseLayerFlag() ) 1676 1633 { 1677 1634 pcSlice->setBaseColPic ( refLayerIdc, *m_ppcTDecTop[0]->getListPic()->begin() ); … … 1792 1749 if(pcSlice->getSPS()->getScalingListFlag()) 1793 1750 { 1794 pcSlice->setScalingList ( pcSlice->getSPS()->getScalingList() ); 1795 1796 #if SVC_EXTENSION 1797 if( pcSlice->getPPS()->getScalingListPresentFlag() || pcSlice->getPPS()->getInferScalingListFlag() ) 1751 TComScalingList scalingList; 1752 1753 #if SVC_EXTENSION 1754 if( pcSlice->getPPS()->getInferScalingListFlag() ) 1755 { 1756 const TComPPS *refPps = m_ppcTDecTop[pcSlice->getPPS()->getScalingListRefLayerId()]->getParameterSetManager()->getActivePPS(); assert( refPps != NULL ); 1757 scalingList = refPps->getScalingList(); 1758 } 1759 else 1760 #endif 1761 if(pcSlice->getPPS()->getScalingListPresentFlag()) 1762 { 1763 scalingList = pcSlice->getPPS()->getScalingList(); 1764 } 1765 #if SVC_EXTENSION 1766 else if( pcSlice->getSPS()->getInferScalingListFlag() ) 1767 { 1768 const TComSPS *refSps = m_ppcTDecTop[pcSlice->getSPS()->getScalingListRefLayerId()]->getParameterSetManager()->getActiveSPS(); assert( refSps != NULL ); 1769 scalingList = refSps->getScalingList(); 1770 } 1771 #endif 1772 else if (pcSlice->getSPS()->getScalingListPresentFlag()) 1773 { 1774 scalingList = pcSlice->getSPS()->getScalingList(); 1775 } 1776 else 1777 { 1778 scalingList.setDefaultScalingList(); 1779 } 1780 #if SVC_EXTENSION 1781 m_cTrQuant.setScalingListDec(scalingList, pcSlice->getChromaFormatIdc()); 1798 1782 #else 1799 if(pcSlice->getPPS()->getScalingListPresentFlag()) 1800 #endif 1801 { 1802 pcSlice->setScalingList ( pcSlice->getPPS()->getScalingList() ); 1803 } 1804 1805 #if SVC_EXTENSION 1806 if( m_layerId == 0 || ( m_layerId > 0 && !pcSlice->getPPS()->getInferScalingListFlag() && !pcSlice->getSPS()->getInferScalingListFlag() ) ) 1807 #endif 1808 if(!pcSlice->getPPS()->getScalingListPresentFlag() && !pcSlice->getSPS()->getScalingListPresentFlag()) 1809 { 1810 pcSlice->setDefaultScalingList(); 1811 } 1812 m_cTrQuant.setScalingListDec(pcSlice->getScalingList(), pcSlice->getSPS()->getChromaFormatIdc()); 1783 m_cTrQuant.setScalingListDec(scalingList, pcSlice->getSPS()->getChromaFormatIdc()); 1784 #endif 1813 1785 m_cTrQuant.setUseScalingList(true); 1814 1786 } 1815 1787 else 1816 1788 { 1789 #if SVC_EXTENSION 1790 m_cTrQuant.setFlatScalingList(pcSlice->getChromaFormatIdc()); 1791 #else 1817 1792 m_cTrQuant.setFlatScalingList(pcSlice->getSPS()->getChromaFormatIdc()); 1793 #endif 1818 1794 m_cTrQuant.setUseScalingList(false); 1819 1795 } … … 1833 1809 } 1834 1810 1835 Void TDecTop::xDecodeVPS( )1811 Void TDecTop::xDecodeVPS(const std::vector<UChar> *pNaluData) 1836 1812 { 1837 1813 TComVPS* vps = new TComVPS(); 1838 1814 1839 1815 m_cEntropyDecoder.decodeVPS( vps ); 1840 m_parameterSetManager Decoder.storePrefetchedVPS(vps);1816 m_parameterSetManager.storeVPS(vps, pNaluData); 1841 1817 #if SVC_EXTENSION 1842 1818 checkValueOfTargetOutputLayerSetIdx(vps); 1843 #endif 1844 } 1845 1846 Void TDecTop::xDecodeSPS() 1819 1820 #if AVC_BASE 1821 if( vps->getNonHEVCBaseLayerFlag() ) 1822 { 1823 if( !m_ppcTDecTop[0]->getBLReconFile()->good() ) 1824 { 1825 printf( "Base layer YUV input reading error\n" ); 1826 exit(EXIT_FAILURE); 1827 } 1828 } 1829 else 1830 { 1831 TComList<TComPic*> *cListPic = m_ppcTDecTop[0]->getListPic(); 1832 cListPic->clear(); 1833 } 1834 #endif 1835 1836 xDeriveSmallestLayerId(vps); 1837 #endif 1838 } 1839 1840 Void TDecTop::xDecodeSPS(const std::vector<UChar> *pNaluData) 1847 1841 { 1848 1842 TComSPS* sps = new TComSPS(); … … 1854 1848 #endif 1855 1849 m_cEntropyDecoder.decodeSPS( sps ); 1856 m_parameterSetManager Decoder.storePrefetchedSPS(sps);1850 m_parameterSetManager.storeSPS(sps, pNaluData); 1857 1851 } 1858 1852 1859 1853 #if CGS_3D_ASYMLUT 1860 Void TDecTop::xDecodePPS( TCom3DAsymLUT * pc3DAsymLUT )1854 Void TDecTop::xDecodePPS( const std::vector<UChar> *pNaluData, TCom3DAsymLUT * pc3DAsymLUT ) 1861 1855 #else 1862 Void TDecTop::xDecodePPS( )1856 Void TDecTop::xDecodePPS(const std::vector<UChar> *pNaluData) 1863 1857 #endif 1864 1858 { … … 1873 1867 m_cEntropyDecoder.decodePPS( pps ); 1874 1868 #endif 1875 m_parameterSetManager Decoder.storePrefetchedPPS( pps);1869 m_parameterSetManager.storePPS( pps, pNaluData); 1876 1870 } 1877 1871 … … 1887 1881 #endif 1888 1882 #if LAYERS_NOT_PRESENT_SEI 1889 m_seiReader.parseSEImessage( bs, m_pcPic->getSEIs(), nalUnitType, m_parameterSetManager Decoder.getActiveVPS(), m_parameterSetManagerDecoder.getActiveSPS(), m_pDecodedSEIOutputStream );1883 m_seiReader.parseSEImessage( bs, m_pcPic->getSEIs(), nalUnitType, m_parameterSetManager.getActiveVPS(), m_parameterSetManager.getActiveSPS(), m_pDecodedSEIOutputStream ); 1890 1884 #else 1891 m_seiReader.parseSEImessage( bs, m_pcPic->getSEIs(), nalUnitType, m_parameterSetManager Decoder.getActiveSPS(), m_pDecodedSEIOutputStream );1885 m_seiReader.parseSEImessage( bs, m_pcPic->getSEIs(), nalUnitType, m_parameterSetManager.getActiveSPS(), m_pDecodedSEIOutputStream ); 1892 1886 #endif 1893 1887 } … … 1895 1889 { 1896 1890 #if LAYERS_NOT_PRESENT_SEI 1897 m_seiReader.parseSEImessage( bs, m_SEIs, nalUnitType, m_parameterSetManager Decoder.getActiveVPS(), m_parameterSetManagerDecoder.getActiveSPS(), m_pDecodedSEIOutputStream );1891 m_seiReader.parseSEImessage( bs, m_SEIs, nalUnitType, m_parameterSetManager.getActiveVPS(), m_parameterSetManager.getActiveSPS(), m_pDecodedSEIOutputStream ); 1898 1892 #else 1899 m_seiReader.parseSEImessage( bs, m_SEIs, nalUnitType, m_parameterSetManager Decoder.getActiveSPS(), m_pDecodedSEIOutputStream );1893 m_seiReader.parseSEImessage( bs, m_SEIs, nalUnitType, m_parameterSetManager.getActiveSPS(), m_pDecodedSEIOutputStream ); 1900 1894 #endif 1901 1895 SEIMessages activeParamSets = getSeisByType(m_SEIs, SEI::ACTIVE_PARAMETER_SETS); … … 1904 1898 SEIActiveParameterSets *seiAps = (SEIActiveParameterSets*)(*activeParamSets.begin()); 1905 1899 #if R0247_SEI_ACTIVE 1906 getLayerDec(0)->m_parameterSetManagerDecoder.applyPrefetchedPS();1907 1900 assert(seiAps->activeSeqParameterSetId.size()>0); 1908 if( !getLayerDec(0)->m_parameterSetManager Decoder.activateSPSWithSEI( seiAps->activeSeqParameterSetId[0] ) )1901 if( !getLayerDec(0)->m_parameterSetManager.activateSPSWithSEI( seiAps->activeSeqParameterSetId[0] ) ) 1909 1902 { 1910 1903 printf ("Warning SPS activation with Active parameter set SEI failed"); … … 1913 1906 { 1914 1907 Int layerIdx = seiAps->layerSpsIdx[c]; 1915 getLayerDec(layerIdx)->m_parameterSetManagerDecoder.applyPrefetchedPS(); 1916 if( !getLayerDec(layerIdx)->m_parameterSetManagerDecoder.activateSPSWithSEI( seiAps->activeSeqParameterSetId[layerIdx] ) ) 1908 if( !getLayerDec(layerIdx)->m_parameterSetManager.activateSPSWithSEI( seiAps->activeSeqParameterSetId[layerIdx] ) ) 1917 1909 { 1918 1910 printf ("Warning SPS activation with Active parameter set SEI failed"); … … 1920 1912 } 1921 1913 #else 1922 m_parameterSetManagerDecoder.applyPrefetchedPS();1923 1914 assert(seiAps->activeSeqParameterSetId.size()>0); 1924 if (! m_parameterSetManager Decoder.activateSPSWithSEI(seiAps->activeSeqParameterSetId[0] ))1915 if (! m_parameterSetManager.activateSPSWithSEI(seiAps->activeSeqParameterSetId[0] )) 1925 1916 { 1926 1917 printf ("Warning SPS activation with Active parameter set SEI failed"); … … 1954 1945 assert( nalu.m_layerId == 0 ); // Non-conforming bitstream. The value of nuh_layer_id of VPS NAL unit shall be equal to 0. 1955 1946 #endif 1956 xDecodeVPS( );1947 xDecodeVPS(nalu.m_Bitstream->getFifo()); 1957 1948 #if RExt__DECODER_DEBUG_BIT_STATISTICS 1958 1949 TComCodingStatistics::IncrementStatisticEP(STATS__BYTE_ALIGNMENT_BITS,nalu.m_Bitstream->readByteAlignment(),0); 1959 1950 #endif 1960 1951 #if SVC_EXTENSION 1961 m_isLastNALWasEos = false; 1962 #if AVC_BASE 1963 if( m_parameterSetManagerDecoder.getPrefetchedVPS(0)->getNonHEVCBaseLayerFlag() ) 1964 { 1965 if( !m_ppcTDecTop[0]->getBLReconFile()->good() ) 1966 { 1967 printf( "Base layer YUV input reading error\n" ); 1968 exit(EXIT_FAILURE); 1969 } 1970 } 1971 else 1972 { 1973 TComList<TComPic*> *cListPic = m_ppcTDecTop[0]->getListPic(); 1974 cListPic->clear(); 1975 } 1976 #endif 1977 xDeriveSmallestLayerId(m_parameterSetManagerDecoder.getPrefetchedVPS(0)); 1952 m_isLastNALWasEos = false; 1978 1953 #endif 1979 1954 return false; 1980 1955 1981 1956 case NAL_UNIT_SPS: 1982 xDecodeSPS( );1957 xDecodeSPS(nalu.m_Bitstream->getFifo()); 1983 1958 #if RExt__DECODER_DEBUG_BIT_STATISTICS 1984 1959 TComCodingStatistics::IncrementStatisticEP(STATS__BYTE_ALIGNMENT_BITS,nalu.m_Bitstream->readByteAlignment(),0); … … 1987 1962 1988 1963 case NAL_UNIT_PPS: 1989 xDecodePPS(1990 1964 #if CGS_3D_ASYMLUT 1991 &m_c3DAsymLUTPPS 1992 #endif 1993 ); 1965 xDecodePPS( nalu.m_Bitstream->getFifo(), &m_c3DAsymLUTPPS ); 1966 #else 1967 xDecodePPS(nalu.m_Bitstream->getFifo()); 1968 #endif 1994 1969 #if RExt__DECODER_DEBUG_BIT_STATISTICS 1995 1970 TComCodingStatistics::IncrementStatisticEP(STATS__BYTE_ALIGNMENT_BITS,nalu.m_Bitstream->readByteAlignment(),0); … … 2205 2180 Void TDecTop::xInitILRP(TComSlice *slice) 2206 2181 { 2207 TComSPS* pcSPS = slice->getSPS(); 2182 const TComVPS* vps = slice->getVPS(); 2183 const TComSPS* sps = slice->getSPS(); 2184 2208 2185 Int bitDepthY = slice->getBitDepthY(); 2209 2186 Int bitDepthC = slice->getBitDepthC(); 2210 Int picWidth = slice->getPicWidthInLumaSamples();2211 Int picHeight = slice->getPicHeightInLumaSamples();2212 2187 2213 2188 if( m_layerId > 0 ) … … 2216 2191 g_bitDepth[CHANNEL_TYPE_LUMA] = bitDepthY; 2217 2192 g_bitDepth[CHANNEL_TYPE_CHROMA] = bitDepthC; 2218 g_uiMaxCUWidth = pcSPS->getMaxCUWidth();2219 g_uiMaxCUHeight = pcSPS->getMaxCUHeight();2220 g_uiMaxCUDepth = pcSPS->getMaxCUDepth();2221 g_uiAddCUDepth = max (0, pcSPS->getLog2MinCodingBlockSize() - (Int)pcSPS->getQuadtreeTULog2MinSize() );2193 g_uiMaxCUWidth = sps->getMaxCUWidth(); 2194 g_uiMaxCUHeight = sps->getMaxCUHeight(); 2195 g_uiMaxCUDepth = sps->getMaxCUDepth(); 2196 g_uiAddCUDepth = max (0, sps->getLog2MinCodingBlockSize() - (Int)sps->getQuadtreeTULog2MinSize() ); 2222 2197 2223 2198 Int numReorderPics[MAX_TLAYER]; 2224 Window &conformanceWindow = slice->getConformanceWindow();2225 Window defaultDisplayWindow = pcSPS->getVuiParametersPresentFlag() ? pcSPS->getVuiParameters()->getDefaultDisplayWindow() : Window();2226 2199 2227 2200 for( Int temporalLayer=0; temporalLayer < MAX_TLAYER; temporalLayer++ ) … … 2230 2203 { 2231 2204 assert( this->getLayerId() == 0 ); 2232 numReorderPics[temporalLayer] = pcSPS->getNumReorderPics(temporalLayer);2205 numReorderPics[temporalLayer] = sps->getNumReorderPics(temporalLayer); 2233 2206 } 2234 2207 else 2235 { 2236 TComVPS *vps = slice->getVPS(); 2208 { 2237 2209 // SHM decoders will use DPB size table in the VPS to determine the number of reorder pictures. 2238 2210 numReorderPics[temporalLayer] = vps->getMaxVpsNumReorderPics( getCommonDecoderParams()->getTargetOutputLayerSetIdx() , temporalLayer); … … 2244 2216 for (Int j=0; j < m_numDirectRefLayers; j++) 2245 2217 { 2246 2247 2218 m_cIlpPic[j] = new TComPic; 2248 2219 2249 #if AUXILIARY_PICTURES 2250 m_cIlpPic[j]->create(picWidth, picHeight, slice->getChromaFormatIdc(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, pcSPS, true); 2251 #else 2252 m_cIlpPic[j]->create(picWidth, picHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, conformanceWindow, defaultDisplayWindow, numReorderPics, pcSPS, true); 2253 #endif 2220 m_cIlpPic[j]->create(*vps, *sps, *slice->getPPS(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, true, m_layerId); 2221 2254 2222 for (Int i=0; i<m_cIlpPic[j]->getPicSym()->getNumberOfCtusInFrame(); i++) 2255 2223 { … … 2263 2231 TDecTop* TDecTop::getRefLayerDec( UInt refLayerIdx ) 2264 2232 { 2265 TComVPS* vps = m_parameterSetManagerDecoder.getActiveVPS();2233 const TComVPS* vps = m_parameterSetManager.getActiveVPS(); 2266 2234 if( vps->getNumDirectRefLayers( m_layerId ) <= 0 ) 2267 2235 { … … 2272 2240 } 2273 2241 2274 Void TDecTop::setRefLayerParams( TComVPS* vps )2242 Void TDecTop::setRefLayerParams( const TComVPS* vps ) 2275 2243 { 2276 2244 for(UInt layerIdx = 0; layerIdx < m_numLayer; layerIdx++) … … 2404 2372 } 2405 2373 2406 Void TDecTop::markAllPicsAsNoCurrAu( TComVPS *vps)2374 Void TDecTop::markAllPicsAsNoCurrAu( const TComVPS *vps ) 2407 2375 { 2408 2376 for(Int i = 0; i < MAX_LAYERS; i++) 2409 2377 { 2410 TComList<TComPic*>* listPic = this->getLayerDec(vps->getLayerIdInNuh(i))->getListPic();2378 TComList<TComPic*>* listPic = m_ppcTDecTop[vps->getLayerIdInNuh(i)]->getListPic(); 2411 2379 TComList<TComPic*>::iterator iterPic = listPic->begin(); 2412 2380 while ( iterPic != listPic->end() ) … … 2570 2538 } 2571 2539 2572 Void TDecTop::xSetSpatialEnhLayerFlag( TComSlice* slice, TComPic* pic)2573 { 2574 for(UInt i = 0; i < slice->getVPS()->getNumDirectRefLayers( m_layerId ); i++ )2575 { 2576 const Window scalEL = slice->getPPS()->getScaledRefLayerWindowForLayer(slice->getVPS()->getRefLayerId(m_layerId, i));2577 const Window refEL = slice->getPPS()->getRefLayerWindowForLayer(slice->getVPS()->getRefLayerId(m_layerId, i));2540 Void TDecTop::xSetSpatialEnhLayerFlag( const TComVPS &vps, const TComSPS &sps, const TComPPS &pps, TComPic* pic ) 2541 { 2542 for(UInt i = 0; i < vps.getNumDirectRefLayers( m_layerId ); i++ ) 2543 { 2544 const Window scalEL = pps.getScaledRefLayerWindowForLayer(vps.getRefLayerId(m_layerId, i)); 2545 const Window refEL = pps.getRefLayerWindowForLayer(vps.getRefLayerId(m_layerId, i)); 2578 2546 Bool equalOffsets = scalEL.hasEqualOffset(refEL); 2579 Bool zeroPhase = slice->getPPS()->hasZeroResamplingPhase(slice->getVPS()->getRefLayerId(m_layerId, i));2547 Bool zeroPhase = pps.hasZeroResamplingPhase(vps.getRefLayerId(m_layerId, i)); 2580 2548 2581 2549 TDecTop *pcTDecTopBase = (TDecTop *)getRefLayerDec( i ); 2582 //TComPic* pcPic = *(pcTDecTopBase->getListPic()->begin());2583 2550 TComPicYuv* pcPicYuvRecBase = (*(pcTDecTopBase->getListPic()->begin()))->getPicYuvRec(); 2584 2551 2585 UInt refLayerId = slice->getVPS()->getRefLayerId(m_layerId, i);2552 UInt refLayerId = vps.getRefLayerId(m_layerId, i); 2586 2553 Bool sameBitDepths = ( g_bitDepthLayer[CHANNEL_TYPE_LUMA][m_layerId] == g_bitDepthLayer[CHANNEL_TYPE_LUMA][refLayerId] ) && ( g_bitDepthLayer[CHANNEL_TYPE_CHROMA][m_layerId] == g_bitDepthLayer[CHANNEL_TYPE_CHROMA][refLayerId] ); 2587 2554 2588 if( pcPicYuvRecBase->getWidth(COMPONENT_Y) == slice->getPicWidthInLumaSamples() && pcPicYuvRecBase->getHeight(COMPONENT_Y) == slice->getPicHeightInLumaSamples() && equalOffsets && zeroPhase )2555 if( pcPicYuvRecBase->getWidth(COMPONENT_Y) == vps.getPicWidthInLumaSamples(&sps, m_layerId) && pcPicYuvRecBase->getHeight(COMPONENT_Y) == vps.getPicHeightInLumaSamples(&sps, m_layerId) && equalOffsets && zeroPhase ) 2589 2556 { 2590 2557 pic->setEqualPictureSizeAndOffsetFlag( i, true ); … … 2593 2560 if( !pic->equalPictureSizeAndOffsetFlag(i) || !sameBitDepths 2594 2561 #if CGS_3D_ASYMLUT 2595 || slice->getPPS()->getCGSFlag() > 02562 || pps.getCGSFlag() > 0 2596 2563 #endif 2597 2564 #if LAYER_CTB … … 2603 2570 2604 2571 //only for scalable extension 2605 assert( slice->getVPS()->getScalabilityMask( SCALABILITY_ID ) == true );2572 assert( vps.getScalabilityMask( SCALABILITY_ID ) == true ); 2606 2573 } 2607 2574 } -
branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.h
r1223 r1235 75 75 76 76 TComList<TComPic*> m_cListPic; // Dynamic buffer 77 ParameterSetManager Decoder m_parameterSetManagerDecoder; // storage for parameter sets77 ParameterSetManager m_parameterSetManager; // storage for parameter sets 78 78 TComSlice* m_apcSlicePilot; 79 79 … … 152 152 Int m_prevPicOrderCnt; 153 153 #if CONFORMANCE_BITSTREAM_MODE 154 Bool m_confModeFlag;155 std::vector<TComPic> m_confListPic; // Dynamic buffer for storing pictures for conformance purposes156 #endif 157 Bool m_isOutputLayerFlag;154 Bool m_confModeFlag; 155 std::vector<TComPic> m_confListPic; // Dynamic buffer for storing pictures for conformance purposes 156 #endif 157 Bool m_isOutputLayerFlag; 158 158 #endif //SVC_EXTENSION 159 159 160 160 public: 161 161 #if SVC_EXTENSION 162 static Bool 163 static Int 164 static Bool 165 static Bool 166 static Bool 167 static Bool 168 static Int 169 static Bool 170 static Bool 171 static Int 172 static Int 162 static Bool m_checkPocRestrictionsForCurrAu; 163 static Int m_pocResetIdcOrCurrAu; 164 static Bool m_baseLayerIdrFlag; 165 static Bool m_baseLayerPicPresentFlag; 166 static Bool m_baseLayerIrapFlag; 167 static Bool m_nonBaseIdrPresentFlag; 168 static Int m_nonBaseIdrType; 169 static Bool m_picNonIdrWithRadlPresentFlag; 170 static Bool m_picNonIdrNoLpPresentFlag; 171 static Int m_crossLayerPocResetPeriodId; 172 static Int m_crossLayerPocResetIdc; 173 173 #endif //SVC_EXTENSION 174 174 … … 189 189 190 190 Void deletePicBuffer(); 191 192 193 TComSPS* getActiveSPS() { return m_parameterSetManagerDecoder.getActiveSPS(); }194 195 191 196 192 Void executeLoopFilters(Int& poc, TComList<TComPic*>*& rpcListPic); … … 210 206 Int getParseIdc () { return m_parseIdc; } 211 207 Void setParseIdc (Int x) { m_parseIdc = x; } 212 Void markAllPicsAsNoCurrAu ( TComVPS *vps);208 Void markAllPicsAsNoCurrAu ( const TComVPS *vps ); 213 209 214 210 Int getLastPocPeriodId () { return m_lastPocPeriodId; } … … 240 236 Void setNumMotionPredRefLayers (Int num) { m_numMotionPredRefLayers = num; } 241 237 242 Void setRefLayerParams( TComVPS* vps );238 Void setRefLayerParams( const TComVPS* vps ); 243 239 244 240 #if AVC_BASE … … 251 247 Void checkValueOfTargetOutputLayerSetIdx(TComVPS *vps); 252 248 253 ParameterSetManager Decoder* getParameterSetManager() { return &m_parameterSetManagerDecoder; }249 ParameterSetManager* getParameterSetManager() { return &m_parameterSetManager; } 254 250 255 251 #if CONFORMANCE_BITSTREAM_MODE 256 252 std::vector<TComPic>* getConfListPic() {return &m_confListPic; } 257 Bool const getConfModeFlag() { return m_confModeFlag; }258 Void setConfModeFlag(Bool x) { m_confModeFlag = x; }253 Bool const getConfModeFlag() { return m_confModeFlag; } 254 Void setConfModeFlag(Bool x) { m_confModeFlag = x; } 259 255 #endif 260 256 #endif //SVC_EXTENSION 261 257 262 258 protected: 263 Void xGetNewPicBuffer (TComSlice* pcSlice, TComPic*& rpcPic); 264 Void xCreateLostPicture (Int iLostPOC); 259 #if SVC_EXTENSION 260 Void xGetNewPicBuffer ( const TComVPS &vps, const TComSPS &sps, const TComPPS &pps, TComPic*& rpcPic, const UInt temporalLayer); 261 #else 262 Void xGetNewPicBuffer (const TComSPS &sps, const TComPPS &pps, TComPic*& rpcPic, const UInt temporalLayer); 263 #endif 264 Void xCreateLostPicture (Int iLostPOC); 265 265 266 266 Void xActivateParameterSets(); 267 267 #if SVC_EXTENSION 268 268 Bool xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay, UInt& curLayerId, Bool& bNewPOC); 269 Void xSetSpatialEnhLayerFlag( TComSlice* slice, TComPic* pic);269 Void xSetSpatialEnhLayerFlag( const TComVPS &vps, const TComSPS &sps, const TComPPS &pps, TComPic* pic ); 270 270 #else 271 271 Bool xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay); 272 272 #endif 273 Void xDecodeVPS( );274 Void xDecodeSPS( );273 Void xDecodeVPS(const std::vector<UChar> *pNaluData); 274 Void xDecodeSPS(const std::vector<UChar> *pNaluData); 275 275 #if CGS_3D_ASYMLUT 276 Void xDecodePPS( TCom3DAsymLUT * pc3DAsymLUT);276 Void xDecodePPS(const std::vector<UChar> *pNaluData, TCom3DAsymLUT *pc3DAsymLUT); 277 277 #else 278 Void xDecodePPS( );278 Void xDecodePPS(const std::vector<UChar> *pNaluData); 279 279 #endif 280 280 Void xDecodeSEI( TComInputBitstream* bs, const NalUnitType nalUnitType ); … … 282 282 #if SVC_EXTENSION 283 283 #if NO_CLRAS_OUTPUT_FLAG 284 Int getNoClrasOutputFlag() { return m_noClrasOutputFlag;}285 Void setNoClrasOutputFlag(Bool x) { m_noClrasOutputFlag = x; }286 Int getLayerInitializedFlag() { return m_layerInitializedFlag;}287 Void setLayerInitializedFlag(Bool x) { m_layerInitializedFlag = x; }288 Int getFirstPicInLayerDecodedFlag() { return m_firstPicInLayerDecodedFlag;}289 Void setFirstPicInLayerDecodedFlag(Bool x) { m_firstPicInLayerDecodedFlag = x; }284 Int getNoClrasOutputFlag() { return m_noClrasOutputFlag;} 285 Void setNoClrasOutputFlag(Bool x) { m_noClrasOutputFlag = x; } 286 Int getLayerInitializedFlag() { return m_layerInitializedFlag;} 287 Void setLayerInitializedFlag(Bool x) { m_layerInitializedFlag = x; } 288 Int getFirstPicInLayerDecodedFlag() { return m_firstPicInLayerDecodedFlag;} 289 Void setFirstPicInLayerDecodedFlag(Bool x) { m_firstPicInLayerDecodedFlag = x; } 290 290 #endif 291 291 #if CGS_3D_ASYMLUT 292 Void initAsymLut(TComSlice *pcSlice);293 #endif 294 Void resetPocRestrictionCheckParameters();295 Void xCheckLayerReset();296 Void xSetNoRaslOutputFlag();297 Void xSetLayerInitializedFlag();292 Void initAsymLut(TComSlice *pcSlice); 293 #endif 294 Void resetPocRestrictionCheckParameters(); 295 Void xCheckLayerReset(); 296 Void xSetNoRaslOutputFlag(); 297 Void xSetLayerInitializedFlag(); 298 298 #endif 299 299 };// END CLASS DEFINITION TDecTop
Note: See TracChangeset for help on using the changeset viewer.