Changeset 849 in SHVCSoftware for branches/SHM-dev/source/Lib/TLibCommon
- Timestamp:
- 29 Jul 2014, 14:03:05 (11 years ago)
- Location:
- branches/SHM-dev/source/Lib/TLibCommon
- Files:
-
- 8 edited
-
TComDataCU.cpp (modified) (3 diffs)
-
TComPrediction.cpp (modified) (1 diff)
-
TComPrediction.h (modified) (1 diff)
-
TComSlice.cpp (modified) (8 diffs)
-
TComSlice.h (modified) (8 diffs)
-
TComUpsampleFilter.cpp (modified) (19 diffs)
-
TComUpsampleFilter.h (modified) (1 diff)
-
TypeDef.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev/source/Lib/TLibCommon/TComDataCU.cpp
r828 r849 3509 3509 #endif 3510 3510 3511 #if MOVE_SCALED_OFFSET_TO_PPS 3512 #if O0098_SCALED_REF_LAYER_ID 3513 Int leftStartL = baseColPic->getSlice(0)->getPPS()->getScaledRefLayerWindowForLayer(baseColPic->getSlice(0)->getVPS()->getRefLayerId(getSlice()->getLayerId(), refLayerIdc)).getWindowLeftOffset(); 3514 Int topStartL = baseColPic->getSlice(0)->getPPS()->getScaledRefLayerWindowForLayer(baseColPic->getSlice(0)->getVPS()->getRefLayerId(getSlice()->getLayerId(), refLayerIdc)).getWindowTopOffset(); 3515 #else 3516 Int leftStartL = baseColPic->getSlice(0)->getPPS()->getScaledRefLayerWindow(refLayerIdc).getWindowLeftOffset(); 3517 Int topStartL = baseColPic->getSlice(0)->getPPS()->getScaledRefLayerWindow(refLayerIdc).getWindowTopOffset(); 3518 #endif 3519 #else 3511 3520 #if O0098_SCALED_REF_LAYER_ID 3512 3521 Int leftStartL = baseColPic->getSlice(0)->getSPS()->getScaledRefLayerWindowForLayer(baseColPic->getSlice(0)->getVPS()->getRefLayerId(getSlice()->getLayerId(), refLayerIdc)).getWindowLeftOffset(); … … 3516 3525 Int topStartL = baseColPic->getSlice(0)->getSPS()->getScaledRefLayerWindow(refLayerIdc).getWindowTopOffset(); 3517 3526 #endif 3518 3527 #endif 3528 3529 #if REF_REGION_OFFSET 3530 const Window &windowRL = baseColPic->getSlice(0)->getPPS()->getRefLayerWindow(refLayerIdc); 3531 Int iBX = (((uiPelX - leftStartL)*g_posScalingFactor[refLayerIdc][0] + (1<<15)) >> 16) + windowRL.getWindowLeftOffset(); 3532 Int iBY = (((uiPelY - topStartL )*g_posScalingFactor[refLayerIdc][1] + (1<<15)) >> 16) + windowRL.getWindowTopOffset(); 3533 #else 3519 3534 #if Q0200_CONFORMANCE_BL_SIZE 3520 3535 Int chromaFormatIdc = baseColPic->getSlice(0)->getChromaFormatIdc(); … … 3525 3540 Int iBY = ((uiPelY - topStartL )*g_posScalingFactor[refLayerIdc][1] + (1<<15)) >> 16; 3526 3541 #endif 3542 #endif 3527 3543 3528 3544 #if REF_IDX_MFM -
branches/SHM-dev/source/Lib/TLibCommon/TComPrediction.cpp
r815 r849 796 796 #else 797 797 #if O0194_JOINT_US_BITSHIFT 798 #if REF_REGION_OFFSET 799 Void TComPrediction::upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, const Window altRefWindow ) 800 { 801 m_cUsf.upsampleBasePic( refLayerIdc, pcUsPic, pcBasePic, pcTempPic, window, altRefWindow ); 802 } 803 #else 798 804 Void TComPrediction::upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window) 799 805 { 800 806 m_cUsf.upsampleBasePic( refLayerIdc, pcUsPic, pcBasePic, pcTempPic, window); 801 807 } 808 #endif 802 809 #else 803 810 Void TComPrediction::upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window) -
branches/SHM-dev/source/Lib/TLibCommon/TComPrediction.h
r815 r849 126 126 #else 127 127 #if O0194_JOINT_US_BITSHIFT 128 #if REF_REGION_OFFSET 129 Void upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, const Window altRefWindow ); 130 #else 128 131 Void upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window ); 132 #endif 129 133 #else 130 134 Void upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window ); -
branches/SHM-dev/source/Lib/TLibCommon/TComSlice.cpp
r848 r849 571 571 UInt refLayerId = m_pcVPS->getRefLayerId( m_layerId, refLayerIdc ); 572 572 #if RESAMPLING_CONSTRAINT_BUG_FIX 573 #if MOVE_SCALED_OFFSET_TO_PPS 574 #if O0098_SCALED_REF_LAYER_ID 575 const Window &scalEL = getPPS()->getScaledRefLayerWindowForLayer(refLayerId); 576 #else 577 const Window &scalEL = getPPS()->getScaledRefLayerWindow(m_interLayerPredLayerIdc[i]); 578 #endif 579 #else 573 580 #if O0098_SCALED_REF_LAYER_ID 574 581 const Window &scalEL = getSPS()->getScaledRefLayerWindowForLayer(refLayerId); 575 582 #else 576 583 const Window &scalEL = getSPS()->getScaledRefLayerWindow(m_interLayerPredLayerIdc[i]); 584 #endif 577 585 #endif 578 586 Int scalingOffset = ((scalEL.getWindowLeftOffset() == 0 ) && … … 3061 3069 , m_layerId ( 0 ) 3062 3070 , m_extensionFlag ( false ) 3071 #if !MOVE_SCALED_OFFSET_TO_PPS 3063 3072 , m_numScaledRefLayerOffsets ( 0 ) 3073 #endif 3064 3074 #if REPN_FORMAT_IN_VPS 3065 3075 , m_updateRepFormatFlag (false) … … 3084 3094 ::memset(m_usedByCurrPicLtSPSFlag, 0, sizeof(m_usedByCurrPicLtSPSFlag)); 3085 3095 3096 #if !MOVE_SCALED_OFFSET_TO_PPS 3086 3097 #if P0312_VERT_PHASE_ADJ 3087 3098 ::memset(m_vertPhasePositionEnableFlag, 0, sizeof(m_vertPhasePositionEnableFlag)); 3099 #endif 3088 3100 #endif 3089 3101 } … … 3217 3229 const Int TComSPS::m_winUnitY[]={1,2,1,1}; 3218 3230 3231 #if !MOVE_SCALED_OFFSET_TO_PPS 3219 3232 #if O0098_SCALED_REF_LAYER_ID 3220 3233 Window& TComSPS::getScaledRefLayerWindowForLayer(Int layerId) … … 3233 3246 return win; 3234 3247 } 3248 #endif 3249 #if REF_REGION_OFFSET 3250 Window& TComSPS::getRefLayerWindowForLayer(Int layerId) 3251 { 3252 static Window win; 3253 3254 for (Int i = 0; i < m_numRefLayerOffsets; i++) 3255 { 3256 if (layerId == m_refLayerId[i]) 3257 { 3258 return m_refLayerWindow[i]; 3259 } 3260 } 3261 3262 win.resetWindow(); // reference region offsets are inferred to be zero when not present 3263 return win; 3264 } 3265 #endif 3235 3266 #endif 3236 3267 … … 3276 3307 , m_pocResetInfoPresentFlag (false) 3277 3308 #endif 3309 #if MOVE_SCALED_OFFSET_TO_PPS 3310 , m_numScaledRefLayerOffsets ( 0 ) 3311 #endif 3278 3312 #if Q0048_CGS_3D_ASYMLUT 3279 3313 , m_nCGSFlag(0) … … 3284 3318 { 3285 3319 m_scalingList = new TComScalingList; 3320 #if REF_REGION_OFFSET 3321 ::memset(m_scaledRefLayerOffsetPresentFlag, 0, sizeof(m_scaledRefLayerOffsetPresentFlag)); 3322 ::memset(m_refRegionOffsetPresentFlag, 0, sizeof(m_refRegionOffsetPresentFlag)); 3323 #endif 3324 #if R0209_GENERIC_PHASE 3325 ::memset(m_resamplePhaseSetPresentFlag, 0, sizeof(m_resamplePhaseSetPresentFlag)); 3326 ::memset(m_phaseHorLuma, 0, sizeof(m_phaseHorLuma)); 3327 ::memset(m_phaseVerLuma, 0, sizeof(m_phaseVerLuma)); 3328 ::memset(m_phaseHorChroma, 0, sizeof(m_phaseHorChroma)); 3329 ::memset(m_phaseVerChroma, 0, sizeof(m_phaseVerChroma)); 3330 #endif 3286 3331 } 3287 3332 … … 3293 3338 delete m_scalingList; 3294 3339 } 3340 3341 #if MOVE_SCALED_OFFSET_TO_PPS 3342 #if O0098_SCALED_REF_LAYER_ID 3343 Window& TComPPS::getScaledRefLayerWindowForLayer(Int layerId) 3344 { 3345 static Window win; 3346 3347 for (Int i = 0; i < m_numScaledRefLayerOffsets; i++) 3348 { 3349 if (layerId == m_scaledRefLayerId[i]) 3350 { 3351 return m_scaledRefLayerWindow[i]; 3352 } 3353 } 3354 3355 win.resetWindow(); // scaled reference layer offsets are inferred to be zero when not present 3356 return win; 3357 } 3358 #endif 3359 #if REF_REGION_OFFSET 3360 Window& TComPPS::getRefLayerWindowForLayer(Int layerId) 3361 { 3362 static Window win; 3363 3364 for (Int i = 0; i < m_numScaledRefLayerOffsets; i++) 3365 { 3366 if (layerId == m_scaledRefLayerId[i]) 3367 { 3368 return m_refLayerWindow[i]; 3369 } 3370 } 3371 3372 win.resetWindow(); // reference region offsets are inferred to be zero when not present 3373 return win; 3374 } 3375 #endif 3376 #endif 3295 3377 3296 3378 TComReferencePictureSet::TComReferencePictureSet() -
branches/SHM-dev/source/Lib/TLibCommon/TComSlice.h
r848 r849 1243 1243 1244 1244 Bool getWindowEnabledFlag() const { return m_enabledFlag; } 1245 #if P0312_VERT_PHASE_ADJ 1245 #if P0312_VERT_PHASE_ADJ 1246 1246 Void resetWindow() { m_enabledFlag = false; m_winLeftOffset = m_winRightOffset = m_winTopOffset = m_winBottomOffset = 0; m_vertPhasePositionEnableFlag = false; } 1247 1247 #else … … 1256 1256 Int getWindowBottomOffset() const { return m_enabledFlag ? m_winBottomOffset: 0; } 1257 1257 Void setWindowBottomOffset(Int val) { m_winBottomOffset = val; m_enabledFlag = true; } 1258 1259 1258 #if P0312_VERT_PHASE_ADJ 1260 1259 Bool getVertPhasePositionEnableFlag() const { return m_vertPhasePositionEnableFlag; } 1261 1260 Void setVertPhasePositionEnableFlag(Bool val) { m_vertPhasePositionEnableFlag = val; } 1261 #endif 1262 1263 #if P0312_VERT_PHASE_ADJ 1262 1264 Void setWindow(Int offsetLeft, Int offsetLRight, Int offsetLTop, Int offsetLBottom, Bool vertPhasePositionEnableFlag = 0) 1263 1265 #else … … 1532 1534 Bool m_vertPhasePositionEnableFlag[MAX_LAYERS]; 1533 1535 #endif 1536 #if !MOVE_SCALED_OFFSET_TO_PPS 1534 1537 #if O0098_SCALED_REF_LAYER_ID 1535 1538 UInt m_scaledRefLayerId[MAX_LAYERS]; 1536 1539 #endif 1537 1540 Window m_scaledRefLayerWindow[MAX_LAYERS]; 1541 #endif 1538 1542 #if REPN_FORMAT_IN_VPS 1539 Bool m_updateRepFormatFlag;1543 Bool m_updateRepFormatFlag; 1540 1544 #if O0096_REP_FORMAT_INDEX 1541 1545 UInt m_updateRepFormatIndex; … … 1547 1551 #endif 1548 1552 #endif //SVC_EXTENSION 1553 1549 1554 public: 1550 1555 TComSPS(); … … 1693 1698 Int getExtensionFlag() { return m_extensionFlag; } 1694 1699 Void setExtensionFlag(Int n) { m_extensionFlag = n; } 1700 #if !MOVE_SCALED_OFFSET_TO_PPS 1695 1701 UInt getNumScaledRefLayerOffsets() { return m_numScaledRefLayerOffsets; } 1696 1702 Void setNumScaledRefLayerOffsets(Int x) { m_numScaledRefLayerOffsets = x; } … … 1705 1711 #endif 1706 1712 Window& getScaledRefLayerWindow( Int x ) { return m_scaledRefLayerWindow[x]; } 1713 #endif 1707 1714 #if REPN_FORMAT_IN_VPS 1708 1715 Bool getUpdateRepFormatFlag() { return m_updateRepFormatFlag; } … … 1816 1823 #if POC_RESET_IDC 1817 1824 Bool m_pocResetInfoPresentFlag; 1825 #endif 1826 #if MOVE_SCALED_OFFSET_TO_PPS 1827 UInt m_numScaledRefLayerOffsets; 1828 #if O0098_SCALED_REF_LAYER_ID 1829 UInt m_scaledRefLayerId[MAX_LAYERS]; 1830 #endif 1831 Window m_scaledRefLayerWindow[MAX_LAYERS]; 1832 #if REF_REGION_OFFSET 1833 Window m_refLayerWindow[MAX_LAYERS]; 1834 Bool m_scaledRefLayerOffsetPresentFlag[MAX_LAYERS]; 1835 Bool m_refRegionOffsetPresentFlag[MAX_LAYERS]; 1836 #endif 1837 #if R0209_GENERIC_PHASE 1838 Int m_phaseHorLuma[MAX_LAYERS]; 1839 Int m_phaseVerLuma[MAX_LAYERS]; 1840 Int m_phaseHorChroma[MAX_LAYERS]; 1841 Int m_phaseVerChroma[MAX_LAYERS]; 1842 Bool m_resamplePhaseSetPresentFlag[MAX_LAYERS]; 1843 #endif 1818 1844 #endif 1819 1845 #if Q0048_CGS_3D_ASYMLUT … … 1944 1970 Bool getPocResetInfoPresentFlag () { return m_pocResetInfoPresentFlag; } 1945 1971 Void setPocResetInfoPresentFlag (const Bool val) { m_pocResetInfoPresentFlag = val; } 1972 #endif 1973 #if MOVE_SCALED_OFFSET_TO_PPS 1974 UInt getNumScaledRefLayerOffsets() { return m_numScaledRefLayerOffsets; } 1975 Void setNumScaledRefLayerOffsets(Int x) { m_numScaledRefLayerOffsets = x; } 1976 #if O0098_SCALED_REF_LAYER_ID 1977 UInt getScaledRefLayerId(Int x) { return m_scaledRefLayerId[x]; } 1978 Void setScaledRefLayerId(Int x, UInt id) { m_scaledRefLayerId[x] = id; } 1979 Window& getScaledRefLayerWindowForLayer( Int layerId ); 1980 #endif 1981 Window& getScaledRefLayerWindow( Int x ) { return m_scaledRefLayerWindow[x]; } 1982 #if REF_REGION_OFFSET 1983 Window& getRefLayerWindowForLayer( Int layerId ); 1984 Window& getRefLayerWindow( Int x ) { return m_refLayerWindow[x]; } 1985 Bool getScaledRefLayerOffsetPresentFlag(Int x) { return m_scaledRefLayerOffsetPresentFlag[x]; } 1986 Void setScaledRefLayerOffsetPresentFlag(Int x, Bool b) { m_scaledRefLayerOffsetPresentFlag[x] = b; } 1987 Bool getRefRegionOffsetPresentFlag(Int x) { return m_refRegionOffsetPresentFlag[x]; } 1988 Void setRefRegionOffsetPresentFlag(Int x, Bool b) { m_refRegionOffsetPresentFlag[x] = b; } 1989 #endif 1990 #if R0209_GENERIC_PHASE 1991 Int getPhaseHorLuma(Int x) { return m_phaseHorLuma[x]; } 1992 Int getPhaseVerLuma(Int x) { return m_phaseVerLuma[x]; } 1993 Int getPhaseHorChroma(Int x) { return m_phaseHorChroma[x]; } 1994 Int getPhaseVerChroma(Int x) { return m_phaseVerChroma[x]; } 1995 Void setPhaseHorLuma(Int x, Int val) { m_phaseHorLuma[x] = val; } 1996 Void setPhaseVerLuma(Int x, Int val) { m_phaseVerLuma[x] = val; } 1997 Void setPhaseHorChroma(Int x, Int val) { m_phaseHorChroma[x] = val; } 1998 Void setPhaseVerChroma(Int x, Int val) { m_phaseVerChroma[x] = val; } 1999 Bool getResamplePhaseSetPresentFlag(Int x) { return m_resamplePhaseSetPresentFlag[x]; } 2000 Void setResamplePhaseSetPresentFlag(Int x, Bool b) { m_resamplePhaseSetPresentFlag[x] = b; } 2001 #endif 1946 2002 #endif 1947 2003 #if Q0048_CGS_3D_ASYMLUT -
branches/SHM-dev/source/Lib/TLibCommon/TComUpsampleFilter.cpp
r815 r849 59 59 #else 60 60 #if O0194_JOINT_US_BITSHIFT 61 #if REF_REGION_OFFSET 62 Void TComUpsampleFilter::upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, const Window altRefWindow ) 63 #else 61 64 Void TComUpsampleFilter::upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window ) 65 #endif 62 66 #else 63 67 Void TComUpsampleFilter::upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window ) … … 75 79 #endif 76 80 81 #if MOVE_SCALED_OFFSET_TO_PPS 82 #if O0098_SCALED_REF_LAYER_ID 83 const Window &scalEL = currSlice->getPPS()->getScaledRefLayerWindowForLayer(refLayerId); 84 #else 85 const Window &scalEL = currSlice->getPPS()->getScaledRefLayerWindow(refLayerIdc); 86 #endif 87 #if REF_REGION_OFFSET 88 const Window &windowRL = currSlice->getPPS()->getRefLayerWindow(refLayerIdc); 89 #endif 90 #else 77 91 #if O0098_SCALED_REF_LAYER_ID 78 92 const Window &scalEL = currSlice->getSPS()->getScaledRefLayerWindowForLayer(refLayerId); 79 93 #else 80 94 const Window &scalEL = currSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc); 95 #endif 81 96 #endif 82 97 … … 91 106 92 107 #if Q0200_CONFORMANCE_BL_SIZE 108 const Window &confBL = currSlice->getBaseColPic(refLayerIdc)->getConformanceWindow(); 109 #endif 110 #if Q0200_CONFORMANCE_BL_SIZE || REF_REGION_OFFSET 93 111 Int chromaFormatIdc = currSlice->getBaseColPic(refLayerIdc)->getSlice(0)->getChromaFormatIdc(); 94 const Window &confBL = currSlice->getBaseColPic(refLayerIdc)->getConformanceWindow();95 112 Int xScal = TComSPS::getWinUnitX( chromaFormatIdc ); 96 113 Int yScal = TComSPS::getWinUnitY( chromaFormatIdc ); 114 #endif 115 #if R0209_GENERIC_PHASE 116 Int phaseHorLuma = currSlice->getPPS()->getPhaseHorLuma(refLayerIdc); 117 Int phaseVerLuma = currSlice->getPPS()->getPhaseVerLuma(refLayerIdc); 118 Int phaseHorChroma = currSlice->getPPS()->getPhaseHorChroma(refLayerIdc); 119 Int phaseVerChroma; 120 if (currSlice->getPPS()->getResamplePhaseSetPresentFlag(refLayerIdc)) 121 { 122 phaseVerChroma = currSlice->getPPS()->getPhaseVerChroma(refLayerIdc); 123 } 124 else 125 { 126 Int refRegionHeight = heightBL - windowRL.getWindowTopOffset() - windowRL.getWindowBottomOffset(); 127 phaseVerChroma = (4 * heightEL + (refRegionHeight >> 1)) / refRegionHeight - 4; 128 } 97 129 #endif 98 130 #if P0312_VERT_PHASE_ADJ … … 223 255 Int shiftY = 16; 224 256 257 #if R0209_GENERIC_PHASE 258 Int phaseX = phaseHorLuma; 259 Int phaseY = phaseVerLuma; 260 Int addX = ( ( phaseX * scaleX + 8 ) >> 4 ) - (1 << ( shiftX - 5 )); 261 Int addY = ( ( phaseY * scaleY + 8 ) >> 4 ) - (1 << ( shiftX - 5 )); 262 #if REF_REGION_OFFSET 263 Int refOffsetX = windowRL.getWindowLeftOffset() << 4; 264 Int refOffsetY = windowRL.getWindowTopOffset() << 4; 265 #else 266 #if Q0200_CONFORMANCE_BL_SIZE 267 Int refOffsetX = ( confBL.getWindowLeftOffset() * xScal ) << 4; 268 Int refOffsetY = ( confBL.getWindowTopOffset() * yScal ) << 4; 269 #endif 270 #endif 271 #else 225 272 #if O0215_PHASE_ALIGNMENT //for Luma, if Phase 0, then both PhaseX and PhaseY should be 0. If symmetric: both PhaseX and PhaseY should be 2 226 273 Int phaseX = 2*phaseAlignFlag; … … 258 305 #endif 259 306 307 #if REF_REGION_OFFSET 308 Int refOffsetX = windowRL.getWindowLeftOffset() << 4; 309 Int refOffsetY = windowRL.getWindowTopOffset() << 4; 310 #else 260 311 #if Q0200_CONFORMANCE_BL_SIZE 261 312 deltaX -= ( confBL.getWindowLeftOffset() * xScal ) << 4; 262 313 deltaY -= ( confBL.getWindowTopOffset() * yScal ) << 4; 263 314 #endif 315 #endif 316 #endif 264 317 265 318 Int shiftXM4 = shiftX - 4; … … 272 325 heightBL = min<Int>( pcBasePic->getHeight(), heightEL ); 273 326 327 #if R0220_REMOVE_EL_CLIP 328 Int phaseXL = scalEL.getWindowLeftOffset(); 329 Int phaseYL = scalEL.getWindowTopOffset(); 330 Int rlClipL = -(NTAPS_US_LUMA>>1); 331 Int rlClipR = widthBL -1 + (NTAPS_US_LUMA>>1); 332 Int rlClipT = -(NTAPS_US_LUMA>>1); 333 Int rlClipB = heightBL - 1 + (NTAPS_US_LUMA>>1); 334 #else 274 335 Int leftStartL = scalEL.getWindowLeftOffset(); 275 336 Int rightEndL = pcUsPic->getWidth() - scalEL.getWindowRightOffset(); … … 277 338 Int bottomEndL = pcUsPic->getHeight() - scalEL.getWindowBottomOffset(); 278 339 Int leftOffset = leftStartL > 0 ? leftStartL : 0; 340 #endif 279 341 #if O0194_JOINT_US_BITSHIFT 280 342 // g_bitDepthY was set to EL bit-depth, but shift1 should be calculated using BL bit-depth … … 293 355 for( i = 0; i < widthEL; i++ ) 294 356 { 357 #if R0220_REMOVE_EL_CLIP 358 Int x = i; 359 #if R0209_GENERIC_PHASE 360 refPos16 = (((x - phaseXL)*scaleX - addX) >> shiftXM4) + refOffsetX; 361 #else 362 #if REF_REGION_OFFSET 363 refPos16 = (((x - phaseXL)*scaleX + addX) >> shiftXM4) - deltaX + refOffsetX; 364 #else 365 refPos16 = (((x - phaseXL)*scaleX + addX) >> shiftXM4) - deltaX; 366 #endif 367 #endif 368 #else 295 369 Int x = Clip3( leftStartL, rightEndL - 1, i ); 370 #if REF_REGION_OFFSET 371 refPos16 = (((x - leftStartL)*scaleX + addX) >> shiftXM4) - deltaX + refOffsetX; 372 #else 296 373 refPos16 = (((x - leftStartL)*scaleX + addX) >> shiftXM4) - deltaX; 374 #endif 375 #endif 297 376 phase = refPos16 & 15; 298 377 refPos = refPos16 >> 4; 378 #if R0220_REMOVE_EL_CLIP 379 refPos = Clip3( rlClipL, rlClipR, refPos ); 380 #endif 299 381 coeff = m_lumaFilter[phase]; 300 382 … … 325 407 for( j = 0; j < pcTempPic->getHeight(); j++ ) 326 408 { 409 #if R0220_REMOVE_EL_CLIP 410 Int y = j; 411 #if R0209_GENERIC_PHASE 412 refPos16 = ((( y - phaseYL )*scaleY - addY) >> shiftYM4) + refOffsetY; 413 #else 414 #if REF_REGION_OFFSET 415 refPos16 = ((( y - phaseYL )*scaleY + addY) >> shiftYM4) - deltaY + refOffsetY; 416 #else 417 refPos16 = ((( y - pahseYL )*scaleY + addY) >> shiftYM4) - deltaY; 418 #endif 419 #endif 420 #else 327 421 Int y = Clip3(topStartL, bottomEndL - 1, j); 422 #if REF_REGION_OFFSET 423 refPos16 = ((( y - topStartL )*scaleY + addY) >> shiftYM4) - deltaY + refOffsetY; 424 #else 328 425 refPos16 = ((( y - topStartL )*scaleY + addY) >> shiftYM4) - deltaY; 426 #endif 427 #endif 329 428 phase = refPos16 & 15; 330 429 refPos = refPos16 >> 4; 430 #if R0220_REMOVE_EL_CLIP 431 refPos = Clip3( rlClipT, rlClipB, refPos ); 432 #endif 331 433 coeff = m_lumaFilter[phase]; 332 434 333 435 piSrcY = piTempBufY + (refPos -((NTAPS_US_LUMA>>1) - 1))*strideEL; 334 436 Pel* piDstY0 = piDstBufY + j * strideEL; 335 piDstY = piDstY0 + leftOffset; 336 piSrcY += leftOffset; 337 338 for( i = min<Int>(rightEndL, pcTempPic->getWidth()) - max<Int>(0, leftStartL); i > 0; i-- ) 437 438 #if R0220_REMOVE_EL_CLIP 439 piDstY = piDstY0; 440 441 for( i = pcTempPic->getWidth(); i > 0; i-- ) 339 442 { 340 443 *piDstY = ClipY( (sumLumaVer(piSrcY, coeff, strideEL) + iOffset) >> (nShift)); … … 342 445 piDstY++; 343 446 } 447 #else 448 piDstY = piDstY0 + leftOffset; 449 piSrcY += leftOffset; 450 451 for( i = min<Int>(rightEndL, pcTempPic->getWidth()) - max<Int>(0, leftStartL); i > 0; i-- ) 452 { 453 *piDstY = ClipY( (sumLumaVer(piSrcY, coeff, strideEL) + iOffset) >> (nShift)); 454 piSrcY++; 455 piDstY++; 456 } 344 457 345 458 for( i = rightEndL; i < pcTempPic->getWidth(); i++ ) … … 355 468 piDstY++; 356 469 } 357 470 #endif 358 471 } 359 472 … … 374 487 strideEL = pcUsPic->getCStride(); 375 488 489 #if R0220_REMOVE_EL_CLIP 490 Int srlLOffsetC = scalEL.getWindowLeftOffset() >> 1; 491 Int srlTOffsetC = scalEL.getWindowTopOffset() >> 1; 492 rlClipL = -(NTAPS_US_CHROMA>>1); 493 rlClipR = widthBL -1 + (NTAPS_US_CHROMA>>1); 494 rlClipT = -(NTAPS_US_CHROMA>>1); 495 rlClipB = heightBL - 1 + (NTAPS_US_CHROMA>>1); 496 #else 376 497 Int leftStartC = scalEL.getWindowLeftOffset() >> 1; 377 498 Int rightEndC = (pcUsPic->getWidth() >> 1) - (scalEL.getWindowRightOffset() >> 1); … … 379 500 Int bottomEndC = (pcUsPic->getHeight() >> 1) - (scalEL.getWindowBottomOffset() >> 1); 380 501 leftOffset = leftStartC > 0 ? leftStartC : 0; 502 #endif 381 503 shiftX = 16; 382 504 shiftY = 16; 383 505 506 #if R0209_GENERIC_PHASE 507 addX = ( ( phaseHorChroma * scaleX + 8 ) >> 4 ) - (1 << ( shiftX - 5 )); 508 addY = ( ( phaseVerChroma * scaleY + 8 ) >> 4 ) - (1 << ( shiftX - 5 )); 509 Int refOffsetXC = (windowRL.getWindowLeftOffset() / xScal) << 4; 510 Int refOffsetYC = (windowRL.getWindowTopOffset() / yScal) << 4; 511 #else 384 512 #if O0215_PHASE_ALIGNMENT 385 513 Int phaseXC = phaseAlignFlag; … … 417 545 #endif 418 546 547 #if REF_REGION_OFFSET 548 Int refOffsetXC = (windowRL.getWindowLeftOffset() / xScal) << 4; 549 Int refOffsetYC = (windowRL.getWindowTopOffset() / yScal) << 4; 550 #else 419 551 #if Q0200_CONFORMANCE_BL_SIZE 420 552 deltaX -= ( ( confBL.getWindowLeftOffset() * xScal ) >> 1 ) << 4; 421 553 deltaY -= ( ( confBL.getWindowTopOffset() * yScal ) >> 1 ) << 4; 554 #endif 555 #endif 422 556 #endif 423 557 … … 447 581 for( i = 0; i < widthEL; i++ ) 448 582 { 583 #if R0220_REMOVE_EL_CLIP 584 Int x = i; 585 #if R0209_GENERIC_PHASE 586 refPos16 = (((x - srlLOffsetC)*scaleX - addX) >> shiftXM4) + refOffsetXC; 587 #else 588 #if REF_REGION_OFFSET 589 refPos16 = (((x - srlLOffsetC)*scaleX + addX) >> shiftXM4) - deltaX + refOffsetXC; 590 #else 591 refPos16 = (((x - srlLOffsetC)*scaleX + addX) >> shiftXM4) - deltaX; 592 #endif 593 #endif 594 #else 449 595 Int x = Clip3(leftStartC, rightEndC - 1, i); 596 #if REF_REGION_OFFSET 597 refPos16 = (((x - leftStartC)*scaleX + addX) >> shiftXM4) - deltaX + refOffsetXC; 598 #else 450 599 refPos16 = (((x - leftStartC)*scaleX + addX) >> shiftXM4) - deltaX; 600 #endif 601 #endif 451 602 phase = refPos16 & 15; 452 603 refPos = refPos16 >> 4; 604 #if R0220_REMOVE_EL_CLIP 605 refPos = Clip3(rlClipL, rlClipR, refPos); 606 #endif 453 607 coeff = m_chromaFilter[phase]; 454 608 … … 485 639 for( j = 0; j < pcTempPic->getHeight() >> 1; j++ ) 486 640 { 641 #if R0220_REMOVE_EL_CLIP 642 Int y = j; 643 #if R0209_GENERIC_PHASE 644 refPos16 = (((y - srlTOffsetC)*scaleX - addY) >> shiftYM4) + refOffsetYC; 645 #else 646 #if REF_REGION_OFFSET 647 refPos16 = (((y - srlTOffsetC)*scaleY + addY) >> shiftYM4) - deltaY + refOffsetYC; 648 #else 649 refPos16 = (((y - srlTOffsetC)*scaleY + addY) >> shiftYM4) - deltaY; 650 #endif 651 #endif 652 #else 487 653 Int y = Clip3(topStartC, bottomEndC - 1, j); 654 #if REF_REGION_OFFSET 655 refPos16 = (((y - topStartC)*scaleY + addY) >> shiftYM4) - deltaY + refOffsetYC; 656 #else 488 657 refPos16 = (((y - topStartC)*scaleY + addY) >> shiftYM4) - deltaY; 658 #endif 659 #endif 489 660 phase = refPos16 & 15; 490 661 refPos = refPos16 >> 4; 662 #if R0220_REMOVE_EL_CLIP 663 refPos = Clip3(rlClipT, rlClipB, refPos); 664 #endif 491 665 coeff = m_chromaFilter[phase]; 492 666 … … 496 670 Pel* piDstU0 = piDstBufU + j*strideEL; 497 671 Pel* piDstV0 = piDstBufV + j*strideEL; 498 piDstU = piDstU0 + leftOffset; 499 piDstV = piDstV0 + leftOffset; 500 pi SrcU += leftOffset;501 pi SrcV += leftOffset;502 503 for( i = min<Int>(rightEndC, pcTempPic->getWidth() >> 1) - max<Int>(0, leftStartC); i > 0; i-- )672 673 #if R0220_REMOVE_EL_CLIP 674 piDstU = piDstU0; 675 piDstV = piDstV0; 676 677 for( i = pcTempPic->getWidth() >> 1; i > 0; i-- ) 504 678 { 505 679 *piDstU = ClipC( (sumChromaVer(piSrcU, coeff, strideEL) + iOffset) >> (nShift)); … … 510 684 piDstV++; 511 685 } 686 #else 687 piDstU = piDstU0 + leftOffset; 688 piDstV = piDstV0 + leftOffset; 689 piSrcU += leftOffset; 690 piSrcV += leftOffset; 691 692 for( i = min<Int>(rightEndC, pcTempPic->getWidth() >> 1) - max<Int>(0, leftStartC); i > 0; i-- ) 693 { 694 *piDstU = ClipC( (sumChromaVer(piSrcU, coeff, strideEL) + iOffset) >> (nShift)); 695 *piDstV = ClipC( (sumChromaVer(piSrcV, coeff, strideEL) + iOffset) >> (nShift)); 696 piSrcU++; 697 piSrcV++; 698 piDstU++; 699 piDstV++; 700 } 512 701 513 702 for( i = rightEndC; i < pcTempPic->getWidth() >> 1; i++ ) … … 528 717 piDstV++; 529 718 } 719 #endif 530 720 531 721 } -
branches/SHM-dev/source/Lib/TLibCommon/TComUpsampleFilter.h
r713 r849 51 51 #else 52 52 #if O0194_JOINT_US_BITSHIFT 53 #if REF_REGION_OFFSET 54 Void upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, const Window altRefWindow ); 55 #else 53 56 Void upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window ); 57 #endif 54 58 #else 55 59 Void upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window ); -
branches/SHM-dev/source/Lib/TLibCommon/TypeDef.h
r848 r849 62 62 #define Q0146_SSH_EXT_DATA_BIT 1 ///< JCTVC-Q0146; Bug-fix -- the SSH_EXT_DATA_BIT can have any value -- not required to be 1 63 63 64 #define Q0200_CONFORMANCE_BL_SIZE 1 ///< JCTVC-Q0200; use conformance picture size in re-sampling processs65 #define P0312_VERT_PHASE_ADJ 1 ///< JCTVC-P0312: vertical phase adjustment in re-sampling process (BoG report)66 #if P0312_VERT_PHASE_ADJ67 #define Q0120_PHASE_CALCULATION 1 ///< JCTVC-Q0120 phase offset derivation for combination of spatial scalibility and field coding.68 #endif69 64 #define P0130_EOB 1 ///< JCTVC-P0130, set layer Id of EOB NALU to be fixed to 0 70 65 #define T_ID_EOB_BUG_FIX 1 ///< Bug fix for the value of temporal id of EOB NALU. It must be set to 0 … … 235 230 #define HRD_BPB 1 ///< JCTVC-Q0101 Bitstream Partition Buffering Proposals 236 231 #define DPB_CONSTRAINTS 1 ///< JCTVC-Q0100 RPS DPB constraints 232 233 #define R0340_RESAMPLING_MODIFICATION 1 ///< JCTVC-R0340: set of changes regarding resampling (as listed below) 234 #if R0340_RESAMPLING_MODIFICATION 235 #define MOVE_SCALED_OFFSET_TO_PPS 1 ///< JCTVC-R0013: move scaled reference layer offset from SPS to PPS 236 #if MOVE_SCALED_OFFSET_TO_PPS 237 #define REF_REGION_OFFSET 1 ///< JCTVC-Q0159/R0220: reference region offset 238 #define R0209_GENERIC_PHASE 1 ///< JCTVC-R0209: resampling with generic phase 239 #define R0220_REMOVE_EL_CLIP 1 ///< JCTVC-R0220: remove clip to scaled ref window in resampling process 240 #endif 241 #else 242 #define Q0200_CONFORMANCE_BL_SIZE 1 ///< JCTVC-Q0200; use conformance picture size in re-sampling processs 243 #define P0312_VERT_PHASE_ADJ 1 ///< JCTVC-P0312: vertical phase adjustment in re-sampling process (BoG report) 244 #if P0312_VERT_PHASE_ADJ 245 #define Q0120_PHASE_CALCULATION 1 ///< JCTVC-Q0120 phase offset derivation for combination of spatial scalibility and field coding. 246 #endif 247 #endif 237 248 238 249 /// scalability types
Note: See TracChangeset for help on using the changeset viewer.