Index: branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.cpp
===================================================================
--- branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.cpp	(revision 1029)
+++ branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.cpp	(revision 1030)
@@ -815,5 +815,5 @@
 #endif
 #if O0098_SCALED_REF_LAYER_ID
-  string    cfg_scaledRefLayerId [MAX_LAYERS];
+  string    cfg_refLocationOffsetLayerId [MAX_LAYERS];
 #endif
   string    cfg_scaledRefLayerLeftOffset [MAX_LAYERS];
@@ -821,5 +821,5 @@
   string    cfg_scaledRefLayerRightOffset [MAX_LAYERS];
   string    cfg_scaledRefLayerBottomOffset [MAX_LAYERS];
-  Int*      cfg_numScaledRefLayerOffsets[MAX_LAYERS];
+  Int*      cfg_numRefLayerLocationOffsets[MAX_LAYERS];
 #if REF_REGION_OFFSET
   string    cfg_scaledRefLayerOffsetPresentFlag [MAX_LAYERS];
@@ -843,5 +843,5 @@
 
 #if O0098_SCALED_REF_LAYER_ID
-  string*    cfg_scaledRefLayerIdPtr           [MAX_LAYERS];
+  string*    cfg_refLocationOffsetLayerIdPtr   [MAX_LAYERS];
 #endif
   string*    cfg_scaledRefLayerLeftOffsetPtr   [MAX_LAYERS];
@@ -944,10 +944,10 @@
     cfg_predLayerIdsPtr     [layer]  = &cfg_predLayerIds[layer];
 #endif
