Index: branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/CommonDef.h
===================================================================
--- branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/CommonDef.h	(revision 647)
+++ branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/CommonDef.h	(revision 648)
@@ -187,5 +187,4 @@
 }
 
-#if H_MV5
 template <typename T>
 __inline T gCeilLog2( T val )
@@ -196,5 +195,4 @@
   return ceilLog2;
 }
-#endif
 
 #define RemoveBitIncrement( exp ) ( exp >> ( g_bitDepthY - 8 ) )
Index: branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComDataCU.cpp
===================================================================
--- branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComDataCU.cpp	(revision 647)
+++ branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComDataCU.cpp	(revision 648)
@@ -4804,21 +4804,5 @@
 
   // use coldir.
-#if H_MV5
   TComPic *pColPic = getSlice()->getRefPic( RefPicList(getSlice()->isInterB() ? 1-getSlice()->getColFromL0Flag() : 0), getSlice()->getColRefIdx());
-#else
-#if H_MV
-  TComPic *pColPic;  
-  if (getSlice()->getAltCollocatedIndicationFlag() )
-  {
-    pColPic = getSlice()->getPicFromRefPicSetInterLayer( getSlice()->getActiveMotionPredRefLayerId( getSlice()->getCollocatedRefLayerIdx() )); 
-  }
-  else
-  {
-    pColPic = getSlice()->getRefPic( RefPicList(getSlice()->isInterB() ? 1-getSlice()->getColFromL0Flag() : 0), getSlice()->getColRefIdx());  
-  }  
-#else
-  TComPic *pColPic = getSlice()->getRefPic( RefPicList(getSlice()->isInterB() ? 1-getSlice()->getColFromL0Flag() : 0), getSlice()->getColRefIdx());
-#endif
-#endif
   TComDataCU *pColCU = pColPic->getCU( uiCUAddr );
   if(pColCU->getPic()==0||pColCU->getPartitionSize(uiPartUnitIdx)==SIZE_NONE)
Index: branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComSlice.cpp
===================================================================
--- branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComSlice.cpp	(revision 647)
+++ branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComSlice.cpp	(revision 648)
@@ -101,32 +101,16 @@
 , m_enableTMVPFlag                ( true )
 #if H_MV
-#if H_MV5
 , m_refPicSetInterLayer0           ( NULL )
 , m_refPicSetInterLayer1           ( NULL )
-#else
-, m_refPicSetInterLayer           ( NULL )
-#endif
 , m_layerId                       (0)
 , m_viewId                        (0)
-#if H_MV5
 , m_viewIndex                     (0)
-#endif
 #if H_3D
-#if !H_MV5
-, m_viewIndex                     (0)
-#endif
 , m_isDepth                       (false)
 #endif
-#if H_MV5
 , m_pocResetFlag                  (false)
-#endif
 , m_discardableFlag               (false)
 , m_interLayerPredEnabledFlag     (false)
 , m_numInterLayerRefPicsMinus1    (0)
-#if !H_MV5
-, m_interLayerSamplePredOnlyFlag  (false)
-, m_altCollocatedIndicationFlag   (0)
-, m_collocatedRefLayerIdx         (0)
-#endif
 #if H_3D_IC
 , m_bApplyIC                      ( false )
@@ -164,9 +148,5 @@
   for (Int i = 0; i < MAX_NUM_LAYERS; i++ )
   {
-#if H_MV5
    m_interLayerPredLayerIdc[ i ] = i;
-#else
-   m_interLayerPredLayerIdc[ i ] = 0;
-#endif
   }
 #endif
@@ -387,5 +367,4 @@
   }
 }
-#if H_MV5
 #if !H_MV
 #if FIX1071
@@ -730,256 +709,20 @@
 }
 #endif
