Index: branches/SHM-2.1-multilayers-dev/source/Lib/TLibCommon/TComSlice.cpp
===================================================================
--- branches/SHM-2.1-multilayers-dev/source/Lib/TLibCommon/TComSlice.cpp	(revision 259)
+++ branches/SHM-2.1-multilayers-dev/source/Lib/TLibCommon/TComSlice.cpp	(revision 260)
@@ -576,5 +576,5 @@
       m_activeNumILRRefIdx = numInterLayerRPSPics;
     }
-#if MAX_ONE_RESAMPLING_DIRECT_LAYERS
+#if MAX_ONE_RESAMPLING_DIRECT_LAYERS && SIMPLIFIED_MV_POS_SCALING
     if( m_pcVPS->getScalabilityMask(1) )
     {
Index: branches/SHM-2.1-multilayers-dev/source/Lib/TLibCommon/TComUpsampleFilter.cpp
===================================================================
--- branches/SHM-2.1-multilayers-dev/source/Lib/TLibCommon/TComUpsampleFilter.cpp	(revision 259)
+++ branches/SHM-2.1-multilayers-dev/source/Lib/TLibCommon/TComUpsampleFilter.cpp	(revision 260)
@@ -127,6 +127,11 @@
   Pel* piDstV;
 
+#if SIMPLIFIED_MV_POS_SCALING
   Int scaleX = g_posScalingFactor[refLayerIdc][0];
   Int scaleY = g_posScalingFactor[refLayerIdc][1];
+#else
+  Int   scaleX     = ( ( widthBL << shiftX ) + ( widthEL >> 1 ) ) / widthEL;
+  Int   scaleY     = ( ( heightBL << shiftY ) + ( heightEL >> 1 ) ) / heightEL;
+#endif
 
   if( scaleX == 65536 && scaleY == 65536 ) // ratio 1x
@@ -334,4 +339,9 @@
     shiftYM4 = shiftY - 4;
 
+#if !SIMPLIFIED_MV_POS_SCALING
+    scaleX     = ( ( widthBL << shiftX ) + ( widthEL >> 1 ) ) / widthEL;
+    scaleY     = ( ( heightBL << shiftY ) + ( heightEL >> 1 ) ) / heightEL;
+#endif
+
 #if ILP_DECODED_PICTURE
     widthEL   = pcUsPic->getWidth () >> 1;
Index: branches/SHM-2.1-multilayers-dev/source/Lib/TLibDecoder/TDecTop.cpp
===================================================================
--- branches/SHM-2.1-multilayers-dev/source/Lib/TLibDecoder/TDecTop.cpp	(revision 259)
+++ branches/SHM-2.1-multilayers-dev/source/Lib/TLibDecoder/TDecTop.cpp	(revision 260)
@@ -186,7 +186,7 @@
     if(m_cIlpPic[refLayerIdc])
     {
-      m_cIlpPic[refLayerIdc]->copyUpsampledPictureYuv(pcPic->getFullPelBaseRec(i), m_cIlpPic[refLayerIdc]->getPicYuvRec());
+      m_cIlpPic[refLayerIdc]->copyUpsampledPictureYuv(pcPic->getFullPelBaseRec(refLayerIdc), m_cIlpPic[refLayerIdc]->getPicYuvRec());
       m_cIlpPic[refLayerIdc]->getSlice(0)->setPOC(pcPic->getPOC());
-      m_cIlpPic[refLayerIdc]->setLayerId(pcPic->getSlice(0)->getBaseColPic(i)->getLayerId()); //set reference layerId
+      m_cIlpPic[refLayerIdc]->setLayerId(pcPic->getSlice(0)->getBaseColPic(refLayerIdc)->getLayerId()); //set reference layerId
       m_cIlpPic[refLayerIdc]->getPicYuvRec()->setBorderExtension(false);
       m_cIlpPic[refLayerIdc]->getPicYuvRec()->extendPicBorder();
@@ -890,10 +890,10 @@
 
 #if SVC_UPSAMPLING
-        if ( pcPic->isSpatialEnhLayer(refLayerIdc))
+        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() );
 #else
-          m_cPrediction.upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(), pcSlice->getBaseColPic()->getPicYuvRec(), pcPic->getPicYuvRec() );
+          m_cPrediction.upsampleBasePic( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc), pcSlice->getBaseColPic(refLayerIdc)->getPicYuvRec(), pcPic->getPicYuvRec() );
 #endif
         }
