Changeset 46 in SHVCSoftware for branches/SHM-1.1-dev/source/Lib
- Timestamp:
- 22 Feb 2013, 20:33:00 (12 years ago)
- Location:
- branches/SHM-1.1-dev/source/Lib/TLibCommon
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-1.1-dev/source/Lib/TLibCommon/TComDataCU.cpp
r41 r46 4882 4882 TComDataCU* TComDataCU::getBaseColCU( UInt uiCuAbsPartIdx, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase ) 4883 4883 { 4884 #if 1 // it should provide identical resutls 4885 UInt uiPelX = getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiCuAbsPartIdx] ]; 4886 UInt uiPelY = getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiCuAbsPartIdx] ]; 4887 4888 return getBaseColCU( uiPelX, uiPelY, uiCUAddrBase, uiAbsPartIdxBase ); 4889 #else 4884 4890 TComPic* cBaseColPic = m_pcSlice->getBaseColPic(); 4885 4891 … … 4926 4932 4927 4933 return cBaseColPic->getCU(uiCUAddrBase); 4934 #endif 4935 } 4936 4937 TComDataCU* TComDataCU::getBaseColCU( UInt uiPelX, UInt uiPelY, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase ) 4938 { 4939 TComPic* cBaseColPic = m_pcSlice->getBaseColPic(); 4940 4941 #if SVC_UPSAMPLING 4942 Int iBWidth = cBaseColPic->getPicYuvRec()->getWidth () - cBaseColPic->getPicYuvRec()->getPicCropLeftOffset() - cBaseColPic->getPicYuvRec()->getPicCropRightOffset(); 4943 Int iBHeight = cBaseColPic->getPicYuvRec()->getHeight() - cBaseColPic->getPicYuvRec()->getPicCropTopOffset() - cBaseColPic->getPicYuvRec()->getPicCropBottomOffset(); 4944 4945 Int iEWidth = m_pcPic->getPicYuvRec()->getWidth() - m_pcPic->getPicYuvRec()->getPicCropLeftOffset() - m_pcPic->getPicYuvRec()->getPicCropRightOffset(); 4946 Int iEHeight = m_pcPic->getPicYuvRec()->getHeight() - m_pcPic->getPicYuvRec()->getPicCropTopOffset() - m_pcPic->getPicYuvRec()->getPicCropBottomOffset(); 4947 #else 4948 Int iBWidth = cBaseColPic->getPicYuvRec()->getWidth(); 4949 Int iBHeight = cBaseColPic->getPicYuvRec()->getHeight(); 4950 4951 Int iEWidth = m_pcPic->getPicYuvRec()->getWidth(); 4952 Int iEHeight = m_pcPic->getPicYuvRec()->getHeight(); 4953 #endif 4954 4955 uiPelX = (UInt)Clip3<UInt>(0, m_pcPic->getPicYuvRec()->getWidth() - 1, uiPelX); 4956 uiPelY = (UInt)Clip3<UInt>(0, m_pcPic->getPicYuvRec()->getHeight() - 1, uiPelY); 4957 4958 UInt uiMinUnitSize = m_pcPic->getMinCUWidth(); 4959 4960 Int iBX = (uiPelX*iBWidth + iEWidth/2)/iEWidth; 4961 Int iBY = (uiPelY*iBHeight+ iEHeight/2)/iEHeight; 4962 4963 if ( iBX >= cBaseColPic->getPicYuvRec()->getWidth() || iBY >= cBaseColPic->getPicYuvRec()->getHeight()) 4964 { 4965 return NULL; 4966 } 4967 4968 #if AVC_SYNTAX 4969 if( iBX >= iBWidth || iBY >= iBHeight ) //outside of the reference layer cropped picture 4970 { 4971 return NULL; 4972 } 4973 #endif 4974 4975 uiCUAddrBase = (iBY/g_uiMaxCUHeight)*cBaseColPic->getFrameWidthInCU() + (iBX/g_uiMaxCUWidth); 4976 4977 assert(uiCUAddrBase < cBaseColPic->getNumCUsInFrame()); 4978 4979 UInt uiRasterAddrBase = (iBY - (iBY/g_uiMaxCUHeight)*g_uiMaxCUHeight)/uiMinUnitSize*cBaseColPic->getNumPartInWidth() 4980 + (iBX - (iBX/g_uiMaxCUWidth)*g_uiMaxCUWidth)/uiMinUnitSize; 4981 4982 uiAbsPartIdxBase = g_auiRasterToZscan[uiRasterAddrBase]; 4983 4984 return cBaseColPic->getCU(uiCUAddrBase); 4928 4985 } 4929 4986 4930 4987 Void TComDataCU::scaleBaseMV( TComMvField& rcMvFieldEnhance, TComMvField& rcMvFieldBase ) 4931 4988 { 4932 4933 4989 TComMvField cMvFieldBase; 4990 TComMv cMv; 4934 4991 4935 4992 #if MV_SCALING_FIX 4936 4937 4938 4939 4940 4993 Int iBWidth = m_pcSlice->getBaseColPic()->getPicYuvRec()->getWidth () - m_pcSlice->getBaseColPic()->getPicYuvRec()->getPicCropLeftOffset() - m_pcSlice->getBaseColPic()->getPicYuvRec()->getPicCropRightOffset(); 4994 Int iBHeight = m_pcSlice->getBaseColPic()->getPicYuvRec()->getHeight() - m_pcSlice->getBaseColPic()->getPicYuvRec()->getPicCropTopOffset() - m_pcSlice->getBaseColPic()->getPicYuvRec()->getPicCropBottomOffset(); 4995 4996 Int iEWidth = m_pcPic->getPicYuvRec()->getWidth() - m_pcPic->getPicYuvRec()->getPicCropLeftOffset() - m_pcPic->getPicYuvRec()->getPicCropRightOffset(); 4997 Int iEHeight = m_pcPic->getPicYuvRec()->getHeight() - m_pcPic->getPicYuvRec()->getPicCropTopOffset() - m_pcPic->getPicYuvRec()->getPicCropBottomOffset(); 4941 4998 #else 4942 4943 4944 4945 4946 4947 #endif 4948 4949 4950 4951 4952 4953 4954 4999 Int iBWidth = m_pcSlice->getBaseColPic()->getPicYuvRec()->getWidth(); 5000 Int iBHeight = m_pcSlice->getBaseColPic()->getPicYuvRec()->getHeight(); 5001 5002 Int iEWidth = m_pcPic->getPicYuvRec()->getWidth(); 5003 Int iEHeight = m_pcPic->getPicYuvRec()->getHeight(); 5004 #endif 5005 5006 Int iMvX = (rcMvFieldBase.getHor()*iEWidth + (iBWidth/2 -1) * (rcMvFieldBase.getHor() > 0 ? 1: -1) )/iBWidth; 5007 Int iMvY = (rcMvFieldBase.getVer()*iEHeight + (iBHeight/2 -1) * (rcMvFieldBase.getVer() > 0 ? 1: -1) )/iBHeight; 5008 5009 cMv.set(iMvX, iMvY); 5010 5011 rcMvFieldEnhance.setMvField( cMv, rcMvFieldBase.getRefIdx() ); 4955 5012 } 4956 5013 #endif -
branches/SHM-1.1-dev/source/Lib/TLibCommon/TComDataCU.h
r41 r46 593 593 #if SVC_COL_BLK 594 594 TComDataCU* getBaseColCU( UInt uiCuAbsPartIdx, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase ); 595 TComDataCU* getBaseColCU( UInt uiPelX, UInt uiPelY, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase ); 595 596 Void scaleBaseMV( TComMvField& rcMvFieldEnhance, TComMvField& rcMvFieldBase ); 596 597 #endif
Note: See TracChangeset for help on using the changeset viewer.