-#else
+Int TComSlice::getNumRpsCurrTempList()
+{
+  Int numRpsCurrTempList = 0;
+
+  if (m_eSliceType == I_SLICE) 
+  {
+    return 0;
+  }
+  for(UInt i=0; i < m_pcRPS->getNumberOfNegativePictures()+ m_pcRPS->getNumberOfPositivePictures() + m_pcRPS->getNumberOfLongtermPictures(); i++)
+  {
+    if(m_pcRPS->getUsed(i))
+    {
+      numRpsCurrTempList++;
+    }
+  }
 #if H_MV
-Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic, std::vector<TComPic*>& refPicSetInterLayer , Bool checkNumPocTotalCurr)
-#else
-#if FIX1071
-Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic, Bool checkNumPocTotalCurr )
-#else
-Void TComSlice::setRefPicList( TComList<TComPic*>& rcListPic )
-#endif
-#endif
-{
-#if FIX1071
-  if (!checkNumPocTotalCurr)
-#endif
-  {
-    if (m_eSliceType == I_SLICE)
-    {
-      ::memset( m_apcRefPicList, 0, sizeof (m_apcRefPicList));
-      ::memset( m_aiNumRefIdx,   0, sizeof ( m_aiNumRefIdx ));
-      
-      return;
-    }
-    
-#if !H_MV
-    m_aiNumRefIdx[0] = getNumRefIdx(REF_PIC_LIST_0);
-    m_aiNumRefIdx[1] = getNumRefIdx(REF_PIC_LIST_1);
-#endif
-  }
-
-  TComPic*  pcRefPic= NULL;
-  TComPic*  RefPicSetStCurr0[16];
-  TComPic*  RefPicSetStCurr1[16];
-  TComPic*  RefPicSetLtCurr[16];
-  UInt NumPocStCurr0 = 0;
-  UInt NumPocStCurr1 = 0;
-  UInt NumPocLtCurr = 0;
-  Int i;
-
-  for(i=0; i < m_pcRPS->getNumberOfNegativePictures(); i++)
-  {
-    if(m_pcRPS->getUsed(i))
-    {
-      pcRefPic = xGetRefPic(rcListPic, getPOC()+m_pcRPS->getDeltaPOC(i));
-      pcRefPic->setIsLongTerm(0);
-      pcRefPic->getPicYuvRec()->extendPicBorder();
-      RefPicSetStCurr0[NumPocStCurr0] = pcRefPic;
-      NumPocStCurr0++;
-      pcRefPic->setCheckLTMSBPresent(false);  
-    }
-  }
-  
-  for(; i < m_pcRPS->getNumberOfNegativePictures()+m_pcRPS->getNumberOfPositivePictures(); i++)
-  {
-    if(m_pcRPS->getUsed(i))
-    {
-      pcRefPic = xGetRefPic(rcListPic, getPOC()+m_pcRPS->getDeltaPOC(i));
-      pcRefPic->setIsLongTerm(0);
-      pcRefPic->getPicYuvRec()->extendPicBorder();
-      RefPicSetStCurr1[NumPocStCurr1] = pcRefPic;
-      NumPocStCurr1++;
-      pcRefPic->setCheckLTMSBPresent(false);  
-    }
-  }
-  
-  for(i = m_pcRPS->getNumberOfNegativePictures()+m_pcRPS->getNumberOfPositivePictures()+m_pcRPS->getNumberOfLongtermPictures()-1; i > m_pcRPS->getNumberOfNegativePictures()+m_pcRPS->getNumberOfPositivePictures()-1 ; i--)
-  {
-    if(m_pcRPS->getUsed(i))
-    {
-      pcRefPic = xGetLongTermRefPic(rcListPic, m_pcRPS->getPOC(i), m_pcRPS->getCheckLTMSBPresent(i));
-      pcRefPic->setIsLongTerm(1);
-      pcRefPic->getPicYuvRec()->extendPicBorder();
-      RefPicSetLtCurr[NumPocLtCurr] = pcRefPic;
-      NumPocLtCurr++;
-    }
-    if(pcRefPic==NULL) 
-    {
-      pcRefPic = xGetLongTermRefPic(rcListPic, m_pcRPS->getPOC(i), m_pcRPS->getCheckLTMSBPresent(i));
-    }
-    pcRefPic->setCheckLTMSBPresent(m_pcRPS->getCheckLTMSBPresent(i));  
-  }
-
-  // ref_pic_list_init
-  TComPic*  rpsCurrList0[MAX_NUM_REF+1];
-  TComPic*  rpsCurrList1[MAX_NUM_REF+1];
-#if H_MV
-  Int numPocInterCurr = NumPocStCurr0 + NumPocStCurr1 + NumPocLtCurr; 
-  assert( numPocInterCurr == 0 || getInterRefEnabledInRPLFlag() ); 
-  Int numPocTotalCurr = numPocInterCurr + getNumActiveRefLayerPics( );
-  assert( numPocTotalCurr == getNumRpsCurrTempList() );
-#else
-  Int numPocTotalCurr = NumPocStCurr0 + NumPocStCurr1 + NumPocLtCurr;
-#endif
-#if FIX1071
-  if (checkNumPocTotalCurr)
-  {
-    // The variable NumPocTotalCurr is derived as specified in subclause 7.4.7.2. It is a requirement of bitstream conformance that the following applies to the value of NumPocTotalCurr:
-#if H_MV
-    // ??If nuh_layer_id is equal to 0 and the current picture is a BLA picture or a CRA picture, the value of NumPocTotalCurr shall be equal to 0.
-    // ??Otherwise, when the current picture contains a P or B slice, the value of NumPocTotalCurr shall not be equal to 0.
-    if ( getRapPicFlag() && m_layerId == 0 )
-#else
-    // ??If the current picture is a BLA or CRA picture, the value of NumPocTotalCurr shall be equal to 0.
-    // ??Otherwise, when the current picture contains a P or B slice, the value of NumPocTotalCurr shall not be equal to 0.
-    if (getRapPicFlag())
-#endif
-    {
-      assert(numPocTotalCurr == 0);
-    }
-
-    if (m_eSliceType == I_SLICE)
-    {
-      ::memset( m_apcRefPicList, 0, sizeof (m_apcRefPicList));
-      ::memset( m_aiNumRefIdx,   0, sizeof ( m_aiNumRefIdx ));
-      
-      return;
-    }
-    
-    assert(numPocTotalCurr > 0);
-    
-    m_aiNumRefIdx[0] = getNumRefIdx(REF_PIC_LIST_0);
-    m_aiNumRefIdx[1] = getNumRefIdx(REF_PIC_LIST_1);
-  }
-#endif
-
-  Int cIdx = 0;
-#if H_MV
-  if ( getInterRefEnabledInRPLFlag() )
-  {  
-#endif
-  for ( i=0; i<NumPocStCurr0; i++, cIdx++)
-  {
-    rpsCurrList0[cIdx] = RefPicSetStCurr0[i];
-  }
-  for ( i=0; i<NumPocStCurr1; i++, cIdx++)
-  {
-    rpsCurrList0[cIdx] = RefPicSetStCurr1[i];
-  }
-  for ( i=0; i<NumPocLtCurr;  i++, cIdx++)
-  {
-    rpsCurrList0[cIdx] = RefPicSetLtCurr[i];
-  }
-#if H_MV
-  }
-  for ( i=0; i < getNumActiveRefLayerPics( );  i++, cIdx++)
-    {
-    assert( cIdx < MAX_NUM_REF );    
-      rpsCurrList0[cIdx] = refPicSetInterLayer[i];
-    }
-#endif
-  assert(cIdx == numPocTotalCurr);
-
-  if (m_eSliceType==B_SLICE)
-  {
-    cIdx = 0;
-#if H_MV
-    if ( getInterRefEnabledInRPLFlag() )
-    {  
-#endif
-    for ( i=0; i<NumPocStCurr1; i++, cIdx++)
-    {
-      rpsCurrList1[cIdx] = RefPicSetStCurr1[i];
-    }
-    for ( i=0; i<NumPocStCurr0; i++, cIdx++)
-    {
-      rpsCurrList1[cIdx] = RefPicSetStCurr0[i];
-    }
-    for ( i=0; i<NumPocLtCurr;  i++, cIdx++)
-    {
-      rpsCurrList1[cIdx] = RefPicSetLtCurr[i];
-    }
-#if H_MV
-    }
-    for ( i=0; i < getNumActiveRefLayerPics( );  i++, cIdx++)
-      {
-      assert( cIdx < MAX_NUM_REF );    
-        rpsCurrList1[cIdx] = refPicSetInterLayer[i];
-      }
-#endif
-    assert(cIdx == numPocTotalCurr);
-  }
-
-  ::memset(m_bIsUsedAsLongTerm, 0, sizeof(m_bIsUsedAsLongTerm));
-
-#if H_MV
-  Int numPocSt = NumPocStCurr0 + NumPocStCurr1; 
-  assert(  getInterRefEnabledInRPLFlag( ) || numPocSt == 0 );
-
-  for (Int li = 0; li < 2; li++)
-  {
-    if ( m_eSliceType == P_SLICE && li == 1 )
-    {
-      m_aiNumRefIdx[1] = 0;
-      ::memset( m_apcRefPicList[1], 0, sizeof(m_apcRefPicList[1]));
-    } 
-    else
-    {
-      for (Int rIdx = 0; rIdx <= (m_aiNumRefIdx[ li ] - 1 ); rIdx ++)
-      { 
-        Bool listModified             =                m_RefPicListModification.getRefPicListModificationFlagL( li ); 
-        Int orgIdx                    = listModified ? m_RefPicListModification.getRefPicSetIdxL(li, rIdx) : (rIdx % numPocTotalCurr); 
-
-        m_apcRefPicList    [li][rIdx] = ( li == 0 )  ? rpsCurrList0[ orgIdx  ] : rpsCurrList1[ orgIdx  ];
-        m_bIsUsedAsLongTerm[li][rIdx] = ( orgIdx >= numPocSt ) ; 
-      }
-    }
-  }
-#else
-  for (Int rIdx = 0; rIdx < m_aiNumRefIdx[0]; rIdx ++)
-  {
-    cIdx = m_RefPicListModification.getRefPicListModificationFlagL0() ? m_RefPicListModification.getRefPicSetIdxL0(rIdx) : rIdx % numPocTotalCurr;
-    assert(cIdx >= 0 && cIdx < numPocTotalCurr);
-    m_apcRefPicList[0][rIdx] = rpsCurrList0[ cIdx ];
-    m_bIsUsedAsLongTerm[0][rIdx] = ( cIdx >= NumPocStCurr0 + NumPocStCurr1 );
-  }
-  if ( m_eSliceType != B_SLICE )
-  {
-    m_aiNumRefIdx[1] = 0;
-    ::memset( m_apcRefPicList[1], 0, sizeof(m_apcRefPicList[1]));
-  }
-  else
-  {
-    for (Int rIdx = 0; rIdx < m_aiNumRefIdx[1]; rIdx ++)
-    {
-      cIdx = m_RefPicListModification.getRefPicListModificationFlagL1() ? m_RefPicListModification.getRefPicSetIdxL1(rIdx) : rIdx % numPocTotalCurr;
-      assert(cIdx >= 0 && cIdx < numPocTotalCurr);
-      m_apcRefPicList[1][rIdx] = rpsCurrList1[ cIdx ];
-      m_bIsUsedAsLongTerm[1][rIdx] = ( cIdx >= NumPocStCurr0 + NumPocStCurr1 );
-    }
-  }
-#endif
-}
-
-#endif
-Int TComSlice::getNumRpsCurrTempList()
-{
-  Int numRpsCurrTempList = 0;
-
-  if (m_eSliceType == I_SLICE) 
-  {
-    return 0;
-  }
-  for(UInt i=0; i < m_pcRPS->getNumberOfNegativePictures()+ m_pcRPS->getNumberOfPositivePictures() + m_pcRPS->getNumberOfLongtermPictures(); i++)
-  {
-    if(m_pcRPS->getUsed(i))
-    {
-      numRpsCurrTempList++;
-    }
-  }
-#if H_MV
-#if !H_MV5
-  assert( ( numRpsCurrTempList == 0 ) || getInterRefEnabledInRPLFlag() ); 
-#endif
   numRpsCurrTempList = numRpsCurrTempList + getNumActiveRefLayerPics();
 #endif
@@ -1295,7 +1038,5 @@
 #if H_MV
   // Additional slice header syntax elements 
-#if H_MV5
   m_pocResetFlag               = pSrc->m_pocResetFlag; 
-#endif
   m_discardableFlag            = pSrc->m_discardableFlag; 
   m_interLayerPredEnabledFlag  = pSrc->m_interLayerPredEnabledFlag; 
@@ -1306,15 +1047,4 @@
     m_interLayerPredLayerIdc[ layer ] = pSrc->m_interLayerPredLayerIdc[ layer ]; 
   }
-#if !H_MV5
-  m_interLayerSamplePredOnlyFlag = pSrc->m_interLayerSamplePredOnlyFlag;
-  m_altCollocatedIndicationFlag  = pSrc->m_altCollocatedIndicationFlag ;   
-  m_collocatedRefLayerIdx        = pSrc->m_collocatedRefLayerIdx       ;
-  m_numActiveMotionPredRefLayers = pSrc->m_numActiveMotionPredRefLayers;
-
-  for (Int layer = 0; layer < MAX_NUM_LAYER_IDS; layer++)
-  {    
-    m_interLayerPredLayerIdc[layer] = pSrc->m_interLayerPredLayerIdc[layer];
-  }
-#endif
 #endif
 #if H_3D_IC
@@ -1781,10 +1511,6 @@
 : m_VPSId                     (  0)
 , m_uiMaxTLayers              (  1)
-#if H_MV5
 #if H_MV
 , m_uiMaxLayersMinus1         (  0)
-#else
-, m_uiMaxLayers               (  1)
-#endif
 #else
 , m_uiMaxLayers               (  1)
@@ -1800,8 +1526,6 @@
 , m_hrdOpSetIdx               (NULL)
 , m_cprmsPresentFlag          (NULL)
-#if H_MV5
 #if H_MV
 , m_vpsVUI                 (  NULL )
