Index: trunk/source/Lib/TLibCommon/ContextTables.h
===================================================================
--- trunk/source/Lib/TLibCommon/ContextTables.h	(revision 873)
+++ trunk/source/Lib/TLibCommon/ContextTables.h	(revision 884)
@@ -94,17 +94,9 @@
 
 #if H_3D_ARP
-#if MTK_ARP_FLAG_CABAC_SIMP_G0061
 #define NUM_ARPW_CTX                  3       ///< number of context models for weighting factor index used by advanced residual prediction
-#else
-#define NUM_ARPW_CTX                  4       ///< number of context models for weighting factor index used by advanced residual prediction
-#endif
 #endif
 
 #if H_3D_IC
-#if MTK_IC_FLAG_CABAC_SIMP_G0061
 #define NUM_IC_FLAG_CTX               1       ///< number of context models for illumination compensation flag
-#else
-#define NUM_IC_FLAG_CTX               3       ///< number of context models for illumination compensation flag
-#endif
 #endif
 
@@ -112,9 +104,5 @@
 
 #if H_3D_DIM
-#if QC_GENERIC_SDC_G0122
 #define NUM_DEPTH_INTRA_MODE_CTX      1       ///< number of context models for depth intra modes
-#else
-#define NUM_DEPTH_INTRA_MODE_CTX      8       ///< number of context models for depth intra modes
-#endif
 #define NUM_DDC_FLAG_CTX              2       ///< number of context models for deltaDC flag (DMM or RBC)
 #define NUM_DDC_DATA_CTX              1       ///< number of context models for deltaDC data (DMM or RBC)
@@ -122,24 +110,10 @@
 #define NUM_DMM1_DATA_CTX             1       ///< number of context models for DMM1 data
 #endif
-#if QC_GENERIC_SDC_G0122
 #define NUM_ANGLE_FLAG_CTX            3
-#if !QC_SDC_UNIFY_G0130
-#define NUM_INTRASDC_FLAG_CTX         3
-#endif
-#endif
 #endif
 
 #if H_3D_DIM_SDC
-#define SDC_NUM_RESIDUAL_FLAG_CTX        1
-#define SDC_NUM_RESIDUAL_CTX             1
-#endif
-
-#if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
-#define NUM_INTER_SDC_FLAG_CTX        1      ///< number of context models for inter SDC flag
-#define NUM_INTER_SDC_SIGN_FLAG_CTX   1      ///< number of context models for sign of inter SDC residual
-#define NUM_INTER_SDC_RESIDUAL_CTX    1      ///< number of context models for abs of inter SDC residual
-#endif
-
-#if QC_SDC_UNIFY_G0130
+#define SDC_NUM_RESIDUAL_FLAG_CTX     1
+#define SDC_NUM_RESIDUAL_CTX          1
 #define NUM_SDC_FLAG_CTX              1      ///< number of context 
 #endif
@@ -366,5 +340,4 @@
 
 #if H_3D_ARP
-#if MTK_ARP_FLAG_CABAC_SIMP_G0061
 static const UChar 
 INIT_ARPW[3][NUM_ARPW_CTX] = 
@@ -374,16 +347,7 @@
     { 162, 153, 162 },
 };
-#else
-static const UChar 
-INIT_ARPW[3][NUM_ARPW_CTX] = 
-{
-    { 162, 153, 154, 162 },
-    { 162, 153, 154, 162 },
-    { 162, 153, 154, 162 },
-};
-#endif
+
 #endif
 #if H_3D_IC
-#if MTK_IC_FLAG_CABAC_SIMP_G0061
 static const UChar 
 INIT_IC_FLAG[3][NUM_IC_FLAG_CTX] =  
@@ -393,16 +357,7 @@
     { 154 },
 };
-#else
-static const UChar 
-INIT_IC_FLAG[3][NUM_IC_FLAG_CTX] =  
-{
-    { 154,  154,  154, },
-    { 154,  154,  154, },
-    { 154,  154,  154, },
-};
-#endif
+
 #endif
 #if H_3D_DIM
-#if QC_GENERIC_SDC_G0122
 static const UChar
 INIT_DEPTH_INTRA_MODE[3][NUM_DEPTH_INTRA_MODE_CTX] =
@@ -412,15 +367,5 @@
   { 154, }
 };
-#else
-static const UChar
-INIT_DEPTH_INTRA_MODE[3][NUM_DEPTH_INTRA_MODE_CTX] =
-{
-    {0,  0,  64, 168, 168, 124, CNU, 0},
-    {0, 64,   0, 183, CNU, 108,   0, 0},
-    {64, 0, CNU, CNU, 168, 109,   0, 0}
-};
-#endif
-
-#if QC_GENERIC_SDC_G0122
+
 static const UChar 
 INIT_ANGLE_FLAG[3][NUM_ANGLE_FLAG_CTX] =
@@ -430,14 +375,4 @@
   { 155, 170, 157 },
 };
-#if !QC_SDC_UNIFY_G0130
-static const UChar 
-INIT_INTRASDC_FLAG[3][NUM_INTRASDC_FLAG_CTX] =
-{
-  { 214, 229, 230 },
-  { 215, 202, 174 },
-  { 213, 201, 246 },
-};
-#endif
-#endif
 
 static const UChar 
@@ -482,31 +417,7 @@
 #endif
 
-#if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
-static const UChar 
-INIT_INTER_SDC_FLAG[3][NUM_INTER_SDC_FLAG_CTX] =
-{
-  { CNU },  
-  { 154 },
-  { 154 },
-};
-
-static const UChar 
-INIT_INTER_SDC_SIGN_FLAG[3][NUM_INTER_SDC_SIGN_FLAG_CTX] =
-{
-  { CNU },  
-  { 154 },
-  { 154 },
-};
-
-static const UChar 
-INIT_INTER_SDC_RESIDUAL[3][NUM_INTER_SDC_RESIDUAL_CTX] =
-{
-  { CNU },  
-  { 154 },
-  { 154 },
-};
-#endif
+
 //! \}
-#if QC_SDC_UNIFY_G0130
+#if H_3D_DIM_SDC
 static const UChar 
 INIT_SDC_FLAG[3][NUM_SDC_FLAG_CTX] =
Index: trunk/source/Lib/TLibCommon/SEI.h
===================================================================
--- trunk/source/Lib/TLibCommon/SEI.h	(revision 873)
+++ trunk/source/Lib/TLibCommon/SEI.h	(revision 884)
@@ -72,5 +72,5 @@
     SCALABLE_NESTING                     = 133,
     REGION_REFRESH_INFO                  = 134,
-#if H_MV_HLS_7_SEI_P0204_26
+#if H_MV
     SUB_BITSTREAM_PROPERTY               = 139,    // Final PayloadType to be defined after finalization
 #endif
@@ -366,5 +366,5 @@
 };
 
-#if H_MV_HLS_7_SEI_P0204_26
+#if H_MV
 class SEISubBitstreamProperty : public SEI
 {
Index: trunk/source/Lib/TLibCommon/TComDataCU.cpp
===================================================================
--- trunk/source/Lib/TLibCommon/TComDataCU.cpp	(revision 873)
+++ trunk/source/Lib/TLibCommon/TComDataCU.cpp	(revision 884)
@@ -123,13 +123,6 @@
 #if H_3D_DIM_SDC
   m_pbSDCFlag             = NULL;
-#if QC_SDC_UNIFY_G0130 && !SEC_INTER_SDC_G0101
-  for( Int i = 0; i < 4; i++ )
-  {
-    m_apSegmentDCOffset[i]  = NULL;
-  }
-#else
   m_apSegmentDCOffset[0]  = NULL;
   m_apSegmentDCOffset[1]  = NULL;
-#endif
 #endif
 #endif
@@ -153,14 +146,4 @@
 #endif
 #if H_3D_INTER_SDC
-#if !QC_SDC_UNIFY_G0130
-  m_pbInterSDCFlag       = NULL;
-  for( Int i = 0; i < 4; i++ )
-  {
-    m_apSegmentInterDCOffset[i] = NULL;
-  }
-#endif
-#if !SEC_INTER_SDC_G0101
-  m_pucInterSDCMask       = NULL;
-#endif
 #endif
 #if H_3D_DBBP
@@ -168,5 +151,5 @@
 #endif
 
-#if MTK_DDD_G0063
+#if H_3D_DDD
   m_pucDisparityDerivedDepth = NULL;
   m_pbUseDDD = NULL;
@@ -291,22 +274,8 @@
 #if H_3D_DIM_SDC
     m_pbSDCFlag             = (Bool*)xMalloc(Bool, uiNumPartition);
-#if QC_SDC_UNIFY_G0130 && !SEC_INTER_SDC_G0101
-    for( Int i = 0; i < 4; i++ )
-    {
-      m_apSegmentDCOffset[i]  = (Pel*)xMalloc(Pel, uiNumPartition);
-    }
-#else
     m_apSegmentDCOffset[0]  = (Pel*)xMalloc(Pel, uiNumPartition);
     m_apSegmentDCOffset[1]  = (Pel*)xMalloc(Pel, uiNumPartition);
 #endif
 #endif
-#endif
-#if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
-    m_pbInterSDCFlag     = (Bool*  )xMalloc(Bool,   uiNumPartition);
-    for( Int i = 0; i < 4; i++ )
-    {
-      m_apSegmentInterDCOffset[i] = (Int*)xMalloc(Int, uiNumPartition);
-    }
-#endif
 #if H_3D_DBBP
     m_pbDBBPFlag         = (Bool*  )xMalloc(Bool,   uiNumPartition);
@@ -318,9 +287,4 @@
     m_acCUMvField[1].setNumPartition(uiNumPartition );
   }
-#if !SEC_INTER_SDC_G0101
-#if H_3D_INTER_SDC
-  m_pucInterSDCMask     = (UChar*  )xMalloc(UChar,    g_uiMaxCUHeight*g_uiMaxCUWidth);
-#endif
-#endif
   m_sliceStartCU        = (UInt*  )xMalloc(UInt, uiNumPartition);
   m_sliceSegmentStartCU = (UInt*  )xMalloc(UInt, uiNumPartition);
@@ -329,5 +293,5 @@
   m_pcPattern            = (TComPattern*)xMalloc(TComPattern, 1);
   
-#if MTK_DDD_G0063
+#if H_3D_DDD
   m_pucDisparityDerivedDepth         = (UChar*  )xMalloc( UChar,  uiNumPartition);
   m_pbUseDDD                         = (Bool*  ) xMalloc( Bool,   uiNumPartition);
@@ -413,5 +377,5 @@
 #endif
 
-#if MTK_DDD_G0063
+#if H_3D_DDD
     if ( m_pucDisparityDerivedDepth ) { xFree(m_pucDisparityDerivedDepth);          m_pucDisparityDerivedDepth        = NULL; }
     if ( m_pbUseDDD                 ) { xFree(m_pbUseDDD);                          m_pbUseDDD                        = NULL; }
@@ -441,31 +405,12 @@
 #if H_3D_DIM_SDC
     if ( m_pbSDCFlag            ) { xFree(m_pbSDCFlag);             m_pbSDCFlag             = NULL; }
-#if QC_SDC_UNIFY_G0130 && !SEC_INTER_SDC_G0101
-    for( Int i = 0; i < 4; i++ )
-    {
-      if ( m_apSegmentDCOffset[i] ) { xFree(m_apSegmentDCOffset[i]);  m_apSegmentDCOffset[i]  = NULL; }
-    }
-#else
     if ( m_apSegmentDCOffset[0] ) { xFree(m_apSegmentDCOffset[0]);  m_apSegmentDCOffset[0]  = NULL; }
     if ( m_apSegmentDCOffset[1] ) { xFree(m_apSegmentDCOffset[1]);  m_apSegmentDCOffset[1]  = NULL; }
-#endif
 #endif    
 #endif    
-#if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
-    if ( m_pbInterSDCFlag     ) { xFree(m_pbInterSDCFlag);      m_pbInterSDCFlag    = NULL; }
-    for(Int i = 0; i < 4; i++ )
-    {
-      if ( m_apSegmentInterDCOffset[i] ) { xFree( m_apSegmentInterDCOffset[i] ); m_apSegmentInterDCOffset[i] = NULL; }
-  }
-#endif
 #if H_3D_DBBP
     if ( m_pbDBBPFlag         ) { xFree(m_pbDBBPFlag);          m_pbDBBPFlag        = NULL; }
 #endif
   }
-#if !SEC_INTER_SDC_G0101
-#if H_3D_INTER_SDC
-  if ( m_pucInterSDCMask     ) { xFree(m_pucInterSDCMask);      m_pucInterSDCMask    = NULL; }
-#endif
-#endif
   m_pcCUAboveLeft       = NULL;
   m_pcCUAboveRight      = NULL;
@@ -560,5 +505,5 @@
 #endif
 
-#if MTK_DDD_G0063
+#if H_3D_DDD
     m_pucDisparityDerivedDepth[ui] = pcFrom->m_pucDisparityDerivedDepth[ui];
     m_pbUseDDD[ui] = pcFrom->m_pbUseDDD[ui];
@@ -593,7 +538,4 @@
 #if H_3D_DIM_SDC
     m_pbSDCFlag[ui] = pcFrom->m_pbSDCFlag[ui];
-#endif
-#if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
-    m_pbInterSDCFlag[ui] = pcFrom->m_pbInterSDCFlag[ui];
 #endif
 #if H_3D_DBBP
@@ -646,5 +588,5 @@
 #endif
 
-#if MTK_DDD_G0063
+#if H_3D_DDD
     memset( m_pucDisparityDerivedDepth        + firstElement, 0,           numElements * sizeof( *m_pucDisparityDerivedDepth ) );
     memset( m_pbUseDDD                        + firstElement, 0,           numElements * sizeof( *m_pbUseDDD ) );
@@ -665,21 +607,7 @@
 #if H_3D_DIM_SDC
     memset( m_pbSDCFlag             + firstElement,     0,                numElements * sizeof( *m_pbSDCFlag            ) );
-#if QC_SDC_UNIFY_G0130 && !SEC_INTER_SDC_G0101
-    for( Int i = 0; i < 4; i++ )
-    {
-      memset( m_apSegmentDCOffset[i]  + firstElement,     0,                numElements * sizeof( *m_apSegmentDCOffset[i] ) );
-    }
-#else
     memset( m_apSegmentDCOffset[0]  + firstElement,     0,                numElements * sizeof( *m_apSegmentDCOffset[0] ) );
     memset( m_apSegmentDCOffset[1]  + firstElement,     0,                numElements * sizeof( *m_apSegmentDCOffset[1] ) );
 #endif
-#endif
-#endif
-#if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
-    memset( m_pbInterSDCFlag   + firstElement,     0,                    numElements * sizeof( *m_pbInterSDCFlag ) );
-    for( Int i = 0; i < 4; i++ )
-    {
-      memset( m_apSegmentInterDCOffset[i] + firstElement,     0,         numElements * sizeof( *m_apSegmentInterDCOffset[i] ) );
-    }
 #endif
 #if H_3D_DBBP
@@ -834,5 +762,5 @@
 #endif
 
-#if MTK_DDD_G0063
+#if H_3D_DDD
       m_pucDisparityDerivedDepth[ui] = 0;
       m_pbUseDDD[ui] = 0;
@@ -853,21 +781,7 @@
 #if H_3D_DIM_SDC
       m_pbSDCFlag           [ui] = false;
-#if QC_SDC_UNIFY_G0130 && !SEC_INTER_SDC_G0101
-      for( Int i = 0; i < 4; i++ )
-      {
-        m_apSegmentDCOffset[i][ui] = 0;
-      }
-#else
       m_apSegmentDCOffset[0][ui] = 0;
       m_apSegmentDCOffset[1][ui] = 0;
 #endif
-#endif
-#endif
-#if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
-      m_pbInterSDCFlag[ui] = false;
-      for( Int i = 0; i < 4; i++ )
-      {
-        m_apSegmentInterDCOffset[i][ui] = 0;
-      }
 #endif
 #if H_3D_DBBP
@@ -955,5 +869,5 @@
 #endif
 
-#if MTK_DDD_G0063
+#if H_3D_DDD
   memset( m_pucDisparityDerivedDepth,         0, iSizeInUchar );
   memset( m_pbUseDDD,                         0, iSizeInBool );
@@ -982,21 +896,7 @@
 #if H_3D_DIM_SDC
   memset( m_pbSDCFlag,            0, sizeof(Bool) * m_uiNumPartition  );
-#if QC_SDC_UNIFY_G0130 && !SEC_INTER_SDC_G0101
-  for( Int i = 0; i < 4; i++ )
-  {
-    memset( m_apSegmentDCOffset[i], 0, sizeof(Pel) * m_uiNumPartition   );
-  }
-#else
   memset( m_apSegmentDCOffset[0], 0, sizeof(Pel) * m_uiNumPartition   );
   memset( m_apSegmentDCOffset[1], 0, sizeof(Pel) * m_uiNumPartition   );
 #endif
-#endif
-#endif
-#if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
-  memset( m_pbInterSDCFlag,           0, sizeof( Bool ) * m_uiNumPartition );
-  for( Int i = 0; i < 4; i++ )
-  {
-    memset( m_apSegmentInterDCOffset[i], 0, sizeof( Int ) * m_uiNumPartition );
-  }
 #endif
 #if H_3D_DBBP
@@ -1056,5 +956,5 @@
 #endif
 
-#if MTK_DDD_G0063
+#if H_3D_DDD
       m_pucDisparityDerivedDepth[ui] = pcCU->m_pucDisparityDerivedDepth[uiPartOffset+ui];
       m_pbUseDDD[ui]                 = pcCU->m_pbUseDDD[uiPartOffset+ui];
@@ -1075,21 +975,7 @@
 #if H_3D_DIM_SDC
       m_pbSDCFlag           [ui] = pcCU->m_pbSDCFlag            [ uiPartOffset + ui ];
-#if QC_SDC_UNIFY_G0130 && !SEC_INTER_SDC_G0101
-      for( Int i = 0; i < 4; i++ )
-      {
-        m_apSegmentDCOffset[i][ui] = pcCU->m_apSegmentDCOffset[i] [ uiPartOffset + ui ];
-      }
-#else
       m_apSegmentDCOffset[0][ui] = pcCU->m_apSegmentDCOffset[0] [ uiPartOffset + ui ];
       m_apSegmentDCOffset[1][ui] = pcCU->m_apSegmentDCOffset[1] [ uiPartOffset + ui ];
 #endif
-#endif
-#endif
-#if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
-      m_pbInterSDCFlag      [ui] = pcCU->m_pbInterSDCFlag    [ uiPartOffset + ui ];
-      for( Int i = 0; i < 4; i++ )
-      {
-        m_apSegmentInterDCOffset[i][ui] = pcCU->m_apSegmentInterDCOffset[i][ uiPartOffset + ui ];
-      }
 #endif
 #if H_3D_DBBP
@@ -1216,5 +1102,5 @@
 #endif
 
-#if MTK_DDD_G0063
+#if H_3D_DDD
   m_pucDisparityDerivedDepth          = pcCU->getDDDepth()        + uiPart;
   m_pbUseDDD                          = pcCU->getUseDDD()         + uiPart;
@@ -1246,22 +1132,8 @@
 #if H_3D_DIM_SDC
   m_pbSDCFlag               = pcCU->getSDCFlag()              + uiPart;
-#if QC_SDC_UNIFY_G0130 && !SEC_INTER_SDC_G0101
-  for( Int i = 0; i < 4; i++ )
-  {
-    m_apSegmentDCOffset[i]    = pcCU->getSDCSegmentDCOffset(i)  + uiPart;
-  }
-#else
   m_apSegmentDCOffset[0]    = pcCU->getSDCSegmentDCOffset(0)  + uiPart;
   m_apSegmentDCOffset[1]    = pcCU->getSDCSegmentDCOffset(1)  + uiPart;
-#endif
 #endif  
 #endif  
-#if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
-  m_pbInterSDCFlag          = pcCU->getInterSDCFlag()       + uiPart;
-  for( Int i = 0; i < 4; i++ )
-  {
-    m_apSegmentInterDCOffset[i] = pcCU->getInterSDCSegmentDCOffset( i ) + uiPart;
-  }
-#endif
 #if H_3D_DBBP
   m_pbDBBPFlag              = pcCU->getDBBPFlag()         + uiPart;
@@ -1380,5 +1252,5 @@
 #endif
 
-#if MTK_DDD_G0063
+#if H_3D_DDD
   m_pucDisparityDerivedDepth         = pcCU->getDDDepth()              + uiAbsPartIdx;
   m_pbUseDDD                         = pcCU->getUseDDD()              + uiAbsPartIdx;
@@ -1445,5 +1317,5 @@
   memcpy( m_puhCbf[2] + uiOffset, pcCU->getCbf(TEXT_CHROMA_V), iSizeInUchar );
   
-#if MTK_DDD_G0063
+#if H_3D_DDD
   memcpy( m_pucDisparityDerivedDepth          + uiOffset, pcCU->getDDDepth(),         iSizeInUchar );
   memcpy( m_pbUseDDD                          + uiOffset, pcCU->getUseDDD(),          iSizeInBool );
@@ -1465,21 +1337,7 @@
 #if H_3D_DIM_SDC
   memcpy( m_pbSDCFlag             + uiOffset, pcCU->getSDCFlag(),             iSizeInBool  );
-#if QC_SDC_UNIFY_G0130 && !SEC_INTER_SDC_G0101
-  for( Int i = 0; i < 4; i++ )
-  {
-    memcpy( m_apSegmentDCOffset[i]  + uiOffset, pcCU->getSDCSegmentDCOffset(i), sizeof( Pel ) * uiNumPartition);
-  }
-#else
   memcpy( m_apSegmentDCOffset[0]  + uiOffset, pcCU->getSDCSegmentDCOffset(0), sizeof( Pel ) * uiNumPartition);
   memcpy( m_apSegmentDCOffset[1]  + uiOffset, pcCU->getSDCSegmentDCOffset(1), sizeof( Pel ) * uiNumPartition);
 #endif
-#endif
-#endif
-#if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
-  memcpy( m_pbInterSDCFlag  + uiOffset, pcCU->getInterSDCFlag(),      iSizeInBool  );
-  for( Int i = 0; i < 4; i++ )
-  {
-    memcpy( m_apSegmentInterDCOffset[i] + uiOffset, pcCU->getInterSDCSegmentDCOffset( i ), sizeof( Int ) * uiNumPartition);
-  }
 #endif
 #if H_3D_DBBP
@@ -1559,5 +1417,5 @@
 #endif
 
-#if MTK_DDD_G0063
+#if H_3D_DDD
   memcpy( rpcCU->getDDDepth()          + m_uiAbsIdxInLCU, m_pucDisparityDerivedDepth,         iSizeInUchar  );
   memcpy( rpcCU->getUseDDD()           + m_uiAbsIdxInLCU, m_pbUseDDD,                         iSizeInBool  );
@@ -1602,21 +1460,7 @@
 #if H_3D_DIM_SDC
   memcpy( rpcCU->getSDCFlag()             + m_uiAbsIdxInLCU, m_pbSDCFlag,      iSizeInBool  );
-#if QC_SDC_UNIFY_G0130 && !SEC_INTER_SDC_G0101
-  for( Int i = 0; i < 4; i++ )
-  {
-    memcpy( rpcCU->getSDCSegmentDCOffset(i) + m_uiAbsIdxInLCU, m_apSegmentDCOffset[i], sizeof( Pel ) * m_uiNumPartition);
-  }
-#else
   memcpy( rpcCU->getSDCSegmentDCOffset(0) + m_uiAbsIdxInLCU, m_apSegmentDCOffset[0], sizeof( Pel ) * m_uiNumPartition);
   memcpy( rpcCU->getSDCSegmentDCOffset(1) + m_uiAbsIdxInLCU, m_apSegmentDCOffset[1], sizeof( Pel ) * m_uiNumPartition);
 #endif
