Index: /trunk/source/App/TAppDecoder/TAppDecTop.cpp
===================================================================
--- /trunk/source/App/TAppDecoder/TAppDecTop.cpp	(revision 883)
+++ /trunk/source/App/TAppDecoder/TAppDecTop.cpp	(revision 884)
@@ -140,7 +140,4 @@
     AOF( m_pScaleOffsetFile ); 
   }
-#if !FIX_CAM_PARS_COLLECTOR
-  m_cCamParsCollector.init( m_pScaleOffsetFile );
-#endif
 #endif
   InputByteStream bytestream(bitstreamFile);
@@ -209,16 +206,10 @@
       read(nalu, nalUnit);
 #if H_MV      
-#if H_MV_FIX_VPS_LAYER_ID_NOT_EQUAL_ZERO
       if( (m_iMaxTemporalLayer >= 0 && nalu.m_temporalId > m_iMaxTemporalLayer) 
           || !isNaluWithinTargetDecLayerIdSet(&nalu)
           || nalu.m_layerId > MAX_NUM_LAYER_IDS-1
           || (nalu.m_nalUnitType == NAL_UNIT_VPS && nalu.m_layerId > 0)           
-#if H_MV_HLS_7_MISC_P0130_EOS
           || (nalu.m_nalUnitType == NAL_UNIT_EOB && nalu.m_layerId > 0)           
-#endif
          ) 
-#else
-      if( (m_iMaxTemporalLayer >= 0 && nalu.m_temporalId > m_iMaxTemporalLayer) || !isNaluWithinTargetDecLayerIdSet(&nalu) || nalu.m_layerId > MAX_NUM_LAYER_IDS-1 ) 
-#endif
       {
         bNewPicture = false;
@@ -248,5 +239,4 @@
           }
 
-#if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
           if ( m_targetOptLayerSetIdx < 0 || m_targetOptLayerSetIdx >= vps->getNumOutputLayerSets() )
           {
@@ -254,16 +244,12 @@
             exit(EXIT_FAILURE);
           }
-#endif
           m_targetDecLayerIdSet = vps->getTargetDecLayerIdList( m_targetOptLayerSetIdx ); 
         }
 
-#if FIX_CAM_PARS_COLLECTOR
 #if H_3D
         if (nalu.m_nalUnitType == NAL_UNIT_VPS )
-        {        
-          
+        {                  
           m_cCamParsCollector.init( m_pScaleOffsetFile, m_tDecTop[decIdx]->getPrefetchedVPS() );
         }       
-#endif
 #endif
         bNewPicture       = ( newSliceDiffLayer || newSliceDiffPoc ) && !sliceSkippedFlag; 
Index: /trunk/source/App/TAppEncoder/TAppEncCfg.cpp
===================================================================
--- /trunk/source/App/TAppEncoder/TAppEncCfg.cpp	(revision 883)
+++ /trunk/source/App/TAppEncoder/TAppEncCfg.cpp	(revision 884)
@@ -388,17 +388,9 @@
   ("VpsNumLayerSets",       m_vpsNumLayerSets    , 1                    , "Number of layer sets")    
   ("LayerIdsInSet_%d",      m_layerIdsInSets     , std::vector<Int>(1,0), MAX_VPS_OP_SETS_PLUS1 ,"LayerIds of Layer set")  
-#if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
   ("DefaultTargetOutputLayerIdc"     , m_defaultTargetOutputLayerIdc     , 0, "Specifies output layers of layer sets, 0: output all layers, 1: output highest layer, 2: specified by LayerIdsInDefOutputLayerSet")
-#else
-  ("DefaultOneTargetOutputLayerFlag"  , m_defaultOneTargetOutputLayerIdc  , 0, "Output highest layer of layer sets by default")
-#endif
   ("OutputLayerSetIdx",     m_outputLayerSetIdx  , std::vector<Int>(0,0), "Indices of layer sets used as additional output layer sets")  
 
-#if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
   ("LayerIdsInAddOutputLayerSet_%d", m_layerIdsInAddOutputLayerSet      , std::vector<Int>(0,0), MAX_VPS_ADD_OUTPUT_LAYER_SETS, "Indices in VPS of output layers in additional output layer set")  
   ("LayerIdsInDefOutputLayerSet_%d", m_layerIdsInDefOutputLayerSet      , std::vector<Int>(0,0), MAX_VPS_OP_SETS_PLUS1, "Indices in VPS of output layers in layer set")  
-#else
-  ("LayerIdsInAddOutputLayerSet_%d", m_layerIdsInAddOutputLayerSet      , std::vector<Int>(1,0), MAX_VPS_ADD_OUTPUT_LAYER_SETS, "LayerIds of additional output layers")  
-#endif
   ("ProfileLevelTierIdx",   m_profileLevelTierIdx, std::vector<Int>(1,0), "Indices to profile level tier")
   
@@ -521,6 +513,4 @@
 #if H_3D_SPIVMP
   ("SubPULog2Size", m_iSubPULog2Size, (Int)3, "Sub-PU size index: 2^n")
-#endif
-#if QC_SPIVMP_MPI_G0119
   ("SubPUMPILog2Size", m_iSubPUMPILog2Size, (Int)3, "Sub-PU MPI size index: 2^n")
 #endif
@@ -613,15 +603,9 @@
 #if H_MV
 
-  // DBP Size
-#if !H_MV_HLS_7_FIX_SET_DPB_SIZE
-  ("SubLayerFlagInfoPresentFlag",  m_subLayerFlagInfoPresentFlag , false                                           , "SubLayerFlagInfoPresentFlag")
-#endif
   // VPS VUI
   ("VpsVuiPresentFlag"           , m_vpsVuiPresentFlag           , false                                           , "VpsVuiPresentFlag           ")
   ("CrossLayerPicTypeAlignedFlag", m_crossLayerPicTypeAlignedFlag, false                                           , "CrossLayerPicTypeAlignedFlag")  // Could actually be derived by the encoder
   ("CrossLayerIrapAlignedFlag"   , m_crossLayerIrapAlignedFlag   , false                                           , "CrossLayerIrapAlignedFlag   ")  // Could actually be derived by the encoder
-#if H_MV_HLS_7_MISC_P0068_21
   ("AllLayersIdrAlignedFlag"     , m_allLayersIdrAlignedFlag     , false                                           , "CrossLayerIrapAlignedFlag   ")  // Could actually be derived by the encoder
-#endif
   ("BitRatePresentVpsFlag"       , m_bitRatePresentVpsFlag       , false                                           , "BitRatePresentVpsFlag       ")
   ("PicRatePresentVpsFlag"       , m_picRatePresentVpsFlag       , false                                           , "PicRatePresentVpsFlag       ")
@@ -737,5 +721,4 @@
   ("SEISOPDescription",              m_SOPDescriptionSEIEnabled,              0, "Control generation of SOP description SEI messages")
   ("SEIScalableNesting",             m_scalableNestingSEIEnabled,              0, "Control generation of scalable nesting SEI messages")
-#if H_MV_HLS_7_SEI_P0204_26
   ("SubBitstreamPropSEIEnabled",              m_subBistreamPropSEIEnabled,    false                     ,"Enable signaling of sub-bitstream property SEI message")
   ("SEISubBitstreamNumAdditionalSubStreams",  m_sbPropNumAdditionalSubStreams,0, "Number of substreams for which additional information is signalled")
@@ -745,5 +728,4 @@
   ("SEISubBitstreamAvgBitRate",               m_sbPropAvgBitRate,             std::vector< Int  >(1,0)  ,"Specifies average bit rate of the i-th sub-bitstream")
   ("SEISubBitstreamMaxBitRate",               m_sbPropMaxBitRate,             std::vector< Int  >(1,0)  ,"Specifies maximum bit rate of the i-th sub-bitstream")
-#endif
 #if H_3D
   ("CameraParameterFile,cpf", m_pchCameraParameterFile,    (Char *) 0, "Camera Parameter File Name")
@@ -1432,5 +1414,4 @@
   }
 
-#if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
   xConfirmPara( m_defaultTargetOutputLayerIdc < 0 || m_defaultTargetOutputLayerIdc > 2, "Default target output layer idc must greater than or equal to 0 and less than or equal to 2." );  
 
@@ -1463,7 +1444,5 @@
     }
   }
-#else
-  xConfirmPara( m_defaultOneTargetOutputLayerIdc < 0 || m_defaultOneTargetOutputLayerIdc > 1, "Default one target output layer idc must be equal to 0 or equal to 1" );
-#endif
+
   xConfirmPara( m_profileLevelTierIdx.size() < m_vpsNumLayerSets + m_outputLayerSetIdx.size(), "The number of Profile Level Tier indices must be equal to the number of layer set plus the number of output layer set indices" );
 
@@ -1552,13 +1531,8 @@
 #endif
 #if H_3D_SPIVMP
-#if SEC_SPIVMP_MCP_SIZE_G0077
   xConfirmPara( m_iSubPULog2Size < 3,                                        "SubPULog2Size must be 3 or greater.");
-#else
-  xConfirmPara( m_iSubPULog2Size < 2,                                        "SubPULog2Size must be 2 or greater.");
-#endif
   xConfirmPara( m_iSubPULog2Size > 6,                                        "SubPULog2Size must be 6 or smaller.");
   xConfirmPara( (1<<m_iSubPULog2Size) > m_uiMaxCUWidth,                      "SubPULog2Size must be log2(maxCUSize) or smaller.");
-#endif
-#if QC_SPIVMP_MPI_G0119
+ 
   xConfirmPara( m_iSubPUMPILog2Size < 3,                                        "SubPUMPILog2Size must be 3 or greater.");
   xConfirmPara( m_iSubPUMPILog2Size > 6,                                        "SubPUMPILog2Size must be 6 or smaller.");
@@ -2252,6 +2226,4 @@
   }
   }
-#endif
-#if H_MV_HLS_7_SEI_P0204_26
   // Check input parameters for Sub-bitstream property SEI message
   if( m_subBistreamPropSEIEnabled )
@@ -2499,8 +2471,6 @@
 #if H_3D_SPIVMP
   printf(" SubPULog2Size:%d  " , m_iSubPULog2Size  );
-#endif
-#endif
-#if QC_SPIVMP_MPI_G0119
   printf(" SubPUMPILog2Size:%d  " , m_iSubPUMPILog2Size  );
+#endif
 #endif
 #if H_3D_ARP
Index: /trunk/source/App/TAppEncoder/TAppEncCfg.h
===================================================================
--- /trunk/source/App/TAppEncoder/TAppEncCfg.h	(revision 883)
+++ /trunk/source/App/TAppEncoder/TAppEncCfg.h	(revision 884)
@@ -89,14 +89,8 @@
   Int                    m_vpsNumLayerSets;                   ///< Number of layer sets
   std::vector< std::vector<Int> > m_layerIdsInSets;           ///< LayerIds in vps of layer set 
-#if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
   Int                    m_defaultTargetOutputLayerIdc;       ///< Specifies output layers of layer sets, 0: output all layers, 1: output highest layers, 2: specified by LayerIdsInDefOuputLayerSet
-#else
-  Int                    m_defaultOneTargetOutputLayerIdc;    ///< Output highest layer of layer sets by default when equal to 1
-#endif
   std::vector<Int>       m_outputLayerSetIdx;                 ///< Indices of layer sets used as additional output layer sets  
   std::vector< std::vector<Int> > m_layerIdsInAddOutputLayerSet; ///< LayerIds in vps of additional output layers
-#if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
   std::vector< std::vector<Int> > m_layerIdsInDefOutputLayerSet; ///< Indices in vps of output layers in layer sets
-#endif
   std::vector<Int>       m_profileLevelTierIdx;               ///< Indices of of profile level tier
   
@@ -104,9 +98,4 @@
   std::vector< std::vector<Int> > m_directRefLayers;          ///< LayerIds of direct reference layers
   std::vector< std::vector<Int> > m_dependencyTypes;          ///< Dependency types of direct reference layers
-
-  // DBP Size
-#if !H_MV_HLS_7_FIX_SET_DPB_SIZE
-  Bool m_subLayerFlagInfoPresentFlag;
-#endif
 
   // VPS VUI
@@ -114,7 +103,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;
@@ -141,8 +128,6 @@
 #if H_3D_SPIVMP
   Int                    m_iSubPULog2Size;                    
-#endif
-#endif
-#if QC_SPIVMP_MPI_G0119
   Int                    m_iSubPUMPILog2Size;                    
+#endif
 #endif
 #if H_3D_ARP                                                  /// < flag and number of weighting factors in ARP
@@ -440,5 +425,5 @@
   Int       m_log2MaxMvLengthHorizontal;                      ///< Indicate the maximum absolute value of a decoded horizontal MV component in quarter-pel luma units
   Int       m_log2MaxMvLengthVertical;                        ///< Indicate the maximum absolute value of a decoded vertical MV component in quarter-pel luma units
-#if H_MV_HLS_7_SEI_P0204_26
+#if H_MV
   Bool              m_subBistreamPropSEIEnabled;
   Int               m_sbPropNumAdditionalSubStreams;
Index: /trunk/source/App/TAppEncoder/TAppEncTop.cpp
===================================================================
--- /trunk/source/App/TAppEncoder/TAppEncTop.cpp	(revision 883)
+++ /trunk/source/App/TAppEncoder/TAppEncTop.cpp	(revision 884)
@@ -127,7 +127,5 @@
   xSetRepFormat            ( vps ); 
   xSetLayerSets            ( vps ); 
-#if H_MV_HLS_7_FIX_SET_DPB_SIZE
   xSetDpbSize              ( vps ); 
-#endif
   xSetVPSVUI               ( vps ); 
 #if H_3D
@@ -187,6 +185,4 @@
 #if H_3D_SPIVMP
     m_cTEncTop.setSubPULog2Size                 (( isDepth || 0==layerIdInVps ) ? 0 : m_iSubPULog2Size   );
-#endif
-#if QC_SPIVMP_MPI_G0119
     m_cTEncTop.setSubPUMPILog2Size              ( !isDepth ? 0 : m_iSubPUMPILog2Size   );
 #endif
@@ -429,5 +425,5 @@
   m_cTEncTop.setSOPDescriptionSEIEnabled( m_SOPDescriptionSEIEnabled );
   m_cTEncTop.setScalableNestingSEIEnabled( m_scalableNestingSEIEnabled );
-#if H_MV_HLS_7_SEI_P0204_26
+#if H_MV
   m_cTEncTop.setSubBitstreamPropSEIEnabled( m_subBistreamPropSEIEnabled );
   if( m_subBistreamPropSEIEnabled )
@@ -826,5 +822,5 @@
 #endif
 
-#if MTK_DDD_G0063
+#if H_3D_DDD
           m_acTEncTopList[ layer ]->getSliceEncoder()->setDDDPar( m_cCameraData.getCodedScale()[0][ m_acTEncTopList[layer]->getViewIndex() ], 
               m_cCameraData.getCodedOffset()[0][ m_acTEncTopList[layer]->getViewIndex() ], 
@@ -1506,5 +1502,4 @@
 }
 
-#if H_MV_HLS_7_FIX_SET_DPB_SIZE
 Void TAppEncTop::xSetDpbSize                ( TComVPS& vps )
 {
@@ -1520,18 +1515,9 @@
     Bool subLayerFlagInfoPresentFlag = false; 
 
-#if H_MV_HLS_7_HRD_P0156_7
     for( Int j = 0; j  <=  vps.getMaxSubLayersInLayerSetMinus1( i ); j++ )
-#else
-    for( Int j = 0; j  <=  vps.getMaxTLayers() - 1 ; j++ )
-#endif
     {   
       Bool subLayerDpbInfoPresentFlag = false; 
-#if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
       assert( vps.getNumSubDpbs( vps.getLayerSetIdxForOutputLayerSet( i ) ) == targetDecLayerIdList.size() ); 
       for( Int k = 0; k < vps.getNumSubDpbs( vps.getLayerSetIdxForOutputLayerSet( i )); k++ )   
-#else
-      assert( vps.getNumSubDpbs( vps.getOutputLayerSetIdxMinus1( i ) + 1 ) == targetDecLayerIdList.size() ); 
-      for( Int k = 0; k < vps.getNumSubDpbs( vps.getOutputLayerSetIdxMinus1( i ) + 1 ); k++ )   
-#endif
       {
         Int layerIdInVps = vps.getLayerIdInVps( targetDecLayerIdList[k] );           
@@ -1576,60 +1562,5 @@
   }  
 }
-#else
-Void TAppEncTop::xSetDpbSize                ( TComVPS& vps )
-{
-  // These settings need to be verified
-
-  TComDpbSize* dpbSize = vps.getDpbSize(); 
-
-  assert ( dpbSize != 0 ); 
-
-  for( Int i = 1; i < vps.getNumOutputLayerSets(); i++ )
-  {  
-    std::vector<Int> targetDecLayerIdList = vps.getTargetDecLayerIdList( i ); 
-    dpbSize->setSubLayerFlagInfoPresentFlag( i, m_subLayerFlagInfoPresentFlag );
-    if ( dpbSize->getSubLayerFlagInfoPresentFlag( i ) )
-    {
-      for( Int j = 0; j  <=  vps.getMaxTLayers() - 1 ; j++ )
-      {   
-        Int maxNumReorderPics  = MIN_INT; 
-        Int maxDecPicBuffering = MIN_INT; 
-        Int maxLatencyIncrease = MIN_INT; 
-
-        Int prevMaxNumReorderPics  = MIN_INT; 
-        Int prevMaxDecPicBuffering = MIN_INT; 
-        Int prevMaxLatencyIncrease = MIN_INT; 
-
-        assert( vps.getNumSubDpbs( vps.getOutputLayerSetIdxMinus1( i ) + 1 ) == targetDecLayerIdList.size() ); 
-        for( Int k = 0; k < vps.getNumSubDpbs( vps.getOutputLayerSetIdxMinus1( i ) + 1 ); k++ )   
-        {
-          Int layerIdInVps = vps.getLayerIdInVps( targetDecLayerIdList[k] );           
-          dpbSize->setMaxVpsDecPicBufferingMinus1( i, k, j, m_maxDecPicBufferingMvc[ layerIdInVps ][ j ] - 1 );
-        }        
-
-        for ( Int idx = 0; idx < targetDecLayerIdList.size(); idx++ )
-        {
-          Int layerIdInVps = vps.getLayerIdInVps( targetDecLayerIdList[ idx ] ); 
-          maxNumReorderPics = std::max( maxNumReorderPics, m_numReorderPicsMvc[ layerIdInVps ][ j ] ); 
-        }
-        assert( maxNumReorderPics != MIN_INT ); 
-        dpbSize->setMaxVpsNumReorderPics( i, j, maxNumReorderPics );
-
-        // To Be Done !
-        // dpbSize->setMaxVpsLatencyIncreasePlus1( i, j, uiCode );
-
-        if( j > 0 )  
-        {
-          dpbSize->setSubLayerDpbInfoPresentFlag( i, j, prevMaxDecPicBuffering == maxDecPicBuffering && prevMaxLatencyIncrease == maxLatencyIncrease && prevMaxNumReorderPics == maxNumReorderPics );
-        }        
-
-        prevMaxNumReorderPics   = maxNumReorderPics; 
-        prevMaxDecPicBuffering  = maxDecPicBuffering; 
-        prevMaxLatencyIncrease  = maxLatencyIncrease; 
-      }  
-    }  
-  }  
-}
-#endif
+
 
 Void TAppEncTop::xSetLayerSets( TComVPS& vps )
@@ -1637,7 +1568,4 @@
   // Layer sets
   vps.setVpsNumLayerSetsMinus1   ( m_vpsNumLayerSets - 1 ); 
-#if !H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
-  vps.setVpsNumberLayerSetsMinus1( vps.getVpsNumLayerSetsMinus1() ); 
-#endif
     
   for (Int lsIdx = 0; lsIdx < m_vpsNumLayerSets; lsIdx++ )
@@ -1656,15 +1584,8 @@
   Int numAddOuputLayerSets = (Int) m_outputLayerSetIdx.size(); 
   // Additional output layer sets + profileLevelTierIdx
-#if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
   vps.setDefaultTargetOutputLayerIdc      ( m_defaultTargetOutputLayerIdc );   
   vps.setNumAddOutputLayerSets            ( numAddOuputLayerSets          ); 
   vps.initTargetLayerIdLists(); 
-#else
-  vps.setDefaultOneTargetOutputLayerIdc   ( m_defaultOneTargetOutputLayerIdc ); 
-  vps.setMoreOutputLayerSetsThanDefaultFlag( numAddOuputLayerSets       != 0 );   
-  vps.setNumAddOutputLayerSetsMinus1       ( numAddOuputLayerSets - 1        ); 
-#endif
-
-#if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
+
   for (Int olsIdx = 0; olsIdx < m_vpsNumLayerSets + numAddOuputLayerSets; olsIdx++)
   {
@@ -1716,43 +1637,5 @@
     vps.setAltOutputLayerFlag( olsIdx , false);     
   }
-#else
-  for (Int lsIdx = 0; lsIdx < m_vpsNumLayerSets; lsIdx++)
-  {
-    if ( lsIdx > 0 ) 
-    {
-      vps.setProfileLevelTierIdx( lsIdx, m_profileLevelTierIdx[ lsIdx ] ); 
-    }  
-
-    vps.setOutputLayerSetIdxMinus1( lsIdx, lsIdx - 1 ); 
-
-    for (Int i = 0; i < m_layerIdsInSets[ lsIdx ].size(); i++ )
-    { 
-      vps.setOutputLayerFlag( lsIdx, i, vps.inferOutputLayerFlag( lsIdx, i ));       
-    }
-  }
-
-  for (Int addOutLs = 0; addOutLs < numAddOuputLayerSets; addOutLs++ )
-  {
-    vps.setProfileLevelTierIdx( m_vpsNumLayerSets + addOutLs, m_profileLevelTierIdx[ addOutLs ] ); 
-
-    Int refLayerSetIdx = m_outputLayerSetIdx[ addOutLs ];     
-    vps.setOutputLayerSetIdxMinus1( m_vpsNumLayerSets + addOutLs, refLayerSetIdx - 1 ); 
-
-    for (Int i = 0; i < m_layerIdsInSets[ refLayerSetIdx].size(); i++ )
-    {
-      Bool outputLayerFlag = false; 
-      for (Int j = 0; j < m_layerIdsInAddOutputLayerSet[ addOutLs ].size(); j++ )
-      {
-        if (  m_layerIdsInAddOutputLayerSet[addOutLs][ j ] == m_layerIdsInSets[ refLayerSetIdx][ i ] )
-        {
-          outputLayerFlag = true; 
-          break; 
-        }
-      }
-      vps.setOutputLayerFlag( m_vpsNumLayerSets + addOutLs, i, outputLayerFlag );       
-    }
-  }
-  vps.deriveTargetLayerIdLists(); 
-#endif
+
 }
 
@@ -1761,17 +1644,9 @@
   vps.setVpsVuiPresentFlag( m_vpsVuiPresentFlag ); 
 
-#if H_MV_HLS_7_FIX_INFER_CROSS_LAYER_IRAP_ALIGNED_FLAG
   TComVPSVUI* pcVPSVUI = vps.getVPSVUI(  ); 
   assert( pcVPSVUI ); 
-#endif
 
   if ( m_vpsVuiPresentFlag )
   {
-#if !H_MV_HLS_7_FIX_INFER_CROSS_LAYER_IRAP_ALIGNED_FLAG
-    TComVPSVUI* pcVPSVUI = vps.getVPSVUI(  ); 
-
-    assert( pcVPSVUI ); 
-#endif
-
     // All this stuff could actually be derived by the encoder, 
     // however preliminary setting it from input parameters
@@ -1779,7 +1654,5 @@
     pcVPSVUI->setCrossLayerPicTypeAlignedFlag( m_crossLayerPicTypeAlignedFlag );
     pcVPSVUI->setCrossLayerIrapAlignedFlag   ( m_crossLayerIrapAlignedFlag    );
-#if H_MV_HLS_7_MISC_P0068_21
     pcVPSVUI->setAllLayersIdrAlignedFlag     ( m_allLayersIdrAlignedFlag      );
-#endif
     pcVPSVUI->setBitRatePresentVpsFlag( m_bitRatePresentVpsFlag );
     pcVPSVUI->setPicRatePresentVpsFlag( m_picRatePresentVpsFlag );
@@ -1787,9 +1660,5 @@
     if( pcVPSVUI->getBitRatePresentVpsFlag( )  ||  pcVPSVUI->getPicRatePresentVpsFlag( ) )
     {
-#if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
       for( Int i = 0; i  <=  vps.getVpsNumLayerSetsMinus1(); i++ )
-#else
-      for( Int i = 0; i  <=  vps.getVpsNumberLayerSetsMinus1(); i++ )
-#endif
       {
         for( Int j = 0; j  <=  vps.getMaxTLayers(); j++ ) 
@@ -1909,10 +1778,8 @@
     pcVPSVUI->setVpsVuiBspHrdPresentFlag( false ); // TBD
   }
-#if H_MV_HLS_7_FIX_INFER_CROSS_LAYER_IRAP_ALIGNED_FLAG
   else
   {
     pcVPSVUI->setCrossLayerIrapAlignedFlag   ( false   );
   }
-#endif
 }
 #endif
@@ -1970,5 +1837,5 @@
 #endif
   }  
-#if QC_SPIVMP_MPI_G0119
+#if H_3D_SPIVMP
   vps.setSubPUMPILog2Size( m_iSubPUMPILog2Size );
 #endif
Index: /trunk/source/Lib/TLibCommon/ContextTables.h
===================================================================
--- /trunk/source/Lib/TLibCommon/ContextTables.h	(revision 883)
+++ /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 883)
+++ /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 883)
+++ /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 883)
+++ /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 883)
+++ /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 883)
+++ /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 883)
+++ /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 883)
+++ /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 883)
+++ /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 883)
+++ /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 883)
+++ /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
Index: /trunk/source/Lib/TLibDecoder/SEIread.cpp
===================================================================
--- /trunk/source/Lib/TLibDecoder/SEIread.cpp	(revision 883)
+++ /trunk/source/Lib/TLibDecoder/SEIread.cpp	(revision 884)
@@ -99,5 +99,5 @@
     fprintf( g_hTrace, "=========== Scalable Nesting SEI message ===========\n");
     break;
-#if H_MV_HLS_7_SEI_P0204_26
+#if H_MV
   case SEI::SUB_BITSTREAM_PROPERTY:
     fprintf( g_hTrace, "=========== Sub-bitstream property SEI message ===========\n");
@@ -245,5 +245,5 @@
       xParseSEIScalableNesting((SEIScalableNesting&) *sei, nalUnitType, payloadSize, sps);
       break;
-#if H_MV_HLS_7_SEI_P0204_26
+#if H_MV
      case SEI::SUB_BITSTREAM_PROPERTY:
        sei = new SEISubBitstreamProperty;
@@ -777,5 +777,5 @@
 
 }
-#if H_MV_HLS_7_SEI_P0204_26
+#if H_MV
 Void SEIReader::xParseSEISubBitstreamProperty(SEISubBitstreamProperty &sei)
 {
Index: /trunk/source/Lib/TLibDecoder/SEIread.h
===================================================================
--- /trunk/source/Lib/TLibDecoder/SEIread.h	(revision 883)
+++ /trunk/source/Lib/TLibDecoder/SEIread.h	(revision 884)
@@ -73,5 +73,5 @@
   Void xParseSEISOPDescription        (SEISOPDescription &sei, UInt payloadSize);
   Void xParseSEIScalableNesting       (SEIScalableNesting& sei, const NalUnitType nalUnitType, UInt payloadSize, TComSPS *sps);
-#if H_MV_HLS_7_SEI_P0204_26
+#if H_MV
   Void  xParseSEISubBitstreamProperty   (SEISubBitstreamProperty &sei);
   Void  xResizeSubBitstreamPropertySeiArrays(SEISubBitstreamProperty &sei);
Index: /trunk/source/Lib/TLibDecoder/TDecCAVLC.cpp
===================================================================
--- /trunk/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 883)
+++ /trunk/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 884)
@@ -366,5 +366,4 @@
 
   READ_FLAG( uiCode, "pps_extension_flag");
-#if H_MV_HLS_7_GEN_P0166_PPS_EXTENSION
   if (uiCode)
   {
@@ -383,7 +382,5 @@
     if( pcPPS->getPpsExtensionTypeFlag( PPS_EX_T_MV ) )
     {
-#if H_MV_HLS_7_POC_P0041
       READ_FLAG( uiCode, "poc_reset_info_present_flag" ); pcPPS->setPocResetInfoPresentFlag( uiCode == 1 );
-#endif
     }
 
@@ -406,22 +403,4 @@
 #endif
   }
