Index: /branches/SHM-4.0-dev/source/App/TAppEncoder/TAppEncCfg.cpp
===================================================================
--- /branches/SHM-4.0-dev/source/App/TAppEncoder/TAppEncCfg.cpp	(revision 447)
+++ /branches/SHM-4.0-dev/source/App/TAppEncoder/TAppEncCfg.cpp	(revision 448)
@@ -392,5 +392,4 @@
   string* cfg_predLayerIdsPtr    [MAX_LAYERS];
 #endif
-#if SCALED_REF_LAYER_OFFSETS
   string    cfg_scaledRefLayerLeftOffset [MAX_LAYERS];
   string    cfg_scaledRefLayerTopOffset [MAX_LAYERS];
@@ -403,5 +402,4 @@
   string*    cfg_scaledRefLayerRightOffsetPtr  [MAX_LAYERS];
   string*    cfg_scaledRefLayerBottomOffsetPtr [MAX_LAYERS];
-#endif
 #if RC_SHVC_HARMONIZATION
   Bool*   cfg_RCEnableRateControl  [MAX_LAYERS];
@@ -455,5 +453,4 @@
     cfg_predLayerIdsPtr     [layer]  = &cfg_predLayerIds[layer];
 #endif
-#if SCALED_REF_LAYER_OFFSETS
     cfg_numScaledRefLayerOffsets [layer] = &m_acLayerCfg[layer].m_numScaledRefLayerOffsets;
     for(Int i = 0; i < MAX_LAYERS; i++)
@@ -464,5 +461,4 @@
       cfg_scaledRefLayerBottomOffsetPtr[layer] = &cfg_scaledRefLayerBottomOffset[layer];
     }
-#endif
 #if RC_SHVC_HARMONIZATION
     cfg_RCEnableRateControl[layer]   = &m_acLayerCfg[layer].m_RCEnableRateControl;
@@ -487,10 +483,10 @@
   string  cfg_tileSets;
 #endif
-#else
+#else //SVC_EXTENSION
   string cfg_InputFile;
   string cfg_BitstreamFile;
   string cfg_ReconFile;
   string cfg_dQPFile;
-#endif
+#endif //SVC_EXTENSION
   string cfg_ColumnWidth;
   string cfg_RowHeight;
@@ -546,5 +542,4 @@
   ("OutputBitDepthC",         m_outputBitDepthC,   0, "As per OutputBitDepth but for chroma component. (default:InternalBitDepthC)")
   ("InternalBitDepthC",       m_internalBitDepthC, 0, "As per InternalBitDepth but for chroma component. (default:IntrenalBitDepth)")
-#if SCALED_REF_LAYER_OFFSETS
   ("NumScaledRefLayerOffsets%d",    cfg_numScaledRefLayerOffsets,     0, MAX_LAYERS,  "Number of scaled offset layer sets ")
   ("ScaledRefLayerLeftOffset%d",   cfg_scaledRefLayerLeftOffsetPtr,  string(""), MAX_LAYERS, "Horizontal offset of top-left luma sample of scaled base layer picture with respect to"
@@ -556,5 +551,4 @@
   ("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")
-#endif
 #if N0120_MAX_TID_REF_CFG
   ("MaxTidRefPresentFlag", m_maxTidRefPresentFlag, true, "max_tid_ref_present_flag (0: not present, 1: present(default)) " )
@@ -572,5 +566,5 @@
   ("IlSampleOnlyPred%d",       m_ilSampleOnlyPred, 0, MAX_LAYERS, "Set inter_layer_sample_pred_only_flag for all slices")
 #endif
-#else
+#else //SVC_EXTENSION
   ("InputFile,i",           cfg_InputFile,     string(""), "Original YUV input file name")
   ("BitstreamFile,b",       cfg_BitstreamFile, string(""), "Bitstream output file name")
@@ -593,5 +587,5 @@
   ("ConfBottom",            m_confBottom,          0, "Bottom offset for window conformance mode 3")
   ("FrameRate,-fr",         m_iFrameRate,          0, "Frame rate")
-#endif
+#endif //SVC_EXTENSION
 
   //Field coding parameters
@@ -978,10 +972,10 @@
   m_BLSyntaxFile = cfg_BLSyntaxFile.empty() ? NULL : strdup(cfg_BLSyntaxFile.c_str());
 #endif
-#else
+#else //SVC_EXTENSION
   m_pchInputFile = cfg_InputFile.empty() ? NULL : strdup(cfg_InputFile.c_str());
   m_pchBitstreamFile = cfg_BitstreamFile.empty() ? NULL : strdup(cfg_BitstreamFile.c_str());
   m_pchReconFile = cfg_ReconFile.empty() ? NULL : strdup(cfg_ReconFile.c_str());
   m_pchdQPFile = cfg_dQPFile.empty() ? NULL : strdup(cfg_dQPFile.c_str());
-#endif  
+#endif //SVC_EXTENSION 
 
   Char* pColumnWidth = cfg_ColumnWidth.empty() ? NULL: strdup(cfg_ColumnWidth.c_str());
@@ -1042,5 +1036,5 @@
     m_pRowHeight = NULL;
   }
