Changeset 253 in SHVCSoftware for branches/SHM-2.1-multilayers-dev/source/Lib/TLibCommon/TComSlice.cpp
- Timestamp:
- 3 Jun 2013, 20:08:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-2.1-multilayers-dev/source/Lib/TLibCommon/TComSlice.cpp
r248 r253 92 92 #if SVC_EXTENSION 93 93 , m_layerId ( 0 ) 94 , m_pcBaseColPic ( NULL )95 94 #endif 96 95 , m_bTLayerSwitchingFlag ( false ) … … 122 121 m_aiNumRefIdx[0] = m_aiNumRefIdx[1] = m_aiNumRefIdx[2] = 0; 123 122 #endif 124 123 124 #if SVC_EXTENSION 125 memset( m_pcBaseColPic, NULL, sizeof( m_pcBaseColPic ) ); 125 126 #if REF_IDX_FRAMEWORK 126 127 #if JCTVC_M0458_INTERLAYER_RPS_SIG … … 131 132 m_numILRRefIdx = 0; 132 133 #endif 134 #endif 133 135 #endif 134 136 … … 518 520 519 521 #if REF_IDX_FRAMEWORK 520 //inter-layer reference picture 522 for( UInt i = 0; i < m_activeNumILRRefIdx; i++ ) 523 { 524 UInt refLayerIdc = m_interLayerPredLayerIdc[i]; 525 //inter-layer reference picture 521 526 #if REF_IDX_MFM 522 527 523 528 #if ILR_RESTR 524 Int maxSubLayerForILPPlus1 = (getLayerId() > 0 && m_activeNumILRRefIdx > 0)? getVPS()->getMaxSublayerForIlpPlus1(ilpPic[0]->getSlice(0)->getLayerId()) : 0;529 Int maxSubLayerForILPPlus1 = ( m_layerId > 0 && m_activeNumILRRefIdx > 0)? m_pcVPS->getMaxSublayerForIlpPlus1(ilpPic[refLayerIdc]->getSlice(0)->getLayerId()) : 0; 525 530 #if ZERO_NUM_DIRECT_LAYERS 526 if( getLayerId() > 0 && m_activeNumILRRefIdx > 0 && ( ( (Int)(ilpPic[0]->getSlice(0)->getTLayer())<= maxSubLayerForILPPlus1-1) || (maxSubLayerForILPPlus1==0 && ilpPic[0]->getSlice(0)->getRapPicFlag()) ) )527 #else 528 if( getLayerId() && ( ( (Int)(ilpPic[0]->getSlice(0)->getTLayer())<=maxSubLayerForILPPlus1-1) || (maxSubLayerForILPPlus1==0 && ilpPic[0]->getSlice(0)->getRapPicFlag()) ) )531 if( m_layerId > 0 && m_activeNumILRRefIdx > 0 && ( ( (Int)(ilpPic[refLayerIdc]->getSlice(0)->getTLayer())<= maxSubLayerForILPPlus1-1) || (maxSubLayerForILPPlus1==0 && ilpPic[refLayerIdc]->getSlice(0)->getRapPicFlag()) ) ) 532 #else 533 if( m_layerId > 0 && ( ( (Int)(ilpPic[refLayerIdc]->getSlice(0)->getTLayer())<=maxSubLayerForILPPlus1-1) || (maxSubLayerForILPPlus1==0 && ilpPic[refLayerIdc]->getSlice(0)->getRapPicFlag()) ) ) 529 534 #endif 530 535 531 536 #else 532 537 #if ZERO_NUM_DIRECT_LAYERS 533 if( m_layerId > 0 && m_activeNumILRRefIdx > 0 ) 534 #else 535 if (getLayerId()) 536 #endif 537 #endif 538 { 539 if(!(getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA) && getSPS()->getMFMEnabledFlag()) 540 { 541 ilpPic[0]->copyUpsampledMvField(getBaseColPic()); 542 } 543 else 544 { 545 ilpPic[0]->initUpsampledMvField(); 546 } 547 #endif 548 ilpPic[0]->setIsLongTerm(1); 538 if( m_layerId > 0 && m_activeNumILRRefIdx > 0 ) 539 #else 540 if( m_layerId > 0 ) 541 #endif 542 #endif 543 { 544 if(!(m_eNalUnitType >= NAL_UNIT_CODED_SLICE_BLA_W_LP && m_eNalUnitType <= NAL_UNIT_CODED_SLICE_CRA) && m_pcSPS->getMFMEnabledFlag()) 545 { 546 ilpPic[refLayerIdc]->copyUpsampledMvField( m_pcBaseColPic[refLayerIdc] ); 547 } 548 else 549 { 550 ilpPic[refLayerIdc]->initUpsampledMvField(); 551 } 552 #endif 553 ilpPic[refLayerIdc]->setIsLongTerm(1); 554 } 549 555 } 550 556 #endif … … 555 561 #if ILR_RESTR 556 562 Int numInterLayerRPSPics = 0; 557 if (getLayerId()>0)558 { 559 for (i=0; i < getVPS()->getNumDirectRefLayers(getLayerId()); i++)560 { 561 maxSubLayerForILPPlus1 = getVPS()->getMaxSublayerForIlpPlus1(ilpPic[i]->getSlice(0)->getLayerId());563 if( m_layerId > 0 ) 564 { 565 for( i=0; i < m_pcVPS->getNumDirectRefLayers( m_layerId ); i++ ) 566 { 567 Int maxSubLayerForILPPlus1 = getVPS()->getMaxSublayerForIlpPlus1(ilpPic[i]->getSlice(0)->getLayerId()); 562 568 if( ((Int)(ilpPic[i]->getSlice(0)->getTLayer())<= maxSubLayerForILPPlus1-1) || (maxSubLayerForILPPlus1==0 && ilpPic[i]->getSlice(0)->getRapPicFlag() ) ) 563 569 { … … 571 577 } 572 578 #if MAX_ONE_RESAMPLING_DIRECT_LAYERS 573 if( getVPS()->getScalabilityMask(1))579 if( m_pcVPS->getScalabilityMask(1) ) 574 580 { 575 581 Int numResampler = 0; … … 583 589 Int widthEL = getPic()->getPicYuvRec()->getWidth(); 584 590 Int heightEL = getPic()->getPicYuvRec()->getHeight(); 585 for (i=0; i < m_activeNumILRRefIdx; i++) 586 { 587 Int widthBL = ilpPic[getInterLayerPredLayerIdc(i)]->getSlice(0)->getBaseColPic()->getPicYuvRec()->getWidth(); 588 Int heightBL = ilpPic[getInterLayerPredLayerIdc(i)]->getSlice(0)->getBaseColPic()->getPicYuvRec()->getHeight(); 591 for( i=0; i < m_activeNumILRRefIdx; i++ ) 592 { 593 UInt refLayerIdc = m_interLayerPredLayerIdc[i]; 594 Int widthBL = ilpPic[refLayerIdc]->getSlice(0)->getBaseColPic(refLayerIdc)->getPicYuvRec()->getWidth(); 595 Int heightBL = ilpPic[refLayerIdc]->getSlice(0)->getBaseColPic(refLayerIdc)->getPicYuvRec()->getHeight(); 589 596 590 597 if(!(widthEL == widthBL && heightEL == heightBL && (scalingOffset))) … … 660 667 } 661 668 #if REF_IDX_FRAMEWORK 662 if( getLayerId())669 if( m_layerId > 0 ) 663 670 { 664 671 #if JCTVC_M0458_INTERLAYER_RPS_SIG … … 668 675 #endif 669 676 { 677 Int refLayerIdc = m_interLayerPredLayerIdc[i]; 670 678 #if ILR_RESTR 671 maxSubLayerForILPPlus1 = getVPS()->getMaxSublayerForIlpPlus1(ilpPic[i]->getSlice(0)->getLayerId());672 if( ((Int)(ilpPic[ i]->getSlice(0)->getTLayer())<=maxSubLayerForILPPlus1-1) || (maxSubLayerForILPPlus1==0 && ilpPic[i]->getSlice(0)->getRapPicFlag()) )673 #endif 674 rpsCurrList0[cIdx] = ilpPic[ i];679 Int maxSubLayerForILPPlus1 = getVPS()->getMaxSublayerForIlpPlus1(ilpPic[refLayerIdc]->getSlice(0)->getLayerId()); 680 if( ((Int)(ilpPic[refLayerIdc]->getSlice(0)->getTLayer())<=maxSubLayerForILPPlus1-1) || (maxSubLayerForILPPlus1==0 && ilpPic[refLayerIdc]->getSlice(0)->getRapPicFlag()) ) 681 #endif 682 rpsCurrList0[cIdx] = ilpPic[refLayerIdc]; 675 683 } 676 684 } … … 692 700 } 693 701 #if REF_IDX_FRAMEWORK 694 if( getLayerId())702 if( m_layerId > 0 ) 695 703 { 696 704 #if JCTVC_M0458_INTERLAYER_RPS_SIG … … 700 708 #endif 701 709 { 710 Int refLayerIdc = m_interLayerPredLayerIdc[i]; 702 711 #if ILR_RESTR 703 maxSubLayerForILPPlus1 = getVPS()->getMaxSublayerForIlpPlus1(ilpPic[i]->getSlice(0)->getLayerId());704 if( ((Int)(ilpPic[ i]->getSlice(0)->getTLayer())<=maxSubLayerForILPPlus1-1) || (maxSubLayerForILPPlus1==0 && ilpPic[i]->getSlice(0)->getRapPicFlag()) )705 #endif 706 rpsCurrList1[cIdx] = ilpPic[ i];712 Int maxSubLayerForILPPlus1 = getVPS()->getMaxSublayerForIlpPlus1(ilpPic[refLayerIdc]->getSlice(0)->getLayerId()); 713 if( ((Int)(ilpPic[refLayerIdc]->getSlice(0)->getTLayer())<=maxSubLayerForILPPlus1-1) || (maxSubLayerForILPPlus1==0 && ilpPic[refLayerIdc]->getSlice(0)->getRapPicFlag()) ) 714 #endif 715 rpsCurrList1[cIdx] = ilpPic[refLayerIdc]; 707 716 } 708 717 } … … 737 746 Void TComSlice::setRefPicListModificationSvc() 738 747 { 739 if( ! this->getPPS()->getListsModificationPresentFlag())748 if( !m_pcPPS->getListsModificationPresentFlag()) 740 749 { 741 750 return; 742 751 } 743 752 744 if( this->getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && this->getNalUnitType()<= NAL_UNIT_CODED_SLICE_CRA)753 if(m_eNalUnitType >= NAL_UNIT_CODED_SLICE_BLA_W_LP && m_eNalUnitType <= NAL_UNIT_CODED_SLICE_CRA) 745 754 { 746 755 return; 747 756 } 748 757 749 TComRefPicListModification* refPicListModification = this->getRefPicListModification();758 TComRefPicListModification* refPicListModification = &m_RefPicListModification; 750 759 Int numberOfRpsCurrTempList = this->getNumRpsCurrTempList(); // total number of ref pics in listTemp0 including inter-layer ref pics 751 760 … … 821 830 822 831 #if REF_IDX_FRAMEWORK 823 if( m_eSliceType == I_SLICE || ( getSPS()->getLayerId() &&824 ( getNalUnitType()>= NAL_UNIT_CODED_SLICE_BLA_W_LP) &&825 ( getNalUnitType()<= NAL_UNIT_CODED_SLICE_CRA) ) )832 if( m_eSliceType == I_SLICE || ( m_pcSPS->getLayerId() && 833 (m_eNalUnitType >= NAL_UNIT_CODED_SLICE_BLA_W_LP) && 834 (m_eNalUnitType <= NAL_UNIT_CODED_SLICE_CRA) ) ) 826 835 #else 827 836 if (m_eSliceType == I_SLICE) … … 846 855 } 847 856 #if REF_IDX_FRAMEWORK 848 if( getLayerId())857 if( m_layerId > 0 ) 849 858 { 850 859 #if JCTVC_M0458_INTERLAYER_RPS_SIG … … 2593 2602 #endif 2594 2603 2595 Void TComSlice::setBaseColPic( TComList<TComPic*>& rcListPic, UInt layerID)2604 Void TComSlice::setBaseColPic( TComList<TComPic*>& rcListPic, UInt refLayerIdc ) 2596 2605 { 2597 if (layerID== 0)2598 { 2599 m _pcBaseColPic = NULL;2606 if(m_layerId == 0) 2607 { 2608 memset( m_pcBaseColPic, NULL, sizeof( m_pcBaseColPic ) ); 2600 2609 return; 2601 2610 } 2602 setBaseColPic( xGetRefPic(rcListPic, getPOC()));2611 setBaseColPic(refLayerIdc, xGetRefPic(rcListPic, getPOC())); 2603 2612 } 2604 2613 #endif 2605 2614 2606 2615 #if REF_IDX_MFM 2607 Void TComSlice::setRefPOCListILP( TComPic** ilpPic, TComPic *pcRefPicBL ) 2608 { 2609 //set reference picture POC of each ILP reference 2610 Int thePoc = ilpPic[0]->getPOC(); 2611 assert(thePoc >= 0); 2612 assert(thePoc == pcRefPicBL->getPOC()); 2613 2614 ilpPic[0]->getSlice(0)->setBaseColPic( pcRefPicBL ); 2615 2616 //copy reference pictures marking from the reference layer 2617 ilpPic[0]->getSlice(0)->copySliceInfo(pcRefPicBL->getSlice(0)); 2618 2619 for( Int refList = 0; refList < 2; refList++ ) 2620 { 2621 RefPicList refPicList = RefPicList( refList ); 2622 2623 //set reference POC of ILP 2624 ilpPic[0]->getSlice(0)->setNumRefIdx(refPicList, pcRefPicBL->getSlice(0)->getNumRefIdx(refPicList)); 2625 assert(ilpPic[0]->getSlice(0)->getNumRefIdx(refPicList) >= 0); 2626 assert(ilpPic[0]->getSlice(0)->getNumRefIdx(refPicList) <= MAX_NUM_REF); 2627 2628 //initialize reference POC of ILP 2629 for(Int refIdx = 0; refIdx < pcRefPicBL->getSlice(0)->getNumRefIdx(refPicList); refIdx++) 2630 { 2631 ilpPic[0]->getSlice(0)->setRefPOC(pcRefPicBL->getSlice(0)->getRefPOC(refPicList, refIdx), refPicList, refIdx); 2632 ilpPic[0]->getSlice(0)->setRefPic(pcRefPicBL->getSlice(0)->getRefPic(refPicList, refIdx), refPicList, refIdx); 2633 } 2634 2635 for(Int refIdx = pcRefPicBL->getSlice(0)->getNumRefIdx(refPicList); refIdx < MAX_NUM_REF; refIdx++) 2636 { 2637 ilpPic[0]->getSlice(0)->setRefPOC(0, refPicList, refIdx); 2638 ilpPic[0]->getSlice(0)->setRefPic(NULL, refPicList, refIdx); 2616 Void TComSlice::setRefPOCListILP( TComPic** ilpPic, TComPic** pcRefPicRL ) 2617 { 2618 for( UInt i = 0; i < m_activeNumILRRefIdx; i++ ) 2619 { 2620 UInt refLayerIdc = m_interLayerPredLayerIdc[i]; 2621 2622 TComPic* pcRefPicBL = pcRefPicRL[refLayerIdc]; 2623 //set reference picture POC of each ILP reference 2624 Int thePoc = ilpPic[refLayerIdc]->getPOC(); 2625 assert(thePoc >= 0); 2626 assert(thePoc == pcRefPicBL->getPOC()); 2627 2628 ilpPic[refLayerIdc]->getSlice(0)->setBaseColPic( refLayerIdc, pcRefPicBL ); 2629 2630 //copy reference pictures marking from the reference layer 2631 ilpPic[refLayerIdc]->getSlice(0)->copySliceInfo(pcRefPicBL->getSlice(0)); 2632 2633 for( Int refList = 0; refList < 2; refList++ ) 2634 { 2635 RefPicList refPicList = RefPicList( refList ); 2636 2637 //set reference POC of ILP 2638 ilpPic[refLayerIdc]->getSlice(0)->setNumRefIdx(refPicList, pcRefPicBL->getSlice(0)->getNumRefIdx(refPicList)); 2639 assert(ilpPic[refLayerIdc]->getSlice(0)->getNumRefIdx(refPicList) >= 0); 2640 assert(ilpPic[refLayerIdc]->getSlice(0)->getNumRefIdx(refPicList) <= MAX_NUM_REF); 2641 2642 //initialize reference POC of ILP 2643 for(Int refIdx = 0; refIdx < pcRefPicBL->getSlice(0)->getNumRefIdx(refPicList); refIdx++) 2644 { 2645 ilpPic[refLayerIdc]->getSlice(0)->setRefPOC(pcRefPicBL->getSlice(0)->getRefPOC(refPicList, refIdx), refPicList, refIdx); 2646 ilpPic[refLayerIdc]->getSlice(0)->setRefPic(pcRefPicBL->getSlice(0)->getRefPic(refPicList, refIdx), refPicList, refIdx); 2647 } 2648 2649 for(Int refIdx = pcRefPicBL->getSlice(0)->getNumRefIdx(refPicList); refIdx < MAX_NUM_REF; refIdx++) 2650 { 2651 ilpPic[refLayerIdc]->getSlice(0)->setRefPOC(0, refPicList, refIdx); 2652 ilpPic[refLayerIdc]->getSlice(0)->setRefPic(NULL, refPicList, refIdx); 2653 } 2639 2654 } 2640 2655 }
Note: See TracChangeset for help on using the changeset viewer.