Index: /branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.cpp
===================================================================
--- /branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.cpp	(revision 1089)
+++ /branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.cpp	(revision 1090)
@@ -793,5 +793,4 @@
   string    cfg_scaledRefLayerBottomOffset [MAX_LAYERS];
   Int*      cfg_numRefLayerLocationOffsets[MAX_LAYERS];
-#if REF_REGION_OFFSET
   string    cfg_scaledRefLayerOffsetPresentFlag [MAX_LAYERS];
   string    cfg_refRegionOffsetPresentFlag      [MAX_LAYERS];
@@ -800,6 +799,4 @@
   string    cfg_refRegionRightOffset  [MAX_LAYERS];
   string    cfg_refRegionBottomOffset [MAX_LAYERS];
-#endif
-#if R0209_GENERIC_PHASE
   string    cfg_resamplePhaseSetPresentFlag [MAX_LAYERS];
   string    cfg_phaseHorLuma   [MAX_LAYERS];
@@ -807,9 +804,4 @@
   string    cfg_phaseHorChroma [MAX_LAYERS];
   string    cfg_phaseVerChroma [MAX_LAYERS];
-#else
-#if P0312_VERT_PHASE_ADJ
-  string    cfg_vertPhasePositionEnableFlag[MAX_LAYERS];
-#endif
-#endif
 
 #if O0098_SCALED_REF_LAYER_ID
@@ -820,5 +812,4 @@
   string*    cfg_scaledRefLayerRightOffsetPtr  [MAX_LAYERS];
   string*    cfg_scaledRefLayerBottomOffsetPtr [MAX_LAYERS];
-#if REF_REGION_OFFSET
   string*    cfg_scaledRefLayerOffsetPresentFlagPtr [MAX_LAYERS];
   string*    cfg_refRegionOffsetPresentFlagPtr      [MAX_LAYERS];
@@ -827,6 +818,4 @@
   string*    cfg_refRegionRightOffsetPtr  [MAX_LAYERS];
   string*    cfg_refRegionBottomOffsetPtr [MAX_LAYERS];
-#endif
-#if R0209_GENERIC_PHASE
   string*    cfg_resamplePhaseSetPresentFlagPtr [MAX_LAYERS];
   string*    cfg_phaseHorLumaPtr   [MAX_LAYERS];
@@ -834,8 +823,4 @@
   string*    cfg_phaseHorChromaPtr [MAX_LAYERS];
   string*    cfg_phaseVerChromaPtr [MAX_LAYERS];
-#endif
-#if P0312_VERT_PHASE_ADJ
-  string*    cfg_vertPhasePositionEnableFlagPtr[MAX_LAYERS];
-#endif
 
 #if RC_SHVC_HARMONIZATION
@@ -927,8 +912,4 @@
       cfg_scaledRefLayerRightOffsetPtr [layer] = &cfg_scaledRefLayerRightOffset[layer];
       cfg_scaledRefLayerBottomOffsetPtr[layer] = &cfg_scaledRefLayerBottomOffset[layer];
-#if P0312_VERT_PHASE_ADJ
-      cfg_vertPhasePositionEnableFlagPtr[layer] = &cfg_vertPhasePositionEnableFlag[layer];
-#endif
-#if REF_REGION_OFFSET
       cfg_scaledRefLayerOffsetPresentFlagPtr [layer] = &cfg_scaledRefLayerOffsetPresentFlag [layer];
       cfg_refRegionOffsetPresentFlagPtr      [layer] = &cfg_refRegionOffsetPresentFlag      [layer];
@@ -937,6 +918,4 @@
       cfg_refRegionRightOffsetPtr [layer] = &cfg_refRegionRightOffset [layer];
       cfg_refRegionBottomOffsetPtr[layer] = &cfg_refRegionBottomOffset[layer];
-#endif
-#if R0209_GENERIC_PHASE
       cfg_resamplePhaseSetPresentFlagPtr [layer] = &cfg_resamplePhaseSetPresentFlag [layer];
       cfg_phaseHorLumaPtr   [layer] = &cfg_phaseHorLuma   [layer];
@@ -944,5 +923,4 @@
       cfg_phaseHorChromaPtr [layer] = &cfg_phaseHorChroma [layer];
       cfg_phaseVerChromaPtr [layer] = &cfg_phaseVerChroma [layer];
-#endif
     }
 #if RC_SHVC_HARMONIZATION
@@ -1088,7 +1066,4 @@
   ("FrameRate%d,-fr%d",                             cfg_FrameRate,                               0, MAX_LAYERS, "Frame rate for layer %d")
   ("LambdaModifier%d,-LM%d",                        m_adLambdaModifier,                Double(1.0), MAX_TLAYER, "Lambda modifier for temporal layer %d")
-#if O0215_PHASE_ALIGNMENT
-  ("PhaseAlignment",                                m_phaseAlignFlag,                                    false, "indicate the sample location alignment between layers (0: zero position aligned, 1: central position aligned)")
-#endif
 #if REPN_FORMAT_IN_VPS
   ("RepFormatIdx%d",                                cfg_repFormatIdx,                           -1, MAX_LAYERS, "Index to the representation format structure used from the VPS")
@@ -1165,5 +1140,5 @@
   ("ScaledRefLayerBottomOffset%d",                  cfg_scaledRefLayerBottomOffsetPtr,  string(""), MAX_LAYERS, "Vertical offset of bottom-right luma sample of scaled base layer picture with respect to"
                                                                                                                 "  bottom-right luma sample of the EL picture, in units of two luma samples")
-#if REF_REGION_OFFSET
+#if SVC_EXTENSION
   ("ScaledRefLayerOffsetPresentFlag%d",         cfg_scaledRefLayerOffsetPresentFlagPtr, string(""), MAX_LAYERS, "presense flag of scaled reference layer offsets")
   ("RefRegionOffsetPresentFlag%d",                  cfg_refRegionOffsetPresentFlagPtr,  string(""), MAX_LAYERS, "presense flag of reference region offsets")
@@ -1176,6 +1151,4 @@
   ("RefRegionBottomOffset%d",                       cfg_refRegionBottomOffsetPtr,       string(""), MAX_LAYERS, "Vertical offset of bottom-right luma sample of ref region with respect to"
                                                                                                                 "  bottom-right luma sample of the BL picture, in units of two luma samples")
-#endif
-#if R0209_GENERIC_PHASE
   ("ResamplePhaseSetPresentFlag%d",                 cfg_resamplePhaseSetPresentFlagPtr, string(""), MAX_LAYERS, "presense flag of resample phase set")
   ("PhaseHorLuma%d",                                cfg_phaseHorLumaPtr,                string(""), MAX_LAYERS, "luma shift in the horizontal direction used in resampling proces")
@@ -1183,7 +1156,4 @@
   ("PhaseHorChroma%d",                              cfg_phaseHorChromaPtr,              string(""), MAX_LAYERS, "chroma shift in the horizontal direction used in resampling proces")
   ("PhaseVerChroma%d",                              cfg_phaseVerChromaPtr,              string(""), MAX_LAYERS, "chroma shift in the vertical   direction used in resampling proces")
-#endif
-#if P0312_VERT_PHASE_ADJ
-  ("VertPhasePositionEnableFlag%d",                 cfg _vertPhasePositionEnableFlagPtr,string(""), MAX_LAYERS, "VertPhasePositionEnableFlag for layer %d")
 #endif
 #if Q0074_COLOUR_REMAPPING_SEI
@@ -2156,5 +2126,4 @@
       assert( strcmp(cfg_refLocationOffsetLayerId[layer].c_str(),  ""));
 #endif
-#if REF_REGION_OFFSET
       Bool srloFlag =
         strcmp(cfg_scaledRefLayerLeftOffset   [layer].c_str(), "") ||
@@ -2162,4 +2131,5 @@
         strcmp(cfg_scaledRefLayerTopOffset    [layer].c_str(), "") ||
         strcmp(cfg_scaledRefLayerBottomOffset [layer].c_str(), "");
+
       Bool rroFlag =
         strcmp(cfg_refRegionLeftOffset   [layer].c_str(), "") ||
@@ -2167,5 +2137,5 @@
         strcmp(cfg_refRegionTopOffset    [layer].c_str(), "") ||
         strcmp(cfg_refRegionBottomOffset [layer].c_str(), "");
-#if R0209_GENERIC_PHASE
+
       Bool phaseSetFlag =
         strcmp(cfg_phaseHorLuma   [layer].c_str(), "") ||
@@ -2174,21 +2144,4 @@
         strcmp(cfg_phaseVerChroma [layer].c_str(), "");
       assert( srloFlag || rroFlag || phaseSetFlag);
-#else
-      assert( srloFlag || rroFlag );
-#endif
-#else
-#if P0312_VERT_PHASE_ADJ
-      assert( strcmp(cfg_scaledRefLayerLeftOffset[layer].c_str(),  "") ||
-              strcmp(cfg_scaledRefLayerRightOffset[layer].c_str(), "") ||
-              strcmp(cfg_scaledRefLayerTopOffset[layer].c_str(),   "") ||
-              strcmp(cfg_scaledRefLayerBottomOffset[layer].c_str(),"") ||
-              strcmp(cfg_vertPhasePositionEnableFlag[layer].c_str(),"") ); 
-#else
-      assert( strcmp(cfg_scaledRefLayerLeftOffset[layer].c_str(),  "") ||
-              strcmp(cfg_scaledRefLayerRightOffset[layer].c_str(), "") ||
-              strcmp(cfg_scaledRefLayerTopOffset[layer].c_str(),   "") ||
-              strcmp(cfg_scaledRefLayerBottomOffset[layer].c_str(),"") ); 
-#endif
-#endif
     }
 
@@ -2211,5 +2164,4 @@
 #endif
 
-#if REF_REGION_OFFSET
     // Presense Flag //
     if(strcmp(cfg_scaledRefLayerOffsetPresentFlag[layer].c_str(),  ""))
@@ -2225,5 +2177,4 @@
       }
     }
-#endif
 
     // Left offset //
@@ -2282,20 +2233,5 @@
       }
     }
-#if P0312_VERT_PHASE_ADJ
-   // VertPhasePositionEnableFlag //
-    if(strcmp(cfg_vertPhasePositionEnableFlag[layer].c_str(),  ""))
-    {
-      cfgStringToArray( &tempArray, cfg_vertPhasePositionEnableFlag[layer], m_acLayerCfg[layer].m_numScaledRefLayerOffsets, "VertPhasePositionEnableFlag");
-      if(tempArray)
-      {
-        for(Int i = 0; i < m_acLayerCfg[layer].m_numScaledRefLayerOffsets; i++)
-        {
-          m_acLayerCfg[layer].m_vertPhasePositionEnableFlag[i] = tempArray[i];
-        }
-        delete [] tempArray; tempArray = NULL;
-      }
-    }
-#endif
-#if REF_REGION_OFFSET
+
     // Presense Flag //
     if(strcmp(cfg_refRegionOffsetPresentFlag[layer].c_str(),  ""))
@@ -2367,6 +2303,5 @@
       }
     }
-#endif
-#if R0209_GENERIC_PHASE
+
     Int numPhaseSet = m_acLayerCfg[layer].m_numRefLayerLocationOffsets;
 
@@ -2440,5 +2375,4 @@
       }
     }
-#endif
   }
 
@@ -4611,7 +4545,4 @@
   printf("InterLayerWeightedPred            : %d\n", m_useInterLayerWeightedPred );
 #endif
-#if O0215_PHASE_ALIGNMENT  
-  printf("Cross-layer sample alignment      : %d\n", m_phaseAlignFlag);
-#endif
   printf("\n");
   for(UInt layer=0; layer<m_numLayers; layer++)
Index: /branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.h
===================================================================
--- /branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.h	(revision 1089)
+++ /branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.h	(revision 1090)
@@ -496,7 +496,4 @@
   UInt      m_ilcIdc[1024];
 #endif
-#if O0215_PHASE_ALIGNMENT
-  Bool      m_phaseAlignFlag;
-#endif
 #if O0223_PICTURE_TYPES_ALIGN_FLAG
   Bool      m_crossLayerPictureTypeAlignFlag;
Index: /branches/SHM-dev/source/App/TAppEncoder/TAppEncLayerCfg.cpp
===================================================================
--- /branches/SHM-dev/source/App/TAppEncoder/TAppEncLayerCfg.cpp	(revision 1089)
+++ /branches/SHM-dev/source/App/TAppEncoder/TAppEncLayerCfg.cpp	(revision 1090)
@@ -72,5 +72,4 @@
   ::memset(m_scaledRefLayerRightOffset,  0, sizeof(m_scaledRefLayerRightOffset));
   ::memset(m_scaledRefLayerBottomOffset, 0, sizeof(m_scaledRefLayerBottomOffset));
-#if REF_REGION_OFFSET
   ::memset(m_scaledRefLayerOffsetPresentFlag, 0, sizeof(m_scaledRefLayerOffsetPresentFlag));
   ::memset(m_refRegionOffsetPresentFlag, 0, sizeof(m_refRegionOffsetPresentFlag));
@@ -79,6 +78,4 @@
   ::memset(m_refRegionRightOffset,  0, sizeof(m_refRegionRightOffset));
   ::memset(m_refRegionBottomOffset, 0, sizeof(m_refRegionBottomOffset));
-#endif
-#if R0209_GENERIC_PHASE
   ::memset(m_resamplePhaseSetPresentFlag, 0, sizeof(m_resamplePhaseSetPresentFlag));
   ::memset(m_phaseHorLuma,   0, sizeof(m_phaseHorLuma));
@@ -86,9 +83,4 @@
   ::memset(m_phaseHorChroma, 0, sizeof(m_phaseHorChroma));
   ::memset(m_phaseVerChroma, 0, sizeof(m_phaseVerChroma));
