Index: /branches/HTM-11.1-dev0/source/App/TAppEncoder/TAppEncTop.cpp
===================================================================
--- /branches/HTM-11.1-dev0/source/App/TAppEncoder/TAppEncTop.cpp	(revision 970)
+++ /branches/HTM-11.1-dev0/source/App/TAppEncoder/TAppEncTop.cpp	(revision 971)
@@ -58,8 +58,7 @@
 {
 
-#if H_MV_HLS_8
+#if H_MV
   m_vps = new TComVPS; 
-#endif
-#if !H_MV
+#else !H_MV
   m_iFrameRcvd = 0;
 #endif
@@ -70,5 +69,5 @@
 TAppEncTop::~TAppEncTop()
 {
-#if H_MV_HLS_8
+#if H_MV
   if (m_vps)
   {
@@ -82,9 +81,5 @@
 {
 #if H_MV
-#if H_MV_HLS_8
   TComVPS& vps = (*m_vps);   
-#else
-  TComVPS& vps = m_vps;   
-#endif
 #else
   TComVPS vps;
@@ -701,15 +696,8 @@
 {
 #if H_3D
-#if H_MV_HLS_8
   for ( Int viewIndex = 0; viewIndex < m_vps->getNumViews(); viewIndex++ )
   {
     m_vps->initCamParaVPS( viewIndex, true, m_cCameraData.getCamParsCodedPrecision(), 
       m_cCameraData.getVaryingCameraParameters(), m_cCameraData.getCodedScale(), m_cCameraData.getCodedOffset() );
-#else
-  for ( Int viewIndex = 0; viewIndex < m_vps.getNumViews(); viewIndex++ )
-  {
-  m_vps.initCamParaVPS( viewIndex, true, m_cCameraData.getCamParsCodedPrecision(), 
-      m_cCameraData.getVaryingCameraParameters(), m_cCameraData.getCodedScale(), m_cCameraData.getCodedOffset() );
-#endif
   }
 #endif
@@ -1507,9 +1495,5 @@
 Void TAppEncTop::xSetRepFormat( TComVPS& vps )
 {
-#if H_MV_HLS_8_PMS_Q0195_20
   vps.setRepFormatIdxPresentFlag( false ); 
-#else
-  vps.setRepFormatIdxPresentFlag( true ); 
-#endif
   vps.setVpsNumRepFormatsMinus1 ( 0    ); 
 
@@ -1527,11 +1511,4 @@
   assert( vps.getRepFormat( 0 ) == NULL ); 
   vps.setRepFormat( 0 , repFormat );
-
-#if !H_MV_HLS_8_PMS_Q0195_20
-  for(Int i = 0; i <= vps.getMaxLayersMinus1(); i++ )
-  {
-    vps.setVpsRepFormatIdx( i , 0 ); 
-  }
-#endif
 }
 
@@ -1544,35 +1521,17 @@
   assert ( dpbSize != 0 ); 
 
-#if H_MV_HLS_8_HRD_Q0102_08
   for( Int i = 0; i < vps.getNumOutputLayerSets(); i++ )
-#else
-  for( Int i = 1; i < vps.getNumOutputLayerSets(); i++ )
-#endif
   {  
-#if H_MV_HLS_8_MIS_Q0102_30
     Int currLsIdx = vps.olsIdxToLsIdx( i ); 
-#endif
     std::vector<Int> targetDecLayerIdList = vps.getTargetDecLayerIdList( i ); 
     Bool subLayerFlagInfoPresentFlag = false; 
 
-#if H_MV_HLS_8_MIS_Q0102_30
     for( Int j = 0; j  <=  vps.getMaxSubLayersInLayerSetMinus1( currLsIdx ); j++ )
-#else
-    for( Int j = 0; j  <=  vps.getMaxSubLayersInLayerSetMinus1( i ); j++ )
-#endif
     {   
       Bool subLayerDpbInfoPresentFlag = false; 
-#if H_MV_HLS_8_MIS_Q0102_30 || H_MV_HLS_8_DBP_NODOC_42
       assert( vps.getNumLayersInIdList( currLsIdx ) == targetDecLayerIdList.size() ); 
       for( Int k = 0; k < vps.getNumLayersInIdList( currLsIdx ); k++ )   
-#else
-      assert( vps.getNumSubDpbs( vps.olsIdxToLsIdx( i ) ) == targetDecLayerIdList.size() ); 
-      for( Int k = 0; k < vps.getNumSubDpbs( vps.olsIdxToLsIdx( i )); k++ )   
-#endif
       {
         Int layerIdInVps = vps.getLayerIdInVps( targetDecLayerIdList[k] );           
-#if H_MV_HLS7_GEN
-        // TBD. Some derivation based on output layer set might be added here. 
-#endif
         dpbSize->setMaxVpsDecPicBufferingMinus1( i, k, j, m_maxDecPicBufferingMvc[ layerIdInVps ][ j ] - 1 );
         if ( j > 0 )
@@ -1635,10 +1594,6 @@
   // Additional output layer sets + profileLevelTierIdx
   vps.setDefaultOutputLayerIdc      ( m_defaultOutputLayerIdc );   
-#if H_MV_HLS_8_SYN_39_19
   vps.setNumAddLayerSets            ( 0                             );  
   vps.setNumAddOlss                 ( numAddOuputLayerSets          ); 
-#else
-  vps.setNumAddLayerSets            ( numAddOuputLayerSets          ); 
-#endif
   vps.initTargetLayerIdLists(); 
 
Index: /branches/HTM-11.1-dev0/source/Lib/TLibCommon/TComSlice.cpp
===================================================================
--- /branches/HTM-11.1-dev0/source/Lib/TLibCommon/TComSlice.cpp	(revision 970)
+++ /branches/HTM-11.1-dev0/source/Lib/TLibCommon/TComSlice.cpp	(revision 971)
@@ -48,5 +48,5 @@
 TComSlice::TComSlice()
 : m_iPPSId                        ( -1 )
-#if H_MV_HLS_8_POC_Q0142_32
+#if H_MV
 , m_slicePicOrderCntLsb           ( 0 )
 #endif
@@ -1863,5 +1863,5 @@
 #endif
 {
-#if H_MV_HLS_8_SYN_Q0041_03
+#if H_MV
   m_vpsBaseLayerInternalFlag = true; 
 #endif
@@ -1883,10 +1883,6 @@
   m_vpsNumProfileTierLevelMinus1 = -1; 
     
-#if H_MV_HLS_8_SYN_39_19
   m_numAddLayerSets              = 0;   
   m_numAddOlss                   = 0; 
-#else
-  m_numAddLayerSets              = -1;   
-#endif
   m_defaultOutputLayerIdc     = 0; 
   
@@ -1902,15 +1898,10 @@
   }
 
-#if H_MV_HLS_8_PMS_Q0195_20
   m_repFormatIdxPresentFlag = false; 
-#endif
   m_maxOneActiveRefLayerFlag = false; 
   m_directDepTypeLenMinus2   = 0;         
   
 
-#if H_MV_HLS_8_RPS_Q0100_36
   m_vpsExtensionFlag = true; 
-#endif
-  m_avcBaseLayerFlag = false;
   m_vpsNonVuiExtensionLength = 0;
   m_splittingFlag    = false;
@@ -2032,10 +2023,7 @@
   }
 
-
-#if H_MV_HLS_8_PMS_Q0195_20
   //The value of vps_num_rep_formats_minus1 shall be in the range of 0 to 255, inclusive.
   assert( getVpsNumRepFormatsMinus1() >= 0 ); 
   assert( getVpsNumRepFormatsMinus1() <= 255 ); 
-#endif
 
   return true; 
@@ -2083,5 +2071,4 @@
   }
 
-#if H_MV_HLS_8
   for (Int i = 0 ; i < MAX_NUM_LAYER_IDS; i++ )
   {
@@ -2096,5 +2083,4 @@
     }
   }
-
 
   for( Int i = 0; i  <=  getMaxLayersMinus1(); i++ )
@@ -2107,5 +2093,4 @@
     }
   }
-
 
   for( Int i = 0; i <= getMaxLayersMinus1(); i++ )  // Bug in spec "<" instead of "<=" 
@@ -2149,5 +2134,4 @@
     m_numIndependentLayers = k;
   }
-#endif
 }
 
@@ -2314,9 +2298,5 @@
 Int    TComVPS::getNumOutputLayerSets() 
 {
-#if H_MV_HLS_8_SYN_39_19
   return getNumAddOlss() + getNumLayerSets(); 
-#else
-  return getNumAddLayerSets() + getVpsNumLayerSetsMinus1() + 1; 
-#endif
 }
 
@@ -2384,7 +2364,5 @@
     }
   }  
-#if H_MV_HLS_8_PMS_Q0165_18
   assert( getNumOutputLayersInOutputLayerSet( i ) > 0 ); 
-#endif
 }
 