-#else
-  if (uiCode)
-  {
-#if H_3D
-    parsePPSExtension( pcPPS, pcVPS );
-    READ_FLAG( uiCode, "pps_extension2_flag");
-    if ( uiCode )
-    {
-#endif
-      while ( xMoreRbspData() )
-      {
-        READ_FLAG( uiCode, "pps_extension_data_flag");
-      }
-#if H_3D
-    }
-#endif
-  }
-#endif
 }
 
@@ -849,5 +828,5 @@
   assert(uiCode <= 12);
 
-#if H_MV_HLS_7_SPS_P0155_16_32
+#if H_MV
   if ( pcSPS->getLayerId() == 0 ) 
   {  
@@ -888,5 +867,5 @@
     }
   }
-#if H_MV_HLS_7_SPS_P0155_16_32
+#if H_MV
   }
 #endif
@@ -1053,7 +1032,5 @@
     READ_SVLC( iCode, "scaled_ref_layer_right_offset" ); pcSPS->setScaledRefLayerRightOffset( j, iCode );
     READ_SVLC( iCode, "scaled_ref_layer_bottom_offset" ); pcSPS->setScaledRefLayerBottomOffset( j, iCode );
-#if H_MV_HLS_7_RESERVED_FLAGS
     READ_FLAG( uiCode, "sps_multilayer_ext_reserved_zero_flag[ i ]" );
-#endif
   }
 }
@@ -1092,13 +1069,5 @@
   assert (pcVPS->getMaxTLayers()>1||pcVPS->getTemporalNestingFlag());
 
-#if H_MV_HLS_7_VPS_P0125_24
   READ_CODE( 16, uiCode,  "vps_reserved_ffff_16bits" );           assert(uiCode == 0xffff);
-#else
-#if H_MV && !H_MV_HLS7_GEN
-  READ_CODE( 16, uiCode,  "vps_extension_offset" );               
-#else
-  READ_CODE( 16, uiCode,  "vps_reserved_ffff_16bits" );           assert(uiCode == 0xffff);
-#endif
-#endif
   parsePTL ( pcVPS->getPTL(), true, pcVPS->getMaxTLayers()-1);
   UInt subLayerOrderingInfoPresentFlag;
@@ -1212,12 +1181,4 @@
   READ_FLAG( uiCode, "avc_base_layer_flag" );                     pcVPS->setAvcBaseLayerFlag( uiCode == 1 ? true : false );
 
-#if !H_MV_HLS_7_VPS_P0307_23
-  READ_FLAG( uiCode, "vps_vui_present_flag" );                    pcVPS->setVpsVuiPresentFlag( uiCode == 1 );
-  if ( pcVPS->getVpsVuiPresentFlag() )
-  {  
-  READ_CODE( 16, uiCode, "vps_vui_offset" );                      pcVPS->setVpsVuiOffset( uiCode );
-  }
-#endif
-
   READ_FLAG( uiCode, "splitting_flag" );                          pcVPS->setSplittingFlag( uiCode == 1 ? true : false );
 
@@ -1325,37 +1286,19 @@
 
   READ_FLAG( uiCode, "all_ref_layers_active_flag" );             pcVPS->setAllRefLayersActiveFlag( uiCode == 1 );
-#if !H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
-  READ_CODE( 10, uiCode, "vps_number_layer_sets_minus1"      );  pcVPS->setVpsNumberLayerSetsMinus1    ( uiCode ); 
-#endif
-
-#if !H_MV_HLS_7_VPS_P0306_22
-  READ_CODE( 6,  uiCode, "vps_num_profile_tier_level_minus1" );  pcVPS->setVpsNumProfileTierLevelMinus1( uiCode );
-#else
+
   READ_UVLC( uiCode, "vps_num_profile_tier_level_minus1" );  pcVPS->setVpsNumProfileTierLevelMinus1( uiCode );  
-#endif
+
   for( Int i = 1; i <= pcVPS->getVpsNumProfileTierLevelMinus1(); i++ )
   {
     READ_FLAG(  uiCode, "vps_profile_present_flag[i]" );    pcVPS->setVpsProfilePresentFlag( i, uiCode == 1 );
-#if !H_MV_HLS_7_VPS_P0048_14
-    if( !pcVPS->getVpsProfilePresentFlag( i ) )
-    {
-      READ_CODE( 6, uiCode, "profile_ref_minus1[i]" ); pcVPS->setProfileRefMinus1( i, uiCode );
-      pcVPS->checkProfileRefMinus1( i );      
-    }
-#endif
     parsePTL ( pcVPS->getPTL( i ), pcVPS->getVpsProfilePresentFlag( i ), pcVPS->getMaxTLayers()-1);
     if( !pcVPS->getVpsProfilePresentFlag( i ) )
     {
       TComPTL temp = *pcVPS->getPTL( i );
-#if H_MV_HLS_7_VPS_P0048_14
       *pcVPS->getPTL( i ) = *pcVPS->getPTL( i - 1 );
-#else
-      *pcVPS->getPTL( i ) = *pcVPS->getPTL( pcVPS->getProfileRefMinus1( i ) + 1 );
-#endif
       pcVPS->getPTL( i )->copyLevelFrom( &temp );
     }
   }
 
-#if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
   READ_UVLC( uiCode, "num_add_output_layer_sets"      ); pcVPS->setNumAddOutputLayerSets( uiCode );
   pcVPS->initTargetLayerIdLists( ); 
@@ -1365,38 +1308,13 @@
   }  
 
-#else
-  Int numOutputLayerSets = pcVPS->getVpsNumberLayerSetsMinus1( ) + 1; 
-
-  READ_FLAG( uiCode, "more_output_layer_sets_than_default_flag" ); pcVPS->setMoreOutputLayerSetsThanDefaultFlag( uiCode == 1 );
-
-  if ( pcVPS->getMoreOutputLayerSetsThanDefaultFlag( ) )
-  {
-    READ_CODE( 10, uiCode, "num_add_output_layer_sets_minus1"      ); pcVPS->setNumAddOutputLayerSetsMinus1( uiCode );
-    numOutputLayerSets += ( pcVPS->getNumAddOutputLayerSetsMinus1( ) + 1); 
-  }
-
-  if( numOutputLayerSets > 1)
-  {
-    READ_CODE( 2, uiCode, "default_one_target_output_layer_idc" ); pcVPS->setDefaultOneTargetOutputLayerIdc( uiCode );
-    pcVPS->checkDefaultOneTargetOutputLayerIdc(); 
-  }  
-#endif
-
   pcVPS->setOutputLayerFlag(0, 0, pcVPS->inferOutputLayerFlag( 0, 0 )); 
   pcVPS->setOutputLayerSetIdxMinus1(0, -1); 
 
-#if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
   pcVPS->deriveTargetLayerIdList( 0 ); 
   for( Int i = 1; i < pcVPS->getNumOutputLayerSets( ); i++ )
   {
     if( i > pcVPS->getVpsNumLayerSetsMinus1( ) )    
-#else
-  for( Int i = 1; i < numOutputLayerSets; i++ )
-  {
-    if( i > pcVPS->getVpsNumberLayerSetsMinus1( ) )
-#endif
     {        
       READ_UVLC( uiCode,      "output_layer_set_idx_minus1[i]" ); pcVPS->setOutputLayerSetIdxMinus1( i, uiCode ); 
-#if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
     }
 
@@ -1416,19 +1334,5 @@
     }
     pcVPS->deriveTargetLayerIdList( i ); 
-#else
-      for( Int j = 0; j < pcVPS->getNumLayersInIdList( j ) - 1; j++ )
-      {
-        READ_FLAG( uiCode, "output_layer_flag" ); pcVPS->setOutputLayerFlag( i, j, uiCode == 1 ); 
-      }        
-    }
-    else
-    { // These inference rules would also be helpful in spec text
-      pcVPS->setOutputLayerSetIdxMinus1(i, i - 1 ); 
-      for( Int j = 0; j < pcVPS->getNumLayersInIdList( j ) - 1; j++ )
-      {              
-        pcVPS->setOutputLayerFlag(i,j, pcVPS->inferOutputLayerFlag( i, j )); 
-      }
-    }
-#endif
+
     if ( pcVPS->getProfileLevelTierIdxLen()  > 0 )
     {      
@@ -1436,5 +1340,4 @@
     }
 
-#if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
     if( pcVPS->getNumOutputLayersInOutputLayerSet( i ) == 1 && pcVPS->getNumDirectRefLayers( pcVPS->getOlsHighestOutputLayerId( i ) ) > 0 )
     {
@@ -1442,24 +1345,9 @@
     }
   }
-#else
-  }
-  if( pcVPS->getMaxLayersMinus1() > 0 )
-  {
-    READ_FLAG( uiCode, "alt_output_layer_flag" ); pcVPS->setAltOutputLayerFlag( uiCode == 1 );
-  }
-#endif
-
-#if !H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
-  pcVPS->deriveTargetLayerIdLists(); 
-#endif
 
   READ_FLAG( uiCode, "rep_format_idx_present_flag" ); pcVPS->setRepFormatIdxPresentFlag( uiCode == 1 );
   if ( pcVPS->getRepFormatIdxPresentFlag() )
   {
-#if H_MV_HLS_7_VPS_P0306_22
     READ_UVLC( uiCode, "vps_num_rep_formats_minus1" ); pcVPS->setVpsNumRepFormatsMinus1( uiCode );
-#else
-    READ_CODE( 4, uiCode, "vps_num_rep_formats_minus1" ); pcVPS->setVpsNumRepFormatsMinus1( uiCode );
-#endif
   }
 
@@ -1479,9 +1367,5 @@
       if( pcVPS->getVpsNumRepFormatsMinus1() > 0 )
       {
-#if H_MV_HLS_7_VPS_P0306_22
         READ_CODE( pcVPS->getVpsRepFormatIdxLen(), uiCode, "vps_rep_format_idx[i]" ); pcVPS->setVpsRepFormatIdx( i, uiCode );
-#else
-        READ_CODE( 8, uiCode, "vps_rep_format_idx" ); pcVPS->setVpsRepFormatIdx( i, uiCode );
-#endif
       }
     }
@@ -1500,7 +1384,5 @@
   }
 
-#if H_MV_HLS_7_RESERVED_FLAGS
   READ_FLAG( uiCode, "vps_reserved_zero_flag" ); 
-#endif
   parseDpbSize( pcVPS ); 
 
@@ -1531,5 +1413,4 @@
   }  
 
-#if H_MV_HLS_7_VPS_P0307_23
   READ_UVLC( uiCode, "vps_non_vui_extension_length" ); pcVPS->setVpsNonVuiExtensionLength( uiCode ); 
   for ( Int i = 1; i <= pcVPS->getVpsNonVuiExtensionLength(); i++ )
@@ -1538,8 +1419,4 @@
   }
   READ_FLAG( uiCode, "vps_vui_present_flag" );  pcVPS->setVpsVuiPresentFlag( uiCode == 1 );
-#endif
-#if !H_MV_HLS_7_RESERVED_FLAGS
-  READ_FLAG( uiCode, "vps_shvc_reserved_zero_flag" ); 
-#endif
   if( pcVPS->getVpsVuiPresentFlag() )
   {
@@ -1547,5 +1424,4 @@
     parseVPSVUI( pcVPS ); 
   }     
-#if H_MV_HLS_7_FIX_INFER_CROSS_LAYER_IRAP_ALIGNED_FLAG
   {
     TComVPSVUI* pcVPSVUI = pcVPS->getVPSVUI( ); 
@@ -1553,5 +1429,4 @@
     pcVPSVUI->inferVpsVui( false ); 
   }
-#endif
 
   pcVPS->checkVPSExtensionSyntax(); 
@@ -1601,19 +1476,13 @@
     READ_FLAG( uiCode, "cross_layer_irap_aligned_flag" ); pcVPSVUI->setCrossLayerIrapAlignedFlag( uiCode == 1 );
   }
-#if H_MV_HLS_7_MISC_P0068_21
   if( pcVPSVUI->getCrossLayerIrapAlignedFlag( ) )
   {
     READ_FLAG( uiCode, "all_layers_idr_aligned_flag" ); pcVPSVUI->setAllLayersIdrAlignedFlag( uiCode == 1 );
   }
-#endif
   READ_FLAG( uiCode, "bit_rate_present_vps_flag" ); pcVPSVUI->setBitRatePresentVpsFlag( uiCode == 1 );
   READ_FLAG( uiCode, "pic_rate_present_vps_flag" ); pcVPSVUI->setPicRatePresentVpsFlag( uiCode == 1 );
   if( pcVPSVUI->getBitRatePresentVpsFlag( )  ||  pcVPSVUI->getPicRatePresentVpsFlag( ) )
   {
-#if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
     for( Int i = 0; i  <=  pcVPS->getVpsNumLayerSetsMinus1(); i++ )
-#else
-    for( Int i = 0; i  <=  pcVPS->getVpsNumberLayerSetsMinus1(); i++ )
-#endif
     {
       for( Int j = 0; j  <=  pcVPS->getMaxTLayers(); j++ ) 
@@ -1641,5 +1510,4 @@
   }
 
-#if H_MV_HLS_7_VPS_P0076_15
   READ_FLAG( uiCode, "video_signal_info_idx_present_flag" ); pcVPSVUI->setVideoSignalInfoIdxPresentFlag( uiCode == 1 );
   if( pcVPSVUI->getVideoSignalInfoIdxPresentFlag() )
@@ -1675,5 +1543,4 @@
     }
   }
-#endif
 
   READ_FLAG( uiCode, "tiles_not_in_use_flag" ); pcVPSVUI->setTilesNotInUseFlag( uiCode == 1 );
@@ -1712,8 +1579,5 @@
   }
 
-#if H_MV_HLS_7_RESERVED_FLAGS
   READ_CODE( 3, uiCode, "vps_vui_reserved_zero_3bits" ); 
-#endif
-
   READ_FLAG( uiCode, "ilp_restricted_ref_layers_flag" ); pcVPSVUI->setIlpRestrictedRefLayersFlag( uiCode == 1 );
 
@@ -1737,39 +1601,4 @@
   }
 
-#if !H_MV_HLS_7_VPS_P0076_15
-  READ_FLAG( uiCode, "video_signal_info_idx_present_flag" ); pcVPSVUI->setVideoSignalInfoIdxPresentFlag( uiCode == 1 );
-  if( pcVPSVUI->getVideoSignalInfoIdxPresentFlag() )
-  {
-    READ_CODE( 4, uiCode, "vps_num_video_signal_info_minus1" ); pcVPSVUI->setVpsNumVideoSignalInfoMinus1( uiCode );
-  }
-  else
-  {
-    pcVPSVUI->setVpsNumVideoSignalInfoMinus1( pcVPS->getMaxLayersMinus1() ); 
-  }
-
-  for( Int i = 0; i <= pcVPSVUI->getVpsNumVideoSignalInfoMinus1(); i++ )
-  {
-    assert( pcVPSVUI->getVideoSignalInfo( i ) == NULL ); 
-    TComVideoSignalInfo* curVideoSignalInfo = new TComVideoSignalInfo();     
-    parseVideoSignalInfo( curVideoSignalInfo ); 
-    pcVPSVUI->setVideoSignalInfo(i, curVideoSignalInfo ); 
-  }
-  
-  if( pcVPSVUI->getVideoSignalInfoIdxPresentFlag() && pcVPSVUI->getVpsNumVideoSignalInfoMinus1() > 0 )
-  {
-    for( Int i = 1; i <=  pcVPS->getMaxLayersMinus1(); i++ )
-    {
-      READ_CODE( 4, uiCode, "vps_video_signal_info_idx" ); pcVPSVUI->setVpsVideoSignalInfoIdx( i, uiCode );
-      assert( pcVPSVUI->getVpsVideoSignalInfoIdx( i ) >= 0 && pcVPSVUI->getVpsVideoSignalInfoIdx( i ) <= pcVPSVUI->getVpsNumVideoSignalInfoMinus1() );
-    }
-  }
-  else
-  {
-    for( Int i = 1; i <=  pcVPS->getMaxLayersMinus1(); i++ )
-    {
-      pcVPSVUI->setVpsVideoSignalInfoIdx( i, pcVPSVUI->getVideoSignalInfoIdxPresentFlag() ? 0 : i ); 
-    }
-  }
-#endif
   READ_FLAG( uiCode, "vps_vui_bsp_hrd_present_flag" ); pcVPSVUI->setVpsVuiBspHrdPresentFlag( uiCode == 1 );
   if ( pcVPSVUI->getVpsVuiBspHrdPresentFlag( ) )
@@ -1777,5 +1606,4 @@
     parseVpsVuiBspHrdParameters( pcVPS ); 
 }
-#if H_MV_HLS_7_MISC_P0182_13
   for( Int i = 1; i  <=  pcVPS->getMaxLayersMinus1(); i++ )
   {
@@ -1785,5 +1613,4 @@
     }
   }
-#endif
 }
 
@@ -1864,9 +1691,5 @@
   {  
     READ_FLAG( uiCode, "sub_layer_flag_info_present_flag" ); dpbSize->setSubLayerFlagInfoPresentFlag( i, uiCode == 1 );
-#if H_MV_HLS_7_HRD_P0156_7
     for( Int j = 0; j  <=  vps->getMaxSubLayersInLayerSetMinus1( i ); j++ )
-#else
-    for( Int j = 0; j  <=  vps->getMaxTLayers() - 1 ; j++ )
-#endif
     {  
       if( j > 0  &&  dpbSize->getSubLayerDpbInfoPresentFlag( i, j )  )  
@@ -1876,9 +1699,5 @@
       if( dpbSize->getSubLayerDpbInfoPresentFlag( i, j ) )
       {  
-#if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
         for( Int k = 0; k < vps->getNumSubDpbs( vps->getLayerSetIdxForOutputLayerSet( i )); k++ )   
-#else
-        for( Int k = 0; k < vps->getNumSubDpbs( vps->getOutputLayerSetIdxMinus1( i ) + 1 ); k++ )   
-#endif
         {
           READ_UVLC( uiCode, "max_vps_dec_pic_buffering_minus1" ); dpbSize->setMaxVpsDecPicBufferingMinus1( i, k, j, uiCode );
@@ -1933,9 +1752,5 @@
         READ_FLAG( uiCode, "iv_mv_pred_flag[i]");          pcVPS->setIvMvPredFlag         ( i, uiCode == 1 ? true : false );
 #if H_3D_SPIVMP
-#if SEC_SPIVMP_MCP_SIZE_G0077
         READ_UVLC (uiCode, "log2_sub_PU_size_minus3[i]");     pcVPS->setSubPULog2Size(i, uiCode+3); 
-#else
-        READ_UVLC (uiCode, "log2_sub_PU_size_minus2");     pcVPS->setSubPULog2Size(i, uiCode+2); 
-#endif
 #endif
 #endif
@@ -1965,9 +1780,5 @@
         if (i!=1)
         {
-#if SEC_SPIVMP_MCP_SIZE_G0077
           READ_UVLC (uiCode, "log2_sub_PU_size_minus3[i]");     pcVPS->setSubPULog2Size(i, uiCode+3); 
-#else
-          READ_UVLC (uiCode, "log2_sub_PU_size_minus2[i]");     pcVPS->setSubPULog2Size(i, uiCode+2); 
-#endif
         }
 #endif
@@ -1991,8 +1802,6 @@
   for (UInt viewIndex=0; viewIndex<pcVPS->getNumViews(); viewIndex++)
   {
-#if FIX_CAM_PARS_COLLECTOR
     pcVPS->setCamParPresent         ( viewIndex, false );
     pcVPS->setHasCamParInSliceHeader( viewIndex, false );
-#endif
     READ_FLAG( uiCode, "cp_present_flag[i]" );                  bCamParPresentFlag = ( uiCode == 1);
     if ( bCamParPresentFlag )
@@ -2013,7 +1822,5 @@
     }
   }
-#if QC_SPIVMP_MPI_G0119
   READ_UVLC (uiCode, "log2_sub_PU_MPI_size_minus3");              pcVPS->setSubPUMPILog2Size( uiCode + 3 ); 
-#endif
   READ_FLAG( uiCode, "iv_mv_scaling_flag");                       pcVPS->setIvMvScalingFlag( uiCode == 1 ? true : false ); 
 }
@@ -2728,13 +2535,4 @@
   if(pps->getSliceHeaderExtensionPresentFlag())
   {
-#if !H_MV_HLS_7_POC_P0041    
-    READ_UVLC(uiCode,"slice_header_extension_length");
-    for(Int i=0; i<uiCode; i++)
-    {
-      UInt ignore;
-      READ_CODE(8,ignore,"slice_header_extension_data_byte");
-    }
-  }
-#else
 #if H_MV
     READ_UVLC( uiCode, "slice_segment_header_extension_length" ); rpcSlice->setSliceSegmentHeaderExtensionLength( uiCode );
@@ -2806,5 +2604,4 @@
     }
   }
-#endif
 #endif
   }
@@ -3103,5 +2900,4 @@
 #endif
 #if H_3D_INTER_SDC
-#if QC_SDC_UNIFY_G0130
 Void TDecCavlc::parseDeltaDC( TComDataCU* /*pcCU*/, UInt /*uiAbsPartIdx*/, UInt /*uiDepth*/ )
 { 
@@ -3113,15 +2909,5 @@
   assert(0);
 }
-#else
-Void TDecCavlc::parseInterSDCFlag    ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
-{
-  assert(0);
-}
-
-Void TDecCavlc::parseInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPart )
-{
-  assert(0);
-}
-#endif
+
 #endif
 #if H_3D_DBBP
Index: /trunk/source/Lib/TLibDecoder/TDecCAVLC.h
===================================================================
--- /trunk/source/Lib/TLibDecoder/TDecCAVLC.h	(revision 883)
+++ /trunk/source/Lib/TLibDecoder/TDecCAVLC.h	(revision 884)
@@ -124,11 +124,6 @@
 #endif
 #if H_3D_INTER_SDC
-#if QC_SDC_UNIFY_G0130
   Void  parseDeltaDC        ( TComDataCU* pcCU, UInt absPartIdx, UInt depth );
   Void  parseSDCFlag        ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
-#else
-  Void  parseInterSDCFlag    ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
-  Void  parseInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPart );
-#endif
 #endif
 #if H_3D_DBBP
Index: /trunk/source/Lib/TLibDecoder/TDecCu.cpp
===================================================================
--- /trunk/source/Lib/TLibDecoder/TDecCu.cpp	(revision 883)
+++ /trunk/source/Lib/TLibDecoder/TDecCu.cpp	(revision 884)
@@ -293,5 +293,5 @@
 
 
-#if MTK_DDD_G0063
+#if H_3D_DDD
       pcCU->setUseDDD( false, uiAbsPartIdx, uiDepth );
 #endif
@@ -339,9 +339,5 @@
       if( pcCU->getSlice()->getIsDepth())
       {
-#if SEC_DEPTH_DV_DERIVAITON_G0074
         DvInfo.bDV = m_ppcCU[uiDepth]->getDispforDepth(0, 0, &DvInfo);
-#else
-        DvInfo.bDV = m_ppcCU[uiDepth]->getDispNeighBlocks(0, 0, &DvInfo);
-#endif
       }
       else
@@ -414,17 +410,9 @@
     m_pcEntropyDecoder->decodeMergeIndex( pcCU, 0, uiAbsPartIdx, uiDepth );
     UInt uiMergeIndex = pcCU->getMergeIndex(uiAbsPartIdx);
-
-#if !SEC_IC_ARP_SIG_G0072
+#if H_3D_ARP
+    m_pcEntropyDecoder->decodeARPW( pcCU , uiAbsPartIdx , uiDepth );
+#endif
 #if H_3D_IC
     m_pcEntropyDecoder->decodeICFlag( pcCU, uiAbsPartIdx, uiDepth );
-#endif
-#endif
-#if H_3D_ARP
-    m_pcEntropyDecoder->decodeARPW( pcCU , uiAbsPartIdx , uiDepth );
-#endif
-#if SEC_IC_ARP_SIG_G0072
-#if H_3D_IC
-    m_pcEntropyDecoder->decodeICFlag( pcCU, uiAbsPartIdx, uiDepth );
-#endif
 #endif
 
@@ -466,5 +454,5 @@
     pcCU->setInterDirSubParts( uhInterDirNeighbours[uiMergeIndex], uiAbsPartIdx, 0, uiDepth );
 