-#else
-#if P0312_VERT_PHASE_ADJ 
-  ::memset(m_vertPhasePositionEnableFlag, 0, sizeof(m_vertPhasePositionEnableFlag));
-#endif
-#endif
 }
 
Index: /branches/SHM-dev/source/App/TAppEncoder/TAppEncLayerCfg.h
===================================================================
--- /branches/SHM-dev/source/App/TAppEncoder/TAppEncLayerCfg.h	(revision 1089)
+++ /branches/SHM-dev/source/App/TAppEncoder/TAppEncLayerCfg.h	(revision 1090)
@@ -101,5 +101,4 @@
   Int       m_scaledRefLayerRightOffset [MAX_LAYERS];
   Int       m_scaledRefLayerBottomOffset[MAX_LAYERS];
-#if REF_REGION_OFFSET
   Bool      m_scaledRefLayerOffsetPresentFlag [MAX_LAYERS];
   Bool      m_refRegionOffsetPresentFlag      [MAX_LAYERS];
@@ -108,9 +107,4 @@
   Int       m_refRegionRightOffset [MAX_LAYERS];
   Int       m_refRegionBottomOffset[MAX_LAYERS];
-#endif
-#if P0312_VERT_PHASE_ADJ
-  Bool      m_vertPhasePositionEnableFlag[MAX_LAYERS];
-#endif
-#if R0209_GENERIC_PHASE
   Int       m_phaseHorLuma  [MAX_LAYERS];
   Int       m_phaseVerLuma  [MAX_LAYERS];
@@ -118,5 +112,4 @@
   Int       m_phaseVerChroma[MAX_LAYERS];
   Bool      m_resamplePhaseSetPresentFlag [MAX_LAYERS];
-#endif
 
   Int       m_inputBitDepth   [MAX_NUM_CHANNEL_TYPE];         ///< bit-depth of input file
Index: /branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp
===================================================================
--- /branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp	(revision 1089)
+++ /branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp	(revision 1090)
@@ -769,5 +769,4 @@
     if( layer > 0 )
     {
-#if REF_REGION_OFFSET
 #if AUXILIARY_PICTURES
       Int subWidthC  = ( m_acLayerCfg[layer].m_chromaFormatIDC == CHROMA_420 || m_acLayerCfg[layer].m_chromaFormatIDC == CHROMA_422 ) ? 2 : 1;
@@ -777,5 +776,4 @@
       Int subHeightC = 2;
 #endif
-#endif
       m_acTEncTop[layer].setNumRefLayerLocationOffsets          ( m_acLayerCfg[layer].m_numRefLayerLocationOffsets );
       for(Int i = 0; i < m_acLayerCfg[layer].m_numRefLayerLocationOffsets; i++)
@@ -784,18 +782,8 @@
         m_acTEncTop[layer].setRefLocationOffsetLayerId          (i, m_acLayerCfg[layer].m_refLocationOffsetLayerId[i]);
 #endif
-#if REF_REGION_OFFSET
         m_acTEncTop[layer].setScaledRefLayerOffsetPresentFlag   ( i, m_acLayerCfg[layer].m_scaledRefLayerOffsetPresentFlag[i] );
         m_acTEncTop[layer].getScaledRefLayerWindow(i).setWindow ( subWidthC  * m_acLayerCfg[layer].m_scaledRefLayerLeftOffset[i], subWidthC  * m_acLayerCfg[layer].m_scaledRefLayerRightOffset[i],
                                                                   subHeightC * m_acLayerCfg[layer].m_scaledRefLayerTopOffset[i],  subHeightC * m_acLayerCfg[layer].m_scaledRefLayerBottomOffset[i]);
-#else
-#if P0312_VERT_PHASE_ADJ
-        m_acTEncTop[layer].setVertPhasePositionEnableFlag       ( i, m_acLayerCfg[layer].m_vertPhasePositionEnableFlag[i] );
-        m_acTEncTop[layer].getScaledRefLayerWindow(i).setWindow ( 2*m_acLayerCfg[layer].m_scaledRefLayerLeftOffset[i], 2*m_acLayerCfg[layer].m_scaledRefLayerRightOffset[i],
-          2*m_acLayerCfg[layer].m_scaledRefLayerTopOffset[i], 2*m_acLayerCfg[layer].m_scaledRefLayerBottomOffset[i], m_acLayerCfg[layer].m_vertPhasePositionEnableFlag[i] );
-#else
-        m_acTEncTop[layer].getScaledRefLayerWindow(i).setWindow ( 2*m_acLayerCfg[layer].m_scaledRefLayerLeftOffset[i], 2*m_acLayerCfg[layer].m_scaledRefLayerRightOffset[i],
-          2*m_acLayerCfg[layer].m_scaledRefLayerTopOffset[i], 2*m_acLayerCfg[layer].m_scaledRefLayerBottomOffset[i]);
-#endif
-#endif
+
         Int rlSubWidthC  = ( m_acLayerCfg[i].m_chromaFormatIDC == CHROMA_420 || m_acLayerCfg[i].m_chromaFormatIDC == CHROMA_422 ) ? 2 : 1;
         Int rlSubHeightC = ( m_acLayerCfg[i].m_chromaFormatIDC == CHROMA_420 ) ? 2 : 1;
@@ -804,5 +792,4 @@
         m_acTEncTop[layer].getRefLayerWindow(i).setWindow       ( rlSubWidthC  * m_acLayerCfg[layer].m_refRegionLeftOffset[i], rlSubWidthC  * m_acLayerCfg[layer].m_refRegionRightOffset[i],
                                                                   rlSubHeightC * m_acLayerCfg[layer].m_refRegionTopOffset[i],  rlSubHeightC * m_acLayerCfg[layer].m_refRegionBottomOffset[i]);
-#if R0209_GENERIC_PHASE
         m_acTEncTop[layer].setResamplePhaseSetPresentFlag       ( i, m_acLayerCfg[layer].m_resamplePhaseSetPresentFlag[i] );
         m_acTEncTop[layer].setPhaseHorLuma                      ( i, m_acLayerCfg[layer].m_phaseHorLuma[i] );
@@ -810,5 +797,4 @@
         m_acTEncTop[layer].setPhaseHorChroma                    ( i, m_acLayerCfg[layer].m_phaseHorChroma[i] );
         m_acTEncTop[layer].setPhaseVerChroma                    ( i, m_acLayerCfg[layer].m_phaseVerChroma[i] );
-#endif
       }
     }
@@ -1846,8 +1832,4 @@
 #endif
 
-#if O0215_PHASE_ALIGNMENT
-  vps->setPhaseAlignFlag( m_phaseAlignFlag );
-#endif
-
 #if P0300_ALT_OUTPUT_LAYER_FLAG
   for (Int k = 0; k < MAX_VPS_LAYER_SETS_PLUS1; k++)
@@ -1859,20 +1841,4 @@
   vps->setAltOuputLayerFlag( m_altOutputLayerFlag );
 #endif
-#endif
-
-#if P0312_VERT_PHASE_ADJ
-  Bool vpsVuiVertPhaseInUseFlag = false;
-  for( UInt layerId = 1; layerId < m_numLayers; layerId++ )
-  {
-    for( i = 0; i < m_acLayerCfg[layerId].m_numScaledRefLayerOffsets; i++ )
-    {
-      if( m_acTEncTop[layerId].getVertPhasePositionEnableFlag(i) )
-      {
-        vpsVuiVertPhaseInUseFlag = true;
-        break;
-      }
-    }
-  }
-  vps->setVpsVuiVertPhaseInUseFlag( vpsVuiVertPhaseInUseFlag );
 #endif
 
Index: /branches/SHM-dev/source/Lib/TLibCommon/TComDataCU.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibCommon/TComDataCU.cpp	(revision 1089)
+++ /branches/SHM-dev/source/Lib/TLibCommon/TComDataCU.cpp	(revision 1090)
@@ -3428,5 +3428,4 @@
 #endif
 
-#if MOVE_SCALED_OFFSET_TO_PPS
 #if O0098_SCALED_REF_LAYER_ID
   Int leftStartL = m_pcSlice->getPPS()->getScaledRefLayerWindowForLayer(baseColPic->getSlice(0)->getVPS()->getRefLayerId(getSlice()->getLayerId(), refLayerIdc)).getWindowLeftOffset();
@@ -3436,28 +3435,8 @@
   Int topStartL  = baseColPic->getSlice(0)->getPPS()->getScaledRefLayerWindow(refLayerIdc).getWindowTopOffset();
 #endif
-#else
-#if O0098_SCALED_REF_LAYER_ID
-  Int leftStartL = baseColPic->getSlice(0)->getSPS()->getScaledRefLayerWindowForLayer(baseColPic->getSlice(0)->getVPS()->getRefLayerId(getSlice()->getLayerId(), refLayerIdc)).getWindowLeftOffset();
-  Int topStartL  = baseColPic->getSlice(0)->getSPS()->getScaledRefLayerWindowForLayer(baseColPic->getSlice(0)->getVPS()->getRefLayerId(getSlice()->getLayerId(), refLayerIdc)).getWindowTopOffset();
-#else
-  Int leftStartL = baseColPic->getSlice(0)->getSPS()->getScaledRefLayerWindow(refLayerIdc).getWindowLeftOffset();
-  Int topStartL  = baseColPic->getSlice(0)->getSPS()->getScaledRefLayerWindow(refLayerIdc).getWindowTopOffset();
-#endif
-#endif
-
-#if REF_REGION_OFFSET
+
   const Window &windowRL = m_pcSlice->getPPS()->getRefLayerWindowForLayer(baseColPic->getSlice(0)->getVPS()->getRefLayerId(getSlice()->getLayerId(), refLayerIdc));
   Int iBX = (((iPelX - leftStartL)*g_posScalingFactor[refLayerIdc][0] + (1<<15)) >> 16) + windowRL.getWindowLeftOffset();
   Int iBY = (((iPelY - topStartL )*g_posScalingFactor[refLayerIdc][1] + (1<<15)) >> 16) + windowRL.getWindowTopOffset();
-#else
-#if Q0200_CONFORMANCE_BL_SIZE
-  Int chromaFormatIdc = baseColPic->getSlice(0)->getChromaFormatIdc();
-  Int iBX = (((iPelX - leftStartL)*g_posScalingFactor[refLayerIdc][0] + (1<<15)) >> 16) + baseColPic->getConformanceWindow().getWindowLeftOffset() * TComSPS::getWinUnitX( chromaFormatIdc );
-  Int iBY = (((iPelY - topStartL )*g_posScalingFactor[refLayerIdc][1] + (1<<15)) >> 16) + baseColPic->getConformanceWindow().getWindowTopOffset() * TComSPS::getWinUnitY( chromaFormatIdc );
-#else
-  Int iBX = ((iPelX - leftStartL)*g_posScalingFactor[refLayerIdc][0] + (1<<15)) >> 16;
-  Int iBY = ((iPelY - topStartL )*g_posScalingFactor[refLayerIdc][1] + (1<<15)) >> 16;
-#endif
-#endif
 
 #if REF_IDX_MFM
Index: /branches/SHM-dev/source/Lib/TLibCommon/TComPrediction.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibCommon/TComPrediction.cpp	(revision 1089)
+++ /branches/SHM-dev/source/Lib/TLibCommon/TComPrediction.cpp	(revision 1090)
@@ -860,43 +860,8 @@
 
 #if SVC_EXTENSION
-#if O0215_PHASE_ALIGNMENT_REMOVAL
 Void TComPrediction::upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic )
 {
   m_cUsf.upsampleBasePic( currSlice, refLayerIdc, pcUsPic, pcBasePic, pcTempPic );
 }
-#else
-#if O0215_PHASE_ALIGNMENT
-#if O0194_JOINT_US_BITSHIFT
-Void TComPrediction::upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, Bool phaseAlignFlag )
-{
-  m_cUsf.upsampleBasePic( currSlice, refLayerIdc, pcUsPic, pcBasePic, pcTempPic, phaseAlignFlag );
-}
-#else
-Void TComPrediction::upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, Bool phaseAlignFlag )
-{
-  m_cUsf.upsampleBasePic( refLayerIdc, pcUsPic, pcBasePic, pcTempPic, window, phaseAlignFlag );
-}
-#endif
-#else
-#if O0194_JOINT_US_BITSHIFT
-#if REF_REGION_OFFSET
-Void TComPrediction::upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, const Window altRefWindow )
-{
-  m_cUsf.upsampleBasePic( refLayerIdc, pcUsPic, pcBasePic, pcTempPic, window, altRefWindow );
-}
-#else
-Void TComPrediction::upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window)
-{
-  m_cUsf.upsampleBasePic( refLayerIdc, pcUsPic, pcBasePic, pcTempPic, window);
-}
-#endif
-#else
-Void TComPrediction::upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window)
-{
-  m_cUsf.upsampleBasePic( refLayerIdc, pcUsPic, pcBasePic, pcTempPic, window);
-}
-#endif
-#endif
-#endif
 #endif //SVC_EXTENSION
 //! \}
Index: /branches/SHM-dev/source/Lib/TLibCommon/TComPrediction.h
===================================================================
--- /branches/SHM-dev/source/Lib/TLibCommon/TComPrediction.h	(revision 1089)
+++ /branches/SHM-dev/source/Lib/TLibCommon/TComPrediction.h	(revision 1090)
@@ -146,25 +146,5 @@
 
 #if SVC_EXTENSION
-#if O0215_PHASE_ALIGNMENT_REMOVAL
 Void upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic );
-#else
-#if O0215_PHASE_ALIGNMENT
-#if O0194_JOINT_US_BITSHIFT
-  Void upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, Bool phaseAlignFlag );
-#else
-  Void upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, Bool phaseAlignFlag );
-#endif
-#else
-#if O0194_JOINT_US_BITSHIFT
-#if REF_REGION_OFFSET
-  Void upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, const Window altRefWindow );
-#else
-  Void upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window );
-#endif
-#else
-  Void upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window );
-#endif
-#endif
-#endif
 #endif //SVC_EXTENSION
 };
