Changeset 851 in SHVCSoftware for branches/SHM-dev/source/Lib/TLibDecoder
- Timestamp:
- 2 Aug 2014, 00:34:01 (10 years ago)
- Location:
- branches/SHM-dev/source/Lib/TLibDecoder
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp
r850 r851 3439 3439 { 3440 3440 READ_CODE( 2, uiCode, "poc_reset_idc"); rpcSlice->setPocResetIdc(uiCode); 3441 #if POC_RESET_RESTRICTIONS 3442 /* The value of poc_reset_idc shall not be equal to 1 or 2 for a RASL picture, a RADL picture, 3443 a sub-layer non-reference picture, or a picture that has TemporalId greater than 0, 3444 or a picture that has discardable_flag equal to 1. */ 3445 if( rpcSlice->getPocResetIdc() == 1 || rpcSlice->getPocResetIdc() == 2 ) 3446 { 3447 assert( !rpcSlice->isRASL() ); 3448 assert( !rpcSlice->isRADL() ); 3449 assert( !rpcSlice->isSLNR() ); 3450 assert( rpcSlice->getTLayer() == 0 ); 3451 assert( rpcSlice->getDiscardableFlag() == 0 ); 3452 } 3453 3454 // The value of poc_reset_idc of a CRA or BLA picture shall be less than 3. 3455 if( rpcSlice->getPocResetIdc() == 3) 3456 { 3457 assert( ! ( rpcSlice->isCRA() || rpcSlice->isBLA() ) ); 3458 } 3459 #endif 3441 3460 } 3442 3461 else -
branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp
r850 r851 43 43 UInt TDecTop::m_uiPrevLayerId = MAX_UINT; 44 44 Bool TDecTop::m_bFirstSliceInSequence = true; 45 #if POC_RESET_RESTRICTIONS 46 Bool TDecTop::m_checkPocRestrictionsForCurrAu = false; 47 Int TDecTop::m_pocResetIdcOrCurrAu = -1; 48 Bool TDecTop::m_baseLayerIdrFlag = false; 49 Bool TDecTop::m_baseLayerPicPresentFlag = false; 50 Bool TDecTop::m_baseLayerIrapFlag = false; 51 Bool TDecTop::m_nonBaseIdrPresentFlag = false; 52 Int TDecTop::m_nonBaseIdrType = -1; 53 Bool TDecTop::m_picNonIdrWithRadlPresentFlag = false; 54 Bool TDecTop::m_picNonIdrNoLpPresentFlag = false; 55 #endif 45 56 #endif 46 57 … … 104 115 #if Q0074_SEI_COLOR_MAPPING 105 116 m_ColorMapping = new TDecColorMapping(); 117 #endif 118 119 #if POC_RESET_RESTRICTIONS 120 resetPocRestrictionCheckParameters(); 106 121 #endif 107 122 } … … 940 955 941 956 m_apcSlicePilot->setNalUnitType(nalu.m_nalUnitType); 957 #if POC_RESET_RESTRICTIONS 958 m_apcSlicePilot->setTLayer( nalu.m_temporalId ); 959 #endif 942 960 Bool nonReferenceFlag = (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_TRAIL_N || 943 961 m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_TSA_N || … … 1116 1134 if(( m_layerId < m_uiPrevLayerId) ||( ( m_layerId == m_uiPrevLayerId) && bNewPOC)) // Decoding a lower layer than or same layer as previous - mark all earlier pictures as not in current AU 1117 1135 { 1136 #if POC_RESET_RESTRICTIONS 1137 // New access unit; reset all variables related to POC reset restrictions 1138 resetPocRestrictionCheckParameters(); 1139 #endif 1118 1140 markAllPicsAsNoCurrAu(); 1119 1141 } … … 1132 1154 { 1133 1155 m_parseIdc = 3; // Proceed to decoding POC and RPS 1134 } 1156 } 1135 1157 } 1136 1158 #endif … … 1622 1644 #if POC_RESET_IDC_DECODER 1623 1645 pcPic->setCurrAuFlag( true ); 1646 #if POC_RESET_RESTRICTIONS 1647 if( pcPic->getLayerId() > 0 && m_apcSlicePilot->isIDR() && !m_nonBaseIdrPresentFlag ) 1648 { 1649 // IDR picture with nuh_layer_id > 0 present 1650 m_nonBaseIdrPresentFlag = true; 1651 m_nonBaseIdrType = (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL); 1652 } 1653 else 1654 { 1655 if( m_apcSlicePilot->getNalUnitType() != NAL_UNIT_CODED_SLICE_IDR_W_RADL ) 1656 { 1657 // Picture with nal_unit_type not equal IDR_W_RADL present 1658 m_picNonIdrWithRadlPresentFlag = true; 1659 } 1660 if( m_apcSlicePilot->getNalUnitType() != NAL_UNIT_CODED_SLICE_IDR_N_LP ) 1661 { 1662 // Picture with nal_unit_type not equal IDR_N_LP present 1663 m_picNonIdrNoLpPresentFlag = true; 1664 } 1665 } 1666 if( !m_checkPocRestrictionsForCurrAu ) // Will be true for the first slice/picture of the AU 1667 { 1668 m_checkPocRestrictionsForCurrAu = true; 1669 m_pocResetIdcOrCurrAu = m_apcSlicePilot->getPocResetIdc(); 1670 if( pcPic->getLayerId() == 0 ) 1671 { 1672 // Base layer picture is present 1673 m_baseLayerPicPresentFlag = true; 1674 if( m_apcSlicePilot->isIRAP() ) 1675 { 1676 // Base layer picture is IRAP 1677 m_baseLayerIrapFlag = true; 1678 } 1679 if( m_apcSlicePilot->isIDR() ) 1680 { 1681 // Base layer picture is IDR 1682 m_baseLayerIdrFlag = true; 1683 } 1684 else 1685 { 1686 if( m_apcSlicePilot->getVPS()->getBaseLayerInternalFlag()) 1687 { 1688 /* When the picture with nuh_layer_id equal to 0 in an access unit is not an IDR picture 1689 and vps_base_layer_internal_flag is equal to 1, the value of poc_reset_idc shall not be equal to 2 1690 for any picture in the access unit. */ 1691 assert( m_apcSlicePilot->getPocResetIdc() != 2 ); 1692 } 1693 } 1694 } 1695 } 1696 else 1697 { 1698 // The value of poc_reset_idc of all coded pictures that are present in the bitstream in an access unit shall be the same. 1699 assert( m_pocResetIdcOrCurrAu == m_apcSlicePilot->getPocResetIdc() ); 1700 1701 /* When the picture in an access unit with nuh_layer_id equal to 0 is an IRAP picture and vps_base_layer_internal_flag is equal to 1 1702 and there is at least one other picture in the same access unit that is not an IRAP picture, 1703 the value of poc_reset_idc shall be equal to 1 or 2 for all pictures in the access unit. */ 1704 if( m_baseLayerPicPresentFlag && m_baseLayerIrapFlag && !m_apcSlicePilot->isIRAP() && m_apcSlicePilot->getVPS()->getBaseLayerInternalFlag() ) 1705 { 1706 assert( m_apcSlicePilot->getPocResetIdc() == 1 || m_apcSlicePilot->getPocResetIdc() == 2 ); 1707 } 1708 1709 /* When the picture with nuh_layer_id equal to 0 in an access unit is an IDR picture and 1710 vps_base_layer_internal_flag is equal to 1 and there is at least one non-IDR picture in the same access unit, 1711 the value of poc_reset_idc shall be equal to 2 for all pictures in the access unit. */ 1712 if( m_baseLayerPicPresentFlag && m_baseLayerIdrFlag && !m_apcSlicePilot->isIDR() && m_apcSlicePilot->getVPS()->getBaseLayerInternalFlag() ) 1713 { 1714 assert( m_apcSlicePilot->getPocResetIdc() == 2 ); 1715 } 1716 1717 /* When there is at least one picture that has nuh_layer_id greater than 0 and that is an IDR picture 1718 with a particular value of nal_unit_type in an access unit and there is at least one other coded picture 1719 that is present in the bitstream in the same access unit with a different value of nal_unit_type, 1720 the value of poc_reset_idc shall be equal to 1 or 2 for all pictures in the access unit. */ 1721 if( m_nonBaseIdrPresentFlag && 1722 ( m_nonBaseIdrType == 1 && m_picNonIdrWithRadlPresentFlag 1723 || m_nonBaseIdrType == 0 && m_picNonIdrNoLpPresentFlag ) 1724 ) 1725 { 1726 assert( m_apcSlicePilot->getPocResetIdc() == 1 || m_apcSlicePilot->getPocResetIdc() == 2 ); 1727 } 1728 } 1729 #endif 1624 1730 #endif 1625 1731 … … 2675 2781 } 2676 2782 #endif 2677 2783 #if POC_RESET_RESTRICTIONS 2784 Void TDecTop::resetPocRestrictionCheckParameters() 2785 { 2786 TDecTop::m_checkPocRestrictionsForCurrAu = false; 2787 TDecTop::m_pocResetIdcOrCurrAu = -1; 2788 TDecTop::m_baseLayerIdrFlag = false; 2789 TDecTop::m_baseLayerPicPresentFlag = false; 2790 TDecTop::m_baseLayerIrapFlag = false; 2791 TDecTop::m_nonBaseIdrPresentFlag = false; 2792 TDecTop::m_nonBaseIdrType = -1; 2793 TDecTop::m_picNonIdrWithRadlPresentFlag = false; 2794 TDecTop::m_picNonIdrNoLpPresentFlag = false; 2795 } 2796 #endif 2678 2797 #endif //SVC_EXTENSION 2679 2798 -
branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.h
r850 r851 213 213 #endif 214 214 215 #if POC_RESET_RESTRICTIONS 216 static Bool m_checkPocRestrictionsForCurrAu; 217 static Int m_pocResetIdcOrCurrAu; 218 static Bool m_baseLayerIdrFlag; 219 static Bool m_baseLayerPicPresentFlag; 220 static Bool m_baseLayerIrapFlag; 221 static Bool m_nonBaseIdrPresentFlag; 222 static Int m_nonBaseIdrType; 223 static Bool m_picNonIdrWithRadlPresentFlag; 224 static Bool m_picNonIdrNoLpPresentFlag; 225 #endif 226 215 227 TDecTop(); 216 228 virtual ~TDecTop(); … … 357 369 Void initAsymLut(TComSlice *pcSlice); 358 370 #endif 371 #if POC_RESET_RESTRICTIONS 372 Void resetPocRestrictionCheckParameters(); 373 #endif 359 374 };// END CLASS DEFINITION TDecTop 360 375 361 376 377 362 378 //! \} 363 379
Note: See TracChangeset for help on using the changeset viewer.