-#if MTK_DDD_G0063
+#if H_3D_DDD
     if( uiMergeIndex == m_ppcCU[uiDepth]->getUseDDDCandIdx() )
     {
@@ -484,5 +472,5 @@
         pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvd( cTmpMv, SIZE_2Nx2N, uiAbsPartIdx, uiDepth );
         pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvField( cMvFieldNeighbours[ 2*uiMergeIndex + uiRefListIdx ], SIZE_2Nx2N, uiAbsPartIdx, uiDepth );
-#if NTT_STORE_SPDV_VSP_G0148
+#if H_3D_VSP
         if( pcCU->getVSPFlag( uiAbsPartIdx ) != 0 )
         {
@@ -551,5 +539,5 @@
   m_pcEntropyDecoder->decodePartSize( pcCU, uiAbsPartIdx, uiDepth );
 
-#if QC_SDC_UNIFY_G0130
+#if H_3D_DIM_SDC
   m_pcEntropyDecoder->decodeSDCFlag( pcCU, uiAbsPartIdx, uiDepth );
 #endif
@@ -573,7 +561,4 @@
   // prediction mode ( Intra : direction mode, Inter : Mv, reference idx )
   m_pcEntropyDecoder->decodePredInfo( pcCU, uiAbsPartIdx, uiDepth, m_ppcCU[uiDepth]);
-#if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
-  m_pcEntropyDecoder->decodeInterSDCFlag( pcCU, uiAbsPartIdx, uiDepth );
-#endif
   // Coefficient decoding
   Bool bCodeDQP = getdQPFlag();
@@ -663,9 +648,5 @@
 #endif
 #if H_3D_INTER_SDC
-#if QC_SDC_UNIFY_G0130
       if( m_ppcCU[uiDepth]->getSDCFlag( 0 ) )
-#else
-      if( m_ppcCU[uiDepth]->getInterSDCFlag( 0 ) )
-#endif
       {
         xReconInterSDC( m_ppcCU[uiDepth], uiAbsPartIdx, uiDepth );
@@ -730,10 +711,4 @@
   UInt  uiWidth      = pcCU->getWidth ( 0 );
   UInt  uiHeight     = pcCU->getHeight( 0 );
-#if !SEC_INTER_SDC_G0101
-  UChar* pMask       = pcCU->getInterSDCMask();
-
-  memset( pMask, 0, uiWidth*uiHeight );
-  pcCU->xSetInterSDCCUMask( pcCU, pMask );
-#endif
 
   Pel  *pResi;
@@ -746,14 +721,5 @@
     for( uiPelX = 0; uiPelX < uiWidth; uiPelX++ )
     {
-#if SEC_INTER_SDC_G0101
       pResi[ uiPelX ] = pcCU->getSDCSegmentDCOffset( 0, 0 );
-#else
-      UChar uiSeg = pMask[ uiPelX + uiPelY*uiWidth ];
-#if QC_SDC_UNIFY_G0130
-      pResi[ uiPelX ] = pcCU->getSDCSegmentDCOffset( uiSeg, 0 );
-#else
-      pResi[ uiPelX ] = pcCU->getInterSDCSegmentDCOffset( uiSeg, 0 );
-#endif
-#endif
     }
     pResi += uiResiStride;
@@ -929,5 +895,5 @@
 #endif
   
-#if H_3D && UPDATE_HM13
+#if H_3D
   Bool useDltFlag = (isDimMode( uiLumaPredMode ) || uiLumaPredMode == HOR_IDX || uiLumaPredMode == VER_IDX || uiLumaPredMode == DC_IDX) && pcCU->getSlice()->getIsDepth() && pcCU->getSlice()->getPPS()->getDLT()->getUseDLTFlag(pcCU->getSlice()->getLayerIdInVps());
 
@@ -955,9 +921,5 @@
     {
 #if H_3D
-#if UPDATE_HM13
       if ( useDltFlag )
-#else
-      if( (isDimMode( uiLumaPredMode ) || uiLumaPredMode == HOR_IDX || uiLumaPredMode == VER_IDX || uiLumaPredMode == DC_IDX) && pcCU->getSlice()->getIsDepth() && pcCU->getSlice()->getPPS()->getDLT()->getUseDLTFlag(pcCU->getSlice()->getLayerIdInVps()) )
-#endif
       {
         pReco    [ uiX ] = pcCU->getSlice()->getPPS()->getDLT()->idx2DepthValue( pcCU->getSlice()->getLayerIdInVps(), Clip3( 0, pcCU->getSlice()->getPPS()->getDLT()->getNumDepthValues( pcCU->getSlice()->getLayerIdInVps() ) - 1, pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), pPred[ uiX ] ) + pResi[ uiX ] ) );
@@ -1151,18 +1113,6 @@
   UInt uiWidth        = pcCU->getWidth  ( 0 );
   UInt uiHeight       = pcCU->getHeight ( 0 );
-#if QC_PKU_SDC_SPLIT_G0123
-#if HS_TSINGHUA_SDC_SPLIT_G0111
-#if QC_GENERIC_SDC_G0122
   TComWedgelet* dmm4SegmentationOrg = new TComWedgelet( uiWidth, uiHeight );
-#endif
-#else
-#if QC_GENERIC_SDC_G0122
-  TComWedgelet* dmm4Segmentation = new TComWedgelet( uiWidth, uiHeight );
-#endif
-#endif
-#endif
-#if QC_PKU_SDC_SPLIT_G0123
   UInt numParts = 1;
-  UInt i = 0;
   UInt sdcDepth    = 0;
   TComYuv* pcRecoYuv  = m_ppcYuvReco[uiDepth];
@@ -1181,5 +1131,4 @@
   UInt    uiLumaPredMode = 0;  
 
-#if HS_TSINGHUA_SDC_SPLIT_G0111
   if ((uiWidth >> pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize()) > 1)
   {
@@ -1188,14 +1137,6 @@
     uiWidth = uiHeight = (1 << pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize());
   }
-#else
-  if (uiWidth == 64)
-  {
-    numParts = 4;
-    sdcDepth = 1;
-    uiWidth = uiHeight = 32;
-  }
-#endif
-
-  for ( i = 0; i < numParts; i++ )
+
+  for ( Int i = 0; i < numParts; i++ )
   {
     uiStride    = pcRecoYuv->getStride  ();
@@ -1203,5 +1144,5 @@
     piPred      = pcPredYuv->getLumaAddr( uiAbsPartIdx );
     piResi      = pcResiYuv->getLumaAddr( uiAbsPartIdx );
-  
+
     uiZOrder          = pcCU->getZorderIdxInCU() + uiAbsPartIdx;
     piRecIPred        = pcCU->getPic()->getPicYuvRec()->getLumaAddr( pcCU->getAddr(), uiZOrder );
@@ -1211,70 +1152,29 @@
 
     AOF( uiWidth == uiHeight );
-#else
-  TComYuv* pcRecoYuv  = m_ppcYuvReco[uiDepth];
-  TComYuv* pcPredYuv  = m_ppcYuvReco[uiDepth];
-  TComYuv* pcResiYuv  = m_ppcYuvResi[uiDepth];
-  
-  UInt    uiStride    = pcRecoYuv->getStride  ();
-  Pel*    piReco      = pcRecoYuv->getLumaAddr( uiAbsPartIdx );
-  Pel*    piPred      = pcPredYuv->getLumaAddr( uiAbsPartIdx );
-  Pel*    piResi      = pcResiYuv->getLumaAddr( uiAbsPartIdx );
-  
-  UInt    uiZOrder          = pcCU->getZorderIdxInCU() + uiAbsPartIdx;
-  Pel*    piRecIPred        = pcCU->getPic()->getPicYuvRec()->getLumaAddr( pcCU->getAddr(), uiZOrder );
-  UInt    uiRecIPredStride  = pcCU->getPic()->getPicYuvRec()->getStride  ();
-  
-  UInt    uiLumaPredMode    = pcCU->getLumaIntraDir     ( uiAbsPartIdx );
-  
-  AOF( uiWidth == uiHeight );
-  AOF( uiAbsPartIdx == 0 );
-  AOF( pcCU->getSDCAvailable(uiAbsPartIdx) );
-  AOF( pcCU->getSDCFlag(uiAbsPartIdx) );
-#endif
-  
-  //===== init availability pattern =====
-  Bool  bAboveAvail = false;
-  Bool  bLeftAvail  = false;
-#if QC_PKU_SDC_SPLIT_G0123
-  pcCU->getPattern()->initPattern   ( pcCU, sdcDepth, uiAbsPartIdx );
-  pcCU->getPattern()->initAdiPattern( pcCU, uiAbsPartIdx, sdcDepth, m_pcPrediction->getPredicBuf(), m_pcPrediction->getPredicBufWidth(), m_pcPrediction->getPredicBufHeight(), bAboveAvail, bLeftAvail );
-#else
-  pcCU->getPattern()->initPattern   ( pcCU, 0, uiAbsPartIdx );
-  pcCU->getPattern()->initAdiPattern( pcCU, uiAbsPartIdx, 0, m_pcPrediction->getPredicBuf(), m_pcPrediction->getPredicBufWidth(), m_pcPrediction->getPredicBufHeight(), bAboveAvail, bLeftAvail );
-#endif
-#if !QC_PKU_SDC_SPLIT_G0123
-#if QC_GENERIC_SDC_G0122
-  TComWedgelet* dmm4Segmentation = new TComWedgelet( uiWidth, uiHeight );
-#endif
-#endif
-#if HS_TSINGHUA_SDC_SPLIT_G0111
-  TComWedgelet* dmm4Segmentation = new TComWedgelet( uiWidth, uiHeight );
-#endif
-  //===== get prediction signal =====
-#if H_3D_DIM
-  if( isDimMode( uiLumaPredMode ) )
-  {
-    m_pcPrediction->predIntraLumaDepth( pcCU, uiAbsPartIdx, uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight 
-#if QC_GENERIC_SDC_G0122
-      , false, dmm4Segmentation
-#endif
-      );
-#if HS_TSINGHUA_SDC_SPLIT_G0111
-    Bool* dmm4PatternSplit = dmm4Segmentation->getPattern();
-    Bool* dmm4PatternOrg = dmm4SegmentationOrg->getPattern();
-    for( UInt k = 0; k < (uiWidth*uiHeight); k++ ) 
-    { 
-      dmm4PatternOrg[k+(uiAbsPartIdx<<4)] = dmm4PatternSplit[k];
-    }
-#endif
-  }
-  else
-  {
-#endif
-    m_pcPrediction->predIntraLumaAng( pcCU->getPattern(), uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight, bAboveAvail, bLeftAvail );
-#if H_3D_DIM
-  }
-#endif
-#if QC_PKU_SDC_SPLIT_G0123 
+
+    //===== init availability pattern =====
+    Bool  bAboveAvail = false;
+    Bool  bLeftAvail  = false;
+
+    pcCU->getPattern()->initPattern   ( pcCU, sdcDepth, uiAbsPartIdx );
+    pcCU->getPattern()->initAdiPattern( pcCU, uiAbsPartIdx, sdcDepth, m_pcPrediction->getPredicBuf(), m_pcPrediction->getPredicBufWidth(), m_pcPrediction->getPredicBufHeight(), bAboveAvail, bLeftAvail );
+
+    TComWedgelet* dmm4Segmentation = new TComWedgelet( uiWidth, uiHeight );
+    //===== get prediction signal =====
+    if( isDimMode( uiLumaPredMode ) )
+    {
+      m_pcPrediction->predIntraLumaDepth( pcCU, uiAbsPartIdx, uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight, false, dmm4Segmentation  );
+      Bool* dmm4PatternSplit = dmm4Segmentation->getPattern();
+      Bool* dmm4PatternOrg = dmm4SegmentationOrg->getPattern();
+      for( UInt k = 0; k < (uiWidth*uiHeight); k++ ) 
+      { 
+        dmm4PatternOrg[k+(uiAbsPartIdx<<4)] = dmm4PatternSplit[k];
+      }
+    }
+    else
+    {
+      m_pcPrediction->predIntraLumaAng( pcCU->getPattern(), uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight, bAboveAvail, bLeftAvail );
+    }
+
     if ( numParts > 1 )
     {
@@ -1292,7 +1192,5 @@
     }
     uiAbsPartIdx += ( (uiWidth * uiWidth) >> 4 );
-#if HS_TSINGHUA_SDC_SPLIT_G0111
     dmm4Segmentation->destroy(); delete dmm4Segmentation;
-#endif
   }
   uiAbsPartIdx = 0;
@@ -1309,5 +1207,4 @@
   piRecIPred        = pcCU->getPic()->getPicYuvRec()->getLumaAddr( pcCU->getAddr(), uiZOrder );
   uiRecIPredStride  = pcCU->getPic()->getPicYuvRec()->getStride  ();
-#endif
   // number of segments depends on prediction mode
   UInt uiNumSegments = 1;
@@ -1326,17 +1223,10 @@
     uiMaskStride = pcWedgelet->getStride();
   }
-#if QC_GENERIC_SDC_G0122
   if( getDimType( uiLumaPredMode ) == DMM4_IDX )
   {
     uiNumSegments = 2;
-#if HS_TSINGHUA_SDC_SPLIT_G0111
     pbMask  = dmm4SegmentationOrg->getPattern();
     uiMaskStride = dmm4SegmentationOrg->getStride();
-#else
-    pbMask  = dmm4Segmentation->getPattern();
-    uiMaskStride = dmm4Segmentation->getStride();
-#endif
-  }
-#endif
+  }
   // get DC prediction for each segment
   Pel apDCPredValues[2];
@@ -1400,11 +1290,5 @@
     pRecCr += uiStrideC;
   }
-#if QC_GENERIC_SDC_G0122
-#if HS_TSINGHUA_SDC_SPLIT_G0111
   dmm4SegmentationOrg->destroy(); delete dmm4SegmentationOrg;
-#else
-  dmm4Segmentation->destroy(); delete dmm4Segmentation;
-#endif
-#endif
 }
 #endif
Index: /trunk/source/Lib/TLibDecoder/TDecEntropy.cpp
===================================================================
--- /trunk/source/Lib/TLibDecoder/TDecEntropy.cpp	(revision 883)
+++ /trunk/source/Lib/TLibDecoder/TDecEntropy.cpp	(revision 884)
@@ -111,9 +111,5 @@
   pcCU->setICFlagSubParts( false , uiAbsPartIdx, 0, uiDepth );
 
-#if SEC_IC_ARP_SIG_G0072
   if ( pcCU->isIntra( uiAbsPartIdx ) || ( pcCU->getSlice()->getViewIndex() == 0 ) || pcCU->getSlice()->getIsDepth() || pcCU->getARPW( uiAbsPartIdx ) > 0 )
-#else
-  if ( pcCU->isIntra( uiAbsPartIdx ) || ( pcCU->getSlice()->getViewIndex() == 0 ) || pcCU->getSlice()->getIsDepth() )
-#endif
   {
     return;
@@ -272,16 +268,9 @@
       decodeMergeIndex( pcCU, uiPartIdx, uiSubPartIdx, uiDepth );
       UInt uiMergeIndex = pcCU->getMergeIndex(uiSubPartIdx);
-#if !SEC_IC_ARP_SIG_G0072
+#if H_3D_ARP
+      decodeARPW  ( pcCU, uiAbsPartIdx, uiDepth );
+#endif
 #if H_3D_IC
       decodeICFlag( pcCU, uiAbsPartIdx, uiDepth );
-#endif
-#endif
-#if H_3D_ARP
-      decodeARPW  ( pcCU, uiAbsPartIdx, uiDepth );
-#endif
-#if SEC_IC_ARP_SIG_G0072
-#if H_3D_IC
-      decodeICFlag( pcCU, uiAbsPartIdx, uiDepth );
-#endif
 #endif
 #if H_3D_DBBP
@@ -362,5 +351,5 @@
       pcCU->setInterDirSubParts( uhInterDirNeighbours[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth );
 
-#if MTK_DDD_G0063
+#if H_3D_DDD
       if( uiMergeIndex == pcSubCU->getUseDDDCandIdx() )
       {
@@ -384,5 +373,5 @@
           pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvd( cTmpMv, ePartSize, uiSubPartIdx, uiDepth, uiPartIdx );
           pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvField( cMvFieldNeighbours[ 2*uiMergeIndex + uiRefListIdx ], ePartSize, uiSubPartIdx, uiDepth, uiPartIdx );
-#if NTT_STORE_SPDV_VSP_G0148
+#if H_3D_VSP
 #if H_3D_DBBP
           if( pcCU->getVSPFlag( uiSubPartIdx ) != 0 && !pcCU->getDBBPFlag( uiAbsPartIdx ) )
@@ -440,24 +429,13 @@
         }
       }
-#if !SEC_IC_ARP_SIG_G0072
+#if H_3D_ARP
+      decodeARPW  ( pcCU, uiAbsPartIdx, uiDepth );
+#endif
 #if H_3D_IC
       decodeICFlag( pcCU, uiAbsPartIdx, uiDepth );
 #endif
-#endif
-#if H_3D_ARP
-      decodeARPW  ( pcCU, uiAbsPartIdx, uiDepth );
-#endif
-#if SEC_IC_ARP_SIG_G0072
-#if H_3D_IC
-      decodeICFlag( pcCU, uiAbsPartIdx, uiDepth );
-#endif
-#endif
     }
 #if H_3D_VSP
-#if NTT_STORE_SPDV_VSP_G0148
     if ( (pcCU->getInterDir(uiSubPartIdx) == 3) && pcSubCU->isBipredRestriction(uiPartIdx) && (pcCU->getVSPFlag(uiSubPartIdx) == 0))
-#else
-    if ( (pcCU->getInterDir(uiSubPartIdx) == 3) && pcSubCU->isBipredRestriction(uiPartIdx) && (pcCU->getVSPFlag(uiSubPartIdx) == false))
-#endif
 #else
     if ( (pcCU->getInterDir(uiSubPartIdx) == 3) && pcSubCU->isBipredRestriction(uiPartIdx) )
@@ -797,5 +775,4 @@
   UInt uiLumaOffset   = uiMinCoeffSize*uiAbsPartIdx;
   UInt uiChromaOffset = uiLumaOffset>>2;
-#if QC_SDC_UNIFY_G0130
 #if H_3D_DIM_SDC
   if( pcCU->getSDCFlag( uiAbsPartIdx ) && pcCU->isIntra( uiAbsPartIdx) )
@@ -807,5 +784,4 @@
     assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_V) == 1 );
   }
-#endif
 
 #if H_3D_INTER_SDC
@@ -817,9 +793,5 @@
   }
 #endif
-#if QC_SDC_UNIFY_G0130_FIX
   if( pcCU->getSlice()->getIsDepth() && ( pcCU->getSDCFlag( uiAbsPartIdx ) || pcCU->isIntra( uiAbsPartIdx ) ) )
-#else
-  if( pcCU->getSDCFlag( uiAbsPartIdx ) || pcCU->isIntra( uiAbsPartIdx ) )
-#endif
   {
     Int iPartNum = ( pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_NxN ) ? 4 : 1;
@@ -842,28 +814,4 @@
     }
   }
-#else
-#if H_3D_DIM_SDC
-  if( pcCU->getSDCFlag( uiAbsPartIdx ) )
-  {
-    assert( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N );
-    assert( pcCU->getTransformIdx(uiAbsPartIdx) == 0 );
-    assert( pcCU->getCbf(uiAbsPartIdx, TEXT_LUMA) == 1 );
-    assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_U) == 1 );
-    assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_V) == 1 );
-    return;
-  }
-#endif
-  
-#if H_3D_INTER_SDC
-  if( pcCU->getInterSDCFlag( uiAbsPartIdx ) )
-  {
-    assert( !pcCU->isSkipped( uiAbsPartIdx ) );
-    assert( !pcCU->isIntra( uiAbsPartIdx) );
-    assert( pcCU->getSlice()->getIsDepth() );
-
-    decodeInterSDCResidualData( pcCU, uiAbsPartIdx, uiDepth );
-    return;
-  }
-#endif
 #endif
 
@@ -893,5 +841,4 @@
 
 #if H_3D_INTER_SDC
-#if QC_SDC_UNIFY_G0130
 Void TDecEntropy::decodeSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
 {
@@ -904,61 +851,12 @@
   }
 
-#if SEC_INTER_SDC_G0101
   if( !pcCU->getSlice()->getIsDepth() || pcCU->getPartitionSize( uiAbsPartIdx ) != SIZE_2Nx2N || pcCU->isSkipped( uiAbsPartIdx ) )
-#else
-  if( !pcCU->getSlice()->getIsDepth() || ( pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) != SIZE_2Nx2N ) || pcCU->isSkipped( uiAbsPartIdx ) )
-#endif
   {
     return;
   }
 
-#if SEC_INTER_SDC_G0101
   assert( pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N || ( !pcCU->isIntra( uiAbsPartIdx ) && !pcCU->isSkipped( uiAbsPartIdx ) ) );
-#else
-  assert( ( pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N ) || ( !pcCU->isIntra( uiAbsPartIdx ) && !pcCU->isSkipped( uiAbsPartIdx ) ) );
-#endif
-
   m_pcEntropyDecoderIf->parseSDCFlag( pcCU, uiAbsPartIdx, uiDepth );
 }
-
-#else
-Void TDecEntropy::decodeInterSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
-{
-  pcCU->setInterSDCFlagSubParts( false, uiAbsPartIdx, 0, uiDepth);
-
-  if( !pcCU->getSlice()->getVPS()->getInterSDCFlag( pcCU->getSlice()->getLayerIdInVps() ) )
-  {
-    return;
-  }
-
-  if( !pcCU->getSlice()->getIsDepth() || pcCU->isIntra( uiAbsPartIdx ) || pcCU->isSkipped( uiAbsPartIdx ) )
-  {
-    return;
-  }
-
-  m_pcEntropyDecoderIf->parseInterSDCFlag( pcCU, uiAbsPartIdx, uiDepth );
-}
-
-Void TDecEntropy::decodeInterSDCResidualData( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
-{
-  if( !pcCU->getSlice()->getVPS()->getInterSDCFlag( pcCU->getSlice()->getLayerIdInVps() ) )
-  {
-    return;
-  }
-
-  if( !pcCU->getSlice()->getIsDepth() || pcCU->isIntra( uiAbsPartIdx ) || !pcCU->getInterSDCFlag( uiAbsPartIdx ) )
-  {
-    return;
-  }
-
-  UInt uiNumSegments = ( pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N ) ? 1 : ( pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_NxN ? 4 : 2 );
-
-  // decode residual data for each segment
-  for( UInt uiSeg = 0; uiSeg < uiNumSegments; uiSeg++ )
-  {
-    m_pcEntropyDecoderIf->parseInterSDCResidualData( pcCU, uiAbsPartIdx, uiDepth, uiSeg );
-  }
-}
-#endif
 #endif
 #if H_3D_DBBP
Index: /trunk/source/Lib/TLibDecoder/TDecEntropy.h
===================================================================
--- /trunk/source/Lib/TLibDecoder/TDecEntropy.h	(revision 883)
+++ /trunk/source/Lib/TLibDecoder/TDecEntropy.h	(revision 884)
@@ -96,11 +96,6 @@
 #endif
 #if H_3D_INTER_SDC
-#if QC_SDC_UNIFY_G0130
   virtual Void parseDeltaDC       ( TComDataCU* pcCU, UInt absPartIdx, UInt depth ) = 0;
   virtual Void parseSDCFlag       ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
-#else
-  virtual Void parseInterSDCFlag  ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
-  virtual Void parseInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPart ) = 0;
-#endif
 #endif
 #if H_3D_DBBP
@@ -187,10 +182,5 @@
 #endif
 #if H_3D_INTER_SDC
-#if QC_SDC_UNIFY_G0130
   Void decodeSDCFlag           ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
-#else
-  Void decodeInterSDCFlag      ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
-  Void decodeInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
-#endif
 #endif
 #if H_3D_DBBP
Index: /trunk/source/Lib/TLibDecoder/TDecSbac.cpp
===================================================================
--- /trunk/source/Lib/TLibDecoder/TDecSbac.cpp	(revision 883)
+++ /trunk/source/Lib/TLibDecoder/TDecSbac.cpp	(revision 884)
@@ -86,10 +86,5 @@
 , m_cDdcFlagSCModel           ( 1,             1,               NUM_DDC_FLAG_CTX              , m_contextModels + m_numContextModels, m_numContextModels)
 , m_cDdcDataSCModel           ( 1,             1,               NUM_DDC_DATA_CTX              , m_contextModels + m_numContextModels, m_numContextModels)
-#if QC_GENERIC_SDC_G0122
 , m_cAngleFlagSCModel         ( 1,             1,               NUM_ANGLE_FLAG_CTX            , m_contextModels + m_numContextModels, m_numContextModels)
-#if !QC_SDC_UNIFY_G0130
-, m_cIntraSdcFlagSCModel      ( 1,             1,               NUM_INTRASDC_FLAG_CTX         , m_contextModels + m_numContextModels, m_numContextModels)
-#endif
-#endif
 #if H_3D_DIM_DMM
 , m_cDmm1DataSCModel          ( 1,             1,               NUM_DMM1_DATA_CTX             , m_contextModels + m_numContextModels, m_numContextModels)
@@ -100,10 +95,5 @@
 #endif
 #endif
-#if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
-, m_cInterSDCFlagSCModel             ( 1,             1,  NUM_INTER_SDC_FLAG_CTX           , m_contextModels + m_numContextModels, m_numContextModels)
-, m_cInterSDCResidualSCModel         ( 1,             1,  NUM_INTER_SDC_RESIDUAL_CTX       , m_contextModels + m_numContextModels, m_numContextModels)
-, m_cInterSDCResidualSignFlagSCModel ( 1,             1,  NUM_INTER_SDC_SIGN_FLAG_CTX      , m_contextModels + m_numContextModels, m_numContextModels)
-#endif
-#if QC_SDC_UNIFY_G0130
+#if H_3D_DIM_SDC
 , m_cSDCFlagSCModel                  ( 1,             1,  NUM_SDC_FLAG_CTX                 , m_contextModels + m_numContextModels, m_numContextModels)
 #endif
@@ -180,10 +170,5 @@
   m_cDdcFlagSCModel.initBuffer           ( sliceType, qp, (UChar*)INIT_DDC_FLAG );
   m_cDdcDataSCModel.initBuffer           ( sliceType, qp, (UChar*)INIT_DDC_DATA );
-#if QC_GENERIC_SDC_G0122
   m_cAngleFlagSCModel.initBuffer         ( sliceType, qp, (UChar*)INIT_ANGLE_FLAG );
-#if !QC_SDC_UNIFY_G0130
-  m_cIntraSdcFlagSCModel.initBuffer      ( sliceType, qp, (UChar*)INIT_INTRASDC_FLAG );
-#endif
-#endif
 #if H_3D_DIM_DMM
   m_cDmm1DataSCModel.initBuffer          ( sliceType, qp, (UChar*)INIT_DMM1_DATA );
@@ -194,10 +179,5 @@
 #endif
 #endif
-#if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
-  m_cInterSDCFlagSCModel.initBuffer       ( sliceType, qp, (UChar*)INIT_INTER_SDC_FLAG );
-  m_cInterSDCResidualSCModel.initBuffer   ( sliceType, qp, (UChar*)INIT_INTER_SDC_RESIDUAL );
-  m_cInterSDCResidualSignFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_INTER_SDC_SIGN_FLAG );
-#endif
-#if QC_SDC_UNIFY_G0130
+#if H_3D_DIM_SDC
   m_cSDCFlagSCModel.initBuffer            ( sliceType, qp, (UChar*)INIT_SDC_FLAG );
 #endif
@@ -260,10 +240,5 @@
   m_cDdcFlagSCModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_DDC_FLAG );
   m_cDdcDataSCModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_DDC_DATA );
-#if QC_GENERIC_SDC_G0122
   m_cAngleFlagSCModel.initBuffer         ( eSliceType, iQp, (UChar*)INIT_ANGLE_FLAG );
-#if !QC_SDC_UNIFY_G0130
-  m_cIntraSdcFlagSCModel.initBuffer      ( eSliceType, iQp, (UChar*)INIT_INTRASDC_FLAG );
-#endif
-#endif
 #if H_3D_DIM_DMM
   m_cDmm1DataSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_DMM1_DATA );
@@ -274,10 +249,5 @@
 #endif
 #endif
-#if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
-  m_cInterSDCFlagSCModel.initBuffer       ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_FLAG );
-  m_cInterSDCResidualSCModel.initBuffer   ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_RESIDUAL );
-  m_cInterSDCResidualSignFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_SIGN_FLAG );
-#endif
-#if QC_SDC_UNIFY_G0130
+#if H_3D_DIM_SDC
   m_cSDCFlagSCModel.initBuffer            ( eSliceType, iQp, (UChar*)INIT_SDC_FLAG );
 #endif
@@ -817,15 +787,10 @@
   Bool rapPic     = (pcCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || pcCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP || pcCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA);
 
-#if MTK_TEX_DEP_PAR_G0055
   Bool depthDependent = false;
   UInt uiTexturePart = uiMode;
-#endif
   if(bDepthMapDetect && !bIntraSliceDetect && !rapPic && sps->getUseQTL() && sps->getUsePC())
   {
     TComDataCU *pcTextureCU = pcTexture->getCU(pcCU->getAddr());
     assert(pcTextureCU->getDepth(uiAbsPartIdx) >= uiDepth);
-#if !MTK_TEX_DEP_PAR_G0055
-    if (pcTextureCU->getDepth(uiAbsPartIdx) == uiDepth && pcTextureCU->getPartitionSize( uiAbsPartIdx ) != SIZE_NxN)
-#else
     if(pcTextureCU->getDepth(uiAbsPartIdx) == uiDepth )
     {
@@ -834,5 +799,4 @@
     }
     if (pcTextureCU->getDepth(uiAbsPartIdx) == uiDepth && pcTextureCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N)
-#endif
     {
       bParsePartSize = false;
@@ -879,6 +843,4 @@
     if(bParsePartSize)
     {
-#endif
-#if MTK_TEX_DEP_PAR_G0055
       if (depthDependent==false || uiTexturePart == SIZE_NxN|| uiTexturePart == SIZE_2Nx2N)
       {
@@ -920,5 +882,5 @@
         }
       }
-#if MTK_TEX_DEP_PAR_G0055
+#if H_3D_QTLPC
       }
       else if(uiTexturePart == SIZE_2NxN || uiTexturePart == SIZE_2NxnU || uiTexturePart == SIZE_2NxnD)
@@ -985,10 +947,10 @@
       }
       else
+      {
         assert(0);
-#endif
+      }
 #if H_MV_ENC_DEC_TRAC          
       DTRACE_CU("part_mode", eMode )
 #endif
-#if H_3D_QTLPC
     }
 #endif
@@ -1041,11 +1003,4 @@
     }
     if( pcCU->getLumaIntraDir( absPartIdx+partOffset*j ) < NUM_INTRA_MODE )
-#if H_3D_DIM_SDC
-#if QC_GENERIC_SDC_G0122
-      if( 1 ) // This should be cleaned up. 
-#else
-      if( !pcCU->getSDCFlag( absPartIdx+partOffset*j ) )
-#endif
-#endif
     {
 #endif
@@ -1063,11 +1018,4 @@
 #if H_3D_DIM
     if( pcCU->getLumaIntraDir( absPartIdx+partOffset*j ) < NUM_INTRA_MODE )
-#if H_3D_DIM_SDC
-#if QC_GENERIC_SDC_G0122
-      if( 1 )  // This should be cleaned up. 
-#else
-      if( !pcCU->getSDCFlag( absPartIdx+partOffset*j ) )
-#endif
-#endif
     {
 #endif
@@ -1171,53 +1119,7 @@
   }
 
-#if !QC_SDC_UNIFY_G0130
-  if( dimType < DIM_NUM_TYPE || pcCU->getSDCFlag( absPartIdx ) )
-  {
-    UInt symbol;
-#if QC_GENERIC_SDC_G0122
-    UInt uiNumSegments = isDimMode( dir ) ? 2 : 1;
-#else
-    UInt uiNumSegments = ( dir == PLANAR_IDX ) ? 1 : 2;
-#endif
-
-    if( pcCU->getSDCFlag( absPartIdx ) )
-    {
-      assert(pcCU->getPartitionSize(absPartIdx)==SIZE_2Nx2N);
-      pcCU->setTrIdxSubParts(0, absPartIdx, depth);
-      pcCU->setCbfSubParts(1, 1, 1, absPartIdx, depth);
-    }
-
-    m_pcTDecBinIf->decodeBin( symbol, m_cDdcFlagSCModel.get(0, 0, uiNumSegments-1) );
-
-    if( symbol )
-    {
-      if( !pcCU->getSDCFlag( absPartIdx ) )
-      {
-        dir += symbol;
-      }
-    }
-    for( UInt segment = 0; segment < uiNumSegments; segment++ )
-    {
-      Pel valDeltaDC = 0;
-      if( symbol )
-      {
-        xParseDimDeltaDC( valDeltaDC, uiNumSegments );
-      }
-
-      if( pcCU->getSDCFlag( absPartIdx ) )
-      {
-        pcCU->setSDCSegmentDCOffset( valDeltaDC, segment, absPartIdx );
-      }
-      else
-      {
-        pcCU->setDimDeltaDC( dimType, segment, absPartIdx, valDeltaDC );
-      }
-    }
-  }
-#endif
   pcCU->setLumaIntraDirSubParts( (UChar)dir, absPartIdx, depth );
 }
 