-#endif
 #endif
 {
@@ -1848,16 +1572,10 @@
 
   m_avcBaseLayerFlag = false;
-#if H_MV5
   m_vpsVuiOffset     = 0; 
-#endif
   m_splittingFlag    = false;
   
   for( Int i = 0; i < MAX_NUM_SCALABILITY_TYPES; i++ )
   {
-#if H_MV5
     m_scalabilityMaskFlag[i] = false;
-#else
-    m_scalabilityMask[i] = false;
-#endif
     m_dimensionIdLen [i]  = -1; 
   }
@@ -1885,12 +1603,8 @@
     m_layerIdInNuh      [i] = ( i == 0 ) ? 0 : -1; 
     m_numDirectRefLayers[i] = 0; 
-#if H_MV5
     m_maxTidIlRefPicPlus1[i] = 7;
     m_vpsRepFormatIdx    [i] = 0; 
     m_repFormat          [i] = NULL; 
     m_viewIdVal          [i] = 0; 
-#else
-    m_maxTidIlRefPicPlus1[i] = -1; 
-#endif
 
 #if H_3D
@@ -1935,7 +1649,5 @@
 #endif
   }
-#if H_MV5
   m_vpsVUI = new TComVPSVUI; 
-#endif
 #if H_3D
   for( Int i = 0; i < MAX_NUM_LAYERS; i++ )
@@ -1963,5 +1675,4 @@
   if( m_hrdOpSetIdx      != NULL )     delete[] m_hrdOpSetIdx;
   if( m_cprmsPresentFlag != NULL )     delete[] m_cprmsPresentFlag;
-#if H_MV5
 #if H_MV
   if ( m_vpsVUI          != NULL )     delete m_vpsVUI; 
@@ -1983,23 +1694,4 @@
 #endif
   }
-#endif
-#else
-#if H_3D_DIM_DLT
-  for( Int i = 0; i < MAX_NUM_LAYERS; i++ )
-  {
-    if ( m_iDepthValue2Idx[i] != 0 ) 
-    {
-       xFree( m_iDepthValue2Idx[i] );
-       m_iDepthValue2Idx[i] = 0; 
-    }
-
-    if ( m_iIdx2DepthValue[i] != 0 ) 
-    {
-      xFree( m_iIdx2DepthValue[i] );
-      m_iIdx2DepthValue[i] = 0; 
-
-    }
-  }
-#endif
 #endif
 }
@@ -2072,9 +1764,5 @@
 Bool TComVPS::checkVPSExtensionSyntax()
 {
-#if H_MV5
   for( Int layer = 1; layer <= getMaxLayersMinus1(); layer++ )
-#else
-  for( Int layer = 1; layer < getMaxLayers(); layer++ )
-#endif
   {
     // check layer_id_in_nuh constraint
@@ -2092,17 +1780,9 @@
 {
   assert( scalType >= 0 && scalType <= MAX_NUM_SCALABILITY_TYPES ); 
-#if H_MV5
   assert( scalType == MAX_NUM_SCALABILITY_TYPES || getScalabilityMaskFlag( scalType ) );
-#else
-  assert( scalType == MAX_NUM_SCALABILITY_TYPES || getScalabilityMask( scalType ) );
-#endif
   Int scalIdx = 0; 
   for( Int curScalType = 0; curScalType < scalType; curScalType++ )
   {
-#if H_MV5
     scalIdx += ( getScalabilityMaskFlag( curScalType ) ? 1 : 0 );
-#else
-    scalIdx += ( getScalabilityMask( curScalType ) ? 1 : 0 );
-#endif
 
   }
@@ -2110,5 +1790,4 @@
   return scalIdx; 
 }
-#if H_MV5
 Void TComVPS::setScalabilityMaskFlag( UInt val )
 {
@@ -2118,14 +1797,5 @@
   }
 }
-#else
-Void TComVPS::setScalabilityMask( UInt val )
-{
-  for ( Int scalType = 0; scalType < MAX_NUM_SCALABILITY_TYPES; scalType++ ) 
-    setScalabilityMask( scalType, ( val & (1 << scalType ) ) != 0 );
-}
-
-#endif
-
-#if H_MV5
+
 Void TComVPS::setRefLayers()
 {
@@ -2176,124 +1846,4 @@
 }
 #endif // H_3D
-#else
-Void TComVPS::setRefLayers()
-{
-  for( Int i = 0; i < MAX_NUM_LAYERS; i++ ) 
-  { 
-    m_numSamplePredRefLayers[ i ] = 0;
-    m_numMotionPredRefLayers[ i ] = 0;
-    m_numDirectRefLayers[ i ] = 0; 
-    for( Int j = 0; j < MAX_NUM_LAYERS; j++ ) {
-      m_samplePredEnabledFlag[ i ][ j ] = 0;
-      m_motionPredEnabledFlag[ i ][ j ] = 0;
-      m_refLayerId[ i ][ j ] = 0;
-      m_samplePredRefLayerId[ i ][ j ] = 0;
-      m_motionPredRefLayerId[ i ][ j ] = 0;
-    }
-  }
-
-  for( Int i = 1; i  <= getMaxLayers()- 1; i++ )
-  {
-    for( Int j = 0; j < i; j++ )
-    {
-      if( getDirectDependencyFlag(i,j) )
-      {
-        m_refLayerId[ i ][m_numDirectRefLayers[ i ]++ ] = getLayerIdInNuh( j );
-
-        m_samplePredEnabledFlag [ i ][ j ]  = ( (   getDirectDependencyType( i , j ) + 1 ) & 1 ) == 1;
-        m_numSamplePredRefLayers[ i ]      += m_samplePredEnabledFlag [ i ][ j ] ? 1 : 0; 
-        m_motionPredEnabledFlag [ i ][ j ]  = ( ( ( getDirectDependencyType( i , j ) + 1 ) & 2 ) >> 1 ) == 1;
-        m_numMotionPredRefLayers[ i ]      += m_motionPredEnabledFlag  [ i][ j ] ? 1 : 0; 
-      }
-    }
-  }
-
-  for( Int i = 1, mIdx = 0, sIdx = 0; i <= getMaxLayers()- 1; i++ )
-  {    
-    for( Int j = 0 ; j < i; j++ )
-    {
-      if( m_motionPredEnabledFlag[ i ][ j ] )
-      {
-        m_motionPredRefLayerId[ i ][ mIdx++ ] = getLayerIdInNuh( j );
-      }
-      
-      if( m_samplePredEnabledFlag[ i ][ j ] )
-      {
-        m_samplePredRefLayerId[ i ][ sIdx++ ] = getLayerIdInNuh( j );
-      }
-    }
-  }
-}
-
-Int TComVPS::getRefLayerId( Int layerIdInVps, Int idx )
-{
-  assert( idx >= 0 && idx < m_numDirectRefLayers[layerIdInVps] );     
-  Int layerIdInNuh = m_refLayerId[ layerIdInVps ][ idx ];    
-  assert ( layerIdInNuh >= 0 ); 
-  return layerIdInNuh;
-}
-
-Int TComVPS::getScalabilityId( Int layerIdInVps, ScalabilityType scalType )
-{
-  return getScalabilityMask( scalType ) ? getDimensionId( layerIdInVps, scalTypeToScalIdx( scalType ) ) : 0;
-}
-
-#if H_3D
-Void TComVPS::initViewIndex()
-{
-  Int viewIdList   [ MAX_NUM_LAYERS ]; // ed. should be changed to MAX_VIEW_ID
-  Int viewIndexList[ MAX_NUM_LAYERS ]; 
-  Int numViewIds = 0; 
-
-  for ( Int i = 0 ; i  <  m_uiMaxLayers; i++ )
-  {     
-    Int currViewId = getViewId( i ); 
-
-    Bool viewIdInListFlag = false; 
-    for ( Int j = 0; j < numViewIds; j ++ )
-    {
-      viewIdInListFlag  = viewIdInListFlag || ( currViewId  == viewIdList[ j ]  );
-    }
-
-    if ( !viewIdInListFlag ) 
-    {
-      viewIdList   [ numViewIds ] = currViewId;
-      viewIndexList[ currViewId ] = numViewIds;
-
-      numViewIds++;
-    }  
-
-    m_viewIndex[ i ] = viewIndexList[ currViewId ]; 
-  }
-}
-
-Int TComVPS::getLayerIdInNuh( Int viewIndex, Bool depthFlag )
-{
-  Int foundlayerId = -1; 
-
-  for (Int layer = 0 ; layer < m_uiMaxLayers; layer++ )
-  {
-    if( ( getViewIndex( layer ) == viewIndex ) && ( getDepthId( layer ) == ( depthFlag ? 1 : 0 ) )  )
-    {
-      foundlayerId = layer; 
-      break; 
-    }
-  }
-  assert( foundlayerId != -1 ); 
-
-  return getLayerIdInNuh( foundlayerId );
-}
-
-#endif // H_3D
-
-Int TComVPS::xCeilLog2( Int val )
-{
-  assert( val > 0 ); 
-  Int ceilLog2 = 0;
-  while( val > ( 1 << ceilLog2 ) ) ceilLog2++;
-  return ceilLog2;
-}
-
-#endif // H_MV5
 
 
@@ -2336,5 +1886,4 @@
   return numLayersInIdList;
 }
-#if H_MV5
 Int TComVPS::getNumViews()
 {
@@ -2366,5 +1915,4 @@
   return dependentFlag;
 }
