Index: branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp
===================================================================
--- branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 1198)
+++ branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 1199)
@@ -1969,24 +1969,12 @@
 
     // Derive the value of PocMsbValRequiredFlag
-#if P0297_VPS_POC_LSB_ALIGNED_FLAG
     pcSlice->setPocMsbValRequiredFlag( (pcSlice->getCraPicFlag() || pcSlice->getBlaPicFlag())
       && (!pcSlice->getVPS()->getVpsPocLsbAlignedFlag() ||
       (pcSlice->getVPS()->getVpsPocLsbAlignedFlag() && pcSlice->getVPS()->getNumDirectRefLayers(pcSlice->getLayerId()) == 0))
       );
-#else
-    pcSlice->setPocMsbValRequiredFlag( pcSlice->getCraPicFlag() || pcSlice->getBlaPicFlag() );
-#endif
-
-#if P0297_VPS_POC_LSB_ALIGNED_FLAG
-    if (!pcSlice->getPocMsbValRequiredFlag() && pcSlice->getVPS()->getVpsPocLsbAlignedFlag())
-#else
-    if (!pcSlice->getPocMsbValRequiredFlag() /* vps_poc_lsb_aligned_flag */)
-#endif
-    {
-#if P0297_VPS_POC_LSB_ALIGNED_FLAG
+
+    if( !pcSlice->getPocMsbValRequiredFlag() && pcSlice->getVPS()->getVpsPocLsbAlignedFlag() )
+    {
       READ_FLAG(uiCode, "poc_msb_cycle_val_present_flag"); pcSlice->setPocMsbValPresentFlag(uiCode ? true : false);
-#else
-      READ_FLAG(uiCode, "poc_msb_val_present_flag"); pcSlice->setPocMsbValPresentFlag(uiCode ? true : false);
-#endif
     }
     else
@@ -2007,9 +1995,5 @@
     if( pcSlice->getPocMsbValPresentFlag() )
     {
-#if P0297_VPS_POC_LSB_ALIGNED_FLAG
       READ_UVLC( uiCode,    "poc_msb_cycle_val");             pcSlice->setPocMsbVal( uiCode );
-#else
-      READ_UVLC( uiCode,    "poc_msb_val");             pcSlice->setPocMsbVal( uiCode );
-#endif
 
 #if !POC_RESET_IDC_DECODER
@@ -3026,10 +3010,9 @@
   READ_FLAG(uiCode, "max_one_active_ref_layer_flag" );
   vps->setMaxOneActiveRefLayerFlag(uiCode);
-#if P0297_VPS_POC_LSB_ALIGNED_FLAG
+
   READ_FLAG(uiCode, "vps_poc_lsb_aligned_flag");
   vps->setVpsPocLsbAlignedFlag(uiCode);
-#endif
-
-  for(i = 1; i< vps->getMaxLayers(); i++)
+
+  for( i = 1; i< vps->getMaxLayers(); i++ )
   {
     if( vps->getNumDirectRefLayers( vps->getLayerIdInNuh(i) ) == 0  )
@@ -3177,7 +3160,5 @@
   }
 
-#if P0297_VPS_POC_LSB_ALIGNED_FLAG
   vps->setVpsPocLsbAlignedFlag(false);
-#endif
 
   // When not present, poc_lsb_not_present_flag[ i ] is inferred to be equal to 0.
Index: branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp
===================================================================
--- branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp	(revision 1198)
+++ branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp	(revision 1199)
@@ -124,8 +124,6 @@
   resetPocRestrictionCheckParameters();
 #endif
-#if P0297_VPS_POC_LSB_ALIGNED_FLAG
   m_pocResettingFlag        = false;
   m_pocDecrementedInDPBFlag = false;
-#endif
 #if CONFORMANCE_BITSTREAM_MODE
   m_confModeFlag = false;
@@ -909,19 +907,16 @@
 #endif
       markAllPicsAsNoCurrAu(m_apcSlicePilot->getVPS());
-#if P0297_VPS_POC_LSB_ALIGNED_FLAG
-      for (UInt i = 0; i < MAX_LAYERS; i++)
+
+      for( UInt i = 0; i < MAX_LAYERS; i++ )
       {
         m_ppcTDecTop[m_apcSlicePilot->getVPS()->getLayerIdInNuh(i)]->m_pocDecrementedInDPBFlag = false;
       }
-#endif
-    }
-
-
-#if P0297_VPS_POC_LSB_ALIGNED_FLAG
+    }
+
     m_pocResettingFlag = false;
 
