Changeset 730 in 3DVCSoftware for branches/HTM-9.0-dev0/source/Lib/TLibDecoder/TDecTop.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/TLibDecoder/TDecTop.cpp
r724 r730 635 635 #if H_MV 636 636 m_apcSlicePilot->setVPS(vps); 637 #if H_MV_6_PS_0092_17 638 // The nuh_layer_id value of the NAL unit containing the PPS that is activated for a layer layerA with nuh_layer_id equal to nuhLayerIdA shall be equal to 0, or nuhLayerIdA, or the nuh_layer_id of a direct or indirect reference layer of layerA. 639 assert( pps->getLayerId() == m_layerId || pps->getLayerId( ) == 0 || vps->getInDirectDependencyFlag( m_layerId, pps->getLayerId() ) ); 640 // The nuh_layer_id value of the NAL unit containing the SPS that is activated for a layer layerA with nuh_layer_id equal to nuhLayerIdA shall be equal to 0, or nuhLayerIdA, or the nuh_layer_id of a direct or indirect reference layer of layerA. 641 assert( sps->getLayerId() == m_layerId || sps->getLayerId( ) == 0 || vps->getInDirectDependencyFlag( m_layerId, sps->getLayerId() ) ); 642 #endif 637 643 sps->inferRepFormat ( vps , m_layerId ); 638 644 sps->inferScalingList( m_parameterSetManagerDecoder.getActiveSPS( sps->getSpsScalingListRefLayerId() ) ); … … 665 671 666 672 #if H_MV 673 #if H_MV_FIX_SKIP_PICTURES 674 Bool TDecTop::xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay, Bool newLayerFlag, Bool& sliceSkippedFlag ) 675 #else 667 676 Bool TDecTop::xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay, Bool newLayerFlag ) 677 #endif 668 678 { 669 679 assert( nalu.m_layerId == m_layerId ); 670 671 680 #else 672 681 Bool TDecTop::xDecodeSlice(InputNALUnit &nalu, Int &iSkipFrame, Int iPOCLastDisplay ) … … 722 731 #endif 723 732 #endif 733 734 #if H_MV_LAYER_WISE_STARTUP 735 xCeckNoClrasOutput(); 736 #endif 724 737 // Skip pictures due to random access 725 738 if (isRandomAccessSkipPicture(iSkipFrame, iPOCLastDisplay)) 726 739 { 727 m_prevSliceSkipped = true; 728 m_skippedPOC = m_apcSlicePilot->getPOC(); 740 m_prevSliceSkipped = true; 741 m_skippedPOC = m_apcSlicePilot->getPOC(); 742 #if H_MV_FIX_SKIP_PICTURES 743 sliceSkippedFlag = true; 744 #endif 729 745 return false; 730 746 } … … 732 748 if (isSkipPictureForBLA(iPOCLastDisplay)) 733 749 { 734 m_prevSliceSkipped = true; 735 m_skippedPOC = m_apcSlicePilot->getPOC(); 750 m_prevSliceSkipped = true; 751 m_skippedPOC = m_apcSlicePilot->getPOC(); 752 #if H_MV_FIX_SKIP_PICTURES 753 sliceSkippedFlag = true; 754 #endif 736 755 return false; 737 756 } … … 788 807 xCreateLostPicture(lostPoc-1); 789 808 } 809 790 810 if (m_bFirstSliceInPicture) 791 811 { … … 1171 1191 1172 1192 #if H_MV 1193 #if H_MV_FIX_SKIP_PICTURES 1194 Bool TDecTop::decode(InputNALUnit& nalu, Int& iSkipFrame, Int& iPOCLastDisplay, Bool newLayerFlag, Bool& sliceSkippedFlag ) 1195 #else 1173 1196 Bool TDecTop::decode(InputNALUnit& nalu, Int& iSkipFrame, Int& iPOCLastDisplay, Bool newLayerFlag) 1197 #endif 1174 1198 #else 1175 1199 Bool TDecTop::decode(InputNALUnit& nalu, Int& iSkipFrame, Int& iPOCLastDisplay) … … 1216 1240 case NAL_UNIT_CODED_SLICE_RASL_R: 1217 1241 #if H_MV 1242 #if H_MV_FIX_SKIP_PICTURES 1243 return xDecodeSlice(nalu, iSkipFrame, iPOCLastDisplay, newLayerFlag, sliceSkippedFlag ); 1244 #else 1218 1245 return xDecodeSlice(nalu, iSkipFrame, iPOCLastDisplay, newLayerFlag); 1246 #endif 1219 1247 #else 1220 1248 return xDecodeSlice(nalu, iSkipFrame, iPOCLastDisplay); … … 1242 1270 return true; 1243 1271 } 1272 1244 1273 return false; 1245 1274 } … … 1265 1294 return true; 1266 1295 } 1296 #if H_MV_LAYER_WISE_STARTUP 1297 else if ( !m_layerInitilizedFlag[ m_layerId ] ) // start of random access point, m_pocRandomAccess has not been set yet. 1298 #else 1267 1299 else if (m_pocRandomAccess == MAX_INT) // start of random access point, m_pocRandomAccess has not been set yet. 1300 #endif 1268 1301 { 1269 1302 if ( m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA … … 1272 1305 || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL ) 1273 1306 { 1307 1308 #if H_MV_LAYER_WISE_STARTUP 1309 if ( xAllRefLayersInitilized() ) 1310 { 1311 m_layerInitilizedFlag[ m_layerId ] = true; 1312 m_pocRandomAccess = m_apcSlicePilot->getPOC(); 1313 } 1314 else 1315 { 1316 return true; 1317 } 1318 #else 1274 1319 // set the POC random access since we need to skip the reordered pictures in the case of CRA/CRANT/BLA/BLANT. 1275 1320 m_pocRandomAccess = m_apcSlicePilot->getPOC(); 1321 #endif 1276 1322 } 1277 1323 else if ( m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP ) 1278 1324 { 1325 #if H_MV_LAYER_WISE_STARTUP 1326 if ( xAllRefLayersInitilized() ) 1327 { 1328 m_layerInitilizedFlag[ m_layerId ] = true; 1329 m_pocRandomAccess = -MAX_INT; // no need to skip the reordered pictures in IDR, they are decodable. 1330 } 1331 else 1332 { 1333 return true; 1334 } 1335 #else 1279 1336 m_pocRandomAccess = -MAX_INT; // no need to skip the reordered pictures in IDR, they are decodable. 1337 #endif 1280 1338 } 1281 1339 else 1282 1340 { 1341 #if H_MV_FIX_SKIP_PICTURES 1342 static Bool warningMessage[MAX_NUM_LAYERS]; 1343 static Bool warningInitFlag = false; 1344 1345 if (!warningInitFlag) 1346 { 1347 for ( Int i = 0; i < MAX_NUM_LAYERS; i++) 1348 { 1349 warningMessage[i] = true; 1350 } 1351 warningInitFlag = true; 1352 } 1353 1354 if ( warningMessage[getLayerId()] ) 1355 { 1356 printf("\nLayer%3d No valid random access point. VCL NAL units of this layer are discarded until next layer initialization picture. ", getLayerId() ); 1357 warningMessage[m_layerId] = false; 1358 } 1359 #else 1283 1360 static Bool warningMessage = false; 1284 1361 if(!warningMessage) … … 1287 1364 warningMessage = true; 1288 1365 } 1366 #endif 1289 1367 return true; 1290 1368 } … … 1296 1374 return true; 1297 1375 } 1376 #if H_MV_LAYER_WISE_STARTUP 1377 return !m_layerInitilizedFlag[ getLayerId() ]; 1378 #else 1298 1379 // if we reach here, then the picture is not skipped. 1299 1380 return false; 1381 #endif 1300 1382 } 1301 1383 … … 1338 1420 } 1339 1421 } 1422 1423 #if H_MV_LAYER_WISE_STARTUP 1424 Void TDecTop::xCeckNoClrasOutput() 1425 { 1426 // This part needs further testing! 1427 if ( getLayerId() == 0 ) 1428 { 1429 NalUnitType nut = m_apcSlicePilot->getNalUnitType(); 1430 1431 Bool isBLA = ( nut == NAL_UNIT_CODED_SLICE_BLA_W_LP ) || ( nut == NAL_UNIT_CODED_SLICE_BLA_N_LP ) || ( nut == NAL_UNIT_CODED_SLICE_BLA_W_RADL ); 1432 Bool isIDR = ( nut == NAL_UNIT_CODED_SLICE_IDR_W_RADL ) || ( nut == NAL_UNIT_CODED_SLICE_IDR_N_LP ); 1433 Bool noClrasOutputFlag = isBLA || ( isIDR && m_apcSlicePilot->getCrossLayerBlaFlag() ); 1434 1435 if ( noClrasOutputFlag ) 1436 { 1437 for (Int i = 0; i < MAX_NUM_LAYER_IDS; i++) 1438 { 1439 m_layerInitilizedFlag[i] = false; 1440 } 1441 } 1442 } 1443 } 1444 1445 Bool TDecTop::xAllRefLayersInitilized() 1446 { 1447 Bool allRefLayersInitilizedFlag = true; 1448 TComVPS* vps = m_parameterSetManagerDecoder.getPrefetchedVPS( 0 ); 1449 for (Int i = 0; i < vps->getNumDirectRefLayers( getLayerId() ); i++ ) 1450 { 1451 Int refLayerId = vps->getRefLayerId( m_layerId, i ); 1452 allRefLayersInitilizedFlag = allRefLayersInitilizedFlag && m_layerInitilizedFlag[ refLayerId ]; 1453 } 1454 1455 return allRefLayersInitilizedFlag; 1456 } 1457 #endif 1340 1458 #endif 1341 1459 //! \}
Note: See TracChangeset for help on using the changeset viewer.