Index: branches/SHM-4.0-dev/source/Lib/TLibCommon/TComSlice.cpp
===================================================================
--- branches/SHM-4.0-dev/source/Lib/TLibCommon/TComSlice.cpp	(revision 445)
+++ branches/SHM-4.0-dev/source/Lib/TLibCommon/TComSlice.cpp	(revision 446)
@@ -118,4 +118,7 @@
 , m_temporalLayerNonReferenceFlag ( false )
 , m_enableTMVPFlag                ( true )
+#if REF_IDX_MFM
+, m_bMFMEnabledFlag               ( false )
+#endif
 {
   m_aiNumRefIdx[0] = m_aiNumRefIdx[1] = 0;
@@ -631,5 +634,5 @@
 #if RPL_INIT_N0316_N0082
     if( m_layerId > 0 )
-    {
+    {      
 #if JCTVC_M0458_INTERLAYER_RPS_SIG
       for( i = 0; i < m_activeNumILRRefIdx && cIdx < numPocTotalCurr; cIdx ++, i ++)      
@@ -1133,4 +1136,5 @@
 #if SVC_EXTENSION
   m_pcVPS                = pSrc->m_pcVPS;
+  m_layerId              = pSrc->m_layerId;
 #if JCTVC_M0458_INTERLAYER_RPS_SIG
   m_activeNumILRRefIdx         = pSrc->m_activeNumILRRefIdx;
Index: branches/SHM-4.0-dev/source/Lib/TLibDecoder/TDecTop.cpp
===================================================================
--- branches/SHM-4.0-dev/source/Lib/TLibDecoder/TDecTop.cpp	(revision 445)
+++ branches/SHM-4.0-dev/source/Lib/TLibDecoder/TDecTop.cpp	(revision 446)
@@ -684,4 +684,5 @@
 
 #if SVC_EXTENSION
+  m_apcSlicePilot->setSliceIdx( m_uiSliceIdx ); // it should be removed if HM will reflect it in above
 #if VPS_EXTN_DIRECT_REF_LAYERS && M0457_PREDICTION_INDICATIONS
   setRefLayerParams(m_apcSlicePilot->getVPS());
@@ -1113,10 +1114,12 @@
 #endif
 
-#if SVC_EXTENSION   
-    if(m_layerId > 0)
-    {
-      for( i = 0; i < pcSlice->getActiveNumILRRefIdx(); i++ )
-      {
-        UInt refLayerIdc = pcSlice->getInterLayerPredLayerIdc(i);
+#if SVC_EXTENSION
+    // Create upsampling reference layer pictures for all possible dependent layers and do it only once for the first slice. 
+    // Other slices might choose which reference pictures to be used for inter-layer prediction
+    if( m_layerId > 0 && m_uiSliceIdx == 0 )
+    {      
+      for( i = 0; i < pcSlice->getNumILRRefIdx(); i++ )
+      {
+        UInt refLayerIdc = i;
 #if AVC_BASE
         if( pcSlice->getVPS()->getRefLayerId( m_layerId, refLayerIdc ) == 0 && m_parameterSetManagerDecoder[0].getActiveVPS()->getAvcBaseLayerFlag() )
@@ -1200,4 +1203,47 @@
     if( m_layerId > 0 && pcSlice->getActiveNumILRRefIdx() )
     {
+      for( i = 0; i < pcSlice->getActiveNumILRRefIdx(); i++ )
+      {
+        UInt refLayerIdc = pcSlice->getInterLayerPredLayerIdc(i);
+#if AVC_BASE
+        if( pcSlice->getVPS()->getRefLayerId( m_layerId, refLayerIdc ) == 0 && m_parameterSetManagerDecoder[0].getActiveVPS()->getAvcBaseLayerFlag() )
+        {
+          pcSlice->setBaseColPic ( refLayerIdc, *m_ppcTDecTop[0]->getListPic()->begin() );
+#if AVC_SYNTAX
+          TComPic* pBLPic = pcSlice->getBaseColPic(refLayerIdc);
+          if( pcSlice->getPOC() == 0 )
+          {
+            // initialize partition order.
+            UInt* piTmp = &g_auiZscanToRaster[0];
+            initZscanToRaster( pBLPic->getPicSym()->getMaxDepth() + 1, 1, 0, piTmp );
+            initRasterToZscan( pBLPic->getPicSym()->getMaxCUWidth(), pBLPic->getPicSym()->getMaxCUHeight(), pBLPic->getPicSym()->getMaxDepth() + 1 );
+          }      
+          pBLPic->getSlice( 0 )->initBaseLayerRPL( pcSlice );
+          pBLPic->readBLSyntax( m_ppcTDecTop[0]->getBLSyntaxFile(), SYNTAX_BYTES );
+#endif
+        }
+        else
+        {
+#if VPS_EXTN_DIRECT_REF_LAYERS
+          TDecTop *pcTDecTop = (TDecTop *)getRefLayerDec( refLayerIdc );
+#else
+          TDecTop *pcTDecTop = (TDecTop *)getLayerDec( m_layerId-1 );
+#endif
+          TComList<TComPic*> *cListPic = pcTDecTop->getListPic();
+          pcSlice->setBaseColPic ( *cListPic, refLayerIdc );
+        }
+#else
+#if VPS_EXTN_DIRECT_REF_LAYERS
+        TDecTop *pcTDecTop = (TDecTop *)getRefLayerDec( refLayerIdc );
+#else
+        TDecTop *pcTDecTop = (TDecTop *)getLayerDec( m_layerId-1 );
+#endif
+        TComList<TComPic*> *cListPic = pcTDecTop->getListPic();
+        pcSlice->setBaseColPic ( *cListPic, refLayerIdc );
+#endif
+
+        pcSlice->setFullPelBaseRec ( refLayerIdc, pcPic->getFullPelBaseRec(refLayerIdc) );
+      }
+
       setILRPic(pcPic);
 #if REF_IDX_MFM
Index: branches/SHM-4.0-dev/source/Lib/TLibEncoder/TEncGOP.cpp
===================================================================
--- branches/SHM-4.0-dev/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 445)
+++ branches/SHM-4.0-dev/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 446)
@@ -1607,4 +1607,8 @@
           pcSlice->setSliceSegmentCurStartCUAddr  ( startCUAddrSlice      );
           pcSlice->setSliceBits(0);
+#if SVC_EXTENSION
+          // copy reference list modification info from the first slice, assuming that this information is the same across all slices in the picture
+          memcpy( pcSlice->getRefPicListModification(), pcPic->getSlice(0)->getRefPicListModification(), sizeof(TComRefPicListModification) );
+#endif
           uiNumSlices ++;
         }