@@ -2420,20 +2398,12 @@
 {
   Int maxSLMinus1 = 0; 
-#if H_MV_HLS_8_MIS_Q0102_30
   for( Int k = 0; k < getNumLayersInIdList( i ); k++ )
   {
     Int lId = m_layerSetLayerIdList[i][k];
-#else  
-  Int optLsIdx    = olsIdxToLsIdx( i );
-
-  for( Int k = 0; k < getNumLayersInIdList( optLsIdx ); k++ )
-  {
-    Int lId = m_layerSetLayerIdList[optLsIdx][k];
-#endif
     maxSLMinus1 = std::max( maxSLMinus1, getSubLayersVpsMaxMinus1( getLayerIdInVps( lId ) ));
   }
   return maxSLMinus1;
 }
-#if H_MV_HLS_8_RPS_Q0100_36
+
 Void TComVPS::inferDbpSizeLayerSetZero( TComSPS* sps, Bool encoder )
 {
@@ -2458,5 +2428,50 @@
   }
 }
-#endif
+
+Bool TComVPS::getAltOutputLayerFlagVar( Int i )
+{
+  // Semantics variable not syntax element !
+
+  Bool altOptLayerFlag = false;     
+  if ( i > 0 && getNumOutputLayersInOutputLayerSet( i ) == 1 && 
+    getNumDirectRefLayers( getOlsHighestOutputLayerId( i ) ) > 0 )
+  {
+    altOptLayerFlag = getAltOutputLayerFlag( i ); 
+  }
+  return altOptLayerFlag;
+}
+
+Int TComVPS::getMaxNumPics( Int layerId )
+{
+  Int maxNumPics = MAX_INT; 
+  for( Int olsIdx = 0; olsIdx < getNumOutputLayerSets(); olsIdx++)
+  {
+    Int lsIdx = olsIdxToLsIdx( olsIdx ); 
+    for( Int j = 0; j < getNumLayersInIdList( lsIdx ); j++ )
+    {
+      if( getLayerSetLayerIdList(lsIdx, j ) ==  layerId )
+      {
+        Int maxSL = getMaxSubLayersInLayerSetMinus1( lsIdx ); 
+        maxNumPics = std::min( maxNumPics, getDpbSize()->getMaxVpsDecPicBufferingMinus1( olsIdx , j,  maxSL ) );
+      }
+    }
+  }
+  assert( maxNumPics != MAX_INT ); 
+  return maxNumPics;
+}
+
+Void TComVPS::xSetRefLayerFlags( Int currLayerId )
+{
+  for( Int j = 0; j < getNumDirectRefLayers( currLayerId ); j++ )
+  {
+    Int refLayerId = m_refLayerId[ currLayerId ][ j ];
+    m_recursiveRefLayerFlag[ currLayerId ][ refLayerId ] = 1;
+    for( Int k = 0; k < MAX_NUM_LAYER_IDS; k++ )
+    {
+      m_recursiveRefLayerFlag[ currLayerId ][ k ] = m_recursiveRefLayerFlag[ currLayerId ][ k ]  ||  m_recursiveRefLayerFlag[ refLayerId ][ k ];
+    }
+  }
+}
+
 #endif // H_MV
 
@@ -2530,11 +2545,4 @@
   ::memset(m_usedByCurrPicLtSPSFlag, 0, sizeof(m_usedByCurrPicLtSPSFlag));
 #if H_MV
-#if !H_MV_HLS_8_SPS_NODOC_48
-  m_spsExtensionPresentFlag = false; 
-  for( Int i = 0; i < PS_EX_T_MAX_NUM; i++ ) 
-  {
-    m_spsExtensionTypeFlag[ i ] = false;
-  }
-#else 
   m_spsRangeExtensionsFlag     = false;
   m_spsMultilayerExtensionFlag = false;
@@ -2544,5 +2552,4 @@
 #else
   m_spsExtension6bits          = 0;
-#endif
 #endif
 
@@ -2726,5 +2733,4 @@
 
 #if H_MV
-#if H_MV_HLS_8_SPS_NODOC_48
   m_ppsRangeExtensionsFlag     = false;
   m_ppsMultilayerExtensionFlag = false;
@@ -2734,10 +2740,4 @@
   m_pps3dExtensionFlag         = false;
   m_ppsExtension5bits          = 0;
-#endif
-#else
-  for( Int i = 0; i < PS_EX_T_MAX_NUM; i++ ) 
-  {
-    m_ppsExtensionTypeFlag[ i ] = false;
-  }
 #endif
 #endif
@@ -2984,4 +2984,55 @@
   }
 }
+
+Void TComSPS::inferSpsMaxDecPicBufferingMinus1( TComVPS* vps, Int targetOptLayerSetIdx, Int currLayerId, Bool encoder )
+{
+  const std::vector<Int>& targetDecLayerIdList = vps->getTargetDecLayerIdList( vps->olsIdxToLsIdx( targetOptLayerSetIdx )); 
+
+  if (getLayerId() > 0 )
+  {
+    Int layerIdx = 0;         
+    while (layerIdx < (Int) targetDecLayerIdList.size() )
+    {
+      if ( targetDecLayerIdList[layerIdx] == currLayerId )
+      { 
+        break; 
+      }
+      layerIdx++; 
+    }
+
+    assert( layerIdx < (Int) targetDecLayerIdList.size() ); 
+
+    for (Int i = 0; i <= getSpsMaxSubLayersMinus1(); i++ ) 
+    {
+      Int maxDecPicBufferingMinus1 = vps->getDpbSize()->getMaxVpsDecPicBufferingMinus1( targetOptLayerSetIdx, layerIdx, i ) ; 
+
+      if ( encoder )
+      {
+        assert( getMaxDecPicBuffering( i ) - 1 == maxDecPicBufferingMinus1 ); 
+      }
+      else
+      {
+        setMaxDecPicBuffering(i, maxDecPicBufferingMinus1 + 1 ); 
+      }
+    }
+  }
+}
+
+Void TComSPS::checkRpsMaxNumPics( TComVPS* vps, Int currLayerId )
+{
+  // In spec, when rps is in SPS, nuh_layer_id of SPS is used instead 
+  // of nuh_layer_id of slice (currLayerId), this seems to be a bug.
+
+  for (Int i = 0; i < getRPSList()->getNumberOfReferencePictureSets(); i++ )
+  {
+    TComReferencePictureSet* rps = getRPSList()->getReferencePictureSet( i ); 
+    if ( !rps->getInterRPSPrediction() )
+    {
+      rps->checkMaxNumPics( vps->getVpsExtensionFlag(), vps->getMaxNumPics( currLayerId ), 
+        getLayerId(), getMaxDecPicBuffering( getSpsMaxSubLayersMinus1() ) - 1 );  
+    }
+  }
+}
+
 #endif
 
@@ -3133,4 +3184,19 @@
   printf("}\n");
 }
+#if H_MV
+Void TComReferencePictureSet::checkMaxNumPics( Bool vpsExtensionFlag, Int maxNumPics, Int nuhLayerId, Int spsMaxDecPicBufferingMinus1 )
+{
+  assert( getNumberOfPictures() >= 0 ); 
+  if ( nuhLayerId == 0 )
+  {
+    assert( getNumberOfPictures() <= spsMaxDecPicBufferingMinus1 ); 
+  }
+
+  if ( vpsExtensionFlag )
+  {
+    assert( getNumberOfPictures() <= maxNumPics );
+  }
+}
+#endif
 
 TComRPSList::TComRPSList()
@@ -3279,60 +3345,4 @@
 }
 