-#endif
-#endif
-#if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
-  memcpy( rpcCU->getInterSDCFlag() + m_uiAbsIdxInLCU, m_pbInterSDCFlag,      iSizeInBool  );
-  for( Int i = 0;i < 4; i++ )
-  {
-    memcpy( rpcCU->getInterSDCSegmentDCOffset( i ) + m_uiAbsIdxInLCU, m_apSegmentInterDCOffset[i], sizeof( Int ) * m_uiNumPartition);
-  }
 #endif
 #if H_3D_DBBP
@@ -1707,5 +1551,5 @@
   memcpy( rpcCU->getCbf(TEXT_CHROMA_V) + uiPartOffset, m_puhCbf[2], iSizeInUchar );
   
-#if MTK_DDD_G0063
+#if H_3D_DDD
   memcpy( rpcCU->getDDDepth()          + uiPartOffset, m_pucDisparityDerivedDepth,         iSizeInUchar );
   memcpy( rpcCU->getUseDDD()           + uiPartOffset, m_pbUseDDD,                         iSizeInBool );
@@ -1726,21 +1570,7 @@
 #if H_3D_DIM_SDC
   memcpy( rpcCU->getSDCFlag()             + uiPartOffset, m_pbSDCFlag,      iSizeInBool  );
-#if QC_SDC_UNIFY_G0130 && !SEC_INTER_SDC_G0101
-  for( Int i = 0; i < 4; i++ )
-  {
-    memcpy( rpcCU->getSDCSegmentDCOffset(i) + uiPartOffset, m_apSegmentDCOffset[i], sizeof( Pel ) * uiQNumPart);
-  }
-#else
   memcpy( rpcCU->getSDCSegmentDCOffset(0) + uiPartOffset, m_apSegmentDCOffset[0], sizeof( Pel ) * uiQNumPart);
   memcpy( rpcCU->getSDCSegmentDCOffset(1) + uiPartOffset, m_apSegmentDCOffset[1], sizeof( Pel ) * uiQNumPart);
 #endif
-#endif
-#endif
-#if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
-  memcpy( rpcCU->getInterSDCFlag() + uiPartOffset, m_pbInterSDCFlag,      iSizeInBool  );
-  for( Int i = 0; i < 4; i++ )
-  {
-    memcpy( rpcCU->getInterSDCSegmentDCOffset( i ) + uiPartOffset, m_apSegmentInterDCOffset[i], sizeof( Int ) * uiQNumPart);
-  }
 #endif
 #if H_3D_DBBP
@@ -1791,5 +1621,5 @@
 }
 
-#if MTK_DDD_G0063
+#if H_3D_DDD
 Void TComDataCU::setDDDepthSubParts ( UChar ucDDD, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth )
 {
@@ -2463,30 +2293,6 @@
   pcTempCU = getPULeft( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx );
   uiCtx    = ( pcTempCU ) ? ((pcTempCU->getARPW( uiTempPartIdx )==0)?0:1) : 0;
-  
-#if !MTK_ARP_FLAG_CABAC_SIMP_G0061        
-  pcTempCU = getPUAbove( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx );
-  uiCtx   += ( pcTempCU ) ? ((pcTempCU->getARPW( uiTempPartIdx )==0)?0:1): 0;
-#endif
-  return uiCtx;
-}
-#endif
-#if !MTK_IC_FLAG_CABAC_SIMP_G0061
-#if H_3D_IC
-UInt TComDataCU::getCtxICFlag( UInt uiAbsPartIdx )
-{
-  UInt        uiCtx = 0;
-
-  TComDataCU* pcTempCU = NULL;
-  UInt        uiTempPartIdx = 0;
-
-  pcTempCU = getPULeft( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx );
-  uiCtx    = ( pcTempCU ) ? pcTempCU->isIC( uiTempPartIdx ) : 0;
-
-  pcTempCU = getPUAbove( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx );
-  uiCtx    += ( pcTempCU ) ? pcTempCU->isIC( uiTempPartIdx ) : 0;
-
-  return uiCtx;
-}
-#endif
+    return uiCtx;
+}
 #endif
 #if H_3D_DBBP
@@ -2569,137 +2375,8 @@
 #endif
 
-#if H_3D_INTER_SDC
-#if !QC_SDC_UNIFY_G0130
-Void TComDataCU::setInterSDCFlagSubParts ( Bool bInterSDCFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth )
-{
-  setSubPart( bInterSDCFlag, m_pbInterSDCFlag, uiAbsPartIdx, uiDepth, uiPartIdx );
-}
-
-UInt TComDataCU::getCtxInterSDCFlag( UInt uiAbsPartIdx )
+#if H_3D_DIM_SDC
+UInt TComDataCU::getCtxSDCFlag( UInt uiAbsPartIdx )
 {
   return 0;
-}
-#endif
-
-#if !SEC_INTER_SDC_G0101
-Void TComDataCU::xSetInterSDCCUMask( TComDataCU *pcCU, UChar *pMask )
-{
-  UInt  uiWidth      = pcCU->getWidth ( 0 );
-  UInt  uiHeight     = pcCU->getHeight( 0 );
-  UInt  uiPartitionSize = pcCU->getPartitionSize( 0 );
-  UInt  uiXOffset = 0, uiYOffset = 0;
-
-  switch( uiPartitionSize )
-  {
-  case SIZE_2NxN:
-    uiXOffset = uiWidth;      uiYOffset = uiHeight >> 1;   break;
-  case SIZE_2NxnU:
-    uiXOffset = uiWidth;      uiYOffset = uiHeight >> 2;   break;
-  case SIZE_2NxnD: 
-    uiXOffset = uiWidth;      uiYOffset = ( uiHeight >> 1 ) + ( uiHeight >> 2 );   break;
-  case SIZE_Nx2N:
-    uiXOffset = uiWidth >> 1; uiYOffset = uiHeight; break;
-  case SIZE_nLx2N:
-    uiXOffset = uiWidth >> 2; uiYOffset = uiHeight; break;
-  case SIZE_nRx2N:
-    uiXOffset = ( uiWidth >> 1 ) + ( uiWidth >> 2 ); uiYOffset = uiHeight; break;
-  case SIZE_NxN:
-    uiXOffset = uiWidth >> 1; uiYOffset = uiHeight >> 1;  break;
-  default:
-    assert( uiPartitionSize == SIZE_2Nx2N );
-    uiXOffset = uiWidth;     uiYOffset = uiHeight;    break;
-  }
-
-  UInt uiPelX, uiPelY;
-
-  memset( pMask, 0, uiWidth*uiHeight );
-
-  //mask
-  if( uiPartitionSize == SIZE_2NxN || uiPartitionSize == SIZE_2NxnD || uiPartitionSize == SIZE_2NxnU )
-  {
-    for( uiPelY = 0; uiPelY < uiYOffset; uiPelY++ )
-    {
-      for( uiPelX = 0; uiPelX < uiWidth; uiPelX++ )
-      {
-        pMask[uiPelX + uiPelY*uiWidth] = 0;
-      }
-    }
-
-    for( ; uiPelY < uiHeight; uiPelY++ )
-    {
-      for( uiPelX = 0; uiPelX < uiWidth; uiPelX++ )
-      {
-        pMask[uiPelX + uiPelY*uiWidth] = 1;
-      }
-    }
-  }
-  else if( uiPartitionSize == SIZE_Nx2N || uiPartitionSize == SIZE_nLx2N || uiPartitionSize == SIZE_nRx2N )
-  {
-    for( uiPelY = 0; uiPelY < uiHeight; uiPelY++ )
-    {
-      for( uiPelX = 0; uiPelX < uiXOffset; uiPelX++ )
-      {
-        pMask[uiPelX + uiPelY*uiWidth] = 0;
-      }
-
-      for( ; uiPelX < uiWidth; uiPelX++ )
-      {
-        pMask[uiPelX + uiPelY*uiWidth] = 1;
-      }
-    }
-  }
-  else if( uiPartitionSize == SIZE_NxN )
-  {
-    for( uiPelY = 0; uiPelY < uiYOffset; uiPelY++ )
-    {
-      for( uiPelX = 0; uiPelX < uiXOffset; uiPelX++ )
-      {
-        pMask[uiPelX + uiPelY*uiWidth] = 0;
-      }
-
-      for( ; uiPelX < uiWidth; uiPelX++ )
-      {
-        pMask[uiPelX + uiPelY*uiWidth] = 1;
-      }
-    }
-
-    for( ; uiPelY < uiHeight; uiPelY++ )
-    {
-      for( uiPelX = 0; uiPelX < uiXOffset; uiPelX++ )
-      {
-        pMask[uiPelX + uiPelY*uiWidth] = 2;
-      }
-
-      for( ; uiPelX < uiWidth; uiPelX++ )
-      {
-        pMask[uiPelX + uiPelY*uiWidth] = 3;
-      }
-    }
-  }
-
-}
-#endif
-#endif
-
-#if QC_GENERIC_SDC_G0122
-UInt TComDataCU::getCtxSDCFlag( UInt uiAbsPartIdx )
-{
-#if QC_SDC_UNIFY_G0130
-  return 0;
-#else
-  TComDataCU* pcTempCU;
-  UInt        uiTempPartIdx;
-  UInt        uiCtx = 0;
-
-  // Get BCBP of left PU
-  pcTempCU = getPULeft( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx );
-  uiCtx    = ( pcTempCU && pcTempCU->isIntra( uiTempPartIdx ) ) ? pcTempCU->getSDCFlag( uiTempPartIdx ) : 0;
-
-  // Get BCBP of above PU
-  pcTempCU = getPUAbove( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx );
-  uiCtx   += ( pcTempCU && pcTempCU->isIntra( uiTempPartIdx ) ) ? pcTempCU->getSDCFlag( uiTempPartIdx ) : 0;
-
-  return uiCtx;
-#endif
 }
 
@@ -2947,6 +2624,8 @@
   // check general CU information
   if( !getSlice()->getIsDepth() || !isIntra(uiAbsPartIdx) || getPartitionSize(uiAbsPartIdx) != SIZE_2Nx2N )