-#endif
 #endif // H_MV
 
@@ -2417,5 +1965,4 @@
 , m_vuiParameters             ()
 #if H_MV
-#if H_MV5
 , m_pcVPS                     ( NULL )
 , m_spsInferScalingListFlag   ( false )
@@ -2423,8 +1970,4 @@
 , m_updateRepFormatFlag       ( true ) 
 , m_interViewMvVertConstraintFlag (false)
-#else
-, m_interViewMvVertConstraintFlag (false)
-, m_numIlpRestrictedRefLayers ( 0 )
-#endif
 #endif
 #if H_3D
@@ -2441,14 +1984,4 @@
   ::memset(m_ltRefPicPocLsbSps, 0, sizeof(m_ltRefPicPocLsbSps));
   ::memset(m_usedByCurrPicLtSPSFlag, 0, sizeof(m_usedByCurrPicLtSPSFlag));
-#if !H_MV5
-#if H_MV
-  for (Int i = 0; i < MAX_NUM_LAYERS; i++ )
-  {
-    m_minSpatialSegmentOffsetPlus1[ i ] = 0;
-    m_ctuBasedOffsetEnabledFlag   [ i ] = false;
-    m_minHorizontalCtuOffsetPlus1 [ i ] = 0;
-  }
-#endif
-#endif
 }
 
@@ -2603,10 +2136,8 @@
 , m_listsModificationPresentFlag(  0)
 , m_numExtraSliceHeaderBits(0)
-#if H_MV5
 #if H_MV
 , m_ppsInferScalingListFlag(false)
 , m_ppsScalingListRefLayerId(0)
 #endif
-#endif
 {
   m_scalingList = new TComScalingList;
@@ -2628,5 +2159,4 @@
 }
 
-#if H_MV5
 #if H_MV
 Void TComSPS::inferRepFormat( TComVPS* vps, Int layerIdCurr )
@@ -2679,5 +2209,4 @@
   }
 }
-#endif
 #endif
 #if H_3D
@@ -2950,5 +2479,4 @@
 
 #if H_MV
-#if H_MV5
 Void TComSlice::createInterLayerReferencePictureSet( TComPicLists* ivPicLists, std::vector<TComPic*>& refPicSetInterLayer0, std::vector<TComPic*>& refPicSetInterLayer1 )
 {
@@ -2982,27 +2510,5 @@
   }
 }
-#else
-Void TComSlice::createAndApplyIvReferencePictureSet( TComPicLists* ivPicLists, std::vector<TComPic*>& refPicSetInterLayer )
-{
-  refPicSetInterLayer.clear(); 
-
-  for( Int i = 0; i < getNumActiveRefLayerPics(); i++ ) 
-  {
-    Int layerIdRef = getRefPicLayerId( i ); 
-    TComPic* picRef = ivPicLists->getPic( layerIdRef, getPOC() ) ; 
-    assert ( picRef != 0 ); 
-
-    picRef->getPicYuvRec()->extendPicBorder(); 
-    picRef->setIsLongTerm( true );        
-    picRef->getSlice(0)->setReferenced( true );       
-
-    // Consider to check here: 
-    // "If the current picture is a RADL picture, there shall be no entry in the RefPicSetInterLayer that is a RASL picture. "
-    refPicSetInterLayer.push_back( picRef ); 
-  }
-}
-#endif
-
-#if H_MV5
+
 Void TComSlice::markIvRefPicsAsShortTerm( std::vector<TComPic*> refPicSetInterLayer0, std::vector<TComPic*> refPicSetInterLayer1 )
 {
@@ -3019,15 +2525,4 @@
 
 }