-#if QC_GENERIC_SDC_G0122
 Void TDecSbac::parseIntraDepthMode( TComDataCU* pcCU, UInt absPartIdx, UInt depth )
 {
@@ -1234,16 +1136,5 @@
   uiIsDimMode = uiSymbol ? 0 : 1;
   pcCU->setLumaIntraDirSubParts( 0, absPartIdx, depth );
-#if !QC_SDC_UNIFY_G0130
-  if( pcCU->getPartitionSize( absPartIdx ) == SIZE_2Nx2N ) //SDC is allowed only in this case
-  {
-    m_pcTDecBinIf->decodeBin( uiSymbol, m_cIntraSdcFlagSCModel.get( 0, 0, pcCU->getCtxSDCFlag( absPartIdx ) ) );
-  }
-  else
-  {
-    uiSymbol = 0;
-  }
-
-  pcCU->setSDCFlagSubParts( uiSymbol, absPartIdx, depth );
-#endif
+
   //decode DMM index
   if( uiIsDimMode )
@@ -1260,68 +1151,4 @@
   }
 }
-#else
-Void TDecSbac::parseIntraDepthMode( TComDataCU* pcCU, UInt absPartIdx, UInt depth )
-{
-  UInt puIdx = (pcCU->getWidth(absPartIdx) == 64) ? 2 : ( (pcCU->getPartitionSize(absPartIdx) == SIZE_NxN && pcCU->getWidth(absPartIdx) == 8) ? 0 : 1 );
-  UInt dir = 0;
-  Bool sdcFlag = 0;
-  UInt symbol = 1;
-  UInt modeCode = 0 ;
-  UInt binNum = 0;
-  UInt ctxDepthMode = 0;
-
-  if( puIdx == 2 )
-  {
-    {
-      ctxDepthMode = puIdx*3 + binNum;
-      m_pcTDecBinIf->decodeBin( symbol, m_cDepthIntraModeSCModel.get(0,0,ctxDepthMode) );
-      modeCode = (modeCode<<1) + symbol;
-      binNum++;
-    }
-         if( modeCode == 0 ) { dir = PLANAR_IDX; sdcFlag = 1;}
-    else if( modeCode == 1 ) { dir = 0;          sdcFlag = 0;}
-  }
-  else if( puIdx == 0 )
-  {
-    while( binNum < 1 && symbol )
-    {
-      ctxDepthMode = puIdx*3 + ((binNum >= 2) ? 2 : binNum);
-      m_pcTDecBinIf->decodeBin( symbol, m_cDepthIntraModeSCModel.get(0,0,ctxDepthMode) );
-      modeCode = (modeCode<<1) + symbol;
-      binNum++;
-    }
-    if( modeCode == 0 ) 
-    { 
-      dir = 0;
-      sdcFlag = 0;
-    }
-    else if ( modeCode == 1 ) 
-    { 
-      dir = (2*DMM1_IDX+DIM_OFFSET); 
-      sdcFlag = 0;
-    }
-  }
-  else
-  {
-    while( binNum < 4 && symbol )
-    {
-      ctxDepthMode = puIdx*3 + ((binNum >= 2) ? 2 : binNum);
-      m_pcTDecBinIf->decodeBin( symbol, m_cDepthIntraModeSCModel.get(0,0,ctxDepthMode) );
-      modeCode = (modeCode<<1) + symbol;
-      binNum++;
-    }
-    if ( modeCode == 0 )        { dir =  PLANAR_IDX;             sdcFlag = 1;}
-    else if ( modeCode == 2 )   { dir = 5;                       sdcFlag = 0;}
-    else if ( modeCode == 6 )   { dir = (2*DMM1_IDX+DIM_OFFSET); sdcFlag = 1;}
-    else if ( modeCode == 14 )  { dir = (2*DMM1_IDX+DIM_OFFSET); sdcFlag = 0;}
-    else if ( modeCode == 15 )  { dir = (2*DMM4_IDX+DIM_OFFSET); sdcFlag = 0;}
-
-  }
-  pcCU->setLumaIntraDirSubParts( (UChar)dir, absPartIdx, depth );
-#if H_3D_DIM_SDC
-  pcCU->setSDCFlagSubParts( sdcFlag, absPartIdx, depth ); 
-#endif
-}
-#endif
 #endif
 
@@ -2189,9 +2016,5 @@
   if( 1 == uiW )   
   {
-#if MTK_ARP_FLAG_CABAC_SIMP_G0061
     m_pcTDecBinIf->decodeBin( uiCode , m_cCUPUARPWSCModel.get( 0, 0, 2 ) );
-#else
-    m_pcTDecBinIf->decodeBin( uiCode , m_cCUPUARPWSCModel.get( 0, 0, 3 ) );
-#endif
     uiW += ( 1 == uiCode ? 1 : 0 );
   }
@@ -2213,10 +2036,5 @@
 { 
   UInt uiSymbol = 0;
-#if MTK_IC_FLAG_CABAC_SIMP_G0061
   m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUICFlagSCModel.get( 0, 0, 0 ) );
-#else
-  UInt uiCtxIC = pcCU->getCtxICFlag( uiAbsPartIdx );
-  m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUICFlagSCModel.get( 0, 0, uiCtxIC ) );
-#endif
 #if !H_MV_ENC_DEC_TRAC 
   DTRACE_CABAC_VL( g_nSymbolCounter++ );
@@ -2236,5 +2054,4 @@
 
 #if H_3D_INTER_SDC
-#if QC_SDC_UNIFY_G0130
 Void TDecSbac::parseDeltaDC( TComDataCU* pcCU, UInt absPartIdx, UInt depth )
 {
@@ -2267,10 +2084,5 @@
   else
   {
-#if SEC_INTER_SDC_G0101
     uiNumSegments = 1;
-#else
-    PartSize cPartSize = pcCU->getPartitionSize( absPartIdx );
-    uiNumSegments = ( cPartSize == SIZE_2Nx2N ) ? 1 : ( cPartSize == SIZE_NxN ? 4 : 2 );
-#endif
     symbol = 1;
   }
@@ -2323,39 +2135,5 @@
   }
 }
-#else
-Void TDecSbac::parseInterSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
-{
-  UInt uiSymbol = 0;
-  UInt uiCtxInterSDCFlag = pcCU->getCtxInterSDCFlag( uiAbsPartIdx );
-
-  m_pcTDecBinIf->decodeBin( uiSymbol, m_cInterSDCFlagSCModel.get( 0, 0, uiCtxInterSDCFlag ) );
-
-  if( uiSymbol )
-  {
-    pcCU->setInterSDCFlagSubParts( true, uiAbsPartIdx, 0, uiDepth );
-    pcCU->setTrIdxSubParts( 0, uiAbsPartIdx, uiDepth );
-    pcCU->setCbfSubParts( 1, 1, 1, uiAbsPartIdx, uiDepth );
-  }
-  else
-  {
-    pcCU->setInterSDCFlagSubParts( false, uiAbsPartIdx, 0, uiDepth);
-  }
-}
-
-Void TDecSbac::parseInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiSegment )
-{
-  UInt uiAbsIdx   = 0;
-  UInt uiSign     = 0;
-  Int  iIdx       = 0;
-
-  xReadExGolombLevel( uiAbsIdx, m_cInterSDCResidualSCModel.get( 0, 0, 0 ) );
-
-  uiAbsIdx++;
-  m_pcTDecBinIf->decodeBin( uiSign, m_cInterSDCResidualSignFlagSCModel.get( 0, 0, 0 ) );
-  iIdx = (Int)( uiSign ? -1 : 1 ) * uiAbsIdx;
-
-  pcCU->setInterSDCSegmentDCOffset( iIdx, uiSegment, uiAbsPartIdx );
-}
-#endif
+
 #endif
 
Index: /trunk/source/Lib/TLibDecoder/TDecSbac.h
===================================================================
--- /trunk/source/Lib/TLibDecoder/TDecSbac.h	(revision 883)
+++ /trunk/source/Lib/TLibDecoder/TDecSbac.h	(revision 884)
@@ -112,11 +112,6 @@
 #endif
 #if H_3D_INTER_SDC
-#if QC_SDC_UNIFY_G0130
   Void  parseDeltaDC         ( TComDataCU* pcCU, UInt absPartIdx, UInt depth );
   Void  parseSDCFlag         ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
-#else
-  Void  parseInterSDCFlag    ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
-  Void  parseInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPart );
-#endif
 #endif
 #if H_3D_DBBP
@@ -218,10 +213,5 @@
   ContextModel3DBuffer m_cDdcFlagSCModel;
   ContextModel3DBuffer m_cDdcDataSCModel;
-#if QC_GENERIC_SDC_G0122
   ContextModel3DBuffer m_cAngleFlagSCModel;
-#if !QC_SDC_UNIFY_G0130
-  ContextModel3DBuffer m_cIntraSdcFlagSCModel;
-#endif
-#endif
 #if H_3D_DIM_DMM
   ContextModel3DBuffer m_cDmm1DataSCModel;
@@ -232,10 +222,5 @@
 #endif
 #endif
-#if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
-  ContextModel3DBuffer m_cInterSDCFlagSCModel;
-  ContextModel3DBuffer m_cInterSDCResidualSCModel;
-  ContextModel3DBuffer m_cInterSDCResidualSignFlagSCModel;
-#endif
-#if QC_SDC_UNIFY_G0130
+#if H_3D_DIM_SDC  
   ContextModel3DBuffer m_cSDCFlagSCModel;
 #endif
Index: /trunk/source/Lib/TLibDecoder/TDecTop.cpp
===================================================================
--- /trunk/source/Lib/TLibDecoder/TDecTop.cpp	(revision 883)
+++ /trunk/source/Lib/TLibDecoder/TDecTop.cpp	(revision 884)
@@ -51,9 +51,4 @@
   m_aaiCodedOffset         = new Int* [ MAX_NUM_LAYERS ];
   m_aaiCodedScale          = new Int* [ MAX_NUM_LAYERS ];
-#if !FIX_CAM_PARS_COLLECTOR
-  m_aiViewId               = new Int  [ MAX_NUM_LAYERS ];
-
-  m_bViewReceived          = new Bool [ MAX_NUM_LAYERS ];
-#endif
   for( UInt uiId = 0; uiId < MAX_NUM_LAYERS; uiId++ )
   {
@@ -65,8 +60,6 @@
   m_iLog2Precision   = LOG2_DISP_PREC_LUT;
   m_uiBitDepthForLUT = 8; // fixed
-#if FIX_CAM_PARS_COLLECTOR
   m_receivedIdc = NULL; 
   m_vps         = NULL; 
-#endif
 }
 
@@ -80,18 +73,11 @@
   delete [] m_aaiCodedOffset;
   delete [] m_aaiCodedScale;
-#if !FIX_CAM_PARS_COLLECTOR
-  delete [] m_aiViewId;  
-  delete [] m_bViewReceived;
-#endif
 
   xDeleteArray( m_adBaseViewShiftLUT, MAX_NUM_LAYERS, MAX_NUM_LAYERS, 2 );
   xDeleteArray( m_aiBaseViewShiftLUT, MAX_NUM_LAYERS, MAX_NUM_LAYERS, 2 );
-#if FIX_CAM_PARS_COLLECTOR
   xDeleteArray( m_receivedIdc, m_uiMaxViewIndex + 1 );
-#endif
-}
-
-
-#if FIX_CAM_PARS_COLLECTOR
+}
+
+
 Void
 CamParsCollector::init( FILE* pCodedScaleOffsetFile, TComVPS* vps)
@@ -159,18 +145,4 @@
   }
 }
-#else
-Void
-CamParsCollector::init( FILE* pCodedScaleOffsetFile )
-{
-  m_bInitialized            = true;
-  m_pCodedScaleOffsetFile   = pCodedScaleOffsetFile;
-  m_uiCamParsCodedPrecision = 0;
-  m_bCamParsVaryOverTime    = false;
-  m_iLastViewIndex             = -1;
-  m_iLastPOC                = -1;
-  m_uiMaxViewIndex             = 0;
-}
-#endif
-
 
 
@@ -206,9 +178,5 @@
   CamParsCollector::xInitLUTs( UInt uiSourceView, UInt uiTargetView, Int iScale, Int iOffset, Double****& radLUT, Int****& raiLUT)
 {
-#if FIX_CAM_PARS_COLLECTOR
   Int     iLog2DivLuma   = m_uiBitDepthForLUT + m_vps->getCamParPrecision() + 1 - m_iLog2Precision;   AOF( iLog2DivLuma > 0 );
-#else
-  Int     iLog2DivLuma   = m_uiBitDepthForLUT + m_uiCamParsCodedPrecision + 1 - m_iLog2Precision;   AOF( iLog2DivLuma > 0 );
-#endif
   Int     iLog2DivChroma = iLog2DivLuma + 1;
 
@@ -252,124 +220,4 @@
 }
 
-#if !FIX_CAM_PARS_COLLECTOR
-Void
-CamParsCollector::setSlice( TComSlice* pcSlice )
-{
-
-  if( pcSlice == 0 )
-  {
-    AOF( xIsComplete() );
-    if( m_bCamParsVaryOverTime || m_iLastPOC == 0 )
-    {
-      xOutput( m_iLastPOC );
-    }
-    return;
-  }
-  
-  if ( pcSlice->getIsDepth())
-  {
-    return;
-  }
-
-  Bool  bFirstAU          = ( pcSlice->getPOC()     == 0 );
-  Bool  bFirstSliceInAU   = ( pcSlice->getPOC()     != Int ( m_iLastPOC ) );
-  Bool  bFirstSliceInView = ( pcSlice->getViewIndex()  != UInt( m_iLastViewIndex ) || bFirstSliceInAU );
-
-  AOT(  bFirstSliceInAU  &&   pcSlice->getViewIndex()  != 0 );
-  AOT( !bFirstSliceInAU  &&   pcSlice->getViewIndex()   < UInt( m_iLastViewIndex ) );
-  
-  AOT( !bFirstSliceInAU  &&   pcSlice->getViewIndex()   > UInt( m_iLastViewIndex + 1 ) );
-  
-  AOT( !bFirstAU         &&   pcSlice->getViewIndex()   > m_uiMaxViewIndex );
-
-  if ( !bFirstSliceInView )
-  {
-    if( m_bCamParsVaryOverTime ) // check consistency of slice parameters here
-    {
-      UInt uiViewIndex = pcSlice->getViewIndex();
-      for( UInt uiBaseViewIndex = 0; uiBaseViewIndex < uiViewIndex; uiBaseViewIndex++ )
-      {
-        AOF( m_aaiCodedScale [ uiBaseViewIndex ][ uiViewIndex ] == pcSlice->getCodedScale    () [ uiBaseViewIndex ] );
-        AOF( m_aaiCodedOffset[ uiBaseViewIndex ][ uiViewIndex ] == pcSlice->getCodedOffset   () [ uiBaseViewIndex ] );
-        AOF( m_aaiCodedScale [ uiViewIndex ][ uiBaseViewIndex ] == pcSlice->getInvCodedScale () [ uiBaseViewIndex ] );
-        AOF( m_aaiCodedOffset[ uiViewIndex ][ uiBaseViewIndex ] == pcSlice->getInvCodedOffset() [ uiBaseViewIndex ] );
-      }
-    }
-    return;
-  }
-
-  if( bFirstSliceInAU )
-  {
-    if( !bFirstAU )
-    {
-      AOF( xIsComplete() );
-      xOutput( m_iLastPOC );
-    }
-    ::memset( m_bViewReceived, false, MAX_NUM_LAYERS * sizeof( Bool ) );
-  }
-
-  UInt uiViewIndex                       = pcSlice->getViewIndex();
-  m_bViewReceived[ uiViewIndex ]         = true;
-  if( bFirstAU )
-  {
-    m_uiMaxViewIndex                     = std::max( m_uiMaxViewIndex, uiViewIndex );
-    m_aiViewId[ uiViewIndex ]            = pcSlice->getViewId();
-
-    if( uiViewIndex == 1 )
-    {
-      m_uiCamParsCodedPrecision       = pcSlice->getVPS()->getCamParPrecision     ();
-      m_bCamParsVaryOverTime          = pcSlice->getVPS()->hasCamParInSliceHeader ( uiViewIndex );
-    }
-    else if( uiViewIndex > 1 )
-    {
-      AOF( m_uiCamParsCodedPrecision == pcSlice->getVPS()->getCamParPrecision     () );
-      AOF( m_bCamParsVaryOverTime    == pcSlice->getVPS()->hasCamParInSliceHeader ( uiViewIndex ) );
-    }
-
-    for( UInt uiBaseIndex = 0; uiBaseIndex < uiViewIndex; uiBaseIndex++ )
-    {
-      if( m_bCamParsVaryOverTime )
-      {
-        m_aaiCodedScale [ uiBaseIndex ][ uiViewIndex ]  = pcSlice->getCodedScale    () [ uiBaseIndex ];
-        m_aaiCodedOffset[ uiBaseIndex ][ uiViewIndex ]  = pcSlice->getCodedOffset   () [ uiBaseIndex ];
-        m_aaiCodedScale [ uiViewIndex ][ uiBaseIndex ]  = pcSlice->getInvCodedScale () [ uiBaseIndex ];
-        m_aaiCodedOffset[ uiViewIndex ][ uiBaseIndex ]  = pcSlice->getInvCodedOffset() [ uiBaseIndex ];
-        xInitLUTs( uiBaseIndex, uiViewIndex, m_aaiCodedScale[ uiBaseIndex ][ uiViewIndex ], m_aaiCodedOffset[ uiBaseIndex ][ uiViewIndex ], m_adBaseViewShiftLUT, m_aiBaseViewShiftLUT);
-        xInitLUTs( uiViewIndex, uiBaseIndex, m_aaiCodedScale[ uiViewIndex ][ uiBaseIndex ], m_aaiCodedOffset[ uiViewIndex ][ uiBaseIndex ], m_adBaseViewShiftLUT, m_aiBaseViewShiftLUT);
-      }
-      else
-      {
-        m_aaiCodedScale [ uiBaseIndex ][ uiViewIndex ]  = pcSlice->getVPS()->getCodedScale    (uiViewIndex) [ uiBaseIndex ];
-        m_aaiCodedOffset[ uiBaseIndex ][ uiViewIndex ]  = pcSlice->getVPS()->getCodedOffset   (uiViewIndex) [ uiBaseIndex ];
-        m_aaiCodedScale [ uiViewIndex ][ uiBaseIndex ]  = pcSlice->getVPS()->getInvCodedScale (uiViewIndex) [ uiBaseIndex ];
-        m_aaiCodedOffset[ uiViewIndex ][ uiBaseIndex ]  = pcSlice->getVPS()->getInvCodedOffset(uiViewIndex) [ uiBaseIndex ];
-        xInitLUTs( uiBaseIndex, uiViewIndex, m_aaiCodedScale[ uiBaseIndex ][ uiViewIndex ], m_aaiCodedOffset[ uiBaseIndex ][ uiViewIndex ], m_adBaseViewShiftLUT, m_aiBaseViewShiftLUT );
-        xInitLUTs( uiViewIndex, uiBaseIndex, m_aaiCodedScale[ uiViewIndex ][ uiBaseIndex ], m_aaiCodedOffset[ uiViewIndex ][ uiBaseIndex ], m_adBaseViewShiftLUT, m_aiBaseViewShiftLUT );
-      }
-    }
-  }
-  else
-  {
-    AOF( m_aiViewId[ uiViewIndex ] == pcSlice->getViewId() );
-    if( m_bCamParsVaryOverTime )
-    {
-      for( UInt uiBaseIndex = 0; uiBaseIndex < uiViewIndex; uiBaseIndex++ )
-      {
-        m_aaiCodedScale [ uiBaseIndex ][ uiViewIndex ]  = pcSlice->getCodedScale    () [ uiBaseIndex ];
-        m_aaiCodedOffset[ uiBaseIndex ][ uiViewIndex ]  = pcSlice->getCodedOffset   () [ uiBaseIndex ];
-        m_aaiCodedScale [ uiViewIndex ][ uiBaseIndex ]  = pcSlice->getInvCodedScale () [ uiBaseIndex ];
-        m_aaiCodedOffset[ uiViewIndex ][ uiBaseIndex ]  = pcSlice->getInvCodedOffset() [ uiBaseIndex ];
-
-        xInitLUTs( uiBaseIndex, uiViewIndex, m_aaiCodedScale[ uiBaseIndex ][ uiViewIndex ], m_aaiCodedOffset[ uiBaseIndex ][ uiViewIndex ], m_adBaseViewShiftLUT, m_aiBaseViewShiftLUT );
-        xInitLUTs( uiViewIndex, uiBaseIndex, m_aaiCodedScale[ uiViewIndex ][ uiBaseIndex ], m_aaiCodedOffset[ uiViewIndex ][ uiBaseIndex ], m_adBaseViewShiftLUT, m_aiBaseViewShiftLUT );
-      }
-    }
-  }
-  
-  m_iLastViewIndex = (Int)pcSlice->getViewIndex();  
-  m_iLastPOC       = (Int)pcSlice->getPOC();
-}
-
-#else
 Void
 CamParsCollector::setSlice( TComSlice* pcSlice )
@@ -440,5 +288,4 @@
   }
 }
-#endif
 
 
@@ -454,18 +301,4 @@
 #endif
 
-#if !FIX_CAM_PARS_COLLECTOR
-Bool
-CamParsCollector::xIsComplete()
-{
-  for( UInt uiView = 0; uiView <= m_uiMaxViewIndex; uiView++ )
-  {
-    if( m_bViewReceived[ uiView ] == 0 )
-    {
-      return false;
-    }
-  }
-  return true;
-}
-#endif
 
 Void
@@ -474,21 +307,11 @@
   if( m_pCodedScaleOffsetFile )
   {
-#if FIX_CAM_PARS_COLLECTOR
     if( iPOC == m_firstReceivedPoc )
-#else
-    if( iPOC == 0 )
-#endif
     {
       fprintf( m_pCodedScaleOffsetFile, "#  ViewIndex       ViewId\n" );
       fprintf( m_pCodedScaleOffsetFile, "#----------- ------------\n" );
-#if FIX_CAM_PARS_COLLECTOR
       for( UInt uiViewIndex = 0; uiViewIndex <= m_uiMaxViewIndex; uiViewIndex++ )
       {
         fprintf( m_pCodedScaleOffsetFile, "%12d %12d\n", uiViewIndex, m_vps->getViewIdVal( uiViewIndex ) );
-#else        
-      for( UInt uiViewIndex = 0; uiViewIndex <= m_uiMaxViewIndex; uiViewIndex++ )
-      {
-        fprintf( m_pCodedScaleOffsetFile, "%12d %12d\n", uiViewIndex, m_aiViewId[ uiViewIndex ] );
-#endif
       }
       fprintf( m_pCodedScaleOffsetFile, "\n\n");
@@ -496,9 +319,5 @@
       fprintf( m_pCodedScaleOffsetFile, "#----------- ------------ ------------ ------------ ------------ ------------ ------------\n" );
     }
-#if FIX_CAM_PARS_COLLECTOR
     if( iPOC == m_firstReceivedPoc || m_bCamParsVaryOverTime  )
-#else
-    if( iPOC == 0 || m_bCamParsVaryOverTime )
-#endif
     {
       Int iS = iPOC;
@@ -510,5 +329,4 @@
           if( uiViewIndex != uiBaseIndex )
           {
-#if FIX_CAM_PARS_COLLECTOR
             if ( m_receivedIdc[uiBaseIndex][uiViewIndex] != 0 )
             {            
@@ -516,9 +334,4 @@
                 iS, iE, uiViewIndex, uiBaseIndex, m_aaiCodedScale[ uiBaseIndex ][ uiViewIndex ], m_aaiCodedOffset[ uiBaseIndex ][ uiViewIndex ], m_vps->getCamParPrecision() );
             }            
-#else
-            fprintf( m_pCodedScaleOffsetFile, "%12d %12d %12d %12d %12d %12d %12d\n",
-              iS, iE, uiViewIndex, uiBaseIndex, m_aaiCodedScale[ uiBaseIndex ][ uiViewIndex ], m_aaiCodedOffset[ uiBaseIndex ][ uiViewIndex ], m_uiCamParsCodedPrecision );
-#endif
-
           }
         }
@@ -641,5 +454,5 @@
   for( Int temporalLayer=0; temporalLayer < MAX_TLAYER; temporalLayer++) 
   {
-#if H_MV_HLS_7_SPS_P0155_16_32
+#if H_MV
     numReorderPics[temporalLayer] = ( getLayerId() == 0 ) ? pcSlice->getSPS()->getNumReorderPics(temporalLayer) : pcSlice->getVPS()->getNumReorderPics(temporalLayer);
 #else
@@ -647,5 +460,5 @@
 #endif
   }
-#if H_MV_HLS_7_SPS_P0155_16_32
+#if H_MV
   if ( getLayerId() == 0 )
   {  
Index: /trunk/source/Lib/TLibDecoder/TDecTop.h
===================================================================
--- /trunk/source/Lib/TLibDecoder/TDecTop.h	(revision 883)
+++ /trunk/source/Lib/TLibDecoder/TDecTop.h	(revision 884)
@@ -71,9 +71,5 @@
   ~CamParsCollector ();
 
-#if FIX_CAM_PARS_COLLECTOR
   Void  init        ( FILE* pCodedScaleOffsetFile, TComVPS* vps );
-#else
-  Void  init        ( FILE* pCodedScaleOffsetFile );
-#endif
 
   Void  uninit      ();
@@ -87,5 +83,5 @@
 #endif
 
-#if MTK_DDD_G0063
+#if H_3D_DDD
   Int getCodedScale( Int iBaseView, Int iCureView){ return m_aaiCodedScale[ iBaseView ][ iCureView ];}
   Int getCodedOffset( Int iBaseView, Int iCureView){ return m_aaiCodedOffset[ iBaseView ][ iCureView ];}
@@ -94,9 +90,5 @@
 
 private:
-#if FIX_CAM_PARS_COLLECTOR
   Void xResetReceivedIdc( Bool overWriteFlag ); 
-#else
-  Bool  xIsComplete ();
-#endif
   Void  xOutput     ( Int iPOC );
 
@@ -108,7 +100,4 @@
   Int**   m_aaiCodedScale;
   
-#if !FIX_CAM_PARS_COLLECTOR
-  Int*    m_aiViewId;  
-#else
   TComVPS* m_vps; 
   Int**    m_receivedIdc; 
@@ -116,18 +105,7 @@
   Int      m_lastPoc; 
   Int      m_firstReceivedPoc; 
-#endif
-
-  
-#if !FIX_CAM_PARS_COLLECTOR
-  Bool*   m_bViewReceived;
-  UInt    m_uiCamParsCodedPrecision;
-#endif
+
+  
   Bool    m_bCamParsVaryOverTime;
-#if !FIX_CAM_PARS_COLLECTOR
-  Int     m_iLastViewIndex;
-  Int     m_iLastPOC;
-  UInt    m_uiMaxViewIndex;
-#endif
-
 
   UInt    m_uiBitDepthForLUT;
Index: /trunk/source/Lib/TLibEncoder/NALwrite.cpp
===================================================================
--- /trunk/source/Lib/TLibEncoder/NALwrite.cpp	(revision 883)
+++ /trunk/source/Lib/TLibEncoder/NALwrite.cpp	(revision 884)
@@ -91,5 +91,5 @@
   vector<uint8_t>& rbsp   = nalu.m_Bitstream.getFIFO();
 
-#if H_MV_HLS_7_MISC_P0130_EOS  // This will handle situation when writing NAL with zero payload
+#if H_MV  // This will handle situation when writing NAL with zero payload
   if (rbsp.size() == 0) return;
 #endif
Index: /trunk/source/Lib/TLibEncoder/SEIwrite.cpp
===================================================================
--- /trunk/source/Lib/TLibEncoder/SEIwrite.cpp	(revision 883)
+++ /trunk/source/Lib/TLibEncoder/SEIwrite.cpp	(revision 884)
@@ -93,5 +93,5 @@
     fprintf( g_hTrace, "=========== Scalable Nesting SEI message ===========\n");
     break;
-#if H_MV_HLS_7_SEI_P0204_26
+#if H_MV
     case SEI::SUB_BITSTREAM_PROPERTY:
     fprintf( g_hTrace, "=========== Sub-bitstream property SEI message ===========\n");
@@ -151,5 +151,5 @@
     xWriteSEIScalableNesting(bs, *static_cast<const SEIScalableNesting*>(&sei), sps);
     break;
-#if H_MV_HLS_7_SEI_P0204_26
+#if H_MV
    case SEI::SUB_BITSTREAM_PROPERTY:
    xWriteSEISubBitstreamProperty(*static_cast<const SEISubBitstreamProperty*>(&sei));
@@ -589,5 +589,5 @@
 }
 
-#if H_MV_HLS_7_SEI_P0204_26
+#if H_MV
 Void SEIWriter::xWriteSEISubBitstreamProperty(const SEISubBitstreamProperty &sei)
 {
Index: /trunk/source/Lib/TLibEncoder/SEIwrite.h
===================================================================
--- /trunk/source/Lib/TLibEncoder/SEIwrite.h	(revision 883)
+++ /trunk/source/Lib/TLibEncoder/SEIwrite.h	(revision 884)
@@ -66,5 +66,5 @@
   Void xWriteSEISOPDescription(const SEISOPDescription& sei);
   Void xWriteSEIScalableNesting(TComBitIf& bs, const SEIScalableNesting& sei, TComSPS *sps);
-#if H_MV_HLS_7_SEI_P0204_26
+#if H_MV
   Void xWriteSEISubBitstreamProperty(const SEISubBitstreamProperty &sei);
 #endif
Index: /trunk/source/Lib/TLibEncoder/TEncCavlc.cpp
===================================================================
--- /trunk/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 883)
+++ /trunk/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 884)
@@ -272,5 +272,4 @@
   WRITE_FLAG( pcPPS->getSliceHeaderExtensionPresentFlag() ? 1 : 0, "slice_segment_header_extension_present_flag");
 
