Changeset 903 in SHVCSoftware for branches/SHM-dev/source/Lib/TLibDecoder
- Timestamp:
- 10 Oct 2014, 18:22:03 (11 years ago)
- Location:
- branches/SHM-dev/source/Lib/TLibDecoder
- Files:
-
- 3 edited
-
TDecCAVLC.cpp (modified) (4 diffs)
-
TDecTop.cpp (modified) (10 diffs)
-
TDecTop.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp
r902 r903 2033 2033 READ_FLAG(uiCode, "max_one_active_ref_layer_flag" ); 2034 2034 vps->setMaxOneActiveRefLayerFlag(uiCode); 2035 #if P0297_VPS_POC_LSB_ALIGNED_FLAG 2036 READ_FLAG(uiCode, "vps_poc_lsb_aligned_flag"); 2037 vps->setVpsPocLsbAlignedFlag(uiCode); 2038 #endif 2035 2039 #if O0062_POC_LSB_NOT_PRESENT_FLAG 2036 2040 for(i = 1; i< vps->getMaxLayers(); i++) … … 2228 2232 } 2229 2233 2230 // vps_poc_lsb_aligned_flag 2231 // When not present, vps_poc_lsb_aligned_flag is inferred to be equal to 0. 2234 #if P0297_VPS_POC_LSB_ALIGNED_FLAG 2235 vps->setVpsPocLsbAlignedFlag(false); 2236 #endif 2232 2237 2233 2238 #if O0062_POC_LSB_NOT_PRESENT_FLAG … … 3892 3897 3893 3898 // Derive the value of PocMsbValRequiredFlag 3894 rpcSlice->setPocMsbValRequiredFlag( rpcSlice->getCraPicFlag() || rpcSlice->getBlaPicFlag() 3895 /* || related to vps_poc_lsb_aligned_flag */ 3896 ); 3897 3898 if( !rpcSlice->getPocMsbValRequiredFlag() /* vps_poc_lsb_aligned_flag */ ) 3899 { 3900 READ_FLAG( uiCode, "poc_msb_val_present_flag"); rpcSlice->setPocMsbValPresentFlag( uiCode ? true : false ); 3899 #if P0297_VPS_POC_LSB_ALIGNED_FLAG 3900 rpcSlice->setPocMsbValRequiredFlag( (rpcSlice->getCraPicFlag() || rpcSlice->getBlaPicFlag()) 3901 && (!rpcSlice->getVPS()->getVpsPocLsbAlignedFlag() || 3902 (rpcSlice->getVPS()->getVpsPocLsbAlignedFlag() && rpcSlice->getVPS()->getNumDirectRefLayers(rpcSlice->getLayerId()) == 0)) 3903 ); 3904 #else 3905 rpcSlice->setPocMsbValRequiredFlag( rpcSlice->getCraPicFlag() || rpcSlice->getBlaPicFlag() ); 3906 #endif 3907 3908 #if P0297_VPS_POC_LSB_ALIGNED_FLAG 3909 if (!rpcSlice->getPocMsbValRequiredFlag() && rpcSlice->getVPS()->getVpsPocLsbAlignedFlag()) 3910 #else 3911 if (!rpcSlice->getPocMsbValRequiredFlag() /* vps_poc_lsb_aligned_flag */) 3912 #endif 3913 { 3914 #if P0297_VPS_POC_LSB_ALIGNED_FLAG 3915 READ_FLAG(uiCode, "poc_msb_cycle_val_present_flag"); rpcSlice->setPocMsbValPresentFlag(uiCode ? true : false); 3916 #else 3917 READ_FLAG(uiCode, "poc_msb_val_present_flag"); rpcSlice->setPocMsbValPresentFlag(uiCode ? true : false); 3918 #endif 3901 3919 } 3902 3920 else … … 3925 3943 if( rpcSlice->getPocMsbValPresentFlag() ) 3926 3944 { 3945 #if P0297_VPS_POC_LSB_ALIGNED_FLAG 3946 READ_UVLC( uiCode, "poc_msb_cycle_val"); rpcSlice->setPocMsbVal( uiCode ); 3947 #else 3927 3948 READ_UVLC( uiCode, "poc_msb_val"); rpcSlice->setPocMsbVal( uiCode ); 3949 #endif 3928 3950 3929 3951 #if !POC_RESET_IDC_DECODER -
branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp
r901 r903 120 120 resetPocRestrictionCheckParameters(); 121 121 #endif 122 #if P0297_VPS_POC_LSB_ALIGNED_FLAG 123 m_pocResettingFlag = false; 124 m_pocDecrementedInDPBFlag = false; 125 #endif 122 126 } 123 127 … … 1176 1180 } 1177 1181 #endif 1182 1178 1183 #if POC_RESET_IDC_DECODER 1179 1184 if( m_parseIdc != -1 ) // Second pass for a POC resetting picture … … 1201 1206 #endif 1202 1207 markAllPicsAsNoCurrAu(); 1203 } 1208 #if P0297_VPS_POC_LSB_ALIGNED_FLAG 1209 for (UInt i = 0; i < MAX_LAYERS; i++) 1210 { 1211 m_ppcTDecTop[i]->m_pocDecrementedInDPBFlag = false; 1212 } 1213 #endif 1214 } 1215 1216 1217 #if P0297_VPS_POC_LSB_ALIGNED_FLAG 1218 m_pocResettingFlag = false; 1219 1220 if (m_apcSlicePilot->getPocResetIdc() != 0) 1221 { 1222 if (m_apcSlicePilot->getVPS()->getVpsPocLsbAlignedFlag()) 1223 { 1224 m_pocResettingFlag = true; 1225 } 1226 else if (m_pocDecrementedInDPBFlag) 1227 { 1228 m_pocResettingFlag = false; 1229 } 1230 else 1231 { 1232 m_pocResettingFlag = true; 1233 } 1234 } 1235 #endif 1204 1236 1205 1237 if( m_apcSlicePilot->getPocResetIdc() && m_apcSlicePilot->getSliceIdx() == 0 ) … … 1249 1281 #if ALIGNED_BUMPING 1250 1282 #if POC_RESET_IDC_DECODER 1283 1284 #if P0297_VPS_POC_LSB_ALIGNED_FLAG 1285 UInt affectedLayerList[MAX_NUM_LAYER_IDS]; 1286 Int numAffectedLayers; 1287 1288 affectedLayerList[0] = m_apcSlicePilot->getLayerId(); 1289 numAffectedLayers = 1; 1290 1291 if (m_apcSlicePilot->getVPS()->getVpsPocLsbAlignedFlag()) 1292 { 1293 for (UInt j = 0; j < m_apcSlicePilot->getVPS()->getNumPredictedLayers(m_apcSlicePilot->getLayerId()); j++) 1294 { 1295 affectedLayerList[j + 1] = m_apcSlicePilot->getVPS()->getPredictedLayerId(m_apcSlicePilot->getLayerId(), j); 1296 } 1297 numAffectedLayers = m_apcSlicePilot->getVPS()->getNumPredictedLayers(m_apcSlicePilot->getLayerId()) + 1; 1298 } 1299 #endif 1300 1251 1301 //if( (bNewPOC || m_layerId != m_uiPrevLayerId) && ( m_parseIdc != 1) ) 1252 if( m_parseIdc == 1 ) 1302 #if P0297_VPS_POC_LSB_ALIGNED_FLAG 1303 if (m_parseIdc == 1 && m_pocResettingFlag) 1304 #else 1305 if (m_parseIdc == 1) 1306 #endif 1253 1307 { 1254 1308 // Invoke output of pictures if the current picture is a POC reset picture … … 1301 1355 Int deltaPocVal = pocMsbDelta + pocLsbDelta; 1302 1356 1357 #if P0297_VPS_POC_LSB_ALIGNED_FLAG 1358 for (UInt layerIdx = 0; layerIdx < numAffectedLayers; layerIdx++) 1359 { 1360 if (!m_ppcTDecTop[affectedLayerList[layerIdx]]->m_pocDecrementedInDPBFlag) 1361 { 1362 m_ppcTDecTop[affectedLayerList[layerIdx]]->m_pocDecrementedInDPBFlag = true; 1363 TComList<TComPic*>::iterator iterPic = m_ppcTDecTop[affectedLayerList[layerIdx]]->getListPic()->begin(); 1364 while (iterPic != m_ppcTDecTop[affectedLayerList[layerIdx]]->getListPic()->end()) 1365 #else 1303 1366 //Reset all POC for DPB -> basically do it for each slice in the picutre 1304 1367 TComList<TComPic*>::iterator iterPic = m_cListPic.begin(); … … 1306 1369 // Iterate through all picture in DPB 1307 1370 while( iterPic != m_cListPic.end() ) 1371 #endif 1308 1372 { 1309 1373 TComPic *dpbPic = *iterPic; 1310 1374 // Check if the picture pointed to by iterPic is either used for reference or 1311 1375 // needed for output, are in the same layer, and not the current picture. 1312 if( /* ( ( dpbPic->getSlice(0)->isReferenced() ) || ( dpbPic->getOutputMark() ) ) 1376 #if P0297_VPS_POC_LSB_ALIGNED_FLAG 1377 assert(dpbPic->getLayerId() == affectedLayerList[layerIdx]); 1378 if ( (dpbPic->getReconMark()) && (dpbPic->getPicSym()->getSlice(0)->getPicOutputFlag()) ) 1379 #else 1380 if ( /* ( ( dpbPic->getSlice(0)->isReferenced() ) || ( dpbPic->getOutputMark() ) ) 1313 1381 &&*/ ( dpbPic->getLayerId() == m_apcSlicePilot->getLayerId() ) 1314 1382 && ( dpbPic->getReconMark() ) && ( dpbPic->getPicSym()->getSlice(0)->getPicOutputFlag() )) 1383 #endif 1315 1384 { 1316 1385 for(Int i = dpbPic->getNumAllocatedSlice()-1; i >= 0; i--) … … 1339 1408 iterPic++; 1340 1409 } 1410 #if P0297_VPS_POC_LSB_ALIGNED_FLAG 1411 // Update the value of pocCRA 1412 m_ppcTDecTop[affectedLayerList[layerIdx]]->m_pocCRA -= deltaPocVal; 1413 } 1414 } 1415 #else 1341 1416 // Update the value of pocCRA 1342 1417 m_pocCRA -= deltaPocVal; 1418 #endif 1343 1419 1344 1420 // Update value of POCLastDisplay … … 1348 1424 Int slicePicOrderCntLsb = m_apcSlicePilot->getPicOrderCntLsb(); 1349 1425 1350 if( m_parseIdc == 1 || m_parseIdc == 2 ) // TODO This should be replaced by pocResettingFlag. 1426 #if P0297_VPS_POC_LSB_ALIGNED_FLAG 1427 if (m_pocResettingFlag && (m_parseIdc == 1 || m_parseIdc == 2)) 1428 #else 1429 if (m_parseIdc == 1 || m_parseIdc == 2) // TODO This should be replaced by pocResettingFlag. 1430 #endif 1351 1431 { 1352 1432 // Set poc for current slice … … 1394 1474 && !m_apcSlicePilot->getDiscardableFlag() ) 1395 1475 { 1476 #if P0297_VPS_POC_LSB_ALIGNED_FLAG 1477 for (UInt i = 0; i < numAffectedLayers; i++) 1478 { 1479 m_ppcTDecTop[affectedLayerList[i]]->setPrevPicOrderCnt(m_apcSlicePilot->getPOC()); 1480 } 1481 #else 1396 1482 this->setPrevPicOrderCnt( m_apcSlicePilot->getPOC() ); 1483 #endif 1397 1484 } 1398 1485 else if ( m_apcSlicePilot->getPocResetIdc() == 3 ) 1399 1486 { 1487 #if P0297_VPS_POC_LSB_ALIGNED_FLAG 1488 if (!m_firstPicInLayerDecodedFlag || (m_firstPicInLayerDecodedFlag && m_pocResettingFlag)) 1489 { 1490 for (UInt i = 0; i < numAffectedLayers; i++) 1491 { 1492 m_ppcTDecTop[affectedLayerList[i]]->setPrevPicOrderCnt( m_apcSlicePilot->getFullPocResetFlag() 1493 ? 0 : m_apcSlicePilot->getPocLsbVal() ); 1494 } 1495 } 1496 #else 1400 1497 this->setPrevPicOrderCnt( m_apcSlicePilot->getFullPocResetFlag() 1401 1498 ? 0 : m_apcSlicePilot->getPocLsbVal() ); 1499 #endif 1402 1500 } 1403 1501 #else … … 2312 2410 // Decode a picture 2313 2411 m_cGopDecoder.decompressSlice(nalu.m_Bitstream, pcPic); 2412 2413 #if P0297_VPS_POC_LSB_ALIGNED_FLAG 2414 setFirstPicInLayerDecodedFlag(true); 2415 #endif 2314 2416 2315 2417 m_bFirstSliceInPicture = false; -
branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.h
r856 r903 127 127 UInt m_numLayer; 128 128 TDecTop** m_ppcTDecTop; 129 #if P0297_VPS_POC_LSB_ALIGNED_FLAG 130 Bool m_pocResettingFlag; 131 Bool m_pocDecrementedInDPBFlag; 132 #endif 129 133 #if AVC_BASE 130 134 fstream* m_pBLReconFile;
Note: See TracChangeset for help on using the changeset viewer.