-#else
-Void TComSlice::markIvRefPicsAsShortTerm( std::vector<TComPic*> refPicSetInterLayer )
-{
-  // Mark as shortterm 
-  for ( Int i = 0; i < refPicSetInterLayer.size(); i++ ) 
-  {
-    refPicSetInterLayer[i]->setIsLongTerm( false ); 
-  }
-}
-
-#endif
 Void TComSlice::markIvRefPicsAsUnused( TComPicLists* ivPicLists, std::vector<Int> targetDecLayerIdSet, TComVPS* vps, Int curLayerId, Int curPoc )
 {
@@ -3035,9 +2530,5 @@
   if (targetDecLayerIdSet.size() == 0 )    
   {
-#if H_MV5
     for ( Int layerIdInVps = 0; layerIdInVps <= vps->getMaxLayersMinus1(); layerIdInVps++ )
-#else
-    for ( Int layerIdInVps = 0; layerIdInVps < vps->getMaxLayers(); layerIdInVps++ )
-#endif
     {
       targetDecLayerIdSet.push_back( vps->getLayerIdInNuh( layerIdInVps ) ); 
@@ -3068,14 +2559,7 @@
           if ( vps->nuhLayerIdIncluded( targetDecLayerIdSet[ j ] ) )
           {
-#if H_MV5
             for( Int k = 0; k < vpsSlice->getNumDirectRefLayers( targetDecLayerIdSet[ j ] ); k++ )
             {
               if ( targetDecLayerIdSet[ i ] == vpsSlice->getRefLayerId( targetDecLayerIdSet[ j ],  k  ) )
-#else
-            Int targetDecLayerIdinVPS = vpsSlice->getLayerIdInVps( targetDecLayerIdSet[ j ] ); 
-            for( Int k = 0; k < vpsSlice->getNumDirectRefLayers( targetDecLayerIdinVPS ); k++ )
-            {
-              if ( targetDecLayerIdSet[ i ] == vpsSlice->getRefLayerId( targetDecLayerIdinVPS,  k  ) )
-#endif
               {
                 remainingInterLayerReferencesFlag = true;
@@ -3093,9 +2577,5 @@
 }
 
-#if H_MV5
 Void TComSlice::printRefPicList()
-#else
-Void TComSlice::xPrintRefPicList()
-#endif
 {  
   for ( Int li = 0; li < 2; li++)
@@ -3110,13 +2590,4 @@
   }
 }
-#if !H_MV5
-Int TComSlice::xCeilLog2( Int val )
-{
-  assert( val > 0 ); 
-  Int ceilLog2 = 0;
-  while( val > ( 1 << ceilLog2 ) ) ceilLog2++;
-  return ceilLog2;
-}
-#endif
 
 Void TComSlice::markCurrPic( TComPic* currPic )
@@ -3133,5 +2604,4 @@
 }
 
-#if H_MV5
 Void TComSlice::setRefPicSetInterLayer( std::vector<TComPic*>* refPicSetInterLayer0, std::vector<TComPic*>* refPicSetInterLayer1 )
 {
@@ -3158,31 +2628,8 @@
   return pcPic;
 }
-#else
-Void TComSlice::setRefPicSetInterLayer( std::vector<TComPic*>* refPicSetInterLayer )
-{
-  m_refPicSetInterLayer = refPicSetInterLayer; 
-}
-
-TComPic* TComSlice::getPicFromRefPicSetInterLayer( Int layerId )
-{
-  assert( m_refPicSetInterLayer != 0 ); 
-  assert( (*m_refPicSetInterLayer).size() == getNumActiveRefLayerPics() ); 
-  TComPic* pcPic = NULL; 
-  for ( Int i = 0; i < getNumActiveRefLayerPics(); i++ )
-  {
-    if ((*m_refPicSetInterLayer)[ i ]->getLayerId() == layerId)
-    {
-      pcPic = (*m_refPicSetInterLayer)[ i ]; 
-    }
-  }
-  assert(pcPic != NULL); 
-  return pcPic;
-}
-#endif
 Int TComSlice::getNumActiveRefLayerPics()
 {
   Int numActiveRefLayerPics; 
 
-#if H_MV5
   if( getLayerId() == 0 || getVPS()->getNumDirectRefLayers( getLayerId() ) ==  0 )
   {
@@ -3198,11 +2645,4 @@
   }
   else if( getVPS()->getMaxOneActiveRefLayerFlag() || getVPS()->getNumDirectRefLayers( getLayerId() ) == 1 )
-#else
-  if( getLayerId() == 0 || getVPS()->getNumDirectRefLayers( getLayerIdInVps() ) ==  0 || !getInterLayerPredEnabledFlag() )
-  {
-    numActiveRefLayerPics = 0; 
-  }
-  else if( getVPS()->getMaxOneActiveRefLayerFlag() || getVPS()->getNumDirectRefLayers( getLayerIdInVps() ) == 1 )
-#endif
   {
     numActiveRefLayerPics = 1; 
@@ -3217,41 +2657,7 @@
 Int TComSlice::getRefPicLayerId( Int i )
 {
-#if H_MV5
   return getVPS()->getRefLayerId( getLayerId(), getInterLayerPredLayerIdc( i ) );
-#else
-  return getVPS()->getRefLayerId( getLayerIdInVps(), getInterLayerPredLayerIdc( i ) );
-#endif
-}
-
-#if !H_MV5
-Void TComSlice::setActiveMotionPredRefLayers()
-{
-  Int j = 0; 
-  for( Int i = 0; i < getNumActiveRefLayerPics(); i++)
-  {
-    if( getVPS()->getMotionPredEnabledFlag( getLayerIdInVps(), getInterLayerPredLayerIdc( i ))  )
-    {
-      m_activeMotionPredRefLayerId[ j++ ] = getVPS()->getRefLayerId( getLayerIdInVps(), i ); 
-    }
-  }
-  m_numActiveMotionPredRefLayers = j;
-
-  // Consider incorporating bitstream conformance tests on derived variables here.
-}
-
-Bool TComSlice::getInterRefEnabledInRPLFlag()
-{
-  Bool interRefEnabledInRPLFlag; 
-  if ( getVPS()->getNumSamplePredRefLayers( getLayerIdInVps() ) > 0 && getNumActiveRefLayerPics() > 0 )
-  {
-    interRefEnabledInRPLFlag = !getInterLayerSamplePredOnlyFlag(); 
-  }
-  else
-  {
-    interRefEnabledInRPLFlag = 1; 
-  }
-  return interRefEnabledInRPLFlag;
-}
-#endif
+}
+
 #if H_3D_ARP
 Void TComSlice::setARPStepNum()                                  
@@ -3531,5 +2937,4 @@
 }
 
-#if H_MV5
 #if H_MV
 Void TComScalingList::inferFrom( TComScalingList* srcScLi )
@@ -3545,5 +2950,4 @@
   }
 }
-#endif
 #endif
 /** initialization process of quantization matrix array
@@ -3636,5 +3040,4 @@
 , m_ppsMap(MAX_NUM_PPS)
 , m_activeVPSId(-1)
-#if H_MV5
 #if !H_MV
 , m_activeSPSId(-1)
@@ -3649,9 +3052,4 @@
   }
 #endif
-#else
-, m_activeSPSId(-1)
-, m_activePPSId(-1)
-{
-#endif
 }
 
@@ -3663,5 +3061,4 @@
 //! activate a SPS from a active parameter sets SEI message
 //! \returns true, if activation is successful
-#if H_MV5
 #if H_MV
 Bool ParameterSetManager::activateSPSWithSEI(Int spsId, Int layerId )
@@ -3669,7 +3066,4 @@
 Bool ParameterSetManager::activateSPSWithSEI(Int spsId)
 #endif
-#else
-Bool ParameterSetManager::activateSPSWithSEI(Int spsId)
-#endif
 {
   TComSPS *sps = m_spsMap.getPS(spsId);
@@ -3680,7 +3074,4 @@
     {
       m_activeVPSId = vpsId;
-#if !H_MV5
-      m_activeSPSId = spsId;
-#else
 #if H_MV
       m_activeSPSId[ layerId ] = spsId;
@@ -3688,5 +3079,4 @@
       m_activeSPSId = spsId;
 #endif
-#endif
       return true;
     }
@@ -3705,5 +3095,4 @@
 //! activate a PPS and depending on isIDR parameter also SPS and VPS
 //! \returns true, if activation is successful
-#if H_MV5
 #if H_MV
 Bool ParameterSetManager::activatePPS(Int ppsId, Bool isIRAP, Int layerId )
@@ -3742,35 +3131,4 @@
         m_activeSPSId[ layerId ] = spsId;
 #else
-        m_activePPSId = ppsId;
-        m_activeVPSId = vpsId;
-        m_activeSPSId = spsId;
-#endif
-#else
-Bool ParameterSetManager::activatePPS(Int ppsId, Bool isIRAP)
-{
-  TComPPS *pps = m_ppsMap.getPS(ppsId);
-  if (pps)
-  {
-    Int spsId = pps->getSPSId();
-#if H_MV
-    // active parameter sets per layer should be used here
-#else
-    if (!isIRAP && (spsId != m_activeSPSId))
-    {
-      printf("Warning: tried to activate PPS referring to a inactive SPS at non-IRAP.");
-      return false;
-    }
-#endif
-    TComSPS *sps = m_spsMap.getPS(spsId);
-    if (sps)
-    {
-      Int vpsId = sps->getVPSId();
-      if (!isIRAP && (vpsId != m_activeVPSId))
-      {
-        printf("Warning: tried to activate PPS referring to a inactive VPS at non-IRAP.");
-        return false;
-      }
-      if (m_vpsMap.getPS(vpsId))
-      {
         m_activePPSId = ppsId;
         m_activeVPSId = vpsId;
@@ -3828,5 +3186,4 @@
 //! \}
 
-#if H_MV5
 #if H_MV
 TComVPSVUI::TComVPSVUI()
@@ -3861,3 +3218,2 @@
 }
 #endif
-#endif
Index: branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComSlice.h
===================================================================
--- branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComSlice.h	(revision 647)
+++ branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TComSlice.h	(revision 648)
@@ -169,8 +169,6 @@
   Void     processRefMatrix               (UInt sizeId, UInt listId , UInt refListId );
   Bool     xParseScalingList              (Char* pchFile);
-#if H_MV5
 #if H_MV
   Void     inferFrom                      ( TComScalingList* srcScLi );
-#endif
 #endif
 
@@ -407,5 +405,4 @@
 };
 
-#if H_MV5
 #if H_MV
 class TComVPSVUI
@@ -502,5 +499,4 @@
 };
 #endif
-#endif
 
 class TComVPS
@@ -510,10 +506,6 @@
   UInt        m_uiMaxTLayers;
 
-#if H_MV5
 #if H_MV
   UInt        m_uiMaxLayersMinus1;
-#else
-  UInt        m_uiMaxLayers;
-#endif
 #else
   UInt        m_uiMaxLayers;
@@ -551,29 +543,17 @@
   /// VPS EXTENSION SYNTAX ELEMENTS
   Bool        m_avcBaseLayerFlag;
-#if H_MV5
   Int         m_vpsVuiOffset;
-#endif
   Bool        m_splittingFlag;
-#if H_MV5
   Bool        m_scalabilityMaskFlag          [MAX_NUM_SCALABILITY_TYPES];
-#else
-  Bool        m_scalabilityMask          [MAX_NUM_SCALABILITY_TYPES];
-#endif
   Int         m_dimensionIdLen           [MAX_NUM_SCALABILITY_TYPES];
   Bool        m_vpsNuhLayerIdPresentFlag;
   Int         m_layerIdInNuh             [MAX_NUM_LAYER_IDS];
   Int         m_dimensionId              [MAX_NUM_LAYER_IDS][MAX_NUM_SCALABILITY_TYPES];  
-#if H_MV5
   Int         m_viewIdLenMinus1;
   Int         m_viewIdVal                [MAX_NUM_LAYERS];
-#endif
   Bool        m_directDependencyFlag     [MAX_NUM_LAYER_IDS][MAX_NUM_LAYER_IDS];
-#if H_MV5
   Bool        m_maxTidRefPresentFlag;
-#endif
   Int         m_maxTidIlRefPicPlus1      [MAX_NUM_LAYERS];
-#if H_MV5
   Bool        m_allRefLayersActiveFlag;
-#endif
   Int         m_vpsNumberLayerSetsMinus1; 
   Int         m_vpsNumProfileTierLevelMinus1;   
@@ -586,19 +566,13 @@
   Bool        m_outputLayerFlag          [MAX_VPS_OUTPUTLAYER_SETS][MAX_VPS_NUH_LAYER_ID_PLUS1];
   Int         m_profileLevelTierIdx      [MAX_VPS_OUTPUTLAYER_SETS ];
-#if H_MV5
   Bool        m_repFormatIdxPresentFlag;
   Int         m_vpsNumRepFormatsMinus1;
   Int         m_vpsRepFormatIdx          [MAX_NUM_LAYERS];
   TComRepFormat* m_repFormat             [MAX_NUM_LAYERS]; 
-#endif
   Bool        m_maxOneActiveRefLayerFlag;       
-#if H_MV5
   Bool        m_crossLayerIrapAlignedFlag;
-#endif
   Int         m_directDepTypeLenMinus2;         
-#if H_MV5
   Bool        m_vpsVuiPresentFlag;
   TComVPSVUI* m_vpsVUI; 
-#endif
   Int         m_directDependencyType     [MAX_NUM_LAYERS] [MAX_NUM_LAYERS];
 
@@ -616,13 +590,5 @@
   Bool        m_motionPredEnabledFlag    [MAX_NUM_LAYERS][MAX_NUM_LAYERS];
   Int         m_motionPredRefLayerId     [MAX_NUM_LAYERS][MAX_NUM_LAYERS];
-#if H_MV5
   Int         m_viewIndex                [MAX_NUM_LAYERS   ];
-#else
-#if H_3D
-  Int         m_viewIndex                [MAX_NUM_LAYERS   ];
-#endif
-
-  Int         xCeilLog2       ( Int val );
-#endif
   Int         xGetDimBitOffset( Int j );
   
@@ -681,5 +647,4 @@
   Void    setMaxTLayers  (UInt t)             { m_uiMaxTLayers = t; }
   
-#if H_MV5
 #if H_MV    
   UInt    getMaxLayersMinus1()                { return m_uiMaxLayersMinus1;  }; 
@@ -689,8 +654,4 @@
   Void    setMaxLayers   (UInt l)             { m_uiMaxLayers = l; }
 #endif
-#else
-  UInt    getMaxLayers   ()                   { return m_uiMaxLayers;   }
-  Void    setMaxLayers   (UInt l)             { m_uiMaxLayers = l; }
-#endif
 
   Bool    getTemporalNestingFlag   ()         { return m_bTemporalIdNestingFlag;   }
@@ -735,22 +696,13 @@
   Bool    getAvcBaseLayerFlag()                                            { return m_avcBaseLayerFlag; } 
 
-#if H_MV5
   Void    setVpsVuiOffset( Int  val )                                      { m_vpsVuiOffset = val; } 
   Int     getVpsVuiOffset(  )                                              { return m_vpsVuiOffset; } 
-#endif
 
   Void    setSplittingFlag( Bool val )                                     { m_splittingFlag = val;  }
   Bool    getSplittingFlag()                                               { return m_splittingFlag; }
 
-#if H_MV5
   Void    setScalabilityMaskFlag( UInt val );
   Void    setScalabilityMaskFlag( Int scalType, Bool val )                     { m_scalabilityMaskFlag[scalType] = val;  }
   Bool    getScalabilityMaskFlag( Int scalType )                               { return m_scalabilityMaskFlag[scalType]; }
-#else
-  Void    setScalabilityMask( UInt val );
-
-  Void    setScalabilityMask( Int scalType, Bool val )              { m_scalabilityMask[scalType] = val;  }
-  Bool    getScalabilityMask( Int scalType )                        { return m_scalabilityMask[scalType]; }
-#endif
   Int     getNumScalabilityTypes( );
 
@@ -769,5 +721,4 @@
   Int     getDimensionId( Int layerIdInVps, Int scalIdx )                  { return m_dimensionId[layerIdInVps][scalIdx]; }
 
-#if H_MV5
   Void    setViewIdLenMinus1( Int  val )                                   { m_viewIdLenMinus1 = val; } 
   Int     getViewIdLenMinus1(  )                                           { return m_viewIdLenMinus1; } 
@@ -775,18 +726,13 @@
   Void    setViewIdVal( Int viewOrderIndex, Int  val )                     { m_viewIdVal[viewOrderIndex] = val; } 
   Int     getViewIdVal( Int viewOrderIndex )                               { return m_viewIdVal[viewOrderIndex]; } 
-#endif
   Void    setDirectDependencyFlag( Int depLayeridInVps, Int refLayeridInVps, Bool val ) { m_directDependencyFlag[depLayeridInVps][refLayeridInVps] = val;  }
   Bool    getDirectDependencyFlag( Int depLayeridInVps, Int refLayeridInVps )           { return m_directDependencyFlag[depLayeridInVps][refLayeridInVps]; }
 
-#if H_MV5
   Void    setMaxTidRefPresentFlag( Bool flag )                             { m_maxTidRefPresentFlag = flag; } 
   Bool    getMaxTidRefPresentFlag(  )                                      { return m_maxTidRefPresentFlag; } 
-#endif
   Void    setMaxTidIlRefPicPlus1( Int layerIdInVps, Int val )              { m_maxTidIlRefPicPlus1[ layerIdInVps ] = val;  } 
   Int     getMaxTidIlRefPicPlus1( Int layerIdInVps )                       { return m_maxTidIlRefPicPlus1[ layerIdInVps ]; } 
-#if H_MV5
   Void    setAllRefLayersActiveFlag( Bool flag )                           { m_allRefLayersActiveFlag = flag; } 
   Bool    getAllRefLayersActiveFlag(  )                                    { return m_allRefLayersActiveFlag; } 
-#endif
   Void    setVpsNumberLayerSetsMinus1( Int val )                           { m_vpsNumberLayerSetsMinus1 = val;  } 
   Int     getVpsNumberLayerSetsMinus1( )                                   { return m_vpsNumberLayerSetsMinus1; } 
@@ -819,5 +765,4 @@
   Int     getProfileLevelTierIdx( Int outLayerSetIdx )                     { return m_profileLevelTierIdx[ outLayerSetIdx ]; } 
 
-#if H_MV5
   Void    setRepFormatIdxPresentFlag( Bool flag )                          { m_repFormatIdxPresentFlag = flag; } 
   Bool    getRepFormatIdxPresentFlag(  )                                   { return m_repFormatIdxPresentFlag; } 
@@ -831,11 +776,8 @@
   Void    setRepFormat( Int i, TComRepFormat* val )                        { m_repFormat[i] = val;  }
   TComRepFormat* getRepFormat( Int i )                                     { return m_repFormat[i]; }
-#endif
   Void    setMaxOneActiveRefLayerFlag( Bool flag)                          { m_maxOneActiveRefLayerFlag = flag; } 
   Bool    getMaxOneActiveRefLayerFlag( )                                   { return m_maxOneActiveRefLayerFlag; } 
-#if H_MV5
   Void    setCrossLayerIrapAlignedFlag( Bool flag )                        { m_crossLayerIrapAlignedFlag = flag; } 
   Bool    getCrossLayerIrapAlignedFlag(  )                                 { return m_crossLayerIrapAlignedFlag; } 
-#endif
   Void    setDirectDepTypeLenMinus2( Int val)                              { m_directDepTypeLenMinus2 = val; } 
   Int     getDirectDepTypeLenMinus2( )                                     { return m_directDepTypeLenMinus2; } 
@@ -843,10 +785,8 @@
   Void    setDirectDependencyType( Int depLayeridInVps, Int refLayeridInVps, Int val) { m_directDependencyType[ depLayeridInVps ][ refLayeridInVps ] = val; } 
   Int     getDirectDependencyType( Int depLayeridInVps, Int refLayeridInVps)   { return m_directDependencyType[ depLayeridInVps ][ refLayeridInVps ]; } 
-#if H_MV5  
   Void    setVpsVuiPresentFlag( Bool flag )                                { m_vpsVuiPresentFlag = flag; } 
   Bool    getVpsVuiPresentFlag(  )                                         { return m_vpsVuiPresentFlag; } 
 
   TComVPSVUI* getVPSVUI(  )                                                { return m_vpsVUI;  }
-#endif
   // VPS EXTENSION SEMANTICS VARIABLES
   Void    setLayerIdInVps( Int layerIdInNuh, Int val )                     { m_layerIdInVps[layerIdInNuh] = val;  }
@@ -854,13 +794,7 @@
 
   Int     getScalabilityId ( Int layerIdInVps, ScalabilityType scalType );
-#if H_MV5
   Int     getViewId        ( Int layerIdInNuh )                            { return m_viewIdVal[ getViewIndex( getLayerIdInVps( layerIdInNuh) )]; }
-#else
-  Int     getViewId  ( Int layerIdInVps )                                  { return getScalabilityId( layerIdInVps, VIEW_ID  ); }
-
-#endif
   Void    setRefLayers(); 
 
-#if H_MV5
   Int     getViewIndex    ( Int layerIdInNuh )                             { return getScalabilityId( getLayerIdInVps(layerIdInNuh), VIEW_ORDER_INDEX  ); }    
   Int     getNumViews();
@@ -868,24 +802,8 @@
   Int     getNumDirectRefLayers( Int layerIdInNuh )                        { return m_numDirectRefLayers[ layerIdInNuh ];  };                               
   Int     getRefLayerId        ( Int layerIdInNuh, Int idx );; 
-#else
-  Int     getNumDirectRefLayers( Int layerIdInVps )          { return m_numDirectRefLayers[ layerIdInVps ];  };                               
-  Int     getRefLayerId        ( Int layerIdInVps, Int idx );; 
-  
-  Int     getNumSamplePredRefLayers( Int layerIdInVps )          { return m_numSamplePredRefLayers[layerIdInVps]; } 
-  Bool    getSamplePredEnabledFlag ( Int layerIdInVps, Int idx ) { return m_samplePredEnabledFlag [layerIdInVps][idx]; } 
-  Int     getSamplePredRefLayerId  ( Int layerIdInVps, Int idx ) { return m_samplePredRefLayerId  [layerIdInVps][idx]; } 
-
-  Int     getNumMotionPredRefLayers( Int layerIdInVps )          { return m_numMotionPredRefLayers[layerIdInVps]; } 
-  Bool    getMotionPredEnabledFlag ( Int layerIdInVps, Int idx ) { return m_motionPredEnabledFlag [layerIdInVps][idx]; } 
-  Int     getMotionPredRefLayerId  ( Int layerIdInVps, Int idx ) { return m_motionPredRefLayerId  [layerIdInVps][idx]; } 
-#endif  
   Bool    checkVPSExtensionSyntax(); 
   Int     scalTypeToScalIdx   ( ScalabilityType scalType );
 
-  #if H_MV5
 Int     getProfileLevelTierIdxLen()                                      { return gCeilLog2( getVpsNumProfileTierLevelMinus1() + 1 ); };       
-#else
-  Int     getProfileLevelTierIdxLen() { return xCeilLog2( getVpsNumProfileTierLevelMinus1() + 1 ); };       
-#endif
 
   Int     getNumLayersInIdList              ( Int lsIdx );; 
@@ -895,17 +813,9 @@
   Int     inferLastDimsionIdLenMinus1();
 
-#if H_MV5
   // helpers
   Bool    getInDirectDependencyFlag( Int depLayeridInVps, Int refLayeridInVps, Int depth = 0 );
-#endif
   /// VPS EXTENSION 2 SYNTAX ELEMENTS
 #if H_3D  
-#if H_MV5
   Int     getDepthId      ( Int layerIdInNuh)                             { return getScalabilityId( getLayerIdInVps(layerIdInNuh), DEPTH_ID ); }
-#else
-  Void    initViewIndex(); 
-  Int     getViewIndex    ( Int layerIdInVps )                             { return m_viewIndex[ layerIdInVps ]; }    
-  Int     getDepthId      ( Int layerIdInVps )                             { return getScalabilityId( layerIdInVps, DEPTH_ID ); }
-#endif
   Int     getLayerIdInNuh( Int viewIndex, Bool depthFlag );   
 
@@ -960,8 +870,6 @@
   Int           m_winTopOffset;
   Int           m_winBottomOffset;
-#if H_MV5
 #if H_MV
   Bool          m_scaledFlag; 
-#endif
 #endif
 public:
@@ -972,8 +880,6 @@
   , m_winTopOffset      (0)
   , m_winBottomOffset   (0)
-#if H_MV5
 #if H_MV
   , m_scaledFlag(true)
-#endif
 #endif
   { }
@@ -990,5 +896,4 @@
   Void          setWindowBottomOffset(Int val)    { m_winBottomOffset = val; m_enabledFlag = true; }
 
-#if H_MV5
 #if H_MV
   Void          setScaledFlag(Bool flag)          { m_scaledFlag = flag;  } 
@@ -1005,5 +910,4 @@
     }
   }
-#endif
 #endif
   Void          setWindow(Int offsetLeft, Int offsetLRight, Int offsetLTop, Int offsetLBottom)
@@ -1054,9 +958,4 @@
   TComHRD m_hrdParameters;
   TimingInfo m_timingInfo;
-#if !H_MV5
-#if H_MV
-  Bool m_tileBoundariesAlignedFlag;
-#endif
-#endif
 
 public:
@@ -1091,9 +990,4 @@
     ,m_log2MaxMvLengthHorizontal(15)
     ,m_log2MaxMvLengthVertical(15)
-#if !H_MV5
-#if H_MV
-    ,m_tileBoundariesAlignedFlag(true)
-#endif
-#endif
   {}
 
@@ -1191,10 +1085,4 @@
   TComHRD* getHrdParameters                 ()             { return &m_hrdParameters; }
   TimingInfo* getTimingInfo() { return &m_timingInfo; }
-#if !H_MV5
-#if H_MV
-Bool getTileBoundariesAlignedFlag(  ) { return m_tileBoundariesAlignedFlag; } 
-  Void setTileBoundariesAlignedFlag( Bool flag ) { m_tileBoundariesAlignedFlag = flag; } 
-#endif
-#endif
 
 };
@@ -1281,5 +1169,4 @@
   TComPTL     m_pcPTL;
 #if H_MV
-#if H_MV5
   TComVPS*    m_pcVPS; 
   // SPS 
@@ -1287,13 +1174,6 @@
   Int         m_spsScalingListRefLayerId;
   Bool        m_updateRepFormatFlag;
-#endif
   // SPS Extension 
   Bool        m_interViewMvVertConstraintFlag;
-#if !H_MV5
-  Int         m_numIlpRestrictedRefLayers        ;
-  Int         m_minSpatialSegmentOffsetPlus1[MAX_NUM_LAYERS];
-  Bool        m_ctuBasedOffsetEnabledFlag   [MAX_NUM_LAYERS];
-  Int         m_minHorizontalCtuOffsetPlus1 [MAX_NUM_LAYERS];
-#endif
 #endif
 #if H_3D
@@ -1432,5 +1312,4 @@
   TComPTL* getPTL()     { return &m_pcPTL; }
 #if H_MV
-#if H_MV5
   Void      setVPS          ( TComVPS* pcVPS ) { m_pcVPS = pcVPS; }
   TComVPS*  getVPS          () { return m_pcVPS; }
@@ -1444,27 +1323,11 @@
   Void setUpdateRepFormatFlag( Bool flag )     { m_updateRepFormatFlag = flag; } 
   Bool getUpdateRepFormatFlag(  )              { return m_updateRepFormatFlag; } 
-#endif
   // SPS Extension 
   Void setInterViewMvVertConstraintFlag(Bool val) { m_interViewMvVertConstraintFlag = val; }
   Bool getInterViewMvVertConstraintFlag()         { return m_interViewMvVertConstraintFlag;}
-#if H_MV5
   // Inference 
   Void inferRepFormat( TComVPS* vps, Int layerIdCurr );
 
   Void inferScalingList( TComSPS* spsSrc );
-#else
-  Void setNumIlpRestrictedRefLayers   ( Int val )        { m_numIlpRestrictedRefLayers         = val;}
-  Int  getNumIlpRestrictedRefLayers   ( )                { return m_numIlpRestrictedRefLayers        ;}
-  
-  Void setMinSpatialSegmentOffsetPlus1( Int i, Int val ) { m_minSpatialSegmentOffsetPlus1[ i ] = val;}
-  Int  getMinSpatialSegmentOffsetPlus1( Int i )          { return m_minSpatialSegmentOffsetPlus1[ i ];}
-  
-  Void setCtuBasedOffsetEnabledFlag   ( Int i, Bool flag ) { m_ctuBasedOffsetEnabledFlag   [ i ] = flag;}
-  Bool getCtuBasedOffsetEnabledFlag   ( Int i )            { return m_ctuBasedOffsetEnabledFlag   [ i ];}
-
-  Void setMinHorizontalCtuOffsetPlus1 ( Int i, Int val )   { m_minHorizontalCtuOffsetPlus1 [ i ] = val;}
-  Int  getMinHorizontalCtuOffsetPlus1 ( Int i )            { return m_minHorizontalCtuOffsetPlus1 [ i ];}
-
-#endif
 #endif
 #if H_3D_QTLPC
@@ -1582,10 +1445,8 @@
   Int m_numExtraSliceHeaderBits;
 
-#if H_MV5
 #if H_MV
   Int  m_layerId; 
   Bool m_ppsInferScalingListFlag;
   Int  m_ppsScalingListRefLayerId;
-#endif
 #endif
 public:
@@ -1710,5 +1571,4 @@
   Bool getSliceHeaderExtensionPresentFlag   ()                    { return m_sliceHeaderExtensionPresentFlag; }
   Void setSliceHeaderExtensionPresentFlag   (Bool val)            { m_sliceHeaderExtensionPresentFlag = val; }
-#if H_MV5
 #if H_MV
   Void setLayerId( Int  val ) { m_layerId = val; } 
@@ -1720,5 +1580,4 @@
   Void setPpsScalingListRefLayerId( Int  val ) { m_ppsScalingListRefLayerId = val; } 
   Int  getPpsScalingListRefLayerId(  ) { return m_ppsScalingListRefLayerId; } 
-#endif
 #endif
 };
@@ -1754,8 +1613,6 @@
   Bool        m_PicOutputFlag;        ///< pic_output_flag 
   Int         m_iPOC;
-#if H_MV5
 #if H_MV
   Int         m_iPOCBeforeReset; 
-#endif
 #endif
   Int         m_iLastIDR;
@@ -1853,5 +1710,4 @@
   Bool       m_enableTMVPFlag;
 #if H_MV
-#if H_MV5
   std::vector<TComPic*>* m_refPicSetInterLayer0; 
   std::vector<TComPic*>* m_refPicSetInterLayer1; 
@@ -1862,31 +1718,11 @@
   Bool       m_isDepth;
 #endif
-#else
-  std::vector<TComPic*>* m_refPicSetInterLayer; 
-  Int        m_layerId; 
-  Int        m_viewId;
-#if H_3D
-  Int        m_viewIndex; 
-  Bool       m_isDepth;
-#endif
-#endif
 
 // Additional slice header syntax elements 
-#if H_MV5
   Bool       m_pocResetFlag; 
-#endif
   Bool       m_discardableFlag;
   Bool       m_interLayerPredEnabledFlag;
   Int        m_numInterLayerRefPicsMinus1;
   Int        m_interLayerPredLayerIdc       [MAX_NUM_LAYERS];
-#if !H_MV5
-  Bool       m_interLayerSamplePredOnlyFlag;
-  Bool       m_altCollocatedIndicationFlag;
-  Int        m_collocatedRefLayerIdx;
-// Additional slice header semantics variables
-  Int        m_numActiveMotionPredRefLayers;
-  Int        m_activeMotionPredRefLayerId   [ MAX_NUM_LAYER_IDS ];
-
-#endif
   Int        m_aaiCodedScale [2][MAX_NUM_LAYERS];
   Int        m_aaiCodedOffset[2][MAX_NUM_LAYERS];
@@ -2022,18 +1858,12 @@
   
 #if H_MV
-#if H_MV5
   Void      setPocBeforeReset   ( Int i )                       { m_iPOCBeforeReset = i; }
   Int       getPocBeforeReset   ( )                             { return m_iPOCBeforeReset; }
-#endif
   Int       getRefLayerId        ( RefPicList e, Int iRefIdx)    { return  m_aiRefLayerIdList[e][iRefIdx]; }
   Void      setRefLayerId        ( Int i, RefPicList e, Int iRefIdx ) { m_aiRefLayerIdList[e][iRefIdx] = i; }
-#if H_MV5
   Void      getTempRefPicLists   ( TComList<TComPic*>& rcListPic, std::vector<TComPic*>& refPicSetInterLayer0, std::vector<TComPic*>& refPicSetInterLayer1,                                     
                                    std::vector<TComPic*> rpsCurrList[2], std::vector<Bool> usedAsLongTerm[2], Int& numPocTotalCurr, Bool checkNumPocTotalCurr = false );
 
   Void      setRefPicList        ( std::vector<TComPic*> rpsCurrList[2], std::vector<Bool> usedAsLongTerm[2], Int numPocTotalCurr, Bool checkNumPocTotalCurr = false ); 
-#else
-  Void      setRefPicList       ( TComList<TComPic*>& rcListPic, std::vector<TComPic*>& interLayerRefPicSet , Bool checkNumPocTotalCurr = false );
-#endif
 #else
 #if FIX1071
@@ -2084,18 +1914,9 @@
   Void applyReferencePictureSet( TComList<TComPic*>& rcListPic, TComReferencePictureSet *RPSList);
 #if H_MV
-#if !H_MV5
-  Void createAndApplyIvReferencePictureSet( TComPicLists* ivPicLists, std::vector<TComPic*>& refPicSetInterLayer );
-  static Void markIvRefPicsAsShortTerm    ( std::vector<TComPic*> refPicSetInterLayer );
-#else
   Void createInterLayerReferencePictureSet( TComPicLists* ivPicLists, std::vector<TComPic*>& refPicSetInterLayer0, std::vector<TComPic*>& refPicSetInterLayer1 );
   static Void markIvRefPicsAsShortTerm    ( std::vector<TComPic*> refPicSetInterLayer0, std::vector<TComPic*> refPicSetInterLayer1 );
-#endif
   static Void markCurrPic                 ( TComPic* currPic );; 
   static Void markIvRefPicsAsUnused       ( TComPicLists* ivPicLists, std::vector<Int> targetDecLayerIdSet, TComVPS* vps, Int curLayerId, Int curPoc  );
-#if H_MV5
   Void        printRefPicList();
-#else
-  Void        xPrintRefPicList();
-#endif
 #endif
   Bool isTemporalLayerSwitchingPoint( TComList<TComPic*>& rcListPic );
@@ -2184,8 +2005,6 @@
   Void      setViewId             ( Int viewId )     { m_viewId = viewId;   }
   Int       getViewId             ()                 { return m_viewId;     }
-#if H_MV5
   Void      setViewIndex          ( Int viewIndex )  { m_viewIndex = viewIndex;   }
   Int       getViewIndex          ()                 { return m_viewIndex;     }
-#endif
 #if H_3D
 #if H_3D_TMVP
@@ -2193,8 +2012,4 @@
   Void      setAlterRefIdx          ( RefPicList e, Int i ) { m_aiAlterRefIdx[e]    = i;      }
   Int       getAlterRefIdx          ( RefPicList e )        { return  m_aiAlterRefIdx[e];     }
-#endif
-#if !H_MV5
-  Void      setViewIndex          ( Int viewIndex )  { m_viewIndex = viewIndex;   }
-  Int       getViewIndex          ()                 { return m_viewIndex;     }
 #endif
   Void      setIsDepth            ( Bool isDepth )   { m_isDepth = isDepth; }
@@ -2219,8 +2034,6 @@
 // Additional slice header syntax elements
 
-#if H_MV5
   Void setPocResetFlag( Bool flag ) { m_pocResetFlag = flag; } 
   Bool getPocResetFlag(  ) { return m_pocResetFlag; } 
-#endif
 
 Void setDiscardableFlag( Bool flag ) { m_discardableFlag = flag; } 
@@ -2236,5 +2049,4 @@
 Int  getInterLayerPredLayerIdc( Int i ) { return m_interLayerPredLayerIdc[i]; } 
 
-#if H_MV5 
   // Additional variables derived in slice header semantics 
   Int  getNumInterLayerRefPicsMinus1Len( ) { return gCeilLog2(  getVPS()->getNumDirectRefLayers( getLayerId() )); }
@@ -2250,32 +2062,4 @@
   Void     setRefPicSetInterLayer       ( std::vector<TComPic*>* refPicSetInterLayer0, std::vector<TComPic*>* refPicSetInterLayer1);
   TComPic* getPicFromRefPicSetInterLayer( Int setIdc, Int layerId );
-#else
-Void setInterLayerSamplePredOnlyFlag( Bool flag ) { m_interLayerSamplePredOnlyFlag = flag; } 
-Bool getInterLayerSamplePredOnlyFlag(  ) { return m_interLayerSamplePredOnlyFlag; } 
-
-Void setAltCollocatedIndicationFlag( Bool flag ) { m_altCollocatedIndicationFlag = flag; } 
-Bool getAltCollocatedIndicationFlag(  ) { return m_altCollocatedIndicationFlag; } 
-
-Void setCollocatedRefLayerIdx( Int  val ) { m_collocatedRefLayerIdx = val; } 
-Int  getCollocatedRefLayerIdx(  ) { return m_collocatedRefLayerIdx; } 
-
-// Additional variables derived in slice header semantics 
-Int  getNumInterLayerRefPicsMinus1Len( ) { return xCeilLog2(  getVPS()->getNumDirectRefLayers( getLayerIdInVps() )); }
-Int  getInterLayerPredLayerIdcLen    ( ) { return xCeilLog2(  getVPS()->getNumDirectRefLayers( getLayerIdInVps() )); }
-
-Int  getNumActiveRefLayerPics( );
-Int  getRefPicLayerId               ( Int i );
-
-Void setActiveMotionPredRefLayers   ( );
-
-Int  getNumActiveMotionPredRefLayers(  )      { return m_numActiveMotionPredRefLayers; } 
-Int  getActiveMotionPredRefLayerId  ( Int i ) { return m_activeMotionPredRefLayerId[i]; } 
-
-Bool getInterRefEnabledInRPLFlag( );
-
-Void     setRefPicSetInterLayer       ( std::vector<TComPic*>* m_refPicSetInterLayer );
-TComPic* getPicFromRefPicSetInterLayer( Int layerId );
-
-#endif
 #endif
 protected:
@@ -2284,7 +2068,4 @@
 TComPic*  xGetLongTermRefPic(TComList<TComPic*>& rcListPic, Int poc, Bool pocHasMsb);
 #if H_MV
-#if !H_MV5
-  Int       xCeilLog2( Int val );
-#endif
   TComPic*  xGetInterLayerRefPic( std::vector<TComPic*>& rcListIlPic, Int layerId );  
 #endif
@@ -2368,25 +2149,4 @@
   //! activate a SPS from a active parameter sets SEI message
   //! \returns true, if activation is successful
-#if !H_MV5
-  Bool activateSPSWithSEI(Int SPSId);
-
-  //! activate a PPS and depending on isIDR parameter also SPS and VPS
-  //! \returns true, if activation is successful
-  Bool activatePPS(Int ppsId, Bool isIRAP);
-
-  TComVPS* getActiveVPS(){ return m_vpsMap.getPS(m_activeVPSId); };
-  TComSPS* getActiveSPS(){ return m_spsMap.getPS(m_activeSPSId); };
-  TComPPS* getActivePPS(){ return m_ppsMap.getPS(m_activePPSId); };
-
-protected:
-  
-  ParameterSetMap<TComVPS> m_vpsMap;
-  ParameterSetMap<TComSPS> m_spsMap; 
-  ParameterSetMap<TComPPS> m_ppsMap;
-
-  Int m_activeVPSId;
-  Int m_activeSPSId;
-  Int m_activePPSId;
-#else
 #if H_MV
   Bool activateSPSWithSEI(Int SPSId, Int layerId );
@@ -2426,5 +2186,4 @@
 #endif
 
-#endif
 };
 
Index: branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TypeDef.h	(revision 647)
+++ branches/HTM-8.2-dev0-Cleanup/source/Lib/TLibCommon/TypeDef.h	(revision 648)
@@ -181,9 +181,4 @@
 #define KWU_RC_MADPRED_E0227              0  ///< JCT3V-E0227, inter-view MAD prediction
 
-
-/// FIXES
-#if H_MV
-#define H_MV5                             1   // Update to MV-HEVC 5 HLS
-#endif
 /////////////////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////   DERIVED DEFINES ///////////////////////////////////  
@@ -769,15 +764,8 @@
   enum ScalabilityType
   {
-#if H_MV5
 #if H_3D
     DEPTH_ID = 0,    
 #endif    
     VIEW_ORDER_INDEX  = 1,
-#else
-    VIEW_ID  = 0,
-#if H_3D
-    DEPTH_ID = 1,    
-#endif    
-#endif
   };
 #endif
