Changeset 137 in SHVCSoftware for branches/SHM-2.0-dev/source
- Timestamp:
- 2 May 2013, 08:47:06 (12 years ago)
- Location:
- branches/SHM-2.0-dev/source/Lib
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-2.0-dev/source/Lib/TLibCommon/TComDataCU.cpp
r136 r137 4175 4175 TComPic* cBaseColPic = m_pcSlice->getBaseColPic(); 4176 4176 4177 #if !SIMPLIFIED_MV_POS_SCALING 4177 4178 #if SVC_UPSAMPLING 4178 4179 const Window &confBL = cBaseColPic->getPicYuvRec()->getConformanceWindow(); … … 4191 4192 Int heightEL = m_pcPic->getPicYuvRec()->getHeight(); 4192 4193 #endif 4194 #endif 4193 4195 4194 4196 uiPelX = (UInt)Clip3<UInt>(0, m_pcPic->getPicYuvRec()->getWidth() - 1, uiPelX); … … 4197 4199 UInt uiMinUnitSize = m_pcPic->getMinCUWidth(); 4198 4200 4201 #if SIMPLIFIED_MV_POS_SCALING 4202 Int iBX = (uiPelX*g_posScalingFactor[m_layerId][0] + (1<<15)) >> 16; 4203 Int iBY = (uiPelY*g_posScalingFactor[m_layerId][1] + (1<<15)) >> 16; 4204 #else 4199 4205 Int iBX = (uiPelX*widthBL + widthEL/2)/widthEL; 4200 4206 Int iBY = (uiPelY*heightBL+ heightEL/2)/heightEL; 4207 #endif 4201 4208 4202 4209 if ( iBX >= cBaseColPic->getPicYuvRec()->getWidth() || iBY >= cBaseColPic->getPicYuvRec()->getHeight()) … … 4228 4235 TComMvField cMvFieldBase; 4229 4236 TComMv cMv; 4230 4237 #if SIMPLIFIED_MV_POS_SCALING 4238 cMv = rcMvFieldBase.getMv().scaleMv( g_mvScalingFactor[m_layerId][0], g_mvScalingFactor[m_layerId][1] ); 4239 #else 4231 4240 #if MV_SCALING_FIX 4232 4241 const Window &confBL = m_pcSlice->getBaseColPic()->getPicYuvRec()->getConformanceWindow(); … … 4250 4259 4251 4260 cMv.set(iMvX, iMvY); 4261 #endif 4252 4262 4253 4263 rcMvFieldEnhance.setMvField( cMv, rcMvFieldBase.getRefIdx() ); -
branches/SHM-2.0-dev/source/Lib/TLibCommon/TComMv.h
r125 r137 149 149 return TComMv( mvx, mvy ); 150 150 } 151 #if SIMPLIFIED_MV_POS_SCALING 152 const TComMv scaleMv( Int iScaleX, Int iScaleY ) const 153 { 154 Int mvx = Clip3( -32768, 32767, (iScaleX * getHor() + 127 + (iScaleX * getHor() < 0)) >> 8 ); 155 Int mvy = Clip3( -32768, 32767, (iScaleY * getVer() + 127 + (iScaleY * getVer() < 0)) >> 8 ); 156 return TComMv( mvx, mvy ); 157 } 158 #endif 151 159 };// END CLASS DEFINITION TComMV 152 160 -
branches/SHM-2.0-dev/source/Lib/TLibCommon/TComRom.cpp
r133 r137 518 518 Int g_eTTable[4] = {0,3,1,2}; 519 519 520 #if SIMPLIFIED_MV_POS_SCALING 521 Int g_mvScalingFactor [MAX_LAYERS][2] = {{0,0}, {0,0}}; 522 Int g_posScalingFactor [MAX_LAYERS][2] = {{0,0}, {0,0}}; 523 #endif 524 520 525 //! \} -
branches/SHM-2.0-dev/source/Lib/TLibCommon/TComRom.h
r125 r137 273 273 extern UInt g_scalingListNum [SCALING_LIST_SIZE_NUM]; 274 274 extern Int g_eTTable[4]; 275 276 #if SIMPLIFIED_MV_POS_SCALING 277 extern Int g_mvScalingFactor [MAX_LAYERS][2]; 278 extern Int g_posScalingFactor [MAX_LAYERS][2]; 279 #endif 280 275 281 //! \} 276 282 -
branches/SHM-2.0-dev/source/Lib/TLibCommon/TypeDef.h
r136 r137 64 64 #define MV_SCALING_FIX 1 ///< fixing the base layer MV scaling 65 65 #define MV_SCALING_POS_FIX 1 ///< use center pixels to get co-located base layer block 66 #define SIMPLIFIED_MV_POS_SCALING 1 ///< M0133/M0449: inter-layer MV scaling and pixel mapping position calculation 66 67 #define MFM_CLIPPING_FIX 1 ///< set the right picture size for the clipping 67 68 -
branches/SHM-2.0-dev/source/Lib/TLibDecoder/TDecTop.cpp
r134 r137 922 922 } 923 923 924 #if SIMPLIFIED_MV_POS_SCALING 925 if (m_layerId > 0) 926 { 927 const Window &confBL = pcSlice->getBaseColPic()->getPicYuvRec()->getConformanceWindow(); 928 const Window &confEL = pcPic->getPicYuvRec()->getConformanceWindow(); 929 930 Int widthBL = pcSlice->getBaseColPic()->getPicYuvRec()->getWidth () - confBL.getWindowLeftOffset() - confBL.getWindowRightOffset(); 931 Int heightBL = pcSlice->getBaseColPic()->getPicYuvRec()->getHeight() - confBL.getWindowTopOffset() - confBL.getWindowBottomOffset(); 932 933 Int widthEL = pcPic->getPicYuvRec()->getWidth() - confEL.getWindowLeftOffset() - confEL.getWindowRightOffset(); 934 Int heightEL = pcPic->getPicYuvRec()->getHeight() - confEL.getWindowTopOffset() - confEL.getWindowBottomOffset(); 935 936 g_mvScalingFactor[m_layerId][0] = Clip3(-4096, 4095, ((widthEL << 8) + (widthBL >> 1)) / widthBL); 937 g_mvScalingFactor[m_layerId][1] = Clip3(-4096, 4095, ((heightEL << 8) + (heightBL >> 1)) / heightBL); 938 939 g_posScalingFactor[m_layerId][0] = ((widthBL << 16) + (widthEL >> 1)) / widthEL; 940 g_posScalingFactor[m_layerId][1] = ((heightBL << 16) + (heightEL >> 1)) / heightEL; 941 } 942 #endif 943 924 944 // Decode a picture 925 945 m_cGopDecoder.decompressSlice(nalu.m_Bitstream, pcPic); -
branches/SHM-2.0-dev/source/Lib/TLibEncoder/TEncGOP.cpp
r134 r137 970 970 971 971 UInt uiNumSlices = 1; 972 973 #if SIMPLIFIED_MV_POS_SCALING 974 if (m_layerId > 0) 975 { 976 const Window &confBL = pcSlice->getBaseColPic()->getPicYuvRec()->getConformanceWindow(); 977 const Window &confEL = pcPic->getPicYuvRec()->getConformanceWindow(); 978 979 Int widthBL = pcSlice->getBaseColPic()->getPicYuvRec()->getWidth () - confBL.getWindowLeftOffset() - confBL.getWindowRightOffset(); 980 Int heightBL = pcSlice->getBaseColPic()->getPicYuvRec()->getHeight() - confBL.getWindowTopOffset() - confBL.getWindowBottomOffset(); 981 982 Int widthEL = pcPic->getPicYuvRec()->getWidth() - confEL.getWindowLeftOffset() - confEL.getWindowRightOffset(); 983 Int heightEL = pcPic->getPicYuvRec()->getHeight() - confEL.getWindowTopOffset() - confEL.getWindowBottomOffset(); 984 985 g_mvScalingFactor[m_layerId][0] = Clip3(-4096, 4095, ((widthEL << 8) + (widthBL >> 1)) / widthBL); 986 g_mvScalingFactor[m_layerId][1] = Clip3(-4096, 4095, ((heightEL << 8) + (heightBL >> 1)) / heightBL); 987 988 g_posScalingFactor[m_layerId][0] = ((widthBL << 16) + (widthEL >> 1)) / widthEL; 989 g_posScalingFactor[m_layerId][1] = ((heightBL << 16) + (heightEL >> 1)) / heightEL; 990 } 991 #endif 972 992 973 993 UInt uiInternalAddress = pcPic->getNumPartInCU()-4;
Note: See TracChangeset for help on using the changeset viewer.