-#if H_MV_HLS_7_GEN_P0166_PPS_EXTENSION
 #if !H_MV
   WRITE_FLAG( 0, "pps_extension_flag" );
@@ -290,7 +289,5 @@
   if( pcPPS->getPpsExtensionTypeFlag( PPS_EX_T_MV ) )
   {
-#if H_MV_HLS_7_POC_P0041
     WRITE_FLAG( pcPPS->getPocResetInfoPresentFlag( ) ? 1 : 0 , "poc_reset_info_present_flag" );
-#endif
   }
 
@@ -303,13 +300,5 @@
 
 #endif
-#else
-#if !H_3D
-  WRITE_FLAG( 0, "pps_extension_flag" );
-#else
-  WRITE_FLAG( 1, "pps_extension_flag" );
-  codePPSExtension( pcPPS ); 
-  WRITE_FLAG( 0, "pps_extension2_flag" );
-#endif
-#endif
+
 }
 
@@ -725,5 +714,5 @@
 #endif
   WRITE_UVLC( pcSPS->getBitsForPOC()-4,                 "log2_max_pic_order_cnt_lsb_minus4" );
-#if H_MV_HLS_7_SPS_P0155_16_32
+#if H_MV
   if ( pcSPS->getLayerId() == 0 ) 
   {  
@@ -741,5 +730,5 @@
     }
   }
-#if H_MV_HLS_7_SPS_P0155_16_32
+#if H_MV
   }
 #endif
@@ -871,7 +860,5 @@
     WRITE_SVLC( pcSPS->getScaledRefLayerRightOffset( j ), "scaled_ref_layer_right_offset" );
     WRITE_SVLC( pcSPS->getScaledRefLayerBottomOffset( j ), "scaled_ref_layer_bottom_offset" );
-#if H_MV_HLS_7_RESERVED_FLAGS
     WRITE_FLAG( 0, "sps_multilayer_ext_reserved_zero_flag[ j ]" );
-#endif
   }
 }
@@ -904,13 +891,5 @@
   WRITE_FLAG( pcVPS->getTemporalNestingFlag(),                "vps_temporal_id_nesting_flag" );
   assert (pcVPS->getMaxTLayers()>1||pcVPS->getTemporalNestingFlag());
-#if H_MV_HLS_7_VPS_P0125_24
   WRITE_CODE( 0xffff,                              16,        "vps_reserved_ffff_16bits" );
-#else
-#if H_MV && !H_MV_HLS7_GEN
-  WRITE_CODE( 0xffff,                              16,        "vps_extension_offset" );
-#else
-  WRITE_CODE( 0xffff,                              16,        "vps_reserved_ffff_16bits" );
-#endif
-#endif
   codePTL( pcVPS->getPTL(), true, pcVPS->getMaxTLayers() - 1 );
   const Bool subLayerOrderingInfoPresentFlag = 1;
@@ -1010,14 +989,6 @@
 {
   WRITE_FLAG( pcVPS->getAvcBaseLayerFlag() ? 1 : 0,          "avc_base_layer_flag" );
-#if !H_MV_HLS_7_VPS_P0307_23
-  WRITE_FLAG( pcVPS->getVpsVuiPresentFlag() ? 1 : 0 , "vps_vui_present_flag" );
-  if ( pcVPS->getVpsVuiPresentFlag() )
-  {  
-  WRITE_CODE( pcVPS->getVpsVuiOffset( ), 16,                 "vps_vui_offset" );  // TBD
-  }
-#endif
-
   WRITE_FLAG( pcVPS->getSplittingFlag() ? 1 : 0,             "splitting_flag" );
-  
+
   for( Int type = 0; type < MAX_NUM_SCALABILITY_TYPES; type++ )
   {
@@ -1042,9 +1013,9 @@
     {      
       WRITE_CODE( pcVPS->getLayerIdInNuh( i ), 6,          "layer_id_in_nuh[i]");
-  }
+    }
     else
     {
       assert( pcVPS->getLayerIdInNuh( i ) == i ); 
-  }
+    }
 
     assert(  pcVPS->getLayerIdInVps( pcVPS->getLayerIdInNuh( i ) ) == i ); 
@@ -1064,20 +1035,20 @@
 
 
-    WRITE_CODE( pcVPS->getViewIdLen( ), 4, "view_id_len" );
-    
-    if ( pcVPS->getViewIdLen( ) > 0 )
-    {    
-      for( Int i = 0; i < pcVPS->getNumViews(); i++ )
-      {
-        WRITE_CODE( pcVPS->getViewIdVal( i ), pcVPS->getViewIdLen( ), "view_id_val[i]" );
-      }
-    }
-    else
-    {
-      for( Int i = 0; i < pcVPS->getNumViews(); i++ )
-      {
-        assert( pcVPS->getViewIdVal( i ) == 0 ); 
-      }
-    }
+  WRITE_CODE( pcVPS->getViewIdLen( ), 4, "view_id_len" );
+
+  if ( pcVPS->getViewIdLen( ) > 0 )
+  {    
+    for( Int i = 0; i < pcVPS->getNumViews(); i++ )
+    {
+      WRITE_CODE( pcVPS->getViewIdVal( i ), pcVPS->getViewIdLen( ), "view_id_val[i]" );
+    }
+  }
+  else
+  {
+    for( Int i = 0; i < pcVPS->getNumViews(); i++ )
+    {
+      assert( pcVPS->getViewIdVal( i ) == 0 ); 
+    }
+  }
 
 
@@ -1122,33 +1093,12 @@
 
   WRITE_FLAG( pcVPS->getAllRefLayersActiveFlag( ) ? 1 : 0 , "all_ref_layers_active_flag" );
-#if !H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
-  WRITE_CODE( pcVPS->getVpsNumberLayerSetsMinus1( )    , 10,    "vps_number_layer_sets_minus1"      );
-#endif
-
-#if !H_MV_HLS_7_VPS_P0306_22
-  WRITE_CODE( pcVPS->getVpsNumProfileTierLevelMinus1( ), 6,     "vps_num_profile_tier_level_minus1" );
-#else
   WRITE_UVLC( pcVPS->getVpsNumProfileTierLevelMinus1( ), "vps_num_profile_tier_level_minus1" );
-#endif
 
   for( Int i = 1; i <= pcVPS->getVpsNumProfileTierLevelMinus1(); i++ )
   {
     WRITE_FLAG( pcVPS->getVpsProfilePresentFlag( i ) ? 1 : 0, "vps_profile_present_flag[i]" );
-#if !H_MV_HLS_7_VPS_P0048_14
-    if( !pcVPS->getVpsProfilePresentFlag( i ) )
-    {    
-      WRITE_CODE( pcVPS->getProfileRefMinus1( i ), 6, "profile_ref_minus1[i]" );
-      pcVPS->checkProfileRefMinus1( i );      
-    }
-#endif
     codePTL( pcVPS->getPTL( i ), pcVPS->getVpsProfilePresentFlag( i ), pcVPS->getMaxTLayers() - 1 );
   }
 
-
-
-
-
-
-#if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
   WRITE_UVLC( pcVPS->getNumAddOutputLayerSets( ), "num_add_output_layer_sets" );
 
@@ -1157,38 +1107,14 @@
     WRITE_CODE( pcVPS->getDefaultTargetOutputLayerIdc( ), 2, "default_target_output_layer_idc" );
   }  
-#else
-  Int numOutputLayerSets = pcVPS->getVpsNumberLayerSetsMinus1( ) + 1; 
-
-  WRITE_FLAG( pcVPS->getMoreOutputLayerSetsThanDefaultFlag( ) ? 1 : 0, "more_output_layer_sets_than_default_flag" );
-
-  if ( pcVPS->getMoreOutputLayerSetsThanDefaultFlag( ) )
-  {
-    WRITE_CODE( pcVPS->getNumAddOutputLayerSetsMinus1( )    , 10,    "num_add_output_layer_sets_minus1"      );
-    numOutputLayerSets += ( pcVPS->getNumAddOutputLayerSetsMinus1( ) + 1 ); 
-  }
-
-  if( numOutputLayerSets > 1)
-  {
-    WRITE_CODE( pcVPS->getDefaultOneTargetOutputLayerIdc( ), 2, "default_one_target_output_layer_idc" );
-    pcVPS->checkDefaultOneTargetOutputLayerIdc(); 
-  }  
-#endif
+
 
   assert( pcVPS->getOutputLayerFlag(0, 0) == pcVPS->inferOutputLayerFlag( 0, 0 )); 
   assert( pcVPS->getOutputLayerSetIdxMinus1( 0 ) == -1 ); 
 
-#if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
-
   for( Int i = 1; i < pcVPS->getNumOutputLayerSets( ); i++ )
   {
     if( i > pcVPS->getVpsNumLayerSetsMinus1( ) )    
-#else
-  for( Int i = 1; i < numOutputLayerSets; i++ )
-  {
-    if( i > pcVPS->getVpsNumberLayerSetsMinus1( ) )
-#endif
     {      
       WRITE_UVLC( pcVPS->getOutputLayerSetIdxMinus1( i ),      "output_layer_set_idx_minus1[i]" );
-#if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
     }
 
@@ -1208,24 +1134,8 @@
     }        
 
-#else
-      for( Int j = 0; j < pcVPS->getNumLayersInIdList( j ) - 1 ; j++ )
-      {
-        WRITE_FLAG( pcVPS->getOutputLayerFlag( i, j) ? 1 : 0, "output_layer_flag" );
-      }      
-    }
-    else
-    { // These inference rules would also be helpful in spec text
-      assert( pcVPS->getOutputLayerSetIdxMinus1(i ) ==  i - 1 ); 
-      for( Int j = 0; j < pcVPS->getNumLayersInIdList( j ) - 1; j++ )
-      {              
-        assert( pcVPS->getOutputLayerFlag( i , j ) == pcVPS->inferOutputLayerFlag( i, j )); 
-      }
-    }
-#endif
     if ( pcVPS->getProfileLevelTierIdxLen()  > 0 )
     {      
       WRITE_CODE( pcVPS->getProfileLevelTierIdx( i ), pcVPS->getProfileLevelTierIdxLen() ,"profile_level_tier_idx[ i ]" );   
     }
-#if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
     if( pcVPS->getNumOutputLayersInOutputLayerSet( i ) == 1 && pcVPS->getNumDirectRefLayers( pcVPS->getOlsHighestOutputLayerId( i ) ) > 0 )
     {
@@ -1233,25 +1143,9 @@
     }
   }
-#else
-  }
-
-  if( pcVPS->getMaxLayersMinus1() > 0 )
-  {
-    WRITE_FLAG( pcVPS->getAltOutputLayerFlag( ) ? 1 : 0 , "alt_output_layer_flag" );
-  }
-#endif
-
-
-
-
 
   WRITE_FLAG( pcVPS->getRepFormatIdxPresentFlag( ) ? 1 : 0 , "rep_format_idx_present_flag" );
   if ( pcVPS->getRepFormatIdxPresentFlag() )
   {
-#if H_MV_HLS_7_VPS_P0306_22
     WRITE_UVLC( pcVPS->getVpsNumRepFormatsMinus1( ), "vps_num_rep_formats_minus1" );
-#else
-    WRITE_CODE( pcVPS->getVpsNumRepFormatsMinus1( ), 4, "vps_num_rep_formats_minus1" );
-#endif
   }
 
@@ -1269,9 +1163,5 @@
       if( pcVPS->getVpsNumRepFormatsMinus1() > 0 )
       {
-#if H_MV_HLS_7_VPS_P0306_22
         WRITE_CODE( pcVPS->getVpsRepFormatIdx(i), pcVPS->getVpsRepFormatIdxLen(), "vps_rep_format_idx[i]" );
-#else
-        WRITE_CODE( pcVPS->getVpsRepFormatIdx( i ), 8, "vps_rep_format_idx" );
-#endif
       }
     }
@@ -1289,7 +1179,5 @@
     }
   }
-#if H_MV_HLS_7_RESERVED_FLAGS
   WRITE_FLAG( 0, "vps_reserved_zero_flag" );
-#endif
   codeDpbSize( pcVPS ); 
 
@@ -1321,24 +1209,18 @@
     }
   }  
-#if H_MV_HLS_7_VPS_P0307_23
   WRITE_UVLC( 0, "vps_non_vui_extension_length" );
   WRITE_FLAG( pcVPS->getVpsVuiPresentFlag() ? 1 : 0 , "vps_vui_present_flag" );
-#endif
-#if !H_MV_HLS_7_RESERVED_FLAGS  
-    WRITE_FLAG ( 0,                                      "vps_shvc_reserved_zero_flag" ); 
-#endif
-    if( pcVPS->getVpsVuiPresentFlag() )
-    {
-      m_pcBitIf->writeAlignOne();  // vps_vui_alignment_bit_equal_to_one
-      codeVPSVUI( pcVPS ); 
-    }     
-#if H_MV_HLS_7_FIX_INFER_CROSS_LAYER_IRAP_ALIGNED_FLAG
-    {
-      TComVPSVUI* pcVPSVUI = pcVPS->getVPSVUI( ); 
-      assert( pcVPSVUI ); 
-      pcVPSVUI->inferVpsVui( true ); 
-    }
-#endif
-}
+  if( pcVPS->getVpsVuiPresentFlag() )
+  {
+    m_pcBitIf->writeAlignOne();  // vps_vui_alignment_bit_equal_to_one
+    codeVPSVUI( pcVPS ); 
+  }     
+  {
+    TComVPSVUI* pcVPSVUI = pcVPS->getVPSVUI( ); 
+    assert( pcVPSVUI ); 
+    pcVPSVUI->inferVpsVui( true ); 
+  }
+}
+
 Void TEncCavlc::codeVideoSignalInfo( TComVideoSignalInfo* pcVideoSignalInfo )
 {
@@ -1359,9 +1241,5 @@
   {  
     WRITE_FLAG( dpbSize->getSubLayerFlagInfoPresentFlag( i ) ? 1 : 0 , "sub_layer_flag_info_present_flag" );
-#if H_MV_HLS_7_HRD_P0156_7
     for( Int j = 0; j  <=  vps->getMaxSubLayersInLayerSetMinus1( i ); j++ )
-#else
-    for( Int j = 0; j  <=  vps->getMaxTLayers() - 1 ; j++ )
-#endif
     {  
       if( j > 0  &&  dpbSize->getSubLayerDpbInfoPresentFlag( i, j )  )  
@@ -1371,9 +1249,5 @@
       if( dpbSize->getSubLayerDpbInfoPresentFlag( i, j ) )
       {  
-#if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
         for( Int k = 0; k < vps->getNumSubDpbs( vps->getLayerSetIdxForOutputLayerSet( i )); k++ )   
-#else
-        for( Int k = 0; k < vps->getNumSubDpbs( vps->getOutputLayerSetIdxMinus1( i ) + 1 ); k++ )   // Preliminary fix does not match with spec
-#endif
         {
           WRITE_UVLC( dpbSize->getMaxVpsDecPicBufferingMinus1( i, k, j ), "max_vps_dec_pic_buffering_minus1" );
@@ -1395,9 +1269,5 @@
         if ( j > 0 )
         {
-#if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
           for( Int k = 0; k < vps->getNumSubDpbs( vps->getLayerSetIdxForOutputLayerSet( i ) ); k++ )   
-#else
-          for( Int k = 0; k < vps->getNumSubDpbs( vps->getOutputLayerSetIdxMinus1( i ) + 1 ); k++ )   
-#endif
           {
             assert( dpbSize->getMaxVpsDecPicBufferingMinus1( i, k, j ) == dpbSize->getMaxVpsDecPicBufferingMinus1( i,k, j - 1 ) );
@@ -1451,19 +1321,13 @@
     WRITE_FLAG( pcVPSVUI->getCrossLayerIrapAlignedFlag( ) ? 1 : 0 , "cross_layer_irap_aligned_flag" );
   }
-#if H_MV_HLS_7_MISC_P0068_21
   if( pcVPSVUI->getCrossLayerIrapAlignedFlag( ) )
   {
     WRITE_FLAG( pcVPSVUI->getAllLayersIdrAlignedFlag( ) ? 1 : 0 , "all_layers_idr_aligned_flag" );
   }
-#endif
   WRITE_FLAG( pcVPSVUI->getBitRatePresentVpsFlag( ) ? 1 : 0 , "bit_rate_present_vps_flag" );
   WRITE_FLAG( pcVPSVUI->getPicRatePresentVpsFlag( ) ? 1 : 0 , "pic_rate_present_vps_flag" );
   if( pcVPSVUI->getBitRatePresentVpsFlag( )  ||  pcVPSVUI->getPicRatePresentVpsFlag( ) )
   {
-#if H_MV_HLS_7_OUTPUT_LAYERS_5_10_22_27
     for( Int i = 0; i  <=  pcVPS->getVpsNumLayerSetsMinus1(); i++ )
-#else
-    for( Int i = 0; i  <=  pcVPS->getVpsNumberLayerSetsMinus1(); i++ )
-#endif
     {
       for( Int j = 0; j  <=  pcVPS->getMaxTLayers(); j++ ) 
@@ -1491,5 +1355,4 @@
   }
 
-#if H_MV_HLS_7_VPS_P0076_15
   WRITE_FLAG( pcVPSVUI->getVideoSignalInfoIdxPresentFlag( ) ? 1 : 0 , "video_signal_info_idx_present_flag" );
   if( pcVPSVUI->getVideoSignalInfoIdxPresentFlag() )
@@ -1525,5 +1388,4 @@
     }
   }
-#endif
   WRITE_FLAG( pcVPSVUI->getTilesNotInUseFlag( ) ? 1 : 0 , "tiles_not_in_use_flag" );
   if( !pcVPSVUI->getTilesNotInUseFlag() ) 
@@ -1560,7 +1422,5 @@
     }
   }
-#if H_MV_HLS_7_RESERVED_FLAGS
   WRITE_CODE( 0, 3, "vps_vui_reserved_zero_3bits" );
-#endif
   WRITE_FLAG( pcVPSVUI->getIlpRestrictedRefLayersFlag( ) ? 1 : 0 , "ilp_restricted_ref_layers_flag" );
 
@@ -1584,38 +1444,5 @@
   }
 
-#if !H_MV_HLS_7_VPS_P0076_15
-  WRITE_FLAG( pcVPSVUI->getVideoSignalInfoIdxPresentFlag( ) ? 1 : 0 , "video_signal_info_idx_present_flag" );
-  if( pcVPSVUI->getVideoSignalInfoIdxPresentFlag() )
-  {
-    WRITE_CODE( pcVPSVUI->getVpsNumVideoSignalInfoMinus1( ), 4, "vps_num_video_signal_info_minus1" );
-  }
-  else
-  {
-    pcVPSVUI->setVpsNumVideoSignalInfoMinus1( pcVPS->getMaxLayersMinus1() ); 
-  }
-
-  for( Int i = 0; i <= pcVPSVUI->getVpsNumVideoSignalInfoMinus1(); i++ )
-  {
-    assert( pcVPSVUI->getVideoSignalInfo( i ) != NULL ); 
-    TComVideoSignalInfo* curVideoSignalInfo = pcVPSVUI->getVideoSignalInfo( i ); 
-    codeVideoSignalInfo( curVideoSignalInfo );     
-  }
-
-  if( pcVPSVUI->getVideoSignalInfoIdxPresentFlag() && pcVPSVUI->getVpsNumVideoSignalInfoMinus1() > 0 )
-  {
-    for( Int i = 1; i <=  pcVPS->getMaxLayersMinus1(); i++ )
-    {
-      WRITE_CODE( pcVPSVUI->getVpsVideoSignalInfoIdx( i ), 4, "vps_video_signal_info_idx" );
-      assert( pcVPSVUI->getVpsVideoSignalInfoIdx( i ) >= 0 && pcVPSVUI->getVpsVideoSignalInfoIdx( i ) <= pcVPSVUI->getVpsNumVideoSignalInfoMinus1() );
-    }
-}
-  else
-  {
-    for( Int i = 1; i <=  pcVPS->getMaxLayersMinus1(); i++ )
-    {
-      assert( pcVPSVUI->getVpsVideoSignalInfoIdx( i  ) == ( pcVPSVUI->getVideoSignalInfoIdxPresentFlag() ? 0 : i ) ); 
-    }
-  }
-#endif
+
   WRITE_FLAG( pcVPSVUI->getVpsVuiBspHrdPresentFlag( ) ? 1 : 0 , "vps_vui_bsp_hrd_present_flag" );
   if ( pcVPSVUI->getVpsVuiBspHrdPresentFlag( ) )
@@ -1623,5 +1450,4 @@
     codeVpsVuiBspHrdParameters( pcVPS ); 
   }
-#if H_MV_HLS_7_MISC_P0182_13
   for( Int i = 1; i  <=  pcVPS->getMaxLayersMinus1(); i++ )
   {
@@ -1630,6 +1456,5 @@
       WRITE_FLAG( pcVPSVUI->getBaseLayerParameterSetCompatibilityFlag( i ) ? 1 : 0 , "base_layer_parameter_set_compatibility_flag" );
     }
-}
-#endif
+  }
 }
 
@@ -1705,9 +1530,5 @@
         WRITE_FLAG( pcVPS->getIvMvPredFlag         ( i ) ? 1 : 0 , "iv_mv_pred_flag[i]");
 #if H_3D_SPIVMP
-#if SEC_SPIVMP_MCP_SIZE_G0077
         WRITE_UVLC( pcVPS->getSubPULog2Size(i)-3, "log2_sub_PU_size_minus3[i]");
-#else
-        WRITE_UVLC( pcVPS->getSubPULog2Size(i)-2, "log2_sub_PU_size_minus2[i]");
-#endif
 #endif
 #endif
@@ -1734,9 +1555,5 @@
         if (i!=1)
         {
-#if SEC_SPIVMP_MCP_SIZE_G0077
           WRITE_UVLC( pcVPS->getSubPULog2Size(i)-3, "log2_sub_PU_size_minus3[i]");
-#else
-          WRITE_UVLC( pcVPS->getSubPULog2Size(i)-2, "log2_sub_PU_size_minus2[i]");
-#endif
         }
 #endif
@@ -1771,7 +1588,5 @@
     }
   }
-#if QC_SPIVMP_MPI_G0119
   WRITE_UVLC( pcVPS->getSubPUMPILog2Size( ) - 3, "log2_sub_PU_MPI_size_minus3");
-#endif
 #if H_3D_TMVP
   WRITE_FLAG( pcVPS->getIvMvScalingFlag( ) ? 1 : 0 ,          "iv_mv_scaling_flag" );
@@ -2235,16 +2050,5 @@
 #endif
 
-#if !H_MV_HLS_7_POC_P0041
-#if PPS_FIX_DEPTH
-  if(pcSlice->getPPS()->getSliceHeaderExtensionPresentFlag() || pcSlice->getIsDepth() )
-#else
-  if(pcSlice->getPPS()->getSliceHeaderExtensionPresentFlag())
-#endif
-  {
-    WRITE_UVLC(0,"slice_header_extension_length");
-  }
-#endif
-
-#if H_MV_HLS_7_POC_P0041
+
 #if !H_MV
   if(pcSlice->getPPS()->getSliceHeaderExtensionPresentFlag())
@@ -2354,5 +2158,4 @@
   }
 #endif 
-#endif
 }
 
@@ -2824,5 +2627,4 @@
 
 #if H_3D_INTER_SDC
-#if QC_SDC_UNIFY_G0130
 Void TEncCavlc::codeDeltaDC( TComDataCU* pcCU, UInt uiAbsPartIdx )
 {
@@ -2834,15 +2636,5 @@
   assert(0);
 }
-#else
-Void TEncCavlc::codeInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx )
-{
-  assert(0);
-}
-
-Void TEncCavlc::codeInterSDCResidualData  ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment )
-{
-  assert(0);
-}
-#endif
+
 #endif
     
Index: /trunk/source/Lib/TLibEncoder/TEncCavlc.h
===================================================================
--- /trunk/source/Lib/TLibEncoder/TEncCavlc.h	(revision 883)
+++ /trunk/source/Lib/TLibEncoder/TEncCavlc.h	(revision 884)
@@ -133,11 +133,6 @@
 #endif
 #if H_3D_INTER_SDC
-#if QC_SDC_UNIFY_G0130
   Void codeDeltaDC       ( TComDataCU* pcCU, UInt uiAbsPartIdx );
   Void codeSDCFlag       ( TComDataCU* pcCU, UInt uiAbsPartIdx );
-#else
-  Void codeInterSDCFlag          ( TComDataCU* pcCU, UInt uiAbsPartIdx );
-  Void codeInterSDCResidualData  ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment );
-#endif
 #endif
 #if H_3D_DBBP
Index: /trunk/source/Lib/TLibEncoder/TEncCfg.h
===================================================================
--- /trunk/source/Lib/TLibEncoder/TEncCfg.h	(revision 883)
+++ /trunk/source/Lib/TLibEncoder/TEncCfg.h	(revision 884)
@@ -347,5 +347,5 @@
 
   Bool      m_useStrongIntraSmoothing;                        ///< enable the use of strong intra smoothing (bi_linear interpolation) for 32x32 blocks when reference samples are flat.
-#if H_MV_HLS_7_SEI_P0204_26
+#if H_MV
   Bool              m_subBistreamPropSEIEnabled;
   Int               m_numAdditionalSubStreams;
@@ -397,6 +397,4 @@
 #if H_3D_SPIVMP
   Int      m_iSubPULog2Size;
-#endif
-#if QC_SPIVMP_MPI_G0119
   Int      m_iSubPUMPILog2Size;
 #endif
@@ -507,6 +505,4 @@
   Int        getSubPULog2Size                   ()                   { return m_iSubPULog2Size;}
   Void       setSubPULog2Size                   (Int u)              { m_iSubPULog2Size = u; }     
-#endif
-#if QC_SPIVMP_MPI_G0119
   Int        getSubPUMPILog2Size            ()               { return m_iSubPUMPILog2Size;}
   Void       setSubPUMPILog2Size            (Int u)          { m_iSubPUMPILog2Size = u;   }     
@@ -789,5 +785,5 @@
   Int   getScalableNestingSEIEnabled()                     { return m_scalableNestingSEIEnabled; }
 
-#if H_MV_HLS_7_SEI_P0204_26
+#if H_MV
   Bool   getSubBitstreamPropSEIEnabled()        { return m_subBistreamPropSEIEnabled;}
   Void   setSubBitstreamPropSEIEnabled(Bool x)  { m_subBistreamPropSEIEnabled = x;}
Index: /trunk/source/Lib/TLibEncoder/TEncCu.cpp
===================================================================
--- /trunk/source/Lib/TLibEncoder/TEncCu.cpp	(revision 883)
+++ /trunk/source/Lib/TLibEncoder/TEncCu.cpp	(revision 884)
@@ -547,5 +547,4 @@
           bTryNx2N  = false;
           bTry2NxN  = false;
-#if MTK_TEX_DEP_PAR_G0055
           if( pcTextureCU->getDepth(uiCUIdx) == uiDepth && pcTextureCU->getPartitionSize(uiCUIdx) != SIZE_2Nx2N)
           {
@@ -555,5 +554,4 @@
               bTryNx2N  = true;
           }
-#endif
         }
       }
@@ -582,9 +580,5 @@
           if (rpcTempCU->getSlice()->getIsDepth() )
           {
-#if SEC_DEPTH_DV_DERIVAITON_G0074
             DvInfo.bDV = rpcTempCU->getDispforDepth(0, 0, &DvInfo);
-#else
-            DvInfo.bDV = rpcTempCU->getDispNeighBlocks(0, 0, &DvInfo);
-#endif
           }
           else