Index: /branches/SHM-dev/source/Lib/TLibCommon/TComSlice.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibCommon/TComSlice.cpp	(revision 1089)
+++ /branches/SHM-dev/source/Lib/TLibCommon/TComSlice.cpp	(revision 1090)
@@ -159,7 +159,4 @@
   m_interLayerPredEnabledFlag = 0;
   ::memset( m_interLayerPredLayerIdc, 0, sizeof(m_interLayerPredLayerIdc) );
-#if P0312_VERT_PHASE_ADJ
-  ::memset( m_vertPhasePositionFlag, 0, sizeof(m_vertPhasePositionFlag) );
-#endif
 #endif //SVC_EXTENSION
 
@@ -535,16 +532,8 @@
         UInt refLayerId = m_pcVPS->getRefLayerId( m_layerId, refLayerIdc );
 #if RESAMPLING_CONSTRAINT_BUG_FIX
-#if MOVE_SCALED_OFFSET_TO_PPS
 #if O0098_SCALED_REF_LAYER_ID
         const Window &scalEL = getPPS()->getScaledRefLayerWindowForLayer(refLayerId);
 #else
         const Window &scalEL = getPPS()->getScaledRefLayerWindow(m_interLayerPredLayerIdc[i]);
-#endif
-#else
-#if O0098_SCALED_REF_LAYER_ID
-        const Window &scalEL = getSPS()->getScaledRefLayerWindowForLayer(refLayerId);
-#else
-        const Window &scalEL = getSPS()->getScaledRefLayerWindow(m_interLayerPredLayerIdc[i]);
-#endif
 #endif
         Int scalingOffset = ((scalEL.getWindowLeftOffset()   == 0 ) && 
@@ -1099,7 +1088,4 @@
   m_interLayerPredEnabledFlag  = pSrc->m_interLayerPredEnabledFlag;
   memcpy( m_interLayerPredLayerIdc, pSrc->m_interLayerPredLayerIdc, sizeof( m_interLayerPredLayerIdc ) );
-#if P0312_VERT_PHASE_ADJ
-  memcpy( m_vertPhasePositionFlag, pSrc->m_vertPhasePositionFlag, sizeof( m_vertPhasePositionFlag ) );
-#endif
 #endif
   m_pcSPS                = pSrc->m_pcSPS;
@@ -2260,7 +2246,4 @@
 , m_layerId                   ( 0 )
 , m_extensionFlag             ( false )
-#if !MOVE_SCALED_OFFSET_TO_PPS
-, m_numScaledRefLayerOffsets  ( 0 )
-#endif
 #if REPN_FORMAT_IN_VPS
 , m_updateRepFormatFlag       (false)
@@ -2297,10 +2280,4 @@
   ::memset(m_ltRefPicPocLsbSps, 0, sizeof(m_ltRefPicPocLsbSps));
   ::memset(m_usedByCurrPicLtSPSFlag, 0, sizeof(m_usedByCurrPicLtSPSFlag));
-
-#if !MOVE_SCALED_OFFSET_TO_PPS
-#if P0312_VERT_PHASE_ADJ 
-  ::memset(m_vertPhasePositionEnableFlag, 0, sizeof(m_vertPhasePositionEnableFlag));
-#endif
-#endif
 }
 
@@ -2434,41 +2411,4 @@
 const Int TComSPS::m_winUnitX[]={1,2,2,1};
 const Int TComSPS::m_winUnitY[]={1,2,1,1};
-
-#if !MOVE_SCALED_OFFSET_TO_PPS
-#if O0098_SCALED_REF_LAYER_ID
-Window& TComSPS::getScaledRefLayerWindowForLayer(Int layerId)
-{
-  static Window win;
-
-  for (Int i = 0; i < m_numScaledRefLayerOffsets; i++)
-  {
-    if (layerId == m_scaledRefLayerId[i])
-    {
-      return m_scaledRefLayerWindow[i];
-    }
-  }
-
-  win.resetWindow();  // scaled reference layer offsets are inferred to be zero when not present
-  return win;
-}
-#endif
-#if REF_REGION_OFFSET
-Window& TComSPS::getRefLayerWindowForLayer(Int layerId)
-{
-  static Window win;
-
-  for (Int i = 0; i < m_numRefLayerOffsets; i++)
-  {
-    if (layerId == m_refLayerId[i])
-    {
-      return m_refLayerWindow[i];
-    }
-  }
-
-  win.resetWindow();  // reference region offsets are inferred to be zero when not present
-  return win;
-}
-#endif
-#endif
 
 TComPPS::TComPPS()
@@ -2519,7 +2459,5 @@
 , m_pocResetInfoPresentFlag   (false)
 #endif
-#if MOVE_SCALED_OFFSET_TO_PPS
 , m_numRefLayerLocationOffsets  ( 0 )
-#endif
 #if Q0048_CGS_3D_ASYMLUT
 , m_nCGSFlag(0)
@@ -2538,9 +2476,6 @@
 
 #if SVC_EXTENSION
-#if REF_REGION_OFFSET
   ::memset(m_scaledRefLayerOffsetPresentFlag,   0, sizeof(m_scaledRefLayerOffsetPresentFlag));
   ::memset(m_refRegionOffsetPresentFlag,   0, sizeof(m_refRegionOffsetPresentFlag));
-#endif
-#if R0209_GENERIC_PHASE
   ::memset(m_resamplePhaseSetPresentFlag,   0, sizeof(m_resamplePhaseSetPresentFlag));
   ::memset(m_phaseHorLuma,   0, sizeof(m_phaseHorLuma));
@@ -2548,5 +2483,4 @@
   ::memset(m_phaseHorChroma, 0, sizeof(m_phaseHorChroma));
   ::memset(m_phaseVerChroma, 0, sizeof(m_phaseVerChroma));
-#endif
 #endif //SVC_EXTENSION
 }
@@ -3210,5 +3144,4 @@
 #endif
 
-#if MOVE_SCALED_OFFSET_TO_PPS
 #if O0098_SCALED_REF_LAYER_ID
 Window& TComPPS::getScaledRefLayerWindowForLayer(Int layerId)
@@ -3228,5 +3161,6 @@
 }
 #endif
-#if REF_REGION_OFFSET
+
+#if SVC_EXTENSION
 Window& TComPPS::getRefLayerWindowForLayer(Int layerId)
 {
@@ -3244,8 +3178,5 @@
   return win;
 }
-#endif
-
-#if RESAMPLING_FIX
-#if R0209_GENERIC_PHASE
+
 Bool TComPPS::hasZeroResamplingPhase(Int refLayerId)
 {
@@ -3278,8 +3209,4 @@
 }
 #endif
-#endif
-
-#endif
-
 
 #if DERIVE_LAYER_ID_LIST_VARIABLES
Index: /branches/SHM-dev/source/Lib/TLibCommon/TComSlice.h
===================================================================
--- /branches/SHM-dev/source/Lib/TLibCommon/TComSlice.h	(revision 1089)
+++ /branches/SHM-dev/source/Lib/TLibCommon/TComSlice.h	(revision 1090)
@@ -467,7 +467,5 @@
   Int           m_winTopOffset;
   Int           m_winBottomOffset;
-#if P0312_VERT_PHASE_ADJ
-  Bool          m_vertPhasePositionEnableFlag;
-#endif
+
 public:
   Window()
@@ -477,15 +475,8 @@
   , m_winTopOffset      (0)
   , m_winBottomOffset   (0)
-#if P0312_VERT_PHASE_ADJ
-  , m_vertPhasePositionEnableFlag(false)  
-#endif
   { }
 
   Bool          getWindowEnabledFlag() const      { return m_enabledFlag; }
-#if P0312_VERT_PHASE_ADJ
-  Void          resetWindow()                     { m_enabledFlag = false; m_winLeftOffset = m_winRightOffset = m_winTopOffset = m_winBottomOffset = 0; m_vertPhasePositionEnableFlag = false; } 
-#else
   Void          resetWindow()                     { m_enabledFlag = false; m_winLeftOffset = m_winRightOffset = m_winTopOffset = m_winBottomOffset = 0; }
-#endif
   Int           getWindowLeftOffset() const       { return m_enabledFlag ? m_winLeftOffset : 0; }
   Void          setWindowLeftOffset(Int val)      { m_winLeftOffset = val; m_enabledFlag = true; }
@@ -497,9 +488,5 @@
   Void          setWindowBottomOffset(Int val)    { m_winBottomOffset = val; m_enabledFlag = true; }
 
-#if P0312_VERT_PHASE_ADJ
-  Bool          getVertPhasePositionEnableFlag() const     { return m_vertPhasePositionEnableFlag;  }
-  Void          setVertPhasePositionEnableFlag(Bool val)    { m_vertPhasePositionEnableFlag = val;  }
-#endif
-#if REF_REGION_OFFSET && RESAMPLING_FIX
+#if SVC_EXTENSION
   Bool          hasEqualOffset(const Window& ref) const
   {
@@ -511,9 +498,5 @@
 #endif
 
-#if P0312_VERT_PHASE_ADJ
-  Void          setWindow(Int offsetLeft, Int offsetLRight, Int offsetLTop, Int offsetLBottom, Bool vertPhasePositionEnableFlag = 0)
-#else
   Void          setWindow(Int offsetLeft, Int offsetLRight, Int offsetLTop, Int offsetLBottom)
-#endif
   {
     m_enabledFlag       = true;
@@ -522,8 +505,4 @@
     m_winTopOffset      = offsetLTop;
     m_winBottomOffset   = offsetLBottom;
-
-#if P0312_VERT_PHASE_ADJ
-    m_vertPhasePositionEnableFlag = vertPhasePositionEnableFlag;    
-#endif
   }
 };
@@ -797,8 +776,4 @@
   Int        m_constPicRateIdc     [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER];
   Int        m_avgPicRate          [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER];
-  
-#if P0312_VERT_PHASE_ADJ
-  Bool       m_vpsVuiVertPhaseInUseFlag;
-#endif
 
 #if P0300_ALT_OUTPUT_LAYER_FLAG
@@ -826,8 +801,4 @@
 #endif
   Int        m_viewIdVal                [MAX_LAYERS];
-#endif
-
-#if O0215_PHASE_ALIGNMENT
-  Bool       m_phaseAlignFlag;
 #endif
 
@@ -1348,9 +1319,4 @@
 #endif
 
-#if P0312_VERT_PHASE_ADJ
-  Bool   getVpsVuiVertPhaseInUseFlag()       { return m_vpsVuiVertPhaseInUseFlag; }
-  Void   setVpsVuiVertPhaseInUseFlag(Bool x) { m_vpsVuiVertPhaseInUseFlag = x;    }
-#endif
-
 #if P0300_ALT_OUTPUT_LAYER_FLAG
   Bool   getAltOuputLayerFlag(Int idx)         { return m_altOutputLayerFlag[idx]; }
@@ -1397,8 +1363,4 @@
   Void   setExtensionOffset( UInt offset )    { m_extensionOffset = offset; }
 #endif
-#endif
-#if O0215_PHASE_ALIGNMENT
-  Bool   getPhaseAlignFlag()                             { return m_phaseAlignFlag; }
-  Void   setPhaseAlignFlag(Bool x)                       { m_phaseAlignFlag = x;    }
 #endif
 #if VPS_DPB_SIZE_TABLE
@@ -1727,13 +1689,4 @@
   Int         m_NumDirectRefLayers;
 #endif
-#if P0312_VERT_PHASE_ADJ
- Bool         m_vertPhasePositionEnableFlag[MAX_LAYERS];
-#endif
-#if !MOVE_SCALED_OFFSET_TO_PPS
-#if O0098_SCALED_REF_LAYER_ID
-  UInt        m_scaledRefLayerId[MAX_LAYERS];
-#endif
-  Window      m_scaledRefLayerWindow[MAX_LAYERS];
-#endif
 #if REPN_FORMAT_IN_VPS
   Bool m_updateRepFormatFlag;
@@ -1912,18 +1865,4 @@
   Void     setNumDirectRefLayers(Int n)             {  m_NumDirectRefLayers = n;     }
 #endif
-#if !MOVE_SCALED_OFFSET_TO_PPS
-  UInt     getNumScaledRefLayerOffsets()       { return m_numScaledRefLayerOffsets; }
-  Void     setNumScaledRefLayerOffsets(Int x)  { m_numScaledRefLayerOffsets = x;    }
-#if P0312_VERT_PHASE_ADJ
-  Bool     getVertPhasePositionEnableFlag(Int x)          { return m_vertPhasePositionEnableFlag[x]; }
-  Void     setVertPhasePositionEnableFlag(Int x, Bool b)  { m_vertPhasePositionEnableFlag[x] = b;    } 
-#endif
-#if O0098_SCALED_REF_LAYER_ID
-  UInt     getScaledRefLayerId(Int x)          { return m_scaledRefLayerId[x]; }
-  Void     setScaledRefLayerId(Int x, UInt id) { m_scaledRefLayerId[x] = id;   }
-  Window&  getScaledRefLayerWindowForLayer( Int layerId );
-#endif
-  Window&  getScaledRefLayerWindow( Int x )   { return m_scaledRefLayerWindow[x]; }
-#endif
 #if REPN_FORMAT_IN_VPS
   Bool     getUpdateRepFormatFlag()       { return m_updateRepFormatFlag; }
@@ -2047,5 +1986,4 @@
   Bool     m_pocResetInfoPresentFlag;
 #endif
-#if MOVE_SCALED_OFFSET_TO_PPS
   UInt     m_numRefLayerLocationOffsets;
 #if O0098_SCALED_REF_LAYER_ID
@@ -2053,10 +1991,7 @@
 #endif
   Window   m_scaledRefLayerWindow[MAX_LAYERS];
