Changeset 627 in SHVCSoftware for branches/SHM-5.1-dev/source/Lib/TLibCommon
- Timestamp:
- 12 Mar 2014, 22:06:13 (11 years ago)
- Location:
- branches/SHM-5.1-dev/source/Lib/TLibCommon
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-5.1-dev/source/Lib/TLibCommon/TComSlice.cpp
r625 r627 125 125 m_interLayerPredEnabledFlag = 0; 126 126 ::memset( m_interLayerPredLayerIdc, 0, sizeof(m_interLayerPredLayerIdc) ); 127 #if P0312_VERT_PHASE_ADJ 128 ::memset( m_vertPhasePositionFlag, 0, sizeof(m_vertPhasePositionFlag) ); 129 #endif 127 130 #endif //SVC_EXTENSION 128 131 … … 1122 1125 m_interLayerPredEnabledFlag = pSrc->m_interLayerPredEnabledFlag; 1123 1126 memcpy( m_interLayerPredLayerIdc, pSrc->m_interLayerPredLayerIdc, sizeof( m_interLayerPredLayerIdc ) ); 1127 #if P0312_VERT_PHASE_ADJ 1128 memcpy( m_vertPhasePositionFlag, pSrc->m_vertPhasePositionFlag, sizeof( m_vertPhasePositionFlag ) ); 1129 #endif 1124 1130 #endif 1125 1131 m_pcSPS = pSrc->m_pcSPS; -
branches/SHM-5.1-dev/source/Lib/TLibCommon/TComSlice.h
r625 r627 627 627 Int m_avgPicRate [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER]; 628 628 #endif 629 630 #if P0312_VERT_PHASE_ADJ 631 Bool m_vpsVuiVertPhaseInUseFlag; 632 #endif 633 629 634 #if P0300_ALT_OUTPUT_LAYER_FLAG 630 635 Bool m_altOutputLayerFlag[MAX_VPS_LAYER_SETS_PLUS1]; … … 1008 1013 Int getBaseLayerPSCompatibilityFlag (Int layer) { return m_baseLayerPSCompatibilityFlag[layer];} 1009 1014 #endif 1015 1016 #if P0312_VERT_PHASE_ADJ 1017 Bool getVpsVuiVertPhaseInUseFlag() { return m_vpsVuiVertPhaseInUseFlag; } 1018 Void setVpsVuiVertPhaseInUseFlag(Bool x) { m_vpsVuiVertPhaseInUseFlag = x; } 1019 #endif 1020 1010 1021 #if P0300_ALT_OUTPUT_LAYER_FLAG 1011 1022 Bool getAltOuputLayerFlag(Int idx) { return m_altOutputLayerFlag[idx]; } … … 1115 1126 Int m_winTopOffset; 1116 1127 Int m_winBottomOffset; 1128 #if P0312_VERT_PHASE_ADJ 1129 Bool m_vertPhasePositionEnableFlag; 1130 Bool m_vertPhasePositionFlag; 1131 #endif 1117 1132 public: 1118 1133 Window() … … 1122 1137 , m_winTopOffset (0) 1123 1138 , m_winBottomOffset (0) 1139 #if P0312_VERT_PHASE_ADJ 1140 , m_vertPhasePositionEnableFlag(false) 1141 , m_vertPhasePositionFlag(false) 1142 #endif 1124 1143 { } 1125 1144 1126 1145 Bool getWindowEnabledFlag() const { return m_enabledFlag; } 1127 Void resetWindow() { m_enabledFlag = false; m_winLeftOffset = m_winRightOffset = m_winTopOffset = m_winBottomOffset = 0; } 1146 #if P0312_VERT_PHASE_ADJ 1147 Void resetWindow() { m_enabledFlag = false; m_winLeftOffset = m_winRightOffset = m_winTopOffset = m_winBottomOffset = 0; m_vertPhasePositionEnableFlag = m_vertPhasePositionFlag = false;} 1148 #else 1149 Void resetWindow() { m_enabledFlag = false; m_winLeftOffset = m_winRightOffset = m_winTopOffset = m_winBottomOffset = 0;} 1150 #endif 1128 1151 Int getWindowLeftOffset() const { return m_enabledFlag ? m_winLeftOffset : 0; } 1129 1152 Void setWindowLeftOffset(Int val) { m_winLeftOffset = val; m_enabledFlag = true; } … … 1135 1158 Void setWindowBottomOffset(Int val) { m_winBottomOffset = val; m_enabledFlag = true; } 1136 1159 1160 #if P0312_VERT_PHASE_ADJ 1161 Bool getVertPhasePositionEnableFlag() const { return m_vertPhasePositionEnableFlag ; } 1162 Void setVertPhasePositionEnableFlag(Bool val) { m_vertPhasePositionEnableFlag = val; } 1163 1164 Bool getVertPhasePositionFlag() const { return m_vertPhasePositionEnableFlag ? m_vertPhasePositionFlag: 0; } 1165 Void setVertPhasePositionFlag(Bool val) { m_vertPhasePositionFlag = val; } 1166 1167 Void setWindow(Int offsetLeft, Int offsetLRight, Int offsetLTop, Int offsetLBottom , Bool vertPhasePositionEnableFlag = 0, Bool phasePosFlag = 0) 1168 #else 1137 1169 Void setWindow(Int offsetLeft, Int offsetLRight, Int offsetLTop, Int offsetLBottom) 1170 #endif 1138 1171 { 1139 1172 m_enabledFlag = true; … … 1142 1175 m_winTopOffset = offsetLTop; 1143 1176 m_winBottomOffset = offsetLBottom; 1177 #if P0312_VERT_PHASE_ADJ 1178 m_vertPhasePositionEnableFlag = vertPhasePositionEnableFlag; 1179 m_vertPhasePositionFlag = phasePosFlag; 1180 #endif 1144 1181 } 1145 1182 }; … … 1393 1430 UInt m_layerId; 1394 1431 UInt m_numScaledRefLayerOffsets; 1432 #if P0312_VERT_PHASE_ADJ 1433 Bool m_vertPhasePositionEnableFlag[MAX_LAYERS]; 1434 #endif 1395 1435 #if O0098_SCALED_REF_LAYER_ID 1396 1436 UInt m_scaledRefLayerId[MAX_LAYERS]; … … 1549 1589 UInt getNumScaledRefLayerOffsets() { return m_numScaledRefLayerOffsets; } 1550 1590 Void setNumScaledRefLayerOffsets(Int x) { m_numScaledRefLayerOffsets = x; } 1591 #if P0312_VERT_PHASE_ADJ 1592 Bool getVertPhasePositionEnableFlag(Int x) { return m_vertPhasePositionEnableFlag[x]; } 1593 Void setVertPhasePositionEnableFlag(Int x, Bool b) { m_vertPhasePositionEnableFlag[x] = b; } 1594 #endif 1551 1595 #if O0098_SCALED_REF_LAYER_ID 1552 1596 UInt getScaledRefLayerId(Int x) { return m_scaledRefLayerId[x]; } … … 1944 1988 Int m_activeNumILRRefIdx; //< Active inter-layer reference pictures 1945 1989 Int m_interLayerPredLayerIdc [MAX_VPS_LAYER_ID_PLUS1]; 1990 #if P0312_VERT_PHASE_ADJ 1991 Bool m_vertPhasePositionFlag[MAX_VPS_LAYER_ID_PLUS1]; 1992 #endif 1946 1993 #if POC_RESET_FLAG 1947 1994 Bool m_bPocResetFlag; … … 2224 2271 Bool getInterLayerPredEnabledFlag () { return m_interLayerPredEnabledFlag;} 2225 2272 2273 #if P0312_VERT_PHASE_ADJ 2274 Int getVertPhasePositionFlag (UInt layerIdx) { return m_vertPhasePositionFlag[layerIdx];} 2275 Void setVertPhasePositionFlag (Bool b, UInt layerIdx) { m_vertPhasePositionFlag[layerIdx] = b; } 2276 #endif 2277 2226 2278 Void setNumMotionPredRefLayers(int i) { m_numMotionPredRefLayers = i; } 2227 2279 Int getNumMotionPredRefLayers() { return m_numMotionPredRefLayers; } -
branches/SHM-5.1-dev/source/Lib/TLibCommon/TComUpsampleFilter.cpp
r498 r627 126 126 Int heightEL = pcUsPic->getHeight() - scalEL.getWindowTopOffset() - scalEL.getWindowBottomOffset(); 127 127 Int strideEL = pcUsPic->getStride(); 128 129 #if P0312_VERT_PHASE_ADJ 130 Bool vertPhasePositionEnableFlag = scalEL.getVertPhasePositionEnableFlag(); 131 Bool vertPhasePositionFlag = scalEL.getVertPhasePositionFlag(); 132 if (vertPhasePositionFlag) 133 { 134 assert (vertPhasePositionEnableFlag); 135 } 136 #endif 128 137 129 138 Pel* piTempBufY = pcTempPic->getLumaAddr(); … … 219 228 #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 220 229 Int phaseX = 2*phaseAlignFlag; 230 #if P0312_VERT_PHASE_ADJ 231 Int phaseY = (vertPhasePositionEnableFlag?(vertPhasePositionFlag *4):(2*phaseAlignFlag)); 232 #else 221 233 Int phaseY = 2*phaseAlignFlag; 234 #endif 222 235 #else 223 236 Int phaseX = 0; 237 #if P0312_VERT_PHASE_ADJ 238 Int phaseY = (vertPhasePositionEnableFlag?(vertPhasePositionFlag *4):(0)); 239 #else 224 240 Int phaseY = 0; 241 #endif 225 242 #endif 226 243 … … 363 380 364 381 #if O0215_PHASE_ALIGNMENT 382 Int phaseXC = phaseAlignFlag; 383 #if P0312_VERT_PHASE_ADJ 384 Int phaseYC = vertPhasePositionEnableFlag ? (vertPhasePositionFlag * 4):(phaseAlignFlag + 1); 385 #else 386 Int phaseYC = phaseAlignFlag + 1; 387 #endif 388 #else 365 389 Int phaseXC = 0; 390 #if P0312_VERT_PHASE_ADJ 391 Int phaseYC = vertPhasePositionEnableFlag ? (vertPhasePositionFlag * 4): 1;; 392 #else 366 393 Int phaseYC = 1; 367 394 #endif 395 #endif 396 368 397 #if ROUNDING_OFFSET 369 addX = ( ( (phaseXC+phaseAlignFlag) * scaleX + 2 ) >> 2 ) + ( 1 << ( shiftX - 5 ) ); 370 addY = ( ( (phaseYC+phaseAlignFlag) * scaleY + 2 ) >> 2 ) + ( 1 << ( shiftY - 5 ) ); 371 #else 372 addX = ( ( ( widthBL * (phaseXC+phaseAlignFlag) ) << ( shiftX - 2 ) ) + ( widthEL >> 1 ) ) / widthEL + ( 1 << ( shiftX - 5 ) ); 373 addY = ( ( ( heightBL * (phaseYC+phaseAlignFlag) ) << ( shiftY - 2 ) ) + ( heightEL >> 1 ) ) / heightEL+ ( 1 << ( shiftY - 5 ) ); 374 #endif 375 376 deltaX = 4 * (phaseXC+phaseAlignFlag); 377 deltaY = 4 * (phaseYC+phaseAlignFlag); 378 #else 379 phaseX = 0; 380 phaseY = 1; 381 382 #if ROUNDING_OFFSET 383 addX = ( ( phaseX * scaleX + 2 ) >> 2 ) + ( 1 << ( shiftX - 5 ) ); 384 addY = ( ( phaseY * scaleY + 2 ) >> 2 ) + ( 1 << ( shiftY - 5 ) ); 385 #else 386 addX = ( ( ( widthBL * phaseX ) << ( shiftX - 2 ) ) + ( widthEL >> 1 ) ) / widthEL + ( 1 << ( shiftX - 5 ) ); 387 addY = ( ( ( heightBL * phaseY ) << ( shiftY - 2 ) ) + ( heightEL >> 1 ) ) / heightEL+ ( 1 << ( shiftY - 5 ) ); 388 #endif 389 390 deltaX = 4 * phaseX; 391 deltaY = 4 * phaseY; 392 #endif 398 addX = ( ( phaseXC * scaleX + 2 ) >> 2 ) + ( 1 << ( shiftX - 5 ) ); 399 addY = ( ( phaseYC * scaleY + 2 ) >> 2 ) + ( 1 << ( shiftY - 5 ) ); 400 #else 401 addX = ( ( ( widthBL * (phaseXC) ) << ( shiftX - 2 ) ) + ( widthEL >> 1 ) ) / widthEL + ( 1 << ( shiftX - 5 ) ); 402 addY = ( ( ( heightBL * (phaseYC) ) << ( shiftY - 2 ) ) + ( heightEL >> 1 ) ) / heightEL+ ( 1 << ( shiftY - 5 ) ); 403 #endif 404 405 deltaX = 4 * phaseXC; 406 deltaY = 4 * phaseYC; 393 407 394 408 shiftXM4 = shiftX - 4; -
branches/SHM-5.1-dev/source/Lib/TLibCommon/TypeDef.h
r625 r627 50 50 #define O0137_MAX_LAYERID 1 ///< JCTVC-O0137, JCTVC-O0200, JCTVC-O0223: restrict nuh_layer_id and vps_max_layers_minus1 51 51 52 #define P0312_VERT_PHASE_ADJ 1 ///< JCTVC-P0312: vertical phase adjustment in re-sampling process (BoG report) 52 53 #define P0130_EOB 1 ///< JCTVC-P0130, set layer Id of EOB NALU to be fixed to 0 53 54 #define P0307_REMOVE_VPS_VUI_OFFSET 1 ///< JCTVC-P0307, remove implementation related to VPS VUI offset signalling
Note: See TracChangeset for help on using the changeset viewer.