Changeset 730 in 3DVCSoftware for branches/HTM-9.0-dev0/source/Lib/TLibCommon/TComSlice.cpp
- Timestamp:
- 9 Dec 2013, 17:16:03 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-9.0-dev0/source/Lib/TLibCommon/TComSlice.cpp
r724 r730 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 , m_vpsVUI ( NULL)1718 , m_vpsVUI (NULL) 1713 1719 #endif 1714 1720 { … … 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++) … … 1748 1762 m_outputLayerFlag[i][j] = false; 1749 1763 } 1750 } 1751 1764 } 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++ ) … … 2073 2108 numLayersInIdList += ( getLayerIdIncludedFlag( lsIdx, layerId ) ); 2074 2109 } 2110 2075 2111 return numLayersInIdList; 2076 } 2112 #endif 2113 } 2114 2115 #if H_MV_6_HRD_O0217_13 2116 Int TComVPS::getNumOutputLayerSets() 2117 { 2118 Int numOutputLayerSets = getVpsNumberLayerSetsMinus1( ) + 1; 2119 if ( getMoreOutputLayerSetsThanDefaultFlag( ) ) 2120 { 2121 numOutputLayerSets += (getNumAddOutputLayerSetsMinus1( ) + 1); 2122 } 2123 return numOutputLayerSets; 2124 } 2125 #endif 2126 2077 2127 Int TComVPS::getNumViews() 2078 2128 { … … 2104 2154 return dependentFlag; 2105 2155 } 2156 2157 #if H_MV_6_HRD_O0217_13 2158 Void TComVPS::deriveLayerSetLayerIdList() 2159 { 2160 m_layerSetLayerIdList.resize( getVpsNumLayerSetsMinus1() + 1 ); 2161 for (Int i = 0; i <= getVpsNumLayerSetsMinus1(); i++ ) 2162 { 2163 for( Int m = 0; m <= getVpsMaxLayerId(); m++ ) 2164 { 2165 if( getLayerIdIncludedFlag( i, m) ) 2166 { 2167 m_layerSetLayerIdList[ i ].push_back( m ); 2168 } 2169 } 2170 } 2171 } 2172 2173 Void TComVPS::deriveTargetLayerIdLists() 2174 { 2175 m_targetDecLayerIdLists.resize( getNumOutputLayerSets() ); 2176 m_targetOptLayerIdLists.resize( getNumOutputLayerSets() ); 2177 2178 for (Int targetOptLayerSetIdx = 0; targetOptLayerSetIdx < getNumOutputLayerSets(); targetOptLayerSetIdx++ ) 2179 { 2180 Int targetDecLayerSetIdx = getOutputLayerSetIdxMinus1( targetOptLayerSetIdx ) + 1; 2181 Int lsIdx = targetDecLayerSetIdx; 2182 2183 for( Int j = 0; j < getNumLayersInIdList( lsIdx ); j++ ) 2184 { 2185 m_targetDecLayerIdLists[targetOptLayerSetIdx].push_back( m_layerSetLayerIdList[ lsIdx ][ j ] ); 2186 if( getOutputLayerFlag( targetOptLayerSetIdx, j )) // This seems to be wrong in draft text 2187 { 2188 m_targetOptLayerIdLists[targetOptLayerSetIdx].push_back( m_layerSetLayerIdList[ lsIdx ][ j ] ); 2189 } 2190 } 2191 } 2192 } 2193 #endif 2106 2194 #endif // H_MV 2107 2195 … … 2157 2245 , m_spsInferScalingListFlag ( false ) 2158 2246 , m_spsScalingListRefLayerId ( 0 ) 2247 2248 #if !H_MV_6_PS_REP_FORM_18_19_20 2159 2249 , m_updateRepFormatFlag ( true ) 2250 #else 2251 , m_updateRepFormatFlag ( false ) 2252 , m_spsRepFormatIdx ( 0 ) 2253 #endif 2160 2254 , m_interViewMvVertConstraintFlag (false) 2161 2255 #endif … … 2173 2267 ::memset(m_ltRefPicPocLsbSps, 0, sizeof(m_ltRefPicPocLsbSps)); 2174 2268 ::memset(m_usedByCurrPicLtSPSFlag, 0, sizeof(m_usedByCurrPicLtSPSFlag)); 2269 #if H_MV_6_PSEM_O0142_3 2270 m_spsExtensionFlag = false; 2271 for( Int i = 0; i < PS_EX_T_MAX_NUM; i++ ) 2272 { 2273 m_spsExtensionTypeFlag[ i ] = false; 2274 } 2275 #endif 2276 #if H_MV_6_SHVC_O0098_36 2277 m_numScaledRefLayerOffsets = 0; 2278 2279 for (Int i = 0; i < MAX_NUM_SCALED_REF_LAYERS; i++ ) 2280 { 2281 m_scaledRefLayerId [i] = -1; 2282 } 2283 2284 for (Int i = 0; i < MAX_NUM_LAYERS; i++ ) 2285 { 2286 m_scaledRefLayerLeftOffset [i] = 0; 2287 m_scaledRefLayerTopOffset [i] = 0; 2288 m_scaledRefLayerRightOffset [i] = 0; 2289 m_scaledRefLayerBottomOffset [i] = 0; 2290 } 2291 #endif 2175 2292 } 2176 2293 … … 2353 2470 if ( layerIdCurr > 0 ) 2354 2471 { 2472 #if H_MV_6_PS_REP_FORM_18_19_20 2473 Int repFormatIdx = getUpdateRepFormatFlag() ? getSpsRepFormatIdx() : vps->getVpsRepFormatIdx( vps->getLayerIdInVps( layerIdCurr ) ) ; 2474 TComRepFormat* repFormat = vps->getRepFormat( repFormatIdx ); 2475 #else 2355 2476 TComRepFormat* repFormat = vps->getRepFormat( vps->getVpsRepFormatIdx( vps->getLayerIdInVps( layerIdCurr ) ) ); 2477 2356 2478 if ( !getUpdateRepFormatFlag() ) 2357 2479 { 2480 #endif 2358 2481 setChromaFormatIdc( repFormat->getChromaFormatVpsIdc() ); 2359 2482 //// ToDo: add when supported: … … 2368 2491 setBitDepthC ( repFormat->getBitDepthVpsChromaMinus8() + 8 ); 2369 2492 setQpBDOffsetC ( (Int) (6* ( getBitDepthC() -8 ) ) ); 2493 #if !H_MV_6_PS_REP_FORM_18_19_20 2370 2494 } 2371 2495 else 2496 #else 2497 if ( getLayerId() > 0 && getUpdateRepFormatFlag() ) 2498 #endif 2372 2499 { 2373 2500 assert( getChromaFormatIdc() <= repFormat->getChromaFormatVpsIdc() ); … … 2398 2525 } 2399 2526 } 2527 2400 2528 #endif 2401 2529 #if H_3D … … 2668 2796 #if H_MV 2669 2797 Void TComSlice::createInterLayerReferencePictureSet( TComPicLists* ivPicLists, std::vector<TComPic*>& refPicSetInterLayer0, std::vector<TComPic*>& refPicSetInterLayer1 ) 2670 { 2798 { 2671 2799 refPicSetInterLayer0.clear(); 2672 2800 refPicSetInterLayer1.clear(); … … 2713 2841 2714 2842 } 2843 2844 2715 2845 Void TComSlice::markIvRefPicsAsUnused( TComPicLists* ivPicLists, std::vector<Int> targetDecLayerIdSet, TComVPS* vps, Int curLayerId, Int curPoc ) 2716 2846 { 2717 // Fill targetDecLayerIdSet with all layers if empty .2847 // Fill targetDecLayerIdSet with all layers if empty (at encoder side) 2718 2848 if (targetDecLayerIdSet.size() == 0 ) 2719 2849 { … … 2722 2852 targetDecLayerIdSet.push_back( vps->getLayerIdInNuh( layerIdInVps ) ); 2723 2853 } 2724 } 2854 } 2725 2855 2726 2856 Int numTargetDecLayers = (Int) targetDecLayerIdSet.size(); … … 2731 2861 { 2732 2862 break; 2863 } 2733 2864 } 2734 }2735 2865 2736 2866 for( Int i = 0; i <= latestDecIdx; i++ ) … … 2739 2869 { 2740 2870 TComPic* pcPic = ivPicLists->getPic( targetDecLayerIdSet[ i ], curPoc ); 2741 if( pcPic->getSlice(0)->isReferenced() && pcPic->getSlice(0)->getTemporalLayerNonReferenceFlag() ) 2742 { 2743 Bool remainingInterLayerReferencesFlag = false; 2744 for( Int j = latestDecIdx + 1; j < numTargetDecLayers; j++ ) 2871 #if H_MV_LAYER_WISE_STARTUP 2872 if ( pcPic ) 2873 { 2874 #endif 2875 if( pcPic->getSlice(0)->isReferenced() && pcPic->getSlice(0)->getTemporalLayerNonReferenceFlag() ) 2745 2876 { 2746 TComVPS* vpsSlice = pcPic->getSlice(0)->getVPS(); 2747 if ( vps->nuhLayerIdIncluded( targetDecLayerIdSet[ j ] ) ) 2877 Bool remainingInterLayerReferencesFlag = false; 2878 for( Int j = latestDecIdx + 1; j < numTargetDecLayers; j++ ) 2879 { 2880 TComVPS* vpsSlice = pcPic->getSlice(0)->getVPS(); 2881 if ( vps->nuhLayerIdIncluded( targetDecLayerIdSet[ j ] ) ) 2882 { 2883 for( Int k = 0; k < vpsSlice->getNumDirectRefLayers( targetDecLayerIdSet[ j ] ); k++ ) 2884 { 2885 if ( targetDecLayerIdSet[ i ] == vpsSlice->getRefLayerId( targetDecLayerIdSet[ j ], k ) ) 2886 { 2887 remainingInterLayerReferencesFlag = true; 2888 } 2889 } 2890 } 2891 } 2892 if( !remainingInterLayerReferencesFlag ) 2748 2893 { 2749 for( Int k = 0; k < vpsSlice->getNumDirectRefLayers( targetDecLayerIdSet[ j ] ); k++ ) 2750 { 2751 if ( targetDecLayerIdSet[ i ] == vpsSlice->getRefLayerId( targetDecLayerIdSet[ j ], k ) ) 2752 { 2753 remainingInterLayerReferencesFlag = true; 2894 pcPic->getSlice(0)->setReferenced( false ); 2754 2895 } 2755 2896 } 2756 } 2757 } 2758 if( !remainingInterLayerReferencesFlag ) 2759 { 2760 pcPic->getSlice(0)->setReferenced( false ); 2761 } 2762 } 2763 } 2764 } 2897 #if H_MV_LAYER_WISE_STARTUP 2898 } 2899 #endif 2900 } 2901 } 2765 2902 } 2766 2903 … … 2773 2910 { 2774 2911 if (rIdx == 0 && li == 0) m_apcRefPicList[li][rIdx]->print( true ); 2775 2912 2776 2913 m_apcRefPicList[li][rIdx]->print( false ); 2777 2914 } … … 2816 2953 return pcPic; 2817 2954 } 2955 2956 2957 #if H_MV_6_ILDDS_ILREFPICS_27_34 2958 Int TComSlice::getRefLayerPicFlag( Int i ) 2959 { 2960 TComVPS* vps = getVPS(); 2961 Int refLayerIdx = vps->getLayerIdInVps( vps->getRefLayerId( getLayerId(), i ) ); 2962 2963 Bool refLayerPicFlag = ( vps->getSubLayersVpsMaxMinus1( refLayerIdx ) >= getTLayer() ) && 2964 ( vps->getMaxTidIlRefPicsPlus1( refLayerIdx, vps->getLayerIdInVps( getLayerId() )) > getTLayer() ); 2965 2966 return refLayerPicFlag; 2967 } 2968 2969 Int TComSlice::getRefLayerPicIdc( Int j ) 2970 { 2971 Int refLayerPicIdc = -1; 2972 Int curj = 0; 2973 for( Int i = 0; i < getVPS()->getNumDirectRefLayers( getLayerId()) ; i++ ) 2974 { 2975 if( getRefLayerPicFlag( i ) ) 2976 { 2977 if ( curj == j ) 2978 { 2979 refLayerPicIdc = i; 2980 break; 2981 } 2982 curj++; 2983 } 2984 } 2985 2986 assert( curj == j ); 2987 assert( refLayerPicIdc != -1 ); 2988 return refLayerPicIdc; 2989 } 2990 2991 Int TComSlice::getNumRefLayerPics( ) 2992 { 2993 Int numRefLayerPics = 0; 2994 for( Int i = 0; i < getVPS()->getNumDirectRefLayers( getLayerId()) ; i++ ) 2995 { 2996 numRefLayerPics += getRefLayerPicFlag( i ); 2997 } 2998 return numRefLayerPics; 2999 } 3000 #endif 3001 3002 3003 2818 3004 Int TComSlice::getNumActiveRefLayerPics() 2819 3005 { … … 2826 3012 else if (getVPS()->getAllRefLayersActiveFlag() ) 2827 3013 { 3014 #if H_MV_6_ILDDS_ILREFPICS_27_34 3015 numActiveRefLayerPics = getNumRefLayerPics(); 3016 #else 2828 3017 numActiveRefLayerPics = getVPS()->getNumDirectRefLayers( getLayerId() ); 3018 #endif 2829 3019 } 2830 3020 else if ( !getInterLayerPredEnabledFlag() ) … … 2834 3024 else if( getVPS()->getMaxOneActiveRefLayerFlag() || getVPS()->getNumDirectRefLayers( getLayerId() ) == 1 ) 2835 3025 { 3026 #if H_MV_6_ILDDS_ILREFPICS_27_34 3027 numActiveRefLayerPics = getRefLayerPicFlag( 0 ) ? 1 : 0; 3028 #else 2836 3029 numActiveRefLayerPics = 1; 3030 #endif 2837 3031 } 2838 3032 else … … 3434 3628 TComVPSVUI::TComVPSVUI() 3435 3629 { 3630 #if H_MV_6_PS_O0223_29 3631 m_crossLayerIrapAlignedFlag = true; 3632 #endif 3436 3633 m_bitRatePresentVpsFlag = false; 3437 3634 m_picRatePresentVpsFlag = false; … … 3461 3658 } 3462 3659 } 3463 } 3464 #endif 3660 #if H_MV_6_PS_O0118_33 3661 for ( Int i = 0; i < MAX_NUM_VIDEO_SIGNAL_INFO; i++ ) 3662 { 3663 m_videoSignalInfo [i] = NULL; 3664 } 3665 #endif 3666 3667 #if H_MV_6_HRD_O0164_15 3668 m_vpsVuiBspHrdPresentFlag = false; 3669 m_vpsVuiBspHrdParameters = new TComVpsVuiBspHrdParameters(); 3670 #endif 3671 } 3672 3673 #if H_MV_6_PS_O0118_33 3674 TComVPSVUI::~TComVPSVUI() 3675 { 3676 for ( Int i = 0; i < MAX_NUM_VIDEO_SIGNAL_INFO; i++ ) 3677 { 3678 if (m_videoSignalInfo[ i ] != NULL ) delete m_videoSignalInfo[ i ]; 3679 m_videoSignalInfo [ i ] = NULL; 3680 } 3681 3682 #if H_MV_6_HRD_O0164_15 3683 if ( m_vpsVuiBspHrdParameters ) delete m_vpsVuiBspHrdParameters; 3684 m_vpsVuiBspHrdParameters = NULL; 3685 #endif 3686 } 3687 #endif 3688 3689 #if H_MV_6_PS_REP_FORM_18_19_20 3690 Void TComRepFormat::inferChromaAndBitDepth( TComRepFormat* prevRepFormat, Bool encoderFlag ) 3691 { 3692 if ( !encoderFlag ) 3693 { 3694 setChromaAndBitDepthVpsPresentFlag( prevRepFormat->getChromaAndBitDepthVpsPresentFlag() ); 3695 setSeparateColourPlaneVpsFlag ( prevRepFormat->getSeparateColourPlaneVpsFlag () ); 3696 setBitDepthVpsLumaMinus8 ( prevRepFormat->getBitDepthVpsLumaMinus8 () ); 3697 setBitDepthVpsChromaMinus8 ( prevRepFormat->getBitDepthVpsChromaMinus8 () ); 3698 } 3699 else 3700 { 3701 assert( getChromaAndBitDepthVpsPresentFlag() == prevRepFormat->getChromaAndBitDepthVpsPresentFlag() ); 3702 assert( getSeparateColourPlaneVpsFlag () == prevRepFormat->getSeparateColourPlaneVpsFlag () ); 3703 assert( getBitDepthVpsLumaMinus8 () == prevRepFormat->getBitDepthVpsLumaMinus8 () ); 3704 assert( getBitDepthVpsChromaMinus8 () == prevRepFormat->getBitDepthVpsChromaMinus8 () ); 3705 } 3706 } 3707 #endif 3708 3709 #if H_MV_6_HRD_O0164_15 3710 Void TComVpsVuiBspHrdParameters::checkLayerInBspFlag( TComVPS* vps, Int h ) 3711 { 3712 // It is a requirement of bitstream conformance that bitstream partition with index j shall not include 3713 // direct or indirect reference layers of any layers in bitstream partition i for any values of i and j 3714 // in the range of 0 to num_bitstream_partitions[ h ] 1, inclusive, such that i is less than j. 3715 3716 for ( Int partJ = 0; partJ < getNumBitstreamPartitions( h ); partJ++ ) 3717 { 3718 for ( Int partI = 0; partI < partJ; partI++ ) 3719 { 3720 for ( Int layerJ = 0; layerJ < vps->getMaxLayersMinus1(); layerJ++ ) 3721 { 3722 if ( m_layerInBspFlag[ h ][partJ][layerJ ] ) 3723 { 3724 for ( Int layerI = 0; layerI < vps->getMaxLayersMinus1(); layerI++ ) 3725 { 3726 if ( m_layerInBspFlag[ h ][partI][layerI] ) 3727 { 3728 assert( !vps->getInDirectDependencyFlag( layerI, layerJ ) ); 3729 } 3730 } 3731 } 3732 } 3733 } 3734 } 3735 } 3736 #endif 3737 #endif
Note: See TracChangeset for help on using the changeset viewer.