Index: branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.cpp
===================================================================
--- branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.cpp	(revision 1171)
+++ branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.cpp	(revision 1172)
@@ -935,5 +935,5 @@
 #endif
   }
-#if Q0078_ADD_LAYER_SETS
+
   Int* cfg_numLayerInIdList[MAX_VPS_LAYER_SETS_PLUS1];
   string cfg_layerSetLayerIdList[MAX_VPS_LAYER_SETS_PLUS1];
@@ -942,4 +942,5 @@
   string cfg_highestLayerIdx[MAX_VPS_LAYER_SETS_PLUS1];
   string* cfg_highestLayerIdxPtr[MAX_VPS_LAYER_SETS_PLUS1];
+
   for (UInt i = 0; i < MAX_VPS_LAYER_SETS_PLUS1; i++)
   {
@@ -949,5 +950,5 @@
     cfg_numHighestLayerIdx[i] = &m_numHighestLayerIdx[i];
   }
-#endif
+
   string* cfg_numOutputLayersInOutputLayerSet = new string;
   string* cfg_listOfOutputLayers     = new string[MAX_VPS_OUTPUT_LAYER_SETS_PLUS1];
@@ -1059,5 +1060,5 @@
 
   ("NumLayers",                                     m_numLayers,                                             1, "Number of layers to code")  
-#if Q0078_ADD_LAYER_SETS
+
   ("NumLayerSets",                                  m_numLayerSets,                                          1, "Number of layer sets")
   ("NumLayerInIdList%d",                            cfg_numLayerInIdList,            0, MAX_VPS_LAYER_IDX_PLUS1, "Number of layers in the set")
@@ -1066,5 +1067,5 @@
   ("NumHighestLayerIdx%d",                          cfg_numHighestLayerIdx,          0, MAX_VPS_LAYER_IDX_PLUS1, "Number of highest layer idx")
   ("HighestLayerIdx%d",                             cfg_highestLayerIdxPtr, string(""), MAX_VPS_LAYER_IDX_PLUS1, "Highest layer idx for an additional layer set")
-#endif
+
   ("DefaultTargetOutputLayerIdc",                   m_defaultTargetOutputLayerIdc,                           1, "Default target output layers. 0: All layers are output layer, 1: Only highest layer is output layer, 2 or 3: No default output layers")
   ("NumOutputLayerSets",                            m_numOutputLayerSets,                                    1, "Number of output layer sets excluding the 0-th output layer set")
@@ -2429,5 +2430,4 @@
   } //for(Int layer = 0; layer < MAX_LAYERS; layer++)
 
-#if Q0078_ADD_LAYER_SETS
   for (Int layerSet = 1; layerSet < m_numLayerSets; layerSet++)
   {
@@ -2435,4 +2435,5 @@
     assert( scanStringToArray( cfg_layerSetLayerIdList[layerSet], m_numLayerInIdList[layerSet], "NumLayerInIdList", m_layerSetLayerIdList[layerSet] ) );
   }
+
   for (Int addLayerSet = 0; addLayerSet < m_numAddLayerSets; addLayerSet++)
   {
@@ -2440,5 +2441,4 @@
     assert( scanStringToArray( cfg_highestLayerIdx[addLayerSet], m_numHighestLayerIdx[addLayerSet], "HighestLayerIdx", m_highestLayerIdx[addLayerSet] ) );
   }
-#endif
 
   if( m_defaultTargetOutputLayerIdc != -1 )
@@ -2446,4 +2446,5 @@
     assert( m_defaultTargetOutputLayerIdc >= 0 && m_defaultTargetOutputLayerIdc <= 3 );
   }
+
   assert( m_numOutputLayerSets != 0 );
   assert( m_numOutputLayerSets >= m_numLayerSets + m_numAddLayerSets ); // Number of output layer sets must be at least as many as layer sets.
Index: branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.h
===================================================================
--- branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.h	(revision 1171)
+++ branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.h	(revision 1172)
@@ -73,12 +73,12 @@
 #endif
   Bool      m_maxTidRefPresentFlag; 
-#if Q0078_ADD_LAYER_SETS
+
   Int       m_numLayerSets;
+  Int       m_numAddLayerSets;
   Int       m_numLayerInIdList[MAX_VPS_LAYER_SETS_PLUS1];
   Int       m_layerSetLayerIdList[MAX_VPS_LAYER_SETS_PLUS1][MAX_VPS_LAYER_IDX_PLUS1];
-  Int       m_numAddLayerSets;
   Int       m_numHighestLayerIdx[MAX_VPS_LAYER_SETS_PLUS1];
   Int       m_highestLayerIdx[MAX_VPS_LAYER_SETS_PLUS1][MAX_VPS_LAYER_IDX_PLUS1];
-#endif
+
   Int       m_defaultTargetOutputLayerIdc;
   Int       m_numOutputLayerSets;
Index: branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp
===================================================================
--- branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp	(revision 1171)
+++ branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp	(revision 1172)
@@ -804,7 +804,5 @@
 #endif
 #endif
-#if Q0078_ADD_LAYER_SETS
     m_acTEncTop[layer].setNumAddLayerSets                        ( m_numAddLayerSets );
-#endif
   }
 }
@@ -1256,6 +1254,5 @@
   vps->setVpsExtensionFlag( m_numLayers > 1 ? true : false );
 
-#if Q0078_ADD_LAYER_SETS
-  if (m_numLayerSets > 1)
+  if( m_numLayerSets > 1 )
   {
     vps->setNumLayerSets(m_numLayerSets);
@@ -1290,5 +1287,4 @@
   {
     // Default layer sets
-#endif
     vps->setNumLayerSets(m_numLayers);
     for (Int setId = 1; setId < vps->getNumLayerSets(); setId++)
@@ -1315,12 +1311,11 @@
       }
     }
