Index: branches/HTM-10.1-dev0/source/Lib/TLibCommon/ContextTables.h
===================================================================
--- branches/HTM-10.1-dev0/source/Lib/TLibCommon/ContextTables.h	(revision 875)
+++ branches/HTM-10.1-dev0/source/Lib/TLibCommon/ContextTables.h	(revision 876)
@@ -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
 
@@ -366,5 +358,4 @@
 
 #if H_3D_ARP
-#if MTK_ARP_FLAG_CABAC_SIMP_G0061
 static const UChar 
 INIT_ARPW[3][NUM_ARPW_CTX] = 
@@ -374,16 +365,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,13 +375,5 @@
     { 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
Index: branches/HTM-10.1-dev0/source/Lib/TLibCommon/TComDataCU.cpp
===================================================================
--- branches/HTM-10.1-dev0/source/Lib/TLibCommon/TComDataCU.cpp	(revision 875)
+++ branches/HTM-10.1-dev0/source/Lib/TLibCommon/TComDataCU.cpp	(revision 876)
@@ -2463,30 +2463,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
@@ -3582,10 +3558,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 +3566,5 @@
   Int refViewIdx = pDInfo->m_aVIdxCan;
   TComPic* picDepth = getSlice()->getIvPic( true, refViewIdx );
-  
+
   if( picDepth == NULL ) // No depth reference avail
   {
@@ -3602,5 +3574,5 @@
 
   rightShiftMergeCandList( pcMvFieldNeighbours, puhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, iCount, (5-iCount), iCount3DV);
-  
+
   Bool  refViewAvailFlag = false;
   UChar predFlag[2]      = {0, 0};
@@ -3609,5 +3581,5 @@
   Int   viewIdInRefListX = -1;
 #endif
-  
+
   for( Int iRefListIdX = 0; iRefListIdX < 2 && !refViewAvailFlag; iRefListIdX++ )
   {
@@ -3645,13 +3617,13 @@
         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() ) 
@@ -4449,5 +4421,4 @@
   if( bMPIFlag)
   {
-#if QC_SPIVMP_MPI_G0119
     tmpMV[0].setMvField( cZeroMv, NOT_VALID );
     tmpMV[1].setMvField( cZeroMv, NOT_VALID );
@@ -4556,147 +4527,73 @@
     }
 #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(), tRef[0]);
-        }
-        if ( getSlice()->isInterB())
-        {
-          if( (tmpMV[1].getRefIdx()>=0) && ( tRef[1] >= 0) )
-          {
-            pcMvFieldNeighbours[(iCount<<1)+1].setMvField(tmpMV[1].getMv(), tRef[1]);
-          }
-        }
-#endif
-        puhInterDirNeighbours[iCount] = tmpDir;
-
-        if ( mrgCandIdx == iCount )
-        {
-          return;
-        }
-        iCount ++;
-      }
-#if !QC_SPIVMP_MPI_G0119
-    }
-#endif
+      }
+      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 MTK_DDD_G0063
@@ -4836,9 +4733,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 +4741,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] )
   {
@@ -4961,13 +4853,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;
@@ -5111,9 +4998,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 +5159,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 +6524,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 +6537,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 +6553,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 +7075,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 +7136,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 +7160,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 +7173,88 @@
   //////////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( 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;
 #if !KHU_SIMP_SPIVMP_G0147
-  Int iInterDirLast = 0;
-  TComMvField cMvFieldLast[2];
-#endif
-
-  Int iDelX = iSPWidth/2;
-  Int iDelY = iSPHeight/2;
+      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++ )
+      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 +7265,118 @@
         }
       }