@@ -908,5 +908,9 @@
 
 #if REF_IDX_FRAMEWORK
+#if ZERO_NUM_DIRECT_LAYERS
+    if( m_layerId > 0 && pcSlice->getActiveNumILRRefIdx() )
+#else
     if(m_layerId > 0)
+#endif
     {
       setILRPic(pcPic);
Index: branches/SHM-2.1-multilayers-dev/source/Lib/TLibEncoder/TEncGOP.cpp
===================================================================
--- branches/SHM-2.1-multilayers-dev/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 259)
+++ branches/SHM-2.1-multilayers-dev/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 260)
@@ -543,5 +543,5 @@
         TComList<TComPic*> *cListPic = m_ppcTEncTop[m_layerId-1]->getListPic();
 #endif
-        pcSlice->setBaseColPic (*cListPic, refLayerIdc );
+        pcSlice->setBaseColPic( *cListPic, refLayerIdc );
 
 #if SIMPLIFIED_MV_POS_SCALING
@@ -936,4 +936,11 @@
     {
       pcSlice->getSPS()->setTMVPFlagsPresent(1);
+#if SVC_EXTENSION
+      if( pcSlice->getIdrPicFlag() )
+      {
+        pcSlice->setEnableTMVPFlag(0);
+      }
+      else
+#endif
       pcSlice->setEnableTMVPFlag(1);
     }
Index: branches/SHM-2.1-multilayers-dev/source/Lib/TLibEncoder/TEncSearch.cpp
===================================================================
--- branches/SHM-2.1-multilayers-dev/source/Lib/TLibEncoder/TEncSearch.cpp	(revision 259)
+++ branches/SHM-2.1-multilayers-dev/source/Lib/TLibEncoder/TEncSearch.cpp	(revision 260)
@@ -3313,5 +3313,5 @@
       
 #if (ENCODER_FAST_MODE)
-      if (pcCU->getSlice()->getNumRefIdx(eRefPicList) > 1)
+      if( pcCU->getSlice()->getNumRefIdx(eRefPicList) - pcCU->getSlice()->getActiveNumILRRefIdx() > 0)
       {
         testILR = false;
Index: branches/SHM-2.1-multilayers-dev/source/Lib/TLibEncoder/TEncSlice.cpp
===================================================================
--- branches/SHM-2.1-multilayers-dev/source/Lib/TLibEncoder/TEncSlice.cpp	(revision 259)
+++ branches/SHM-2.1-multilayers-dev/source/Lib/TLibEncoder/TEncSlice.cpp	(revision 260)
@@ -995,7 +995,4 @@
     TComDataCU*& pcCU = rpcPic->getCU( uiCUAddr );
     pcCU->initCU( rpcPic, uiCUAddr );
-#if SVC_EXTENSION
-    pcCU->setLayerId(m_pcCfg->getLayerId());
-#endif
 
 #if !RATE_CONTROL_LAMBDA_DOMAIN
Index: branches/SHM-2.1-multilayers-dev/source/Lib/TLibEncoder/TEncTop.cpp
===================================================================
--- branches/SHM-2.1-multilayers-dev/source/Lib/TLibEncoder/TEncTop.cpp	(revision 259)
+++ branches/SHM-2.1-multilayers-dev/source/Lib/TLibEncoder/TEncTop.cpp	(revision 260)
@@ -1222,5 +1222,5 @@
   }
 
-  return (TEncTop *)getLayerEnc( getVPS()->getRefLayerId( m_layerId, refLayerIdc ) );
+  return (TEncTop *)getLayerEnc( m_cVPS.getRefLayerId( m_layerId, refLayerIdc ) );
 }
 #endif
