Index: branches/SHM-2.0-dev/source/Lib/TLibCommon/TComSlice.cpp
===================================================================
--- branches/SHM-2.0-dev/source/Lib/TLibCommon/TComSlice.cpp	(revision 175)
+++ branches/SHM-2.0-dev/source/Lib/TLibCommon/TComSlice.cpp	(revision 176)
@@ -124,13 +124,12 @@
   
 #if REF_IDX_FRAMEWORK
+#if JCTVC_M0458_INTERLAYER_RPS_SIG
+  m_activeNumILRRefIdx        = 0; 
+  m_interLayerPredEnabledFlag = 0;
+  ::memset( m_interLayerPredLayerIdc, 0, sizeof(m_interLayerPredLayerIdc) );
+#else
   m_numILRRefIdx = 0;
-#endif
-#if JCTVC_M0458_INTERLAYER_RPS_SIG
-  m_activeNumILRRefIdx      = 0; 
-  m_bInterLayerPredEnabledFlag = 0;
-
-  for ( Int idx = 0; idx < MAX_VPS_LAYER_ID_PLUS1; idx++ )
-    m_aiInterLayerPredLayerIdc[idx] = 0; 
 #endif 
+#endif
 
   initEqualRef();
@@ -183,20 +182,11 @@
   m_aiNumRefIdx[1]      = 0;
 #if REF_IDX_FRAMEWORK
-  if(layerId)
-  {
-    m_numILRRefIdx              = m_pcVPS->getNumDirectRefLayers( layerId );
 #if JCTVC_M0458_INTERLAYER_RPS_SIG
-    m_activeNumILRRefIdx         = m_pcVPS->getNumDirectRefLayers( layerId );         
-    m_bInterLayerPredEnabledFlag = 1;   
+    m_activeNumILRRefIdx        = 0;
+    m_interLayerPredEnabledFlag = 0;
+#else
+    m_numILRRefIdx              = 0;
 #endif  
-  }
-  else
-  {
-    m_numILRRefIdx              = 0;
-#if JCTVC_M0458_INTERLAYER_RPS_SIG
-    m_activeNumILRRefIdx      = 0;
-    m_bInterLayerPredEnabledFlag = 0;
-#endif  
-  }
+
 #endif
   m_colFromL0Flag = 1;
Index: branches/SHM-2.0-dev/source/Lib/TLibCommon/TComSlice.h
===================================================================
--- branches/SHM-2.0-dev/source/Lib/TLibCommon/TComSlice.h	(revision 175)
+++ branches/SHM-2.0-dev/source/Lib/TLibCommon/TComSlice.h	(revision 176)
@@ -1423,10 +1423,11 @@
   Int         m_deblockingFilterBetaOffsetDiv2;    //< beta offset for deblocking filter
   Int         m_deblockingFilterTcOffsetDiv2;      //< tc offset for deblocking filter
+#if JCTVC_M0458_INTERLAYER_RPS_SIG
+  Int         m_activeNumILRRefIdx;        //< Active inter-layer reference pictures
+  Int         m_interLayerPredLayerIdc  [MAX_VPS_LAYER_ID_PLUS1];
+#else
 #if REF_IDX_FRAMEWORK
   Int         m_numILRRefIdx;       //< for inter-layer reference picture ser
 #endif
-#if JCTVC_M0458_INTERLAYER_RPS_SIG
-  Int         m_activeNumILRRefIdx;        //< Active inter-layer reference pictures
-  Int         m_aiInterLayerPredLayerIdc  [MAX_VPS_LAYER_ID_PLUS1];
 #endif 
 #if L0034_COMBINED_LIST_CLEANUP
@@ -1523,5 +1524,5 @@
   Bool       m_enableTMVPFlag;
 #if JCTVC_M0458_INTERLAYER_RPS_SIG
-  Bool       m_bInterLayerPredEnabledFlag;
+  Bool       m_interLayerPredEnabledFlag;
   Int        m_numInterLayerRefPics;
 #endif 
@@ -1582,6 +1583,8 @@
   Int       getDeblockingFilterTcOffsetDiv2()           { return  m_deblockingFilterTcOffsetDiv2; }
 #if REF_IDX_FRAMEWORK
