Index: branches/SHM-2.1-dev/source/Lib/TLibDecoder/TDecTop.cpp
===================================================================
--- branches/SHM-2.1-dev/source/Lib/TLibDecoder/TDecTop.cpp	(revision 249)
+++ branches/SHM-2.1-dev/source/Lib/TLibDecoder/TDecTop.cpp	(revision 250)
@@ -249,5 +249,5 @@
     {
 #if VPS_EXTN_DIRECT_REF_LAYERS
-      TDecTop *pcTDecTopBase = (TDecTop *)getRefLayerDec( m_layerId );
+      TDecTop *pcTDecTopBase = (TDecTop *)getRefLayerDec( m_layerId - 1 );
 #else
       TDecTop *pcTDecTopBase = (TDecTop *)getLayerDec( m_layerId-1 );
@@ -832,5 +832,5 @@
       {
 #if VPS_EXTN_DIRECT_REF_LAYERS
-        TDecTop *pcTDecTop = (TDecTop *)getRefLayerDec( m_layerId );
+        TDecTop *pcTDecTop = (TDecTop *)getRefLayerDec( m_layerId - 1 );
 #else
         TDecTop *pcTDecTop = (TDecTop *)getLayerDec( m_layerId-1 );
@@ -1281,5 +1281,5 @@
 
 #if VPS_EXTN_DIRECT_REF_LAYERS
-TDecTop* TDecTop::getRefLayerDec( UInt layerId )
+TDecTop* TDecTop::getRefLayerDec( UInt refLayerIdc )
 {
   TComVPS* vps = m_parameterSetManagerDecoder[0].getActiveVPS();
@@ -1299,5 +1299,5 @@
 #endif 
   
-  return (TDecTop *)getLayerDec( vps->getRefLayerId( m_layerId, 0 ) );
+  return (TDecTop *)getLayerDec( vps->getRefLayerId( m_layerId, refLayerIdc ) );
 }
 #endif
Index: branches/SHM-2.1-dev/source/Lib/TLibDecoder/TDecTop.h
===================================================================
--- branches/SHM-2.1-dev/source/Lib/TLibDecoder/TDecTop.h	(revision 249)
+++ branches/SHM-2.1-dev/source/Lib/TLibDecoder/TDecTop.h	(revision 250)
@@ -157,5 +157,5 @@
   TDecTop*  getLayerDec(UInt layer)     { return m_ppcTDecTop[layer]; }
 #if VPS_EXTN_DIRECT_REF_LAYERS
-  TDecTop*  getRefLayerDec(UInt layerId);
+  TDecTop*  getRefLayerDec(UInt refLayerIdc);
 #endif
 #if AVC_BASE
Index: branches/SHM-2.1-dev/source/Lib/TLibEncoder/TEncGOP.cpp
===================================================================
--- branches/SHM-2.1-dev/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 249)
+++ branches/SHM-2.1-dev/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 250)
@@ -536,5 +536,5 @@
     {
 #if VPS_EXTN_DIRECT_REF_LAYERS
-      TComList<TComPic*> *cListPic = m_ppcTEncTop[m_layerId]->getRefLayerEnc(m_layerId)->getListPic();
+      TComList<TComPic*> *cListPic = m_ppcTEncTop[m_layerId]->getRefLayerEnc(m_layerId-1)->getListPic();
 #else
       TComList<TComPic*> *cListPic = m_ppcTEncTop[m_layerId-1]->getListPic();
Index: branches/SHM-2.1-dev/source/Lib/TLibEncoder/TEncTop.cpp
===================================================================
--- branches/SHM-2.1-dev/source/Lib/TLibEncoder/TEncTop.cpp	(revision 249)
+++ branches/SHM-2.1-dev/source/Lib/TLibEncoder/TEncTop.cpp	(revision 250)
@@ -508,5 +508,5 @@
       {
 #if VPS_EXTN_DIRECT_REF_LAYERS
-        TEncTop *pcEncTopBase = (TEncTop *)getRefLayerEnc( m_layerId );
+        TEncTop *pcEncTopBase = (TEncTop *)getRefLayerEnc( m_layerId - 1 );
 #else
         TEncTop *pcEncTopBase = (TEncTop *)getLayerEnc( m_layerId-1 );
@@ -539,5 +539,5 @@
       {
 #if VPS_EXTN_DIRECT_REF_LAYERS
-        TEncTop *pcEncTopBase = (TEncTop *)getRefLayerEnc( m_layerId );
+        TEncTop *pcEncTopBase = (TEncTop *)getRefLayerEnc( m_layerId - 1 );
 #else
         TEncTop *pcEncTopBase = (TEncTop *)getLayerEnc( m_layerId-1 );
@@ -1199,5 +1199,5 @@
 #if SVC_EXTENSION
 #if VPS_EXTN_DIRECT_REF_LAYERS
-TEncTop* TEncTop::getRefLayerEnc( UInt layerId )
+TEncTop* TEncTop::getRefLayerEnc( UInt refLayerIdc )
 {
   if( m_ppcTEncTop[m_layerId]->getNumDirectRefLayers() <= 0 )
@@ -1213,5 +1213,5 @@
   assert( m_ppcTEncTop[m_layerId]->getNumDirectRefLayers() == 1 );
 
-  return (TEncTop *)getLayerEnc( getVPS()->getRefLayerId( m_layerId, 0 ) );
+  return (TEncTop *)getLayerEnc( getVPS()->getRefLayerId( m_layerId, refLayerIdc ) );
 }
 #endif
Index: branches/SHM-2.1-dev/source/Lib/TLibEncoder/TEncTop.h
===================================================================
--- branches/SHM-2.1-dev/source/Lib/TLibEncoder/TEncTop.h	(revision 249)
+++ branches/SHM-2.1-dev/source/Lib/TLibEncoder/TEncTop.h	(revision 250)
@@ -231,5 +231,5 @@
   Void      encodePrep( TComPicYuv* pcPicYuvOrg );
 #if VPS_EXTN_DIRECT_REF_LAYERS
-  TEncTop*  getRefLayerEnc(UInt layerId);
+  TEncTop*  getRefLayerEnc(UInt refLayerIdc);
 #endif
 #else