-#if !H_MV_HLS_8_DBP_NODOC_42
-Void TComSlice::markIvRefPicsAsUnused( TComPicLists* ivPicLists, std::vector<Int> targetDecLayerIdSet, TComVPS* vps, Int curLayerId, Int curPoc )
-{
-  // Fill targetDecLayerIdSet with all layers if empty (at encoder side) 
-  if (targetDecLayerIdSet.size() == 0 )    
-  {
-    for ( Int layerIdInVps = 0; layerIdInVps <= vps->getMaxLayersMinus1(); layerIdInVps++ )
-    {
-      targetDecLayerIdSet.push_back( vps->getLayerIdInNuh( layerIdInVps ) ); 
-    }
-  }     
-
-  Int numTargetDecLayers = (Int) targetDecLayerIdSet.size(); 
-  Int latestDecIdx; 
-  for ( latestDecIdx = 0; latestDecIdx < numTargetDecLayers; latestDecIdx++)
-  {
-    if ( targetDecLayerIdSet[ latestDecIdx ] == curLayerId )
-    {
-      break; 
-    }        
-  }        
-
-  for( Int i = 0; i <= latestDecIdx; i++ ) 
-  {
-    if ( vps->nuhLayerIdIncluded( targetDecLayerIdSet[ i ] ) )
-    {
-      TComPic* pcPic = ivPicLists->getPic( targetDecLayerIdSet[ i ], curPoc ); 
-      if ( pcPic )
-      {
-        if( pcPic->getSlice(0)->isReferenced() && pcPic->getSlice(0)->getTemporalLayerNonReferenceFlag() ) 
-        { 
-          Bool remainingInterLayerReferencesFlag = false; 
-          for( Int j = latestDecIdx + 1; j < numTargetDecLayers; j++ )
-          { 
-            TComVPS* vpsSlice = pcPic->getSlice(0)->getVPS(); 
-            if ( vps->nuhLayerIdIncluded( targetDecLayerIdSet[ j ] ) )
-            {
-              for( Int k = 0; k < vpsSlice->getNumDirectRefLayers( targetDecLayerIdSet[ j ] ); k++ )
-              {
-                if ( targetDecLayerIdSet[ i ] == vpsSlice->getRefLayerId( targetDecLayerIdSet[ j ],  k  ) )
-                {
-                  remainingInterLayerReferencesFlag = true;
-                }
-              }
-            }
-          }
-          if( !remainingInterLayerReferencesFlag )
-          {
-            pcPic->getSlice(0)->setReferenced( false );                   
-          }
-        }
-      }
-    }
-  }
-}
-#endif
 Void TComSlice::printRefPicList()
 {  
@@ -3351,23 +3361,9 @@
 Void TComSlice::markCurrPic( TComPic* currPic )
 {
-
-#if !H_MV_HLS_8_DBP_NODOC_42
-  if ( !currPic->getSlice(0)->getDiscardableFlag() )
-  {
-#endif
-    currPic->getSlice(0)->setReferenced( true ) ; 
-    currPic->setIsLongTerm( false ); 
-#if !H_MV_HLS_8_DBP_NODOC_42
-  }
-  else
-  {
-    currPic->getSlice(0)->setReferenced( false ) ; 
-  }
-#endif
-
-#if H_MV_HLS_7_VPS_P0300_27
+  currPic->getSlice(0)->setReferenced( true ) ; 
+  currPic->setIsLongTerm( false ); 
+
   currPic->setReconMark( true );
   currPic->setPicOutputFlag( currPic->getSlice(0)->getPicOutputFlag() );
-#endif
 }
 
@@ -3403,11 +3399,6 @@
   Int refLayerIdx = vps->getLayerIdInVps( vps->getRefLayerId( getLayerId(), i ) ); 
 
-#if H_MV_HLS_8_RPS_Q0060_17
   Bool refLayerPicFlag = ( vps->getSubLayersVpsMaxMinus1( refLayerIdx ) >=  getTLayer() )  && ( getTLayer() == 0  ) &&
     ( vps->getMaxTidIlRefPicsPlus1( refLayerIdx, vps->getLayerIdInVps( getLayerId() )) > getTLayer() ); 
-#else
-  Bool refLayerPicFlag = ( vps->getSubLayersVpsMaxMinus1( refLayerIdx ) >=  getTLayer() )  && 
-    ( vps->getMaxTidIlRefPicsPlus1( refLayerIdx, vps->getLayerIdInVps( getLayerId() )) > getTLayer() ); 
-#endif
 
   return refLayerPicFlag;       
@@ -3766,5 +3757,5 @@
 
 #if H_3D_DDD
-    InitializeDDDPara( vps->getCamParPrecision(), codScale[ i ], codOffset[ i ], i );
+    initializeDDDPara( vps->getCamParPrecision(), codScale[ i ], codOffset[ i ], i );
 #endif
   }
@@ -3774,5 +3765,5 @@
 
 #if H_3D_DDD
-Void TComSlice::InitializeDDDPara( UInt uiCamParsCodedPrecision, Int  iCodedScale,Int  iCodedOffset, Int iBaseViewIdx )
+Void TComSlice::initializeDDDPara( UInt uiCamParsCodedPrecision, Int  iCodedScale,Int  iCodedOffset, Int iBaseViewIdx )
 {
     UInt uiViewId     = getViewIndex();
@@ -3831,4 +3822,45 @@
 
     return;
+}
+
+
+#endif
+
+#if H_MV
+Void TComSlice::checkCrossLayerBlaFlag()
+{
+  // cross_layer_bla_flag shall be equal to 0 for pictures with nal_unit_type not equal to IDR_W_RADL or IDR_N_LP or with nuh_layer_id not equal to 0.
+  if ( getLayerId() != 0 || getNalUnitType() != NAL_UNIT_CODED_SLICE_IDR_W_RADL || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP )
+  {
+    assert( m_crossLayerBlaFlag == 0 ); 
+  }
+}
+
+Bool TComSlice::inferPocMsbValPresentFlag()
+{
+  Bool pocMsbValPresentFlag; 
+  if( getSliceSegmentHeaderExtensionLength() == 0 ) 
+  {
+    pocMsbValPresentFlag = false; 
+  }
+  else if ( getPocMsbValRequiredFlag() )
+  {
+    pocMsbValPresentFlag = true; 
+  }
+  else
+  {
+    pocMsbValPresentFlag = false; 
+  }
+
+  return pocMsbValPresentFlag;
+}
+
+
+#endif
+
+#if H_3D_DBBP
+Int TComSlice::getDepthFromDV( Int iDV, Int iBaseViewIdx )
+{
+  return ClipY(( iDV * m_aiDDDInvScale[ iBaseViewIdx ] + m_aiDDDInvOffset[ iBaseViewIdx ] ) >> m_aiDDDShift[ iBaseViewIdx ]);
 }
 #endif
@@ -4323,4 +4355,17 @@
 }
 
+Void TComVpsVuiBspHrdParameters::checkBspCombHrdAndShedIdx( TComVPS* vps, Int h, Int i, Int j )
+{
+  // bsp_comb_hrd_idx
+  assert( getBspCombSchedIdx(h, i, j ) >= 0 );
+  assert( getBspCombSchedIdx(h, i, j ) <= getVpsNumBspHrdParametersMinus1() );
+
+  // bsp_comb_sched_idx
+  assert( getBspCombSchedIdx(h, i, j ) >= 0 );
+
+  //* This check needs to activated,  when HighestTid is available here    
+  //  assert(  getBspCombSchedIdx(h, i, j ) <= vps->getHrdParameters( getBspCombHrdIdx( h, i, j ) )->getCpbCntMinus1( highestTid ) );
+}
+
 Void TComVUI::inferVideoSignalInfo( TComVPS* vps, Int layerIdCurr )
 {
Index: /branches/HTM-11.1-dev0/source/Lib/TLibCommon/TComSlice.h
===================================================================
--- /branches/HTM-11.1-dev0/source/Lib/TLibCommon/TComSlice.h	(revision 970)
+++ /branches/HTM-11.1-dev0/source/Lib/TLibCommon/TComSlice.h	(revision 971)
@@ -54,7 +54,5 @@
 class TComPicLists; 
 class TComVPS; 
-#if H_MV_HLS_8_RPS_Q0100_36
 class TComSPS; 
-#endif
 #endif
 // ====================================================================================================================
@@ -130,18 +128,6 @@
   Void printDeltaPOC();
 
-#if H_MV_HLS_8_RPS_Q0100_36
-  Void checkMaxNumPics( Bool vpsExtensionFlag, Int maxNumPics, Int nuhLayerId, Int spsMaxDecPicBufferingMinus1 )
-  {
-    assert( getNumberOfPictures() >= 0 ); 
-    if ( nuhLayerId == 0 )
-    {
-      assert( getNumberOfPictures() <= spsMaxDecPicBufferingMinus1 ); 
-    }
-
-    if ( vpsExtensionFlag )
-    {
-      assert( getNumberOfPictures() <= maxNumPics );
-    }
-  }
+#if H_MV
+  Void checkMaxNumPics( Bool vpsExtensionFlag, Int maxNumPics, Int nuhLayerId, Int spsMaxDecPicBufferingMinus1 );
 #endif
 };
@@ -479,22 +465,11 @@
   Void setBspCombHrdIdx( Int h, Int i, Int j, Int  val ) { m_bspCombHrdIdx[h][i][j] = val; } 
   Int  getBspCombHrdIdx( Int h, Int i, Int j ) { return m_bspCombHrdIdx[h][i][j]; } 
-#if H_MV_HLS_8_HRD_Q0101_04
   Int  getBspCombHrdIdxLen() { return gCeilLog2( getVpsNumBspHrdParametersMinus1() + 1);  }; 
-  Void checkBspCombHrdAndShedIdx( TComVPS* vps, Int h, Int i, Int j )  
-  {
-    // bsp_comb_hrd_idx
-    assert( getBspCombSchedIdx(h, i, j ) >= 0 );
-    assert( getBspCombSchedIdx(h, i, j ) <= getVpsNumBspHrdParametersMinus1() );
-
-    // bsp_comb_sched_idx
-    assert( getBspCombSchedIdx(h, i, j ) >= 0 );
-
-    //* This check needs to activated,  when HighestTid is available here    
-    //  assert(  getBspCombSchedIdx(h, i, j ) <= vps->getHrdParameters( getBspCombHrdIdx( h, i, j ) )->getCpbCntMinus1( highestTid ) );
-  }
-#endif
+
 
   Void setBspCombSchedIdx( Int h, Int i, Int j, Int  val ) { m_bspCombSchedIdx[h][i][j] = val; } 
   Int  getBspCombSchedIdx( Int h, Int i, Int j ) { return m_bspCombSchedIdx[h][i][j]; } 