-#if SCALED_REF_LAYER_OFFSETS
+#if SVC_EXTENSION
   for(Int layer = 0; layer < MAX_LAYERS; layer++)
   {
@@ -1112,5 +1106,4 @@
     }
   }
-#endif
 #if VPS_EXTN_DIRECT_REF_LAYERS
 #if M0457_PREDICTION_INDICATIONS
@@ -1242,4 +1235,5 @@
   }
 #endif
+#endif //SVC_EXTENSION
   m_scalingListFile = cfg_ScalingListFile.empty() ? NULL : strdup(cfg_ScalingListFile.c_str());
 
@@ -2516,5 +2510,5 @@
 }
 
-#if SCALED_REF_LAYER_OFFSETS
+#if SVC_EXTENSION
 Void TAppEncCfg::cfgStringToArray(Int **arr, string cfgString, Int numEntries, const char* logString)
 {
@@ -2549,5 +2543,4 @@
   }
 }
-#endif
 
 #if FINAL_RPL_CHANGE_N0082
@@ -2765,3 +2758,4 @@
 }
 #endif
+#endif //SVC_EXTENSION
 //! \}
Index: /branches/SHM-4.0-dev/source/App/TAppEncoder/TAppEncCfg.h
===================================================================
--- /branches/SHM-4.0-dev/source/App/TAppEncoder/TAppEncCfg.h	(revision 447)
+++ /branches/SHM-4.0-dev/source/App/TAppEncoder/TAppEncCfg.h	(revision 448)
@@ -407,7 +407,5 @@
   Char* getBLSyntaxFile()           { return m_BLSyntaxFile;      }
 #endif
-#if SCALED_REF_LAYER_OFFSETS
   Void cfgStringToArray(Int **arr, string cfgString, Int numEntries, const char* logString);
-#endif
 #if REPN_FORMAT_IN_VPS
   RepFormatCfg* getRepFormatCfg(Int i)  { return &m_repFormatCfg[i]; }
Index: /branches/SHM-4.0-dev/source/App/TAppEncoder/TAppEncLayerCfg.cpp
===================================================================
--- /branches/SHM-4.0-dev/source/App/TAppEncoder/TAppEncLayerCfg.cpp	(revision 447)
+++ /branches/SHM-4.0-dev/source/App/TAppEncoder/TAppEncLayerCfg.cpp	(revision 448)
@@ -38,5 +38,4 @@
   m_confLeft = m_confRight = m_confTop = m_confBottom = 0;
   m_aiPad[1] = m_aiPad[0] = 0;
-#if SCALED_REF_LAYER_OFFSETS
   m_numScaledRefLayerOffsets = 0;
   ::memset(m_scaledRefLayerLeftOffset,   0, sizeof(m_scaledRefLayerLeftOffset));
@@ -44,5 +43,4 @@
   ::memset(m_scaledRefLayerRightOffset,  0, sizeof(m_scaledRefLayerRightOffset));
   ::memset(m_scaledRefLayerBottomOffset, 0, sizeof(m_scaledRefLayerBottomOffset));
-#endif
 }
 
@@ -332,5 +330,5 @@
 }
 
-#endif
+#endif //SVC_EXTENSION
 
 
Index: /branches/SHM-4.0-dev/source/App/TAppEncoder/TAppEncLayerCfg.h
===================================================================
--- /branches/SHM-4.0-dev/source/App/TAppEncoder/TAppEncLayerCfg.h	(revision 447)
+++ /branches/SHM-4.0-dev/source/App/TAppEncoder/TAppEncLayerCfg.h	(revision 448)
@@ -43,4 +43,5 @@
   Int       m_iIntraPeriod;                                   ///< period of I-slice (random access period)
   Double    m_fQP;                                            ///< QP value of key-picture (floating point)
+#if SVC_EXTENSION
 #if VPS_EXTN_DIRECT_REF_LAYERS
 #if M0457_PREDICTION_INDICATIONS
@@ -84,7 +85,6 @@
   Int       m_maxTidIlRefPicsPlus1;
 #endif 
-#if SVC_EXTENSION
   Int       m_iWaveFrontSubstreams; //< If iWaveFrontSynchro, this is the number of substreams per frame (dependent tiles) or per tile (independent tiles).
-#endif
+#endif //SVC_EXTENSION
 
   Int       m_iQP;                                            ///< QP value of key-picture (integer)
@@ -92,5 +92,5 @@
   Int*      m_aidQP;                                          ///< array of slice QP values
   TAppEncCfg* m_cAppEncCfg;                                   ///< pointer to app encoder config
-#if SCALED_REF_LAYER_OFFSETS
+#if SVC_EXTENSION
   Int       m_numScaledRefLayerOffsets  ;
   Int       m_scaledRefLayerLeftOffset  [MAX_LAYERS];
@@ -98,5 +98,4 @@
   Int       m_scaledRefLayerRightOffset [MAX_LAYERS];
   Int       m_scaledRefLayerBottomOffset[MAX_LAYERS];