-#if REF_REGION_OFFSET
   Window   m_refLayerWindow[MAX_LAYERS];
   Bool     m_scaledRefLayerOffsetPresentFlag[MAX_LAYERS];
   Bool     m_refRegionOffsetPresentFlag[MAX_LAYERS];
-#endif
-#if R0209_GENERIC_PHASE
   Int      m_phaseHorLuma[MAX_LAYERS];
   Int      m_phaseVerLuma[MAX_LAYERS];
@@ -2064,6 +1999,4 @@
   Int      m_phaseVerChroma[MAX_LAYERS];
   Bool     m_resamplePhaseSetPresentFlag[MAX_LAYERS];
-#endif
-#endif
 #if Q0048_CGS_3D_ASYMLUT
   Int      m_nCGSFlag;
@@ -2215,5 +2148,4 @@
   Void setPocResetInfoPresentFlag   (const Bool val)      { m_pocResetInfoPresentFlag = val; }
 #endif
-#if MOVE_SCALED_OFFSET_TO_PPS
   UInt     getNumRefLayerLocationOffsets()       { return m_numRefLayerLocationOffsets; }
   Void     setNumRefLayerLocationOffsets(Int x)  { m_numRefLayerLocationOffsets = x;    }
@@ -2224,5 +2156,4 @@
 #endif
   Window&  getScaledRefLayerWindow( Int x )   { return m_scaledRefLayerWindow[x]; }
-#if REF_REGION_OFFSET
   Window&  getRefLayerWindowForLayer( Int layerId );
   Window&  getRefLayerWindow( Int x )   { return m_refLayerWindow[x]; }
@@ -2231,6 +2162,4 @@
   Bool getRefRegionOffsetPresentFlag(Int x) { return m_refRegionOffsetPresentFlag[x]; }
   Void setRefRegionOffsetPresentFlag(Int x, Bool b) { m_refRegionOffsetPresentFlag[x] = b; }
-#endif
-#if R0209_GENERIC_PHASE
   Int getPhaseHorLuma(Int x) { return m_phaseHorLuma[x]; }
   Int getPhaseVerLuma(Int x) { return m_phaseVerLuma[x]; }
@@ -2243,10 +2172,6 @@
   Bool getResamplePhaseSetPresentFlag(Int x) { return m_resamplePhaseSetPresentFlag[x]; }
   Void setResamplePhaseSetPresentFlag(Int x, Bool b) { m_resamplePhaseSetPresentFlag[x] = b; }
-#if RESAMPLING_FIX
   Bool hasZeroResamplingPhase(Int refLayerId);
   Void getResamplingPhase(Int refLayerId, Bool& phaseSetPresentFlag, Int& phaseHorLuma, Int& phaseVerLuma, Int& phaseHorChroma, Int& phaseVerChroma);
-#endif
-#endif
-#endif
 #if Q0048_CGS_3D_ASYMLUT
   Int     getCGSFlag()                { return m_nCGSFlag;  }
@@ -2405,7 +2330,4 @@
   Int         m_activeNumILRRefIdx;        //< Active inter-layer reference pictures
   Int         m_interLayerPredLayerIdc  [MAX_VPS_LAYER_IDX_PLUS1];
-#if P0312_VERT_PHASE_ADJ
-  Bool        m_vertPhasePositionFlag[MAX_VPS_LAYER_IDX_PLUS1];
-#endif
 #if POC_RESET_FLAG
   Bool        m_bPocResetFlag;
@@ -2723,9 +2645,4 @@
   Bool      getInterLayerPredEnabledFlag     ()                { return m_interLayerPredEnabledFlag;}
 
-#if P0312_VERT_PHASE_ADJ
-  Int       getVertPhasePositionFlag (UInt layerIdx)              { return   m_vertPhasePositionFlag[layerIdx];}
-  Void      setVertPhasePositionFlag (Bool b, UInt layerIdx)      {  m_vertPhasePositionFlag[layerIdx] = b;  }
-#endif
-
   Void      setNumMotionPredRefLayers(int i)            { m_numMotionPredRefLayers = i; }
   Int       getNumMotionPredRefLayers()                 { return m_numMotionPredRefLayers; }
Index: /branches/SHM-dev/source/Lib/TLibCommon/TComUpsampleFilter.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibCommon/TComUpsampleFilter.cpp	(revision 1089)
+++ /branches/SHM-dev/source/Lib/TLibCommon/TComUpsampleFilter.cpp	(revision 1090)
@@ -51,25 +51,5 @@
 }
 
-#if O0215_PHASE_ALIGNMENT_REMOVAL
 Void TComUpsampleFilter::upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic )
-#else
-#if O0215_PHASE_ALIGNMENT
-#if O0194_JOINT_US_BITSHIFT
-Void TComUpsampleFilter::upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, Bool phaseAlignFlag )
-#else
-Void TComUpsampleFilter::upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, Bool phaseAlignFlag )
-#endif
-#else
-#if O0194_JOINT_US_BITSHIFT
-#if REF_REGION_OFFSET
-Void TComUpsampleFilter::upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, const Window altRefWindow )
-#else
-Void TComUpsampleFilter::upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window )
-#endif
-#else
-Void TComUpsampleFilter::upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window )
-#endif
-#endif
-#endif
 {
   assert ( NTAPS_US_LUMA == 8 );
@@ -83,5 +63,4 @@
 #endif
 
-#if MOVE_SCALED_OFFSET_TO_PPS
 #if O0098_SCALED_REF_LAYER_ID
   const Window &scalEL = currSlice->getPPS()->getScaledRefLayerWindowForLayer(refLayerId);
@@ -89,14 +68,5 @@
   const Window &scalEL = currSlice->getPPS()->getScaledRefLayerWindow(refLayerIdc);
 #endif
-#if REF_REGION_OFFSET
   const Window &windowRL = currSlice->getPPS()->getRefLayerWindowForLayer(refLayerId);
-#endif
-#else
-#if O0098_SCALED_REF_LAYER_ID
-  const Window &scalEL = currSlice->getSPS()->getScaledRefLayerWindowForLayer(refLayerId);
-#else
-  const Window &scalEL = currSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc);
-#endif
-#endif
 
   //========== Y component upsampling ===========
@@ -109,13 +79,7 @@
   Int strideEL  = pcUsPic->getStride(COMPONENT_Y);
 
-#if Q0200_CONFORMANCE_BL_SIZE
-  const Window &confBL = currSlice->getBaseColPic(refLayerIdc)->getConformanceWindow();
-#endif
-#if Q0200_CONFORMANCE_BL_SIZE || REF_REGION_OFFSET
   Int chromaFormatIdc = currSlice->getBaseColPic(refLayerIdc)->getSlice(0)->getChromaFormatIdc();
   Int xScal = TComSPS::getWinUnitX( chromaFormatIdc );
   Int yScal = TComSPS::getWinUnitY( chromaFormatIdc );
-#endif
-#if R0209_GENERIC_PHASE
   Bool phaseSetPresentFlag;
   Int phaseHorLuma, phaseVerLuma, phaseHorChroma, phaseVerChroma;  
@@ -127,13 +91,4 @@
     phaseVerChroma = (4 * heightEL + (refRegionHeight >> 1)) / refRegionHeight - 4;
   }
-#endif
-#if P0312_VERT_PHASE_ADJ
-  Bool vertPhasePositionEnableFlag = scalEL.getVertPhasePositionEnableFlag();
-  Bool vertPhasePositionFlag = currSlice->getVertPhasePositionFlag( refLayerIdc );
-  if( vertPhasePositionFlag )
-  {
-    assert( vertPhasePositionEnableFlag );
-  }
-#endif
 
   Pel* piTempBufY = pcTempPic->getAddr(COMPONENT_Y);
@@ -255,64 +210,10 @@
     Int   shiftY = 16;
 
-#if R0209_GENERIC_PHASE
     Int phaseX = phaseHorLuma;
     Int phaseY = phaseVerLuma;
     Int addX = ( ( phaseX * scaleX + 8 ) >> 4 ) -  (1 << ( shiftX - 5 ));
     Int addY = ( ( phaseY * scaleY + 8 ) >> 4 ) -  (1 << ( shiftX - 5 ));
-#if REF_REGION_OFFSET
     Int refOffsetX = windowRL.getWindowLeftOffset() << 4;
     Int refOffsetY = windowRL.getWindowTopOffset()  << 4;
-#else
-#if Q0200_CONFORMANCE_BL_SIZE
-    Int refOffsetX = ( confBL.getWindowLeftOffset() * xScal ) << 4;
-    Int refOffsetY = ( confBL.getWindowTopOffset()  * yScal ) << 4;
-#endif
-#endif
-#else
-#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
-    Int   phaseX = 2*phaseAlignFlag;
-#if P0312_VERT_PHASE_ADJ
-#if Q0120_PHASE_CALCULATION
-    Int   phaseY = 2*phaseAlignFlag;
-#else
-    Int   phaseY = vertPhasePositionEnableFlag ? ( vertPhasePositionFlag * 4 ) : ( 2 * phaseAlignFlag );
-#endif
-#else
-    Int   phaseY = 2*phaseAlignFlag;
-#endif
-#else
-    Int   phaseX = 0;
-#if P0312_VERT_PHASE_ADJ
-#if Q0120_PHASE_CALCULATION
-    Int   phaseY = 0;
-#else
-    Int   phaseY = (vertPhasePositionEnableFlag?(vertPhasePositionFlag *4):(0));
-#endif
-#else
-    Int   phaseY = 0;
-#endif
-#endif
- 
-    Int   addX = ( ( phaseX * scaleX + 2 ) >> 2 ) + ( 1 << ( shiftX - 5 ) );
-    Int   addY = ( ( phaseY * scaleY + 2 ) >> 2 ) + ( 1 << ( shiftY - 5 ) );
-
-#if Q0120_PHASE_CALCULATION
-    Int   deltaX = (Int)phaseAlignFlag <<3;
-    Int   deltaY = (((Int)phaseAlignFlag <<3)>>(Int)vertPhasePositionEnableFlag) + ((Int)vertPhasePositionFlag<<3);
-#else
-    Int   deltaX = 4 * phaseX;
-    Int   deltaY = 4 * phaseY;
-#endif
-
-#if REF_REGION_OFFSET
-    Int refOffsetX = windowRL.getWindowLeftOffset() << 4;
-    Int refOffsetY = windowRL.getWindowTopOffset() << 4;
-#else
-#if Q0200_CONFORMANCE_BL_SIZE
-    deltaX -= ( confBL.getWindowLeftOffset() * xScal ) << 4;
-    deltaY -= ( confBL.getWindowTopOffset() * yScal ) << 4;
-#endif
-#endif
-#endif
 
     Int shiftXM4 = shiftX - 4;
@@ -325,5 +226,4 @@
     heightBL = min<Int>( pcBasePic->getHeight( COMPONENT_Y ), heightEL );
 
-#if R0220_REMOVE_EL_CLIP
     Int phaseXL = scalEL.getWindowLeftOffset();
     Int phaseYL = scalEL.getWindowTopOffset();
@@ -332,11 +232,5 @@
     Int rlClipT = -(NTAPS_US_LUMA>>1);
     Int rlClipB = heightBL - 1 + (NTAPS_US_LUMA>>1);
-#else
-    Int leftStartL = scalEL.getWindowLeftOffset();
-    Int rightEndL  = pcUsPic->getWidth() - scalEL.getWindowRightOffset();
-    Int topStartL  = scalEL.getWindowTopOffset();
-    Int bottomEndL = pcUsPic->getHeight() - scalEL.getWindowBottomOffset();
-    Int leftOffset = leftStartL > 0 ? leftStartL : 0;
-#endif
+
 #if O0194_JOINT_US_BITSHIFT
     // g_bitDepthY was set to EL bit-depth, but shift1 should be calculated using BL bit-depth
@@ -355,28 +249,9 @@
     for( i = 0; i < widthEL; i++ )
     {
-#if R0220_REMOVE_EL_CLIP
       Int x = i;
-#if R0209_GENERIC_PHASE
       refPos16 = (((x - phaseXL)*scaleX - addX) >> shiftXM4) + refOffsetX;
-#else
-#if REF_REGION_OFFSET
-      refPos16 = (((x - phaseXL)*scaleX + addX) >> shiftXM4) - deltaX + refOffsetX;
-#else
-      refPos16 = (((x - phaseXL)*scaleX + addX) >> shiftXM4) - deltaX;
-#endif
-#endif
-#else
-      Int x = Clip3( leftStartL, rightEndL - 1, i );
-#if REF_REGION_OFFSET
-      refPos16 = (((x - leftStartL)*scaleX + addX) >> shiftXM4) - deltaX + refOffsetX;
-#else
-      refPos16 = (((x - leftStartL)*scaleX + addX) >> shiftXM4) - deltaX;
-#endif
-#endif
       phase    = refPos16 & 15;
       refPos   = refPos16 >> 4;
-#if R0220_REMOVE_EL_CLIP
       refPos   = Clip3( rlClipL, rlClipR, refPos );
-#endif
       coeff = m_lumaFilter[phase];
 
@@ -407,28 +282,9 @@
     for( j = 0; j < pcTempPic->getHeight(COMPONENT_Y); j++ )
     {
-#if R0220_REMOVE_EL_CLIP
       Int y = j;
-#if R0209_GENERIC_PHASE
       refPos16 = ((( y - phaseYL )*scaleY - addY) >> shiftYM4) + refOffsetY;
-#else
-#if REF_REGION_OFFSET
-      refPos16 = ((( y - phaseYL )*scaleY + addY) >> shiftYM4) - deltaY + refOffsetY;
-#else
-      refPos16 = ((( y - pahseYL )*scaleY + addY) >> shiftYM4) - deltaY;
-#endif
-#endif
-#else
-      Int y = Clip3(topStartL, bottomEndL - 1, j);
-#if REF_REGION_OFFSET
-      refPos16 = ((( y - topStartL )*scaleY + addY) >> shiftYM4) - deltaY + refOffsetY;
-#else
-      refPos16 = ((( y - topStartL )*scaleY + addY) >> shiftYM4) - deltaY;
-#endif
-#endif
       phase    = refPos16 & 15;
       refPos   = refPos16 >> 4;
-#if R0220_REMOVE_EL_CLIP
       refPos = Clip3( rlClipT, rlClipB, refPos );
-#endif
       coeff = m_lumaFilter[phase];
 
@@ -436,5 +292,4 @@
       Pel* piDstY0 = piDstBufY + j * strideEL;
 
-#if R0220_REMOVE_EL_CLIP
       piDstY = piDstY0;
 
@@ -445,28 +300,4 @@
         piDstY++;
       }
-#else
-      piDstY = piDstY0 + leftOffset;
-      piSrcY += leftOffset;
-
-      for( i = min<Int>(rightEndL, pcTempPic->getWidth()) - max<Int>(0, leftStartL); i > 0; i-- )
-      {
-        *piDstY = Clip( (sumLumaVer(piSrcY, coeff, strideEL) + iOffset) >> (nShift), CHANNEL_TYPE_LUMA );
-        piSrcY++;
-        piDstY++;
-      }
-
-      for( i = rightEndL; i < pcTempPic->getWidth(); i++ )
-      {
-        *piDstY = piDstY0[rightEndL-1];
-        piDstY++;
-      }
-
-      piDstY = piDstY0;
-      for( i = 0; i < leftStartL; i++ )
-      {
-        *piDstY = piDstY0[leftStartL];
-        piDstY++;
-      }
-#endif
     }
 