-#if Q0078_ADD_LAYER_SETS
-  }
-#endif
-#if Q0078_ADD_LAYER_SETS
+  }
+
   vps->setVpsNumLayerSetsMinus1(vps->getNumLayerSets() - 1);
   vps->setNumAddLayerSets(m_numAddLayerSets);
   vps->setNumLayerSets(vps->getNumLayerSets() + vps->getNumAddLayerSets());
-  if (m_numAddLayerSets > 0)
+
+  if( m_numAddLayerSets > 0 )
   {
     for (Int setId = 0; setId < m_numAddLayerSets; setId++)
@@ -1332,5 +1327,4 @@
     }
   }
-#endif
 
 #if AVC_BASE
@@ -1494,9 +1488,7 @@
   // The Layer ID List variables should be derived here.
   vps->deriveLayerIdListVariables();
-#if Q0078_ADD_LAYER_SETS
   vps->setPredictedLayerIds();
   vps->setTreePartitionLayerIdList();
   vps->deriveLayerIdListVariablesForAddLayerSets();
-#endif
 
   vps->setDefaultTargetOutputLayerIdc( m_defaultTargetOutputLayerIdc ); // As per configuration file
@@ -1538,19 +1530,14 @@
     for( UInt layer = 0; layer < vps->getNumLayersInIdList(lsIdx); layer++ )
     {
-#if !Q0078_ADD_LAYER_SETS  // the following condition is incorrect and is not needed anyway
-      if( vps->getLayerIdIncludedFlag(lsIdx, layer) )      
-#endif
-      {
-        switch(vps->getDefaultTargetOutputLayerIdc())
-        {
-        case 0: vps->setOutputLayerFlag( lsIdx, layer, 1 );
-          break;
-        case 1: vps->setOutputLayerFlag( lsIdx, layer, layer == vps->getNumLayersInIdList(lsIdx) - 1 );
-          break;
-        case 2:
-        case 3: vps->setOutputLayerFlag( lsIdx, layer, (layer != vps->getNumLayersInIdList(lsIdx) - 1) ? std::find( m_listOfOutputLayers[lsIdx].begin(), m_listOfOutputLayers[lsIdx].end(), m_layerSetLayerIdList[lsIdx][layer]) != m_listOfOutputLayers[lsIdx].end() 
-                  : m_listOfOutputLayers[lsIdx][m_listOfOutputLayers[lsIdx].size()-1] == m_layerSetLayerIdList[lsIdx][layer] );
-          break;
-        }
+      switch( vps->getDefaultTargetOutputLayerIdc() )
+      {
+      case 0: vps->setOutputLayerFlag( lsIdx, layer, 1 );
+        break;
+      case 1: vps->setOutputLayerFlag( lsIdx, layer, layer == vps->getNumLayersInIdList(lsIdx) - 1 );
+        break;
+      case 2:
+      case 3: vps->setOutputLayerFlag( lsIdx, layer, (layer != vps->getNumLayersInIdList(lsIdx) - 1) ? std::find( m_listOfOutputLayers[lsIdx].begin(), m_listOfOutputLayers[lsIdx].end(), m_layerSetLayerIdList[lsIdx][layer]) != m_listOfOutputLayers[lsIdx].end() 
+                : m_listOfOutputLayers[lsIdx][m_listOfOutputLayers[lsIdx].size()-1] == m_layerSetLayerIdList[lsIdx][layer] );
+        break;
       }
     }
@@ -1616,13 +1603,10 @@
     vps->setMaxOneActiveRefLayerFlag(maxDirectRefLayers > 1 ? false : true);
 #if O0062_POC_LSB_NOT_PRESENT_FLAG
-    for(i = 1; i< vps->getMaxLayers(); i++)
+    for( i = 1; i< vps->getMaxLayers(); i++ )
     {
       if( vps->getNumDirectRefLayers( vps->getLayerIdInNuh(i) ) == 0  )
       {
-#if Q0078_ADD_LAYER_SETS
-        vps->setPocLsbNotPresentFlag(i, true); // make independedent layers base-layer compliant
-#else
-        vps->setPocLsbNotPresentFlag(i, false);
-#endif
+        // make independedent layers base-layer compliant
+        vps->setPocLsbNotPresentFlag(i, true); 
       }
     }
@@ -1739,9 +1723,5 @@
   {
     vps->setVpsVuiBspHrdPresentFlag(true);
-#if Q0078_ADD_LAYER_SETS
     vps->setVpsNumBspHrdParametersMinus1(vps->getVpsNumLayerSetsMinus1() - 1); 
-#else
-    vps->setVpsNumBspHrdParametersMinus1(vps->getNumLayerSets() - 2); 
-#endif
     vps->createBspHrdParamBuffer(vps->getVpsNumBspHrdParametersMinus1() + 1);
     for ( i = 0; i <= vps->getVpsNumBspHrdParametersMinus1(); i++ )
@@ -1776,9 +1756,5 @@
       vps->setBspHrdParameters( i, pcCfgLayer->getFrameRate(), numDU, pcCfgLayer->getTargetBitrate(), ( pcCfgLayer->getIntraPeriod() > 0 ) );
     }
-#if Q0078_ADD_LAYER_SETS
     for (UInt h = 1; h <= vps->getVpsNumLayerSetsMinus1(); h++)
-#else
-    for(UInt h = 1; h <= (vps->getNumLayerSets()-1); h++)
-#endif
     {
       vps->setNumBitstreamPartitions(h, 1);