-#endif  
 #if FINAL_RPL_CHANGE_N0082
   GOPEntry  m_GOPListLayer[MAX_GOP];                            ///< for layer
@@ -105,4 +104,5 @@
   Int       m_repFormatIdx;
 #endif
+#endif //SVC_EXTENSION
 public:
   TAppEncLayerCfg();
@@ -139,4 +139,5 @@
   Int     getIntQP()                  {return m_iQP;              } 
   Int*    getdQPs()                   {return m_aidQP;            }
+#if SVC_EXTENSION
 #if VPS_EXTN_DIRECT_REF_LAYERS
 #if M0457_PREDICTION_INDICATIONS
@@ -183,4 +184,5 @@
   UInt getMaxCUDepth()             {return m_uiMaxCUDepth;      }
 #endif
+#endif //SVC_EXTENSION
 }; // END CLASS DEFINITION TAppEncLayerCfg
 
Index: /branches/SHM-4.0-dev/source/App/TAppEncoder/TAppEncTop.cpp
===================================================================
--- /branches/SHM-4.0-dev/source/App/TAppEncoder/TAppEncTop.cpp	(revision 447)
+++ /branches/SHM-4.0-dev/source/App/TAppEncoder/TAppEncTop.cpp	(revision 448)
@@ -561,5 +561,4 @@
     m_acTEncTop[layer].setLog2MaxMvLengthVertical( m_log2MaxMvLengthVertical );
     m_acTEncTop[layer].setElRapSliceTypeB(layer == 0? 0 : m_elRapSliceBEnabled);
-#if SCALED_REF_LAYER_OFFSETS
     if( layer > 0 )
     {
@@ -571,5 +570,4 @@
       }
     }
-#endif
 #if M0040_ADAPTIVE_RESOLUTION_CHANGE
     m_acTEncTop[layer].setAdaptiveResolutionChange( m_adaptiveResolutionChange );
@@ -577,5 +575,5 @@
   }
 }
-#else
+#else //SVC_EXTENSION
 Void TAppEncTop::xInitLibCfg()
 {
@@ -851,5 +849,5 @@
   m_cTEncTop.setLog2MaxMvLengthVertical( m_log2MaxMvLengthVertical );
 }
-#endif
+#endif //SVC_EXTENSION
 
 Void TAppEncTop::xCreateLib()
@@ -878,5 +876,5 @@
     m_acTEncTop[layer].create();
   }
-#else
+#else //SVC_EXTENSION
   m_cTVideoIOYuvInputFile.open( m_pchInputFile,     false, m_inputBitDepthY, m_inputBitDepthC, m_internalBitDepthY, m_internalBitDepthC );  // read  mode
   m_cTVideoIOYuvInputFile.skipFrames(m_FrameSkip, m_iSourceWidth - m_aiPad[0], m_iSourceHeight - m_aiPad[1]);
@@ -887,5 +885,5 @@
   // Neo Decoder
   m_cTEncTop.create();
-#endif
+#endif //SVC_EXTENSION
 }
 
@@ -911,5 +909,5 @@
     m_acTEncTop[layer].destroy();
   }
-#else
+#else //SVC_EXTENSION
   m_cTVideoIOYuvInputFile.close();
   m_cTVideoIOYuvReconFile.close();
@@ -917,5 +915,5 @@
   // Neo Decoder
   m_cTEncTop.destroy();
-#endif
+#endif //SVC_EXTENSION
 }
 
Index: /branches/SHM-4.0-dev/source/Lib/TLibCommon/TComDataCU.cpp
===================================================================
--- /branches/SHM-4.0-dev/source/Lib/TLibCommon/TComDataCU.cpp	(revision 447)
+++ /branches/SHM-4.0-dev/source/Lib/TLibCommon/TComDataCU.cpp	(revision 448)
@@ -4008,13 +4008,8 @@
 #endif
 
-#if SCALED_REF_LAYER_OFFSETS
   Int leftStartL = this->getSlice()->getSPS()->getScaledRefLayerWindow(refLayerIdc).getWindowLeftOffset();
   Int topStartL  = this->getSlice()->getSPS()->getScaledRefLayerWindow(refLayerIdc).getWindowTopOffset();
   Int iBX = ((uiPelX - leftStartL)*g_posScalingFactor[refLayerIdc][0] + (1<<15)) >> 16;
   Int iBY = ((uiPelY - topStartL )*g_posScalingFactor[refLayerIdc][1] + (1<<15)) >> 16;
-#else
-  Int iBX = (uiPelX*g_posScalingFactor[refLayerIdc][0] + (1<<15)) >> 16;
-  Int iBY = (uiPelY*g_posScalingFactor[refLayerIdc][1] + (1<<15)) >> 16;
-#endif
 
 #if N0139_POSITION_ROUNDING_OFFSET
@@ -4026,10 +4021,6 @@
 #endif
 
-#if SCALED_REF_LAYER_OFFSETS
   if ( iBX >= cBaseColPic->getPicYuvRec()->getWidth() || iBY >= cBaseColPic->getPicYuvRec()->getHeight() ||
        iBX < 0                                        || iBY < 0                                           )