@@ -1533,17 +1527,10 @@
 #endif
     m_pcEntropyCoder->encodeMergeIndex( pcCU, uiAbsPartIdx );
-#if !SEC_IC_ARP_SIG_G0072
+#if H_3D_ARP
+    m_pcEntropyCoder->encodeARPW( pcCU , uiAbsPartIdx );
+#endif
 #if H_3D_IC
     m_pcEntropyCoder->encodeICFlag  ( pcCU, uiAbsPartIdx );
 #endif
-#endif
-#if H_3D_ARP
-    m_pcEntropyCoder->encodeARPW( pcCU , uiAbsPartIdx );
-#endif
-#if SEC_IC_ARP_SIG_G0072
-#if H_3D_IC
-    m_pcEntropyCoder->encodeICFlag  ( pcCU, uiAbsPartIdx );
-#endif
-#endif
     finishCU(pcCU,uiAbsPartIdx,uiDepth);
     return;
@@ -1553,5 +1540,5 @@
   m_pcEntropyCoder->encodePartSize( pcCU, uiAbsPartIdx, uiDepth );
   
-#if QC_SDC_UNIFY_G0130
+#if H_3D_DIM_SDC
   m_pcEntropyCoder->encodeSDCFlag( pcCU, uiAbsPartIdx, false );
 #endif
@@ -1570,21 +1557,11 @@
   // prediction Info ( Intra : direction mode, Inter : Mv, reference idx )
   m_pcEntropyCoder->encodePredInfo( pcCU, uiAbsPartIdx );
-#if !SEC_IC_ARP_SIG_G0072
+
+#if H_3D_ARP
+  m_pcEntropyCoder->encodeARPW( pcCU , uiAbsPartIdx );
+#endif
 #if H_3D_IC
   m_pcEntropyCoder->encodeICFlag  ( pcCU, uiAbsPartIdx );
 #endif
-#endif
-#if H_3D_ARP
-  m_pcEntropyCoder->encodeARPW( pcCU , uiAbsPartIdx );
-#endif
-#if SEC_IC_ARP_SIG_G0072
-#if H_3D_IC
-  m_pcEntropyCoder->encodeICFlag  ( pcCU, uiAbsPartIdx );
-#endif
-#endif
-#if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
-  m_pcEntropyCoder->encodeInterSDCFlag( pcCU, uiAbsPartIdx, false );
-#endif
-
   // Encode Coefficients
   Bool bCodeDQP = getdQPFlag();
@@ -1809,9 +1786,5 @@
 #if H_3D_ARP
   Int nARPWMax = rpcTempCU->getSlice()->getARPStepNum() - 1;
-#if SEC_IC_ARP_SIG_G0072
   if( nARPWMax < 0 || !rpcTempCU->getDvInfo(0).bDV || bICFlag )
-#else
-  if( nARPWMax < 0 || !rpcTempCU->getDvInfo(0).bDV )
-#endif
   {
     nARPWMax = 0;
@@ -1821,7 +1794,4 @@
     memset( mergeCandBuffer, 0, MRG_MAX_NUM_CANDS_MEM*sizeof(Int) );
     rpcTempCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uhDepth ); // interprets depth relative to LCU level
-#if !UPDATE_HM13
-    rpcTempCU->setCUTransquantBypassSubParts( m_pcEncCfg->getCUTransquantBypassFlagValue(), 0, uhDepth );
-#endif
     rpcTempCU->setARPWSubParts( (UChar)nARPW , 0 , uhDepth );
 #if H_3D_IC
@@ -1856,5 +1826,5 @@
 #endif
 
-#if MTK_DDD_G0063
+#if H_3D_DDD
     Int iDDDCand = rpcTempCU->getUseDDDCandIdx(); 
     UChar ucDDDepth = rpcTempCU->getDDTmpDepth();
@@ -1895,5 +1865,5 @@
           rpcTempCU->setDvInfoSubParts(inheritedVSPDisInfo[uiMergeCand].m_acDvInfo, 0, 0, uhDepth );
 #endif
-#if MTK_DDD_G0063
+#if H_3D_DDD
           if( rpcTempCU->getSlice()->getIsDepth() && rpcTempCU->getSlice()->getViewIndex() != 0 && iDDDCand == uiMergeCand )
           {
@@ -1925,6 +1895,6 @@
           else
 #endif
-#if NTT_STORE_SPDV_VSP_G0148
-            {
+#if H_3D_VSP
+          {
           if ( vspFlag[uiMergeCand] )
           {
@@ -1959,5 +1929,5 @@
             rpcTempCU->getCUMvField( REF_PIC_LIST_0 )->setAllMvField( cMvFieldNeighbours[0 + 2*uiMergeCand], SIZE_2Nx2N, 0, 0 ); // interprets depth relative to rpcTempCU level
             rpcTempCU->getCUMvField( REF_PIC_LIST_1 )->setAllMvField( cMvFieldNeighbours[1 + 2*uiMergeCand], SIZE_2Nx2N, 0, 0 ); // interprets depth relative to rpcTempCU level
-#if NTT_STORE_SPDV_VSP_G0148
+#if H_3D_VSP
           }
         }
@@ -1992,5 +1962,5 @@
 
           rpcTempCU->setSkipFlagSubParts( rpcTempCU->getQtRootCbf(0) == 0, 0, uhDepth );
-#if NTT_STORE_SPDV_VSP_G0148 // possible bug fix
+#if H_3D_VSP // possible bug fix
           if( rpcTempCU->getSkipFlag(0) )
           {
@@ -2007,5 +1977,4 @@
           if( rpcTempCU->getSlice()->getVPS()->getInterSDCFlag( rpcTempCU->getSlice()->getLayerIdInVps() ) && rpcTempCU->getSlice()->getIsDepth() && !uiNoResidual )
           {
-#if SEC_INTER_SDC_G0101
             for( Int uiOffest = -2 ; uiOffest <= 2 ; uiOffest++ )
             {
@@ -2039,33 +2008,4 @@
               xCheckBestMode( rpcBestCU, rpcTempCU, uhDepth );
             }
-#else
-            if( rpcTempCU != rpcTempCUPre )
-            {
-              rpcTempCU->initEstData( uhDepth, orgQP, bTransquantBypassFlag  );
-              rpcTempCU->copyPartFrom( rpcBestCU, 0, uhDepth );
-            }
-            rpcTempCU->setSkipFlagSubParts( false, 0, uhDepth );
-            rpcTempCU->setTrIdxSubParts( 0, 0, uhDepth );
-            rpcTempCU->setCbfSubParts( 1, 1, 1, 0, uhDepth );
-#if H_3D_VSO //M2
-            if( m_pcRdCost->getUseRenModel() )
-            { //Reset
-              UInt  uiWidth     = m_ppcOrigYuv[uhDepth]->getWidth    ();
-              UInt  uiHeight    = m_ppcOrigYuv[uhDepth]->getHeight   ();
-              Pel*  piSrc       = m_ppcOrigYuv[uhDepth]->getLumaAddr ();
-              UInt  uiSrcStride = m_ppcOrigYuv[uhDepth]->getStride   ();
-              m_pcRdCost->setRenModelData( rpcTempCU, 0, piSrc, uiSrcStride, uiWidth, uiHeight );
-            }
-#endif
-            m_pcPredSearch->encodeResAndCalcRdInterSDCCU( rpcTempCU, 
-              m_ppcOrigYuv[uhDepth], 
-              ( rpcTempCU != rpcTempCUPre ) ? m_ppcPredYuvBest[uhDepth] : m_ppcPredYuvTemp[uhDepth], 
-              m_ppcResiYuvTemp[uhDepth], 
-              m_ppcRecoYuvTemp[uhDepth], 
-              uhDepth );
-
-            xCheckDQP( rpcTempCU );
-            xCheckBestMode( rpcBestCU, rpcTempCU, uhDepth );
-#endif
           }
 #endif
@@ -2142,8 +2082,6 @@
 {
 
-#if UPDATE_HM13
 #if H_3D
   const Bool bTransquantBypassFlag = rpcTempCU->getCUTransquantBypass(0);
-#endif
 #endif
 #if  H_3D_FAST_TEXTURE_ENCODING
@@ -2157,9 +2095,5 @@
   Int nARPWMax    = rpcTempCU->getSlice()->getARPStepNum() - 1;
 
-#if SEC_IC_ARP_SIG_G0072
   if( nARPWMax < 0 || ePartSize != SIZE_2Nx2N || !rpcTempCU->getDvInfo(0).bDV || rpcTempCU->getICFlag(0) )
-#else
-  if( nARPWMax < 0 || ePartSize != SIZE_2Nx2N || !rpcTempCU->getDvInfo(0).bDV  )
-#endif
   {
     nARPWMax = 0;
@@ -2170,9 +2104,5 @@
     if( bFirstTime == false && rpcTempCU->getSlice()->getVPS()->getUseAdvRP( iLayerId ) )
     {
-#if UPDATE_HM13
       rpcTempCU->initEstData( rpcTempCU->getDepth(0), rpcTempCU->getQP(0),bTransquantBypassFlag );      
-#else
-      rpcTempCU->initEstData( rpcTempCU->getDepth(0), rpcTempCU->getQP(0) );
-#endif
     }
 #endif
@@ -2194,5 +2124,5 @@
   rpcTempCU->setPartSizeSubParts  ( ePartSize,  0, uhDepth );
   rpcTempCU->setPredModeSubParts  ( MODE_INTER, 0, uhDepth );
-#if MTK_DDD_G0063
+#if H_3D_DDD
   rpcTempCU->setUseDDD( false, 0, uhDepth );
 #endif
@@ -2256,5 +2186,5 @@
 #endif
   m_pcPredSearch->encodeResAndCalcRdInterCU( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcResiYuvBest[uhDepth], m_ppcRecoYuvTemp[uhDepth], false );
-#if NTT_STORE_SPDV_VSP_G0148 // possible bug fix
+#if H_3D_VSP // possible bug fix
   if( rpcTempCU->getQtRootCbf(0)==0 )
   {
@@ -2276,11 +2206,6 @@
   xCheckBestMode(rpcBestCU, rpcTempCU, uhDepth);
 #if H_3D_INTER_SDC
-#if SEC_INTER_SDC_G0101 // ONLY_2NX2N_SDC
   if( rpcTempCU->getSlice()->getVPS()->getInterSDCFlag( rpcTempCU->getSlice()->getLayerIdInVps() ) && rpcTempCU->getSlice()->getIsDepth() && ePartSize == SIZE_2Nx2N)
-#else
-  if( rpcTempCU->getSlice()->getVPS()->getInterSDCFlag( rpcTempCU->getSlice()->getLayerIdInVps() ) && rpcTempCU->getSlice()->getIsDepth() )
-#endif
-  {
-#if SEC_INTER_SDC_G0101
+  {
     for( Int uiOffest = -2 ; uiOffest <= 2 ; uiOffest++ )
     {
@@ -2288,9 +2213,5 @@
       {
         Int orgQP = rpcBestCU->getQP( 0 );
-#if UPDATE_HM13
         rpcTempCU->initEstData( uhDepth, orgQP ,bTransquantBypassFlag );      
-#else
-        rpcTempCU->initEstData( uhDepth, orgQP );
-#endif
         rpcTempCU->copyPartFrom( rpcBestCU, 0, uhDepth );
       }
@@ -2320,35 +2241,5 @@
       xCheckBestMode(rpcBestCU, rpcTempCU, uhDepth);
     }
-#else
-    if( rpcTempCU != rpcTempCUPre )
-    {
-      Int orgQP = rpcBestCU->getQP( 0 );
-      rpcTempCU->initEstData( uhDepth, orgQP );
-      rpcTempCU->copyPartFrom( rpcBestCU, 0, uhDepth );
-    }
-    rpcTempCU->setSkipFlagSubParts( false, 0, uhDepth );
-    rpcTempCU->setTrIdxSubParts( 0, 0, uhDepth );
-    rpcTempCU->setCbfSubParts( 1, 1, 1, 0, uhDepth );
-#if H_3D_VSO // M3
-    if( m_pcRdCost->getUseRenModel() )
-    {
-      UInt  uiWidth     = m_ppcOrigYuv[uhDepth]->getWidth ( );
-      UInt  uiHeight    = m_ppcOrigYuv[uhDepth]->getHeight( );
-      Pel*  piSrc       = m_ppcOrigYuv[uhDepth]->getLumaAddr( );
-      UInt  uiSrcStride = m_ppcOrigYuv[uhDepth]->getStride();
-      m_pcRdCost->setRenModelData( rpcTempCU, 0, piSrc, uiSrcStride, uiWidth, uiHeight );
-    }
-#endif
-
-    m_pcPredSearch->encodeResAndCalcRdInterSDCCU( rpcTempCU, 
-      m_ppcOrigYuv[uhDepth],
-      ( rpcTempCU != rpcTempCUPre ) ? m_ppcPredYuvBest[uhDepth] : m_ppcPredYuvTemp[uhDepth],
-      m_ppcResiYuvTemp[uhDepth],
-      m_ppcRecoYuvTemp[uhDepth],
-      uhDepth );
-
-  xCheckDQP( rpcTempCU );
-  xCheckBestMode(rpcBestCU, rpcTempCU, uhDepth);
-#endif
+
   }
 #endif
@@ -2593,5 +2484,5 @@
   m_pcEntropyCoder->encodePredMode( rpcTempCU, 0,          true );
   m_pcEntropyCoder->encodePartSize( rpcTempCU, 0, uiDepth, true );
-#if QC_SDC_UNIFY_G0130
+#if H_3D_DIM_SDC
   m_pcEntropyCoder->encodeSDCFlag( rpcTempCU, 0, true );
 #endif
@@ -2650,5 +2541,5 @@
   m_pcEntropyCoder->encodePredMode ( rpcTempCU, 0,          true );
   m_pcEntropyCoder->encodePartSize ( rpcTempCU, 0, uiDepth, true );
-#if QC_SDC_UNIFY_G0130
+#if H_3D_DIM_SDC
   m_pcEntropyCoder->encodeSDCFlag( rpcTempCU, 0, true );
 #endif
Index: /trunk/source/Lib/TLibEncoder/TEncEntropy.cpp
===================================================================
--- /trunk/source/Lib/TLibEncoder/TEncEntropy.cpp	(revision 883)
+++ /trunk/source/Lib/TLibEncoder/TEncEntropy.cpp	(revision 884)
@@ -151,9 +151,5 @@
 Void TEncEntropy::encodeICFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD )
 {
-#if SEC_IC_ARP_SIG_G0072
   if ( pcCU->isIntra( uiAbsPartIdx ) || ( pcCU->getSlice()->getViewIndex() == 0 ) || pcCU->getSlice()->getIsDepth() || pcCU->getARPW( uiAbsPartIdx ) > 0 )
-#else
-  if ( pcCU->isIntra( uiAbsPartIdx ) || ( pcCU->getSlice()->getViewIndex() == 0 ) || pcCU->getSlice()->getIsDepth() )
-#endif
   {
     return;
@@ -670,5 +666,4 @@
   UInt uiLumaOffset   = uiMinCoeffSize*uiAbsPartIdx;
   UInt uiChromaOffset = uiLumaOffset>>2;
-#if QC_SDC_UNIFY_G0130
 #if H_3D_DIM_SDC
   if( pcCU->getSDCFlag( uiAbsPartIdx ) && pcCU->isIntra( uiAbsPartIdx ) )
@@ -680,7 +675,5 @@
     assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_V) == 1 );
   }
-#endif
-
-#if H_3D_INTER_SDC
+
   if( pcCU->getSDCFlag( uiAbsPartIdx ) && !pcCU->isIntra( uiAbsPartIdx ) )
   {
@@ -689,10 +682,6 @@
     assert( pcCU->getSlice()->getIsDepth() );
   }
-#endif
-#if QC_SDC_UNIFY_G0130_FIX
+
   if( pcCU->getSlice()->getIsDepth() && ( pcCU->getSDCFlag( uiAbsPartIdx ) || pcCU->isIntra( uiAbsPartIdx ) ) )
-#else
-  if( pcCU->getSDCFlag( uiAbsPartIdx ) || pcCU->isIntra( uiAbsPartIdx ) )
-#endif
   {
     Int iPartNum = ( pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_NxN ) ? 4 : 1;
@@ -715,28 +704,4 @@
     }
   }
-#else
-#if H_3D_DIM_SDC
-  if( pcCU->getSDCFlag( uiAbsPartIdx ) )
-  {
-    assert( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N );
-    assert( pcCU->getTransformIdx(uiAbsPartIdx) == 0 );
-    assert( pcCU->getCbf(uiAbsPartIdx, TEXT_LUMA) == 1 );
-    assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_U) == 1 );
-    assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_V) == 1 );
-    return;
-  }
-#endif
-
-#if H_3D_INTER_SDC
-  if( pcCU->getInterSDCFlag( uiAbsPartIdx ) )
-  {
-    assert( !pcCU->isSkipped( uiAbsPartIdx ) );
-    assert( !pcCU->isIntra( uiAbsPartIdx) );
-    assert( pcCU->getSlice()->getIsDepth() );
-
-    encodeInterSDCResidualData( pcCU, uiAbsPartIdx, false );
-    return;
-  }
-#endif
 #endif
 
@@ -799,5 +764,4 @@
 
 #if H_3D_INTER_SDC
-#if QC_SDC_UNIFY_G0130
 Void TEncEntropy::encodeDeltaDC  ( TComDataCU* pcCU, UInt absPartIdx )
 {
@@ -813,18 +777,10 @@
   }
 
-#if SEC_INTER_SDC_G0101
   if( !pcCU->getSlice()->getIsDepth() || pcCU->getPartitionSize( uiAbsPartIdx ) != SIZE_2Nx2N || pcCU->isSkipped( uiAbsPartIdx ) )
-#else
-  if( !pcCU->getSlice()->getIsDepth() || ( pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) != SIZE_2Nx2N ) || pcCU->isSkipped( uiAbsPartIdx ) )
-#endif
-  {
-    return;
-  }
-
-#if SEC_INTER_SDC_G0101
+  {
+    return;
+  }
+
   assert( pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N || ( !pcCU->isIntra( uiAbsPartIdx ) && !pcCU->isSkipped( uiAbsPartIdx ) ) );
-#else
-  assert( ( pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N ) || ( !pcCU->isIntra( uiAbsPartIdx ) && !pcCU->isSkipped( uiAbsPartIdx ) ) );
-#endif
 
   if( bRD )
@@ -835,52 +791,5 @@
   m_pcEntropyCoderIf->codeSDCFlag( pcCU, uiAbsPartIdx );
 }
-#else
-Void TEncEntropy::encodeInterSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD )
-{
-  if( !pcCU->getSlice()->getVPS()->getInterSDCFlag( pcCU->getSlice()->getLayerIdInVps() ) )
-  {
-    return;
-  }
-
-  if( !pcCU->getSlice()->getIsDepth() || pcCU->isIntra( uiAbsPartIdx ) || pcCU->isSkipped( uiAbsPartIdx ) )
-  {
-    return;
-  }
-
-  if( bRD )
-  {
-    uiAbsPartIdx = 0;
-  }
-
-  m_pcEntropyCoderIf->codeInterSDCFlag( pcCU, uiAbsPartIdx );
-}
-
-Void TEncEntropy::encodeInterSDCResidualData( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD )
-{
-  if( !pcCU->getSlice()->getVPS()->getInterSDCFlag( pcCU->getSlice()->getLayerIdInVps() ) )
-  {
-    return;
-  }
-
-  if( !pcCU->getSlice()->getIsDepth() || pcCU->isIntra( uiAbsPartIdx ) || !pcCU->getInterSDCFlag( uiAbsPartIdx ) )
-  {
-    return;
-  }
-
-  if( bRD )
-  {
-    uiAbsPartIdx = 0;
-  }
-
-  // number of segments depends on prediction mode for INTRA
-  UInt uiNumSegments = ( pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N ) ? 1 : ( pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_NxN ? 4 : 2 );
-
-  // encode residual data for each segment
-  for( UInt uiSeg = 0; uiSeg < uiNumSegments; uiSeg++ )
-  {
-    m_pcEntropyCoderIf->codeInterSDCResidualData( pcCU, uiAbsPartIdx, uiSeg );
-  }
-}
-#endif
+
 #endif
 #if H_3D_DBBP
Index: /trunk/source/Lib/TLibEncoder/TEncEntropy.h
===================================================================
--- /trunk/source/Lib/TLibEncoder/TEncEntropy.h	(revision 883)
+++ /trunk/source/Lib/TLibEncoder/TEncEntropy.h	(revision 884)
@@ -95,11 +95,6 @@
 #endif
 #if H_3D_INTER_SDC
-#if QC_SDC_UNIFY_G0130
   virtual Void codeDeltaDC       ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;
   virtual Void codeSDCFlag       ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;
-#else
-  virtual Void codeInterSDCFlag  ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;
-  virtual Void codeInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment ) = 0;
-#endif
 #endif
 #if H_3D_DBBP
@@ -190,11 +185,6 @@
 #endif
 #if H_3D_INTER_SDC
-#if QC_SDC_UNIFY_G0130
   Void encodeDeltaDC      ( TComDataCU* pcCU, UInt absPartIdx );
   Void encodeSDCFlag      ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false );
-#else
-  Void encodeInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false );
-  Void encodeInterSDCResidualData( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD );
-#endif
 #endif
 #if H_3D_DBBP
Index: /trunk/source/Lib/TLibEncoder/TEncGOP.cpp
===================================================================
--- /trunk/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 883)
+++ /trunk/source/Lib/TLibEncoder/TEncGOP.cpp	(revision 884)
@@ -296,5 +296,5 @@
 }
 
-#if H_MV_HLS_7_SEI_P0204_26
+#if H_MV
 SEISubBitstreamProperty *TEncGOP::xCreateSEISubBitstreamProperty( TComSPS *sps)
 {
@@ -365,5 +365,5 @@
     delete sei;
   }
-#if H_MV_HLS_7_SEI_P0204_26
+#if H_MV
   if( m_pcCfg->getSubBitstreamPropSEIEnabled() )
   {
Index: /trunk/source/Lib/TLibEncoder/TEncGOP.h
===================================================================
--- /trunk/source/Lib/TLibEncoder/TEncGOP.h	(revision 883)
+++ /trunk/source/Lib/TLibEncoder/TEncGOP.h	(revision 884)
@@ -212,5 +212,5 @@
 
   SEIToneMappingInfo*     xCreateSEIToneMappingInfo();
-#if H_MV_HLS_7_SEI_P0204_26
+#if H_MV
   SEISubBitstreamProperty *xCreateSEISubBitstreamProperty( TComSPS *sps);
 #endif
Index: /trunk/source/Lib/TLibEncoder/TEncSbac.cpp
===================================================================
--- /trunk/source/Lib/TLibEncoder/TEncSbac.cpp	(revision 883)
+++ /trunk/source/Lib/TLibEncoder/TEncSbac.cpp	(revision 884)
@@ -92,10 +92,5 @@
 , m_cDdcFlagSCModel           ( 1,             1,               NUM_DDC_FLAG_CTX              , m_contextModels + m_numContextModels, m_numContextModels)
 , m_cDdcDataSCModel           ( 1,             1,               NUM_DDC_DATA_CTX              , m_contextModels + m_numContextModels, m_numContextModels)
-#if QC_GENERIC_SDC_G0122
 , m_cAngleFlagSCModel         ( 1,             1,               NUM_ANGLE_FLAG_CTX            , m_contextModels + m_numContextModels, m_numContextModels)
-#if !QC_SDC_UNIFY_G0130
-, m_cIntraSdcFlagSCModel      ( 1,             1,               NUM_INTRASDC_FLAG_CTX         , m_contextModels + m_numContextModels, m_numContextModels)
-#endif
-#endif
 #if H_3D_DIM_DMM
 , m_cDmm1DataSCModel          ( 1,             1,               NUM_DMM1_DATA_CTX             , m_contextModels + m_numContextModels, m_numContextModels)
@@ -106,10 +101,5 @@
 #endif
 #endif
-#if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
-, m_cInterSDCFlagSCModel             ( 1,             1,  NUM_INTER_SDC_FLAG_CTX           , m_contextModels + m_numContextModels, m_numContextModels)
-, m_cInterSDCResidualSCModel         ( 1,             1,  NUM_INTER_SDC_RESIDUAL_CTX       , m_contextModels + m_numContextModels, m_numContextModels)
-, m_cInterSDCResidualSignFlagSCModel ( 1,             1,  NUM_INTER_SDC_SIGN_FLAG_CTX      , m_contextModels + m_numContextModels, m_numContextModels)
-#endif
-#if QC_SDC_UNIFY_G0130
+#if H_3D_DIM_SDC
 , m_cSDCFlagSCModel                  ( 1,             1,  NUM_SDC_FLAG_CTX                 , m_contextModels + m_numContextModels, m_numContextModels)
 #endif
@@ -178,10 +168,5 @@
   m_cDdcFlagSCModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_DDC_FLAG );
   m_cDdcDataSCModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_DDC_DATA );
-#if QC_GENERIC_SDC_G0122
   m_cAngleFlagSCModel.initBuffer         ( eSliceType, iQp, (UChar*)INIT_ANGLE_FLAG );
-#if !QC_SDC_UNIFY_G0130
-  m_cIntraSdcFlagSCModel.initBuffer      ( eSliceType, iQp, (UChar*)INIT_INTRASDC_FLAG );
-#endif
-#endif
 #if H_3D_DIM_DMM
   m_cDmm1DataSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_DMM1_DATA );
@@ -192,10 +177,5 @@
 #endif
 #endif
-#if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
-  m_cInterSDCFlagSCModel.initBuffer         ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_FLAG );
-  m_cInterSDCResidualSCModel.initBuffer     ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_RESIDUAL );
-  m_cInterSDCResidualSignFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_SIGN_FLAG );
-#endif
-#if QC_SDC_UNIFY_G0130
+#if H_3D_DIM_SDC
   m_cSDCFlagSCModel.initBuffer              ( eSliceType, iQp, (UChar*)INIT_SDC_FLAG );
 #endif
@@ -240,10 +220,5 @@
       curCost += m_cCUICFlagSCModel.calcCost          ( curSliceType, qp, (UChar*)INIT_IC_FLAG );
 #endif
-#if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
-      curCost += m_cInterSDCFlagSCModel.calcCost      ( curSliceType, qp, (UChar*)INIT_INTER_SDC_FLAG );
-      curCost += m_cInterSDCResidualSCModel.calcCost  ( curSliceType, qp, (UChar*)INIT_INTER_SDC_RESIDUAL );
-      curCost += m_cInterSDCResidualSignFlagSCModel.calcCost( curSliceType, qp, (UChar*)INIT_INTER_SDC_SIGN_FLAG );
-#endif
-#if QC_SDC_UNIFY_G0130
+#if H_3D_DIM_SDC
       curCost += m_cSDCFlagSCModel.calcCost           ( curSliceType, qp, (UChar*)INIT_SDC_FLAG );
 #endif
@@ -279,10 +254,5 @@
       curCost += m_cDdcFlagSCModel.calcCost           ( curSliceType, qp, (UChar*)INIT_DDC_FLAG );
       curCost += m_cDdcDataSCModel.calcCost           ( curSliceType, qp, (UChar*)INIT_DDC_DATA );
-#if QC_GENERIC_SDC_G0122
       curCost += m_cAngleFlagSCModel.calcCost         ( curSliceType, qp, (UChar*)INIT_ANGLE_FLAG );  
-#if !QC_SDC_UNIFY_G0130
-      curCost += m_cIntraSdcFlagSCModel.calcCost      ( curSliceType, qp, (UChar*)INIT_INTRASDC_FLAG );  
-#endif
-#endif
 #if H_3D_DIM_DMM
       curCost += m_cDmm1DataSCModel.calcCost          ( curSliceType, qp, (UChar*)INIT_DMM1_DATA );
@@ -348,10 +318,5 @@
   m_cDdcFlagSCModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_DDC_FLAG );
   m_cDdcDataSCModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_DDC_DATA );
-#if QC_GENERIC_SDC_G0122
   m_cAngleFlagSCModel.initBuffer         ( eSliceType, iQp, (UChar*)INIT_ANGLE_FLAG );
-#if !QC_SDC_UNIFY_G0130
-  m_cIntraSdcFlagSCModel.initBuffer      ( eSliceType, iQp, (UChar*)INIT_INTRASDC_FLAG );
-#endif
-#endif
 #if H_3D_DIM_DMM
   m_cDmm1DataSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_DMM1_DATA );
@@ -362,10 +327,5 @@
 #endif
 #endif
-#if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
-  m_cInterSDCFlagSCModel.initBuffer         ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_FLAG );
-  m_cInterSDCResidualSCModel.initBuffer     ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_RESIDUAL );
-  m_cInterSDCResidualSignFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_SIGN_FLAG );
-#endif
-#if QC_SDC_UNIFY_G0130
+#if H_3D_DIM_SDC
   m_cSDCFlagSCModel.initBuffer              ( eSliceType, iQp, (UChar*)INIT_SDC_FLAG );
 #endif
