Changeset 528 in SHVCSoftware for branches/SHM-4.1-dev/source/Lib/TLibDecoder
- Timestamp:
- 24 Dec 2013, 18:24:19 (11 years ago)
- Location:
- branches/SHM-4.1-dev/source/Lib/TLibDecoder
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-4.1-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp
r525 r528 290 290 } 291 291 } 292 293 #if SCALINGLIST_INFERRING 294 if( pcPPS->getLayerId() > 0 ) 295 { 296 READ_FLAG( uiCode, "pps_infer_scaling_list_flag" ); 297 pcPPS->setInferScalingListFlag( uiCode ); 298 } 299 300 if( pcPPS->getInferScalingListFlag() ) 301 { 302 READ_UVLC( uiCode, "pps_scaling_list_ref_layer_id" ); pcPPS->setScalingListRefLayerId( uiCode ); 303 304 // The value of pps_scaling_list_ref_layer_id shall be in the range of 0 to 62, inclusive 305 assert( pcPPS->getScalingListRefLayerId() <= 62 ); 306 307 pcPPS->setScalingListPresentFlag( false ); 308 } 309 else 310 { 311 #endif 312 292 313 READ_FLAG( uiCode, "pps_scaling_list_data_present_flag" ); pcPPS->setScalingListPresentFlag( uiCode ? true : false ); 293 314 … … 343 364 #endif 344 365 } 366 367 #if SCALINGLIST_INFERRING 368 } 369 #endif 345 370 346 371 READ_FLAG( uiCode, "lists_modification_present_flag"); … … 716 741 if(pcSPS->getScalingListFlag()) 717 742 { 743 #if SCALINGLIST_INFERRING 744 if( pcSPS->getLayerId() > 0 ) 745 { 746 READ_FLAG( uiCode, "sps_infer_scaling_list_flag" ); pcSPS->setInferScalingListFlag( uiCode ); 747 } 748 749 if( pcSPS->getInferScalingListFlag() ) 750 { 751 READ_UVLC( uiCode, "sps_scaling_list_ref_layer_id" ); pcSPS->setScalingListRefLayerId( uiCode ); 752 753 // The value of pps_scaling_list_ref_layer_id shall be in the range of 0 to 62, inclusive 754 assert( pcSPS->getScalingListRefLayerId() <= 62 ); 755 756 pcSPS->setScalingListPresentFlag( false ); 757 } 758 else 759 { 760 #endif 718 761 READ_FLAG( uiCode, "sps_scaling_list_data_present_flag" ); pcSPS->setScalingListPresentFlag ( uiCode ); 719 762 if(pcSPS->getScalingListPresentFlag ()) … … 766 809 767 810 } 811 #if SCALINGLIST_INFERRING 812 } 813 #endif 768 814 } 769 815 READ_FLAG( uiCode, "amp_enabled_flag" ); pcSPS->setUseAMP( uiCode ); -
branches/SHM-4.1-dev/source/Lib/TLibDecoder/TDecTop.cpp
r526 r528 551 551 printf("\ninserting lost poc : %d\n",iLostPoc); 552 552 TComSlice cFillSlice; 553 #if SVC_EXTENSION554 cFillSlice.setSPS( m_parameterSetManagerDecoder[m_layerId].getFirstSPS() );555 cFillSlice.setPPS( m_parameterSetManagerDecoder[m_layerId].getFirstPPS() );556 cFillSlice.setVPS( m_parameterSetManagerDecoder[m_layerId].getFirstVPS() );557 cFillSlice.initSlice( m_layerId );558 #else559 553 cFillSlice.setSPS( m_parameterSetManagerDecoder.getFirstSPS() ); 560 554 cFillSlice.setPPS( m_parameterSetManagerDecoder.getFirstPPS() ); 555 #if SVC_EXTENSION 556 cFillSlice.setVPS( m_parameterSetManagerDecoder.getFirstVPS() ); 557 cFillSlice.initSlice( m_layerId ); 558 #else 561 559 cFillSlice.initSlice(); 562 560 #endif 563 561 TComPic *cFillPic; 564 562 xGetNewPicBuffer(&cFillSlice,cFillPic); 565 #if SVC_EXTENSION566 cFillPic->getSlice(0)->setSPS( m_parameterSetManagerDecoder[m_layerId].getFirstSPS() );567 cFillPic->getSlice(0)->setPPS( m_parameterSetManagerDecoder[m_layerId].getFirstPPS() );568 cFillPic->getSlice(0)->setVPS( m_parameterSetManagerDecoder[m_layerId].getFirstVPS() );569 cFillPic->getSlice(0)->initSlice( m_layerId );570 #else571 563 cFillPic->getSlice(0)->setSPS( m_parameterSetManagerDecoder.getFirstSPS() ); 572 564 cFillPic->getSlice(0)->setPPS( m_parameterSetManagerDecoder.getFirstPPS() ); 565 #if SVC_EXTENSION 566 cFillPic->getSlice(0)->setVPS( m_parameterSetManagerDecoder.getFirstVPS() ); 567 cFillPic->getSlice(0)->initSlice( m_layerId ); 568 #else 573 569 cFillPic->getSlice(0)->initSlice(); 574 570 #endif … … 613 609 Void TDecTop::xActivateParameterSets() 614 610 { 615 #if SVC_EXTENSION616 m_parameterSetManagerDecoder[m_layerId].applyPrefetchedPS();617 618 TComPPS *pps = m_parameterSetManagerDecoder[m_layerId].getPPS(m_apcSlicePilot->getPPSId());619 assert (pps != 0);620 621 TComSPS *sps = m_parameterSetManagerDecoder[m_layerId].getSPS(pps->getSPSId());622 assert (sps != 0);623 624 if( false == m_parameterSetManagerDecoder[m_layerId].activatePPS(m_apcSlicePilot->getPPSId(), m_apcSlicePilot->isIRAP()) )625 #else626 611 m_parameterSetManagerDecoder.applyPrefetchedPS(); 627 612 … … 633 618 634 619 if (false == m_parameterSetManagerDecoder.activatePPS(m_apcSlicePilot->getPPSId(),m_apcSlicePilot->isIRAP())) 635 #endif636 620 { 637 621 printf ("Parameter set activation failed!"); 638 622 assert (0); 639 623 } 624 625 #if SCALINGLIST_INFERRING 626 // scaling list settings and checks 627 TComVPS *activeVPS = m_parameterSetManagerDecoder.getActiveVPS(); 628 TComSPS *activeSPS = m_parameterSetManagerDecoder.getActiveSPS(); 629 TComPPS *activePPS = m_parameterSetManagerDecoder.getActivePPS(); 630 631 if( activeSPS->getInferScalingListFlag() ) 632 { 633 UInt refLayerId = activeSPS->getScalingListRefLayerId(); 634 TComSPS *refSps = m_ppcTDecTop[refLayerId]->getParameterSetManager()->getActiveSPS(); assert( refSps != NULL ); 635 636 // When avc_base_layer_flag is equal to 1, it is a requirement of bitstream conformance that the value of sps_scaling_list_ref_layer_id shall be greater than 0 637 if( activeVPS->getAvcBaseLayerFlag() ) 638 { 639 assert( refLayerId > 0 ); 640 } 641 642 // It is a requirement of bitstream conformance that, when an SPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB and 643 // sps_infer_scaling_list_flag in the SPS is equal to 1, sps_infer_scaling_list_flag shall be equal to 0 for the SPS that is active for the layer with nuh_layer_id equal to sps_scaling_list_ref_layer_id 644 assert( refSps->getInferScalingListFlag() == false ); 645 646 // It is a requirement of bitstream conformance that, when an SPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB, 647 // the layer with nuh_layer_id equal to sps_scaling_list_ref_layer_id shall be a direct or indirect reference layer of the layer with nuh_layer_id equal to nuhLayerIdB 648 assert( activeVPS->getRecursiveRefLayerFlag( activeSPS->getLayerId(), refLayerId ) == true ); 649 650 if( activeSPS->getScalingList() != refSps->getScalingList() ) 651 { 652 // delete created instance of scaling list since it will be inferred 653 delete activeSPS->getScalingList(); 654 655 // infer scaling list 656 activeSPS->setScalingList( refSps->getScalingList() ); 657 } 658 } 659 660 if( activePPS->getInferScalingListFlag() ) 661 { 662 UInt refLayerId = activePPS->getScalingListRefLayerId(); 663 TComPPS *refPps = m_ppcTDecTop[refLayerId]->getParameterSetManager()->getActivePPS(); assert( refPps != NULL ); 664 665 // When avc_base_layer_flag is equal to 1, it is a requirement of bitstream conformance that the value of sps_scaling_list_ref_layer_id shall be greater than 0 666 if( activeVPS->getAvcBaseLayerFlag() ) 667 { 668 assert( refLayerId > 0 ); 669 } 670 671 // It is a requirement of bitstream conformance that, when an PPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB and 672 // pps_infer_scaling_list_flag in the PPS is equal to 1, pps_infer_scaling_list_flag shall be equal to 0 for the PPS that is active for the layer with nuh_layer_id equal to pps_scaling_list_ref_layer_id 673 assert( refPps->getInferScalingListFlag() == false ); 674 675 // It is a requirement of bitstream conformance that, when an PPS with nuh_layer_id equal to nuhLayerIdA is active for a layer with nuh_layer_id equal to nuhLayerIdB, 676 // the layer with nuh_layer_id equal to pps_scaling_list_ref_layer_id shall be a direct or indirect reference layer of the layer with nuh_layer_id equal to nuhLayerIdB 677 assert( activeVPS->getRecursiveRefLayerFlag( activePPS->getLayerId(), refLayerId ) == true ); 678 679 if( activePPS->getScalingList() != refPps->getScalingList() ) 680 { 681 // delete created instance of scaling list since it will be inferred 682 delete activePPS->getScalingList(); 683 684 // infer scaling list 685 activePPS->setScalingList( refPps->getScalingList() ); 686 } 687 688 } 689 #endif 640 690 641 691 if( pps->getDependentSliceSegmentsEnabledFlag() ) … … 709 759 TComPic*& pcPic = m_pcPic; 710 760 #if SVC_EXTENSION 711 m_apcSlicePilot->setVPS( m_parameterSetManagerDecoder [m_layerId].getPrefetchedVPS(0) );761 m_apcSlicePilot->setVPS( m_parameterSetManagerDecoder.getPrefetchedVPS(0) ); 712 762 #if OUTPUT_LAYER_SET_INDEX 713 763 // Following check should go wherever the VPS is activated … … 751 801 m_apcSlicePilot->setNumSamplePredRefLayers( getNumSamplePredRefLayers() ); 752 802 #endif 753 m_cEntropyDecoder.decodeSliceHeader (m_apcSlicePilot, &m_parameterSetManagerDecoder[m_layerId]); 754 #else 803 #endif 755 804 m_cEntropyDecoder.decodeSliceHeader (m_apcSlicePilot, &m_parameterSetManagerDecoder); 756 #endif757 805 758 806 // set POC for dependent slices in skipped pictures … … 950 998 { 951 999 #if AVC_BASE 952 if( m_layerId == 1 && m_parameterSetManagerDecoder [0].getPrefetchedVPS(0)->getAvcBaseLayerFlag() )1000 if( m_layerId == 1 && m_parameterSetManagerDecoder.getPrefetchedVPS(0)->getAvcBaseLayerFlag() ) 953 1001 { 954 1002 TComPic* pBLPic = (*m_ppcTDecTop[0]->getListPic()->begin()); … … 1187 1235 UInt refLayerIdc = i; 1188 1236 #if AVC_BASE 1189 if( pcSlice->getVPS()->getRefLayerId( m_layerId, refLayerIdc ) == 0 && m_parameterSetManagerDecoder [0].getActiveVPS()->getAvcBaseLayerFlag() )1237 if( pcSlice->getVPS()->getRefLayerId( m_layerId, refLayerIdc ) == 0 && m_parameterSetManagerDecoder.getActiveVPS()->getAvcBaseLayerFlag() ) 1190 1238 { 1191 1239 pcSlice->setBaseColPic ( refLayerIdc, *m_ppcTDecTop[0]->getListPic()->begin() ); … … 1278 1326 UInt refLayerIdc = pcSlice->getInterLayerPredLayerIdc(i); 1279 1327 #if AVC_BASE 1280 if( pcSlice->getVPS()->getRefLayerId( m_layerId, refLayerIdc ) == 0 && m_parameterSetManagerDecoder [0].getActiveVPS()->getAvcBaseLayerFlag() )1328 if( pcSlice->getVPS()->getRefLayerId( m_layerId, refLayerIdc ) == 0 && m_parameterSetManagerDecoder.getActiveVPS()->getAvcBaseLayerFlag() ) 1281 1329 { 1282 1330 pcSlice->setBaseColPic ( refLayerIdc, *m_ppcTDecTop[0]->getListPic()->begin() ); … … 1431 1479 pcSlice->setScalingList ( pcSlice->getPPS()->getScalingList() ); 1432 1480 } 1481 #if SCALINGLIST_INFERRING 1482 if( m_layerId == 0 || ( m_layerId > 0 && !pcSlice->getPPS()->getInferScalingListFlag() && !pcSlice->getSPS()->getInferScalingListFlag() ) ) 1483 #endif 1433 1484 if(!pcSlice->getPPS()->getScalingListPresentFlag() && !pcSlice->getSPS()->getScalingListPresentFlag()) 1434 1485 { … … 1466 1517 1467 1518 m_cEntropyDecoder.decodeVPS( vps ); 1468 #if SVC_EXTENSION1469 m_parameterSetManagerDecoder[0].storePrefetchedVPS(vps);1470 #else1471 1519 m_parameterSetManagerDecoder.storePrefetchedVPS(vps); 1472 #endif1473 1520 } 1474 1521 … … 1478 1525 #if SVC_EXTENSION 1479 1526 sps->setLayerId(m_layerId); 1480 m_cEntropyDecoder.decodeSPS( sps, &m_parameterSetManagerDecoder [0]);1481 m_parameterSetManagerDecoder [m_layerId].storePrefetchedSPS(sps);1527 m_cEntropyDecoder.decodeSPS( sps, &m_parameterSetManagerDecoder ); 1528 m_parameterSetManagerDecoder.storePrefetchedSPS(sps); 1482 1529 #if !REPN_FORMAT_IN_VPS // ILRP can only be initialized at activation 1483 1530 if(m_numLayer>0) … … 1496 1543 TComPPS* pps = new TComPPS(); 1497 1544 1498 #if IL_SL_SIGNALLING_N03711499 pps->setLayerId( m_layerId);1545 #if SCALINGLIST_INFERRING || IL_SL_SIGNALLING_N0371 1546 pps->setLayerId( m_layerId ); 1500 1547 #endif 1501 1548 1502 1549 m_cEntropyDecoder.decodePPS( pps ); 1503 #if SVC_EXTENSION1504 m_parameterSetManagerDecoder[m_layerId].storePrefetchedPPS( pps );1505 #else1506 1550 m_parameterSetManagerDecoder.storePrefetchedPPS( pps ); 1507 #endif1508 1551 1509 1552 if( pps->getDependentSliceSegmentsEnabledFlag() ) … … 1533 1576 #endif 1534 1577 #if M0043_LAYERS_PRESENT_SEI 1535 m_seiReader.parseSEImessage( bs, m_pcPic->getSEIs(), nalUnitType, m_parameterSetManagerDecoder [m_layerId].getActiveVPS(), m_parameterSetManagerDecoder[m_layerId].getActiveSPS() );1536 #else 1537 m_seiReader.parseSEImessage( bs, m_pcPic->getSEIs(), nalUnitType, m_parameterSetManagerDecoder [m_layerId].getActiveSPS() );1578 m_seiReader.parseSEImessage( bs, m_pcPic->getSEIs(), nalUnitType, m_parameterSetManagerDecoder.getActiveVPS(), m_parameterSetManagerDecoder.getActiveSPS() ); 1579 #else 1580 m_seiReader.parseSEImessage( bs, m_pcPic->getSEIs(), nalUnitType, m_parameterSetManagerDecoder.getActiveSPS() ); 1538 1581 #endif 1539 1582 } … … 1541 1584 { 1542 1585 #if M0043_LAYERS_PRESENT_SEI 1543 m_seiReader.parseSEImessage( bs, m_SEIs, nalUnitType, m_parameterSetManagerDecoder [m_layerId].getActiveVPS(), m_parameterSetManagerDecoder[m_layerId].getActiveSPS() );1544 #else 1545 m_seiReader.parseSEImessage( bs, m_SEIs, nalUnitType, m_parameterSetManagerDecoder [m_layerId].getActiveSPS() );1586 m_seiReader.parseSEImessage( bs, m_SEIs, nalUnitType, m_parameterSetManagerDecoder.getActiveVPS(), m_parameterSetManagerDecoder.getActiveSPS() ); 1587 #else 1588 m_seiReader.parseSEImessage( bs, m_SEIs, nalUnitType, m_parameterSetManagerDecoder.getActiveSPS() ); 1546 1589 #endif 1547 1590 SEIMessages activeParamSets = getSeisByType(m_SEIs, SEI::ACTIVE_PARAMETER_SETS); … … 1549 1592 { 1550 1593 SEIActiveParameterSets *seiAps = (SEIActiveParameterSets*)(*activeParamSets.begin()); 1551 m_parameterSetManagerDecoder [m_layerId].applyPrefetchedPS();1594 m_parameterSetManagerDecoder.applyPrefetchedPS(); 1552 1595 assert(seiAps->activeSeqParamSetId.size()>0); 1553 if (! m_parameterSetManagerDecoder[m_layerId].activateSPSWithSEI(seiAps->activeSeqParamSetId[0] ))1596 if( !m_parameterSetManagerDecoder.activateSPSWithSEI( seiAps->activeSeqParamSetId[0] ) ) 1554 1597 { 1555 1598 printf ("Warning SPS activation with Active parameter set SEI failed"); … … 1606 1649 xDecodeVPS(); 1607 1650 #if AVC_BASE 1608 if( m_parameterSetManagerDecoder [0].getPrefetchedVPS(0)->getAvcBaseLayerFlag() )1651 if( m_parameterSetManagerDecoder.getPrefetchedVPS(0)->getAvcBaseLayerFlag() ) 1609 1652 { 1610 1653 if( !m_ppcTDecTop[0]->getBLReconFile()->good() ) … … 1632 1675 xDecodeSPS(); 1633 1676 #if AVC_BASE 1634 if( m_parameterSetManagerDecoder [0].getPrefetchedVPS(0)->getAvcBaseLayerFlag() )1677 if( m_parameterSetManagerDecoder.getPrefetchedVPS(0)->getAvcBaseLayerFlag() ) 1635 1678 { 1636 1679 TComPic* pBLPic = (*m_ppcTDecTop[0]->getListPic()->begin()); … … 1638 1681 { 1639 1682 // using EL SPS with spsId = 1 1640 TComSPS* sps = m_parameterSetManagerDecoder [nalu.m_layerId].getPrefetchedSPS(1);1683 TComSPS* sps = m_parameterSetManagerDecoder.getPrefetchedSPS(1); 1641 1684 Int numReorderPics[MAX_TLAYER]; 1642 1685 Window &conformanceWindow = sps->getConformanceWindow(); … … 1787 1830 TDecTop* TDecTop::getRefLayerDec( UInt refLayerIdc ) 1788 1831 { 1789 TComVPS* vps = m_parameterSetManagerDecoder [0].getActiveVPS();1832 TComVPS* vps = m_parameterSetManagerDecoder.getActiveVPS(); 1790 1833 if( vps->getNumDirectRefLayers( m_layerId ) <= 0 ) 1791 1834 { -
branches/SHM-4.1-dev/source/Lib/TLibDecoder/TDecTop.h
r521 r528 72 72 73 73 TComList<TComPic*> m_cListPic; // Dynamic buffer 74 #if SVC_EXTENSION75 ParameterSetManagerDecoder m_parameterSetManagerDecoder[MAX_LAYERS]; // storage for parameter sets76 #else77 74 ParameterSetManagerDecoder m_parameterSetManagerDecoder; // storage for parameter sets 78 #endif79 75 80 76 TComSlice* m_apcSlicePilot; … … 249 245 Void checkValueOfOutputLayerSetIdx(TComVPS *vps); 250 246 #endif 247 #if SCALINGLIST_INFERRING 248 ParameterSetManagerDecoder* getParameterSetManager() { return &m_parameterSetManagerDecoder; } 249 #endif 251 250 };// END CLASS DEFINITION TDecTop 252 251
Note: See TracChangeset for help on using the changeset viewer.