Index: branches/SHM-2.1-dev/source/Lib/TLibCommon/TComDataCU.cpp
===================================================================
--- branches/SHM-2.1-dev/source/Lib/TLibCommon/TComDataCU.cpp	(revision 287)
+++ branches/SHM-2.1-dev/source/Lib/TLibCommon/TComDataCU.cpp	(revision 288)
@@ -4270,6 +4270,6 @@
 #if SIMPLIFIED_MV_POS_SCALING
 #if SCALED_REF_LAYER_OFFSETS
-  Int leftStartL = this->getSlice()->getSPS()->getScaledRefLayerWindow().getWindowLeftOffset();
-  Int topStartL  = this->getSlice()->getSPS()->getScaledRefLayerWindow().getWindowTopOffset();
+  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;
Index: branches/SHM-2.1-dev/source/Lib/TLibCommon/TComSlice.cpp
===================================================================
--- branches/SHM-2.1-dev/source/Lib/TLibCommon/TComSlice.cpp	(revision 287)
+++ branches/SHM-2.1-dev/source/Lib/TLibCommon/TComSlice.cpp	(revision 288)
@@ -580,5 +580,5 @@
     {
       Int numResampler = 0;
-      const Window &scalEL = getSPS()->getScaledRefLayerWindow();
+      const Window &scalEL = getSPS()->getScaledRefLayerWindow(m_interLayerPredLayerIdc[i]);
       Int scalingOffset = ((scalEL.getWindowLeftOffset()   == 0 ) && 
                            (scalEL.getWindowRightOffset()  == 0 ) && 
@@ -1765,4 +1765,7 @@
 #if SVC_EXTENSION
 , m_layerId(0)
+#endif
+#if SCALED_REF_LAYER_OFFSETS
+, m_numScaledRefLayerOffsets  (0)
 #endif
 {
Index: branches/SHM-2.1-dev/source/Lib/TLibCommon/TComSlice.h
===================================================================
--- branches/SHM-2.1-dev/source/Lib/TLibCommon/TComSlice.h	(revision 287)
+++ branches/SHM-2.1-dev/source/Lib/TLibCommon/TComSlice.h	(revision 288)
@@ -1029,5 +1029,6 @@
 #endif
 #if SCALED_REF_LAYER_OFFSETS
-  Window      m_scaledRefLayerWindow;
+  UInt        m_numScaledRefLayerOffsets;
+  Window      m_scaledRefLayerWindow[MAX_LAYERS];
 #endif
 public:
@@ -1171,5 +1172,7 @@
 #endif
 #if SCALED_REF_LAYER_OFFSETS
-  Window&  getScaledRefLayerWindow(     )   { return m_scaledRefLayerWindow; }
+  UInt     getNumScaledRefLayerOffsets()  { return m_numScaledRefLayerOffsets; }
+  Void     setNumScaledRefLayerOffsets(Int x)  { m_numScaledRefLayerOffsets = x; }
+  Window&  getScaledRefLayerWindow( Int x )   { return m_scaledRefLayerWindow[x]; }
 #endif
 };
Index: branches/SHM-2.1-dev/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- branches/SHM-2.1-dev/source/Lib/TLibCommon/TypeDef.h	(revision 287)
+++ branches/SHM-2.1-dev/source/Lib/TLibCommon/TypeDef.h	(revision 288)
@@ -45,5 +45,5 @@
 #if SVC_EXTENSION
 #define SPS_EXTENSION                    1      ///< Define sps_extension() syntax structure
-#define SCALED_REF_LAYER_OFFSET_FLAG     1      ///< M0309: Signal scaled reference layer offsets in SPS
+#define SCALED_REF_LAYER_OFFSET_FLAG     0      ///< M0309: Signal scaled reference layer offsets in SPS
 #define SCALED_REF_LAYER_OFFSETS         1      ///< M0309: Signal scaled reference layer offsets in SPS
 #define MAX_LAYERS                       2      ///< max number of layers the codec is supposed to handle
Index: branches/SHM-2.1-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp
===================================================================
--- branches/SHM-2.1-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 287)
+++ branches/SHM-2.1-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 288)
@@ -764,10 +764,14 @@
 #endif
   {
-    Int iCode;
-    Window& scaledWindow = pcSPS->getScaledRefLayerWindow();
-    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);
+    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);
+      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);
+    }
   }
 #endif
