Changeset 253 in SHVCSoftware for branches/SHM-2.1-multilayers-dev
- Timestamp:
- 3 Jun 2013, 20:08:00 (12 years ago)
- Location:
- branches/SHM-2.1-multilayers-dev/source/Lib
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-2.1-multilayers-dev/source/Lib/TLibCommon/TComDataCU.cpp
r212 r253 1750 1750 // check BL mode 1751 1751 UInt uiCUAddrBase, uiAbsPartAddrBase; 1752 TComDataCU* pcTempCU = getBaseColCU( uiAbsPartIdx, uiCUAddrBase, uiAbsPartAddrBase ); 1752 // the right reference layerIdc should be specified, currently it is set to 0 1753 TComDataCU* pcTempCU = getBaseColCU(0, uiAbsPartIdx, uiCUAddrBase, uiAbsPartAddrBase ); 1753 1754 1754 1755 if( pcTempCU->getPredictionMode( uiAbsPartAddrBase ) != MODE_INTRA ) 1756 { 1755 1757 return( NUM_INTRA_MODE-1 ); 1758 } 1756 1759 1757 1760 // compute set of enabled modes g_reducedSetIntraModes[...] … … 4182 4185 4183 4186 #if SVC_COL_BLK 4184 TComDataCU* TComDataCU::getBaseColCU( UInt uiCuAbsPartIdx, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase )4187 TComDataCU* TComDataCU::getBaseColCU( UInt refLayerIdc, UInt uiCuAbsPartIdx, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase ) 4185 4188 { 4186 4189 #if 1 // it should provide identical resutls … … 4188 4191 UInt uiPelY = getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiCuAbsPartIdx] ]; 4189 4192 4190 return getBaseColCU( uiPelX, uiPelY, uiCUAddrBase, uiAbsPartIdxBase );4193 return getBaseColCU( refLayerIdc, uiPelX, uiPelY, uiCUAddrBase, uiAbsPartIdxBase ); 4191 4194 #else 4192 4195 TComPic* cBaseColPic = m_pcSlice->getBaseColPic(); … … 4237 4240 } 4238 4241 4239 TComDataCU* TComDataCU::getBaseColCU( UInt uiPelX, UInt uiPelY, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase )4240 { 4241 TComPic* cBaseColPic = m_pcSlice->getBaseColPic( );4242 TComDataCU* TComDataCU::getBaseColCU( UInt refLayerIdc, UInt uiPelX, UInt uiPelY, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase ) 4243 { 4244 TComPic* cBaseColPic = m_pcSlice->getBaseColPic(refLayerIdc); 4242 4245 4243 4246 #if !SIMPLIFIED_MV_POS_SCALING … … 4269 4272 Int leftStartL = this->getSlice()->getSPS()->getScaledRefLayerWindow().getWindowLeftOffset(); 4270 4273 Int topStartL = this->getSlice()->getSPS()->getScaledRefLayerWindow().getWindowTopOffset(); 4271 Int iBX = ((uiPelX - leftStartL)*g_posScalingFactor[ m_layerId][0] + (1<<15)) >> 16;4272 Int iBY = ((uiPelY - topStartL )*g_posScalingFactor[ m_layerId][1] + (1<<15)) >> 16;4274 Int iBX = ((uiPelX - leftStartL)*g_posScalingFactor[refLayerIdc][0] + (1<<15)) >> 16; 4275 Int iBY = ((uiPelY - topStartL )*g_posScalingFactor[refLayerIdc][1] + (1<<15)) >> 16; 4273 4276 #else 4274 Int iBX = (uiPelX*g_posScalingFactor[ m_layerId][0] + (1<<15)) >> 16;4275 Int iBY = (uiPelY*g_posScalingFactor[ m_layerId][1] + (1<<15)) >> 16;4277 Int iBX = (uiPelX*g_posScalingFactor[refLayerIdc][0] + (1<<15)) >> 16; 4278 Int iBY = (uiPelY*g_posScalingFactor[refLayerIdc][1] + (1<<15)) >> 16; 4276 4279 #endif 4277 4280 #else … … 4295 4298 const Window &confEL = m_pcPic->getPicYuvRec()->getConformanceWindow(); 4296 4299 4297 Int widthBL = m_pcSlice->getBaseColPic( )->getPicYuvRec()->getWidth () - confBL.getWindowLeftOffset() - confBL.getWindowRightOffset();4298 Int heightBL = m_pcSlice->getBaseColPic( )->getPicYuvRec()->getHeight() - confBL.getWindowTopOffset() - confBL.getWindowBottomOffset();4300 Int widthBL = m_pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getWidth () - confBL.getWindowLeftOffset() - confBL.getWindowRightOffset(); 4301 Int heightBL = m_pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getHeight() - confBL.getWindowTopOffset() - confBL.getWindowBottomOffset(); 4299 4302 #endif 4300 4303 if( iBX >= widthBL || iBY >= heightBL ) //outside of the reference layer cropped picture -
branches/SHM-2.1-multilayers-dev/source/Lib/TLibCommon/TComDataCU.h
r212 r253 554 554 555 555 #if SVC_COL_BLK 556 TComDataCU* getBaseColCU( UInt uiCuAbsPartIdx, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase );557 TComDataCU* getBaseColCU( UInt uiPelX, UInt uiPelY, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase );556 TComDataCU* getBaseColCU( UInt refLayerIdc, UInt uiCuAbsPartIdx, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase ); 557 TComDataCU* getBaseColCU( UInt refLayerIdc, UInt uiPelX, UInt uiPelY, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase ); 558 558 Void scaleBaseMV( TComMvField& rcMvFieldEnhance, TComMvField& rcMvFieldBase ); 559 559 #endif -
branches/SHM-2.1-multilayers-dev/source/Lib/TLibCommon/TComPic.cpp
r191 r253 67 67 , m_pNDBFilterYuvTmp (NULL) 68 68 , m_bCheckLTMSB (false) 69 { 69 70 #if SVC_EXTENSION 70 , m_bSpatialEnhLayer( false ) 71 , m_pcFullPelBaseRec( NULL ) 72 #endif 73 { 71 memset( m_pcFullPelBaseRec, NULL, sizeof( m_pcFullPelBaseRec ) ); 72 memset( m_bSpatialEnhLayer, false, sizeof( m_bSpatialEnhLayer ) ); 73 #endif 74 74 m_apcPicYuv[0] = NULL; 75 75 m_apcPicYuv[1] = NULL; … … 91 91 m_apcPicYuv[1] = new TComPicYuv; m_apcPicYuv[1]->create( iWidth, iHeight, uiMaxWidth, uiMaxHeight, uiMaxDepth, pcSps ); 92 92 93 if (m_bSpatialEnhLayer) 94 { 95 m_pcFullPelBaseRec = new TComPicYuv; m_pcFullPelBaseRec->create( iWidth, iHeight, uiMaxWidth, uiMaxHeight, uiMaxDepth, pcSps ); 93 for( Int i = 0; i < MAX_LAYERS; i++ ) 94 { 95 if( m_bSpatialEnhLayer[i] ) 96 { 97 m_pcFullPelBaseRec[i] = new TComPicYuv; m_pcFullPelBaseRec[i]->create( iWidth, iHeight, uiMaxWidth, uiMaxHeight, uiMaxDepth, pcSps ); 98 } 96 99 } 97 100 … … 173 176 deleteSEIs(m_SEIs); 174 177 #if SVC_EXTENSION && SVC_UPSAMPLING 175 if (m_bSpatialEnhLayer) 176 { 177 m_pcFullPelBaseRec->destroy(); 178 delete m_pcFullPelBaseRec; 179 m_pcFullPelBaseRec = NULL; 178 for( Int i = 0; i < MAX_LAYERS; i++ ) 179 { 180 if( m_bSpatialEnhLayer[i] ) 181 { 182 m_pcFullPelBaseRec[i]->destroy(); 183 delete m_pcFullPelBaseRec[i]; 184 m_pcFullPelBaseRec[i] = NULL; 185 } 180 186 } 181 187 #endif … … 564 570 Void TComPic::copyUpsampledMvField(TComPic* pcPicBase) 565 571 { 572 UInt refLayerIdc = pcPicBase->getLayerId(); 566 573 #if AVC_SYNTAX && !ILP_DECODED_PICTURE 567 574 const Window &confBL = pcPicBase->getConformanceWindow(); … … 592 599 593 600 TComDataCU *pcColCU = 0; 594 pcColCU = pcCUDes->getBaseColCU( pelX + 8, pelY + 8, baseCUAddr, baseAbsPartIdx);601 pcColCU = pcCUDes->getBaseColCU(refLayerIdc, pelX + 8, pelY + 8, baseCUAddr, baseAbsPartIdx); 595 602 596 603 #if AVC_SYNTAX && !ILP_DECODED_PICTURE -
branches/SHM-2.1-multilayers-dev/source/Lib/TLibCommon/TComPic.h
r191 r253 92 92 SEIMessages m_SEIs; ///< Any SEI messages that have been received. If !NULL we own the object. 93 93 #if SVC_EXTENSION 94 Bool m_bSpatialEnhLayer ; // whether current layer is a spatial enhancement layer,95 TComPicYuv* m_pcFullPelBaseRec ; // upsampled base layer recontruction for difference domain inter prediction94 Bool m_bSpatialEnhLayer[MAX_LAYERS]; // whether current layer is a spatial enhancement layer, 95 TComPicYuv* m_pcFullPelBaseRec[MAX_LAYERS]; // upsampled base layer recontruction for difference domain inter prediction 96 96 #endif 97 97 … … 114 114 Void setLayerId (UInt layerId) { m_layerId = layerId; } 115 115 UInt getLayerId () { return m_layerId; } 116 Bool isSpatialEnhLayer( ) { return m_bSpatialEnhLayer; }117 Void setSpatialEnhLayerFlag ( Bool b) { m_bSpatialEnhLayer= b; }118 Void setFullPelBaseRec ( TComPicYuv* p) { m_pcFullPelBaseRec= p; }119 TComPicYuv* getFullPelBaseRec ( ) { return m_pcFullPelBaseRec; }116 Bool isSpatialEnhLayer(UInt refLayerIdc) { return m_bSpatialEnhLayer[refLayerIdc]; } 117 Void setSpatialEnhLayerFlag (UInt refLayerIdc, Bool b) { m_bSpatialEnhLayer[refLayerIdc] = b; } 118 Void setFullPelBaseRec (UInt refLayerIdc, TComPicYuv* p) { m_pcFullPelBaseRec[refLayerIdc] = p; } 119 TComPicYuv* getFullPelBaseRec (UInt refLayerIdc) { return m_pcFullPelBaseRec[refLayerIdc]; } 120 120 #endif 121 121 #if REF_IDX_ME_ZEROMV || ENCODER_FAST_MODE || REF_IDX_MFM -
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 } -
branches/SHM-2.1-multilayers-dev/source/Lib/TLibCommon/TComSlice.h
r216 r253 1494 1494 #if SVC_EXTENSION 1495 1495 UInt m_layerId; 1496 TComPic* m_pcBaseColPic ;1497 TComPicYuv* m_pcFullPelBaseRec ;1496 TComPic* m_pcBaseColPic[MAX_LAYERS]; 1497 TComPicYuv* m_pcFullPelBaseRec[MAX_LAYERS]; 1498 1498 #endif 1499 1499 Bool m_bTLayerSwitchingFlag; … … 1776 1776 1777 1777 #if SVC_EXTENSION 1778 Void setBaseColPic ( TComList<TComPic*>& rcListPic , UInt layerID ); 1779 Void setBaseColPic ( TComPic* p) { m_pcBaseColPic = p; } 1780 TComPic* getBaseColPic () { return m_pcBaseColPic; } 1778 Void setBaseColPic ( TComList<TComPic*>& rcListPic , UInt refLayerIdc ); 1779 Void setBaseColPic (UInt refLayerIdc, TComPic* p) { m_pcBaseColPic[refLayerIdc] = p; } 1780 TComPic* getBaseColPic (UInt refLayerIdc) { return m_pcBaseColPic[refLayerIdc]; } 1781 TComPic** getBaseColPic () { return &m_pcBaseColPic[0]; } 1781 1782 1782 1783 Void setLayerId (UInt layerId) { m_layerId = layerId; } 1783 1784 UInt getLayerId () { return m_layerId; } 1784 1785 1785 Void setFullPelBaseRec ( TComPicYuv* p) { m_pcFullPelBaseRec= p; }1786 TComPicYuv* getFullPelBaseRec ( ) { return m_pcFullPelBaseRec; }1786 Void setFullPelBaseRec (UInt refLayerIdc, TComPicYuv* p) { m_pcFullPelBaseRec[refLayerIdc] = p; } 1787 TComPicYuv* getFullPelBaseRec (UInt refLayerIdc) { return m_pcFullPelBaseRec[refLayerIdc]; } 1787 1788 1788 1789 #if AVC_SYNTAX … … 1795 1796 1796 1797 #if REF_IDX_MFM 1797 Void setRefPOCListILP(TComPic** ilpPic, TComPic *pcRefPicBL);1798 Void setRefPOCListILP(TComPic** ilpPic, TComPic** pcRefPicRL); 1798 1799 #endif 1799 1800 … … 1814 1815 #endif 1815 1816 #endif 1817 1818 TComPic* getRefPic(TComList<TComPic*>& rcListPic, Int poc) { return xGetRefPic( rcListPic, poc ); } 1816 1819 1817 1820 #endif //SVC_EXTENSION -
branches/SHM-2.1-multilayers-dev/source/Lib/TLibDecoder/TDecTop.cpp
r250 r253 180 180 Void TDecTop::setILRPic(TComPic *pcPic) 181 181 { 182 if(m_cIlpPic[0]) 183 { 184 m_cIlpPic[0]->copyUpsampledPictureYuv(pcPic->getFullPelBaseRec(), m_cIlpPic[0]->getPicYuvRec()); 185 m_cIlpPic[0]->getSlice(0)->setPOC(pcPic->getPOC()); 186 m_cIlpPic[0]->setLayerId(pcPic->getSlice(0)->getBaseColPic()->getLayerId()); //set reference layerId 187 m_cIlpPic[0]->getPicYuvRec()->setBorderExtension(false); 188 m_cIlpPic[0]->getPicYuvRec()->extendPicBorder(); 182 for( Int i = 0; i < pcPic->getSlice(0)->getActiveNumILRRefIdx(); i++ ) 183 { 184 Int refLayerIdc = pcPic->getSlice(0)->getInterLayerPredLayerIdc(i); 185 186 if(m_cIlpPic[refLayerIdc]) 187 { 188 m_cIlpPic[refLayerIdc]->copyUpsampledPictureYuv(pcPic->getFullPelBaseRec(i), m_cIlpPic[refLayerIdc]->getPicYuvRec()); 189 m_cIlpPic[refLayerIdc]->getSlice(0)->setPOC(pcPic->getPOC()); 190 m_cIlpPic[refLayerIdc]->setLayerId(pcPic->getSlice(0)->getBaseColPic(i)->getLayerId()); //set reference layerId 191 m_cIlpPic[refLayerIdc]->getPicYuvRec()->setBorderExtension(false); 192 m_cIlpPic[refLayerIdc]->getPicYuvRec()->extendPicBorder(); 193 } 189 194 } 190 195 } … … 248 253 if(m_layerId > 0) 249 254 { 255 for(UInt i = 0; i < pcSlice->getVPS()->getNumDirectRefLayers( m_layerId ); i++ ) 256 { 257 const Window scalEL = pcSlice->getSPS()->getScaledRefLayerWindow(); 258 Bool zeroOffsets = ( scalEL.getWindowLeftOffset() == 0 && scalEL.getWindowRightOffset() == 0 && scalEL.getWindowTopOffset() == 0 && scalEL.getWindowBottomOffset() == 0 ); 259 250 260 #if VPS_EXTN_DIRECT_REF_LAYERS 251 TDecTop *pcTDecTopBase = (TDecTop *)getRefLayerDec( m_layerId - 1);252 #else 253 TDecTop *pcTDecTopBase = (TDecTop *)getLayerDec( m_layerId-1 );254 #endif 255 //TComPic* pcPic = *(pcTDecTopBase->getListPic()->begin());256 TComPicYuv* pcPicYuvRecBase = (*(pcTDecTopBase->getListPic()->begin()))->getPicYuvRec();257 if(pcPicYuvRecBase->getWidth() != pcSlice->getSPS()->getPicWidthInLumaSamples() || pcPicYuvRecBase->getHeight() != pcSlice->getSPS()->getPicHeightInLumaSamples())258 {259 rpcPic->setSpatialEnhLayerFlag(true );260 261 //only for scalable extension262 assert( pcSlice->getVPS()->getScalabilityMask(1) == true );263 }261 TDecTop *pcTDecTopBase = (TDecTop *)getRefLayerDec( i ); 262 #else 263 TDecTop *pcTDecTopBase = (TDecTop *)getLayerDec( m_layerId-1 ); 264 #endif 265 //TComPic* pcPic = *(pcTDecTopBase->getListPic()->begin()); 266 TComPicYuv* pcPicYuvRecBase = (*(pcTDecTopBase->getListPic()->begin()))->getPicYuvRec(); 267 if(pcPicYuvRecBase->getWidth() != pcSlice->getSPS()->getPicWidthInLumaSamples() || pcPicYuvRecBase->getHeight() != pcSlice->getSPS()->getPicHeightInLumaSamples() || !zeroOffsets ) 268 { 269 rpcPic->setSpatialEnhLayerFlag( i, true ); 270 271 //only for scalable extension 272 assert( pcSlice->getVPS()->getScalabilityMask(1) == true ); 273 } 264 274 #if MAX_ONE_RESAMPLING_DIRECT_LAYERS 265 if(pcSlice->getVPS()->getScalabilityMask(1)) 266 { 267 pcSlice->setPic(rpcPic); 268 } 269 #endif 275 if(pcSlice->getVPS()->getScalabilityMask(1)) 276 { 277 pcSlice->setPic(rpcPic); 278 } 279 #endif 280 } 270 281 } 271 282 #endif … … 812 823 if(m_layerId > 0) 813 824 { 825 for( UInt i = 0; i < pcSlice->getActiveNumILRRefIdx(); i++ ) 826 { 827 UInt refLayerIdc = pcSlice->getInterLayerPredLayerIdc(i); 814 828 #if AVC_BASE 815 if(m_parameterSetManagerDecoder[0].getActiveVPS()->getAvcBaseLayerFlag() )816 {817 pcSlice->setBaseColPic (*m_ppcTDecTop[0]->getListPic()->begin() );829 if( pcSlice->getVPS()->getRefLayerId( m_layerId, refLayerIdc ) == 0 && m_parameterSetManagerDecoder[0].getActiveVPS()->getAvcBaseLayerFlag() ) 830 { 831 pcSlice->setBaseColPic ( refLayerIdc, *m_ppcTDecTop[0]->getListPic()->begin() ); 818 832 #if AVC_SYNTAX 819 TComPic* pBLPic = pcSlice->getBaseColPic();820 if( pcSlice->getPOC() == 0 )821 {822 // initialize partition order.823 UInt* piTmp = &g_auiZscanToRaster[0];824 initZscanToRaster( pBLPic->getPicSym()->getMaxDepth() + 1, 1, 0, piTmp );825 initRasterToZscan( pBLPic->getPicSym()->getMaxCUWidth(), pBLPic->getPicSym()->getMaxCUHeight(), pBLPic->getPicSym()->getMaxDepth() + 1 );826 }827 pBLPic->getSlice( 0 )->initBaseLayerRPL( pcSlice );828 pBLPic->readBLSyntax( m_ppcTDecTop[0]->getBLSyntaxFile(), SYNTAX_BYTES );829 #endif 830 }831 else832 {833 TComPic* pBLPic = pcSlice->getBaseColPic(refLayerIdc); 834 if( pcSlice->getPOC() == 0 ) 835 { 836 // initialize partition order. 837 UInt* piTmp = &g_auiZscanToRaster[0]; 838 initZscanToRaster( pBLPic->getPicSym()->getMaxDepth() + 1, 1, 0, piTmp ); 839 initRasterToZscan( pBLPic->getPicSym()->getMaxCUWidth(), pBLPic->getPicSym()->getMaxCUHeight(), pBLPic->getPicSym()->getMaxDepth() + 1 ); 840 } 841 pBLPic->getSlice( 0 )->initBaseLayerRPL( pcSlice ); 842 pBLPic->readBLSyntax( m_ppcTDecTop[0]->getBLSyntaxFile(), SYNTAX_BYTES ); 843 #endif 844 } 845 else 846 { 833 847 #if VPS_EXTN_DIRECT_REF_LAYERS 834 TDecTop *pcTDecTop = (TDecTop *)getRefLayerDec( m_layerId - 1 ); 848 TDecTop *pcTDecTop = (TDecTop *)getRefLayerDec( refLayerIdc ); 849 #else 850 TDecTop *pcTDecTop = (TDecTop *)getLayerDec( m_layerId-1 ); 851 #endif 852 TComList<TComPic*> *cListPic = pcTDecTop->getListPic(); 853 pcSlice->setBaseColPic ( *cListPic, refLayerIdc ); 854 } 855 #else 856 #if VPS_EXTN_DIRECT_REF_LAYERS 857 TDecTop *pcTDecTop = (TDecTop *)getRefLayerDec( refLayerIdc ); 835 858 #else 836 859 TDecTop *pcTDecTop = (TDecTop *)getLayerDec( m_layerId-1 ); 837 860 #endif 838 861 TComList<TComPic*> *cListPic = pcTDecTop->getListPic(); 839 pcSlice->setBaseColPic ( *cListPic, m_layerId ); 840 } 841 #else 842 #if VPS_EXTN_DIRECT_REF_LAYERS 843 TDecTop *pcTDecTop = (TDecTop *)getRefLayerDec( m_layerId ); 844 #else 845 TDecTop *pcTDecTop = (TDecTop *)getLayerDec( m_layerId-1 ); 846 #endif 847 TComList<TComPic*> *cListPic = pcTDecTop->getListPic(); 848 pcSlice->setBaseColPic ( *cListPic, m_layerId ); 862 pcSlice->setBaseColPic ( *cListPic, refLayerIdc ); 849 863 #endif 850 864 851 865 #if SIMPLIFIED_MV_POS_SCALING 852 866 #if SCALED_REF_LAYER_OFFSETS 853 const Window &scalEL = pcSlice->getSPS()->getScaledRefLayerWindow();854 855 Int widthBL = pcSlice->getBaseColPic()->getPicYuvRec()->getWidth();856 Int heightBL = pcSlice->getBaseColPic()->getPicYuvRec()->getHeight();857 858 Int widthEL = pcPic->getPicYuvRec()->getWidth() - scalEL.getWindowLeftOffset() - scalEL.getWindowRightOffset();859 Int heightEL = pcPic->getPicYuvRec()->getHeight() - scalEL.getWindowTopOffset() - scalEL.getWindowBottomOffset();860 #else 861 const Window &confBL = pcSlice->getBaseColPic()->getPicYuvRec()->getConformanceWindow();862 const Window &confEL = pcPic->getPicYuvRec()->getConformanceWindow();863 864 Int widthBL = pcSlice->getBaseColPic()->getPicYuvRec()->getWidth () - confBL.getWindowLeftOffset() - confBL.getWindowRightOffset();865 Int heightBL = pcSlice->getBaseColPic()->getPicYuvRec()->getHeight() - confBL.getWindowTopOffset() - confBL.getWindowBottomOffset();866 867 Int widthEL = pcPic->getPicYuvRec()->getWidth() - confEL.getWindowLeftOffset() - confEL.getWindowRightOffset();868 Int heightEL = pcPic->getPicYuvRec()->getHeight() - confEL.getWindowTopOffset() - confEL.getWindowBottomOffset();869 #endif 870 g_mvScalingFactor[m_layerId][0] = widthEL == widthBL ? 4096 : Clip3(-4096, 4095, ((widthEL << 8) + (widthBL >> 1)) / widthBL);871 g_mvScalingFactor[m_layerId][1] = heightEL == heightBL ? 4096 : Clip3(-4096, 4095, ((heightEL << 8) + (heightBL >> 1)) / heightBL);872 873 g_posScalingFactor[m_layerId][0] = ((widthBL << 16) + (widthEL >> 1)) / widthEL;874 g_posScalingFactor[m_layerId][1] = ((heightBL << 16) + (heightEL >> 1)) / heightEL;867 const Window &scalEL = pcSlice->getSPS()->getScaledRefLayerWindow(); 868 869 Int widthBL = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getWidth(); 870 Int heightBL = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getHeight(); 871 872 Int widthEL = pcPic->getPicYuvRec()->getWidth() - scalEL.getWindowLeftOffset() - scalEL.getWindowRightOffset(); 873 Int heightEL = pcPic->getPicYuvRec()->getHeight() - scalEL.getWindowTopOffset() - scalEL.getWindowBottomOffset(); 874 #else 875 const Window &confBL = pcSlice->getBaseColPic()->getPicYuvRec()->getConformanceWindow(); 876 const Window &confEL = pcPic->getPicYuvRec()->getConformanceWindow(); 877 878 Int widthBL = pcSlice->getBaseColPic()->getPicYuvRec()->getWidth () - confBL.getWindowLeftOffset() - confBL.getWindowRightOffset(); 879 Int heightBL = pcSlice->getBaseColPic()->getPicYuvRec()->getHeight() - confBL.getWindowTopOffset() - confBL.getWindowBottomOffset(); 880 881 Int widthEL = pcPic->getPicYuvRec()->getWidth() - confEL.getWindowLeftOffset() - confEL.getWindowRightOffset(); 882 Int heightEL = pcPic->getPicYuvRec()->getHeight() - confEL.getWindowTopOffset() - confEL.getWindowBottomOffset(); 883 #endif 884 g_mvScalingFactor[refLayerIdc][0] = widthEL == widthBL ? 4096 : Clip3(-4096, 4095, ((widthEL << 8) + (widthBL >> 1)) / widthBL); 885 g_mvScalingFactor[refLayerIdc][1] = heightEL == heightBL ? 4096 : Clip3(-4096, 4095, ((heightEL << 8) + (heightBL >> 1)) / heightBL); 886 887 g_posScalingFactor[refLayerIdc][0] = ((widthBL << 16) + (widthEL >> 1)) / widthEL; 888 g_posScalingFactor[refLayerIdc][1] = ((heightBL << 16) + (heightEL >> 1)) / heightEL; 875 889 #endif 876 890 877 891 #if SVC_UPSAMPLING 878 if ( pcPic->isSpatialEnhLayer())879 {892 if ( pcPic->isSpatialEnhLayer(refLayerIdc)) 893 { 880 894 #if SCALED_REF_LAYER_OFFSETS 881 m_cPrediction.upsampleBasePic( pcPic->getFullPelBaseRec(), pcSlice->getBaseColPic()->getPicYuvRec(), pcPic->getPicYuvRec(), pcSlice->getSPS()->getScaledRefLayerWindow() ); 882 #else 883 m_cPrediction.upsampleBasePic( pcPic->getFullPelBaseRec(), pcSlice->getBaseColPic()->getPicYuvRec(), pcPic->getPicYuvRec() ); 884 #endif 885 } 886 else 887 { 888 pcPic->setFullPelBaseRec( pcSlice->getBaseColPic()->getPicYuvRec() ); 889 } 890 pcSlice->setFullPelBaseRec ( pcPic->getFullPelBaseRec() ); 891 #endif 895 m_cPrediction.upsampleBasePic( pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), pcSlice->getSPS()->getScaledRefLayerWindow() ); 896 #else 897 m_cPrediction.upsampleBasePic( pcPic->getFullPelBaseRec(), pcSlice->getBaseColPic()->getPicYuvRec(), pcPic->getPicYuvRec() ); 898 #endif 899 } 900 else 901 { 902 pcPic->setFullPelBaseRec( refLayerIdc, pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec() ); 903 } 904 pcSlice->setFullPelBaseRec ( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc) ); 905 #endif 906 } 892 907 } 893 908 -
branches/SHM-2.1-multilayers-dev/source/Lib/TLibEncoder/TEncCu.cpp
r191 r253 458 458 if (rpcBestCU->getLayerId() > 0) 459 459 { 460 if (rpcBestCU->getSlice()->getBaseColPic()->getSlice(0)->getSliceType() == I_SLICE) 460 // the right reference layerIdc should be specified, currently it is set to 0 461 if (rpcBestCU->getSlice()->getBaseColPic(0)->getSlice(0)->getSliceType() == I_SLICE) 461 462 { 462 463 testInter = false; -
branches/SHM-2.1-multilayers-dev/source/Lib/TLibEncoder/TEncGOP.cpp
r251 r253 535 535 if (m_layerId > 0) 536 536 { 537 for( Int i = 0; i < pcSlice->getActiveNumILRRefIdx(); i++ ) 538 { 539 UInt refLayerIdc = pcSlice->getInterLayerPredLayerIdc(i); 537 540 #if VPS_EXTN_DIRECT_REF_LAYERS 538 TComList<TComPic*> *cListPic = m_ppcTEncTop[m_layerId]->getRefLayerEnc(m_layerId-1)->getListPic();539 #else 540 TComList<TComPic*> *cListPic = m_ppcTEncTop[m_layerId-1]->getListPic();541 #endif 542 pcSlice->setBaseColPic (*cListPic, m_layerId);543 541 TComList<TComPic*> *cListPic = m_ppcTEncTop[m_layerId]->getRefLayerEnc(refLayerIdc)->getListPic(); 542 #else 543 TComList<TComPic*> *cListPic = m_ppcTEncTop[m_layerId-1]->getListPic(); 544 #endif 545 pcSlice->setBaseColPic (*cListPic, refLayerIdc ); 546 544 547 #if SIMPLIFIED_MV_POS_SCALING 545 548 #if SCALED_REF_LAYER_OFFSETS 546 const Window &scalEL = m_pcEncTop->getScaledRefLayerWindow(); 547 548 Int widthBL = pcSlice->getBaseColPic()->getPicYuvRec()->getWidth(); 549 Int heightBL = pcSlice->getBaseColPic()->getPicYuvRec()->getHeight(); 550 551 Int widthEL = pcPic->getPicYuvRec()->getWidth() - scalEL.getWindowLeftOffset() - scalEL.getWindowRightOffset(); 552 Int heightEL = pcPic->getPicYuvRec()->getHeight() - scalEL.getWindowTopOffset() - scalEL.getWindowBottomOffset(); 553 #else 554 const Window &confBL = pcSlice->getBaseColPic()->getPicYuvRec()->getConformanceWindow(); 555 const Window &confEL = pcPic->getPicYuvRec()->getConformanceWindow(); 556 557 Int widthBL = pcSlice->getBaseColPic()->getPicYuvRec()->getWidth () - confBL.getWindowLeftOffset() - confBL.getWindowRightOffset(); 558 Int heightBL = pcSlice->getBaseColPic()->getPicYuvRec()->getHeight() - confBL.getWindowTopOffset() - confBL.getWindowBottomOffset(); 559 560 Int widthEL = pcPic->getPicYuvRec()->getWidth() - confEL.getWindowLeftOffset() - confEL.getWindowRightOffset(); 561 Int heightEL = pcPic->getPicYuvRec()->getHeight() - confEL.getWindowTopOffset() - confEL.getWindowBottomOffset(); 562 #endif 563 g_mvScalingFactor[m_layerId][0] = widthEL == widthBL ? 4096 : Clip3(-4096, 4095, ((widthEL << 8) + (widthBL >> 1)) / widthBL); 564 g_mvScalingFactor[m_layerId][1] = heightEL == heightBL ? 4096 : Clip3(-4096, 4095, ((heightEL << 8) + (heightBL >> 1)) / heightBL); 565 566 g_posScalingFactor[m_layerId][0] = ((widthBL << 16) + (widthEL >> 1)) / widthEL; 567 g_posScalingFactor[m_layerId][1] = ((heightBL << 16) + (heightEL >> 1)) / heightEL; 568 #endif 569 570 #if ZERO_NUM_DIRECT_LAYERS 571 if( pcSlice->getActiveNumILRRefIdx() ) 572 #endif 573 { 549 const Window &scalEL = m_pcEncTop->getScaledRefLayerWindow(); 550 551 Int widthBL = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getWidth(); 552 Int heightBL = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getHeight(); 553 554 Int widthEL = pcPic->getPicYuvRec()->getWidth() - scalEL.getWindowLeftOffset() - scalEL.getWindowRightOffset(); 555 Int heightEL = pcPic->getPicYuvRec()->getHeight() - scalEL.getWindowTopOffset() - scalEL.getWindowBottomOffset(); 556 #else 557 const Window &confBL = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getConformanceWindow(); 558 const Window &confEL = pcPic->getPicYuvRec()->getConformanceWindow(); 559 560 Int widthBL = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getWidth () - confBL.getWindowLeftOffset() - confBL.getWindowRightOffset(); 561 Int heightBL = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getHeight() - confBL.getWindowTopOffset() - confBL.getWindowBottomOffset(); 562 563 Int widthEL = pcPic->getPicYuvRec()->getWidth() - confEL.getWindowLeftOffset() - confEL.getWindowRightOffset(); 564 Int heightEL = pcPic->getPicYuvRec()->getHeight() - confEL.getWindowTopOffset() - confEL.getWindowBottomOffset(); 565 #endif 566 g_mvScalingFactor[refLayerIdc][0] = widthEL == widthBL ? 4096 : Clip3(-4096, 4095, ((widthEL << 8) + (widthBL >> 1)) / widthBL); 567 g_mvScalingFactor[refLayerIdc][1] = heightEL == heightBL ? 4096 : Clip3(-4096, 4095, ((heightEL << 8) + (heightBL >> 1)) / heightBL); 568 569 g_posScalingFactor[refLayerIdc][0] = ((widthBL << 16) + (widthEL >> 1)) / widthEL; 570 g_posScalingFactor[refLayerIdc][1] = ((heightBL << 16) + (heightEL >> 1)) / heightEL; 571 #endif 572 574 573 #if SVC_UPSAMPLING 575 if ( pcPic->isSpatialEnhLayer())574 if( pcPic->isSpatialEnhLayer(refLayerIdc)) 576 575 { 577 576 #if SCALED_REF_LAYER_OFFSETS 578 m_pcPredSearch->upsampleBasePic( pcPic->getFullPelBaseRec( ), pcSlice->getBaseColPic()->getPicYuvRec(), pcPic->getPicYuvRec(), pcSlice->getSPS()->getScaledRefLayerWindow() );579 #else 580 m_pcPredSearch->upsampleBasePic( pcPic->getFullPelBaseRec( ), pcSlice->getBaseColPic()->getPicYuvRec(), pcPic->getPicYuvRec() );577 m_pcPredSearch->upsampleBasePic( pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), pcSlice->getSPS()->getScaledRefLayerWindow() ); 578 #else 579 m_pcPredSearch->upsampleBasePic( pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec() ); 581 580 #endif 582 581 } 583 582 else 584 583 { 585 pcPic->setFullPelBaseRec( pcSlice->getBaseColPic()->getPicYuvRec() );586 } 587 pcSlice->setFullPelBaseRec ( pcPic->getFullPelBaseRec() );584 pcPic->setFullPelBaseRec( refLayerIdc, pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec() ); 585 } 586 pcSlice->setFullPelBaseRec ( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc) ); 588 587 #endif 589 588 } … … 595 594 { 596 595 #if IDR_ALIGNMENT 597 if( pcSlice->getBaseColPic()->getSlice(0)->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || pcSlice->getBaseColPic()->getSlice(0)->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP ) 598 { 599 pcSlice->setNalUnitType(pcSlice->getBaseColPic()->getSlice(0)->getNalUnitType()); 596 TComList<TComPic*> *cListPic = m_ppcTEncTop[m_layerId]->getRefLayerEnc(0)->getListPic(); 597 TComPic* picLayer0 = pcSlice->getRefPic(*cListPic, pcSlice->getPOC() ); 598 if( picLayer0->getSlice(0)->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || picLayer0->getSlice(0)->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP ) 599 { 600 pcSlice->setNalUnitType(picLayer0->getSlice(0)->getNalUnitType()); 600 601 } 601 602 else -
branches/SHM-2.1-multilayers-dev/source/Lib/TLibEncoder/TEncTop.cpp
r250 r253 507 507 if(m_layerId > 0) 508 508 { 509 for(UInt i = 0; i < m_cVPS.getNumDirectRefLayers( m_layerId ); i++ ) 510 { 511 const Window scalEL = getSPS()->getScaledRefLayerWindow(); 512 Bool zeroOffsets = ( scalEL.getWindowLeftOffset() == 0 && scalEL.getWindowRightOffset() == 0 && scalEL.getWindowTopOffset() == 0 && scalEL.getWindowBottomOffset() == 0 ); 513 509 514 #if VPS_EXTN_DIRECT_REF_LAYERS 510 TEncTop *pcEncTopBase = (TEncTop *)getRefLayerEnc( m_layerId - 1 ); 511 #else 512 TEncTop *pcEncTopBase = (TEncTop *)getLayerEnc( m_layerId-1 ); 513 #endif 514 if(m_iSourceWidth != pcEncTopBase->getSourceWidth() || m_iSourceHeight != pcEncTopBase->getSourceHeight() ) 515 { 516 pcEPic->setSpatialEnhLayerFlag( true ); 517 518 //only for scalable extension 519 assert( m_cVPS.getScalabilityMask(1) == true ); 515 TEncTop *pcEncTopBase = (TEncTop *)getRefLayerEnc( i ); 516 #else 517 TEncTop *pcEncTopBase = (TEncTop *)getLayerEnc( m_layerId-1 ); 518 #endif 519 if(m_iSourceWidth != pcEncTopBase->getSourceWidth() || m_iSourceHeight != pcEncTopBase->getSourceHeight() || !zeroOffsets ) 520 { 521 pcEPic->setSpatialEnhLayerFlag( i, true ); 522 523 //only for scalable extension 524 assert( m_cVPS.getScalabilityMask(1) == true ); 525 } 520 526 } 521 527 } … … 538 544 if(m_layerId > 0) 539 545 { 546 for(UInt i = 0; i < m_cVPS.getNumDirectRefLayers( m_layerId ); i++ ) 547 { 548 const Window scalEL = getSPS()->getScaledRefLayerWindow(); 549 Bool zeroOffsets = ( scalEL.getWindowLeftOffset() == 0 && scalEL.getWindowRightOffset() == 0 && scalEL.getWindowTopOffset() == 0 && scalEL.getWindowBottomOffset() == 0 ); 550 540 551 #if VPS_EXTN_DIRECT_REF_LAYERS 541 TEncTop *pcEncTopBase = (TEncTop *)getRefLayerEnc( m_layerId - 1 ); 542 #else 543 TEncTop *pcEncTopBase = (TEncTop *)getLayerEnc( m_layerId-1 ); 544 #endif 545 if(m_iSourceWidth != pcEncTopBase->getSourceWidth() || m_iSourceHeight != pcEncTopBase->getSourceHeight() ) 546 { 547 rpcPic->setSpatialEnhLayerFlag( true ); 548 549 //only for scalable extension 550 assert( m_cVPS.getScalabilityMask(1) == true ); 552 TEncTop *pcEncTopBase = (TEncTop *)getRefLayerEnc( i ); 553 #else 554 TEncTop *pcEncTopBase = (TEncTop *)getLayerEnc( m_layerId-1 ); 555 #endif 556 if(m_iSourceWidth != pcEncTopBase->getSourceWidth() || m_iSourceHeight != pcEncTopBase->getSourceHeight() || !zeroOffsets ) 557 { 558 rpcPic->setSpatialEnhLayerFlag( i, true ); 559 560 //only for scalable extension 561 assert( m_cVPS.getScalabilityMask(1) == true ); 562 } 551 563 } 552 564 } … … 1235 1247 if (m_cIlpPic[0] == NULL) 1236 1248 { 1237 for (Int j=0; j <1/*MAX_NUM_REF*/; j++)1249 for (Int j=0; j < MAX_LAYERS /*MAX_NUM_REF*/; j++) 1238 1250 { 1239 1251 m_cIlpPic[j] = new TComPic; … … 1254 1266 Void TEncTop::setILRPic(TComPic *pcPic) 1255 1267 { 1256 if(m_cIlpPic[0]) 1257 { 1258 m_cIlpPic[0]->copyUpsampledPictureYuv(pcPic->getFullPelBaseRec(), m_cIlpPic[0]->getPicYuvRec()); 1259 m_cIlpPic[0]->getSlice(0)->setPOC(pcPic->getPOC()); 1260 m_cIlpPic[0]->setLayerId(pcPic->getSlice(0)->getBaseColPic()->getLayerId()); //set reference layerId 1261 m_cIlpPic[0]->getPicYuvRec()->setBorderExtension(false); 1262 m_cIlpPic[0]->getPicYuvRec()->extendPicBorder(); 1268 for( Int i = 0; i < pcPic->getSlice(0)->getActiveNumILRRefIdx(); i++ ) 1269 { 1270 Int refLayerIdc = pcPic->getSlice(0)->getInterLayerPredLayerIdc(i); 1271 1272 if(m_cIlpPic[refLayerIdc]) 1273 { 1274 m_cIlpPic[refLayerIdc]->copyUpsampledPictureYuv(pcPic->getFullPelBaseRec(refLayerIdc), m_cIlpPic[refLayerIdc]->getPicYuvRec()); 1275 m_cIlpPic[refLayerIdc]->getSlice(0)->setPOC(pcPic->getPOC()); 1276 m_cIlpPic[refLayerIdc]->setLayerId(pcPic->getSlice(0)->getBaseColPic(refLayerIdc)->getLayerId()); //set reference layerId 1277 m_cIlpPic[refLayerIdc]->getPicYuvRec()->setBorderExtension(false); 1278 m_cIlpPic[refLayerIdc]->getPicYuvRec()->extendPicBorder(); 1279 } 1263 1280 } 1264 1281 }
Note: See TracChangeset for help on using the changeset viewer.