Changeset 55 in SHVCSoftware for trunk/source/Lib/TLibCommon/TComDataCU.cpp
- Timestamp:
- 4 Mar 2013, 22:43:28 (12 years ago)
- Location:
- trunk/source
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source
- Property svn:mergeinfo changed
/branches/SHM-1.1-dev/source (added) merged: 38-49,52-53
- Property svn:mergeinfo changed
-
trunk/source/Lib/TLibCommon/TComDataCU.cpp
r33 r55 383 383 m_layerId = pcPic->getLayerId(); 384 384 #endif 385 386 385 for(int i=0; i<pcPic->getNumPartInCU(); i++) 387 386 { … … 2906 2905 if(m_layerId) 2907 2906 { 2907 #if MV_SCALING_POS_FIX 2908 pcColCU = getBaseColCU( xP + nPSW/2, yP + nPSH/2, uiCUAddrBase, uiAbsPartAddrBase ); 2909 #else 2908 2910 UInt uiPartIdxCenter; 2909 2911 xDeriveCenterIdx( cCurPS, uiPUIdx, uiPartIdxCenter ); 2910 2912 uiPartIdxCenter -= m_uiAbsIdxInLCU; 2911 2913 pcColCU = getBaseColCU( uiPartIdxCenter, uiCUAddrBase, uiAbsPartAddrBase ); 2914 #endif 2912 2915 2913 2916 #if INTRA_BL … … 4843 4846 } 4844 4847 4845 #if INTRA_BL 4848 #if INTRA_BL && !NO_RESIDUAL_FLAG_FOR_BLPRED 4846 4849 Void TComDataCU::getBaseLumaBlk ( UInt uiWidth, UInt uiHeight, UInt uiAbsPartIdx, Pel* piPred, UInt uiStride ) 4847 4850 { … … 4883 4886 TComDataCU* TComDataCU::getBaseColCU( UInt uiCuAbsPartIdx, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase ) 4884 4887 { 4888 #if 1 // it should provide identical resutls 4889 UInt uiPelX = getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiCuAbsPartIdx] ]; 4890 UInt uiPelY = getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiCuAbsPartIdx] ]; 4891 4892 return getBaseColCU( uiPelX, uiPelY, uiCUAddrBase, uiAbsPartIdxBase ); 4893 #else 4885 4894 TComPic* cBaseColPic = m_pcSlice->getBaseColPic(); 4886 4895 … … 4927 4936 4928 4937 return cBaseColPic->getCU(uiCUAddrBase); 4938 #endif 4939 } 4940 4941 TComDataCU* TComDataCU::getBaseColCU( UInt uiPelX, UInt uiPelY, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase ) 4942 { 4943 TComPic* cBaseColPic = m_pcSlice->getBaseColPic(); 4944 4945 #if SVC_UPSAMPLING 4946 Int iBWidth = cBaseColPic->getPicYuvRec()->getWidth () - cBaseColPic->getPicYuvRec()->getPicCropLeftOffset() - cBaseColPic->getPicYuvRec()->getPicCropRightOffset(); 4947 Int iBHeight = cBaseColPic->getPicYuvRec()->getHeight() - cBaseColPic->getPicYuvRec()->getPicCropTopOffset() - cBaseColPic->getPicYuvRec()->getPicCropBottomOffset(); 4948 4949 Int iEWidth = m_pcPic->getPicYuvRec()->getWidth() - m_pcPic->getPicYuvRec()->getPicCropLeftOffset() - m_pcPic->getPicYuvRec()->getPicCropRightOffset(); 4950 Int iEHeight = m_pcPic->getPicYuvRec()->getHeight() - m_pcPic->getPicYuvRec()->getPicCropTopOffset() - m_pcPic->getPicYuvRec()->getPicCropBottomOffset(); 4951 #else 4952 Int iBWidth = cBaseColPic->getPicYuvRec()->getWidth(); 4953 Int iBHeight = cBaseColPic->getPicYuvRec()->getHeight(); 4954 4955 Int iEWidth = m_pcPic->getPicYuvRec()->getWidth(); 4956 Int iEHeight = m_pcPic->getPicYuvRec()->getHeight(); 4957 #endif 4958 4959 uiPelX = (UInt)Clip3<UInt>(0, m_pcPic->getPicYuvRec()->getWidth() - 1, uiPelX); 4960 uiPelY = (UInt)Clip3<UInt>(0, m_pcPic->getPicYuvRec()->getHeight() - 1, uiPelY); 4961 4962 UInt uiMinUnitSize = m_pcPic->getMinCUWidth(); 4963 4964 Int iBX = (uiPelX*iBWidth + iEWidth/2)/iEWidth; 4965 Int iBY = (uiPelY*iBHeight+ iEHeight/2)/iEHeight; 4966 4967 if ( iBX >= cBaseColPic->getPicYuvRec()->getWidth() || iBY >= cBaseColPic->getPicYuvRec()->getHeight()) 4968 { 4969 return NULL; 4970 } 4971 4972 #if AVC_SYNTAX 4973 if( iBX >= iBWidth || iBY >= iBHeight ) //outside of the reference layer cropped picture 4974 { 4975 return NULL; 4976 } 4977 #endif 4978 4979 uiCUAddrBase = (iBY/g_uiMaxCUHeight)*cBaseColPic->getFrameWidthInCU() + (iBX/g_uiMaxCUWidth); 4980 4981 assert(uiCUAddrBase < cBaseColPic->getNumCUsInFrame()); 4982 4983 UInt uiRasterAddrBase = (iBY - (iBY/g_uiMaxCUHeight)*g_uiMaxCUHeight)/uiMinUnitSize*cBaseColPic->getNumPartInWidth() 4984 + (iBX - (iBX/g_uiMaxCUWidth)*g_uiMaxCUWidth)/uiMinUnitSize; 4985 4986 uiAbsPartIdxBase = g_auiRasterToZscan[uiRasterAddrBase]; 4987 4988 return cBaseColPic->getCU(uiCUAddrBase); 4929 4989 } 4930 4990 4931 4991 Void TComDataCU::scaleBaseMV( TComMvField& rcMvFieldEnhance, TComMvField& rcMvFieldBase ) 4932 4992 { 4933 TComMvField cMvFieldBase; 4934 TComMv cMv; 4935 4936 Int iBWidth = m_pcSlice->getBaseColPic()->getPicYuvRec()->getWidth(); 4937 Int iBHeight = m_pcSlice->getBaseColPic()->getPicYuvRec()->getHeight(); 4938 4939 Int iEWidth = m_pcPic->getPicYuvRec()->getWidth(); 4940 Int iEHeight = m_pcPic->getPicYuvRec()->getHeight(); 4941 4942 Int iMvX = (rcMvFieldBase.getHor()*iEWidth + (iBWidth/2 -1) * (rcMvFieldBase.getHor() > 0 ? 1: -1) )/iBWidth; 4943 Int iMvY = (rcMvFieldBase.getVer()*iEHeight + (iBHeight/2 -1) * (rcMvFieldBase.getVer() > 0 ? 1: -1) )/iBHeight; 4944 4945 cMv.set(iMvX, iMvY); 4946 4947 rcMvFieldEnhance.setMvField( cMv, rcMvFieldBase.getRefIdx() ); 4993 TComMvField cMvFieldBase; 4994 TComMv cMv; 4995 4996 #if MV_SCALING_FIX 4997 Int iBWidth = m_pcSlice->getBaseColPic()->getPicYuvRec()->getWidth () - m_pcSlice->getBaseColPic()->getPicYuvRec()->getPicCropLeftOffset() - m_pcSlice->getBaseColPic()->getPicYuvRec()->getPicCropRightOffset(); 4998 Int iBHeight = m_pcSlice->getBaseColPic()->getPicYuvRec()->getHeight() - m_pcSlice->getBaseColPic()->getPicYuvRec()->getPicCropTopOffset() - m_pcSlice->getBaseColPic()->getPicYuvRec()->getPicCropBottomOffset(); 4999 5000 Int iEWidth = m_pcPic->getPicYuvRec()->getWidth() - m_pcPic->getPicYuvRec()->getPicCropLeftOffset() - m_pcPic->getPicYuvRec()->getPicCropRightOffset(); 5001 Int iEHeight = m_pcPic->getPicYuvRec()->getHeight() - m_pcPic->getPicYuvRec()->getPicCropTopOffset() - m_pcPic->getPicYuvRec()->getPicCropBottomOffset(); 5002 #else 5003 Int iBWidth = m_pcSlice->getBaseColPic()->getPicYuvRec()->getWidth(); 5004 Int iBHeight = m_pcSlice->getBaseColPic()->getPicYuvRec()->getHeight(); 5005 5006 Int iEWidth = m_pcPic->getPicYuvRec()->getWidth(); 5007 Int iEHeight = m_pcPic->getPicYuvRec()->getHeight(); 5008 #endif 5009 5010 Int iMvX = (rcMvFieldBase.getHor()*iEWidth + (iBWidth/2 -1) * (rcMvFieldBase.getHor() > 0 ? 1: -1) )/iBWidth; 5011 Int iMvY = (rcMvFieldBase.getVer()*iEHeight + (iBHeight/2 -1) * (rcMvFieldBase.getVer() > 0 ? 1: -1) )/iBHeight; 5012 5013 cMv.set(iMvX, iMvY); 5014 5015 rcMvFieldEnhance.setMvField( cMv, rcMvFieldBase.getRefIdx() ); 4948 5016 } 4949 5017 #endif
Note: See TracChangeset for help on using the changeset viewer.