@@ -487,5 +318,4 @@
     strideEL  = pcUsPic->getStride( COMPONENT_Cb );
 
-#if R0220_REMOVE_EL_CLIP
     Int srlLOffsetC = scalEL.getWindowLeftOffset() >> 1;
     Int srlTOffsetC = scalEL.getWindowTopOffset() >> 1;
@@ -494,65 +324,11 @@
     rlClipT = -(NTAPS_US_CHROMA>>1);
     rlClipB = heightBL - 1 + (NTAPS_US_CHROMA>>1);
-#else
-    Int leftStartC = scalEL.getWindowLeftOffset() >> 1;
-    Int rightEndC  = (pcUsPic->getWidth() >> 1) - (scalEL.getWindowRightOffset() >> 1);
-    Int topStartC  = scalEL.getWindowTopOffset() >> 1;
-    Int bottomEndC = (pcUsPic->getHeight() >> 1) - (scalEL.getWindowBottomOffset() >> 1);
-    leftOffset = leftStartC > 0 ? leftStartC : 0;
-#endif
     shiftX = 16;
     shiftY = 16;
 
-#if R0209_GENERIC_PHASE
     addX = ( ( phaseHorChroma * scaleX + 8 ) >> 4 ) -  (1 << ( shiftX - 5 ));
     addY = ( ( phaseVerChroma * scaleY + 8 ) >> 4 ) -  (1 << ( shiftX - 5 ));
     Int refOffsetXC = (windowRL.getWindowLeftOffset() / xScal) << 4;
     Int refOffsetYC = (windowRL.getWindowTopOffset()  / yScal) << 4;
-#else
-#if O0215_PHASE_ALIGNMENT
-    Int phaseXC = phaseAlignFlag;
-#if P0312_VERT_PHASE_ADJ
-#if Q0120_PHASE_CALCULATION
-    Int phaseYC = phaseAlignFlag + 1;
-#else
-    Int phaseYC = vertPhasePositionEnableFlag ? ( vertPhasePositionFlag * 4 ) : ( phaseAlignFlag + 1 );
-#endif
-#else
-    Int phaseYC = phaseAlignFlag + 1;
-#endif
-#else
-    Int phaseXC = 0;
-#if P0312_VERT_PHASE_ADJ
-#if Q0120_PHASE_CALCULATION
-    Int phaseYC = 1;
-#else
-    Int phaseYC = vertPhasePositionEnableFlag ? (vertPhasePositionFlag * 4): 1;
-#endif
-#else
-    Int phaseYC = 1;
-#endif
-#endif
-    
-    addX       = ( ( phaseXC * scaleX + 2 ) >> 2 ) + ( 1 << ( shiftX - 5 ) );
-    addY       = ( ( phaseYC * scaleY + 2 ) >> 2 ) + ( 1 << ( shiftY - 5 ) );
-
-#if Q0120_PHASE_CALCULATION
-    deltaX     = (Int)phaseAlignFlag << 2;
-    deltaY     = ((( (Int)phaseAlignFlag +1)<<2)>>(Int)vertPhasePositionEnableFlag)+((Int)vertPhasePositionFlag<<3);
-#else
-    deltaX     = 4 * phaseXC;
-    deltaY     = 4 * phaseYC;
-#endif
-
-#if REF_REGION_OFFSET
-    Int refOffsetXC = (windowRL.getWindowLeftOffset() / xScal) << 4;
-    Int refOffsetYC  = (windowRL.getWindowTopOffset()  / yScal) << 4;
-#else
-#if Q0200_CONFORMANCE_BL_SIZE
-    deltaX -= ( ( confBL.getWindowLeftOffset() * xScal ) >> 1 ) << 4;
-    deltaY  -= ( ( confBL.getWindowTopOffset() * yScal ) >> 1 ) << 4;
-#endif
-#endif
-#endif
 
     shiftXM4 = shiftX - 4;
@@ -581,28 +357,9 @@
     for( i = 0; i < widthEL; i++ )
     {
-#if R0220_REMOVE_EL_CLIP
       Int x = i;
-#if R0209_GENERIC_PHASE
       refPos16 = (((x - srlLOffsetC)*scaleX - addX) >> shiftXM4) + refOffsetXC;
-#else
-#if REF_REGION_OFFSET
-      refPos16 = (((x - srlLOffsetC)*scaleX + addX) >> shiftXM4) - deltaX + refOffsetXC;
-#else
-      refPos16 = (((x - srlLOffsetC)*scaleX + addX) >> shiftXM4) - deltaX;
-#endif
-#endif
-#else
-      Int x = Clip3(leftStartC, rightEndC - 1, i);
-#if REF_REGION_OFFSET
-      refPos16 = (((x - leftStartC)*scaleX + addX) >> shiftXM4) - deltaX + refOffsetXC;
-#else
-      refPos16 = (((x - leftStartC)*scaleX + addX) >> shiftXM4) - deltaX;
-#endif
-#endif
       phase    = refPos16 & 15;
       refPos   = refPos16 >> 4;
-#if R0220_REMOVE_EL_CLIP
       refPos   = Clip3(rlClipL, rlClipR, refPos);
-#endif
       coeff = m_chromaFilter[phase];
 
@@ -639,28 +396,9 @@
     for( j = 0; j < pcTempPic->getHeight(COMPONENT_Y) >> 1; j++ )
     {
-#if R0220_REMOVE_EL_CLIP
       Int y = j;
-#if R0209_GENERIC_PHASE
       refPos16 = (((y - srlTOffsetC)*scaleY - addY) >> shiftYM4) + refOffsetYC;
-#else
-#if REF_REGION_OFFSET
-      refPos16 = (((y - srlTOffsetC)*scaleY + addY) >> shiftYM4) - deltaY + refOffsetYC;
-#else
-      refPos16 = (((y - srlTOffsetC)*scaleY + addY) >> shiftYM4) - deltaY;
-#endif
-#endif
-#else
-      Int y = Clip3(topStartC, bottomEndC - 1, j);
-#if REF_REGION_OFFSET
-      refPos16 = (((y - topStartC)*scaleY + addY) >> shiftYM4) - deltaY + refOffsetYC;
-#else
-      refPos16 = (((y - topStartC)*scaleY + addY) >> shiftYM4) - deltaY;
-#endif
-#endif
       phase    = refPos16 & 15;
       refPos   = refPos16 >> 4;
-#if R0220_REMOVE_EL_CLIP
       refPos = Clip3(rlClipT, rlClipB, refPos);
-#endif
       coeff = m_chromaFilter[phase];
 
@@ -671,5 +409,4 @@
       Pel* piDstV0 = piDstBufV + j*strideEL;
 
-#if R0220_REMOVE_EL_CLIP
       piDstU = piDstU0;
       piDstV = piDstV0;
@@ -684,39 +421,4 @@
         piDstV++;
       }
-#else
-      piDstU = piDstU0 + leftOffset;
-      piDstV = piDstV0 + leftOffset;
-      piSrcU += leftOffset;
-      piSrcV += leftOffset;
-
-      for( i = min<Int>(rightEndC, pcTempPic->getWidth() >> 1) - max<Int>(0, leftStartC); i > 0; i-- )
-      {
-        *piDstU = Clip( (sumChromaVer(piSrcU, coeff, strideEL) + iOffset) >> (nShift), CHANNEL_TYPE_CHROMA );
-        *piDstV = Clip( (sumChromaVer(piSrcV, coeff, strideEL) + iOffset) >> (nShift), CHANNEL_TYPE_CHROMA );
-        piSrcU++;
-        piSrcV++;
-        piDstU++;
-        piDstV++;
-      }
-
-      for( i = rightEndC; i < pcTempPic->getWidth(COMPONENT_Y) >> 1; i++ )
-      {
-        *piDstU = piDstU0[rightEndC-1];
-        *piDstV = piDstV0[rightEndC-1];
-        piDstU++;
-        piDstV++;
-      }
-
-      piDstU = piDstU0;
-      piDstV = piDstV0;
-      for( i = 0; i < leftStartC; i++ )
-      {
-        *piDstU = piDstU0[leftStartC];
-        *piDstV = piDstV0[leftStartC];
-        piDstU++;
-        piDstV++;
-      }
-#endif
-
     }
   }
Index: /branches/SHM-dev/source/Lib/TLibCommon/TComUpsampleFilter.h
===================================================================
--- /branches/SHM-dev/source/Lib/TLibCommon/TComUpsampleFilter.h	(revision 1089)
+++ /branches/SHM-dev/source/Lib/TLibCommon/TComUpsampleFilter.h	(revision 1090)
@@ -42,25 +42,5 @@
   TComUpsampleFilter(void);
   ~TComUpsampleFilter(void);
-#if O0215_PHASE_ALIGNMENT_REMOVAL
   Void upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic );
-#else
-#if O0215_PHASE_ALIGNMENT
-#if O0194_JOINT_US_BITSHIFT
-  Void upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, Bool phaseAlignFlag );
-#else
-  Void upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, Bool phaseAlignFlag );
-#endif
-#else
-#if O0194_JOINT_US_BITSHIFT
-#if REF_REGION_OFFSET
-  Void upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, const Window altRefWindow );
-#else
-  Void upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window );
-#endif
-#else
-  Void upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window );
-#endif
-#endif
-#endif
 
 };
Index: /branches/SHM-dev/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- /branches/SHM-dev/source/Lib/TLibCommon/TypeDef.h	(revision 1089)
+++ /branches/SHM-dev/source/Lib/TLibCommon/TypeDef.h	(revision 1090)
@@ -45,5 +45,4 @@
 #if SVC_EXTENSION
 #define MAX_LAYERS                       8      ///< max number of layers the codec is supposed to handle
-#define O0215_PHASE_ALIGNMENT_REMOVAL    1
 #define CONFORMANCE_BITSTREAM_MODE       1      ///< In order to generate the metadata related to conformance bitstreams
 #define FIX_CONF_MODE                    1
@@ -217,7 +216,4 @@
 #define VIEW_ID_RELATED_SIGNALING        1      ///< Introduce syntax elements view_id and view_id_val
 #define N0065_LAYER_POC_ALIGNMENT        1
-#if !O0215_PHASE_ALIGNMENT_REMOVAL
-#define O0215_PHASE_ALIGNMENT            1      ///< JCTVC_O0215: signal a flag to specify phase alignment case, 0: zero-position-aligned, 1: central-position-aligned,
-#endif
 #define AUXILIARY_PICTURES               1      ///< JCTVC-O0041: auxiliary picture layers
 #define R0062_AUX_PSEUDO_MONOCHROME      1      ///> JCVVC-R0063: pseudo monochrome for auxiliary pictures
@@ -277,19 +273,4 @@
 #define OLS_IDX_CHK                      1      ///< JCTVC-R0155: Proposal 2 valid range for output_layer_set_idx_to_vps[i]
 #define R0340_RESAMPLING_MODIFICATION    1      ///< JCTVC-R0340: set of changes regarding resampling (as listed below)
-#if R0340_RESAMPLING_MODIFICATION
-#define MOVE_SCALED_OFFSET_TO_PPS        1      ///< JCTVC-R0013: move scaled reference layer offset from SPS to PPS
-#if MOVE_SCALED_OFFSET_TO_PPS
-#define REF_REGION_OFFSET                1      ///< JCTVC-Q0159/R0220: reference region offset
-#define R0209_GENERIC_PHASE              1      ///< JCTVC-R0209: resampling with generic phase
-#define R0220_REMOVE_EL_CLIP             1      ///< JCTVC-R0220: remove clip to scaled ref window in resampling process
-#define RESAMPLING_FIX                   1      ///< Resampling fix -- equal offset check and conformance check
-#endif
-#else
-#define Q0200_CONFORMANCE_BL_SIZE        1      ///< JCTVC-Q0200; use conformance picture size in re-sampling processs
-#define P0312_VERT_PHASE_ADJ             1      ///< JCTVC-P0312: vertical phase adjustment in re-sampling process (BoG report)
-#if P0312_VERT_PHASE_ADJ
-#define Q0120_PHASE_CALCULATION          1      ///< JCTVC-Q0120 phase offset derivation for combination of spatial scalibility and field coding.
-#endif
-#endif
 #define R0157_RESTRICT_PPSID_FOR_CGS_LUT 1      ///< JCTVC-R0157: when pps_pic_parameter_set_id greater than or equal to 8, colour_mapping_enabled_flag shall be equal to 0
 