+
+  Void checkBspCombHrdAndShedIdx( TComVPS* vps, Int h, Int i, Int j );
 
   Void setHrdParametermeters( Int k, TComHRD* val  ) {  m_hrdParameters[k] = val; }; 
@@ -695,5 +670,5 @@
 private:
   Int         m_VPSId;
-#if H_MV_HLS_8_SYN_Q0041_03
+#if H_MV
   Bool        m_vpsBaseLayerInternalFlag;
 #endif
@@ -736,9 +711,7 @@
   TimingInfo  m_timingInfo;
 #if H_MV
-  #if H_MV_HLS_8_RPS_Q0100_36
   Bool        m_vpsExtensionFlag;
-#endif
+
   /// VPS EXTENSION SYNTAX ELEMENTS
-  Bool        m_avcBaseLayerFlag;
   Int         m_vpsNonVuiExtensionLength;
   Bool        m_splittingFlag;
@@ -761,8 +734,7 @@
 
   Int         m_numAddLayerSets;    
-#if H_MV_HLS_8_SYN_39_19
   Int         m_highestLayerIdxPlus1     [MAX_VPS_ADD_OUTPUT_LAYER_SETS][MAX_NUM_LAYERS];
   Int         m_numAddOlss;
-#endif
+
   Int         m_defaultOutputLayerIdc;
 
@@ -802,5 +774,4 @@
   Int         m_refLayerId               [MAX_NUM_LAYERS][MAX_NUM_LAYERS];  
 
-#if H_MV_HLS_8
   Int         m_numRefLayers             [MAX_NUM_LAYER_IDS]; 
   Int         m_numPredictedLayers       [MAX_NUM_LAYERS]; 
@@ -810,14 +781,5 @@
   Int         m_treePartitionLayerIdList [MAX_NUM_LAYERS][MAX_NUM_LAYER_IDS];
   Bool        m_recursiveRefLayerFlag    [MAX_NUM_LAYER_IDS][MAX_NUM_LAYER_IDS]; 
-#else
-
-  Int         m_numSamplePredRefLayers   [MAX_NUM_LAYERS];
-  Bool        m_samplePredEnabledFlag    [MAX_NUM_LAYERS][MAX_NUM_LAYERS];
-  Int         m_samplePredRefLayerId     [MAX_NUM_LAYERS][MAX_NUM_LAYERS];
-
-  Int         m_numMotionPredRefLayers   [MAX_NUM_LAYERS];
-  Bool        m_motionPredEnabledFlag    [MAX_NUM_LAYERS][MAX_NUM_LAYERS];
-  Int         m_motionPredRefLayerId     [MAX_NUM_LAYERS][MAX_NUM_LAYERS];
-#endif
+
   Int         m_viewIndex                [MAX_NUM_LAYERS   ];
   
@@ -828,19 +790,5 @@
 
   Int         xGetDimBitOffset( Int j );
-
-#if H_MV_HLS_8
-  Void xSetRefLayerFlags( Int currLayerId )
-  { 
-    for( Int j = 0; j < getNumDirectRefLayers( currLayerId ); j++ )
-    {
-      Int refLayerId = m_refLayerId[ currLayerId ][ j ];
-      m_recursiveRefLayerFlag[ currLayerId ][ refLayerId ] = 1;
-      for( Int k = 0; k < MAX_NUM_LAYER_IDS; k++ )
-      {
-        m_recursiveRefLayerFlag[ currLayerId ][ k ] = m_recursiveRefLayerFlag[ currLayerId ][ k ]  ||  m_recursiveRefLayerFlag[ refLayerId ][ k ];
-      }
-    }
-  }
-#endif
+  Void        xSetRefLayerFlags( Int currLayerId );
   // VPS EXTENSION 2 SYNTAX ELEMENTS
 #if H_3D_ARP
@@ -902,8 +850,6 @@
   Void    setVPSId       (Int i)              { m_VPSId = i;             }
 
-#if H_MV_HLS_8_SYN_Q0041_03
   Void    setVpsBaseLayerInternalFlag( Bool flag ) { m_vpsBaseLayerInternalFlag = flag; } 
   Bool    getVpsBaseLayerInternalFlag(  )          { return m_vpsBaseLayerInternalFlag; } 
-#endif
 
   UInt    getMaxTLayers  ()                   { return m_uiMaxTLayers;   }
@@ -957,13 +903,7 @@
   TimingInfo* getTimingInfo() { return &m_timingInfo; }
 #if H_MV
-
-#if H_MV_HLS_8_RPS_Q0100_36
   Void    setVpsExtensionFlag( Bool flag )                                 { m_vpsExtensionFlag = flag; } 
   Bool    getVpsExtensionFlag(  )                                          { return m_vpsExtensionFlag; } 
-#endif
-#if !H_MV_HLS_8_SYN_Q0041_03
-  Void    setAvcBaseLayerFlag( Bool val )                                  { m_avcBaseLayerFlag = val;  }
-  Bool    getAvcBaseLayerFlag()                                            { return m_avcBaseLayerFlag; } 
-#endif 
+
   Void    setVpsNonVuiExtensionLength( Int  val )                          { m_vpsNonVuiExtensionLength = val; } 
   Int     getVpsNonVuiExtensionLength(  )                                  { return m_vpsNonVuiExtensionLength; } 
@@ -1026,5 +966,4 @@
   Int     getNumAddLayerSets( )                                            { return m_numAddLayerSets; } 
   
-#if H_MV_HLS_8_SYN_39_19
   Void    setHighestLayerIdxPlus1( Int i, Int j, Int  val )                { m_highestLayerIdxPlus1[i][j] = val; } 
   Int     getHighestLayerIdxPlus1( Int i, Int j )                          { return m_highestLayerIdxPlus1[i][j]; } 
@@ -1032,5 +971,4 @@
   Void    setNumAddOlss( Int  val )                                        { m_numAddOlss = val; } 
   Int     getNumAddOlss(  )                                                { return m_numAddOlss; } 
-#endif
 
   Void    setDefaultOutputLayerIdc( Int  val )                             { m_defaultOutputLayerIdc = val; } 
@@ -1060,7 +998,5 @@
   Int     getVpsRepFormatIdx( Int i )                                      { return m_vpsRepFormatIdx[i]; } 
 
-#if H_MV_HLS_8_PMS_Q0195_20
   Int     inferVpsRepFormatIdx( Int i )                                    { return std::min( i, getVpsNumRepFormatsMinus1()  );  }
-#endif
 
   Void    setRepFormat( Int i, TComRepFormat* val )                        { m_repFormat[i] = val;  }
@@ -1077,9 +1013,7 @@
   Void    setDpbSize( TComDpbSize* val )                                   { assert( m_dpbSize != 0 ); m_dpbSize = val; } 
   TComDpbSize* getDpbSize( )                                               { return m_dpbSize;} 
-#if H_MV_HLS_8_RPS_Q0100_36
+  
   Void    inferDbpSizeLayerSetZero( TComSPS* sps, Bool encoder );
-#endif
-
-
+  
   Void    setPocLsbNotPresentFlag( Int i, Bool flag )                      { m_pocLsbNotPresentFlag[i] = flag; } 
   Bool    getPocLsbNotPresentFlag( Int i )                                 { return m_pocLsbNotPresentFlag[i]; } 
@@ -1116,5 +1050,4 @@
   Int     getRefLayerId        ( Int layerIdInNuh, Int idx );; 
 
-#if H_MV_HLS_8
   Int     getNumRefLayers            ( Int i )        { return m_numRefLayers[i]; } 
   Int     getNumPredictedLayers      ( Int i )        { return m_numPredictedLayers[i]; } 
@@ -1124,10 +1057,6 @@
   Int     getTreePartitionLayerIdList( Int i, Int j ) { return m_treePartitionLayerIdList[i][j]; } 
   Bool    getRecursiveRefLayerFlag   ( Int i, Int j ) { return m_recursiveRefLayerFlag[i][j]; } 
-
-#endif
-
-#if H_MV_HLS_8_SYN_39_19
   Int     getNumLayerSets( )                                               { return getVpsNumLayerSetsMinus1() + 1 + getNumAddLayerSets();  };  
-#endif
+  
   Bool    checkVPSExtensionSyntax(); 
   Int     scalTypeToScalIdx   ( ScalabilityType scalType );
@@ -1137,12 +1066,8 @@
 
   Int     getNumLayersInIdList ( Int lsIdx );
