Index: trunk/source/Lib/TAppCommon/program_options_lite.h
===================================================================
--- trunk/source/Lib/TAppCommon/program_options_lite.h	(revision 1067)
+++ trunk/source/Lib/TAppCommon/program_options_lite.h	(revision 1084)
@@ -378,17 +378,9 @@
         std::string cDescBuffer;
 
-#if !FIX_TICKET_62
-        cNameBuffer       .resize( name.size() + 10 );
-        cDescBuffer.resize( desc.size() + 10 );
-#endif
-
         storage.resize(uiMaxNum);
         for ( unsigned int uiK = 0; uiK < uiMaxNum; uiK++ )
         {
-
-#if FIX_TICKET_62
           cNameBuffer       .resize( name.size() + 10 );
           cDescBuffer.resize( desc.size() + 10 );
-#endif
 
           Bool duplicate = (uiK != 0); 
Index: trunk/source/Lib/TLibCommon/CommonDef.h
===================================================================
--- trunk/source/Lib/TLibCommon/CommonDef.h	(revision 1067)
+++ trunk/source/Lib/TLibCommon/CommonDef.h	(revision 1084)
@@ -61,5 +61,5 @@
 #if H_MV
 #define NV_VERSION        "12.1"                ///< Current software version
-#define HM_VERSION        "14.0"                ///< 
+#define HM_VERSION        "15.0"                ///< 
 #else
 #define NV_VERSION        "14.0"                 ///< Current software version
Index: trunk/source/Lib/TLibCommon/ContextTables.h
===================================================================
--- trunk/source/Lib/TLibCommon/ContextTables.h	(revision 1067)
+++ trunk/source/Lib/TLibCommon/ContextTables.h	(revision 1084)
@@ -51,5 +51,5 @@
 #define NUM_SPLIT_FLAG_CTX            3       ///< number of context models for split flag
 #define NUM_SKIP_FLAG_CTX             3       ///< number of context models for skip flag
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
 #define NUM_SINGLEDEPTH_FLAG_CTX                     1
 #define NUM_SINGLE_DEPTH_VALUE_DATA_CTX              1       
@@ -153,5 +153,5 @@
   { CNU,  CNU,  CNU, }, 
 };
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
 static const UChar 
 INIT_SINGLEDEPTH_FLAG[3][NUM_SINGLEDEPTH_FLAG_CTX] =  
@@ -450,15 +450,9 @@
 static const UChar INIT_DBBP_FLAG[3][DBBP_NUM_FLAG_CTX] =
 {
-#if SEC_DBBP_EXPLICIT_SIG_I0077
-  { CNU },
-  { CNU },
-  { CNU },
-#else
-  { 161 },
-  { 161 },
-  { 161 },
-#endif
-};
-#endif
-
-#endif
+  { CNU },
+  { CNU },
+  { CNU },
+};
+#endif
+
+#endif
Index: trunk/source/Lib/TLibCommon/SEI.h
===================================================================
--- trunk/source/Lib/TLibCommon/SEI.h	(revision 1067)
+++ trunk/source/Lib/TLibCommon/SEI.h	(revision 1084)
@@ -161,6 +161,6 @@
   UInt m_bpSeqParameterSetId;
   Bool m_rapCpbParamsPresentFlag;
-  Bool m_cpbDelayOffset;
-  Bool m_dpbDelayOffset;
+  UInt m_cpbDelayOffset;
+  UInt m_dpbDelayOffset;
   UInt m_initialCpbRemovalDelay         [MAX_CPB_CNT][2];
   UInt m_initialCpbRemovalDelayOffset   [MAX_CPB_CNT][2];
Index: trunk/source/Lib/TLibCommon/TComDataCU.cpp
===================================================================
--- trunk/source/Lib/TLibCommon/TComDataCU.cpp	(revision 1067)
+++ trunk/source/Lib/TLibCommon/TComDataCU.cpp	(revision 1084)
@@ -60,5 +60,5 @@
   
   m_skipFlag           = NULL;
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
   m_singleDepthFlag     = NULL;
   m_apSingleDepthValue  = NULL;
@@ -185,5 +185,5 @@
 
     m_skipFlag           = new Bool[ uiNumPartition ];
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
     m_singleDepthFlag     = new Bool[ uiNumPartition ];
     m_apSingleDepthValue  = (Pel*)xMalloc(Pel, uiNumPartition);
@@ -335,5 +335,5 @@
 
     if ( m_skipFlag           ) { delete[] m_skipFlag;          m_skipFlag          = NULL; }
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
     if ( m_singleDepthFlag    ) { delete[] m_singleDepthFlag;   m_singleDepthFlag     = NULL; }
     if ( m_apSingleDepthValue ) { xFree(m_apSingleDepthValue);  m_apSingleDepthValue  = NULL; }
@@ -503,5 +503,5 @@
     TComDataCU * pcFrom = pcPic->getCU(getAddr());
     m_skipFlag[ui]   = pcFrom->getSkipFlag(ui);
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
     m_singleDepthFlag[ui]    = pcFrom->getSingleDepthFlag(ui);
     m_apSingleDepthValue[ui] = pcFrom->getSingleDepthValue(ui);
@@ -563,5 +563,5 @@
   {
     memset( m_skipFlag          + firstElement, false,                    numElements * sizeof( *m_skipFlag ) );
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
     memset( m_singleDepthFlag     + firstElement, false,                  numElements * sizeof( *m_singleDepthFlag ) );
     memset( m_apSingleDepthValue  + firstElement,     0,                  numElements * sizeof( *m_apSingleDepthValue ) );
@@ -754,5 +754,5 @@
       m_puhTransformSkip[2][ui] = 0;
       m_skipFlag[ui]   = false;
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
       m_singleDepthFlag[ui]     = false;
       m_apSingleDepthValue[ui]  = 0;
@@ -933,5 +933,5 @@
   {
     m_skipFlag[ui]   = false;
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
     m_singleDepthFlag[ui]   = false;
     m_apSingleDepthValue[ui]= 0;
@@ -958,5 +958,5 @@
       m_puhTransformSkip[2][ui] = pcCU->getTransformSkip(uiPartOffset+ui,TEXT_CHROMA_V);
       m_skipFlag[ui]   = pcCU->getSkipFlag(uiPartOffset+ui);
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
       m_singleDepthFlag[ui]    = pcCU->getSingleDepthFlag(uiPartOffset+ui);
       m_apSingleDepthValue[ui] = pcCU->getSingleDepthValue(uiPartOffset+ui);
@@ -1111,5 +1111,5 @@
   
   m_skipFlag=pcCU->getSkipFlag()          + uiPart;
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
   m_singleDepthFlag     = pcCU->getSingleDepthFlag()   + uiPart;
   m_apSingleDepthValue  = pcCU->getSingleDepthValue()  + uiPart;
@@ -1252,5 +1252,5 @@
   
   m_skipFlag           = pcCU->getSkipFlag ()             + uiAbsPartIdx;
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
   m_singleDepthFlag     = pcCU->getSingleDepthFlag ()             + uiAbsPartIdx;
   m_apSingleDepthValue  = pcCU->getSingleDepthValue ()            + uiAbsPartIdx;
@@ -1331,5 +1331,5 @@
   Int sizeInChar  = sizeof( Char ) * uiNumPartition;
   memcpy( m_skipFlag   + uiOffset, pcCU->getSkipFlag(),       sizeof( *m_skipFlag )   * uiNumPartition );
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
   memcpy( m_singleDepthFlag     + uiOffset, pcCU->getSingleDepthFlag(),       sizeof( *m_singleDepthFlag )   * uiNumPartition );
   memcpy( m_apSingleDepthValue  + uiOffset, pcCU->getSingleDepthValue(),      sizeof( *m_apSingleDepthValue ) * uiNumPartition);
@@ -1455,5 +1455,5 @@
 
   memcpy( rpcCU->getSkipFlag() + m_uiAbsIdxInLCU, m_skipFlag, sizeof( *m_skipFlag ) * m_uiNumPartition );
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
   memcpy( rpcCU->getSingleDepthFlag()  + m_uiAbsIdxInLCU, m_singleDepthFlag,    sizeof( *m_singleDepthFlag ) * m_uiNumPartition );
   memcpy( rpcCU->getSingleDepthValue() + m_uiAbsIdxInLCU, m_apSingleDepthValue, sizeof( *m_apSingleDepthValue ) * m_uiNumPartition);
@@ -1574,5 +1574,5 @@
   Int sizeInChar  = sizeof( Char ) * uiQNumPart;
   memcpy( rpcCU->getSkipFlag()       + uiPartOffset, m_skipFlag,   sizeof( *m_skipFlag )   * uiQNumPart );
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
   memcpy( rpcCU->getSingleDepthFlag()  + uiPartOffset, m_singleDepthFlag,    sizeof( *m_singleDepthFlag )   * uiQNumPart );
   memcpy( rpcCU->getSingleDepthValue() + uiPartOffset, m_apSingleDepthValue, sizeof( *m_apSingleDepthValue ) * uiQNumPart);
@@ -2497,5 +2497,5 @@
   memset( m_skipFlag + absPartIdx, skip, m_pcPic->getNumPartInCU() >> ( 2 * depth ) );
 }
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
 Void TComDataCU::setSingleDepthFlagSubParts( Bool singleDepth, UInt absPartIdx, UInt depth )
 {
@@ -2677,9 +2677,5 @@
   }
 
-#if HS_DMM_SIGNALLING_I0120
   if( isDimMode( getLumaIntraDir( uiAbsPartIdx ) ) )
-#else
-  if( isDimMode( getLumaIntraDir( uiAbsPartIdx ) ) && !isDimDeltaDC( getLumaIntraDir( uiAbsPartIdx ) ) )
-#endif
   {
     return true;
@@ -2694,9 +2690,5 @@
   // check prediction mode
   UInt uiLumaPredMode = getLumaIntraDir( uiAbsPartIdx );  
-#if HS_DMM_SIGNALLING_I0120
   if( uiLumaPredMode == PLANAR_IDX || ( getDimType( uiLumaPredMode ) == DMM1_IDX  ) )
-#else
-  if( uiLumaPredMode == PLANAR_IDX || ( getDimType( uiLumaPredMode ) == DMM1_IDX && !isDimDeltaDC( uiLumaPredMode ) ) )
-#endif
     return true;
   
@@ -3373,40 +3365,4 @@
   for(Int iLoop = 0; iLoop < 2; iLoop ++ ) 
   {
-#if !SEC_SIMP_SHIFTED_DV_I0086
-    // IvDcShift (Derived from spatial Iv neighboring blocks)
-    if( iLoop == 1 )
-    {
-      Int iFirDispCand = -1;
-      TComMvField mvIvDcShift[2];
-      UChar dirIvDcShift;
-
-      if (xGetPosFirstAvailDmvCand(MRG_IVSHIFT, iFirDispCand))
-      {
-        TComMv cMv;
-        cMv = m_mergCands[iFirDispCand].m_cMvField[0].getMv();
-        cMv.setHor(cMv.getHor()+4);
-        if(m_pcSlice->getVPS()->getViewSynthesisPredFlag(m_pcSlice->getLayerIdInVps()))
-        {
-          cMv.setVer(0);
-        }
-#if !(NTT_BUG_FIX_TK54)
-        clipMv( cMv );
-#endif
-
-        dirIvDcShift = m_mergCands[iFirDispCand].m_uDir;
-        mvIvDcShift[0].setMvField(cMv, m_mergCands[iFirDispCand].m_cMvField[0].getRefIdx() );
-        mvIvDcShift[1].setMvField(m_mergCands[iFirDispCand].m_cMvField[1].getMv(), m_mergCands[iFirDispCand].m_cMvField[1].getRefIdx() );
-        m_mergCands[MRG_IVSHIFT].setCand(mvIvDcShift, dirIvDcShift, false, false);
-        
-        if( mrgCandIdx == iCount ) 
-        {
-          return true;
-        }
-        iCount++;
-        break;
-      }
-    }
-#endif
-
     /// iLoop = 0 --> IvMCShift
     /// iLoop = 1 --> IvDCShift  (Derived from IvDC)
@@ -3455,23 +3411,4 @@
 } 
 
-#if !SEC_SIMP_SHIFTED_DV_I0086
-inline Bool TComDataCU::xGetPosFirstAvailDmvCand(Int iCount, Int& posFirstAvailDmvCand )
-{
-  for ( Int currListPos = 0; currListPos < iCount; currListPos++ )
-  {
-    if ( !m_mergCands[currListPos].m_bAvailable || ( currListPos == MRG_IVMC ) || ( currListPos == MRG_IVDC ) || ( m_mergCands[currListPos].m_iVspFlag != 0 ))
-    {
-      continue;
-    }
-    else if((m_mergCands[currListPos].m_bAvailable) && (m_mergCands[currListPos].m_cMvField[0].getRefIdx() != -1 ) && (getSlice()->getViewIndex() != getSlice()->getRefPic(RefPicList(0), m_mergCands[currListPos].m_cMvField[0].getRefIdx())->getViewIndex()))
-    {
-      posFirstAvailDmvCand = currListPos;
-      return true;
-    }
-  }
-  return false;  
-}
-#endif
-                                      
 #endif
 
@@ -3921,7 +3858,4 @@
 Void TComDataCU::getInterMergeCandidates( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours
 #endif
-#if H_3D_VSP && !FIX_TICKET_79
-      , InheritedVSPDisInfo*  inheritedVSPDisInfo
-#endif
 #if H_3D_SPIVMP
       , TComMvField* pcMvFieldSP, UChar* puhInterDirSP
@@ -3951,10 +3885,4 @@
   //////////////////////////////////
   DisInfo cDisInfo = getDvInfo(uiAbsPartIdx);
-#if !FIX_TICKET_79
-  for(Int i = 0; i < MRG_MAX_NUM_CANDS_MEM; i++)
-  {
-    inheritedVSPDisInfo[i].m_acDvInfo = cDisInfo;   // To prevent run-time error, this code must be executed always for merging process.
-  }
-#endif
   m_cDefaultDisInfo = cDisInfo;
 
@@ -4177,5 +4105,5 @@
     TComPic * pcTexPic = m_pcSlice->getTexturePic();
 #if H_3D_FCO
-#if LGE_FCO_I0116
+#if H_3D_FCO
     if (pcTexPic && pcTexPic->getReconMark())
 #else
@@ -4251,7 +4179,4 @@
                 TComMv cMv = cDefaultMvField.getMv() + cMvRounding;
                 cMv >>= 2;
-#if !FIX_TICKET_68
-                clipMv( cMv );
-#endif
                 cMvFieldSaved[eCurrRefPicList].setMvField(cMv, iRefPicList) ;
                 break;
@@ -5325,13 +5250,4 @@
 #endif
 
-#if !FIX_TICKET_76
-#if H_3D_VSP
-inline Void TComDataCU::xInheritVSPDisInfo(TComDataCU* pcCURef, UInt uiAbsPartIdx, Int iCount, InheritedVSPDisInfo*  inheritedVSPDisInfo)
-{
-  inheritedVSPDisInfo[iCount].m_acDvInfo.m_acNBDV   = pcCURef->getDvInfo(uiAbsPartIdx).m_acNBDV;
-  inheritedVSPDisInfo[iCount].m_acDvInfo.m_aVIdxCan = pcCURef->getDvInfo(uiAbsPartIdx).m_aVIdxCan;
-}
-#endif
-#endif
 /** Check whether the current PU and a spatial neighboring PU are in a same ME region.
  * \param xN, xN   location of the upper-left corner pixel of a neighboring PU
@@ -5976,9 +5892,6 @@
     Int iColRefViewId  = pColCU->getSlice()->getRefPic( eColRefPicList, pColCU->getCUMvField(eColRefPicList)->getRefIdx(uiAbsPartAddr))->getViewIndex(); 
     iScale = xGetDistScaleFactor( iCurrViewId, iCurrRefViewId, iColViewId, iColRefViewId );
-#if SEC_HLS_CLEANUP_I0100
+
     if ( iScale != 4096 && m_pcSlice->getVPS()->getIvMvScalingFlag(getSlice()->getLayerIdInVps()) ) 
-#else
-    if ( iScale != 4096 && m_pcSlice->getVPS()->getIvMvScalingFlag() ) 
-#endif
     {
       rcMv = cColMv.scaleMv( iScale );
@@ -6164,9 +6077,5 @@
   TComMv cMv; 
 #if MTK_I0093
-#if H_3D_FIX_64BIT_SHIFT
   Int iDisp     = getSlice()->getDepthToDisparityB( 0 )[ (Int64) (1 << ( getSlice()->getSPS()->getBitDepthY() - 1 )) ];
-#else
-  Int iDisp     = getSlice()->getDepthToDisparityB( 0 )[  1 << ( getSlice()->getSPS()->getBitDepthY() - 1 ) ];
-#endif
 #else
   Int iDisp     = getSlice()->getDepthToDisparityB( 0 )[ 128 ];
@@ -6181,5 +6090,5 @@
 #endif
 
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
 Bool TComDataCU::getNeighDepth (UInt uiPartIdx, UInt uiPartAddr, Pel* pNeighDepth, Int index)
 {
@@ -6795,9 +6704,5 @@
   if( getSlice()->getIsDepth() )
   {
-#if MTK_I0099_VPS_EX2
     iSubPUSize = 1<<getSlice()->getVPS()->getSubPUMPILog2Size(getSlice()->getLayerId());
-#else
-    iSubPUSize = 1 << getSlice()->getVPS()->getSubPUMPILog2Size();
-#endif
   }
 
Index: trunk/source/Lib/TLibCommon/TComDataCU.h
===================================================================
--- trunk/source/Lib/TLibCommon/TComDataCU.h	(revision 1067)
+++ trunk/source/Lib/TLibCommon/TComDataCU.h	(revision 1084)
@@ -110,5 +110,5 @@
   // -------------------------------------------------------------------------------------------------------------------
   Bool*         m_skipFlag;           ///< array of skip flags
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
   Bool*         m_singleDepthFlag;           ///< array of single depth flags
   Pel*          m_apSingleDepthValue;
@@ -250,7 +250,4 @@
 #if H_3D_IV_MERGE
   Bool          xAddIvMRGCand( Int mrgCandIdx, Int& iCount, Int*   ivCandDir, TComMv* ivCandMv, Int* ivCandRefIdx ); 
-#if! SEC_SIMP_SHIFTED_DV_I0086
-  Bool          xGetPosFirstAvailDmvCand( Int iCount, Int& iFirDispCand );
-#endif
 #endif
 
@@ -353,5 +350,5 @@
   Void         setSkipFlag           ( UInt idx, Bool skip)     { m_skipFlag[idx] = skip;   }
   Void         setSkipFlagSubParts   ( Bool skip, UInt absPartIdx, UInt depth );
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
   Bool*        getSingleDepthFlag            ()                        { return m_singleDepthFlag;          }
   Bool         getSingleDepthFlag            (UInt idx)                { return m_singleDepthFlag[idx];     }
@@ -505,5 +502,5 @@
   Bool          getDispMvPredCan(UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDis, Int* iPdm );
 #endif
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
    Bool          getNeighDepth (UInt uiPartIdx, UInt uiPartAddr, Pel* pNeighDepth, Int index);
 #endif
@@ -670,7 +667,4 @@
   Void          getInterMergeCandidates ( UInt uiAbsPartIdx, UInt uiPUIdx, TComMvField* pcMFieldNeighbours, UChar* puhInterDirNeighbours
 #endif
-#if H_3D_VSP && !FIX_TICKET_79
-                                            , InheritedVSPDisInfo*  inheritedVSPDisInfo
-#endif
 #if H_3D_SPIVMP
                                             , TComMvField* pcMvFieldSP, UChar* puhInterDirSP
@@ -680,8 +674,4 @@
 
 #if H_3D_VSP
-#if !FIX_TICKET_76
-  inline Void   xInheritVSPDisInfo(TComDataCU* pcCURef, UInt uiAbsPartIdx, Int iCount,  InheritedVSPDisInfo*  inheritedVSPDisInfo);
-#endif
-
 #if H_3D_SPIVMP
   Bool*         getSPIVMPFlag        ()                        { return m_pbSPIVMPFlag;          }
@@ -771,5 +761,5 @@
 #endif
 
-#if SHARP_DMM1_I0110
+#if H_3D_DIM
   Bool         isDMM1UpscaleMode       ( UInt uiWidth ){ Bool bDMM1UpsampleModeFlag = true; UInt uiBaseWidth = 16; if( uiBaseWidth >= uiWidth ){ bDMM1UpsampleModeFlag = false; } return bDMM1UpsampleModeFlag; };
   UInt         getDMM1BasePatternWidth ( UInt uiWidth ){ UInt uiBaseWidth = 16; if( uiBaseWidth >= uiWidth ){ uiBaseWidth =  uiWidth; } return uiBaseWidth; }
Index: trunk/source/Lib/TLibCommon/TComMotionInfo.h
===================================================================
--- trunk/source/Lib/TLibCommon/TComMotionInfo.h	(revision 1067)
+++ trunk/source/Lib/TLibCommon/TComMotionInfo.h	(revision 1084)
@@ -79,10 +79,5 @@
 } IDVInfo;
 #endif
-#if H_3D_VSP && !FIX_TICKET_79
-typedef struct _InheritedVSPDisCand 
-{
-  DisInfo m_acDvInfo;
-} InheritedVSPDisInfo;
-#endif
+
 // ====================================================================================================================
 // Class definition
Index: trunk/source/Lib/TLibCommon/TComPicSym.cpp
===================================================================
--- trunk/source/Lib/TLibCommon/TComPicSym.cpp	(revision 1067)
+++ trunk/source/Lib/TLibCommon/TComPicSym.cpp	(revision 1084)
@@ -38,4 +38,5 @@
 #include "TComPicSym.h"
 #include "TComSampleAdaptiveOffset.h"
+#include "TComSlice.h"
 
 //! \ingroup TLibCommon
@@ -63,5 +64,4 @@
 ,m_iNumColumnsMinus1 (0)
 ,m_iNumRowsMinus1(0)
-,m_apcTComTile(NULL)
 ,m_puiCUOrderMap(0)
 ,m_puiTileIdxMap(NULL)
@@ -101,5 +101,5 @@
     delete [] m_apcTComSlice;
   }
-  m_apcTComSlice      = new TComSlice*[m_uiNumCUsInFrame*m_uiNumPartitions];  
+  m_apcTComSlice      = new TComSlice*[m_uiNumCUsInFrame];
   m_apcTComSlice[0]   = new TComSlice;
   m_uiNumAllocatedSlice = 1;
@@ -148,12 +148,4 @@
   m_apcTComDataCU = NULL;
 
-  for(Int i = 0; i < (m_iNumColumnsMinus1+1)*(m_iNumRowsMinus1+1); i++ )
-  {
-    delete m_apcTComTile[i];
-  }
-  delete [] m_apcTComTile;
-
-  m_apcTComTile = NULL;
-
   delete [] m_puiCUOrderMap;
   m_puiCUOrderMap = NULL;
@@ -173,4 +165,5 @@
 Void TComPicSym::allocateNewSlice()
 {
+  assert ((m_uiNumAllocatedSlice + 1) <= m_uiNumCUsInFrame);
   m_apcTComSlice[m_uiNumAllocatedSlice ++] = new TComSlice;
   if (m_uiNumAllocatedSlice>=2)
@@ -201,71 +194,134 @@
 }
 
-Void TComPicSym::xCreateTComTileArray()
-{
-  m_apcTComTile = new TComTile*[(m_iNumColumnsMinus1+1)*(m_iNumRowsMinus1+1)];
-  for( UInt i=0; i<(m_iNumColumnsMinus1+1)*(m_iNumRowsMinus1+1); i++ )
-  {
-    m_apcTComTile[i] = new TComTile;
-  }
-}
-
-Void TComPicSym::xInitTiles()
-{
-  UInt  uiTileIdx;
-  UInt  uiColumnIdx = 0;
-  UInt  uiRowIdx = 0;
-  UInt  uiRightEdgePosInCU;
-  UInt  uiBottomEdgePosInCU;
-  Int   i, j;
+Void TComPicSym::initTiles(TComPPS *pps)
+{
+  //set NumColumnsMinus1 and NumRowsMinus1
+  setNumColumnsMinus1( pps->getNumTileColumnsMinus1() );
+  setNumRowsMinus1( pps->getTileNumRowsMinus1() );
+
+  const Int numCols = pps->getNumTileColumnsMinus1() + 1;
+  const Int numRows = pps->getTileNumRowsMinus1() + 1;
+  const Int numTiles = numRows * numCols;
+
+  // allocate memory for tile parameters
+  m_tileParameters.resize(numTiles);
+
+  if( pps->getTileUniformSpacingFlag() )
+  {
+    //set width and height for each (uniform) tile
+    for(Int row=0; row < numRows; row++)
+    {
+      for(Int col=0; col < numCols; col++)
+      {
+        const Int tileIdx = row * numCols + col;
+        m_tileParameters[tileIdx].setTileWidth( (col+1)*getFrameWidthInCU()/numCols
+                                              - (col*getFrameWidthInCU())/numCols );
+        m_tileParameters[tileIdx].setTileHeight( (row+1)*getFrameHeightInCU()/numRows
+                                               - (row*getFrameHeightInCU())/numRows );
+      }
+    }
+  }
+  else
+  {
+    //set the width for each tile
+    for(Int row=0; row < numRows; row++)
+    {
+      Int cumulativeTileWidth = 0;
+      for(Int col=0; col < getNumColumnsMinus1(); col++)
+  {
+        m_tileParameters[row * numCols + col].setTileWidth( pps->getTileColumnWidth(col) );
+        cumulativeTileWidth += pps->getTileColumnWidth(col);
+  }
+      m_tileParameters[row * numCols + getNumColumnsMinus1()].setTileWidth( getFrameWidthInCU()-cumulativeTileWidth );
+}
+
+    //set the height for each tile
+    for(Int col=0; col < numCols; col++)
+{
+      Int cumulativeTileHeight = 0;
+      for(Int row=0; row < getNumRowsMinus1(); row++)
+      {
+        m_tileParameters[row * numCols + col].setTileHeight( pps->getTileRowHeight(row) );
+        cumulativeTileHeight += pps->getTileRowHeight(row);
+      }
+      m_tileParameters[getNumRowsMinus1() * numCols + col].setTileHeight( getFrameHeightInCU()-cumulativeTileHeight );
+    }
+  }
+
+#if TILE_SIZE_CHECK
+  Int minWidth  = 1;
+  Int minHeight = 1;
+  const Int profileIdc = pps->getSPS()->getPTL()->getGeneralPTL()->getProfileIdc();
+  if (  profileIdc == Profile::MAIN || profileIdc == Profile::MAIN10)
+  {
+    if (pps->getTilesEnabledFlag())
+    {
+      minHeight = 64  / g_uiMaxCUHeight;
+      minWidth  = 256 / g_uiMaxCUWidth;
+    }
+  }
+  for(Int row=0; row < numRows; row++)
+  {
+    for(Int col=0; col < numCols; col++)
+    {
+      const Int tileIdx = row * numCols + col;
+      assert (m_tileParameters[tileIdx].getTileWidth() >= minWidth);
+      assert (m_tileParameters[tileIdx].getTileHeight() >= minHeight);
+    }
+  }
+#endif
 
   //initialize each tile of the current picture
-  for( uiRowIdx=0; uiRowIdx < m_iNumRowsMinus1+1; uiRowIdx++ )
-  {
-    for( uiColumnIdx=0; uiColumnIdx < m_iNumColumnsMinus1+1; uiColumnIdx++ )
-    {
-      uiTileIdx = uiRowIdx * (m_iNumColumnsMinus1+1) + uiColumnIdx;
+  for( Int row=0; row < numRows; row++ )
+  {
+    for( Int col=0; col < numCols; col++ )
+    {
+      const Int tileIdx = row * numCols + col;
 
       //initialize the RightEdgePosInCU for each tile
-      uiRightEdgePosInCU = 0;
-      for( i=0; i <= uiColumnIdx; i++ )
-      {
-        uiRightEdgePosInCU += this->getTComTile(uiRowIdx * (m_iNumColumnsMinus1+1) + i)->getTileWidth();
-      }
-      this->getTComTile(uiTileIdx)->setRightEdgePosInCU(uiRightEdgePosInCU-1);
+      Int rightEdgePosInCTU = 0;
+      for( Int i=0; i <= col; i++ )
+      {
+        rightEdgePosInCTU += m_tileParameters[row * numCols + i].getTileWidth();
+      }
+      m_tileParameters[tileIdx].setRightEdgePosInCU(rightEdgePosInCTU-1);
 
       //initialize the BottomEdgePosInCU for each tile
-      uiBottomEdgePosInCU = 0;
-      for( i=0; i <= uiRowIdx; i++ )
-      {
-        uiBottomEdgePosInCU += this->getTComTile(i * (m_iNumColumnsMinus1+1) + uiColumnIdx)->getTileHeight();
-      }
-      this->getTComTile(uiTileIdx)->setBottomEdgePosInCU(uiBottomEdgePosInCU-1);
+      Int bottomEdgePosInCTU = 0;
+      for( Int i=0; i <= row; i++ )
+      {
+        bottomEdgePosInCTU += m_tileParameters[i * numCols + col].getTileHeight();
+      }
+      m_tileParameters[tileIdx].setBottomEdgePosInCU(bottomEdgePosInCTU-1);
 
       //initialize the FirstCUAddr for each tile
-      this->getTComTile(uiTileIdx)->setFirstCUAddr( (this->getTComTile(uiTileIdx)->getBottomEdgePosInCU() - this->getTComTile(uiTileIdx)->getTileHeight() +1)*m_uiWidthInCU + 
-        this->getTComTile(uiTileIdx)->getRightEdgePosInCU() - this->getTComTile(uiTileIdx)->getTileWidth() + 1);
-    }
-  }
+      m_tileParameters[tileIdx].setFirstCUAddr( (m_tileParameters[tileIdx].getBottomEdgePosInCU() - m_tileParameters[tileIdx].getTileHeight() + 1) * getFrameWidthInCU() + 
+                                                 m_tileParameters[tileIdx].getRightEdgePosInCU() - m_tileParameters[tileIdx].getTileWidth() + 1);
+    }
+  }
+
+  Int  columnIdx = 0;
+  Int  rowIdx = 0;
 
   //initialize the TileIdxMap
-  for( i=0; i<m_uiNumCUsInFrame; i++)
-  {
-    for(j=0; j < m_iNumColumnsMinus1+1; j++)
-    {
-      if(i % m_uiWidthInCU <= this->getTComTile(j)->getRightEdgePosInCU())
-      {
-        uiColumnIdx = j;
-        j = m_iNumColumnsMinus1+1;
-      }
-    }
-    for(j=0; j < m_iNumRowsMinus1+1; j++)
-    {
-      if(i/m_uiWidthInCU <= this->getTComTile(j*(m_iNumColumnsMinus1 + 1))->getBottomEdgePosInCU())
-      {
-        uiRowIdx = j;
-        j = m_iNumRowsMinus1 + 1;
-      }
-    }
-    m_puiTileIdxMap[i] = uiRowIdx * (m_iNumColumnsMinus1 + 1) + uiColumnIdx;
+  for( Int i=0; i<m_uiNumCUsInFrame; i++)
+  {
+    for( Int col=0; col < numCols; col++)
+    {
+      if(i % getFrameWidthInCU() <= m_tileParameters[col].getRightEdgePosInCU())
+      {
+        columnIdx = col;
+        break;
+      }
+    }
+    for(Int row=0; row < numRows; row++)
+    {
+      if(i / getFrameWidthInCU() <= m_tileParameters[row*numCols].getBottomEdgePosInCU())
+      {
+        rowIdx = row;
+        break;
+      }
+    }
+    m_puiTileIdxMap[i] = rowIdx * numCols + columnIdx;
   }
 
@@ -417,4 +473,10 @@
 
 TComTile::TComTile()
+: m_uiTileWidth         (0)
+, m_uiTileHeight        (0)
+, m_uiRightEdgePosInCU  (0)
+, m_uiBottomEdgePosInCU (0)
+, m_uiFirstCUAddr       (0)
+
 {
 }
Index: trunk/source/Lib/TLibCommon/TComPicSym.h
===================================================================
--- trunk/source/Lib/TLibCommon/TComPicSym.h	(revision 1067)
+++ trunk/source/Lib/TLibCommon/TComPicSym.h	(revision 1084)
@@ -45,4 +45,5 @@
 #include "TComDataCU.h"
 class TComSampleAdaptiveOffset;
+class TComPPS;
 
 //! \ingroup TLibCommon
@@ -102,5 +103,5 @@
   Int           m_iNumColumnsMinus1; 
   Int           m_iNumRowsMinus1;
-  TComTile**    m_apcTComTile;
+  std::vector<TComTile> m_tileParameters;
   UInt*         m_puiCUOrderMap;       //the map of LCU raster scan address relative to LCU encoding order 
   UInt*         m_puiTileIdxMap;       //the map of the tile index relative to LCU raster scan address 
@@ -133,5 +134,5 @@
   Int          getNumRowsMinus1()                                    { return m_iNumRowsMinus1; }
   Int          getNumTiles()                                         { return (m_iNumRowsMinus1+1)*(m_iNumColumnsMinus1+1); }
-  TComTile*    getTComTile  ( UInt tileIdx )                         { return *(m_apcTComTile + tileIdx); }
+  TComTile*    getTComTile  ( UInt tileIdx )                         { return &(m_tileParameters[tileIdx]); }
   Void         setCUOrderMap( Int encCUOrder, Int cuAddr )           { *(m_puiCUOrderMap + encCUOrder) = cuAddr; }
   UInt         getCUOrderMap( Int encCUOrder )                       { return *(m_puiCUOrderMap + (encCUOrder>=m_uiNumCUsInFrame ? m_uiNumCUsInFrame : encCUOrder)); }
@@ -141,6 +142,5 @@
   UInt         getPicSCUEncOrder( UInt SCUAddr );
   UInt         getPicSCUAddr( UInt SCUEncOrder );
-  Void         xCreateTComTileArray();
-  Void         xInitTiles();
+  Void         initTiles(TComPPS *pps);
   UInt         xCalculateNxtCUAddr( UInt uiCurrCUAddr );
   SAOBlkParam* getSAOBlkParam() { return m_saoBlkParams;}
Index: trunk/source/Lib/TLibCommon/TComPrediction.cpp
===================================================================
--- trunk/source/Lib/TLibCommon/TComPrediction.cpp	(revision 1067)
+++ trunk/source/Lib/TLibCommon/TComPrediction.cpp	(revision 1084)
@@ -423,7 +423,4 @@
 
   UInt dimType    = getDimType  ( uiIntraMode );
-#if !HS_DMM_SIGNALLING_I0120
-  Bool dimDeltaDC = isDimDeltaDC( uiIntraMode );
-#endif
   Bool isDmmMode  = (dimType <  DMM_NUM_TYPE);
 
@@ -440,11 +437,7 @@
     case( DMM1_IDX ): 
       {
-#if SHARP_DMM1_I0110
         dmmSegmentation = pcCU->isDMM1UpscaleMode((UInt)iWidth) ? 
             &(g_dmmWedgeLists[ g_aucConvertToBit[pcCU->getDMM1BasePatternWidth((UInt)iWidth)] ][ pcCU->getDmmWedgeTabIdx( dimType, uiAbsPartIdx ) ]) : 
             &(g_dmmWedgeLists[ g_aucConvertToBit[iWidth] ][ pcCU->getDmmWedgeTabIdx( dimType, uiAbsPartIdx ) ]);
-#else
-        dmmSegmentation = &(g_dmmWedgeLists[ g_aucConvertToBit[iWidth] ][ pcCU->getDmmWedgeTabIdx( dimType, uiAbsPartIdx ) ]);
-#endif
       } break;
     case( DMM4_IDX ): 
@@ -464,5 +457,4 @@
     }
     assert( dmmSegmentation );
-#if SHARP_DMM1_I0110
     if( dimType == DMM1_IDX && pcCU->isDMM1UpscaleMode((UInt)iWidth) ) 
     {
@@ -475,8 +467,4 @@
         patternStride = dmmSegmentation->getStride ();
     }
-#else
-    biSegPattern  = dmmSegmentation->getPattern();
-    patternStride = dmmSegmentation->getStride ();
-#endif
   }
 #endif
@@ -495,9 +483,5 @@
   Pel segDC1 = 0;
   Pel segDC2 = 0;
-#if HS_DMM_SIGNALLING_I0120
   if( !pcCU->getSDCFlag( uiAbsPartIdx ) )
-#else
-  if( dimDeltaDC )
-#endif
   {
     Pel deltaDC1 = pcCU->getDimDeltaDC( dimType, 0, uiAbsPartIdx );
@@ -568,10 +552,9 @@
     pcCU->getSPAbsPartIdx(uiPartAddr, iSPWidth, iSPHeight, i, iNumSPInOneLine, uiSPAddr[i]);
   }
-#if SHARP_ARP_CHROMA_I0104
   if( pcCU->getARPW( uiPartAddr ) != 0 )
   {
     return;
   }
-#endif
+
   // horizontal sub-PU merge
   for (Int i=0; i<iNumSP; i++)
@@ -745,5 +728,5 @@
   Int uiMinDepth = MAX_INT;
   Int uiMaxDepth = 0;
-#if SEC_DBBP_DMM4_THRESHOLD_I0076
+
   iSumDepth  = pDepthPels[ 0 ];
   iSumDepth += pDepthPels[ uiWidth - 1 ];
@@ -760,26 +743,5 @@
   uiMaxDepth = std::max( uiMaxDepth, (Int)pDepthPels[ uiDepthStride * (uiHeight - 1) ]);
   uiMaxDepth = std::max( uiMaxDepth, (Int)pDepthPels[ uiDepthStride * (uiHeight - 1) + uiWidth - 1 ]);
-#else
-  for (Int y=0; y<uiHeight; y++)
-  {
-    for (Int x=0; x<uiWidth; x++)
-    {
-      Int depthPel = pDepthPels[x];
-      iSumDepth += depthPel;
-      
-      if( depthPel > uiMaxDepth )
-      {
-        uiMaxDepth = depthPel;
-      }
-      if( depthPel < uiMinDepth )
-      {
-        uiMinDepth = depthPel;
-      }
-    }
-    
-    // next row
-    pDepthPels += uiDepthStride;
-  }
-#endif
+
   
   // don't generate mask for blocks with small depth range (encoder decision)
@@ -790,10 +752,5 @@
   
   AOF(uiWidth==uiHeight);
-#if SEC_DBBP_DMM4_THRESHOLD_I0076
   Int iMean = iSumDepth >> 2;
-#else
-  Int iSizeInBits = g_aucConvertToBit[uiWidth]+2;
-  Int iMean = iSumDepth >> iSizeInBits*2;       // iMean /= (uiWidth*uiHeight);
-#endif
   
   // start again for segmentation
@@ -842,9 +799,5 @@
 }
 
-#if SHARP_DBBP_SIMPLE_FLTER_I0109
 Void TComPrediction::combineSegmentsWithMask( TComYuv* pInYuv[2], TComYuv* pOutYuv, Bool* pMask, UInt uiWidth, UInt uiHeight, UInt uiPartAddr, UInt partSize )
-#else
-Void TComPrediction::combineSegmentsWithMask( TComYuv* pInYuv[2], TComYuv* pOutYuv, Bool* pMask, UInt uiWidth, UInt uiHeight, UInt uiPartAddr )
-#endif
 {
   Pel*  piSrc[2]    = {pInYuv[0]->getLumaAddr(uiPartAddr), pInYuv[1]->getLumaAddr(uiPartAddr)};
@@ -854,7 +807,4 @@
   
   UInt  uiMaskStride= MAX_CU_SIZE;
-#if !SHARP_DBBP_SIMPLE_FLTER_I0109
-  Pel  filSrc = 0;
-#endif
   Pel* tmpTar = 0;
   tmpTar = (Pel *)xMalloc(Pel, uiWidth*uiHeight);
@@ -880,5 +830,4 @@
   }
   
-#if SHARP_DBBP_SIMPLE_FLTER_I0109
   if (partSize == SIZE_Nx2N)
   {
@@ -917,39 +866,4 @@
     }
   }
-#else
-  for (Int y=0; y<uiHeight; y++)
-  {
-    for (Int x=0; x<uiWidth; x++)
-    {
-      Bool t = (y==0)?pMaskStart[y*uiMaskStride+x]:pMaskStart[(y-1)*uiMaskStride+x];
-      Bool l = (x==0)?pMaskStart[y*uiMaskStride+x]:pMaskStart[y*uiMaskStride+x-1];
-      Bool b = (y==uiHeight-1)?pMaskStart[y*uiMaskStride+x]:pMaskStart[(y+1)*uiMaskStride+x];
-      Bool r = (x==uiWidth-1)?pMaskStart[y*uiMaskStride+x]:pMaskStart[y*uiMaskStride+x+1];
-      Bool c =pMaskStart[y*uiMaskStride+x];
-
-      Pel left, right, top, bottom;
-      left   = (x==0)          ? tmpTar[y*uiWidth+x] : tmpTar[y*uiWidth+x-1];
-      right  = (x==uiWidth-1)  ? tmpTar[y*uiWidth+x] : tmpTar[y*uiWidth+x+1];
-      top    = (y==0)          ? tmpTar[y*uiWidth+x] : tmpTar[(y-1)*uiWidth+x];
-      bottom = (y==uiHeight-1) ? tmpTar[y*uiWidth+x] : tmpTar[(y+1)*uiWidth+x];
-
-      if(!((l&&r&&c) || (!l&&!r&&!c)))
-      {
-        filSrc = Clip3( Pel( 0 ), Pel( 255 ), Pel(( left + (tmpTar[y*uiWidth+x] << 1) + right ) >> 2 ));
-      }
-      else
-      {
-        filSrc = tmpTar[y*uiWidth+x];
-      }
-
-      if(!((t&&b&&c) || (!t&&!b&&!c)))
-      {
-        filSrc = Clip3( Pel( 0 ), Pel( 255 ), Pel(( top + (filSrc << 1) + bottom ) >> 2 ));
-      }
-      piDst[x] = filSrc;
-    }
-    piDst     += uiDstStride;
-  }
-#endif
 
   if ( tmpTar    ) { xFree(tmpTar);             tmpTar        = NULL; }
@@ -989,5 +903,4 @@
   }
 
-#if SHARP_DBBP_SIMPLE_FLTER_I0109
   if (partSize == SIZE_Nx2N)
   {
@@ -1056,51 +969,5 @@
     }
   }
-#else
-  for (Int y=0; y<uiHeightC; y++)
-  {
-    for (Int x=0; x<uiWidthC; x++)
-    {
-      Bool t = (y==0)?pMaskStart[y*2*uiMaskStride+x*2]:pMaskStart[(y-1)*2*uiMaskStride+x*2];
-      Bool l = (x==0)?pMaskStart[y*2*uiMaskStride+x*2]:pMaskStart[y*2*uiMaskStride+(x-1)*2];
-      Bool b = (y==uiHeightC-1)?pMaskStart[y*2*uiMaskStride+x*2]:pMaskStart[(y+1)*2*uiMaskStride+x*2];
-      Bool r = (x==uiWidthC-1)?pMaskStart[y*2*uiMaskStride+x*2]:pMaskStart[y*2*uiMaskStride+(x+1)*2];
-      Bool c =pMaskStart[y*2*uiMaskStride+x*2];
-
-      Pel leftU, rightU, topU, bottomU;
-      leftU   = (x==0)           ? tmpTarU[y*uiWidthC+x] : tmpTarU[y*uiWidthC+x-1];
-      rightU  = (x==uiWidthC-1)  ? tmpTarU[y*uiWidthC+x] : tmpTarU[y*uiWidthC+x+1];
-      topU    = (y==0)           ? tmpTarU[y*uiWidthC+x] : tmpTarU[(y-1)*uiWidthC+x];
-      bottomU = (y==uiHeightC-1) ? tmpTarU[y*uiWidthC+x] : tmpTarU[(y+1)*uiWidthC+x];
-
-      Pel leftV, rightV, topV, bottomV;
-      leftV   = (x==0)           ? tmpTarV[y*uiWidthC+x] : tmpTarV[y*uiWidthC+x-1];
-      rightV  = (x==uiWidthC-1)  ? tmpTarV[y*uiWidthC+x] : tmpTarV[y*uiWidthC+x+1];
-      topV    = (y==0)           ? tmpTarV[y*uiWidthC+x] : tmpTarV[(y-1)*uiWidthC+x];
-      bottomV = (y==uiHeightC-1) ? tmpTarV[y*uiWidthC+x] : tmpTarV[(y+1)*uiWidthC+x];
-
-      if(!((l&&r&&c) || (!l&&!r&&!c)))
-      {
-        filSrcU = Clip3( Pel( 0 ), Pel( 255 ), Pel(( leftU + (tmpTarU[y*uiWidthC+x] << 1) + rightU ) >> 2 ));
-        filSrcV = Clip3( Pel( 0 ), Pel( 255 ), Pel(( leftV + (tmpTarV[y*uiWidthC+x] << 1) + rightV ) >> 2 ));
-      }
-      else
-      {
-        filSrcU = tmpTarU[y*uiWidthC+x];
-        filSrcV = tmpTarV[y*uiWidthC+x];
-      }
-
-      if(!((t&&b&&c) || (!t&&!b&&!c)))
-      {
-        filSrcU = Clip3( Pel( 0 ), Pel( 255 ), Pel(( topU + (filSrcU << 1) + bottomU ) >> 2 ));
-        filSrcV = Clip3( Pel( 0 ), Pel( 255 ), Pel(( topV + (filSrcV << 1) + bottomV ) >> 2 ));
-      }
-
-      piDstU[x] = filSrcU;
-      piDstV[x] = filSrcV;
-    }
-    piDstU      += uiDstStrideC;
-    piDstV      += uiDstStrideC;
-  }
-#endif
+
   if ( tmpTarU    ) { xFree(tmpTarU);             tmpTarU        = NULL; }
   if ( tmpTarV    ) { xFree(tmpTarV);             tmpTarV        = NULL; }
@@ -1475,11 +1342,7 @@
   pcCU->clipMv(cMv);
   TComPicYuv* pcPicYuvRef = pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec();
-#if QC_I0129_ARP_FIX
   xPredInterLumaBlk  ( pcCU, pcPicYuvRef, uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi || ( dW > 0 ), true );
   xPredInterChromaBlk( pcCU, pcPicYuvRef, uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi || ( dW > 0 ), true );
-#else
-  xPredInterLumaBlk  ( pcCU, pcPicYuvRef, uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi, true );
-  xPredInterChromaBlk( pcCU, pcPicYuvRef, uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi, true );
-#endif
+
   if( dW > 0 )
   {
@@ -1489,45 +1352,25 @@
     TComMv cMVwithDisparity = cMv + cDistparity.m_acNBDV;
     pcCU->clipMv(cMVwithDisparity);
-#if SHARP_ARP_CHROMA_I0104
     if (iWidth <= 8)
     {
       pYuvB0->clear(); pYuvB1->clear();
     }
-#endif
 
     assert ( cDistparity.bDV );
     
-#if NTT_BUG_FIX_TK54
     TComMv cNBDV = cDistparity.m_acNBDV;
     pcCU->clipMv( cNBDV );
     
     pcPicYuvRef = pcPicYuvBaseCol->getPicYuvRec();
-#if QC_I0129_ARP_FIX
     xPredInterLumaBlk  ( pcCU, pcPicYuvRef, uiPartAddr, &cNBDV, iWidth, iHeight, pYuvB0, true, true );
-#if SHARP_ARP_CHROMA_I0104
     if (iWidth > 8)
-#endif
-    xPredInterChromaBlk( pcCU, pcPicYuvRef, uiPartAddr, &cNBDV, iWidth, iHeight, pYuvB0, true, true );
-#else
-    xPredInterLumaBlk  ( pcCU, pcPicYuvRef, uiPartAddr, &cNBDV, iWidth, iHeight, pYuvB0, bi, true );
-    xPredInterChromaBlk( pcCU, pcPicYuvRef, uiPartAddr, &cNBDV, iWidth, iHeight, pYuvB0, bi, true );
-#endif
-#else
-    pcPicYuvRef = pcPicYuvBaseCol->getPicYuvRec();
-    xPredInterLumaBlk  ( pcCU, pcPicYuvRef, uiPartAddr, &cDistparity.m_acNBDV, iWidth, iHeight, pYuvB0, bi, true );
-    xPredInterChromaBlk( pcCU, pcPicYuvRef, uiPartAddr, &cDistparity.m_acNBDV, iWidth, iHeight, pYuvB0, bi, true );
-#endif
+      xPredInterChromaBlk( pcCU, pcPicYuvRef, uiPartAddr, &cNBDV, iWidth, iHeight, pYuvB0, true, true );
     
     pcPicYuvRef = pcPicYuvBaseRef->getPicYuvRec();
-#if QC_I0129_ARP_FIX
     xPredInterLumaBlk  ( pcCU, pcPicYuvRef, uiPartAddr, &cMVwithDisparity, iWidth, iHeight, pYuvB1, true, true );
-#if SHARP_ARP_CHROMA_I0104
+  
     if (iWidth > 8)
-#endif
-    xPredInterChromaBlk( pcCU, pcPicYuvRef, uiPartAddr, &cMVwithDisparity, iWidth, iHeight, pYuvB1, true, true );
-#else
-    xPredInterLumaBlk  ( pcCU, pcPicYuvRef, uiPartAddr, &cMVwithDisparity, iWidth, iHeight, pYuvB1, bi, true );
-    xPredInterChromaBlk( pcCU, pcPicYuvRef, uiPartAddr, &cMVwithDisparity, iWidth, iHeight, pYuvB1, bi, true );
-#endif
+      xPredInterChromaBlk( pcCU, pcPicYuvRef, uiPartAddr, &cMVwithDisparity, iWidth, iHeight, pYuvB1, true, true );
+    
     pYuvB0->subtractARP( pYuvB0 , pYuvB1 , uiPartAddr , iWidth , iHeight );
 
@@ -1540,5 +1383,4 @@
 }
 
-#if QC_I0051_ARP_SIMP
 Bool TComPrediction::xCheckBiInterviewARP( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eBaseRefPicList, TComPic*& pcPicYuvCurrTRef, TComMv& cBaseTMV, Int& iCurrTRefPoc )
 {
@@ -1572,9 +1414,6 @@
         Int  iCurrRefPOC = pcPicYuvBaseTRef->getPOC();
         Int  iCurrRef    = pcCU->getSlice()->getFirstTRefIdx(eRefPicListCurr);
-#if MTK_I0072_IVARP_SCALING_FIX
+
         if( iCurrRef >= 0 && iCurrPOC != iCurrRefPOC)
-#else
-        if( iCurrRef >= 0)
-#endif
         {
           pcPicYuvCurrTRef =  pcCU->getSlice()->getRefPic(eRefPicListCurr,iCurrRef);  
@@ -1608,5 +1447,4 @@
   return false;
 }
-#endif
 
 Void TComPrediction::xPredInterUniARPviewRef( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi, TComMvField * pNewMvFiled )
@@ -1643,5 +1481,4 @@
   pcYuvBaseCol->getCUAddrAndPartIdx( irefPUX, irefPUY, uiLCUAddr, uiAbsPartAddr);
   TComDataCU *pColCU = pcPicYuvBaseCol->getCU( uiLCUAddr );
-#if QC_I0051_ARP_SIMP
   if( pcCU->getSlice()->isInterB() && !pcCU->getSlice()->getIsDepth() )
   {
@@ -1708,7 +1545,4 @@
 
   if( !pColCU->isIntra( uiAbsPartAddr ) && !bTMVAvai )
-#else
-  if(!pColCU->isIntra(uiAbsPartAddr))
-#endif
   {
     TComMvField puMVField;
@@ -1723,9 +1557,5 @@
         Int  iCurrRefPOC = pcPicYuvBaseTRef->getPOC();
         Int  iCurrRef    = pcCU->getSlice()->getFirstTRefIdx(eRefPicListCurr);
-#if MTK_I0072_IVARP_SCALING_FIX
         if (iCurrRef >= 0 && iCurrRefPOC != iCurrPOC)
-#else
-        if( iCurrRef >= 0)
-#endif
         {
           pcPicYuvCurrTRef =  pcCU->getSlice()->getRefPic(eRefPicListCurr,iCurrRef);  
@@ -1754,11 +1584,8 @@
     pcPicYuvCurrTRef =  pcCU->getSlice()->getRefPic  (eRefPicList,  pcCU->getSlice()->getFirstTRefIdx(eRefPicList));      
   }
-#if QC_I0129_ARP_FIX
+
   xPredInterLumaBlk  ( pcCU, pcYuvBaseCol, uiPartAddr, &cTempDMv, iWidth, iHeight, rpcYuvPred, bi || ( dW > 0 && bTMVAvai ),        bTMVAvai);
   xPredInterChromaBlk( pcCU, pcYuvBaseCol, uiPartAddr, &cTempDMv, iWidth, iHeight, rpcYuvPred, bi || ( dW > 0 && bTMVAvai ),        bTMVAvai);
-#else
-  xPredInterLumaBlk  ( pcCU, pcYuvBaseCol, uiPartAddr, &cTempDMv, iWidth, iHeight, rpcYuvPred, bi,        bTMVAvai);
-  xPredInterChromaBlk( pcCU, pcYuvBaseCol, uiPartAddr, &cTempDMv, iWidth, iHeight, rpcYuvPred, bi,        bTMVAvai);
-#endif
+
   if( dW > 0 && bTMVAvai ) 
   {
@@ -1771,28 +1598,19 @@
     pcCU->clipMv(cBaseTMV);
     pcCU->clipMv(cTempMv);
-#if SHARP_ARP_CHROMA_I0104
+
     if (iWidth <= 8)
     {
       pYuvCurrTRef->clear(); pYuvBaseTRef->clear();
     }
-#endif
-#if QC_I0129_ARP_FIX
     xPredInterLumaBlk  ( pcCU, pcYuvCurrTref, uiPartAddr, &cBaseTMV, iWidth, iHeight, pYuvCurrTRef, true,   true);
-#if SHARP_ARP_CHROMA_I0104
+
     if (iWidth > 8)
-#endif
-    xPredInterChromaBlk( pcCU, pcYuvCurrTref, uiPartAddr, &cBaseTMV, iWidth, iHeight, pYuvCurrTRef, true,   true);
+      xPredInterChromaBlk( pcCU, pcYuvCurrTref, uiPartAddr, &cBaseTMV, iWidth, iHeight, pYuvCurrTRef, true,   true);
+
     xPredInterLumaBlk  ( pcCU, pcYuvBaseTref, uiPartAddr, &cTempMv,  iWidth, iHeight, pYuvBaseTRef, true,   true); 
-#if SHARP_ARP_CHROMA_I0104
+
     if (iWidth > 8)
-#endif
-    xPredInterChromaBlk( pcCU, pcYuvBaseTref, uiPartAddr, &cTempMv,  iWidth, iHeight, pYuvBaseTRef, true,   true); 
-#else
-    xPredInterLumaBlk  ( pcCU, pcYuvCurrTref, uiPartAddr, &cBaseTMV, iWidth, iHeight, pYuvCurrTRef, bi,   true);
-    xPredInterChromaBlk( pcCU, pcYuvCurrTref, uiPartAddr, &cBaseTMV, iWidth, iHeight, pYuvCurrTRef, bi,   true);
-    xPredInterLumaBlk  ( pcCU, pcYuvBaseTref, uiPartAddr, &cTempMv,  iWidth, iHeight, pYuvBaseTRef, bi,   true); 
-    xPredInterChromaBlk( pcCU, pcYuvBaseTref, uiPartAddr, &cTempMv,  iWidth, iHeight, pYuvBaseTRef, bi,   true); 
-
-#endif
+      xPredInterChromaBlk( pcCU, pcYuvBaseTref, uiPartAddr, &cTempMv,  iWidth, iHeight, pYuvBaseTRef, true,   true); 
+
     pYuvCurrTRef->subtractARP( pYuvCurrTRef , pYuvBaseTRef , uiPartAddr , iWidth , iHeight );  
     if(dW == 2)
@@ -1803,5 +1621,4 @@
   }
 }
-
 #endif
 
@@ -2328,18 +2145,7 @@
   Int iRecStride = ( eType == TEXT_LUMA ) ? pRecPic->getStride() : pRecPic->getCStride();
   Int iRefStride = ( eType == TEXT_LUMA ) ? pRefPic->getStride() : pRefPic->getCStride();
-#if SEC_IC_NEIGHBOR_CLIP_I0080
   Int iRefOffset, iHor, iVer;
-#else
-  Int iCUPelX, iCUPelY, iRefX, iRefY, iRefOffset, iHor, iVer;
-
-  iCUPelX = pcCU->getCUPelX() + g_auiRasterToPelX[g_auiZscanToRaster[pcCU->getZorderIdxInCU()]];
-  iCUPelY = pcCU->getCUPelY() + g_auiRasterToPelY[g_auiZscanToRaster[pcCU->getZorderIdxInCU()]];
-#endif
   iHor = pcCU->getSlice()->getIsDepth() ? pMv->getHor() : ( ( pMv->getHor() + 2 ) >> 2 );
   iVer = pcCU->getSlice()->getIsDepth() ? pMv->getVer() : ( ( pMv->getVer() + 2 ) >> 2 );
-#if !SEC_IC_NEIGHBOR_CLIP_I0080
-  iRefX   = iCUPelX + iHor;
-  iRefY   = iCUPelY + iVer;
-#endif
   if( eType != TEXT_LUMA )
   {
@@ -2357,9 +2163,5 @@
   Int precShift = std::max(0, (( eType == TEXT_LUMA ) ? g_bitDepthY : g_bitDepthC) - 12);
 
-#if SEC_IC_NEIGHBOR_CLIP_I0080
   if( pcCU->getPUAbove( uiTmpPartIdx, pcCU->getZorderIdxInCU() ) )
-#else
-  if( pcCU->getPUAbove( uiTmpPartIdx, pcCU->getZorderIdxInCU() ) && iCUPelY > 0 && iRefY > 0 )
-#endif
   {
     iRefOffset = iHor + iVer * iRefStride - iRefStride;
@@ -2391,9 +2193,5 @@
   }
 
-#if SEC_IC_NEIGHBOR_CLIP_I0080
   if( pcCU->getPULeft( uiTmpPartIdx, pcCU->getZorderIdxInCU() ) )
-#else
-  if( pcCU->getPULeft( uiTmpPartIdx, pcCU->getZorderIdxInCU() ) && iCUPelX > 0 && iRefX > 0 )
-#endif
   {
     iRefOffset = iHor + iVer * iRefStride - 1;
@@ -2429,5 +2227,4 @@
   }
 
-#if FIX_TICKET_71
   if( iCountShift == 0 )
   {
@@ -2436,5 +2233,4 @@
     return;
   }
-#endif
 
   xy += xx >> IC_REG_COST_SHIFT;
@@ -2553,5 +2349,5 @@
   // find contour for texture luma block
   UInt iDC = 0;
-#if SEC_DBBP_DMM4_THRESHOLD_I0076
+
   iDC  = piRefBlkY[ 0 ];
   iDC += piRefBlkY[ uiWidth - 1 ];
@@ -2559,13 +2355,4 @@
   iDC += piRefBlkY[ uiWidth * (uiHeight - 1) + uiWidth - 1 ];
   iDC = iDC >> 2;
-#else
-  for( UInt k = 0; k < (uiWidth*uiHeight); k++ ) 
-  { 
-    iDC += piRefBlkY[k]; 
-  }
-
-  Int cuMaxLog2Size = g_aucConvertToBit[g_uiMaxCUWidth]+2;   // 
-  iDC = iDC >> (cuMaxLog2Size - pcCU->getDepth(0))*2;        //  iDC /= (uiWidth*uiHeight);
-#endif
 
   piRefBlkY = cTempYuv.getLumaAddr();
Index: trunk/source/Lib/TLibCommon/TComPrediction.h
===================================================================
--- trunk/source/Lib/TLibCommon/TComPrediction.h	(revision 1067)
+++ trunk/source/Lib/TLibCommon/TComPrediction.h	(revision 1084)
@@ -90,7 +90,5 @@
 #if H_3D_ARP
   Void xPredInterUniARP         ( TComDataCU* pcCU,                          UInt uiPartAddr,               Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi=false, TComMvField * pNewMvFiled = NULL );
-#if QC_I0051_ARP_SIMP
   Bool xCheckBiInterviewARP     ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eBaseRefPicList, TComPic*& pcPicYuvCurrTRef, TComMv& cBaseTMV, Int& iCurrTRefPoc );
-#endif
   Void xPredInterUniARPviewRef( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi, TComMvField * pNewMvFiled = NULL );
 #endif
@@ -179,9 +177,5 @@
   PartSize      getPartitionSizeFromDepth(Pel* pDepthPels, UInt uiDepthStride, UInt uiSize);
   Bool          getSegmentMaskFromDepth( Pel* pDepthPels, UInt uiDepthStride, UInt uiWidth, UInt uiHeight, Bool* pMask );
-#if SHARP_DBBP_SIMPLE_FLTER_I0109
   Void          combineSegmentsWithMask( TComYuv* pInYuv[2], TComYuv* pOutYuv, Bool* pMask, UInt uiWidth, UInt uiHeight, UInt uiPartAddr, UInt partSize );
-#else
-  Void          combineSegmentsWithMask( TComYuv* pInYuv[2], TComYuv* pOutYuv, Bool* pMask, UInt uiWidth, UInt uiHeight, UInt uiPartAddr = 0 );
-#endif
 #endif
 
Index: trunk/source/Lib/TLibCommon/TComRom.cpp
===================================================================
--- trunk/source/Lib/TLibCommon/TComRom.cpp	(revision 1067)
+++ trunk/source/Lib/TLibCommon/TComRom.cpp	(revision 1084)
@@ -355,13 +355,7 @@
   HALF_PEL,    //   8x8
   FULL_PEL,    //  16x16
-#if SHARP_DMM1_I0110
   FULL_PEL,    //  32x32
   FULL_PEL,    //  64x64
   FULL_PEL     // 128x128
-#else
-  DOUBLE_PEL,  //  32x32
-  DOUBLE_PEL,  //  64x64
-  DOUBLE_PEL   // 128x128
-#endif
 };
 
@@ -374,7 +368,5 @@
      0,    4,    7,    8,    8,    0 };
 
-#if SHARP_DMM1_I0110
 Bool g_wedgePattern[32*32];
-#endif
 
 extern std::vector< std::vector<TComWedgelet> >   g_dmmWedgeLists;
@@ -388,11 +380,4 @@
 
 Char  g_aucConvertToBit  [ MAX_CU_SIZE+1 ];
-#if !MTK_LOW_LATENCY_IC_ENCODING_H0086_FIX
-#if H_3D_IC
-UInt g_aICEnableCANDIDATE[10] = { 0, };
-UInt g_aICEnableNUM[ 10 ] = { 0, };
-Int g_lastlayer=0;
-#endif
-#endif
 #if ENC_DEC_TRACE
 FILE*  g_hTrace = NULL;
@@ -676,9 +661,5 @@
   if( !g_dmmWedgeLists.empty() ) return;
 
-#if SHARP_DMM1_I0110
   for( UInt ui = g_aucConvertToBit[DIM_MIN_SIZE]; ui < (g_aucConvertToBit[DIM_MAX_SIZE]); ui++ )
-#else
-  for( UInt ui = g_aucConvertToBit[DIM_MIN_SIZE]; ui < (g_aucConvertToBit[DIM_MAX_SIZE]+1); ui++ )
-#endif
   {
     UInt uiWedgeBlockSize = ((UInt)DIM_MIN_SIZE)<<ui;
@@ -764,7 +745,4 @@
   switch( eWedgeRes )
   {
-#if !SHARP_DMM1_I0110
-  case( DOUBLE_PEL ): { uiBlockSize = (uiWidth>>1); break; }
-#endif
   case(   FULL_PEL ): { uiBlockSize =  uiWidth;     break; }
   case(   HALF_PEL ): { uiBlockSize = (uiWidth<<1); break; }
Index: trunk/source/Lib/TLibCommon/TComRom.h
===================================================================
--- trunk/source/Lib/TLibCommon/TComRom.h	(revision 1067)
+++ trunk/source/Lib/TLibCommon/TComRom.h	(revision 1084)
@@ -166,7 +166,5 @@
 extern const UChar                                           g_dmm3IntraTabIdxBits[6];
 
-#if SHARP_DMM1_I0110
 extern Bool                                                  g_wedgePattern[32*32];
-#endif 
 
 extern       std::vector< std::vector<TComWedgelet> >        g_dmmWedgeLists;
@@ -230,11 +228,4 @@
 
 extern       Char   g_aucConvertToBit  [ MAX_CU_SIZE+1 ];   // from width to log2(width)-2
-#if !MTK_LOW_LATENCY_IC_ENCODING_H0086_FIX
-#if H_3D_IC
-extern UInt g_aICEnableCANDIDATE[10];
-extern UInt g_aICEnableNUM[ 10 ]; //10 layers
-extern Int  g_lastlayer;
-#endif
-#endif
 
 #ifndef ENC_DEC_TRACE
Index: trunk/source/Lib/TLibCommon/TComSlice.cpp
===================================================================
--- trunk/source/Lib/TLibCommon/TComSlice.cpp	(revision 1067)
+++ trunk/source/Lib/TLibCommon/TComSlice.cpp	(revision 1084)
@@ -103,8 +103,6 @@
 , m_temporalLayerNonReferenceFlag ( false )
 , m_enableTMVPFlag                ( true )
-#if I0044_SLICE_TMVP
+#if H_MV
 , m_availableForTMVPRefFlag       ( true )
-#endif
-#if H_MV
 , m_refPicSetInterLayer0           ( NULL )
 , m_refPicSetInterLayer1           ( NULL )
@@ -142,5 +140,5 @@
 , m_depthToDisparityF             ( NULL )
 #endif
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
 , m_bApplySingleDepthMode         (false)
 #endif
@@ -650,9 +648,5 @@
   
   TComPic**             refPicSetStCurr    [2] = { RefPicSetStCurr0, RefPicSetStCurr1 };
-#if FIX_WARNING
   Int numPocStCurr[2] = { (Int)NumPocStCurr0, (Int)NumPocStCurr1 }; 
-#else
-  Int numPocStCurr[2] = { NumPocStCurr0, NumPocStCurr1 }; 
-#endif
 
   for (Int li = 0; li < ((m_eSliceType==B_SLICE) ? 2 : 1); li++)
@@ -728,7 +722,5 @@
 
         assert( rpsCurrList[li][ orgIdx ] != NULL ); 
-#if DISCARDABLE_PIC_RPS
         assert( rpsCurrList[li][ orgIdx ]->getSlice(0)->getDiscardableFlag() == 0 );    // Inter-layer RPS shall not contain picture with discardable_flag = 1.
-#endif
         m_apcRefPicList    [li][rIdx] = rpsCurrList    [li][ orgIdx ];
         m_bIsUsedAsLongTerm[li][rIdx] = usedAsLongTerm [li][ orgIdx ] ; 
@@ -1105,5 +1097,5 @@
   }
 #endif
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
   m_bApplySingleDepthMode = pSrc->m_bApplySingleDepthMode;
 #endif
@@ -1881,7 +1873,5 @@
 #if H_MV
   m_vpsBaseLayerInternalFlag = true; 
-#if H_MV_HLS10_GEN_VSP_BASE_LAYER_AVAIL
   m_vpsBaseLayerAvailableFlag = true; 
-#endif
 #endif
 
@@ -1909,16 +1899,7 @@
   {
     m_layerSetIdxForOlsMinus1[i]  = -1; 
-#if !H_MV_HLS10_PTL
-    m_profileLevelTierIdx[i]      = 0; 
-#endif
     for ( Int j = 0; j < MAX_VPS_NUH_LAYER_ID_PLUS1; j++)
     {
-#if H_MV_HLS10_PTL
-#if H_MV_HLS10_PTL_FIX
       m_profileTierLevelIdx[i][j] = -1; 
-#else
-      m_profileTierLevelIdx[i][j] = false; 
-#endif
-#endif
       m_outputLayerFlag[i][j] = false; 
     }
@@ -1970,12 +1951,6 @@
     m_viewIndex         [i] = -1; 
     m_vpsDepthModesFlag [i] = false;
-#if SEC_HLS_CLEANUP_I0100
     m_ivMvScalingFlag[i] = true; 
-#else
-    m_ivMvScalingFlag = true; 
-#endif
-#if SEPARATE_FLAG_I0085
     m_bIVPFlag [i]      = false;
-#endif
 #endif
 
@@ -1984,12 +1959,8 @@
       m_directDependencyFlag[i][j] = false;
       m_directDependencyType[i][j] = -1; 
-#if H_MV_HLS10_REF_PRED_LAYERS
       m_dependencyFlag  [i][j]    = false; 
       m_idDirectRefLayer[i][j]    = -1; 
       m_idPredictedLayer[i][j]    = -1; 
       m_idRefLayer      [i][j]    = -1; 
-#else
-      m_refLayerId[i][j]           = -1; 
-#endif
       m_maxTidIlRefPicsPlus1[i][j]  = 7;
     }
@@ -2016,5 +1987,5 @@
 #endif
 #endif
-#if MTK_I0099_VPS_EX2
+#if H_3D_QTLPC
     m_bLimQtPredFlag       [ i ] = false;
 #endif
@@ -2028,5 +1999,5 @@
     m_bInterSDCFlag        [ i ] = false;
 #endif
-#if SEPARATE_FLAG_I0085
+#if H_3D
     m_bIVPFlag             [ i ] = false;
 #endif
@@ -2075,8 +2046,6 @@
   assert( getVpsNumRepFormatsMinus1() <= 255 ); 
 
-#if H_MV_HLS10_ADD_LAYERSETS
   // The value of num_add_layer_sets shall be in the range of 0 to 1023, inclusive. 
   assert( getNumAddLayerSets() >= 0 && getNumAddLayerSets() <= 1023 ); 
-#endif
   return true; 
 }
@@ -2111,5 +2080,4 @@
 {
 
-#if H_MV_HLS10_REF_PRED_LAYERS
   for( Int i = 0; i  <=  getMaxLayersMinus1(); i++ )
   {
@@ -2181,95 +2149,6 @@
   }
   m_numIndependentLayers = k;
-#else // H_MV_HLS10_GEN
-
-  for( Int i = 0; i  <= getMaxLayersMinus1(); i++ )
-  {
-    Int iNuhLId = getLayerIdInNuh( i ); 
-    m_numDirectRefLayers[ iNuhLId ] = 0; 
-    for( Int j = 0; j < i; j++ )
-    {
-      if( getDirectDependencyFlag(i , j) )
-      {
-        m_refLayerId[ iNuhLId ][m_numDirectRefLayers[ iNuhLId ]++ ] = getLayerIdInNuh( j );
-      }
-    }
-  }
-
-  for (Int i = 0 ; i < MAX_NUM_LAYER_IDS; i++ )
-  {
-    m_numRefLayers[i] = 0; 
-  }
-
-  for (Int currLayerId = 0; currLayerId <= 62; currLayerId++ ) 
-  {
-    for (Int i = 0 ; i < MAX_NUM_LAYER_IDS; i++ )
-    {
-      m_recursiveRefLayerFlag[currLayerId][i] = 0; 
-    }
-  }
-
-  for( Int i = 0; i  <=  getMaxLayersMinus1(); i++ )
-  {
-    Int iNuhLId = getLayerIdInNuh( i );
-    xSetRefLayerFlags( iNuhLId );
-    for( Int j = 0; j < 63; j++ )
-    {
-      m_numRefLayers[ iNuhLId ]  +=  m_recursiveRefLayerFlag[ iNuhLId ][ j ];
-    }
-  }
-  
-  for( Int i = 0; i <= getMaxLayersMinus1(); i++ )  // Bug in spec "<" instead of "<=" 
-  {
-    Int iNuhLId = getLayerIdInNuh( i );
-    Int predIdx = 0;
-    for( Int j = iNuhLId + 1; j < 63; j++ )
-    {
-      if( m_recursiveRefLayerFlag[ j ][ iNuhLId ] )
-      {
-        m_predictedLayerId[ iNuhLId ][ predIdx++ ] = j;
-      }
-    }
-    m_numPredictedLayers[ iNuhLId ] = predIdx;
-  }
-  
-  Bool countedLayerIdxFlag[ MAX_NUM_LAYERS ]; 
-  for( Int i = 0; i  <=  getMaxLayersMinus1(); i++ )
-  {
-    countedLayerIdxFlag[ i ] = 0;
-  }
-  for( Int i = 0, k = 0; i  <=  getMaxLayersMinus1(); i++ )
-  {
-    Int iNuhLId = getLayerIdInNuh( i );
-    if( m_numDirectRefLayers[ iNuhLId ]  ==  0 )
-    {
-      m_treePartitionLayerIdList[ k ][ 0 ] = iNuhLId;
-      m_numLayersInTreePartition[ k ]      = 1;
-
-      for( Int j = 0; j < m_numPredictedLayers[ iNuhLId ]; j++ )  
-      {
-        if( !countedLayerIdxFlag[ getLayerIdInVps( m_predictedLayerId[ iNuhLId ][ j ] ) ] )    
-        {
-          m_treePartitionLayerIdList[ k ][ m_numLayersInTreePartition[ k ] ] = m_predictedLayerId[ iNuhLId ][ j ];
-          m_numLayersInTreePartition[ k ]++;
-          countedLayerIdxFlag[ getLayerIdInVps( m_predictedLayerId[ iNuhLId ][ j ] ) ] = 1;
-        }
-      }
-      k++;
-
-      m_numIndependentLayers = k;
-    }
-  }
-#endif // H_MV_HLS10_GEN
-}
-
-#if !H_MV_HLS10_REF_PRED_LAYERS
-Int TComVPS::getRefLayerId( Int layerIdInNuh, Int idx )
-{
-  assert( idx >= 0 && idx < m_numDirectRefLayers[layerIdInNuh] );     
-  Int refLayerIdInNuh = m_refLayerId[ layerIdInNuh ][ idx ];    
-  assert ( refLayerIdInNuh >= 0 ); 
-  return refLayerIdInNuh;
-}
-#endif
+}
+
 
 Int TComVPS::getScalabilityId( Int layerIdInVps, ScalabilityType scalType )
@@ -2309,7 +2188,5 @@
   for ( i = 0; i < iNumViews ; i++ )
   {
-#if H_3D_FIX_UNINIT
     m_bCamParPresent[i] = false; 
-#endif
     m_bCamParInSliceHeader[i] = false; 
     m_aaaiCodedScale[i] = new Int*[ 2 ];
@@ -2424,9 +2301,5 @@
 {
   assert( lsIdx >= 0 ); 
-#if H_MV_HLS10_ADD_LAYERSETS
   assert( lsIdx <= getNumLayerSets() ); 
-#else
-  assert( lsIdx <= getVpsNumLayerSetsMinus1() ); 
-#endif
   return (Int) m_layerSetLayerIdList[ lsIdx ].size(); 
 }
@@ -2452,25 +2325,4 @@
 }
 
-#if !H_MV_HLS10_REF_PRED_LAYERS
-Bool TComVPS::getInDirectDependencyFlag( Int depLayeridInVps, Int refLayeridInVps, Int depth /*= 0 */ )
-{
-#if H_MV_HLS10_REF_PRED_LAYERS
-  // TBD: Remove getInDirectDependencyFlag entirely.
-  return getDependencyFlag( depLayeridInVps, refLayeridInVps );
-#else
-  assert( depth < 65 ); 
-  Bool dependentFlag = getDirectDependencyFlag( depLayeridInVps, refLayeridInVps ); 
-
-  for( Int i = 0; i < depLayeridInVps && !dependentFlag; i++ )
-  {
-    if ( getDirectDependencyFlag( depLayeridInVps, i ) )
-    {
-      dependentFlag = getInDirectDependencyFlag( i, refLayeridInVps, depth++ ); 
-    }
-  }
-  return dependentFlag;
-#endif
-}
-#endif
 
 Void TComVPS::deriveLayerSetLayerIdList()
@@ -2501,12 +2353,8 @@
   for( Int j = 0; j < getNumLayersInIdList( lsIdx ); j++ )
   {
-#if H_MV_HLS10_NESSECARY_LAYER
     if ( getNecessaryLayerFlag( i , j ))
     {
-#endif
       m_targetDecLayerIdLists[i].push_back( m_layerSetLayerIdList[ lsIdx ][ j ] ); 
-#if H_MV_HLS10_NESSECARY_LAYER
-    }
-#endif
+    }
 
     if( getOutputLayerFlag( i, j  ))
@@ -2557,28 +2405,4 @@
 }
 
-#if !H_MV_HLS10_ADD_LAYERSETS
-Void TComVPS::inferDbpSizeLayerSetZero( TComSPS* sps, Bool encoder )
-{
-  for( Int j = 0; j <= getMaxSubLayersInLayerSetMinus1( 0 ); j++ )
-  {
-    Int maxDecPicBufferingMinus1 = sps->getMaxDecPicBuffering( j ) - 1; 
-    Int numReorderPics           = sps->getNumReorderPics    ( j ); 
-    Int maxLatencyIncreasePlus1  = sps->getMaxLatencyIncrease( j ); 
-
-    if ( encoder )
-    {
-      assert( getDpbSize()->getMaxVpsDecPicBufferingMinus1(0, 0, j ) == maxDecPicBufferingMinus1 );
-      assert( getDpbSize()->getMaxVpsNumReorderPics       (0,    j ) == numReorderPics           );
-      assert( getDpbSize()->getMaxVpsLatencyIncreasePlus1 (0,    j ) == maxLatencyIncreasePlus1  );
-    }
-    else
-    {
-      getDpbSize()->setMaxVpsDecPicBufferingMinus1(0, 0, j, maxDecPicBufferingMinus1 );
-      getDpbSize()->setMaxVpsNumReorderPics       (0,    j, numReorderPics           );
-      getDpbSize()->setMaxVpsLatencyIncreasePlus1 (0,    j, maxLatencyIncreasePlus1  );        
-    }     
-  }
-}
-#endif
 Bool TComVPS::getAltOutputLayerFlagVar( Int i )
 {
@@ -2594,42 +2418,6 @@
 }
 
-#if !H_MV_HLS10_MAXNUMPICS
-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;
-}
-#endif
-
-#if !H_MV_HLS10_REF_PRED_LAYERS
-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
-
-#if H_MV_HLS10_PTL_FIX
+
+
 Int TComVPS::inferProfileTierLevelIdx(Int i, Int j)
 {
@@ -2651,7 +2439,5 @@
   return ptlIdx;
 }
-#endif
-
-#if H_MV_HLS10_ADD_LAYERSETS
+
 Void TComVPS::deriveAddLayerSetLayerIdList(Int i)
 {
@@ -2676,7 +2462,5 @@
 }
 
-#endif
-
-#if H_MV_HLS10_NESSECARY_LAYER
+
 Void TComVPS::deriveNecessaryLayerFlags(Int olsIdx)
 {
@@ -2709,7 +2493,5 @@
   }
 }
-#endif
-
-#if H_MV_HLS10_ADD_LAYERSETS
+
 Void TComVPS::printPTL()
 {
@@ -2757,15 +2539,12 @@
 #endif
 
-#if H_MV_HLS10_AUX
   vector<Int> viewOrderIndex;
   vector<Int> auxId;
   vector<Int> dependencyId; 
   vector<Int> viewId; 
-#endif
   for (Int i = 0; i <= getMaxLayersMinus1(); i++ )
   {
     fullArray.push_back( getMaxLayersMinus1() + 1 ); 
     range.push_back( i ); 
-#if H_MV_HLS10_AUX      
     viewOrderIndex.push_back( getViewIndex   ( i ) );
     dependencyId  .push_back( getDependencyId( i ) );
@@ -2774,5 +2553,4 @@
 #if H_3D  
     depthId.push_back( getDepthId( i ) );
-#endif
 #endif
   }
@@ -2787,5 +2565,4 @@
 }
 
-#if H_MV_HLS10_AUX
 Void TComVPS::printScalabilityId()
 {
@@ -2825,5 +2602,4 @@
   std::cout << std::endl;
 }
-#endif
 
 Void TComVPS::printLayerSets()
@@ -2880,5 +2656,4 @@
 }
 
-#endif
 
 #endif // H_MV
@@ -2910,10 +2685,4 @@
 , m_pcmLog2MaxSize            (  5)
 , m_uiPCMLog2MinSize          (  7)
-#if !MTK_I0099_VPS_EX2
-#if H_3D_QTLPC
-, m_bUseQTL                   (false)
-, m_bUsePC                    (false)
-#endif
-#endif
 , m_bitDepthY                 (  8)
 , m_bitDepthC                 (  8)
@@ -2964,20 +2733,4 @@
 #endif
 
-#if !H_MV_HLS10_PPS
-  m_numScaledRefLayerOffsets = 0; 
-
-  for (Int i = 0; i < MAX_NUM_SCALED_REF_LAYERS; i++ )
-  {
-    m_scaledRefLayerId             [i] = -1;
-  }
-
-  for (Int i = 0; i < MAX_NUM_LAYERS; i++ )
-  {
-    m_scaledRefLayerLeftOffset     [i] = 0;
-    m_scaledRefLayerTopOffset      [i] = 0;
-    m_scaledRefLayerRiFghtOffset    [i] = 0;
-    m_scaledRefLayerBottomOffset   [i] = 0;
-  }
-#endif
 #endif
 }
@@ -3120,10 +2873,8 @@
 , m_entropyCodingSyncEnabledFlag   (false)
 , m_loopFilterAcrossTilesEnabledFlag  (true)
-, m_uniformSpacingFlag           (0)
-, m_iNumColumnsMinus1            (0)
-, m_puiColumnWidth               (NULL)
-, m_iNumRowsMinus1               (0)
-, m_puiRowHeight                 (NULL)
-, m_iNumSubstreams             (1)
+, m_uniformSpacingFlag           (false)
+, m_numTileColumnsMinus1         (0)
+, m_numTileRowsMinus1            (0)
+, m_numSubstreams               (1)
 , m_signHideFlag(0)
 , m_cabacInitPresentFlag        (false)
@@ -3158,14 +2909,4 @@
 TComPPS::~TComPPS()
 {
-  if( m_iNumColumnsMinus1 > 0 && m_uniformSpacingFlag == 0 )
-  {
-    if (m_puiColumnWidth) delete [] m_puiColumnWidth; 
-    m_puiColumnWidth = NULL;
-  }
-  if( m_iNumRowsMinus1 > 0 && m_uniformSpacingFlag == 0 )
-  {
-    if (m_puiRowHeight) delete [] m_puiRowHeight;
-    m_puiRowHeight = NULL;
-  }
   delete m_scalingList;
 }
@@ -3186,7 +2927,4 @@
     // allocate some memory and initialize with default mapping
     m_iNumDepthmapValues[i] = ((1 << m_uiDepthViewBitDepth)-1)+1;
-#if !FIX_TICKET_77
-    m_iBitsPerDepthValue[i] = numBitsForValue(m_iNumDepthmapValues[i]);
-#endif
     m_iDepthValue2Idx[i]    = (Int*) xMalloc(Int, m_iNumDepthmapValues[i]);
     m_iIdx2DepthValue[i]    = (Int*) xMalloc(Int, m_iNumDepthmapValues[i]);
@@ -3277,10 +3015,6 @@
   // update DLT variables
   m_iNumDepthmapValues[layerIdInVps] = iNumDepthValues;
-#if !FIX_TICKET_77
-  m_iBitsPerDepthValue[layerIdInVps] = numBitsForValue(m_iNumDepthmapValues[layerIdInVps]);
-#endif
-}
-
-#if H_3D_DELTA_DLT
+}
+
 Void TComDLT::getDeltaDLT( Int layerIdInVps, Int* piDLTInRef, UInt uiDLTInRefNum, Int* piDeltaDLTOut, UInt *puiDeltaDLTOutNum )
 {
@@ -3347,5 +3081,4 @@
   setDepthLUTs(layerIdInVps, aiIdx2DepthValue, uiNumDepthValues);
 }
-#endif
 
 #endif
@@ -3354,9 +3087,5 @@
 Void TComSPS::inferRepFormat( TComVPS* vps, Int layerIdCurr )
 {
-#if H_MV_HLS10_MULTILAYERSPS
   if ( getMultiLayerExtSpsFlag() )
-#else
-  if ( layerIdCurr > 0 )
-#endif
   { 
     Int            repFormatIdx = getUpdateRepFormatFlag() ?  getSpsRepFormatIdx() : vps->getVpsRepFormatIdx( vps->getLayerIdInVps( layerIdCurr ) ) ;
@@ -3374,5 +3103,4 @@
     setBitDepthC             ( repFormat->getBitDepthVpsChromaMinus8() + 8 ); 
     setQpBDOffsetC           ( (Int) (6* ( getBitDepthC() -8 ) ) );
- #if H_MV_HLS10_GEN_VSP_CONF_WIN
     Window &spsConf    = getConformanceWindow();    
 
@@ -3383,11 +3111,6 @@
     spsConf.setWindowTopOffset   ( repFormat->getConfWinVpsTopOffset()     );
     spsConf.setWindowBottomOffset( repFormat->getConfWinVpsBottomOffset()  );    
-#endif
-
-#if H_MV_HLS10_MULTILAYERSPS
+
    if ( getMultiLayerExtSpsFlag() && getUpdateRepFormatFlag() )
-#else 
-   if ( getLayerId() > 0 && getUpdateRepFormatFlag() )
-#endif
     {
       assert( getChromaFormatIdc()      <=  repFormat->getChromaFormatVpsIdc()         ); 
@@ -3423,9 +3146,5 @@
   const std::vector<Int>& targetDecLayerIdList = vps->getTargetDecLayerIdList( vps->olsIdxToLsIdx( targetOptLayerSetIdx )); 
 
-#if H_MV_HLS10_MULTILAYERSPS
   if ( getMultiLayerExtSpsFlag() )
-#else
-  if (getLayerId() > 0 )
-#endif
   {
     Int layerIdx = 0;         
@@ -3445,29 +3164,21 @@
       Int maxDecPicBufferingMinus1 = vps->getDpbSize()->getMaxVpsDecPicBufferingMinus1( targetOptLayerSetIdx, layerIdx, i ) ; 
 
-#if H_MV_HLS10_MULTILAYERSPS
       // This preliminary fix needs to be checked.
       Int maxNumReorderPics       = vps->getDpbSize()->getMaxVpsNumReorderPics( targetOptLayerSetIdx, i ); 
       Int maxLatencyIncreasePlus1 = vps->getDpbSize()->getMaxVpsLatencyIncreasePlus1( targetOptLayerSetIdx, i ); 
-#endif
       if ( encoder )      
       {
         assert( getMaxDecPicBuffering( i ) - 1 == maxDecPicBufferingMinus1 ); 
-#if H_MV_HLS10_MULTILAYERSPS
         // This preliminary fix needs to be checked.
         assert( getNumReorderPics( i )     == maxNumReorderPics       ); 
         assert( getMaxLatencyIncrease( i ) == maxLatencyIncreasePlus1 ); 
-#endif    
 
       }
       else
       {
-#if !H_MV_HLS10_MULTILAYERSPS
-        setMaxDecPicBuffering(i, maxDecPicBufferingMinus1 + 1 ); 
-#else
         // This preliminary fix needs to be checked.
         setMaxDecPicBuffering( maxDecPicBufferingMinus1 + 1 , i); 
         setNumReorderPics    ( maxNumReorderPics, i );
         setMaxLatencyIncrease( maxLatencyIncreasePlus1 - 1 , i); 
-#endif
       }
     }    
@@ -3477,8 +3188,4 @@
 Void TComSPS::checkRpsMaxNumPics( TComVPS* vps, Int currLayerId )
 {
-#if !H_MV_HLS10_MAXNUMPICS
-  // 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.
-#endif
   for (Int i = 0; i < getRPSList()->getNumberOfReferencePictureSets(); i++ )
   {
@@ -3486,15 +3193,9 @@
     if ( !rps->getInterRPSPrediction() )
     {
-#if H_MV_HLS10_MAXNUMPICS
       rps->checkMaxNumPics( vps->getVpsExtensionFlag(), MAX_INT, getLayerId(), getMaxDecPicBuffering( getSpsMaxSubLayersMinus1() ) - 1 );   // INT_MAX to be replaced by DpbSize
-#else
-      rps->checkMaxNumPics( vps->getVpsExtensionFlag(), vps->getMaxNumPics( currLayerId ), 
-        getLayerId(), getMaxDecPicBuffering( getSpsMaxSubLayersMinus1() ) - 1 );  
-#endif
-    }
-  }
-}
-
-#if H_MV_HLS10_MULTILAYERSPS
+    }
+  }
+}
+
 Void TComSPS::inferSpsMaxSubLayersMinus1(Bool atPsActivation, TComVPS* vps)
 {
@@ -3517,5 +3218,4 @@
   }
 }
-#endif
 #endif
 
@@ -3880,9 +3580,5 @@
 {
   TComVPS* vps = getVPS(); 
-#if H_MV_HLS10_REF_PRED_LAYERS
   Int refLayerIdx = vps->getLayerIdInVps( vps->getIdDirectRefLayer( getLayerId(), i ) ); 
-#else
-  Int refLayerIdx = vps->getLayerIdInVps( vps->getRefLayerId( getLayerId(), i ) ); 
-#endif
 
   Bool refLayerPicFlag = ( vps->getSubLayersVpsMaxMinus1( refLayerIdx ) >=  getTLayer() )  && ( getTLayer() == 0  ) &&
@@ -3955,9 +3651,5 @@
 Int TComSlice::getRefPicLayerId( Int i )
 {
-#if H_MV_HLS10_REF_PRED_LAYERS
   return getVPS()->getIdDirectRefLayer( getLayerId(), getInterLayerPredLayerIdc( i ) );
-#else
-  return getVPS()->getRefLayerId( getLayerId(), getInterLayerPredLayerIdc( i ) );
-#endif
 }
 
@@ -4065,5 +3757,5 @@
       m_bApplyIC = true;
       Int refLayer = curLayer-1;
-#if MTK_LOW_LATENCY_IC_ENCODING_H0086_FIX
+
       Int ICEnableCandidate = getICEnableCandidate(refLayer);
       Int ICEnableNum = getICEnableNum(refLayer);
@@ -4083,22 +3775,4 @@
       setICEnableCandidate(curLayer, 0);
       setICEnableNum(curLayer, 0);
-#else
-      if( (refLayer>=0) && (g_aICEnableCANDIDATE[refLayer]>0) )
-      {    
-        Double ratio=Double(g_aICEnableNUM[refLayer])/Double(g_aICEnableCANDIDATE[refLayer]);
-
-        if( ratio > IC_LOW_LATENCY_ENCODING_THRESHOLD)
-{
-          m_bApplyIC=true;
-        }
-        else
-        {
-          m_bApplyIC=false;
-        }
-      }
-      g_aICEnableNUM[curLayer]=0;
-      g_aICEnableCANDIDATE[curLayer]=0;
-      g_lastlayer=getDepth();
-#endif
     }
   }
@@ -4210,5 +3884,5 @@
 
 #if H_3D_DDD
-#if LGE_FCO_I0116
+#if H_3D_FCO
   if( getIsDepth() && getViewIndex() > 0 && getVPS()->getMPIFlag(layerIdInVPS))
 #else
@@ -4696,5 +4370,5 @@
 , m_nonPackedConstraintFlag(false)
 , m_frameOnlyConstraintFlag(false)
-#if H_MV_HLS10_PTL
+#if H_MV
   , m_max12bitConstraintFlag      ( false )
   , m_max10bitConstraintFlag      ( false )
@@ -4712,5 +4386,5 @@
 }
 
-#if H_MV_HLS10_PTL_INFER_FIX
+#if H_MV
 Bool ProfileTierLevel::getV2ConstraintsPresentFlag()
 {
@@ -4757,5 +4431,4 @@
   copyV2ConstraintFlags      ( ptlRef );
 }
-
 #endif
 
@@ -4767,15 +4440,4 @@
 
 #if H_MV
-#if !H_MV_HLS10_PTL_INFER_FIX
-Void TComPTL::copyLevelFrom( TComPTL* source )
-{
-  getGeneralPTL()->setLevelIdc( source->getGeneralPTL()->getLevelIdc() );
-  for( Int subLayer = 0; subLayer < 6; subLayer++ )
-  {
-    setSubLayerLevelPresentFlag( subLayer, source->getSubLayerLevelPresentFlag( subLayer ) );
-    getSubLayerPTL( subLayer )->setLevelIdc( source->getSubLayerPTL( subLayer )->getLevelIdc() );
-  }
-}
-#else
 Void TComPTL::inferGeneralValues(Bool profilePresentFlag, Int k, TComPTL* refPTL)
 {
@@ -4865,5 +4527,4 @@
 }
 
-#endif
 #endif
 //! \}
@@ -4908,9 +4569,5 @@
 
   m_vpsVuiBspHrdPresentFlag = false; 
-#if H_MV_HLS10_VPS_VUI_BSP
   m_vpsVuiBspHrdParameters  = NULL;
-#else
-  m_vpsVuiBspHrdParameters  = new TComVpsVuiBspHrdParameters();
-#endif
 }
 
@@ -4958,86 +4615,5 @@
 }
 
-#if !H_MV_HLS10_VPS_VUI_BSP
-Void TComVpsVuiBspHrdParameters::checkLayerInBspFlag( TComVPS* vps, Int h )
-{
-  // It is a requirement of bitstream conformance that bitstream partition with index j shall not include 
-  // direct or indirect reference layers of any layers in bitstream partition i for any values of i and j 
-  // in the range of 0 to num_bitstream_partitions[ h ] ?1, inclusive, such that i is less than j.
-
-  for ( Int partJ = 0; partJ < getNumBitstreamPartitions( h ); partJ++ )
-  {        
-    for ( Int partI = 0; partI < partJ; partI++ )
-    {
-      for ( Int layerJ = 0; layerJ < vps->getMaxLayersMinus1(); layerJ++ )
-      {
-        if ( m_layerInBspFlag[ h ][partJ][layerJ ] )
-        {
-          for ( Int layerI = 0; layerI < vps->getMaxLayersMinus1(); layerI++ )
-          {
-            if ( m_layerInBspFlag[ h ][partI][layerI] )
-            {
-              assert( !vps->getInDirectDependencyFlag( layerI, layerJ ) ); 
-            }
-          }
-        }
-      }
-    }
-  }
-
-  // ---------------
-  // To be added: 
-  // When vps_base_layer_internal_flag is equal to 0 and layer_in_bsp_flag[ h ][ i ][ 0 ] is equal to 1 for any value of h in the 
-  // range of 1 to vps_num_layer_sets_minus1, inclusive, and any value of i in the range of 0 to num_bitstream_partitions[ h ] - 1, 
-  // inclusive, the value of layer_in_bsp_flag[ h ][ i ][ j ] for at least one value of j in the range of 1 to 
-  // NumLayersInIdList[ h ] - 1, inclusive, shall be equal to 1.
-  // ---------------
-
-
-  // When num_bitstream_partitions[ h ] is equal to 1 for any value of h in the range 1 to vps_num_layer_set_minus1, inclusive, 
-  // the value of layer_in_bsp_flag[ h ][ 0 ][ j ] should be equal to 0 for at least one value of j in the range 0 to 
-  // NumLayersInIdList[ h ] ? 1, inclusive. 
-
-
-  if ( getNumBitstreamPartitions( h ) == 1 )
-  {
-    Bool atLeastOneZero = false; 
-    for ( Int j = 0; j <= vps->getNumLayersInIdList( h ) - 1; j++ )
-    {
-      atLeastOneZero = atLeastOneZero || !getLayerInBspFlag( h, 0, j ); 
-    }    
-    assert( atLeastOneZero ); 
-  }
-
-  
-  // For any value of h in the range 1 to vps_num_layer_set_minus1, inclusive, the value of layer_in_bsp_flag[ h ][ i ][ j ] 
-  // shall be equal to 1 for at most one value of i in the range of 0 to num_bitstream_partitions[ h ] ? 1, inclusive. 
-
-  for ( Int j = 0; j <= vps->getNumLayersInIdList( h ) - 1; j++ )
-  {
-    Int numLayerInBsp = 0; 
-    for ( Int i = 0; i <= getNumBitstreamPartitions( h ) - 1; i++ )
-    {
-      numLayerInBsp += ( getLayerInBspFlag( h, i, j ) ? 1 : 0 );  
-    }    
-    assert( numLayerInBsp <= 1 ); 
-  }
-
-}
-
-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 ) );
-}
-#endif
-
-#if H_MV_HLS10_VPS_VUI_BSP
+
 
 TComVpsVuiBspHrdParameters::~TComVpsVuiBspHrdParameters()
@@ -5137,5 +4713,4 @@
 }
 
-#endif
 
 Void TComVUI::inferVideoSignalInfo( TComVPS* vps, Int layerIdCurr )
@@ -5173,9 +4748,5 @@
       for (Int k = 0; k < MAX_NUM_LAYER_IDS; k++ )
       {
-#if H_MV_HLS10_ADD_LAYERSETS
         m_maxVpsDecPicBufferingMinus1[i][k][j] = MIN_INT; 
-#else
-        m_maxVpsDecPicBufferingMinus1[i][k][j] = 0; 
-#endif
       }
     }
Index: trunk/source/Lib/TLibCommon/TComSlice.h
===================================================================
--- trunk/source/Lib/TLibCommon/TComSlice.h	(revision 1067)
+++ trunk/source/Lib/TLibCommon/TComSlice.h	(revision 1084)
@@ -45,10 +45,8 @@
 #include "TComRom.h"
 #include "TComList.h"
-#if H_MV_HLS10_GEN_FIX
 #if H_MV
 #include <ios>
 #include <iostream>
 #include <iomanip>
-#endif
 #endif
 //! \ingroup TLibCommon
@@ -207,5 +205,4 @@
   Bool m_frameOnlyConstraintFlag;
   
-#if H_MV_HLS10_PTL
 #if H_MV
   Bool m_max12bitConstraintFlag;
@@ -220,5 +217,4 @@
   Bool m_inbldFlag;
 #endif
-#endif
 public:
   ProfileTierLevel();
@@ -252,5 +248,4 @@
 
 #if H_MV
-#if H_MV_HLS10_PTL
   Void setMax12bitConstraintFlag( Bool flag ) { m_max12bitConstraintFlag = flag; } 
   Bool getMax12bitConstraintFlag(  ) { return m_max12bitConstraintFlag; } 
@@ -281,11 +276,8 @@
   Void setInbldFlag( Bool flag ) { m_inbldFlag = flag; } 
   Bool getInbldFlag(  ) { return m_inbldFlag; } 
-#endif
-#if H_MV_HLS10_PTL_INFER_FIX
   Bool getV2ConstraintsPresentFlag();  
   Bool getInbldPresentFlag();
   Void copyV2ConstraintFlags( ProfileTierLevel* ptlRef );
   Void copyProfile( ProfileTierLevel* ptlRef );
-#endif
 #endif
 };
@@ -310,10 +302,6 @@
   ProfileTierLevel* getSubLayerPTL(Int i)  { return &m_subLayerPTL[i]; }
 #if H_MV
-#if H_MV_HLS10_PTL_INFER_FIX
   Void inferGeneralValues ( Bool profilePresentFlag  , Int k, TComPTL* refPTL );; 
   Void inferSubLayerValues( Int maxNumSubLayersMinus1, Int k, TComPTL* refPTL );; 
-#else
-  Void copyLevelFrom( TComPTL* source );
-#endif
 #endif
 };
@@ -501,5 +489,4 @@
 class TComVpsVuiBspHrdParameters
 {
-#if H_MV_HLS10_VPS_VUI_BSP
 
   /* Not yet tested */
@@ -563,45 +550,4 @@
   Void setHrdParametermeters( Int k, TComHRD* val  ) {  *(m_hrdParameters + k ) = *val; }; 
   TComHRD* getHrdParametermeters( Int k ) {  return m_hrdParameters + k; }; 
-#else 
-private: 
-  Int  m_vpsNumBspHrdParametersMinus1;
-  Bool m_bspCprmsPresentFlag[MAX_NUM_BSP_HRD_PARAMETERS];
-  Int  m_numBitstreamPartitions[MAX_VPS_OP_SETS_PLUS1];
-  Bool m_layerInBspFlag[MAX_VPS_OP_SETS_PLUS1][MAX_NUM_BSP_HRD_PARAMETERS][MAX_NUM_LAYERS];
-  Int  m_numBspSchedCombinationsMinus1[MAX_VPS_OP_SETS_PLUS1];
-  Int  m_bspCombHrdIdx[MAX_VPS_OP_SETS_PLUS1][MAX_NUM_BSP_HRD_PARAMETERS][MAX_NUM_BSP_SCHED_COMBINATION];
-  Int  m_bspCombSchedIdx[MAX_VPS_OP_SETS_PLUS1][MAX_NUM_BSP_HRD_PARAMETERS][MAX_NUM_BSP_SCHED_COMBINATION];
-  TComHRD* m_hrdParameters[MAX_NUM_BSP_HRD_PARAMETERS]; 
-public: 
-
-  Void setVpsNumBspHrdParametersMinus1( Int  val ) { m_vpsNumBspHrdParametersMinus1 = val; } 
-  Int  getVpsNumBspHrdParametersMinus1(  ) { return m_vpsNumBspHrdParametersMinus1; } 
-
-  Void setBspCprmsPresentFlag( Int i, Bool flag ) { m_bspCprmsPresentFlag[i] = flag; } 
-  Bool getBspCprmsPresentFlag( Int i ) { return m_bspCprmsPresentFlag[i]; } 
-
-  Void setNumBitstreamPartitions( Int h, Int  val ) { m_numBitstreamPartitions[h] = val; } 
-  Int  getNumBitstreamPartitions( Int h ) { return m_numBitstreamPartitions[h]; } 
-
-  Void setLayerInBspFlag( Int h, Int i, Int j, Bool flag ) { m_layerInBspFlag[h][i][j] = flag; } 
-  Bool getLayerInBspFlag( Int h, Int i, Int j ) { return m_layerInBspFlag[h][i][j]; } 
-  Void checkLayerInBspFlag ( TComVPS* vps, Int h );  
-
-  Void setNumBspSchedCombinationsMinus1( Int h, Int  val ) { m_numBspSchedCombinationsMinus1[h] = val; } 
-  Int  getNumBspSchedCombinationsMinus1( Int h ) { return m_numBspSchedCombinationsMinus1[h]; } 
-
-  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]; } 
-  Int  getBspCombHrdIdxLen() { return gCeilLog2( getVpsNumBspHrdParametersMinus1() + 1);  }; 
-
-
-  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; }; 
-  TComHRD* getHrdParametermeters( Int k ) {  return m_hrdParameters[k]; }; 
-#endif
 };
 
@@ -630,8 +576,6 @@
   Bool m_wppNotInUseFlag;
   Bool m_wppInUseFlag                [MAX_NUM_LAYERS];
-#if H_MV_HLS10_VPS_VUI
   Bool m_singleLayerForNonIrapFlag;
   Bool m_higherLayerIrapSkipFlag;
-#endif
   Bool m_ilpRestrictedRefLayersFlag;
   Int  m_minSpatialSegmentOffsetPlus1[MAX_NUM_LAYERS][MAX_NUM_LAYERS];
@@ -708,5 +652,4 @@
   Bool getWppInUseFlag( Int i ) { return m_wppInUseFlag[i]; } 
 
-#if H_MV_HLS10_VPS_VUI
   Void setSingleLayerForNonIrapFlag( Bool flag ) { m_singleLayerForNonIrapFlag = flag; } 
   Bool getSingleLayerForNonIrapFlag(  ) { return m_singleLayerForNonIrapFlag; } 
@@ -714,5 +657,4 @@
   Void setHigherLayerIrapSkipFlag( Bool flag ) { m_higherLayerIrapSkipFlag = flag; } 
   Bool getHigherLayerIrapSkipFlag(  ) { return m_higherLayerIrapSkipFlag; } 
-#endif
 
   Void setIlpRestrictedRefLayersFlag( Bool flag ) { m_ilpRestrictedRefLayersFlag = flag; } 
@@ -750,5 +692,4 @@
   Int  m_bitDepthVpsLumaMinus8;
   Int  m_bitDepthVpsChromaMinus8;
-#if H_MV_HLS10_GEN_VSP_CONF_WIN
   Bool m_conformanceWindowVpsFlag;
   Int  m_confWinVpsLeftOffset;
@@ -756,9 +697,7 @@
   Int  m_confWinVpsTopOffset;
   Int  m_confWinVpsBottomOffset;
-#endif
 
 public: 
 
-#if H_MV_HLS10_GEN_VSP_CONF_WIN
   TComRepFormat()
   { 
@@ -769,7 +708,4 @@
   m_confWinVpsBottomOffset   = 0;
   };  
-#else
-  TComRepFormat() { };  
-#endif
 
   Void setChromaAndBitDepthVpsPresentFlag( Bool flag ) { m_chromaAndBitDepthVpsPresentFlag = flag; } 
@@ -796,5 +732,4 @@
   Int  getBitDepthVpsChromaMinus8(  ) { return m_bitDepthVpsChromaMinus8; } 
 
-#if H_MV_HLS10_GEN_VSP_CONF_WIN
   Void setConformanceWindowVpsFlag( Bool flag ) { m_conformanceWindowVpsFlag = flag; } 
   Bool getConformanceWindowVpsFlag(  ) { return m_conformanceWindowVpsFlag; } 
@@ -811,5 +746,4 @@
   Void setConfWinVpsBottomOffset( Int  val ) { m_confWinVpsBottomOffset = val; } 
   Int  getConfWinVpsBottomOffset(  ) { return m_confWinVpsBottomOffset; } 
-#endif
 };
 
@@ -834,9 +768,5 @@
 
   Void setMaxVpsDecPicBufferingMinus1( Int i, Int k, Int j, Int  val ) { m_maxVpsDecPicBufferingMinus1[i][k][j] = val; } 
-  #if H_MV_HLS10_ADD_LAYERSETS
   Int  getMaxVpsDecPicBufferingMinus1( Int i, Int k, Int j ) { assert( m_maxVpsDecPicBufferingMinus1[i][k][j] >= 0 ); return m_maxVpsDecPicBufferingMinus1[i][k][j]; }     
-  #else
-  Int  getMaxVpsDecPicBufferingMinus1( Int i, Int k, Int j ) { return m_maxVpsDecPicBufferingMinus1[i][k][j]; } 
-  #endif
 
   Void setMaxVpsNumReorderPics( Int i, Int j, Int  val ) { m_maxVpsNumReorderPics[i][j] = val; } 
@@ -853,7 +783,5 @@
 #if H_MV
   Bool        m_vpsBaseLayerInternalFlag;
-#if H_MV_HLS10_GEN_VSP_BASE_LAYER_AVAIL
   Bool        m_vpsBaseLayerAvailableFlag;
-#endif // H_MV_HLS10_GEN
 #endif
 
@@ -925,9 +853,5 @@
   Int         m_layerSetIdxForOlsMinus1  [MAX_VPS_OUTPUTLAYER_SETS];  
   Bool        m_outputLayerFlag          [MAX_VPS_OUTPUTLAYER_SETS][MAX_VPS_NUH_LAYER_ID_PLUS1];
-#if H_MV_HLS10_PTL
   Int         m_profileTierLevelIdx      [MAX_VPS_OUTPUTLAYER_SETS ][MAX_NUM_LAYERS];
-#else  
-  Int         m_profileLevelTierIdx      [MAX_VPS_OUTPUTLAYER_SETS ];
-#endif
   Bool        m_altOutputLayerFlag       [MAX_VPS_OUTPUTLAYER_SETS];
   Bool        m_repFormatIdxPresentFlag;
@@ -958,33 +882,19 @@
   // VPS EXTENSION SEMANTICS VARIABLES
   Int         m_layerIdInVps             [MAX_NUM_LAYERS   ];
-#if H_MV_HLS10_REF_PRED_LAYERS
   Int         m_dependencyFlag           [MAX_NUM_LAYERS][MAX_NUM_LAYERS]; 
-#endif
 
   Int         m_numDirectRefLayers       [MAX_NUM_LAYERS];
-#if H_MV_HLS10_REF_PRED_LAYERS
   Int         m_idDirectRefLayer         [MAX_NUM_LAYERS][MAX_NUM_LAYERS];  
-#else
-  Int         m_refLayerId               [MAX_NUM_LAYERS][MAX_NUM_LAYERS];  
-#endif
 
   Int         m_numRefLayers             [MAX_NUM_LAYER_IDS]; 
-#if H_MV_HLS10_REF_PRED_LAYERS
   Int         m_idRefLayer               [MAX_NUM_LAYERS][MAX_NUM_LAYERS];  
-#endif
 
 
   Int         m_numPredictedLayers       [MAX_NUM_LAYERS ]; 
-#if !H_MV_HLS10_REF_PRED_LAYERS
-  Int         m_predictedLayerId         [MAX_NUM_LAYERS][MAX_NUM_LAYER_IDS];
-#else
   Int         m_idPredictedLayer         [MAX_NUM_LAYERS][MAX_NUM_LAYER_IDS];
-#endif
   Int         m_numIndependentLayers; 
   Int         m_numLayersInTreePartition [MAX_NUM_LAYER_IDS];
   Int         m_treePartitionLayerIdList [MAX_NUM_LAYERS][MAX_NUM_LAYER_IDS];
-#if H_MV_HLS10_REF_PRED_LAYERS
   Bool        m_recursiveRefLayerFlag    [MAX_NUM_LAYER_IDS][MAX_NUM_LAYER_IDS]; 
-  #endif
   Int         m_viewIndex                [MAX_NUM_LAYERS   ];
   
@@ -993,13 +903,9 @@
   std::vector< std::vector< Int> >       m_layerSetLayerIdList; 
 
-#if H_MV_HLS10_NESSECARY_LAYER
   Int        m_numNecessaryLayers        [MAX_VPS_OUTPUTLAYER_SETS];
   Bool       m_necessaryLayerFlag        [MAX_VPS_OUTPUTLAYER_SETS][MAX_NUM_LAYERS]; 
-#endif
 
   Int         xGetDimBitOffset( Int j );
-#if H_MV_HLS10_REF_PRED_LAYERS
   Void        xSetRefLayerFlags( Int currLayerId );
-#endif
   // VPS EXTENSION 2 SYNTAX ELEMENTS
 #if H_3D_ARP
@@ -1009,17 +915,11 @@
 #if H_3D_IV_MERGE
   Bool        m_ivMvPredFlag             [ MAX_NUM_LAYERS ]; 
-#if SEC_HLS_CLEANUP_I0100
   Bool        m_ivMvScalingFlag          [ MAX_NUM_LAYERS ]; 
-#endif
 #if H_3D_SPIVMP
   Int         m_iSubPULog2Size           [MAX_NUM_LAYERS   ];
-#if MTK_I0099_VPS_EX2
   Int         m_iSubPUMPILog2Size        [MAX_NUM_LAYERS   ];
-#else
-  Int         m_iSubPUMPILog2Size;
-#endif
-#endif
-#endif
-#if MTK_I0099_VPS_EX2
+#endif
+#endif
+#if H_3D_QTLPC
   Bool        m_bLimQtPredFlag           [ MAX_NUM_LAYERS ];
 #endif
@@ -1031,8 +931,7 @@
 #endif
   Bool        m_vpsDepthModesFlag        [MAX_NUM_LAYERS   ];
-#if SEPARATE_FLAG_I0085
+#if H_3D
   Bool        m_bIVPFlag                 [MAX_NUM_LAYERS   ];
 #endif
-
 #if H_3D
   UInt        m_uiCamParPrecision;
@@ -1041,9 +940,4 @@
   Int         ***m_aaaiCodedScale ;
   Int         ***m_aaaiCodedOffset;
-
-#if !SEC_HLS_CLEANUP_I0100
-  Bool        m_ivMvScalingFlag; 
-#endif
-
 #endif
 #if H_3D_INTER_SDC
@@ -1081,9 +975,7 @@
   Void    setVpsBaseLayerInternalFlag( Bool flag ) { m_vpsBaseLayerInternalFlag = flag; } 
   Bool    getVpsBaseLayerInternalFlag(  )          { return m_vpsBaseLayerInternalFlag; } 
-#if H_MV_HLS10_GEN_VSP_BASE_LAYER_AVAIL
   Void    setVpsBaseLayerAvailableFlag( Bool flag ) { m_vpsBaseLayerAvailableFlag = flag; } 
   Bool    getVpsBaseLayerAvailableFlag(  )          { return m_vpsBaseLayerAvailableFlag; } 
 #endif
-#endif
 
   UInt    getMaxTLayers  ()                   { return m_uiMaxTLayers;   }
@@ -1092,7 +984,5 @@
 #if H_MV    
   UInt    getMaxSubLayersMinus1()             { return m_uiMaxTLayers - 1;  }  // For consistency with draft spec
-#if H_MV_HLS10_GEN_FIX
   Void    setMaxSubLayersMinus1(UInt val)     { m_uiMaxTLayers = (val + 1); };
-#endif
   UInt    getMaxLayersMinus1()                { return m_uiMaxLayersMinus1;  }; 
   Void    setMaxLayersMinus1(UInt l)          { m_uiMaxLayersMinus1 = l; }
@@ -1134,9 +1024,5 @@
 
 #if H_MV
-#if H_MV_HLS10_PTL
   TComPTL* getPTL( Int idx = 0 ) { return &m_pcPTL[idx]; }
-#else
-  TComPTL* getPTL( Int layerSet = 0 ) { return &m_pcPTL[layerSet]; }
-#endif
 #else
   TComPTL* getPTL() { return &m_pcPTL; }
@@ -1218,7 +1104,5 @@
   Void    setLayerSetIdxForOlsMinus1( Int outLayerSetIdx, Int val )        { m_layerSetIdxForOlsMinus1[ outLayerSetIdx ]  = val; } 
   Int     getLayerSetIdxForOlsMinus1( Int outLayerSetIdx )                 { return m_layerSetIdxForOlsMinus1[ outLayerSetIdx ]; } 
-#if VPS_MISC_UPDATES
   Int     getLayerSetIdxForOlsMinus1Len( Int outLayerSetIdx )              { return gCeilLog2( getNumLayerSets() ); } 
-#endif
 
   Void    setOutputLayerFlag( Int outLayerSetIdx, Int i, Bool flag )       { m_outputLayerFlag[ outLayerSetIdx ][ i ] = flag; } 
@@ -1227,14 +1111,7 @@
   Bool    inferOutputLayerFlag( Int i, Int j );
 
-#if H_MV_HLS10_PTL
   Void    setProfileTierLevelIdx( Int i, Int j, Int val )                  { m_profileTierLevelIdx[ i ][ j ] = val; }
   Int     getProfileTierLevelIdx( Int i, Int j )                           { return m_profileTierLevelIdx[ i ][ j ]; } 
-#if H_MV_HLS10_PTL_FIX
   Int     inferProfileTierLevelIdx( Int i, Int j );
-#endif
-#else
-  Void    setProfileLevelTierIdx( Int outLayerSetIdx, Int val )            { m_profileLevelTierIdx[ outLayerSetIdx ] = val; }
-  Int     getProfileLevelTierIdx( Int outLayerSetIdx )                     { return m_profileLevelTierIdx[ outLayerSetIdx ]; } 
-#endif
   
   Void    setAltOutputLayerFlag( Int i, Bool flag )                        { m_altOutputLayerFlag[i] = flag; } 
@@ -1266,7 +1143,4 @@
   TComDpbSize* getDpbSize( )                                               { return m_dpbSize;} 
   
-#if !H_MV_HLS10_ADD_LAYERSETS  
-  Void    inferDbpSizeLayerSetZero( TComSPS* sps, Bool encoder );
-#endif
 
   Void    setPocLsbNotPresentFlag( Int i, Bool flag )                      { m_pocLsbNotPresentFlag[i] = flag; } 
@@ -1299,27 +1173,16 @@
 
   Int     getViewIndex    ( Int layerIdInNuh )                             { return getScalabilityId( getLayerIdInVps(layerIdInNuh), VIEW_ORDER_INDEX  ); }    
-#if H_MV_HLS10_AUX
   Int     getAuxId        ( Int layerIdInNuh )                             { return getScalabilityId( getLayerIdInVps(layerIdInNuh), AUX_ID  ); }    
   Int     getDependencyId ( Int layerIdInNuh )                             { return getScalabilityId( getLayerIdInVps(layerIdInNuh), DEPENDENCY_ID  ); }    
-#endif
   Int     getNumViews();
 
-#if H_MV_HLS10_REF_PRED_LAYERS
   Bool    getDependencyFlag( Int i, Int j )                                { return m_dependencyFlag[i][j]; }
-#endif
   Int     getNumDirectRefLayers( Int layerIdInNuh )                        { return m_numDirectRefLayers[ layerIdInNuh ];  };                               
-#if !H_MV_HLS10_REF_PRED_LAYERS
-  Int     getRefLayerId        ( Int layerIdInNuh, Int idx );; 
-#endif
   Int     getNumRefLayers            ( Int i )        { return m_numRefLayers[i]; } 
   Int     getNumPredictedLayers      ( Int i )        { return m_numPredictedLayers[i]; } 
 
-#if !H_MV_HLS10_REF_PRED_LAYERS  
-  Int     getPredictedLayerId        ( Int i, Int j ) { return m_predictedLayerId[i][j]; } 
-#else
   Int     getIdRefLayer              ( Int i, Int j ) { assert( j >= 0 && j < getNumRefLayers      ( i )); return m_idRefLayer      [i][j]; } 
   Int     getIdPredictedLayer        ( Int i, Int j ) { assert( j >= 0 && j < getNumPredictedLayers( i )); return m_idPredictedLayer[i][j]; } 
   Int     getIdDirectRefLayer        ( Int i, Int j ) { assert( j >= 0 && j < getNumDirectRefLayers( i )); return m_idDirectRefLayer[i][j]; } 
-#endif
   Int     getNumIndependentLayers    (  )             { return m_numIndependentLayers; } 
   Int     getNumLayersInTreePartition( Int i )        { return m_numLayersInTreePartition[i]; } 
@@ -1328,16 +1191,10 @@
   Int     getNumLayerSets( )                                               { return getVpsNumLayerSetsMinus1() + 1 + getNumAddLayerSets();  };  
   
-#if H_MV_HLS10_ADD_LAYERSETS
   Int     getFirstAddLayerSetIdx()                    { return getVpsNumLayerSetsMinus1() + 1; } 
   Int     getLastAddLayerSetIdx()                     { return getFirstAddLayerSetIdx() + getNumAddLayerSets() - 1; }
-#endif
   Bool    checkVPSExtensionSyntax(); 
   Int     scalTypeToScalIdx   ( ScalabilityType scalType );
 
-#if H_MV_HLS10_PTL
   Int     getProfileTierLevelIdxLen()                                      { return gCeilLog2( getVpsNumProfileTierLevelMinus1() + 1 ); };       
-#else
-  Int     getProfileLevelTierIdxLen()                                      { return gCeilLog2( getVpsNumProfileTierLevelMinus1() + 1 ); };       
-#endif
   Int     getVpsRepFormatIdxLen()                                          { return gCeilLog2( getVpsNumRepFormatsMinus1() + 1 ); };       
 
@@ -1350,9 +1207,5 @@
   Void    deriveLayerSetLayerIdList();
 
-#if H_MV_HLS10_ADD_LAYERSETS
   Int     olsIdxToLsIdx( Int i )                                           { return ( i < getNumLayerSets() ) ? i  : getLayerSetIdxForOlsMinus1( i ) + 1 ; };
-#else
-  Int     olsIdxToLsIdx( Int i )                                           { return ( i <= getVpsNumLayerSetsMinus1() ) ? i  : getLayerSetIdxForOlsMinus1( i ) + 1 ; };
-#endif
   Void    initTargetLayerIdLists  ( );
   Void    deriveTargetLayerIdList ( Int i );
@@ -1363,11 +1216,7 @@
   Int     getOlsHighestOutputLayerId( Int i )                              { return getTargetOptLayerIdList( i ).back(); };  
 
-#if H_MV_HLS10_ADD_LAYERSETS
   Void    deriveAddLayerSetLayerIdList( Int i );
-#endif
-#if H_MV_HLS10_NESSECARY_LAYER
   Void    deriveNecessaryLayerFlags( Int olsIdx );;
   Int     getNecessaryLayerFlag( Int i, Int j )                            { AOF( i >= 0 && i < getNumOutputLayerSets() ); AOF( j >= 0 && j < getNumLayersInIdList( olsIdxToLsIdx( i ) )  );  return m_necessaryLayerFlag[i][j]; };  
-#endif
 
   Int     getMaxSubLayersInLayerSetMinus1( Int i );
@@ -1380,16 +1229,7 @@
 
   // helpers
-#if !H_MV_HLS10_REF_PRED_LAYERS
-  Bool    getInDirectDependencyFlag( Int depLayeridInVps, Int refLayeridInVps, Int depth = 0 );
-#endif
-#if !H_MV_HLS10_MAXNUMPICS
-  Int     getMaxNumPics( Int layerId );
-#endif
-#if H_MV_HLS10_ADD_LAYERSETS
   Void    printPTL();
   Void    printLayerDependencies();
-#if H_MV_HLS10_AUX
   Void    printScalabilityId();;
-#endif
   Void    printLayerSets();;
 
@@ -1436,5 +1276,4 @@
     xPrintArray( name, 1, idx2, numElemDim2, vec2, printNumber, false );
   }
-#endif
 
 
@@ -1470,14 +1309,9 @@
   Int     getSubPULog2Size(Int layerIdInVps)           { return m_iSubPULog2Size[layerIdInVps]; }
   Void    setSubPULog2Size(Int layerIdInVps, Int u)    { m_iSubPULog2Size[layerIdInVps] = u;}
-#if MTK_I0099_VPS_EX2
   Int     getSubPUMPILog2Size(Int layerIdInVps)           { return m_iSubPUMPILog2Size[layerIdInVps]; }
   Void    setSubPUMPILog2Size(Int layerIdInVps, Int u)    { m_iSubPUMPILog2Size[layerIdInVps] = u;}
-#else
-  Int     getSubPUMPILog2Size( )           { return m_iSubPUMPILog2Size; }
-  Void    setSubPUMPILog2Size( Int u )     { m_iSubPUMPILog2Size = u;    }
-#endif
-#endif
-#endif
-#if MTK_I0099_VPS_EX2
+#endif
+#endif
+#if H_3D_QTLPC
   Void    setLimQtPredFlag    ( Int layerIdInVps, Bool val )  { m_bLimQtPredFlag[ layerIdInVps ] = val; }
   Bool    getLimQtPredFlag    ( Int layerIdInVps ) { return m_bLimQtPredFlag[layerIdInVps];}
@@ -1493,16 +1327,10 @@
   Void    setVpsDepthModesFlag( Int layerIdInVps, Bool val )               { m_vpsDepthModesFlag[ layerIdInVps ] = val; }
   Bool    getVpsDepthModesFlag( Int layerIdInVps )                         { return m_vpsDepthModesFlag[ layerIdInVps ]; }
-#if SEPARATE_FLAG_I0085
+
   Void    setIVPFlag( Int layerIdInVps, Bool val )                    { m_bIVPFlag[ layerIdInVps ] = val; }
   Bool    getIVPFlag( Int layerIdInVps )                              { return m_bIVPFlag[ layerIdInVps ]; }
-#endif
-
-#if SEC_HLS_CLEANUP_I0100
+
   Bool    getIvMvScalingFlag   ( Int layerIdInVps )                        { return m_ivMvScalingFlag[ layerIdInVps ]; }
   Void    setIvMvScalingFlag   (Int layerIdInVps, Bool b )                 { m_ivMvScalingFlag[ layerIdInVps ] = b;    }  
-#else
-  Bool    getIvMvScalingFlag   (  )                       { return m_ivMvScalingFlag; }
-  Void    setIvMvScalingFlag   ( Bool b )                 { m_ivMvScalingFlag = b;    }  
-#endif
 
 #if H_3D_INTER_SDC
@@ -1530,7 +1358,4 @@
   Bool        m_bInterViewDltPredEnableFlag[ MAX_NUM_LAYERS ];
 
-#if !FIX_TICKET_77
-  Int         m_iBitsPerDepthValue       [ MAX_NUM_LAYERS ];
-#endif
   Int         m_iNumDepthmapValues       [ MAX_NUM_LAYERS ];
   Int*        m_iDepthValue2Idx          [ MAX_NUM_LAYERS ];
@@ -1559,20 +1384,11 @@
   UInt    getDepthViewBitDepth()                          { return m_uiDepthViewBitDepth; }
 
-#if !FIX_TICKET_77
-  Int     getBitsPerDepthValue( Int layerIdInVps )        { return getUseDLTFlag(layerIdInVps)?m_iBitsPerDepthValue[layerIdInVps]:g_bitDepthY; }
-#endif
   Int     getNumDepthValues( Int layerIdInVps )           { return getUseDLTFlag(layerIdInVps)?m_iNumDepthmapValues[layerIdInVps]:((1 << g_bitDepthY)-1); }
   Int     depthValue2idx( Int layerIdInVps, Pel value )   { return getUseDLTFlag(layerIdInVps)?m_iDepthValue2Idx[layerIdInVps][value]:value; }
-#if RWTH_DLT_CLIP_I0057
   Pel     idx2DepthValue( Int layerIdInVps, UInt uiIdx )  { return getUseDLTFlag(layerIdInVps)?m_iIdx2DepthValue[layerIdInVps][ClipY(uiIdx)]:uiIdx; }
-#else
-  Pel     idx2DepthValue( Int layerIdInVps, UInt uiIdx )  { return getUseDLTFlag(layerIdInVps)?m_iIdx2DepthValue[layerIdInVps][uiIdx]:uiIdx; }
-#endif
   Void    setDepthLUTs( Int layerIdInVps, Int* idx2DepthValue = NULL, Int iNumDepthValues = 0 );
-#if H_3D_DELTA_DLT
   Int*    idx2DepthValue( Int layerIdInVps )  { return m_iIdx2DepthValue[layerIdInVps]; }
   Void    getDeltaDLT( Int layerIdInVps, Int* piDLTInRef, UInt uiDLTInRefNum, Int* piDeltaDLTOut, UInt *puiDeltaDLTOutNum );
   Void    setDeltaDLT( Int layerIdInVps, Int* piDLTInRef, UInt uiDLTInRefNum, Int* piDeltaDLTIn, UInt uiDeltaDLTInNum );
-#endif
 };
 #endif
@@ -1833,10 +1649,4 @@
   Bool        m_useAMP;
 
-#if !MTK_I0099_VPS_EX2
-#if H_3D_QTLPC
-  Bool        m_bUseQTL;
-  Bool        m_bUsePC;
-#endif
-#endif
   // Parameter
   Int         m_bitDepthY;
@@ -1880,8 +1690,6 @@
   TComVPS*    m_pcVPS; 
   // SPS 
-#if H_MV_HLS10_MULTILAYERSPS
   Int         m_spsMaxSubLayersMinus1;
   Int         m_spsExtOrMaxSubLayersMinus1;
-#endif
   Bool        m_spsExtensionPresentFlag; 
 
@@ -1901,12 +1709,4 @@
   // SPS Extension 
   Bool        m_interViewMvVertConstraintFlag;
-#if !H_MV_HLS10_PPS
-  Int         m_numScaledRefLayerOffsets;
-  Int         m_scaledRefLayerId          [MAX_NUM_SCALED_REF_LAYERS];
-  Int         m_scaledRefLayerLeftOffset  [MAX_NUM_LAYERS];
-  Int         m_scaledRefLayerTopOffset   [MAX_NUM_LAYERS];
-  Int         m_scaledRefLayerRightOffset [MAX_NUM_LAYERS];
-  Int         m_scaledRefLayerBottomOffset[MAX_NUM_LAYERS];
-#endif
 #endif
 #if H_3D
@@ -2012,7 +1812,5 @@
 #if H_MV
   UInt      getSpsMaxSubLayersMinus1()                { return ( m_uiMaxTLayers - 1); }
-#if H_MV_HLS10_MULTILAYERSPS
   Void      setSpsMaxSubLayersMinus1( UInt val )       { setMaxTLayers( val + 1 ); }
-#endif
 #endif
 
@@ -2047,5 +1845,4 @@
   TComPTL* getPTL()     { return &m_pcPTL; }
 #if H_MV
-#if H_MV_HLS10_MULTILAYERSPS
   Void setSpsExtOrMaxSubLayersMinus1( Int  val ) { m_spsExtOrMaxSubLayersMinus1 = val; } 
   Int  getSpsExtOrMaxSubLayersMinus1(  ) { return m_spsExtOrMaxSubLayersMinus1; } 
@@ -2053,5 +1850,4 @@
 
   Bool getMultiLayerExtSpsFlag()            { return ( getLayerId() != 0  &&  getSpsExtOrMaxSubLayersMinus1() == 7 ); }
-#endif
   Void inferSpsMaxDecPicBufferingMinus1( TComVPS* vps, Int targetOptLayerSetIdx, Int currLayerId, Bool encoder );
 
@@ -2092,23 +1888,4 @@
   Bool getInterViewMvVertConstraintFlag()         { return m_interViewMvVertConstraintFlag;}
 
-#if !H_MV_HLS10_PPS
-  Void setNumScaledRefLayerOffsets( Int  val )    { m_numScaledRefLayerOffsets = val; } 
-  Int  getNumScaledRefLayerOffsets(  )            { return m_numScaledRefLayerOffsets; } 
-
-  Void setScaledRefLayerId( Int i, Int  val )     { m_scaledRefLayerId[i] = val; } 
-  Int  getScaledRefLayerId( Int i )               { return m_scaledRefLayerId[i]; } 
-
-  Void setScaledRefLayerLeftOffset( Int j, Int  val ) { m_scaledRefLayerLeftOffset[j] = val; } 
-  Int  getScaledRefLayerLeftOffset( Int j )           { return m_scaledRefLayerLeftOffset[j]; } 
-
-  Void setScaledRefLayerTopOffset( Int j, Int  val )  { m_scaledRefLayerTopOffset[j] = val; } 
-  Int  getScaledRefLayerTopOffset( Int j )            { return m_scaledRefLayerTopOffset[j]; } 
-
-  Void setScaledRefLayerRightOffset( Int j, Int  val ) { m_scaledRefLayerRightOffset[j] = val; } 
-  Int  getScaledRefLayerRightOffset( Int j )           { return m_scaledRefLayerRightOffset[j]; } 
-
-  Void setScaledRefLayerBottomOffset( Int j, Int  val ) { m_scaledRefLayerBottomOffset[j] = val; } 
-  Int  getScaledRefLayerBottomOffset( Int j )           { return m_scaledRefLayerBottomOffset[j]; } 
-#endif
   // Inference 
 
@@ -2119,12 +1896,4 @@
   Void checkRpsMaxNumPics( TComVPS* vps, Int currLayerId );
 
-#endif
-#if !MTK_I0099_VPS_EX2
-#if H_3D_QTLPC
-  Void setUseQTL( Bool b ) { m_bUseQTL = b;    }
-  Bool getUseQTL()         { return m_bUseQTL; }
-  Void setUsePC ( Bool b ) { m_bUsePC  = b;    }
-  Bool getUsePC ()         { return m_bUsePC;  }
-#endif
 #endif
 #if H_MV
@@ -2201,11 +1970,11 @@
   
   Bool     m_loopFilterAcrossTilesEnabledFlag;
-  Int      m_uniformSpacingFlag;
-  Int      m_iNumColumnsMinus1;
-  UInt*    m_puiColumnWidth;
-  Int      m_iNumRowsMinus1;
-  UInt*    m_puiRowHeight;
-
-  Int      m_iNumSubstreams;
+  Bool             m_uniformSpacingFlag;
+  Int              m_numTileColumnsMinus1;
+  Int              m_numTileRowsMinus1;
+  std::vector<Int> m_tileColumnWidth;
+  std::vector<Int> m_tileRowHeight;
+
+  Int      m_numSubstreams;
 
   Int      m_signHideFlag;
@@ -2304,42 +2073,22 @@
   Bool    getDependentSliceSegmentsEnabledFlag() const     { return m_dependentSliceSegmentsEnabledFlag; }
   Void    setDependentSliceSegmentsEnabledFlag(Bool val)   { m_dependentSliceSegmentsEnabledFlag = val; }
-  Bool    getTilesEnabledFlag() const                      { return m_tilesEnabledFlag; }
-  Void    setTilesEnabledFlag(Bool val)                    { m_tilesEnabledFlag = val; }
   Bool    getEntropyCodingSyncEnabledFlag() const          { return m_entropyCodingSyncEnabledFlag; }
   Void    setEntropyCodingSyncEnabledFlag(Bool val)        { m_entropyCodingSyncEnabledFlag = val; }
-  Void     setUniformSpacingFlag            ( Bool b )          { m_uniformSpacingFlag = b; }
-  Bool     getUniformSpacingFlag            ()                  { return m_uniformSpacingFlag; }
-  Void     setNumColumnsMinus1              ( Int i )           { m_iNumColumnsMinus1 = i; }
-  Int      getNumColumnsMinus1              ()                  { return m_iNumColumnsMinus1; }
-  Void     setColumnWidth ( UInt* columnWidth )
-  {
-    if( m_uniformSpacingFlag == 0 && m_iNumColumnsMinus1 > 0 )
-    {
-      m_puiColumnWidth = new UInt[ m_iNumColumnsMinus1 ];
-
-      for(Int i=0; i<m_iNumColumnsMinus1; i++)
-      {
-        m_puiColumnWidth[i] = columnWidth[i];
-      }
-    }
-  }
-  UInt     getColumnWidth  (UInt columnIdx) { return *( m_puiColumnWidth + columnIdx ); }
-  Void     setNumRowsMinus1( Int i )        { m_iNumRowsMinus1 = i; }
-  Int      getNumRowsMinus1()               { return m_iNumRowsMinus1; }
-  Void     setRowHeight    ( UInt* rowHeight )
-  {
-    if( m_uniformSpacingFlag == 0 && m_iNumRowsMinus1 > 0 )
-    {
-      m_puiRowHeight = new UInt[ m_iNumRowsMinus1 ];
-
-      for(Int i=0; i<m_iNumRowsMinus1; i++)
-      {
-        m_puiRowHeight[i] = rowHeight[i];
-      }
-    }
-  }
-  UInt     getRowHeight           (UInt rowIdx)    { return *( m_puiRowHeight + rowIdx ); }
-  Void     setNumSubstreams(Int iNumSubstreams)               { m_iNumSubstreams = iNumSubstreams; }
-  Int      getNumSubstreams()                                 { return m_iNumSubstreams; }
+
+  Void     setTilesEnabledFlag       (Bool val)                             { m_tilesEnabledFlag = val; }
+  Bool     getTilesEnabledFlag       () const                               { return m_tilesEnabledFlag; }
+  Void     setTileUniformSpacingFlag (Bool b)                               { m_uniformSpacingFlag = b; }
+  Bool     getTileUniformSpacingFlag () const                               { return m_uniformSpacingFlag; }
+  Void     setNumTileColumnsMinus1   (Int i)                                { m_numTileColumnsMinus1 = i; }
+  Int      getNumTileColumnsMinus1   () const                               { return m_numTileColumnsMinus1; }
+  Void     setTileColumnWidth        (const std::vector<Int>& columnWidth ) { m_tileColumnWidth = columnWidth; }
+  UInt     getTileColumnWidth        (UInt columnIdx) const                 { return  m_tileColumnWidth[columnIdx]; }
+  Void     setNumTileRowsMinus1      (Int i)                                { m_numTileRowsMinus1 = i; }
+  Int      getTileNumRowsMinus1      () const                               { return m_numTileRowsMinus1; }
+  Void     setTileRowHeight          (const std::vector<Int>& rowHeight)    { m_tileRowHeight = rowHeight;  }
+  UInt     getTileRowHeight          (UInt rowIdx) const                    { return m_tileRowHeight[rowIdx]; }
+
+  Void     setNumSubstreams    (Int numSubstreams)                     { m_numSubstreams = numSubstreams; }
+  Int      getNumSubstreams    ()                                      { return m_numSubstreams; }
 
   Void      setSignHideFlag( Int signHideFlag ) { m_signHideFlag = signHideFlag; }
@@ -2537,5 +2286,5 @@
 
   Bool       m_enableTMVPFlag;
-#if I0044_SLICE_TMVP
+#if H_MV
   Bool       m_availableForTMVPRefFlag;
 #endif
@@ -2599,8 +2348,8 @@
   UInt         m_aiDDDShift    [MAX_NUM_LAYERS];
 #endif
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
   Bool      m_bApplySingleDepthMode;
 #endif
-#if MTK_LOW_LATENCY_IC_ENCODING_H0086_FIX
+#if H_3D_IC
   Int *m_aICEnableCandidate;
   Int *m_aICEnableNum;
@@ -2676,5 +2425,5 @@
   TComPic*  getTexturePic       ()                              { return  m_ivPicsCurrPoc[0][ m_viewIndex ]; }
 #endif
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
   Void      setApplySingleDepthMode( Bool b )                                { m_bApplySingleDepthMode = b; }
   Bool      getApplySingleDepthMode()                                        { return m_bApplySingleDepthMode; }
@@ -2877,5 +2626,5 @@
   Void      setEnableTMVPFlag     ( Bool   b )    { m_enableTMVPFlag = b; }
   Bool      getEnableTMVPFlag     ()              { return m_enableTMVPFlag;}
-#if I0044_SLICE_TMVP
+#if H_MV
   Void      setAvailableForTMVPRefFlag     ( Bool   b )    { m_availableForTMVPRefFlag = b; }
   Bool      getAvailableForTMVPRefFlag     ()              { return m_availableForTMVPRefFlag;}
@@ -2917,9 +2666,7 @@
   Int* getDepthToDisparityF( Int refViewIdx ) { return m_depthToDisparityF[ refViewIdx ]; }; 
   Bool getVpsDepthModesFlag  ()  { return getVPS()->getVpsDepthModesFlag( getVPS()->getLayerIdInVps( m_layerId ) ); }
-#if SEPARATE_FLAG_I0085
   Bool getIVPFlag       ()  { return getVPS()->getIVPFlag( getVPS()->getLayerIdInVps( m_layerId ) ); }
 #endif
-#endif
-#if MTK_LOW_LATENCY_IC_ENCODING_H0086_FIX
+#if H_3D_IC
   Void    setICEnableCandidate( Int* ICEnableCandidate)   { m_aICEnableCandidate = ICEnableCandidate; };
   Void    setICEnableNum( Int* ICEnableNum)   { m_aICEnableNum = ICEnableNum; };
Index: trunk/source/Lib/TLibCommon/TComWedgelet.cpp
===================================================================
--- trunk/source/Lib/TLibCommon/TComWedgelet.cpp	(revision 1067)
+++ trunk/source/Lib/TLibCommon/TComWedgelet.cpp	(revision 1084)
@@ -68,7 +68,5 @@
                                                             m_uiHeight ( rcWedge.m_uiHeight  ),
                                                             m_pbPattern( (Bool*)xMalloc( Bool, (m_uiWidth * m_uiHeight) ) )
-#if SHARP_DMM1_I0110
                                                             ,m_pbScaledPattern( g_wedgePattern )
-#endif
 {
   ::memcpy( m_pbPattern, rcWedge.m_pbPattern, sizeof(Bool) * (m_uiWidth * m_uiHeight));
@@ -88,7 +86,5 @@
 
   m_pbPattern = (Bool*)xMalloc( Bool, (m_uiWidth * m_uiHeight) );
-#if SHARP_DMM1_I0110
   m_pbScaledPattern = g_wedgePattern;
-#endif
 }
 
@@ -187,21 +183,7 @@
   switch( m_eWedgeRes )
   {
-#if !SHARP_DMM1_I0110
-  case( DOUBLE_PEL ): { uiTempBlockSize =  m_uiWidth;     uhXs = (m_uhXs<<1); uhYs = (m_uhYs<<1); uhXe = (m_uhXe<<1); uhYe = (m_uhYe<<1); } break;
-#endif
   case(   FULL_PEL ): { uiTempBlockSize =  m_uiWidth;     uhXs =  m_uhXs;     uhYs =  m_uhYs;     uhXe =  m_uhXe;     uhYe =  m_uhYe;     } break;
   case(   HALF_PEL ): { uiTempBlockSize = (m_uiWidth<<1); uhXs =  m_uhXs;     uhYs =  m_uhYs;     uhXe =  m_uhXe;     uhYe =  m_uhYe;     } break;
   }
-
-#if !SHARP_DMM1_I0110
-  if( m_eWedgeRes == DOUBLE_PEL) // adjust line-end for DOUBLE_PEL resolution
-  {
-    if( m_uhOri == 1 ) { uhXs = uiTempBlockSize-1; }
-    if( m_uhOri == 2 ) { uhXe = uiTempBlockSize-1; uhYs = uiTempBlockSize-1; }
-    if( m_uhOri == 3 ) { uhYe = uiTempBlockSize-1; }
-    if( m_uhOri == 4 ) { uhYe = uiTempBlockSize-1; }
-    if( m_uhOri == 5 ) { uhXs = uiTempBlockSize-1; }
-  }
-#endif
 
   Bool* pbTempPattern = new Bool[ (uiTempBlockSize * uiTempBlockSize) ];
@@ -233,7 +215,4 @@
   switch( m_eWedgeRes )
   {
-#if !SHARP_DMM1_I0110
-  case( DOUBLE_PEL ): { for( UInt k = 0; k < (m_uiWidth * m_uiHeight); k++ ) { m_pbPattern[k] = pbTempPattern[k]; }; } break;
-#endif
   case(   FULL_PEL ): { for( UInt k = 0; k < (m_uiWidth * m_uiHeight); k++ ) { m_pbPattern[k] = pbTempPattern[k]; }; } break;
   case(   HALF_PEL ): // sub-sampling by factor 2
@@ -327,24 +306,22 @@
 }
 
-#if SHARP_DMM1_I0110
 Bool* TComWedgelet::getScaledPattern(UInt uiDstSize)
 {
-    Bool *pbSrcPat = this->getPattern();
-    UInt uiSrcSize = this->getStride();
-
-    Int scale = (g_aucConvertToBit[uiDstSize] - g_aucConvertToBit[uiSrcSize]);
-    assert(scale>=0);
-    for (Int y=0; y<uiDstSize; y++)
-    {
-       for (Int x=0; x<uiDstSize; x++)
-       {
-           Int srcX = x>>scale;
-           Int srcY = y>>scale;
-           m_pbScaledPattern[y*uiDstSize + x] = pbSrcPat[ srcY*uiSrcSize + srcX ];
-       }
-   }
-   return m_pbScaledPattern;
-}
-#endif
+  Bool *pbSrcPat = this->getPattern();
+  UInt uiSrcSize = this->getStride();
+
+  Int scale = (g_aucConvertToBit[uiDstSize] - g_aucConvertToBit[uiSrcSize]);
+  assert(scale>=0);
+  for (Int y=0; y<uiDstSize; y++)
+  {
+    for (Int x=0; x<uiDstSize; x++)
+    {
+      Int srcX = x>>scale;
+      Int srcY = y>>scale;
+      m_pbScaledPattern[y*uiDstSize + x] = pbSrcPat[ srcY*uiSrcSize + srcX ];
+    }
+  }
+  return m_pbScaledPattern;
+}
 
 TComWedgeNode::TComWedgeNode()
Index: trunk/source/Lib/TLibCommon/TComWedgelet.h
===================================================================
--- trunk/source/Lib/TLibCommon/TComWedgelet.h	(revision 1067)
+++ trunk/source/Lib/TLibCommon/TComWedgelet.h	(revision 1084)
@@ -58,5 +58,4 @@
 #define DIM_NO_IDX     MAX_UINT
 
-#if HS_DMM_SIGNALLING_I0120
 __inline UInt getDimType  ( Int intraMode ) 
 { 
@@ -64,11 +63,5 @@
     return (dimType >= 0 && dimType < DIM_NUM_TYPE) ? (UInt)dimType : DIM_NO_IDX; 
 }
-#else
-__inline UInt getDimType  ( Int intraMode ) { Int dimType = (intraMode-DIM_OFFSET)/2; return (dimType >= 0 && dimType < DIM_NUM_TYPE) ? (UInt)dimType : DIM_NO_IDX; }
-#endif
 __inline Bool isDimMode   ( Int intraMode ) { return (getDimType( intraMode ) < DIM_NUM_TYPE); }
-#if !HS_DMM_SIGNALLING_I0120
-__inline Bool isDimDeltaDC( Int intraMode ) { return (isDimMode( intraMode ) && ((intraMode-DIM_OFFSET)%2) == 1); }
-#endif
 #endif
 
@@ -79,7 +72,4 @@
 enum WedgeResolution
 {
-#if !SHARP_DMM1_I0110
-  DOUBLE_PEL,
-#endif
   FULL_PEL,
   HALF_PEL
@@ -106,7 +96,5 @@
 
   Bool* m_pbPattern;
-#if SHARP_DMM1_I0110
   Bool* m_pbScaledPattern;
-#endif
 
   Void  xGenerateWedgePattern();
@@ -134,7 +122,5 @@
   Bool            getIsCoarse() { return m_bIsCoarse; }
   UInt            getAng     () { return m_uiAng; }
-#if SHARP_DMM1_I0110
   Bool*           getScaledPattern(UInt uiWidth);
-#endif
 
   Void  setWedgelet( UChar uhXs, UChar uhYs, UChar uhXe, UChar uhYe, UChar uhOri, WedgeResolution eWedgeRes, Bool bIsCoarse = false );
Index: trunk/source/Lib/TLibCommon/TComYuv.cpp
===================================================================
--- trunk/source/Lib/TLibCommon/TComYuv.cpp	(revision 1067)
+++ trunk/source/Lib/TLibCommon/TComYuv.cpp	(revision 1084)
@@ -689,8 +689,6 @@
   UInt iSrc1Stride = pcYuvSrc1->getStride();
   UInt iDstStride  = getStride();
-#if QC_I0129_ARP_FIX
   Int iIFshift = IF_INTERNAL_PREC - g_bitDepthY;
   Int iOffSet  = ( 1 << ( iIFshift - 1 ) ) + IF_INTERNAL_OFFS;
-#endif
   for ( y = uiHeight-1; y >= 0; y-- )
   {
@@ -700,9 +698,5 @@
       if( bClip )
       {
-#if QC_I0129_ARP_FIX
         pDst[x] = ClipY( ( pDst[x] + iOffSet ) >> iIFshift );
-#else
-        pDst[x] = ClipY( pDst[x] );
-#endif
       }
     }
@@ -727,8 +721,8 @@
   UInt  iSrc1Stride = pcYuvSrc1->getCStride();
   UInt  iDstStride  = getCStride();
-#if QC_I0129_ARP_FIX
+
   Int iIFshift = IF_INTERNAL_PREC - g_bitDepthC;
   Int iOffSet  = ( 1 << ( iIFshift - 1 ) ) + IF_INTERNAL_OFFS;
-#endif
+
   for ( y = uiHeight-1; y >= 0; y-- )
   {
@@ -739,11 +733,6 @@
       if( bClip )
       {
-#if QC_I0129_ARP_FIX
         pDstU[x] = ClipC( ( pDstU[x] + iOffSet ) >> iIFshift );
         pDstV[x] = ClipC( ( pDstV[x] + iOffSet ) >> iIFshift );
-#else
-        pDstU[x] = ClipC( pDstU[x] );
-        pDstV[x] = ClipC( pDstV[x] );
-#endif
       }
     }
@@ -761,8 +750,7 @@
 {
   subtractARPLuma  ( pcYuvSrc0, pcYuvSrc1,  uiAbsPartIdx, uiWidth    , uiHeight    );
-#if SHARP_ARP_CHROMA_I0104
+
   if (uiWidth > 8)
-#endif
-  subtractARPChroma( pcYuvSrc0, pcYuvSrc1,  uiAbsPartIdx, uiWidth>>1 , uiHeight>>1 );
+    subtractARPChroma( pcYuvSrc0, pcYuvSrc1,  uiAbsPartIdx, uiWidth>>1 , uiHeight>>1 );
 }
 
@@ -823,8 +811,7 @@
 {
   multiplyARPLuma( uiAbsPartIdx , uiWidth , uiHeight , dW );
-#if SHARP_ARP_CHROMA_I0104
+
   if (uiWidth > 8)
-#endif
-  multiplyARPChroma( uiAbsPartIdx , uiWidth >> 1 , uiHeight >> 1 , dW );
+    multiplyARPChroma( uiAbsPartIdx , uiWidth >> 1 , uiHeight >> 1 , dW );
 }
 
Index: trunk/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- trunk/source/Lib/TLibCommon/TypeDef.h	(revision 1067)
+++ trunk/source/Lib/TLibCommon/TypeDef.h	(revision 1084)
@@ -111,5 +111,7 @@
                                               // MTK_ARP_REF_SELECTION_G0053 ARP Reference picture selection in JCT3V-G0053 
                                               // MTK_ALIGN_SW_WD_BI_PRED_ARP_H0085  Align the SW and WD for the bi-prediction ARP PUs by disallowing non-normative fast bi-prediction for ARP PUs, JCT3V-H0085
-
+                                              // QC_I0051_ARP_SIMP          
+                                              // SHARP_ARP_CHROMA_I0104     
+                                              // MTK_I0072_IVARP_SCALING_FIX
 
 #define H_3D_IC                           1   // Illumination Compensation, JCT3V-B0045, JCT3V-C0046, JCT3V-D0060
@@ -123,10 +125,6 @@
                                               // SEC_IC_ARP_SIG_G0072, Disabling IC when ARP is enabled, option 1 in JCT3V-G0072, part 2 in JCT3V-G0121
                                               // MTK_LOW_LATENCY_IC_ENCODING_H0086  Low-latency IC encoding in JCT3V-H0086
-
-#define MTK_LOW_LATENCY_IC_ENCODING_H0086_FIX  1  // Remove the global variables used in JCT3V-H0086
-
-
-#define SEC_IC_NEIGHBOR_CLIP_I0080        1   // Clipping of neighboring sample position, JCT3V-I0080
-
+                                              // MTK_LOW_LATENCY_IC_ENCODING_H0086_FIX  1  // Remove the global variables used in JCT3V-H0086
+                                              // SEC_IC_NEIGHBOR_CLIP_I0080    // Clipping of neighboring sample position, JCT3V-I0080
 
 #if H_3D_NBDV
@@ -177,7 +175,8 @@
                                               // SHARP_SIMPLE_MERGE_H0062      Restrict 3D-HEVC merge cand in small PUs
                                               // MTK_DIS_SPBIP8X4_H0205        Disable bi-prediction for 8x4 and 4x8 sub PU and remove the SPIVMP 2Nx2N restriction
-                                              // SEC_ADAPT_DISABLE_IVMP        Disalbing IVMP merge candidates when IC is enabled, JCT3V-H0070
-
-#define SEC_SIMP_SHIFTED_DV_I0086         1   // Simplification of Shifted DV candidate, JCT3V-I0086
+                                              // SEC_ADAPT_DISABLE_IVMP        Disabling IVMP merge candidates when IC is enabled, JCT3V-H0070
+                                              // SEC_SIMP_SHIFTED_DV_I0086     Simplification of Shifted DV candidate, JCT3V-I0086
+
+
 
 #define H_3D_TMVP                         1   // QC_TMVP_C0047 
@@ -222,11 +221,16 @@
                                               // SEC_NO_RESI_DLT_H0105    
                                               // MTK_DLT_CODING_FIX_H0091 
-
-#define MTK_SINGLE_DEPTH_MODE_I0095       1   // Single depth mode proposed in JCT3V-I0095
-#if MTK_SINGLE_DEPTH_MODE_I0095
-#define MTK_SINGLE_DEPTH_MODE_CANDIDATE_LIST_SIZE            2 // size of the sample candidate list
-#endif
-
-#define H_3D_FIX_UNINIT                   1   // Fix uninitialized flag
+                                              // HS_DMM_SIGNALLING_I0120
+                                              // SHARP_DMM1_I0110 // LUT size reduction for DMM1 proposed in JCT3V-I0110 
+                                              // FAST_SDC_OFFSET_DECISION_I0084
+                                              // SEPARATE_FLAG_I0085
+                                              // H_3D_DELTA_DLT
+                                              // RWTH_DLT_CLIP_I0057               1
+
+
+
+#define H_3D_SINGLE_DEPTH                 1   // Single depth mode proposed in JCT3V-I0095
+
+
 #define H_3D_INTER_SDC                    1   // INTER SDC, Inter simplified depth coding
                                               // LGE_INTER_SDC_E0156 Enable inter SDC for depth coding
@@ -245,9 +249,8 @@
                                               // MTK_DBBP_SIGNALING_H0094    
                                               // H_3D_FIX_DBBP_IVMP        Fix . Enable IVMP is always disabled, when DBBP is enabled. The original intention is to disable Sub-PU IVMP when DBBP is enabled, not to disable IVMP itself. 
-
-#define SEC_DBBP_EXPLICIT_SIG_I0077       1   // Remove the partition derivation and signal dbbp_flag only when the partion mode is 2NxN/Nx2N, JCT3V-I0077
-#define SEC_DBBP_DISALLOW_8x8_I0078       1   // Disallow DBBP in 8x8 CU, JCT3V-I0078
-#define SHARP_DBBP_SIMPLE_FLTER_I0109     1   // Simple condition and one dimensional dilter for DBBP
-#define SEC_DBBP_DMM4_THRESHOLD_I0076     1   // Simplification of threshold derivation for DBBP and DMM4, JCT3V-I0076
+                                              // SEC_DBBP_EXPLICIT_SIG_I0077       1   // Remove the partition derivation and signal dbbp_flag only when the partition mode is 2NxN/Nx2N, JCT3V-I0077
+                                              // Disallow DBBP in 8x8 CU, JCT3V-I0078
+                                              // SHARP_DBBP_SIMPLE_FLTER_I0109     1   // Simple condition and one dimensional filter for DBBP
+                                              // SEC_DBBP_DMM4_THRESHOLD_I0076     Simplification of threshold derivation for DBBP and DMM4, JCT3V-I0076
 
 
@@ -256,8 +259,8 @@
 #define H_3D_FCO                          0   // Flexible coding order for 3D
 #if H_3D_FCO
-#define LGE_FCO_I0116                     1
-#endif
-
-#define SCU_HS_FAST_INTRA_SDC_I0123       1
+#define H_3D_FCO                     1
+#endif
+
+#define H_3D_FAST_INTRA_SDC               1   // I0123
 
 // OTHERS
@@ -271,16 +274,8 @@
 #endif
 
-#define MTK_I0099_VPS_EX2                 1  ///< JCT3V-I0099, sub-PU size signaling and lim_qt_pred_flag in VPS extension 2
-#define MTK_I0099_FIX                     1  ///< Fix the problem of removing encoder only QTL 
-
 // Rate Control
 #define KWU_FIX_URQ                       1
 #define KWU_RC_VIEWRC_E0227               0  ///< JCT3V-E0227, view-wise target bitrate allocation
 #define KWU_RC_MADPRED_E0227              0  ///< JCT3V-E0227, inter-view MAD prediction
-
-#define SEC_VPS_CLEANUP_I0090             1
-#define SEC_HLS_CLEANUP_I0100             1
-
-#define H_3D_FIX_64BIT_SHIFT              1
 #endif // H_3D
 
@@ -292,12 +287,9 @@
 
 // Fixes
-#define FIX_TICKET_79                     1    // Unused VSP code
-#define FIX_TICKET_75                     1    // Bi-pred restriction bug in VSP
-#define FIX_TICKET_68                     1    // MV clipping bug in the sub-PU MPI default MV generation
-#define FIX_TICKET_71                     1    // IC parameters is meaningless in HTM when no training samples are available
-#define FIX_TICKET_77                     1    // Unused variable m_iBitsPerDepthValue
-#define FIX_TICKET_76                     1    // unused functions
-#define FIX_TICKET_62                     1    // buffer overflow for print
-#define FIX_TICKET_61                     1    // layerIdsInSets size check
+
+///// ***** SINGLE DEPTH MODE *********
+#if H_3D_SINGLE_DEPTH
+#define SINGLE_DEPTH_MODE_CAND_LIST_SIZE            2 // size of the sample candidate list
+#endif
 
 ///// ***** VIEW SYNTHESIS OPTIMIZAION *********
@@ -308,5 +300,4 @@
 #define H_3D_VSO_RM_ASSERTIONS            0   // Output VSO assertions
 #define H_3D_VSO_SYNTH_DIST_OUT           0   // Output of synthesized view distortion instead of depth distortion in encoder output
-#define H_3D_VSO_FIX                      1   // This fix should be enabled after verification 
 #endif
 
@@ -321,29 +312,16 @@
 #if H_3D_ARP
 #define H_3D_ARP_WFNR                     3
-#define QC_I0129_ARP_FIX                  1
-#define QC_I0051_ARP_SIMP                 1
-#define SHARP_ARP_CHROMA_I0104            1
-#define MTK_I0072_IVARP_SCALING_FIX       1
 #endif
 
 ///// ***** DEPTH INTRA MODES *********
 #if H_3D_DIM
+                                              // HHI_DMM4_ENC_I0066
 #define H_3D_DIM_DMM                      1   // Depth Modeling Modes
 #define H_3D_DIM_SDC                      1   // Simplified Depth Coding method
 #define H_3D_DIM_DLT                      1   // Depth Lookup Table
-#define HS_DMM_SIGNALLING_I0120  1   
-#define SHARP_DMM1_I0110                  1   // LUT size reduction for DMM1 proposed in JCT3V-I0110 
-#define FIX_WARNING                       1   // fix narrowing conversion of NumPocStCurr0,NumPocStCurr1 at TComSlice.cpp
-#define FAST_SDC_OFFSET_DECISION_I0084    1
-#define SEPARATE_FLAG_I0085               1
-
-#if H_3D_DIM_DLT
-#define H_3D_DELTA_DLT                    1
-#define RWTH_DLT_CLIP_I0057               1
-#endif
+
 #define H_3D_DIM_ENC                      1   // Depth Intra encoder optimizations, includes:
                                               // HHI_DEPTH_INTRA_SEARCH_RAU_C0160
                                               // LG_ZEROINTRADEPTHRESI_A0087
-#define HHI_DMM4_ENC_I0066                1
 #endif
 ///// ***** VIEW SYNTHESIS PREDICTION *********
@@ -370,5 +348,5 @@
 #if H_3D_DBBP
 #define DBBP_INVALID_SHORT                (-4)
-#define RWTH_DBBP_PACK_MODE               SIZE_2NxN
+#define DBBP_PACK_MODE               SIZE_2NxN
 #endif
 
@@ -389,46 +367,7 @@
 /////////////////////////////////////////////////////////////////////////////////
 // TBD: Check if integration is necessary. 
-
-
-
-//Added by Qualcomm for HLS
-#define DISCARDABLE_PIC_RPS              1      ///< JCT3V-G0131: Inter-layer RPS and temporal RPS should not contain picture with discardable_flag equal to 1
-#define VPS_MISC_UPDATES                 1      ///< Misc updates:JCT3V-0240, 
-#define NON_REF_NAL_TYPE_DISCARDABLE     1      ///< JCT3V-G0031: If discardable picture is a non-IRAP, it must be a non-referenced sub-layer picture
-#define INFERENCE_POC_MSB_VAL_PRESENT    1      ///< JCT3V-H0042: poc_msb_val_present_flag shall be equal to 0 when slice_header_extension_length is (inferred to be ) equal to 0
-#define INFERENCE_POC_RESET_INFO_PRESENT 1      ///< JCT3V-H0042: Infer the value of poc_reset_info_present_flag to be equal to 0 when no pps extension / pps extension for multilayer.
-#define I0044_SLICE_TMVP                 1      ///< JCT3V-I0044: Regarding slice_temporal_mvp_enabled_flag
-#define I0045_BR_PR_ADD_LAYER_SET        1      ///< JCT3V-I0045: Signalling of bit-rate and picture rate for additional layer set
-#define I0045_VPS_VUI_VST_PARAMS         1      ///< JCT3V-I0045: Related to signalling of VST parameters of the base layer.
-
-
-#define H_MV_HLS10_GEN                       0  // General changes (not tested)
-
-#define H_MV_HLS10_AUX                       1 // Auxiliary pictures
-#define H_MV_HLS10_GEN_FIX                   1
-#define H_MV_FIX_LOOP_GOPSIZE                1
-#define H_MV_FIX_SUB_LAYERS_MAX_MINUS1       1
-
-#define H_MV_HLS10_GEN_VSP_CONF_WIN          1  // VPS conformance window
-#define H_MV_HLS10_GEN_VSP_BASE_LAYER_AVAIL  1  // vps_base_layer_available
-#define H_MV_HLS10_REF_PRED_LAYERS           1  // reference and predicted layer derivation
-#define H_MV_HLS10_NESSECARY_LAYER           1  // necessary layers
-#define H_MV_HLS10_ADD_LAYERSETS             1  // additional layer sets
-#define H_MV_HLS10_DBP_SIZE                  1  // dpb size syntax structure
-#define H_MV_HLS10_MAXNUMPICS                1  // constraint on number of pictures in rps  
-#define H_MV_HLS10_PTL                       1  // profile tier level
-#define H_MV_HLS10_PTL_FIX                   1  // profile tier level fix
-#define H_MV_HLS10_PTL_INBL_FIX              1  // profile tier level fix 
-#define H_MV_HLS10_PTL_INFER_FIX             1  // fix inference ptl
-#define H_MV_HLS10_MULTILAYERSPS             1  // multilayer SPS extension 
-#define H_MV_HLS10_VPS_VUI                   1  // vsp vui
-#define H_MV_HLS10_VPS_VUI_BSP               1  // vsp vui bsp
-#define H_MV_HLS10_PPS                       1  // PPS modifications
-
-#define H_MV_HLS10_VPS_VUI_BSP_STORE         0  // Currently bsp vui bsp hrd parameters are not stored, some dynamic memory allocation with upper bounds is required. 
-
-
+#define H_MV_HLS_PTL_LIMITS                  0
 #define H_MV_HLS7_GEN                        0  // General changes (not tested)
-
+#define H_MV_ALIGN_HM_15                     1  
 
 // POC
@@ -452,16 +391,4 @@
 //#define H_MV_HLS_7_SEI_P0123_25  0 // (SEI/P0123/Alpha channel info) #25 Add alpha channel information SEI message Decision: Adopt. Constrain the bit depth indicated to be equal to the coded bit depth of the aux picture. 
 
-// Auxiliary picture related
-//#define H_MV_HLS_8_AUX_NODOC_40  0 // #40 (AUX    /NODOC/primary pic) Clarify that an auxiliary picture can be associated with more than one primary picture. Consider if the language associating an alpha auxiliary picture with a primary picture in the semantics of dimension_id[ ][ ] near the AuxId derivation could be moved to the alpha SEI message.
-//#define H_MV_HLS_8_AUX_Q0081_2   0 // #2  (AUX    /Q0081/primary) Decision: Remove the constraint that an alpha picture must be accompanied by a primary picture.
-//#define H_MV_HLS_8_AUX_Q0078_44  0 // #44 (AUX    /Q0078/concepts Auxiliary picture concepts:
-//#define H_MV_HLS_8_AUX_Q0078_39  0 // #39 (AUX    /Q0078/conformance): mechanism for signaling a profile/tier/level conformance point for auxiliary pictures
-
-// Profiles
-//#define H_MV_HLS_8_PRO_NODOC_50  0 // #50 (PROF   /NODOC/Monochrome) Add Monochrome 8-bit profile
-//#define H_MV_HLS_8_PRO_NODOC_31  0 // #31 (PROF   /NODOC/Profile constraint) Add a profile constraint to the Scalable Main, Scalable Main 10, and Stereo Main profiles against allowing layers with duplicate values of DependencyId (or ViewOrderIdx) when AuxId equal to 0.
-//#define H_MV_HLS_8_PRO_H0126_45  0 // #45 (PROF   /H0126/Stereo main) Phrasing used in specifying the Stereo Main profile. 
-//#define H_MV_HLS_8_PRO_Q0160_33  0 // #33 (PROF   /Q0160/alt_output_flag) v2: Add constraint to stereo main profile that it must contain exactly two texture views, and add a note to state that the constraint implies a restriction that alt_output_flag equal to 0. 
-
 // DPB
 //#define H_MV_HLS_8_HRD_Q0102_09  0 // #9  (HRD    /Q0102/NoOutputOfPriorPicsFlag) It was suggested that also the separate_colour_plane_flag should affect inference of NoOutputOfPriorPicsFlag. Decision (Ed.): Agreed (affects RExt text).
@@ -491,4 +418,6 @@
 #define SAO_SGN_FUNC 1
 
+#define TILE_SIZE_CHECK 1
+
 #define FIX1172 1 ///< fix ticket #1172
 
@@ -506,17 +435,16 @@
 #define MAX_NESTING_NUM_LAYER       64
 
-#if H_MV_HLS10_VPS_VUI_BSP
+#if H_MV
 #define MAX_VPS_NUM_HRD_PARAMETERS                1024
+#else
+#define MAX_VPS_NUM_HRD_PARAMETERS                1
+#endif
+#if H_MV
 #define MAX_NUM_SUB_LAYERS                        7
 #define MAX_NUM_SIGNALLED_PARTITIONING_SCHEMES    16
-#else
-#define MAX_VPS_NUM_HRD_PARAMETERS                1
-#endif
-
+#endif
 #define MAX_VPS_OP_SETS_PLUS1                     1024
 #if H_MV
-#if H_MV_HLS10_ADD_LAYERSETS
 #define MAX_VPS_NUM_ADD_LAYER_SETS                1024
-#endif
 #define MAX_VPS_NUH_LAYER_ID_PLUS1  63
 #define MAX_NUM_SCALABILITY_TYPES   16
@@ -533,17 +461,7 @@
 #define MAX_VPS_PROFILE_TIER_LEVEL      64
 #define MAX_VPS_ADD_OUTPUT_LAYER_SETS   1024
-#if H_MV_HLS10_ADD_LAYERSETS
 #define MAX_VPS_OUTPUTLAYER_SETS        ( MAX_VPS_ADD_OUTPUT_LAYER_SETS + MAX_VPS_OP_SETS_PLUS1 + MAX_VPS_OP_SETS_PLUS1 )
-#else
-#define MAX_VPS_OUTPUTLAYER_SETS        ( MAX_VPS_ADD_OUTPUT_LAYER_SETS + MAX_VPS_OP_SETS_PLUS1 )
-#endif
 #define  MAX_NUM_VIDEO_SIGNAL_INFO      16
 #define MAX_NUM_SCALED_REF_LAYERS       MAX_NUM_LAYERS-1
-#if !H_MV_HLS10_VPS_VUI_BSP
-#define MAX_NUM_BSP_HRD_PARAMETERS      100 ///< Maximum value is actually not specified
-#define MAX_NUM_BITSTREAM_PARTITIONS    100 ///< Maximum value is actually not specified 
-#define MAX_NUM_BSP_SCHED_COMBINATION   100 ///< Maximum value is actually not specified 
-#define MAX_SUB_STREAMS                 1024
-#endif
 #else
 #define MAX_NUM_LAYER_IDS                64
@@ -1016,15 +934,7 @@
     MAINSTILLPICTURE = 3,
 #if H_MV
-#if H_MV_HLS10_PTL
     MULTIVIEWMAIN = 6,
 #if H_3D
     MAIN3D = 8, 
-#endif
-#else
-    MAINSTEREO = 4,
-    MAINMULTIVIEW = 5,
-#if H_3D
-    MAIN3D = 6, 
-#endif
 #endif
 #endif
@@ -1069,8 +979,6 @@
 #endif    
     VIEW_ORDER_INDEX  = 1,
-#if H_MV_HLS10_AUX
     DEPENDENCY_ID = 2,
     AUX_ID = 3,
-#endif    
   };
 #endif
Index: trunk/source/Lib/TLibDecoder/TDecCAVLC.cpp
===================================================================
--- trunk/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 1067)
+++ trunk/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 1084)
@@ -53,10 +53,6 @@
   }
   // To avoid mismatches
-#if H_MV_HLS10_GEN_FIX
   fprintf( g_hTrace, "=========== Sequence Parameter Set LayerId: %d ===========\n", pSPS->getLayerId() );
 #else
-  fprintf( g_hTrace, "=========== Sequence Parameter Set ===========\n" );
-#endif
-#else
   fprintf( g_hTrace, "=========== Sequence Parameter Set ID: %d ===========\n", pSPS->getSPSId() );
 #endif
@@ -70,9 +66,5 @@
     return; 
   }
-#if H_MV_HLS10_GEN_FIX
   fprintf( g_hTrace, "=========== Picture Parameter Set LayerId: %d ===========\n", pPPS->getLayerId() );
-#else
-  fprintf( g_hTrace, "=========== Picture Parameter Set ===========\n" );
-#endif
 #else
   fprintf( g_hTrace, "=========== Picture Parameter Set ID: %d ===========\n", pPPS->getPPSId() );
@@ -300,30 +292,28 @@
   if( pcPPS->getTilesEnabledFlag() )
   {
-    READ_UVLC ( uiCode, "num_tile_columns_minus1" );                pcPPS->setNumColumnsMinus1( uiCode );  
-    READ_UVLC ( uiCode, "num_tile_rows_minus1" );                   pcPPS->setNumRowsMinus1( uiCode );  
-    READ_FLAG ( uiCode, "uniform_spacing_flag" );                   pcPPS->setUniformSpacingFlag( uiCode );
-
-    if( !pcPPS->getUniformSpacingFlag())
-    {
-      UInt* columnWidth = (UInt*)malloc(pcPPS->getNumColumnsMinus1()*sizeof(UInt));
-      for(UInt i=0; i<pcPPS->getNumColumnsMinus1(); i++)
+    READ_UVLC ( uiCode, "num_tile_columns_minus1" );                pcPPS->setNumTileColumnsMinus1( uiCode );  
+    READ_UVLC ( uiCode, "num_tile_rows_minus1" );                   pcPPS->setNumTileRowsMinus1( uiCode );  
+    READ_FLAG ( uiCode, "uniform_spacing_flag" );                   pcPPS->setTileUniformSpacingFlag( uiCode == 1 );
+
+    if( !pcPPS->getTileUniformSpacingFlag())
+    {
+      std::vector<Int> columnWidth(pcPPS->getNumTileColumnsMinus1());
+      for(UInt i=0; i<pcPPS->getNumTileColumnsMinus1(); i++)
       { 
         READ_UVLC( uiCode, "column_width_minus1" );  
         columnWidth[i] = uiCode+1;
       }
-      pcPPS->setColumnWidth(columnWidth);
-      free(columnWidth);
-
-      UInt* rowHeight = (UInt*)malloc(pcPPS->getNumRowsMinus1()*sizeof(UInt));
-      for(UInt i=0; i<pcPPS->getNumRowsMinus1(); i++)
+      pcPPS->setTileColumnWidth(columnWidth);
+
+      std::vector<Int> rowHeight (pcPPS->getTileNumRowsMinus1());
+      for(UInt i=0; i<pcPPS->getTileNumRowsMinus1(); i++)
       {
         READ_UVLC( uiCode, "row_height_minus1" );
         rowHeight[i] = uiCode + 1;
       }
-      pcPPS->setRowHeight(rowHeight);
-      free(rowHeight);  
-    }
-
-    if(pcPPS->getNumColumnsMinus1() !=0 || pcPPS->getNumRowsMinus1() !=0)
+      pcPPS->setTileRowHeight(rowHeight);
+    }
+
+    if(pcPPS->getNumTileColumnsMinus1() !=0 || pcPPS->getTileNumRowsMinus1() !=0)
     {
       READ_FLAG ( uiCode, "loop_filter_across_tiles_enabled_flag" );   pcPPS->setLoopFilterAcrossTilesEnabledFlag( uiCode ? true : false );
@@ -342,19 +332,4 @@
     }
   }
-#if !H_MV_HLS10_PPS
-#if H_MV
-  if ( pcPPS->getLayerId() > 0 )
-  {
-    READ_FLAG( uiCode, "pps_infer_scaling_list_flag" ); pcPPS->setPpsInferScalingListFlag( uiCode == 1 );    
-  }
-
-  if( pcPPS->getPpsInferScalingListFlag( ) ) 
-  {
-    READ_CODE( 6, uiCode, "pps_scaling_list_ref_layer_id" ); pcPPS->setPpsScalingListRefLayerId( uiCode );
-  }
-  else
-  {  
-#endif
-#endif
   READ_FLAG( uiCode, "pps_scaling_list_data_present_flag" );           pcPPS->setScalingListPresentFlag( uiCode ? true : false );
   if(pcPPS->getScalingListPresentFlag ())
@@ -362,9 +337,4 @@
     parseScalingList( pcPPS->getScalingList() );
   }
-#if !H_MV_HLS10_PPS
-#if H_MV
-  }
-#endif
-#endif
   READ_FLAG( uiCode, "lists_modification_present_flag");
   pcPPS->setListsModificationPresentFlag(uiCode);
@@ -400,10 +370,5 @@
     if ( pcPPS->getPpsMultilayerExtensionFlag() )
     { 
-#if H_MV_HLS10_PPS
       parsePPSMultilayerExtension( pcPPS ); 
-#else
-      READ_FLAG( uiCode, "poc_reset_info_present_flag" ); pcPPS->setPocResetInfoPresentFlag( uiCode == 1 );
-      READ_FLAG( uiCode, "pps_extension_reserved_zero_flag" );
-#endif
     }
 #if !H_3D
@@ -505,7 +470,4 @@
               READ_CODE(8, uiNumDepthValues, "num_depth_values_in_dlt[i]");   // num_entry
 
-#if !H_3D_DELTA_DLT
-              if ( pcDLT->getInterViewDltPredEnableFlag( i ) == false )       // Single-view DLT Diff Coding
-#endif
               {
                 // The condition if( pcVPS->getNumDepthValues(i) > 0 ) is always true since for Single-view Diff Coding, there is at least one depth value in depth component. 
@@ -555,5 +517,4 @@
             }
             
-#if H_3D_DELTA_DLT
             if( pcDLT->getInterViewDltPredEnableFlag( i ) )
             {
@@ -571,8 +532,5 @@
               pcDLT->setDepthLUTs(i, aiIdx2DepthValue, uiNumDepthValues);
             }
-#else
-            // store final DLT
-            pcDLT->setDepthLUTs(i, aiIdx2DepthValue, uiNumDepthValues);
-#endif
+
           }
         }
@@ -782,5 +740,4 @@
     READ_CODE( 3,  uiCode, "sps_max_sub_layers_minus1" );          pcSPS->setMaxTLayers   ( uiCode+1 );
     assert(uiCode <= 6);
-#if H_MV_HLS10_MULTILAYERSPS
 #if H_MV
   }
@@ -793,5 +750,4 @@
   {
 #endif
-#endif
 
     READ_FLAG( uiCode, "sps_temporal_id_nesting_flag" );               pcSPS->setTemporalIdNestingFlag ( uiCode > 0 ? true : false );
@@ -803,9 +759,7 @@
 
     parsePTL(pcSPS->getPTL(), 1, pcSPS->getMaxTLayers() - 1);
-#if H_MV_HLS10_PTL_INFER_FIX
+#if H_MV
     pcSPS->getPTL()->inferGeneralValues ( true, 0, NULL ); 
     pcSPS->getPTL()->inferSubLayerValues( pcSPS->getMaxTLayers() - 1, 0, NULL );
-#endif
-#if H_MV
   }
 #endif
@@ -813,9 +767,5 @@
   assert(uiCode <= 15);
 #if H_MV
-#if H_MV_HLS10_MULTILAYERSPS
   if ( pcSPS->getMultiLayerExtSpsFlag() )
-#else 
-  if ( pcSPS->getLayerId() > 0 )
-#endif
   {
     READ_FLAG( uiCode, "update_rep_format_flag" );               pcSPS->setUpdateRepFormatFlag( uiCode == 1 );
@@ -839,9 +789,4 @@
     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_HLS10_MULTILAYERSPS
-#if H_MV
-  }
-#endif
-#endif
   READ_FLAG(     uiCode, "conformance_window_flag");
   if (uiCode != 0)
@@ -855,7 +800,5 @@
     READ_UVLC(   uiCode, "conf_win_top_offset" );                conf.setWindowTopOffset   ( uiCode  );
     READ_UVLC(   uiCode, "conf_win_bottom_offset" );             conf.setWindowBottomOffset( uiCode  );    
-#if H_MV_HLS10_MULTILAYERSPS
-  }
-#endif
+  }
 #else
     READ_UVLC(   uiCode, "conf_win_left_offset" );               conf.setWindowLeftOffset  ( uiCode * TComSPS::getWinUnitX( pcSPS->getChromaFormatIdc() ) );
@@ -867,9 +810,5 @@
 
 #if H_MV
-#if H_MV_HLS10_MULTILAYERSPS
   if ( !pcSPS->getMultiLayerExtSpsFlag() )
-#else // H_MV_HLS10_GEN
-  if ( pcSPS->getLayerId() == 0 )
-#endif // H_MV_HLS10_GEN
   { 
 #endif
@@ -891,9 +830,5 @@
 
 #if H_MV
-#if H_MV_HLS10_MULTILAYERSPS
   if ( !pcSPS->getMultiLayerExtSpsFlag()) 
-#else 
-  if ( pcSPS->getLayerId() == 0 ) 
-#endif
   {  
 #endif
@@ -954,9 +889,5 @@
   {
 #if H_MV
-#if H_MV_HLS10_MULTILAYERSPS
     if ( pcSPS->getMultiLayerExtSpsFlag() )
-#else 
-    if ( pcSPS->getLayerId() > 0 )
-#endif
     {    
       READ_FLAG( uiCode, "sps_infer_scaling_list_flag" ); pcSPS->setSpsInferScalingListFlag( uiCode == 1 );
@@ -1086,20 +1017,4 @@
   READ_FLAG( uiCode, "inter_view_mv_vert_constraint_flag" );    pcSPS->setInterViewMvVertConstraintFlag(uiCode == 1 ? true : false);
   
-#if !H_MV_HLS10_PPS
-  READ_UVLC( uiCode, "num_scaled_ref_layer_offsets" ); pcSPS->setNumScaledRefLayerOffsets( uiCode );
-
-  for( Int i = 0; i < pcSPS->getNumScaledRefLayerOffsets( ); i++)
-  {    
-    READ_CODE( 6, uiCode, "scaled_ref_layer_id" ); pcSPS->setScaledRefLayerId( i, uiCode ); 
-
-    Int j = pcSPS->getScaledRefLayerId( i ); 
-    Int iCode; 
-    READ_SVLC( iCode, "scaled_ref_layer_left_offset" ); pcSPS->setScaledRefLayerLeftOffset( j, iCode );
-    READ_SVLC( iCode, "scaled_ref_layer_top_offset" ); pcSPS->setScaledRefLayerTopOffset( j, iCode );
-    READ_SVLC( iCode, "scaled_ref_layer_right_offset" ); pcSPS->setScaledRefLayerRightOffset( j, iCode );
-    READ_SVLC( iCode, "scaled_ref_layer_bottom_offset" ); pcSPS->setScaledRefLayerBottomOffset( j, iCode );
-    READ_FLAG( uiCode, "sps_multilayer_ext_reserved_zero_flag[ i ]" );
-  }
-#endif
 }
 
@@ -1107,21 +1022,8 @@
 Void TDecCavlc::parseSPSExtension2( TComSPS* pcSPS, Int viewIndex, Bool depthFlag )
 { 
-#if !MTK_I0099_VPS_EX2
-  UInt uiCode; 
-#if H_3D_QTLPC
-  //GT: This has to go to VPS
-  if( depthFlag )
-  {
-    READ_FLAG( uiCode, "use_qtl_flag" );
-    pcSPS->setUseQTL( uiCode );
-    READ_FLAG( uiCode, "use_pc_flag" );
-    pcSPS->setUsePC( uiCode );
-  }
-#endif
-#endif
-}
-#endif
-
-#if H_MV_HLS10_PPS
+
+}
+#endif
+
 Void TDecCavlc::parsePPSMultilayerExtension(TComPPS* pcPPS)
 {
@@ -1134,5 +1036,4 @@
 
 #endif
-#endif
 
 Void TDecCavlc::parseVPS(TComVPS* pcVPS)
@@ -1143,9 +1044,5 @@
 #if H_MV
   READ_FLAG( uiCode, "vps_base_layer_internal_flag" );            pcVPS->setVpsBaseLayerInternalFlag( uiCode == 1 );
-#if H_MV_HLS10_GEN_VSP_BASE_LAYER_AVAIL
   READ_FLAG( uiCode, "vps_base_layer_available_flag" );           pcVPS->setVpsBaseLayerAvailableFlag( uiCode == 1 );
-#else
-  READ_FLAG( uiCode, "vps_reserved_one_bit" );                    assert( uiCode == 1 ); 
-#endif
 #else
   READ_CODE( 2,  uiCode,  "vps_reserved_three_2bits" );           assert(uiCode == 3);
@@ -1162,9 +1059,7 @@
   READ_CODE( 16, uiCode,  "vps_reserved_ffff_16bits" );           assert(uiCode == 0xffff);
   parsePTL ( pcVPS->getPTL(), true, pcVPS->getMaxTLayers()-1);
-#if H_MV_HLS10_PTL_INFER_FIX
 #if H_MV
   pcVPS->getPTL()->inferGeneralValues ( true, 0, NULL );
   pcVPS->getPTL()->inferSubLayerValues( pcVPS->getMaxTLayers() - 1, 0, NULL );
-#endif
 #endif
   UInt subLayerOrderingInfoPresentFlag;
@@ -1193,9 +1088,5 @@
   READ_CODE( 6, uiCode, "vps_max_layer_id" );   pcVPS->setVpsMaxLayerId( uiCode );
 
-#if H_MV_HLS10_GEN_FIX
   READ_UVLC(    uiCode, "vps_num_layer_sets_minus1" );  pcVPS->setVpsNumLayerSetsMinus1( uiCode );
-#else
-  READ_UVLC(    uiCode, "vps_max_num_layer_sets_minus1" );               pcVPS->setVpsNumLayerSetsMinus1( uiCode );
-#endif
   for( UInt opsIdx = 1; opsIdx <= pcVPS->getVpsNumLayerSetsMinus1(); opsIdx ++ )
   {
@@ -1241,4 +1132,9 @@
         READ_FLAG( uiCode, "cprms_present_flag[i]" );              pcVPS->setCprmsPresentFlag( uiCode == 1 ? true : false, i );
       }
+      else
+      {
+        pcVPS->setCprmsPresentFlag( true, i );
+      }
+
       parseHrdParameters(pcVPS->getHrdParameters(i), pcVPS->getCprmsPresentFlag( i ), pcVPS->getMaxTLayers() - 1);
     }
@@ -1286,20 +1182,11 @@
   UInt uiCode; 
 
-#if H_MV_HLS10_PTL
   if( pcVPS->getMaxLayersMinus1() > 0  &&  pcVPS->getVpsBaseLayerInternalFlag() )
   {
     parsePTL( pcVPS->getPTL( 1 ),0, pcVPS->getMaxSubLayersMinus1()  );  
     
-#if !H_MV_HLS10_PTL_INFER_FIX
-    // Copy Profile info
-    TComPTL temp = *pcVPS->getPTL( 1 );
-    *pcVPS->getPTL( 1 ) = *pcVPS->getPTL( 0 );
-    pcVPS->getPTL( 1 )->copyLevelFrom( &temp );
-#else
     pcVPS->getPTL( 1 )->inferGeneralValues ( false, 1, pcVPS->getPTL( 0 ) );
     pcVPS->getPTL( 1 )->inferSubLayerValues( pcVPS->getMaxSubLayersMinus1(), 1, pcVPS->getPTL( 0 ) );    
-#endif
-  }
-#endif 
+  }
 
   READ_FLAG( uiCode, "splitting_flag" );                          pcVPS->setSplittingFlag( uiCode == 1 ? true : false );
@@ -1375,5 +1262,4 @@
   pcVPS->setRefLayers(); 
 
-#if H_MV_HLS10_ADD_LAYERSETS
   if ( pcVPS->getNumIndependentLayers() > 1 ) 
   {
@@ -1388,5 +1274,4 @@
     pcVPS->deriveAddLayerSetLayerIdList( i );
   }
-#endif
 
   READ_FLAG( uiCode, "vps_sub_layers_max_minus1_present_flag" ); pcVPS->setVpsSubLayersMaxMinus1PresentFlag( uiCode == 1 );
@@ -1425,5 +1310,4 @@
   READ_UVLC( uiCode, "vps_num_profile_tier_level_minus1" );  pcVPS->setVpsNumProfileTierLevelMinus1( uiCode );  
 
-#if H_MV_HLS10_PTL
   Int offsetVal =  ( pcVPS->getMaxLayersMinus1() > 0  &&  pcVPS->getVpsBaseLayerInternalFlag() ) ? 2 : 1;   
   for( Int i = pcVPS->getVpsBaseLayerInternalFlag() ? 2 : 1; i <= pcVPS->getVpsNumProfileTierLevelMinus1(); i++ )
@@ -1431,44 +1315,9 @@
     READ_FLAG(  uiCode, "vps_profile_present_flag[i]" );    pcVPS->setVpsProfilePresentFlag( i, uiCode == 1 );
     parsePTL ( pcVPS->getPTL( offsetVal ), pcVPS->getVpsProfilePresentFlag( i ), pcVPS->getMaxTLayers()-1);
-#if H_MV_HLS10_PTL_INFER_FIX
     pcVPS->getPTL( offsetVal )->inferGeneralValues ( pcVPS->getVpsProfilePresentFlag( i ), offsetVal, pcVPS->getPTL( offsetVal - 1 ) );    
     pcVPS->getPTL( offsetVal )->inferSubLayerValues( pcVPS->getMaxSubLayersMinus1()      , offsetVal, pcVPS->getPTL( offsetVal - 1 ) );    
-#else
-    if( !pcVPS->getVpsProfilePresentFlag( i ) )
-    {
-      TComPTL temp = *pcVPS->getPTL( offsetVal );
-      *pcVPS->getPTL( offsetVal ) = *pcVPS->getPTL( offsetVal - 1 );
-      pcVPS->getPTL( offsetVal )->copyLevelFrom( &temp );
-    }
-#endif
     offsetVal++;
   }
-#else 
-  for( Int i = 1; i <= pcVPS->getVpsNumProfileTierLevelMinus1(); i++ )
-  {
-    READ_FLAG(  uiCode, "vps_profile_present_flag[i]" );    pcVPS->setVpsProfilePresentFlag( i, uiCode == 1 );
-    parsePTL ( pcVPS->getPTL( i ), pcVPS->getVpsProfilePresentFlag( i ), pcVPS->getMaxTLayers()-1);
-    if( !pcVPS->getVpsProfilePresentFlag( i ) )
-    {
-      TComPTL temp = *pcVPS->getPTL( i );
-      *pcVPS->getPTL( i ) = *pcVPS->getPTL( i - 1 );
-      pcVPS->getPTL( i )->copyLevelFrom( &temp );
-    }
-  }
-#endif 
-
-#if !H_MV_HLS10_ADD_LAYERSETS
-  if ( pcVPS->getNumIndependentLayers() > 1 ) 
-  {
-   READ_UVLC( uiCode, "num_add_layer_sets"      ); pcVPS->setNumAddLayerSets( uiCode );
-  }
-  for (Int i = 0; i < pcVPS->getNumAddLayerSets(); i++)
-  {
-    for (Int j = 0; j < pcVPS->getNumIndependentLayers(); j++)
-    {
-      READ_CODE( pcVPS->getHighestLayerIdxPlus1Len( j ) , uiCode, "highest_layer_idx_plus1" ); pcVPS->setHighestLayerIdxPlus1( i, j, uiCode );
-    }
-  }
-#endif
+
 
   if (pcVPS->getNumLayerSets() > 1)
@@ -1484,24 +1333,16 @@
   pcVPS->setLayerSetIdxForOlsMinus1(0, -1); 
 
-#if H_MV_HLS10_NESSECARY_LAYER
   pcVPS->deriveNecessaryLayerFlags( 0 ); 
-#endif 
   pcVPS->deriveTargetLayerIdList( 0 ); 
 
-#if H_MV_HLS10_PTL_FIX
   if (pcVPS->getVpsBaseLayerInternalFlag() )
   {  
     pcVPS->setProfileTierLevelIdx(0,0, pcVPS->inferProfileTierLevelIdx(0,0) );
   }
-#endif
   for( Int i = 1; i < pcVPS->getNumOutputLayerSets( ); i++ )
   {
     if( i >= pcVPS->getNumLayerSets( ) )    
     {        
-#if !VPS_MISC_UPDATES
-      READ_UVLC( uiCode,      "layer_set_idx_for_ols_minus1[i]" ); pcVPS->setLayerSetIdxForOlsMinus1( i, uiCode ); 
-#else
       READ_CODE( pcVPS->getLayerSetIdxForOlsMinus1Len( i ), uiCode, "layer_set_idx_for_ols_minus1[i]" ); pcVPS->setLayerSetIdxForOlsMinus1( i, uiCode ); 
-#endif
     }
 
@@ -1520,10 +1361,7 @@
       }
     }
-#if H_MV_HLS10_NESSECARY_LAYER
     pcVPS->deriveNecessaryLayerFlags( i ); 
-#endif
     pcVPS->deriveTargetLayerIdList( i ); 
 
-#if H_MV_HLS10_PTL
     for ( Int j = 0; j < pcVPS->getNumLayersInIdList( pcVPS->olsIdxToLsIdx(i)); j++ )
     {    
@@ -1532,17 +1370,9 @@
         READ_CODE( pcVPS->getProfileTierLevelIdxLen(), uiCode,"profile_tier_level_idx[ i ][ j ]" );   pcVPS->setProfileTierLevelIdx( i, j, uiCode ); 
       }
-#if H_MV_HLS10_PTL_FIX
       if (pcVPS->getNecessaryLayerFlag( i, j ) && pcVPS->getVpsNumProfileTierLevelMinus1() == 0 )
       {
         pcVPS->setProfileTierLevelIdx( i , j, pcVPS->inferProfileTierLevelIdx( i, j) );
       }
-#endif
-    }
-#else
-    if ( pcVPS->getProfileLevelTierIdxLen()  > 0 )
-    { 
-      READ_CODE( pcVPS->getProfileLevelTierIdxLen(), uiCode,"profile_level_tier_idx[ i ]" );   pcVPS->setProfileLevelTierIdx( i , uiCode ); 
-    }
-#endif
+    }
 
     if( pcVPS->getNumOutputLayersInOutputLayerSet( i ) == 1 && pcVPS->getNumDirectRefLayers( pcVPS->getOlsHighestOutputLayerId( i ) ) > 0 )
@@ -1594,7 +1424,4 @@
   }
 
-#if !H_MV_HLS10_GEN_FIX
-  READ_FLAG( uiCode, "vps_reserved_zero_flag" ); 
-#endif
   parseDpbSize( pcVPS ); 
 
@@ -1670,5 +1497,4 @@
     pcRepFormat->inferChromaAndBitDepth(pcPrevRepFormat, false ); 
   }
-#if H_MV_HLS10_GEN_VSP_CONF_WIN
   READ_FLAG( uiCode, "conformance_window_vps_flag" ); pcRepFormat->setConformanceWindowVpsFlag( uiCode == 1 );
   if ( pcRepFormat->getConformanceWindowVpsFlag() )
@@ -1679,5 +1505,4 @@
     READ_UVLC( uiCode, "conf_win_vps_bottom_offset" ); pcRepFormat->setConfWinVpsBottomOffset( uiCode );
   }
-#endif 
 }
 
@@ -1705,9 +1530,5 @@
   if( pcVPSVUI->getBitRatePresentVpsFlag( )  ||  pcVPSVUI->getPicRatePresentVpsFlag( ) )
   {
-#if H_MV_HLS10_VPS_VUI
     for( Int i = pcVPS->getVpsBaseLayerInternalFlag() ? 0 : 1; i  <  pcVPS->getNumLayerSets(); i++ )
-#else
-    for( Int i = pcVPS->getVpsBaseLayerInternalFlag() ? 0 : 1; i  <=  pcVPS->getVpsNumLayerSetsMinus1(); i++ )
-#endif
     {
       for( Int j = 0; j  <=  pcVPS->getMaxSubLayersInLayerSetMinus1( i ); j++ ) 
@@ -1742,9 +1563,5 @@
   else
   {
-#if H_MV_HLS10_VPS_VUI
     pcVPSVUI->setVpsNumVideoSignalInfoMinus1( pcVPS->getMaxLayersMinus1() - pcVPS->getVpsBaseLayerInternalFlag() ? 0 : 1 ); 
-#else
-    pcVPSVUI->setVpsNumVideoSignalInfoMinus1( pcVPS->getMaxLayersMinus1() ); 
-#endif
   }
 
@@ -1757,5 +1574,4 @@
   }
 
-#if I0045_VPS_VUI_VST_PARAMS
   if( pcVPSVUI->getVideoSignalInfoIdxPresentFlag() && pcVPSVUI->getVpsNumVideoSignalInfoMinus1() > 0 )
   {
@@ -1779,21 +1595,5 @@
     }
   }
-#else
-  if( pcVPSVUI->getVideoSignalInfoIdxPresentFlag() && pcVPSVUI->getVpsNumVideoSignalInfoMinus1() > 0 )
-  {
-    for( Int i = 1; i <=  pcVPS->getMaxLayersMinus1(); i++ )
-    {
-      READ_CODE( 4, uiCode, "vps_video_signal_info_idx" ); pcVPSVUI->setVpsVideoSignalInfoIdx( i, uiCode );
-      assert( pcVPSVUI->getVpsVideoSignalInfoIdx( i ) >= 0 && pcVPSVUI->getVpsVideoSignalInfoIdx( i ) <= pcVPSVUI->getVpsNumVideoSignalInfoMinus1() );
-    }
-  }
-  else
-  {
-    for( Int i = 1; i <=  pcVPS->getMaxLayersMinus1(); i++ )
-    {
-      pcVPSVUI->setVpsVideoSignalInfoIdx( i, pcVPSVUI->getVideoSignalInfoIdxPresentFlag() ? 0 : i ); 
-    }
-  }
-#endif
+
   READ_FLAG( uiCode, "tiles_not_in_use_flag" ); pcVPSVUI->setTilesNotInUseFlag( uiCode == 1 );
   if( !pcVPSVUI->getTilesNotInUseFlag() ) 
@@ -1811,9 +1611,5 @@
       for( Int j = 0; j < pcVPS->getNumDirectRefLayers( pcVPS->getLayerIdInNuh( i ) ) ; j++ )
       {
-#if H_MV_HLS10_REF_PRED_LAYERS
         Int layerIdx = pcVPS->getLayerIdInVps(pcVPS->getIdDirectRefLayer(pcVPS->getLayerIdInNuh( i ) , j  ));  
-#else
-        Int layerIdx = pcVPS->getLayerIdInVps(pcVPS->getRefLayerId(pcVPS->getLayerIdInNuh( i ) , j  ));  
-#endif
         if( pcVPSVUI->getTilesInUseFlag( i )  &&  pcVPSVUI->getTilesInUseFlag( layerIdx ) )  
         {
@@ -1833,10 +1629,6 @@
     }
   }
-#if H_MV_HLS10_VPS_VUI
   READ_FLAG( uiCode, "single_layer_for_non_irap_flag" ); pcVPSVUI->setSingleLayerForNonIrapFlag( uiCode == 1 );
   READ_FLAG( uiCode, "higher_layer_irap_skip_flag" ); pcVPSVUI->setHigherLayerIrapSkipFlag( uiCode == 1 );
-#else 
-  READ_CODE( 3, uiCode, "vps_vui_reserved_zero_3bits" ); 
-#endif
   READ_FLAG( uiCode, "ilp_restricted_ref_layers_flag" ); pcVPSVUI->setIlpRestrictedRefLayersFlag( uiCode == 1 );
 
@@ -1847,9 +1639,5 @@
       for( Int j = 0; j < pcVPS->getNumDirectRefLayers( pcVPS->getLayerIdInNuh( i ) ); j++ )
       {
-#if H_MV_HLS10_REF_PRED_LAYERS
         if( pcVPS->getVpsBaseLayerInternalFlag() || pcVPS->getIdDirectRefLayer( pcVPS->getLayerIdInNuh( i ), j ) > 0 )
-#else
-        if( pcVPS->getVpsBaseLayerInternalFlag() || pcVPS->getRefLayerId( pcVPS->getLayerIdInNuh( i ), j ) > 0 )
-#endif
         {        
           READ_UVLC( uiCode, "min_spatial_segment_offset_plus1" ); pcVPSVUI->setMinSpatialSegmentOffsetPlus1( i, j, uiCode );
@@ -1870,7 +1658,5 @@
   if ( pcVPSVUI->getVpsVuiBspHrdPresentFlag( ) )
   {
-#if VPS_MISC_UPDATES
     assert(pcVPS->getTimingInfo()->getTimingInfoPresentFlag() == 1);
-#endif
     parseVpsVuiBspHrdParameters( pcVPS ); 
   }
@@ -1893,13 +1679,8 @@
 
   TComVpsVuiBspHrdParameters*  vpsVuiBspHrdP = pcVPSVUI->getVpsVuiBspHrdParameters(); 
-#if H_MV_HLS10_VPS_VUI_BSP
   assert( vpsVuiBspHrdP == NULL ); 
   vpsVuiBspHrdP = new TComVpsVuiBspHrdParameters; 
   pcVPSVUI->setVpsVuiBspHrdParameters( vpsVuiBspHrdP ); 
-#else
-  assert ( vpsVuiBspHrdP );
-#endif
   UInt uiCode; 
-#if H_MV_HLS10_VPS_VUI_BSP
   READ_UVLC( uiCode, "vps_num_add_hrd_params" ); vpsVuiBspHrdP->setVpsNumAddHrdParams( uiCode );
   vpsVuiBspHrdP->createAfterVpsNumAddHrdParams( pcVPS ); 
@@ -1990,42 +1771,4 @@
     }
   }  
-#else
-  READ_UVLC( uiCode, "vps_num_bsp_hrd_parameters_minus1" ); vpsVuiBspHrdP->setVpsNumBspHrdParametersMinus1( uiCode );
-  for( Int i = 0; i <= vpsVuiBspHrdP->getVpsNumBspHrdParametersMinus1( ); i++ )
-  {  
-    if( i > 0 )
-    {
-      READ_FLAG( uiCode, "bsp_cprms_present_flag" ); vpsVuiBspHrdP->setBspCprmsPresentFlag( i, uiCode == 1 );
-    }
-    TComHRD* hrdParameters = vpsVuiBspHrdP->getHrdParametermeters( i ); 
-    parseHrdParameters( hrdParameters, vpsVuiBspHrdP->getBspCprmsPresentFlag( i ), pcVPS->getMaxSubLayersMinus1() );     
-  }  
-  for( Int h = 1; h <= pcVPS->getVpsNumLayerSetsMinus1(); h++ )
-  {  
-    READ_UVLC( uiCode, "num_bitstream_partitions" ); vpsVuiBspHrdP->setNumBitstreamPartitions( h, uiCode );
-    for( Int i = 0; i < vpsVuiBspHrdP->getNumBitstreamPartitions( h ); i++ )  
-    {
-      for( Int j = 0; j < pcVPS->getNumLayersInIdList( h ); j++ )  
-      {
-        READ_FLAG( uiCode, "layer_in_bsp_flag" ); vpsVuiBspHrdP->setLayerInBspFlag( h, i, j, uiCode == 1 );
-      }
-    }
-    vpsVuiBspHrdP->checkLayerInBspFlag( pcVPS, h ); 
-    
-    if( vpsVuiBspHrdP->getNumBitstreamPartitions( h ) )
-    {  
-      READ_UVLC( uiCode, "num_bsp_sched_combinations_minus1" ); vpsVuiBspHrdP->setNumBspSchedCombinationsMinus1( h, uiCode );
-      for( Int i = 0; i <= vpsVuiBspHrdP->getNumBspSchedCombinationsMinus1( h ); i++ )
-      {
-        for( Int j = 0; j < vpsVuiBspHrdP->getNumBitstreamPartitions( h ); j++ )
-        {  
-          READ_CODE( vpsVuiBspHrdP->getBspCombHrdIdxLen(), uiCode, "bsp_comb_hrd_idx" ); vpsVuiBspHrdP->setBspCombHrdIdx( h, i, j, uiCode );
-          READ_UVLC( uiCode, "bsp_comb_sched_idx" ); vpsVuiBspHrdP->setBspCombSchedIdx( h, i, j, uiCode );
-          vpsVuiBspHrdP->checkBspCombHrdAndShedIdx( pcVPS, h, i, j ); 
-        }  
-      }
-    }  
-  }  
-#endif  
 }
 
@@ -2060,5 +1803,4 @@
         for( Int k = 0; k < vps->getNumLayersInIdList( currLsIdx ); k++ )   
         {
-#if H_MV_HLS10_DBP_SIZE
           if ( vps->getNecessaryLayerFlag( i, k ) && ( vps->getVpsBaseLayerInternalFlag() || ( vps->getLayerSetLayerIdList(vps->olsIdxToLsIdx(i),k) != 0 ) ))
           {
@@ -2072,7 +1814,4 @@
             }
           }
-#else
-          READ_UVLC( uiCode, "max_vps_dec_pic_buffering_minus1" ); dpbSize->setMaxVpsDecPicBufferingMinus1( i, k, j, uiCode );
-#endif
         }
         READ_UVLC( uiCode, "max_vps_num_reorder_pics" ); dpbSize->setMaxVpsNumReorderPics( i, j, uiCode );
@@ -2085,12 +1824,8 @@
           for( Int k = 0; k < vps->getNumLayersInIdList( vps->olsIdxToLsIdx( i ) ); k++ )   
           {
-#if H_MV_HLS10_DBP_SIZE
             if ( vps->getNecessaryLayerFlag(i, k ) )
             {            
-#endif
               dpbSize->setMaxVpsDecPicBufferingMinus1( i, k, j, dpbSize->getMaxVpsDecPicBufferingMinus1( i,k, j - 1 ) );
-#if H_MV_HLS10_DBP_SIZE
             }
-#endif            
           }
           dpbSize->setMaxVpsNumReorderPics      ( i, j, dpbSize->getMaxVpsNumReorderPics      ( i, j - 1 ) );
@@ -2106,9 +1841,5 @@
 {
   UInt uiCode; 
-#if SEC_VPS_CLEANUP_I0090
   for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ )
-#else
-  for( Int i = 0; i <= pcVPS->getMaxLayersMinus1(); i++ )
-#endif
   {
 #if H_3D_ARP
@@ -2119,20 +1850,12 @@
     pcVPS->setSubPULog2Size(i, 0);
 #endif
-#if !SEC_VPS_CLEANUP_I0090
-    if ( i != 0 )
-#endif
-    {
-#if MTK_I0099_VPS_EX2
+    {
+#if H_3D_IV_MERGE
       READ_FLAG( uiCode, "iv_mv_pred_flag[i]");          pcVPS->setIvMvPredFlag         ( i, uiCode == 1 ? true : false );
-#if SEC_HLS_CLEANUP_I0100
       READ_FLAG( uiCode, "iv_mv_scaling_flag[i]");       pcVPS->setIvMvScalingFlag         ( i, uiCode == 1 ? true : false );
 #endif
-#endif
       if( !( pcVPS->getDepthId( i ) == 1 ) )
       {
 #if H_3D_IV_MERGE
-#if !MTK_I0099_VPS_EX2
-        READ_FLAG( uiCode, "iv_mv_pred_flag[i]");          pcVPS->setIvMvPredFlag         ( i, uiCode == 1 ? true : false );
-#endif
         if( !pcVPS->getNumDirectRefLayers(i) )
         {
@@ -2166,33 +1889,13 @@
       else
       {
-#if !MTK_I0099_VPS_EX2
-#if H_3D_IV_MERGE
-        if(i!=1)
-        {
-          READ_FLAG( uiCode, "iv_mv_pred_flag[i]");          pcVPS->setIvMvPredFlag         ( i, uiCode == 1 ? true : false );
-          if( !pcVPS->getNumDirectRefLayers(i) )
-          {
-            assert( !uiCode );         
-          }
-        }
-#endif
-#if H_3D_SPIVMP
-        if (i!=1)
-        {
-          READ_UVLC (uiCode, "log2_sub_PU_size_minus3[i]");     pcVPS->setSubPULog2Size(i, uiCode+3); 
-        }
-#endif
-#endif
 #if H_3D_IV_MERGE
         READ_FLAG( uiCode, "mpi_flag[i]" );             pcVPS->setMPIFlag( i, uiCode == 1 ? true : false );
-#endif
-#if MTK_I0099_VPS_EX2
         READ_UVLC (uiCode, "log2_mpi_sub_PU_size_minus3[i]");     pcVPS->setSubPUMPILog2Size(i, uiCode+3);
 #endif
         READ_FLAG( uiCode, "vps_depth_modes_flag[i]" );             pcVPS->setVpsDepthModesFlag( i, uiCode == 1 ? true : false );
-#if SEPARATE_FLAG_I0085
+#if H_3D
         READ_FLAG( uiCode, "ivp_flag[i]" );                   pcVPS->setIVPFlag( i, uiCode == 1 ? true : false );
 #endif
-#if MTK_I0099_VPS_EX2
+#if H_3D_QTLPC
         READ_FLAG( uiCode, "lim_qt_pred_flag[i]");                  pcVPS->setLimQtPredFlag     ( i, uiCode == 1 ? true : false ); 
 #endif
@@ -2209,9 +1912,5 @@
 
   READ_UVLC( uiCamParPrecision, "cp_precision" );
-#if SEC_VPS_CLEANUP_I0090
   for (UInt viewIndex=1; viewIndex<pcVPS->getNumViews(); viewIndex++)
-#else
-  for (UInt viewIndex=0; viewIndex<pcVPS->getNumViews(); viewIndex++)
-#endif
   {
     pcVPS->setCamParPresent         ( viewIndex, false );
@@ -2235,10 +1934,4 @@
     }
   }
-#if !MTK_I0099_VPS_EX2
-  READ_UVLC (uiCode, "log2_sub_PU_MPI_size_minus3");              pcVPS->setSubPUMPILog2Size( uiCode + 3 ); 
-#endif
-#if !SEC_HLS_CLEANUP_I0100
-  READ_FLAG( uiCode, "iv_mv_scaling_flag");                       pcVPS->setIvMvScalingFlag( uiCode == 1 ? true : false ); 
-#endif
 }
 #endif
@@ -2288,7 +1981,4 @@
   sps->inferScalingList( parameterSetManager->getActiveSPS( sps->getSpsScalingListRefLayerId() ) );   
   sps->inferSpsMaxDecPicBufferingMinus1( vps, targetOlsIdx, rpcSlice->getLayerId(), false ); 
-#if !H_MV_HLS10_ADD_LAYERSETS 
-  vps->inferDbpSizeLayerSetZero( sps, false ); 
-#endif
 
   if ( sps->getVuiParametersPresentFlag() )
@@ -2358,5 +2048,4 @@
       esb++; 
       READ_FLAG( uiCode, "discardable_flag" ); rpcSlice->setDiscardableFlag( uiCode == 1 );
-#if NON_REF_NAL_TYPE_DISCARDABLE
       if ( uiCode == 1 )
       {
@@ -2367,5 +2056,4 @@
           rpcSlice->getNalUnitType() != NAL_UNIT_CODED_SLICE_RASL_R);
       }
-#endif
     }
 
@@ -2515,9 +2203,5 @@
           rps->checkMaxNumPics( 
             vps->getVpsExtensionFlag(), 
-#if H_MV_HLS10_MAXNUMPICS
             MAX_INT,  // To be replaced by MaxDbpSize
-#else
-            vps->getMaxNumPics( rpcSlice->getLayerId() ),
-#endif
             rpcSlice->getLayerId(), 
             sps->getMaxDecPicBuffering( sps->getSpsMaxSubLayersMinus1() ) - 1 );
@@ -2632,9 +2316,5 @@
         rps->checkMaxNumPics( 
           vps->getVpsExtensionFlag(), 
-#if H_MV_HLS10_MAXNUMPICS
             MAX_INT,  // To be replaced by MaxDbpsize
-#else
-          vps->getMaxNumPics( rpcSlice->getLayerId() ),
-#endif
           rpcSlice->getLayerId(), 
           sps->getMaxDecPicBuffering( sps->getSpsMaxSubLayersMinus1() ) - 1 );
@@ -2655,5 +2335,5 @@
       if (rpcSlice->getSPS()->getTMVPFlagsPresent())
       {
-#if I0044_SLICE_TMVP
+#if H_MV
         READ_FLAG( uiCode, "slice_temporal_mvp_enabled_flag" );
 #else
@@ -2865,9 +2545,5 @@
     }
 #if H_3D_IC
-#if SEC_HLS_CLEANUP_I0100
     else if( rpcSlice->getViewIndex() && ( rpcSlice->getSliceType() == P_SLICE || rpcSlice->getSliceType() == B_SLICE ) && !rpcSlice->getIsDepth() && vps->getNumDirectRefLayers( layerId ) > 0 )
-#else
-    else if( rpcSlice->getViewIndex() && ( rpcSlice->getSliceType() == P_SLICE || rpcSlice->getSliceType() == B_SLICE ) && !rpcSlice->getIsDepth())
-#endif
     {
       UInt uiCodeTmp = 0;
@@ -2883,5 +2559,5 @@
     }
 #endif
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
     if(rpcSlice->getIsDepth())
     {
@@ -3009,5 +2685,5 @@
 
 #if H_3D
-#if LGE_FCO_I0116
+#if H_3D_FCO
   if( rpcSlice->getVPS()->hasCamParInSliceHeader( rpcSlice->getViewIndex() )  && rpcSlice->getIsDepth() )
 #else
@@ -3090,4 +2766,5 @@
     }
     assert( ( m_pcBitstream->getNumBitsRead() - posFollSliceSegHeaderExtLen ) == rpcSlice->getSliceSegmentHeaderExtensionLength() * 8  ); 
+  }
 #else
     READ_UVLC( uiCode, "slice_header_extension_length" );
@@ -3097,15 +2774,6 @@
       READ_CODE(8,ignore,"slice_header_extension_data_byte");
     }  
-#endif
-  }
-#if INFERENCE_POC_MSB_VAL_PRESENT
-  else
-  {
-    rpcSlice->setSliceSegmentHeaderExtensionLength( 0 );
-    rpcSlice->setPocMsbValPresentFlag( false );
-  }
-#endif
-
-
+  }
+#endif
   m_pcBitstream->readByteAlignment();
 
@@ -3198,10 +2866,6 @@
       READ_FLAG( uiCode, "sub_layer_profile_present_flag[i]" ); rpcPTL->setSubLayerProfilePresentFlag(i, uiCode);
 #if H_MV
-#if !H_MV_HLS10_PTL_INFER_FIX
-      rpcPTL->setSubLayerProfilePresentFlag( i, profilePresentFlag && rpcPTL->getSubLayerProfilePresentFlag(i) );
-#else
       // When profilePresentFlag is equal to 0, sub_layer_profile_present_flag[ i ] shall be equal to 0.
       assert( profilePresentFlag || !rpcPTL->getSubLayerProfilePresentFlag(i) );
-#endif
 #else
     }
@@ -3221,12 +2885,8 @@
   for(Int i = 0; i < maxNumSubLayersMinus1; i++)
   {
-#if H_MV_HLS10_PTL_INFER_FIX
 #if H_MV
     if( rpcPTL->getSubLayerProfilePresentFlag(i) )         
 #else
     if( profilePresentFlag && rpcPTL->getSubLayerProfilePresentFlag(i) )          
-#endif
-#else
-    if( profilePresentFlag && rpcPTL->getSubLayerProfilePresentFlag(i) )    
 #endif
     {
@@ -3262,13 +2922,6 @@
   ptl->setFrameOnlyConstraintFlag(uiCode ? true : false);
   
-#if H_MV_HLS10_PTL
-#if H_MV_HLS10_PTL_INFER_FIX
+#if H_MV
   if( ptl->getV2ConstraintsPresentFlag() )
-#else
-  if( ptl->getProfileIdc( ) ==  4 || ptl->getProfileCompatibilityFlag( 4 )  ||
-      ptl->getProfileIdc( ) ==  5 || ptl->getProfileCompatibilityFlag( 5 )  ||
-      ptl->getProfileIdc( ) ==  6 || ptl->getProfileCompatibilityFlag( 6 )  ||
-      ptl->getProfileIdc( ) ==  7 || ptl->getProfileCompatibilityFlag( 7 ) ) 
-#endif
   {
     READ_FLAG( uiCode, "max_12bit_constraint_flag" );        ptl->setMax12bitConstraintFlag      ( uiCode == 1 );
@@ -3291,12 +2944,5 @@
     READ_CODE(11, uiCode, "XXX_reserved_zero_43bits[32..42]");
   }
-#if H_MV_HLS10_PTL_INFER_FIX
   if( ptl->getInbldPresentFlag() )
-#else
-  if( ( ptl->getProfileIdc() >= 1 && ptl->getProfileIdc() <= 5 )  ||
-    ptl->getProfileCompatibilityFlag( 1 ) || ptl->getProfileCompatibilityFlag( 2 )  ||
-    ptl->getProfileCompatibilityFlag( 3 ) || ptl->getProfileCompatibilityFlag( 4 )  ||
-    ptl->getProfileCompatibilityFlag( 5 ) )
-#endif
   {
     READ_FLAG( uiCode, "inbld_flag" ); ptl->setInbldFlag( uiCode == 1 );
@@ -3331,5 +2977,5 @@
   assert(0);
 }
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
 Void TDecCavlc::parseSingleDepthMode( TComDataCU* /*pcCU*/, UInt /*uiAbsPartIdx*/, UInt /*uiDepth*/ )
 {
Index: trunk/source/Lib/TLibDecoder/TDecCAVLC.h
===================================================================
--- trunk/source/Lib/TLibDecoder/TDecCAVLC.h	(revision 1067)
+++ trunk/source/Lib/TLibDecoder/TDecCAVLC.h	(revision 1084)
@@ -97,8 +97,6 @@
 #endif
 
-#if H_MV_HLS10_PPS
 #if H_MV
   Void  parsePPSMultilayerExtension( TComPPS* pcPPS );
-#endif
 #endif
 
@@ -126,5 +124,5 @@
   
   Void  parseSkipFlag       ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
   Void  parseSingleDepthMode        ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
 #endif  
Index: trunk/source/Lib/TLibDecoder/TDecCu.cpp
===================================================================
--- trunk/source/Lib/TLibDecoder/TDecCu.cpp	(revision 1067)
+++ trunk/source/Lib/TLibDecoder/TDecCu.cpp	(revision 1084)
@@ -420,7 +420,4 @@
     Int vspFlag[MRG_MAX_NUM_CANDS_MEM];
     memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM);
-#if !FIX_TICKET_79
-    InheritedVSPDisInfo inheritedVSPDisInfo[MRG_MAX_NUM_CANDS_MEM];
-#endif
 #if H_3D_SPIVMP
     Bool bSPIVMPFlag[MRG_MAX_NUM_CANDS_MEM];
@@ -434,7 +431,4 @@
     m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex );
     m_ppcCU[uiDepth]->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours 
-#if !FIX_TICKET_79
-      , inheritedVSPDisInfo
-#endif
 #if H_3D_SPIVMP
       , pcMvFieldSP, puhInterDirSP
@@ -456,10 +450,4 @@
     m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex );
 #endif
-#endif
-#if H_3D_VSP && !FIX_TICKET_79
-    if(vspFlag[uiMergeIndex])
-    {
-      pcCU->setDvInfoSubParts(inheritedVSPDisInfo[uiMergeIndex].m_acDvInfo, uiAbsPartIdx, 0, uiDepth);
-    }
 #endif
     pcCU->setInterDirSubParts( uhInterDirNeighbours[uiMergeIndex], uiAbsPartIdx, 0, uiDepth );
@@ -546,5 +534,5 @@
     return;
   }
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
   m_pcEntropyDecoder->decodeSingleDepthMode( pcCU, uiAbsPartIdx, uiDepth );
   if(!pcCU->getSingleDepthFlag(uiAbsPartIdx))
@@ -580,5 +568,5 @@
   m_pcEntropyDecoder->decodeCoeff( pcCU, uiAbsPartIdx, uiDepth, uiCurrWidth, uiCurrHeight, bCodeDQP );
   setdQPFlag( bCodeDQP );
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
   }
 #endif
@@ -682,5 +670,5 @@
       break;
     case MODE_INTRA:
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
       if( m_ppcCU[uiDepth]->getSingleDepthFlag(0) )
         xReconIntraSingleDepth( m_ppcCU[uiDepth], 0, uiDepth );
@@ -730,5 +718,5 @@
   }
 }
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
 Void TDecCu::xReconIntraSingleDepth( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
 {
@@ -749,5 +737,5 @@
   Pel DepthNeighbours[5];
   Int index =0;
-  for( Int i = 0; (i < 5) && (index<MTK_SINGLE_DEPTH_MODE_CANDIDATE_LIST_SIZE) ; i++ )
+  for( Int i = 0; (i < 5) && (index<SINGLE_DEPTH_MODE_CAND_LIST_SIZE) ; i++ )
   {
     if(!pcCU->getNeighDepth (0, uiAbsPartIdx, &testDepth, i))
@@ -859,5 +847,5 @@
   // get collocated depth block
   UInt uiDepthStride = 0;
-#if LGE_FCO_I0116
+#if H_3D_FCO
   Pel* pDepthPels = pcCU->getVirtualDepthBlock(pcCU->getZorderIdxInCU(), pcCU->getWidth(0), pcCU->getHeight(0), uiDepthStride);
 #else
@@ -932,10 +920,6 @@
   
   // reconstruct final prediction signal by combining both segments
-#if SHARP_DBBP_SIMPLE_FLTER_I0109
   m_pcPrediction->combineSegmentsWithMask(apSegPredYuv, m_ppcYuvReco[uiDepth], pMask, pcCU->getWidth(0), pcCU->getHeight(0), 0, ePartSize);
-#else
-  m_pcPrediction->combineSegmentsWithMask(apSegPredYuv, m_ppcYuvReco[uiDepth], pMask, pcCU->getWidth(0), pcCU->getHeight(0));
-#endif
-  
+
   // inter recon
   xDecodeInterTexture( pcCU, 0, uiDepth );
@@ -1311,20 +1295,11 @@
     Int uiTabIdx = pcCU->getDmmWedgeTabIdx(DMM1_IDX, uiAbsPartIdx);
 
-#if SHARP_DMM1_I0110
     WedgeList* pacWedgeList  = pcCU->isDMM1UpscaleMode(uiWidth) ? &g_dmmWedgeLists[(g_aucConvertToBit[pcCU->getDMM1BasePatternWidth(uiWidth)])] :  &g_dmmWedgeLists[(g_aucConvertToBit[uiWidth])];
-#else
-    WedgeList* pacWedgeList = &g_dmmWedgeLists[(g_aucConvertToBit[uiWidth])];
-#endif
     TComWedgelet* pcWedgelet = &(pacWedgeList->at( uiTabIdx ));
 
     uiNumSegments = 2;
 
-#if SHARP_DMM1_I0110
     pbMask       = pcCU->isDMM1UpscaleMode( uiWidth ) ? pcWedgelet->getScaledPattern(uiWidth) : pcWedgelet->getPattern();
     uiMaskStride = pcCU->isDMM1UpscaleMode( uiWidth ) ? uiWidth : pcWedgelet->getStride();
-#else
-    pbMask = pcWedgelet->getPattern();
-    uiMaskStride = pcWedgelet->getStride();
-#endif
   }
   if( getDimType( uiLumaPredMode ) == DMM4_IDX )
Index: trunk/source/Lib/TLibDecoder/TDecCu.h
===================================================================
--- trunk/source/Lib/TLibDecoder/TDecCu.h	(revision 1067)
+++ trunk/source/Lib/TLibDecoder/TDecCu.h	(revision 1084)
@@ -123,5 +123,5 @@
   Void setdQPFlag               ( Bool b )                { m_bDecodeDQP = b;           }
   Void xFillPCMBuffer           (TComDataCU* pCU, UInt depth);
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
   Void xReconIntraSingleDepth( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
 #endif
Index: trunk/source/Lib/TLibDecoder/TDecEntropy.cpp
===================================================================
--- trunk/source/Lib/TLibDecoder/TDecEntropy.cpp	(revision 1067)
+++ trunk/source/Lib/TLibDecoder/TDecEntropy.cpp	(revision 1084)
@@ -52,5 +52,5 @@
   m_pcEntropyDecoderIf->parseSkipFlag( pcCU, uiAbsPartIdx, uiDepth );
 }
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
 Void TDecEntropy::decodeSingleDepthMode( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
 {
@@ -152,45 +152,7 @@
   
 #if H_3D_DBBP
-
-#if SEC_DBBP_EXPLICIT_SIG_I0077
-#if SEC_DBBP_DISALLOW_8x8_I0078
   if( pcCU->getSlice()->getVPS()->getUseDBBP(pcCU->getSlice()->getLayerIdInVps()) && (pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2NxN || pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_Nx2N) && pcCU->getWidth(uiAbsPartIdx) > 8 )
-#else
-  if( pcCU->getSlice()->getVPS()->getUseDBBP(pcCU->getSlice()->getLayerIdInVps()) && (pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2NxN || pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_Nx2N) )
-#endif
-#else
-#if SEC_DBBP_DISALLOW_8x8_I0078
-  if( pcCU->getSlice()->getVPS()->getUseDBBP(pcCU->getSlice()->getLayerIdInVps()) && pcCU->getWidth(uiAbsPartIdx) > 8 )
-#else
-  if( pcCU->getSlice()->getVPS()->getUseDBBP(pcCU->getSlice()->getLayerIdInVps()) )
-#endif
-#endif
   {
     decodeDBBPFlag(pcCU, uiAbsPartIdx, uiDepth);
-#if !SEC_DBBP_EXPLICIT_SIG_I0077    
-    if( pcCU->getDBBPFlag(uiAbsPartIdx) )
-    {
-      
-      // get collocated depth block
-      UInt uiDepthStride = 0;
-      Pel* pDepthPels = NULL;
-      pDepthPels = pcCU->getVirtualDepthBlock(uiAbsPartIdx, pcCU->getWidth(uiAbsPartIdx), pcCU->getHeight(uiAbsPartIdx), uiDepthStride);
-      
-      AOF( pDepthPels != NULL );
-      AOF( uiDepthStride != 0 );
-      
-      // derive true partitioning for this CU based on depth
-      // (needs to be done in parsing process as motion vector predictors are also derived during parsing)
-      PartSize eVirtualPartSize = m_pcPrediction->getPartitionSizeFromDepth(pDepthPels, uiDepthStride, pcCU->getWidth(uiAbsPartIdx));
-      AOF( eVirtualPartSize != SIZE_NONE );
-      
-      pcCU->setPartSizeSubParts(eVirtualPartSize, uiAbsPartIdx, uiDepth);
-      
-      // make sure that DBBP flag is set for both segments
-      UInt uiPUOffset = ( g_auiPUOffset[UInt( eVirtualPartSize )] << ( ( pcCU->getSlice()->getSPS()->getMaxCUDepth() - uiDepth ) << 1 ) ) >> 4;
-      pcCU->setDBBPFlagSubParts(true, uiAbsPartIdx, 0, uiDepth);
-      pcCU->setDBBPFlagSubParts(true, uiAbsPartIdx+uiPUOffset, 1, uiDepth);
-    }
-#endif
   }
 #endif
@@ -311,7 +273,4 @@
           Int vspFlag[MRG_MAX_NUM_CANDS_MEM];
           memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM);
-#if !FIX_TICKET_79
-          InheritedVSPDisInfo inheritedVSPDisInfo[MRG_MAX_NUM_CANDS_MEM];
-#endif
 #if H_3D_SPIVMP
           memset(bSPIVMPFlag, false, sizeof(Bool)*MRG_MAX_NUM_CANDS_MEM);
@@ -320,7 +279,4 @@
           pcSubCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand);
           pcSubCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours
-#if !FIX_TICKET_79
-            , inheritedVSPDisInfo
-#endif
 #if H_3D_SPIVMP
             , pcMvFieldSP, puhInterDirSP
@@ -334,10 +290,4 @@
           pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth );
 
-#if !FIX_TICKET_79
-          if(vspFlag[uiMergeIndex])
-          {
-            pcCU->setDvInfoSubParts(inheritedVSPDisInfo[uiMergeIndex].m_acDvInfo, uiSubPartIdx, uiPartIdx, uiDepth);
-          }
-#endif
 #else
 #if H_3D
@@ -360,7 +310,4 @@
         Int vspFlag[MRG_MAX_NUM_CANDS_MEM];
         memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM);
-#if !FIX_TICKET_79
-        InheritedVSPDisInfo inheritedVSPDisInfo[MRG_MAX_NUM_CANDS_MEM];
-#endif
 #if H_3D_SPIVMP
         memset(bSPIVMPFlag, false, sizeof(Bool)*MRG_MAX_NUM_CANDS_MEM);
@@ -369,7 +316,4 @@
         pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex );
         pcSubCU->xGetInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours
-#if !FIX_TICKET_79
-          , inheritedVSPDisInfo
-#endif
 #if H_3D_SPIVMP
           , pcMvFieldSP, puhInterDirSP
@@ -382,10 +326,4 @@
           ,numValidMergeCand );
         pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth );
-#if !FIX_TICKET_79
-        if(vspFlag[uiMergeIndex])
-        {
-          pcCU->setDvInfoSubParts(inheritedVSPDisInfo[uiMergeIndex].m_acDvInfo, uiSubPartIdx, uiPartIdx, uiDepth);
-        }
-#endif
 #else
 #if H_3D
@@ -485,9 +423,5 @@
 #endif
     }
-#if H_3D_VSP && !FIX_TICKET_75
-    if ( (pcCU->getInterDir(uiSubPartIdx) == 3) && pcSubCU->isBipredRestriction(uiPartIdx) && (pcCU->getVSPFlag(uiSubPartIdx) == 0))
-#else
     if ( (pcCU->getInterDir(uiSubPartIdx) == 3) && pcSubCU->isBipredRestriction(uiPartIdx) )
-#endif
     {
       pcCU->getCUMvField( REF_PIC_LIST_1 )->setAllMv( TComMv(0,0), ePartSize, uiSubPartIdx, uiDepth, uiPartIdx);
Index: trunk/source/Lib/TLibDecoder/TDecEntropy.h
===================================================================
--- trunk/source/Lib/TLibDecoder/TDecEntropy.h	(revision 1067)
+++ trunk/source/Lib/TLibDecoder/TDecEntropy.h	(revision 1084)
@@ -89,5 +89,5 @@
 public:
   virtual Void parseSkipFlag      ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
   virtual Void parseSingleDepthMode       ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
 #endif
@@ -132,5 +132,5 @@
   virtual Void updateContextTables( SliceType eSliceType, Int iQp ) = 0;
   
-  virtual ~TDecEntropyIf() {}; 
+  virtual ~TDecEntropyIf() {}
 };
 
@@ -179,5 +179,5 @@
   Void decodeSplitFlag         ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
   Void decodeSkipFlag          ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
   Void decodeSingleDepthMode ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) ;
 #endif
Index: trunk/source/Lib/TLibDecoder/TDecGop.cpp
===================================================================
--- trunk/source/Lib/TLibDecoder/TDecGop.cpp	(revision 1067)
+++ trunk/source/Lib/TLibDecoder/TDecGop.cpp	(revision 1084)
@@ -248,4 +248,12 @@
     calcAndPrintHashStatus(*rpcPic->getPicYuvRec(), hash);
   }
+#if !H_MV
+#if SETTING_PIC_OUTPUT_MARK
+  rpcPic->setOutputMark(rpcPic->getSlice(0)->getPicOutputFlag() ? true : false);
+#else
+  rpcPic->setOutputMark(true);
+#endif
+  rpcPic->setReconMark(true);
+#endif
 }
 
Index: trunk/source/Lib/TLibDecoder/TDecSbac.cpp
===================================================================
--- trunk/source/Lib/TLibDecoder/TDecSbac.cpp	(revision 1067)
+++ trunk/source/Lib/TLibDecoder/TDecSbac.cpp	(revision 1084)
@@ -52,5 +52,5 @@
 , m_cCUSplitFlagSCModel       ( 1,             1,               NUM_SPLIT_FLAG_CTX            , m_contextModels + m_numContextModels, m_numContextModels )
 , m_cCUSkipFlagSCModel        ( 1,             1,               NUM_SKIP_FLAG_CTX             , m_contextModels + m_numContextModels, m_numContextModels)
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
 , m_cCUSingleDepthFlagSCModel        ( 1,             1,               NUM_SINGLEDEPTH_FLAG_CTX             , m_contextModels + m_numContextModels, m_numContextModels)
 , m_cSingleDepthValueSCModel         ( 1,             1,               NUM_SINGLE_DEPTH_VALUE_DATA_CTX      , m_contextModels + m_numContextModels, m_numContextModels)
@@ -136,5 +136,5 @@
   m_cCUSplitFlagSCModel.initBuffer       ( sliceType, qp, (UChar*)INIT_SPLIT_FLAG );
   m_cCUSkipFlagSCModel.initBuffer        ( sliceType, qp, (UChar*)INIT_SKIP_FLAG );
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
   m_cCUSingleDepthFlagSCModel.initBuffer        ( sliceType, qp, (UChar*)INIT_SINGLEDEPTH_FLAG );
   m_cSingleDepthValueSCModel.initBuffer         ( sliceType, qp, (UChar*)INIT_SINGLE_DEPTH_VALUE_DATA );
@@ -207,5 +207,5 @@
   m_cCUSplitFlagSCModel.initBuffer       ( eSliceType, iQp, (UChar*)INIT_SPLIT_FLAG );
   m_cCUSkipFlagSCModel.initBuffer        ( eSliceType, iQp, (UChar*)INIT_SKIP_FLAG );
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
   m_cCUSingleDepthFlagSCModel.initBuffer        ( eSliceType, iQp, (UChar*)INIT_SINGLEDEPTH_FLAG );
   m_cSingleDepthValueSCModel.initBuffer         ( eSliceType, iQp, (UChar*)INIT_SINGLE_DEPTH_VALUE_DATA );
@@ -432,84 +432,5 @@
 #endif
 
-#if !FIX_TICKET_76
-#if H_3D_DIM_SDC
-Void TDecSbac::xParseSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiSegment )
-{
-  assert( pcCU->getSlice()->getIsDepth() );
-  assert( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N );
-  assert( pcCU->getSDCFlag(uiAbsPartIdx) );
-  assert( uiSegment < 2 );
-  
-  UInt uiResidual = 0;
-  UInt uiBit      = 0;
-  UInt uiAbsIdx   = 0;
-  UInt uiSign     = 0;
-  Int  iIdx       = 0;
-  
-#if H_3D_DIM_DLT
-  UInt uiMaxResidualBits = pcCU->getSlice()->getPPS()->getDLT()->getBitsPerDepthValue( pcCU->getSlice()->getLayerIdInVps() );
-#else
-  UInt uiMaxResidualBits = g_bitDepthY;
-#endif
-  assert( uiMaxResidualBits <= g_bitDepthY );
-  
-  m_pcTDecBinIf->decodeBin(uiResidual, m_cSDCResidualFlagSCModel.get( 0, 0, 0 ) );
-  
-#if H_MV_ENC_DEC_TRAC
-  DTRACE_CU("sdc_residual_flag[i]", uiResidual)
-#endif
-  
-  if (uiResidual)
-  {
-    // decode residual sign bit
-    m_pcTDecBinIf->decodeBinEP(uiSign);
-#if H_MV_ENC_DEC_TRAC
-    DTRACE_CU("sdc_residual_sign_flag[i]", uiSign)
-#endif
-    
-    // decode residual magnitude
-    // prefix part
-    UInt uiCount = 0;
-#if H_3D_DIM_DLT
-    UInt uiNumDepthValues = pcCU->getSlice()->getPPS()->getDLT()->getNumDepthValues( pcCU->getSlice()->getLayerIdInVps() );
-#else
-    UInt uiNumDepthValues = ((1 << g_bitDepthY)-1);
-#endif
-    UInt uiPrefixThreshold = ((uiNumDepthValues * 3) >> 2);
-    for ( UInt ui = 0; ui < uiPrefixThreshold; ui++)
-    {
-      m_pcTDecBinIf->decodeBin( uiBit, m_cSDCResidualSCModel.get(0, 0, 0) );
-      if ( uiBit == 0 )
-        break;
-      else
-        uiCount++;
-    }
-    // suffix part
-    if ( uiCount == uiPrefixThreshold )
-    {
-      for ( UInt ui = 0; ui < numBitsForValue(uiNumDepthValues - uiPrefixThreshold); ui++ )
-      {
-        m_pcTDecBinIf->decodeBinEP( uiBit );
-        uiAbsIdx |= uiBit << ui;
-      }
-      uiAbsIdx += uiCount;
-    }
-    else
-    {
-      uiAbsIdx = uiCount;
-    }
-  
-#if H_MV_ENC_DEC_TRAC
-    DTRACE_CU("sdc_residual_abs_minus1[i]", uiAbsIdx)
-#endif
-    
-    uiAbsIdx += 1;
-    iIdx =(Int)(uiSign ? -1 : 1)*uiAbsIdx;
-  }
-  
-  pcCU->setSDCSegmentDCOffset(iIdx, uiSegment, uiAbsPartIdx);
-}
-#endif
-#endif
+
 #endif
 /** Parse I_PCM information. 
@@ -649,5 +570,5 @@
 #endif
 }
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
 Void TDecSbac::parseSingleDepthMode( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
 {
@@ -671,5 +592,5 @@
 
     UInt uiUnaryIdx = 0;
-    UInt uiNumCand = MTK_SINGLE_DEPTH_MODE_CANDIDATE_LIST_SIZE;
+    UInt uiNumCand = SINGLE_DEPTH_MODE_CAND_LIST_SIZE;
     if ( uiNumCand > 1 )
     {
@@ -781,10 +702,6 @@
   Bool bParseSplitFlag    = true;
 
-#if MTK_I0099_VPS_EX2
   TComVPS *vps           = pcCU->getPic()->getSlice(0)->getVPS();
   Bool    bLimQtPredFlag = vps->getLimQtPredFlag(pcCU->getPic()->getSlice(0)->getLayerId());
-#else
-  TComSPS *sps            = pcCU->getPic()->getSlice(0)->getSPS();
-#endif
   TComPic *pcTexture      = pcCU->getSlice()->getTexturePic();
   Bool bDepthMapDetect    = (pcTexture != NULL);
@@ -793,12 +710,8 @@
   Bool rapPic = (pcCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || pcCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP || pcCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA);
 
-#if MTK_I0099_VPS_EX2
-#if LGE_FCO_I0116
+#if H_3D_FCO
   if(bDepthMapDetect && !bIntraSliceDetect && !rapPic && bLimQtPredFlag && pcTexture->getReconMark())
 #else
   if(bDepthMapDetect && !bIntraSliceDetect && !rapPic && bLimQtPredFlag)
-#endif
-#else
-  if(bDepthMapDetect && !bIntraSliceDetect && !rapPic && sps->getUseQTL() && sps->getUsePC())
 #endif
   {
@@ -843,10 +756,6 @@
 #if H_3D_QTLPC
   Bool bParsePartSize    = true;
-#if MTK_I0099_VPS_EX2
   TComVPS *vps           = pcCU->getPic()->getSlice(0)->getVPS();
   Bool    bLimQtPredFlag = vps->getLimQtPredFlag(pcCU->getPic()->getSlice(0)->getLayerId());
-#else
-  TComSPS *sps           = pcCU->getPic()->getSlice(0)->getSPS();
-#endif
   TComPic *pcTexture     = pcCU->getSlice()->getTexturePic();
   Bool bDepthMapDetect   = (pcTexture != NULL);
@@ -857,12 +766,9 @@
   Bool depthDependent = false;
   UInt uiTexturePart = uiMode;
-#if MTK_I0099_VPS_EX2
-#if LGE_FCO_I0116
+
+#if H_3D_FCO
   if(bDepthMapDetect && !bIntraSliceDetect && !rapPic && bLimQtPredFlag && pcTexture->getReconMark())
 #else
   if(bDepthMapDetect && !bIntraSliceDetect && !rapPic && bLimQtPredFlag )
-#endif
-#else
-  if(bDepthMapDetect && !bIntraSliceDetect && !rapPic && sps->getUseQTL() && sps->getUsePC())
 #endif
   {
@@ -1076,9 +982,5 @@
   {
 #if H_3D_DIM
-#if SEPARATE_FLAG_I0085
     if( pcCU->getSlice()->getVpsDepthModesFlag() || pcCU->getSlice()->getIVPFlag() )
-#else
-    if( pcCU->getSlice()->getVpsDepthModesFlag() )
-#endif
     {
       parseIntraDepth( pcCU, absPartIdx+partOffset*j, depth );
@@ -1222,5 +1124,4 @@
   if( uiIsDimMode )
   {
-#if SEPARATE_FLAG_I0085
     if( pcCU->getSlice()->getVpsDepthModesFlag() && pcCU->getSlice()->getIVPFlag() )
     {
@@ -1228,54 +1129,19 @@
       if( !uiSymbol )
       {
-#if HS_DMM_SIGNALLING_I0120
         pcCU->setLumaIntraDirSubParts( DIM_OFFSET, absPartIdx, depth );
-#else
-        pcCU->setLumaIntraDirSubParts( ( 2 * DMM1_IDX + DIM_OFFSET ), absPartIdx, depth );
-#endif
       }
       else
       {
-#if HS_DMM_SIGNALLING_I0120
         pcCU->setLumaIntraDirSubParts( ( 1+ DIM_OFFSET ), absPartIdx, depth );
-#else
-        pcCU->setLumaIntraDirSubParts( ( 2 * DMM4_IDX + DIM_OFFSET ), absPartIdx, depth );
-#endif
       }
     }
     else if ( pcCU->getSlice()->getVpsDepthModesFlag() )
     {
-#if HS_DMM_SIGNALLING_I0120
       pcCU->setLumaIntraDirSubParts( DIM_OFFSET, absPartIdx, depth );
-#else
-      pcCU->setLumaIntraDirSubParts( ( 2 * DMM1_IDX + DIM_OFFSET ), absPartIdx, depth );
-#endif
     }
     else if( pcCU->getSlice()->getIVPFlag() )
     {
-#if HS_DMM_SIGNALLING_I0120
       pcCU->setLumaIntraDirSubParts( ( 1+ DIM_OFFSET ), absPartIdx, depth );
-#else
-      pcCU->setLumaIntraDirSubParts( ( 2 * DMM4_IDX + DIM_OFFSET ), absPartIdx, depth );
-#endif
-    }
-#else
-    m_pcTDecBinIf->decodeBin( uiSymbol, m_cDepthIntraModeSCModel.get( 0, 0, 0 ) );
-    if( !uiSymbol )
-    {
-#if HS_DMM_SIGNALLING_I0120
-      pcCU->setLumaIntraDirSubParts( DIM_OFFSET, absPartIdx, depth );
-#else
-      pcCU->setLumaIntraDirSubParts( ( 2 * DMM1_IDX + DIM_OFFSET ), absPartIdx, depth );
-#endif
-    }
-    else
-    {
-#if HS_DMM_SIGNALLING_I0120
-      pcCU->setLumaIntraDirSubParts( ( 1+ DIM_OFFSET ), absPartIdx, depth );
-#else
-      pcCU->setLumaIntraDirSubParts( ( 2 * DMM4_IDX + DIM_OFFSET ), absPartIdx, depth );
-#endif
-    }
-#endif
+    }
   }
 }
@@ -2190,43 +2056,15 @@
   }
 
-#if HS_DMM_SIGNALLING_I0120
   UInt symbol = 1;
   UInt uiNumSegments = isDimMode( pcCU->getLumaIntraDir( absPartIdx ) ) ? 2 : 1;
-#else
-  UInt symbol = 0;
-  UInt uiNumSegments = 0;
-#endif
-
-#if HS_DMM_SIGNALLING_I0120
+
   if( pcCU->isIntra( absPartIdx ) && pcCU->getSDCFlag( absPartIdx ))
   {
-#else
-  if( pcCU->isIntra( absPartIdx ) )
-  {
-    UInt dir     = pcCU->getLumaIntraDir( absPartIdx );
-    uiNumSegments = isDimMode( dir ) ? 2 : 1;
-#endif
+
     m_pcTDecBinIf->decodeBin( symbol, m_cDdcFlagSCModel.get( 0, 0, 0 ) );
-#if !HS_DMM_SIGNALLING_I0120
-    if( pcCU->getSDCFlag( absPartIdx ) )
-    {
-#endif
       assert( pcCU->getPartitionSize( absPartIdx ) == SIZE_2Nx2N );
       pcCU->setTrIdxSubParts( 0, absPartIdx, depth );
       pcCU->setCbfSubParts( 1, 1, 1, absPartIdx, depth );
     }
-#if !HS_DMM_SIGNALLING_I0120
-    else
-    {
-      pcCU->setLumaIntraDirSubParts( dir + symbol, absPartIdx, depth );
-    }
-  }
-  else
-  {
-    uiNumSegments = 1;
-    symbol = 1;
-  }
-#endif
-
 
   for( UInt segment = 0; segment < uiNumSegments; segment++ )
@@ -2289,5 +2127,4 @@
   m_pcTDecBinIf->decodeBin( uiSymbol, m_cDBBPFlagSCModel.get( 0, 0, 0 ) );
   
-#if SEC_DBBP_EXPLICIT_SIG_I0077
   PartSize ePartSize = pcCU->getPartitionSize( uiAbsPartIdx );
   AOF( ePartSize == SIZE_2NxN || ePartSize == SIZE_Nx2N );
@@ -2295,12 +2132,4 @@
   pcCU->setDBBPFlagSubParts(uiSymbol, uiAbsPartIdx, 0, uiDepth);
   pcCU->setDBBPFlagSubParts(uiSymbol, uiAbsPartIdx+uiPUOffset, 1, uiDepth);
-#else
-  if( uiSymbol )
-  {
-    pcCU->setDBBPFlagSubParts(true, uiAbsPartIdx, 0, uiDepth);
-    UInt uiCurrPartNumQ = (pcCU->getPic()->getNumPartInCU() >> (2 * uiDepth)) >> 2;
-    pcCU->setDBBPFlagSubParts(true, uiAbsPartIdx + 2*uiCurrPartNumQ, 1, uiDepth);
-  }
-#endif
 }
 #endif
Index: trunk/source/Lib/TLibDecoder/TDecSbac.h
===================================================================
--- trunk/source/Lib/TLibDecoder/TDecSbac.h	(revision 1067)
+++ trunk/source/Lib/TLibDecoder/TDecSbac.h	(revision 1084)
@@ -129,5 +129,5 @@
   
   Void parseSkipFlag      ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
-#if MTK_SINGLE_DEPTH_MODE_I0095  
+#if H_3D_SINGLE_DEPTH  
   Void parseSingleDepthMode      ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
 #endif  
@@ -182,5 +182,5 @@
   ContextModel3DBuffer m_cCUSplitFlagSCModel;
   ContextModel3DBuffer m_cCUSkipFlagSCModel;
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
   ContextModel3DBuffer m_cCUSingleDepthFlagSCModel;
   ContextModel3DBuffer m_cSingleDepthValueSCModel;
Index: trunk/source/Lib/TLibDecoder/TDecTop.cpp
===================================================================
--- trunk/source/Lib/TLibDecoder/TDecTop.cpp	(revision 1067)
+++ trunk/source/Lib/TLibDecoder/TDecTop.cpp	(revision 1084)
@@ -229,5 +229,5 @@
   }
 
-#if !LGE_FCO_I0116
+#if !H_3D_FCO
   if ( pcSlice->getIsDepth())
   {
@@ -669,7 +669,4 @@
 #if H_MV
   sps->inferSpsMaxDecPicBufferingMinus1( vps, m_targetOptLayerSetIdx, getLayerId(), false ); 
-#if !H_MV_HLS10_ADD_LAYERSETS 
-  vps->inferDbpSizeLayerSetZero( sps, false ); 
-#endif
   // When the value of vps_num_rep_formats_minus1 in the active VPS is equal to 0
   if ( vps->getVpsNumRepFormatsMinus1() == 0 )
@@ -679,5 +676,4 @@
   }
   sps->checkRpsMaxNumPics( vps, getLayerId() ); 
-#if H_MV_HLS10_MULTILAYERSPS
 
   if( sps->getLayerId() != 0 )
@@ -686,5 +682,4 @@
   }
 
-#if H_MV_HLS10_MULTILAYERSPS
   // It is a requirement of bitstream conformance that, when the SPS is referred to by 
   // any current picture that belongs to an independent non-base layer, the value of 
@@ -695,5 +690,4 @@
     assert( sps->getMultiLayerExtSpsFlag() == 0 ); 
   }
-#endif
 
   if( sps->getMultiLayerExtSpsFlag() )
@@ -701,10 +695,4 @@
     sps->setTemporalIdNestingFlag( (sps->getMaxTLayers() > 1) ? vps->getTemporalNestingFlag() : true );
   }
-#else
-  if( m_layerId > 0 )
-  {
-    sps->setTemporalIdNestingFlag( (sps->getMaxTLayers() > 1) ? vps->getTemporalNestingFlag() : true );
-  }
-#endif
 #endif
 
@@ -730,15 +718,8 @@
 #if H_MV
   m_apcSlicePilot->setVPS(vps);  
-#if H_MV_HLS10_REF_PRED_LAYERS
   // The nuh_layer_id value of the NAL unit containing the PPS that is activated for a layer layerA with nuh_layer_id equal to nuhLayerIdA shall be equal to 0, or nuhLayerIdA, or the nuh_layer_id of a direct or indirect reference layer of layerA.
   assert( pps->getLayerId() == m_layerId || pps->getLayerId( ) == 0 || vps->getDependencyFlag( m_layerId, pps->getLayerId() ) );   
   // The nuh_layer_id value of the NAL unit containing the SPS that is activated for a layer layerA with nuh_layer_id equal to nuhLayerIdA shall be equal to 0, or nuhLayerIdA, or the nuh_layer_id of a direct or indirect reference layer of layerA.
   assert( sps->getLayerId() == m_layerId || sps->getLayerId( ) == 0 || vps->getDependencyFlag( m_layerId, sps->getLayerId() ) );
-#else
-  // The nuh_layer_id value of the NAL unit containing the PPS that is activated for a layer layerA with nuh_layer_id equal to nuhLayerIdA shall be equal to 0, or nuhLayerIdA, or the nuh_layer_id of a direct or indirect reference layer of layerA.
-  assert( pps->getLayerId() == m_layerId || pps->getLayerId( ) == 0 || vps->getInDirectDependencyFlag( m_layerId, pps->getLayerId() ) );   
-  // The nuh_layer_id value of the NAL unit containing the SPS that is activated for a layer layerA with nuh_layer_id equal to nuhLayerIdA shall be equal to 0, or nuhLayerIdA, or the nuh_layer_id of a direct or indirect reference layer of layerA.
-  assert( sps->getLayerId() == m_layerId || sps->getLayerId( ) == 0 || vps->getInDirectDependencyFlag( m_layerId, sps->getLayerId() ) );
-#endif
   sps->inferRepFormat  ( vps , m_layerId ); 
   sps->inferScalingList( m_parameterSetManagerDecoder.getActiveSPS( sps->getSpsScalingListRefLayerId() ) ); 
@@ -746,5 +727,5 @@
 #endif
   pps->setSPS(sps);
-  pps->setNumSubstreams(pps->getEntropyCodingSyncEnabledFlag() ? ((sps->getPicHeightInLumaSamples() + sps->getMaxCUHeight() - 1) / sps->getMaxCUHeight()) * (pps->getNumColumnsMinus1() + 1) : 1);
+  pps->setNumSubstreams(pps->getEntropyCodingSyncEnabledFlag() ? ((sps->getPicHeightInLumaSamples() + sps->getMaxCUHeight() - 1) / sps->getMaxCUHeight()) * (pps->getNumTileColumnsMinus1() + 1) : 1);
   pps->setMinCuDQPSize( sps->getMaxCUWidth() >> ( pps->getMaxCuDQPDepth()) );
 
@@ -807,4 +788,6 @@
   m_apcSlicePilot->setLayerId( nalu.m_layerId );
   m_cEntropyDecoder.decodeSliceHeader (m_apcSlicePilot, &m_parameterSetManagerDecoder, m_targetOptLayerSetIdx );
+#else
+  m_cEntropyDecoder.decodeSliceHeader (m_apcSlicePilot, &m_parameterSetManagerDecoder);
 #endif
   // set POC for dependent slices in skipped pictures
@@ -944,8 +927,6 @@
      xResetPocInPicBuffer();
    }
-#endif
-   
-#if I0044_SLICE_TMVP
-  if ( m_apcSlicePilot->getTLayer() == 0 && m_apcSlicePilot->getEnableTMVPFlag() == 0 )
+
+   if ( m_apcSlicePilot->getTLayer() == 0 && m_apcSlicePilot->getEnableTMVPFlag() == 0 )
   {
     //update all pics in the DPB such that they cannot be used for TMPV ref
@@ -1043,67 +1024,6 @@
   Bool bNextSlice     = pcSlice->isNextSlice();
 
-  UInt uiCummulativeTileWidth;
-  UInt uiCummulativeTileHeight;
-  UInt i, j, p;
-
-  //set NumColumnsMins1 and NumRowsMinus1
-  pcPic->getPicSym()->setNumColumnsMinus1( pcSlice->getPPS()->getNumColumnsMinus1() );
-  pcPic->getPicSym()->setNumRowsMinus1( pcSlice->getPPS()->getNumRowsMinus1() );
-
-  //create the TComTileArray
-  pcPic->getPicSym()->xCreateTComTileArray();
-
-  if( pcSlice->getPPS()->getUniformSpacingFlag() )
-  {
-    //set the width for each tile
-    for(j=0; j < pcPic->getPicSym()->getNumRowsMinus1()+1; j++)
-    {
-      for(p=0; p < pcPic->getPicSym()->getNumColumnsMinus1()+1; p++)
-      {
-        pcPic->getPicSym()->getTComTile( j * (pcPic->getPicSym()->getNumColumnsMinus1()+1) + p )->
-          setTileWidth( (p+1)*pcPic->getPicSym()->getFrameWidthInCU()/(pcPic->getPicSym()->getNumColumnsMinus1()+1) 
-          - (p*pcPic->getPicSym()->getFrameWidthInCU())/(pcPic->getPicSym()->getNumColumnsMinus1()+1) );
-      }
-    }
-
-    //set the height for each tile
-    for(j=0; j < pcPic->getPicSym()->getNumColumnsMinus1()+1; j++)
-    {
-      for(p=0; p < pcPic->getPicSym()->getNumRowsMinus1()+1; p++)
-      {
-        pcPic->getPicSym()->getTComTile( p * (pcPic->getPicSym()->getNumColumnsMinus1()+1) + j )->
-          setTileHeight( (p+1)*pcPic->getPicSym()->getFrameHeightInCU()/(pcPic->getPicSym()->getNumRowsMinus1()+1) 
-          - (p*pcPic->getPicSym()->getFrameHeightInCU())/(pcPic->getPicSym()->getNumRowsMinus1()+1) );   
-      }
-    }
-  }
-  else
-  {
-    //set the width for each tile
-    for(j=0; j < pcSlice->getPPS()->getNumRowsMinus1()+1; j++)
-    {
-      uiCummulativeTileWidth = 0;
-      for(i=0; i < pcSlice->getPPS()->getNumColumnsMinus1(); i++)
-      {
-        pcPic->getPicSym()->getTComTile(j * (pcSlice->getPPS()->getNumColumnsMinus1()+1) + i)->setTileWidth( pcSlice->getPPS()->getColumnWidth(i) );
-        uiCummulativeTileWidth += pcSlice->getPPS()->getColumnWidth(i);
-      }
-      pcPic->getPicSym()->getTComTile(j * (pcSlice->getPPS()->getNumColumnsMinus1()+1) + i)->setTileWidth( pcPic->getPicSym()->getFrameWidthInCU()-uiCummulativeTileWidth );
-    }
-
-    //set the height for each tile
-    for(j=0; j < pcSlice->getPPS()->getNumColumnsMinus1()+1; j++)
-    {
-      uiCummulativeTileHeight = 0;
-      for(i=0; i < pcSlice->getPPS()->getNumRowsMinus1(); i++)
-      { 
-        pcPic->getPicSym()->getTComTile(i * (pcSlice->getPPS()->getNumColumnsMinus1()+1) + j)->setTileHeight( pcSlice->getPPS()->getRowHeight(i) );
-        uiCummulativeTileHeight += pcSlice->getPPS()->getRowHeight(i);
-      }
-      pcPic->getPicSym()->getTComTile(i * (pcSlice->getPPS()->getNumColumnsMinus1()+1) + j)->setTileHeight( pcPic->getPicSym()->getFrameHeightInCU()-uiCummulativeTileHeight );
-    }
-  }
-
-  pcPic->getPicSym()->xInitTiles();
+  UInt i;
+  pcPic->getPicSym()->initTiles(pcSlice->getPPS());
 
   //generate the Coding Order Map and Inverse Coding Order Map
@@ -1192,6 +1112,5 @@
 #endif    
 #endif
-    // For generalized B
-#if I0044_SLICE_TMVP
+#if H_MV
     if( m_layerId > 0 && !pcSlice->isIntra() && pcSlice->getEnableTMVPFlag() )
     {
@@ -1272,5 +1191,5 @@
 
 #if H_3D_IV_MERGE
-#if LGE_FCO_I0116
+#if H_3D_FCO
   if( !pcSlice->getIsDepth() && m_pcCamParsCollector )
 #else
@@ -1727,9 +1646,5 @@
   for (Int i = 0; i < vps->getNumDirectRefLayers( getLayerId()  ); i++ )
   {
-#if H_MV_HLS10_REF_PRED_LAYERS
     Int refLayerId = vps->getIdDirectRefLayer( m_layerId, i ); 
-#else
-    Int refLayerId = vps->getRefLayerId( m_layerId, i ); 
-#endif
     allRefLayersInitilizedFlag = allRefLayersInitilizedFlag && m_layerInitilizedFlag[ refLayerId ]; 
   }
Index: trunk/source/Lib/TLibEncoder/TEncCavlc.cpp
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 1067)
+++ trunk/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 1084)
@@ -49,10 +49,6 @@
 {
 #if H_MV_ENC_DEC_TRAC
-#if H_MV_HLS10_GEN_FIX
   fprintf( g_hTrace, "=========== Sequence Parameter Set LayerId: %d ===========\n", pSPS->getLayerId() );
 #else
-  fprintf( g_hTrace, "=========== Sequence Parameter Set ===========\n" );
-#endif
-#else
   fprintf( g_hTrace, "=========== Sequence Parameter Set ID: %d ===========\n", pSPS->getSPSId() );
 #endif
@@ -62,9 +58,5 @@
 {
 #if H_MV_ENC_DEC_TRAC
-#if H_MV_HLS10_GEN_FIX
   fprintf( g_hTrace, "=========== Picture Parameter Set LayerId: %d ===========\n", pPPS->getLayerId() );
-#else
-  fprintf( g_hTrace, "=========== Picture Parameter Set ===========\n" );
-#endif
 #else
   fprintf( g_hTrace, "=========== Picture Parameter Set ID: %d ===========\n", pPPS->getPPSId() );
@@ -218,19 +210,19 @@
   if( pcPPS->getTilesEnabledFlag() )
   {
-    WRITE_UVLC( pcPPS->getNumColumnsMinus1(),                                    "num_tile_columns_minus1" );
-    WRITE_UVLC( pcPPS->getNumRowsMinus1(),                                       "num_tile_rows_minus1" );
-    WRITE_FLAG( pcPPS->getUniformSpacingFlag(),                                  "uniform_spacing_flag" );
-    if( pcPPS->getUniformSpacingFlag() == 0 )
-    {
-      for(UInt i=0; i<pcPPS->getNumColumnsMinus1(); i++)
-      {
-        WRITE_UVLC( pcPPS->getColumnWidth(i)-1,                                  "column_width_minus1" );
-      }
-      for(UInt i=0; i<pcPPS->getNumRowsMinus1(); i++)
-      {
-        WRITE_UVLC( pcPPS->getRowHeight(i)-1,                                    "row_height_minus1" );
-      }
-    }
-    if(pcPPS->getNumColumnsMinus1() !=0 || pcPPS->getNumRowsMinus1() !=0)
+    WRITE_UVLC( pcPPS->getNumTileColumnsMinus1(),                                    "num_tile_columns_minus1" );
+    WRITE_UVLC( pcPPS->getTileNumRowsMinus1(),                                       "num_tile_rows_minus1" );
+    WRITE_FLAG( pcPPS->getTileUniformSpacingFlag(),                                  "uniform_spacing_flag" );
+    if( !pcPPS->getTileUniformSpacingFlag() )
+    {
+      for(UInt i=0; i<pcPPS->getNumTileColumnsMinus1(); i++)
+      {
+        WRITE_UVLC( pcPPS->getTileColumnWidth(i)-1,                                  "column_width_minus1" );
+      }
+      for(UInt i=0; i<pcPPS->getTileNumRowsMinus1(); i++)
+      {
+        WRITE_UVLC( pcPPS->getTileRowHeight(i)-1,                                    "row_height_minus1" );
+      }
+    }
+    if(pcPPS->getNumTileColumnsMinus1() !=0 || pcPPS->getTileNumRowsMinus1() !=0)
     {
       WRITE_FLAG( pcPPS->getLoopFilterAcrossTilesEnabledFlag()?1 : 0,          "loop_filter_across_tiles_enabled_flag");
@@ -249,19 +241,4 @@
     }
   }
-#if !H_MV_HLS10_PPS
-#if H_MV
-  if ( pcPPS->getLayerId() > 0 )
-  {
-    WRITE_FLAG( pcPPS->getPpsInferScalingListFlag( ) ? 1 : 0 , "pps_infer_scaling_list_flag" );
-  }
-
-  if( pcPPS->getPpsInferScalingListFlag( ) ) 
-  {
-    WRITE_CODE( pcPPS->getPpsScalingListRefLayerId( ), 6, "pps_scaling_list_ref_layer_id" );
-  }
-  else
-  {  
-#endif  
-#endif
   WRITE_FLAG( pcPPS->getScalingListPresentFlag() ? 1 : 0,                          "pps_scaling_list_data_present_flag" ); 
   if( pcPPS->getScalingListPresentFlag() )
@@ -269,9 +246,4 @@
     codeScalingList( m_pcSlice->getScalingList() );
   }
-#if !H_MV_HLS10_PPS 
-#if H_MV
-  }
-#endif
-#endif
 #if PPS_FIX_DEPTH
   if( pcPPS->getSPS()->getVPS()->getDepthId(pcPPS->getSPS()->getLayerId()) )
@@ -313,10 +285,5 @@
     if ( pcPPS->getPpsMultilayerExtensionFlag() )
     { 
-#if H_MV_HLS10_PPS
       codePPSMultilayerExtension( pcPPS );
-#else
-      WRITE_FLAG( pcPPS->getPocResetInfoPresentFlag( ) ? 1 : 0 , "poc_reset_info_present_flag" );
-      WRITE_FLAG( 0, "pps_extension_reserved_zero_flag" );
-#endif
     }
 
@@ -385,5 +352,4 @@
             }
             
-#if H_3D_DELTA_DLT
             if( pcDLT->getInterViewDltPredEnableFlag( i ) )
             {
@@ -395,8 +361,8 @@
               pcDLT->getDeltaDLT(i, piRefDLT, uiRefNum, aiIdx2DepthValue_coded, &uiNumDepthValues_coded);
             }
-#endif
 
             if ( NULL == (puiDltDiffValues = (UInt *)calloc(uiNumDepthValues_coded, sizeof(UInt))) )
             {
+              // This should be changed to an assertion. 
               exit(-1);
             }
@@ -477,8 +443,4 @@
             {
               WRITE_CODE(uiNumDepthValues_coded, 8, "num_depth_values_in_dlt[i]");    // num_entry
-
-#if !H_3D_DELTA_DLT
-              if ( pcDLT->getInterViewDltPredEnableFlag( i ) == false )   // Single-view DLT Diff Coding
-#endif
               {
                 // The condition if( uiNumDepthValues_coded > 0 ) is always true since for Single-view Diff Coding, there is at least one depth value in depth component.
@@ -566,8 +528,8 @@
   if( defaultDisplayWindow.getWindowEnabledFlag() )
   {
-    WRITE_UVLC(defaultDisplayWindow.getWindowLeftOffset(),      "def_disp_win_left_offset");
-    WRITE_UVLC(defaultDisplayWindow.getWindowRightOffset(),     "def_disp_win_right_offset");
-    WRITE_UVLC(defaultDisplayWindow.getWindowTopOffset(),       "def_disp_win_top_offset");
-    WRITE_UVLC(defaultDisplayWindow.getWindowBottomOffset(),    "def_disp_win_bottom_offset");
+    WRITE_UVLC(defaultDisplayWindow.getWindowLeftOffset()  / TComSPS::getWinUnitX(pcSPS->getChromaFormatIdc()), "def_disp_win_left_offset");
+    WRITE_UVLC(defaultDisplayWindow.getWindowRightOffset() / TComSPS::getWinUnitX(pcSPS->getChromaFormatIdc()), "def_disp_win_right_offset");
+    WRITE_UVLC(defaultDisplayWindow.getWindowTopOffset()   / TComSPS::getWinUnitY(pcSPS->getChromaFormatIdc()), "def_disp_win_top_offset");
+    WRITE_UVLC(defaultDisplayWindow.getWindowBottomOffset()/ TComSPS::getWinUnitY(pcSPS->getChromaFormatIdc()), "def_disp_win_bottom_offset");
   }
   TimingInfo *timingInfo = pcVUI->getTimingInfo();
@@ -691,5 +653,4 @@
 #endif
   WRITE_CODE( pcSPS->getMaxTLayers() - 1,  3,       "sps_max_sub_layers_minus1" );
-#if H_MV_HLS10_MULTILAYERSPS
 #if H_MV
   }
@@ -700,5 +661,4 @@
   if ( !pcSPS->getMultiLayerExtSpsFlag() )
   {
-#endif
 #endif
 
@@ -710,9 +670,5 @@
   WRITE_UVLC( pcSPS->getSPSId (),                   "sps_seq_parameter_set_id" );
 #if H_MV
-#if H_MV_HLS10_MULTILAYERSPS
     if ( pcSPS->getMultiLayerExtSpsFlag() )
-#else 
-  if ( pcSPS->getLayerId() > 0 )
-#endif
   {
     WRITE_FLAG( pcSPS->getUpdateRepFormatFlag( ) ? 1 : 0 , "update_rep_format_flag" );
@@ -735,9 +691,4 @@
   WRITE_UVLC( pcSPS->getPicWidthInLumaSamples (),   "pic_width_in_luma_samples" );
   WRITE_UVLC( pcSPS->getPicHeightInLumaSamples(),   "pic_height_in_luma_samples" );
-#if !H_MV_HLS10_MULTILAYERSPS
-#if H_MV
-  }
-#endif
-#endif
   Window conf = pcSPS->getConformanceWindow();
 
@@ -750,16 +701,10 @@
     WRITE_UVLC( conf.getWindowBottomOffset() / TComSPS::getWinUnitY(pcSPS->getChromaFormatIdc() ), "conf_win_bottom_offset" );
   }
-#if H_MV_HLS10_MULTILAYERSPS
 #if H_MV
 }
 #endif
-#endif
 
 #if H_MV
-#if H_MV_HLS10_MULTILAYERSPS
   if ( !pcSPS->getMultiLayerExtSpsFlag() )
-#else 
-  if ( pcSPS->getLayerId() == 0 )
-#endif
   { 
 #endif
@@ -771,9 +716,5 @@
   WRITE_UVLC( pcSPS->getBitsForPOC()-4,                 "log2_max_pic_order_cnt_lsb_minus4" );
 #if H_MV
-#if H_MV_HLS10_MULTILAYERSPS
   if ( !pcSPS->getMultiLayerExtSpsFlag()) 
-#else
-  if ( pcSPS->getLayerId() == 0 ) 
-#endif
   {  
 #endif
@@ -806,9 +747,5 @@
   {
 #if H_MV
-#if H_MV_HLS10_MULTILAYERSPS
     if ( pcSPS->getMultiLayerExtSpsFlag() )
-#else 
-    if ( pcSPS->getLayerId() > 0 )
-#endif
     {    
       WRITE_FLAG( pcSPS->getSpsInferScalingListFlag( ) ? 1 : 0 , "sps_infer_scaling_list_flag" );
@@ -917,24 +854,7 @@
 {
   WRITE_FLAG( pcSPS->getInterViewMvVertConstraintFlag() ? 1 : 0, "inter_view_mv_vert_constraint_flag" );
-#if !H_MV_HLS10_PPS
-  WRITE_UVLC( pcSPS->getNumScaledRefLayerOffsets( ), "num_scaled_ref_layer_offsets" );
-
-  for( Int i = 0; i < pcSPS->getNumScaledRefLayerOffsets( ); i++)
-  {    
-    WRITE_CODE( pcSPS->getScaledRefLayerId( i ), 6, "scaled_ref_layer_id" );
-
-    Int j = pcSPS->getScaledRefLayerId( i ); 
-    
-    WRITE_SVLC( pcSPS->getScaledRefLayerLeftOffset( j ), "scaled_ref_layer_left_offset" );
-    WRITE_SVLC( pcSPS->getScaledRefLayerTopOffset( j ), "scaled_ref_layer_top_offset" );
-    WRITE_SVLC( pcSPS->getScaledRefLayerRightOffset( j ), "scaled_ref_layer_right_offset" );
-    WRITE_SVLC( pcSPS->getScaledRefLayerBottomOffset( j ), "scaled_ref_layer_bottom_offset" );
-    WRITE_FLAG( 0, "sps_multilayer_ext_reserved_zero_flag[ j ]" );
-  }
-#endif
-}
-
-
-#if H_MV_HLS10_PPS
+}
+
+
 Void TEncCavlc::codePPSMultilayerExtension(TComPPS* pcPPS)
 {
@@ -944,5 +864,4 @@
   WRITE_UVLC( 0, "num_ref_loc_offsets" );
 }
-#endif
 
 #endif
@@ -951,17 +870,6 @@
 Void TEncCavlc::codeSPSExtension2( TComSPS* pcSPS, Int viewIndex, Bool depthFlag )
 {
-#if H_3D_QTLPC
-#if !MTK_I0099_VPS_EX2
-//GT: This has to go to VPS
-if( depthFlag )
-{
-  WRITE_FLAG( pcSPS->getUseQTL() ? 1 : 0, "use_qtl_flag");
-  WRITE_FLAG( pcSPS->getUsePC()  ? 1 : 0, "use_pc_flag");
-}
-#endif
-#endif
-}
-
-
+
+}
 #endif
 
@@ -974,9 +882,5 @@
 #if H_MV
   WRITE_FLAG( pcVPS->getVpsBaseLayerInternalFlag( ) ? 1 : 0 , "vps_base_layer_internal_flag" );
-#if H_MV_HLS10_GEN_VSP_BASE_LAYER_AVAIL
   WRITE_FLAG( pcVPS->getVpsBaseLayerAvailableFlag( ) ? 1 : 0 , "vps_base_layer_available_flag" );
-#else // H_MV_HLS10_GEN
-  WRITE_FLAG( 1                                             , "vps_reserved_one_bit" );
-#endif // H_MV_HLS10_GEN
 #else
   WRITE_CODE( 3,                                    2,        "vps_reserved_three_2bits" );
@@ -1008,9 +912,5 @@
   assert( pcVPS->getVpsMaxLayerId() < MAX_VPS_NUH_LAYER_ID_PLUS1 );
   WRITE_CODE( pcVPS->getVpsMaxLayerId(), 6,                 "vps_max_layer_id" );  
-#if H_MV_HLS10_GEN_FIX
   WRITE_UVLC( pcVPS->getVpsNumLayerSetsMinus1(),  "vps_num_layer_sets_minus1" );
-#else
-  WRITE_UVLC( pcVPS->getVpsNumLayerSetsMinus1(),  "vps_max_num_layer_sets_minus1" );
-#endif
   for( UInt opsIdx = 1; opsIdx <= pcVPS->getVpsNumLayerSetsMinus1(); opsIdx ++ )
   {
@@ -1089,10 +989,8 @@
 Void TEncCavlc::codeVPSExtension( TComVPS *pcVPS ) 
 { 
-#if H_MV_HLS10_PTL
   if( pcVPS->getMaxLayersMinus1() > 0  &&  pcVPS->getVpsBaseLayerInternalFlag() )
   {
     codePTL( pcVPS->getPTL( 1 ),0, pcVPS->getMaxSubLayersMinus1()  );
   }
-#endif
 
   WRITE_FLAG( pcVPS->getSplittingFlag() ? 1 : 0,             "splitting_flag" );
@@ -1167,5 +1065,4 @@
   }
 
-#if H_MV_HLS10_ADD_LAYERSETS
   if ( pcVPS->getNumIndependentLayers() > 1 ) 
   {
@@ -1180,5 +1077,4 @@
   
   }
-#endif
 
 
@@ -1218,5 +1114,4 @@
   WRITE_UVLC( pcVPS->getVpsNumProfileTierLevelMinus1( ), "vps_num_profile_tier_level_minus1" );
 
-#if H_MV_HLS10_PTL
   Int offsetVal =  ( pcVPS->getMaxLayersMinus1() > 0  &&  pcVPS->getVpsBaseLayerInternalFlag() ) ? 2 : 1;   
   for( Int i = pcVPS->getVpsBaseLayerInternalFlag() ? 2 : 1; i <= pcVPS->getVpsNumProfileTierLevelMinus1(); i++ )
@@ -1226,25 +1121,5 @@
     offsetVal++;
   }
-#else 
-  for( Int i = 1; i <= pcVPS->getVpsNumProfileTierLevelMinus1(); i++ )
-  {
-    WRITE_FLAG( pcVPS->getVpsProfilePresentFlag( i ) ? 1 : 0, "vps_profile_present_flag[i]" );
-    codePTL( pcVPS->getPTL( i ), pcVPS->getVpsProfilePresentFlag( i ), pcVPS->getMaxTLayers() - 1 );
-  }
-#endif
-
-#if !H_MV_HLS10_ADD_LAYERSETS
-  if ( pcVPS->getNumIndependentLayers() > 1 ) 
-  {
-   WRITE_UVLC( pcVPS->getNumAddLayerSets( ), "num_add_layer_sets" );
-  }
-  for (Int i = 0; i < pcVPS->getNumAddLayerSets(); i++)
-  {
-    for (Int j = 0; j < pcVPS->getNumIndependentLayers(); j++)
-    {
-      WRITE_CODE( pcVPS->getHighestLayerIdxPlus1( i, j ), pcVPS->getHighestLayerIdxPlus1Len( j )  , "highest_layer_idx_plus1" );
-    }
-  }
-#endif
+
 
   if (pcVPS->getNumLayerSets() > 1)
@@ -1258,10 +1133,8 @@
 
 
-#if H_MV_HLS10_PTL_FIX
   if (pcVPS->getVpsBaseLayerInternalFlag() )
   {  
     assert( pcVPS->getProfileTierLevelIdx(0,0) == pcVPS->inferProfileTierLevelIdx(0,0) );
   }
-#endif
 
 
@@ -1270,9 +1143,5 @@
     if( i >= pcVPS->getNumLayerSets( ) )    
     {      
-#if !VPS_MISC_UPDATES
-      WRITE_UVLC( pcVPS->getLayerSetIdxForOlsMinus1( i ),      "layer_set_idx_for_ols_minus1[i]" );
-#else
       WRITE_CODE( pcVPS->getLayerSetIdxForOlsMinus1( i ), pcVPS->getLayerSetIdxForOlsMinus1Len( i ) ,      "layer_set_idx_for_ols_minus1[i]" );
-#endif
     }
 
@@ -1292,5 +1161,4 @@
     }        
         
-#if H_MV_HLS10_PTL
     for ( Int j = 0; j < pcVPS->getNumLayersInIdList( pcVPS->olsIdxToLsIdx(i)); j++ )
     {    
@@ -1299,18 +1167,10 @@
         WRITE_CODE( pcVPS->getProfileTierLevelIdx( i, j ), pcVPS->getProfileTierLevelIdxLen() ,"profile_tier_level_idx[ i ][ j ]" );   
       }
-#if H_MV_HLS10_PTL_FIX
       if (pcVPS->getNecessaryLayerFlag( i, j ) && pcVPS->getVpsNumProfileTierLevelMinus1() == 0 )
       {
         assert( pcVPS->getProfileTierLevelIdx( i , j ) == pcVPS->inferProfileTierLevelIdx( i, j ) );
       }
-#endif
-
-    }
-#else
-    if ( pcVPS->getProfileLevelTierIdxLen()  > 0 )
-    {      
-      WRITE_CODE( pcVPS->getProfileLevelTierIdx( i ), pcVPS->getProfileLevelTierIdxLen() ,"profile_level_tier_idx[ i ]" );   
-    }
-#endif
+
+    }
     if( pcVPS->getNumOutputLayersInOutputLayerSet( i ) == 1 && pcVPS->getNumDirectRefLayers( pcVPS->getOlsHighestOutputLayerId( i ) ) > 0 )
     {
@@ -1362,7 +1222,4 @@
   }
 
-#if !H_MV_HLS10_GEN_FIX
-  WRITE_FLAG( 0, "vps_reserved_zero_flag" );
-#endif
   codeDpbSize( pcVPS ); 
 
@@ -1441,5 +1298,4 @@
         for( Int k = 0; k < vps->getNumLayersInIdList( currLsIdx ); k++ )   
         {
-#if H_MV_HLS10_DBP_SIZE
           if ( vps->getNecessaryLayerFlag( i, k ) && ( vps->getVpsBaseLayerInternalFlag() || ( vps->getLayerSetLayerIdList(vps->olsIdxToLsIdx(i),k) != 0 ) ))
           {
@@ -1453,7 +1309,4 @@
             }
           }
-#else
-          WRITE_UVLC( dpbSize->getMaxVpsDecPicBufferingMinus1( i, k, j ), "max_vps_dec_pic_buffering_minus1" );
-#endif
         }
         WRITE_UVLC( dpbSize->getMaxVpsNumReorderPics( i, j ), "max_vps_num_reorder_pics" );
@@ -1466,12 +1319,8 @@
           for( Int k = 0; k < vps->getNumLayersInIdList( vps->olsIdxToLsIdx( i ) ); k++ )   
           {
-#if H_MV_HLS10_DBP_SIZE
             if ( vps->getNecessaryLayerFlag(i, k ) )
             {            
-#endif
               assert( dpbSize->getMaxVpsDecPicBufferingMinus1( i, k, j ) == dpbSize->getMaxVpsDecPicBufferingMinus1( i,k, j - 1 ) );
-#if H_MV_HLS10_DBP_SIZE
             }
-#endif  
           }
           assert( dpbSize->getMaxVpsNumReorderPics      ( i, j ) ==  dpbSize->getMaxVpsNumReorderPics      ( i, j - 1 ) );
@@ -1508,5 +1357,4 @@
     pcRepFormat->inferChromaAndBitDepth(pcPrevRepFormat, true ); 
   }
-#if H_MV_HLS10_GEN_VSP_CONF_WIN
   WRITE_FLAG( pcRepFormat->getConformanceWindowVpsFlag( ) ? 1 : 0 , "conformance_window_vps_flag" );
   if ( pcRepFormat->getConformanceWindowVpsFlag() )
@@ -1517,5 +1365,4 @@
     WRITE_UVLC( pcRepFormat->getConfWinVpsBottomOffset( ), "conf_win_vps_bottom_offset" );
   }
-#endif
 }
 
@@ -1542,9 +1389,5 @@
   if( pcVPSVUI->getBitRatePresentVpsFlag( )  ||  pcVPSVUI->getPicRatePresentVpsFlag( ) )
   {
-#if H_MV_HLS10_VPS_VUI
     for( Int i = pcVPS->getVpsBaseLayerInternalFlag() ? 0 : 1; i < pcVPS->getNumLayerSets(); i++ )
-#else
-    for( Int i = pcVPS->getVpsBaseLayerInternalFlag() ? 0 : 1; i  <=  pcVPS->getVpsNumLayerSetsMinus1(); i++ )
-#endif
     {
       for( Int j = 0; j  <=  pcVPS->getMaxSubLayersInLayerSetMinus1( i ); j++ ) 
@@ -1579,9 +1422,5 @@
   else
   {
-#if H_MV_HLS10_VPS_VUI
     assert( pcVPSVUI->getVpsNumVideoSignalInfoMinus1() == pcVPS->getMaxLayersMinus1() - ( pcVPS->getVpsBaseLayerInternalFlag() ? 0 : 1)  ); 
-#else
-    pcVPSVUI->setVpsNumVideoSignalInfoMinus1( pcVPS->getMaxLayersMinus1() ); 
-#endif
   }
 
@@ -1596,23 +1435,8 @@
   if( pcVPSVUI->getVideoSignalInfoIdxPresentFlag() && pcVPSVUI->getVpsNumVideoSignalInfoMinus1() > 0 )
   {
-#if I0045_VPS_VUI_VST_PARAMS
     for( Int i = pcVPS->getVpsBaseLayerInternalFlag() ? 0 : 1; i <=  pcVPS->getMaxLayersMinus1(); i++ )
     {
       WRITE_CODE( pcVPSVUI->getVpsVideoSignalInfoIdx( i ), 4, "vps_video_signal_info_idx" );
     }
-#else
-    for( Int i = 1; i <=  pcVPS->getMaxLayersMinus1(); i++ )
-    {
-      WRITE_CODE( pcVPSVUI->getVpsVideoSignalInfoIdx( i ), 4, "vps_video_signal_info_idx" );
-      assert( pcVPSVUI->getVpsVideoSignalInfoIdx( i ) >= 0 && pcVPSVUI->getVpsVideoSignalInfoIdx( i ) <= pcVPSVUI->getVpsNumVideoSignalInfoMinus1() );
-    }
-  }
-  else
-  {
-    for( Int i = 1; i <=  pcVPS->getMaxLayersMinus1(); i++ )
-    {
-      assert( pcVPSVUI->getVpsVideoSignalInfoIdx( i  ) == ( pcVPSVUI->getVideoSignalInfoIdxPresentFlag() ? 0 : i ) ); 
-    }
-#endif
   }
   WRITE_FLAG( pcVPSVUI->getTilesNotInUseFlag( ) ? 1 : 0 , "tiles_not_in_use_flag" );
@@ -1631,9 +1455,5 @@
       for( Int j = 0; j < pcVPS->getNumDirectRefLayers( pcVPS->getLayerIdInNuh( i ) ) ; j++ )
       {  
-#if H_MV_HLS10_REF_PRED_LAYERS
         Int layerIdx = pcVPS->getLayerIdInVps(pcVPS->getIdRefLayer(pcVPS->getLayerIdInNuh( i ) , j  ));  
-#else
-        Int layerIdx = pcVPS->getLayerIdInVps(pcVPS->getRefLayerId(pcVPS->getLayerIdInNuh( i ) , j  ));  
-#endif
         if( pcVPSVUI->getTilesInUseFlag( i )  &&  pcVPSVUI->getTilesInUseFlag( layerIdx ) )  
         {
@@ -1653,10 +1473,6 @@
     }
   }
-#if H_MV_HLS10_VPS_VUI
   WRITE_FLAG( pcVPSVUI->getSingleLayerForNonIrapFlag( ) ? 1 : 0 , "single_layer_for_non_irap_flag" );
   WRITE_FLAG( pcVPSVUI->getHigherLayerIrapSkipFlag( ) ? 1 : 0 , "higher_layer_irap_skip_flag" );
-#else
-  WRITE_CODE( 0, 3, "vps_vui_reserved_zero_3bits" );
-#endif
   WRITE_FLAG( pcVPSVUI->getIlpRestrictedRefLayersFlag( ) ? 1 : 0 , "ilp_restricted_ref_layers_flag" );
 
@@ -1667,9 +1483,5 @@
       for( Int j = 0; j < pcVPS->getNumDirectRefLayers( pcVPS->getLayerIdInNuh( i ) ); j++ )
       {
-#if H_MV_HLS10_REF_PRED_LAYERS
         if( pcVPS->getVpsBaseLayerInternalFlag() || pcVPS->getIdRefLayer( pcVPS->getLayerIdInNuh( i ), j ) > 0 )
-#else
-        if( pcVPS->getVpsBaseLayerInternalFlag() || pcVPS->getRefLayerId( pcVPS->getLayerIdInNuh( i ), j ) > 0 )
-#endif
         {        
           WRITE_UVLC( pcVPSVUI->getMinSpatialSegmentOffsetPlus1( i, j ), "min_spatial_segment_offset_plus1" );
@@ -1714,5 +1526,4 @@
   assert ( vpsVuiBspHrdP );
   
-#if H_MV_HLS10_VPS_VUI_BSP
   WRITE_UVLC( vpsVuiBspHrdP->getVpsNumAddHrdParams( ), "vps_num_add_hrd_params" );
 
@@ -1760,43 +1571,4 @@
   }  
 
-#else // H_MV_HLS10_GEN
-  WRITE_UVLC( vpsVuiBspHrdP->getVpsNumBspHrdParametersMinus1( ), "vps_num_bsp_hrd_parameters_minus1" );
-  for( Int i = 0; i <= vpsVuiBspHrdP->getVpsNumBspHrdParametersMinus1( ); i++ )
-  {  
-    if( i > 0 )
-    {
-      WRITE_FLAG( vpsVuiBspHrdP->getBspCprmsPresentFlag( i ) ? 1 : 0 , "bsp_cprms_present_flag" );
-    }
-    TComHRD* hrdParameters = vpsVuiBspHrdP->getHrdParametermeters( i ); 
-    codeHrdParameters( hrdParameters, vpsVuiBspHrdP->getBspCprmsPresentFlag( i ), pcVPS->getMaxSubLayersMinus1() );     
-  }  
-  for( Int h = 1; h <= pcVPS->getVpsNumLayerSetsMinus1(); h++ )
-  {  
-    WRITE_UVLC( vpsVuiBspHrdP->getNumBitstreamPartitions( h ), "num_bitstream_partitions" );
-    for( Int i = 0; i < vpsVuiBspHrdP->getNumBitstreamPartitions( h ); i++ )  
-    {
-      for( Int j = 0; j < pcVPS->getNumLayersInIdList( h ); j++ )  
-      {
-        WRITE_FLAG( vpsVuiBspHrdP->getLayerInBspFlag( h, i, j ) ? 1 : 0 , "layer_in_bsp_flag" );
-      }
-    }
-    vpsVuiBspHrdP->checkLayerInBspFlag( pcVPS, h ); 
-
-    if( vpsVuiBspHrdP->getNumBitstreamPartitions( h ) )
-    { 
-      WRITE_UVLC( vpsVuiBspHrdP->getNumBspSchedCombinationsMinus1( h ), "num_bsp_sched_combinations_minus1" );
-      for( Int i = 0; i <= vpsVuiBspHrdP->getNumBspSchedCombinationsMinus1( h ); i++ )
-      {
-        for( Int j = 0; j < vpsVuiBspHrdP->getNumBitstreamPartitions( h ); j++ )
-        {  
-          WRITE_CODE( vpsVuiBspHrdP->getBspCombHrdIdx( h, i, j ),  vpsVuiBspHrdP->getBspCombHrdIdxLen(), "bsp_comb_hrd_idx" ); 
-          WRITE_UVLC( vpsVuiBspHrdP->getBspCombSchedIdx( h, i, j ), "bsp_comb_sched_idx" );
-
-          vpsVuiBspHrdP->checkBspCombHrdAndShedIdx( pcVPS, h, i, j ); 
-        }  
-      }
-    }  
-  }
-#endif  
 }  
 #endif
@@ -1805,27 +1577,13 @@
 Void TEncCavlc::codeVPSExtension2( TComVPS* pcVPS )
 { 
-#if SEC_VPS_CLEANUP_I0090
   for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ )
-#else
-  for( Int i = 0; i <= pcVPS->getMaxLayersMinus1(); i++ )
-#endif
-  {
-#if !SEC_VPS_CLEANUP_I0090
-    if (i!= 0)
-#endif
-    {
-#if MTK_I0099_VPS_EX2
+  {
+    {
       WRITE_FLAG( pcVPS->getIvMvPredFlag         ( i ) ? 1 : 0 , "iv_mv_pred_flag[i]");
-#if SEC_HLS_CLEANUP_I0100
       WRITE_FLAG( pcVPS->getIvMvScalingFlag( i ) ? 1 : 0 ,       "iv_mv_scaling_flag[i]" );
-#endif
-
-#endif
+
       if ( !( pcVPS->getDepthId( i ) == 1 ) )
       {
 #if H_3D_IV_MERGE
-#if !MTK_I0099_VPS_EX2
-        WRITE_FLAG( pcVPS->getIvMvPredFlag         ( i ) ? 1 : 0 , "iv_mv_pred_flag[i]");
-#endif
 #if H_3D_SPIVMP
         WRITE_UVLC( pcVPS->getSubPULog2Size(i)-3, "log2_sub_PU_size_minus3[i]");
@@ -1847,29 +1605,14 @@
       else
       {
-#if !MTK_I0099_VPS_EX2
-        if(i!=1)
-        {
-          WRITE_FLAG( pcVPS->getIvMvPredFlag         ( i ) ? 1 : 0 , "iv_mv_pred_flag[i]");
-        }
-#if H_3D_SPIVMP
-        if (i!=1)
-        {
-          WRITE_UVLC( pcVPS->getSubPULog2Size(i)-3, "log2_sub_PU_size_minus3[i]");
-        }
-#endif
-#endif
 #if H_3D_IV_MERGE
         WRITE_FLAG( pcVPS->getMPIFlag( i ) ? 1 : 0 ,          "mpi_flag[i]" );
 #endif
-#if MTK_I0099_VPS_EX2
         WRITE_UVLC( pcVPS->getSubPUMPILog2Size(i)-3, "log2_mpi_sub_PU_size_minus3[i]");
-#endif
+
         WRITE_FLAG( pcVPS->getVpsDepthModesFlag( i ) ? 1 : 0 ,          "vps_depth_modes_flag[i]" );
-#if SEPARATE_FLAG_I0085
+#if H_3D
         WRITE_FLAG( pcVPS->getIVPFlag( i ) ? 1 : 0 ,               "IVP_flag[i]" );
 #endif
-#if MTK_I0099_VPS_EX2
         WRITE_FLAG( pcVPS->getLimQtPredFlag    ( i ) ? 1 : 0 ,          "lim_qt_pred_flag[i]"     ); 
-#endif
 
 #if H_3D_INTER_SDC
@@ -1880,9 +1623,5 @@
   }
   WRITE_UVLC( pcVPS->getCamParPrecision(), "cp_precision" );
-#if SEC_VPS_CLEANUP_I0090
   for (UInt viewIndex=1; viewIndex<pcVPS->getNumViews(); viewIndex++)
-#else
-  for (UInt viewIndex=0; viewIndex<pcVPS->getNumViews(); viewIndex++)
-#endif
   {
     WRITE_FLAG( pcVPS->getCamParPresent(viewIndex) ? 1 : 0, "cp_present_flag[i]" );
@@ -1902,12 +1641,4 @@
     }
   }
-#if !MTK_I0099_VPS_EX2
-  WRITE_UVLC( pcVPS->getSubPUMPILog2Size( ) - 3, "log2_sub_PU_MPI_size_minus3");
-#endif
-#if H_3D_TMVP
-#if !SEC_HLS_CLEANUP_I0100
-  WRITE_FLAG( pcVPS->getIvMvScalingFlag( ) ? 1 : 0 ,          "iv_mv_scaling_flag" );
-#endif
-#endif
 }
 #endif
@@ -1978,5 +1709,4 @@
       esb++; 
       WRITE_FLAG( pcSlice->getDiscardableFlag( ) ? 1 : 0 , "discardable_flag" );
-#if NON_REF_NAL_TYPE_DISCARDABLE
       if (pcSlice->getDiscardableFlag( ))
       {
@@ -1987,5 +1717,4 @@
           pcSlice->getNalUnitType() != NAL_UNIT_CODED_SLICE_RASL_R);
       }
-#endif
     }
 
@@ -2148,5 +1877,5 @@
       if (pcSlice->getSPS()->getTMVPFlagsPresent())
       {
-#if I0044_SLICE_TMVP
+#if H_MV
         WRITE_FLAG( pcSlice->getEnableTMVPFlag() ? 1 : 0, "slice_temporal_mvp_enabled_flag" );
 #else
@@ -2308,9 +2037,5 @@
     }
 #if H_3D_IC
-#if SEC_HLS_CLEANUP_I0100
     else if( pcSlice->getViewIndex() && ( pcSlice->getSliceType() == P_SLICE || pcSlice->getSliceType() == B_SLICE ) && !pcSlice->getIsDepth() && vps->getNumDirectRefLayers( layerId ) > 0 )
-#else
-    else if( pcSlice->getViewIndex() && ( pcSlice->getSliceType() == P_SLICE || pcSlice->getSliceType() == B_SLICE ) && !pcSlice->getIsDepth())
-#endif
     {
       WRITE_FLAG( pcSlice->getApplyIC() ? 1 : 0, "slice_ic_enable_flag" );
@@ -2321,5 +2046,5 @@
     }
 #endif
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
     if(pcSlice->getIsDepth())
     {
@@ -2385,5 +2110,5 @@
   }
 #if H_3D
-#if LGE_FCO_I0116
+#if H_3D_FCO
   if( pcSlice->getVPS()->hasCamParInSliceHeader( pcSlice->getViewIndex() ) && pcSlice->getIsDepth() )
 #else
@@ -2575,13 +2300,6 @@
   WRITE_FLAG(ptl->getFrameOnlyConstraintFlag(), "general_frame_only_constraint_flag");
   
-#if H_MV_HLS10_PTL
-#if H_MV_HLS10_PTL_INFER_FIX
+#if H_MV
   if( ptl->getV2ConstraintsPresentFlag() ) 
-#else
-  if( ptl->getProfileIdc( ) ==  4 || ptl->getProfileCompatibilityFlag( 4 )  ||
-    ptl->getProfileIdc( ) ==  5 || ptl->getProfileCompatibilityFlag( 5 )  ||
-    ptl->getProfileIdc( ) ==  6 || ptl->getProfileCompatibilityFlag( 6 )  ||
-    ptl->getProfileIdc( ) ==  7 || ptl->getProfileCompatibilityFlag( 7 ) ) 
-#endif
   {
     WRITE_FLAG( ptl->getMax12bitConstraintFlag( ) ? 1 : 0 , "max_12bit_constraint_flag" );
@@ -2604,12 +2322,5 @@
     WRITE_CODE( 0, 11, "XXX_reserved_zero_43bits[32..42]");
   }
-#if H_MV_HLS10_PTL_INFER_FIX
     if( ptl->getInbldPresentFlag() )
-#else
-  if( ( ptl->getProfileIdc() >= 1 && ptl->getProfileIdc() <= 5 )  ||
-    ptl->getProfileCompatibilityFlag( 1 ) || ptl->getProfileCompatibilityFlag( 2 )  ||
-    ptl->getProfileCompatibilityFlag( 3 ) || ptl->getProfileCompatibilityFlag( 4 )  ||
-    ptl->getProfileCompatibilityFlag( 5 ) )
-#endif
   {
     WRITE_FLAG( ptl->getInbldFlag( ) ? 1 : 0 , "inbld_flag" );
@@ -2762,5 +2473,5 @@
   assert(0);
 }
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
 Void TEncCavlc::codeSingleDepthMode( TComDataCU* pcCU, UInt uiAbsPartIdx )
 {
Index: trunk/source/Lib/TLibEncoder/TEncCavlc.h
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncCavlc.h	(revision 1067)
+++ trunk/source/Lib/TLibEncoder/TEncCavlc.h	(revision 1084)
@@ -107,8 +107,6 @@
   Void  codePPS                 ( TComPPS* pcPPS );
 
-#if H_MV_HLS10_PPS
 #if H_MV
   Void codePPSMultilayerExtension( TComPPS* pcPPS );
-#endif
 #endif
 
@@ -129,5 +127,5 @@
   Void codeCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx );
   Void codeSkipFlag      ( TComDataCU* pcCU, UInt uiAbsPartIdx );
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
   Void codeSingleDepthMode( TComDataCU* pcCU, UInt uiAbsPartIdx );
 #endif
Index: trunk/source/Lib/TLibEncoder/TEncCfg.h
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncCfg.h	(revision 1067)
+++ trunk/source/Lib/TLibEncoder/TEncCfg.h	(revision 1084)
@@ -124,5 +124,4 @@
   Int       m_iSourceWidth;
   Int       m_iSourceHeight;
-  Int       m_conformanceMode;
   Window    m_conformanceWindow;
   Int       m_framesToBeEncoded;
@@ -229,9 +228,9 @@
   Bool      m_bPCMFilterDisableFlag;
   Bool      m_loopFilterAcrossTilesEnabledFlag;
-  Int       m_iUniformSpacingIdr;
+  Bool      m_tileUniformSpacingFlag;
   Int       m_iNumColumnsMinus1;
-  UInt*     m_puiColumnWidth;
   Int       m_iNumRowsMinus1;
-  UInt*     m_puiRowHeight;
+  std::vector<Int> m_tileColumnWidth;
+  std::vector<Int> m_tileRowHeight;
 
   Int       m_iWaveFrontSynchro;
@@ -414,11 +413,9 @@
 #if H_3D_DIM
   Bool      m_useDMM;
-#if SEPARATE_FLAG_I0085
   Bool      m_useIVP;
-#endif
   Bool      m_useSDC;
   Bool      m_useDLT;
 #endif
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
   Bool      m_useSingleDepthMode;
 #endif
@@ -426,17 +423,12 @@
   Bool      m_useMPI;
 #endif
-#if !MTK_I0099_VPS_EX2 || MTK_I0099_FIX
 #if H_3D_QTLPC
   Bool      m_bUseQTL;
-#if !MTK_I0099_VPS_EX2
-  Bool      m_bUsePC;
-#endif
-#endif
 #endif
 #endif
 public:
   TEncCfg()
-  : m_puiColumnWidth()
-  , m_puiRowHeight()
+  : m_tileColumnWidth()
+  , m_tileRowHeight()
 #if H_MV
   , m_layerId(-1)
@@ -452,8 +444,5 @@
 
   virtual ~TEncCfg()
-  {
-    delete[] m_puiColumnWidth;
-    delete[] m_puiRowHeight;
-  }
+  {}
   
   Void setProfile(Profile::Name profile) { m_profile = profile; }
@@ -678,40 +667,14 @@
   Void  setLFCrossTileBoundaryFlag               ( Bool   val  )       { m_loopFilterAcrossTilesEnabledFlag = val; }
   Bool  getLFCrossTileBoundaryFlag               ()                    { return m_loopFilterAcrossTilesEnabledFlag;   }
-  Void  setUniformSpacingIdr           ( Int i )           { m_iUniformSpacingIdr = i; }
-  Int   getUniformSpacingIdr           ()                  { return m_iUniformSpacingIdr; }
+  Void  setTileUniformSpacingFlag      ( Bool b )          { m_tileUniformSpacingFlag = b; }
+  Bool  getTileUniformSpacingFlag      ()                  { return m_tileUniformSpacingFlag; }
   Void  setNumColumnsMinus1            ( Int i )           { m_iNumColumnsMinus1 = i; }
   Int   getNumColumnsMinus1            ()                  { return m_iNumColumnsMinus1; }
-  Void  setColumnWidth ( UInt* columnWidth )
-  {
-    if( m_iUniformSpacingIdr == 0 && m_iNumColumnsMinus1 > 0 )
-    {
-      Int  m_iWidthInCU = ( m_iSourceWidth%g_uiMaxCUWidth ) ? m_iSourceWidth/g_uiMaxCUWidth + 1 : m_iSourceWidth/g_uiMaxCUWidth;
-      m_puiColumnWidth = new UInt[ m_iNumColumnsMinus1 ];
-
-      for(Int i=0; i<m_iNumColumnsMinus1; i++)
-      {
-        m_puiColumnWidth[i] = columnWidth[i];
-        printf("col: m_iWidthInCU= %4d i=%4d width= %4d\n",m_iWidthInCU,i,m_puiColumnWidth[i]); //AFU
-      }
-    }
-  }
-  UInt  getColumnWidth                 ( UInt columnidx )  { return *( m_puiColumnWidth + columnidx ); }
+  Void  setColumnWidth ( const std::vector<Int>& columnWidth ) { m_tileColumnWidth = columnWidth; }
+  UInt  getColumnWidth                 ( UInt columnIdx )      { return m_tileColumnWidth[columnIdx]; }
   Void  setNumRowsMinus1               ( Int i )           { m_iNumRowsMinus1 = i; }
   Int   getNumRowsMinus1               ()                  { return m_iNumRowsMinus1; }
-  Void  setRowHeight (UInt* rowHeight)
-  {
-    if( m_iUniformSpacingIdr == 0 && m_iNumRowsMinus1 > 0 )
-    {
-      Int  m_iHeightInCU = ( m_iSourceHeight%g_uiMaxCUHeight ) ? m_iSourceHeight/g_uiMaxCUHeight + 1 : m_iSourceHeight/g_uiMaxCUHeight;
-      m_puiRowHeight = new UInt[ m_iNumRowsMinus1 ];
-
-      for(Int i=0; i<m_iNumRowsMinus1; i++)
-      {
-        m_puiRowHeight[i] = rowHeight[i];
-        printf("row: m_iHeightInCU=%4d i=%4d height=%4d\n",m_iHeightInCU,i,m_puiRowHeight[i]); //AFU
-      }
-    }
-  }
-  UInt  getRowHeight                   ( UInt rowIdx )     { return *( m_puiRowHeight + rowIdx ); }
+  Void  setRowHeight ( const std::vector<Int>& rowHeight)      { m_tileRowHeight = rowHeight; }
+  UInt  getRowHeight                   ( UInt rowIdx )         { return m_tileRowHeight[rowIdx]; }
   Void  xCheckGSParameters();
   Void  setWaveFrontSynchro(Int iWaveFrontSynchro)       { m_iWaveFrontSynchro = iWaveFrontSynchro; }
@@ -1013,8 +976,6 @@
   Bool      getUseDMM                       ()        { return m_useDMM; }
   Void      setUseDMM                       ( Bool b) { m_useDMM = b;    }
-#if SEPARATE_FLAG_I0085
   Bool      getUseIVP                       ()        { return m_useIVP; }
   Void      setUseIVP                       ( Bool b) { m_useIVP = b;    }
-#endif
   Bool      getUseSDC                       ()        { return m_useSDC; }
   Void      setUseSDC                       ( Bool b) { m_useSDC = b;    }
@@ -1022,17 +983,11 @@
   Void      setUseDLT                       ( Bool b) { m_useDLT = b;    }
 #endif
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
   Void       setUseSingleDepthMode          ( Bool bVal )    { m_useSingleDepthMode = bVal; }
   Bool       getUseSingleDepthMode          ()               { return m_useSingleDepthMode; }
 #endif
-#if !MTK_I0099_VPS_EX2 || MTK_I0099_FIX
 #if H_3D_QTLPC
   Void      setUseQTL                       ( Bool b ) { m_bUseQTL = b;    }
   Bool      getUseQTL                       ()         { return m_bUseQTL; }
-#if !MTK_I0099_VPS_EX2
-  Void      setUsePC                        ( Bool b ) { m_bUsePC  = b;    }
-  Bool      getUsePC                        ()         { return m_bUsePC;  }
-#endif
-#endif
 #endif
 #if H_3D_IV_MERGE
Index: trunk/source/Lib/TLibEncoder/TEncCu.cpp
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncCu.cpp	(revision 1067)
+++ trunk/source/Lib/TLibEncoder/TEncCu.cpp	(revision 1084)
@@ -409,10 +409,6 @@
 
 #if H_3D_QTLPC
-#if MTK_I0099_VPS_EX2
   TComVPS *vps            = pcPic->getSlice(0)->getVPS();
   Bool  bLimQtPredFalg    = vps->getLimQtPredFlag(pcPic->getSlice(0)->getLayerId()); 
-#else
-  TComSPS *sps            = pcPic->getSlice(0)->getSPS();
-#endif
   TComPic *pcTexture      = rpcBestCU->getSlice()->getTexturePic();
 
@@ -535,17 +531,8 @@
 #if H_3D_QTLPC
       //logic for setting bTrySplit using the partition information that is stored of the texture colocated CU
-
-#if MTK_I0099_VPS_EX2
-#if MTK_I0099_FIX
-#if LGE_FCO_I0116
+#if H_3D_FCO
       if(depthMapDetect && !bIntraSliceDetect && !rapPic && ( m_pcEncCfg->getUseQTL() || bLimQtPredFalg ) && pcTexture->getReconMark())
 #else
       if(depthMapDetect && !bIntraSliceDetect && !rapPic && ( m_pcEncCfg->getUseQTL() || bLimQtPredFalg ))
-#endif
-#else
-      if(depthMapDetect && !bIntraSliceDetect && !rapPic && bLimQtPredFalg)
-#endif
-#else
-      if(depthMapDetect && !bIntraSliceDetect && !rapPic && sps->getUseQTL())
 #endif
       {
@@ -702,13 +689,5 @@
 
 #if H_3D_QTLPC      
-#if MTK_I0099_VPS_EX2
-#if MTK_I0099_FIX
       if(depthMapDetect && !bIntraSliceDetect && !rapPic && ( m_pcEncCfg->getUseQTL() || bLimQtPredFalg ))
-#else
-      if(depthMapDetect && !bIntraSliceDetect && !rapPic && bLimQtPredFalg)
-#endif
-#else
-      if(depthMapDetect && !bIntraSliceDetect && !rapPic && sps->getUseQTL())
-#endif
       {
         bTrySplitDQP = bTrySplit;
@@ -734,5 +713,5 @@
     }
 #endif
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
     rpcTempCU->initEstData( uiDepth, iMinQP, isAddLowestQP  );
     if(rpcBestCU->getSlice()->getApplySingleDepthMode())
@@ -1057,13 +1036,9 @@
               rpcBestCU->getCbf( 0, TEXT_CHROMA_V ) != 0     
 #if H_3D_DIM_ENC
-#if HHI_DMM4_ENC_I0066
               || rpcBestCU->getSlice()->getIsDepth()
-#else
-            || ( rpcBestCU->getSlice()->getIsDepth() && rpcBestCU->getSlice()->isIRAP() )
-#endif
 #endif
             ) // avoid very complex intra if it is unlikely
           {
-#if HHI_DMM4_ENC_I0066
+#if H_3D_DIM
             Bool bOnlyIVP = false;
             if( rpcBestCU->getSlice()->getIsDepth() && !(rpcBestCU->getSlice()->isIRAP()) && 
@@ -1098,5 +1073,5 @@
                 if( rpcTempCU->getWidth(0) > ( 1 << rpcTempCU->getSlice()->getSPS()->getQuadtreeTULog2MinSize() ) )
                 {
-#if HHI_DMM4_ENC_I0066
+#if H_3D_DIM
                   xCheckRDCostIntra( rpcBestCU, rpcTempCU, SIZE_NxN, bOnlyIVP );
 #else
@@ -1590,5 +1565,5 @@
     return;
   }
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
   m_pcEntropyCoder->encodeSingleDepthMode( pcCU, uiAbsPartIdx );
   if(!pcCU->getSingleDepthFlag(uiAbsPartIdx))
@@ -1627,5 +1602,5 @@
   m_pcEntropyCoder->encodeCoeff( pcCU, uiAbsPartIdx, uiDepth, pcCU->getWidth (uiAbsPartIdx), pcCU->getHeight(uiAbsPartIdx), bCodeDQP );
   setdQPFlag( bCodeDQP );
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
   }
 #endif
@@ -1863,7 +1838,4 @@
     Int vspFlag[MRG_MAX_NUM_CANDS_MEM];
     memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM);
-#if !FIX_TICKET_79
-    InheritedVSPDisInfo inheritedVSPDisInfo[MRG_MAX_NUM_CANDS_MEM];
-#endif
 #if H_3D_SPIVMP
     Bool bSPIVMPFlag[MRG_MAX_NUM_CANDS_MEM];
@@ -1878,7 +1850,4 @@
     rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand );
     rpcTempCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours
-#if !FIX_TICKET_79
-      , inheritedVSPDisInfo
-#endif
 #if H_3D_SPIVMP
       , pcMvFieldSP, puhInterDirSP
@@ -1895,9 +1864,5 @@
 
 #else
-#if FIX_TICKET_79
     rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, vspFlag, numValidMergeCand );
-#else
-    rpcTempCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, numValidMergeCand );
-#endif
 #endif
 
@@ -1942,7 +1907,4 @@
 #if H_3D_VSP
           rpcTempCU->setVSPFlagSubParts( vspFlag[uiMergeCand], 0, 0, uhDepth );
-#if !FIX_TICKET_79
-          rpcTempCU->setDvInfoSubParts(inheritedVSPDisInfo[uiMergeCand].m_acDvInfo, 0, 0, uhDepth );
-#endif
 #endif
 #if H_3D_DDD
@@ -2043,5 +2005,5 @@
 
           rpcTempCU->setSkipFlagSubParts( rpcTempCU->getQtRootCbf(0) == 0, 0, uhDepth );
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
           rpcTempCU->setSingleDepthFlagSubParts( false, 0, uhDepth );
 #endif
@@ -2061,12 +2023,7 @@
           if( rpcTempCU->getSlice()->getVPS()->getInterSDCFlag( rpcTempCU->getSlice()->getLayerIdInVps() ) && rpcTempCU->getSlice()->getIsDepth() && !uiNoResidual )
           {
-#if FAST_SDC_OFFSET_DECISION_I0084
             Double dOffsetCost[3] = {MAX_DOUBLE,MAX_DOUBLE,MAX_DOUBLE};
             for( Int uiOffest = 1 ; uiOffest <= 5 ; uiOffest++ )
-#else
-            for( Int uiOffest = -2 ; uiOffest <= 2 ; uiOffest++ )
-#endif
             {
-#if FAST_SDC_OFFSET_DECISION_I0084
               if( uiOffest > 3)
               {
@@ -2084,5 +2041,4 @@
                 }
               }
-#endif
               if( rpcTempCU != rpcTempCUPre )
               {
@@ -2091,5 +2047,5 @@
               }
               rpcTempCU->setSkipFlagSubParts( false, 0, uhDepth );
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
               rpcTempCU->setSingleDepthFlagSubParts( false, 0, uhDepth );
 #endif
@@ -2106,5 +2062,4 @@
               }
 #endif
-#if FAST_SDC_OFFSET_DECISION_I0084
               Int iSdcOffset = 0;
               if(uiOffest % 2 == 0)
@@ -2127,13 +2082,4 @@
                 dOffsetCost [uiOffest -1] = rpcTempCU->getTotalCost();
               }
-#else
-              m_pcPredSearch->encodeResAndCalcRdInterSDCCU( rpcTempCU, 
-                m_ppcOrigYuv[uhDepth], 
-                ( rpcTempCU != rpcTempCUPre ) ? m_ppcPredYuvBest[uhDepth] : m_ppcPredYuvTemp[uhDepth], 
-                m_ppcResiYuvTemp[uhDepth], 
-                m_ppcRecoYuvTemp[uhDepth],
-                uiOffest,
-                uhDepth );
-#endif
 
               xCheckDQP( rpcTempCU );
@@ -2253,5 +2199,5 @@
   
   rpcTempCU->setSkipFlagSubParts( false, 0, uhDepth );
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
   rpcTempCU->setSingleDepthFlagSubParts( false, 0, uhDepth );
 #endif
@@ -2326,5 +2272,4 @@
   }
 #endif
-
 #if H_3D_VSO // M4
   if( m_pcRdCost->getUseLambdaScaleVSO() )
@@ -2332,5 +2277,4 @@
   else
 #endif
-
   rpcTempCU->getTotalCost()  = m_pcRdCost->calcRdCost( rpcTempCU->getTotalBits(), rpcTempCU->getTotalDistortion() );
 #if H_3D_INTER_SDC
@@ -2342,12 +2286,7 @@
   if( rpcTempCU->getSlice()->getVPS()->getInterSDCFlag( rpcTempCU->getSlice()->getLayerIdInVps() ) && rpcTempCU->getSlice()->getIsDepth() && ePartSize == SIZE_2Nx2N)
   {
-#if FAST_SDC_OFFSET_DECISION_I0084
     Double dOffsetCost[3] = {MAX_DOUBLE,MAX_DOUBLE,MAX_DOUBLE};
     for( Int uiOffest = 1 ; uiOffest <= 5 ; uiOffest++ )
-#else
-    for( Int uiOffest = -2 ; uiOffest <= 2 ; uiOffest++ )
-#endif
-    {
-#if FAST_SDC_OFFSET_DECISION_I0084
+    {
       if( uiOffest > 3)
       {
@@ -2365,5 +2304,5 @@
         }
       }
-#endif
+
       if( rpcTempCU != rpcTempCUPre )
       {
@@ -2373,5 +2312,5 @@
       }
       rpcTempCU->setSkipFlagSubParts( false, 0, uhDepth );
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
       rpcTempCU->setSingleDepthFlagSubParts( false, 0, uhDepth );
 #endif
@@ -2389,5 +2328,4 @@
 #endif
 
-#if FAST_SDC_OFFSET_DECISION_I0084
       Int iSdcOffset = 0;
       if(uiOffest % 2 == 0)
@@ -2410,13 +2348,4 @@
         dOffsetCost [uiOffest -1] = rpcTempCU->getTotalCost();
       }
-#else
-      m_pcPredSearch->encodeResAndCalcRdInterSDCCU( rpcTempCU, 
-        m_ppcOrigYuv[uhDepth],
-        ( rpcTempCU != rpcTempCUPre ) ? m_ppcPredYuvBest[uhDepth] : m_ppcPredYuvTemp[uhDepth],
-        m_ppcResiYuvTemp[uhDepth],
-        m_ppcRecoYuvTemp[uhDepth],
-        uiOffest,
-        uhDepth );
-#endif
 
       xCheckDQP( rpcTempCU );
@@ -2493,5 +2422,5 @@
   }
 }
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
 Void TEncCu::xCheckRDCostSingleDepth( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize eSize )
 {
@@ -2560,4 +2489,5 @@
 }
 #endif
+
 Void TEncCu::xCheckRDCostInterDBBP( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, Bool bUseMRG )
 {
@@ -2581,5 +2511,6 @@
   AOF( uiWidth == uiHeight );
   
-#if SEC_DBBP_DISALLOW_8x8_I0078
+#if H_3D_DBBP
+  // Is this correct here, was under the macro SEC_DBBP_DISALLOW_8x8_I0078, however the function is related to Single Depth Mode
   if(uiWidth <= 8)
   {
@@ -2592,5 +2523,5 @@
   // fetch virtual depth block
   UInt uiDepthStride = 0;
-#if LGE_FCO_I0116
+#if H_3D_FCO
   Pel* pDepthPels = rpcTempCU->getVirtualDepthBlock(rpcTempCU->getZorderIdxInCU(), uiWidth, uiHeight, uiDepthStride);
 #else
@@ -2688,10 +2619,5 @@
   
   // reconstruct final prediction signal by combining both segments
-#if SHARP_DBBP_SIMPLE_FLTER_I0109
   m_pcPredSearch->combineSegmentsWithMask(apPredYuv, m_ppcPredYuvTemp[uhDepth], pMask, uiWidth, uiHeight, 0, eVirtualPartSize);
-#else
-  m_pcPredSearch->combineSegmentsWithMask(apPredYuv, m_ppcPredYuvTemp[uhDepth], pMask, uiWidth, uiHeight);
-#endif
-  
   m_pcPredSearch->encodeResAndCalcRdInterCU( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcResiYuvBest[uhDepth], m_ppcRecoYuvTemp[uhDepth], false );
   
@@ -2700,6 +2626,5 @@
 }
 #endif
-
-#if HHI_DMM4_ENC_I0066
+#if H_3D_DIM
 Void TEncCu::xCheckRDCostIntra( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize eSize, Bool bOnlyIVP )
 #else
@@ -2707,6 +2632,5 @@
 #endif
 {
-  UInt uiDepth = rpcTempCU->getDepth( 0 );
-  
+  UInt uiDepth = rpcTempCU->getDepth( 0 );  
 #if H_3D_VSO // M5
   if( m_pcRdCost->getUseRenModel() )
@@ -2721,5 +2645,5 @@
 
   rpcTempCU->setSkipFlagSubParts( false, 0, uiDepth );
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
   rpcTempCU->setSingleDepthFlagSubParts( false, 0, uiDepth );
 #endif
@@ -2733,5 +2657,5 @@
     m_pcPredSearch->preestChromaPredMode( rpcTempCU, m_ppcOrigYuv[uiDepth], m_ppcPredYuvTemp[uiDepth] );
   }
-#if HHI_DMM4_ENC_I0066
+#if H_3D_DIM
   m_pcPredSearch  ->estIntraPredQT      ( rpcTempCU, m_ppcOrigYuv[uiDepth], m_ppcPredYuvTemp[uiDepth], m_ppcResiYuvTemp[uiDepth], m_ppcRecoYuvTemp[uiDepth], uiPreCalcDistC, bSeparateLumaChroma, bOnlyIVP );
 #else
@@ -2751,5 +2675,5 @@
   }
   m_pcEntropyCoder->encodeSkipFlag ( rpcTempCU, 0,          true );
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
   m_pcEntropyCoder->encodeSingleDepthMode( rpcTempCU, 0,          true );
   if(!rpcTempCU->getSingleDepthFlag(0))
@@ -2768,5 +2692,5 @@
   m_pcEntropyCoder->encodeCoeff( rpcTempCU, 0, uiDepth, rpcTempCU->getWidth (0), rpcTempCU->getHeight(0), bCodeDQP );
   setdQPFlag( bCodeDQP );
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
   }
 #endif        
@@ -2798,5 +2722,5 @@
 
   rpcTempCU->setSkipFlagSubParts( false, 0, uiDepth );
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
   rpcTempCU->setSingleDepthFlagSubParts( false, 0, uiDepth );
 #endif
@@ -2817,5 +2741,5 @@
   }
   m_pcEntropyCoder->encodeSkipFlag ( rpcTempCU, 0,          true );
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
   m_pcEntropyCoder->encodeSingleDepthMode( rpcTempCU, 0,          true );
 #endif
Index: trunk/source/Lib/TLibEncoder/TEncCu.h
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncCu.h	(revision 1067)
+++ trunk/source/Lib/TLibEncoder/TEncCu.h	(revision 1084)
@@ -159,8 +159,8 @@
   Void  xCheckRDCostInterDBBP( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, Bool bUseMRG = false );
 #endif
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
   Void  xCheckRDCostSingleDepth   ( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize ePartSize  );
 #endif
-#if HHI_DMM4_ENC_I0066
+#if H_3D_DIM
   Void  xCheckRDCostIntra   ( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize ePartSize, Bool bOnlyIVP );
 #else
Index: trunk/source/Lib/TLibEncoder/TEncEntropy.cpp
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncEntropy.cpp	(revision 1067)
+++ trunk/source/Lib/TLibEncoder/TEncEntropy.cpp	(revision 1084)
@@ -119,5 +119,5 @@
   m_pcEntropyCoderIf->codeSkipFlag( pcCU, uiAbsPartIdx );
 }
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
 Void TEncEntropy::encodeSingleDepthMode( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD )
 {
@@ -185,5 +185,4 @@
   else
   {
-#if MTK_LOW_LATENCY_IC_ENCODING_H0086_FIX
     Int ICEnableCandidate = pcCU->getSlice()->getICEnableCandidate(pcCU->getSlice()->getDepth());
     Int ICEnableNum = pcCU->getSlice()->getICEnableNum(pcCU->getSlice()->getDepth());
@@ -195,11 +194,4 @@
     pcCU->getSlice()->setICEnableCandidate(pcCU->getSlice()->getDepth(), ICEnableCandidate);
     pcCU->getSlice()->setICEnableNum(pcCU->getSlice()->getDepth(), ICEnableNum);
-#else
-    g_aICEnableCANDIDATE[pcCU->getSlice()->getDepth()]++;
-    if(pcCU->getICFlag(uiAbsPartIdx))
-    {
-      g_aICEnableNUM[pcCU->getSlice()->getDepth()]++;
-    }
-#endif
   }
   if( pcCU->isICFlagRequired( uiAbsPartIdx ) )
@@ -273,42 +265,10 @@
   }
   
+  m_pcEntropyCoderIf->codePartSize( pcCU, uiAbsPartIdx, uiDepth );
+  
 #if H_3D_DBBP
-#if! SEC_DBBP_EXPLICIT_SIG_I0077
-  PartSize eVirtualPartSize = pcCU->getPartitionSize(uiAbsPartIdx);
-  if( pcCU->getDBBPFlag(uiAbsPartIdx) )
-  {
-    AOF( pcCU->getSlice()->getVPS()->getUseDBBP(pcCU->getSlice()->getLayerIdInVps()) );
-    
-    // temporarily change partition size for DBBP blocks
-    pcCU->setPartSizeSubParts(RWTH_DBBP_PACK_MODE, uiAbsPartIdx, uiDepth);
-  }
-#endif
-#endif
-  
-  m_pcEntropyCoderIf->codePartSize( pcCU, uiAbsPartIdx, uiDepth );
-  
-#if H_3D_DBBP
-#if SEC_DBBP_EXPLICIT_SIG_I0077
-#if SEC_DBBP_DISALLOW_8x8_I0078
   if( pcCU->getSlice()->getVPS()->getUseDBBP(pcCU->getSlice()->getLayerIdInVps()) && (pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2NxN || pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_Nx2N) && pcCU->getWidth(uiAbsPartIdx) > 8 )
-#else
-  if( pcCU->getSlice()->getVPS()->getUseDBBP(pcCU->getSlice()->getLayerIdInVps()) && (pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2NxN || pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_Nx2N) )
-#endif
-#else
-#if SEC_DBBP_DISALLOW_8x8_I0078
-  if( pcCU->getSlice()->getVPS()->getUseDBBP(pcCU->getSlice()->getLayerIdInVps()) && pcCU->getWidth(uiAbsPartIdx) > 8 )
-#else
-  if( pcCU->getSlice()->getVPS()->getUseDBBP(pcCU->getSlice()->getLayerIdInVps()) )
-#endif
-#endif
   {
     encodeDBBPFlag(pcCU, uiAbsPartIdx, bRD);
-#if !SEC_DBBP_EXPLICIT_SIG_I0077
-    if( pcCU->getDBBPFlag(uiAbsPartIdx) )
-    {
-      // restore virtual partition size for DBBP blocks
-      pcCU->setPartSizeSubParts(eVirtualPartSize, uiAbsPartIdx, uiDepth);
-    }
-#endif
   }
 #endif
Index: trunk/source/Lib/TLibEncoder/TEncEntropy.h
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncEntropy.h	(revision 1067)
+++ trunk/source/Lib/TLibEncoder/TEncEntropy.h	(revision 1084)
@@ -86,5 +86,5 @@
   virtual Void codeCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;
   virtual Void codeSkipFlag      ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
   virtual Void codeSingleDepthMode      ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;
 #endif
@@ -174,5 +174,5 @@
   Void encodeCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false );
   Void encodeSkipFlag          ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false );
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
   Void encodeSingleDepthMode( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD=false );
 #endif
Index: trunk/source/Lib/TLibEncoder/TEncGOP.cpp
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 1067)
+++ trunk/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 1084)
@@ -160,7 +160,7 @@
 #endif
 #endif
-#if MTK_LOW_LATENCY_IC_ENCODING_H0086_FIX
-  m_aICEnableCandidate           = pcTEncTop->getICEnableCandidate(); 
-  m_aICEnableNum           = pcTEncTop->getICEnableNum(); 
+#if H_3D_IC
+  m_aICEnableCandidate   = pcTEncTop->getICEnableCandidate(); 
+  m_aICEnableNum         = pcTEncTop->getICEnableNum(); 
 #endif
 #if KWU_FIX_URQ
@@ -395,5 +395,9 @@
 Void TEncGOP::initGOP( Int iPOCLast, Int iNumPicRcvd, TComList<TComPic*>& rcListPic, TComList<TComPicYuv*>& rcListPicYuvRecOut, std::list<AccessUnit>& accessUnitsInGOP)
 {
+#if H_MV_ALIGN_HM_15
+  xInitGOP( iPOCLast, iNumPicRcvd, rcListPic, rcListPicYuvRecOut, false );
+#else
   xInitGOP( iPOCLast, iNumPicRcvd, rcListPic, rcListPicYuvRecOut );
+#endif
   m_iNumPicCoded = 0;
 }
@@ -937,5 +941,5 @@
     pcSlice->setRefPicList ( rcListPic );
 #endif
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
     TEncTop* pcEncTop = (TEncTop*) m_pcCfg;
     bool enableSingleDepthMode=false;
@@ -971,5 +975,5 @@
 #endif    
 #endif
-#if MTK_LOW_LATENCY_IC_ENCODING_H0086_FIX
+#if H_3D_IC
     pcSlice->setICEnableCandidate( m_aICEnableCandidate );         
     pcSlice->setICEnableNum( m_aICEnableNum );         
@@ -1228,68 +1232,8 @@
     UInt uiRealEndAddress = uiExternalAddress*pcPic->getNumPartInCU()+uiInternalAddress;
 
-    UInt uiCummulativeTileWidth;
-    UInt uiCummulativeTileHeight;
     Int  p, j;
     UInt uiEncCUAddr;
 
-    //set NumColumnsMinus1 and NumRowsMinus1
-    pcPic->getPicSym()->setNumColumnsMinus1( pcSlice->getPPS()->getNumColumnsMinus1() );
-    pcPic->getPicSym()->setNumRowsMinus1( pcSlice->getPPS()->getNumRowsMinus1() );
-
-    //create the TComTileArray
-    pcPic->getPicSym()->xCreateTComTileArray();
-
-    if( pcSlice->getPPS()->getUniformSpacingFlag() == 1 )
-    {
-      //set the width for each tile
-      for(j=0; j < pcPic->getPicSym()->getNumRowsMinus1()+1; j++)
-      {
-        for(p=0; p < pcPic->getPicSym()->getNumColumnsMinus1()+1; p++)
-        {
-          pcPic->getPicSym()->getTComTile( j * (pcPic->getPicSym()->getNumColumnsMinus1()+1) + p )->
-            setTileWidth( (p+1)*pcPic->getPicSym()->getFrameWidthInCU()/(pcPic->getPicSym()->getNumColumnsMinus1()+1) 
-            - (p*pcPic->getPicSym()->getFrameWidthInCU())/(pcPic->getPicSym()->getNumColumnsMinus1()+1) );
-        }
-      }
-
-      //set the height for each tile
-      for(j=0; j < pcPic->getPicSym()->getNumColumnsMinus1()+1; j++)
-      {
-        for(p=0; p < pcPic->getPicSym()->getNumRowsMinus1()+1; p++)
-        {
-          pcPic->getPicSym()->getTComTile( p * (pcPic->getPicSym()->getNumColumnsMinus1()+1) + j )->
-            setTileHeight( (p+1)*pcPic->getPicSym()->getFrameHeightInCU()/(pcPic->getPicSym()->getNumRowsMinus1()+1) 
-            - (p*pcPic->getPicSym()->getFrameHeightInCU())/(pcPic->getPicSym()->getNumRowsMinus1()+1) );   
-        }
-      }
-    }
-    else
-    {
-      //set the width for each tile
-      for(j=0; j < pcPic->getPicSym()->getNumRowsMinus1()+1; j++)
-      {
-        uiCummulativeTileWidth = 0;
-        for(p=0; p < pcPic->getPicSym()->getNumColumnsMinus1(); p++)
-        {
-          pcPic->getPicSym()->getTComTile( j * (pcPic->getPicSym()->getNumColumnsMinus1()+1) + p )->setTileWidth( pcSlice->getPPS()->getColumnWidth(p) );
-          uiCummulativeTileWidth += pcSlice->getPPS()->getColumnWidth(p);
-        }
-        pcPic->getPicSym()->getTComTile(j * (pcPic->getPicSym()->getNumColumnsMinus1()+1) + p)->setTileWidth( pcPic->getPicSym()->getFrameWidthInCU()-uiCummulativeTileWidth );
-      }
-
-      //set the height for each tile
-      for(j=0; j < pcPic->getPicSym()->getNumColumnsMinus1()+1; j++)
-      {
-        uiCummulativeTileHeight = 0;
-        for(p=0; p < pcPic->getPicSym()->getNumRowsMinus1(); p++)
-        {
-          pcPic->getPicSym()->getTComTile( p * (pcPic->getPicSym()->getNumColumnsMinus1()+1) + j )->setTileHeight( pcSlice->getPPS()->getRowHeight(p) );
-          uiCummulativeTileHeight += pcSlice->getPPS()->getRowHeight(p);
-        }
-        pcPic->getPicSym()->getTComTile(p * (pcPic->getPicSym()->getNumColumnsMinus1()+1) + j)->setTileHeight( pcPic->getPicSym()->getFrameHeightInCU()-uiCummulativeTileHeight );
-      }
-    }
-    //intialize each tile of the current picture
-    pcPic->getPicSym()->xInitTiles();
+    pcPic->getPicSym()->initTiles(pcSlice->getPPS());
 
     // Allocate some coders, now we know how many tiles there are.
@@ -1814,4 +1758,5 @@
 
 #if SETTING_NO_OUT_PIC_PRIOR
+          pcSlice->setNoRaslOutputFlag(false);
           if (pcSlice->isIRAP())
           {
@@ -1821,4 +1766,5 @@
             }
             //the inference for NoOutputPriorPicsFlag
+            // KJS: This cannot happen at the encoder
             if (!m_bFirst && pcSlice->isIRAP() && pcSlice->getNoRaslOutputFlag())
             {
@@ -2492,20 +2438,4 @@
   assert (m_iGopSize > 0);
   
-  return;
-}
-
-Void TEncGOP::xInitGOP( Int iPOCLast, Int iNumPicRcvd, TComList<TComPic*>& rcListPic, TComList<TComPicYuv*>& rcListPicYuvRecOut )
-{
-  assert( iNumPicRcvd > 0 );
-  //  Exception for the first frame
-  if ( iPOCLast == 0 )
-  {
-    m_iGopSize    = 1;
-  }
-  else
-    m_iGopSize    = m_pcCfg->getGOPSize();
-  
-  assert (m_iGopSize > 0); 
-
   return;
 }
Index: trunk/source/Lib/TLibEncoder/TEncGOP.h
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncGOP.h	(revision 1067)
+++ trunk/source/Lib/TLibEncoder/TEncGOP.h	(revision 1084)
@@ -116,7 +116,7 @@
 #endif
 #endif
-#if MTK_LOW_LATENCY_IC_ENCODING_H0086_FIX
-  Int *m_aICEnableCandidate; 
-  Int *m_aICEnableNum; 
+#if H_3D_IC
+  Int*                    m_aICEnableCandidate; 
+  Int*                    m_aICEnableNum; 
 #endif
   //--Adaptive Loop filter
@@ -200,5 +200,4 @@
 
   Void xInitGOP( Int iPOCLast, Int iNumPicRcvd, TComList<TComPic*>& rcListPic, TComList<TComPicYuv*>& rcListPicYuvRecOut, bool isField );
-  Void  xInitGOP          ( Int iPOC, Int iNumPicRcvd, TComList<TComPic*>& rcListPic, TComList<TComPicYuv*>& rcListPicYuvRecOut );
   Void  xGetBuffer        ( TComList<TComPic*>& rcListPic, TComList<TComPicYuv*>& rcListPicYuvRecOut, Int iNumPicRcvd, Int iTimeOffset, TComPic*& rpcPic, TComPicYuv*& rpcPicYuvRecOut, Int pocCurr, bool isField );
   
Index: trunk/source/Lib/TLibEncoder/TEncSbac.cpp
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncSbac.cpp	(revision 1067)
+++ trunk/source/Lib/TLibEncoder/TEncSbac.cpp	(revision 1084)
@@ -58,5 +58,5 @@
 , m_cCUSplitFlagSCModel       ( 1,             1,               NUM_SPLIT_FLAG_CTX            , m_contextModels + m_numContextModels, m_numContextModels )
 , m_cCUSkipFlagSCModel        ( 1,             1,               NUM_SKIP_FLAG_CTX             , m_contextModels + m_numContextModels, m_numContextModels)
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
 , m_cCUSingleDepthFlagSCModel        ( 1,             1,               NUM_SINGLEDEPTH_FLAG_CTX             , m_contextModels + m_numContextModels, m_numContextModels)
 , m_cSingleDepthValueSCModel         ( 1,             1,               NUM_SINGLE_DEPTH_VALUE_DATA_CTX      , m_contextModels + m_numContextModels, m_numContextModels)
@@ -134,5 +134,5 @@
   
   m_cCUSkipFlagSCModel.initBuffer        ( eSliceType, iQp, (UChar*)INIT_SKIP_FLAG );
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
   m_cCUSingleDepthFlagSCModel.initBuffer        ( eSliceType, iQp, (UChar*)INIT_SINGLEDEPTH_FLAG );
   m_cSingleDepthValueSCModel.initBuffer         ( eSliceType, iQp, (UChar*)INIT_SINGLE_DEPTH_VALUE_DATA );
@@ -214,5 +214,5 @@
       curCost  = m_cCUSplitFlagSCModel.calcCost       ( curSliceType, qp, (UChar*)INIT_SPLIT_FLAG );
       curCost += m_cCUSkipFlagSCModel.calcCost        ( curSliceType, qp, (UChar*)INIT_SKIP_FLAG );
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
       curCost += m_cCUSingleDepthFlagSCModel.calcCost        ( curSliceType, qp, (UChar*)INIT_SINGLEDEPTH_FLAG );
       curCost += m_cSingleDepthValueSCModel.calcCost         ( curSliceType, qp, (UChar*)INIT_SINGLE_DEPTH_VALUE_DATA );
@@ -255,9 +255,5 @@
       curCost += m_CUTransquantBypassFlagSCModel.calcCost( curSliceType, qp, (UChar*)INIT_CU_TRANSQUANT_BYPASS_FLAG );
 #if H_3D_DIM
-#if SEPARATE_FLAG_I0085
     if( m_pcSlice->getVpsDepthModesFlag() || m_pcSlice->getIVPFlag() )
-#else
-    if( m_pcSlice->getVpsDepthModesFlag() )
-#endif
     {
       curCost += m_cDepthIntraModeSCModel.calcCost    ( curSliceType, qp, (UChar*)INIT_DEPTH_INTRA_MODE );
@@ -291,5 +287,5 @@
   
   m_cCUSkipFlagSCModel.initBuffer        ( eSliceType, iQp, (UChar*)INIT_SKIP_FLAG );
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
   m_cCUSingleDepthFlagSCModel.initBuffer        ( eSliceType, iQp, (UChar*)INIT_SINGLEDEPTH_FLAG );
   m_cSingleDepthValueSCModel.initBuffer         ( eSliceType, iQp, (UChar*)INIT_SINGLE_DEPTH_VALUE_DATA );
@@ -454,5 +450,5 @@
   m_pcBinIf->encodeBinsEP( bins, numBins );
 }
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
 Void TEncSbac::codeSingleDepthMode( TComDataCU* pcCU, UInt uiAbsPartIdx )
 {
@@ -462,5 +458,5 @@
   {
     UInt uiUnaryIdx = (UInt) pcCU->getSingleDepthValue(uiAbsPartIdx);
-    UInt uiNumCand = MTK_SINGLE_DEPTH_MODE_CANDIDATE_LIST_SIZE;
+    UInt uiNumCand = SINGLE_DEPTH_MODE_CAND_LIST_SIZE;
     if ( uiNumCand > 1 )
     {
@@ -563,92 +559,4 @@
 
 #endif
-
-#if !FIX_TICKET_76
-#if H_3D_DIM_SDC
-Void TEncSbac::xCodeSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment )
-{
-  assert( pcCU->getSlice()->getIsDepth() );
-  assert( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N );
-  assert( pcCU->getSDCFlag(uiAbsPartIdx) );
-  assert( uiSegment < 2 );
-  
-  Pel segmentDCOffset = pcCU->getSDCSegmentDCOffset(uiSegment, uiAbsPartIdx);
-  
-  UInt uiResidual = segmentDCOffset == 0 ? 0 : 1;
-  UInt uiSign     = segmentDCOffset < 0 ? 1 : 0;
-  UInt uiAbsIdx   = abs(segmentDCOffset);
-
-#if H_3D_DIM_DLT
-  UInt uiMaxResidualBits = pcCU->getSlice()->getPPS()->getDLT()->getBitsPerDepthValue( pcCU->getSlice()->getLayerIdInVps() );
-#else
-  UInt uiMaxResidualBits = g_bitDepthY;
-#endif
-  assert( uiMaxResidualBits <= g_bitDepthY );
-  
-  // residual flag
-  m_pcBinIf->encodeBin( uiResidual, m_cSDCResidualFlagSCModel.get( 0, 0, 0 ) );
-#if H_MV_ENC_DEC_TRAC
-  DTRACE_CU("sdc_residual_flag[i]", uiResidual)
-#endif  
-  
-  if (uiResidual)
-  {
-    // encode sign bit of residual
-    m_pcBinIf->encodeBinEP( uiSign );
-#if H_MV_ENC_DEC_TRAC
-    DTRACE_CU("sdc_residual_sign_flag[i]", uiSign)
-#endif
-#if H_3D_DIM_DLT    
-    UInt uiNumDepthValues = pcCU->getSlice()->getPPS()->getDLT()->getNumDepthValues( pcCU->getSlice()->getLayerIdInVps() );
-#else
-    UInt uiNumDepthValues = ((1 << g_bitDepthY)-1);
-#endif
-
-    assert(uiAbsIdx <= uiNumDepthValues);
-    
-    // encode residual magnitude
-    uiAbsIdx -= 1;
-
-#if H_MV_ENC_DEC_TRAC
-    DTRACE_CU("sdc_residual_abs_minus1[i]", uiAbsIdx)
-#endif
-
-    // prefix part
-    if ( uiAbsIdx == 0 )
-    {
-      m_pcBinIf->encodeBin( 0, m_cSDCResidualSCModel.get(0, 0, 0) );
-    }
-    else
-    {
-      UInt l = uiAbsIdx;
-      UInt k = 0;
-      UInt uiPrefixThreshold = ((uiNumDepthValues * 3) >> 2);
-      while ( l > 0 && k < uiPrefixThreshold )
-      {
-        m_pcBinIf->encodeBin( 1, m_cSDCResidualSCModel.get(0, 0, 0) );
-        l--;
-        k++;
-      }
-      if ( uiAbsIdx < uiPrefixThreshold )
-      {
-        m_pcBinIf->encodeBin( 0, m_cSDCResidualSCModel.get(0, 0, 0) );
-      }      
-      else
-      { // suffix part
-        uiAbsIdx -= uiPrefixThreshold;
-        UInt uiSuffixLength = numBitsForValue(uiNumDepthValues - uiPrefixThreshold);
-        UInt uiBitInfo = 0;
-        for ( Int i = 0; i < uiSuffixLength; i++)
-        {
-          uiBitInfo = ( uiAbsIdx & ( 1 << i ) ) >> i;
-          m_pcBinIf->encodeBinEP( uiBitInfo);
-        }
-      }
-    }
-    
-  }
-}
-#endif
-#endif
 #endif
 
@@ -717,10 +625,6 @@
   PartSize eSize         = pcCU->getPartitionSize( uiAbsPartIdx );
 #if H_3D_QTLPC
-#if MTK_I0099_VPS_EX2
   TComVPS *vps           = pcCU->getPic()->getSlice(0)->getVPS();
   Bool    bLimQtPredFlag = vps->getLimQtPredFlag(pcCU->getPic()->getSlice(0)->getLayerId());
-#else
-  TComSPS *sps           = pcCU->getPic()->getSlice(0)->getSPS();
-#endif
   TComPic *pcTexture     = pcCU->getSlice()->getTexturePic();
   Bool bDepthMapDetect   = (pcTexture != NULL);
@@ -731,12 +635,9 @@
   Bool depthDependent = false;
   UInt uiTexturePart = eSize;
-#if MTK_I0099_VPS_EX2
-#if LGE_FCO_I0116
+
+#if H_3D_FCO
   if(bDepthMapDetect && !bIntraSliceDetect && !rapPic && pcCU->getPic()->getReduceBitsFlag() && bLimQtPredFlag && pcTexture->getReconMark())
 #else
   if(bDepthMapDetect && !bIntraSliceDetect && !rapPic && pcCU->getPic()->getReduceBitsFlag() && bLimQtPredFlag )
-#endif
-#else
-  if(bDepthMapDetect && !bIntraSliceDetect && !rapPic && pcCU->getPic()->getReduceBitsFlag() && sps->getUseQTL() && sps->getUsePC() )
 #endif
   {
@@ -1097,10 +998,6 @@
   Bool bCodeSplitFlag    = true;
 
-#if MTK_I0099_VPS_EX2
   TComVPS *vps           = pcCU->getPic()->getSlice(0)->getVPS();
   Bool    bLimQtPredFlag = vps->getLimQtPredFlag(pcCU->getPic()->getSlice(0)->getLayerId());
-#else
-  TComSPS *sps           = pcCU->getPic()->getSlice(0)->getSPS();
-#endif
   TComPic *pcTexture     = pcCU->getSlice()->getTexturePic();
   Bool bDepthMapDetect   = (pcTexture != NULL);
@@ -1109,12 +1006,8 @@
   Bool rapPic     = (pcCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || pcCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP || pcCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA);
 
-#if MTK_I0099_VPS_EX2
-#if LGE_FCO_I0116
+#if H_3D_FCO
   if(bDepthMapDetect && !bIntraSliceDetect && !rapPic && pcCU->getPic()->getReduceBitsFlag() && bLimQtPredFlag && pcTexture->getReconMark() )
 #else
   if(bDepthMapDetect && !bIntraSliceDetect && !rapPic && pcCU->getPic()->getReduceBitsFlag() && bLimQtPredFlag  )
-#endif
-#else
-  if(bDepthMapDetect && !bIntraSliceDetect && !rapPic && pcCU->getPic()->getReduceBitsFlag() && sps->getUseQTL() && sps->getUsePC())
 #endif
   {
@@ -1167,9 +1060,5 @@
     dir[j] = pcCU->getLumaIntraDir( absPartIdx+partOffset*j );
 #if H_3D_DIM
-#if SEPARATE_FLAG_I0085
     if( pcCU->getSlice()->getVpsDepthModesFlag() ||  pcCU->getSlice()->getIVPFlag() )
-#else
-    if( pcCU->getSlice()->getVpsDepthModesFlag() )
-#endif
     {
       codeIntraDepth( pcCU, absPartIdx+partOffset*j );
@@ -1317,12 +1206,8 @@
     }
     //mode coding
-#if SEPARATE_FLAG_I0085
     if( pcCU->getSlice()->getVpsDepthModesFlag() && pcCU->getSlice()->getIVPFlag())
     {
       m_pcBinIf->encodeBin( uiCodeIdx == 0 ? 0 : 1, m_cDepthIntraModeSCModel.get( 0, 0, 0 ) );
     }
-#else
-    m_pcBinIf->encodeBin( uiCodeIdx == 0 ? 0 : 1, m_cDepthIntraModeSCModel.get( 0, 0, 0 ) );
-#endif
   }
 }
@@ -2368,24 +2253,9 @@
   }
 
-#if HS_DMM_SIGNALLING_I0120
   UInt uiNumSegments = isDimMode( pcCU->getLumaIntraDir( absPartIdx ) ) ? 2 : 1;
   UInt dimDeltaDC = 1;
-#else
-  UInt uiNumSegments = 0;
-  UInt dimDeltaDC = 0;
-#endif
-
-#if HS_DMM_SIGNALLING_I0120
+
   if( pcCU->isIntra( absPartIdx ) && pcCU->getSDCFlag( absPartIdx ))
   {
-#else
-  if( pcCU->isIntra( absPartIdx ) )
-  {
-    UInt dir     = pcCU->getLumaIntraDir( absPartIdx );
-    uiNumSegments = isDimMode( dir ) ? 2 : 1;
-
-    if( pcCU->getSDCFlag( absPartIdx ) )
-    {
-#endif
       if( uiNumSegments == 1 )
       {
@@ -2396,20 +2266,6 @@
         dimDeltaDC = ( pcCU->getSDCSegmentDCOffset( 0, absPartIdx ) || pcCU->getSDCSegmentDCOffset( 1, absPartIdx ) ) ? 1 : 0;
       }
-#if !HS_DMM_SIGNALLING_I0120
-    }
-    else
-    {
-      dimDeltaDC = isDimDeltaDC( dir );
-    }
-#endif
     m_pcBinIf->encodeBin( dimDeltaDC, m_cDdcFlagSCModel.get( 0, 0, 0 ) );
   }
-#if !HS_DMM_SIGNALLING_I0120
-  else //all-zero inter SDC is not allowed
-  {
-    uiNumSegments = 1;
-    dimDeltaDC = 1;
-  }
-#endif
 
   if( dimDeltaDC )
@@ -2447,8 +2303,6 @@
 Void TEncSbac::codeDBBPFlag( TComDataCU* pcCU, UInt uiAbsPartIdx )
 {
-#if SEC_DBBP_EXPLICIT_SIG_I0077
   PartSize ePartSize = pcCU->getPartitionSize( uiAbsPartIdx );
   AOF( ePartSize == SIZE_2NxN || ePartSize == SIZE_Nx2N );
-#endif
   AOF( pcCU->getSlice()->getVPS()->getUseDBBP(pcCU->getSlice()->getLayerIdInVps()) );
   AOF( !pcCU->getSlice()->getIsDepth() );
Index: trunk/source/Lib/TLibEncoder/TEncSbac.h
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncSbac.h	(revision 1067)
+++ trunk/source/Lib/TLibEncoder/TEncSbac.h	(revision 1084)
@@ -130,9 +130,4 @@
   Void  xCodeDmm1WedgeIdx    ( UInt uiTabIdx, Int iNumBit );
 #endif
-#if !FIX_TICKET_76
-#if H_3D_DIM_SDC
-  Void  xCodeSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment );
-#endif
-#endif
 #endif
   
@@ -155,5 +150,5 @@
   Void codeCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx );
   Void codeSkipFlag      ( TComDataCU* pcCU, UInt uiAbsPartIdx );
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
   Void codeSingleDepthMode( TComDataCU* pcCU, UInt uiAbsPartIdx );
 #endif
@@ -224,5 +219,5 @@
   ContextModel3DBuffer m_cCUSplitFlagSCModel;
   ContextModel3DBuffer m_cCUSkipFlagSCModel;
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
   ContextModel3DBuffer m_cCUSingleDepthFlagSCModel;
   ContextModel3DBuffer m_cSingleDepthValueSCModel;
Index: trunk/source/Lib/TLibEncoder/TEncSearch.cpp
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncSearch.cpp	(revision 1067)
+++ trunk/source/Lib/TLibEncoder/TEncSearch.cpp	(revision 1084)
@@ -915,5 +915,5 @@
         }
         m_pcEntropyCoder->encodeSkipFlag( pcCU, 0, true );
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
         m_pcEntropyCoder->encodeSingleDepthMode(pcCU, 0, true );
         if(!pcCU->getSingleDepthFlag(uiAbsPartIdx))
@@ -921,5 +921,5 @@
         m_pcEntropyCoder->encodePredMode( pcCU, 0, true );
       }
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
       else
       {
@@ -927,5 +927,5 @@
       }
 #endif      
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
       if(!pcCU->getSingleDepthFlag(uiAbsPartIdx))
       {
@@ -945,9 +945,9 @@
         }
       }
-#if MTK_SINGLE_DEPTH_MODE_I0095
-    }
-#endif
-    }
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
+    }
+#endif
+    }
+#if H_3D_SINGLE_DEPTH
       if(!pcCU->getSingleDepthFlag(uiAbsPartIdx))
       {
@@ -995,5 +995,5 @@
     }
   }
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
     }
 #endif
@@ -1859,5 +1859,5 @@
   dRDCost  += dSingleCost;
 }
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
 Void TEncSearch::xIntraCodingSingleDepth( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, Int iTestDepthIdx, Pel *DepthNeighbor )
 {
@@ -1970,16 +1970,8 @@
       UInt dimType   = getDimType  ( uiLumaPredMode );
       UInt patternID = pcCU->getDmmWedgeTabIdx(dimType, uiAbsPartIdx);
-#if SHARP_DMM1_I0110
       UInt uiBaseWidth = pcCU->isDMM1UpscaleMode(uiWidth) ? pcCU->getDMM1BasePatternWidth(uiWidth) : uiWidth;
       if ( patternID >= g_dmmWedgeLists[g_aucConvertToBit[uiBaseWidth]].size() && dimType == DMM1_IDX )
-#else
-      if ( patternID >= g_dmmWedgeLists[g_aucConvertToBit[uiWidth]].size() && dimType == DMM1_IDX )
-#endif
-      {
-#if SHARP_DMM1_I0110
+      {
         if (g_aucConvertToBit[uiBaseWidth] == 2) // Encoder method. Avoid DMM1 pattern list index exceeds the maximum DMM1 pattern number when SDC split is used.
-#else
-        if (g_aucConvertToBit[uiWidth] == 2) // Encoder method. Avoid DMM1 pattern list index exceeds the maximum DMM1 pattern number when SDC split is used.
-#endif
         {                                    
           patternID = 1349;  // Split 32x32 to 16x16. 1349: Maximum DMM1 pattern number when block size is 16x16
@@ -2043,19 +2035,10 @@
     Int uiTabIdx = pcCU->getDmmWedgeTabIdx(DMM1_IDX, uiAbsPartIdx);
 
-#if SHARP_DMM1_I0110
     WedgeList* pacWedgeList  = pcCU->isDMM1UpscaleMode( uiWidth ) ? &g_dmmWedgeLists[(g_aucConvertToBit[pcCU->getDMM1BasePatternWidth(uiWidth)])] : &g_dmmWedgeLists[(g_aucConvertToBit[uiWidth])];
-#else
-    WedgeList* pacWedgeList = &g_dmmWedgeLists[(g_aucConvertToBit[uiWidth])];
-#endif
     TComWedgelet* pcWedgelet = &(pacWedgeList->at( uiTabIdx ));
 
     uiNumSegments = 2;
-#if SHARP_DMM1_I0110
     pbMask       = pcCU->isDMM1UpscaleMode( uiWidth ) ? pcWedgelet->getScaledPattern( uiWidth ) : pcWedgelet->getPattern();
     uiMaskStride = pcCU->isDMM1UpscaleMode( uiWidth ) ? uiWidth : pcWedgelet->getStride();
-#else
-    pbMask = pcWedgelet->getPattern();
-    uiMaskStride = pcWedgelet->getStride();
-#endif
   }
   if( getDimType( uiLumaPredMode ) == DMM4_IDX )
@@ -2878,5 +2861,5 @@
   pcCU->setChromIntraDirSubParts( uiBestMode, 0, pcCU->getDepth( 0 ) );
 }
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
 Void 
 TEncSearch::estIntraPredSingleDepth( TComDataCU* pcCU, 
@@ -2900,5 +2883,5 @@
   Pel DepthNeighbours[5];
   //construction of depth candidates
-  for( Int i = 0; (i < 5)  && (index<MTK_SINGLE_DEPTH_MODE_CANDIDATE_LIST_SIZE) ; i++ )
+  for( Int i = 0; (i < 5)  && (index<SINGLE_DEPTH_MODE_CAND_LIST_SIZE) ; i++ )
   {
     if(!pcCU->getNeighDepth (0, 0, &testDepth, i))
@@ -2983,5 +2966,5 @@
                             UInt&       ruiDistC,
                             Bool        bLumaOnly
-#if HHI_DMM4_ENC_I0066
+#if H_3D_DIM
                           , Bool        bOnlyIVP
 #endif
@@ -3032,5 +3015,5 @@
     Int numModesForFullRD = g_aucIntraModeNumFast[ uiWidthBit ];
     
-#if HHI_DMM4_ENC_I0066
+#if H_3D_DIM
     if( bOnlyIVP )
     {
@@ -3080,5 +3063,4 @@
         UInt   iModeBits = xModeBitsIntra( pcCU, uiMode, uiPU, uiPartOffset, uiDepth, uiInitTrDepth );
 #if H_3D_VSO // M35
-#if H_3D_VSO_FIX // This fix should be enabled after verification 
         Double dLambda;
         if ( m_pcRdCost->getUseLambdaScaleVSO() )
@@ -3092,7 +3074,4 @@
 
         Double cost      = (Double)uiSad + (Double)iModeBits * dLambda;
-#else
-        Double cost      = (Double)uiSad + (Double)iModeBits * m_pcRdCost->getSqrtLambda();
-#endif
 #else
         Double cost      = (Double)uiSad + (Double)iModeBits * m_pcRdCost->getSqrtLambda();
@@ -3135,5 +3114,5 @@
       }
     }
-#if HHI_DMM4_ENC_I0066
+#if H_3D_DIM
     }
 #endif
@@ -3143,10 +3122,5 @@
     if( m_pcEncCfg->getIsDepth() && uiWidth >= DIM_MIN_SIZE && uiWidth <= DIM_MAX_SIZE && uiWidth == uiHeight )
     {
-#if HHI_DMM4_ENC_I0066
-#if SEPARATE_FLAG_I0085
       if( bOnlyIVP && m_pcEncCfg->getUseIVP() )
-#else
-      if( bOnlyIVP )
-#endif
       {
         TComWedgelet* dmm4Segmentation = new TComWedgelet( uiWidth, uiHeight );
@@ -3158,16 +3132,9 @@
         pcCU->setDimDeltaDC( DMM4_IDX, 1, uiPartOffset, deltaDC2 );
 
-#if HS_DMM_SIGNALLING_I0120
         uiRdModeList[ numModesForFullRD++ ] = (DMM4_IDX+DIM_OFFSET);
-#else
-        uiRdModeList[ numModesForFullRD++ ] = (2*DMM4_IDX  +DIM_OFFSET);
-        if( deltaDC1 != 0 || deltaDC2 != 0 )
-          uiRdModeList[ numModesForFullRD++ ] = (2*DMM4_IDX+1+DIM_OFFSET);
-#endif
         dmm4Segmentation->destroy(); delete dmm4Segmentation;
       }
       else
       {
-#endif
 #if H_3D_FAST_DEPTH_INTRA
       Int  threshold    = max(((pcCU->getQP(0))>>3)-1,3);
@@ -3177,9 +3144,5 @@
 
 #if H_3D_DIM_DMM
-#if SEPARATE_FLAG_I0085
       if( ( m_pcEncCfg->getUseDMM() || m_pcEncCfg->getUseIVP() )
-#else
-      if( m_pcEncCfg->getUseDMM()
-#endif
 #if H_3D_FAST_DEPTH_INTRA
          && (uiRdModeList[0] != PLANAR_IDX || varCU >= varThreshold)
@@ -3187,5 +3150,4 @@
         )
       {
-#if SEPARATE_FLAG_I0085
         UInt uiStart, uiEnd;
         if( m_pcEncCfg->getUseDMM() &&  m_pcEncCfg->getUseIVP() )
@@ -3210,11 +3172,8 @@
         }
         for( UInt dmmType = uiStart; dmmType < uiEnd; dmmType++ )
-#else
-        for( UInt dmmType = 0; dmmType < DMM_NUM_TYPE; dmmType++ )
-#endif
         {
 #if H_3D_FCO
             TComPic* picTexture  = pcCU->getSlice()->getIvPic(false, pcCU->getSlice()->getViewIndex() );
-#if LGE_FCO_I0116
+#if H_3D_FCO
             if ( !picTexture->getReconMark() && (DMM4_IDX == dmmType ) )
 #else
@@ -3234,10 +3193,6 @@
               xSearchDmm1Wedge( pcCU, uiPartOffset, piOrg, uiStride, uiWidth, uiHeight, uiTabIdx );
               pcCU->setDmmWedgeTabIdxSubParts( uiTabIdx, dmmType,  uiPartOffset, uiDepth + uiInitTrDepth );
-#if SHARP_DMM1_I0110
               biSegmentation = pcCU->isDMM1UpscaleMode( uiWidth ) ? 
                   &(g_dmmWedgeLists[(g_aucConvertToBit[pcCU->getDMM1BasePatternWidth(uiWidth)])][uiTabIdx]) : &(g_dmmWedgeLists[(g_aucConvertToBit[uiWidth])][uiTabIdx]);
-#else
-              biSegmentation = &(g_dmmWedgeLists[(g_aucConvertToBit[uiWidth])][uiTabIdx]);
-#endif
             } break;
 
@@ -3254,5 +3209,4 @@
           if( biSegmentation )
           {
-#if SHARP_DMM1_I0110
             if( dmmType == DMM1_IDX && pcCU->isDMM1UpscaleMode( uiWidth ) ){
                 xSearchDmmDeltaDCs( pcCU, uiPartOffset, piOrg, piPred, uiStride, biSegmentation->getScaledPattern(uiWidth), uiWidth, uiWidth, uiHeight, deltaDC1, deltaDC2 );
@@ -3262,25 +3216,13 @@
                 xSearchDmmDeltaDCs( pcCU, uiPartOffset, piOrg, piPred, uiStride, biSegmentation->getPattern(), biSegmentation->getStride(), uiWidth, uiHeight, deltaDC1, deltaDC2 );
             }
-#else
-            xSearchDmmDeltaDCs( pcCU, uiPartOffset, piOrg, piPred, uiStride, biSegmentation->getPattern(), biSegmentation->getStride(), uiWidth, uiHeight, deltaDC1, deltaDC2 );
-#endif
             pcCU->setDimDeltaDC( dmmType, 0, uiPartOffset, deltaDC1 );
             pcCU->setDimDeltaDC( dmmType, 1, uiPartOffset, deltaDC2 );
 
-#if HS_DMM_SIGNALLING_I0120
             uiRdModeList[ numModesForFullRD++ ] = (dmmType  +DIM_OFFSET);
-#else
-            uiRdModeList[ numModesForFullRD++ ] = (2*dmmType  +DIM_OFFSET);
-#if HHI_DMM4_ENC_I0066
-            if( deltaDC1 != 0 || deltaDC2 != 0 )
-#endif
-            uiRdModeList[ numModesForFullRD++ ] = (2*dmmType+1+DIM_OFFSET);
-#endif
-
             if( DMM4_IDX == dmmType ) { biSegmentation->destroy(); delete biSegmentation; }
           }
         }
       }
-#if HHI_DMM4_ENC_I0066
+#if H_3D_DIM
       }
 #endif
@@ -3295,5 +3237,5 @@
     
     UInt    uiBestPUMode  = 0;
-#if SCU_HS_FAST_INTRA_SDC_I0123
+#if H_3D_FAST_INTRA_SDC
     UInt    uiBestPUModeConv  = 0;
     UInt    uiSecondBestPUModeConv  = 0;
@@ -3309,5 +3251,5 @@
     Double  dBestPUCost   = MAX_DOUBLE;
 
-#if SCU_HS_FAST_INTRA_SDC_I0123
+#if H_3D_FAST_INTRA_SDC
     Double  dBestPUCostConv   = MAX_DOUBLE;
     UInt varCU      = m_pcRdCost->calcVAR(piOrg, uiStride, uiWidth,uiHeight,pcCU->getDepth(0));
@@ -3319,5 +3261,5 @@
     Pel     apBestDCOffsets[2] = {0,0};
 #endif
-#if SCU_HS_FAST_INTRA_SDC_I0123
+#if H_3D_FAST_INTRA_SDC
     for( UInt uiMode = 0; uiMode < numModesForFullRD + rdSDC; uiMode++ )
 #else
@@ -3326,9 +3268,9 @@
     {
       // set luma prediction mode
-#if !SCU_HS_FAST_INTRA_SDC_I0123
+#if !H_3D_FAST_INTRA_SDC
      UInt uiOrgMode = uiRdModeList[uiMode];  
 #endif
       
-#if SCU_HS_FAST_INTRA_SDC_I0123
+#if H_3D_FAST_INTRA_SDC
       UInt uiOrgMode;
       if (uiMode < numModesForFullRD)
@@ -3356,5 +3298,5 @@
       
 #if H_3D_DIM_SDC
-#if SCU_HS_FAST_INTRA_SDC_I0123
+#if H_3D_FAST_INTRA_SDC
       Bool bTestSDC = ( m_pcEncCfg->getUseSDC() && pcCU->getSDCAvailable(uiPartOffset) && uiMode >= numModesForFullRD);
 #else
@@ -3364,16 +3306,11 @@
       for( UInt uiSDC=0; uiSDC<=(bTestSDC?1:0); uiSDC++ )
       {
-#if SCU_HS_FAST_INTRA_SDC_I0123
+#if H_3D_FAST_INTRA_SDC
         if (!uiSDC && uiMode >= numModesForFullRD) continue;
 #endif
         pcCU->setSDCFlagSubParts( (uiSDC != 0), uiPartOffset, uiDepth + uiInitTrDepth );
-#if FAST_SDC_OFFSET_DECISION_I0084
         Double dOffsetCost[3] = {MAX_DOUBLE,MAX_DOUBLE,MAX_DOUBLE};
         for( Int iOffset = 1; iOffset <= 5; iOffset++ )
-#else
-        for( Int iSDCDeltaResi = -2; iSDCDeltaResi <= 2; iSDCDeltaResi++ )
-#endif
-        {
-#if FAST_SDC_OFFSET_DECISION_I0084
+        {
           Int iSDCDeltaResi = 0;
           if(iOffset % 2 == 0)
@@ -3385,10 +3322,8 @@
             iSDCDeltaResi = -1 * (iOffset >> 1);
           }
-#endif
           if( ( uiSDC == 0 ) && iSDCDeltaResi != 0 )
           {
             continue;
           }
-#if FAST_SDC_OFFSET_DECISION_I0084
           if( iOffset > 3)
           {
@@ -3407,5 +3342,4 @@
           }
 #endif
-#endif
       
 #if H_3D_DIM_ENC || H_3D_DIM_SDC
@@ -3452,10 +3386,8 @@
           // start encoding with SDC
           xIntraCodingSDC(pcCU, uiPartOffset, pcOrgYuv, pcPredYuv, uiPUDistY, dPUCost, ( testZeroResi != 0 ), iSDCDeltaResi );
-#if FAST_SDC_OFFSET_DECISION_I0084
           if ( testZeroResi == 0 && iOffset <= 3 )
           {
             dOffsetCost [iOffset -1] = dPUCost;
           }
-#endif
         }
         else
@@ -3465,5 +3397,5 @@
 #if H_3D_DIM_ENC
           xRecurIntraCodingQT( pcCU, uiInitTrDepth, uiPartOffset, bLumaOnly, pcOrgYuv, pcPredYuv, pcResiYuv, uiPUDistY, uiPUDistC, true, dPUCost, (testZeroResi != 0) );
-#if SCU_HS_FAST_INTRA_SDC_I0123    
+#if H_3D_FAST_INTRA_SDC    
       if( dPUCost < dBestPUCostConv )
       {
@@ -4017,7 +3949,4 @@
 #if H_3D_VSP
                                  , Int* vspFlag
-#if !FIX_TICKET_79
-                                 , InheritedVSPDisInfo*  inheritedVSPDisInfo
-#endif
 #endif
 #if H_3D_SPIVMP
@@ -4079,7 +4008,4 @@
       pcCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours, numValidMergeCand);
       pcCU->xGetInterMergeCandidates( 0, 0, cMvFieldNeighbours,uhInterDirNeighbours
-#if H_3D_VSP && !FIX_TICKET_79
-                                        , inheritedVSPDisInfo
-#endif
 #if H_3D_SPIVMP
         , pcMvFieldSP, puhInterDirSP
@@ -4109,7 +4035,4 @@
     pcCU->getInterMergeCandidates( uiAbsPartIdx, iPUIdx, cMvFieldNeighbours,uhInterDirNeighbours, numValidMergeCand);
     pcCU->xGetInterMergeCandidates( uiAbsPartIdx, iPUIdx, cMvFieldNeighbours, uhInterDirNeighbours
-#if H_3D_VSP && !FIX_TICKET_79
-                                      , inheritedVSPDisInfo
-#endif
 #if H_3D_SPIVMP
       , pcMvFieldSP, puhInterDirSP
@@ -4132,9 +4055,5 @@
 #endif
   }
-#if H_3D_VSP && !FIX_TICKET_75
-  xRestrictBipredMergeCand( pcCU, iPUIdx, cMvFieldNeighbours, uhInterDirNeighbours,vspFlag, numValidMergeCand );
-#else
   xRestrictBipredMergeCand( pcCU, iPUIdx, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand );
-#endif
 
 #if H_3D_DBBP
@@ -4164,7 +4083,4 @@
 #if H_3D_VSP
     pcCU->setVSPFlagSubParts( vspFlag[uiMergeCand], uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) );
-#if !FIX_TICKET_79
-    pcCU->setDvInfoSubParts(inheritedVSPDisInfo[uiMergeCand].m_acDvInfo, uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) );
-#endif
 #endif
 
@@ -4266,9 +4182,5 @@
  * \returns Void
  */
-#if H_3D_VSP && !FIX_TICKET_75
-Void TEncSearch::xRestrictBipredMergeCand( TComDataCU* pcCU, UInt puIdx, TComMvField* mvFieldNeighbours, UChar* interDirNeighbours, Int* vspFlag, Int numValidMergeCand )
-#else
 Void TEncSearch::xRestrictBipredMergeCand( TComDataCU* pcCU, UInt puIdx, TComMvField* mvFieldNeighbours, UChar* interDirNeighbours, Int numValidMergeCand )
-#endif
 {
   if ( pcCU->isBipredRestriction(puIdx) )
@@ -4276,9 +4188,5 @@
     for( UInt mergeCand = 0; mergeCand < numValidMergeCand; ++mergeCand )
     {
-#if H_3D_VSP && !FIX_TICKET_75
-      if ( (interDirNeighbours[mergeCand] == 3) && (vspFlag[mergeCand] == false) )
-#else
       if ( interDirNeighbours[mergeCand] == 3 )
-#endif
       {
         interDirNeighbours[mergeCand] = 1;
@@ -4902,7 +4810,4 @@
       Int vspFlag[MRG_MAX_NUM_CANDS_MEM];
       memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM);
-#if !FIX_TICKET_79
-      InheritedVSPDisInfo inheritedVSPDisInfo[MRG_MAX_NUM_CANDS_MEM];
-#endif
       UInt uiAbsPartIdx = 0;
       Int iWidth = 0;
@@ -4922,7 +4827,4 @@
 #if H_3D_VSP
                       , vspFlag
-#if !FIX_TICKET_79
-                      , inheritedVSPDisInfo
-#endif
 #endif
 #if H_3D_SPIVMP
@@ -4938,7 +4840,4 @@
 #if H_3D_VSP
         pcCU->setVSPFlagSubParts( vspFlag[uiMRGIndex], uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) );
-#if !FIX_TICKET_79
-        pcCU->setDvInfoSubParts(inheritedVSPDisInfo[uiMRGIndex].m_acDvInfo, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) );
-#endif
 #endif
 #if H_3D_DDD
@@ -6430,11 +6329,15 @@
     if( bCodeChroma )
     {
+      m_pcRDGoOnSbacCoder->load( m_pppcRDSbacCoder[ uiDepth ][ CI_QT_TRAFO_ROOT ] );
+      m_pcEntropyCoder->resetBits();
         m_pcEntropyCoder->encodeQtCbf   ( pcCU, uiAbsPartIdx, TEXT_CHROMA_U, uiTrMode );
       m_pcEntropyCoder->encodeCoeffNxN( pcCU, pcCoeffCurrU, uiAbsPartIdx, trWidthC, trHeightC, uiDepth, TEXT_CHROMA_U );
-      uiSingleBitsU = m_pcEntropyCoder->getNumberOfWrittenBits() - uiSingleBitsY;
+      uiSingleBitsU = m_pcEntropyCoder->getNumberOfWrittenBits();
       
+      m_pcRDGoOnSbacCoder->load( m_pppcRDSbacCoder[ uiDepth ][ CI_QT_TRAFO_ROOT ] );
+      m_pcEntropyCoder->resetBits();
         m_pcEntropyCoder->encodeQtCbf   ( pcCU, uiAbsPartIdx, TEXT_CHROMA_V, uiTrMode );
       m_pcEntropyCoder->encodeCoeffNxN( pcCU, pcCoeffCurrV, uiAbsPartIdx, trWidthC, trHeightC, uiDepth, TEXT_CHROMA_V );
-      uiSingleBitsV = m_pcEntropyCoder->getNumberOfWrittenBits() - ( uiSingleBitsY + uiSingleBitsU );
+      uiSingleBitsV = m_pcEntropyCoder->getNumberOfWrittenBits();
     }
     
@@ -6517,4 +6420,6 @@
         const Double singleCostY = m_pcRdCost->calcRdCost( uiSingleBitsY, uiNonzeroDistY );
 #endif
+        m_pcRDGoOnSbacCoder->load( m_pppcRDSbacCoder[ uiDepth ][ CI_QT_TRAFO_ROOT ] );
+
         m_pcEntropyCoder->resetBits();
         m_pcEntropyCoder->encodeQtCbfZero( pcCU, TEXT_LUMA,     uiTrMode );
@@ -6550,4 +6455,5 @@
     else if( checkTransformSkipY )
     {
+      m_pcRDGoOnSbacCoder->load( m_pppcRDSbacCoder[ uiDepth ][ CI_QT_TRAFO_ROOT ] );
       m_pcEntropyCoder->resetBits();
       m_pcEntropyCoder->encodeQtCbfZero( pcCU, TEXT_LUMA, uiTrMode );
@@ -6606,4 +6512,5 @@
         {
           const Double dSingleCostU = m_pcRdCost->calcRdCost( uiSingleBitsU, uiNonzeroDistU );
+          m_pcRDGoOnSbacCoder->load( m_pppcRDSbacCoder[ uiDepth ][ CI_QT_TRAFO_ROOT ] );
           m_pcEntropyCoder->resetBits();
           m_pcEntropyCoder->encodeQtCbfZero( pcCU, TEXT_CHROMA_U,     uiTrMode );
@@ -6631,4 +6538,5 @@
       else if( checkTransformSkipUV )
       {
+        m_pcRDGoOnSbacCoder->load( m_pppcRDSbacCoder[ uiDepth ][ CI_QT_TRAFO_ROOT ] );
         m_pcEntropyCoder->resetBits();
         m_pcEntropyCoder->encodeQtCbfZero( pcCU, TEXT_CHROMA_U, uiTrMode );
@@ -6675,4 +6583,5 @@
         {
           const Double dSingleCostV = m_pcRdCost->calcRdCost( uiSingleBitsV, uiNonzeroDistV );
+          m_pcRDGoOnSbacCoder->load( m_pppcRDSbacCoder[ uiDepth ][ CI_QT_TRAFO_ROOT ] );
           m_pcEntropyCoder->resetBits();
           m_pcEntropyCoder->encodeQtCbfZero( pcCU, TEXT_CHROMA_V,     uiTrMode );
@@ -6700,4 +6609,5 @@
       else if( checkTransformSkipUV )
       {
+        m_pcRDGoOnSbacCoder->load( m_pppcRDSbacCoder[ uiDepth ][ CI_QT_TRAFO_ROOT ] );
         m_pcEntropyCoder->resetBits();
         m_pcEntropyCoder->encodeQtCbfZero( pcCU, TEXT_CHROMA_V, uiTrMode );
@@ -6896,5 +6806,4 @@
       pcCU->setCbfSubParts( uiAbsSumTransformSkipV ? uiSetCbf : 0, TEXT_CHROMA_V, uiAbsPartIdx, pcCU->getDepth(0)+uiTrModeC );
 
-      m_pcEntropyCoder->resetBits();
       uiSingleBitsU = 0;
       uiSingleBitsV = 0;
@@ -6902,4 +6811,5 @@
       if( uiAbsSumTransformSkipU )
       {
+        m_pcEntropyCoder->resetBits();
         m_pcEntropyCoder->encodeQtCbf   ( pcCU, uiAbsPartIdx, TEXT_CHROMA_U, uiTrMode );
         m_pcEntropyCoder->encodeCoeffNxN( pcCU, pcCoeffCurrU, uiAbsPartIdx, trWidthC, trHeightC, uiDepth, TEXT_CHROMA_U );
@@ -6944,7 +6854,9 @@
       if( uiAbsSumTransformSkipV )
       {
+        m_pcRDGoOnSbacCoder->load( m_pppcRDSbacCoder[ uiDepth ][ CI_QT_TRAFO_ROOT ] );
+        m_pcEntropyCoder->resetBits();
         m_pcEntropyCoder->encodeQtCbf   ( pcCU, uiAbsPartIdx, TEXT_CHROMA_V, uiTrMode );
         m_pcEntropyCoder->encodeCoeffNxN( pcCU, pcCoeffCurrV, uiAbsPartIdx, trWidthC, trHeightC, uiDepth, TEXT_CHROMA_V );
-        uiSingleBitsV = m_pcEntropyCoder->getNumberOfWrittenBits() - uiSingleBitsU;
+        uiSingleBitsV = m_pcEntropyCoder->getNumberOfWrittenBits();
 
         curChromaQpOffset = pcCU->getSlice()->getPPS()->getChromaCrQpOffset() + pcCU->getSlice()->getSliceQpDeltaCr();
@@ -7388,5 +7300,5 @@
     }
     m_pcEntropyCoder->encodeSkipFlag ( pcCU, 0, true );
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
     m_pcEntropyCoder->encodeSingleDepthMode ( pcCU, 0, true );
 #endif
@@ -7845,11 +7757,6 @@
 
   Pel refDC1 = 0; Pel refDC2 = 0;
-#if SHARP_DMM1_I0110
   WedgeList*     pacWedgeList     = pcCU->isDMM1UpscaleMode( uiWidth ) ? &g_dmmWedgeLists[(g_aucConvertToBit[pcCU->getDMM1BasePatternWidth(uiWidth)])] : &g_dmmWedgeLists[(g_aucConvertToBit[uiWidth])];
   WedgeNodeList* pacWedgeNodeList = pcCU->isDMM1UpscaleMode( uiWidth ) ? &g_dmmWedgeNodeLists[(g_aucConvertToBit[pcCU->getDMM1BasePatternWidth(uiWidth)])] : &g_dmmWedgeNodeLists[(g_aucConvertToBit[uiWidth])];
-#else
-  WedgeList*     pacWedgeList     = &g_dmmWedgeLists    [(g_aucConvertToBit[uiWidth])];
-  WedgeNodeList* pacWedgeNodeList = &g_dmmWedgeNodeLists[(g_aucConvertToBit[uiWidth])];
-#endif
 
   // coarse wedge search
@@ -7859,13 +7766,8 @@
   {
     TComWedgelet* pcWedgelet = &(pacWedgeList->at(pacWedgeNodeList->at(uiNodeId).getPatternIdx()));
-#if SHARP_DMM1_I0110
     Bool *pbPattern = pcCU->isDMM1UpscaleMode(uiWidth) ? pcWedgelet->getScaledPattern(uiWidth) : pcWedgelet->getPattern();
     UInt uiStride   = pcCU->isDMM1UpscaleMode(uiWidth) ? uiWidth : pcWedgelet->getStride();
     xCalcBiSegDCs  ( piRef,  uiRefStride,  pbPattern, uiStride, refDC1, refDC2 );
     xAssignBiSegDCs( piPred, uiPredStride, pbPattern, uiStride, refDC1, refDC2 );
-#else
-    xCalcBiSegDCs  ( piRef,  uiRefStride,  pcWedgelet->getPattern(), pcWedgelet->getStride(), refDC1, refDC2 );
-    xAssignBiSegDCs( piPred, uiPredStride, pcWedgelet->getPattern(), pcWedgelet->getStride(), refDC1, refDC2 );
-#endif
 
     Dist uiActDist = RDO_DIST_MAX;
@@ -7903,13 +7805,8 @@
     {
       TComWedgelet* pcWedgelet = &(pacWedgeList->at(pacWedgeNodeList->at(uiBestNodeId).getRefineIdx( uiRefId )));
-#if SHARP_DMM1_I0110
       Bool *pbPattern = pcCU->isDMM1UpscaleMode(uiWidth) ? pcWedgelet->getScaledPattern(uiWidth) : pcWedgelet->getPattern();
       UInt uiStride   = pcCU->isDMM1UpscaleMode(uiWidth) ? uiWidth : pcWedgelet->getStride();
       xCalcBiSegDCs  ( piRef,  uiRefStride,  pbPattern, uiStride, refDC1, refDC2 );
       xAssignBiSegDCs( piPred, uiPredStride, pbPattern, uiStride, refDC1, refDC2 );
-#else
-      xCalcBiSegDCs  ( piRef,  uiRefStride,  pcWedgelet->getPattern(), pcWedgelet->getStride(), refDC1, refDC2 );
-      xAssignBiSegDCs( piPred, uiPredStride, pcWedgelet->getPattern(), pcWedgelet->getStride(), refDC1, refDC2 );
-#endif
       Dist uiActDist = RDO_DIST_MAX;
 #if H_3D_VSO
Index: trunk/source/Lib/TLibEncoder/TEncSearch.h
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncSearch.h	(revision 1067)
+++ trunk/source/Lib/TLibEncoder/TEncSearch.h	(revision 1084)
@@ -181,5 +181,5 @@
                                   UInt&       ruiDistC,
                                   Bool        bLumaOnly
-#if HHI_DMM4_ENC_I0066
+#if H_3D_DIM
                                 , Bool        bOnlyIVP
 #endif
@@ -191,5 +191,5 @@
                                   TComYuv*    pcRecoYuv,
                                   UInt        uiPreCalcDistC );
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
   Void  estIntraPredSingleDepth  ( TComDataCU* pcCU, 
                                   TComYuv*    pcOrgYuv, 
@@ -354,5 +354,5 @@
                                     UInt         uiAbsPartIdx,
                                     UInt         stateU0V1Both2 );
-#if MTK_SINGLE_DEPTH_MODE_I0095
+#if H_3D_SINGLE_DEPTH
   Void xIntraCodingSingleDepth( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, Int iTestDepthIdx, Pel * DepthNeighbor );
 #endif
@@ -429,7 +429,4 @@
 #if H_3D_VSP
                                   , Int* vspFlag
-#if !FIX_TICKET_79
-                                  , InheritedVSPDisInfo*  inheritedVSPDisInfo
-#endif
 #endif
 #if H_3D_SPIVMP
@@ -443,7 +440,4 @@
                                     TComMvField*    mvFieldNeighbours, 
                                     UChar*          interDirNeighbours, 
-#if H_3D_VSP && !FIX_TICKET_75
-                                    Int* vspFlag,
-#endif
                                     Int             numValidMergeCand );
 
Index: trunk/source/Lib/TLibEncoder/TEncTop.cpp
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncTop.cpp	(revision 1067)
+++ trunk/source/Lib/TLibEncoder/TEncTop.cpp	(revision 1084)
@@ -72,8 +72,6 @@
   ContextModel::buildNextStateTable();
 #endif
-#if H_MV_HLS10_GEN_FIX
 #if H_MV
   m_iNumSubstreams         = 0; 
-#endif
 #endif
 
@@ -89,5 +87,5 @@
   m_ivPicLists = NULL;
 #endif
-#if MTK_LOW_LATENCY_IC_ENCODING_H0086_FIX
+#if H_3D_IC
   m_aICEnableCandidate = NULL;
   m_aICEnableNum = NULL;
@@ -236,5 +234,4 @@
       for (Int iCIIdx = 0; iCIIdx < CI_NUM; iCIIdx ++ )
       {
-#if H_MV_HLS10_GEN_FIX
 #if H_MV
         xDelete( false, m_pppcRDSbacCoder, iDepth, iCIIdx);
@@ -244,5 +241,4 @@
         delete m_pppcBinCoderCABAC[iDepth][iCIIdx];
 #endif
-#endif
       }
     }
@@ -250,5 +246,4 @@
     for ( iDepth = 0; iDepth < g_uiMaxCUDepth+1; iDepth++ )
     {
-#if H_MV_HLS10_GEN_FIX
 #if H_MV
       xDelete( true, m_pppcRDSbacCoder  , iDepth);
@@ -258,8 +253,6 @@
       delete [] m_pppcBinCoderCABAC[iDepth];
 #endif
-#endif
-    }
-
-#if H_MV_HLS10_GEN_FIX
+    }
+
 #if H_MV
      xDelete( true, m_pppcRDSbacCoder  );
@@ -269,5 +262,4 @@
     delete [] m_pppcBinCoderCABAC;
 #endif
-#endif
     for ( UInt ui = 0; ui < m_iNumSubstreams; ui++ )
     {
@@ -276,5 +268,4 @@
         for (Int iCIIdx = 0; iCIIdx < CI_NUM; iCIIdx ++ )
         {
-#if H_MV_HLS10_GEN_FIX
 #if H_MV
           xDelete(false, m_ppppcRDSbacCoders  ,ui, iDepth, iCIIdx);
@@ -284,5 +275,4 @@
           delete m_ppppcBinCodersCABAC[ui][iDepth][iCIIdx];
 #endif
-#endif
         }
       }
@@ -290,5 +280,4 @@
       for ( iDepth = 0; iDepth < g_uiMaxCUDepth+1; iDepth++ )
       {
-#if H_MV_HLS10_GEN_FIX
 #if H_MV
         xDelete(true, m_ppppcRDSbacCoders  ,ui, iDepth);
@@ -298,9 +287,7 @@
         delete [] m_ppppcBinCodersCABAC[ui][iDepth];
 #endif
-#endif
-      }
-
-
-#if H_MV_HLS10_GEN_FIX
+      }
+
+
 #if H_MV
       xDelete(true, m_ppppcRDSbacCoders,   ui);
@@ -310,7 +297,5 @@
       delete[] m_ppppcBinCodersCABAC[ui];
 #endif
-#endif
-    }
-#if H_MV_HLS10_GEN_FIX
+    }
 #if H_MV
     xDelete(true, m_ppppcRDSbacCoders    ) ;
@@ -332,5 +317,4 @@
   delete[] m_pcRdCosts;
 #endif
-#endif
 
 #if !H_MV
@@ -370,5 +354,5 @@
 
   xInitPPSforTiles();
-#if MTK_LOW_LATENCY_IC_ENCODING_H0086_FIX
+#if H_3D_IC
   m_aICEnableCandidate = new Int[ 10 ];
   m_aICEnableNum = new Int[ 10 ];
@@ -769,5 +753,4 @@
 #if H_MV  
   m_cSPS.setUpdateRepFormatFlag           ( false );    
-#if H_MV_HLS10_MULTILAYERSPS  
   Bool multiLayerExtensionFlag  = ( getLayerId() > 0 ) && ( m_cVPS->getNumRefLayers( getLayerId() ) > 0 ); 
   
@@ -778,8 +761,4 @@
     m_cSPS.setSpsScalingListRefLayerId( m_cVPS->getIdRefLayer( getLayerId(), 0 ) ); 
   }
-#else
-  m_cSPS.setSpsInferScalingListFlag       ( m_layerId > 0 && m_cVPS->getInDirectDependencyFlag( getLayerIdInVps(), 0 ) ); 
-  m_cSPS.setSpsScalingListRefLayerId      ( 0              ); 
-#endif
   m_cSPS.setSpsExtensionPresentFlag       ( true ); 
   m_cSPS.setSpsMultilayerExtensionFlag    ( true ); 
@@ -829,11 +808,4 @@
   m_cSPS.setUseAMP ( m_useAMP );
 
-#if !MTK_I0099_VPS_EX2
-#if H_3D_QTLPC
-  m_cSPS.setUseQTL( m_bUseQTL );
-  m_cSPS.setUsePC ( m_bUsePC  );
-#endif
-#endif
-
   for (i = g_uiMaxCUDepth-g_uiAddCUDepth; i < g_uiMaxCUDepth; i++ )
   {
@@ -863,17 +835,10 @@
     for( Int is = 0; is < targetDecLayerIdList.size(); is++  )
     {
-#if H_MV_HLS10_ADD_LAYERSETS
       if ( m_cVPS->getNecessaryLayerFlag( ols, is ) )
       {      
         m_cSPS.inferSpsMaxDecPicBufferingMinus1( m_cVPS, ols, targetDecLayerIdList[is], true );       
       }
-#else
-      m_cSPS.inferSpsMaxDecPicBufferingMinus1( m_cVPS, ols, targetDecLayerIdList[is], true );       
-#endif
-    }
-  }
-#if !H_MV_HLS10_ADD_LAYERSETS 
-  m_cVPS->inferDbpSizeLayerSetZero( &m_cSPS, true ); 
-#endif
+    }
+  }
 #endif
   m_cSPS.setPCMBitDepthLuma (g_uiPCMBitDepthLuma);
@@ -889,5 +854,5 @@
   {
     TComVUI* pcVUI = m_cSPS.getVuiParameters();
-    pcVUI->setAspectRatioInfoPresentFlag(getAspectRatioIdc() != -1);
+    pcVUI->setAspectRatioInfoPresentFlag(getAspectRatioInfoPresentFlag());
     pcVUI->setAspectRatioIdc(getAspectRatioIdc());
     pcVUI->setSarWidth(getSarWidth());
@@ -1323,17 +1288,16 @@
 Void  TEncTop::xInitPPSforTiles()
 {
-  m_cPPS.setUniformSpacingFlag( m_iUniformSpacingIdr );
-  m_cPPS.setNumColumnsMinus1( m_iNumColumnsMinus1 );
-  m_cPPS.setNumRowsMinus1( m_iNumRowsMinus1 );
-  if( m_iUniformSpacingIdr == 0 )
-  {
-    m_cPPS.setColumnWidth( m_puiColumnWidth );
-    m_cPPS.setRowHeight( m_puiRowHeight );
+  m_cPPS.setTileUniformSpacingFlag( m_tileUniformSpacingFlag );
+  m_cPPS.setNumTileColumnsMinus1( m_iNumColumnsMinus1 );
+  m_cPPS.setNumTileRowsMinus1( m_iNumRowsMinus1 );
+  if( !m_tileUniformSpacingFlag )
+  {
+    m_cPPS.setTileColumnWidth( m_tileColumnWidth );
+    m_cPPS.setTileRowHeight( m_tileRowHeight );
   }
   m_cPPS.setLoopFilterAcrossTilesEnabledFlag( m_loopFilterAcrossTilesEnabledFlag );
 
   // # substreams is "per tile" when tiles are independent.
-  if (m_iWaveFrontSynchro
-    )
+  if (m_iWaveFrontSynchro )
   {
     m_cPPS.setNumSubstreams(m_iWaveFrontSubstreams * (m_iNumColumnsMinus1+1));
@@ -1361,9 +1325,9 @@
   }
 
-  if( m_iNumColumnsMinus1 && m_iUniformSpacingIdr==0 )
+  if( m_iNumColumnsMinus1 && !m_tileUniformSpacingFlag )
   {
     for(Int i=0; i<m_iNumColumnsMinus1; i++)
     {
-      uiCummulativeColumnWidth += m_puiColumnWidth[i];
+      uiCummulativeColumnWidth += m_tileColumnWidth[i];
     }
 
@@ -1388,8 +1352,8 @@
   }
 
-  if( m_iNumRowsMinus1 && m_iUniformSpacingIdr==0 )
+  if( m_iNumRowsMinus1 && !m_tileUniformSpacingFlag )
   {
     for(Int i=0; i<m_iNumRowsMinus1; i++)
-      uiCummulativeRowHeight += m_puiRowHeight[i];
+      uiCummulativeRowHeight += m_tileRowHeight[i];
 
     if( uiCummulativeRowHeight >= iHeightInCU )
Index: trunk/source/Lib/TLibEncoder/TEncTop.h
===================================================================
--- trunk/source/Lib/TLibEncoder/TEncTop.h	(revision 1067)
+++ trunk/source/Lib/TLibEncoder/TEncTop.h	(revision 1084)
@@ -80,5 +80,5 @@
   TComPicLists*           m_ivPicLists;                   ///< access to picture lists of other layers 
 #endif
-#if MTK_LOW_LATENCY_IC_ENCODING_H0086_FIX
+#if H_3D_IC
   Int *m_aICEnableCandidate;
   Int *m_aICEnableNum;
@@ -150,5 +150,4 @@
   Void  xInitPPSforTiles  ();
   Void  xInitRPS          (Bool isFieldCoding);           ///< initialize PPS from encoder options
-#if H_MV_HLS10_GEN_FIX
 #if H_MV
 
@@ -193,5 +192,4 @@
 
 #endif
-#endif
 public:
   TEncTop();
@@ -209,7 +207,7 @@
   TComPicLists* getIvPicLists() { return m_ivPicLists; }
 #endif
-#if MTK_LOW_LATENCY_IC_ENCODING_H0086_FIX
-  Int *getICEnableCandidate() { return m_aICEnableCandidate; }
-  Int *getICEnableNum() { return m_aICEnableNum; }
+#if H_3D_IC
+  Int*      getICEnableCandidate() { return m_aICEnableCandidate; }
+  Int*      getICEnableNum() { return m_aICEnableNum; }
 #endif
   Void      deletePicBuffer ();
@@ -272,5 +270,5 @@
   Void                    setIvPicLists         ( TComPicLists* picLists) { m_ivPicLists = picLists; }
 #endif
-#if MTK_LOW_LATENCY_IC_ENCODING_H0086_FIX
+#if H_3D_IC
   Void                    setICEnableCandidate         ( Int* ICEnableCandidate) { m_aICEnableCandidate = ICEnableCandidate; }
   Void                    setICEnableNum         ( Int* ICEnableNum) { m_aICEnableNum = ICEnableNum; }
Index: trunk/source/Lib/TLibVideoIO/TVideoIOYuv.cpp
===================================================================
--- trunk/source/Lib/TLibVideoIO/TVideoIOYuv.cpp	(revision 1067)
+++ trunk/source/Lib/TLibVideoIO/TVideoIOYuv.cpp	(revision 1084)
@@ -470,4 +470,9 @@
   Bool retval = true;
 
+  if ((width==0)||(height==0))
+  {
+    printf ("\nWarning: writing %d x %d luma sample output picture!", width, height);
+  }
+
   if (m_bitDepthShiftY != 0 || m_bitDepthShiftC != 0)
   {
@@ -563,4 +568,9 @@
   
   Bool retval = true;
+  
+  if ((width==0)||(height==0))
+  {
+    printf ("\nWarning: writing %d x %d luma sample output picture!", width, height);
+  }
   
   if (m_bitDepthShiftY != 0 || m_bitDepthShiftC != 0)