-#else
-  if ( iBX >= cBaseColPic->getPicYuvRec()->getWidth() || iBY >= cBaseColPic->getPicYuvRec()->getHeight())
-#endif
   {
     return NULL;
Index: /branches/SHM-4.0-dev/source/Lib/TLibCommon/TComPrediction.cpp
===================================================================
--- /branches/SHM-4.0-dev/source/Lib/TLibCommon/TComPrediction.cpp	(revision 447)
+++ /branches/SHM-4.0-dev/source/Lib/TLibCommon/TComPrediction.cpp	(revision 448)
@@ -765,15 +765,8 @@
 
 #if SVC_UPSAMPLING
-#if SCALED_REF_LAYER_OFFSETS
 Void TComPrediction::upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window)
 {
   m_cUsf.upsampleBasePic( refLayerIdc, pcUsPic, pcBasePic, pcTempPic, window);
 }
-#else
-Void TComPrediction::upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic)
-{
-  m_cUsf.upsampleBasePic( refLayerIdc, pcUsPic, pcBasePic, pcTempPic);
-}
-#endif
 #endif
 //! \}
Index: /branches/SHM-4.0-dev/source/Lib/TLibCommon/TComPrediction.h
===================================================================
--- /branches/SHM-4.0-dev/source/Lib/TLibCommon/TComPrediction.h	(revision 447)
+++ /branches/SHM-4.0-dev/source/Lib/TLibCommon/TComPrediction.h	(revision 448)
@@ -120,11 +120,7 @@
 #if SVC_EXTENSION
 #if SVC_UPSAMPLING
-#if SCALED_REF_LAYER_OFFSETS
   Void upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window );
-#else
-  Void upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic );
 #endif
-#endif
-#endif
+#endif //SVC_EXTENSION
 };
 
Index: /branches/SHM-4.0-dev/source/Lib/TLibCommon/TComSlice.cpp
===================================================================
--- /branches/SHM-4.0-dev/source/Lib/TLibCommon/TComSlice.cpp	(revision 447)
+++ /branches/SHM-4.0-dev/source/Lib/TLibCommon/TComSlice.cpp	(revision 448)
@@ -2167,17 +2167,15 @@
 , m_vuiParametersPresentFlag  (false)
 , m_vuiParameters             ()
+#if SVC_EXTENSION
 #if M0463_VUI_EXT_ILP_REF
 , m_interViewMvVertConstraintFlag (false)
 , m_numIlpRestrictedRefLayers ( 0 )
 #endif
-#if SVC_EXTENSION
-, m_layerId(0)
-#endif
-#if SCALED_REF_LAYER_OFFSETS
-, m_numScaledRefLayerOffsets  (0)
-#endif
+, m_layerId                   ( 0 )
+, m_numScaledRefLayerOffsets  ( 0 )
 #if REPN_FORMAT_IN_VPS
 , m_updateRepFormatFlag       (false)
 #endif
+#endif //SVC_EXTENSION
 {
   for ( Int i = 0; i < MAX_TLAYER; i++ )
Index: /branches/SHM-4.0-dev/source/Lib/TLibCommon/TComSlice.h
===================================================================
--- /branches/SHM-4.0-dev/source/Lib/TLibCommon/TComSlice.h	(revision 447)
+++ /branches/SHM-4.0-dev/source/Lib/TLibCommon/TComSlice.h	(revision 448)
@@ -1132,4 +1132,5 @@
   TComPTL     m_pcPTL;
 
+#if SVC_EXTENSION
 #if M0463_VUI_EXT_ILP_REF
   Bool        m_interViewMvVertConstraintFlag;
@@ -1140,5 +1141,4 @@
 #endif
 
-#if SVC_EXTENSION
   UInt m_layerId;
 
@@ -1150,5 +1150,4 @@
 #endif
 
-#endif
 #if REF_IDX_MFM
 #if !M0457_COL_PICTURE_SIGNALING
@@ -1156,11 +1155,10 @@
 #endif
 #endif
-#if SCALED_REF_LAYER_OFFSETS
   UInt        m_numScaledRefLayerOffsets;
   Window      m_scaledRefLayerWindow[MAX_LAYERS];
-#endif
 #if REPN_FORMAT_IN_VPS
   Bool m_updateRepFormatFlag;
 #endif
+#endif //SVC_EXTENSION
 public:
   TComSPS();
@@ -1323,5 +1321,4 @@
   Void     setLayerId(UInt layerId) { m_layerId = layerId; }
   UInt     getLayerId() { return m_layerId; }
-#endif
 #if REF_IDX_MFM
 #if !M0457_COL_PICTURE_SIGNALING
@@ -1330,13 +1327,12 @@
 #endif
 #endif
-#if SCALED_REF_LAYER_OFFSETS
   UInt     getNumScaledRefLayerOffsets()  { return m_numScaledRefLayerOffsets; }
   Void     setNumScaledRefLayerOffsets(Int x)  { m_numScaledRefLayerOffsets = x; }
   Window&  getScaledRefLayerWindow( Int x )   { return m_scaledRefLayerWindow[x]; }
-#endif
 #if REPN_FORMAT_IN_VPS
   Bool     getUpdateRepFormatFlag()       { return m_updateRepFormatFlag; }
   Void     setUpdateRepFormatFlag(Bool x) { m_updateRepFormatFlag = x;    }
 #endif
+#endif //SVC_EXTENSION
 };
 
