Changeset 1419 in SHVCSoftware for branches/SHM-dev/source/Lib/TLibCommon
- Timestamp:
- 5 Aug 2015, 03:02:48 (10 years ago)
- Location:
- branches/SHM-dev/source/Lib/TLibCommon
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev/source/Lib/TLibCommon/TComDataCU.cpp
r1418 r1419 3276 3276 3277 3277 #if SVC_EXTENSION 3278 TComDataCU* TComDataCU::getBaseColCU( UInt refLayerIdc, UInt uiCuAbsPartIdx, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase, Bool motionMapping )3278 TComDataCU* TComDataCU::getBaseColCU( UInt refLayerIdc, UInt uiCuAbsPartIdx, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase, Int** petPosScalingFactor, Bool motionMapping ) 3279 3279 { 3280 3280 UInt uiPelX = getCUPelX() + g_auiRasterToPelX[ g_auiZscanToRaster[uiCuAbsPartIdx] ]; 3281 3281 UInt uiPelY = getCUPelY() + g_auiRasterToPelY[ g_auiZscanToRaster[uiCuAbsPartIdx] ]; 3282 3282 3283 return getBaseColCU( refLayerIdc, uiPelX, uiPelY, uiCUAddrBase, uiAbsPartIdxBase, motionMapping );3284 } 3285 3286 TComDataCU* TComDataCU::getBaseColCU( UInt refLayerIdc, UInt pelX, UInt pelY, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase, Bool motionMapping )3283 return getBaseColCU( refLayerIdc, uiPelX, uiPelY, uiCUAddrBase, uiAbsPartIdxBase, petPosScalingFactor, motionMapping ); 3284 } 3285 3286 TComDataCU* TComDataCU::getBaseColCU( UInt refLayerIdc, UInt pelX, UInt pelY, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase, Int** posScalingFactor, Bool motionMapping ) 3287 3287 { 3288 3288 TComPic* baseColPic = m_pcSlice->getBaseColPic(refLayerIdc); … … 3302 3302 3303 3303 const Window &windowRL = m_pcSlice->getPPS()->getRefLayerWindowForLayer(baseColPic->getSlice(0)->getVPS()->getRefLayerId(getSlice()->getLayerId(), refLayerIdc)); 3304 Int iBX = (((iPelX - leftStartL) *g_posScalingFactor[refLayerIdc][0] + (1<<15)) >> 16) + windowRL.getWindowLeftOffset();3305 Int iBY = (((iPelY - topStartL ) *g_posScalingFactor[refLayerIdc][1] + (1<<15)) >> 16) + windowRL.getWindowTopOffset();3304 Int iBX = (((iPelX - leftStartL) * posScalingFactor[0][refLayerIdc] + (1<<15)) >> 16) + windowRL.getWindowLeftOffset(); 3305 Int iBY = (((iPelY - topStartL ) * posScalingFactor[1][refLayerIdc] + (1<<15)) >> 16) + windowRL.getWindowTopOffset(); 3306 3306 3307 3307 // offset for collocated block in the motion mapping … … 3346 3346 } 3347 3347 3348 Void TComDataCU::scaleBaseMV( UInt refLayerIdc, TComMvField& rcMvFieldEnhance, TComMvField& rcMvFieldBase )3348 Void TComDataCU::scaleBaseMV( UInt refLayerIdc, TComMvField& rcMvFieldEnhance, TComMvField& rcMvFieldBase, Int** mvScalingFactor ) 3349 3349 { 3350 3350 TComMvField cMvFieldBase; 3351 3351 TComMv cMv; 3352 3352 3353 cMv = rcMvFieldBase.getMv().scaleMv( g_mvScalingFactor[refLayerIdc][0], g_mvScalingFactor[refLayerIdc][1] );3353 cMv = rcMvFieldBase.getMv().scaleMv( mvScalingFactor[0][refLayerIdc], mvScalingFactor[1][refLayerIdc] ); 3354 3354 3355 3355 rcMvFieldEnhance.setMvField( cMv, rcMvFieldBase.getRefIdx() ); -
branches/SHM-dev/source/Lib/TLibCommon/TComDataCU.h
r1418 r1419 490 490 Bool xCheckZeroMVILRMvdL1Zero(Int iRefList, Int iRefIdx, Int MvpIdx); 491 491 #endif 492 TComDataCU* getBaseColCU( UInt refLayerIdc, UInt uiCuAbsPartIdx, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase, Bool motionMapping = false );493 TComDataCU* getBaseColCU( UInt refLayerIdc, UInt pelX, UInt pelY, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase, Bool motionMapping = false );494 Void scaleBaseMV( UInt refLayerIdc, TComMvField& rcMvFieldEnhance, TComMvField& rcMvFieldBase );492 TComDataCU* getBaseColCU( UInt refLayerIdc, UInt uiCuAbsPartIdx, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase, Int** posScalingFactor, Bool motionMapping = false ); 493 TComDataCU* getBaseColCU( UInt refLayerIdc, UInt pelX, UInt pelY, UInt &uiCUAddrBase, UInt &uiAbsPartIdxBase, Int** posScalingFactor, Bool motionMapping = false ); 494 Void scaleBaseMV( UInt refLayerIdc, TComMvField& rcMvFieldEnhance, TComMvField& rcMvFieldBase, Int** mvScalingFactor ); 495 495 #if FAST_INTRA_SHVC 496 496 UChar getReducedSetIntraModes(UChar idx) { assert( idx < NUM_INTRA_MODE-1 ); return m_reducedSetIntraModes[idx]; } -
branches/SHM-dev/source/Lib/TLibCommon/TComPic.cpp
r1290 r1419 64 64 memset( m_bSpatialEnhLayer, false, sizeof( m_bSpatialEnhLayer ) ); 65 65 memset( m_equalPictureSizeAndOffsetFlag, false, sizeof( m_equalPictureSizeAndOffsetFlag ) ); 66 memset( m_mvScalingFactor, NULL, sizeof( m_mvScalingFactor ) ); 67 memset( m_posScalingFactor, NULL, sizeof( m_posScalingFactor ) ); 66 68 #endif 67 69 for(UInt i=0; i<NUM_PIC_YUV; i++) … … 160 162 delete m_pcFullPelBaseRec[i]; 161 163 m_pcFullPelBaseRec[i] = NULL; 164 } 165 } 166 167 for( Int comp = 0; comp < 2; comp++ ) 168 { 169 if( m_mvScalingFactor[comp] ) 170 { 171 delete [] m_mvScalingFactor[comp]; 172 m_mvScalingFactor[comp] = NULL; 173 } 174 175 if( m_posScalingFactor[comp] ) 176 { 177 delete [] m_posScalingFactor[comp]; 178 m_posScalingFactor[comp] = NULL; 162 179 } 163 180 } … … 220 237 221 238 #if SVC_EXTENSION 239 Void TComPic::createMvScalingFactor(UInt numOfILRPs) 240 { 241 assert(m_mvScalingFactor[0] == NULL); 242 m_mvScalingFactor[0] = new Int[numOfILRPs]; 243 244 assert(m_mvScalingFactor[1] == NULL); 245 m_mvScalingFactor[1] = new Int[numOfILRPs]; 246 } 247 248 Void TComPic::createPosScalingFactor(UInt numOfILRPs) 249 { 250 assert(m_posScalingFactor[0] == NULL); 251 m_posScalingFactor[0] = new Int[numOfILRPs]; 252 253 assert(m_posScalingFactor[1] == NULL); 254 m_posScalingFactor[1] = new Int[numOfILRPs]; 255 } 256 222 257 Void copyOnetoOnePicture( // SVC_NONCOLL 223 258 Pel *in, … … 262 297 } 263 298 264 Void TComPic::copyUpsampledMvField(UInt refLayerIdc )299 Void TComPic::copyUpsampledMvField(UInt refLayerIdc, Int** mvScalingFactor, Int** posScalingFactor) 265 300 { 266 301 const TComSPS *sps = getSlice(0)->getSPS(); … … 283 318 284 319 TComDataCU *pcColCU = 0; 285 pcColCU = pcCUDes->getBaseColCU(refLayerIdc, pelX, pelY, baseCUAddr, baseAbsPartIdx, true);320 pcColCU = pcCUDes->getBaseColCU(refLayerIdc, pelX, pelY, baseCUAddr, baseAbsPartIdx, posScalingFactor, true); 286 321 287 322 if( pcColCU && pcColCU->getPredictionMode(baseAbsPartIdx) == MODE_INTER ) //base layer unit not skip and invalid mode … … 291 326 TComMvField sMvFieldBase, sMvField; 292 327 pcColCU->getMvField( pcColCU, baseAbsPartIdx, (RefPicList)refPicList, sMvFieldBase); 293 pcCUDes->scaleBaseMV( refLayerIdc, sMvField, sMvFieldBase );328 pcCUDes->scaleBaseMV( refLayerIdc, sMvField, sMvFieldBase, mvScalingFactor ); 294 329 295 330 pcCUDes->getCUMvField((RefPicList)refPicList)->setMvField(sMvField, absPartIdx); -
branches/SHM-dev/source/Lib/TLibCommon/TComPic.h
r1383 r1419 88 88 Bool m_bSpatialEnhLayer[MAX_LAYERS]; // whether current layer is a spatial enhancement layer, 89 89 TComPicYuv* m_pcFullPelBaseRec[MAX_LAYERS]; // upsampled base layer recontruction for difference domain inter prediction 90 Bool m_equalPictureSizeAndOffsetFlag[MAX_LAYERS]; 90 Bool m_equalPictureSizeAndOffsetFlag[MAX_LAYERS]; 91 Int* m_mvScalingFactor[2]; 92 Int* m_posScalingFactor[2]; 91 93 #if CGS_3D_ASYMLUT 92 94 Int m_nFrameBit; … … 199 201 Bool equalPictureSizeAndOffsetFlag(UInt refLayerIdc) { return m_equalPictureSizeAndOffsetFlag[refLayerIdc]; } 200 202 Void setEqualPictureSizeAndOffsetFlag(UInt refLayerIdc, Bool b) { m_equalPictureSizeAndOffsetFlag[refLayerIdc] = b; } 201 Void copyUpsampledMvField(UInt refLayerIdc );203 Void copyUpsampledMvField(UInt refLayerIdc, Int** mvScalingFactor, Int** posScalingFactor); 202 204 Void initUpsampledMvField(); 203 205 Bool checkSameRefInfo(); 204 Void copyUpsampledPictureYuv(TComPicYuv* pcPicYuvIn, TComPicYuv* pcPicYuvOut); 206 Void copyUpsampledPictureYuv(TComPicYuv* pcPicYuvIn, TComPicYuv* pcPicYuvOut); 207 Void setMvScalingFactor(UInt refLayerIdc, Int compX, Int compY) { m_mvScalingFactor[0][refLayerIdc] = compX; m_mvScalingFactor[1][refLayerIdc] = compY; } 208 Void setPosScalingFactor(UInt refLayerIdc, Int compX, Int compY) { m_posScalingFactor[0][refLayerIdc] = compX; m_posScalingFactor[1][refLayerIdc] = compY; } 209 Int getMvScalingFactor(UInt refLayerIdc, UChar comp) const { return m_mvScalingFactor[comp][refLayerIdc]; } 210 Int getPosScalingFactor(UInt refLayerIdc, UChar comp) const { return m_posScalingFactor[comp][refLayerIdc]; } 211 Int** getPosScalingFactor() { return m_posScalingFactor; } 212 Int** getMvScalingFactor() { return m_mvScalingFactor; } 213 Void createMvScalingFactor(UInt numOfILRPs); 214 Void createPosScalingFactor(UInt numOfILRPs); 205 215 #if CGS_3D_ASYMLUT 206 216 Void setFrameBit( Int n ) { m_nFrameBit = n; } -
branches/SHM-dev/source/Lib/TLibCommon/TComRom.cpp
r1418 r1419 725 725 const UInt g_scalingListSizeX [SCALING_LIST_SIZE_NUM] = { 4, 8, 16, 32}; 726 726 727 #if SVC_EXTENSION728 Int g_mvScalingFactor [MAX_LAYERS][2] = {{0,0}, {0,0}};729 Int g_posScalingFactor [MAX_LAYERS][2] = {{0,0}, {0,0}};730 727 #if LAYER_CTB 731 728 UInt g_auiLayerZscanToRaster[MAX_LAYERS][ MAX_NUM_SPU_W*MAX_NUM_SPU_W ]; … … 734 731 UInt g_auiLayerRasterToPelY[MAX_LAYERS][ MAX_NUM_SPU_W*MAX_NUM_SPU_W ]; 735 732 #endif 736 #endif //SVC_EXTENSION737 733 738 734 //! \} -
branches/SHM-dev/source/Lib/TLibCommon/TComRom.h
r1418 r1419 171 171 extern const UInt g_scalingListSizeX[SCALING_LIST_SIZE_NUM]; 172 172 173 #if SVC_EXTENSION174 extern Int g_mvScalingFactor [MAX_LAYERS][2];175 extern Int g_posScalingFactor [MAX_LAYERS][2];176 173 #if LAYER_CTB 177 174 extern UInt g_auiLayerZscanToRaster[MAX_LAYERS][ MAX_NUM_SPU_W*MAX_NUM_SPU_W ]; … … 180 177 extern UInt g_auiLayerRasterToPelY[MAX_LAYERS][ MAX_NUM_SPU_W*MAX_NUM_SPU_W ]; 181 178 #endif 182 #endif //SVC_EXTENSION183 179 184 180 //! \} -
branches/SHM-dev/source/Lib/TLibCommon/TComSlice.cpp
r1414 r1419 510 510 // motion resampling constraint 511 511 // Allow maximum of one motion resampling process for direct reference layers, and use motion inter-layer prediction from the same layer as texture inter-layer prediction 512 if( !( g_posScalingFactor[refLayerIdc][0] == 65536 && g_posScalingFactor[refLayerIdc][1]== 65536 ) || !scalingOffset || !sameBitDepths512 if( !( m_pcPic->getPosScalingFactor(refLayerIdc, 0) == 65536 && m_pcPic->getPosScalingFactor(refLayerIdc, 1) == 65536 ) || !scalingOffset || !sameBitDepths 513 513 #if CGS_3D_ASYMLUT 514 514 || getPPS()->getCGSFlag() … … 3637 3637 } 3638 3638 3639 pcIlpPic[refLayerIdc]->copyUpsampledMvField( refLayerIdc);3639 pcIlpPic[refLayerIdc]->copyUpsampledMvField( refLayerIdc, m_pcPic->getMvScalingFactor(), m_pcPic->getPosScalingFactor() ); 3640 3640 } 3641 3641 else -
branches/SHM-dev/source/Lib/TLibCommon/TComUpsampleFilter.cpp
r1335 r1419 109 109 Pel* piDstV; 110 110 111 Int scaleX = g_posScalingFactor[refLayerIdc][0];112 Int scaleY = g_posScalingFactor[refLayerIdc][1];111 Int scaleX = currSlice->getPic()->getPosScalingFactor(refLayerIdc, 0); 112 Int scaleY = currSlice->getPic()->getPosScalingFactor(refLayerIdc, 1); 113 113 114 114 // non-normative software optimization for certain simple resampling cases
Note: See TracChangeset for help on using the changeset viewer.