Index: /branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 1089)
+++ /branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 1090)
@@ -411,5 +411,4 @@
 #endif
 
-#if REF_REGION_OFFSET
             READ_UVLC( uiCode,      "num_ref_loc_offsets" ); pcPPS->setNumRefLayerLocationOffsets(uiCode);
             for(Int k = 0; k < pcPPS->getNumRefLayerLocationOffsets(); k++)
@@ -424,7 +423,4 @@
                 READ_SVLC( iCode, "scaled_ref_layer_right_offset" );   scaledWindow.setWindowRightOffset (iCode << 1);
                 READ_SVLC( iCode, "scaled_ref_layer_bottom_offset" );  scaledWindow.setWindowBottomOffset(iCode << 1);
-#if P0312_VERT_PHASE_ADJ
-                READ_FLAG( uiCode, "vert_phase_position_enable_flag" ); scaledWindow.setVertPhasePositionEnableFlag(uiCode);  pcPPS->setVertPhasePositionEnableFlag( pcPPS->getScaledRefLayerId(i), uiCode);
-#endif
               }
               READ_FLAG( uiCode, "ref_region_offset_present_flag" );   pcPPS->setRefRegionOffsetPresentFlag( k, uiCode );
@@ -437,5 +433,4 @@
                 READ_SVLC( iCode, "ref_region_bottom_offset" );  refWindow.setWindowBottomOffset(iCode << 1);
               }
-#if R0209_GENERIC_PHASE
               READ_FLAG( uiCode, "resample_phase_set_present_flag" );   pcPPS->setResamplePhaseSetPresentFlag( k, uiCode );
               if (uiCode)
@@ -446,25 +441,5 @@
                 READ_UVLC( uiCode, "phase_ver_chroma_plus8" );  pcPPS->setPhaseVerChroma (k, uiCode - 8);
               }
-#endif
             }
-#else
-#if MOVE_SCALED_OFFSET_TO_PPS
-            READ_UVLC( uiCode,      "num_scaled_ref_layer_offsets" ); pcPPS->setNumScaledRefLayerOffsets(uiCode);
-            for(Int k = 0; k < pcPPS->getNumScaledRefLayerOffsets(); k++)
-            {
-              Window& scaledWindow = pcPPS->getScaledRefLayerWindow(k);
-#if O0098_SCALED_REF_LAYER_ID
-              READ_CODE( 6,  uiCode,  "scaled_ref_layer_id" );       pcPPS->setScaledRefLayerId( k, uiCode );
-#endif
-              READ_SVLC( iCode, "scaled_ref_layer_left_offset" );    scaledWindow.setWindowLeftOffset  (iCode << 1);
-              READ_SVLC( iCode, "scaled_ref_layer_top_offset" );     scaledWindow.setWindowTopOffset   (iCode << 1);
-              READ_SVLC( iCode, "scaled_ref_layer_right_offset" );   scaledWindow.setWindowRightOffset (iCode << 1);
-              READ_SVLC( iCode, "scaled_ref_layer_bottom_offset" );  scaledWindow.setWindowBottomOffset(iCode << 1);
-#if P0312_VERT_PHASE_ADJ
-              READ_FLAG( uiCode, "vert_phase_position_enable_flag" ); scaledWindow.setVertPhasePositionEnableFlag(uiCode);  pcPPS->setVertPhasePositionEnableFlag( pcPPS->getScaledRefLayerId(k), uiCode);
-#endif
-            }
-#endif
-#endif
 #if Q0048_CGS_3D_ASYMLUT
             READ_FLAG( uiCode , "colour_mapping_enabled_flag" ); 
@@ -1698,18 +1673,4 @@
 #endif 
     }
-#if P0312_VERT_PHASE_ADJ
-    for(Int i = 0; i < pcSlice->getActiveNumILRRefIdx(); i++ ) 
-    {
-      UInt refLayerIdc = pcSlice->getInterLayerPredLayerIdc(i);
-#if !MOVE_SCALED_OFFSET_TO_PPS
-      if( pcSlice->getSPS()->getVertPhasePositionEnableFlag(refLayerIdc) )
-#else
-      if( pcSlice->getPPS()->getVertPhasePositionEnableFlag(refLayerIdc) )
-#endif
-      {
-        READ_FLAG( uiCode, "vert_phase_position_flag" ); pcSlice->setVertPhasePositionFlag( uiCode? true : false, refLayerIdc );
-      }
-    }
-#endif
 #endif //SVC_EXTENSION
 
@@ -3539,7 +3500,4 @@
   }
 #endif
-#if O0215_PHASE_ALIGNMENT
-  READ_FLAG( uiCode, "cross_layer_phase_alignment_flag"); vps->setPhaseAlignFlag( uiCode == 1 ? true : false );
-#endif
 
 #if !IRAP_ALIGN_FLAG_IN_VPS_VUI
@@ -4275,7 +4233,4 @@
   }
 #endif
-#endif
-#if P0312_VERT_PHASE_ADJ
-  READ_FLAG( uiCode, "vps_vui_vert_phase_in_use_flag" ); vps->setVpsVuiVertPhaseInUseFlag(uiCode);
 #endif
 #if N0160_VUI_EXT_ILP_REF
@@ -4465,26 +4420,4 @@
   // Vertical MV component restriction is not used in SHVC CTC
   assert( uiCode == 0 );
-
-#if !MOVE_SCALED_OFFSET_TO_PPS
-  if( pcSPS->getLayerId() > 0 )
-  {
-    Int iCode;
-    READ_UVLC( uiCode,      "num_scaled_ref_layer_offsets" ); pcSPS->setNumScaledRefLayerOffsets(uiCode);
-    for(Int i = 0; i < pcSPS->getNumScaledRefLayerOffsets(); i++)
-    {
-      Window& scaledWindow = pcSPS->getScaledRefLayerWindow(i);
-#if O0098_SCALED_REF_LAYER_ID
-      READ_CODE( 6,  uiCode,  "scaled_ref_layer_id" );       pcSPS->setScaledRefLayerId( i, uiCode );
-#endif
-      READ_SVLC( iCode, "scaled_ref_layer_left_offset" );    scaledWindow.setWindowLeftOffset  (iCode << 1);
-      READ_SVLC( iCode, "scaled_ref_layer_top_offset" );     scaledWindow.setWindowTopOffset   (iCode << 1);
-      READ_SVLC( iCode, "scaled_ref_layer_right_offset" );   scaledWindow.setWindowRightOffset (iCode << 1);
-      READ_SVLC( iCode, "scaled_ref_layer_bottom_offset" );  scaledWindow.setWindowBottomOffset(iCode << 1);
-#if P0312_VERT_PHASE_ADJ
-      READ_FLAG( uiCode, "vert_phase_position_enable_flag" ); scaledWindow.setVertPhasePositionEnableFlag(uiCode);  pcSPS->setVertPhasePositionEnableFlag( pcSPS->getScaledRefLayerId(i), uiCode);    
-#endif
-    }
-  }
-#endif
 }
 #endif
Index: /branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp	(revision 1089)
+++ /branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp	(revision 1090)
@@ -615,34 +615,4 @@
 #endif
 
-#if P0312_VERT_PHASE_ADJ
-#if MOVE_SCALED_OFFSET_TO_PPS
-  if( activeVPS->getVpsVuiVertPhaseInUseFlag() == 0 )
-  {    
-    for(Int i = 0; i < activePPS->getNumScaledRefLayerOffsets(); i++)
-    {
-      UInt scaledRefLayerId = activePPS->getScaledRefLayerId(i);
-      if( activePPS->getVertPhasePositionEnableFlag( scaledRefLayerId ) )
-      {
-        printf("\nWarning: LayerId = %d: vert_phase_position_enable_flag[%d] = 1, however indication vert_phase_position_in_use_flag = 0\n", m_layerId, scaledRefLayerId );
-        break;
-      }
-    }
-  }
-#else
-  if( activeVPS->getVpsVuiVertPhaseInUseFlag() == 0 )
-  {    
-    for(Int i = 0; i < activeSPS->getNumScaledRefLayerOffsets(); i++)
-    {
-      UInt scaledRefLayerId = activeSPS->getScaledRefLayerId(i);
-      if( activeSPS->getVertPhasePositionEnableFlag( scaledRefLayerId ) )
-      {
-        printf("\nWarning: LayerId = %d: vert_phase_position_enable_flag[%d] = 1, however indication vert_phase_position_in_use_flag = 0\n", m_layerId, scaledRefLayerId );
-        break;
-      }
-    }
-  }
-#endif
-#endif
-
 #if SPS_DPB_PARAMS
   if( m_layerId > 0 )
@@ -1912,5 +1882,4 @@
 #endif
 
-#if MOVE_SCALED_OFFSET_TO_PPS
 #if O0098_SCALED_REF_LAYER_ID
         const Window &scalEL = pcSlice->getPPS()->getScaledRefLayerWindowForLayer(refLayerId);
@@ -1918,31 +1887,11 @@
         const Window &scalEL = pcSlice->getPPS()->getScaledRefLayerWindow(refLayerIdc);
 #endif
-#else
-#if O0098_SCALED_REF_LAYER_ID
-        const Window &scalEL = pcSlice->getSPS()->getScaledRefLayerWindowForLayer(refLayerId);
-#else
-        const Window &scalEL = pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc);
-#endif
-#endif
-
-#if REF_REGION_OFFSET
+
         const Window &windowRL = pcSlice->getPPS()->getRefLayerWindowForLayer(pcSlice->getVPS()->getRefLayerId(m_layerId, refLayerIdc));
         Int widthBL   = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getWidth(COMPONENT_Y) - windowRL.getWindowLeftOffset() - windowRL.getWindowRightOffset();
         Int heightBL  = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getHeight(COMPONENT_Y) - windowRL.getWindowTopOffset() - windowRL.getWindowBottomOffset();
-#else
-        Int widthBL   = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getWidth(COMPONENT_Y);
-        Int heightBL  = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getHeight(COMPONENT_Y);
-#if Q0200_CONFORMANCE_BL_SIZE
-        Int chromaFormatIdc = pcSlice->getBaseColPic(refLayerIdc)->getSlice(0)->getChromaFormatIdc();
-        const Window &confBL = pcSlice->getBaseColPic(refLayerIdc)->getConformanceWindow(); 
-        widthBL  -= ( confBL.getWindowLeftOffset() + confBL.getWindowRightOffset() ) * TComSPS::getWinUnitX( chromaFormatIdc );
-        heightBL -= ( confBL.getWindowTopOffset() + confBL.getWindowBottomOffset() ) * TComSPS::getWinUnitY( chromaFormatIdc );
-#endif
-#endif
         Int widthEL   = m_pcPic->getPicYuvRec()->getWidth(COMPONENT_Y)  - scalEL.getWindowLeftOffset() - scalEL.getWindowRightOffset();
         Int heightEL  = m_pcPic->getPicYuvRec()->getHeight(COMPONENT_Y) - scalEL.getWindowTopOffset()  - scalEL.getWindowBottomOffset();
 
-#if RESAMPLING_FIX
-#if REF_REGION_OFFSET
         // conformance check: the values of RefLayerRegionWidthInSamplesY, RefLayerRegionHeightInSamplesY, ScaledRefRegionWidthInSamplesY and ScaledRefRegionHeightInSamplesY shall be greater than 0
         assert(widthEL > 0 && heightEL > 0 && widthBL > 0 && widthEL > 0);
@@ -1951,5 +1900,4 @@
         assert(widthEL >= widthBL && heightEL >= heightBL);
 
-#if R0209_GENERIC_PHASE
         // conformance check: when ScaledRefRegionWidthInSamplesY is equal to RefLayerRegionWidthInSamplesY, PhaseHorY shall be equal to 0, when ScaledRefRegionWidthInSamplesC is equal to RefLayerRegionWidthInSamplesC, PhaseHorC shall be equal to 0, when ScaledRefRegionHeightInSamplesY is equal to RefLayerRegionHeightInSamplesY, PhaseVerY shall be equal to 0, and when ScaledRefRegionHeightInSamplesC is equal to RefLayerRegionHeightInSamplesC, PhaseVerC shall be equal to 0.
         Bool phaseSetPresentFlag;
@@ -1959,7 +1907,4 @@
         assert( ( (widthEL  != widthBL)  || (phaseHorLuma == 0 && phaseHorChroma == 0) )
              && ( (heightEL != heightBL) || (phaseVerLuma == 0 && phaseVerChroma == 0) ) );
-#endif
-#endif
-#endif
 
         g_mvScalingFactor[refLayerIdc][0] = widthEL  == widthBL  ? 4096 : Clip3(-4096, 4095, ((widthEL  << 8) + (widthBL  >> 1)) / widthBL);
@@ -1991,5 +1936,4 @@
         }
 #endif