Index: /branches/SHM-4.0-dev/source/Lib/TLibCommon/TComUpsampleFilter.cpp
===================================================================
--- /branches/SHM-4.0-dev/source/Lib/TLibCommon/TComUpsampleFilter.cpp	(revision 447)
+++ /branches/SHM-4.0-dev/source/Lib/TLibCommon/TComUpsampleFilter.cpp	(revision 448)
@@ -97,9 +97,5 @@
 }
 
-#if SCALED_REF_LAYER_OFFSETS
 Void TComUpsampleFilter::upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window )
-#else
-Void TComUpsampleFilter::upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic )
-#endif
 {
   assert ( NTAPS_US_LUMA == 8 );
@@ -109,5 +105,4 @@
 
   //========== Y component upsampling ===========
-#if SCALED_REF_LAYER_OFFSETS
   const Window &scalEL = window;
 
@@ -119,16 +114,5 @@
   Int heightEL  = pcUsPic->getHeight() - scalEL.getWindowTopOffset()  - scalEL.getWindowBottomOffset();
   Int strideEL  = pcUsPic->getStride();
-#else
-  const Window &confBL = pcBasePic->getConformanceWindow();
-  const Window &confEL = pcUsPic->getConformanceWindow();
-
-  Int widthBL   = pcBasePic->getWidth () - confBL.getWindowLeftOffset() - confBL.getWindowRightOffset();
-  Int heightBL  = pcBasePic->getHeight() - confBL.getWindowTopOffset() - confBL.getWindowBottomOffset();
-  Int strideBL  = pcBasePic->getStride();
-
-  Int widthEL   = pcUsPic->getWidth () - confEL.getWindowLeftOffset() - confEL.getWindowRightOffset();
-  Int heightEL  = pcUsPic->getHeight() - confEL.getWindowTopOffset() - confEL.getWindowBottomOffset();
-  Int strideEL  = pcUsPic->getStride();
-#endif
+
   Pel* piTempBufY = pcTempPic->getLumaAddr();
   Pel* piSrcBufY  = pcBasePic->getLumaAddr();
@@ -238,5 +222,5 @@
     widthBL   = pcBasePic->getWidth ();
     heightBL  = min<Int>( pcBasePic->getHeight(), heightEL );
-#if SCALED_REF_LAYER_OFFSETS
+
     Int leftStartL = scalEL.getWindowLeftOffset();
     Int rightEndL  = pcUsPic->getWidth() - scalEL.getWindowRightOffset();
@@ -246,5 +230,4 @@
     Int leftOffset = leftStartL > 0 ? leftStartL : 0;
 #endif
-#endif
 
 #if  N0214_INTERMEDIATE_BUFFER_16BITS
@@ -255,10 +238,6 @@
     for( i = 0; i < widthEL; i++ )
     {
-#if SCALED_REF_LAYER_OFFSETS
       Int x = Clip3( leftStartL, rightEndL - 1, i );
       refPos16 = (((x - leftStartL)*scaleX + addX) >> shiftXM4) - deltaX;
-#else
-      refPos16 = ((i*scaleX + addX) >> shiftXM4) - deltaX;
-#endif
       phase    = refPos16 & 15;
       refPos   = refPos16 >> 4;
@@ -293,16 +272,8 @@
     Int iOffset = 1 << (nShift - 1); 
 
-#if SCALED_REF_LAYER_OFFSETS
     for( j = 0; j < pcTempPic->getHeight(); j++ )
-#else
-    for( j = 0; j < heightEL; j++ )
-#endif
-    {
-#if SCALED_REF_LAYER_OFFSETS
+    {
       Int y = Clip3(topStartL, bottomEndL - 1, j);
       refPos16 = ((( y - topStartL )*scaleY + addY) >> shiftYM4) - deltaY;
-#else
-      refPos16 = ((j*scaleY + addY) >> shiftYM4) - deltaY;
-#endif
       phase    = refPos16 & 15;
       refPos   = refPos16 >> 4;
@@ -310,5 +281,4 @@
 
       piSrcY = piTempBufY + (refPos -((NTAPS_US_LUMA>>1) - 1))*strideEL;
-#if SCALED_REF_LAYER_OFFSETS
 #if BUGFIX_RESAMPLE
       Pel* piDstY0 = piDstBufY + j * strideEL;            
@@ -376,17 +346,6 @@
 #endif
 #endif
-#else
-      piDstY = piDstBufY + j * strideEL;
-
-      for( i = 0; i < widthEL; i++ )
-      {
-        *piDstY = ClipY( (sumLumaVer(piSrcY, coeff, strideEL) + iOffset) >> (nShift));
-        piSrcY++;
-        piDstY++;
-      }
-#endif
-    }
-
-#if SCALED_REF_LAYER_OFFSETS
+    }
+
     widthBL   = pcBasePic->getWidth ();
     heightBL  = pcBasePic->getHeight();
@@ -394,11 +353,4 @@
     widthEL   = pcUsPic->getWidth () - scalEL.getWindowLeftOffset() - scalEL.getWindowRightOffset();
     heightEL  = pcUsPic->getHeight() - scalEL.getWindowTopOffset()  - scalEL.getWindowBottomOffset();
-#else
-    widthBL   = pcBasePic->getWidth () - confBL.getWindowLeftOffset() - confBL.getWindowRightOffset();
-    heightBL  = pcBasePic->getHeight() - confBL.getWindowTopOffset() - confBL.getWindowBottomOffset();
-
-    widthEL   = pcUsPic->getWidth () - confEL.getWindowLeftOffset() - confEL.getWindowRightOffset();
-    heightEL  = pcUsPic->getHeight() - confEL.getWindowTopOffset() - confEL.getWindowBottomOffset();
-#endif
 
     //========== UV component upsampling ===========
@@ -412,5 +364,5 @@
     strideBL  = pcBasePic->getCStride();
     strideEL  = pcUsPic->getCStride();
-#if SCALED_REF_LAYER_OFFSETS
+
     Int leftStartC = scalEL.getWindowLeftOffset() >> 1;
     Int rightEndC  = (pcUsPic->getWidth() >> 1) - (scalEL.getWindowRightOffset() >> 1);
@@ -420,5 +372,4 @@
     leftOffset = leftStartC > 0 ? leftStartC : 0;
 #endif
-#endif
 
     shiftX = 16;
@@ -455,10 +406,6 @@
     for( i = 0; i < widthEL; i++ )
     {
-#if SCALED_REF_LAYER_OFFSETS
       Int x = Clip3(leftStartC, rightEndC - 1, i);
       refPos16 = (((x - leftStartC)*scaleX + addX) >> shiftXM4) - deltaX;
-#else
-      refPos16 = ((i*scaleX + addX) >> shiftXM4) - deltaX;
-#endif
       phase    = refPos16 & 15;
       refPos   = refPos16 >> 4;
@@ -498,16 +445,8 @@
 #endif
 
-#if SCALED_REF_LAYER_OFFSETS
     for( j = 0; j < pcTempPic->getHeight() >> 1; j++ )
-#else
-    for( j = 0; j < heightEL; j++ )
-#endif
-    {
-#if SCALED_REF_LAYER_OFFSETS
+    {
       Int y = Clip3(topStartC, bottomEndC - 1, j);
       refPos16 = (((y - topStartC)*scaleY + addY) >> shiftYM4) - deltaY;
-#else
-      refPos16 = ((j*scaleY + addY) >> shiftYM4) - deltaY;
-#endif
       phase    = refPos16 & 15;
       refPos   = refPos16 >> 4; 
@@ -516,5 +455,5 @@
       piSrcU = piTempBufU  + (refPos -((NTAPS_US_CHROMA>>1) - 1))*strideEL;
       piSrcV = piTempBufV  + (refPos -((NTAPS_US_CHROMA>>1) - 1))*strideEL;
-#if SCALED_REF_LAYER_OFFSETS
+
 #if BUGFIX_RESAMPLE
       Pel* piDstU0 = piDstBufU + j*strideEL;
@@ -608,18 +547,4 @@
 #endif
 #endif
-#else
-      piDstU = piDstBufU + j*strideEL;
-      piDstV = piDstBufV + j*strideEL;
-
-      for( i = 0; i < widthEL; i++ )
-      {
-        *piDstU = ClipC( (sumChromaVer(piSrcU, coeff, strideEL) + iOffset) >> (nShift));
-        *piDstV = ClipC( (sumChromaVer(piSrcV, coeff, strideEL) + iOffset) >> (nShift));
-        piSrcU++;
-        piSrcV++;
-        piDstU++;
-        piDstV++;
-      }
-#endif
     }
   }
Index: /branches/SHM-4.0-dev/source/Lib/TLibCommon/TComUpsampleFilter.h
===================================================================
--- /branches/SHM-4.0-dev/source/Lib/TLibCommon/TComUpsampleFilter.h	(revision 447)
+++ /branches/SHM-4.0-dev/source/Lib/TLibCommon/TComUpsampleFilter.h	(revision 448)
@@ -43,9 +43,5 @@
   ~TComUpsampleFilter(void);
 
-#if SCALED_REF_LAYER_OFFSETS
   Void upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window );
-#else
- Void upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic );
-#endif
 };
 
