Index: /branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.cpp
===================================================================
--- /branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.cpp	(revision 1083)
+++ /branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.cpp	(revision 1084)
@@ -2038,4 +2038,9 @@
     else
     {
+      if( layer == 0 )
+      {
+        m_profileList[0] = Profile::Name(extendedProfile[0]);
+      }
+
       m_profileList[layerPTLIdx] = Profile::Name(extendedProfile[layerPTLIdx]);
     }
@@ -3324,5 +3329,8 @@
     assert(m_levelList[0] >= m_levelList[1]);            //Level IDC of VpsProfileTierLevel[ 0 ] should not be less than level IDC of VpsProfileTierLevel[ 1 ]. 
                                                          //NOTE that this is not conformance constraint but it would be nice if our encoder can prevent inefficient level IDC assignment
-    if (m_levelList[0] == m_levelList[1]) printf("Warning: Level0 is set the same as Level1\n");
+    if (m_levelList[0] == m_levelList[1])
+    {
+      printf("Warning: Level0 is set the same as Level1\n");
+    }
   }
 #else
Index: /branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp	(revision 1083)
+++ /branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp	(revision 1084)
@@ -1995,5 +1995,5 @@
         {
           // check for the sample prediction picture type
-          if( m_ppcTDecTop[m_layerId]->getSamplePredEnabledFlag(pcSlice->getVPS()->getLayerIdxInVps(refLayerId)))
+          if( pcSlice->getVPS()->isSamplePredictionType( pcSlice->getVPS()->getLayerIdxInVps(m_layerId), pcSlice->getVPS()->getLayerIdxInVps(refLayerId) ) )
           {
 #if O0215_PHASE_ALIGNMENT_REMOVAL
@@ -2144,5 +2144,5 @@
       if( refPic->isILR(pcSlice->getLayerId()) )
       {
-        assert( m_ppcTDecTop[m_layerId]->getMotionPredEnabledFlag( refPic->getLayerIdx() ) );
+        assert( pcSlice->getVPS()->isMotionPredictionType( pcSlice->getVPS()->getLayerIdxInVps(m_layerId), refPic->getLayerIdx() ) );
       }
     }
@@ -2785,11 +2785,5 @@
     decTop->setNumMotionPredRefLayers(0);
     decTop->setNumDirectRefLayers(0);
-    for(Int i = 0; i < MAX_VPS_LAYER_IDX_PLUS1; i++)
-    {
-      decTop->setSamplePredEnabledFlag(i, false);
-      decTop->setMotionPredEnabledFlag(i, false);
-      decTop->setSamplePredRefLayerId(i, 0);
-      decTop->setMotionPredRefLayerId(i, 0);
-    }
+
     for(Int j = 0; j < layerIdx; j++)
     {
@@ -2800,26 +2794,8 @@
 
         Int samplePredEnabledFlag = (vps->getDirectDependencyType(layerIdx, j) + 1) & 1;
-        decTop->setSamplePredEnabledFlag(j, samplePredEnabledFlag == 1 ? true : false);
         decTop->setNumSamplePredRefLayers(decTop->getNumSamplePredRefLayers() + samplePredEnabledFlag);
 
         Int motionPredEnabledFlag = ((vps->getDirectDependencyType(layerIdx, j) + 1) & 2) >> 1;
-        decTop->setMotionPredEnabledFlag(j, motionPredEnabledFlag == 1 ? true : false);
         decTop->setNumMotionPredRefLayers(decTop->getNumMotionPredRefLayers() + motionPredEnabledFlag);
-      }
-    }
-  }
-  for( Int i = 1; i < m_numLayer; i++ )
-  {
-    Int mIdx = 0, sIdx = 0;
-    TDecTop *decTop = (TDecTop *)getLayerDec(vps->getLayerIdInNuh(i));
-    for ( Int j = 0; j < i; j++ )
-    {
-      if (decTop->getMotionPredEnabledFlag(j))
-      {
-        decTop->setMotionPredRefLayerId(mIdx++, vps->getLayerIdInNuh(j));
-      }
-      if (decTop->getSamplePredEnabledFlag(j))
-      {
-        decTop->setSamplePredRefLayerId(sIdx++, vps->getLayerIdInNuh(j));
       }
     }
Index: /branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.h
===================================================================
--- /branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.h	(revision 1083)
+++ /branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.h	(revision 1084)
@@ -151,9 +151,5 @@
   Int                     m_refLayerId[MAX_VPS_LAYER_IDX_PLUS1];
   Int                     m_numSamplePredRefLayers;
-  Int                     m_samplePredRefLayerId[MAX_VPS_LAYER_IDX_PLUS1];
   Int                     m_numMotionPredRefLayers;
-  Int                     m_motionPredRefLayerId[MAX_VPS_LAYER_IDX_PLUS1];
-  Bool                    m_samplePredEnabledFlag[MAX_VPS_LAYER_IDX_PLUS1];
-  Bool                    m_motionPredEnabledFlag[MAX_VPS_LAYER_IDX_PLUS1];
 #endif
   TComPic*                m_cIlpPic[MAX_NUM_REF];                    ///<  Inter layer Prediction picture =  upsampled picture
@@ -273,18 +269,6 @@
   Void      setNumSamplePredRefLayers       (Int num)                       { m_numSamplePredRefLayers = num;   }
 
-  Int       getSamplePredRefLayerId         (Int layerIdc)                  { return m_samplePredRefLayerId[layerIdc];       }
-  Void      setSamplePredRefLayerId         (Int layerIdc, Int refLayerId)  { m_samplePredRefLayerId[layerIdc] = refLayerId; }
-
   Int       getNumMotionPredRefLayers       ()                              { return m_numMotionPredRefLayers;  }
   Void      setNumMotionPredRefLayers       (Int num)                       { m_numMotionPredRefLayers = num;   }
-
-  Int       getMotionPredRefLayerId         (Int layerIdc)                  { return m_motionPredRefLayerId[layerIdc];       }
-  Void      setMotionPredRefLayerId         (Int layerIdc, Int refLayerId)  { m_motionPredRefLayerId[layerIdc] = refLayerId; }
-
-  Bool      getSamplePredEnabledFlag        (Int layerIdx)                  { return m_samplePredEnabledFlag[layerIdx];  }
-  Void      setSamplePredEnabledFlag        (Int layerIdx, Bool flag)       { m_samplePredEnabledFlag[layerIdx] = flag;  }
-
-  Bool      getMotionPredEnabledFlag        (Int layerIdx)                  { return m_motionPredEnabledFlag[layerIdx];  }
-  Void      setMotionPredEnabledFlag        (Int layerIdx, Bool flag)       { m_motionPredEnabledFlag[layerIdx] = flag;  }
 
   Void      setRefLayerParams( TComVPS* vps );
Index: /branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp
===================================================================
--- /branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 1083)
+++ /branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 1084)
@@ -1420,5 +1420,5 @@
         {
           // check for the sample prediction picture type
-          if( m_ppcTEncTop[pcSlice->getVPS()->getLayerIdxInVps(m_layerId)]->getSamplePredEnabledFlag(pcSlice->getVPS()->getLayerIdxInVps(refLayerId)))
+          if( pcSlice->getVPS()->isSamplePredictionType( pcSlice->getVPS()->getLayerIdxInVps(m_layerId), pcSlice->getVPS()->getLayerIdxInVps(refLayerId) ) )
           {
 #if P0312_VERT_PHASE_ADJ
@@ -1846,5 +1846,5 @@
         for( Int i = 0; i < pcSlice->getActiveNumILRRefIdx(); i++ )
         {
-          if( m_ppcTEncTop[pcSlice->getVPS()->getLayerIdxInVps(m_layerId)]->getSamplePredEnabledFlag( pcSlice->getInterLayerPredLayerIdc(i) ) )
+          if( pcSlice->getVPS()->isSamplePredictionType( pcSlice->getVPS()->getLayerIdxInVps(m_layerId), pcSlice->getInterLayerPredLayerIdc(i) ) )
           {
             foundSamplePredPicture = true;
@@ -1974,5 +1974,5 @@
           // It is a requirement of bitstream conformance when the collocated picture, used for temporal motion vector prediction, is an inter-layer reference picture, 
           // VpsInterLayerMotionPredictionEnabled[ LayerIdxInVps[ currLayerId ] ][ LayerIdxInVps[ rLId ] ] shall be equal to 1, where rLId is set equal to nuh_layer_id of the inter-layer picture.
-          if( refPic->isILR(m_layerId) && m_ppcTEncTop[pcSlice->getVPS()->getLayerIdxInVps(m_layerId)]->getMotionPredEnabledFlag( refPic->getLayerIdx() )
+          if( refPic->isILR(m_layerId) && pcSlice->getVPS()->isMotionPredictionType( pcSlice->getVPS()->getLayerIdxInVps(m_layerId), refPic->getLayerIdx() )
 #if MFM_ENCCONSTRAINT
             && pcSlice->getBaseColPic( *m_ppcTEncTop[refPic->getLayerIdx()]->getListPic() )->checkSameRefInfo() == true 
@@ -1996,5 +1996,5 @@
             // It is a requirement of bitstream conformance when the collocated picture, used for temporal motion vector prediction, is an inter-layer reference picture, 
             // VpsInterLayerMotionPredictionEnabled[ LayerIdxInVps[ currLayerId ] ][ LayerIdxInVps[ rLId ] ] shall be equal to 1, where rLId is set equal to nuh_layer_id of the inter-layer picture.
-            if( refPic->isILR(m_layerId) && m_ppcTEncTop[pcSlice->getVPS()->getLayerIdxInVps(m_layerId)]->getMotionPredEnabledFlag( refPic->getLayerIdx() )
+            if( refPic->isILR(m_layerId) && pcSlice->getVPS()->isMotionPredictionType( pcSlice->getVPS()->getLayerIdxInVps(m_layerId), refPic->getLayerIdx() )
 #if MFM_ENCCONSTRAINT
               && pcSlice->getBaseColPic( *m_ppcTEncTop[refPic->getLayerIdx()]->getListPic() )->checkSameRefInfo() == true 
@@ -2115,5 +2115,5 @@
         // It is a requirement of bitstream conformance when the collocated picture, used for temporal motion vector prediction, is an inter-layer reference picture, 
         // VpsInterLayerMotionPredictionEnabled[ LayerIdxInVps[ currLayerId ] ][ LayerIdxInVps[ rLId ] ] shall be equal to 1, where rLId is set equal to nuh_layer_id of the inter-layer picture.
-        if( refPic->isILR(m_layerId) && !m_ppcTEncTop[pcSlice->getVPS()->getLayerIdxInVps(m_layerId)]->getMotionPredEnabledFlag(refPic->getLayerIdx()) )
+        if( refPic->isILR(m_layerId) && !pcSlice->getVPS()->isMotionPredictionType( pcSlice->getVPS()->getLayerIdxInVps(m_layerId), refPic->getLayerIdx() ) )
         {
           pcSlice->setEnableTMVPFlag(false);
@@ -2133,5 +2133,5 @@
           TComPic* refPic = pcSlice->getRefPic(refList, refIdx);
 
-          if( !refPic->isILR(m_layerId) || ( refPic->isILR(m_layerId) && m_ppcTEncTop[pcSlice->getVPS()->getLayerIdxInVps(m_layerId)]->getSamplePredEnabledFlag( refPic->getLayerIdx() ) ) )
+          if( !refPic->isILR(m_layerId) || ( refPic->isILR(m_layerId) && pcSlice->getVPS()->isSamplePredictionType( pcSlice->getVPS()->getLayerIdxInVps(m_layerId), refPic->getLayerIdx() ) ) )
           {
             break;
@@ -2157,5 +2157,5 @@
           TComPic* refPic = pcSlice->getRefPic(refList, refIdx);
 
-          if( !refPic->isILR(m_layerId) || ( refPic->isILR(m_layerId) && m_ppcTEncTop[pcSlice->getVPS()->getLayerIdxInVps(m_layerId)]->getSamplePredEnabledFlag( refPic->getLayerIdx() ) ) )
+          if( !refPic->isILR(m_layerId) || ( refPic->isILR(m_layerId) && pcSlice->getVPS()->isSamplePredictionType( pcSlice->getVPS()->getLayerIdxInVps(m_layerId), refPic->getLayerIdx() ) ) )
           {
             break;