+  {
     return false;
-#if QC_GENERIC_SDC_G0122
+  }
+
   if( isDimMode( getLumaIntraDir( uiAbsPartIdx ) ) && !isDimDeltaDC( getLumaIntraDir( uiAbsPartIdx ) ) )
   {
@@ -2960,5 +2639,4 @@
 
   return false;
-#endif
   // check prediction mode
   UInt uiLumaPredMode = getLumaIntraDir( uiAbsPartIdx );  
@@ -3582,10 +3260,6 @@
 inline Bool TComDataCU::xAddVspCand( Int mrgCandIdx, DisInfo* pDInfo, Int& iCount,
   Bool* abCandIsInter, TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* vspFlag, Int& iCount3DV, InheritedVSPDisInfo*  inheritedVSPDisInfo  )
-  {
-#if MTK_NBDV_IVREF_FIX_G0067
+{
   if ( m_pcSlice->getViewIndex() == 0 || !m_pcSlice->getVPS()->getViewSynthesisPredFlag( m_pcSlice->getLayerIdInVps() ) || m_pcSlice->getIsDepth() || pDInfo->m_aVIdxCan == -1)
-#else
-  if ( m_pcSlice->getViewIndex() == 0 || !m_pcSlice->getVPS()->getViewSynthesisPredFlag( m_pcSlice->getLayerIdInVps() ) || m_pcSlice->getIsDepth() )
-#endif
   {
     return false;
@@ -3594,5 +3268,5 @@
   Int refViewIdx = pDInfo->m_aVIdxCan;
   TComPic* picDepth = getSlice()->getIvPic( true, refViewIdx );
-  
+
   if( picDepth == NULL ) // No depth reference avail
   {
@@ -3602,12 +3276,8 @@
 
   rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, (5-iCount), iCount3DV);
-  
+
   Bool  refViewAvailFlag = false;
   UChar predFlag[2]      = {0, 0};
-#if !MTK_RBIP_VSP_G0069
-  Int   refListIdY       = 0;    
-  Int   viewIdInRefListX = -1;
-#endif
-  
+
   for( Int iRefListIdX = 0; iRefListIdX < 2 && !refViewAvailFlag; iRefListIdX++ )
   {
@@ -3620,8 +3290,4 @@
         refViewAvailFlag      = true;
         predFlag[iRefListIdX] = 1;
-#if !MTK_RBIP_VSP_G0069
-        viewIdInRefListX      = m_pcSlice->getRefPic(eRefPicListX, i)->getViewId();
-        refListIdY            = 1 - iRefListIdX;
-#endif
         pcMvFieldNeighbours[(iCount<<1)+iRefListIdX].setMvField( pDInfo->m_acNBDV, i );
 #if H_3D_NBDV
@@ -3631,46 +3297,4 @@
     }
   }
-
-#if !MTK_RBIP_VSP_G0069
-  if (m_pcSlice->isInterB() && refViewAvailFlag)
-  {
-    RefPicList eRefPicListY = RefPicList( refListIdY );
-    refViewAvailFlag = false;
-    for ( Int i = 0; i < m_pcSlice->getNumRefIdx(eRefPicListY) && !refViewAvailFlag; i++ )
-    {
-      Int viewIdxRefInListY = m_pcSlice->getRefPic(eRefPicListY, i)->getViewIndex();
-      if ( viewIdxRefInListY != refViewIdx && viewIdxRefInListY != m_pcSlice->getViewIndex() )
-      {
-        refViewAvailFlag = true;
-        predFlag[refListIdY] = 1;
-        TComMv  cMv = pDInfo->m_acNBDV;
-        
-        Int viewIdInRefListY = m_pcSlice->getRefPic( eRefPicListY, i)->getViewId();
-        Int currViewId       = m_pcSlice->getViewId();
-        
-        //// Following might be added here when MV-HEVC 5 HLS is included (and derivations above removed): 
-        // Int viewIdInRefListX = m_pcSlice->getVPS()->getViewIdVal( refViewIdx  ); 
-        
-        Int iScale      = xGetDistScaleFactor( currViewId, viewIdInRefListY, currViewId, viewIdInRefListX );
-        
-        // Can iScale == 4096 happen?, I guess not since viewIdInRefListY is always unequal to viewIdInRefListX.
-        if ( iScale != 4096 && m_pcSlice->getVPS()->getIvMvScalingFlag() ) 
-        {
-          cMv = cMv.scaleMv( iScale );
-        }
-        else
-        {
-
-          cMv = cMv;
-        }
-        clipMv( cMv );
-        pcMvFieldNeighbours[(iCount<<1)+refListIdY].setMvField( cMv, i );
-#if H_3D_NBDV
-        pcMvFieldNeighbours[(iCount<<1)+refListIdY].getMv().setIDVFlag (false);
-#endif
-      }
-    }
-  }
-#endif
 
   // Set values to be returned
@@ -3791,9 +3415,5 @@
   for ( Int currListPos = (ivCandDir[0] ? 1 : 0); currListPos < iCount; currListPos++ )
   {
-#if NTT_STORE_SPDV_VSP_G0148
     if ( ( currListPos == posIvDC ) || ( vspFlag[ currListPos ] != 0 ) )
-#else
-    if ( ( currListPos == posIvDC ) || ( vspFlag[ currListPos ] == 1 ) )
-#endif
     {
       continue;
@@ -4227,5 +3847,5 @@
   UChar tmpDir;
 
-#if MTK_DDD_G0063
+#if H_3D_DDD
   m_iUseDDDCandIdx = -1;
 #endif
@@ -4311,9 +3931,5 @@
     iPosLeftAbove[0] = numA1B1B0;
 #if H_3D_VSP
-#if NTT_STORE_SPDV_VSP_G0148
     if (pcCULeft->getVSPFlag(uiLeftPartIdx) != 0
-#else
-    if (pcCULeft->getVSPFlag(uiLeftPartIdx) == 1
-#endif
 #if H_3D_IC
       && !bICFlag
@@ -4338,9 +3954,5 @@
     iPosLeftAbove[1] = numA1B1B0;
 #if H_3D_VSP
-#if NTT_STORE_SPDV_VSP_G0148
     if ( ( ( getAddr() - pcCUAbove->getAddr() ) == 0) && (pcCUAbove->getVSPFlag(uiAbovePartIdx) != 0) 
-#else
-    if ( ( ( getAddr() - pcCUAbove->getAddr() ) == 0) && (pcCUAbove->getVSPFlag(uiAbovePartIdx) == 1) 
-#endif
 #if H_3D_IC
       && !bICFlag
@@ -4365,9 +3977,5 @@
   {
 #if H_3D_VSP
-#if NTT_STORE_SPDV_VSP_G0148
     if ( ( ( getAddr() - pcCUAboveRight->getAddr() ) == 0) && (pcCUAboveRight->getVSPFlag(uiAboveRightPartIdx) != 0) 
-#else
-    if ( ( ( getAddr() - pcCUAboveRight->getAddr() ) == 0) && (pcCUAboveRight->getVSPFlag(uiAboveRightPartIdx) == 1) 
-#endif
 #if H_3D_IC
       && !bICFlag
@@ -4390,9 +3998,5 @@
   {
 #if H_3D_VSP
-#if NTT_STORE_SPDV_VSP_G0148
     if (pcCULeftBottom->getVSPFlag(uiLeftBottomPartIdx) != 0
-#else
-    if (pcCULeftBottom->getVSPFlag(uiLeftBottomPartIdx) == 1
-#endif
 #if H_3D_IC
       && !bICFlag
@@ -4417,9 +4021,5 @@
   {
 #if H_3D_VSP
-#if NTT_STORE_SPDV_VSP_G0148
     if ( ( ( getAddr() - pcCUAboveLeft->getAddr() ) == 0) && (pcCUAboveLeft->getVSPFlag(uiAboveLeftPartIdx) != 0) 
-#else
-    if ( ( ( getAddr() - pcCUAboveLeft->getAddr() ) == 0) && (pcCUAboveLeft->getVSPFlag(uiAboveLeftPartIdx) == 1) 
-#endif
 #if H_3D_IC
       && !bICFlag
@@ -4449,5 +4049,4 @@
   if( bMPIFlag)
   {
-#if QC_SPIVMP_MPI_G0119
     tmpMV[0].setMvField( cZeroMv, NOT_VALID );
     tmpMV[1].setMvField( cZeroMv, NOT_VALID );
@@ -4556,137 +4155,156 @@
     }
 #endif
-#else
-    UInt uiPartIdxCenter;
-    xDeriveCenterIdx( uiPUIdx, uiPartIdxCenter );    
-    tmpMV[0].setMvField( cZeroMv, NOT_VALID );
-    tmpMV[1].setMvField( cZeroMv, NOT_VALID );
-    Int tRef[2]={-1, -1};
-
-#if H_3D_FCO
-    TComPic * pcTexturePic = m_pcSlice->getTexturePic();
-    TComDataCU *pcTextureCU = 0;
-    if ( pcTexturePic )
-      pcTextureCU = pcTexturePic->getCU( getAddr() );
-#else
-    TComDataCU *pcTextureCU = m_pcSlice->getTexturePic()->getCU( getAddr() );
-#endif
-
-#if H_3D_FCO
-    if ( pcTextureCU && pcTexturePic->getReconMark() && !pcTextureCU->isIntra( uiPartIdxCenter ) )
-#else
-    if ( pcTextureCU && !pcTextureCU->isIntra( uiPartIdxCenter ) )
-#endif
-    {
-      pcTextureCU->getMvField( pcTextureCU, uiPartIdxCenter, REF_PIC_LIST_0, tmpMV[0] );
-      tRef[0] = getPic()->isTextRefValid( REF_PIC_LIST_0, tmpMV[0].getRefIdx() );
-      if( (tmpMV[0].getRefIdx()>=0) && ( tRef[0] >= 0 ) )
-      {
-        TComMv cMvPred = tmpMV[0].getMv();
-        const TComMv cAdd( 1 << ( 2 - 1 ), 1 << ( 2 - 1 ) );
-        cMvPred+=cAdd;
-        cMvPred>>=2;
-        clipMv(cMvPred);
-        tmpMV[0].setMvField(cMvPred,tRef[0]);
-      }
-      if ( getSlice()->isInterB() )
-      {
-        pcTextureCU->getMvField( pcTextureCU, uiPartIdxCenter, REF_PIC_LIST_1, tmpMV[1] );
-        tRef[1] = getPic()->isTextRefValid( REF_PIC_LIST_1, tmpMV[1].getRefIdx() );
-        if( (tmpMV[1].getRefIdx()>=0) && ( tRef[1] >= 0) )
+    if( tmpDir != 0 )
+    {
+      Int iCnloop = 0;
+      Bool bRemoveSpa = false; //pruning
+
+      for(Int i = 0; i < 2; i ++)
+      {
+        iCnloop = iPosLeftAbove[i];
+        if ( iCnloop == -1 ) 
         {
-          TComMv cMvPred = tmpMV[1].getMv();
-          const TComMv cAdd( 1 << ( 2 - 1 ), 1 << ( 2 - 1 ) );
-          cMvPred+=cAdd;
-          cMvPred>>=2;
-          clipMv(cMvPred);
-          tmpMV[1].setMvField(cMvPred,tRef[1]);
+          continue;
         }
-      }
-
-      tmpDir = 0;
-      if( (tmpMV[0].getRefIdx()>=0) && ( tRef[0] >= 0 ) )
-      {
-        tmpDir += ((tmpMV[0].getRefIdx()>=0)?1:0);
-      }
-      if( (tmpMV[1].getRefIdx()>=0) && ( tRef[1] >= 0) )
-      {
-        tmpDir += ((tmpMV[1].getRefIdx()>=0)?2:0);
-      }
-#endif
-      if( tmpDir != 0 )
-      {
-        Int iCnloop = 0;
-        Bool bRemoveSpa = false; //pruning
-
-        for(Int i = 0; i < 2; i ++)
+        if(tmpDir == puhInterDirNeighbours[iCnloop] && tmpMV[0]==pcMvFieldNeighbours[(iCnloop<<1)] && tmpMV[1]==pcMvFieldNeighbours[(iCnloop<<1)+1])
         {
-          iCnloop = iPosLeftAbove[i];
-          if ( iCnloop == -1 ) 
+          bRemoveSpa                      = true;
+          break;
+        }      
+      }
+
+      if (!bRemoveSpa)
+      {
+        rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, 5-iCount, iCount3DV);
+      }
+      else
+      {
+        rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, (iCnloop-iCount), iCount3DV);
+        if (iCnloop<numA1B1B0)
+        {
+          numA1B1B0--;
+        }
+        iCountHEVC--;
+
+        if (iPosLeftAbove[0] != -1)
+        {
+          if (iCnloop == iPosLeftAbove[0])
           {
-            continue;
+            iPosLeftAbove[0] = -1;
           }
-          if(tmpDir == puhInterDirNeighbours[iCnloop] && tmpMV[0]==pcMvFieldNeighbours[(iCnloop<<1)] && tmpMV[1]==pcMvFieldNeighbours[(iCnloop<<1)+1])
+          else
           {
-            bRemoveSpa                      = true;
-            break;
-          }      
+            iPosLeftAbove[0]++;
+          }
         }
-
-        if (!bRemoveSpa)
+        if (iPosLeftAbove[1] != -1)
         {
-          rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, 5-iCount, iCount3DV);
-        }
-        else
-        {
-          rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, (iCnloop-iCount), iCount3DV);
-          if (iCnloop<numA1B1B0)
+          if (iCnloop == iPosLeftAbove[1])
           {
-            numA1B1B0--;
+            iPosLeftAbove[1] = -1;
           }
-          iCountHEVC--;
-
-          if (iPosLeftAbove[0] != -1)
+          else
           {
-            if (iCnloop == iPosLeftAbove[0])
+            if (iCnloop > iPosLeftAbove[1])
             {
-              iPosLeftAbove[0] = -1;
-            }
-            else
-            {
-              iPosLeftAbove[0]++;
-            }
-          }
-          if (iPosLeftAbove[1] != -1)
-          {
-            if (iCnloop == iPosLeftAbove[1])
-            {
-              iPosLeftAbove[1] = -1;
-            }
-            else
-            {
-              if (iCnloop > iPosLeftAbove[1])
-              {
-                iPosLeftAbove[1]++;
-              }
+              iPosLeftAbove[1]++;
             }
           }
         }
-#if QC_SPIVMP_MPI_G0119
-        pcMvFieldNeighbours[iCount<<1].setMvField(tmpMV[0].getMv(), tmpMV[0].getRefIdx());
-        pcMvFieldNeighbours[(iCount<<1)+1].setMvField(tmpMV[1].getMv(), tmpMV[1].getRefIdx());
-#else
-        if( (tmpMV[0].getRefIdx()>=0) && ( tRef[0] >= 0 ) )
+      }
+      pcMvFieldNeighbours[iCount<<1].setMvField(tmpMV[0].getMv(), tmpMV[0].getRefIdx());
+      pcMvFieldNeighbours[(iCount<<1)+1].setMvField(tmpMV[1].getMv(), tmpMV[1].getRefIdx());
+
+      puhInterDirNeighbours[iCount] = tmpDir;
+
+      if ( mrgCandIdx == iCount )
+      {
+        return;
+      }
+      iCount ++;
+    }
+  }
+#if H_3D_DDD
+  if( m_pcSlice->getIsDepth() && m_pcSlice->getViewIndex() != 0  && bMPIFlag )
+  {
+    UInt uiPartIdx;
+    TComDataCU *pcTextureCU = m_pcSlice->getTexturePic()->getCU( getAddr() );
+    TComSlice *pcTextureSlice = pcTextureCU->getSlice();  
+
+
+    tmpMV[0].setMvField( cZeroMv, NOT_VALID );
+    tmpMV[1].setMvField( cZeroMv, NOT_VALID );
+    tmpDir = 0;
+
+    xDeriveCenterIdx( uiPUIdx, uiPartIdx); 
+
+    if ( pcTextureCU && !pcTextureCU->isIntra( uiPartIdx ) )
+    {
+
+      TComMvField cMVField;
+      Int iDV = 0;
+      Int iViewIdx = 0;
+      pcTextureCU->getMvField( pcTextureCU, uiPartIdx, REF_PIC_LIST_0, cMVField );
+      if( cMVField.getRefIdx() >= 0 )
+      {
+        if( pcTextureSlice->getRefPOC( REF_PIC_LIST_0, cMVField.getRefIdx()) == pcTextureSlice->getPOC() )
         {
-          pcMvFieldNeighbours[iCount<<1].setMvField(tmpMV[0].getMv(), tRef[0]);
-        }
-        if ( getSlice()->isInterB())
-        {
-          if( (tmpMV[1].getRefIdx()>=0) && ( tRef[1] >= 0) )
+          iViewIdx = pcTextureSlice->getRefPic( REF_PIC_LIST_0, cMVField.getRefIdx())->getViewIndex();
+          iDV = cMVField.getHor();
+
+
+          Int iValidDepRef = getPic()->isTextRefValid( REF_PIC_LIST_0, cMVField.getRefIdx() );
+
+          if( iValidDepRef >= 0 )
           {
-            pcMvFieldNeighbours[(iCount<<1)+1].setMvField(tmpMV[1].getMv(), tRef[1]);
+            const TComMv cAdd( 2, 2 );
+            cMVField.getMv() += cAdd;
+            cMVField.getMv() >>= 2;
+            clipMv( cMVField.getMv() );
+            tmpMV[ 0 ].setMvField( cMVField.getMv(), iValidDepRef );
+            tmpDir = 1;
           }
         }
-#endif
-        puhInterDirNeighbours[iCount] = tmpDir;
+      }
+
+      pcTextureCU->getMvField( pcTextureCU, uiPartIdx, REF_PIC_LIST_1, cMVField );
+
+      if( !tmpDir && cMVField.getRefIdx() >= 0 )
+      {
+        if( pcTextureSlice->getRefPOC( REF_PIC_LIST_1, cMVField.getRefIdx()) == pcTextureSlice->getPOC() )
+        {
+          iViewIdx = pcTextureSlice->getRefPic( REF_PIC_LIST_1, cMVField.getRefIdx())->getViewIndex();
+          iDV = cMVField.getHor();
+
+          Int iValidDepRef = getPic()->isTextRefValid( REF_PIC_LIST_1, cMVField.getRefIdx() );
+
+          if( iValidDepRef >= 0 )
+          {
+            const TComMv cAdd( 2, 2 );
+            cMVField.getMv() += cAdd;
+            cMVField.getMv() >>= 2;
+            clipMv( cMVField.getMv() );
+            tmpMV[ 1 ].setMvField( cMVField.getMv(), iValidDepRef );
+            tmpDir = 2;
+          }
+        }
+      }
+      if( tmpDir != 0 )
+      {
+        rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, 5-iCount, iCount3DV);
+        m_ucDDTmpDepth = m_pcSlice->getDepthFromDV( iDV,  iViewIdx );
+        m_iUseDDDCandIdx = iCount;
+
+        if( tmpDir == 1 )
+        {
+          pcMvFieldNeighbours[ iCount << 1 ] = tmpMV[ 0 ];
+        }
+        else if( tmpDir == 2  )
+        {
+          pcMvFieldNeighbours[( iCount << 1 ) + 1 ] = tmpMV[ 1 ];
+        }
+
+        abCandIsInter        [ iCount ] = true;
+        puhInterDirNeighbours[ iCount ] = tmpDir;
 
         if ( mrgCandIdx == iCount )
@@ -4695,127 +4313,17 @@
         }
         iCount ++;
-      }
-#if !QC_SPIVMP_MPI_G0119
-    }
-#endif
-  }
-#if MTK_DDD_G0063
-  if( m_pcSlice->getIsDepth() && m_pcSlice->getViewIndex() != 0  && bMPIFlag )
-  {
-      UInt uiPartIdx;
-      TComDataCU *pcTextureCU = m_pcSlice->getTexturePic()->getCU( getAddr() );
-      TComSlice *pcTextureSlice = pcTextureCU->getSlice();  
-
-
-      tmpMV[0].setMvField( cZeroMv, NOT_VALID );
-      tmpMV[1].setMvField( cZeroMv, NOT_VALID );
-      tmpDir = 0;
-
-      xDeriveCenterIdx( uiPUIdx, uiPartIdx); 
-
-      if ( pcTextureCU && !pcTextureCU->isIntra( uiPartIdx ) )
-      {
-
-          TComMvField cMVField;
-#if !HTM10RC1_FIX
-          UChar ucInterDir = pcTextureCU->getInterDir( uiPartIdx );
-#endif
-          Int iDV = 0;
-          Int iViewIdx = 0;
-#if !HTM10RC1_FIX
-          if( ucInterDir & 1 )
-          {
-#endif
-              pcTextureCU->getMvField( pcTextureCU, uiPartIdx, REF_PIC_LIST_0, cMVField );
-#if HTM10RC1_FIX
-              if( cMVField.getRefIdx() >= 0 )
-              {
-#endif
-              if( pcTextureSlice->getRefPOC( REF_PIC_LIST_0, cMVField.getRefIdx()) == pcTextureSlice->getPOC() )
-              {
-                  iViewIdx = pcTextureSlice->getRefPic( REF_PIC_LIST_0, cMVField.getRefIdx())->getViewIndex();
-                  iDV = cMVField.getHor();
-
-
-                  Int iValidDepRef = getPic()->isTextRefValid( REF_PIC_LIST_0, cMVField.getRefIdx() );
-
-                  if( iValidDepRef >= 0 )
-                  {
-                      const TComMv cAdd( 2, 2 );
-                      cMVField.getMv() += cAdd;
-                      cMVField.getMv() >>= 2;
-                      clipMv( cMVField.getMv() );
-                      tmpMV[ 0 ].setMvField( cMVField.getMv(), iValidDepRef );
-                      tmpDir = 1;
-                  }
-              }
-          }
-
-#if !HTM10RC1_FIX
-          if( !tmpDir && ( ucInterDir & 2 ))
-          {
-#endif
-              pcTextureCU->getMvField( pcTextureCU, uiPartIdx, REF_PIC_LIST_1, cMVField );
-
-#if HTM10RC1_FIX
-              if( !tmpDir && cMVField.getRefIdx() >= 0 )
-              {
-#endif
-              if( pcTextureSlice->getRefPOC( REF_PIC_LIST_1, cMVField.getRefIdx()) == pcTextureSlice->getPOC() )
-              {
-                  iViewIdx = pcTextureSlice->getRefPic( REF_PIC_LIST_1, cMVField.getRefIdx())->getViewIndex();
-                  iDV = cMVField.getHor();
-
-                  Int iValidDepRef = getPic()->isTextRefValid( REF_PIC_LIST_1, cMVField.getRefIdx() );
-
-                  if( iValidDepRef >= 0 )
-                  {
-                      const TComMv cAdd( 2, 2 );
-                      cMVField.getMv() += cAdd;
-                      cMVField.getMv() >>= 2;
-                      clipMv( cMVField.getMv() );
-                      tmpMV[ 1 ].setMvField( cMVField.getMv(), iValidDepRef );
-                      tmpDir = 2;
-                  }
-              }
-          }
-          if( tmpDir != 0 )
-          {
-              rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, 5-iCount, iCount3DV);
-              m_ucDDTmpDepth = m_pcSlice->getDepthFromDV( iDV,  iViewIdx );
-              m_iUseDDDCandIdx = iCount;
-
-              if( tmpDir == 1 )
-              {
-                  pcMvFieldNeighbours[ iCount << 1 ] = tmpMV[ 0 ];
-              }
-              else if( tmpDir == 2  )
-              {
-                  pcMvFieldNeighbours[( iCount << 1 ) + 1 ] = tmpMV[ 1 ];
-              }
-
-              abCandIsInter        [ iCount ] = true;
-              puhInterDirNeighbours[ iCount ] = tmpDir;
-
-              if ( mrgCandIdx == iCount )
-              {
-                  return;
-              }
-              iCount ++;
-
-              Int iLeftAboveAvail = 0;
-              if( iPosLeftAbove[ 0 ] != -1 )
-              {
-                  iPosLeftAbove[ 0 ] = iCount;
-                  iLeftAboveAvail = 1;
-              }
-              if( iPosLeftAbove[ 1 ] != -1 )
-              {
-                  iPosLeftAbove[ 1 ] = iCount + iLeftAboveAvail;
-              }
-
-          }
-      }      
-
+
+        Int iLeftAboveAvail = 0;
+        if( iPosLeftAbove[ 0 ] != -1 )
+        {
+          iPosLeftAbove[ 0 ] = iCount;
+          iLeftAboveAvail = 1;
+        }
+        if( iPosLeftAbove[ 1 ] != -1 )
+        {
+          iPosLeftAbove[ 1 ] = iCount + iLeftAboveAvail;
+        }
+      }
+    }
   }
 #endif
@@ -4836,9 +4344,5 @@
   Bool ivMvPredFlag   = getSlice()->getVPS()->getIvMvPredFlag( getSlice()->getLayerIdInVps() );
 
-#if MTK_NBDV_IVREF_FIX_G0067
   if ( ivMvPredFlag && cDisInfo.m_aVIdxCan!=-1)
-#else
-  if ( ivMvPredFlag )
-#endif
   {
     getInterViewMergeCands(uiPUIdx, ivCandRefIdx, ivCandMv, &cDisInfo, ivCandDir , bIsDepth, pcMvFieldSP, puhInterDirSP );
@@ -4848,10 +4352,9 @@
   //////// INTER VIEW MOTION COMP(IvMC) /////////
   ///////////////////////////////////////////////
-#if QC_DEPTH_MERGE_SIMP_G0127
   if( getSlice()->getIsDepth() )
   {
     ivCandDir[1] = ivCandDir[2] = ivCandDir[3] = 0;
   }
-#endif
+
   if( ivCandDir[0] )
   {
@@ -4893,5 +4396,5 @@
       for(; iCnloop >= 0; iCnloop --)
       {
-#if MTK_DDD_G0063
+#if H_3D_DDD
           if( iCnloop == m_iUseDDDCandIdx )
           {
@@ -4961,13 +4464,8 @@
     if (bIvMC)
     {
-#if QC_SPIVMP_MPI_G0119
-      if(!m_pcSlice->getIsDepth())
-#endif
-#if SEC_SPIVMP_MCP_SIZE_G0077
-        if(getPartitionSize(0) == SIZE_2Nx2N)
+      if(!m_pcSlice->getIsDepth() && getPartitionSize(0) == SIZE_2Nx2N )
+      {
           pbSPIVMPFlag[iCount] = true;
-#else
-      pbSPIVMPFlag[iCount] = true;
-#endif
+      }
 #if H_3D_DBBP
       pbSPIVMPFlag[iCount] &= !bDBBPFlag;
@@ -5099,5 +4597,5 @@
 #endif
 
-#if MTK_DDD_G0063
+#if H_3D_DDD
   // early termination
   if ( iCount >= getSlice()->getMaxNumMergeCand()) 
@@ -5111,9 +4609,5 @@
   //////// INTER VIEW DISP COMP (IvDC) ////////
   /////////////////////////////////////////////
-#if QC_DEPTH_MERGE_SIMP_G0127
   if( ivCandDir[1] && iCount < getSlice()->getMaxNumMergeCand() && !getSlice()->getIsDepth() )
-#else
-  if( ivCandDir[1] && iCount < getSlice()->getMaxNumMergeCand())
-#endif
   {
     assert(iCount < getSlice()->getMaxNumMergeCand());
@@ -5276,9 +4770,5 @@
   //////// SHIFTED IV (IvMCShift + IvDCShift) ////////
   ////////////////////////////////////////////////////
-#if QC_DEPTH_MERGE_SIMP_G0127
   if(  ivMvPredFlag && iCount < getSlice()->getMaxNumMergeCand() && !getSlice()->getIsDepth() ) 
-#else
-  if(  ivMvPredFlag && iCount < getSlice()->getMaxNumMergeCand() ) 
-#endif
   {
     if(xAddIvMRGCand( mrgCandIdx,  iCount, abCandIsInter, pcMvFieldNeighbours, puhInterDirNeighbours, ivCandDir, ivCandMv, ivCandRefIdx, posIvDC, vspFlag, iCount3DV, inheritedVSPDisInfo ) )
@@ -6645,11 +6135,7 @@
 #endif
 #if H_3D_IV_MERGE
-#if SEC_DEPTH_DV_DERIVAITON_G0074
 Bool TComDataCU::getDispforDepth (UInt uiPartIdx, UInt uiPartAddr, DisInfo* pDisp)
-#else
-Bool TComDataCU::getDispNeighBlocks (UInt uiPartIdx, UInt uiPartAddr, DisInfo* pDisp)
-#endif
-{
-#if SEC_DEPTH_DV_DERIVAITON_G0074
+{
+
   assert(getPartitionSize( uiPartAddr ) == SIZE_2Nx2N);
 
@@ -6662,51 +6148,4 @@
 
   return true;
-#else
-  Pel pDepPos[3] = {0, 0, 0};
-  assert(getPartitionSize( uiPartAddr ) == SIZE_2Nx2N);
-  Bool bDepAvail = false;
-  Pel *pDepth  = this->getPic()->getPicYuvRec()->getLumaAddr();
-  Int iDepStride =  this->getPic()->getPicYuvRec()->getStride();
-  TComMv cMv; 
-
-  Int xP, yP, nPSW, nPSH;
-  this->getPartPosition(uiPartIdx, xP, yP, nPSW, nPSH);
-
-  if(xP != 0 && yP != 0)
-  {
-    pDepPos[0] = pDepth[ (yP-1) * iDepStride + (xP-1) ];
-    bDepAvail = true;
-  }
-
-  if(xP != 0)
-  {
-    pDepPos[1] = pDepth[ (yP+nPSH-1) * iDepStride + (xP-1) ];
-    bDepAvail = true;
-  }
-
-  if(yP != 0)
-  {
-    pDepPos[2] = pDepth[ (yP-1) * iDepStride + (xP+nPSW-1) ];
-    bDepAvail = true;
-  }
-
-  if (bDepAvail)
-  {
-    Pel pAvgDepth = (xP != 0 && yP != 0) ? ((5*pDepPos[0] + 5*pDepPos[1] + 6*pDepPos[2] + 8)>>4) : (xP == 0) ? pDepPos[2] : pDepPos[1];
-    Int iDisp     = getSlice()->getDepthToDisparityB( 0 )[ pAvgDepth ];
-    cMv.setHor(iDisp);
-    cMv.setVer(0);
-    pDisp->m_acNBDV = cMv;
-    pDisp->m_aVIdxCan = 0;
-    return true;
-  }
-  else
-  {  
-    cMv.setZero();
-    pDisp->m_acNBDV = cMv;
-    pDisp->m_aVIdxCan = 0;
-    return false;
-  }
-#endif
 }
 #endif
@@ -6725,7 +6164,6 @@
   // Init disparity struct for results
   pDInfo->bDV = false;   
-#if MTK_NBDV_IVREF_FIX_G0067
   pDInfo->m_aVIdxCan = -1;
-#endif
+
   // Init struct for disparities from MCP neighboring blocks
   IDVInfo cIDVInfo;
@@ -7248,10 +6686,9 @@
 {
   Int iSubPUSize = 1<<getSlice()->getVPS()->getSubPULog2Size(getSlice()->getLayerId());
-#if QC_SPIVMP_MPI_G0119
   if( getSlice()->getIsDepth() )
   {
     iSubPUSize = 1 << getSlice()->getVPS()->getSubPUMPILog2Size();
   }
-#endif
+
   iNumSPInOneLine = iPUWidth/iSubPUSize;
   iNumSPInOneLine = iNumSPInOneLine < 1 ? 1: iNumSPInOneLine;
@@ -7310,5 +6747,5 @@
   TComSlice*    pcSlice = getSlice ();  
   Int iViewIndex        = pDInfo->m_aVIdxCan;
-  
+
   //--- get base CU/PU and check prediction mode ---
   TComPic*    pcBasePic   = pcSlice->getIvPic( bIsDepth, iViewIndex );
@@ -7334,5 +6771,5 @@
 
   TComMv      cDv = depthRefineFlag ? pDInfo->m_acDoNBDV : pDInfo->m_acNBDV; 
-  
+
   Bool abPdmAvailable[8] =  {false, false, false, false, false, false, false, false};
 #if H_3D_NBDV
@@ -7347,151 +6784,83 @@
   //////////sub-PU IvMC///////////
   ////////////////////////////////
-#if QC_SPIVMP_MPI_G0119
   if(!m_pcSlice->getIsDepth())
   {
-#endif  
-#if SEC_SPIVMP_MCP_SIZE_G0077
-  if( getPartitionSize(0) == SIZE_2Nx2N )
-  {
-#endif
-  Int iNumSPInOneLine, iNumSP, iSPWidth, iSPHeight;
-  getSPPara(iWidth, iHeight, iNumSP, iNumSPInOneLine, iSPWidth, iSPHeight);
-
-  for (Int i=0; i<iNumSP; i++)
-  {
-    puhInterDirSP[i] = 0;
-    pcMvFieldSP[2*i].getMv().set(0, 0);
-    pcMvFieldSP[2*i+1].getMv().set(0,0);
-    pcMvFieldSP[2*i].setRefIdx(-1);
-    pcMvFieldSP[2*i+1].setRefIdx(-1);
-  }
-
-  Int         iBaseCUAddr;
-  Int         iBaseAbsPartIdx;
-  TComDataCU* pcBaseCU;
-  Int iPartition = 0;
-#if !KHU_SIMP_SPIVMP_G0147
-  Int iInterDirLast = 0;
-  TComMvField cMvFieldLast[2];
-#endif
-
-  Int iDelX = iSPWidth/2;
-  Int iDelY = iSPHeight/2;
-
-#if KHU_SIMP_SPIVMP_G0147
-  Int         iCenterPosX = iCurrPosX + ( ( iWidth /  iSPWidth ) >> 1 )  * iSPWidth + ( iSPWidth >> 1 );
-  Int         iCenterPosY = iCurrPosY + ( ( iHeight /  iSPHeight ) >> 1 )  * iSPHeight + (iSPHeight >> 1);
-  Int         iRefCenterCUAddr, iRefCenterAbsPartIdx;
-
-  if(iWidth == iSPWidth && iHeight == iSPHeight)
-  {
-    iCenterPosX = iCurrPosX + (iWidth >> 1);
-    iCenterPosY = iCurrPosY + (iHeight >> 1);
-  }
-
-  Int iRefCenterPosX   = Clip3( 0, pcBaseRec->getWidth () - 1, iCenterPosX + ( (cDv.getHor() + 2 ) >> 2 ) );
-  Int iRefCenterPosY   = Clip3( 0, pcBaseRec->getHeight() - 1, iCenterPosY + ( (cDv.getVer() + 2 ) >> 2 ) ); 
-
-  pcBaseRec->getCUAddrAndPartIdx( iRefCenterPosX , iRefCenterPosY , iRefCenterCUAddr, iRefCenterAbsPartIdx );
-  TComDataCU* pcDefaultCU    = pcBasePic->getCU( iRefCenterCUAddr );
-  if(!( pcDefaultCU->getPredictionMode( iRefCenterAbsPartIdx ) == MODE_INTRA ))
-  {
-    for( UInt uiCurrRefListId = 0; uiCurrRefListId < 2; uiCurrRefListId++ )       
-    {
-      RefPicList  eCurrRefPicList = RefPicList( uiCurrRefListId );
-      Bool stopLoop = false;
-      for(Int iLoop = 0; iLoop < 2 && !stopLoop; ++iLoop)
-      {
-        RefPicList eDefaultRefPicList = (iLoop ==1)? RefPicList( 1 -  uiCurrRefListId ) : RefPicList( uiCurrRefListId );
-        TComMvField cDefaultMvField;
-        pcDefaultCU->getMvField( pcDefaultCU, iRefCenterAbsPartIdx, eDefaultRefPicList, cDefaultMvField );
-        Int         iDefaultRefIdx     = cDefaultMvField.getRefIdx();
-        if (iDefaultRefIdx >= 0)
-        {
-          Int iDefaultRefPOC = pcDefaultCU->getSlice()->getRefPOC(eDefaultRefPicList, iDefaultRefIdx);
-          if (iDefaultRefPOC != pcSlice->getPOC())    
-          {
-            for (Int iPdmRefIdx = 0; iPdmRefIdx < pcSlice->getNumRefIdx( eCurrRefPicList ); iPdmRefIdx++)
-            {
-              if (iDefaultRefPOC == pcSlice->getRefPOC(eCurrRefPicList, iPdmRefIdx))
-              {
-                abPdmAvailable[ uiCurrRefListId ] = true;
-                TComMv cMv(cDefaultMvField.getHor(), cDefaultMvField.getVer());
-#if H_3D_NBDV 
-#if H_3D_IV_MERGE
-                if( !bIsDepth )
-                {
-#endif
-                  cMv.setIDVFlag   (true);
-                  cMv.setIDVHor    (cDv.getHor());                  
-                  cMv.setIDVVer    (cDv.getVer());  
-                  cMv.setIDVVId    (iViewIndex); 
-#if H_3D_IV_MERGE
-                }
-#endif
-#endif
-                clipMv( cMv );
-                paiPdmRefIdx  [ uiCurrRefListId ] = iPdmRefIdx;
-                pacPdmMv      [ uiCurrRefListId ] = cMv;
-                stopLoop = true;
-                break;
-              }
-            }
-          }
-        }
-      }
-    }
-  }
-  availableMcDc[0] = ( abPdmAvailable[0]? 1 : 0) + (abPdmAvailable[1]? 2 : 0);
-
-  if(availableMcDc[0])
-  {
-#endif
-  Int         iBasePosX, iBasePosY;
-  for (Int i=iCurrPosY; i < iCurrPosY + iHeight; i += iSPHeight)
-  {
-    for (Int j = iCurrPosX; j < iCurrPosX + iWidth; j += iSPWidth)
-    {
-      iBasePosX   = Clip3( 0, pcBaseRec->getWidth () - 1, j + iDelX + ( (cDv.getHor() + 2 ) >> 2 ));
-      iBasePosY   = Clip3( 0, pcBaseRec->getHeight() - 1, i + iDelY + ( (cDv.getVer() + 2 ) >> 2 )); 
-
-      pcBaseRec->getCUAddrAndPartIdx( iBasePosX , iBasePosY, iBaseCUAddr, iBaseAbsPartIdx );
-      pcBaseCU    = pcBasePic->getCU( iBaseCUAddr );
-      if(!( pcBaseCU->getPredictionMode( iBaseAbsPartIdx ) == MODE_INTRA ))
-      {
-        for( UInt uiCurrRefListId = 0; uiCurrRefListId < 2; uiCurrRefListId++ )
+    if( getPartitionSize(0) == SIZE_2Nx2N )
+    {
+      Int iNumSPInOneLine, iNumSP, iSPWidth, iSPHeight;
+      getSPPara(iWidth, iHeight, iNumSP, iNumSPInOneLine, iSPWidth, iSPHeight);
+
+      for (Int i=0; i<iNumSP; i++)
+      {
+        puhInterDirSP[i] = 0;
+        pcMvFieldSP[2*i].getMv().set(0, 0);
+        pcMvFieldSP[2*i+1].getMv().set(0,0);
+        pcMvFieldSP[2*i].setRefIdx(-1);
+        pcMvFieldSP[2*i+1].setRefIdx(-1);
+      }
+
+      Int         iBaseCUAddr;
+      Int         iBaseAbsPartIdx;
+      TComDataCU* pcBaseCU;
+      Int iPartition = 0;
+
+      Int iDelX = iSPWidth/2;
+      Int iDelY = iSPHeight/2;
+
+      Int         iCenterPosX = iCurrPosX + ( ( iWidth /  iSPWidth ) >> 1 )  * iSPWidth + ( iSPWidth >> 1 );
+      Int         iCenterPosY = iCurrPosY + ( ( iHeight /  iSPHeight ) >> 1 )  * iSPHeight + (iSPHeight >> 1);
+      Int         iRefCenterCUAddr, iRefCenterAbsPartIdx;
+
+      if(iWidth == iSPWidth && iHeight == iSPHeight)
+      {
+        iCenterPosX = iCurrPosX + (iWidth >> 1);
+        iCenterPosY = iCurrPosY + (iHeight >> 1);
+      }
+
+      Int iRefCenterPosX   = Clip3( 0, pcBaseRec->getWidth () - 1, iCenterPosX + ( (cDv.getHor() + 2 ) >> 2 ) );
+      Int iRefCenterPosY   = Clip3( 0, pcBaseRec->getHeight() - 1, iCenterPosY + ( (cDv.getVer() + 2 ) >> 2 ) ); 
+
+      pcBaseRec->getCUAddrAndPartIdx( iRefCenterPosX , iRefCenterPosY , iRefCenterCUAddr, iRefCenterAbsPartIdx );
+      TComDataCU* pcDefaultCU    = pcBasePic->getCU( iRefCenterCUAddr );
+      if(!( pcDefaultCU->getPredictionMode( iRefCenterAbsPartIdx ) == MODE_INTRA ))
+      {
+        for( UInt uiCurrRefListId = 0; uiCurrRefListId < 2; uiCurrRefListId++ )       
         {
           RefPicList  eCurrRefPicList = RefPicList( uiCurrRefListId );
-          Bool bLoop_stop = false;
-          for(Int iLoop = 0; iLoop < 2 && !bLoop_stop; ++iLoop)
+          Bool stopLoop = false;
+          for(Int iLoop = 0; iLoop < 2 && !stopLoop; ++iLoop)
           {
-            RefPicList eBaseRefPicList = (iLoop ==1)? RefPicList( 1 -  uiCurrRefListId ) : RefPicList( uiCurrRefListId );
-            TComMvField cBaseMvField;
-            pcBaseCU->getMvField( pcBaseCU, iBaseAbsPartIdx, eBaseRefPicList, cBaseMvField );
-            Int         iBaseRefIdx     = cBaseMvField.getRefIdx();
-            if (iBaseRefIdx >= 0)
+            RefPicList eDefaultRefPicList = (iLoop ==1)? RefPicList( 1 -  uiCurrRefListId ) : RefPicList( uiCurrRefListId );
+            TComMvField cDefaultMvField;
+            pcDefaultCU->getMvField( pcDefaultCU, iRefCenterAbsPartIdx, eDefaultRefPicList, cDefaultMvField );
+            Int         iDefaultRefIdx     = cDefaultMvField.getRefIdx();
+            if (iDefaultRefIdx >= 0)
             {
-              Int iBaseRefPOC = pcBaseCU->getSlice()->getRefPOC(eBaseRefPicList, iBaseRefIdx);
-              if (iBaseRefPOC != pcSlice->getPOC())    
+              Int iDefaultRefPOC = pcDefaultCU->getSlice()->getRefPOC(eDefaultRefPicList, iDefaultRefIdx);
+              if (iDefaultRefPOC != pcSlice->getPOC())    
               {
                 for (Int iPdmRefIdx = 0; iPdmRefIdx < pcSlice->getNumRefIdx( eCurrRefPicList ); iPdmRefIdx++)
                 {
-                  if (iBaseRefPOC == pcSlice->getRefPOC(eCurrRefPicList, iPdmRefIdx))
+                  if (iDefaultRefPOC == pcSlice->getRefPOC(eCurrRefPicList, iPdmRefIdx))
                   {
                     abPdmAvailable[ uiCurrRefListId ] = true;
-                    TComMv cMv(cBaseMvField.getHor(), cBaseMvField.getVer());
-
+                    TComMv cMv(cDefaultMvField.getHor(), cDefaultMvField.getVer());
+#if H_3D_NBDV 
+#if H_3D_IV_MERGE
                     if( !bIsDepth )
                     {
+#endif
                       cMv.setIDVFlag   (true);
                       cMv.setIDVHor    (cDv.getHor());                  
                       cMv.setIDVVer    (cDv.getVer());  
                       cMv.setIDVVId    (iViewIndex); 
+#if H_3D_IV_MERGE
                     }
-
+#endif
+#endif
                     clipMv( cMv );
-                    bLoop_stop = true;
-
-                    pcMvFieldSP[2*iPartition + uiCurrRefListId].setMvField(cMv, iPdmRefIdx);
+                    paiPdmRefIdx  [ uiCurrRefListId ] = iPdmRefIdx;
+                    pacPdmMv      [ uiCurrRefListId ] = cMv;
+                    stopLoop = true;
                     break;
                   }
@@ -7502,63 +6871,81 @@
         }
       }
-
-      puhInterDirSP[iPartition] = (pcMvFieldSP[2*iPartition].getRefIdx()!=-1 ? 1: 0) + (pcMvFieldSP[2*iPartition+1].getRefIdx()!=-1 ? 2: 0);
-      if (puhInterDirSP[iPartition] == 0)
-      {
-#if KHU_SIMP_SPIVMP_G0147
-        puhInterDirSP[iPartition] = availableMcDc[0];
-        pcMvFieldSP[2*iPartition].setMvField(pacPdmMv[0], paiPdmRefIdx[0]);
-        pcMvFieldSP[2*iPartition + 1].setMvField(pacPdmMv[1], paiPdmRefIdx[1]);
-#else
-        if (iInterDirLast != 0)
+      availableMcDc[0] = ( abPdmAvailable[0]? 1 : 0) + (abPdmAvailable[1]? 2 : 0);
+
+      if(availableMcDc[0])
+      {
+
+        Int         iBasePosX, iBasePosY;
+        for (Int i=iCurrPosY; i < iCurrPosY + iHeight; i += iSPHeight)
         {
-          puhInterDirSP[iPartition] = iInterDirLast;
-          pcMvFieldSP[2*iPartition] = cMvFieldLast[0];
-          pcMvFieldSP[2*iPartition + 1] = cMvFieldLast[1];
-        }
-#endif
-      }
-#if !KHU_SIMP_SPIVMP_G0147
-      else
-      {
-        if (iInterDirLast ==0)
-        {
-          availableMcDc[0] = puhInterDirSP[iPartition];
-          paiPdmRefIdx  [ 0 ] = pcMvFieldSP[2*iPartition].getRefIdx();
-          pacPdmMv      [ 0 ] = pcMvFieldSP[2*iPartition].getMv();
-          paiPdmRefIdx  [ 1 ] = pcMvFieldSP[2*iPartition+1].getRefIdx();
-          pacPdmMv      [ 1 ] = pcMvFieldSP[2*iPartition+1].getMv();
-
-          if (iPartition != 0)
+          for (Int j = iCurrPosX; j < iCurrPosX + iWidth; j += iSPWidth)
           {
-            for (Int iPart = iPartition-1; iPart >= 0; iPart--)
+            iBasePosX   = Clip3( 0, pcBaseRec->getWidth () - 1, j + iDelX + ( (cDv.getHor() + 2 ) >> 2 ));
+            iBasePosY   = Clip3( 0, pcBaseRec->getHeight() - 1, i + iDelY + ( (cDv.getVer() + 2 ) >> 2 )); 
+
+            pcBaseRec->getCUAddrAndPartIdx( iBasePosX , iBasePosY, iBaseCUAddr, iBaseAbsPartIdx );
+            pcBaseCU    = pcBasePic->getCU( iBaseCUAddr );
+            if(!( pcBaseCU->getPredictionMode( iBaseAbsPartIdx ) == MODE_INTRA ))
             {
-              puhInterDirSP[iPart] = puhInterDirSP[iPartition];
-              pcMvFieldSP[2*iPart] = pcMvFieldSP[2*iPartition];
-              pcMvFieldSP[2*iPart + 1] = pcMvFieldSP[2*iPartition + 1];
+              for( UInt uiCurrRefListId = 0; uiCurrRefListId < 2; uiCurrRefListId++ )
+              {
+                RefPicList  eCurrRefPicList = RefPicList( uiCurrRefListId );
+                Bool bLoop_stop = false;
+                for(Int iLoop = 0; iLoop < 2 && !bLoop_stop; ++iLoop)
+                {
+                  RefPicList eBaseRefPicList = (iLoop ==1)? RefPicList( 1 -  uiCurrRefListId ) : RefPicList( uiCurrRefListId );
+                  TComMvField cBaseMvField;
+                  pcBaseCU->getMvField( pcBaseCU, iBaseAbsPartIdx, eBaseRefPicList, cBaseMvField );
+                  Int         iBaseRefIdx     = cBaseMvField.getRefIdx();
+                  if (iBaseRefIdx >= 0)
+                  {
+                    Int iBaseRefPOC = pcBaseCU->getSlice()->getRefPOC(eBaseRefPicList, iBaseRefIdx);
+                    if (iBaseRefPOC != pcSlice->getPOC())    
+                    {
+                      for (Int iPdmRefIdx = 0; iPdmRefIdx < pcSlice->getNumRefIdx( eCurrRefPicList ); iPdmRefIdx++)
+                      {
+                        if (iBaseRefPOC == pcSlice->getRefPOC(eCurrRefPicList, iPdmRefIdx))
+                        {
+                          abPdmAvailable[ uiCurrRefListId ] = true;
+                          TComMv cMv(cBaseMvField.getHor(), cBaseMvField.getVer());
+
+                          if( !bIsDepth )
+                          {
+                            cMv.setIDVFlag   (true);
+                            cMv.setIDVHor    (cDv.getHor());                  
+                            cMv.setIDVVer    (cDv.getVer());  
+                            cMv.setIDVVId    (iViewIndex); 
+                          }
+
+                          clipMv( cMv );
+                          bLoop_stop = true;
+
+                          pcMvFieldSP[2*iPartition + uiCurrRefListId].setMvField(cMv, iPdmRefIdx);
+                          break;
+                        }
+                      }
+                    }
+                  }
+                }
+              }
             }
+
+            puhInterDirSP[iPartition] = (pcMvFieldSP[2*iPartition].getRefIdx()!=-1 ? 1: 0) + (pcMvFieldSP[2*iPartition+1].getRefIdx()!=-1 ? 2: 0);
+            if (puhInterDirSP[iPartition] == 0)
+            {
+              puhInterDirSP[iPartition] = availableMcDc[0];
+              pcMvFieldSP[2*iPartition].setMvField(pacPdmMv[0], paiPdmRefIdx[0]);
+              pcMvFieldSP[2*iPartition + 1].setMvField(pacPdmMv[1], paiPdmRefIdx[1]);
+
+            }
+            iPartition ++;
           }
         }
-        iInterDirLast = puhInterDirSP[iPartition];
-        cMvFieldLast[0] = pcMvFieldSP[2*iPartition];
-        cMvFieldLast[1] = pcMvFieldSP[2*iPartition + 1];
-      }
-#endif
-      iPartition ++;
-
-    }
-  }
-#if KHU_SIMP_SPIVMP_G0147
-  }
-#endif
-#if SEC_SPIVMP_MCP_SIZE_G0077
-  }
-#endif
-
-  iCurrPosX  += ( iWidth  >> 1 );
-  iCurrPosY  += ( iHeight >> 1 );
-#if QC_SPIVMP_MPI_G0119
- }
-#endif
+      }
+    }
+
+    iCurrPosX  += ( iWidth  >> 1 );
+    iCurrPosY  += ( iHeight >> 1 );
+  }
 #endif
 
@@ -7568,31 +6955,11 @@
 
 #if H_3D_SPIVMP
-#if QC_SPIVMP_MPI_G0119
- if(m_pcSlice->getIsDepth())
- {
-   iCurrPosX  += ( iWidth  >> 1 );
-   iCurrPosY  += ( iHeight >> 1 );
- }
-#if QC_DEPTH_MERGE_SIMP_G0127
-#if SEC_SPIVMP_MCP_SIZE_G0077
+  if(m_pcSlice->getIsDepth())
+  {
+    iCurrPosX  += ( iWidth  >> 1 );
+    iCurrPosY  += ( iHeight >> 1 );
+  }
   for(Int iLoopCan = ( (m_pcSlice->getIsDepth() || getPartitionSize(uiPartAddr) != SIZE_2Nx2N) ? 0 : 1 ); iLoopCan < ( 2 - m_pcSlice->getIsDepth() ); iLoopCan ++) 
 #else
- for(Int iLoopCan = ( 1 - m_pcSlice->getIsDepth() ); iLoopCan < ( 2 - m_pcSlice->getIsDepth() ); iLoopCan ++) 
-#endif
-#else
-#if SEC_SPIVMP_MCP_SIZE_G0077
- for(Int iLoopCan = ( (m_pcSlice->getIsDepth() || getPartitionSize(uiPartAddr) != SIZE_2Nx2N) ? 0 : 1 ); iLoopCan < 2; iLoopCan ++) 
-#else
- for(Int iLoopCan = ( 1 - m_pcSlice->getIsDepth() ); iLoopCan < 2; iLoopCan ++) 
-#endif
-#endif
-#else
-#if SEC_SPIVMP_MCP_SIZE_G0077
- for(Int iLoopCan = (getPartitionSize(uiPartAddr) == SIZE_2Nx2N ? 1 : 0); iLoopCan < 2; iLoopCan ++) 
-#else
-  for(Int iLoopCan = 1; iLoopCan < 2; iLoopCan ++) 
-#endif
-#endif
-#else
   for(Int iLoopCan = 0; iLoopCan < 2; iLoopCan ++)
 #endif
@@ -7601,26 +6968,15 @@
     // iLoopCan == 1 --> IvMCShift 
 
-#if !H_3D_SPIVMP || QC_SPIVMP_MPI_G0119
     Int         iBaseCUAddr;
     Int         iBaseAbsPartIdx;
-#endif
 
     Int offsetW = (iLoopCan == 0) ? 0 : ( ((iWidth /2)*4) + 4 );
     Int offsetH = (iLoopCan == 0) ? 0 : ( ((iHeight/2)*4) + 4 );
 
-#if H_3D_SPIVMP && !QC_SPIVMP_MPI_G0119
-    iBasePosX   = Clip3( 0, pcBaseRec->getWidth () - 1, iCurrPosX + ( (cDv.getHor() + offsetW + 2 ) >> 2 ) );
-    iBasePosY   = Clip3( 0, pcBaseRec->getHeight() - 1, iCurrPosY + ( (cDv.getVer() + offsetH + 2 ) >> 2 ) ); 
-#else
     Int         iBasePosX   = Clip3( 0, pcBaseRec->getWidth () - 1, iCurrPosX + ( (cDv.getHor() + offsetW + 2 ) >> 2 ) );
     Int         iBasePosY   = Clip3( 0, pcBaseRec->getHeight() - 1, iCurrPosY + ( (cDv.getVer() + offsetH + 2 ) >> 2 ) ); 
-#endif
     pcBaseRec->getCUAddrAndPartIdx( iBasePosX , iBasePosY , iBaseCUAddr, iBaseAbsPartIdx );
 
-#if H_3D_SPIVMP && !QC_SPIVMP_MPI_G0119
-    pcBaseCU    = pcBasePic->getCU( iBaseCUAddr );
-#else
     TComDataCU* pcBaseCU    = pcBasePic->getCU( iBaseCUAddr );
-#endif
     if(!( pcBaseCU->getPredictionMode( iBaseAbsPartIdx ) == MODE_INTRA ))
     {
@@ -7676,14 +7032,6 @@
   }
 #if H_3D_SPIVMP
-#if QC_SPIVMP_MPI_G0119
-#if QC_DEPTH_MERGE_SIMP_G0127
   for(Int iLoopCan = ( 1 - m_pcSlice->getIsDepth() ); iLoopCan < ( 2 - m_pcSlice->getIsDepth() ); iLoopCan ++) 
 #else
-  for(Int iLoopCan = ( 1 - m_pcSlice->getIsDepth() ); iLoopCan < 2; iLoopCan ++) 
-#endif
-#else
-  for(Int iLoopCan = 1; iLoopCan < 2; iLoopCan ++)
-#endif
-#else
   for(Int iLoopCan = 0; iLoopCan < 2; iLoopCan ++)
 #endif
@@ -7691,49 +7039,48 @@
     availableMcDc[(iLoopCan << 1)] = ( abPdmAvailable[(iLoopCan<<2)] ? 1 : 0 ) + ( abPdmAvailable[1 + (iLoopCan<<2)] ? 2 : 0);
   }
-  
-  
+
+
   ////////////////////////////////
   /////// IvDC + IvDCShift ///////
   ////////////////////////////////
-#if QC_DEPTH_MERGE_SIMP_G0127
+
   if( !getSlice()->getIsDepth() )
   {
-#endif
-  for( Int iRefListId = 0; iRefListId < 2 ; iRefListId++ )
-  {
-    RefPicList  eRefPicListDMV       = RefPicList( iRefListId );
-    Int         iNumRefPics       = pcSlice->getNumRefIdx( eRefPicListDMV );
-    for( Int iPdmRefIdx = 0; iPdmRefIdx < iNumRefPics; iPdmRefIdx++ )
-    {
-      if(( pcSlice->getRefPOC( eRefPicListDMV, iPdmRefIdx ) == pcSlice->getPOC()) && (pcSlice->getRefPic( eRefPicListDMV, iPdmRefIdx )->getViewIndex() == pDInfo->m_aVIdxCan))
-      {
-        for(Int iLoopCan = 0; iLoopCan < 2; iLoopCan ++)
+    for( Int iRefListId = 0; iRefListId < 2 ; iRefListId++ )
+    {
+      RefPicList  eRefPicListDMV       = RefPicList( iRefListId );
+      Int         iNumRefPics       = pcSlice->getNumRefIdx( eRefPicListDMV );
+      for( Int iPdmRefIdx = 0; iPdmRefIdx < iNumRefPics; iPdmRefIdx++ )
+      {
+        if(( pcSlice->getRefPOC( eRefPicListDMV, iPdmRefIdx ) == pcSlice->getPOC()) && (pcSlice->getRefPic( eRefPicListDMV, iPdmRefIdx )->getViewIndex() == pDInfo->m_aVIdxCan))
         {
-          Int ioffsetDV = (iLoopCan == 0) ? 0 : 4;
-          abPdmAvailable[ iRefListId + 2 + (iLoopCan<<2) ] = true;
-          paiPdmRefIdx  [ iRefListId + 2 + (iLoopCan<<2) ] = iPdmRefIdx;
+          for(Int iLoopCan = 0; iLoopCan < 2; iLoopCan ++)
+          {
+            Int ioffsetDV = (iLoopCan == 0) ? 0 : 4;
+            abPdmAvailable[ iRefListId + 2 + (iLoopCan<<2) ] = true;
+            paiPdmRefIdx  [ iRefListId + 2 + (iLoopCan<<2) ] = iPdmRefIdx;
 #if H_3D_NBDV_REF
-          TComMv cMv = depthRefineFlag ? pDInfo->m_acDoNBDV : pDInfo->m_acNBDV; 
-#endif
-          cMv.setHor( cMv.getHor() + ioffsetDV );
+            TComMv cMv = depthRefineFlag ? pDInfo->m_acDoNBDV : pDInfo->m_acNBDV; 
+#endif
+            cMv.setHor( cMv.getHor() + ioffsetDV );
 #if H_3D_IV_MERGE 
-          if( bIsDepth )
-            cMv.setHor((cMv.getHor()+2)>>2); 
-#endif
-          cMv.setVer( 0 );
-          clipMv( cMv );
-          pacPdmMv      [iRefListId + 2 + (iLoopCan<<2)] = cMv;
+            if( bIsDepth )
+            {
+              cMv.setHor((cMv.getHor()+2)>>2); 
+            }
+#endif
+            cMv.setVer( 0 );
+            clipMv( cMv );
+            pacPdmMv      [iRefListId + 2 + (iLoopCan<<2)] = cMv;
+          }
+          break;
         }
-        break;
-      }
-    }
-  }
-  for(Int iLoopCan = 0; iLoopCan < 2; iLoopCan ++)
-  {
-    availableMcDc[1 + (iLoopCan << 1)] = ( abPdmAvailable[2 + (iLoopCan<<2)] ? 1 : 0 ) + ( abPdmAvailable[3 + (iLoopCan<<2)] ? 2 : 0 );
-  }
-#if QC_DEPTH_MERGE_SIMP_G0127
-  }
-#endif
+      }
+    }
+    for(Int iLoopCan = 0; iLoopCan < 2; iLoopCan ++)
+    {
+      availableMcDc[1 + (iLoopCan << 1)] = ( abPdmAvailable[2 + (iLoopCan<<2)] ? 1 : 0 ) + ( abPdmAvailable[3 + (iLoopCan<<2)] ? 2 : 0 );
+    }
+  }
   return false;
 }
@@ -7809,5 +7156,5 @@
 #endif
 
-#if NTT_STORE_SPDV_VSP_G0148
+#if H_3D_VSP
 Void TComDataCU::setMvFieldPUForVSP( TComDataCU* pcCU, UInt partAddr, Int width, Int height, RefPicList eRefPicList, Int iRefIdx, Int &vspSize )
 {
@@ -7943,5 +7290,5 @@
 
 }
-#endif // NTT_STORE_SPDV_VSP_G0148
+#endif
 
 //! \}
Index: trunk/source/Lib/TLibCommon/TComDataCU.h
===================================================================
--- trunk/source/Lib/TLibCommon/TComDataCU.h	(revision 873)
+++ trunk/source/Lib/TLibCommon/TComDataCU.h	(revision 884)
@@ -192,18 +192,5 @@
 #if H_3D_DIM_SDC
   Bool*         m_pbSDCFlag;
-#if QC_SDC_UNIFY_G0130 && !SEC_INTER_SDC_G0101
-  Pel*          m_apSegmentDCOffset[4];
-#else
   Pel*          m_apSegmentDCOffset[2];
-#endif
-#endif
-#endif
-#if H_3D_INTER_SDC
-#if !QC_SDC_UNIFY_G0130
-  Bool*         m_pbInterSDCFlag;
-  Int*          m_apSegmentInterDCOffset[4];
-#endif
-#if !SEC_INTER_SDC_G0101
-  UChar*        m_pucInterSDCMask;
 #endif
 #endif
@@ -239,5 +226,5 @@
 #endif
 
-#if MTK_DDD_G0063
+#if H_3D_DDD
   UChar*        m_pucDisparityDerivedDepth;
   Bool*         m_pbUseDDD;
@@ -280,5 +267,5 @@
   Void xDeriveCenterIdx( UInt uiPartIdx, UInt& ruiPartIdxCenter );
 
-#if NTT_STORE_SPDV_VSP_G0148
+#if H_3D_VSP
   Void xSetMvFieldForVSP  ( TComDataCU *cu, TComPicYuv *picRefDepth, TComMv *dv, UInt partAddr, Int width, Int height, Int *shiftLUT, RefPicList refPicList, Int refIdx, Bool isDepth, Int &vspSize );
 #endif
@@ -499,9 +486,5 @@
 #if H_3D
   Void          rightShiftMergeCandList( TComMvField* pcMvFieldNeighbours, UChar* puhInterDirNeighbours, Int* iVSPIndexTrue, InheritedVSPDisInfo*  inheritedVSPDisInfo, UInt start, UInt num, Int &iCount3DV);
-#if SEC_DEPTH_DV_DERIVAITON_G0074
   Bool          getDispforDepth  ( UInt uiPartIdx, UInt uiPartAddr, DisInfo* cDisp);
-#else
-  Bool          getDispNeighBlocks  ( UInt uiPartIdx, UInt uiPartAddr, DisInfo* cDisp);
-#endif
   Bool          getDispMvPredCan(UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDis, Int* iPdm );
 #endif
@@ -573,25 +556,6 @@
   Pel           getSDCSegmentDCOffset( UInt uiSeg, UInt uiPartIdx ) { return m_apSegmentDCOffset[uiSeg][uiPartIdx]; }
   Void          setSDCSegmentDCOffset( Pel pOffset, UInt uiSeg, UInt uiPartIdx) { m_apSegmentDCOffset[uiSeg][uiPartIdx] = pOffset; }
-#if QC_GENERIC_SDC_G0122
   UInt          getCtxSDCFlag          ( UInt   uiAbsPartIdx );
   UInt          getCtxAngleFlag        ( UInt   uiAbsPartIdx );
-#endif
-#endif
-#endif
-#if H_3D_INTER_SDC
-#if !QC_SDC_UNIFY_G0130
-  Bool*         getInterSDCFlag     ()                        { return m_pbInterSDCFlag;               }
-  Bool          getInterSDCFlag     ( UInt uiIdx )            { return m_pbInterSDCFlag[uiIdx];        }
-  Void          setInterSDCFlagSubParts ( Bool bInterSDCFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth );
-  UInt          getCtxInterSDCFlag  ( UInt uiAbsPartIdx );
-  Int*          getInterSDCSegmentDCOffset( UInt uiSeg ) { return m_apSegmentInterDCOffset[uiSeg]; }
-  Int           getInterSDCSegmentDCOffset( UInt uiSeg, UInt uiPartIdx ) { return m_apSegmentInterDCOffset[uiSeg][uiPartIdx]; }
-  Void          setInterSDCSegmentDCOffset( Int pOffset, UInt uiSeg, UInt uiPartIdx) { m_apSegmentInterDCOffset[uiSeg][uiPartIdx] = pOffset; }
-
-#endif
-#if !SEC_INTER_SDC_G0101
-  Void          xSetInterSDCCUMask( TComDataCU *pcCU, UChar *pMask );
-
-  UChar*        getInterSDCMask     ()                        { return m_pucInterSDCMask;              }
 #endif
 #endif
@@ -701,7 +665,5 @@
   Void          setVSPFlag        ( UInt uiIdx, Int n )     { m_piVSPFlag[uiIdx] = n;      }
   Void          setVSPFlagSubParts( Char iVSPFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth );
-#if NTT_STORE_SPDV_VSP_G0148
   Void          setMvFieldPUForVSP    ( TComDataCU* cu, UInt partAddr, Int width, Int height, RefPicList refPicList, Int refIdx, Int &vspSize );
-#endif
 #endif
   Void          deriveLeftRightTopIdxGeneral  ( UInt uiAbsPartIdx, UInt uiPartIdx, UInt& ruiPartIdxLT, UInt& ruiPartIdxRT );
@@ -743,9 +705,4 @@
   UInt          getCTXARPWFlag                  ( UInt   uiAbsPartIdx                                 );
 #endif  
-#if !MTK_IC_FLAG_CABAC_SIMP_G0061
-#if H_3D_IC
-  UInt          getCtxICFlag                    ( UInt   uiAbsPartIdx                                 );
-#endif
-#endif
   UInt          getSliceStartCU         ( UInt pos )                  { return m_sliceStartCU[pos-m_uiAbsIdxInLCU];                                                                                          }
   UInt          getSliceSegmentStartCU  ( UInt pos )                  { return m_sliceSegmentStartCU[pos-m_uiAbsIdxInLCU];                                                                                   }
@@ -766,5 +723,5 @@
   UInt          getCoefScanIdx(UInt uiAbsPartIdx, UInt uiWidth, Bool bIsLuma, Bool bIsIntra);
 
-#if MTK_DDD_G0063
+#if H_3D_DDD
   UChar*       getDDDepth        ()                        { return m_pucDisparityDerivedDepth;        }
   UChar        getDDDepth        ( UInt uiIdx )            { return m_pucDisparityDerivedDepth[uiIdx]; }
Index: trunk/source/Lib/TLibCommon/TComMotionInfo.h
===================================================================
--- trunk/source/Lib/TLibCommon/TComMotionInfo.h	(revision 873)
+++ trunk/source/Lib/TLibCommon/TComMotionInfo.h	(revision 884)
@@ -176,5 +176,5 @@
   Void    setMvFieldSP ( TComDataCU* pcCU, UInt uiAbsPartIdx, TComMvField cMvField, Int iWidth, Int iHeight  );
 #endif
-#if NTT_STORE_SPDV_VSP_G0148
+#if H_3D_VSP
   Void    setMv         ( Int iIdx, TComMv const & rcMv ) { m_pcMv[iIdx] = rcMv; }
   Void    setRefIdx     ( Int iIdx, Int iRefIdx )         { m_piRefIdx[iIdx] = iRefIdx; }
Index: trunk/source/Lib/TLibCommon/TComPrediction.cpp
===================================================================
--- trunk/source/Lib/TLibCommon/TComPrediction.cpp	(revision 873)
+++ trunk/source/Lib/TLibCommon/TComPrediction.cpp	(revision 884)
@@ -416,9 +416,5 @@
 
 #if H_3D_DIM
-Void TComPrediction::predIntraLumaDepth( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiIntraMode, Pel* piPred, UInt uiStride, Int iWidth, Int iHeight, Bool bFastEnc
-#if QC_GENERIC_SDC_G0122
-  , TComWedgelet* dmm4Segmentation
-#endif
-  )
+Void TComPrediction::predIntraLumaDepth( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiIntraMode, Pel* piPred, UInt uiStride, Int iWidth, Int iHeight, Bool bFastEnc, TComWedgelet* dmm4Segmentation  )
 {
   assert( iWidth == iHeight  );
@@ -446,5 +442,4 @@
     case( DMM4_IDX ): 
       {
-#if QC_GENERIC_SDC_G0122
         if( dmm4Segmentation == NULL )
         { 
@@ -457,8 +452,4 @@
           dmmSegmentation = dmm4Segmentation;
         }
-#else
-        dmmSegmentation = new TComWedgelet( iWidth, iHeight );
-        xPredContourFromTex( pcCU, uiAbsPartIdx, iWidth, iHeight, dmmSegmentation );
-#endif
       } break;
     default: assert(0);
@@ -511,9 +502,5 @@
 
 #if H_3D_DIM_DMM
-#if QC_GENERIC_SDC_G0122
   if( dimType == DMM4_IDX && dmm4Segmentation == NULL ) { dmmSegmentation->destroy(); delete dmmSegmentation; }
-#else
-  if( dimType == DMM4_IDX ) { dmmSegmentation->destroy(); delete dmmSegmentation; }
-#endif
 #endif
 }
@@ -1103,5 +1090,5 @@
   pcCU->clipMv(cMv);
 
-#if MTK_DDD_G0063
+#if H_3D_DDD
   if( pcCU->getUseDDD( uiPartAddr ) )
   {
@@ -1182,5 +1169,4 @@
 Void TComPrediction::xPredInterUniVSP( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi )
 {
-#if NTT_STORE_SPDV_VSP_G0148
   Int vspSize = pcCU->getVSPFlag( uiPartAddr ) >> 1;
 
@@ -1197,61 +1183,6 @@
   }
   xPredInterUniSubPU( pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, rpcYuvPred, bi, widthSubPU, heightSubPU );
-
-#else // NTT_STORE_SPDV_VSP_G0148
-  // Get depth reference
-  Int       depthRefViewIdx = pcCU->getDvInfo(uiPartAddr).m_aVIdxCan;
-#if H_3D_FCO_VSP_DONBDV_E0163
-  TComPic* pRefPicBaseDepth = 0;
-  Bool     bIsCurrDepthCoded = false;
-  pRefPicBaseDepth  = pcCU->getSlice()->getIvPic( true, pcCU->getSlice()->getViewIndex() );
-  if ( pRefPicBaseDepth->getPicYuvRec() != NULL  ) 
-  {
-    bIsCurrDepthCoded = true;
-  }
-  else 
-  {
-    pRefPicBaseDepth = pcCU->getSlice()->getIvPic (true, depthRefViewIdx );
-  }
-#else
-  TComPic* pRefPicBaseDepth = pcCU->getSlice()->getIvPic (true, depthRefViewIdx );
-#endif
-  assert(pRefPicBaseDepth != NULL);
-  TComPicYuv* pcBaseViewDepthPicYuv = pRefPicBaseDepth->getPicYuvRec();
-  assert(pcBaseViewDepthPicYuv != NULL);
-
-  // Get texture reference
-  Int iRefIdx = pcCU->getCUMvField( eRefPicList )->getRefIdx( uiPartAddr );
-  assert(iRefIdx >= 0);
-  TComPic* pRefPicBaseTxt = pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx );
-  TComPicYuv* pcBaseViewTxtPicYuv = pRefPicBaseTxt->getPicYuvRec();
-  assert(pcBaseViewTxtPicYuv != NULL);
-
-  // Initialize LUT according to the reference viewIdx
-  Int txtRefViewIdx = pRefPicBaseTxt->getViewIndex();
-  Int* pShiftLUT    = pcCU->getSlice()->getDepthToDisparityB( txtRefViewIdx );
-  assert( txtRefViewIdx < pcCU->getSlice()->getViewIndex() );
-
-  // Do compensation
-  TComMv cDv  = pcCU->getDvInfo(uiPartAddr).m_acNBDV;
-  pcCU->clipMv(cDv);
-
-#if H_3D_FCO_VSP_DONBDV_E0163
-  if ( bIsCurrDepthCoded )
-  {
-      cDv.setZero();
-  }
-#endif
-  // fetch virtual depth map
-  pcBaseViewDepthPicYuv->extendPicBorder();
-
-  Int vspSize=0;
-  xGetVirtualDepth( pcCU, pcBaseViewDepthPicYuv, &cDv, uiPartAddr, iWidth, iHeight, &m_cYuvDepthOnVsp,vspSize );
-  // sub-PU based compensation
-  xPredInterLumaBlkFromDM   ( pcCU, pcBaseViewTxtPicYuv, &m_cYuvDepthOnVsp, pShiftLUT, &cDv, uiPartAddr, iWidth, iHeight, pcCU->getSlice()->getIsDepth(), rpcYuvPred, bi, vspSize);
-  xPredInterChromaBlkFromDM ( pcCU, pcBaseViewTxtPicYuv, &m_cYuvDepthOnVsp, pShiftLUT, &cDv, uiPartAddr, iWidth, iHeight, pcCU->getSlice()->getIsDepth(), rpcYuvPred, bi, vspSize);
-#endif // NTT_STORE_SPDV_VSP_G0148
-}
-
-#if NTT_STORE_SPDV_VSP_G0148
+}
+
 Void TComPrediction::xPredInterUniSubPU( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi, Int widthSubPU, Int heightSubPU )
 {
@@ -1278,5 +1209,4 @@
   }
 }
-#endif // NTT_STORE_SPDV_VSP_G0148
 
 #endif
@@ -2133,342 +2063,4 @@
 #endif
 
-#if H_3D_VSP
-#if !(NTT_STORE_SPDV_VSP_G0148)
-// not fully support iRatioTxtPerDepth* != 1
-Void TComPrediction::xGetVirtualDepth( TComDataCU *cu, TComPicYuv *picRefDepth, TComMv *mv, UInt partAddr, Int width, Int height, TComYuv *yuvDepth, Int &vspSize, Int ratioTxtPerDepthX, Int ratioTxtPerDepthY )
-{
-  Int nTxtPerDepthX = H_3D_VSP_BLOCKSIZE;
-  Int nTxtPerDepthY = H_3D_VSP_BLOCKSIZE;
-
-  Int refDepStride = picRefDepth->getStride();
-
-  Int refDepOffset  = ( (mv->getHor()+2) >> 2 ) + ( (mv->getVer()+2) >> 2 ) * refDepStride;
-  Pel *refDepth     = picRefDepth->getLumaAddr( cu->getAddr(), cu->getZorderIdxInCU() + partAddr );
-
-  if( ratioTxtPerDepthX!=1 || ratioTxtPerDepthY!=1 )
-  {
-    Int posX, posY;
-    refDepth    = picRefDepth->getLumaAddr( );
-    cu->getPic()->getPicYuvRec()->getTopLeftSamplePos( cu->getAddr(), cu->getZorderIdxInCU() + partAddr, posX, posY ); // top-left position in texture
-    posX /= ratioTxtPerDepthX; // texture position -> depth postion
-    posY /= ratioTxtPerDepthY;
-    refDepOffset += posX + posY * refDepStride;
-
-    width  /= ratioTxtPerDepthX; // texture size -> depth size
-    height /= ratioTxtPerDepthY;
-  }
-
-  refDepth += refDepOffset;
-
-  Int depStride = yuvDepth->getStride();
-  Pel *depth = yuvDepth->getLumaAddr();
-
-  if ((height % 8))
-  {
-    vspSize = 1; // 8x4
-  }
-  else if ((width % 8))
-  {
-    vspSize = 0; // 4x8
-  }
-  else
-  {
-    Bool ULvsBR, URvsBL;
-    ULvsBR = refDepth[0]       < refDepth[refDepStride * (height-1) + width-1];
-    URvsBL = refDepth[width-1] < refDepth[refDepStride * (height-1)];
-    vspSize = ( ULvsBR ^ URvsBL ) ? 0 : 1;
-  }
-  Int subBlockW, subBlockH;
-  Int depStrideTmp = depStride * nTxtPerDepthY;
-  if (vspSize)
-  {
-    subBlockW = 8;
-    subBlockH = 4;
-  }
-  else
-  {
-    subBlockW = 4;
-    subBlockH = 8;
-  }
-  for( Int y=0; y<height; y+=subBlockH )
-  {
-    Pel *refDepthTmp[4];
-    refDepthTmp[0] = refDepth + refDepStride * y;
-    refDepthTmp[1] = refDepthTmp[0] + subBlockW - 1;
-    refDepthTmp[2] = refDepthTmp[0] + refDepStride * (subBlockH - 1);
-    refDepthTmp[3] = refDepthTmp[2] + subBlockW - 1;
-    for( Int x=0; x<width; x+=subBlockW )
-    {
-      Pel  maxDepthVal;
-      maxDepthVal = refDepthTmp[0][x];
-      maxDepthVal = std::max( maxDepthVal, refDepthTmp[1][x]);
-      maxDepthVal = std::max( maxDepthVal, refDepthTmp[2][x]);
-      maxDepthVal = std::max( maxDepthVal, refDepthTmp[3][x]);
-      Pel *depthTmp = &depth[x+y*depStride];
-      for( Int sY=0; sY<subBlockH; sY+=nTxtPerDepthY )
-      {
-        for( Int sX=0; sX<subBlockW; sX+=nTxtPerDepthX )
-        {
-          depthTmp[sX] = maxDepthVal;
-        }
-        depthTmp += depStrideTmp;
-      }
-    }
-  }    
-}
-
-Void TComPrediction::xPredInterLumaBlkFromDM( TComDataCU *cu, TComPicYuv *picRef, TComYuv *yuvDepth, Int* shiftLUT, TComMv *mv, UInt partAddr, Int width, Int height, Bool isDepth, TComYuv *&yuvDst, Bool isBi, Int vspSize)
-{
-  Int nTxtPerDepthX = H_3D_VSP_BLOCKSIZE;
-  Int nTxtPerDepthY = H_3D_VSP_BLOCKSIZE;
-  
-  nTxtPerDepthX = nTxtPerDepthX << vspSize;
-  nTxtPerDepthY = nTxtPerDepthY << (1-vspSize);
-
-  Int refStride = picRef->getStride();
-  Int dstStride = yuvDst->getStride();
-  Int depStride = yuvDepth->getStride();
-  Int refStrideBlock = refStride  * nTxtPerDepthY;
-  Int dstStrideBlock = dstStride * nTxtPerDepthY;
-  Int depStrideBlock = depStride * nTxtPerDepthY;
-
-  Pel *ref    = picRef->getLumaAddr( cu->getAddr(), cu->getZorderIdxInCU() + partAddr );
-  Pel *dst    = yuvDst->getLumaAddr(partAddr);
-  Pel *depth  = yuvDepth->getLumaAddr();
-
-#if H_3D_VSP_BLOCKSIZE == 1
-#if H_3D_VSP_CONSTRAINED
-  //get LUT based horizontal reference range
-  Int range = xGetConstrainedSize(width, height);
-
-  // The minimum depth value
-  Int minRelativePos = MAX_INT;
-  Int maxRelativePos = MIN_INT;
-
-  Pel* depthTemp, *depthInitial=depth;
-  for (Int yTxt = 0; yTxt < height; yTxt++)
-  {
-    for (Int xTxt = 0; xTxt < width; xTxt++)
-    {
-      if (depthPosX+xTxt < widthDepth)
-      {
-        depthTemp = depthInitial + xTxt;
-      }
-      else
-      {
-        depthTemp = depthInitial + (widthDepth - depthPosX - 1);
-      }
-
-      Int disparity = shiftLUT[ *depthTemp ]; // << iShiftPrec;
-      Int disparityInt = disparity >> 2;
-
-      if( disparity <= 0)
-      {
-        if (minRelativePos > disparityInt+xTxt)
-        {
-          minRelativePos = disparityInt+xTxt;
-        }
-      }
-      else
-      {
-        if (maxRelativePos < disparityInt+xTxt)
-        {
-          maxRelativePos = disparityInt+xTxt;
-        }
-      }
-    }
-    if (depthPosY+yTxt < heightDepth)
-    {
-      depthInitial = depthInitial + depStride;
-    }
-  }
-
-  Int disparity_tmp = shiftLUT[ *depth ]; // << iShiftPrec;
-  if (disparity_tmp <= 0)
-  {
-    maxRelativePos = minRelativePos + range -1 ;
-  }
-  else
-  {
-    minRelativePos = maxRelativePos - range +1 ;
-  }
-#endif
-#endif // H_3D_VSP_BLOCKSIZE == 1
-
-  TComMv dv(0, 0);
-
-  for ( Int yTxt = 0; yTxt < height; yTxt += nTxtPerDepthY )
-  {
-    for ( Int xTxt = 0; xTxt < width; xTxt += nTxtPerDepthX )
-    {
-      Pel repDepth = depth[ xTxt ];
-      assert( repDepth >= 0 && repDepth <= 255 );
-
-      Int disparity = shiftLUT[ repDepth ]; // remove << iShiftPrec ??
-      Int xFrac = disparity & 0x3;
-
-      dv.setHor( disparity );
-      cu->clipMv( dv );
-
-      Int refOffset = xTxt + (dv.getHor() >> 2);
-      
-#if H_3D_VSP_CONSTRAINED
-      if(refOffset<minRelativePos || refOffset>maxRelativePos)
-      {
-        xFrac = 0;
-      }
-      refOffset = Clip3(minRelativePos, maxRelativePos, refOffset);
-#endif
-
-      assert( ref[refOffset] >= 0 && ref[refOffset]<= 255 );
-      m_if.filterHorLuma( &ref[refOffset], refStride, &dst[xTxt], dstStride, nTxtPerDepthX, nTxtPerDepthY, xFrac, !isBi );
-    }
-    ref   += refStrideBlock;
-    dst   += dstStrideBlock;
-    depth += depStrideBlock;
-  }
-
-}
-
-Void TComPrediction::xPredInterChromaBlkFromDM  ( TComDataCU *cu, TComPicYuv *picRef, TComYuv *yuvDepth, Int* shiftLUT, TComMv *mv, UInt partAddr, Int width, Int height, Bool isDepth, TComYuv *&yuvDst, Bool isBi, Int vspSize)
-{
-#if (H_3D_VSP_BLOCKSIZE==1)
-  Int nTxtPerDepthX = 1;
-  Int nTxtPerDepthY = 1;
-#else
-  Int nTxtPerDepthX = H_3D_VSP_BLOCKSIZE >> 1;
-  Int nTxtPerDepthY = H_3D_VSP_BLOCKSIZE >> 1;
-#endif
-
-  nTxtPerDepthX = nTxtPerDepthX << vspSize;
-  nTxtPerDepthY = nTxtPerDepthY << (1-vspSize);
-
-  Int refStride = picRef->getCStride();
-  Int dstStride = yuvDst->getCStride();
-  Int depStride = yuvDepth->getStride();
-  Int refStrideBlock = refStride * nTxtPerDepthY;
-  Int dstStrideBlock = dstStride * nTxtPerDepthY;
-  Int depStrideBlock = depStride * (nTxtPerDepthY<<1);
-
-  Pel *refCb  = picRef->getCbAddr( cu->getAddr(), cu->getZorderIdxInCU() + partAddr );
-  Pel *refCr  = picRef->getCrAddr( cu->getAddr(), cu->getZorderIdxInCU() + partAddr );
-  Pel *dstCb  = yuvDst->getCbAddr(partAddr);
-  Pel *dstCr  = yuvDst->getCrAddr(partAddr);
-  Pel *depth  = yuvDepth->getLumaAddr();
-
-#if H_3D_VSP_BLOCKSIZE == 1
-#if H_3D_VSP_CONSTRAINED
-  //get LUT based horizontal reference range
-  Int range = xGetConstrainedSize(width, height, false);
-
-  // The minimum depth value
-  Int minRelativePos = MAX_INT;
-  Int maxRelativePos = MIN_INT;
-
-  Int depthTmp;
-  for (Int yTxt=0; yTxt<height; yTxt++)
-  {
-    for (Int xTxt=0; xTxt<width; xTxt++)
-    {
-      depthTmp = m_pDepthBlock[xTxt+yTxt*width];
-      Int disparity = shiftLUT[ depthTmp ]; // << iShiftPrec;
-      Int disparityInt = disparity >> 3;//in chroma resolution
-
-      if (disparityInt < 0)
-      {
-        if (minRelativePos > disparityInt+xTxt)
-        {
-          minRelativePos = disparityInt+xTxt;
-        }
-      }
-      else
-      {
-        if (maxRelativePos < disparityInt+xTxt)
-        {
-          maxRelativePos = disparityInt+xTxt;
-        }
-      }
-    }
-  }
-
-  depthTmp = m_pDepthBlock[0];
-  Int disparity_tmp = shiftLUT[ depthTmp ]; // << iShiftPrec;
-  if ( disparity_tmp < 0 )
-  {
-    maxRelativePos = minRelativePos + range - 1;
-  }
-  else
-  {
-    minRelativePos = maxRelativePos - range + 1;
-  }
-
-#endif // H_3D_VSP_CONSTRAINED
-#endif // H_3D_VSP_BLOCKSIZE == 1
-
-  TComMv dv(0, 0);
-  // luma size -> chroma size
-  height >>= 1;
-  width  >>= 1;
-
-  for ( Int yTxt = 0; yTxt < height; yTxt += nTxtPerDepthY )
-  {
-    for ( Int xTxt = 0; xTxt < width; xTxt += nTxtPerDepthX )
-    {
-      Pel repDepth = depth[ xTxt<<1 ];
-      assert( repDepth >= 0 && repDepth <= 255 );
-
-      Int disparity = shiftLUT[ repDepth ]; // remove << iShiftPrec;
-      Int xFrac = disparity & 0x7;
-      
-      dv.setHor( disparity );
-      cu->clipMv( dv );
-
-      Int refOffset = xTxt + (dv.getHor() >> 3);
-
-#if H_3D_VSP_CONSTRAINED
-      if(refOffset<minRelativePos || refOffset>maxRelativePos)
-      {
-        xFrac = 0;
-      }
-      refOffset = Clip3(minRelativePos, maxRelativePos, refOffset);
-#endif
-
-      assert( refCb[refOffset] >= 0 && refCb[refOffset]<= 255 );
-      assert( refCr[refOffset] >= 0 && refCr[refOffset]<= 255 );
-
-      m_if.filterHorChroma( &refCb[refOffset], refStride, &dstCb[xTxt], dstStride, nTxtPerDepthX, nTxtPerDepthY, xFrac, !isBi );
-      m_if.filterHorChroma( &refCr[refOffset], refStride, &dstCr[xTxt], dstStride, nTxtPerDepthX, nTxtPerDepthY, xFrac, !isBi );
-    }
-    refCb += refStrideBlock;
-    refCr += refStrideBlock;
-    dstCb += dstStrideBlock;
-    dstCr += dstStrideBlock;
-    depth += depStrideBlock;
-  }
-}
-#endif
-
-#if H_3D_VSP_CONSTRAINED
-Int TComPrediction::xGetConstrainedSize(Int nPbW, Int nPbH, Bool bLuma)
-{
-  Int iSize = 0;
-  if (bLuma)
-  {
-    Int iArea = (nPbW+7) * (nPbH+7);
-    Int iAlpha = iArea / nPbH - nPbW - 7;
-    iSize = iAlpha + nPbW;
-  }
-  else // chroma
-  {
-    Int iArea = (nPbW+2) * (nPbH+2);
-    Int iAlpha = iArea / nPbH - nPbW - 4;
-    iSize = iAlpha + nPbW;
-  }
-  return iSize;
-}
-#endif // H_3D_VSP_CONSTRAINED
-
-#endif // H_3D_VSP
-
 #if H_3D_DIM
 Void TComPrediction::xPredBiSegDCs( Int* ptrSrc, UInt srcStride, Bool* biSegPattern, Int patternStride, Pel& predDC1, Pel& predDC2 )
@@ -2485,11 +2077,7 @@
   if( bL == bT )
   {
-#if SCU_HS_DEPTH_DC_PRED_G0143
     const Int  iTRR = ( patternStride * 2 - 1  ) - srcStride; 
     const Int  iLBB = ( patternStride * 2 - 1  ) * srcStride - 1;
     refDC1 = bL ? ( ptrSrc[iTR] + ptrSrc[iLB] )>>1 : (abs(ptrSrc[iTRR] - ptrSrc[-(Int)srcStride]) > abs(ptrSrc[iLBB] - ptrSrc[ -1]) ? ptrSrc[iTRR] : ptrSrc[iLBB]);
-#else
-    refDC1 = bL ? ( ptrSrc[iTR] + ptrSrc[iLB] )>>1 : 1<<( g_bitDepthY - 1 );
-#endif
     refDC2 =      ( ptrSrc[ -1] + ptrSrc[-(Int)srcStride] )>>1;
   }
@@ -2593,10 +2181,8 @@
   Int iSumPix[2];
   memset(iSumPix, 0, sizeof(Int)*2);
-#if QC_GENERIC_SDC_G0122
   for( Int i = 0; i < uiNumSegments; i++ )
   {
     rpSegMeans[i] = 0;
   }
-#endif
   if (orgDC == false)
   {
@@ -2613,5 +2199,4 @@
       rpSegMeans[ucSegmentRB] = pOrig[uiStride * (uiSize-1) + (uiSize-1) ];
     }
-#if QC_GENERIC_SDC_G0122
     else if( getDimType( uiIntraMode ) == DMM4_IDX )
     {
@@ -2647,7 +2232,4 @@
     }
     else
-#else
-    else if (uiIntraMode == PLANAR_IDX)
-#endif
     {
       Pel* pLeftTop = pOrig;
Index: trunk/source/Lib/TLibCommon/TComPrediction.h
===================================================================
--- trunk/source/Lib/TLibCommon/TComPrediction.h	(revision 873)
+++ trunk/source/Lib/TLibCommon/TComPrediction.h	(revision 884)
@@ -80,9 +80,6 @@
 
 #if H_3D_VSP
-  Int*   m_pDepthBlock;         ///< Store a depth block, local variable, to prevent memory allocation every time
-#if H_3D_VSP_CONSTRAINED
-  Int  xGetConstrainedSize(Int nPbW, Int nPbH, Bool bLuma = true);
-#endif
-  TComYuv   m_cYuvDepthOnVsp;
+  Int*    m_pDepthBlock;         ///< Store a depth block, local variable, to prevent memory allocation every time
+  TComYuv m_cYuvDepthOnVsp;
 #endif
 
@@ -121,11 +118,5 @@
 
 #if H_3D_VSP
-#if NTT_STORE_SPDV_VSP_G0148
   Void xPredInterUniSubPU        ( TComDataCU *cu, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi, Int widthSubPU=4, Int heightSubPU=4 );
-#else
-  Void xGetVirtualDepth           ( TComDataCU *cu, TComPicYuv *picRefDepth, TComMv *dv, UInt partAddr, Int width, Int height, TComYuv *yuvDepth, Int &vspSize, Int txtPerDepthX=1, Int txtPerDepthY=1 );
-  Void xPredInterLumaBlkFromDM    ( TComDataCU *cu, TComPicYuv *picRef, TComYuv *yuvDepth, Int* shiftLUT, TComMv *mv, UInt partAddr, Int width, Int height, Bool isDepth, TComYuv *&pcYuvDst, Bool isBi, Int vspSize);
-  Void xPredInterChromaBlkFromDM  ( TComDataCU *cu, TComPicYuv *picRef, TComYuv *yuvDepth, Int* shiftLUT, TComMv *mv, UInt partAddr, Int width, Int height, Bool isDepth, TComYuv *&pcYuvDst, Bool isBi, Int vspSize);
-#endif
 #endif
 
@@ -172,7 +163,5 @@
   // Depth intra
   Void predIntraLumaDepth         ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiIntraMode, Pel* piPred, UInt uiStride, Int iWidth, Int iHeight, Bool bFastEnc = false 
-#if QC_GENERIC_SDC_G0122
     , TComWedgelet* dmm4Segmentation = NULL
-#endif
     );
 #if H_3D_DIM_SDC
Index: trunk/source/Lib/TLibCommon/TComRdCost.cpp
===================================================================
--- trunk/source/Lib/TLibCommon/TComRdCost.cpp	(revision 873)
+++ trunk/source/Lib/TLibCommon/TComRdCost.cpp	(revision 884)
@@ -599,7 +599,6 @@
   cDtParam.uiComp       = 255;    // just for assert: to be sure it was set before use, since only values 0,1 or 2 are allowed.
 
-#if SCU_HS_VSD_BUGFIX_IMPROV_G0163
   cDtParam.bitDepth   = g_bitDepthY;
-#endif
+
   Dist dist = cDtParam.DistFunc( &cDtParam );
 
@@ -2985,10 +2984,6 @@
   dD = ( (Double) ( dDM >> DISTORTION_PRECISION_ADJUSTMENT( g_bitDepthY - 8 ) ) ) * m_dDisparityCoeff;
 
-#if SCU_HS_VSD_BUGFIX_IMPROV_G0163
   Double dDepthWeight = ( pOrg[x] >=  ( (1<<(g_bitDepthY - 3)) + (1<<(g_bitDepthY - 2)) ) ? 4 : pOrg[x] > ((1<<g_bitDepthY) >> 4) ? (Float)(pOrg[x] - ((1<<g_bitDepthY) >> 4))/(Float)((1<<g_bitDepthY) >> 3) + 1 : 1.0 );
   Double dTemp = ( 0.5 * fabs(dD) * dDepthWeight * ( abs( (Int) pVirRec[ x+y*iVirStride ] - (Int) pVirRec[ x-1+y*iVirStride ] ) + abs( (Int) pVirRec[ x+y*iVirStride ] - (Int) pVirRec[ x+1+y*iVirStride ] ) ) );
-#else
-  Double dTemp = ( 0.5 * fabs(dD) * ( abs( (Int) pVirRec[ x+y*iVirStride ] - (Int) pVirRec[ x-1+y*iVirStride ] ) + abs( (Int) pVirRec[ x+y*iVirStride ] - (Int) pVirRec[ x+1+y*iVirStride ] ) ) );
-#endif  
   iTemp = (Int) (((dTemp) < 0)? (Int)((dTemp) - 0.5) : (Int)((dTemp) + 0.5));
 
Index: trunk/source/Lib/TLibCommon/TComSlice.cpp
===================================================================
--- trunk/source/Lib/TLibCommon/TComSlice.cpp	(revision 873)
+++ trunk/source/Lib/TLibCommon/TComSlice.cpp	(revision 884)
@@ -112,5 +112,5 @@
 , m_interLayerPredEnabledFlag     (false)
 , m_numInterLayerRefPicsMinus1    (0)
-#if H_MV_HLS_7_POC_P0041
+#if H_MV
 , m_sliceSegmentHeaderExtensionLength (0)
 , m_pocResetIdc                       (0)
@@ -1284,5 +1284,4 @@
 
 
-
 /** Function for applying picture marking based on the Reference Picture Set in pReferencePictureSet.
 */
@@ -1340,5 +1339,5 @@
 
     }
-#if H_MV_HLS_7_MISC_P0130_20
+#if H_MV
     if( isReference ) // Current picture is in the temporal RPS
     {
@@ -1727,24 +1726,8 @@
     }
   } 
-#if !H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
-  m_vpsNumberLayerSetsMinus1     = -1; 
-#endif
   m_vpsNumProfileTierLevelMinus1 = -1; 
     
-#if !H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
-  for ( Int i = 0; i < MAX_VPS_PROFILE_TIER_LEVEL; i++)
-  {
-#if !H_MV_HLS_7_VPS_P0048_14
-    m_profileRefMinus1[ i ] = -1; 
-#endif
-  }
-    
-  m_moreOutputLayerSetsThanDefaultFlag = false;   
-  m_numAddOutputLayerSetsMinus1        = -1;   
-  m_defaultOneTargetOutputLayerIdc     = 0; 
-#else
   m_numAddOutputLayerSets              = -1;   
   m_defaultTargetOutputLayerIdc     = 0; 
-#endif
   
   for ( Int i = 0; i < MAX_VPS_OUTPUTLAYER_SETS; i++)
@@ -1756,11 +1739,6 @@
       m_outputLayerFlag[i][j] = false; 
     }
-#if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
     m_altOutputLayerFlag[ i ]       = false; 
-#endif
-  }
-#if !H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
-  m_altOutputLayerFlag       = false; 
-#endif
+  }
   m_maxOneActiveRefLayerFlag = false; 
   m_directDepTypeLenMinus2   = 0;         
@@ -1768,9 +1746,5 @@
 
   m_avcBaseLayerFlag = false;
-#if H_MV_HLS_7_VPS_P0307_23
   m_vpsNonVuiExtensionLength = 0;
-#else
-  m_vpsVuiOffset     = 0; 
-#endif
   m_splittingFlag    = false;
   
@@ -1786,7 +1760,4 @@
   {
     m_vpsProfilePresentFlag   [i] = false;
-#if !H_MV_HLS_7_VPS_P0048_14
-    m_profileRefMinus1[i] = 0;
-#endif
     m_outputLayerSetIdxMinus1       [i] = 0;
     for( Int j = 0; j < MAX_VPS_NUH_LAYER_ID_PLUS1; j++ )
@@ -2099,14 +2070,5 @@
 Int    TComVPS::getNumOutputLayerSets() 
 {
-#if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
   return getNumAddOutputLayerSets() + getVpsNumLayerSetsMinus1() + 1; 
-#else
-  Int numOutputLayerSets = getVpsNumberLayerSetsMinus1( ) + 1; 
-  if ( getMoreOutputLayerSetsThanDefaultFlag( ) )
-  {      
-    numOutputLayerSets += (getNumAddOutputLayerSetsMinus1( ) + 1); 
-}
-  return numOutputLayerSets; 
-#endif
 }
 
@@ -2156,5 +2118,4 @@
 }
 
-#if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
 Void TComVPS::initTargetLayerIdLists()
 {
@@ -2176,26 +2137,44 @@
   }  
 }
-#else
-Void TComVPS::deriveTargetLayerIdLists()
-{
-  m_targetDecLayerIdLists.resize( getNumOutputLayerSets() ); 
-  m_targetOptLayerIdLists.resize( getNumOutputLayerSets() ); 
-
-  for (Int targetOptLayerSetIdx = 0; targetOptLayerSetIdx < getNumOutputLayerSets(); targetOptLayerSetIdx++ )
-  {
-    Int targetDecLayerSetIdx = getOutputLayerSetIdxMinus1( targetOptLayerSetIdx ) + 1;     
-    Int lsIdx                = targetDecLayerSetIdx;
-
-    for( Int j = 0; j < getNumLayersInIdList( lsIdx ); j++ )
-    {
-      m_targetDecLayerIdLists[targetOptLayerSetIdx].push_back( m_layerSetLayerIdList[ lsIdx ][ j ] ); 
-      if( getOutputLayerFlag( targetOptLayerSetIdx, j  )) // This seems to be wrong in draft text
-      {
-        m_targetOptLayerIdLists[targetOptLayerSetIdx].push_back( m_layerSetLayerIdList[ lsIdx ][ j ] );
-      }
-    }  
-  }
-}
-#endif
+
+Bool TComVPS::inferOutputLayerFlag( Int i, Int j )
+{
+  Bool outputLayerFlag; 
+  switch ( getDefaultTargetOutputLayerIdc( ) )
+  {
+  case 0:
+    outputLayerFlag = true; 
+    break; 
+  case 1:
+    outputLayerFlag = ( j == m_layerSetLayerIdList[ getLayerSetIdxForOutputLayerSet( i ) ].size() - 1 );  
+    break;
+  case 2:
+    if ( i == 0 && j == 0)
+    {     
+      outputLayerFlag = true;  // This is a software only fix for a bug in the spec. In spec outputLayerFlag is neither present nor inferred. 
+    }
+    else
+    {
+      assert( 0 ); 
+    }
+    break; 
+  default:      
+    assert( 0 );
+    break; 
+  }
+  return outputLayerFlag;
+}
+
+Int TComVPS::getMaxSubLayersInLayerSetMinus1( Int i )
+{
+  Int maxSLMinus1 = 0; 
+  Int optLsIdx    = getLayerSetIdxForOutputLayerSet( i );
+  for( Int k = 0; k < getNumLayersInIdList( optLsIdx ); k++ )
+  {
+    Int lId = m_layerSetLayerIdList[optLsIdx][k];
+    maxSLMinus1 = std::max( maxSLMinus1, getSubLayersVpsMaxMinus1( getLayerIdInVps( lId ) ));
+  }
+  return maxSLMinus1;
+}
 
 #endif // H_MV
@@ -2445,7 +2424,5 @@
 , m_ppsInferScalingListFlag(false)
 , m_ppsScalingListRefLayerId(0)
-#if H_MV_HLS_7_POC_P0041
 , m_pocResetInfoPresentFlag(false)
-#endif
 #if H_3D
 , m_pcDLT(NULL)
@@ -2455,5 +2432,5 @@
   m_scalingList = new TComScalingList;
 
-#if H_MV_HLS_7_GEN_P0166_PPS_EXTENSION  
+#if H_MV
   for( Int i = 0; i < PS_EX_T_MAX_NUM; i++ ) 
   {
@@ -2461,5 +2438,4 @@
   }
 #endif
-
 }
 
@@ -2980,7 +2956,5 @@
     // Consider to check here: 
     // "If the current picture is a RADL picture, there shall be no entry in the RefPicSetInterLayer0 and RefPicSetInterLayer1 that is a RASL picture. "    
-#if H_MV_HLS_7_MISC_P0130_20
     assert( picRef->getSlice(0)->getDiscardableFlag() == false ); // "There shall be no picture that has discardable_flag equal to 1 in RefPicSetInterLayer0 or RefPicSetInterLayer1".        
-#endif
   }
 }
@@ -3018,5 +2992,5 @@
     {
       break; 
-  }        
+    }        
   }        
 
@@ -3028,29 +3002,29 @@
       if ( pcPic )
       {
-      if( pcPic->getSlice(0)->isReferenced() && pcPic->getSlice(0)->getTemporalLayerNonReferenceFlag() ) 
-      { 
-        Bool remainingInterLayerReferencesFlag = false; 
-        for( Int j = latestDecIdx + 1; j < numTargetDecLayers; j++ )
+        if( pcPic->getSlice(0)->isReferenced() && pcPic->getSlice(0)->getTemporalLayerNonReferenceFlag() ) 
         { 
-          TComVPS* vpsSlice = pcPic->getSlice(0)->getVPS(); 
-          if ( vps->nuhLayerIdIncluded( targetDecLayerIdSet[ j ] ) )
+          Bool remainingInterLayerReferencesFlag = false; 
+          for( Int j = latestDecIdx + 1; j < numTargetDecLayers; j++ )
+          { 
+            TComVPS* vpsSlice = pcPic->getSlice(0)->getVPS(); 
+            if ( vps->nuhLayerIdIncluded( targetDecLayerIdSet[ j ] ) )
+            {
+              for( Int k = 0; k < vpsSlice->getNumDirectRefLayers( targetDecLayerIdSet[ j ] ); k++ )
+              {
+                if ( targetDecLayerIdSet[ i ] == vpsSlice->getRefLayerId( targetDecLayerIdSet[ j ],  k  ) )
+                {
+                  remainingInterLayerReferencesFlag = true;
+                }
+              }
+            }
+          }
+          if( !remainingInterLayerReferencesFlag )
           {
-            for( Int k = 0; k < vpsSlice->getNumDirectRefLayers( targetDecLayerIdSet[ j ] ); k++ )
-            {
-              if ( targetDecLayerIdSet[ i ] == vpsSlice->getRefLayerId( targetDecLayerIdSet[ j ],  k  ) )
-              {
-                remainingInterLayerReferencesFlag = true;
+            pcPic->getSlice(0)->setReferenced( false );                   
           }
         }
-          }
-        }
-        if( !remainingInterLayerReferencesFlag )
-        {
-          pcPic->getSlice(0)->setReferenced( false );                   
-      }
-    }
-      }
-  }
-}
+      }
+    }
+  }
 }
 
@@ -3157,9 +3131,5 @@
   Int numActiveRefLayerPics; 
 
-#if H_MV_HLS_7_MISC_P0079_18
   if( getLayerId() == 0 || getNumRefLayerPics() ==  0 )
-#else
-  if( getLayerId() == 0 || getVPS()->getNumDirectRefLayers( getLayerId() ) ==  0 )
-#endif
   {
     numActiveRefLayerPics = 0; 
@@ -3175,9 +3145,5 @@
   else if( getVPS()->getMaxOneActiveRefLayerFlag() || getVPS()->getNumDirectRefLayers( getLayerId() ) == 1 )
   {
-#if H_MV_HLS_7_MISC_P0079_18
     numActiveRefLayerPics = 1; 
-#else
-    numActiveRefLayerPics = getRefLayerPicFlag( 0 ) ? 1 : 0; 
-#endif
   }
   else
@@ -3207,13 +3173,10 @@
     for ( Int refListIdx = 0; refListIdx < ((m_eSliceType==B_SLICE) ? 2 : 1); refListIdx++ )
     {
-#if MTK_ARP_REF_SELECTION_G0053
       Int diffPOC=MAX_INT;
       Int idx=-1;
-#endif
       for(Int i = 0; i < getNumRefIdx(RefPicList(refListIdx)); i++ )
       {
         if ( getRefPic(RefPicList(refListIdx), i)->getPOC() != getPOC() )
         {
-#if MTK_ARP_REF_SELECTION_G0053
           if( abs(getRefPic(RefPicList(refListIdx), i)->getPOC() - getPOC()) < diffPOC)
           {
@@ -3221,15 +3184,9 @@
             idx=i;
           }
-#else
-          setFirstTRefIdx (RefPicList(refListIdx), i);
-          break;
-#endif
         }
-#if MTK_ARP_REF_SELECTION_G0053
         if(idx>=0)
         {
           setFirstTRefIdx (RefPicList(refListIdx), idx);
         }
-#endif
       }
     }
@@ -3368,5 +3325,5 @@
 #endif
 
-#if MTK_DDD_G0063
+#if H_3D_DDD
   if( getIsDepth() && getViewIndex() > 0 )
   {
@@ -3426,5 +3383,5 @@
     }
 
-#if MTK_DDD_G0063
+#if H_3D_DDD
     InitializeDDDPara( vps->getCamParPrecision(), codScale[ i ], codOffset[ i ], i );
 #endif
@@ -3434,5 +3391,5 @@
 #endif
 
-#if MTK_DDD_G0063
+#if H_3D_DDD
 Void TComSlice::InitializeDDDPara( UInt uiCamParsCodedPrecision, Int  iCodedScale,Int  iCodedOffset, Int iBaseViewIdx )
 {
@@ -3837,7 +3794,5 @@
 {
   m_crossLayerIrapAlignedFlag = true; 
-#if H_MV_HLS_7_MISC_P0068_21
   m_allLayersIdrAlignedFlag   = false; 
-#endif
   m_bitRatePresentVpsFlag = false;
   m_picRatePresentVpsFlag = false;
@@ -3866,7 +3821,5 @@
       m_minHorizontalCtuOffsetPlus1 [i][j] = -1;
     }
-#if H_MV_HLS_7_MISC_P0182_13
     m_baseLayerParameterSetCompatibilityFlag[i] = false;
-#endif
   }
   for ( Int i = 0; i < MAX_NUM_VIDEO_SIGNAL_INFO; i++ )
@@ -3889,4 +3842,17 @@
   if ( m_vpsVuiBspHrdParameters ) delete m_vpsVuiBspHrdParameters;
   m_vpsVuiBspHrdParameters = NULL; 
+}
+
+Void TComVPSVUI::inferVpsVui( Bool encoderFlag )
+{
+  // inference of syntax elements that differ from default inference (as done in constructor), when VPS VUI is not present
+  if (!encoderFlag )
+  {
+    setCrossLayerIrapAlignedFlag( false ); 
+  }
+  else
+  {
+    assert( !getCrossLayerIrapAlignedFlag() ); 
+  }
 }
 
@@ -3955,3 +3921,23 @@
   setMatrixCoefficients     ( videoSignalInfo->getMatrixCoeffsVps           () );
 }