-
-      puhInterDirSP[iPartition] = (pcMvFieldSP[2*iPartition].getRefIdx()!=-1 ? 1: 0) + (pcMvFieldSP[2*iPartition+1].getRefIdx()!=-1 ? 2: 0);
-      if (puhInterDirSP[iPartition] == 0)
-      {
+      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++ )
+              {
+                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)
+            {
 #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]);
+              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)
-        {
-          puhInterDirSP[iPartition] = iInterDirLast;
-          pcMvFieldSP[2*iPartition] = cMvFieldLast[0];
-          pcMvFieldSP[2*iPartition + 1] = cMvFieldLast[1];
-        }
-#endif
-      }
+              if (iInterDirLast != 0)
+              {
+                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 iPart = iPartition-1; iPart >= 0; iPart--)
+            else
             {
-              puhInterDirSP[iPart] = puhInterDirSP[iPartition];
-              pcMvFieldSP[2*iPart] = pcMvFieldSP[2*iPartition];
-              pcMvFieldSP[2*iPart + 1] = pcMvFieldSP[2*iPartition + 1];
+              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 iPart = iPartition-1; iPart >= 0; iPart--)
+                  {
+                    puhInterDirSP[iPart] = puhInterDirSP[iPartition];
+                    pcMvFieldSP[2*iPart] = pcMvFieldSP[2*iPartition];
+                    pcMvFieldSP[2*iPart + 1] = pcMvFieldSP[2*iPartition + 1];
+                  }
+                }
+              }
+              iInterDirLast = puhInterDirSP[iPartition];
+              cMvFieldLast[0] = pcMvFieldSP[2*iPartition];
+              cMvFieldLast[1] = pcMvFieldSP[2*iPartition + 1];
             }
+#endif
+            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
+      }
+#endif
+    }
+
+    iCurrPosX  += ( iWidth  >> 1 );
+    iCurrPosY  += ( iHeight >> 1 );
+  }
 #endif
 
@@ -7568,31 +7386,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 +7399,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 +7463,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 +7470,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;
 }
Index: branches/HTM-10.1-dev0/source/Lib/TLibCommon/TComDataCU.h
===================================================================
--- branches/HTM-10.1-dev0/source/Lib/TLibCommon/TComDataCU.h	(revision 875)
+++ branches/HTM-10.1-dev0/source/Lib/TLibCommon/TComDataCU.h	(revision 876)
@@ -499,9 +499,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
@@ -743,9 +739,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];                                                                                   }
Index: branches/HTM-10.1-dev0/source/Lib/TLibCommon/TComRdCost.cpp
===================================================================
--- branches/HTM-10.1-dev0/source/Lib/TLibCommon/TComRdCost.cpp	(revision 875)
+++ branches/HTM-10.1-dev0/source/Lib/TLibCommon/TComRdCost.cpp	(revision 876)
@@ -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: branches/HTM-10.1-dev0/source/Lib/TLibCommon/TComSlice.cpp
===================================================================
--- branches/HTM-10.1-dev0/source/Lib/TLibCommon/TComSlice.cpp	(revision 875)
+++ branches/HTM-10.1-dev0/source/Lib/TLibCommon/TComSlice.cpp	(revision 876)
@@ -3207,13 +3207,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 +3218,9 @@
             idx=i;
           }
-#else
-          setFirstTRefIdx (RefPicList(refListIdx), i);
-          break;
-#endif
         }
-#if MTK_ARP_REF_SELECTION_G0053
         if(idx>=0)
         {
           setFirstTRefIdx (RefPicList(refListIdx), idx);
         }
-#endif
       }
     }
Index: branches/HTM-10.1-dev0/source/Lib/TLibCommon/TComSlice.h
===================================================================
--- branches/HTM-10.1-dev0/source/Lib/TLibCommon/TComSlice.h	(revision 875)
+++ branches/HTM-10.1-dev0/source/Lib/TLibCommon/TComSlice.h	(revision 876)
@@ -869,8 +869,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
@@ -1248,9 +1246,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
Index: branches/HTM-10.1-dev0/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- branches/HTM-10.1-dev0/source/Lib/TLibCommon/TypeDef.h	(revision 875)
+++ branches/HTM-10.1-dev0/source/Lib/TLibCommon/TypeDef.h	(revision 876)
@@ -83,4 +83,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 +103,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 +113,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
@@ -145,4 +151,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
@@ -177,4 +187,6 @@
                                               // LGE_INTER_SDC_E0156  Enable inter SDC for depth coding
 #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
 #define H_3D_FCO                          0   // Flexible coding order for 3D
 
@@ -279,5 +291,5 @@
 
 #define MTK_DDD_G0063                     1   // Disparity derived depth coding
-#define HTM10RC1_FIX                           1   // Fix of DDD
+#define HTM10RC1_FIX                      1   // Fix of DDD
 
 
@@ -311,17 +323,4 @@
 #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
 
