Changeset 738 in 3DVCSoftware for trunk/source/Lib/TLibDecoder/TDecTop.cpp
- Timestamp:
- 10 Dec 2013, 13:50:12 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/Lib/TLibDecoder/TDecTop.cpp
r724 r738 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 ); … … 722 732 #endif 723 733 #endif 734 735 #if H_MV_LAYER_WISE_STARTUP 736 xCeckNoClrasOutput(); 737 #endif 724 738 // Skip pictures due to random access 725 739 if (isRandomAccessSkipPicture(iSkipFrame, iPOCLastDisplay)) … … 727 741 m_prevSliceSkipped = true; 728 742 m_skippedPOC = m_apcSlicePilot->getPOC(); 743 #if H_MV_FIX_SKIP_PICTURES 744 sliceSkippedFlag = true; 745 #endif 729 746 return false; 730 747 } … … 734 751 m_prevSliceSkipped = true; 735 752 m_skippedPOC = m_apcSlicePilot->getPOC(); 753 #if H_MV_FIX_SKIP_PICTURES 754 sliceSkippedFlag = true; 755 #endif 736 756 return false; 737 757 } … … 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); … … 1265 1293 return true; 1266 1294 } 1295 #if H_MV_LAYER_WISE_STARTUP 1296 else if ( !m_layerInitilizedFlag[ m_layerId ] ) // start of random access point, m_pocRandomAccess has not been set yet. 1297 #else 1267 1298 else if (m_pocRandomAccess == MAX_INT) // start of random access point, m_pocRandomAccess has not been set yet. 1299 #endif 1268 1300 { 1269 1301 if ( m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA … … 1272 1304 || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL ) 1273 1305 { 1306 1307 #if H_MV_LAYER_WISE_STARTUP 1308 if ( xAllRefLayersInitilized() ) 1309 { 1310 m_layerInitilizedFlag[ m_layerId ] = true; 1311 m_pocRandomAccess = m_apcSlicePilot->getPOC(); 1312 } 1313 else 1314 { 1315 return true; 1316 } 1317 #else 1274 1318 // set the POC random access since we need to skip the reordered pictures in the case of CRA/CRANT/BLA/BLANT. 1275 1319 m_pocRandomAccess = m_apcSlicePilot->getPOC(); 1320 #endif 1276 1321 } 1277 1322 else if ( m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP ) 1278 1323 { 1324 #if H_MV_LAYER_WISE_STARTUP 1325 if ( xAllRefLayersInitilized() ) 1326 { 1327 m_layerInitilizedFlag[ m_layerId ] = true; 1279 1328 m_pocRandomAccess = -MAX_INT; // no need to skip the reordered pictures in IDR, they are decodable. 1280 1329 } 1281 1330 else 1282 1331 { 1332 return true; 1333 } 1334 #else 1335 m_pocRandomAccess = -MAX_INT; // no need to skip the reordered pictures in IDR, they are decodable. 1336 #endif 1337 } 1338 else 1339 { 1340 #if H_MV_FIX_SKIP_PICTURES 1341 static Bool warningMessage[MAX_NUM_LAYERS]; 1342 static Bool warningInitFlag = false; 1343 1344 if (!warningInitFlag) 1345 { 1346 for ( Int i = 0; i < MAX_NUM_LAYERS; i++) 1347 { 1348 warningMessage[i] = true; 1349 } 1350 warningInitFlag = true; 1351 } 1352 1353 if ( warningMessage[getLayerId()] ) 1354 { 1355 printf("\nLayer%3d No valid random access point. VCL NAL units of this layer are discarded until next layer initialization picture. ", getLayerId() ); 1356 warningMessage[m_layerId] = false; 1357 } 1358 #else 1283 1359 static Bool warningMessage = false; 1284 1360 if(!warningMessage) … … 1287 1363 warningMessage = true; 1288 1364 } 1365 #endif 1289 1366 return true; 1290 1367 } … … 1296 1373 return true; 1297 1374 } 1375 #if H_MV_LAYER_WISE_STARTUP 1376 return !m_layerInitilizedFlag[ getLayerId() ]; 1377 #else 1298 1378 // if we reach here, then the picture is not skipped. 1299 1379 return false; 1380 #endif 1300 1381 } 1301 1382 … … 1338 1419 } 1339 1420 } 1421 1422 #if H_MV_LAYER_WISE_STARTUP 1423 Void TDecTop::xCeckNoClrasOutput() 1424 { 1425 // This part needs further testing! 1426 if ( getLayerId() == 0 ) 1427 { 1428 NalUnitType nut = m_apcSlicePilot->getNalUnitType(); 1429 1430 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 ); 1431 Bool isIDR = ( nut == NAL_UNIT_CODED_SLICE_IDR_W_RADL ) || ( nut == NAL_UNIT_CODED_SLICE_IDR_N_LP ); 1432 Bool noClrasOutputFlag = isBLA || ( isIDR && m_apcSlicePilot->getCrossLayerBlaFlag() ); 1433 1434 if ( noClrasOutputFlag ) 1435 { 1436 for (Int i = 0; i < MAX_NUM_LAYER_IDS; i++) 1437 { 1438 m_layerInitilizedFlag[i] = false; 1439 } 1440 } 1441 } 1442 } 1443 1444 Bool TDecTop::xAllRefLayersInitilized() 1445 { 1446 Bool allRefLayersInitilizedFlag = true; 1447 TComVPS* vps = m_parameterSetManagerDecoder.getPrefetchedVPS( 0 ); 1448 for (Int i = 0; i < vps->getNumDirectRefLayers( getLayerId() ); i++ ) 1449 { 1450 Int refLayerId = vps->getRefLayerId( m_layerId, i ); 1451 allRefLayersInitilizedFlag = allRefLayersInitilizedFlag && m_layerInitilizedFlag[ refLayerId ]; 1452 } 1453 1454 return allRefLayersInitilizedFlag; 1455 } 1456 #endif 1340 1457 #endif 1341 1458 //! \}
Note: See TracChangeset for help on using the changeset viewer.