Index: /branches/SHM-4.0-dev/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- /branches/SHM-4.0-dev/source/Lib/TLibCommon/TypeDef.h	(revision 447)
+++ /branches/SHM-4.0-dev/source/Lib/TLibCommon/TypeDef.h	(revision 448)
@@ -60,5 +60,4 @@
 #define M0463_VUI_EXT_ILP_REF            0      ///< JCTVC-M0463: VUI extension inter-layer dependency offset signalling
 #define SPS_EXTENSION                    1      ///< Define sps_extension() syntax structure
-#define SCALED_REF_LAYER_OFFSETS         1      ///< JCTVC-M0309: Signal scaled reference layer offsets in SPS
 #define VERT_MV_CONSTRAINT               1      ///< Vertical MV component constraint flag
 #define SCALABILITY_MASK_E0104           1      ///< JCT3V-E0104: scalability mask for depth
Index: /branches/SHM-4.0-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp
===================================================================
--- /branches/SHM-4.0-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 447)
+++ /branches/SHM-4.0-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 448)
@@ -835,5 +835,4 @@
   assert( uiCode == 0 );
 #endif
-#if SCALED_REF_LAYER_OFFSETS
   if( pcSPS->getLayerId() > 0 )
   {
@@ -849,5 +848,4 @@
     }
   }