Index: branches/HTM-10.1-dev0/source/Lib/TLibDecoder/TDecCAVLC.cpp
===================================================================
--- branches/HTM-10.1-dev0/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 875)
+++ branches/HTM-10.1-dev0/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 876)
@@ -1933,9 +1933,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 +1961,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
@@ -2013,7 +2005,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 ); 
 }
Index: branches/HTM-10.1-dev0/source/Lib/TLibDecoder/TDecCu.cpp
===================================================================
--- branches/HTM-10.1-dev0/source/Lib/TLibDecoder/TDecCu.cpp	(revision 875)
+++ branches/HTM-10.1-dev0/source/Lib/TLibDecoder/TDecCu.cpp	(revision 876)
@@ -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
 
Index: branches/HTM-10.1-dev0/source/Lib/TLibDecoder/TDecEntropy.cpp
===================================================================
--- branches/HTM-10.1-dev0/source/Lib/TLibDecoder/TDecEntropy.cpp	(revision 875)
+++ branches/HTM-10.1-dev0/source/Lib/TLibDecoder/TDecEntropy.cpp	(revision 876)
@@ -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
@@ -440,16 +429,9 @@
         }
       }
-#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
     }
Index: branches/HTM-10.1-dev0/source/Lib/TLibDecoder/TDecSbac.cpp
===================================================================
--- branches/HTM-10.1-dev0/source/Lib/TLibDecoder/TDecSbac.cpp	(revision 875)
+++ branches/HTM-10.1-dev0/source/Lib/TLibDecoder/TDecSbac.cpp	(revision 876)
@@ -2189,9 +2189,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 +2209,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++ );
Index: branches/HTM-10.1-dev0/source/Lib/TLibEncoder/TEncCavlc.cpp
===================================================================
--- branches/HTM-10.1-dev0/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 875)
+++ branches/HTM-10.1-dev0/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 876)
@@ -1705,9 +1705,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 +1730,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 +1763,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" );
Index: branches/HTM-10.1-dev0/source/Lib/TLibEncoder/TEncCfg.h
===================================================================
--- branches/HTM-10.1-dev0/source/Lib/TLibEncoder/TEncCfg.h	(revision 875)
+++ branches/HTM-10.1-dev0/source/Lib/TLibEncoder/TEncCfg.h	(revision 876)
@@ -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;   }     
Index: branches/HTM-10.1-dev0/source/Lib/TLibEncoder/TEncCu.cpp
===================================================================
--- branches/HTM-10.1-dev0/source/Lib/TLibEncoder/TEncCu.cpp	(revision 875)
+++ branches/HTM-10.1-dev0/source/Lib/TLibEncoder/TEncCu.cpp	(revision 876)
@@ -582,9 +582,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,16 +1529,9 @@
 #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);
@@ -1570,16 +1559,10 @@
   // 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
@@ -1809,9 +1792,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;
@@ -2157,9 +2136,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;
Index: branches/HTM-10.1-dev0/source/Lib/TLibEncoder/TEncEntropy.cpp
===================================================================
--- branches/HTM-10.1-dev0/source/Lib/TLibEncoder/TEncEntropy.cpp	(revision 875)
+++ branches/HTM-10.1-dev0/source/Lib/TLibEncoder/TEncEntropy.cpp	(revision 876)
@@ -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;
Index: branches/HTM-10.1-dev0/source/Lib/TLibEncoder/TEncSbac.cpp
===================================================================
--- branches/HTM-10.1-dev0/source/Lib/TLibEncoder/TEncSbac.cpp	(revision 875)
+++ branches/HTM-10.1-dev0/source/Lib/TLibEncoder/TEncSbac.cpp	(revision 876)
@@ -1050,9 +1050,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 +1068,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 );
Index: branches/HTM-10.1-dev0/source/Lib/TLibEncoder/TEncSearch.cpp
===================================================================
--- branches/HTM-10.1-dev0/source/Lib/TLibEncoder/TEncSearch.cpp	(revision 875)
+++ branches/HTM-10.1-dev0/source/Lib/TLibEncoder/TEncSearch.cpp	(revision 876)
@@ -5616,16 +5616,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();
@@ -7176,16 +7169,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();
@@ -7205,16 +7191,9 @@
 #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