@@ -672,10 +632,5 @@
   this->m_cDepthIntraModeSCModel .copyFrom( &pSrc->m_cDepthIntraModeSCModel );
   this->m_cDdcFlagSCModel        .copyFrom( &pSrc->m_cDdcFlagSCModel );
-#if QC_GENERIC_SDC_G0122
   this->m_cAngleFlagSCModel      .copyFrom( &pSrc->m_cAngleFlagSCModel );
-#if !QC_SDC_UNIFY_G0130
-  this->m_cIntraSdcFlagSCModel   .copyFrom( &pSrc->m_cIntraSdcFlagSCModel );
-#endif
-#endif
 }
 #endif
@@ -728,8 +683,6 @@
   Bool rapPic     = (pcCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || pcCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP || pcCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA);
 
-#if MTK_TEX_DEP_PAR_G0055
   Bool depthDependent = false;
   UInt uiTexturePart = eSize;
-#endif
   if(bDepthMapDetect && !bIntraSliceDetect && !rapPic && pcCU->getPic()->getReduceBitsFlag() && sps->getUseQTL() && sps->getUsePC() )
   {
@@ -737,7 +690,4 @@
     UInt uiCUIdx            = (pcCU->getZorderIdxInCU() == 0) ? uiAbsPartIdx : pcCU->getZorderIdxInCU();
     assert(pcTextureCU->getDepth(uiCUIdx) >= uiDepth);
-#if !MTK_TEX_DEP_PAR_G0055
-    if (pcTextureCU->getDepth(uiCUIdx) == uiDepth && pcTextureCU->getPartitionSize( uiCUIdx ) != SIZE_NxN)
-#else
     if(pcTextureCU->getDepth(uiCUIdx) == uiDepth )
     {
@@ -746,5 +696,4 @@
     }
     if (pcTextureCU->getDepth(uiCUIdx) == uiDepth && pcTextureCU->getPartitionSize( uiCUIdx ) == SIZE_2Nx2N)
-#endif
     {
       assert( eSize == SIZE_2Nx2N );
@@ -768,5 +717,5 @@
   DTRACE_CU("part_mode", eSize )
 #endif        
-#if MTK_TEX_DEP_PAR_G0055
+#if H_3D_QTLPC
     if (depthDependent==false || uiTexturePart == SIZE_NxN|| uiTexturePart == SIZE_2Nx2N)
     {
@@ -838,5 +787,5 @@
     }
   }
-#if MTK_TEX_DEP_PAR_G0055
+#if H_3D_QTLPC
     }
     else if(uiTexturePart == SIZE_2NxN || uiTexturePart == SIZE_2NxnU || uiTexturePart == SIZE_2NxnD)
@@ -1050,9 +999,5 @@
   if( nBinNum > 1 )
   {
-#if MTK_ARP_FLAG_CABAC_SIMP_G0061
      m_pcBinIf->encodeBin( ( iW == iMaxW ) ? 1 : 0, m_cCUPUARPWSCModel.get( 0, 0, 2 ) );
-#else
-     m_pcBinIf->encodeBin( ( iW == iMaxW ) ? 1 : 0, m_cCUPUARPWSCModel.get( 0, 0, 3 ) );
-#endif
   }
 #if H_MV_ENC_DEC_TRAC
@@ -1072,15 +1017,8 @@
   // get context function is here
   UInt uiSymbol = pcCU->getICFlag( uiAbsPartIdx ) ? 1 : 0;
-#if MTK_IC_FLAG_CABAC_SIMP_G0061
   m_pcBinIf->encodeBin( uiSymbol, m_cCUICFlagSCModel.get( 0, 0, 0 ) );
-#else
-  UInt uiCtxIC  = pcCU->getCtxICFlag( uiAbsPartIdx ) ;
-  m_pcBinIf->encodeBin( uiSymbol, m_cCUICFlagSCModel.get( 0, 0, uiCtxIC ) );
-#endif
 #if !H_MV_ENC_DEC_TRAC
   DTRACE_CABAC_VL( g_nSymbolCounter++ );
   DTRACE_CABAC_T( "\tICFlag" );
-  DTRACE_CABAC_T( "\tuiCtxIC: ");
-  DTRACE_CABAC_V( uiCtxIC );
   DTRACE_CABAC_T( "\tuiSymbol: ");
   DTRACE_CABAC_V( uiSymbol );
@@ -1167,24 +1105,17 @@
     }
     if( pcCU->getLumaIntraDir( absPartIdx+partOffset*j ) < NUM_INTRA_MODE )
-#if H_3D_DIM_SDC
-#if QC_GENERIC_SDC_G0122
-      if( 1 )
-#else
-      if( !pcCU->getSDCFlag( absPartIdx+partOffset*j ) )
-#endif
-#endif
-    {
-#endif
-    predNum[j] = pcCU->getIntraDirLumaPredictor(absPartIdx+partOffset*j, preds[j]);  
-    for(UInt i = 0; i < predNum[j]; i++)
-    {
-      if(dir[j] == preds[j][i])
-      {
-        predIdx[j] = i;
-      }
-    }
-    m_pcBinIf->encodeBin((predIdx[j] != -1)? 1 : 0, m_cCUIntraPredSCModel.get( 0, 0, 0 ) );
+    {
+#endif
+      predNum[j] = pcCU->getIntraDirLumaPredictor(absPartIdx+partOffset*j, preds[j]);  
+      for(UInt i = 0; i < predNum[j]; i++)
+      {
+        if(dir[j] == preds[j][i])
+        {
+          predIdx[j] = i;
+        }
+      }
+      m_pcBinIf->encodeBin((predIdx[j] != -1)? 1 : 0, m_cCUIntraPredSCModel.get( 0, 0, 0 ) );
 #if H_MV_ENC_DEC_TRAC
-    DTRACE_CU("prev_intra_luma_pred_flag", (predIdx[j] != -1)? 1 : 0); 
+      DTRACE_CU("prev_intra_luma_pred_flag", (predIdx[j] != -1)? 1 : 0); 
 #endif
 #if H_3D_DIM
@@ -1197,11 +1128,4 @@
 #if H_3D_DIM
     if( pcCU->getLumaIntraDir( absPartIdx+partOffset*j ) < NUM_INTRA_MODE )
-#if H_3D_DIM_SDC
-#if QC_GENERIC_SDC_G0122
-      if( 1 )
-#else
-      if( !pcCU->getSDCFlag( absPartIdx+partOffset*j ) )
-#endif
-#endif
     {
 #endif
@@ -1301,45 +1225,6 @@
   default: break;
   }
-#if !QC_SDC_UNIFY_G0130
-  if( dimType < DIM_NUM_TYPE || pcCU->getSDCFlag( absPartIdx ) )
-  {
-    UInt dimDeltaDC;
-    Pel  deltaDC;
-#if QC_GENERIC_SDC_G0122
-    UInt uiNumSegments = isDimMode( dir ) ? 2 : 1;
-#else
-    UInt uiNumSegments = ( dir == PLANAR_IDX ) ? 1 : 2;
-#endif
-    if( pcCU->getSDCFlag( absPartIdx ) )
-    {
-      if( uiNumSegments==1 )
-      {
-        dimDeltaDC = pcCU->getSDCSegmentDCOffset(0, absPartIdx) ? 1 : 0;
-      }
-      else
-      {
-        dimDeltaDC = ( pcCU->getSDCSegmentDCOffset(0, absPartIdx) || pcCU->getSDCSegmentDCOffset(1, absPartIdx) ) ? 1 : 0;
-      }
-    }
-    else
-    {
-      dimDeltaDC = isDimDeltaDC( dir );
-    }
-
-    m_pcBinIf->encodeBin( dimDeltaDC, m_cDdcFlagSCModel.get(0, 0, uiNumSegments-1) );
-
-    if( dimDeltaDC ) 
-    {
-      for( UInt segment = 0; segment < uiNumSegments; segment++ )
-      {
-        deltaDC = pcCU->getSDCFlag( absPartIdx ) ? pcCU->getSDCSegmentDCOffset(segment, absPartIdx) : pcCU->getDimDeltaDC( dimType, segment, absPartIdx );
-        xCodeDimDeltaDC( deltaDC, uiNumSegments );
-      }
-    }
-  }
-#endif
-}
-
-#if QC_GENERIC_SDC_G0122
+}
+
 Void TEncSbac::codeIntraDepthMode( TComDataCU* pcCU, UInt absPartIdx )
 {
@@ -1350,10 +1235,4 @@
     m_pcBinIf->encodeBin( isDimMode( dir ) ? 0 : 1, m_cAngleFlagSCModel.get( 0, 0, pcCU->getCtxAngleFlag( absPartIdx ) ) );
   }
-#if !QC_SDC_UNIFY_G0130
-  if( pcCU->getPartitionSize( absPartIdx ) == SIZE_2Nx2N ) //SDC is allowed only in this case
-  {
-    m_pcBinIf->encodeBin( pcCU->getSDCFlag( absPartIdx ) ? 1 : 0, m_cIntraSdcFlagSCModel.get( 0, 0, pcCU->getCtxSDCFlag( absPartIdx ) ) );
-}
-#endif
   if( isDimMode( dir ) )
   {
@@ -1370,46 +1249,4 @@
   }
 }
-#else
-Void TEncSbac::codeIntraDepthMode( TComDataCU* pcCU, UInt absPartIdx )
-{
-  UInt codeWordTable[3][7] =    {{0, 0, 0, 1, 0, 0, 0},{0, 2, 6, 14, 15, 0, 0},{0, 1, 0, 0, 0, 0, 0}};
-  UInt codeWordLenTable[3][7] = {{0, 1, 0, 1, 0, 0, 0},{1, 2, 3,  4,  4, 0, 0},{1, 1, 0, 0, 0, 0, 0}};
-  UInt dir = pcCU->getLumaIntraDir( absPartIdx );
-  UInt puIdx = (pcCU->getWidth(absPartIdx) == 64) ? 2 : ( (pcCU->getPartitionSize(absPartIdx) == SIZE_NxN && pcCU->getWidth(absPartIdx) == 8) ? 0 : 1 );
-  UInt codeIdx = 0;
-
-  if( dir < NUM_INTRA_MODE )
-  { 
-    codeIdx = 1; 
-  }
-  if( isDimMode( dir ) )
-  {
-    switch( getDimType( dir ) )
-    {
-    case DMM1_IDX: codeIdx = 3; break;
-    case DMM4_IDX: codeIdx = 4; break;
-    default:                    break;
-    }
-  }
-
-#if H_3D_DIM_SDC
-  if( pcCU->getSDCFlag( absPartIdx ) )
-  {
-    switch( dir )
-    {
-      case PLANAR_IDX:  codeIdx = 0; break;
-      default:          codeIdx = 2; break;
-    }
-  }
-#endif
-  //mode coding
-  for( UInt i = 0; i < codeWordLenTable[puIdx][codeIdx]; i++ )
-  {
-    UInt bit = codeWordTable[puIdx][codeIdx] & ( 1<<(codeWordLenTable[puIdx][codeIdx] - i - 1) );
-    UInt ctxDepthMode = puIdx*3 + ( (i >= 2) ? 2 : i );
-    m_pcBinIf->encodeBin( bit!=0 , m_cDepthIntraModeSCModel.get(0, 0, ctxDepthMode) );
-  }
-}
-#endif
 #endif
 
@@ -2446,5 +2283,4 @@
 
 #if H_3D_INTER_SDC
-#if QC_SDC_UNIFY_G0130
 Void TEncSbac::codeDeltaDC( TComDataCU* pcCU, UInt absPartIdx )
 {
@@ -2482,10 +2318,5 @@
   else //all-zero inter SDC is not allowed
   {
-#if SEC_INTER_SDC_G0101
     uiNumSegments = 1;
-#else
-    PartSize cPartSize = pcCU->getPartitionSize( absPartIdx );
-    uiNumSegments = ( cPartSize == SIZE_2Nx2N ) ? 1 : ( cPartSize == SIZE_NxN ? 4 : 2 );
-#endif
     dimDeltaDC = 1;
   }
@@ -2519,26 +2350,5 @@
   m_pcBinIf->encodeBin( uiSymbol, m_cSDCFlagSCModel.get( 0, 0, uiCtxSDCFlag ) );
 }
-#else
-Void TEncSbac::codeInterSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx )
-{
-  UInt uiSymbol = pcCU->getInterSDCFlag( uiAbsPartIdx ) ? 1 : 0;
-  UInt uiCtxInterSDCFlag = pcCU->getCtxInterSDCFlag( uiAbsPartIdx );
-
-  m_pcBinIf->encodeBin( uiSymbol, m_cInterSDCFlagSCModel.get( 0, 0, uiCtxInterSDCFlag ) );
-}
-
-Void TEncSbac::codeInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment )
-{
-  Pel segmentDCOffset = pcCU->getInterSDCSegmentDCOffset( uiSegment, uiAbsPartIdx );
-
-  UInt uiSign     = segmentDCOffset < 0 ? 1 : 0;
-  UInt uiAbsIdx   = abs( segmentDCOffset );
-
-  assert( uiAbsIdx > 0 );
-  uiAbsIdx--;
-  xWriteExGolombLevel( uiAbsIdx, m_cInterSDCResidualSCModel.get( 0, 0, 0 ) );
-  m_pcBinIf->encodeBin( uiSign, m_cInterSDCResidualSignFlagSCModel.get( 0, 0, 0 ) );
-}
-#endif
+
 #endif
 
Index: /trunk/source/Lib/TLibEncoder/TEncSbac.h
===================================================================
--- /trunk/source/Lib/TLibEncoder/TEncSbac.h	(revision 883)
+++ /trunk/source/Lib/TLibEncoder/TEncSbac.h	(revision 884)
@@ -162,11 +162,6 @@
 #endif
 #if H_3D_INTER_SDC
-#if QC_SDC_UNIFY_G0130
   Void codeDeltaDC       ( TComDataCU* pcCU, UInt absPartIdx );
   Void codeSDCFlag       ( TComDataCU* pcCU, UInt uiAbsPartIdx );
-#else
-  Void codeInterSDCFlag  ( TComDataCU* pcCU, UInt uiAbsPartIdx );
-  Void codeInterSDCResidualData  ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment );
-#endif
 #endif
 #if H_3D_DBBP
@@ -262,10 +257,5 @@
   ContextModel3DBuffer m_cDdcFlagSCModel;
   ContextModel3DBuffer m_cDdcDataSCModel;
-#if QC_GENERIC_SDC_G0122
   ContextModel3DBuffer m_cAngleFlagSCModel;
-#if !QC_SDC_UNIFY_G0130
-  ContextModel3DBuffer m_cIntraSdcFlagSCModel;
-#endif
-#endif
 #if H_3D_DIM_DMM
   ContextModel3DBuffer m_cDmm1DataSCModel;
@@ -276,10 +266,5 @@
 #endif
 #endif
-#if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
-  ContextModel3DBuffer m_cInterSDCFlagSCModel;
-  ContextModel3DBuffer m_cInterSDCResidualSCModel;
-  ContextModel3DBuffer m_cInterSDCResidualSignFlagSCModel;
-#endif
-#if QC_SDC_UNIFY_G0130
+#if H_3D_DIM_SDC
   ContextModel3DBuffer m_cSDCFlagSCModel;
 #endif
Index: /trunk/source/Lib/TLibEncoder/TEncSearch.cpp
===================================================================
--- /trunk/source/Lib/TLibEncoder/TEncSearch.cpp	(revision 883)
+++ /trunk/source/Lib/TLibEncoder/TEncSearch.cpp	(revision 884)
@@ -920,5 +920,5 @@
       m_pcEntropyCoder  ->encodePartSize( pcCU, 0, pcCU->getDepth(0), true );
 
-#if QC_SDC_UNIFY_G0130
+#if H_3D_DIM_SDC
       m_pcEntropyCoder->encodeSDCFlag( pcCU, 0, true );
 #endif
@@ -939,5 +939,5 @@
       {
         m_pcEntropyCoder->encodeIntraDirModeLuma ( pcCU, 0 );
-#if QC_SDC_UNIFY_G0130_FIX
+#if H_3D_DIM_SDC
         if( pcCU->getSlice()->getIsDepth() && ( !pcCU->getSDCFlag( 0 ) ) && getDimType( pcCU->getLumaIntraDir( 0 ) ) < DIM_NUM_TYPE ) 
         {
@@ -956,5 +956,5 @@
         {
           m_pcEntropyCoder->encodeIntraDirModeLuma ( pcCU, uiPart * uiQNumParts );
-#if QC_SDC_UNIFY_G0130_FIX
+#if H_3D_DIM_SDC
           if( pcCU->getSlice()->getIsDepth() && ( !pcCU->getSDCFlag( uiPart * uiQNumParts ) ) && getDimType( pcCU->getLumaIntraDir( uiPart * uiQNumParts ) ) < DIM_NUM_TYPE ) 
           {
@@ -967,5 +967,5 @@
       {
         m_pcEntropyCoder->encodeIntraDirModeLuma ( pcCU, uiAbsPartIdx );
-#if QC_SDC_UNIFY_G0130_FIX
+#if H_3D_DIM_SDC
         if( pcCU->getSlice()->getIsDepth() && ( !pcCU->getSDCFlag( uiAbsPartIdx ) ) && getDimType( pcCU->getLumaIntraDir( uiAbsPartIdx ) ) < DIM_NUM_TYPE ) 
         {
@@ -975,19 +975,5 @@
     }
   }
-#if QC_SDC_UNIFY_G0130 && !QC_SDC_UNIFY_G0130_FIX
-    Int iPartNum = ( pcCU->isIntra( uiAbsPartIdx ) && pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_NxN ) ? 4 : 1;
-    UInt uiPartOffset = ( pcCU->getPic()->getNumPartInCU() >> ( pcCU->getDepth( uiAbsPartIdx ) << 1 ) ) >> 2;
-
-    if( !pcCU->getSDCFlag( uiAbsPartIdx ) )
-    {
-      for( Int iPart = 0; iPart < iPartNum; iPart++ )
-      {
-        if( getDimType( pcCU->getLumaIntraDir( uiAbsPartIdx + uiPartOffset*iPart ) ) < DIM_NUM_TYPE ) 
-        {
-          m_pcEntropyCoder->encodeDeltaDC( pcCU, uiAbsPartIdx + uiPartOffset*iPart );
-        }
-      }
-    }
-#endif
+
   }
   if( bChroma )
@@ -1875,29 +1861,11 @@
 
 #if H_3D_DIM_SDC
-Void TEncSearch::xIntraCodingSDC( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, 
-#if QC_GENERIC_SDC_G0122
-  Bool bZeroResidual, Int iSDCDeltaResi
-#else
-  Bool bResidual
-#endif
-  )
+Void TEncSearch::xIntraCodingSDC( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, Bool bZeroResidual, Int iSDCDeltaResi  )
 {
   UInt    uiLumaPredMode    = pcCU     ->getLumaIntraDir( uiAbsPartIdx );
   UInt    uiWidth           = pcCU     ->getWidth   ( 0 );
   UInt    uiHeight          = pcCU     ->getHeight  ( 0 );
-#if QC_PKU_SDC_SPLIT_G0123
-#if HS_TSINGHUA_SDC_SPLIT_G0111
-#if QC_GENERIC_SDC_G0122
   TComWedgelet* dmm4SegmentationOrg = new TComWedgelet( uiWidth, uiHeight );
-#endif
-#else
-#if QC_GENERIC_SDC_G0122
-  TComWedgelet* dmm4Segmentation = new TComWedgelet( uiWidth, uiHeight );
-#endif
-#endif
-#endif
-#if QC_PKU_SDC_SPLIT_G0123
   UInt numParts = 1;
-  UInt i = 0;
   UInt sdcDepth = 0;
   UInt uiStride;         
@@ -1910,5 +1878,4 @@
   UInt uiRecIPredStride; 
 
-#if HS_TSINGHUA_SDC_SPLIT_G0111
   if ( ( uiWidth >> pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() ) > 1 )
   {
@@ -1917,14 +1884,6 @@
     uiWidth = uiHeight = ( 1 << pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() );
   }
-#else
-  if (uiWidth == 64)
-  {
-    numParts = 4;
-    sdcDepth = 1;
-    uiWidth = uiHeight = 32;
-  }
-#endif
-
-  for ( i = 0; i < numParts; i++ )
+
+  for ( Int i = 0; i < numParts; i++ )
   {
     uiStride          = pcOrgYuv ->getStride  ();
@@ -1938,83 +1897,40 @@
 
     AOF( uiWidth == uiHeight );
-#else
-  UInt    uiStride          = pcOrgYuv ->getStride  ();
-  Pel*    piOrg             = pcOrgYuv ->getLumaAddr( uiAbsPartIdx );
-  Pel*    piPred            = pcPredYuv->getLumaAddr( uiAbsPartIdx );
-  Pel*    piReco            = pcPredYuv->getLumaAddr( uiAbsPartIdx );
-  
-  UInt    uiZOrder          = pcCU->getZorderIdxInCU() + uiAbsPartIdx;
-  Pel*    piRecIPred        = pcCU->getPic()->getPicYuvRec()->getLumaAddr( pcCU->getAddr(), uiZOrder );
-  UInt    uiRecIPredStride  = pcCU->getPic()->getPicYuvRec()->getStride  ();
-  
-  AOF( uiWidth == uiHeight );
-  AOF( uiAbsPartIdx == 0 );
-  AOF( pcCU->getSDCAvailable(uiAbsPartIdx) );
-  AOF( pcCU->getSDCFlag(uiAbsPartIdx) );
-#endif
-#if !QC_GENERIC_SDC_G0122
-  AOF( uiLumaPredMode == DC_IDX || uiLumaPredMode == PLANAR_IDX || ( getDimType( uiLumaPredMode ) == DMM1_IDX && !isDimDeltaDC( uiLumaPredMode ) ) );
-  AOF( uiLumaPredMode == DC_IDX || uiLumaPredMode == PLANAR_IDX || uiWidth < 64  );
-#endif
-  
-  //===== init availability pattern =====
-  Bool  bAboveAvail = false;
-  Bool  bLeftAvail  = false;
-#if QC_PKU_SDC_SPLIT_G0123
-  pcCU->getPattern()->initPattern   ( pcCU, sdcDepth, uiAbsPartIdx );
-  pcCU->getPattern()->initAdiPattern( pcCU, uiAbsPartIdx, sdcDepth, m_piYuvExt, m_iYuvExtStride, m_iYuvExtHeight, bAboveAvail, bLeftAvail );
-#else
-  pcCU->getPattern()->initPattern   ( pcCU, 0, uiAbsPartIdx );
-  pcCU->getPattern()->initAdiPattern( pcCU, uiAbsPartIdx, 0, m_piYuvExt, m_iYuvExtStride, m_iYuvExtHeight, bAboveAvail, bLeftAvail );
-  
-#endif
-#if !QC_PKU_SDC_SPLIT_G0123
-#if QC_GENERIC_SDC_G0122
-  TComWedgelet* dmm4Segmentation = new TComWedgelet( uiWidth, uiHeight );
-#endif
-#endif
-#if HS_TSINGHUA_SDC_SPLIT_G0111
-#if QC_GENERIC_SDC_G0122
-  TComWedgelet* dmm4Segmentation = new TComWedgelet( uiWidth, uiHeight );
-#endif
-#endif
-  //===== get prediction signal =====
-#if H_3D_DIM
-  if( isDimMode( uiLumaPredMode ) )
-  {
-#if HS_TSINGHUA_SDC_SPLIT_G0111  
-    UInt dimType   = getDimType  ( uiLumaPredMode );
-    UInt patternID = pcCU->getDmmWedgeTabIdx(dimType, uiAbsPartIdx);
-    if ( patternID >= g_dmmWedgeLists[g_aucConvertToBit[uiWidth]].size() && dimType == DMM1_IDX )
-    {
-      if (g_aucConvertToBit[uiWidth] == 2)  // Encoder method. Avoid DMM1 pattern list index exceeds the maximum DMM1 pattern number when SDC split is used.
-        patternID = 1349;  // Split 32x32 to 16x16. 1349: Maximum DMM1 pattern number when block size is 16x16
-      else 
-        patternID = patternID >> 1;  // Other cases
-      pcCU->setDmmWedgeTabIdx(dimType, uiAbsPartIdx, patternID);
-    }
-#endif
-    predIntraLumaDepth( pcCU, uiAbsPartIdx, uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight, true 
-#if QC_GENERIC_SDC_G0122
-      , dmm4Segmentation
-#endif
-      );
-#if HS_TSINGHUA_SDC_SPLIT_G0111
-    Bool* dmm4PatternSplit = dmm4Segmentation->getPattern();
-    Bool* dmm4PatternOrg = dmm4SegmentationOrg->getPattern();
-    for( UInt k = 0; k < (uiWidth*uiHeight); k++ ) 
-    { 
-      dmm4PatternOrg[k+(uiAbsPartIdx<<4)] = dmm4PatternSplit[k];
-    }
-#endif
-  }
-  else
-  {
-#endif
-    predIntraLumaAng( pcCU->getPattern(), uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight, bAboveAvail, bLeftAvail );
-#if H_3D_DIM
-  }
-#endif
-#if QC_PKU_SDC_SPLIT_G0123
+
+    //===== init availability pattern =====
+    Bool  bAboveAvail = false;
+    Bool  bLeftAvail  = false;
+    pcCU->getPattern()->initPattern   ( pcCU, sdcDepth, uiAbsPartIdx );
+    pcCU->getPattern()->initAdiPattern( pcCU, uiAbsPartIdx, sdcDepth, m_piYuvExt, m_iYuvExtStride, m_iYuvExtHeight, bAboveAvail, bLeftAvail );
+    TComWedgelet* dmm4Segmentation = new TComWedgelet( uiWidth, uiHeight );
+    //===== get prediction signal =====
+    if( isDimMode( uiLumaPredMode ) )
+    {
+      UInt dimType   = getDimType  ( uiLumaPredMode );
+      UInt patternID = pcCU->getDmmWedgeTabIdx(dimType, uiAbsPartIdx);
+      if ( patternID >= g_dmmWedgeLists[g_aucConvertToBit[uiWidth]].size() && dimType == DMM1_IDX )
+      {
+        if (g_aucConvertToBit[uiWidth] == 2) // Encoder method. Avoid DMM1 pattern list index exceeds the maximum DMM1 pattern number when SDC split is used.
+        {                                    
+          patternID = 1349;  // Split 32x32 to 16x16. 1349: Maximum DMM1 pattern number when block size is 16x16
+        }
+        else
+        {
+          patternID = patternID >> 1;  // Other cases
+        }
+        pcCU->setDmmWedgeTabIdx(dimType, uiAbsPartIdx, patternID);
+      }
+      predIntraLumaDepth( pcCU, uiAbsPartIdx, uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight, true , dmm4Segmentation    );
+      Bool* dmm4PatternSplit = dmm4Segmentation->getPattern();
+      Bool* dmm4PatternOrg = dmm4SegmentationOrg->getPattern();
+      for( UInt k = 0; k < (uiWidth*uiHeight); k++ ) 
+      { 
+        dmm4PatternOrg[k+(uiAbsPartIdx<<4)] = dmm4PatternSplit[k];
+      }
+    }
+    else
+    {
+      predIntraLumaAng( pcCU->getPattern(), uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight, bAboveAvail, bLeftAvail );
+    }
     if ( numParts > 1 )
     {
@@ -2031,7 +1947,5 @@
     }
     uiAbsPartIdx += ( ( uiWidth * uiWidth ) >> 4 );
-#if HS_TSINGHUA_SDC_SPLIT_G0111
     dmm4Segmentation->destroy(); delete dmm4Segmentation;
-#endif
   }
   uiAbsPartIdx = 0;
@@ -2040,5 +1954,5 @@
   piPred            = pcPredYuv->getLumaAddr( uiAbsPartIdx );
   piReco            = pcPredYuv->getLumaAddr( uiAbsPartIdx );
-  
+
   uiZOrder          = pcCU->getZorderIdxInCU() + uiAbsPartIdx;
   piRecIPred        = pcCU->getPic()->getPicYuvRec()->getLumaAddr( pcCU->getAddr(), uiZOrder );
@@ -2050,51 +1964,39 @@
     uiHeight = pcCU->getHeight( 0 );
   }
-#endif
   // number of segments depends on prediction mode
   UInt uiNumSegments = 1;
   Bool* pbMask = NULL;
   UInt uiMaskStride = 0;
-    
+
   if( getDimType( uiLumaPredMode ) == DMM1_IDX )
   {
     Int uiTabIdx = pcCU->getDmmWedgeTabIdx(DMM1_IDX, uiAbsPartIdx);
-    
+
     WedgeList* pacWedgeList = &g_dmmWedgeLists[(g_aucConvertToBit[uiWidth])];
     TComWedgelet* pcWedgelet = &(pacWedgeList->at( uiTabIdx ));
-    
+
     uiNumSegments = 2;
     pbMask = pcWedgelet->getPattern();
     uiMaskStride = pcWedgelet->getStride();
   }
-#if QC_GENERIC_SDC_G0122
   if( getDimType( uiLumaPredMode ) == DMM4_IDX )
   {
     uiNumSegments = 2;
-#if HS_TSINGHUA_SDC_SPLIT_G0111
-    pbMask  = dmm4SegmentationOrg->getPattern();
+    pbMask       = dmm4SegmentationOrg->getPattern();
     uiMaskStride = dmm4SegmentationOrg->getStride();
-#else
-    pbMask  = dmm4Segmentation->getPattern();
-    uiMaskStride = dmm4Segmentation->getStride();
-#endif
-  }
-#endif
-  
+  }
+
   // get DC prediction for each segment
   Pel apDCPredValues[2];
   analyzeSegmentsSDC(piPred, uiStride, uiWidth, apDCPredValues, uiNumSegments, pbMask, uiMaskStride, uiLumaPredMode );
-  
+
   // get original DC for each segment
   Pel apDCOrigValues[2];
   analyzeSegmentsSDC(piOrg, uiStride, uiWidth, apDCOrigValues, uiNumSegments, pbMask, uiMaskStride, uiLumaPredMode, true );
-  
+
   for( UInt uiSegment = 0; uiSegment < uiNumSegments; uiSegment++ )
   {
     // remap reconstructed value to valid depth values
-#if QC_GENERIC_SDC_G0122
     Pel pDCRec = ( !bZeroResidual ) ? apDCOrigValues[uiSegment] : apDCPredValues[uiSegment];
-#else
-    Pel pDCRec = bResidual?apDCOrigValues[uiSegment]:apDCPredValues[uiSegment];
-#endif
     // get residual (idx)
 #if H_3D_DIM_DLT
@@ -2103,5 +2005,4 @@
     Pel pResidualIdx = pDCRec - apDCPredValues[uiSegment];
 #endif
-#if QC_GENERIC_SDC_G0122
     if( !bZeroResidual )
     {
@@ -2113,9 +2014,8 @@
       }
     }
-#endif
     // save SDC DC offset
     pcCU->setSDCSegmentDCOffset(pResidualIdx, uiSegment, uiAbsPartIdx);
   }
-  
+
   // reconstruct residual based on mask + DC residuals
   Pel apDCResiValues[2];
@@ -2132,5 +2032,5 @@
 #endif
   }