Index: branches/SHM-2.1-dev/source/Lib/TLibDecoder/TDecTop.cpp
===================================================================
--- branches/SHM-2.1-dev/source/Lib/TLibDecoder/TDecTop.cpp	(revision 287)
+++ branches/SHM-2.1-dev/source/Lib/TLibDecoder/TDecTop.cpp	(revision 288)
@@ -255,5 +255,5 @@
       for(UInt i = 0; i < pcSlice->getVPS()->getNumDirectRefLayers( m_layerId ); i++ )
       {
-        const Window scalEL = pcSlice->getSPS()->getScaledRefLayerWindow();
+        const Window scalEL = pcSlice->getSPS()->getScaledRefLayerWindow(i);
         Bool zeroOffsets = ( scalEL.getWindowLeftOffset() == 0 && scalEL.getWindowRightOffset() == 0 && scalEL.getWindowTopOffset() == 0 && scalEL.getWindowBottomOffset() == 0 );
 
@@ -865,5 +865,5 @@
 #if SIMPLIFIED_MV_POS_SCALING
 #if SCALED_REF_LAYER_OFFSETS
-        const Window &scalEL = pcSlice->getSPS()->getScaledRefLayerWindow();
+        const Window &scalEL = pcSlice->getSPS()->getScaledRefLayerWindow(refLayerIdc);
 
         Int widthBL   = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getWidth();
@@ -893,5 +893,5 @@
         {    
 #if SCALED_REF_LAYER_OFFSETS
-          m_cPrediction.upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), pcSlice->getSPS()->getScaledRefLayerWindow() );
+          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() );
Index: branches/SHM-2.1-dev/source/Lib/TLibEncoder/TEncCavlc.cpp
===================================================================
--- branches/SHM-2.1-dev/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 287)
+++ branches/SHM-2.1-dev/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 288)
@@ -584,9 +584,13 @@
 #endif
   {
-    Window scaledWindow = pcSPS->getScaledRefLayerWindow();
-    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" );
+    WRITE_UVLC( pcSPS->getNumScaledRefLayerOffsets(),      "num_scaled_ref_layer_offsets" );
+    for(Int i = 0; i < pcSPS->getNumScaledRefLayerOffsets(); i++)
+    {
+      Window scaledWindow = pcSPS->getScaledRefLayerWindow(i);
+      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
Index: branches/SHM-2.1-dev/source/Lib/TLibEncoder/TEncGOP.cpp
===================================================================
--- branches/SHM-2.1-dev/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 287)
+++ branches/SHM-2.1-dev/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 288)
@@ -547,5 +547,5 @@
 #if SIMPLIFIED_MV_POS_SCALING
 #if SCALED_REF_LAYER_OFFSETS
-        const Window &scalEL = m_pcEncTop->getScaledRefLayerWindow();
+        const Window &scalEL = m_pcEncTop->getScaledRefLayerWindow(refLayerIdc);
 
         Int widthBL   = pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec()->getWidth();
@@ -575,5 +575,5 @@
         { 
 #if SCALED_REF_LAYER_OFFSETS
-          m_pcPredSearch->upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec(), pcSlice->getSPS()->getScaledRefLayerWindow() );
+          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() );
Index: branches/SHM-2.1-dev/source/Lib/TLibEncoder/TEncTop.cpp
===================================================================
--- branches/SHM-2.1-dev/source/Lib/TLibEncoder/TEncTop.cpp	(revision 287)
+++ branches/SHM-2.1-dev/source/Lib/TLibEncoder/TEncTop.cpp	(revision 288)
@@ -89,4 +89,7 @@
   m_bMFMEnabledFlag = false;
 #endif
+#if SCALED_REF_LAYER_OFFSETS
+  m_numScaledRefLayerOffsets = 0;
+#endif
 }
 
@@ -509,5 +512,5 @@
         for(UInt i = 0; i < m_cVPS.getNumDirectRefLayers( m_layerId ); i++ )
         {
-          const Window scalEL = getSPS()->getScaledRefLayerWindow();
+          const Window scalEL = getSPS()->getScaledRefLayerWindow(i);
           Bool zeroOffsets = ( scalEL.getWindowLeftOffset() == 0 && scalEL.getWindowRightOffset() == 0 && scalEL.getWindowTopOffset() == 0 && scalEL.getWindowBottomOffset() == 0 );
 
@@ -546,5 +549,5 @@
         for(UInt i = 0; i < m_cVPS.getNumDirectRefLayers( m_layerId ); i++ )
         {
-          const Window scalEL = getSPS()->getScaledRefLayerWindow();
+          const Window scalEL = getSPS()->getScaledRefLayerWindow(i);
           Bool zeroOffsets = ( scalEL.getWindowLeftOffset() == 0 && scalEL.getWindowRightOffset() == 0 && scalEL.getWindowTopOffset() == 0 && scalEL.getWindowBottomOffset() == 0 );
 
@@ -599,5 +602,9 @@
 #endif
 #if SCALED_REF_LAYER_OFFSETS
-  m_cSPS.getScaledRefLayerWindow() = m_scaledRefLayerWindow;
+  m_cSPS.setNumScaledRefLayerOffsets(m_numScaledRefLayerOffsets);
+  for(Int i = 0; i < m_cSPS.getNumScaledRefLayerOffsets(); i++)
+  {
+    m_cSPS.getScaledRefLayerWindow(i) = m_scaledRefLayerWindow[i];
+  }
 #endif
   ProfileTierLevel& profileTierLevel = *m_cSPS.getPTL()->getGeneralPTL();
Index: branches/SHM-2.1-dev/source/Lib/TLibEncoder/TEncTop.h
===================================================================
--- branches/SHM-2.1-dev/source/Lib/TLibEncoder/TEncTop.h	(revision 287)
+++ branches/SHM-2.1-dev/source/Lib/TLibEncoder/TEncTop.h	(revision 288)
@@ -140,5 +140,6 @@
 #endif
 #if SCALED_REF_LAYER_OFFSETS
-  Window                  m_scaledRefLayerWindow;
+  UInt                    m_numScaledRefLayerOffsets;
+  Window                  m_scaledRefLayerWindow[MAX_LAYERS];
 #endif
 protected:
@@ -207,5 +208,7 @@
 #endif
 #if SCALED_REF_LAYER_OFFSETS
-  Window&  getScaledRefLayerWindow()            { return m_scaledRefLayerWindow; }
+  Void                    setNumScaledRefLayerOffsets(Int x) { m_numScaledRefLayerOffsets = x; }
+  UInt                    getNumScaledRefLayerOffsets() { return m_numScaledRefLayerOffsets; }
+  Window&  getScaledRefLayerWindow(Int x)            { return m_scaledRefLayerWindow[x]; }
 #endif
 
