Changeset 282 in SHVCSoftware for branches/SHM-2.1-dev/source/Lib/TLibCommon
- Timestamp:
- 11 Jun 2013, 02:30:21 (12 years ago)
- Location:
- branches/SHM-2.1-dev/source
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-2.1-dev/source
- Property svn:mergeinfo changed
/branches/SHM-2.1-multilayers-dev/source (added) merged: 253-257,259-275,277-280
- Property svn:mergeinfo changed
-
branches/SHM-2.1-dev/source/Lib/TLibCommon/TComDataCU.cpp
r212 r282 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 m_layerId-1 1753 TComDataCU* pcTempCU = getBaseColCU(m_layerId - 1, 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 … … 4316 4319 } 4317 4320 4318 Void TComDataCU::scaleBaseMV( TComMvField& rcMvFieldEnhance, TComMvField& rcMvFieldBase )4321 Void TComDataCU::scaleBaseMV( UInt refLayerIdc, TComMvField& rcMvFieldEnhance, TComMvField& rcMvFieldBase ) 4319 4322 { 4320 4323 TComMvField cMvFieldBase; 4321 4324 TComMv cMv; 4322 4325 #if SIMPLIFIED_MV_POS_SCALING 4323 cMv = rcMvFieldBase.getMv().scaleMv( g_mvScalingFactor[ m_layerId][0], g_mvScalingFactor[m_layerId][1] );4326 cMv = rcMvFieldBase.getMv().scaleMv( g_mvScalingFactor[refLayerIdc][0], g_mvScalingFactor[refLayerIdc][1] ); 4324 4327 #else 4325 4328 const Window &confBL = m_pcSlice->getBaseColPic()->getPicYuvRec()->getConformanceWindow(); -
branches/SHM-2.1-dev/source/Lib/TLibCommon/TComDataCU.h
r212 r282 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 );558 Void scaleBaseMV( TComMvField& rcMvFieldEnhance, TComMvField& rcMvFieldBase );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 Void scaleBaseMV( UInt refLayerIdc, TComMvField& rcMvFieldEnhance, TComMvField& rcMvFieldBase ); 559 559 #endif 560 560 }; -
branches/SHM-2.1-dev/source/Lib/TLibCommon/TComPic.cpp
r191 r282 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, 0, 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 … … 562 568 563 569 #if REF_IDX_MFM 564 Void TComPic::copyUpsampledMvField( TComPic* pcPicBase)570 Void TComPic::copyUpsampledMvField(UInt refLayerIdc, TComPic* pcPicBase) 565 571 { 566 572 #if AVC_SYNTAX && !ILP_DECODED_PICTURE … … 592 598 593 599 TComDataCU *pcColCU = 0; 594 pcColCU = pcCUDes->getBaseColCU( pelX + 8, pelY + 8, baseCUAddr, baseAbsPartIdx);600 pcColCU = pcCUDes->getBaseColCU(refLayerIdc, pelX + 8, pelY + 8, baseCUAddr, baseAbsPartIdx); 595 601 596 602 #if AVC_SYNTAX && !ILP_DECODED_PICTURE … … 607 613 TComMvField sMvFieldBase, sMvField; 608 614 pcColCU->getMvField( pcColCU, baseAbsPartIdx, (RefPicList)refPicList, sMvFieldBase); 609 pcCUDes->scaleBaseMV( sMvField, sMvFieldBase );615 pcCUDes->scaleBaseMV( refLayerIdc, sMvField, sMvFieldBase ); 610 616 611 617 pcCUDes->getCUMvField((RefPicList)refPicList)->setMvField(sMvField, absPartIdx); -
branches/SHM-2.1-dev/source/Lib/TLibCommon/TComPic.h
r191 r282 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 … … 124 124 125 125 #if REF_IDX_MFM 126 Void copyUpsampledMvField ( TComPic* pcPicBase );126 Void copyUpsampledMvField ( UInt refLayerIdc, TComPic* pcPicBase ); 127 127 Void initUpsampledMvField (); 128 128 #endif -
branches/SHM-2.1-dev/source/Lib/TLibCommon/TComPrediction.cpp
r191 r282 774 774 #if SVC_UPSAMPLING 775 775 #if SCALED_REF_LAYER_OFFSETS 776 Void TComPrediction::upsampleBasePic( TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window)777 { 778 m_cUsf.upsampleBasePic( pcUsPic, pcBasePic, pcTempPic, window);776 Void TComPrediction::upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window) 777 { 778 m_cUsf.upsampleBasePic( refLayerIdc, pcUsPic, pcBasePic, pcTempPic, window); 779 779 } 780 780 #else 781 Void TComPrediction::upsampleBasePic( TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic)782 { 783 m_cUsf.upsampleBasePic( pcUsPic, pcBasePic, pcTempPic);781 Void TComPrediction::upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic) 782 { 783 m_cUsf.upsampleBasePic( refLayerIdc, pcUsPic, pcBasePic, pcTempPic); 784 784 } 785 785 #endif -
branches/SHM-2.1-dev/source/Lib/TLibCommon/TComPrediction.h
r191 r282 123 123 #if SVC_UPSAMPLING 124 124 #if SCALED_REF_LAYER_OFFSETS 125 Void upsampleBasePic( TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window );125 Void upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window ); 126 126 #else 127 Void upsampleBasePic( TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic );127 Void upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic ); 128 128 #endif 129 129 #endif -
branches/SHM-2.1-dev/source/Lib/TLibCommon/TComSlice.cpp
r258 r282 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, 0, 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( 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( refLayerIdc, 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 { … … 570 576 m_activeNumILRRefIdx = numInterLayerRPSPics; 571 577 } 572 #if MAX_ONE_RESAMPLING_DIRECT_LAYERS 573 if( getVPS()->getScalabilityMask(1))578 #if MAX_ONE_RESAMPLING_DIRECT_LAYERS && SIMPLIFIED_MV_POS_SCALING 579 if( m_pcVPS->getScalabilityMask(1) ) 574 580 { 575 581 Int numResampler = 0; … … 581 587 ); 582 588 583 Int widthEL = getPic()->getPicYuvRec()->getWidth(); 584 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(); 589 590 if(!(widthEL == widthBL && heightEL == heightBL && (scalingOffset))) 589 for( i=0; i < m_activeNumILRRefIdx; i++ ) 590 { 591 UInt refLayerIdc = m_interLayerPredLayerIdc[i]; 592 if(!( g_posScalingFactor[refLayerIdc][0] == 65536 && g_posScalingFactor[refLayerIdc][1] == 65536 ) && (scalingOffset)) // ratio 1x 591 593 { 592 594 numResampler++; … … 660 662 } 661 663 #if REF_IDX_FRAMEWORK 662 if( getLayerId())664 if( m_layerId > 0 ) 663 665 { 664 666 #if JCTVC_M0458_INTERLAYER_RPS_SIG … … 668 670 #endif 669 671 { 672 Int refLayerIdc = m_interLayerPredLayerIdc[i]; 670 673 #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];674 Int maxSubLayerForILPPlus1 = getVPS()->getMaxSublayerForIlpPlus1(ilpPic[refLayerIdc]->getSlice(0)->getLayerId()); 675 if( ((Int)(ilpPic[refLayerIdc]->getSlice(0)->getTLayer())<=maxSubLayerForILPPlus1-1) || (maxSubLayerForILPPlus1==0 && ilpPic[refLayerIdc]->getSlice(0)->getRapPicFlag()) ) 676 #endif 677 rpsCurrList0[cIdx] = ilpPic[refLayerIdc]; 675 678 } 676 679 } … … 692 695 } 693 696 #if REF_IDX_FRAMEWORK 694 if( getLayerId())697 if( m_layerId > 0 ) 695 698 { 696 699 #if JCTVC_M0458_INTERLAYER_RPS_SIG … … 700 703 #endif 701 704 { 705 Int refLayerIdc = m_interLayerPredLayerIdc[i]; 702 706 #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];707 Int maxSubLayerForILPPlus1 = getVPS()->getMaxSublayerForIlpPlus1(ilpPic[refLayerIdc]->getSlice(0)->getLayerId()); 708 if( ((Int)(ilpPic[refLayerIdc]->getSlice(0)->getTLayer())<=maxSubLayerForILPPlus1-1) || (maxSubLayerForILPPlus1==0 && ilpPic[refLayerIdc]->getSlice(0)->getRapPicFlag()) ) 709 #endif 710 rpsCurrList1[cIdx] = ilpPic[refLayerIdc]; 707 711 } 708 712 } … … 737 741 Void TComSlice::setRefPicListModificationSvc() 738 742 { 739 if( ! this->getPPS()->getListsModificationPresentFlag())743 if( !m_pcPPS->getListsModificationPresentFlag()) 740 744 { 741 745 return; 742 746 } 743 747 744 if( this->getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && this->getNalUnitType()<= NAL_UNIT_CODED_SLICE_CRA)748 if(m_eNalUnitType >= NAL_UNIT_CODED_SLICE_BLA_W_LP && m_eNalUnitType <= NAL_UNIT_CODED_SLICE_CRA) 745 749 { 746 750 return; 747 751 } 748 752 749 TComRefPicListModification* refPicListModification = this->getRefPicListModification();753 TComRefPicListModification* refPicListModification = &m_RefPicListModification; 750 754 Int numberOfRpsCurrTempList = this->getNumRpsCurrTempList(); // total number of ref pics in listTemp0 including inter-layer ref pics 751 755 … … 821 825 822 826 #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) ) )827 if( m_eSliceType == I_SLICE || ( m_pcSPS->getLayerId() && 828 (m_eNalUnitType >= NAL_UNIT_CODED_SLICE_BLA_W_LP) && 829 (m_eNalUnitType <= NAL_UNIT_CODED_SLICE_CRA) ) ) 826 830 #else 827 831 if (m_eSliceType == I_SLICE) … … 846 850 } 847 851 #if REF_IDX_FRAMEWORK 848 if( getLayerId())852 if( m_layerId > 0 ) 849 853 { 850 854 #if JCTVC_M0458_INTERLAYER_RPS_SIG … … 2592 2596 #endif 2593 2597 2594 Void TComSlice::setBaseColPic( TComList<TComPic*>& rcListPic, UInt layerID)2598 Void TComSlice::setBaseColPic( TComList<TComPic*>& rcListPic, UInt refLayerIdc ) 2595 2599 { 2596 if (layerID== 0)2597 { 2598 m _pcBaseColPic = NULL;2600 if(m_layerId == 0) 2601 { 2602 memset( m_pcBaseColPic, 0, sizeof( m_pcBaseColPic ) ); 2599 2603 return; 2600 2604 } 2601 setBaseColPic( xGetRefPic(rcListPic, getPOC()));2605 setBaseColPic(refLayerIdc, xGetRefPic(rcListPic, getPOC())); 2602 2606 } 2603 2607 #endif 2604 2608 2605 2609 #if REF_IDX_MFM 2606 Void TComSlice::setRefPOCListILP( TComPic** ilpPic, TComPic *pcRefPicBL ) 2607 { 2608 //set reference picture POC of each ILP reference 2609 Int thePoc = ilpPic[0]->getPOC(); 2610 assert(thePoc >= 0); 2611 assert(thePoc == pcRefPicBL->getPOC()); 2612 2613 ilpPic[0]->getSlice(0)->setBaseColPic( pcRefPicBL ); 2614 2615 //copy reference pictures marking from the reference layer 2616 ilpPic[0]->getSlice(0)->copySliceInfo(pcRefPicBL->getSlice(0)); 2617 2618 for( Int refList = 0; refList < 2; refList++ ) 2619 { 2620 RefPicList refPicList = RefPicList( refList ); 2621 2622 //set reference POC of ILP 2623 ilpPic[0]->getSlice(0)->setNumRefIdx(refPicList, pcRefPicBL->getSlice(0)->getNumRefIdx(refPicList)); 2624 assert(ilpPic[0]->getSlice(0)->getNumRefIdx(refPicList) >= 0); 2625 assert(ilpPic[0]->getSlice(0)->getNumRefIdx(refPicList) <= MAX_NUM_REF); 2626 2627 //initialize reference POC of ILP 2628 for(Int refIdx = 0; refIdx < pcRefPicBL->getSlice(0)->getNumRefIdx(refPicList); refIdx++) 2629 { 2630 ilpPic[0]->getSlice(0)->setRefPOC(pcRefPicBL->getSlice(0)->getRefPOC(refPicList, refIdx), refPicList, refIdx); 2631 ilpPic[0]->getSlice(0)->setRefPic(pcRefPicBL->getSlice(0)->getRefPic(refPicList, refIdx), refPicList, refIdx); 2632 } 2633 2634 for(Int refIdx = pcRefPicBL->getSlice(0)->getNumRefIdx(refPicList); refIdx < MAX_NUM_REF; refIdx++) 2635 { 2636 ilpPic[0]->getSlice(0)->setRefPOC(0, refPicList, refIdx); 2637 ilpPic[0]->getSlice(0)->setRefPic(NULL, refPicList, refIdx); 2610 Void TComSlice::setRefPOCListILP( TComPic** ilpPic, TComPic** pcRefPicRL ) 2611 { 2612 for( UInt i = 0; i < m_activeNumILRRefIdx; i++ ) 2613 { 2614 UInt refLayerIdc = m_interLayerPredLayerIdc[i]; 2615 2616 TComPic* pcRefPicBL = pcRefPicRL[refLayerIdc]; 2617 //set reference picture POC of each ILP reference 2618 Int thePoc = ilpPic[refLayerIdc]->getPOC(); 2619 assert(thePoc >= 0); 2620 assert(thePoc == pcRefPicBL->getPOC()); 2621 2622 ilpPic[refLayerIdc]->getSlice(0)->setBaseColPic( refLayerIdc, pcRefPicBL ); 2623 2624 //copy reference pictures marking from the reference layer 2625 ilpPic[refLayerIdc]->getSlice(0)->copySliceInfo(pcRefPicBL->getSlice(0)); 2626 2627 for( Int refList = 0; refList < 2; refList++ ) 2628 { 2629 RefPicList refPicList = RefPicList( refList ); 2630 2631 //set reference POC of ILP 2632 ilpPic[refLayerIdc]->getSlice(0)->setNumRefIdx(refPicList, pcRefPicBL->getSlice(0)->getNumRefIdx(refPicList)); 2633 assert(ilpPic[refLayerIdc]->getSlice(0)->getNumRefIdx(refPicList) >= 0); 2634 assert(ilpPic[refLayerIdc]->getSlice(0)->getNumRefIdx(refPicList) <= MAX_NUM_REF); 2635 2636 //initialize reference POC of ILP 2637 for(Int refIdx = 0; refIdx < pcRefPicBL->getSlice(0)->getNumRefIdx(refPicList); refIdx++) 2638 { 2639 ilpPic[refLayerIdc]->getSlice(0)->setRefPOC(pcRefPicBL->getSlice(0)->getRefPOC(refPicList, refIdx), refPicList, refIdx); 2640 ilpPic[refLayerIdc]->getSlice(0)->setRefPic(pcRefPicBL->getSlice(0)->getRefPic(refPicList, refIdx), refPicList, refIdx); 2641 } 2642 2643 for(Int refIdx = pcRefPicBL->getSlice(0)->getNumRefIdx(refPicList); refIdx < MAX_NUM_REF; refIdx++) 2644 { 2645 ilpPic[refLayerIdc]->getSlice(0)->setRefPOC(0, refPicList, refIdx); 2646 ilpPic[refLayerIdc]->getSlice(0)->setRefPic(NULL, refPicList, refIdx); 2647 } 2638 2648 } 2639 2649 } -
branches/SHM-2.1-dev/source/Lib/TLibCommon/TComSlice.h
r258 r282 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; … … 1775 1775 1776 1776 #if SVC_EXTENSION 1777 Void setBaseColPic ( TComList<TComPic*>& rcListPic , UInt layerID ); 1778 Void setBaseColPic ( TComPic* p) { m_pcBaseColPic = p; } 1779 TComPic* getBaseColPic () { return m_pcBaseColPic; } 1777 Void setBaseColPic ( TComList<TComPic*>& rcListPic , UInt refLayerIdc ); 1778 Void setBaseColPic (UInt refLayerIdc, TComPic* p) { m_pcBaseColPic[refLayerIdc] = p; } 1779 TComPic* getBaseColPic (UInt refLayerIdc) { return m_pcBaseColPic[refLayerIdc]; } 1780 TComPic** getBaseColPic () { return &m_pcBaseColPic[0]; } 1780 1781 1781 1782 Void setLayerId (UInt layerId) { m_layerId = layerId; } 1782 1783 UInt getLayerId () { return m_layerId; } 1783 1784 1784 Void setFullPelBaseRec ( TComPicYuv* p) { m_pcFullPelBaseRec= p; }1785 TComPicYuv* getFullPelBaseRec ( ) { return m_pcFullPelBaseRec; }1785 Void setFullPelBaseRec (UInt refLayerIdc, TComPicYuv* p) { m_pcFullPelBaseRec[refLayerIdc] = p; } 1786 TComPicYuv* getFullPelBaseRec (UInt refLayerIdc) { return m_pcFullPelBaseRec[refLayerIdc]; } 1786 1787 1787 1788 #if AVC_SYNTAX … … 1794 1795 1795 1796 #if REF_IDX_MFM 1796 Void setRefPOCListILP(TComPic** ilpPic, TComPic *pcRefPicBL);1797 Void setRefPOCListILP(TComPic** ilpPic, TComPic** pcRefPicRL); 1797 1798 #endif 1798 1799 … … 1801 1802 Void setActiveNumILRRefIdx ( Int i ) { m_activeNumILRRefIdx = i; } 1802 1803 1803 Int getInterLayerPredLayerIdc (UInt Idx ) { return m_interLayerPredLayerIdc[Idx];}1804 Void setInterLayerPredLayerIdc (UInt val, UInt Idx) { m_interLayerPredLayerIdc[Idx] = val; }1804 Int getInterLayerPredLayerIdc (UInt layerIdx) { return m_interLayerPredLayerIdc[layerIdx];} 1805 Void setInterLayerPredLayerIdc (UInt refLayerIdc, UInt layerIdx) { m_interLayerPredLayerIdc[layerIdx] = refLayerIdc; } 1805 1806 1806 1807 Void setInterLayerPredEnabledFlag ( Bool val ) { m_interLayerPredEnabledFlag = val; } 1807 1808 Bool getInterLayerPredEnabledFlag () { return m_interLayerPredEnabledFlag;} 1808 1809 1809 #else 1810 1810 Void setNumILRRefIdx ( Int i ) { m_numILRRefIdx = i; } 1811 1811 #endif 1812 1812 #endif 1813 1814 TComPic* getRefPic(TComList<TComPic*>& rcListPic, Int poc) { return xGetRefPic( rcListPic, poc ); } 1813 1815 1814 1816 #endif //SVC_EXTENSION -
branches/SHM-2.1-dev/source/Lib/TLibCommon/TComUpsampleFilter.cpp
r237 r282 74 74 75 75 #if SCALED_REF_LAYER_OFFSETS 76 Void TComUpsampleFilter::upsampleBasePic( TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window )77 #else 78 Void TComUpsampleFilter::upsampleBasePic( TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic )76 Void TComUpsampleFilter::upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window ) 77 #else 78 Void TComUpsampleFilter::upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic ) 79 79 #endif 80 80 { … … 127 127 Pel* piDstV; 128 128 129 if( widthEL == widthBL && heightEL == heightBL ) 129 #if SIMPLIFIED_MV_POS_SCALING 130 Int scaleX = g_posScalingFactor[refLayerIdc][0]; 131 Int scaleY = g_posScalingFactor[refLayerIdc][1]; 132 #else 133 Int scaleX = ( ( widthBL << shiftX ) + ( widthEL >> 1 ) ) / widthEL; 134 Int scaleY = ( ( heightBL << shiftY ) + ( heightEL >> 1 ) ) / heightEL; 135 #endif 136 137 if( scaleX == 65536 && scaleY == 65536 ) // ratio 1x 130 138 { 131 139 piSrcY = piSrcBufY - scalEL.getWindowLeftOffset() - scalEL.getWindowTopOffset() * strideEL; … … 196 204 Int shiftYM4 = shiftY - 4; 197 205 198 Int scaleX = ( ( widthBL << shiftX ) + ( widthEL >> 1 ) ) / widthEL;199 Int scaleY = ( ( heightBL << shiftY ) + ( heightEL >> 1 ) ) / heightEL;200 201 206 #if ILP_DECODED_PICTURE 202 207 widthEL = pcUsPic->getWidth (); … … 334 339 shiftYM4 = shiftY - 4; 335 340 341 #if !SIMPLIFIED_MV_POS_SCALING 336 342 scaleX = ( ( widthBL << shiftX ) + ( widthEL >> 1 ) ) / widthEL; 337 343 scaleY = ( ( heightBL << shiftY ) + ( heightEL >> 1 ) ) / heightEL; 344 #endif 338 345 339 346 #if ILP_DECODED_PICTURE -
branches/SHM-2.1-dev/source/Lib/TLibCommon/TComUpsampleFilter.h
r235 r282 44 44 45 45 #if SCALED_REF_LAYER_OFFSETS 46 Void upsampleBasePic( TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window );46 Void upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window ); 47 47 #else 48 Void upsampleBasePic( TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic );48 Void upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic ); 49 49 #endif 50 50 }; -
branches/SHM-2.1-dev/source/Lib/TLibCommon/TypeDef.h
r242 r282 47 47 #define SCALED_REF_LAYER_OFFSET_FLAG 1 ///< M0309: Signal scaled reference layer offsets in SPS 48 48 #define SCALED_REF_LAYER_OFFSETS 1 ///< M0309: Signal scaled reference layer offsets in SPS 49 #define MAX_LAYERS 2///< max number of layers the codec is supposed to handle49 #define MAX_LAYERS 3 ///< max number of layers the codec is supposed to handle 50 50 51 51 #define VPS_RENAME 1 ///< Rename variables max_layer_id and num_layer_sets_minus1 in VPS
Note: See TracChangeset for help on using the changeset viewer.