-#endif
 #if M0463_VUI_EXT_ILP_REF
   ////   sps_extension_vui_parameters( )
Index: /branches/SHM-4.0-dev/source/Lib/TLibDecoder/TDecTop.cpp
===================================================================
--- /branches/SHM-4.0-dev/source/Lib/TLibDecoder/TDecTop.cpp	(revision 447)
+++ /branches/SHM-4.0-dev/source/Lib/TLibDecoder/TDecTop.cpp	(revision 448)
@@ -1159,5 +1159,4 @@
 #endif
 
-#if SCALED_REF_LAYER_OFFSETS
         const Window &scalEL = pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc);
 
@@ -1167,14 +1166,5 @@
         Int widthEL   = pcPic->getPicYuvRec()->getWidth()  - scalEL.getWindowLeftOffset() - scalEL.getWindowRightOffset();
         Int heightEL  = pcPic->getPicYuvRec()->getHeight() - scalEL.getWindowTopOffset()  - scalEL.getWindowBottomOffset();
-#else
-        const Window &confBL = pcSlice->getBaseColPic()->getPicYuvRec()->getConformanceWindow();
-        const Window &confEL = pcPic->getPicYuvRec()->getConformanceWindow();
-
-        Int widthBL   = pcSlice->getBaseColPic()->getPicYuvRec()->getWidth () - confBL.getWindowLeftOffset() - confBL.getWindowRightOffset();
-        Int heightBL  = pcSlice->getBaseColPic()->getPicYuvRec()->getHeight() - confBL.getWindowTopOffset() - confBL.getWindowBottomOffset();
-
-        Int widthEL   = pcPic->getPicYuvRec()->getWidth() - confEL.getWindowLeftOffset() - confEL.getWindowRightOffset();
-        Int heightEL  = pcPic->getPicYuvRec()->getHeight() - confEL.getWindowTopOffset() - confEL.getWindowBottomOffset();
-#endif
+
         g_mvScalingFactor[refLayerIdc][0] = widthEL  == widthBL  ? 4096 : Clip3(-4096, 4095, ((widthEL  << 8) + (widthBL  >> 1)) / widthBL);
         g_mvScalingFactor[refLayerIdc][1] = heightEL == heightBL ? 4096 : Clip3(-4096, 4095, ((heightEL << 8) + (heightBL >> 1)) / heightBL);
@@ -1186,9 +1176,5 @@
         if( pcPic->isSpatialEnhLayer(refLayerIdc) )
         {    
-#if SCALED_REF_LAYER_OFFSETS
           m_cPrediction.upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc) );
-#else
-          m_cPrediction.upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec() );
-#endif
         }
         else
@@ -1268,7 +1254,5 @@
 #endif
 #endif
-
-#endif //SVC_EXTENSION
-
+    
 #if N0147_IRAP_ALIGN_FLAG
     if(  m_layerId > 0 && pcSlice->getVPS()->getCrossLayerIrapAlignFlag())
@@ -1285,4 +1269,5 @@
     }
 #endif 
+#endif //SVC_EXTENSION
     
     // For generalized B
Index: /branches/SHM-4.0-dev/source/Lib/TLibEncoder/TEncCavlc.cpp
===================================================================
--- /branches/SHM-4.0-dev/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 447)
+++ /branches/SHM-4.0-dev/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 448)
@@ -664,5 +664,4 @@
   WRITE_FLAG( 0, "inter_view_mv_vert_constraint_flag" );
 #endif
-#if SCALED_REF_LAYER_OFFSETS
   if( pcSPS->getLayerId() > 0 )
   {
@@ -677,5 +676,4 @@
     }
   }
-#endif
 #if M0463_VUI_EXT_ILP_REF
   ////   sps_extension_vui_parameters( )
Index: /branches/SHM-4.0-dev/source/Lib/TLibEncoder/TEncGOP.cpp
===================================================================
--- /branches/SHM-4.0-dev/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 447)
+++ /branches/SHM-4.0-dev/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 448)
@@ -782,5 +782,4 @@
 #endif
 
-#if SCALED_REF_LAYER_OFFSETS
         const Window &scalEL = m_pcEncTop->getScaledRefLayerWindow(refLayerIdc);
 
