Index: branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.cpp
===================================================================
--- branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.cpp	(revision 1447)
+++ branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.cpp	(revision 1448)
@@ -782,4 +782,5 @@
   string* cfg_scalingListFileName[MAX_LAYERS];
   ScalingListMode*   cfg_UseScalingListId[MAX_LAYERS];
+  Int*    cfg_inheritCodingStruct[MAX_LAYERS];
 
   Bool*   cfg_bUseSAO[MAX_LAYERS];
@@ -865,4 +866,6 @@
     cfg_RCInitialCpbFullness[layer]   = &m_apcLayerCfg[layer]->m_RCInitialCpbFullness;
 #endif
+
+    cfg_inheritCodingStruct[layer]    = &m_apcLayerCfg[layer]->m_inheritCodingStruct;
 #endif
 
@@ -1649,8 +1652,13 @@
 #endif
 #endif
-  ("InheritCodingStruct%d",                             m_inheritCodingStruct, 0, m_numLayers, "Predicts the GOP structure of one layer for another layer")
+  ("InheritCodingStruct%d",                           cfg_inheritCodingStruct, 0, m_numLayers, "Predicts the GOP structure of one layer for another layer")
 #endif //SVC_EXTENSION
   ;
 
+#if SVC_EXTENSION
+  for (Int j=0; j<m_numLayers; j++)
+  {
+    GOPEntry* m_GOPList = m_apcLayerCfg[j]->m_GOPList;
+#endif
   for(Int i=1; i<MAX_GOP+1; i++)
   {
@@ -1659,16 +1667,7 @@
     opts.addOptions()(cOSS.str(), m_GOPList[i-1], GOPEntry());
   }
-
-#if SVC_EXTENSION
-  for (Int i=1; i<m_numLayers; i++)
-  {
-    for(Int j=1; j<MAX_GOP+1; j++)
-    { 
-      std::ostringstream cOSS;
-      cOSS<<"Layer"<<i<<"Frame"<<j;
-      opts.addOptions()(cOSS.str(), m_EhGOPList[i][j-1], GOPEntry());
-    }
-  }
-#endif 
+#if SVC_EXTENSION
+  }
+#endif
 
   po::setDefaults(opts);
@@ -1684,18 +1683,11 @@
 #endif
 