-#endif
+
+TComDpbSize::TComDpbSize()
+{
+  for (Int i = 0; i < MAX_VPS_OUTPUTLAYER_SETS; i++ )
+  {      
+    m_subLayerFlagInfoPresentFlag[i]  = false;
+
+    for (Int j = 0; j < MAX_TLAYER; j++  )
+    {        
+      m_subLayerDpbInfoPresentFlag [i][j] = ( j == 0) ;
+      m_maxVpsNumReorderPics       [i][j] = 0;
+      m_maxVpsLatencyIncreasePlus1 [i][j] = 0;
+
+      for (Int k = 0; k < MAX_NUM_LAYER_IDS; k++ )
+      {
+        m_maxVpsDecPicBufferingMinus1[i][k][j] = 0; 
+      }
+    }
+  }
+}
+#endif
Index: trunk/source/Lib/TLibCommon/TComSlice.h
===================================================================
--- trunk/source/Lib/TLibCommon/TComSlice.h	(revision 873)
+++ trunk/source/Lib/TLibCommon/TComSlice.h	(revision 884)
@@ -473,7 +473,5 @@
   Bool m_crossLayerPicTypeAlignedFlag;
   Bool m_crossLayerIrapAlignedFlag;
-#if H_MV_HLS_7_MISC_P0068_21
   Bool m_allLayersIdrAlignedFlag;