@@ -790,14 +789,5 @@
         Int widthEL   = pcPic->getPicYuvRec()->getWidth()  - scalEL.getWindowLeftOffset() - scalEL.getWindowRightOffset();
         Int heightEL  = pcPic->getPicYuvRec()->getHeight() - scalEL.getWindowTopOffset()  - scalEL.getWindowBottomOffset();
-#else
-        const Window &confBL = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getConformanceWindow();
-        const Window &confEL = pcPic->getPicYuvRec()->getConformanceWindow();
-
-        Int widthBL   = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getWidth () - confBL.getWindowLeftOffset() - confBL.getWindowRightOffset();
-        Int heightBL  = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getHeight() - confBL.getWindowTopOffset() - confBL.getWindowBottomOffset();
-
-        Int widthEL   = pcPic->getPicYuvRec()->getWidth() - confEL.getWindowLeftOffset() - confEL.getWindowRightOffset();
-        Int heightEL  = pcPic->getPicYuvRec()->getHeight() - confEL.getWindowTopOffset() - confEL.getWindowBottomOffset();
-#endif
+
         g_mvScalingFactor[refLayerIdc][0] = widthEL  == widthBL  ? 4096 : Clip3(-4096, 4095, ((widthEL  << 8) + (widthBL  >> 1)) / widthBL);
         g_mvScalingFactor[refLayerIdc][1] = heightEL == heightBL ? 4096 : Clip3(-4096, 4095, ((heightEL << 8) + (heightBL >> 1)) / heightBL);
@@ -809,9 +799,5 @@
         if( pcPic->isSpatialEnhLayer(refLayerIdc))
         {
-#if SCALED_REF_LAYER_OFFSETS
           m_pcPredSearch->upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc) );
-#else
-          m_pcPredSearch->upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec() );
-#endif
         }
         else
Index: /branches/SHM-4.0-dev/source/Lib/TLibEncoder/TEncTop.cpp
===================================================================
--- /branches/SHM-4.0-dev/source/Lib/TLibEncoder/TEncTop.cpp	(revision 447)
+++ /branches/SHM-4.0-dev/source/Lib/TLibEncoder/TEncTop.cpp	(revision 448)
@@ -88,11 +88,9 @@
   m_bMFMEnabledFlag = false;
 #endif
-#if SCALED_REF_LAYER_OFFSETS
   m_numScaledRefLayerOffsets = 0;
-#endif
-#endif
 #if POC_RESET_FLAG
   m_pocAdjustmentValue     = 0;
 #endif
+#endif //SVC_EXTENSION
 }
 
@@ -878,5 +876,4 @@
 #if SVC_EXTENSION
   m_cSPS.setLayerId(m_layerId);
-#endif
 #if REF_IDX_MFM
 #if !M0457_COL_PICTURE_SIGNALING
@@ -884,5 +881,4 @@
 #endif
 #endif
-#if SCALED_REF_LAYER_OFFSETS
   m_cSPS.setNumScaledRefLayerOffsets(m_numScaledRefLayerOffsets);
   for(Int i = 0; i < m_cSPS.getNumScaledRefLayerOffsets(); i++)
@@ -890,5 +886,5 @@
     m_cSPS.getScaledRefLayerWindow(i) = m_scaledRefLayerWindow[i];
   }
-#endif
+#endif //SVC_EXTENSION
   ProfileTierLevel& profileTierLevel = *m_cSPS.getPTL()->getGeneralPTL();
   profileTierLevel.setLevelIdc(m_level);
Index: /branches/SHM-4.0-dev/source/Lib/TLibEncoder/TEncTop.h
===================================================================
--- /branches/SHM-4.0-dev/source/Lib/TLibEncoder/TEncTop.h	(revision 447)
+++ /branches/SHM-4.0-dev/source/Lib/TLibEncoder/TEncTop.h	(revision 448)
@@ -140,12 +140,10 @@
   Int                     m_ilSampleOnlyPred;
 #endif
-#if SCALED_REF_LAYER_OFFSETS
   UInt                    m_numScaledRefLayerOffsets;
   Window                  m_scaledRefLayerWindow[MAX_LAYERS];
-#endif
 #if POC_RESET_FLAG
   Int                     m_pocAdjustmentValue;
 #endif
-#endif
+#endif //SVC_EXTENSION
 protected:
   Void  xGetNewPicBuffer  ( TComPic*& rpcPic );           ///< get picture buffer which will be processed
@@ -209,10 +207,8 @@
   Int                     getNumPicRcvd         () { return m_iNumPicRcvd;            }
   Void                    setNumPicRcvd         ( Int num ) { m_iNumPicRcvd = num;      }
-#if SCALED_REF_LAYER_OFFSETS
   Void                    setNumScaledRefLayerOffsets(Int x) { m_numScaledRefLayerOffsets = x; }
   UInt                    getNumScaledRefLayerOffsets() { return m_numScaledRefLayerOffsets; }
   Window&  getScaledRefLayerWindow(Int x)            { return m_scaledRefLayerWindow[x]; }
-#endif
-#endif
+#endif //SVC_EXTENSION
 
   // -------------------------------------------------------------------------------------------------------------------
