Changeset 964 in 3DVCSoftware for trunk/source/Lib/TLibDecoder/TDecTop.cpp
- Timestamp:
- 5 Jul 2014, 05:16:45 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/Lib/TLibDecoder/TDecTop.cpp
r884 r964 365 365 m_prevSliceSkipped = false; 366 366 m_skippedPOC = 0; 367 #if SETTING_NO_OUT_PIC_PRIOR 368 m_bFirstSliceInBitstream = true; 369 m_lastPOCNoOutputPriorPics = -1; 370 m_craNoRaslOutputFlag = false; 371 m_isNoOutputPriorPics = false; 372 #endif 373 #if H0056_EOS_CHECKS 374 m_isLastNALWasEos = false; 375 #endif 367 376 #if H_MV 368 377 m_layerId = 0; … … 372 381 m_isDepth = false; 373 382 m_pcCamParsCollector = 0; 383 #endif 384 #if H_MV_HLS_8_HRD_Q0102_08 385 m_targetOptLayerSetIdx = -1; 374 386 #endif 375 387 #endif … … 471 483 TComVPS* vps = pcSlice->getVPS(); 472 484 TComDpbSize* dpbSize = vps->getDpbSize(); 473 Int lsIdx = vps-> getLayerSetIdxForOutputLayerSet( getTargetOutputLayerSetIdx()); // Is this correct, seems to be missing in spec?485 Int lsIdx = vps->olsIdxToLsIdx( getTargetOutputLayerSetIdx()); // Is this correct, seems to be missing in spec? 474 486 Int layerIdx = vps->getIdxInLayerSet ( lsIdx, getLayerId() ); 475 487 Int subDpbIdx = dpbSize->getSubDpbAssigned( lsIdx, layerIdx ); … … 499 511 { 500 512 rpcPic->setOutputMark(false); 513 #if H_MV_HLS_7_VPS_P0300_27 514 rpcPic->setPicOutputFlag(false); 515 #endif 501 516 bBufferIsAvailable = true; 502 517 break; … … 506 521 { 507 522 rpcPic->setOutputMark(false); 523 #if H_MV_HLS_7_VPS_P0300_27 524 rpcPic->setPicOutputFlag(false); 525 #endif 508 526 rpcPic->setReconMark( false ); 509 527 rpcPic->getPicYuvRec()->setBorderExtension( false ); … … 550 568 TComSlice::markIvRefPicsAsShortTerm( m_refPicSetInterLayer0, m_refPicSetInterLayer1 ); 551 569 TComSlice::markCurrPic( pcPic ); 570 #if !H_MV_HLS_8_DBP_NODOC_42 552 571 TComSlice::markIvRefPicsAsUnused ( m_ivPicLists, targetDecLayerIdSet, m_parameterSetManagerDecoder.getActiveVPS(), m_layerId, poc ); 553 572 #endif 573 #endif 554 574 m_bFirstSliceInPicture = true; 555 575 556 576 return; 557 577 } 578 579 #if SETTING_NO_OUT_PIC_PRIOR 580 Void TDecTop::checkNoOutputPriorPics (TComList<TComPic*>*& rpcListPic) 581 { 582 if (!rpcListPic || !m_isNoOutputPriorPics) return; 583 584 TComList<TComPic*>::iterator iterPic = rpcListPic->begin(); 585 586 while (iterPic != rpcListPic->end()) 587 { 588 TComPic*& pcPicTmp = *(iterPic++); 589 if (m_lastPOCNoOutputPriorPics != pcPicTmp->getPOC()) 590 { 591 pcPicTmp->setOutputMark(false); 592 #if H_MV_HLS_7_VPS_P0300_27 593 pcPicTmp->setPicOutputFlag(false); 594 #endif 595 } 596 } 597 } 598 #endif 558 599 559 600 Void TDecTop::xCreateLostPicture(Int iLostPoc) … … 620 661 TComVPS* vps = m_parameterSetManagerDecoder.getVPS(sps->getVPSId()); 621 662 assert (vps != 0); 622 if ( false ==m_parameterSetManagerDecoder.activatePPS(m_apcSlicePilot->getPPSId(),m_apcSlicePilot->isIRAP(), m_layerId ) )663 if (!m_parameterSetManagerDecoder.activatePPS(m_apcSlicePilot->getPPSId(),m_apcSlicePilot->isIRAP(), m_layerId ) ) 623 664 #else 624 665 if (false == m_parameterSetManagerDecoder.activatePPS(m_apcSlicePilot->getPPSId(),m_apcSlicePilot->isIRAP())) … … 628 669 assert (0); 629 670 } 671 672 #if H_MV_HLS_8_HRD_Q0102_08 673 sps->inferSpsMaxDecPicBufferingMinus1( vps, m_targetOptLayerSetIdx, getLayerId(), false ); 674 #endif 675 676 #if H_MV_HLS_8_RPS_Q0100_36 677 vps->inferDbpSizeLayerSetZero( sps, false ); 678 #endif 679 680 #if H_MV_HLS_8_PMS_Q0195_21 681 // When the value of vps_num_rep_formats_minus1 in the active VPS is equal to 0 682 if ( vps->getVpsNumRepFormatsMinus1() == 0 ) 683 { 684 //, it is a requirement of bitstream conformance that the value of update_rep_format_flag shall be equal to 0. 685 assert( sps->getUpdateRepFormatFlag() == false ); 686 } 687 #endif 688 689 #if H_MV_HLS_8_RPS_Q0100_36 690 sps->checkRpsMaxNumPics( vps, getLayerId() ); 691 #endif 692 693 #if H_MV_HLS_8_MIS_Q0177_22 694 if( m_layerId > 0 ) 695 { 696 sps->setTemporalIdNestingFlag( (sps->getMaxTLayers() > 1) ? vps->getTemporalNestingFlag() : true ); 697 } 698 #endif 630 699 631 700 if( pps->getDependentSliceSegmentsEnabledFlag() ) … … 719 788 m_apcSlicePilot->setLayerId( nalu.m_layerId ); 720 789 #endif 790 791 #if H_MV_HLS_8_HRD_Q0102_08 792 m_cEntropyDecoder.decodeSliceHeader (m_apcSlicePilot, &m_parameterSetManagerDecoder, m_targetOptLayerSetIdx ); 793 #else 721 794 m_cEntropyDecoder.decodeSliceHeader (m_apcSlicePilot, &m_parameterSetManagerDecoder); 722 795 #endif 723 796 // set POC for dependent slices in skipped pictures 724 797 if(m_apcSlicePilot->getDependentSliceSegmentFlag() && m_prevSliceSkipped) … … 741 814 #endif 742 815 816 #if SETTING_NO_OUT_PIC_PRIOR 817 //For inference of NoOutputOfPriorPicsFlag 818 if (m_apcSlicePilot->getRapPicFlag()) 819 { 820 if ((m_apcSlicePilot->getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && m_apcSlicePilot->getNalUnitType() <= NAL_UNIT_CODED_SLICE_IDR_N_LP) || 821 (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA && m_bFirstSliceInSequence) || 822 (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA && m_apcSlicePilot->getHandleCraAsBlaFlag())) 823 { 824 m_apcSlicePilot->setNoRaslOutputFlag(true); 825 } 826 //the inference for NoOutputPriorPicsFlag 827 if (!m_bFirstSliceInBitstream && m_apcSlicePilot->getRapPicFlag() && m_apcSlicePilot->getNoRaslOutputFlag()) 828 { 829 if (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA) 830 { 831 m_apcSlicePilot->setNoOutputPriorPicsFlag(true); 832 } 833 } 834 else 835 { 836 m_apcSlicePilot->setNoOutputPriorPicsFlag(false); 837 } 838 839 if(m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA) 840 { 841 m_craNoRaslOutputFlag = m_apcSlicePilot->getNoRaslOutputFlag(); 842 } 843 } 844 if (m_apcSlicePilot->getRapPicFlag() && m_apcSlicePilot->getNoOutputPriorPicsFlag()) 845 { 846 m_lastPOCNoOutputPriorPics = m_apcSlicePilot->getPOC(); 847 m_isNoOutputPriorPics = true; 848 } 849 else 850 { 851 m_isNoOutputPriorPics = false; 852 } 853 854 //For inference of PicOutputFlag 855 if (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_N || m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_R) 856 { 857 if ( m_craNoRaslOutputFlag ) 858 { 859 m_apcSlicePilot->setPicOutputFlag(false); 860 } 861 } 862 #endif 863 864 #if FIX_POC_CRA_NORASL_OUTPUT 865 if (m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA && m_craNoRaslOutputFlag) //Reset POC MSB when CRA has NoRaslOutputFlag equal to 1 866 { 867 Int iMaxPOClsb = 1 << m_apcSlicePilot->getSPS()->getBitsForPOC(); 868 m_apcSlicePilot->setPOC( m_apcSlicePilot->getPOC() & (iMaxPOClsb - 1) ); 869 } 870 #endif 743 871 #if H_MV 744 872 xCeckNoClrasOutput(); … … 769 897 770 898 //we should only get a different poc for a new picture (with CTU address==0) 771 if (m_apcSlicePilot->isNextSlice() && m_apcSlicePilot->getPOC()!=m_prevPOC && !m_bFirstSliceInSequence && ( !m_apcSlicePilot->getSliceCurStartCUAddr()==0))899 if (m_apcSlicePilot->isNextSlice() && m_apcSlicePilot->getPOC()!=m_prevPOC && !m_bFirstSliceInSequence && (m_apcSlicePilot->getSliceCurStartCUAddr()!=0)) 772 900 { 773 901 printf ("Warning, the first slice of a picture might have been lost!\n"); … … 810 938 } 811 939 m_bFirstSliceInSequence = false; 940 #if SETTING_NO_OUT_PIC_PRIOR 941 m_bFirstSliceInBitstream = false; 942 #endif 812 943 //detect lost reference picture and insert copy of earlier frame. 813 944 Int lostPoc; … … 1127 1258 #endif 1128 1259 #if H_3D 1129 // Preliminary fix. assuming that all sps refer to the same SPS.1260 // Preliminary fix. assuming that all sps refer to the same VPS. 1130 1261 // Parsing dependency should be resolved! 1131 1262 TComVPS* vps = m_parameterSetManagerDecoder.getPrefetchedVPS( 0 ); 1132 assert( vps != 0 ); 1263 assert( vps != 0 ); 1133 1264 m_cEntropyDecoder.decodeSPS( sps, vps->getViewIndex( m_layerId ), ( vps->getDepthId( m_layerId ) == 1 ) ); 1134 1265 #else … … 1182 1313 SEIActiveParameterSets *seiAps = (SEIActiveParameterSets*)(*activeParamSets.begin()); 1183 1314 m_parameterSetManagerDecoder.applyPrefetchedPS(); 1184 assert(seiAps->activeSeqParam SetId.size()>0);1185 #if H_MV 1186 if (! m_parameterSetManagerDecoder.activateSPSWithSEI(seiAps->activeSeqParam SetId[0], m_layerId ))1187 #else 1188 if (! m_parameterSetManagerDecoder.activateSPSWithSEI(seiAps->activeSeqParam SetId[0] ))1315 assert(seiAps->activeSeqParameterSetId.size()>0); 1316 #if H_MV 1317 if (! m_parameterSetManagerDecoder.activateSPSWithSEI(seiAps->activeSeqParameterSetId[0], m_layerId )) 1318 #else 1319 if (! m_parameterSetManagerDecoder.activateSPSWithSEI(seiAps->activeSeqParameterSetId[0] )) 1189 1320 #endif 1190 1321 { … … 1209 1340 case NAL_UNIT_VPS: 1210 1341 xDecodeVPS(); 1342 #if H0056_EOS_CHECKS 1343 m_isLastNALWasEos = false; 1344 #endif 1211 1345 return false; 1212 1346 … … 1221 1355 case NAL_UNIT_PREFIX_SEI: 1222 1356 case NAL_UNIT_SUFFIX_SEI: 1357 #if H0056_EOS_CHECKS 1358 if ( nalu.m_nalUnitType == NAL_UNIT_SUFFIX_SEI ) 1359 { 1360 assert( m_isLastNALWasEos == false ); 1361 } 1362 #endif 1223 1363 xDecodeSEI( nalu.m_Bitstream, nalu.m_nalUnitType ); 1224 1364 return false; … … 1240 1380 case NAL_UNIT_CODED_SLICE_RASL_N: 1241 1381 case NAL_UNIT_CODED_SLICE_RASL_R: 1382 #if H0056_EOS_CHECKS 1383 if (nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_TRAIL_R || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_TRAIL_N || 1384 nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_TSA_R || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_TSA_N || 1385 nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_STSA_R || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_STSA_N || 1386 nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_RADL_R || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_RADL_N || 1387 nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_RASL_R || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_RASL_N ) 1388 { 1389 assert( m_isLastNALWasEos == false ); 1390 } 1391 else 1392 { 1393 m_isLastNALWasEos = false; 1394 } 1395 #endif 1242 1396 #if H_MV 1243 1397 return xDecodeSlice(nalu, iSkipFrame, iPOCLastDisplay, newLayerFlag, sliceSkippedFlag ); … … 1247 1401 break; 1248 1402 case NAL_UNIT_EOS: 1403 #if H0056_EOS_CHECKS 1404 assert( m_isLastNALWasEos == false ); 1405 //Check layer id of the nalu. if it is not 0, give a warning message and just return without doing anything. 1406 if (nalu.m_layerId > 0) 1407 { 1408 printf( "\nThis bitstream has EOS with non-zero layer id.\n" ); 1409 return false; 1410 } 1411 m_isLastNALWasEos = true; 1412 #endif 1249 1413 m_associatedIRAPType = NAL_UNIT_INVALID; 1250 1414 m_pocCRA = 0; … … 1264 1428 return false; 1265 1429 1430 case NAL_UNIT_FILLER_DATA: 1431 #if H_MV 1432 assert( m_isLastNALWasEos == false ); 1433 #endif 1434 return false; 1266 1435 1267 1436 case NAL_UNIT_RESERVED_VCL_N10: … … 1284 1453 case NAL_UNIT_RESERVED_VCL31: 1285 1454 1286 case NAL_UNIT_FILLER_DATA:1287 1455 case NAL_UNIT_RESERVED_NVCL41: 1288 1456 case NAL_UNIT_RESERVED_NVCL42:
Note: See TracChangeset for help on using the changeset viewer.