-  for (Int i=1; i<m_numLayers; i++)
-  {
-    if(m_inheritCodingStruct[i] == 0)
-    {
-      for(Int j=1; j<MAX_GOP+1; j++)
-      { 
-        m_EhGOPList[i][j-1] = m_GOPList[j-1];
-      }
-    }
-    else if( m_inheritCodingStruct[i] > 0)
-    {
-      for(Int j=1; j<MAX_GOP+1; j++)
-      {
-        m_EhGOPList[i][j-1] = m_EhGOPList[m_inheritCodingStruct[i]][j-1];
+  for( Int i=1; i<m_numLayers; i++ )
+  {    
+    if( m_apcLayerCfg[i]->m_inheritCodingStruct > 0)
+    {
+      for( Int j=1; j<MAX_GOP+1; j++ )
+      {
+        m_apcLayerCfg[i]->m_GOPList[j-1] = m_apcLayerCfg[m_apcLayerCfg[i]->m_inheritCodingStruct]->m_GOPList[j-1];
       }
     }
@@ -3003,4 +2995,8 @@
 
   Int& m_iWaveFrontSynchro                    = m_apcLayerCfg[layerIdx]->m_waveFrontSynchro;
+
+  Int& m_maxTempLayer                         = m_apcLayerCfg[layerIdx]->m_maxTempLayer;
+  Int& m_extraRPSs                            = m_apcLayerCfg[layerIdx]->m_extraRPSs;
+  GOPEntry* m_GOPList                         = m_apcLayerCfg[layerIdx]->m_GOPList;
 #else
 Void TAppEncCfg::xCheckParameter()
@@ -3342,6 +3338,5 @@
   /* if this is an intra-only sequence, ie IntraPeriod=1, don't verify the GOP structure
    * This permits the ability to omit a GOP structure specification */
-#if SVC_EXTENSION
-  if( m_apcLayerCfg[0]->m_iIntraPeriod == 1 && m_GOPList[0].m_POC == -1 )
+  if (m_iIntraPeriod == 1 && m_GOPList[0].m_POC == -1)
   {
     m_GOPList[0] = GOPEntry();
@@ -3356,32 +3351,4 @@
     xConfirmPara( m_intraConstraintFlag, "IntraConstraintFlag cannot be 1 for inter sequences");
   }
-
-  if (m_apcLayerCfg[layerIdx]->m_iIntraPeriod == 1 && m_EhGOPList[layerIdx][0].m_POC == -1) {
-    m_EhGOPList[layerIdx][0] = GOPEntry();
-    m_EhGOPList[layerIdx][0].m_QPFactor = 1;
-    m_EhGOPList[layerIdx][0].m_betaOffsetDiv2 = 0;
-    m_EhGOPList[layerIdx][0].m_tcOffsetDiv2 = 0;
-    m_EhGOPList[layerIdx][0].m_POC = 1;
-    m_EhGOPList[layerIdx][0].m_numRefPicsActive = 4;
-  }
-  else
-  {
-    xConfirmPara( m_intraConstraintFlag, "IntraConstraintFlag cannot be 1 for inter sequences");
-  }
-#else
-  if (m_iIntraPeriod == 1 && m_GOPList[0].m_POC == -1)
-  {
-    m_GOPList[0] = GOPEntry();
-    m_GOPList[0].m_QPFactor = 1;
-    m_GOPList[0].m_betaOffsetDiv2 = 0;
-    m_GOPList[0].m_tcOffsetDiv2 = 0;
-    m_GOPList[0].m_POC = 1;
-    m_GOPList[0].m_numRefPicsActive = 4;
-  }
-  else
-  {
-    xConfirmPara( m_intraConstraintFlag, "IntraConstraintFlag cannot be 1 for inter sequences");
-  }
-#endif
 
   Bool verifiedGOP=false;
@@ -3434,9 +3401,5 @@
   }
 
-#if SVC_EXTENSION
-  memset( m_extraRPSs, 0, sizeof( m_extraRPSs ) );
-#else
   m_extraRPSs=0;
-#endif
 
   //start looping through frames in coding order until we can verify that the GOP structure is correct.
@@ -3505,9 +3468,5 @@
       {
         //create a new GOPEntry for this frame containing all the reference pictures that were available (POC > 0)
-#if SVC_EXTENSION
-        m_GOPList[m_iGOPSize+m_extraRPSs[0]]=m_GOPList[curGOP];
-#else
         m_GOPList[m_iGOPSize+m_extraRPSs]=m_GOPList[curGOP];
-#endif
         Int newRefs=0;
         for(Int i = 0; i< m_GOPList[curGOP].m_numRefPics; i++)
@@ -3516,11 +3475,6 @@
           if(absPOC>=0)
           {
-#if SVC_EXTENSION
-            m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_referencePics[newRefs]=m_GOPList[curGOP].m_referencePics[i];
-            m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_usedByCurrPic[newRefs]=m_GOPList[curGOP].m_usedByCurrPic[i];
-#else
             m_GOPList[m_iGOPSize+m_extraRPSs].m_referencePics[newRefs]=m_GOPList[curGOP].m_referencePics[i];
             m_GOPList[m_iGOPSize+m_extraRPSs].m_usedByCurrPic[newRefs]=m_GOPList[curGOP].m_usedByCurrPic[i];
-#endif
             newRefs++;
           }
@@ -3545,9 +3499,5 @@
             for(Int i=0; i<newRefs; i++)
             {
-#if SVC_EXTENSION
-              if( m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_referencePics[i] == offPOC-curPOC )
-#else
               if(m_GOPList[m_iGOPSize+m_extraRPSs].m_referencePics[i]==offPOC-curPOC)
-#endif
               {
                 newRef=false;
@@ -3564,9 +3514,5 @@
               for(Int j=0; j<newRefs; j++)
               {
-#if SVC_EXTENSION
-                if( m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_referencePics[j] < offPOC-curPOC || m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_referencePics[j] > 0 )
-#else
                 if(m_GOPList[m_iGOPSize+m_extraRPSs].m_referencePics[j]<offPOC-curPOC||m_GOPList[m_iGOPSize+m_extraRPSs].m_referencePics[j]>0)
-#endif
                 {
                   insertPoint = j;
@@ -3578,15 +3524,8 @@
               for(Int j=insertPoint; j<newRefs+1; j++)
               {
-#if SVC_EXTENSION
-                Int newPrev = m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_referencePics[j];
-                Int newUsed = m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_usedByCurrPic[j];
-                m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_referencePics[j]=prev;
-                m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_usedByCurrPic[j]=prevUsed;
-#else
                 Int newPrev = m_GOPList[m_iGOPSize+m_extraRPSs].m_referencePics[j];
                 Int newUsed = m_GOPList[m_iGOPSize+m_extraRPSs].m_usedByCurrPic[j];
                 m_GOPList[m_iGOPSize+m_extraRPSs].m_referencePics[j]=prev;
                 m_GOPList[m_iGOPSize+m_extraRPSs].m_usedByCurrPic[j]=prevUsed;
-#endif
 
                 prevUsed=newUsed;
@@ -3602,17 +3541,4 @@
         }
 
-#if SVC_EXTENSION
-        m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_numRefPics=newRefs;
-        m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_POC = curPOC;
-
-        if( m_extraRPSs[0] == 0 )
-        {
-          m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_interRPSPrediction = 0;
-          m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_numRefIdc = 0;
-        }
-        else
-        {
-          Int rIdx =  m_iGOPSize + m_extraRPSs[0] - 1;
-#else
         m_GOPList[m_iGOPSize+m_extraRPSs].m_numRefPics=newRefs;
         m_GOPList[m_iGOPSize+m_extraRPSs].m_POC = curPOC;
@@ -3626,5 +3552,4 @@
         {
           Int rIdx =  m_iGOPSize + m_extraRPSs - 1;
-#endif
           Int refPOC = m_GOPList[rIdx].m_POC;
           Int refPics = m_GOPList[rIdx].m_numRefPics;
@@ -3636,30 +3561,4 @@
             Int refIdc = 0;
 
-#if SVC_EXTENSION
-            for (Int j = 0; j < m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_numRefPics; j++)
-            {
-              if ( (absPOCref - curPOC) == m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_referencePics[j])
-              {
-                if (m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_usedByCurrPic[j])
-                {
-                  refIdc = 1;
-                }
-                else
-                {
-                  refIdc = 2;
-                }
-              }
-            }
-            m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_refIdc[newIdc]=refIdc;
-            newIdc++;
-          }
-          m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_interRPSPrediction = 1;  
-          m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_numRefIdc = newIdc;
-          m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_deltaRPS = refPOC - m_GOPList[m_iGOPSize+m_extraRPSs[0]].m_POC; 
-        }
-        curGOP=m_iGOPSize+m_extraRPSs[0];
-        m_extraRPSs[0]++;
-      }
-#else
             for (Int j = 0; j < m_GOPList[m_iGOPSize+m_extraRPSs].m_numRefPics; j++)
             {
@@ -3686,5 +3585,4 @@
         m_extraRPSs++;
       }
-#endif
 
       numRefs=0;
@@ -3704,253 +3602,4 @@
   }
   xConfirmPara(errorGOP,"Invalid GOP structure given");
-
-#if SVC_EXTENSION
-  if( layerIdx > 0 )
-  {
-    verifiedGOP=false;
-    errorGOP=false;
-    checkGOP=1;
-    numRefs = m_isField ? 2 : 1;
-    refList[0]=0;
-
-    if(m_isField)
-    {
-      refList[1] = 1;
-    }
-
-    memset( isOK, 0, sizeof( isOK ) );
-    numOK=0;
-
-    for(Int i=0; i<m_iGOPSize; i++)
-    {
-      if(m_EhGOPList[layerIdx][i].m_POC==m_iGOPSize)
-      {
-        xConfirmPara( m_EhGOPList[layerIdx][i].m_temporalId!=0 , "The last frame in each GOP must have temporal ID = 0 " );
-      }
-    }
-
-    xConfirmPara( m_numLayers > MAX_LAYERS , "Number of layers in config file is greater than MAX_LAYERS" );
-    m_numLayers = m_numLayers > MAX_LAYERS ? MAX_LAYERS : m_numLayers;
-
-    // verify layer configuration parameters
-    for(UInt layer=0; layer<m_numLayers; layer++)
-    {
-      if ( (m_apcLayerCfg[layer]->m_iIntraPeriod != 1) && !m_loopFilterOffsetInPPS && (!m_bLoopFilterDisable) )
-      {
-        for(Int i=0; i<m_iGOPSize; i++)
-        {
-          xConfirmPara( (m_EhGOPList[layerIdx][i].m_betaOffsetDiv2 + m_loopFilterBetaOffsetDiv2) < -6 || (m_EhGOPList[layerIdx][i].m_betaOffsetDiv2 + m_loopFilterBetaOffsetDiv2) > 6, "Loop Filter Beta Offset div. 2 for one of the GOP entries exceeds supported range (-6 to 6)" );
-          xConfirmPara( (m_EhGOPList[layerIdx][i].m_tcOffsetDiv2 + m_loopFilterTcOffsetDiv2) < -6 || (m_EhGOPList[layerIdx][i].m_tcOffsetDiv2 + m_loopFilterTcOffsetDiv2) > 6, "Loop Filter Tc Offset div. 2 for one of the GOP entries exceeds supported range (-6 to 6)" );
-        }
-      }
-    }
-
-    //start looping through frames in coding order until we can verify that the GOP structure is correct.
-    while(!verifiedGOP&&!errorGOP) 
-    {
-      Int curGOP = (checkGOP-1)%m_iGOPSize;
-      Int curPOC = ((checkGOP-1)/m_iGOPSize)*m_iGOPSize + m_EhGOPList[layerIdx][curGOP].m_POC;    
-      if(m_EhGOPList[layerIdx][curGOP].m_POC<0) 
-      {
-        printf("\nError: found fewer Reference Picture Sets than GOPSize\n");
-        errorGOP=true;
-      }
-      else 
-      {
-        //check that all reference pictures are available, or have a POC < 0 meaning they might be available in the next GOP.
-        Bool beforeI = false;
-        for(Int i = 0; i< m_EhGOPList[layerIdx][curGOP].m_numRefPics; i++) 
-        {
-          Int absPOC = curPOC+m_EhGOPList[layerIdx][curGOP].m_referencePics[i];
-          if(absPOC < 0)
-          {
-            beforeI=true;
-          }
-          else 
-          {
-            Bool found=false;
-            for(Int j=0; j<numRefs; j++) 
-            {
-              if(refList[j]==absPOC) 
-              {
-                found=true;
-                for(Int k=0; k<m_iGOPSize; k++)
-                {
-                  if(absPOC%m_iGOPSize == m_EhGOPList[layerIdx][k].m_POC%m_iGOPSize)
-                  {
-                    if(m_EhGOPList[layerIdx][k].m_temporalId==m_EhGOPList[layerIdx][curGOP].m_temporalId)
-                    {
-                      m_EhGOPList[layerIdx][k].m_refPic = true;
-                    }
-                    m_EhGOPList[layerIdx][curGOP].m_usedByCurrPic[i]=m_EhGOPList[layerIdx][k].m_temporalId<=m_EhGOPList[layerIdx][curGOP].m_temporalId;
-                  }
-                }
-              }
-            }
-            if(!found)
-            {
-              printf("\nError: ref pic %d is not available for GOP frame %d\n",m_EhGOPList[layerIdx][curGOP].m_referencePics[i],curGOP+1);
-              errorGOP=true;
-            }
-          }
-        }
-        if(!beforeI&&!errorGOP)
-        {
-          //all ref frames were present
-          if(!isOK[curGOP]) 
-          {
-            numOK++;
-            isOK[curGOP]=true;
-            if(numOK==m_iGOPSize)
-            {
-              verifiedGOP=true;
-            }
-          }
-        }
-        else 
-        {
-          //create a new GOPEntry for this frame containing all the reference pictures that were available (POC > 0)
-
-          m_EhGOPList[layerIdx][m_iGOPSize+m_extraRPSs[layerIdx]]=m_EhGOPList[layerIdx][curGOP];
-          Int newRefs=0;
-          for(Int i = 0; i< m_EhGOPList[layerIdx][curGOP].m_numRefPics; i++) 
-          {
-            Int absPOC = curPOC+m_EhGOPList[layerIdx][curGOP].m_referencePics[i];
-            if(absPOC>=0)
-            {
-              m_EhGOPList[layerIdx][m_iGOPSize+m_extraRPSs[layerIdx]].m_referencePics[newRefs]=m_EhGOPList[layerIdx][curGOP].m_referencePics[i];
-              m_EhGOPList[layerIdx][m_iGOPSize+m_extraRPSs[layerIdx]].m_usedByCurrPic[newRefs]=m_EhGOPList[layerIdx][curGOP].m_usedByCurrPic[i];
-              newRefs++;
-            }
-          }
-          Int numPrefRefs = m_EhGOPList[layerIdx][curGOP].m_numRefPicsActive;
-
-          for(Int offset = -1; offset>-checkGOP; offset--)
-          {
-            //step backwards in coding order and include any extra available pictures we might find useful to replace the ones with POC < 0.
-            Int offGOP = (checkGOP-1+offset)%m_iGOPSize;
-            Int offPOC = ((checkGOP-1+offset)/m_iGOPSize)*m_iGOPSize + m_EhGOPList[layerIdx][offGOP].m_POC;
-            if(offPOC>=0&&m_EhGOPList[layerIdx][offGOP].m_temporalId<=m_EhGOPList[layerIdx][curGOP].m_temporalId)
-            {
-              Bool newRef=false;
-              for(Int i=0; i<numRefs; i++)
-              {
-                if(refList[i]==offPOC)
-                {
-                  newRef=true;
-                }
-              }
-              for(Int i=0; i<newRefs; i++) 
-              {
-                if(m_EhGOPList[layerIdx][m_iGOPSize+m_extraRPSs[layerIdx]].m_referencePics[i]==offPOC-curPOC)
-                {
-                  newRef=false;
-                }
-              }
-              if(newRef) 
-              {
-                Int insertPoint=newRefs;
-                //this picture can be added, find appropriate place in list and insert it.
-                if(m_EhGOPList[layerIdx][offGOP].m_temporalId==m_EhGOPList[layerIdx][curGOP].m_temporalId)
-                {
-                  m_EhGOPList[layerIdx][offGOP].m_refPic = true;
-                }
-                for(Int j=0; j<newRefs; j++)
-                {
-                  if(m_EhGOPList[layerIdx][m_iGOPSize+m_extraRPSs[layerIdx]].m_referencePics[j]<offPOC-curPOC||m_EhGOPList[layerIdx][m_iGOPSize+m_extraRPSs[layerIdx]].m_referencePics[j]>0)
-                  {
-                    insertPoint = j;
-                    break;
-                  }
-                }
-                Int prev = offPOC-curPOC;
-                Int prevUsed = m_EhGOPList[layerIdx][offGOP].m_temporalId<=m_EhGOPList[layerIdx][curGOP].m_temporalId;
-                for(Int j=insertPoint; j<newRefs+1; j++)
-                {
-                  Int newPrev = m_EhGOPList[layerIdx][m_iGOPSize+m_extraRPSs[layerIdx]].m_referencePics[j];
-                  Int newUsed = m_EhGOPList[layerIdx][m_iGOPSize+m_extraRPSs[layerIdx]].m_usedByCurrPic[j];
-                  m_EhGOPList[layerIdx][m_iGOPSize+m_extraRPSs[layerIdx]].m_referencePics[j]=prev;
-                  m_EhGOPList[layerIdx][m_iGOPSize+m_extraRPSs[layerIdx]].m_usedByCurrPic[j]=prevUsed;
-                  prevUsed=newUsed;
-                  prev=newPrev;
-                }
-                newRefs++;
-              }
-            }
-            if(newRefs>=numPrefRefs)
-            {
-              break;
-            }
-          }
-          m_EhGOPList[layerIdx][m_iGOPSize+m_extraRPSs[layerIdx]].m_numRefPics=newRefs;
-          m_EhGOPList[layerIdx][m_iGOPSize+m_extraRPSs[layerIdx]].m_POC = curPOC;
-          if (m_extraRPSs[layerIdx] == 0)
-          {
-            m_EhGOPList[layerIdx][m_iGOPSize+m_extraRPSs[layerIdx]].m_interRPSPrediction = 0;
-            m_EhGOPList[layerIdx][m_iGOPSize+m_extraRPSs[layerIdx]].m_numRefIdc = 0;
-          }
-          else
-          {
-            Int rIdx =  m_iGOPSize + m_extraRPSs[layerIdx] - 1;
-            Int refPOC = m_EhGOPList[layerIdx][rIdx].m_POC;
-            Int refPics = m_EhGOPList[layerIdx][rIdx].m_numRefPics;
-            Int newIdc=0;
-            for(Int i = 0; i<= refPics; i++) 
-            {
-              Int deltaPOC = ((i != refPics)? m_EhGOPList[layerIdx][rIdx].m_referencePics[i] : 0);  // check if the reference abs POC is >= 0
-              Int absPOCref = refPOC+deltaPOC;
-              Int refIdc = 0;
-              for (Int j = 0; j < m_EhGOPList[layerIdx][m_iGOPSize+m_extraRPSs[layerIdx]].m_numRefPics; j++)
-              {
-                if ( (absPOCref - curPOC) == m_EhGOPList[layerIdx][m_iGOPSize+m_extraRPSs[layerIdx]].m_referencePics[j])
-                {
-                  if (m_EhGOPList[layerIdx][m_iGOPSize+m_extraRPSs[layerIdx]].m_usedByCurrPic[j])
-                  {
-                    refIdc = 1;
-                  }
-                  else
-                  {
-                    refIdc = 2;
-                  }
-                }
-              }
-              m_EhGOPList[layerIdx][m_iGOPSize+m_extraRPSs[layerIdx]].m_refIdc[newIdc]=refIdc;
-              newIdc++;
-            }
-            m_EhGOPList[layerIdx][m_iGOPSize+m_extraRPSs[layerIdx]].m_interRPSPrediction = 1;  
-            m_EhGOPList[layerIdx][m_iGOPSize+m_extraRPSs[layerIdx]].m_numRefIdc = newIdc;
-            m_EhGOPList[layerIdx][m_iGOPSize+m_extraRPSs[layerIdx]].m_deltaRPS = refPOC - m_EhGOPList[layerIdx][m_iGOPSize+m_extraRPSs[layerIdx]].m_POC; 
-          }
-          curGOP=m_iGOPSize+m_extraRPSs[layerIdx];
-          m_extraRPSs[layerIdx]++;
-        }
-        numRefs=0;
-        for(Int i = 0; i< m_EhGOPList[layerIdx][curGOP].m_numRefPics; i++) 
-        {
-          Int absPOC = curPOC+m_EhGOPList[layerIdx][curGOP].m_referencePics[i];
-          if(absPOC >= 0) 
-          {
-            refList[numRefs]=absPOC;
-            numRefs++;
-          }
-        }
-        refList[numRefs]=curPOC;
-        numRefs++;
-      }
-      checkGOP++;
-    }
-    xConfirmPara(errorGOP,"Invalid GOP structure given");
-
-    m_EhMaxTempLayer[layerIdx] = 1;
-    for(Int i=0; i<m_iGOPSize; i++) 
-    {
-      if(m_EhGOPList[layerIdx][i].m_temporalId >= m_EhMaxTempLayer[layerIdx] )
-      {
-        m_EhMaxTempLayer[layerIdx] = m_EhGOPList[layerIdx][i].m_temporalId;
-      }
-      xConfirmPara(m_GOPList[i].m_sliceType!='B'&&m_GOPList[i].m_sliceType!='P'&&m_GOPList[i].m_sliceType!='I', "Slice type must be equal to B or P or I");
-    }
-  }
-#endif 
 
   m_maxTempLayer = 1;
Index: branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.h
===================================================================
--- branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.h	(revision 1447)
+++ branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.h	(revision 1448)
@@ -170,14 +170,9 @@
   Int       m_iGOPSize;                                       ///< GOP size of hierarchical structure
 
-#if SVC_EXTENSION
-  Int       m_extraRPSs[MAX_LAYERS];                          ///< extra RPSs added to handle CRA
-  GOPEntry  m_EhGOPList[MAX_LAYERS][MAX_GOP];                 ///< the enhancement layer coding structure entries from the config file
-  Int       m_inheritCodingStruct[MAX_LAYERS];
-  Int       m_EhMaxTempLayer[MAX_LAYERS];                    ///< Max temporal layer
-#else
+#if !SVC_EXTENSION
   Int       m_extraRPSs;                                      ///< extra RPSs added to handle CRA
-#endif
 
   GOPEntry  m_GOPList[MAX_GOP];                               ///< the coding structure entries from the config file
+#endif
   Int       m_numReorderPics[MAX_TLAYER];                     ///< total number of reorder pictures
   Int       m_maxDecPicBuffering[MAX_TLAYER];                 ///< total number of pictures in the decoded picture buffer
@@ -221,5 +216,7 @@
   Int       m_iQPAdaptationRange;                             ///< dQP range by QP adaptation
 
+#if !SVC_EXTENSION
   Int       m_maxTempLayer;                                  ///< Max temporal layer
+#endif
 
   // coding unit (CU) definition
Index: branches/SHM-dev/source/App/TAppEncoder/TAppEncLayerCfg.h
===================================================================
--- branches/SHM-dev/source/App/TAppEncoder/TAppEncLayerCfg.h	(revision 1447)
+++ branches/SHM-dev/source/App/TAppEncoder/TAppEncLayerCfg.h	(revision 1448)
@@ -42,4 +42,5 @@
   Int       m_aiPad[2];                                       ///< number of padded pixels for width and height
   Int       m_iIntraPeriod;                                   ///< period of I-slice (random access period)
+  Int       m_iGOPSize;                                       ///< GOP size of hierarchical structure
   Double    m_fQP;                                            ///< QP value of key-picture (floating point)
   ChromaFormat m_chromaFormatIDC;
@@ -53,4 +54,9 @@
   Int       m_auxId;
 #endif
+
+  Int       m_extraRPSs;                                     ///< extra RPSs added to handle CRA
+  GOPEntry  m_GOPList[MAX_GOP];                              ///< the enhancement layer coding structure entries from the config file
+  Int       m_inheritCodingStruct;                           ///< inherit coding structure from certain layer
+  Int       m_maxTempLayer;                                  ///< Max temporal layer
 
   Int       *m_samplePredRefLayerIds;
