Changeset 798 in SHVCSoftware for branches/SHM-6-dev/source/Lib/TLibDecoder
- Timestamp:
- 10 Jun 2014, 01:10:15 (12 years ago)
- Location:
- branches/SHM-6-dev/source/Lib/TLibDecoder
- Files:
-
- 3 edited
-
TDecCAVLC.cpp (modified) (4 diffs)
-
TDecTop.cpp (modified) (6 diffs)
-
TDecTop.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-6-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp
r796 r798 2616 2616 { 2617 2617 READ_CODE(sps->getBitsForPOC(), uiCode, "pic_order_cnt_lsb"); 2618 #if POC_RESET_IDC_DECODER 2619 rpcSlice->setPicOrderCntLsb( uiCode ); 2620 #endif 2618 2621 #if SHM_FIX7 2619 2622 iPOClsb = uiCode; … … 2650 2653 #if SHM_FIX7 2651 2654 } 2655 #endif 2656 #if POC_RESET_IDC_DECODER 2657 else 2658 { 2659 rpcSlice->setPicOrderCntLsb( 0 ); 2660 } 2652 2661 #endif 2653 2662 if( !rpcSlice->getIdrPicFlag() ) … … 3342 3351 } 3343 3352 3353 #if !POC_RESET_IDC_DECODER 3344 3354 Int maxPocLsb = 1 << rpcSlice->getSPS()->getBitsForPOC(); 3355 #endif 3345 3356 if( rpcSlice->getPocMsbValPresentFlag() ) 3346 3357 { 3347 3358 READ_UVLC( uiCode, "poc_msb_val"); rpcSlice->setPocMsbVal( uiCode ); 3359 3360 #if !POC_RESET_IDC_DECODER 3348 3361 // Update POC of the slice based on this MSB val 3349 3362 Int pocLsb = rpcSlice->getPOC() % maxPocLsb; … … 3353 3366 { 3354 3367 rpcSlice->setPocMsbVal( rpcSlice->getPOC() / maxPocLsb ); 3368 #endif 3355 3369 } 3356 3370 -
branches/SHM-6-dev/source/Lib/TLibDecoder/TDecTop.cpp
r797 r798 96 96 m_subDpbIdx = -1; 97 97 #endif 98 #if POC_RESET_IDC_DECODER 99 m_parseIdc = -1; 100 m_lastPocPeriodId = -1; 101 m_prevPicOrderCnt = 0; 102 #endif 98 103 #if Q0048_CGS_3D_ASYMLUT 99 104 m_pColorMappedPic = NULL; … … 1104 1109 } 1105 1110 #endif 1111 #if POC_RESET_IDC_DECODER 1112 if( m_parseIdc != -1 ) // Second pass for a POC resetting picture 1113 { 1114 m_parseIdc++; // Proceed to POC decoding and RPS derivation 1115 } 1116 1117 if( m_parseIdc == 2 ) 1118 { 1119 bNewPOC = false; 1120 } 1121 1122 if( (bNewPOC || m_layerId!=m_uiPrevLayerId) && (m_parseIdc == -1) ) // Will be true at the first pass 1123 { 1124 //if (bNewPOC || m_layerId!=m_uiPrevLayerId) 1125 // Check if new reset period has started - this is needed just so that the SHM decoder which calls slice header decoding twice 1126 // does not invoke the output twice 1127 //if( m_lastPocPeriodId[m_apcSlicePilot->getLayerId()] == m_apcSlicePilot->getPocResetPeriodId() ) 1128 // Update CurrAU marking 1129 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 1130 { 1131 markAllPicsAsNoCurrAu(); 1132 } 1133 1134 if( m_apcSlicePilot->getPocResetIdc() && m_apcSlicePilot->getSliceIdx() == 0 ) 1135 { 1136 Int pocResetPeriodId = m_apcSlicePilot->getPocResetPeriodId(); 1137 if ( m_apcSlicePilot->getPocResetIdc() == 1 || m_apcSlicePilot->getPocResetIdc() == 2 || 1138 ( m_apcSlicePilot->getPocResetIdc() == 3 && pocResetPeriodId != getLastPocPeriodId() ) ) 1139 { 1140 setLastPocPeriodId(pocResetPeriodId); 1141 m_parseIdc = 0; 1142 } 1143 } 1144 else 1145 { 1146 m_parseIdc = 3; // Proceed to decoding POC and RPS 1147 } 1148 } 1149 #endif 1106 1150 1107 1151 #if ALIGNED_BUMPING 1152 #if POC_RESET_IDC_DECODER 1153 //if( (bNewPOC || m_layerId != m_uiPrevLayerId) && ( m_parseIdc != 1) ) 1154 if( m_parseIdc == 1 ) 1155 { 1156 1157 // Invoke output of pictures if the current picture is a POC reset picture 1158 bNewPOC = true; 1159 /* Include reset of all POCs in the layer */ 1160 1161 // This operation would do the following: 1162 // 1. Update the other picture in the DPB. This should be done only for the first slice of the picture. 1163 // 2. Update the value of m_pocCRA. 1164 // 3. Reset the POC values at the decoder for the current picture to be zero - will be done later 1165 // 4. update value of POCLastDisplay 1166 1167 //Do the reset stuff here 1168 Int maxPocLsb = 1 << m_apcSlicePilot->getSPS()->getBitsForPOC(); 1169 Int pocLsbVal; 1170 if( m_apcSlicePilot->getPocResetIdc() == 3 ) 1171 { 1172 pocLsbVal = m_apcSlicePilot->getPocLsbVal() ; 1173 } 1174 else 1175 { 1176 pocLsbVal = (m_apcSlicePilot->getPOC() % maxPocLsb); 1177 } 1178 1179 Int pocMsbDelta = 0; 1180 if ( m_apcSlicePilot->getPocMsbValPresentFlag() ) 1181 { 1182 pocMsbDelta = m_apcSlicePilot->getPocMsbVal() * maxPocLsb; 1183 } 1184 else 1185 { 1186 //This MSB derivation can be made into one function. Item to do next. 1187 Int prevPoc = this->getPrevPicOrderCnt(); 1188 Int prevPocLsb = prevPoc & (maxPocLsb - 1); 1189 Int prevPocMsb = prevPoc - prevPocLsb; 1190 1191 pocMsbDelta = m_apcSlicePilot->getCurrMsb( pocLsbVal, prevPocLsb, prevPocMsb, maxPocLsb ); 1192 } 1193 1194 Int pocLsbDelta; 1195 if( m_apcSlicePilot->getPocResetIdc() == 2 || ( m_apcSlicePilot->getPocResetIdc() == 3 && m_apcSlicePilot->getFullPocResetFlag() )) 1196 { 1197 pocLsbDelta = pocLsbVal; 1198 } 1199 else 1200 { 1201 pocLsbDelta = 0; 1202 } 1203 1204 Int deltaPocVal = pocMsbDelta + pocLsbDelta; 1205 1206 //Reset all POC for DPB -> basically do it for each slice in the picutre 1207 TComList<TComPic*>::iterator iterPic = m_cListPic.begin(); 1208 1209 // Iterate through all picture in DPB 1210 while( iterPic != m_cListPic.end() ) 1211 { 1212 TComPic *dpbPic = *iterPic; 1213 // Check if the picture pointed to by iterPic is either used for reference or 1214 // needed for output, are in the same layer, and not the current picture. 1215 if( /* ( ( dpbPic->getSlice(0)->isReferenced() ) || ( dpbPic->getOutputMark() ) ) 1216 &&*/ ( dpbPic->getLayerId() == m_apcSlicePilot->getLayerId() ) 1217 && ( dpbPic->getReconMark() ) && ( dpbPic->getPicSym()->getSlice(0)->getPicOutputFlag() )) 1218 { 1219 for(Int i = dpbPic->getNumAllocatedSlice()-1; i >= 0; i--) 1220 { 1221 1222 TComSlice *slice = dpbPic->getSlice(i); 1223 TComReferencePictureSet *rps = slice->getRPS(); 1224 slice->setPOC( slice->getPOC() - deltaPocVal ); 1225 1226 // Also adjust the POC value stored in the RPS of each such slice 1227 for(Int j = rps->getNumberOfPictures(); j >= 0; j--) 1228 { 1229 rps->setPOC( j, rps->getPOC(j) - deltaPocVal ); 1230 } 1231 // Also adjust the value of refPOC 1232 for(Int k = 0; k < 2; k++) // For List 0 and List 1 1233 { 1234 RefPicList list = (k == 1) ? REF_PIC_LIST_1 : REF_PIC_LIST_0; 1235 for(Int j = 0; j < slice->getNumRefIdx(list); j++) 1236 { 1237 slice->setRefPOC( slice->getRefPOC(list, j) - deltaPocVal, list, j); 1238 } 1239 } 1240 } 1241 } 1242 iterPic++; 1243 } 1244 // Update the value of pocCRA 1245 m_pocCRA -= deltaPocVal; 1246 1247 // Update value of POCLastDisplay 1248 iPOCLastDisplay -= deltaPocVal; 1249 } 1250 Int maxPocLsb = 1 << m_apcSlicePilot->getSPS()->getBitsForPOC(); 1251 Int slicePicOrderCntLsb = m_apcSlicePilot->getPicOrderCntLsb(); 1252 1253 if( m_parseIdc == 1 || m_parseIdc == 2 ) // TODO This should be replaced by pocResettingFlag. 1254 { 1255 // Set poc for current slice 1256 if( m_apcSlicePilot->getPocResetIdc() == 1 ) 1257 { 1258 m_apcSlicePilot->setPOC( slicePicOrderCntLsb ); 1259 } 1260 else if( m_apcSlicePilot->getPocResetIdc() == 2 ) 1261 { 1262 m_apcSlicePilot->setPOC( 0 ); 1263 } 1264 else 1265 { 1266 Int picOrderCntMsb = m_apcSlicePilot->getCurrMsb( slicePicOrderCntLsb, m_apcSlicePilot->getFullPocResetFlag() ? 0 : m_apcSlicePilot->getPocLsbVal(), 0 , maxPocLsb ); 1267 m_apcSlicePilot->setPOC( picOrderCntMsb + slicePicOrderCntLsb ); 1268 } 1269 } 1270 else if (m_parseIdc == 3) 1271 { 1272 Int picOrderCntMsb = 0; 1273 if( m_apcSlicePilot->getPocMsbValPresentFlag() ) 1274 { 1275 picOrderCntMsb = m_apcSlicePilot->getPocMsbVal() * maxPocLsb; 1276 } 1277 else if( m_apcSlicePilot->getIdrPicFlag() ) 1278 { 1279 picOrderCntMsb = 0; 1280 } 1281 else 1282 { 1283 Int prevPicOrderCntLsb = this->getPrevPicOrderCnt() & ( maxPocLsb - 1); 1284 Int prevPicOrderCntMsb = this->getPrevPicOrderCnt() - prevPicOrderCntLsb; 1285 picOrderCntMsb = m_apcSlicePilot->getCurrMsb(slicePicOrderCntLsb, prevPicOrderCntLsb, prevPicOrderCntMsb, maxPocLsb ); 1286 } 1287 m_apcSlicePilot->setPOC( picOrderCntMsb + slicePicOrderCntLsb ); 1288 } 1289 1290 if( m_parseIdc == 1 || m_parseIdc == 3) 1291 { 1292 // Adjust prevPicOrderCnt 1293 if( !m_apcSlicePilot->getRaslPicFlag() 1294 && !m_apcSlicePilot->getRadlPicFlag() 1295 && (m_apcSlicePilot->getNalUnitType() % 2 == 1) 1296 && ( nalu.m_temporalId == 0 ) 1297 && !m_apcSlicePilot->getDiscardableFlag() ) 1298 { 1299 this->setPrevPicOrderCnt( m_apcSlicePilot->getPOC() ); 1300 } 1301 else if ( m_apcSlicePilot->getPocResetIdc() == 3 ) 1302 { 1303 this->setPrevPicOrderCnt( m_apcSlicePilot->getFullPocResetFlag() 1304 ? 0 : m_apcSlicePilot->getPocLsbVal() ); 1305 } 1306 #else 1108 1307 if (bNewPOC || m_layerId!=m_uiPrevLayerId) 1109 1308 { 1309 #endif 1110 1310 m_apcSlicePilot->applyReferencePictureSet(m_cListPic, m_apcSlicePilot->getRPS()); 1111 1311 } 1112 1312 #endif 1313 #if POC_RESET_IDC_DECODER 1314 if (m_apcSlicePilot->isNextSlice() && (bNewPOC || m_layerId!=m_uiPrevLayerId || m_parseIdc == 1) && !m_bFirstSliceInSequence ) 1315 #else 1113 1316 if (m_apcSlicePilot->isNextSlice() && (bNewPOC || m_layerId!=m_uiPrevLayerId) && !m_bFirstSliceInSequence ) 1317 #endif 1114 1318 { 1115 1319 m_prevPOC = m_apcSlicePilot->getPOC(); … … 1119 1323 } 1120 1324 1325 #if POC_RESET_IDC_DECODER 1326 m_parseIdc = -1; 1327 #endif 1328 1121 1329 // actual decoding starts here 1122 xActivateParameterSets();1330 xActivateParameterSets(); 1123 1331 1124 1332 #if REPN_FORMAT_IN_VPS … … 1201 1409 } 1202 1410 #endif 1203 1204 1411 // Alignment of TSA and STSA pictures across AU 1205 1412 if( m_apcSlicePilot->getLayerId() > 0 ) … … 1401 1608 // Get a new picture buffer 1402 1609 xGetNewPicBuffer (m_apcSlicePilot, pcPic); 1610 1611 #if POC_RESET_IDC_DECODER 1612 pcPic->setCurrAuFlag( true ); 1613 #endif 1403 1614 1404 1615 Bool isField = false; … … 2505 2716 } 2506 2717 #endif 2507 2718 #if POC_RESET_IDC_DECODER 2719 Void TDecTop::markAllPicsAsNoCurrAu() 2720 { 2721 for(Int i = 0; i < MAX_LAYERS; i++) 2722 { 2723 TComList<TComPic*>* listPic = this->getLayerDec(i)->getListPic(); 2724 TComList<TComPic*>::iterator iterPic = listPic->begin(); 2725 while ( iterPic != listPic->end() ) 2726 { 2727 TComPic *pcPic = *(iterPic); 2728 pcPic->setCurrAuFlag( false ); 2729 iterPic++; 2730 } 2731 } 2732 } 2733 #endif 2508 2734 #if Q0048_CGS_3D_ASYMLUT 2509 2735 Void TDecTop::initAsymLut(TComSlice *pcSlice) -
branches/SHM-6-dev/source/Lib/TLibDecoder/TDecTop.h
r747 r798 204 204 Bool m_firstPicInLayerDecodedFlag; 205 205 #endif 206 #if POC_RESET_IDC_DECODER 207 Int m_parseIdc; 208 Int m_lastPocPeriodId; 209 Int m_prevPicOrderCnt; 210 #endif 206 211 #if RESOLUTION_BASED_DPB 207 212 Int m_subDpbIdx; // Index to the sub-DPB that the layer belongs to. … … 244 249 #if EARLY_REF_PIC_MARKING 245 250 Void earlyPicMarking(Int maxTemporalLayer, std::vector<Int>& targetDecLayerIdList); 251 #endif 252 #if POC_RESET_IDC_DECODER 253 Int getParseIdc() { return m_parseIdc;} 254 Void setParseIdc(Int x) { m_parseIdc = x;} 255 Void markAllPicsAsNoCurrAu(); 256 257 Int getLastPocPeriodId() { return m_lastPocPeriodId; } 258 Void setLastPocPeriodId(Int x) { m_lastPocPeriodId = x; } 259 260 Int getPrevPicOrderCnt() { return m_prevPicOrderCnt; } 261 Void setPrevPicOrderCnt(Int const x) { m_prevPicOrderCnt = x; } 246 262 #endif 247 263 UInt getLayerId () { return m_layerId; }
Note: See TracChangeset for help on using the changeset viewer.