-#if H_MV_HLS_8_RPS_Q0100_36
   Int     getLayerSetLayerIdList(Int lsIdx, Int j )                       { return m_layerSetLayerIdList[ lsIdx ][ j ]; }; 
-#endif
 
   Int     getNumOutputLayerSets() ;   
-#if !H_MV_HLS_8_DBP_NODOC_42
-  Int     getNumSubDpbs( Int i )                                           { return getNumLayersInIdList( i ); };  
-#endif
+
   Bool    isOutputLayer( Int outLayerSetIdx, Int layerIdInNuh );   
   Void    deriveLayerSetLayerIdList();
@@ -1160,23 +1085,7 @@
 
   Int     getMaxSubLayersInLayerSetMinus1( Int i );
-
-#if H_MV_HLS_8_SYN_39_19
   Int     getHighestLayerIdxPlus1Len( Int j )                                   { return gCeilLog2( getNumLayersInTreePartition( j ) + 1 );   }; 
-#endif
-
-  
-#if H_MV_HLS_7_VPS_P0300_27
-  Bool     getAltOutputLayerFlagVar( Int i )
-  {  // Semantics variable not syntax element !
-
-    Bool altOptLayerFlag = false;     
-    if ( i > 0 && getNumOutputLayersInOutputLayerSet( i ) == 1 && 
-      getNumDirectRefLayers( getOlsHighestOutputLayerId( i ) ) > 0 )
-    {
-      altOptLayerFlag = getAltOutputLayerFlag( i ); 
-    }
-    return altOptLayerFlag; 
-  };
-#endif
+
+  Bool     getAltOutputLayerFlagVar( Int i );;
 
   // inference
@@ -1186,24 +1095,5 @@
   // helpers
   Bool    getInDirectDependencyFlag( Int depLayeridInVps, Int refLayeridInVps, Int depth = 0 );
-#if H_MV_HLS_8_RPS_Q0100_36
-  Int     getMaxNumPics( Int layerId )
-  {    
-    Int maxNumPics = MAX_INT; 
-    for( Int olsIdx = 0; olsIdx < getNumOutputLayerSets(); olsIdx++)
-    {
-      Int lsIdx = olsIdxToLsIdx( olsIdx ); 
-      for( Int j = 0; j < getNumLayersInIdList( lsIdx ); j++ )
-      {
-        if( getLayerSetLayerIdList(lsIdx, j ) ==  layerId )
-        {
-          Int maxSL = getMaxSubLayersInLayerSetMinus1( lsIdx ); 
-          maxNumPics = std::min( maxNumPics, getDpbSize()->getMaxVpsDecPicBufferingMinus1( olsIdx , j,  maxSL ) );
-        }
-      }
-    }
-    assert( maxNumPics != MAX_INT ); 
-    return maxNumPics; 
-  }
-#endif
+  Int     getMaxNumPics( Int layerId );
 
   /// VPS EXTENSION 2 SYNTAX ELEMENTS
@@ -1630,5 +1520,5 @@
   // SPS 
   Bool        m_spsExtensionPresentFlag; 
-#if H_MV_HLS_8_SPS_NODOC_48
+
   Bool        m_spsRangeExtensionsFlag;
   Bool        m_spsMultilayerExtensionFlag;
@@ -1639,7 +1529,5 @@
   Int         m_spsExtension6bits;
 #endif
-#else
-  Bool        m_spsExtensionTypeFlag     [PS_EX_T_MAX_NUM];
-#endif
+
   Bool        m_spsInferScalingListFlag;
   Int         m_spsScalingListRefLayerId;
@@ -1755,5 +1643,5 @@
   UInt      getMaxTLayers()                           { return m_uiMaxTLayers; }
   Void      setMaxTLayers( UInt uiMaxTLayers )        { assert( uiMaxTLayers <= MAX_TLAYER ); m_uiMaxTLayers = uiMaxTLayers; }
-#if H_MV_HLS_8
+#if H_MV
   UInt      getSpsMaxSubLayersMinus1()                { return ( m_uiMaxTLayers - 1); }
 #endif
@@ -1789,45 +1677,9 @@
   TComPTL* getPTL()     { return &m_pcPTL; }
 #if H_MV
-
-#if H_MV_HLS_8_HRD_Q0102_08
-  Void inferSpsMaxDecPicBufferingMinus1( TComVPS* vps, Int targetOptLayerSetIdx, Int currLayerId, Bool encoder )
-  {
-    const std::vector<Int>& targetDecLayerIdList = vps->getTargetDecLayerIdList( vps->olsIdxToLsIdx( targetOptLayerSetIdx )); 
-
-    if (getLayerId() > 0 )
-    {
-      Int layerIdx = 0;         
-      while (layerIdx < (Int) targetDecLayerIdList.size() )
-      {
-        if ( targetDecLayerIdList[layerIdx] == currLayerId )
-        { 
-          break; 
-        }
-        layerIdx++; 
-      }
-
-      assert( layerIdx < (Int) targetDecLayerIdList.size() ); 
-
-      for (Int i = 0; i <= getSpsMaxSubLayersMinus1(); i++ ) 
-      {
-        Int maxDecPicBufferingMinus1 = vps->getDpbSize()->getMaxVpsDecPicBufferingMinus1( targetOptLayerSetIdx, layerIdx, i ) ; 
-
-        if ( encoder )
-        {
-          assert( getMaxDecPicBuffering( i ) - 1 == maxDecPicBufferingMinus1 ); 
-        }
-        else
-        {
-          setMaxDecPicBuffering(i, maxDecPicBufferingMinus1 + 1 ); 
-        }
-      }
-    }    
-  }
-#endif
+  Void inferSpsMaxDecPicBufferingMinus1( TComVPS* vps, Int targetOptLayerSetIdx, Int currLayerId, Bool encoder );
 
   Void setSpsExtensionPresentFlag( Bool flag ) { m_spsExtensionPresentFlag = flag; } 
   Bool getSpsExtensionPresentFlag( )           { return m_spsExtensionPresentFlag; }
 
-#if H_MV_HLS_8_SPS_NODOC_48
   Void setSpsRangeExtensionsFlag( Bool flag )            { m_spsRangeExtensionsFlag = flag; } 
   Bool getSpsRangeExtensionsFlag(  )                     { return m_spsRangeExtensionsFlag; } 
@@ -1844,8 +1696,4 @@
   Void setSpsExtension6bits( Int  val )                  { m_spsExtension6bits = val; } 
   Int  getSpsExtension6bits(  )                          { return m_spsExtension6bits; } 
-#endif
-#else
-  Void setSpsExtensionTypeFlag( Int i, Bool flag )       { m_spsExtensionTypeFlag[i] = flag; } 
-  Bool getSpsExtensionTypeFlag( Int i )                  { return m_spsExtensionTypeFlag[i]; }
 #endif
   
@@ -1886,25 +1734,8 @@
   // Inference 
   Void inferRepFormat( TComVPS* vps, Int layerIdCurr );
-
   Void inferScalingList( TComSPS* spsSrc );
 
-#if H_MV_HLS_8_RPS_Q0100_36
   // others
-  Void checkRpsMaxNumPics( TComVPS* vps, Int currLayerId ) 
-  {
-    // In spec, when rps is in SPS, nuh_layer_id of SPS is used instead 
-    // of nuh_layer_id of slice (currLayerId), this seems to be a bug.
-
-    for (Int i = 0; i < getRPSList()->getNumberOfReferencePictureSets(); i++ )
-    {
-      TComReferencePictureSet* rps = getRPSList()->getReferencePictureSet( i ); 
-      if ( !rps->getInterRPSPrediction() )
-      {
-        rps->checkMaxNumPics( vps->getVpsExtensionFlag(), vps->getMaxNumPics( currLayerId ), 
-          getLayerId(), getMaxDecPicBuffering( getSpsMaxSubLayersMinus1() ) - 1 );  
-      }
-    }
-  }
-#endif
+  Void checkRpsMaxNumPics( TComVPS* vps, Int currLayerId );
 
 #endif
@@ -2019,5 +1850,4 @@
   Int  m_ppsScalingListRefLayerId;
 
-#if H_MV_HLS_8_SPS_NODOC_48
   Bool m_ppsRangeExtensionsFlag;
   Bool m_ppsMultilayerExtensionFlag;
@@ -2029,7 +1859,4 @@
 #endif
 
-#else
-  Bool m_ppsExtensionTypeFlag[PS_EX_T_MAX_NUM];
-#endif
   Bool m_pocResetInfoPresentFlag;
 #endif
@@ -2175,5 +2002,4 @@
   Int  getPpsScalingListRefLayerId(  ) { return m_ppsScalingListRefLayerId; } 
 
-#if H_MV_HLS_8_SPS_NODOC_48
   Void setPpsRangeExtensionsFlag( Bool flag ) { m_ppsRangeExtensionsFlag = flag; } 
   Bool getPpsRangeExtensionsFlag(  ) { return m_ppsRangeExtensionsFlag; } 
