Changeset 1419 in SHVCSoftware for branches/SHM-dev/source/Lib/TLibEncoder
- Timestamp:
- 5 Aug 2015, 03:02:48 (9 years ago)
- Location:
- branches/SHM-dev/source/Lib/TLibEncoder
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev/source/Lib/TLibEncoder/TEnc3DAsymLUT.cpp
r1297 r1419 549 549 TComPicYuv *pcRecPicBL = pSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(); 550 550 // borders of down-sampled picture 551 Int leftDS = (scalEL.getWindowLeftOffset() *g_posScalingFactor[refLayerIdc][0]+(1<<15))>>16;552 Int rightDS = pcRecPicBL->getWidth(COMPONENT_Y) - 1 + (((scalEL.getWindowRightOffset()) *g_posScalingFactor[refLayerIdc][0]+(1<<15))>>16);553 Int topDS = (((scalEL.getWindowTopOffset()) *g_posScalingFactor[refLayerIdc][1]+(1<<15))>>16);554 Int bottomDS = pcRecPicBL->getHeight(COMPONENT_Y) - 1 + (((scalEL.getWindowBottomOffset()) *g_posScalingFactor[refLayerIdc][1]+(1<<15))>>16);551 Int leftDS = (scalEL.getWindowLeftOffset() * pSlice->getPic()->getPosScalingFactor(refLayerIdc, 0)+(1<<15))>>16; 552 Int rightDS = pcRecPicBL->getWidth(COMPONENT_Y) - 1 + (((scalEL.getWindowRightOffset()) * pSlice->getPic()->getPosScalingFactor(refLayerIdc, 0)+(1<<15))>>16); 553 Int topDS = (((scalEL.getWindowTopOffset()) * pSlice->getPic()->getPosScalingFactor(refLayerIdc, 1)+(1<<15))>>16); 554 Int bottomDS = pcRecPicBL->getHeight(COMPONENT_Y) - 1 + (((scalEL.getWindowBottomOffset()) * pSlice->getPic()->getPosScalingFactor(refLayerIdc, 1)+(1<<15))>>16); 555 555 // overlapped region 556 556 Int left = max( 0 , leftDS ); -
branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp
r1415 r1419 1732 1732 if (m_layerId > 0) 1733 1733 { 1734 if( pcSlice->getSliceIdx() == 0 ) 1735 { 1736 // create buffers for scaling factors 1737 pcSlice->getPic()->createMvScalingFactor(pcSlice->getNumILRRefIdx()); 1738 pcSlice->getPic()->createPosScalingFactor(pcSlice->getNumILRRefIdx()); 1739 } 1740 1734 1741 Int interLayerPredLayerIdcTmp[MAX_VPS_LAYER_IDX_PLUS1]; 1735 1742 Int activeNumILRRefIdxTmp = 0; … … 1773 1780 && ( (heightEL != heightBL) || (resamplingPhase.phaseVerLuma == 0 && resamplingPhase.phaseVerChroma == 0) ) ); 1774 1781 1775 g_mvScalingFactor[refLayerIdc][0] = widthEL == widthBL ? 4096 : Clip3(-4096, 4095, ((widthEL << 8) + (widthBL >> 1)) / widthBL); 1776 g_mvScalingFactor[refLayerIdc][1] = heightEL == heightBL ? 4096 : Clip3(-4096, 4095, ((heightEL << 8) + (heightBL >> 1)) / heightBL); 1777 1778 g_posScalingFactor[refLayerIdc][0] = ((widthBL << 16) + (widthEL >> 1)) / widthEL; 1779 g_posScalingFactor[refLayerIdc][1] = ((heightBL << 16) + (heightEL >> 1)) / heightEL; 1782 pcSlice->getPic()->setMvScalingFactor( refLayerIdc, 1783 widthEL == widthBL ? 4096 : Clip3(-4096, 4095, ((widthEL << 8) + (widthBL >> 1)) / widthBL), 1784 heightEL == heightBL ? 4096 : Clip3(-4096, 4095, ((heightEL << 8) + (heightBL >> 1)) / heightBL) ); 1785 1786 pcSlice->getPic()->setPosScalingFactor( refLayerIdc, 1787 ((widthBL << 16) + (widthEL >> 1)) / widthEL, 1788 ((heightBL << 16) + (heightEL >> 1)) / heightEL ); 1780 1789 1781 1790 #if CGS_3D_ASYMLUT … … 1787 1796 m_Enc3DAsymLUTPicUpdate.addRefLayerId( pcSlice->getVPS()->getRefLayerId(m_layerId, refLayerIdc) ); 1788 1797 1789 if( g_posScalingFactor[refLayerIdc][0] < (1<<16) || g_posScalingFactor[refLayerIdc][1]< (1<<16) ) //if(pcPic->isSpatialEnhLayer(refLayerIdc))1798 if( pcSlice->getPic()->getMvScalingFactor(refLayerIdc, 0) < (1<<16) || pcSlice->getPic()->getMvScalingFactor(refLayerIdc, 1) < (1<<16) ) //if(pcPic->isSpatialEnhLayer(refLayerIdc)) 1790 1799 { 1791 1800 //downsampling 1792 downScalePic(pcPic->getPicYuvOrg(), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvOrg(), pcSlice->getBitDepths() );1801 downScalePic(pcPic->getPicYuvOrg(), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvOrg(), pcSlice->getBitDepths(), pcPic->getPosScalingFactor()); 1793 1802 1794 1803 m_Enc3DAsymLUTPPS.setDsOrigPic(pcSlice->getBaseColPic(refLayerIdc)->getPicYuvOrg()); … … 3297 3306 UInt refLayerId = pcSlice->getRefPic(RefPicList(iRefList), iRefIndex)->getLayerId(); 3298 3307 UInt refLayerIdc = pcSlice->getReferenceLayerIdc(refLayerId); 3299 assert( g_posScalingFactor[refLayerIdc][0]);3300 assert( g_posScalingFactor[refLayerIdc][1]);3301 3302 printf( "%d(%d, {%1.2f, %1.2f}x)", pcSlice->getRefPOC(RefPicList(iRefList), iRefIndex), refLayerId, 65536.0/ g_posScalingFactor[refLayerIdc][0], 65536.0/g_posScalingFactor[refLayerIdc][1]);3308 assert( pcSlice->getPic()->getPosScalingFactor(refLayerIdc, 0) ); 3309 assert( pcSlice->getPic()->getPosScalingFactor(refLayerIdc, 1) ); 3310 3311 printf( "%d(%d, {%1.2f, %1.2f}x)", pcSlice->getRefPOC(RefPicList(iRefList), iRefIndex), refLayerId, 65536.0/pcSlice->getPic()->getPosScalingFactor(refLayerIdc, 0), 65536.0/pcSlice->getPic()->getPosScalingFactor(refLayerIdc, 1) ); 3303 3312 } 3304 3313 else … … 4178 4187 } 4179 4188 4180 Void TEncGOP::downScalePic( TComPicYuv* pcYuvSrc, TComPicYuv* pcYuvDest, BitDepths& bitDepth )4189 Void TEncGOP::downScalePic( TComPicYuv* pcYuvSrc, TComPicYuv* pcYuvDest, BitDepths& bitDepth, Int** posScalingFactor) 4181 4190 { 4182 4191 pcYuvSrc->setBorderExtension(false); 4183 pcYuvSrc->extendPicBorder 4192 pcYuvSrc->extendPicBorder(); // extend the border. 4184 4193 pcYuvSrc->setBorderExtension(false); 4185 4194 … … 4189 4198 if(!m_temp) 4190 4199 { 4191 initDs(iWidth, iHeight, m_pcCfg->getIntraPeriod()>1 );4200 initDs(iWidth, iHeight, m_pcCfg->getIntraPeriod()>1, posScalingFactor); 4192 4201 } 4193 4202 … … 4313 4322 } 4314 4323 4315 Void TEncGOP::initDs(Int iWidth, Int iHeight, Int iType )4324 Void TEncGOP::initDs(Int iWidth, Int iHeight, Int iType, Int** posScalingFactor) 4316 4325 { 4317 4326 m_iTap = 13; 4318 if( g_posScalingFactor[0][0] == (1<<15))4327 if(posScalingFactor[0][0] == (1<<15)) 4319 4328 { 4320 4329 m_iM = 4; -
branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.h
r1415 r1419 287 287 #if CGS_3D_ASYMLUT 288 288 Void xDetermin3DAsymLUT( TComSlice * pSlice , TComPic * pCurPic , UInt refLayerIdc , TEncCfg * pCfg , Bool bSignalPPS ); 289 Void downScalePic( TComPicYuv* pcYuvSrc, TComPicYuv* pcYuvDest, BitDepths& bitDepth );289 Void downScalePic( TComPicYuv* pcYuvSrc, TComPicYuv* pcYuvDest, BitDepths& bitDepth, Int** posScalingFactor); 290 290 Void downScaleComponent2x2( const Pel* pSrc, Pel* pDest, const Int iSrcStride, const Int iDestStride, const Int iSrcWidth, const Int iSrcHeight, const Int inputBitDepth, const Int outputBitDepth ); 291 291 inline Short xClip( Short x , Int bitdepth ); 292 Void initDs(Int iWidth, Int iHeight, Int iType );292 Void initDs(Int iWidth, Int iHeight, Int iType, Int** posScalingFactor); 293 293 Void filterImg( Pel *src, Int iSrcStride, Pel *dst, Int iDstStride, Int height1, Int width1, BitDepths& bitDepth, Int plane ); 294 294
Note: See TracChangeset for help on using the changeset viewer.