Changeset 738 in 3DVCSoftware for trunk/source/Lib/TLibCommon/TComSlice.cpp
- Timestamp:
- 10 Dec 2013, 13:50:12 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/Lib/TLibCommon/TComSlice.cpp
r724 r738 110 110 #endif 111 111 , m_pocResetFlag (false) 112 #if H_MV_6_RALS_O0149_11 113 , m_crossLayerBlaFlag (false) 114 #endif 112 115 , m_discardableFlag (false) 113 116 , m_interLayerPredEnabledFlag (false) … … 148 151 for (Int i = 0; i < MAX_NUM_LAYERS; i++ ) 149 152 { 150 m_interLayerPredLayerIdc[ i ] = i;153 m_interLayerPredLayerIdc[ i ] = -1; 151 154 } 152 155 #endif … … 1709 1712 , m_hrdOpSetIdx (NULL) 1710 1713 , m_cprmsPresentFlag (NULL) 1714 #if H_MV_6_HRD_O0217_13 1715 , m_dpbSize (NULL) 1716 #endif 1711 1717 #if H_MV 1712 1718 , m_vpsVUI ( NULL ) … … 1724 1730 for( Int layerId = 0; layerId < MAX_VPS_NUH_LAYER_ID_PLUS1; layerId++ ) 1725 1731 { 1732 #if H_MV_6_HRD_O0217_13 1733 m_layerIdIncludedFlag[lsIdx][layerId] = (( lsIdx == 0 ) && ( layerId == 0 )) ; 1734 #else 1726 1735 m_layerIdIncludedFlag[lsIdx][layerId] = false; 1736 #endif 1727 1737 } 1728 1738 } … … 1738 1748 m_moreOutputLayerSetsThanDefaultFlag = false; 1739 1749 m_numAddOutputLayerSetsMinus1 = -1; 1750 #if H_MV_6_PS_0109_25 1751 m_defaultOneTargetOutputLayerIdc = 0; 1752 #else 1740 1753 m_defaultOneTargetOutputLayerFlag = false; 1754 #endif 1741 1755 1742 1756 for ( Int i = 0; i < MAX_VPS_OUTPUTLAYER_SETS; i++) … … 1749 1763 } 1750 1764 } 1751 1765 #if H_MV_6_GEN_0153_28 1766 m_altOutputLayerFlag = false; 1767 #endif 1752 1768 m_maxOneActiveRefLayerFlag = false; 1753 1769 m_directDepTypeLenMinus2 = 0; … … 1786 1802 m_layerIdInNuh [i] = ( i == 0 ) ? 0 : -1; 1787 1803 m_numDirectRefLayers[i] = 0; 1804 #if !H_MV_6_ILDDS_O0225_30 1788 1805 m_maxTidIlRefPicPlus1[i] = 7; 1806 #endif 1789 1807 m_vpsRepFormatIdx [i] = 0; 1808 #if H_MV_6_MISC_O0062_31 1809 m_pocLsbNotPresentFlag[i] = 0; 1810 #endif 1790 1811 m_repFormat [i] = NULL; 1791 1812 m_viewIdVal [i] = 0; … … 1821 1842 m_directDependencyType[i][j] = -1; 1822 1843 m_refLayerId[i][j] = -1; 1844 #if H_MV_6_ILDDS_O0225_30 1845 m_maxTidIlRefPicsPlus1[i][j] = 7; 1846 #endif 1823 1847 } 1824 1848 … … 1833 1857 } 1834 1858 m_vpsVUI = new TComVPSVUI; 1859 #if H_MV_6_HRD_O0217_13 1860 m_dpbSize = new TComDpbSize; 1861 #endif 1862 # 1835 1863 #if H_3D 1836 1864 for( Int i = 0; i < MAX_NUM_LAYERS; i++ ) … … 1866 1894 #if H_MV 1867 1895 if ( m_vpsVUI != NULL ) delete m_vpsVUI; 1896 #if H_MV_6_HRD_O0217_13 1897 if ( m_dpbSize != NULL ) delete m_dpbSize; 1898 #endif 1899 1868 1900 for( Int i = 0; i < MAX_NUM_LAYERS; i++ ) 1869 1901 { … … 2068 2100 assert( lsIdx >= 0 ); 2069 2101 assert( lsIdx <= getVpsNumLayerSetsMinus1() ); 2102 #if H_MV_6_HRD_O0217_13 2103 return (Int) m_layerSetLayerIdList[ lsIdx ].size(); 2104 #else 2070 2105 Int numLayersInIdList = 0; 2071 2106 for (Int layerId = 0; layerId < getVpsMaxLayerId(); layerId++ ) … … 2074 2109 } 2075 2110 return numLayersInIdList; 2076 } 2111 #endif 2112 } 2113 2114 #if H_MV_6_HRD_O0217_13 2115 Int TComVPS::getNumOutputLayerSets() 2116 { 2117 Int numOutputLayerSets = getVpsNumberLayerSetsMinus1( ) + 1; 2118 if ( getMoreOutputLayerSetsThanDefaultFlag( ) ) 2119 { 2120 numOutputLayerSets += (getNumAddOutputLayerSetsMinus1( ) + 1); 2121 } 2122 return numOutputLayerSets; 2123 } 2124 #endif 2125 2077 2126 Int TComVPS::getNumViews() 2078 2127 { … … 2104 2153 return dependentFlag; 2105 2154 } 2155 2156 #if H_MV_6_HRD_O0217_13 2157 Void TComVPS::deriveLayerSetLayerIdList() 2158 { 2159 m_layerSetLayerIdList.resize( getVpsNumLayerSetsMinus1() + 1 ); 2160 for (Int i = 0; i <= getVpsNumLayerSetsMinus1(); i++ ) 2161 { 2162 for( Int m = 0; m <= getVpsMaxLayerId(); m++ ) 2163 { 2164 if( getLayerIdIncludedFlag( i, m) ) 2165 { 2166 m_layerSetLayerIdList[ i ].push_back( m ); 2167 } 2168 } 2169 } 2170 } 2171 2172 Void TComVPS::deriveTargetLayerIdLists() 2173 { 2174 m_targetDecLayerIdLists.resize( getNumOutputLayerSets() ); 2175 m_targetOptLayerIdLists.resize( getNumOutputLayerSets() ); 2176 2177 for (Int targetOptLayerSetIdx = 0; targetOptLayerSetIdx < getNumOutputLayerSets(); targetOptLayerSetIdx++ ) 2178 { 2179 Int targetDecLayerSetIdx = getOutputLayerSetIdxMinus1( targetOptLayerSetIdx ) + 1; 2180 Int lsIdx = targetDecLayerSetIdx; 2181 2182 for( Int j = 0; j < getNumLayersInIdList( lsIdx ); j++ ) 2183 { 2184 m_targetDecLayerIdLists[targetOptLayerSetIdx].push_back( m_layerSetLayerIdList[ lsIdx ][ j ] ); 2185 if( getOutputLayerFlag( targetOptLayerSetIdx, j )) // This seems to be wrong in draft text 2186 { 2187 m_targetOptLayerIdLists[targetOptLayerSetIdx].push_back( m_layerSetLayerIdList[ lsIdx ][ j ] ); 2188 } 2189 } 2190 } 2191 } 2192 #endif 2106 2193 #endif // H_MV 2107 2194 … … 2157 2244 , m_spsInferScalingListFlag ( false ) 2158 2245 , m_spsScalingListRefLayerId ( 0 ) 2246 2247 #if !H_MV_6_PS_REP_FORM_18_19_20 2159 2248 , m_updateRepFormatFlag ( true ) 2249 #else 2250 , m_updateRepFormatFlag ( false ) 2251 , m_spsRepFormatIdx ( 0 ) 2252 #endif 2160 2253 , m_interViewMvVertConstraintFlag (false) 2161 2254 #endif … … 2173 2266 ::memset(m_ltRefPicPocLsbSps, 0, sizeof(m_ltRefPicPocLsbSps)); 2174 2267 ::memset(m_usedByCurrPicLtSPSFlag, 0, sizeof(m_usedByCurrPicLtSPSFlag)); 2268 #if H_MV_6_PSEM_O0142_3 2269 m_spsExtensionFlag = false; 2270 for( Int i = 0; i < PS_EX_T_MAX_NUM; i++ ) 2271 { 2272 m_spsExtensionTypeFlag[ i ] = false; 2273 } 2274 #endif 2275 #if H_MV_6_SHVC_O0098_36 2276 m_numScaledRefLayerOffsets = 0; 2277 2278 for (Int i = 0; i < MAX_NUM_SCALED_REF_LAYERS; i++ ) 2279 { 2280 m_scaledRefLayerId [i] = -1; 2281 } 2282 2283 for (Int i = 0; i < MAX_NUM_LAYERS; i++ ) 2284 { 2285 m_scaledRefLayerLeftOffset [i] = 0; 2286 m_scaledRefLayerTopOffset [i] = 0; 2287 m_scaledRefLayerRightOffset [i] = 0; 2288 m_scaledRefLayerBottomOffset [i] = 0; 2289 } 2290 #endif 2175 2291 } 2176 2292 … … 2353 2469 if ( layerIdCurr > 0 ) 2354 2470 { 2471 #if H_MV_6_PS_REP_FORM_18_19_20 2472 Int repFormatIdx = getUpdateRepFormatFlag() ? getSpsRepFormatIdx() : vps->getVpsRepFormatIdx( vps->getLayerIdInVps( layerIdCurr ) ) ; 2473 TComRepFormat* repFormat = vps->getRepFormat( repFormatIdx ); 2474 #else 2355 2475 TComRepFormat* repFormat = vps->getRepFormat( vps->getVpsRepFormatIdx( vps->getLayerIdInVps( layerIdCurr ) ) ); 2356 2476 if ( !getUpdateRepFormatFlag() ) 2357 2477 { 2478 #endif 2358 2479 setChromaFormatIdc( repFormat->getChromaFormatVpsIdc() ); 2359 2480 //// ToDo: add when supported: … … 2368 2489 setBitDepthC ( repFormat->getBitDepthVpsChromaMinus8() + 8 ); 2369 2490 setQpBDOffsetC ( (Int) (6* ( getBitDepthC() -8 ) ) ); 2491 #if !H_MV_6_PS_REP_FORM_18_19_20 2370 2492 } 2371 2493 else 2494 #else 2495 if ( getLayerId() > 0 && getUpdateRepFormatFlag() ) 2496 #endif 2372 2497 { 2373 2498 assert( getChromaFormatIdc() <= repFormat->getChromaFormatVpsIdc() ); … … 2715 2840 Void TComSlice::markIvRefPicsAsUnused( TComPicLists* ivPicLists, std::vector<Int> targetDecLayerIdSet, TComVPS* vps, Int curLayerId, Int curPoc ) 2716 2841 { 2717 // Fill targetDecLayerIdSet with all layers if empty .2842 // Fill targetDecLayerIdSet with all layers if empty (at encoder side) 2718 2843 if (targetDecLayerIdSet.size() == 0 ) 2719 2844 { … … 2739 2864 { 2740 2865 TComPic* pcPic = ivPicLists->getPic( targetDecLayerIdSet[ i ], curPoc ); 2866 #if H_MV_LAYER_WISE_STARTUP 2867 if ( pcPic ) 2868 { 2869 #endif 2741 2870 if( pcPic->getSlice(0)->isReferenced() && pcPic->getSlice(0)->getTemporalLayerNonReferenceFlag() ) 2742 2871 { … … 2761 2890 } 2762 2891 } 2892 #if H_MV_LAYER_WISE_STARTUP 2893 } 2894 #endif 2763 2895 } 2764 2896 } … … 2816 2948 return pcPic; 2817 2949 } 2950 2951 2952 #if H_MV_6_ILDDS_ILREFPICS_27_34 2953 Int TComSlice::getRefLayerPicFlag( Int i ) 2954 { 2955 TComVPS* vps = getVPS(); 2956 Int refLayerIdx = vps->getLayerIdInVps( vps->getRefLayerId( getLayerId(), i ) ); 2957 2958 Bool refLayerPicFlag = ( vps->getSubLayersVpsMaxMinus1( refLayerIdx ) >= getTLayer() ) && 2959 ( vps->getMaxTidIlRefPicsPlus1( refLayerIdx, vps->getLayerIdInVps( getLayerId() )) > getTLayer() ); 2960 2961 return refLayerPicFlag; 2962 } 2963 2964 Int TComSlice::getRefLayerPicIdc( Int j ) 2965 { 2966 Int refLayerPicIdc = -1; 2967 Int curj = 0; 2968 for( Int i = 0; i < getVPS()->getNumDirectRefLayers( getLayerId()) ; i++ ) 2969 { 2970 if( getRefLayerPicFlag( i ) ) 2971 { 2972 if ( curj == j ) 2973 { 2974 refLayerPicIdc = i; 2975 break; 2976 } 2977 curj++; 2978 } 2979 } 2980 2981 assert( curj == j ); 2982 assert( refLayerPicIdc != -1 ); 2983 return refLayerPicIdc; 2984 } 2985 2986 Int TComSlice::getNumRefLayerPics( ) 2987 { 2988 Int numRefLayerPics = 0; 2989 for( Int i = 0; i < getVPS()->getNumDirectRefLayers( getLayerId()) ; i++ ) 2990 { 2991 numRefLayerPics += getRefLayerPicFlag( i ); 2992 } 2993 return numRefLayerPics; 2994 } 2995 #endif 2996 2997 2998 2818 2999 Int TComSlice::getNumActiveRefLayerPics() 2819 3000 { … … 2826 3007 else if (getVPS()->getAllRefLayersActiveFlag() ) 2827 3008 { 3009 #if H_MV_6_ILDDS_ILREFPICS_27_34 3010 numActiveRefLayerPics = getNumRefLayerPics(); 3011 #else 2828 3012 numActiveRefLayerPics = getVPS()->getNumDirectRefLayers( getLayerId() ); 3013 #endif 2829 3014 } 2830 3015 else if ( !getInterLayerPredEnabledFlag() ) … … 2834 3019 else if( getVPS()->getMaxOneActiveRefLayerFlag() || getVPS()->getNumDirectRefLayers( getLayerId() ) == 1 ) 2835 3020 { 3021 #if H_MV_6_ILDDS_ILREFPICS_27_34 3022 numActiveRefLayerPics = getRefLayerPicFlag( 0 ) ? 1 : 0; 3023 #else 2836 3024 numActiveRefLayerPics = 1; 3025 #endif 2837 3026 } 2838 3027 else … … 3434 3623 TComVPSVUI::TComVPSVUI() 3435 3624 { 3625 #if H_MV_6_PS_O0223_29 3626 m_crossLayerIrapAlignedFlag = true; 3627 #endif 3436 3628 m_bitRatePresentVpsFlag = false; 3437 3629 m_picRatePresentVpsFlag = false; … … 3461 3653 } 3462 3654 } 3463 } 3464 #endif 3655 #if H_MV_6_PS_O0118_33 3656 for ( Int i = 0; i < MAX_NUM_VIDEO_SIGNAL_INFO; i++ ) 3657 { 3658 m_videoSignalInfo [i] = NULL; 3659 } 3660 #endif 3661 3662 #if H_MV_6_HRD_O0164_15 3663 m_vpsVuiBspHrdPresentFlag = false; 3664 m_vpsVuiBspHrdParameters = new TComVpsVuiBspHrdParameters(); 3665 #endif 3666 } 3667 3668 #if H_MV_6_PS_O0118_33 3669 TComVPSVUI::~TComVPSVUI() 3670 { 3671 for ( Int i = 0; i < MAX_NUM_VIDEO_SIGNAL_INFO; i++ ) 3672 { 3673 if (m_videoSignalInfo[ i ] != NULL ) delete m_videoSignalInfo[ i ]; 3674 m_videoSignalInfo [ i ] = NULL; 3675 } 3676 3677 #if H_MV_6_HRD_O0164_15 3678 if ( m_vpsVuiBspHrdParameters ) delete m_vpsVuiBspHrdParameters; 3679 m_vpsVuiBspHrdParameters = NULL; 3680 #endif 3681 } 3682 #endif 3683 3684 #if H_MV_6_PS_REP_FORM_18_19_20 3685 Void TComRepFormat::inferChromaAndBitDepth( TComRepFormat* prevRepFormat, Bool encoderFlag ) 3686 { 3687 if ( !encoderFlag ) 3688 { 3689 setChromaAndBitDepthVpsPresentFlag( prevRepFormat->getChromaAndBitDepthVpsPresentFlag() ); 3690 setSeparateColourPlaneVpsFlag ( prevRepFormat->getSeparateColourPlaneVpsFlag () ); 3691 setBitDepthVpsLumaMinus8 ( prevRepFormat->getBitDepthVpsLumaMinus8 () ); 3692 setBitDepthVpsChromaMinus8 ( prevRepFormat->getBitDepthVpsChromaMinus8 () ); 3693 } 3694 else 3695 { 3696 assert( getChromaAndBitDepthVpsPresentFlag() == prevRepFormat->getChromaAndBitDepthVpsPresentFlag() ); 3697 assert( getSeparateColourPlaneVpsFlag () == prevRepFormat->getSeparateColourPlaneVpsFlag () ); 3698 assert( getBitDepthVpsLumaMinus8 () == prevRepFormat->getBitDepthVpsLumaMinus8 () ); 3699 assert( getBitDepthVpsChromaMinus8 () == prevRepFormat->getBitDepthVpsChromaMinus8 () ); 3700 } 3701 } 3702 #endif 3703 3704 #if H_MV_6_HRD_O0164_15 3705 Void TComVpsVuiBspHrdParameters::checkLayerInBspFlag( TComVPS* vps, Int h ) 3706 { 3707 // It is a requirement of bitstream conformance that bitstream partition with index j shall not include 3708 // direct or indirect reference layers of any layers in bitstream partition i for any values of i and j 3709 // in the range of 0 to num_bitstream_partitions[ h ] 1, inclusive, such that i is less than j. 3710 3711 for ( Int partJ = 0; partJ < getNumBitstreamPartitions( h ); partJ++ ) 3712 { 3713 for ( Int partI = 0; partI < partJ; partI++ ) 3714 { 3715 for ( Int layerJ = 0; layerJ < vps->getMaxLayersMinus1(); layerJ++ ) 3716 { 3717 if ( m_layerInBspFlag[ h ][partJ][layerJ ] ) 3718 { 3719 for ( Int layerI = 0; layerI < vps->getMaxLayersMinus1(); layerI++ ) 3720 { 3721 if ( m_layerInBspFlag[ h ][partI][layerI] ) 3722 { 3723 assert( !vps->getInDirectDependencyFlag( layerI, layerJ ) ); 3724 } 3725 } 3726 } 3727 } 3728 } 3729 } 3730 } 3731 #endif 3732 #endif
Note: See TracChangeset for help on using the changeset viewer.