@@ -2191,8 +2017,4 @@
   Void setPpsExtension5bits( Int  val ) { m_ppsExtension5bits = val; } 
   Int  getPpsExtension5bits(  ) { return m_ppsExtension5bits; } 
-#endif
-#else
-  Void setPpsExtensionTypeFlag( Int i, Bool flag ) { m_ppsExtensionTypeFlag[i] = flag; } 
-  Bool getPpsExtensionTypeFlag( Int i ) { return m_ppsExtensionTypeFlag[i]; } 
 #endif
 
@@ -2231,5 +2053,5 @@
   Int         m_iPPSId;               ///< picture parameter set ID
   Bool        m_PicOutputFlag;        ///< pic_output_flag 
-#if H_MV_HLS_8_POC_Q0142_32
+#if H_MV
   Int         m_slicePicOrderCntLsb;   
 #endif  
@@ -2414,5 +2236,5 @@
   Void      setPicOutputFlag( Bool b )         { m_PicOutputFlag = b;    }
   Bool      getPicOutputFlag()                 { return m_PicOutputFlag; }
-#if H_MV_HLS_8_POC_Q0142_32
+#if H_MV
   Void      setSlicePicOrderCntLsb( Int i ) { m_slicePicOrderCntLsb = i; }; 
   Int       getSlicePicOrderCntLsb(  )      { return m_slicePicOrderCntLsb; }; 
@@ -2567,7 +2389,4 @@
   static Void markIvRefPicsAsShortTerm    ( std::vector<TComPic*> refPicSetInterLayer0, std::vector<TComPic*> refPicSetInterLayer1 );
   static Void markCurrPic                 ( TComPic* currPic );
-#if !H_MV_HLS_8_DBP_NODOC_42
-  static Void markIvRefPicsAsUnused       ( TComPicLists* ivPicLists, std::vector<Int> targetDecLayerIdSet, TComVPS* vps, Int curLayerId, Int curPoc  );
-#endif
   Void        printRefPicList();
 #endif
@@ -2705,12 +2524,5 @@
   Void setCrossLayerBlaFlag( Bool flag ) { m_crossLayerBlaFlag = flag; } 
   Bool getCrossLayerBlaFlag(  ) { return m_crossLayerBlaFlag; } 
-  Void checkCrossLayerBlaFlag ( )
-  {
-    // cross_layer_bla_flag shall be equal to 0 for pictures with nal_unit_type not equal to IDR_W_RADL or IDR_N_LP or with nuh_layer_id not equal to 0.
-    if ( getLayerId() != 0 || getNalUnitType() != NAL_UNIT_CODED_SLICE_IDR_W_RADL || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP )
-    {
-      assert( m_crossLayerBlaFlag == 0 ); 
-    }
-  }
+  Void checkCrossLayerBlaFlag ( );
 
 #if !H_MV_HLS7_GEN
@@ -2736,7 +2548,6 @@
   Void setPocResetIdc( Int  val ) { m_pocResetIdc = val; } 
   Int  getPocResetIdc(  ) { return m_pocResetIdc; } 
-#if H_MV_HLS_8_POC_Q0142_32
   Void checkPocResetIdc( ) { assert( !(getVPS()->getPocLsbNotPresentFlag( getLayerIdInVps() ) )  || !(getSlicePicOrderCntLsb() > 0 ) || !( getPocResetIdc() == 2) ); }  
-#endif
+
   Void setPocResetPeriodId( Int  val ) { m_pocResetPeriodId = val; } 
   Int  getPocResetPeriodId(  ) { return m_pocResetPeriodId; } 
@@ -2747,7 +2558,5 @@
   Void setPocLsbVal( Int  val ) { m_pocLsbVal = val; } 
   Int  getPocLsbVal(  ) { return m_pocLsbVal; } 
-#if H_MV_HLS_8_POC_Q0142_32
   Void checkPocLsbVal( ) { assert( !(getVPS()->getPocLsbNotPresentFlag( getLayerIdInVps() ) )  || !getFullPocResetFlag() || ( getPocLsbVal() == 0 ) ); }  
-#endif
 
   Void setPocMsbValPresentFlag( Bool flag ) { m_pocMsbValPresentFlag = flag; } 
@@ -2792,33 +2601,10 @@
   TComPic* getPicFromRefPicSetInterLayer( Int setIdc, Int layerId );
 
-
-#if H_MV_HLS_8_POC_Q0146_15
-// Inference 
-  Bool inferPocMsbValPresentFlag()
-  {
-    Bool pocMsbValPresentFlag; 
-    if( getSliceSegmentHeaderExtensionLength() == 0 ) 
-    {
-      pocMsbValPresentFlag = false; 
-    }
-    else if ( getPocMsbValRequiredFlag() )
-    {
-      pocMsbValPresentFlag = true; 
-    }
-    else
-    {
-      pocMsbValPresentFlag = false; 
-    }
-
-    return pocMsbValPresentFlag; 
-  }  
-#endif
+  // Inference 
+  Bool inferPocMsbValPresentFlag();  
 #endif
 #if H_3D_DDD
-  Void InitializeDDDPara( UInt uiCamParsCodedPrecision, Int  iCodedScale,Int  iCodedOffset, Int iBaseViewIdx );
-  Int  getDepthFromDV( Int iDV, Int iBaseViewIdx )
-  {
-      return ClipY(( iDV * m_aiDDDInvScale[ iBaseViewIdx ] + m_aiDDDInvOffset[ iBaseViewIdx ] ) >> m_aiDDDShift[ iBaseViewIdx ]);
-  }
+  Void initializeDDDPara( UInt uiCamParsCodedPrecision, Int  iCodedScale,Int  iCodedOffset, Int iBaseViewIdx );
+  Int  getDepthFromDV( Int iDV, Int iBaseViewIdx );
 #endif
 
Index: /branches/HTM-11.1-dev0/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- /branches/HTM-11.1-dev0/source/Lib/TLibCommon/TypeDef.h	(revision 970)
+++ /branches/HTM-11.1-dev0/source/Lib/TLibCommon/TypeDef.h	(revision 971)
@@ -398,5 +398,5 @@
 :// #define H_MV_HLS_7_OTHER_P0187_1          0 // (OTHER/P0187/NoOutputOfPriorPicsFlag) #1 Inference of NoOutputOfPriorPicsFlag and proposes to take into account colour format and bit depth for the inference in addition to spatial resolution 
 //#define H_MV_HLS_8_MIS_Q0078_24  0 // #24 (MISC   /Q0078/scan and pic type) , Items 3 b,c and 4, clarifying which pictures in an output layer sets are applied the values of general_progressive_source_flag, general_interlaced_source_flag, general_non_packed_constraint_flag and general_frame_only_constraint_flag.
-//#define H_MV_HLS_7_HRD_P0138_6            0 // (HRD/P0138/HRD parameters for bitstreams excluding) #6 Decision: Adopt (as revised in updated contribution, with the specification of a flag in the BP SEI (HRD/P0192/sub-DPB) #12 Establish sub-DPBs based on the representation format indicated at the VPS level. It was suggested that the expressed shared capacity limit would need to be less than or equal to the sum of the individual capacity limits. Decision: Adopt as modified. Further study is encouraged on profile/level constraint selections. 
+//#define H_MV_HLS_7_HRD_P0138_6   0 //     (HRD/P0138/HRD parameters for bitstreams excluding) #6 Decision: Adopt (as revised in updated contribution, with the specification of a flag in the BP SEI (HRD/P0192/sub-DPB) #12 Establish sub-DPBs based on the representation format indicated at the VPS level. It was suggested that the expressed shared capacity limit would need to be less than or equal to the sum of the individual capacity limits. Decision: Adopt as modified. Further study is encouraged on profile/level constraint selections. 
 
 #define H_MV_HLS_8_SYN_Q0041_03    1   // #3  Syntax only (HS     /Q0041/hybrid scalability) The proposed text was endorsed, with non-editorial open issues considered as follows 
@@ -987,27 +987,4 @@
 #if H_MV
 
-#if !H_MV_HLS_8_SPS_NODOC_48
-enum PpsExtensionTypes
-{
-  PPS_EX_T_MV      = 0,
-#if H_3D
-  PPS_EX_T_3D      = 3,
-#endif
-  PPS_EX_T_ESC     = 7,
-  PPS_EX_T_MAX_NUM = 8
-};
-
-//Below for sps, would be good if this could be aligned
-
-  enum PsExtensionTypes
-  {
-    PS_EX_T_MV   = 1,
-#if H_3D
-    PS_EX_T_3D   = 3,
-#endif
-    PS_EX_T_ESC  = 7,
-    PS_EX_T_MAX_NUM = 8
-  };
-#endif
 /// scalability types
   enum ScalabilityType
Index: /branches/HTM-11.1-dev0/source/Lib/TLibDecoder/TDecCAVLC.cpp
===================================================================
--- /branches/HTM-11.1-dev0/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 970)
+++ /branches/HTM-11.1-dev0/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 971)
@@ -374,5 +374,4 @@
 
 #if H_MV