-#endif
   Bool m_bitRatePresentVpsFlag;
   Bool m_picRatePresentVpsFlag;
@@ -484,10 +482,8 @@
   Int  m_constantPicRateIdc          [MAX_VPS_OP_SETS_PLUS1][MAX_TLAYER];
   Int  m_avgPicRate                  [MAX_VPS_OP_SETS_PLUS1][MAX_TLAYER];
-#if H_MV_HLS_7_VPS_P0076_15
   Bool m_videoSignalInfoIdxPresentFlag;
   Int  m_vpsNumVideoSignalInfoMinus1;
   TComVideoSignalInfo* m_videoSignalInfo[MAX_NUM_VIDEO_SIGNAL_INFO];   
   Int  m_vpsVideoSignalInfoIdx       [MAX_NUM_VIDEO_SIGNAL_INFO];
-#endif
   Bool m_tilesNotInUseFlag;
   Bool m_tilesInUseFlag              [MAX_NUM_LAYERS];
@@ -500,15 +496,7 @@
   Bool m_ctuBasedOffsetEnabledFlag   [MAX_NUM_LAYERS][MAX_NUM_LAYERS];
   Int  m_minHorizontalCtuOffsetPlus1 [MAX_NUM_LAYERS][MAX_NUM_LAYERS];