-#if SVC_EXTENSION
         if( m_pcPic->isSpatialEnhLayer(refLayerIdc) )
         {
@@ -1997,45 +1941,5 @@
           if( pcSlice->getVPS()->isSamplePredictionType( pcSlice->getVPS()->getLayerIdxInVps(m_layerId), pcSlice->getVPS()->getLayerIdxInVps(refLayerId) ) )
           {
-#if O0215_PHASE_ALIGNMENT_REMOVAL
             m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, m_pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, m_pcPic->getPicYuvRec());
-#else
-#if O0215_PHASE_ALIGNMENT
-#if O0194_JOINT_US_BITSHIFT
-#if Q0048_CGS_3D_ASYMLUT 
-            m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, m_pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, m_pcPic->getPicYuvRec(), pcSlice->getVPS()->getPhaseAlignFlag() );
-#else
-            m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, m_pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), m_pcPic->getPicYuvRec(), pcSlice->getVPS()->getPhaseAlignFlag() );
-#endif
-#else
-#if Q0048_CGS_3D_ASYMLUT 
-#if MOVE_SCALED_OFFSET_TO_PPS
-          m_cPrediction.upsampleBasePic( refLayerIdc, m_pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, m_pcPic->getPicYuvRec(), pcSlice->getPPS()->getScaledRefLayerWindow(refLayerIdc), pcSlice->getVPS()->getPhaseAlignFlag() );
-#else
-          m_cPrediction.upsampleBasePic( refLayerIdc, m_pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, m_pcPic->getPicYuvRec(), pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc), pcSlice->getVPS()->getPhaseAlignFlag() );
-#endif
-#else
-          m_cPrediction.upsampleBasePic( refLayerIdc, m_pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), m_pcPic->getPicYuvRec(), scalEL, pcSlice->getVPS()->getPhaseAlignFlag() );
-#endif
-#endif
-#else
-#if O0194_JOINT_US_BITSHIFT
-#if Q0048_CGS_3D_ASYMLUT 
-#if REF_REGION_OFFSET
-          m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, m_pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, m_pcPic->getPicYuvRec(), scalEL, altRL );
-#else
-          m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, m_pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, m_pcPic->getPicYuvRec(), scalEL );
-#endif
-#else
-          m_cPrediction.upsampleBasePic( pcSlice, refLayerIdc, m_pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), m_pcPic->getPicYuvRec(), scalEL );
-#endif
-#else
-#if Q0048_CGS_3D_ASYMLUT 
-            m_cPrediction.upsampleBasePic( refLayerIdc, m_pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, m_pcPic->getPicYuvRec(), scalEL );
-#else
-            m_cPrediction.upsampleBasePic( refLayerIdc, m_pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), m_pcPic->getPicYuvRec(), scalEL );
-#endif
-#endif
-#endif
-#endif
           }
         }
@@ -2045,5 +1949,4 @@
         }
         pcSlice->setFullPelBaseRec ( refLayerIdc, m_pcPic->getFullPelBaseRec(refLayerIdc) );
-#endif //SVC_EXTENSION
       }
     }
Index: /branches/SHM-dev/source/Lib/TLibEncoder/TEnc3DAsymLUT.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibEncoder/TEnc3DAsymLUT.cpp	(revision 1089)
+++ /branches/SHM-dev/source/Lib/TLibEncoder/TEnc3DAsymLUT.cpp	(revision 1090)
@@ -690,9 +690,5 @@
   TComSlice * pSlice = pCurPic->getSlice(pCurPic->getCurrSliceIdx());
   UInt refLayerId = pSlice->getVPS()->getRefLayerId(pSlice->getLayerId(), refLayerIdc);
-#if MOVE_SCALED_OFFSET_TO_PPS
   const Window &scalEL = pSlice->getPPS()->getScaledRefLayerWindowForLayer(refLayerId); 
-#else
-  const Window &scalEL = pSlice->getSPS()->getScaledRefLayerWindowForLayer(refLayerId); 
-#endif
   TComPicYuv *pcRecPicBL = pSlice->getBaseColPic(refLayerIdc)->getPicYuvRec();
   // borders of down-sampled picture
Index: /branches/SHM-dev/source/Lib/TLibEncoder/TEncCavlc.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 1089)
+++ /branches/SHM-dev/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 1090)
@@ -316,5 +316,4 @@
 #endif
 
-#if REF_REGION_OFFSET
             WRITE_UVLC( pcPPS->getNumRefLayerLocationOffsets(),      "num_ref_loc_offsets" );
             for(Int k = 0; k < pcPPS->getNumRefLayerLocationOffsets(); k++)
@@ -339,5 +338,4 @@
                 WRITE_SVLC( refWindow.getWindowBottomOffset() >> 1, "ref_region_bottom_offset" );
               }
-#if R0209_GENERIC_PHASE
               WRITE_FLAG( pcPPS->getResamplePhaseSetPresentFlag(k) ? 1 : 0, "resample_phase_set_present_flag" );
               if (pcPPS->getResamplePhaseSetPresentFlag(k))
@@ -348,22 +346,5 @@
                 WRITE_UVLC( pcPPS->getPhaseVerChroma(k) + 8, "phase_ver_chroma_plus8" );
               }
-#endif
             }
-#else
-#if MOVE_SCALED_OFFSET_TO_PPS
-            WRITE_UVLC( pcPPS->getNumScaledRefLayerOffsets(),      "num_scaled_ref_layer_offsets" );
-            for(Int k = 0; k < pcPPS->getNumScaledRefLayerOffsets(); k++)
-            {
-              Window scaledWindow = pcPPS->getScaledRefLayerWindow(k);
-#if O0098_SCALED_REF_LAYER_ID
-              WRITE_CODE( pcPPS->getScaledRefLayerId(k), 6,          "scaled_ref_layer_id" );
-#endif
-              WRITE_SVLC( scaledWindow.getWindowLeftOffset()   >> 1, "scaled_ref_layer_left_offset" );
-              WRITE_SVLC( scaledWindow.getWindowTopOffset()    >> 1, "scaled_ref_layer_top_offset" );
-              WRITE_SVLC( scaledWindow.getWindowRightOffset()  >> 1, "scaled_ref_layer_right_offset" );
-              WRITE_SVLC( scaledWindow.getWindowBottomOffset() >> 1, "scaled_ref_layer_bottom_offset" );
-            }
-#endif
-#endif
 #if Q0048_CGS_3D_ASYMLUT
             bits = getNumberOfWrittenBits();
@@ -1268,14 +1249,4 @@
       }
     }     
-#if P0312_VERT_PHASE_ADJ
-    for(Int i = 0; i < pcSlice->getActiveNumILRRefIdx(); i++ )
-    {
-      UInt refLayerIdc = pcSlice->getInterLayerPredLayerIdc(i);
-      if( pcSlice->getSPS()->getVertPhasePositionEnableFlag(refLayerIdc) )
-      {
-        WRITE_FLAG( pcSlice->getVertPhasePositionFlag(refLayerIdc), "vert_phase_position_flag" );
-      }
-    }
-#endif
 #endif //SVC_EXTENSION
 
@@ -2549,7 +2520,4 @@
   }
 #endif
-#if O0215_PHASE_ALIGNMENT
-  WRITE_FLAG(vps->getPhaseAlignFlag(), "cross_layer_phase_alignment_flag" );
-#endif
 #if !IRAP_ALIGN_FLAG_IN_VPS_VUI
   WRITE_FLAG(vps->getCrossLayerIrapAlignFlag(), "cross_layer_irap_aligned_flag");
@@ -2993,7 +2961,4 @@
   WRITE_FLAG(vps->getHigherLayerIrapSkipFlag(), "higher_layer_irap_skip_flag" );
 #endif
-#endif
-#if P0312_VERT_PHASE_ADJ
-  WRITE_FLAG( vps->getVpsVuiVertPhaseInUseFlag(), "vps_vui_vert_phase_in_use_flag" );
 #endif
 #if N0160_VUI_EXT_ILP_REF
@@ -3122,25 +3087,4 @@
   // Vertical MV component restriction is not used in SHVC CTC
   WRITE_FLAG( 0, "inter_view_mv_vert_constraint_flag" );
-
-#if !MOVE_SCALED_OFFSET_TO_PPS
-  if( pcSPS->getLayerId() > 0 )
-  {
-    WRITE_UVLC( pcSPS->getNumScaledRefLayerOffsets(),      "num_scaled_ref_layer_offsets" );
-    for(Int i = 0; i < pcSPS->getNumScaledRefLayerOffsets(); i++)
-    {
-      Window scaledWindow = pcSPS->getScaledRefLayerWindow(i);
-#if O0098_SCALED_REF_LAYER_ID
-      WRITE_CODE( pcSPS->getScaledRefLayerId(i), 6,          "scaled_ref_layer_id" );
-#endif
-      WRITE_SVLC( scaledWindow.getWindowLeftOffset()   >> 1, "scaled_ref_layer_left_offset" );
-      WRITE_SVLC( scaledWindow.getWindowTopOffset()    >> 1, "scaled_ref_layer_top_offset" );
-      WRITE_SVLC( scaledWindow.getWindowRightOffset()  >> 1, "scaled_ref_layer_right_offset" );
-      WRITE_SVLC( scaledWindow.getWindowBottomOffset() >> 1, "scaled_ref_layer_bottom_offset" );
-#if P0312_VERT_PHASE_ADJ
-      WRITE_FLAG( scaledWindow.getVertPhasePositionEnableFlag(), "vert_phase_position_enable_flag" ); 
-#endif
-    }
-  }
-#endif
 }
 #endif //SVC_EXTENSION
Index: /branches/SHM-dev/source/Lib/TLibEncoder/TEncCfg.h
===================================================================
--- /branches/SHM-dev/source/Lib/TLibEncoder/TEncCfg.h	(revision 1089)
+++ /branches/SHM-dev/source/Lib/TLibEncoder/TEncCfg.h	(revision 1090)
@@ -489,9 +489,5 @@
 
   Window   &getConformanceWindow()                           { return m_conformanceWindow; }
-#if P0312_VERT_PHASE_ADJ && !R0209_GENERIC_PHASE
-  Void      setConformanceWindow (Int confLeft, Int confRight, Int confTop, Int confBottom ) { m_conformanceWindow.setWindow (confLeft, confRight, confTop, confBottom, false); }
-#else
   Void      setConformanceWindow (Int confLeft, Int confRight, Int confTop, Int confBottom ) { m_conformanceWindow.setWindow (confLeft, confRight, confTop, confBottom); }
-#endif
 
   Void      setFramesToBeEncoded            ( Int   i )      { m_framesToBeEncoded = i; }
Index: /branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 1089)
+++ /branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 1090)
@@ -1477,23 +1477,10 @@
 #endif
 
-#if REF_REGION_OFFSET
         const Window &windowRL  = m_pcEncTop->getRefLayerWindowForLayer(pcSlice->getVPS()->getRefLayerId(m_layerId, refLayerIdc));
         Int widthBL   = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getWidth(COMPONENT_Y) - windowRL.getWindowLeftOffset() - windowRL.getWindowRightOffset();
         Int heightBL  = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getHeight(COMPONENT_Y) - windowRL.getWindowTopOffset() - windowRL.getWindowBottomOffset();
-#else
-        Int widthBL   = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getWidth(COMPONENT_Y);
-        Int heightBL  = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getHeight(COMPONENT_Y);
-#if Q0200_CONFORMANCE_BL_SIZE
-        Int chromaFormatIdc = pcSlice->getBaseColPic(refLayerIdc)->getSlice(0)->getChromaFormatIdc();
-        const Window &confBL = pcSlice->getBaseColPic(refLayerIdc)->getConformanceWindow();
-        widthBL  -= ( confBL.getWindowLeftOffset() + confBL.getWindowRightOffset() ) * TComSPS::getWinUnitX( chromaFormatIdc );
-        heightBL -= ( confBL.getWindowTopOffset() + confBL.getWindowBottomOffset() ) * TComSPS::getWinUnitY( chromaFormatIdc );
-#endif
-#endif
         Int widthEL   = pcPic->getPicYuvRec()->getWidth(COMPONENT_Y)  - scalEL.getWindowLeftOffset() - scalEL.getWindowRightOffset();
         Int heightEL  = pcPic->getPicYuvRec()->getHeight(COMPONENT_Y) - scalEL.getWindowTopOffset()  - scalEL.getWindowBottomOffset();
 
-#if RESAMPLING_FIX
-#if REF_REGION_OFFSET
         // conformance check: the values of RefLayerRegionWidthInSamplesY, RefLayerRegionHeightInSamplesY, ScaledRefRegionWidthInSamplesY and ScaledRefRegionHeightInSamplesY shall be greater than 0
         assert(widthEL > 0 && heightEL > 0 && widthBL > 0 && widthEL > 0);
@@ -1502,5 +1489,4 @@
         assert(widthEL >= widthBL && heightEL >= heightBL);
 
-#if R0209_GENERIC_PHASE
         // conformance check: when ScaledRefRegionWidthInSamplesY is equal to RefLayerRegionWidthInSamplesY, PhaseHorY shall be equal to 0, when ScaledRefRegionWidthInSamplesC is equal to RefLayerRegionWidthInSamplesC, PhaseHorC shall be equal to 0, when ScaledRefRegionHeightInSamplesY is equal to RefLayerRegionHeightInSamplesY, PhaseVerY shall be equal to 0, and when ScaledRefRegionHeightInSamplesC is equal to RefLayerRegionHeightInSamplesC, PhaseVerC shall be equal to 0.
         Bool phaseSetPresentFlag;
@@ -1510,7 +1496,4 @@
         assert( ( (widthEL  != widthBL)  || (phaseHorLuma == 0 && phaseHorChroma == 0) )
              && ( (heightEL != heightBL) || (phaseVerLuma == 0 && phaseVerChroma == 0) ) );
-#endif
-#endif
-#endif
 
         g_mvScalingFactor[refLayerIdc][0] = widthEL  == widthBL  ? 4096 : Clip3(-4096, 4095, ((widthEL  << 8) + (widthBL  >> 1)) / widthBL);
@@ -1556,48 +1539,5 @@
           if( pcSlice->getVPS()->isSamplePredictionType( pcSlice->getVPS()->getLayerIdxInVps(m_layerId), pcSlice->getVPS()->getLayerIdxInVps(refLayerId) ) )
           {
-#if P0312_VERT_PHASE_ADJ
-            //when PhasePositionEnableFlag is equal to 1, set vertPhasePositionFlag to 0 if BL is top field and 1 if bottom
-            if( scalEL.getVertPhasePositionEnableFlag() )
-            {
-              pcSlice->setVertPhasePositionFlag( pcSlice->getPOC()%2, refLayerIdc );
-            }
-#endif
-#if O0215_PHASE_ALIGNMENT_REMOVAL
             m_pcPredSearch->upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, pcPic->getPicYuvRec() );