-#if H_MV_HLS_8_SPS_NODOC_48
     READ_FLAG( uiCode, "pps_range_extensions_flag" ); pcPPS->setPpsRangeExtensionsFlag( uiCode == 1 );
     READ_FLAG( uiCode, "pps_multilayer_extension_flag" ); pcPPS->setPpsMultilayerExtensionFlag( uiCode == 1 );
@@ -390,8 +389,6 @@
     if ( pcPPS->getPpsMultilayerExtensionFlag() )
     { 
-        READ_FLAG( uiCode, "poc_reset_info_present_flag" ); pcPPS->setPocResetInfoPresentFlag( uiCode == 1 );
-#if H_MV_HLS_8_PPS_NODOC_NN
-        READ_FLAG( uiCode, "pps_extension_reserved_zero_flag" );
-#endif
+      READ_FLAG( uiCode, "poc_reset_info_present_flag" ); pcPPS->setPocResetInfoPresentFlag( uiCode == 1 );
+      READ_FLAG( uiCode, "pps_extension_reserved_zero_flag" );
     }
 #if !H_3D
@@ -406,31 +403,5 @@
     {
 #endif
-#else
-    for ( Int i = 0; i < PPS_EX_T_MAX_NUM; i++ )
-    {
-      READ_FLAG( uiCode, "pps_extension_type_flag" ); pcPPS->setPpsExtensionTypeFlag( i, uiCode == 1 );
-#if H_3D
-      assert( !pcPPS->getPpsExtensionTypeFlag( i ) || i == PPS_EX_T_MV || i == PPS_EX_T_3D || i == PPS_EX_T_ESC ); 
-#else
-      assert( !pcPPS->getPpsExtensionTypeFlag( i ) || i == PPS_EX_T_MV || i == PPS_EX_T_ESC ); 
-#endif
-    }
-    
-
-    if( pcPPS->getPpsExtensionTypeFlag( PPS_EX_T_MV ) )
-    {
-      READ_FLAG( uiCode, "poc_reset_info_present_flag" ); pcPPS->setPocResetInfoPresentFlag( uiCode == 1 );
-    }
-
-#if H_3D
-    if( pcPPS->getPpsExtensionTypeFlag( PPS_EX_T_3D ) ) // This probably needs to be aligned with Rext and SHVC
-    {
-      parsePPSExtension( pcPPS, pcVPS );
-    }
-#endif
-
-    if( pcPPS->getPpsExtensionTypeFlag( PPS_EX_T_ESC ) )
-    {
-#endif
+
 #endif
 
@@ -792,15 +763,15 @@
   {
 #endif
-  READ_CODE( 3,  uiCode, "sps_max_sub_layers_minus1" );          pcSPS->setMaxTLayers   ( uiCode+1 );
-  assert(uiCode <= 6);
-  
-  READ_FLAG( uiCode, "sps_temporal_id_nesting_flag" );               pcSPS->setTemporalIdNestingFlag ( uiCode > 0 ? true : false );
-  if ( pcSPS->getMaxTLayers() == 1 )
-  {
-    // sps_temporal_id_nesting_flag must be 1 when sps_max_sub_layers_minus1 is 0
-    assert( uiCode == 1 );
-  }
-  
-  parsePTL(pcSPS->getPTL(), 1, pcSPS->getMaxTLayers() - 1);
+    READ_CODE( 3,  uiCode, "sps_max_sub_layers_minus1" );          pcSPS->setMaxTLayers   ( uiCode+1 );
+    assert(uiCode <= 6);
+
+    READ_FLAG( uiCode, "sps_temporal_id_nesting_flag" );               pcSPS->setTemporalIdNestingFlag ( uiCode > 0 ? true : false );
+    if ( pcSPS->getMaxTLayers() == 1 )
+    {
+      // sps_temporal_id_nesting_flag must be 1 when sps_max_sub_layers_minus1 is 0
+      assert( uiCode == 1 );
+    }
+
+    parsePTL(pcSPS->getPTL(), 1, pcSPS->getMaxTLayers() - 1);
 #if H_MV
   }
@@ -820,15 +791,15 @@
   {
 #endif
-  READ_UVLC(     uiCode, "chroma_format_idc" );                  pcSPS->setChromaFormatIdc( uiCode );
-  assert(uiCode <= 3);
-  // in the first version we only support chroma_format_idc equal to 1 (4:2:0), so separate_colour_plane_flag cannot appear in the bitstream
-  assert (uiCode == 1);
-  if( uiCode == 3 )
-  {
-    READ_FLAG(     uiCode, "separate_colour_plane_flag");        assert(uiCode == 0);
-  }
-
-  READ_UVLC (    uiCode, "pic_width_in_luma_samples" );          pcSPS->setPicWidthInLumaSamples ( uiCode    );
-  READ_UVLC (    uiCode, "pic_height_in_luma_samples" );         pcSPS->setPicHeightInLumaSamples( uiCode    );
+    READ_UVLC(     uiCode, "chroma_format_idc" );                  pcSPS->setChromaFormatIdc( uiCode );
+    assert(uiCode <= 3);
+    // in the first version we only support chroma_format_idc equal to 1 (4:2:0), so separate_colour_plane_flag cannot appear in the bitstream
+    assert (uiCode == 1);
+    if( uiCode == 3 )
+    {
+      READ_FLAG(     uiCode, "separate_colour_plane_flag");        assert(uiCode == 0);
+    }
+
+    READ_UVLC (    uiCode, "pic_width_in_luma_samples" );          pcSPS->setPicWidthInLumaSamples ( uiCode    );
+    READ_UVLC (    uiCode, "pic_height_in_luma_samples" );         pcSPS->setPicHeightInLumaSamples( uiCode    );
 #if H_MV
   }
@@ -857,13 +828,13 @@
   { 
 #endif
-  READ_UVLC(     uiCode, "bit_depth_luma_minus8" );
-  assert(uiCode <= 6);
-  pcSPS->setBitDepthY( uiCode + 8 );
-  pcSPS->setQpBDOffsetY( (Int) (6*uiCode) );
-
-  READ_UVLC( uiCode,    "bit_depth_chroma_minus8" );
-  assert(uiCode <= 6);
-  pcSPS->setBitDepthC( uiCode + 8 );
-  pcSPS->setQpBDOffsetC( (Int) (6*uiCode) );
+    READ_UVLC(     uiCode, "bit_depth_luma_minus8" );
+    assert(uiCode <= 6);
+    pcSPS->setBitDepthY( uiCode + 8 );
+    pcSPS->setQpBDOffsetY( (Int) (6*uiCode) );
+
+    READ_UVLC( uiCode,    "bit_depth_chroma_minus8" );
+    assert(uiCode <= 6);
+    pcSPS->setBitDepthC( uiCode + 8 );
+    pcSPS->setQpBDOffsetC( (Int) (6*uiCode) );
 #if H_MV
   }
@@ -877,27 +848,27 @@
   {  
 #endif
-  UInt subLayerOrderingInfoPresentFlag;
-  READ_FLAG(subLayerOrderingInfoPresentFlag, "sps_sub_layer_ordering_info_present_flag");
-  
-  for(UInt i=0; i <= pcSPS->getMaxTLayers()-1; i++)
-  {
-    READ_UVLC ( uiCode, "sps_max_dec_pic_buffering_minus1[i]");
-    pcSPS->setMaxDecPicBuffering( uiCode + 1, i);
-    READ_UVLC ( uiCode, "sps_num_reorder_pics[i]" );
-    pcSPS->setNumReorderPics(uiCode, i);
-    READ_UVLC ( uiCode, "sps_max_latency_increase_plus1[i]");
-    pcSPS->setMaxLatencyIncrease( uiCode, i );
-
-    if (!subLayerOrderingInfoPresentFlag)
-    {
-      for (i++; i <= pcSPS->getMaxTLayers()-1; i++)
-      {
-        pcSPS->setMaxDecPicBuffering(pcSPS->getMaxDecPicBuffering(0), i);
-        pcSPS->setNumReorderPics(pcSPS->getNumReorderPics(0), i);
-        pcSPS->setMaxLatencyIncrease(pcSPS->getMaxLatencyIncrease(0), i);
-      }
-      break;
-    }
-  }
+    UInt subLayerOrderingInfoPresentFlag;
+    READ_FLAG(subLayerOrderingInfoPresentFlag, "sps_sub_layer_ordering_info_present_flag");
+
+    for(UInt i=0; i <= pcSPS->getMaxTLayers()-1; i++)
+    {
+      READ_UVLC ( uiCode, "sps_max_dec_pic_buffering_minus1[i]");
+      pcSPS->setMaxDecPicBuffering( uiCode + 1, i);
+      READ_UVLC ( uiCode, "sps_num_reorder_pics[i]" );
+      pcSPS->setNumReorderPics(uiCode, i);
+      READ_UVLC ( uiCode, "sps_max_latency_increase_plus1[i]");
+      pcSPS->setMaxLatencyIncrease( uiCode, i );
+
+      if (!subLayerOrderingInfoPresentFlag)
+      {
+        for (i++; i <= pcSPS->getMaxTLayers()-1; i++)
+        {
+          pcSPS->setMaxDecPicBuffering(pcSPS->getMaxDecPicBuffering(0), i);
+          pcSPS->setNumReorderPics(pcSPS->getNumReorderPics(0), i);
+          pcSPS->setMaxLatencyIncrease(pcSPS->getMaxLatencyIncrease(0), i);
+        }
+        break;
+      }
+    }
 #if H_MV
   }
@@ -909,10 +880,10 @@
   READ_UVLC( uiCode, "log2_diff_max_min_coding_block_size" );
   pcSPS->setLog2DiffMaxMinCodingBlockSize(uiCode);
-  
+
   if (pcSPS->getPTL()->getGeneralPTL()->getLevelIdc() >= Level::LEVEL5)
   {
     assert(log2MinCUSize + pcSPS->getLog2DiffMaxMinCodingBlockSize() >= 5);
   }
-  
+
   Int maxCUDepthDelta = uiCode;
   pcSPS->setMaxCUWidth  ( 1<<(log2MinCUSize + maxCUDepthDelta) ); 
@@ -945,9 +916,9 @@
     {    
 #endif
-    READ_FLAG( uiCode, "sps_scaling_list_data_present_flag" );                 pcSPS->setScalingListPresentFlag ( uiCode );
-    if(pcSPS->getScalingListPresentFlag ())
-    {
-      parseScalingList( pcSPS->getScalingList() );
-    }
+      READ_FLAG( uiCode, "sps_scaling_list_data_present_flag" );                 pcSPS->setScalingListPresentFlag ( uiCode );
+      if(pcSPS->getScalingListPresentFlag ())
+      {
+        parseScalingList( pcSPS->getScalingList() );
+      }
 #if H_MV
     }
@@ -1014,5 +985,4 @@
   {
 #if H_MV
-#if H_MV_HLS_8_SPS_NODOC_48
     READ_FLAG( uiCode, "sps_range_extensions_flag" ); pcSPS->setSpsRangeExtensionsFlag( uiCode == 1 );
     READ_FLAG( uiCode, "sps_multilayer_extension_flag" ); pcSPS->setSpsMultilayerExtensionFlag( uiCode == 1 );
@@ -1047,38 +1017,10 @@
   { 
 #endif
-#else
-    for (Int i = 0; i < PS_EX_T_MAX_NUM; i++)
-    {
-      READ_FLAG( uiCode, "sps_extension_type_flag" ); pcSPS->setSpsExtensionTypeFlag( i, uiCode );
-#if H_3D
-      assert( !pcSPS->getSpsExtensionTypeFlag( i ) || i == PS_EX_T_MV || i == PS_EX_T_3D || i == PS_EX_T_ESC ); 
-#else
-      assert( !pcSPS->getSpsExtensionTypeFlag( i ) || i == PS_EX_T_MV || i == PS_EX_T_ESC ); 
-#endif
-    }  
-
-    if( pcSPS->getSpsExtensionTypeFlag( PS_EX_T_MV ))
-    {
-      parseSPSExtension( pcSPS ); 
-    }
-
-#if H_3D
-    if( pcSPS->getSpsExtensionTypeFlag( PS_EX_T_3D ))
-    {
-      parseSPSExtension2( pcSPS, viewIndex, depthFlag  ); 
-    }
-#endif
-
-    if ( pcSPS->getSpsExtensionTypeFlag( PS_EX_T_ESC ))
-    {   
-#endif
-#endif
-        while ( xMoreRbspData() )
-        {
-          READ_FLAG( uiCode, "sps_extension_data_flag");
-        }
-#if H_MV && !H_MV_HLS_8_SPS_NODOC_48
-    }
-#endif
+
+#endif
+    while ( xMoreRbspData() )
+    {
+      READ_FLAG( uiCode, "sps_extension_data_flag");
+    }
   }
 }
@@ -2027,5 +1969,5 @@
 #endif
 
-#if H_MV_HLS_8_HRD_Q0102_08
+#if H_MV
 Void TDecCavlc::parseSliceHeader (TComSlice*& rpcSlice, ParameterSetManagerDecoder *parameterSetManager, Int targetOlsIdx)
 #else
@@ -2070,10 +2012,6 @@
   sps->inferRepFormat  ( vps , rpcSlice->getLayerId() ); 
   sps->inferScalingList( parameterSetManager->getActiveSPS( sps->getSpsScalingListRefLayerId() ) );   
-#if H_MV_HLS_8_HRD_Q0102_08
   sps->inferSpsMaxDecPicBufferingMinus1( vps, targetOlsIdx, rpcSlice->getLayerId(), false ); 
-#endif
-#if H_MV_HLS_8_RPS_Q0100_36
   vps->inferDbpSizeLayerSetZero( sps, false ); 
-#endif
 
   if ( sps->getVuiParametersPresentFlag() )
@@ -2192,7 +2130,5 @@
       READ_CODE(sps->getBitsForPOC(), slicePicOrderCntLsb, "slice_pic_order_cnt_lsb");        
     }    
-#if H_MV_HLS_8_POC_Q0142_32
     rpcSlice->setSlicePicOrderCntLsb( slicePicOrderCntLsb ); 
-#endif
 
     Bool picOrderCntMSBZeroFlag = false;     
@@ -2290,5 +2226,5 @@
       {        
         parseShortTermRefPicSet(sps,rps, sps->getRPSList()->getNumberOfReferencePictureSets());
-#if H_MV_HLS_8_RPS_Q0100_36
+#if H_MV
         if ( !rps->getInterRPSPrediction( ) )
         { // check sum of num_positive_pics and num_negative_pics
@@ -2403,5 +2339,5 @@
         rps->setNumberOfPictures(offset);        
       }  
-#if H_MV_HLS_8_RPS_Q0100_36
+#if H_MV
       if ( !rps->getInterRPSPrediction( ) )
       { // check sum of NumPositivePics, NumNegativePics, num_long_term_sps and num_long_term_pics 
@@ -2793,7 +2729,5 @@
       rpcSlice->setPocResetIdc( 0 );
     }
-#if H_MV_HLS_8_POC_Q0142_32
     rpcSlice->checkPocResetIdc(); 
-#endif
 
 #if H0044_POC_LSB_NOT_PRESENT
@@ -2817,16 +2751,6 @@
       READ_FLAG( uiCode, "full_poc_reset_flag" ); rpcSlice->setFullPocResetFlag( uiCode == 1 );
       READ_CODE( rpcSlice->getPocLsbValLen() , uiCode, "poc_lsb_val" ); rpcSlice->setPocLsbVal( uiCode );
-#if !H_MV_HLS_8_POC_Q0142_32
-#if H0044_POC_LSB_NOT_PRESENT
-      if ( rpcSlice->getVPS()->getPocLsbNotPresentFlag(rpcSlice->getLayerId()) && rpcSlice->getFullPocResetFlag() )
-      {
-        assert( rpcSlice->getPocLsbVal() == 0 );
-      }
-#endif
-#endif
     }          
-#if H_MV_HLS_8_POC_Q0142_32
     rpcSlice->checkPocLsbVal(); 
-#endif
 
     // Derive the value of PocMs8bValRequiredFlag
@@ -2841,16 +2765,5 @@
     else
     {
-#if H_MV_HLS_8_POC_Q0146_15
       rpcSlice->setPocMsbValPresentFlag( rpcSlice->inferPocMsbValPresentFlag( ) ); 
-#else
-      if( rpcSlice->getPocMsbValRequiredFlag() )
-      {
-        rpcSlice->setPocMsbValPresentFlag( true );
-      }
-      else
-      {
-        rpcSlice->setPocMsbValPresentFlag( false );
-      }
-#endif
     }
 
Index: /branches/HTM-11.1-dev0/source/Lib/TLibDecoder/TDecSbac.h
===================================================================
--- /branches/HTM-11.1-dev0/source/Lib/TLibDecoder/TDecSbac.h	(revision 970)
+++ /branches/HTM-11.1-dev0/source/Lib/TLibDecoder/TDecSbac.h	(revision 971)
@@ -87,8 +87,6 @@
 #endif
 
-#if H_MV_HLS_8_HRD_Q0102_08
+#if H_MV
   Void  parseSliceHeader          ( TComSlice*& /*rpcSlice*/, ParameterSetManagerDecoder* /*parameterSetManager*/, Int targetOlsIdx ) {}
-#else
-  Void  parseSliceHeader          ( TComSlice*& /*rpcSlice*/, ParameterSetManagerDecoder* /*parameterSetManager*/) {}
 #endif
   Void  parseTerminatingBit       ( UInt& ruiBit );