-#if !H_MV_HLS_7_VPS_P0076_15
-  Bool m_videoSignalInfoIdxPresentFlag;
-  Int  m_vpsNumVideoSignalInfoMinus1;
-  TComVideoSignalInfo* m_videoSignalInfo[MAX_NUM_VIDEO_SIGNAL_INFO];   
-  Int  m_vpsVideoSignalInfoIdx       [MAX_NUM_VIDEO_SIGNAL_INFO];
-#endif
   Bool m_vpsVuiBspHrdPresentFlag;
   TComVpsVuiBspHrdParameters* m_vpsVuiBspHrdParameters; 
-#if H_MV_HLS_7_MISC_P0182_13
   Bool m_baseLayerParameterSetCompatibilityFlag[MAX_NUM_LAYERS];
-#endif
 
 public: 
@@ -521,8 +509,6 @@
   Bool getCrossLayerIrapAlignedFlag(  ) { return m_crossLayerIrapAlignedFlag; } 
 
-#if H_MV_HLS_7_MISC_P0068_21
   Void setAllLayersIdrAlignedFlag( Bool flag ) { m_allLayersIdrAlignedFlag = flag; } 
   Bool getAllLayersIdrAlignedFlag(  ) { return m_allLayersIdrAlignedFlag; } 
-#endif
 
   Void setBitRatePresentVpsFlag( Bool flag ) { m_bitRatePresentVpsFlag = flag; } 
