Index: branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp
===================================================================
--- branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 1103)
+++ branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 1104)
@@ -3041,9 +3041,5 @@
   for(i = 1; i < numOutputLayerSets; i++)
   {
-#if VPS_FIX_TO_MATCH_SPEC
     if( vps->getNumLayerSets() > 2 && i >= vps->getNumLayerSets() )
-#else
-    if( i > (vps->getNumLayerSets() - 1) )
-#endif
     {
       Int numBits = 1;
@@ -3060,15 +3056,7 @@
     Int layerSetIdxForOutputLayerSet = vps->getOutputLayerSetIdx(i);
 #if Q0078_ADD_LAYER_SETS
-#if VPS_FIX_TO_MATCH_SPEC
     if( i > vps->getVpsNumLayerSetsMinus1() || vps->getDefaultTargetOutputLayerIdc() == 2 )
 #else
-    if( i > vps->getVpsNumLayerSetsMinus1() || vps->getDefaultTargetOutputLayerIdc() >= 2 )
-#endif
-#else
-#if VPS_FIX_TO_MATCH_SPEC
     if( i > (vps->getNumLayerSets() - 1) || vps->getDefaultTargetOutputLayerIdc() == 2 )
-#else
-    if( i > (vps->getNumLayerSets() - 1) || vps->getDefaultTargetOutputLayerIdc() >= 2 )
-#endif
 #endif
     {
@@ -3113,9 +3101,5 @@
     for(j = 0; j < vps->getNumLayersInIdList(layerSetIdxForOutputLayerSet) ; j++)
     {
-#if VPS_FIX_TO_MATCH_SPEC
       if( vps->getNecessaryLayerFlag(i, j) && (vps->getNumProfileTierLevel()-1) > 0 )
-#else
-      if( vps->getNecessaryLayerFlag(i, j) )
-#endif
       {
         READ_CODE( numBitsForPtlIdx, uiCode, "profile_tier_level_idx[i]" ); 
@@ -3317,9 +3301,5 @@
   if( vps->getRepFormatIdxPresentFlag() )
   {
-#if VPS_FIX_TO_MATCH_SPEC
     for( i = vps->getBaseLayerInternalFlag() ? 1 : 0; i < vps->getMaxLayers(); i++ )
-#else
-    for (i = 1; i < vps->getMaxLayers(); i++)
-#endif
     {
       Int numBits = 1;
@@ -3452,15 +3432,7 @@
 #endif
 
-#if VPS_FIX_TO_MATCH_SPEC
   for( i = vps->getBaseLayerInternalFlag() ? 1 : 2; i < vps->getMaxLayers(); i++ )
-#else
-  for(i = 1; i < vps->getMaxLayers(); i++)
-#endif
-  {
-#if VPS_FIX_TO_MATCH_SPEC
+  {
     for( j = vps->getBaseLayerInternalFlag() ? 0 : 1; j < i; j++ )
-#else
-    for(j = 0; j < i; j++)
-#endif
     {
       if (vps->getDirectDependencyFlag(i, j))
@@ -3820,9 +3792,5 @@
             uiCode=0;
 
-#if VPS_FIX_TO_MATCH_SPEC
         if( vps->getNecessaryLayerFlag(i, k) && ( vps->getBaseLayerInternalFlag() || vps->getLayerSetLayerIdList(layerSetIdxForOutputLayerSet, k) ) )
-#else
-        if(vps->getBaseLayerInternalFlag() || ( vps->getLayerSetLayerIdList(layerSetIdxForOutputLayerSet, k) !=  0 ) )
-#endif
 #endif
           READ_UVLC( uiCode, "max_vps_dec_pic_buffering_minus1[i][k][j]" ); vps->setMaxVpsDecPicBufferingMinus1( i, k, j, uiCode );
@@ -4070,9 +4038,5 @@
   if (!uiCode)
   {
-#if VPS_FIX_TO_MATCH_SPEC
     for( i = vps->getBaseLayerInternalFlag() ? 0 : 1; i < vps->getMaxLayers(); i++ )
-#else
-    for (i = 0; i < vps->getMaxLayers(); i++)
-#endif
     {
       READ_FLAG( uiCode, "tiles_in_use_flag[ i ]" ); vps->setTilesInUseFlag(i, (uiCode == 1));
@@ -4088,9 +4052,5 @@
 #endif
 
-#if VPS_FIX_TO_MATCH_SPEC
       for( i = vps->getBaseLayerInternalFlag() ? 1 : 2; i < vps->getMaxLayers(); i++ )
-#else
-      for (i = 1; i < vps->getMaxLayers(); i++)
-#endif
     {
       for(j = 0; j < vps->getNumDirectRefLayers(vps->getLayerIdInNuh(i)); j++)
@@ -4113,9 +4073,5 @@
   if (!uiCode)
   {
-#if VPS_FIX_TO_MATCH_SPEC
       for (i = vps->getBaseLayerInternalFlag() ? 0 : 1; i < vps->getMaxLayers(); i++)
-#else
-      for (i = 0; i < vps->getMaxLayers(); i++)
-#endif
     {
       READ_FLAG( uiCode, "wpp_in_use_flag[ i ]" ); vps->setWppInUseFlag(i, (uiCode == 1));
@@ -4146,8 +4102,6 @@
       for(j = 0; j < vps->getNumDirectRefLayers(vps->getLayerIdInNuh(i)); j++)
       {
-#if VPS_FIX_TO_MATCH_SPEC
         if( vps->getBaseLayerInternalFlag() || vps->getRefLayerId(vps->getLayerIdInNuh(i), j) )
         {
-#endif
           READ_UVLC( uiCode, "min_spatial_segment_offset_plus1[i][j]" ); vps->setMinSpatialSegmentOffsetPlus1( i, j, uiCode );
           if( vps->getMinSpatialSegmentOffsetPlus1(i,j ) > 0 )
@@ -4159,7 +4113,5 @@
             }
           }
-#if VPS_FIX_TO_MATCH_SPEC
-        }
-#endif
+        }
       }
     }
@@ -4575,17 +4527,11 @@
     }
   }
-#if VPS_FIX_TO_MATCH_SPEC
   if( vps->getNumHrdParameters() + vps->getVpsNumAddHrdParams() > 0 )
   {
-#endif
     for (Int h = 1; h < vps->getNumOutputLayerSets(); h++)
     {
       Int lsIdx = vps->getOutputLayerSetIdx(h);
       READ_UVLC(uiCode, "num_signalled_partitioning_schemes[h]"); vps->setNumSignalledPartitioningSchemes(h, uiCode);
-#if VPS_FIX_TO_MATCH_SPEC
       for (Int j = 1; j < vps->getNumSignalledPartitioningSchemes(h) + 1; j++)
-#else
-      for (Int j = 0; j < vps->getNumSignalledPartitioningSchemes(h); j++)
-#endif
       {
         READ_UVLC(uiCode, "num_partitions_in_scheme_minus1[h][j]"); vps->setNumPartitionsInSchemeMinus1(h, j, uiCode);
@@ -4605,11 +4551,6 @@
           for (Int j = 0; j <= vps->getNumBspSchedulesMinus1(h, i, t); j++)
           {
-#if VPS_FIX_TO_MATCH_SPEC
             for( Int k = 0; k <= vps->getNumPartitionsInSchemeMinus1(h, i); k++ )
-#else
-            for (Int k = 0; k < vps->getNumPartitionsInSchemeMinus1(h, i); k++)
-#endif
             {
-#if VPS_FIX_TO_MATCH_SPEC
               if( vps->getNumHrdParameters() + vps->getVpsNumAddHrdParams() > 1 )
               {
@@ -4621,7 +4562,4 @@
                 READ_CODE(numBits, uiCode, "bsp_comb_hrd_idx[h][i][t][j][k]");      vps->setBspHrdIdx(h, i, t, j, k, uiCode);
               }
-#else
-              READ_UVLC(uiCode, "bsp_comb_hrd_idx[h][i][t][j][k]");      vps->setBspHrdIdx(h, i, t, j, k, uiCode);
-#endif
               READ_UVLC(uiCode, "bsp_comb_sched_idx[h][i][t][j][k]");    vps->setBspSchedIdx(h, i, t, j, k, uiCode);
             }
@@ -4634,7 +4572,5 @@
 
     }
-#if VPS_FIX_TO_MATCH_SPEC
-  }
-#endif
+  }
 }
 #endif