-  Int       getNumILRRefIdx     ( )                     { return  m_numILRRefIdx; }
+  Int       getNumILRRefIdx     ( )                     { return  m_pcVPS->getNumDirectRefLayers( m_layerId ); }
+#if !JCTVC_M0458_INTERLAYER_RPS_SIG
   Void      setNumILRRefIdx     ( Int i )               { m_numILRRefIdx = i;     }
+#endif
 #endif
 #if JCTVC_M0458_INTERLAYER_RPS_SIG
@@ -1589,6 +1592,6 @@
   Void      setActiveNumILRRefIdx     ( Int i )         { m_activeNumILRRefIdx = i; }  
 
-  Int       getInterLayerPredLayerIdc (UInt Idx )               { return  m_aiInterLayerPredLayerIdc[Idx];       }
-  Void      setInterLayerPredLayerIdc (UInt val,UInt Idx)       { m_aiInterLayerPredLayerIdc[Idx] = val;         }
+  Int       getInterLayerPredLayerIdc (UInt Idx )               { return  m_interLayerPredLayerIdc[Idx];}
+  Void      setInterLayerPredLayerIdc (UInt val, UInt Idx)      { m_interLayerPredLayerIdc[Idx] = val;  }
 #endif 
   Int       getNumRefIdx        ( RefPicList e )                { return  m_aiNumRefIdx[e];             }
@@ -1796,6 +1799,6 @@
   Bool      getEnableTMVPFlag     ()              { return m_enableTMVPFlag;}
 #if JCTVC_M0458_INTERLAYER_RPS_SIG
-  Void      setInterLayerPredEnabledFlag     ( Bool   val )    { m_bInterLayerPredEnabledFlag = val; }
-  Bool      getInterLayerPredEnabledFlag     ()                { return m_bInterLayerPredEnabledFlag;}
+  Void      setInterLayerPredEnabledFlag     ( Bool   val )    { m_interLayerPredEnabledFlag = val; }
+  Bool      getInterLayerPredEnabledFlag     ()                { return m_interLayerPredEnabledFlag;}
 
   Void      setNumInterLayerRefPics          ( UInt   val )    { m_numInterLayerRefPics = val; }
Index: branches/SHM-2.0-dev/source/Lib/TLibEncoder/TEncGOP.cpp
===================================================================
--- branches/SHM-2.0-dev/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 175)
+++ branches/SHM-2.0-dev/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 176)
@@ -669,9 +669,4 @@
         pcSlice->setNumRefIdx(REF_PIC_LIST_1, pcSlice->getNumRefIdx(REF_PIC_LIST_1)+pcSlice->getNumILRRefIdx());
       }
-#if JCTVC_M0458_INTERLAYER_RPS_SIG
-        // currently only one reference layer is supported in software and no decision logic to select yet.
-        // hence num of active inter layer references is set to one always
-          pcSlice->setActiveNumILRRefIdx(1);
-#endif 
     }
 #endif
Index: branches/SHM-2.0-dev/source/Lib/TLibEncoder/TEncSlice.cpp
===================================================================
--- branches/SHM-2.0-dev/source/Lib/TLibEncoder/TEncSlice.cpp	(revision 175)
+++ branches/SHM-2.0-dev/source/Lib/TLibEncoder/TEncSlice.cpp	(revision 176)
@@ -194,6 +194,7 @@
   rpcSlice->setPic( pcPic );
 #if SVC_EXTENSION
+  UInt layerId = pcPic->getLayerId();
   rpcSlice->setVPS( vps );
-  rpcSlice->initSlice( pcPic->getLayerId() );
+  rpcSlice->initSlice( layerId );
 #else
   rpcSlice->initSlice();
@@ -486,9 +487,21 @@
   xStoreWPparam( pPPS->getUseWP(), pPPS->getWPBiPred() );
 
+#if SVC_EXTENSION
+  if( layerId > 0 )
+  {
 #if JCTVC_M0458_INTERLAYER_RPS_SIG
   // currently only one reference layer is supported in software and no decision logic to select yet.
   // hence num of active inter layer references is set to one always
-  rpcSlice->setActiveNumILRRefIdx(1);
+    if( rpcSlice->getNumILRRefIdx() > 0 )
+    {
+      rpcSlice->setActiveNumILRRefIdx(1);
+      rpcSlice->setInterLayerPredEnabledFlag(1);
+    }
+#else
+    rpcSlice->setNumILRRefIdx( rpcSlice->getVPS()->getNumDirectRefLayers( layerId ) );
 #endif 
+  }
+
+#endif
 }
 