-    if (m_apcSlicePilot->getPocResetIdc() != 0)
-    {
-      if (m_apcSlicePilot->getVPS()->getVpsPocLsbAlignedFlag())
+    if( m_apcSlicePilot->getPocResetIdc() != 0 )
+    {
+      if( m_apcSlicePilot->getVPS()->getVpsPocLsbAlignedFlag() )
       {
         m_pocResettingFlag = true;
@@ -936,5 +931,4 @@
       }
     }
-#endif
 
     if( m_apcSlicePilot->getPocResetIdc() && m_apcSlicePilot->getSliceIdx() == 0 )
@@ -984,6 +978,4 @@
 #if ALIGNED_BUMPING
 #if POC_RESET_IDC_DECODER
-
-#if P0297_VPS_POC_LSB_ALIGNED_FLAG
   UInt affectedLayerList[MAX_LAYERS];
   Int  numAffectedLayers;
@@ -992,7 +984,7 @@
   numAffectedLayers = 1;
 
-  if (m_apcSlicePilot->getVPS()->getVpsPocLsbAlignedFlag())
-  {
-    for (UInt j = 0; j < m_apcSlicePilot->getVPS()->getNumPredictedLayers(m_apcSlicePilot->getLayerId()); j++)
+  if( m_apcSlicePilot->getVPS()->getVpsPocLsbAlignedFlag() )
+  {
+    for( UInt j = 0; j < m_apcSlicePilot->getVPS()->getNumPredictedLayers(m_apcSlicePilot->getLayerId()); j++ )
     {
       affectedLayerList[j + 1] = m_apcSlicePilot->getVPS()->getPredictedLayerId(m_apcSlicePilot->getLayerId(), j);
@@ -1000,12 +992,6 @@
     numAffectedLayers = m_apcSlicePilot->getVPS()->getNumPredictedLayers(m_apcSlicePilot->getLayerId()) + 1;
   }
-#endif
-
-  //if(  (bNewPOC || m_layerId != m_uiPrevLayerId) && ( m_parseIdc != 1) )
-#if P0297_VPS_POC_LSB_ALIGNED_FLAG
-  if (m_parseIdc == 1 && m_pocResettingFlag)
-#else
-  if (m_parseIdc == 1)
-#endif
+
+  if( m_parseIdc == 1 && m_pocResettingFlag )
   {
     // Invoke output of pictures if the current picture is a POC reset picture
@@ -1013,11 +999,11 @@
     /* Include reset of all POCs in the layer */
 
-  // This operation would do the following:
-  // 1. Update the other picture in the DPB. This should be done only for the first slice of the picture.
-  // 2. Update the value of m_pocCRA.
-  // 3. Reset the POC values at the decoder for the current picture to be zero - will be done later
-  // 4. update value of POCLastDisplay
-      
-  //Do the reset stuff here
+    // This operation would do the following:
+    // 1. Update the other picture in the DPB. This should be done only for the first slice of the picture.
+    // 2. Update the value of m_pocCRA.
+    // 3. Reset the POC values at the decoder for the current picture to be zero - will be done later
+    // 4. update value of POCLastDisplay
+
+    //Do the reset stuff here
     Int maxPocLsb = 1 << m_apcSlicePilot->getSPS()->getBitsForPOC();
     Int pocLsbVal;
@@ -1032,5 +1018,5 @@
 
     Int pocMsbDelta = 0;
-    if ( m_apcSlicePilot->getPocMsbValPresentFlag() ) 
+    if( m_apcSlicePilot->getPocMsbValPresentFlag() ) 
     {
       pocMsbDelta = m_apcSlicePilot->getPocMsbVal() * maxPocLsb;
@@ -1058,6 +1044,5 @@
     Int deltaPocVal  =  pocMsbDelta + pocLsbDelta;
 
-#if P0297_VPS_POC_LSB_ALIGNED_FLAG
-    for (UInt layerIdx = 0; layerIdx < numAffectedLayers; layerIdx++)
+    for( UInt layerIdx = 0; layerIdx < numAffectedLayers; layerIdx++ )
     {
       if (!m_ppcTDecTop[affectedLayerList[layerIdx]]->m_pocDecrementedInDPBFlag)
@@ -1065,59 +1050,43 @@
         m_ppcTDecTop[affectedLayerList[layerIdx]]->m_pocDecrementedInDPBFlag = true;
         TComList<TComPic*>::iterator  iterPic = m_ppcTDecTop[affectedLayerList[layerIdx]]->getListPic()->begin();
+
         while (iterPic != m_ppcTDecTop[affectedLayerList[layerIdx]]->getListPic()->end())
-#else
-    //Reset all POC for DPB -> basically do it for each slice in the picutre
-    TComList<TComPic*>::iterator  iterPic = m_cListPic.begin();  
-
-    // Iterate through all picture in DPB
-    while( iterPic != m_cListPic.end() )
-#endif
-    {
-      TComPic *dpbPic = *iterPic;
-      // Check if the picture pointed to by iterPic is either used for reference or
-      // needed for output, are in the same layer, and not the current picture.
-#if P0297_VPS_POC_LSB_ALIGNED_FLAG
-      assert(dpbPic->getLayerId() == affectedLayerList[layerIdx]);
-      if ( (dpbPic->getReconMark()) && (dpbPic->getPicSym()->getSlice(0)->getPicOutputFlag()) )
-#else
-      if ( /*  ( ( dpbPic->getSlice(0)->isReferenced() ) || ( dpbPic->getOutputMark() ) )
-          &&*/ ( dpbPic->getLayerId() == m_apcSlicePilot->getLayerId() )
-            && ( dpbPic->getReconMark() ) && ( dpbPic->getPicSym()->getSlice(0)->getPicOutputFlag() ))
-#endif
-      {
-        for(Int i = dpbPic->getNumAllocatedSlice()-1; i >= 0; i--)
-        {
-
-          TComSlice *slice = dpbPic->getSlice(i);
-          TComReferencePictureSet *rps = slice->getRPS();
-          slice->setPOC( slice->getPOC() - deltaPocVal );
-
-          // Also adjust the POC value stored in the RPS of each such slice
-          for(Int j = rps->getNumberOfPictures(); j >= 0; j--)
+        {
+          TComPic *dpbPic = *iterPic;
+          // Check if the picture pointed to by iterPic is either used for reference or
+          // needed for output, are in the same layer, and not the current picture.
+          assert(dpbPic->getLayerId() == affectedLayerList[layerIdx]);
+
+          if( (dpbPic->getReconMark()) && (dpbPic->getPicSym()->getSlice(0)->getPicOutputFlag()) )
           {
-            rps->setPOC( j, rps->getPOC(j) - deltaPocVal );
-          }
-          // Also adjust the value of refPOC
-          for(Int k = 0; k < 2; k++)  // For List 0 and List 1
-          {
-            RefPicList list = (k == 1) ? REF_PIC_LIST_1 : REF_PIC_LIST_0;
-            for(Int j = 0; j < slice->getNumRefIdx(list); j++)
+            for(Int i = dpbPic->getNumAllocatedSlice()-1; i >= 0; i--)
             {
-              slice->setRefPOC( slice->getRefPOC(list, j) - deltaPocVal, list, j);
+
+              TComSlice *slice = dpbPic->getSlice(i);
+              TComReferencePictureSet *rps = slice->getRPS();
+              slice->setPOC( slice->getPOC() - deltaPocVal );
+
+              // Also adjust the POC value stored in the RPS of each such slice
+              for(Int j = rps->getNumberOfPictures(); j >= 0; j--)
+              {
+                rps->setPOC( j, rps->getPOC(j) - deltaPocVal );
+              }
+              // Also adjust the value of refPOC
+              for(Int k = 0; k < 2; k++)  // For List 0 and List 1
+              {
+                RefPicList list = (k == 1) ? REF_PIC_LIST_1 : REF_PIC_LIST_0;
+                for(Int j = 0; j < slice->getNumRefIdx(list); j++)
+                {
+                  slice->setRefPOC( slice->getRefPOC(list, j) - deltaPocVal, list, j);
+                }
+              }
             }
           }
-        }
-      }
-      iterPic++;
-    }
-#if P0297_VPS_POC_LSB_ALIGNED_FLAG
+          iterPic++;
+        }
         // Update the value of pocCRA
         m_ppcTDecTop[affectedLayerList[layerIdx]]->m_pocCRA -= deltaPocVal;
       }
     }
-#else
-    // Update the value of pocCRA
-    m_pocCRA -= deltaPocVal;
-#endif
 
     // Update value of POCLastDisplay
@@ -1127,9 +1096,5 @@
   Int slicePicOrderCntLsb = m_apcSlicePilot->getPicOrderCntLsb();
 
-#if P0297_VPS_POC_LSB_ALIGNED_FLAG
-  if (m_pocResettingFlag && (m_parseIdc == 1 || m_parseIdc == 2))
-#else
-  if (m_parseIdc == 1 || m_parseIdc == 2) // TODO This should be replaced by pocResettingFlag.
-#endif
+  if( m_pocResettingFlag && (m_parseIdc == 1 || m_parseIdc == 2) )
   {
     // Set poc for current slice
@@ -1172,33 +1137,23 @@
     // Adjust prevPicOrderCnt
     if(    !m_apcSlicePilot->getRaslPicFlag() 
-        && !m_apcSlicePilot->getRadlPicFlag()
-        && (m_apcSlicePilot->getNalUnitType() % 2 == 1)
-        && ( nalu.m_temporalId == 0 )
-        && !m_apcSlicePilot->getDiscardableFlag() )
-    {
-#if P0297_VPS_POC_LSB_ALIGNED_FLAG
-      for (UInt i = 0; i < numAffectedLayers; i++)
+      && !m_apcSlicePilot->getRadlPicFlag()
+      && (m_apcSlicePilot->getNalUnitType() % 2 == 1)
+      && ( nalu.m_temporalId == 0 )
+      && !m_apcSlicePilot->getDiscardableFlag() )
+    {
+      for( UInt i = 0; i < numAffectedLayers; i++ )
       {
         m_ppcTDecTop[affectedLayerList[i]]->setPrevPicOrderCnt(m_apcSlicePilot->getPOC());
       }
-#else
-      this->setPrevPicOrderCnt( m_apcSlicePilot->getPOC() );
-#endif
-    }
-    else if ( m_apcSlicePilot->getPocResetIdc() == 3 )
-    {
-#if P0297_VPS_POC_LSB_ALIGNED_FLAG
-      if (!m_firstPicInLayerDecodedFlag || (m_firstPicInLayerDecodedFlag && m_pocResettingFlag))
-      {
-        for (UInt i = 0; i < numAffectedLayers; i++)
-        {
-          m_ppcTDecTop[affectedLayerList[i]]->setPrevPicOrderCnt( m_apcSlicePilot->getFullPocResetFlag() 
-                                                                  ? 0 : m_apcSlicePilot->getPocLsbVal() );
-        }
-      }
-#else
-      this->setPrevPicOrderCnt( m_apcSlicePilot->getFullPocResetFlag() 
-                                            ? 0 : m_apcSlicePilot->getPocLsbVal() );
-#endif
+    }
+    else if( m_apcSlicePilot->getPocResetIdc() == 3 )
+    {
+      if( !m_firstPicInLayerDecodedFlag || (m_firstPicInLayerDecodedFlag && m_pocResettingFlag) )
+      {
+        for( UInt i = 0; i < numAffectedLayers; i++ )
+        {
+          m_ppcTDecTop[affectedLayerList[i]]->setPrevPicOrderCnt( m_apcSlicePilot->getFullPocResetFlag() ? 0 : m_apcSlicePilot->getPocLsbVal() );
+        }
+      }
     }
 #else
@@ -1947,8 +1902,6 @@
   m_cGopDecoder.decompressSlice(nalu.m_Bitstream, m_pcPic);
 
-#if P0297_VPS_POC_LSB_ALIGNED_FLAG
+#if SVC_EXTENSION
   setFirstPicInLayerDecodedFlag(true);
-#endif
-#if SVC_EXTENSION
   m_lastPicHasEos = false;
 #endif
Index: branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.h
===================================================================
--- branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.h	(revision 1198)
+++ branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.h	(revision 1199)
@@ -132,8 +132,6 @@
   TDecTop**               m_ppcTDecTop;
   UInt                    m_smallestLayerId;
-#if P0297_VPS_POC_LSB_ALIGNED_FLAG
   Bool                    m_pocResettingFlag;
   Bool                    m_pocDecrementedInDPBFlag;
-#endif
 #if AVC_BASE
   fstream*                m_pBLReconFile;