-#else
-#if O0215_PHASE_ALIGNMENT
-#if O0194_JOINT_US_BITSHIFT
-#if Q0048_CGS_3D_ASYMLUT 
-            m_pcPredSearch->upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, pcPic->getPicYuvRec(), pcSlice->getVPS()->getPhaseAlignFlag() );
-#else
-            m_pcPredSearch->upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), pcSlice->getVPS()->getPhaseAlignFlag() );
-#endif
-#else
-#if Q0048_CGS_3D_ASYMLUT
-            m_pcPredSearch->upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, pcPic->getPicYuvRec(), scalEL, pcSlice->getVPS()->getPhaseAlignFlag() );
-#else
-            m_pcPredSearch->upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), scalEL, pcSlice->getVPS()->getPhaseAlignFlag() );
-#endif
-#endif
-#else
-#if O0194_JOINT_US_BITSHIFT
-#if Q0048_CGS_3D_ASYMLUT 
-#if REF_REGION_OFFSET
-          m_pcPredSearch->upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, pcPic->getPicYuvRec(), scalEL, altRL );
-#else
-          m_pcPredSearch->upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, pcPic->getPicYuvRec(), scalEL );
-#endif
-#else
-          m_pcPredSearch->upsampleBasePic( pcSlice, refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), scalEL );
-#endif
-#else
-#if Q0048_CGS_3D_ASYMLUT 
-            m_pcPredSearch->upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pBaseColRec, pcPic->getPicYuvRec(), scalEL );
-#else
-            m_pcPredSearch->upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), scalEL );
-#endif
-#endif
-#endif
-#endif
           }
         }
Index: /branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.cpp	(revision 1089)
+++ /branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.cpp	(revision 1090)
@@ -619,5 +619,4 @@
         for(UInt i = 0; i < m_cVPS.getNumDirectRefLayers( m_layerId ); i++ )
         {
-#if MOVE_SCALED_OFFSET_TO_PPS
 #if O0098_SCALED_REF_LAYER_ID
           const Window scalEL = getPPS()->getScaledRefLayerWindowForLayer(m_cVPS.getRefLayerId(m_layerId, i));
@@ -625,25 +624,7 @@
           const Window scalEL = getPPS()->getScaledRefLayerWindow(i);
 #endif
-#else
-#if O0098_SCALED_REF_LAYER_ID
-          const Window scalEL = getSPS()->getScaledRefLayerWindowForLayer(m_cVPS.getRefLayerId(m_layerId, i));
-#else
-          const Window scalEL = getSPS()->getScaledRefLayerWindow(i);
-#endif
-#endif
-#if REF_REGION_OFFSET
           const Window altRL  = getPPS()->getRefLayerWindowForLayer(m_cVPS.getRefLayerId(m_layerId, i));
-#if RESAMPLING_FIX
           Bool equalOffsets = scalEL.hasEqualOffset(altRL);
-#if R0209_GENERIC_PHASE
           Bool zeroPhase = getPPS()->hasZeroResamplingPhase(m_cVPS.getRefLayerId(m_layerId, i));
-#endif
-#else
-          Bool zeroOffsets = ( scalEL.getWindowLeftOffset() == 0 && scalEL.getWindowRightOffset() == 0 && scalEL.getWindowTopOffset() == 0 && scalEL.getWindowBottomOffset() == 0
-                               && altRL.getWindowLeftOffset() == 0 && altRL.getWindowRightOffset() == 0 && altRL.getWindowTopOffset() == 0 && altRL.getWindowBottomOffset() == 0);
-#endif
-#else
-          Bool zeroOffsets = ( scalEL.getWindowLeftOffset() == 0 && scalEL.getWindowRightOffset() == 0 && scalEL.getWindowTopOffset() == 0 && scalEL.getWindowBottomOffset() == 0 );
-#endif
 
 #if VPS_EXTN_DIRECT_REF_LAYERS
@@ -665,12 +646,6 @@
 #else
           if( m_iSourceWidth != pcEncTopBase->getSourceWidth() || m_iSourceHeight != pcEncTopBase->getSourceHeight() || !sameBitDepths 
-#if REF_REGION_OFFSET && RESAMPLING_FIX
             || !equalOffsets
-#if R0209_GENERIC_PHASE
             || !zeroPhase
-#endif
-#else
-            || !zeroOffsets
-#endif
 #endif
 #if Q0048_CGS_3D_ASYMLUT
@@ -683,12 +658,6 @@
 #else
           if(m_iSourceWidth != pcEncTopBase->getSourceWidth() || m_iSourceHeight != pcEncTopBase->getSourceHeight()
-#if REF_REGION_OFFSET && RESAMPLING_FIX
             || !equalOffsets
-#if R0209_GENERIC_PHASE
             || !zeroPhase
-#endif
-#else
-            || !zeroOffsets
-#endif
           )
 #endif
@@ -720,5 +689,4 @@
         for(UInt i = 0; i < m_cVPS.getNumDirectRefLayers( m_layerId ); i++ )
         {
-#if MOVE_SCALED_OFFSET_TO_PPS
 #if O0098_SCALED_REF_LAYER_ID
           const Window scalEL = getPPS()->getScaledRefLayerWindowForLayer(m_cVPS.getRefLayerId(m_layerId, i));
@@ -726,25 +694,7 @@
           const Window scalEL = getPPS()->getScaledRefLayerWindow(i);
 #endif
-#else
-#if O0098_SCALED_REF_LAYER_ID
-          const Window scalEL = getSPS()->getScaledRefLayerWindowForLayer(m_cVPS.getRefLayerId(m_layerId, i));
-#else
-          const Window scalEL = getSPS()->getScaledRefLayerWindow(i);
-#endif
-#endif
-#if REF_REGION_OFFSET
           const Window altRL  = getPPS()->getRefLayerWindowForLayer(m_cVPS.getRefLayerId(m_layerId, i));
-#if RESAMPLING_FIX
           Bool equalOffsets = scalEL.hasEqualOffset(altRL);
-#if R0209_GENERIC_PHASE
           Bool zeroPhase = getPPS()->hasZeroResamplingPhase(m_cVPS.getRefLayerId(m_layerId, i));
-#endif
-#else
-          Bool zeroOffsets = ( scalEL.getWindowLeftOffset() == 0 && scalEL.getWindowRightOffset() == 0 && scalEL.getWindowTopOffset() == 0 && scalEL.getWindowBottomOffset() == 0
-                               && altRL.getWindowLeftOffset() == 0 && altRL.getWindowRightOffset() == 0 && altRL.getWindowTopOffset() == 0 && altRL.getWindowBottomOffset() == 0);
-#endif
-#else
-          Bool zeroOffsets = ( scalEL.getWindowLeftOffset() == 0 && scalEL.getWindowRightOffset() == 0 && scalEL.getWindowTopOffset() == 0 && scalEL.getWindowBottomOffset() == 0 );
-#endif
 
 #if VPS_EXTN_DIRECT_REF_LAYERS
@@ -758,12 +708,6 @@
 
           if( m_iSourceWidth != pcEncTopBase->getSourceWidth() || m_iSourceHeight != pcEncTopBase->getSourceHeight() || !sameBitDepths 
-#if REF_REGION_OFFSET && RESAMPLING_FIX
             || !equalOffsets 
-#if R0209_GENERIC_PHASE
             || !zeroPhase
-#endif
-#else
-            || !zeroOffsets 
-#endif
 #if Q0048_CGS_3D_ASYMLUT
             || m_cPPS.getCGSFlag() > 0
@@ -775,12 +719,6 @@
 #else
           if(m_iSourceWidth != pcEncTopBase->getSourceWidth() || m_iSourceHeight != pcEncTopBase->getSourceHeight()
-#if REF_REGION_OFFSET && RESAMPLING_FIX
             || !equalOffsets 
-#if R0209_GENERIC_PHASE
             || !zeroPhase
-#endif
-#else
-            || !zeroOffsets 
-#endif
           )
 #endif
@@ -832,17 +770,4 @@
 #else
   m_cSPS.setLayerId(m_layerId);
-#endif
-#if !MOVE_SCALED_OFFSET_TO_PPS
-  m_cSPS.setNumScaledRefLayerOffsets(m_numScaledRefLayerOffsets);
-  for(Int i = 0; i < m_cSPS.getNumScaledRefLayerOffsets(); i++)
-  {
-#if O0098_SCALED_REF_LAYER_ID
-    m_cSPS.setScaledRefLayerId(i, m_scaledRefLayerId[i]);
-#endif
-    m_cSPS.getScaledRefLayerWindow(i) = m_scaledRefLayerWindow[i];
-#if P0312_VERT_PHASE_ADJ
-    m_cSPS.setVertPhasePositionEnableFlag( m_scaledRefLayerId[i], m_scaledRefLayerWindow[i].getVertPhasePositionEnableFlag() );
-#endif
-  }
 #endif
 #endif //SVC_EXTENSION
@@ -1149,5 +1074,4 @@
   }
 #endif
-#if MOVE_SCALED_OFFSET_TO_PPS
   m_cPPS.setNumRefLayerLocationOffsets(m_numRefLayerLocationOffsets);
   for(Int i = 0; i < m_cPPS.getNumRefLayerLocationOffsets(); i++)
@@ -1157,10 +1081,7 @@
 #endif
     m_cPPS.getScaledRefLayerWindow(i) = m_scaledRefLayerWindow[i];
-#if REF_REGION_OFFSET
     m_cPPS.getRefLayerWindow(i) = m_refLayerWindow[i];
     m_cPPS.setScaledRefLayerOffsetPresentFlag( i, m_scaledRefLayerOffsetPresentFlag[i] );
     m_cPPS.setRefRegionOffsetPresentFlag( i, m_refRegionOffsetPresentFlag[i] );
-#endif
-#if R0209_GENERIC_PHASE
     m_cPPS.setResamplePhaseSetPresentFlag( i, m_resamplePhaseSetPresentFlag[i] );
     m_cPPS.setPhaseHorLuma( m_refLocationOffsetLayerId[i], m_phaseHorLuma[i] );
@@ -1168,10 +1089,5 @@
     m_cPPS.setPhaseHorChroma( m_refLocationOffsetLayerId[i], m_phaseHorChroma[i] );
     m_cPPS.setPhaseVerChroma( m_refLocationOffsetLayerId[i], m_phaseVerChroma[i] );
-#endif
-#if P0312_VERT_PHASE_ADJ
-    m_cPPS.setVertPhasePositionEnableFlag( m_scaledRefLayerId[i], m_scaledRefLayerWindow[i].getVertPhasePositionEnableFlag() );
-#endif
-  }
-#endif
+  }
 #if Q0048_CGS_3D_ASYMLUT
   m_cPPS.setCGSFlag( m_nCGSFlag );
@@ -1688,5 +1604,5 @@
   return win;
 }
-#if REF_REGION_OFFSET
+
 Window& TEncTop::getRefLayerWindowForLayer(Int layerId)
 {
@@ -1705,5 +1621,4 @@
 }
 #endif
-#endif
 #endif //SVC_EXTENSION
 //! \}
Index: /branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.h
===================================================================
--- /branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.h	(revision 1089)
+++ /branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.h	(revision 1090)
@@ -127,5 +127,4 @@
 #endif
   Window                  m_scaledRefLayerWindow[MAX_LAYERS];
-#if REF_REGION_OFFSET
   UInt                    m_numRefLayerOffsets;
   UInt                    m_refLayerId[MAX_LAYERS];
@@ -133,6 +132,4 @@
   Bool                    m_scaledRefLayerOffsetPresentFlag[MAX_LAYERS];
   Bool                    m_refRegionOffsetPresentFlag[MAX_LAYERS];
-#endif
-#if R0209_GENERIC_PHASE
   Int                     m_phaseHorLuma  [MAX_LAYERS];
   Int                     m_phaseVerLuma  [MAX_LAYERS];
@@ -140,8 +137,4 @@
   Int                     m_phaseVerChroma[MAX_LAYERS];
   Int                     m_resamplePhaseSetPresentFlag[MAX_LAYERS];
-#endif
-#if P0312_VERT_PHASE_ADJ
-  Bool                    m_vertPhasePositionEnableFlag[MAX_LAYERS];
-#endif
 #if POC_RESET_FLAG || POC_RESET_IDC_ENCODER
   Int                     m_pocAdjustmentValue;
@@ -232,5 +225,4 @@
 #endif
   Window&   getScaledRefLayerWindow(Int x)                 { return m_scaledRefLayerWindow[x];        }
-#if REF_REGION_OFFSET
   Void      setNumRefLayerOffsets(Int x) { m_numRefLayerOffsets = x; }
   UInt      getNumRefLayerOffsets() { return m_numRefLayerOffsets; }
@@ -243,10 +235,4 @@
   Bool      getRefRegionOffsetPresentFlag(Int x) { return m_refRegionOffsetPresentFlag[x]; }
   Void      setRefRegionOffsetPresentFlag(Int x, Bool b) { m_refRegionOffsetPresentFlag[x] = b; }
-#endif
-#if P0312_VERT_PHASE_ADJ
-  Void      setVertPhasePositionEnableFlag(Int x, Bool b)  { m_vertPhasePositionEnableFlag[x] = b;    }
-  UInt      getVertPhasePositionEnableFlag(Int x)          { return m_vertPhasePositionEnableFlag[x]; }
-#endif
-#if R0209_GENERIC_PHASE
   Int       getPhaseHorLuma(Int x) { return m_phaseHorLuma[x]; }
   Int       getPhaseVerLuma(Int x) { return m_phaseVerLuma[x]; }
@@ -259,5 +245,4 @@
   Bool      getResamplePhaseSetPresentFlag(Int x) { return m_resamplePhaseSetPresentFlag[x]; }
   Void      setResamplePhaseSetPresentFlag(Int x, Bool b) { m_resamplePhaseSetPresentFlag[x] = b; }
-#endif
 
   TComPic** getIlpList() { return m_cIlpPic; }