-    cfg_numScaledRefLayerOffsets [layer] = &m_acLayerCfg[layer].m_numScaledRefLayerOffsets;
+    cfg_numRefLayerLocationOffsets [layer] = &m_acLayerCfg[layer].m_numRefLayerLocationOffsets;
     cfg_waveFrontSynchro[layer]  = &m_acLayerCfg[layer].m_waveFrontSynchro;
     for(Int i = 0; i < MAX_LAYERS; i++)
     {
 #if O0098_SCALED_REF_LAYER_ID
-      cfg_scaledRefLayerIdPtr          [layer] = &cfg_scaledRefLayerId[layer];
+      cfg_refLocationOffsetLayerIdPtr  [layer] = &cfg_refLocationOffsetLayerId[layer];
 #endif
       cfg_scaledRefLayerLeftOffsetPtr  [layer] = &cfg_scaledRefLayerLeftOffset[layer];
@@ -1180,7 +1180,7 @@
   ("InternalBitDepthC",                             m_internalBitDepthC,                                     0, "As per InternalBitDepth but for chroma component. (default:IntrenalBitDepth)")
 #endif
-  ("NumScaledRefLayerOffsets%d",                    cfg_numScaledRefLayerOffsets,                0, MAX_LAYERS,  "Number of scaled offset layer sets ")
+  ("NumRefLocationOffsets%d",                       cfg_numRefLayerLocationOffsets,              0, MAX_LAYERS,  "Number of reference layer offset sets ")
 #if O0098_SCALED_REF_LAYER_ID
-  ("ScaledRefLayerId%d",                            cfg_scaledRefLayerIdPtr,            string(""), MAX_LAYERS, "Layer ID of scaled base layer picture")
+  ("RefLocationOffsetLayerId%d",                    cfg_refLocationOffsetLayerIdPtr,    string(""), MAX_LAYERS, "Layer ID of reference location offset")
 #endif                                             
   ("ScaledRefLayerLeftOffset%d",                    cfg_scaledRefLayerLeftOffsetPtr,    string(""), MAX_LAYERS, "Horizontal offset of top-left luma sample of scaled base layer picture with respect to"
@@ -2155,8 +2155,8 @@
 
     // If number of scaled ref. layer offsets is non-zero, at least one of the offsets should be specified
-    if(m_acLayerCfg[layer].m_numScaledRefLayerOffsets)
+    if(m_acLayerCfg[layer].m_numRefLayerLocationOffsets)
     {
 #if O0098_SCALED_REF_LAYER_ID
-      assert( strcmp(cfg_scaledRefLayerId[layer].c_str(),  ""));
+      assert( strcmp(cfg_refLocationOffsetLayerId[layer].c_str(),  ""));
 #endif
 #if REF_REGION_OFFSET
@@ -2201,12 +2201,12 @@
 #if O0098_SCALED_REF_LAYER_ID
     // ID //
-    if(strcmp(cfg_scaledRefLayerId[layer].c_str(),  ""))
-    {
-      cfgStringToArray( &tempArray, cfg_scaledRefLayerId[layer], m_acLayerCfg[layer].m_numScaledRefLayerOffsets, "ScaledRefLayerId");
+    if(strcmp(cfg_refLocationOffsetLayerId[layer].c_str(),  ""))
+    {
+      cfgStringToArray( &tempArray, cfg_refLocationOffsetLayerId[layer], m_acLayerCfg[layer].m_numRefLayerLocationOffsets, "RefLocationOffsetLayerId");
       if(tempArray)
       {
-        for(Int i = 0; i < m_acLayerCfg[layer].m_numScaledRefLayerOffsets; i++)
+        for(Int i = 0; i < m_acLayerCfg[layer].m_numRefLayerLocationOffsets; i++)
         {
-          m_acLayerCfg[layer].m_scaledRefLayerId[i] = tempArray[i];
+          m_acLayerCfg[layer].m_refLocationOffsetLayerId[i] = tempArray[i];
         }
         delete [] tempArray; tempArray = NULL;
@@ -2219,8 +2219,8 @@
     if(strcmp(cfg_scaledRefLayerOffsetPresentFlag[layer].c_str(),  ""))
     {
-      cfgStringToArray( &tempArray, cfg_scaledRefLayerOffsetPresentFlag[layer], m_acLayerCfg[layer].m_numScaledRefLayerOffsets, "ScaledRefLayerOffsetPresentFlag");
+      cfgStringToArray( &tempArray, cfg_scaledRefLayerOffsetPresentFlag[layer], m_acLayerCfg[layer].m_numRefLayerLocationOffsets, "ScaledRefLayerOffsetPresentFlag");
       if(tempArray)
       {
-        for(Int i = 0; i < m_acLayerCfg[layer].m_numScaledRefLayerOffsets; i++)
+        for(Int i = 0; i < m_acLayerCfg[layer].m_numRefLayerLocationOffsets; i++)
         {
           m_acLayerCfg[layer].m_scaledRefLayerOffsetPresentFlag[i] = tempArray[i];
@@ -2234,8 +2234,8 @@
     if(strcmp(cfg_scaledRefLayerLeftOffset[layer].c_str(),  ""))
     {
-      cfgStringToArray( &tempArray, cfg_scaledRefLayerLeftOffset[layer], m_acLayerCfg[layer].m_numScaledRefLayerOffsets, "LeftOffset");
+      cfgStringToArray( &tempArray, cfg_scaledRefLayerLeftOffset[layer], m_acLayerCfg[layer].m_numRefLayerLocationOffsets, "LeftOffset");
       if(tempArray)
       {
-        for(Int i = 0; i < m_acLayerCfg[layer].m_numScaledRefLayerOffsets; i++)
+        for(Int i = 0; i < m_acLayerCfg[layer].m_numRefLayerLocationOffsets; i++)
         {
           m_acLayerCfg[layer].m_scaledRefLayerLeftOffset[i] = tempArray[i];
@@ -2248,8 +2248,8 @@
     if(strcmp(cfg_scaledRefLayerTopOffset[layer].c_str(),  ""))
     {
-      cfgStringToArray( &tempArray, cfg_scaledRefLayerTopOffset[layer], m_acLayerCfg[layer].m_numScaledRefLayerOffsets, "TopOffset");
+      cfgStringToArray( &tempArray, cfg_scaledRefLayerTopOffset[layer], m_acLayerCfg[layer].m_numRefLayerLocationOffsets, "TopOffset");
       if(tempArray)
       {
-        for(Int i = 0; i < m_acLayerCfg[layer].m_numScaledRefLayerOffsets; i++)
+        for(Int i = 0; i < m_acLayerCfg[layer].m_numRefLayerLocationOffsets; i++)
         {
           m_acLayerCfg[layer].m_scaledRefLayerTopOffset[i] = tempArray[i];
@@ -2262,8 +2262,8 @@
     if(strcmp(cfg_scaledRefLayerRightOffset[layer].c_str(),  ""))
     {
-      cfgStringToArray( &tempArray, cfg_scaledRefLayerRightOffset[layer], m_acLayerCfg[layer].m_numScaledRefLayerOffsets, "RightOffset");
+      cfgStringToArray( &tempArray, cfg_scaledRefLayerRightOffset[layer], m_acLayerCfg[layer].m_numRefLayerLocationOffsets, "RightOffset");
       if(tempArray)
       {
-        for(Int i = 0; i < m_acLayerCfg[layer].m_numScaledRefLayerOffsets; i++)
+        for(Int i = 0; i < m_acLayerCfg[layer].m_numRefLayerLocationOffsets; i++)
         {
           m_acLayerCfg[layer].m_scaledRefLayerRightOffset[i] = tempArray[i];
@@ -2276,8 +2276,8 @@
     if(strcmp(cfg_scaledRefLayerBottomOffset[layer].c_str(),  ""))
     {
-      cfgStringToArray( &tempArray, cfg_scaledRefLayerBottomOffset[layer], m_acLayerCfg[layer].m_numScaledRefLayerOffsets, "BottomOffset");
+      cfgStringToArray( &tempArray, cfg_scaledRefLayerBottomOffset[layer], m_acLayerCfg[layer].m_numRefLayerLocationOffsets, "BottomOffset");
       if(tempArray)
       {
-        for(Int i = 0; i < m_acLayerCfg[layer].m_numScaledRefLayerOffsets; i++)
+        for(Int i = 0; i < m_acLayerCfg[layer].m_numRefLayerLocationOffsets; i++)
         {
           m_acLayerCfg[layer].m_scaledRefLayerBottomOffset[i] = tempArray[i];
@@ -2305,8 +2305,8 @@
     if(strcmp(cfg_refRegionOffsetPresentFlag[layer].c_str(),  ""))
     {
-      cfgStringToArray( &tempArray, cfg_refRegionOffsetPresentFlag[layer], m_acLayerCfg[layer].m_numScaledRefLayerOffsets, "RefRegionOffsetPresentFlag");
+      cfgStringToArray( &tempArray, cfg_refRegionOffsetPresentFlag[layer], m_acLayerCfg[layer].m_numRefLayerLocationOffsets, "RefRegionOffsetPresentFlag");
       if(tempArray)
       {
-        for(Int i = 0; i < m_acLayerCfg[layer].m_numScaledRefLayerOffsets; i++)
+        for(Int i = 0; i < m_acLayerCfg[layer].m_numRefLayerLocationOffsets; i++)
         {
           m_acLayerCfg[layer].m_refRegionOffsetPresentFlag[i] = tempArray[i];
@@ -2319,8 +2319,8 @@
     if(strcmp(cfg_refRegionLeftOffset[layer].c_str(),  ""))
     {
-      cfgStringToArray( &tempArray, cfg_refRegionLeftOffset[layer], m_acLayerCfg[layer].m_numScaledRefLayerOffsets, "RefRegionLeftOffset");
+      cfgStringToArray( &tempArray, cfg_refRegionLeftOffset[layer], m_acLayerCfg[layer].m_numRefLayerLocationOffsets, "RefRegionLeftOffset");
       if(tempArray)
       {
-        for(Int i = 0; i < m_acLayerCfg[layer].m_numScaledRefLayerOffsets; i++)
+        for(Int i = 0; i < m_acLayerCfg[layer].m_numRefLayerLocationOffsets; i++)
         {
           m_acLayerCfg[layer].m_refRegionLeftOffset[i] = tempArray[i];
@@ -2333,8 +2333,8 @@
     if(strcmp(cfg_refRegionTopOffset[layer].c_str(),  ""))
     {
-      cfgStringToArray( &tempArray, cfg_refRegionTopOffset[layer], m_acLayerCfg[layer].m_numScaledRefLayerOffsets, "RefRegionTopOffset");
+      cfgStringToArray( &tempArray, cfg_refRegionTopOffset[layer], m_acLayerCfg[layer].m_numRefLayerLocationOffsets, "RefRegionTopOffset");
       if(tempArray)
       {
-        for(Int i = 0; i < m_acLayerCfg[layer].m_numScaledRefLayerOffsets; i++)
+        for(Int i = 0; i < m_acLayerCfg[layer].m_numRefLayerLocationOffsets; i++)
         {
           m_acLayerCfg[layer].m_refRegionTopOffset[i] = tempArray[i];
@@ -2347,8 +2347,8 @@
     if(strcmp(cfg_refRegionRightOffset[layer].c_str(),  ""))
     {
-      cfgStringToArray( &tempArray, cfg_refRegionRightOffset[layer], m_acLayerCfg[layer].m_numScaledRefLayerOffsets, "RefRegionRightOffset");
+      cfgStringToArray( &tempArray, cfg_refRegionRightOffset[layer], m_acLayerCfg[layer].m_numRefLayerLocationOffsets, "RefRegionRightOffset");
       if(tempArray)
       {
-        for(Int i = 0; i < m_acLayerCfg[layer].m_numScaledRefLayerOffsets; i++)
+        for(Int i = 0; i < m_acLayerCfg[layer].m_numRefLayerLocationOffsets; i++)
         {
           m_acLayerCfg[layer].m_refRegionRightOffset[i] = tempArray[i];
@@ -2361,8 +2361,8 @@
     if(strcmp(cfg_refRegionBottomOffset[layer].c_str(),  ""))
     {
-      cfgStringToArray( &tempArray, cfg_refRegionBottomOffset[layer], m_acLayerCfg[layer].m_numScaledRefLayerOffsets, "RefRegionBottomOffset");
+      cfgStringToArray( &tempArray, cfg_refRegionBottomOffset[layer], m_acLayerCfg[layer].m_numRefLayerLocationOffsets, "RefRegionBottomOffset");
       if(tempArray)
       {
-        for(Int i = 0; i < m_acLayerCfg[layer].m_numScaledRefLayerOffsets; i++)
+        for(Int i = 0; i < m_acLayerCfg[layer].m_numRefLayerLocationOffsets; i++)
         {
           m_acLayerCfg[layer].m_refRegionBottomOffset[i] = tempArray[i];
@@ -2373,5 +2373,5 @@
 #endif
 #if R0209_GENERIC_PHASE
-    Int numPhaseSet = m_acLayerCfg[layer].m_numScaledRefLayerOffsets;
+    Int numPhaseSet = m_acLayerCfg[layer].m_numRefLayerLocationOffsets;
 
     // Presense Flag //
Index: branches/SHM-dev/source/App/TAppEncoder/TAppEncLayerCfg.cpp
===================================================================
--- branches/SHM-dev/source/App/TAppEncoder/TAppEncLayerCfg.cpp	(revision 1029)
+++ branches/SHM-dev/source/App/TAppEncoder/TAppEncLayerCfg.cpp	(revision 1030)
@@ -64,7 +64,7 @@
   m_confWinLeft = m_confWinRight = m_confWinTop = m_confWinBottom = 0;
   m_aiPad[1] = m_aiPad[0] = 0;
-  m_numScaledRefLayerOffsets = 0;
+  m_numRefLayerLocationOffsets = 0;
 #if O0098_SCALED_REF_LAYER_ID
-  ::memset(m_scaledRefLayerId,           0, sizeof(m_scaledRefLayerId));
+  ::memset(m_refLocationOffsetLayerId,   0, sizeof(m_refLocationOffsetLayerId));
 #endif
   ::memset(m_scaledRefLayerLeftOffset,   0, sizeof(m_scaledRefLayerLeftOffset));
Index: branches/SHM-dev/source/App/TAppEncoder/TAppEncLayerCfg.h
===================================================================
--- branches/SHM-dev/source/App/TAppEncoder/TAppEncLayerCfg.h	(revision 1029)
+++ branches/SHM-dev/source/App/TAppEncoder/TAppEncLayerCfg.h	(revision 1030)
@@ -93,7 +93,7 @@
   Int*      m_aidQP;                                          ///< array of slice QP values
   TAppEncCfg* m_cAppEncCfg;                                   ///< pointer to app encoder config
-  Int       m_numScaledRefLayerOffsets;
+  Int       m_numRefLayerLocationOffsets;
 #if O0098_SCALED_REF_LAYER_ID
-  Int       m_scaledRefLayerId          [MAX_LAYERS];
+  Int       m_refLocationOffsetLayerId  [MAX_LAYERS];
 #endif
   Int       m_scaledRefLayerLeftOffset  [MAX_LAYERS];
Index: branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp
===================================================================
--- branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp	(revision 1029)
+++ branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp	(revision 1030)
@@ -421,20 +421,4 @@
         }
       }
-#if REF_REGION_OFFSET
-      for(Int i = 0; i < m_acLayerCfg[layer].m_numScaledRefLayerOffsets; i++)
-      {
-#if AUXILIARY_PICTURES
-        Int cf = m_acLayerCfg[i].m_chromaFormatIDC;
-        Int rlSubWidthC  = ( cf == CHROMA_420 || cf == CHROMA_422 ) ? 2 : 1;
-        Int rlSubHeightC = ( cf == CHROMA_420 ) ? 2 : 1;
-#else
-        Int rlSubWidthC  = 2;
-        Int rlSubHeightC = 2;
-#endif
-        m_acTEncTop[layer].setRefRegionOffsetPresentFlag                  ( i, m_acLayerCfg[layer].m_refRegionOffsetPresentFlag[i] );
-        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]);
-      }
-#endif
     }
     else
@@ -762,11 +746,11 @@
     m_acTEncTop[layer].setLog2MaxMvLengthVertical               ( m_log2MaxMvLengthVertical );
     m_acTEncTop[layer].setElRapSliceTypeB                       (layer == 0? 0 : m_elRapSliceBEnabled);
+
     if( layer > 0 )
     {
 #if REF_REGION_OFFSET
 #if AUXILIARY_PICTURES
-      Int cf = m_acLayerCfg[layer].m_chromaFormatIDC;
-      Int subWidthC  = ( cf == CHROMA_420 || cf == CHROMA_422 ) ? 2 : 1;
-      Int subHeightC = ( cf == CHROMA_420 ) ? 2 : 1;
+      Int subWidthC  = ( m_acLayerCfg[layer].m_chromaFormatIDC == CHROMA_420 || m_acLayerCfg[layer].m_chromaFormatIDC == CHROMA_422 ) ? 2 : 1;
+      Int subHeightC = ( m_acLayerCfg[layer].m_chromaFormatIDC == CHROMA_420 ) ? 2 : 1;
 #else
       Int subWidthC  = 2;
@@ -774,9 +758,9 @@
 #endif
 #endif
-      m_acTEncTop[layer].setNumScaledRefLayerOffsets            ( m_acLayerCfg[layer].m_numScaledRefLayerOffsets );
-      for(Int i = 0; i < m_acLayerCfg[layer].m_numScaledRefLayerOffsets; i++)
+      m_acTEncTop[layer].setNumRefLayerLocationOffsets          ( m_acLayerCfg[layer].m_numRefLayerLocationOffsets );
+      for(Int i = 0; i < m_acLayerCfg[layer].m_numRefLayerLocationOffsets; i++)
       {
 #if O0098_SCALED_REF_LAYER_ID
-        m_acTEncTop[layer].setScaledRefLayerId                  (i, m_acLayerCfg[layer].m_scaledRefLayerId[i]);
+        m_acTEncTop[layer].setRefLocationOffsetLayerId          (i, m_acLayerCfg[layer].m_refLocationOffsetLayerId[i]);
 #endif
 #if REF_REGION_OFFSET
@@ -788,10 +772,16 @@
         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] );
+          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
+          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;
+
+        m_acTEncTop[layer].setRefRegionOffsetPresentFlag        ( i, m_acLayerCfg[layer].m_refRegionOffsetPresentFlag[i] );
+        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] );
@@ -803,4 +793,5 @@
       }
     }
+
 #if M0040_ADAPTIVE_RESOLUTION_CHANGE
     m_acTEncTop[layer].setAdaptiveResolutionChange               ( m_adaptiveResolutionChange );
Index: branches/SHM-dev/source/Lib/TLibCommon/TComDataCU.cpp
===================================================================
--- branches/SHM-dev/source/Lib/TLibCommon/TComDataCU.cpp	(revision 1029)
+++ branches/SHM-dev/source/Lib/TLibCommon/TComDataCU.cpp	(revision 1030)
@@ -3430,6 +3430,6 @@
 #if MOVE_SCALED_OFFSET_TO_PPS
 #if O0098_SCALED_REF_LAYER_ID
-  Int leftStartL = baseColPic->getSlice(0)->getPPS()->getScaledRefLayerWindowForLayer(baseColPic->getSlice(0)->getVPS()->getRefLayerId(getSlice()->getLayerId(), refLayerIdc)).getWindowLeftOffset();
-  Int topStartL  = baseColPic->getSlice(0)->getPPS()->getScaledRefLayerWindowForLayer(baseColPic->getSlice(0)->getVPS()->getRefLayerId(getSlice()->getLayerId(), refLayerIdc)).getWindowTopOffset();
+  Int leftStartL = m_pcSlice->getPPS()->getScaledRefLayerWindowForLayer(baseColPic->getSlice(0)->getVPS()->getRefLayerId(getSlice()->getLayerId(), refLayerIdc)).getWindowLeftOffset();
+  Int topStartL  = m_pcSlice->getPPS()->getScaledRefLayerWindowForLayer(baseColPic->getSlice(0)->getVPS()->getRefLayerId(getSlice()->getLayerId(), refLayerIdc)).getWindowTopOffset();
 #else
   Int leftStartL = baseColPic->getSlice(0)->getPPS()->getScaledRefLayerWindow(refLayerIdc).getWindowLeftOffset();
@@ -3447,5 +3447,5 @@
 
 #if REF_REGION_OFFSET
-  const Window &windowRL = baseColPic->getSlice(0)->getPPS()->getRefLayerWindow(refLayerIdc);
+  const Window &windowRL = m_pcSlice->getPPS()->getRefLayerWindow(refLayerIdc);
   Int iBX = (((uiPelX - leftStartL)*g_posScalingFactor[refLayerIdc][0] + (1<<15)) >> 16) + windowRL.getWindowLeftOffset();
   Int iBY = (((uiPelY - topStartL )*g_posScalingFactor[refLayerIdc][1] + (1<<15)) >> 16) + windowRL.getWindowTopOffset();
Index: branches/SHM-dev/source/Lib/TLibCommon/TComSlice.cpp
===================================================================
--- branches/SHM-dev/source/Lib/TLibCommon/TComSlice.cpp	(revision 1029)
+++ branches/SHM-dev/source/Lib/TLibCommon/TComSlice.cpp	(revision 1030)
@@ -2538,5 +2538,5 @@
 #endif
 #if MOVE_SCALED_OFFSET_TO_PPS
-, m_numScaledRefLayerOffsets  ( 0 )
+, m_numRefLayerLocationOffsets  ( 0 )
 #endif
 #if Q0048_CGS_3D_ASYMLUT
@@ -3234,7 +3234,7 @@
   static Window win;
 
-  for (Int i = 0; i < m_numScaledRefLayerOffsets; i++)
-  {
-    if (layerId == m_scaledRefLayerId[i])
+  for (Int i = 0; i < m_numRefLayerLocationOffsets; i++)
+  {
+    if (layerId == m_refLocationOffsetLayerId[i])
     {
       return m_scaledRefLayerWindow[i];
@@ -3251,7 +3251,7 @@
   static Window win;
 
-  for (Int i = 0; i < m_numScaledRefLayerOffsets; i++)
-  {
-    if (layerId == m_scaledRefLayerId[i])
+  for (Int i = 0; i < m_numRefLayerLocationOffsets; i++)
+  {
+    if (layerId == m_refLocationOffsetLayerId[i])
     {
       return m_refLayerWindow[i];
@@ -4277,4 +4277,7 @@
       pcIlpPic[refLayerIdc]->setIsLongTerm(1);
 
+      // assign PPS to IRLP to be used for reference location offsets
+      pcIlpPic[refLayerIdc]->getSlice(0)->setPPS( m_pcPic->getSlice(0)->getPPS() );
+
 #if REF_IDX_MFM
       if( m_bMFMEnabledFlag && !(m_eNalUnitType >= NAL_UNIT_CODED_SLICE_BLA_W_LP && m_eNalUnitType <= NAL_UNIT_CODED_SLICE_CRA) )
Index: branches/SHM-dev/source/Lib/TLibCommon/TComSlice.h
===================================================================
--- branches/SHM-dev/source/Lib/TLibCommon/TComSlice.h	(revision 1029)
+++ branches/SHM-dev/source/Lib/TLibCommon/TComSlice.h	(revision 1030)
@@ -2053,7 +2053,7 @@
 #endif
 #if MOVE_SCALED_OFFSET_TO_PPS
-  UInt     m_numScaledRefLayerOffsets;
+  UInt     m_numRefLayerLocationOffsets;
 #if O0098_SCALED_REF_LAYER_ID
-  UInt     m_scaledRefLayerId[MAX_LAYERS];
+  UInt     m_refLocationOffsetLayerId[MAX_LAYERS];
 #endif
   Window   m_scaledRefLayerWindow[MAX_LAYERS];
@@ -2221,9 +2221,9 @@
 #endif
 #if MOVE_SCALED_OFFSET_TO_PPS
-  UInt     getNumScaledRefLayerOffsets()       { return m_numScaledRefLayerOffsets; }
-  Void     setNumScaledRefLayerOffsets(Int x)  { m_numScaledRefLayerOffsets = x;    }
+  UInt     getNumRefLayerLocationOffsets()       { return m_numRefLayerLocationOffsets; }
+  Void     setNumRefLayerLocationOffsets(Int x)  { m_numRefLayerLocationOffsets = x;    }
 #if O0098_SCALED_REF_LAYER_ID
-  UInt     getScaledRefLayerId(Int x)          { return m_scaledRefLayerId[x]; }
-  Void     setScaledRefLayerId(Int x, UInt id) { m_scaledRefLayerId[x] = id;   }
+  UInt     getRefLocationOffsetLayerId(Int x)          { return m_refLocationOffsetLayerId[x]; }
+  Void     setRefLocationOffsetLayerId(Int x, UInt id) { m_refLocationOffsetLayerId[x] = id;   }
   Window&  getScaledRefLayerWindowForLayer( Int layerId );
 #endif
Index: branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp
===================================================================
--- branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 1029)
+++ branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 1030)
@@ -412,8 +412,8 @@
 
 #if REF_REGION_OFFSET
-            READ_UVLC( uiCode,      "num_ref_loc_offsets" ); pcPPS->setNumScaledRefLayerOffsets(uiCode);
-            for(Int k = 0; k < pcPPS->getNumScaledRefLayerOffsets(); k++)
+            READ_UVLC( uiCode,      "num_ref_loc_offsets" ); pcPPS->setNumRefLayerLocationOffsets(uiCode);
+            for(Int k = 0; k < pcPPS->getNumRefLayerLocationOffsets(); k++)
             {
-              READ_CODE( 6, uiCode,  "ref_loc_offset_layer_id" );  pcPPS->setScaledRefLayerId( k, uiCode );
+              READ_CODE( 6, uiCode,  "ref_loc_offset_layer_id" );  pcPPS->setRefLocationOffsetLayerId( k, uiCode );
               READ_FLAG( uiCode, "scaled_ref_layer_offset_present_flag" );   pcPPS->setScaledRefLayerOffsetPresentFlag( k, uiCode );
               if (uiCode)
Index: branches/SHM-dev/source/Lib/TLibEncoder/TEncCavlc.cpp
===================================================================
--- branches/SHM-dev/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 1029)
+++ branches/SHM-dev/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 1030)
@@ -317,8 +317,8 @@
 
 #if REF_REGION_OFFSET
-            WRITE_UVLC( pcPPS->getNumScaledRefLayerOffsets(),      "num_ref_loc_offsets" );
-            for(Int k = 0; k < pcPPS->getNumScaledRefLayerOffsets(); k++)
+            WRITE_UVLC( pcPPS->getNumRefLayerLocationOffsets(),      "num_ref_loc_offsets" );
+            for(Int k = 0; k < pcPPS->getNumRefLayerLocationOffsets(); k++)
             {
-              WRITE_CODE( pcPPS->getScaledRefLayerId(k), 6, "ref_loc_offset_layer_id" );
+              WRITE_CODE( pcPPS->getRefLocationOffsetLayerId(k), 6, "ref_loc_offset_layer_id" );
               WRITE_FLAG( pcPPS->getScaledRefLayerOffsetPresentFlag(k) ? 1 : 0, "scaled_ref_layer_offset_prsent_flag" );
               if (pcPPS->getScaledRefLayerOffsetPresentFlag(k))
Index: branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.cpp
===================================================================
--- branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.cpp	(revision 1029)
+++ branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.cpp	(revision 1030)
@@ -84,5 +84,5 @@
   m_bMFMEnabledFlag = false;
 #endif
-  m_numScaledRefLayerOffsets = 0;
+  m_numRefLayerLocationOffsets = 0;
 #if POC_RESET_FLAG || POC_RESET_IDC_ENCODER
   m_pocAdjustmentValue     = 0;
@@ -1151,9 +1151,9 @@
 #endif
 #if MOVE_SCALED_OFFSET_TO_PPS
-  m_cPPS.setNumScaledRefLayerOffsets(m_numScaledRefLayerOffsets);
-  for(Int i = 0; i < m_cPPS.getNumScaledRefLayerOffsets(); i++)
+  m_cPPS.setNumRefLayerLocationOffsets(m_numRefLayerLocationOffsets);
+  for(Int i = 0; i < m_cPPS.getNumRefLayerLocationOffsets(); i++)
   {
 #if O0098_SCALED_REF_LAYER_ID
-    m_cPPS.setScaledRefLayerId(i, m_scaledRefLayerId[i]);
+    m_cPPS.setRefLocationOffsetLayerId(i, m_refLocationOffsetLayerId[i]);
 #endif
     m_cPPS.getScaledRefLayerWindow(i) = m_scaledRefLayerWindow[i];
@@ -1165,8 +1165,8 @@
 #if R0209_GENERIC_PHASE
     m_cPPS.setResamplePhaseSetPresentFlag( i, m_resamplePhaseSetPresentFlag[i] );
-    m_cPPS.setPhaseHorLuma( m_scaledRefLayerId[i], m_phaseHorLuma[i] );
-    m_cPPS.setPhaseVerLuma( m_scaledRefLayerId[i], m_phaseVerLuma[i] );
-    m_cPPS.setPhaseHorChroma( m_scaledRefLayerId[i], m_phaseHorChroma[i] );
-    m_cPPS.setPhaseVerChroma( m_scaledRefLayerId[i], m_phaseVerChroma[i] );
+    m_cPPS.setPhaseHorLuma( m_refLocationOffsetLayerId[i], m_phaseHorLuma[i] );
+    m_cPPS.setPhaseVerLuma( m_refLocationOffsetLayerId[i], m_phaseVerLuma[i] );
+    m_cPPS.setPhaseHorChroma( m_refLocationOffsetLayerId[i], m_phaseHorChroma[i] );
+    m_cPPS.setPhaseVerChroma( m_refLocationOffsetLayerId[i], m_phaseVerChroma[i] );
 #endif
 #if P0312_VERT_PHASE_ADJ
@@ -1678,7 +1678,7 @@
   static Window win;
 
-  for (Int i = 0; i < m_numScaledRefLayerOffsets; i++)
-  {
-    if (layerId == m_scaledRefLayerId[i])
+  for (Int i = 0; i < m_numRefLayerLocationOffsets; i++)
+  {
+    if (layerId == m_refLocationOffsetLayerId[i])
     {
       return m_scaledRefLayerWindow[i];
@@ -1694,5 +1694,5 @@
   static Window win;
 
-  for (Int i = 0; i < m_numScaledRefLayerOffsets; i++)
+  for (Int i = 0; i < m_numRefLayerLocationOffsets; i++)
   {
     if (layerId == m_refLayerId[i])
Index: branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.h
===================================================================
--- branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.h	(revision 1029)
+++ branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.h	(revision 1030)
@@ -122,7 +122,7 @@
   Bool                    m_bMFMEnabledFlag;
 #endif
-  UInt                    m_numScaledRefLayerOffsets;
+  UInt                    m_numRefLayerLocationOffsets;
 #if O0098_SCALED_REF_LAYER_ID
-  UInt                    m_scaledRefLayerId[MAX_LAYERS];
+  UInt                    m_refLocationOffsetLayerId[MAX_LAYERS];
 #endif
   Window                  m_scaledRefLayerWindow[MAX_LAYERS];
@@ -224,9 +224,9 @@
   Int       getNumPicRcvd         ()            { return m_iNumPicRcvd;              }
   Void      setNumPicRcvd         ( Int num )   { m_iNumPicRcvd = num;               }
-  Void      setNumScaledRefLayerOffsets(Int x)  { m_numScaledRefLayerOffsets = x;    }
-  UInt      getNumScaledRefLayerOffsets()       { return m_numScaledRefLayerOffsets; }
+  Void      setNumRefLayerLocationOffsets(Int x)  { m_numRefLayerLocationOffsets = x;    }
+  UInt      getNumRefLayerLocationOffsets()       { return m_numRefLayerLocationOffsets; }
 #if O0098_SCALED_REF_LAYER_ID
-  Void      setScaledRefLayerId(Int x, UInt id) { m_scaledRefLayerId[x] = id;   }
-  UInt      getScaledRefLayerId(Int x)          { return m_scaledRefLayerId[x]; }
+  Void      setRefLocationOffsetLayerId(Int x, UInt id) { m_refLocationOffsetLayerId[x] = id;   }
+  UInt      getRefLocationOffsetLayerId(Int x)          { return m_refLocationOffsetLayerId[x]; }
   Window&   getScaledRefLayerWindowForLayer(Int layerId);
 #endif