-  
+
   //===== reconstruction =====
   Bool* pMask     = pbMask;
@@ -2138,5 +2038,5 @@
   Pel* pReco      = piReco;
   Pel* pRecIPred  = piRecIPred;
-  
+
   for( UInt uiY = 0; uiY < uiHeight; uiY++ )
   {
@@ -2147,5 +2047,5 @@
 
       Pel pResiDC = apDCResiValues[ucSegment];
-      
+
       pReco    [ uiX ] = ClipY( pPred[ uiX ] + pResiDC );
       pRecIPred[ uiX ] = pReco[ uiX ];
@@ -2156,10 +2056,10 @@
     pMask     += uiMaskStride;
   }
-  
+
   // clear UV
   UInt  uiStrideC     = pcPredYuv->getCStride();
   Pel   *pRecCb       = pcPredYuv->getCbAddr();
   Pel   *pRecCr       = pcPredYuv->getCrAddr();
-  
+
   for (Int y=0; y<uiHeight/2; y++)
   {
@@ -2169,9 +2069,9 @@
       pRecCr[x] = 128;
     }
-    
+
     pRecCb += uiStrideC;
     pRecCr += uiStrideC;
   }
-  
+
   //===== determine distortion =====
 #if H_3D_VSO
@@ -2181,10 +2081,9 @@
 #endif
     ruiDist = m_pcRdCost->getDistPart(g_bitDepthY, piReco, uiStride, piOrg, uiStride, uiWidth, uiHeight );
-  
+
   //===== determine rate and r-d cost =====
   m_pcEntropyCoder->resetBits();
-  
+
   // encode reduced intra header
-#if QC_SDC_UNIFY_G0130
   if( !pcCU->getSlice()->isIntra() )
   {
@@ -2197,22 +2096,13 @@
   }
 
-#if QC_SDC_UNIFY_G0130_FIX2
   m_pcEntropyCoder->encodePartSize( pcCU, 0, pcCU->getDepth( 0 ), true );
-#else
-  m_pcEntropyCoder->encodePartSize( pcCU, 0, true );
-#endif
   m_pcEntropyCoder->encodeSDCFlag( pcCU, 0, true );
-#else
-  m_pcEntropyCoder->encodePredMode( pcCU, 0, true );
-#endif
-  
+
   // encode pred direction + DC residual data
   m_pcEntropyCoder->encodePredInfo( pcCU, 0, true );
-#if QC_SDC_UNIFY_G0130
   Bool bDummy = false;
   m_pcEntropyCoder->encodeCoeff( pcCU, 0, pcCU->getDepth( 0 ), uiWidth, uiHeight, bDummy );
-#endif
   UInt uiBits = m_pcEntropyCoder->getNumberOfWrittenBits();
-  
+
 #if H_3D_VSO
   if ( m_pcRdCost->getUseLambdaScaleVSO())
@@ -2221,11 +2111,5 @@
 #endif
     dRDCost = m_pcRdCost->calcRdCost( uiBits, ruiDist );
-#if QC_GENERIC_SDC_G0122
-#if HS_TSINGHUA_SDC_SPLIT_G0111
   dmm4SegmentationOrg->destroy(); delete dmm4SegmentationOrg;
-#else
-  dmm4Segmentation->destroy(); delete dmm4Segmentation;
-#endif
-#endif
 }
 #endif
@@ -3093,7 +2977,4 @@
           case( DMM4_IDX ):
             {
-#if !QC_GENERIC_SDC_G0122
-              if( uiWidth > 4 )
-#endif
               {
                 biSegmentation = new TComWedgelet( uiWidth, uiHeight );
@@ -3151,5 +3032,4 @@
       {
         pcCU->setSDCFlagSubParts( (uiSDC != 0), uiPartOffset, uiDepth + uiInitTrDepth );
-#if QC_GENERIC_SDC_G0122
         for( Int iSDCDeltaResi = -2; iSDCDeltaResi <= 2; iSDCDeltaResi++ )
         {
@@ -3158,5 +3038,4 @@
             continue;
           }
-#endif
 #endif
       
@@ -3169,10 +3048,8 @@
       bTestZeroResi |= pcCU->getSDCFlag(uiPartOffset);
 #endif
-#if QC_GENERIC_SDC_G0122
       if( uiSDC != 0 && iSDCDeltaResi != 0 )
       {
         bTestZeroResi = false;
       }
-#endif
 #endif
       
@@ -3205,9 +3082,5 @@
 
           // start encoding with SDC
-#if QC_GENERIC_SDC_G0122
           xIntraCodingSDC(pcCU, uiPartOffset, pcOrgYuv, pcPredYuv, uiPUDistY, dPUCost, ( testZeroResi != 0 ), iSDCDeltaResi );
-#else
-          xIntraCodingSDC(pcCU, uiPartOffset, pcOrgYuv, pcPredYuv, uiPUDistY, dPUCost, (testZeroResi!=0));
-#endif
         }
         else
@@ -3282,6 +3155,4 @@
 #if H_3D_DIM_ENC || H_3D_DIM_SDC
       }
-#endif
-#if QC_GENERIC_SDC_G0122
         } // SDC residual loop
 #endif
@@ -3885,34 +3756,34 @@
   for( UInt uiMergeCand = 0; uiMergeCand < numValidMergeCand; ++uiMergeCand )
   {
-      UInt uiCostCand = MAX_UINT;
-      UInt uiBitsCand = 0;
-      
-      PartSize ePartSize = pcCU->getPartitionSize( 0 );
-      
-#if H_3D_VSP && NTT_STORE_SPDV_VSP_G0148
-      pcCU->setVSPFlagSubParts( vspFlag[uiMergeCand], uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) );
-      pcCU->setDvInfoSubParts(inheritedVSPDisInfo[uiMergeCand].m_acDvInfo, uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) );
+    UInt uiCostCand = MAX_UINT;
+    UInt uiBitsCand = 0;
+
+    PartSize ePartSize = pcCU->getPartitionSize( 0 );
+
+#if H_3D_VSP
+    pcCU->setVSPFlagSubParts( vspFlag[uiMergeCand], uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) );
+    pcCU->setDvInfoSubParts(inheritedVSPDisInfo[uiMergeCand].m_acDvInfo, uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) );
 #endif
 
 #if H_3D_SPIVMP
-      pcCU->setSPIVMPFlagSubParts( pbSPIVMPFlag[uiMergeCand], uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx )); 
-      if (pbSPIVMPFlag[uiMergeCand])
-      {
-        UInt uiSPAddr;
-
-        Int iNumSPInOneLine, iNumSP, iSPWidth, iSPHeight;
-
-        pcCU->getSPPara(iWidth, iHeight, iNumSP, iNumSPInOneLine, iSPWidth, iSPHeight);
-
-        for (Int iPartitionIdx = 0; iPartitionIdx < iNumSP; iPartitionIdx++)
-        {
-          pcCU->getSPAbsPartIdx(uiAbsPartIdx, iSPWidth, iSPHeight, iPartitionIdx, iNumSPInOneLine, uiSPAddr);
-          pcCU->getCUMvField( REF_PIC_LIST_0 )->setMvFieldSP(pcCU, uiSPAddr, pcMvFieldSP[2*iPartitionIdx], iSPWidth, iSPHeight);
-          pcCU->getCUMvField( REF_PIC_LIST_1 )->setMvFieldSP(pcCU, uiSPAddr, pcMvFieldSP[2*iPartitionIdx + 1], iSPWidth, iSPHeight);
-        }
-      }
-      else
-#endif
-#if NTT_STORE_SPDV_VSP_G0148
+    pcCU->setSPIVMPFlagSubParts( pbSPIVMPFlag[uiMergeCand], uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx )); 
+    if (pbSPIVMPFlag[uiMergeCand])
+    {
+      UInt uiSPAddr;
+
+      Int iNumSPInOneLine, iNumSP, iSPWidth, iSPHeight;
+
+      pcCU->getSPPara(iWidth, iHeight, iNumSP, iNumSPInOneLine, iSPWidth, iSPHeight);
+
+      for (Int iPartitionIdx = 0; iPartitionIdx < iNumSP; iPartitionIdx++)
+      {
+        pcCU->getSPAbsPartIdx(uiAbsPartIdx, iSPWidth, iSPHeight, iPartitionIdx, iNumSPInOneLine, uiSPAddr);
+        pcCU->getCUMvField( REF_PIC_LIST_0 )->setMvFieldSP(pcCU, uiSPAddr, pcMvFieldSP[2*iPartitionIdx], iSPWidth, iSPHeight);
+        pcCU->getCUMvField( REF_PIC_LIST_1 )->setMvFieldSP(pcCU, uiSPAddr, pcMvFieldSP[2*iPartitionIdx + 1], iSPWidth, iSPHeight);
+      }
+    }
+    else
+#endif
+#if H_3D_VSP
 #if H_3D_DBBP
       if ( vspFlag[uiMergeCand] && !pcCU->getDBBPFlag(0) )
@@ -3950,22 +3821,17 @@
         pcCU->getCUMvField(REF_PIC_LIST_0)->setAllMvField( cMvFieldNeighbours[0 + 2*uiMergeCand], ePartSize, uiAbsPartIdx, 0, iPUIdx );
         pcCU->getCUMvField(REF_PIC_LIST_1)->setAllMvField( cMvFieldNeighbours[1 + 2*uiMergeCand], ePartSize, uiAbsPartIdx, 0, iPUIdx );
-
-#if NTT_STORE_SPDV_VSP_G0148
-      }
-#endif
-#if H_3D_VSP && !NTT_STORE_SPDV_VSP_G0148
-      pcCU->setVSPFlagSubParts( vspFlag[uiMergeCand], uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) );
-      pcCU->setDvInfoSubParts(inheritedVSPDisInfo[uiMergeCand].m_acDvInfo, uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) );
-#endif
-
-#if MTK_DDD_G0063
+#if H_3D_VSP
+      }
+#endif
+
+#if H_3D_DDD
       if( uiMergeCand == pcCU->getUseDDDCandIdx() )
       {
-          pcCU->setUseDDD( true, uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) );
-          pcCU->setDDDepthSubParts( pcCU->getDDTmpDepth(), uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) );
+        pcCU->setUseDDD( true, uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) );
+        pcCU->setDDDepthSubParts( pcCU->getDDTmpDepth(), uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) );
       }
       else
       {
-          pcCU->setUseDDD( false, uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) );
+        pcCU->setUseDDD( false, uiAbsPartIdx, iPUIdx, pcCU->getDepth( uiAbsPartIdx ) );
       }
 #endif
@@ -3975,5 +3841,5 @@
       if (uiMergeCand == m_pcEncCfg->getMaxNumMergeCand() -1)
       {
-         uiBitsCand--;
+        uiBitsCand--;
       }
       uiCostCand = uiCostCand + m_pcRdCost->getCost( uiBitsCand );
@@ -3986,5 +3852,5 @@
         uiMergeIndex = uiMergeCand;
       }
-    }
+  }
   }
 
@@ -4577,10 +4443,10 @@
     {
       uiLastMode = 1;
-          pcCU->getCUMvField(REF_PIC_LIST_1)->setAllMv( cMv[1], ePartSize, uiPartAddr, 0, iPartIdx );
-          pcCU->getCUMvField(REF_PIC_LIST_1)->setAllRefIdx( iRefIdx[1], ePartSize, uiPartAddr, 0, iPartIdx );
-        TempMv = cMv[1] - cMvPred[1][iRefIdx[1]];
-            pcCU->getCUMvField(REF_PIC_LIST_1)->setAllMvd    ( TempMv,                 ePartSize, uiPartAddr, 0, iPartIdx );
+      pcCU->getCUMvField(REF_PIC_LIST_1)->setAllMv( cMv[1], ePartSize, uiPartAddr, 0, iPartIdx );
+      pcCU->getCUMvField(REF_PIC_LIST_1)->setAllRefIdx( iRefIdx[1], ePartSize, uiPartAddr, 0, iPartIdx );
+      TempMv = cMv[1] - cMvPred[1][iRefIdx[1]];
+      pcCU->getCUMvField(REF_PIC_LIST_1)->setAllMvd    ( TempMv,                 ePartSize, uiPartAddr, 0, iPartIdx );
       pcCU->setInterDirSubParts( 2, uiPartAddr, iPartIdx, pcCU->getDepth(0) );
-      
+
       pcCU->setMVPIdxSubParts( aaiMvpIdx[1][iRefIdx[1]], REF_PIC_LIST_1, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr));
       pcCU->setMVPNumSubParts( aaiMvpNum[1][iRefIdx[1]], REF_PIC_LIST_1, uiPartAddr, iPartIdx, pcCU->getDepth(uiPartAddr));
@@ -4667,5 +4533,5 @@
         pcCU->setDvInfoSubParts(inheritedVSPDisInfo[uiMRGIndex].m_acDvInfo, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) );
 #endif
-#if MTK_DDD_G0063
+#if H_3D_DDD
         if( uiMRGIndex == pcCU->getUseDDDCandIdx() )
         {
@@ -4703,5 +4569,5 @@
         else
 #endif
-#if NTT_STORE_SPDV_VSP_G0148
+#if H_3D_VSP
 #if H_3D_DBBP
         if ( vspFlag[uiMRGIndex] && !pcCU->getDBBPFlag(uiPartAddr) )
@@ -4735,12 +4601,10 @@
         }
         else
-#if H_3D_FIX_G0148_BRACE
           {
-#endif
 #endif
           pcCU->setInterDirSubParts  ( uiMRGInterDir, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) );
             pcCU->getCUMvField( REF_PIC_LIST_0 )->setAllMvField( cMRGMvField[0], ePartSize, uiPartAddr, 0, iPartIdx );
             pcCU->getCUMvField( REF_PIC_LIST_1 )->setAllMvField( cMRGMvField[1], ePartSize, uiPartAddr, 0, iPartIdx );
-#if H_3D_FIX_G0148_BRACE
+#if H_3D
           }
 #endif
@@ -4758,5 +4622,5 @@
         pcCU->setSPIVMPFlagSubParts(0, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) ); 
 #endif
-#if MTK_DDD_G0063
+#if H_3D_DDD
         pcCU->setUseDDD( false, uiPartAddr, iPartIdx, pcCU->getDepth( uiPartAddr ) );
 #endif
@@ -5616,16 +5480,9 @@
     m_pcEntropyCoder->encodeSkipFlag(pcCU, 0, true);
     m_pcEntropyCoder->encodeMergeIndex( pcCU, 0, true );
-#if !SEC_IC_ARP_SIG_G0072
+#if H_3D_ARP
+    m_pcEntropyCoder->encodeARPW( pcCU, 0 );
+#endif
 #if H_3D_IC
     m_pcEntropyCoder->encodeICFlag( pcCU, 0, true );
-#endif
-#endif
-#if H_3D_ARP
-    m_pcEntropyCoder->encodeARPW( pcCU, 0 );
-#endif
-#if SEC_IC_ARP_SIG_G0072
-#if H_3D_IC
-    m_pcEntropyCoder->encodeICFlag( pcCU, 0, true );
-#endif
 #endif
     uiBits = m_pcEntropyCoder->getNumberOfWrittenBits();
@@ -5882,9 +5739,5 @@
 
 #if H_3D_INTER_SDC
-#if SEC_INTER_SDC_G0101
 Void TEncSearch::encodeResAndCalcRdInterSDCCU( TComDataCU* pcCU, TComYuv* pcOrg, TComYuv* pcPred, TComYuv* pcResi, TComYuv* pcRec, Int uiOffest, const UInt uiDepth )
-#else
-Void TEncSearch::encodeResAndCalcRdInterSDCCU( TComDataCU* pcCU, TComYuv* pcOrg, TComYuv* pcPred, TComYuv* pcResi, TComYuv* pcRec, const UInt uiDepth )
-#endif
 {
   if( !pcCU->getSlice()->getIsDepth() || pcCU->isIntra( 0 ) )
@@ -5892,38 +5745,18 @@
     return;
   }
-#if QC_SDC_UNIFY_G0130
   pcCU->setSDCFlagSubParts( true, 0, uiDepth );
-#else
-  pcCU->setInterSDCFlagSubParts( true, 0, 0, uiDepth );
-#endif
-
-  UInt  uiWidth      = pcCU->getWidth ( 0 );
-  UInt  uiHeight     = pcCU->getHeight( 0 );
-#if SEC_INTER_SDC_G0101
-  UInt uiSegSize = 0;
-#else
-  UChar* pMask       = pcCU->getInterSDCMask();
-  memset( pMask, 0, uiWidth*uiHeight );
-
-  pcCU->xSetInterSDCCUMask( pcCU, pMask );
-
-  UInt uiSegSize[4] = { 0, 0, 0, 0 };
-#endif
+
+  UInt  uiWidth   = pcCU->getWidth ( 0 );
+  UInt  uiHeight  = pcCU->getHeight( 0 );
+  UInt  uiSegSize = 0;
+
   Pel *pPred, *pOrg;
   UInt uiPredStride = pcPred->getStride();
   UInt uiOrgStride  = pcOrg->getStride();
   UInt uiPelX, uiPelY;
-#if !SEC_INTER_SDC_G0101
-  UInt uiPartitionSize = pcCU->getPartitionSize( 0 );
-  UInt uiSegmentNum = ( uiPartitionSize == SIZE_2Nx2N ) ? 1 : ( uiPartitionSize == SIZE_NxN ? 4 : 2 );
-#endif
 
   pPred = pcPred->getLumaAddr( 0 );
   pOrg  = pcOrg->getLumaAddr( 0 );
-#if SEC_INTER_SDC_G0101
   Int pResDC = 0;
-#else
-  Int pResDC[4] = { 0, 0, 0, 0};
-#endif
 
   //calculate dc value for prediction and original signal, and calculate residual and reconstruction
@@ -5932,12 +5765,6 @@
     for( uiPelX = 0; uiPelX < uiWidth; uiPelX++ )
     {
-#if SEC_INTER_SDC_G0101
       pResDC += (Int)( pOrg [uiPelX] - pPred[uiPelX] );
       uiSegSize++;
-#else
-      UChar uiSeg = pMask[ uiPelX + uiPelY*uiWidth ];
-      pResDC[uiSeg] += (Int)( pOrg [uiPelX] - pPred[uiPelX] );
-      uiSegSize[uiSeg]++;
-#endif
     }
     pOrg  += uiOrgStride;
@@ -5945,21 +5772,9 @@
   }
 
-#if SEC_INTER_SDC_G0101
   Int iResiOffset = ( pResDC  > 0 ? ( uiSegSize >> 1 ) : -1*( uiSegSize >> 1 ) );
   pResDC          = ( pResDC + iResiOffset ) / (Int) uiSegSize;
 
   pcCU->setSDCSegmentDCOffset( pResDC + uiOffest, 0, 0 );
-#else
-  for( UInt uiSeg = 0; uiSeg < uiSegmentNum; uiSeg++ )
-  {
-    Int iResiOffset = ( pResDC [uiSeg] > 0 ? ( uiSegSize[uiSeg] >> 1 ) : -1*( uiSegSize[uiSeg] >> 1 ) );
-    pResDC [uiSeg]  = ( pResDC [uiSeg] + iResiOffset ) / (Int) uiSegSize[uiSeg];
-#if QC_SDC_UNIFY_G0130
-    pcCU->setSDCSegmentDCOffset( pResDC[uiSeg], uiSeg, 0 );
-#else
-    pcCU->setInterSDCSegmentDCOffset( pResDC[uiSeg], uiSeg, 0 );
-#endif
-  }
-#endif
+
 
   Pel *pRec;
@@ -5972,12 +5787,5 @@
     for( uiPelX = 0; uiPelX < uiWidth; uiPelX++ )
     {
-#if SEC_INTER_SDC_G0101
       pRec[ uiPelX ] = Clip3( 0, ( 1 << g_bitDepthY ) - 1, pPred[uiPelX] + pcCU->getSDCSegmentDCOffset(0, 0) );
-#else
-      UChar uiSeg = pMask[ uiPelX + uiPelY*uiWidth ];
-      assert( uiSeg < uiSegmentNum );
-
-      pRec[ uiPelX ] = Clip3( 0, ( 1 << g_bitDepthY ) - 1, pPred[uiPelX] + pResDC[uiSeg] );
-#endif
     }
     pPred     += uiPredStride;
@@ -6019,22 +5827,10 @@
 #endif
 
-#if QC_SDC_UNIFY_G0130
+#if H_3D_DIM_SDC
   Bool bNonSkip = false;
 #else
   Bool bNonSkip = true;
 #endif
-#if SEC_INTER_SDC_G0101
   bNonSkip |= ( pcCU->getSDCSegmentDCOffset( 0, 0 ) != 0 ) ? 1 : 0;
-#else
-  for( UInt uiSeg = 0; uiSeg < uiSegmentNum; uiSeg++ )
-  {
-#if QC_SDC_UNIFY_G0130
-    bNonSkip |= ( pcCU->getSDCSegmentDCOffset( uiSeg, 0 ) != 0 ) ? 1 : 0;
-#else
-    bNonSkip &= ( pcCU->getInterSDCSegmentDCOffset( uiSeg, 0 ) != 0 ) ? 1 : 0;
-#endif
-  }
-#endif
-
   if( !bNonSkip )
   {
@@ -7176,16 +6972,9 @@
     m_pcEntropyCoder->encodeSkipFlag(pcCU, 0, true);
     m_pcEntropyCoder->encodeMergeIndex(pcCU, 0, true);
-#if !SEC_IC_ARP_SIG_G0072
+#if H_3D_ARP
+    m_pcEntropyCoder->encodeARPW( pcCU, 0 );
+#endif
 #if H_3D_IC
     m_pcEntropyCoder->encodeICFlag( pcCU, 0, true );
-#endif
-#endif
-#if H_3D_ARP
-    m_pcEntropyCoder->encodeARPW( pcCU, 0 );
-#endif
-#if SEC_IC_ARP_SIG_G0072
-#if H_3D_IC
-    m_pcEntropyCoder->encodeICFlag( pcCU, 0, true );
-#endif
 #endif
     ruiBits += m_pcEntropyCoder->getNumberOfWrittenBits();
@@ -7201,23 +6990,13 @@
     m_pcEntropyCoder->encodePredMode( pcCU, 0, true );
     m_pcEntropyCoder->encodePartSize( pcCU, 0, pcCU->getDepth(0), true );
-#if QC_SDC_UNIFY_G0130
+#if H_3D_DIM_SDC
     m_pcEntropyCoder->encodeSDCFlag( pcCU, 0, true );
 #endif
     m_pcEntropyCoder->encodePredInfo( pcCU, 0, true );
-#if !SEC_IC_ARP_SIG_G0072
+#if H_3D_ARP
+    m_pcEntropyCoder->encodeARPW( pcCU , 0 );
+#endif
 #if H_3D_IC
     m_pcEntropyCoder->encodeICFlag( pcCU, 0, true );
-#endif
-#endif
-#if H_3D_ARP
-    m_pcEntropyCoder->encodeARPW( pcCU , 0 );
-#endif
-#if SEC_IC_ARP_SIG_G0072
-#if H_3D_IC
-    m_pcEntropyCoder->encodeICFlag( pcCU, 0, true );
-#endif
-#endif
-#if H_3D_INTER_SDC && !QC_SDC_UNIFY_G0130
-    m_pcEntropyCoder->encodeInterSDCFlag( pcCU, 0, true );
 #endif
     Bool bDummy = false;
Index: /trunk/source/Lib/TLibEncoder/TEncSearch.h
===================================================================
--- /trunk/source/Lib/TLibEncoder/TEncSearch.h	(revision 883)
+++ /trunk/source/Lib/TLibEncoder/TEncSearch.h	(revision 884)
@@ -218,7 +218,5 @@
     TComYuv* pcResi, 
     TComYuv* pcRec, 
-#if SEC_INTER_SDC_G0101
     Int      uiOffset,
-#endif
     const UInt uiDepth );
 #endif
@@ -355,11 +353,5 @@
 #endif
 #if H_3D_DIM_SDC
-  Void xIntraCodingSDC            ( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, 
-#if QC_GENERIC_SDC_G0122
-    Bool bZeroResidual, Int iSDCDeltaResi
-#else
-    Bool bResidual
-#endif
-    );
+  Void xIntraCodingSDC            ( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, Bool bZeroResidual, Int iSDCDeltaResi    );
 #endif
 #endif
Index: /trunk/source/Lib/TLibEncoder/TEncSlice.h
===================================================================
--- /trunk/source/Lib/TLibEncoder/TEncSlice.h	(revision 883)
+++ /trunk/source/Lib/TLibEncoder/TEncSlice.h	(revision 884)
@@ -107,5 +107,5 @@
   UInt                    m_uiSliceIdx;
   std::vector<TEncSbac*> CTXMem;
-#if MTK_DDD_G0063
+#if H_3D_DDD
   Int          m_iDDDScale;
   Int          m_iDDDOffset;
@@ -146,5 +146,5 @@
   Void      setCtxMem( TEncSbac* sb, Int b )   { CTXMem[b] = sb; }
 
-#if MTK_DDD_G0063
+#if H_3D_DDD
   Void setDDDPar( Int iScale, Int iOffset, UInt uiPrecision ){ m_iDDDScale = iScale; m_iDDDOffset = iOffset; m_uiDDDPrecision = uiPrecision; }
 #endif
Index: /trunk/source/Lib/TLibEncoder/TEncTop.cpp
===================================================================
--- /trunk/source/Lib/TLibEncoder/TEncTop.cpp	(revision 883)
+++ /trunk/source/Lib/TLibEncoder/TEncTop.cpp	(revision 884)
@@ -667,6 +667,4 @@
   m_cSPS.setSPSId( getLayerIdInVps() );
   m_cSPS.setLayerId( getLayerId() );
-#endif
-#if H_MV_HLS_7_VPS_P0048_14
  // Code below needs to be moved to VPS
 #endif
@@ -832,11 +830,7 @@
   m_cPPS.setSPSId( getLayerIdInVps() );
 
-#if H_MV_HLS_7_GEN_P0166_PPS_EXTENSION
-#if H_MV  
   m_cPPS.setPpsExtensionTypeFlag          ( PPS_EX_T_MV ,true ); 
 #if H_3D
   m_cPPS.setPpsExtensionTypeFlag          ( PPS_EX_T_3D ,true ); 
-#endif
-#endif
 #endif
 #endif