@@ -550,5 +536,4 @@
   Int  getAvgPicRate( Int i, Int j ) { return m_avgPicRate[i][j]; } 
 
-#if H_MV_HLS_7_VPS_P0076_15
   Void setVideoSignalInfoIdxPresentFlag( Bool flag ) { m_videoSignalInfoIdxPresentFlag = flag; } 
   Bool getVideoSignalInfoIdxPresentFlag(  ) { return m_videoSignalInfoIdxPresentFlag; } 
@@ -562,5 +547,4 @@
   Void setVpsVideoSignalInfoIdx( Int i, Int  val ) { m_vpsVideoSignalInfoIdx[i] = val; } 
   Int  getVpsVideoSignalInfoIdx( Int i ) { return m_vpsVideoSignalInfoIdx[i]; } 
-#endif
 
   Void setTilesNotInUseFlag( Bool flag ) { m_tilesNotInUseFlag = flag; } 
@@ -593,17 +577,5 @@
   Void setMinHorizontalCtuOffsetPlus1( Int i, Int j, Int  val ) { m_minHorizontalCtuOffsetPlus1[i][j] = val; } 
   Int  getMinHorizontalCtuOffsetPlus1( Int i, Int j ) { return m_minHorizontalCtuOffsetPlus1[i][j]; } 
-#if !H_MV_HLS_7_VPS_P0076_15
-  Void setVideoSignalInfoIdxPresentFlag( Bool flag ) { m_videoSignalInfoIdxPresentFlag = flag; } 
-  Bool getVideoSignalInfoIdxPresentFlag(  ) { return m_videoSignalInfoIdxPresentFlag; } 
-
-  Void    setVideoSignalInfo( Int i, TComVideoSignalInfo* val )                        { m_videoSignalInfo[i] = val;  }  
-  TComVideoSignalInfo* getVideoSignalInfo( Int i )                                     { return m_videoSignalInfo[i]; }
-
-  Void setVpsNumVideoSignalInfoMinus1( Int  val ) { m_vpsNumVideoSignalInfoMinus1 = val; } 
-  Int  getVpsNumVideoSignalInfoMinus1(  ) { return m_vpsNumVideoSignalInfoMinus1; } 
-
-  Void setVpsVideoSignalInfoIdx( Int i, Int  val ) { m_vpsVideoSignalInfoIdx[i] = val; } 
-  Int  getVpsVideoSignalInfoIdx( Int i ) { return m_vpsVideoSignalInfoIdx[i]; } 
-#endif
+
   Void setVpsVuiBspHrdPresentFlag( Bool flag ) { m_vpsVuiBspHrdPresentFlag = flag; } 
   Bool getVpsVuiBspHrdPresentFlag(  ) { return m_vpsVuiBspHrdPresentFlag; }
@@ -612,24 +584,8 @@
   TComVpsVuiBspHrdParameters* getVpsVuiBspHrdParameters(  ) { return m_vpsVuiBspHrdParameters; }
 
-#if H_MV_HLS_7_MISC_P0182_13
   Void setBaseLayerParameterSetCompatibilityFlag( Int i, Bool flag ) { m_baseLayerParameterSetCompatibilityFlag[i] = flag; } 
   Bool getBaseLayerParameterSetCompatibilityFlag( Int i ) { return m_baseLayerParameterSetCompatibilityFlag[i]; } 
-#endif
-
-#if H_MV_HLS_7_FIX_INFER_CROSS_LAYER_IRAP_ALIGNED_FLAG
-  Void inferVpsVui( Bool encoderFlag )
-  {
-    // inference of syntax elements that differ from default inference (as done in constructor), when VPS VUI is not present
-    if (!encoderFlag )
-    {
-      setCrossLayerIrapAlignedFlag( false ); 
-    }
-    else
-    {
-      assert( !getCrossLayerIrapAlignedFlag() ); 
-    }
-
-  }
-#endif
+
+  Void inferVpsVui( Bool encoderFlag );
 };
 
@@ -686,23 +642,5 @@
 
 public: 
-  TComDpbSize( )
-  {
-    for (Int i = 0; i < MAX_VPS_OUTPUTLAYER_SETS; i++ )
-    {      
-      m_subLayerFlagInfoPresentFlag[i]  = false;
-
-      for (Int j = 0; j < MAX_TLAYER; j++  )
-      {        
-        m_subLayerDpbInfoPresentFlag [i][j] = ( j == 0) ;
-        m_maxVpsNumReorderPics       [i][j] = 0;
-        m_maxVpsLatencyIncreasePlus1 [i][j] = 0;
-
-        for (Int k = 0; k < MAX_NUM_LAYER_IDS; k++ )
-        {
-          m_maxVpsDecPicBufferingMinus1[i][k][j] = 0; 
-        }
-      }
-    }  
-  }  
+  TComDpbSize( );  
 
   Void setSubLayerFlagInfoPresentFlag( Int i, Bool flag ) { m_subLayerFlagInfoPresentFlag[i] = flag; } 
@@ -768,9 +706,5 @@
   /// VPS EXTENSION SYNTAX ELEMENTS
   Bool        m_avcBaseLayerFlag;
-#if H_MV_HLS_7_VPS_P0307_23
   Int         m_vpsNonVuiExtensionLength;
-#else
-  Int         m_vpsVuiOffset;
-#endif
   Bool        m_splittingFlag;
   Bool        m_scalabilityMaskFlag          [MAX_NUM_SCALABILITY_TYPES];
@@ -788,30 +722,14 @@
   Int         m_maxTidIlRefPicsPlus1     [MAX_NUM_LAYERS][MAX_NUM_LAYERS];
   Bool        m_allRefLayersActiveFlag;
-#if !H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
-  Int         m_vpsNumberLayerSetsMinus1; 
-#endif
   Int         m_vpsNumProfileTierLevelMinus1;   
   Bool        m_vpsProfilePresentFlag    [MAX_VPS_OP_SETS_PLUS1];
 
-#if !H_MV_HLS_7_VPS_P0048_14
-  Int         m_profileRefMinus1         [MAX_VPS_PROFILE_TIER_LEVEL];
-#endif
-#if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
   Int         m_numAddOutputLayerSets;    
   Int         m_defaultTargetOutputLayerIdc;
-#else  
-  Bool        m_moreOutputLayerSetsThanDefaultFlag;
-  Int         m_numAddOutputLayerSetsMinus1;    
-  Int         m_defaultOneTargetOutputLayerIdc;
-#endif
 
   Int         m_outputLayerSetIdxMinus1  [MAX_VPS_OUTPUTLAYER_SETS];  
   Bool        m_outputLayerFlag          [MAX_VPS_OUTPUTLAYER_SETS][MAX_VPS_NUH_LAYER_ID_PLUS1];
   Int         m_profileLevelTierIdx      [MAX_VPS_OUTPUTLAYER_SETS ];
-#if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
   Bool        m_altOutputLayerFlag       [MAX_VPS_OUTPUTLAYER_SETS];
-#else
-  Bool        m_altOutputLayerFlag;
-#endif
   Bool        m_repFormatIdxPresentFlag;
   Int         m_vpsNumRepFormatsMinus1;
@@ -869,8 +787,6 @@
 #if H_3D_SPIVMP
   Int         m_iSubPULog2Size           [MAX_NUM_LAYERS   ];
-#endif
-#endif
-#if QC_SPIVMP_MPI_G0119
   Int         m_iSubPUMPILog2Size;
+#endif
 #endif
 #if H_3D_VSP
@@ -974,11 +890,6 @@
   Bool    getAvcBaseLayerFlag()                                            { return m_avcBaseLayerFlag; } 
 
-#if H_MV_HLS_7_VPS_P0307_23
   Void    setVpsNonVuiExtensionLength( Int  val )                          { m_vpsNonVuiExtensionLength = val; } 
   Int     getVpsNonVuiExtensionLength(  )                                  { return m_vpsNonVuiExtensionLength; } 
-#else
-  Void    setVpsVuiOffset( Int  val )                                      { m_vpsVuiOffset = val; } 
-  Int     getVpsVuiOffset(  )                                              { return m_vpsVuiOffset; } 
-#endif
 
   Void    setSplittingFlag( Bool val )                                     { m_splittingFlag = val;  }
@@ -988,4 +899,5 @@
   Void    setScalabilityMaskFlag( Int scalType, Bool val )                     { m_scalabilityMaskFlag[scalType] = val;  }
   Bool    getScalabilityMaskFlag( Int scalType )                               { return m_scalabilityMaskFlag[scalType]; }
+  
   Int     getNumScalabilityTypes( );
 
@@ -1009,23 +921,24 @@
   Void    setViewIdVal( Int viewOrderIndex, Int  val )                     { m_viewIdVal[viewOrderIndex] = val; } 
   Int     getViewIdVal( Int viewOrderIndex )                               { return m_viewIdVal[viewOrderIndex]; } 
+  
   Void    setDirectDependencyFlag( Int depLayeridInVps, Int refLayeridInVps, Bool val ) { m_directDependencyFlag[depLayeridInVps][refLayeridInVps] = val;  }
   Bool    getDirectDependencyFlag( Int depLayeridInVps, Int refLayeridInVps )           { return m_directDependencyFlag[depLayeridInVps][refLayeridInVps]; }
+  
   Void    setVpsSubLayersMaxMinus1PresentFlag( Bool flag )                 { m_vpsSubLayersMaxMinus1PresentFlag = flag; } 
   Bool    getVpsSubLayersMaxMinus1PresentFlag(  )                          { return m_vpsSubLayersMaxMinus1PresentFlag; } 
+  
   Void    setSubLayersVpsMaxMinus1( Int i, Int  val )                      { m_subLayersVpsMaxMinus1[i] = val; } 
   Int     getSubLayersVpsMaxMinus1( Int i )                                { return m_subLayersVpsMaxMinus1[i]; } 
   Void    checkSubLayersVpsMaxMinus1( Int i )                              { assert( m_subLayersVpsMaxMinus1[i] >= 0 && m_subLayersVpsMaxMinus1[i] <= m_uiMaxTLayers - 1 ); }
+
   Void    setMaxTidRefPresentFlag( Bool flag )                             { m_maxTidRefPresentFlag = flag; } 
   Bool    getMaxTidRefPresentFlag(  )                                      { return m_maxTidRefPresentFlag; } 
+
   Void    setMaxTidIlRefPicsPlus1( Int i, Int j, Int  val )                { m_maxTidIlRefPicsPlus1[i][j] = val; } 
   Int     getMaxTidIlRefPicsPlus1( Int i, Int j )                          { return m_maxTidIlRefPicsPlus1[i][j]; } 
+ 
   Void    setAllRefLayersActiveFlag( Bool flag )                           { m_allRefLayersActiveFlag = flag; } 
   Bool    getAllRefLayersActiveFlag(  )                                    { return m_allRefLayersActiveFlag; } 
   
-#if !H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
-  Void    setVpsNumberLayerSetsMinus1( Int val )                           { m_vpsNumberLayerSetsMinus1 = val;  } 
-  Int     getVpsNumberLayerSetsMinus1( )                                   { return m_vpsNumberLayerSetsMinus1; } 
-#endif
-  
   Void    setVpsNumProfileTierLevelMinus1( Int val )                       { m_vpsNumProfileTierLevelMinus1 = val;  } 
   Int     getVpsNumProfileTierLevelMinus1( )                               { return m_vpsNumProfileTierLevelMinus1; } 
@@ -1034,31 +947,9 @@
   Bool    getVpsProfilePresentFlag( Int idx )                              { return m_vpsProfilePresentFlag[idx]; }
 
-#if !H_MV_HLS_7_VPS_P0048_14
-  Void    setProfileRefMinus1( Int profileTierLevelIdx, Int val )          { m_profileRefMinus1[ profileTierLevelIdx ] = val;  } 
-  Int     getProfileRefMinus1( Int profileTierLevelIdx )                   { return m_profileRefMinus1[ profileTierLevelIdx ]; } 
-  Void    checkProfileRefMinus1( Int i )                                   { assert( getProfileRefMinus1( i ) + 1 <= i ); };  //  The value of profile_ref_minus1[ i ] + 1 shall be less than or equal to i.
-#endif
-
-#if !H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
-  Void    setMoreOutputLayerSetsThanDefaultFlag( Bool flag )               { m_moreOutputLayerSetsThanDefaultFlag = flag; } 
-  Bool    getMoreOutputLayerSetsThanDefaultFlag()                          { return m_moreOutputLayerSetsThanDefaultFlag; } 
-#endif
-  
-#if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
   Void    setNumAddOutputLayerSets( Int val )                              { m_numAddOutputLayerSets = val; } 
   Int     getNumAddOutputLayerSets( )                                      { return m_numAddOutputLayerSets; } 
-#else
-  Void    setNumAddOutputLayerSetsMinus1( Int val )                        { m_numAddOutputLayerSetsMinus1 = val; } 
-  Int     getNumAddOutputLayerSetsMinus1( )                                { return m_numAddOutputLayerSetsMinus1; } 
-#endif
-  
-#if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
+  
   Void    setDefaultTargetOutputLayerIdc( Int  val )                       { m_defaultTargetOutputLayerIdc = val; } 
   Int     getDefaultTargetOutputLayerIdc(  )                               { return m_defaultTargetOutputLayerIdc; }   
-#else
-  Void    setDefaultOneTargetOutputLayerIdc( Int  val )                    { m_defaultOneTargetOutputLayerIdc = val; } 
-  Int     getDefaultOneTargetOutputLayerIdc(  )                            { return m_defaultOneTargetOutputLayerIdc; } 
-  Void    checkDefaultOneTargetOutputLayerIdc( )                           { assert( m_defaultOneTargetOutputLayerIdc >= 0 && m_defaultOneTargetOutputLayerIdc <= 1 ); }
-#endif
   
   Void    setOutputLayerSetIdxMinus1( Int outLayerSetIdx, Int val )        { m_outputLayerSetIdxMinus1[ outLayerSetIdx ]  = val; } 
@@ -1067,46 +958,12 @@
   Void    setOutputLayerFlag( Int outLayerSetIdx, Int i, Bool flag )       { m_outputLayerFlag[ outLayerSetIdx ][ i ] = flag; } 
   Bool    getOutputLayerFlag( Int outLayerSetIdx, Int i )                  { return m_outputLayerFlag[ outLayerSetIdx ][ i ]; } 
-#if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
-  Bool    inferOutputLayerFlag( Int i, Int j )                             
-  { 
-    Bool outputLayerFlag; 
-    switch ( getDefaultTargetOutputLayerIdc( ) )
-    {
-    case 0:
-      outputLayerFlag = true; 
-      break; 
-    case 1:
-      outputLayerFlag = ( j == m_layerSetLayerIdList[ getLayerSetIdxForOutputLayerSet( i ) ].size() - 1 );  
-      break;
-    case 2:
-      if ( i == 0 && j == 0)
-      {     
-        outputLayerFlag = true;  // This is a software only fix for a bug in the spec. In spec outputLayerFlag neither present nor inferred. 
-      }
-      else
-      {
-        assert( 0 ); 
-      }
-      break; 
-    default:      
-      assert( 0 );
-      break; 
-    }
-    return outputLayerFlag;
-  }
-#else
-  Bool    inferOutputLayerFlag( Int layerSetIdx, Int i )                   { return ( getDefaultOneTargetOutputLayerIdc( ) == 0 || ( ( getDefaultOneTargetOutputLayerIdc( ) == 1 ) && ( i == m_layerSetLayerIdList[layerSetIdx].size() - 1  ) ));  }
-#endif
+
+  Bool    inferOutputLayerFlag( Int i, Int j );
 
   Void    setProfileLevelTierIdx( Int outLayerSetIdx, Int val )            { m_profileLevelTierIdx[ outLayerSetIdx ] = val; }
   Int     getProfileLevelTierIdx( Int outLayerSetIdx )                     { return m_profileLevelTierIdx[ outLayerSetIdx ]; } 
   
-#if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
   Void    setAltOutputLayerFlag( Int i, Bool flag )                        { m_altOutputLayerFlag[i] = flag; } 
   Bool    getAltOutputLayerFlag( Int i )                                   { return m_altOutputLayerFlag[i]; } 
-#else
-  Void    setAltOutputLayerFlag( Bool flag )                               { m_altOutputLayerFlag = flag; } 
-  Bool    getAltOutputLayerFlag(  )                                        { return m_altOutputLayerFlag; } 
-#endif
 
   Void    setRepFormatIdxPresentFlag( Bool flag )                          { m_repFormatIdxPresentFlag = flag; } 
@@ -1121,4 +978,5 @@
   Void    setRepFormat( Int i, TComRepFormat* val )                        { m_repFormat[i] = val;  }
   TComRepFormat* getRepFormat( Int i )                                     { return m_repFormat[i]; }
+  
   Void    setMaxOneActiveRefLayerFlag( Bool flag)                          { m_maxOneActiveRefLayerFlag = flag; } 
   Bool    getMaxOneActiveRefLayerFlag( )                                   { return m_maxOneActiveRefLayerFlag; } 
@@ -1134,4 +992,5 @@
   Void    setPocLsbNotPresentFlag( Int i, Bool flag )                      { m_pocLsbNotPresentFlag[i] = flag; } 
   Bool    getPocLsbNotPresentFlag( Int i )                                 { return m_pocLsbNotPresentFlag[i]; } 
+  
   Void    setDirectDepTypeLenMinus2( Int val)                              { m_directDepTypeLenMinus2 = val; } 
   Int     getDirectDepTypeLenMinus2( )                                     { return m_directDepTypeLenMinus2; } 
@@ -1142,4 +1001,5 @@
   Void    setDefaultDirectDependencyType( Int  val )                       { m_defaultDirectDependencyType = val; } 
   Int     getDefaultDirectDependencyType(  )                               { return m_defaultDirectDependencyType; } 
+  
   Void    setDirectDependencyType( Int depLayeridInVps, Int refLayeridInVps, Int val) { m_directDependencyType[ depLayeridInVps ][ refLayeridInVps ] = val; } 
   Int     getDirectDependencyType( Int depLayeridInVps, Int refLayeridInVps)   { return m_directDependencyType[ depLayeridInVps ][ refLayeridInVps ]; } 
