Changeset 54 in SHVCSoftware for branches/HM-10.0-dev-SHM/source/Lib/TLibCommon/TComSlice.cpp
- Timestamp:
- 2 Mar 2013, 09:25:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HM-10.0-dev-SHM/source/Lib/TLibCommon/TComSlice.cpp
r51 r54 81 81 , m_bNoBackPredFlag ( false ) 82 82 , m_uiTLayer ( 0 ) 83 #if SVC_EXTENSION 84 , m_layerId ( 0 ) 85 , m_pcBaseColPic ( NULL ) 86 #endif 83 87 , m_bTLayerSwitchingFlag ( false ) 84 88 , m_sliceMode ( 0 ) … … 136 140 137 141 142 #if SET_SLICE_LAYER_ID 143 Void TComSlice::initSlice( UInt layerId ) 144 #else 138 145 Void TComSlice::initSlice() 139 { 146 #endif 147 { 148 #if SET_SLICE_LAYER_ID 149 m_layerId = layerId; 150 #endif 140 151 m_aiNumRefIdx[0] = 0; 141 152 m_aiNumRefIdx[1] = 0; … … 344 355 Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic ) 345 356 { 357 #if REF_IDX_FRAMEWORK 358 if( m_eSliceType == I_SLICE || ( getSPS()->getLayerId() && 359 (getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA) && 360 (getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA) ) ) 361 #else 346 362 if (m_eSliceType == I_SLICE) 363 #endif 347 364 { 348 365 ::memset( m_apcRefPicList, 0, sizeof (m_apcRefPicList)); … … 1261 1278 , m_vuiParametersPresentFlag (false) 1262 1279 , m_vuiParameters () 1280 #if SVC_EXTENSION 1281 , m_layerId(0) 1282 #endif 1263 1283 { 1264 1284 for ( Int i = 0; i < MAX_TLAYER; i++ ) … … 1926 1946 //! activate a PPS and depending on isIDR parameter also SPS and VPS 1927 1947 //! \returns true, if activation is successful 1948 #if SVC_EXTENSION 1949 Bool ParameterSetManager::activatePPS(Int ppsId, Bool isIDR, UInt layerId) 1950 #else 1928 1951 Bool ParameterSetManager::activatePPS(Int ppsId, Bool isIDR) 1952 #endif 1929 1953 { 1930 1954 TComPPS *pps = m_ppsMap.getPS(ppsId); … … 1932 1956 { 1933 1957 Int spsId = pps->getSPSId(); 1958 #if SVC_EXTENSION 1959 if (!isIDR && (spsId != layerId )) 1960 #else 1934 1961 if (!isIDR && (spsId != m_activeSPSId)) 1962 #endif 1935 1963 { 1936 1964 printf("Warning: tried to activate PPS referring to a inactive SPS at non-IDR."); … … 2001 2029 } 2002 2030 #endif 2031 2032 #if SVC_EXTENSION 2033 #if AVC_SYNTAX 2034 Void TComSlice::initBaseLayerRPL( TComSlice *pcSlice ) 2035 { 2036 // Assumed that RPL of the base layer is same to the EL, otherwise this information should be also dumped and read from the metadata file 2037 setPOC( pcSlice->getPOC() ); 2038 if( pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA ) 2039 { 2040 setSliceType( I_SLICE ); 2041 } 2042 else 2043 { 2044 setSliceType( pcSlice->getSliceType() ); 2045 } 2046 2047 if( this->isIntra() ) 2048 { 2049 return; 2050 } 2051 2052 //initialize reference POC of BL 2053 for( Int iRefPicList = 0; iRefPicList < 2; iRefPicList++ ) 2054 { 2055 RefPicList eRefPicList = RefPicList( iRefPicList ); 2056 2057 assert( pcSlice->getNumRefIdx( eRefPicList) > 0 ); 2058 setNumRefIdx( eRefPicList, pcSlice->getNumRefIdx( eRefPicList ) - 1 ); 2059 assert( getNumRefIdx( eRefPicList) <= MAX_NUM_REF); 2060 2061 for(Int refIdx = 0; refIdx < getNumRefIdx( eRefPicList ); refIdx++) 2062 { 2063 setRefPOC( pcSlice->getRefPic( eRefPicList, refIdx )->getPOC(), eRefPicList, refIdx ); 2064 setRefPic( pcSlice->getRefPic( eRefPicList, refIdx ), eRefPicList, refIdx ); 2065 /* 2066 // should be set if the base layer has its own instance of the reference picture lists, currently EL RPL is reused. 2067 getRefPic( eRefPicList, refIdx )->setLayerId( 0 ); 2068 getRefPic( eRefPicList, refIdx )->setIsLongTerm( pcSlice->getRefPic( eRefPicList, refIdx )->getIsLongTerm() ); 2069 getRefPic( eRefPicList, refIdx )->setIsUsedAsLongTerm( pcSlice->getRefPic( eRefPicList, refIdx )->getIsUsedAsLongTerm() ); 2070 */ 2071 2072 } 2073 } 2074 return; 2075 } 2076 #endif 2077 2078 Void TComSlice::setBaseColPic( TComList<TComPic*>& rcListPic, UInt layerID ) 2079 { 2080 if (layerID == 0) 2081 { 2082 m_pcBaseColPic = NULL; 2083 return; 2084 } 2085 setBaseColPic(xGetRefPic(rcListPic, getPOC())); 2086 } 2087 #endif 2088 2089 #if REF_IDX_FRAMEWORK 2090 Void TComSlice::addRefPicList( TComPic **pIlpPicList, Int iRefPicNum, Int iInsertOffset ) 2091 { 2092 if(getSPS()->getLayerId() && m_eSliceType != I_SLICE) 2093 { 2094 #if REF_IDX_MFM 2095 assert(iRefPicNum == 1); 2096 if( getPOC() != 0 ) 2097 { 2098 pIlpPicList[0]->copyUpsampledMvField(getBaseColPic()); 2099 } 2100 #endif 2101 //add to list 0; 2102 Int iOffset; 2103 m_aiNumRefIdx[REF_PIC_LIST_0] += iInsertOffset; 2104 iOffset = m_aiNumRefIdx[REF_PIC_LIST_0]; 2105 for (Int i=0; i<iRefPicNum; i++) 2106 { 2107 pIlpPicList[i]->setIsLongTerm(1); //mark ilp as long-term reference 2108 pIlpPicList[i]->setIsUsedAsLongTerm(1); //mark ilp as long-term reference 2109 m_apcRefPicList[REF_PIC_LIST_0][iOffset + i] = pIlpPicList[i]; 2110 m_aiNumRefIdx[REF_PIC_LIST_0]++; 2111 //m_aiNumRefIdx[REF_PIC_LIST_C]++; 2112 } 2113 if(m_eSliceType == B_SLICE) 2114 { 2115 m_aiNumRefIdx[REF_PIC_LIST_1] += iInsertOffset; 2116 iOffset = m_aiNumRefIdx[REF_PIC_LIST_1]; 2117 for (Int i=0; i<iRefPicNum; i++) 2118 { 2119 pIlpPicList[i]->setIsLongTerm(1); //mark ilp as long-term reference 2120 pIlpPicList[i]->setIsUsedAsLongTerm(1); //mark ilp as long-term reference 2121 m_apcRefPicList[REF_PIC_LIST_1][iOffset + i] = pIlpPicList[i]; 2122 m_aiNumRefIdx[REF_PIC_LIST_1]++; 2123 //m_aiNumRefIdx[REF_PIC_LIST_C]++; 2124 } 2125 } 2126 } 2127 } 2128 2129 #if REF_IDX_MFM 2130 Void TComSlice::setRefPOCListILP( TComPic** ilpPic, TComPic *pcRefPicBL ) 2131 { 2132 //set reference picture POC of each ILP reference 2133 Int thePoc = ilpPic[0]->getPOC(); 2134 assert(thePoc >= 0); 2135 assert(thePoc == pcRefPicBL->getPOC()); 2136 2137 #if REUSE_MVSCALE || REUSE_BLKMAPPING 2138 ilpPic[0]->getSlice(0)->setBaseColPic( pcRefPicBL ); 2139 #endif 2140 2141 //initialize reference POC of ILP 2142 for(Int refIdx = 0; refIdx < MAX_NUM_REF; refIdx++) 2143 { 2144 ilpPic[0]->getSlice(0)->setRefPOC(0, REF_PIC_LIST_0, refIdx); 2145 ilpPic[0]->getSlice(0)->setRefPOC(0, REF_PIC_LIST_1, refIdx); 2146 2147 ilpPic[0]->getSlice(0)->setRefPic(NULL, REF_PIC_LIST_0, refIdx); 2148 ilpPic[0]->getSlice(0)->setRefPic(NULL, REF_PIC_LIST_1, refIdx); 2149 } 2150 2151 //set reference POC of ILP 2152 ilpPic[0]->getSlice(0)->setNumRefIdx(REF_PIC_LIST_0, pcRefPicBL->getSlice(0)->getNumRefIdx(REF_PIC_LIST_0)); 2153 assert(ilpPic[0]->getSlice(0)->getNumRefIdx(REF_PIC_LIST_0) <= MAX_NUM_REF); 2154 ilpPic[0]->getSlice(0)->setNumRefIdx(REF_PIC_LIST_1, pcRefPicBL->getSlice(0)->getNumRefIdx(REF_PIC_LIST_1)); 2155 assert(ilpPic[0]->getSlice(0)->getNumRefIdx(REF_PIC_LIST_1) <= MAX_NUM_REF); 2156 2157 for(Int refIdx = 0; refIdx < pcRefPicBL->getSlice(0)->getNumRefIdx(REF_PIC_LIST_0); refIdx++) 2158 { 2159 ilpPic[0]->getSlice(0)->setRefPOC(pcRefPicBL->getSlice(0)->getRefPOC(REF_PIC_LIST_0, refIdx), REF_PIC_LIST_0, refIdx); 2160 } 2161 for(Int refIdx = 0; refIdx < pcRefPicBL->getSlice(0)->getNumRefIdx(REF_PIC_LIST_1); refIdx++) 2162 { 2163 ilpPic[0]->getSlice(0)->setRefPOC(pcRefPicBL->getSlice(0)->getRefPOC(REF_PIC_LIST_1, refIdx), REF_PIC_LIST_1, refIdx); 2164 } 2165 for(Int refIdx = 0; refIdx < pcRefPicBL->getSlice(0)->getNumRefIdx(REF_PIC_LIST_0); refIdx++) 2166 { 2167 ilpPic[0]->getSlice(0)->setRefPic(pcRefPicBL->getSlice(0)->getRefPic(REF_PIC_LIST_0, refIdx), REF_PIC_LIST_0, refIdx); 2168 } 2169 for(Int refIdx = 0; refIdx < pcRefPicBL->getSlice(0)->getNumRefIdx(REF_PIC_LIST_1); refIdx++) 2170 { 2171 ilpPic[0]->getSlice(0)->setRefPic(pcRefPicBL->getSlice(0)->getRefPic(REF_PIC_LIST_1, refIdx), REF_PIC_LIST_1, refIdx); 2172 } 2173 return; 2174 } 2175 #endif 2176 2177 2178 #endif 2003 2179 //! \}
Note: See TracChangeset for help on using the changeset viewer.