@@ -1167,8 +1027,6 @@
 
   Int     getProfileLevelTierIdxLen()                                      { return gCeilLog2( getVpsNumProfileTierLevelMinus1() + 1 ); };       
-
-#if H_MV_HLS_7_VPS_P0306_22
   Int     getVpsRepFormatIdxLen()                                          { return gCeilLog2( getVpsNumRepFormatsMinus1() + 1 ); };       
-#endif
+
   Int     getNumLayersInIdList ( Int lsIdx );
 
@@ -1178,5 +1036,4 @@
   Void    deriveLayerSetLayerIdList();
 
-#if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
   Int     getLayerSetIdxForOutputLayerSet( Int i )                         { return ( i <= getVpsNumLayerSetsMinus1() ) ? i  : getOutputLayerSetIdxMinus1( i ) + 1 ; };
 
@@ -1189,23 +1046,6 @@
   Int     getNumOutputLayersInOutputLayerSet( Int i )                      { return (Int) getTargetOptLayerIdList( i ).size(); }; 
   Int     getOlsHighestOutputLayerId( Int i )                              { return getTargetOptLayerIdList( i ).back(); };  
-#else
-  Void    deriveTargetLayerIdLists();
-  std::vector<Int> getTargetDecLayerIdList( Int targetOptLayerSetIdx )     { return m_targetDecLayerIdLists[targetOptLayerSetIdx]; }; 
-  std::vector<Int> getTargetOptLayerIdList( Int targetOptLayerSetIdx )     { return m_targetDecLayerIdLists[targetOptLayerSetIdx]; }; 
-#endif
-
-#if H_MV_HLS_7_HRD_P0156_7
-  Int     getMaxSubLayersInLayerSetMinus1( Int i )
-  { 
-    Int maxSLMinus1 = 0; 
-    Int optLsIdx    = getLayerSetIdxForOutputLayerSet( i );
-    for( Int k = 0; k < getNumLayersInIdList( optLsIdx ); k++ )
-    {
-      Int lId = m_layerSetLayerIdList[optLsIdx][k];
-      maxSLMinus1 = std::max( maxSLMinus1, getSubLayersVpsMaxMinus1( getLayerIdInVps( lId ) ));
-    }
-    return maxSLMinus1; 
-  }
-#endif
+
+  Int     getMaxSubLayersInLayerSetMinus1( Int i );
 
   // inference
@@ -1232,7 +1072,5 @@
   UInt getCamParPrecision    ()  { return m_uiCamParPrecision; }
   Bool getCamParPresent      ( Int viewIndex )  { return m_bCamParPresent[viewIndex]; }
-#if FIX_CAM_PARS_COLLECTOR
   Void setCamParPresent      ( Int viewIndex, Bool val )  { m_bCamParPresent[viewIndex] = val; }
-#endif
   Bool hasCamParInSliceHeader( Int viewIndex )  { return m_bCamParInSliceHeader[viewIndex]; }
   Void setHasCamParInSliceHeader( Int viewIndex, Bool b )  { m_bCamParInSliceHeader[viewIndex] = b; }
@@ -1248,9 +1086,7 @@
   Int     getSubPULog2Size(Int layerIdInVps)           { return m_iSubPULog2Size[layerIdInVps]; }
   Void    setSubPULog2Size(Int layerIdInVps, Int u)    { m_iSubPULog2Size[layerIdInVps] = u;}
-#endif
-#endif
-#if QC_SPIVMP_MPI_G0119
   Int     getSubPUMPILog2Size( )           { return m_iSubPUMPILog2Size; }
   Void    setSubPUMPILog2Size( Int u )     { m_iSubPUMPILog2Size = u;    }
+#endif
 #endif
 #if H_3D_VSP
@@ -1940,10 +1776,6 @@
   Int  m_ppsScalingListRefLayerId;
 
-#if H_MV_HLS_7_GEN_P0166_PPS_EXTENSION
   Bool m_ppsExtensionTypeFlag[PS_EX_T_MAX_NUM];
-#endif
-#if H_MV_HLS_7_POC_P0041
   Bool m_pocResetInfoPresentFlag;
-#endif
 #endif
 
@@ -2088,14 +1920,9 @@
   Int  getPpsScalingListRefLayerId(  ) { return m_ppsScalingListRefLayerId; } 
 
-#if H_MV_HLS_7_GEN_P0166_PPS_EXTENSION
   Void setPpsExtensionTypeFlag( Int i, Bool flag ) { m_ppsExtensionTypeFlag[i] = flag; } 
   Bool getPpsExtensionTypeFlag( Int i ) { return m_ppsExtensionTypeFlag[i]; } 
-#endif
-
-#if H_MV_HLS_7_POC_P0041
+
   Void setPocResetInfoPresentFlag( Bool flag ) { m_pocResetInfoPresentFlag = flag; } 
   Bool getPocResetInfoPresentFlag(  ) { return m_pocResetInfoPresentFlag; } 
-#endif
-
 #endif
 };
@@ -2243,5 +2070,4 @@
   Int        m_interLayerPredLayerIdc       [MAX_NUM_LAYERS];
 
-#if H_MV_HLS_7_POC_P0041
   Int        m_sliceSegmentHeaderExtensionLength;
   Int        m_pocResetIdc;
@@ -2252,5 +2078,4 @@
   Int        m_pocMsbVal;
   Bool       m_pocMsbValRequiredFlag;
-#endif
 
 #if H_3D
@@ -2278,5 +2103,5 @@
 #endif
 
-#if MTK_DDD_G0063
+#if H_3D_DDD
   Int          m_aiDDDInvScale [MAX_NUM_LAYERS];
   Int          m_aiDDDInvOffset[MAX_NUM_LAYERS];
@@ -2600,5 +2425,4 @@
   Int  getInterLayerPredLayerIdc( Int i ) { return m_interLayerPredLayerIdc[i]; } 
 
-#if H_MV_HLS_7_POC_P0041
   Void setSliceSegmentHeaderExtensionLength( Int  val ) { m_sliceSegmentHeaderExtensionLength = val; } 
   Int  getSliceSegmentHeaderExtensionLength(  ) { return m_sliceSegmentHeaderExtensionLength; } 
@@ -2637,5 +2461,4 @@
     return getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA;
   }
-#endif
 
   // Additional variables derived in slice header semantics 
@@ -2658,5 +2481,5 @@
 
 #endif
-#if MTK_DDD_G0063
+#if H_3D_DDD
   Void InitializeDDDPara( UInt uiCamParsCodedPrecision, Int  iCodedScale,Int  iCodedOffset, Int iBaseViewIdx );
   Int  getDepthFromDV( Int iDV, Int iBaseViewIdx )
Index: trunk/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- trunk/source/Lib/TLibCommon/TypeDef.h	(revision 873)
+++ trunk/source/Lib/TLibCommon/TypeDef.h	(revision 884)
@@ -76,5 +76,6 @@
 #if H_3D
 #define H_3D_QTLPC                        1   // OL_QTLIMIT_PREDCODING_B0068 //JCT3V-B0068
-                                              // HHI_QTLPC_RAU_OFF_C0160     // JCT3V-C0160 change 2: quadtree limitation and predictive coding switched off in random access units 
+                                              // HHI_QTLPC_RAU_OFF_C0160 JCT3V-C0160 change 2: quadtree limitation and predictive coding switched off in random access units 
+                                              // MTK_TEX_DEP_PAR_G0055 Texture-partition-dependent depth partition. JCT3V-G0055
 
 #define H_3D_VSO                          1   // VSO, View synthesis optimization, includes: 
@@ -83,4 +84,5 @@
                                               // SAIT_VSO_EST_A0033, JCT3V-A0033 modification 3
                                               // LGE_WVSO_A0119
+                                              // SCU_HS_VSD_BUGFIX_IMPROV_G0163
 #define H_3D_NBDV                         1   // Neighboring block disparity derivation 
                                               // QC_JCT3V-A0097 
@@ -102,4 +104,7 @@
                                               // SHARP_ARP_REF_CHECK_F0105        ARP reference picture selection and DPB check
                                               // LGE_ARP_CTX_F0161                JCT3V-F0161
+                                              // MTK_ARP_FLAG_CABAC_SIMP_G0061 Use 2 context for ARP flag referring to only left neighbor block in JCT3V-G0061
+                                              // MTK_ARP_REF_SELECTION_G0053 ARP Reference picture selection in JCT3V-G0053 
+
 #define H_3D_IC                           1   // Illumination Compensation, JCT3V-B0045, JCT3V-C0046, JCT3V-D0060
                                               // Unifying rounding offset, for IC part, JCT3V-D0135
@@ -109,4 +114,6 @@
                                               // LGE_IC_CTX_F0160 //JCT3V-F0160
                                               // SEC_ONLY_TEXTURE_IC_F0151
+                                              // MTK_IC_FLAG_CABAC_SIMP_G0061
+                                              // SEC_IC_ARP_SIG_G0072, Disabling IC when ARP is enabled, option 1 in JCT3V-G0072, part 2 in JCT3V-G0121
 
 #if H_3D_NBDV
@@ -133,4 +140,6 @@
                                               // MTK_VSP_SIMPLIFICATION_F0111 1. Inherited VSP also use NBDV of current CU, 2. VSP cannot be inherited from above LCU rowss
                                               // LGE_SHARP_VSP_INHERIT_F0104 
+                                              // NTT_STORE_SPDV_VSP_G0148 Storing Sub-PU based DV for VSP
+                                              // Restricted bi-prediction for VSP
 
 #define H_3D_IV_MERGE                     1   // Inter-view motion merge candidate
@@ -145,4 +154,8 @@
                                               // ETRIKHU_MERGE_REUSE_F0093 QC_DEPTH_IV_MRG_F0125, JCT3V-F0125: Depth oriented Inter-view MV candidate
                                               // EC_MPI_ENABLING_MERGE_F0150, MPI flag in VPS and enabling in Merge mode
+                                              // MTK_NBDV_IVREF_FIX_G0067      , Disable IvMC, VSP when IVREF is not available, JCT3V-G0067
+                                              // SEC_DEPTH_DV_DERIVAITON_G0074, Simplification of DV derivation for depth, JCT3V-G0074
+                                              // QC_DEPTH_MERGE_SIMP_G0127 Remove DV candidate and shifting candidate for depth coding
+
 #define H_3D_TMVP                         1   // QC_TMVP_C0047 
                                               // Sony_M23639
@@ -173,8 +186,26 @@
                                               // SEC_DMM3_RBC_F0147 Removal of DMM3 and RBC from DMMs
                                               // QC_DIM_DELTADC_UNIFY_F0132 Unify delta DC coding in depth intra modes
+                                              // Unify intra SDC and inter SDC
+                                              // QC_GENERIC_SDC_G0122 Generalize SDC to all depth intra modes
+                                              // SCU_HS_DEPTH_DC_PRED_G0143
+                                              // HS_TSINGHUA_SDC_SPLIT_G0111
+                                              // QC_PKU_SDC_SPLIT_G0123 Intra SDC Split
+
+
 
 #define H_3D_INTER_SDC                    1   // INTER SDC, Inter simplified depth coding
-                                              // LGE_INTER_SDC_E0156  Enable inter SDC for depth coding
+                                              // LGE_INTER_SDC_E0156 Enable inter SDC for depth coding
+                                              // SEC_INTER_SDC_G0101 Improved inter SDC with multiple DC candidates
+
 #define H_3D_SPIVMP                       1   // H_3D_SPIVMP    // JCT3V-F0110: Sub-PU level inter-view motion prediction
+                                              // SEC_SPIVMP_MCP_SIZE_G0077, Apply SPIVMP only to 2Nx2N partition, JCT3V-G0077
+                                              // QC_SPIVMP_MPI_G0119 Sub-PU level MPI merge candidate
+                                              // Simplification on Sub-PU level temporal interview motion prediction
+
+
+#define H_3D_DBBP                         1   // DBBP: Depth-based Block Partitioning and Merging
+
+#define H_3D_DDD                          1   // Disparity derived depth coding
+
 #define H_3D_FCO                          0   // Flexible coding order for 3D
 
@@ -258,4 +289,11 @@
 
 
+///// ***** DEPTH BASED BLOCK PARTITIONING *********
+#if H_3D_DBBP
+#define DBBP_INVALID_SHORT                (-4)
+#define RWTH_DBBP_PACK_MODE               SIZE_2NxN
+#endif
+
+
 ///// ***** FCO *********
 #if H_3D_FCO
@@ -269,67 +307,8 @@
 #endif
 
-
 /////////////////////////////////////////////////////////////////////////////////////////
-///////////////////////////////////   HTM-10.0 Integrations //////////////////////////////
+///////////////////////////////////   TBD                  //////////////////////////////
 /////////////////////////////////////////////////////////////////////////////////////////
-#if H_3D
-#if  H_3D_QTLPC
-#define MTK_TEX_DEP_PAR_G0055             1   // Texture-partition-dependent depth partition. JCT3V-G0055
-#endif
-
-#define MTK_DDD_G0063                     1   // Disparity derived depth coding
-#define HTM10RC1_FIX                           1   // Fix of DDD
-
-
-#if H_3D_VSP
-#define MTK_RBIP_VSP_G0069                1   // Restricted bi-prediction for VSP
-#define NTT_STORE_SPDV_VSP_G0148          1   // Storing Sub-PU based DV for VSP
-#endif
-
-#define H_3D_DBBP                         1   // DBBP: Depth-based Block Partitioning and Merging
-
-#if H_3D_DBBP
-#define DBBP_INVALID_SHORT                (-4)
-#define RWTH_DBBP_PACK_MODE               SIZE_2NxN
-#endif
-
-#if H_3D_DIM
-#define QC_PKU_SDC_SPLIT_G0123            1   // Intra SDC Split
-#if QC_PKU_SDC_SPLIT_G0123
-#define HS_TSINGHUA_SDC_SPLIT_G0111       1
-#endif
-#define SCU_HS_DEPTH_DC_PRED_G0143        1
-#define QC_GENERIC_SDC_G0122              1  // Generalize SDC to all depth intra modes
-#if H_3D_DIM_SDC && H_3D_INTER_SDC
-#define QC_SDC_UNIFY_G0130                1  // Unify intra SDC and inter SDC
-#define QC_SDC_UNIFY_G0130_FIX            1  // Fix bug of G0130
-#define QC_SDC_UNIFY_G0130_FIX2           1  // Fix bug of G0130
-#endif
-#define SEC_INTER_SDC_G0101               1  // Improved inter SDC with multiple DC candidates
-#endif
-
-#define KHU_SIMP_SPIVMP_G0147             1  // Simplification on Sub-PU level temporal interview motion prediction
-
-#if H_3D_SPIVMP
-#define QC_SPIVMP_MPI_G0119               1 // Sub-PU level MPI merge candidate
-#endif
-
-#define QC_DEPTH_MERGE_SIMP_G0127         1 // Remove DV candidate and shifting candidate for depth coding
-#define SEC_IC_ARP_SIG_G0072              1   // Disabling IC when ARP is enabled, option 1 in JCT3V-G0072, part 2 in JCT3V-G0121
-#define SCU_HS_VSD_BUGFIX_IMPROV_G0163    1
-#define SEC_SPIVMP_MCP_SIZE_G0077         1  // Apply SPIVMP only to 2Nx2N partition, JCT3V-G0077
-#define SEC_DEPTH_DV_DERIVAITON_G0074     1  // Simplification of DV derivation for depth, JCT3V-G0074
-#define MTK_ARP_REF_SELECTION_G0053       1   // ARP Reference picture selection in JCT3V-G0053 
-#define MTK_ARP_FLAG_CABAC_SIMP_G0061     1   // Use 2 context for ARP flag referring to only left neighbor block in JCT3V-G0061
-#define MTK_IC_FLAG_CABAC_SIMP_G0061      1   // Use only 1 context for IC flag in JCT3V-G0061
-#define MTK_NBDV_IVREF_FIX_G0067          1   // Disable IvMC, VSP when IVREF is not available, JCT3V-G0067
-#endif
-
-/////////////////////////////////////////////////////////////////////////////////////////
-///////////////////////////////////   HTM-10.1 Integrations //////////////////////////////
-/////////////////////////////////////////////////////////////////////////////////////////
-
-
-// TBD
+
 // #define H_MV_HLS_7_POC_P0041_3            0 // (POC/P0041/POC reset) #3 It was remarked that we should require each non-IRAP picture that has discardable_flag equal to 1 to have NUT value indicating that it is a sub-layer non-reference picture. This was agreed. Decision: Adopt (with constraint for discardable_flag as described above) 
 // #define H_MV_HLS_7_POC_P0041_FIXES        0 // (POC/P0041/Fixes) For each non-IRAP picture that has discardable_flag equal to 1 to have NUT value indicating that it is a sub-layer non-reference picture. 
@@ -343,41 +322,8 @@
 // #define H_MV_HLS_7_VPS_P0300_27           0 // Output part only. (VPS/P0300/alt output layer flag) #27 Change alt output layer flag to be signalled within the loop of output layer sets, from JCTVC-P0300-v2. Decision: Adopt. 
 
-
-#define H_MV_HLS_7_VPS_P0306_22                1 // (VPS/P0306/ue(v) coded syntax elements) #22 Several minor modifications to the VPS syntax, consistent with eliminating the previous intention to avoid ue(v) parsing in the VPS 
-#define H_MV_HLS_7_SEI_P0204_26                1 // (SEI/P0204/sub-bitstream SEI) #26 Add sub-bitstream property SEI message. Decision: Adopt
-#define H_MV_HLS_7_MISC_P0130_20               1 // (MISC/P0130/discardable not in inter-layer RPS) #20 Add constraint restricting pictures marked as discardable from being present in the temporal or inter-layer RPS,
-#define H_MV_HLS_7_VPS_P0125_24                1 // (VPS/P0125/VPS extension offset ) #24 Decision: Keep it as a reserved FFFF value. 
-#define H_MV_HLS_7_VPS_P0307_23                1 // (VPS/P0307/VPS VUI extension)  #23 Decision: Adopt modification in P0307.
-#define H_MV_HLS_7_POC_P0041                   1 // Syntax related to POC reset
-
-
-#define H_MV_HLS7_GEN                          0  // General changes (not tested)
-#define H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27    1  // Output layer sets, various
-                                                  // (VPS/P0300/alt output layer flag) #27 Change alt output layer flag to be signalled within the loop of output layer sets, from JCTVC-P0300-v2. Decision: Adopt. 
-                                                  // (VPS/P0156/Num of output_layer_flag) #10 Proposal 3: The output_layer_flag[ i ][ j ] is signalled for j equal to 0 to NumLayersInIdList[ lsIdx ] inclusive. It was remarked that we might be able to just assume that the top layer is always output; however, this was not entirely clear , so the safe thing to do may be to also send the flag for this layer.
-                                                  // (VPS/P0295/Default output layer sets) #5 Discussion from (P0110). Decision: Three-state approach (text in P0295, decoder shall allow 3 to be present and shall treat 3 the same as the value 2). 
-
-
-#define H_MV_HLS_7_HRD_P0156_7                 1  // (HRD/P0156/MaxSubLayersInLayerSetMinus1) #7 Proposal 1: signal, in the VPS extension, the DPB parameters for an output layer set for sub-DPBs only up to the maximum temporal sub-layers in the corresponding layer set
-#define H_MV_HLS_7_VPS_P0048_14                1  // (VPS/P0048/profile_ref_minus1 rem) #14 Remove profile_ref_minus1 from the VPS extension, from JCTVC-P0048
-#define H_MV_HLS_7_VPS_P0076_15                1  // (VPS/P0076/video signal info move) #15 Move video signal information syntax structure earlier in the VPS VUI.
-#define H_MV_HLS_7_SPS_P0155_16_32             1  // (SPS/P0155/sps_sub_layer_ordering_info) #16, #32 Not signal the sps_max_num_reorder_pics[], sps_max_latency_increase_plus1[], and sps_max_dec_pic_buffering_minus1[] syntax elements in the SPS when nuh_layer_id > 0. 
-#define H_MV_HLS_7_GEN_P0166_PPS_EXTENSION     1  // (GEN/P0166/pps_extension) #17 Add PPS extension type flags for conditional presence of syntax extensions per extension type, aligned with the SPS extension type flags, from JCTVC-P0166. Further align the SPS extension type flags syntax between RExt and MV-HEVC/SHVC
-#define H_MV_HLS_7_FIX_SET_DPB_SIZE            1  // Fix derivation dpb size parameters
-#define H_MV_HLS_7_RESERVED_FLAGS              1  // Added flags
-                                                  // (SPS/P0312/SHVC reserved flag) The flag will be used for the syntax vert_phase_position_enable_flag in SHVC draft
-                                                  // (VPS/O0215/SHVC reserved flag): this flag will be used for the syntax cross_layer_phase_alignment_flag in SHVC draft.
-                                                  // (VPS VUI/O0199,P0312/SHVC reserved flags) the 3 reserved bits will be used for the syntaxes single_layer_for_non_irap_flag, higher_layer_irap_skip_flag and vert_phase_position_not_in_use_flag in SHVC draft.
-#define H_MV_FIX_VPS_LAYER_ID_NOT_EQUAL_ZERO   1  // Discard VPS with nuh_layer_Id > 0
-#define H_MV_HLS_7_MISC_P0130_EOS              1  // (MISC/P0130/EOS NAL layer id) #19 Require that end of bitstream NAL unit shall have nuh_layer_id equal to 0, from JCTVC-P0130. Decoders shall allow an end of bitstream NAL unit with nuh_layer_id > 0 to be present, and shall ignore the NAL unit.
-#define H_MV_HLS_7_MISC_P0182_13               1  // (MISC/P0182/BL PS Compatibility flag) #13 Define the flag (in VPS VUI) with the proposed semantics, without specifying an associated extraction process. Editors to select the position in the VPS VUI.
-#define H_MV_HLS_7_MISC_P0068_21               1  // (MISC/P0068/all irap idr flag) #21 Add flag in VUI to indicate that all IRAP pictures are IDRs and that all layer pictures in an AU are IDR aligned, from JCTVC-P0068 proposal 1.
-#define H_MV_HLS_7_FIX_INFER_CROSS_LAYER_IRAP_ALIGNED_FLAG               1  // Fix inference of cross_layer_irap_aligned_flag
-#define H_MV_HLS_7_MISC_P0079_18               1  // (MISC/P0079/NumActiveRefLayerPics) #18 Modification of derivation of variable NumActiveRefLayerPics.
-#define FIX_CAM_PARS_COLLECTOR                 1
-#define UPDATE_HM13                            1  // Only some parts in H_3D parts are marked! 
-#if H_3D
-#define H_3D_FIX_G0148_BRACE                   1 
-#endif
+#define H_MV_HLS7_GEN                        0  // General changes (not tested)
+
+
+
 /////////////////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////   HM RELATED DEFINES ////////////////////////////////
@@ -416,7 +362,5 @@
 #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 
-#if H_MV_HLS_7_SEI_P0204_26
 #define MAX_SUB_STREAMS                 1024
-#endif
 #else
 #define MAX_NUM_LAYER_IDS                64
@@ -909,5 +853,4 @@
 #if H_MV
 
-#if H_MV_HLS_7_GEN_P0166_PPS_EXTENSION
 enum PpsExtensionTypes
 {
@@ -921,5 +864,4 @@
 
 //Below for sps, would be good if this could be aligned
-#endif
 
   enum PsExtensionTypes
