Index: /branches/HTM-11.2-dev0/source/App/TAppEncoder/TAppEncCfg.cpp
===================================================================
--- /branches/HTM-11.2-dev0/source/App/TAppEncoder/TAppEncCfg.cpp	(revision 1029)
+++ /branches/HTM-11.2-dev0/source/App/TAppEncoder/TAppEncCfg.cpp	(revision 1030)
@@ -767,7 +767,14 @@
 
 #endif //HHI_VSO
+#if MTK_I0099_VPS_EX2
+  ("LimQtPredFlag",                   m_bLimQtPredFlag          , true          , "Use Predictive Coding with QTL" )
+#endif
+#if !MTK_I0099_VPS_EX2 || MTK_I0099_FIX
 #if H_3D_QTLPC
   ("QTL",                             m_bUseQTL                 , true          , "Use depth Quadtree Limitation" )
+#if !MTK_I0099_VPS_EX2
   ("PC",                              m_bUsePC                  , true          , "Use Predictive Coding with QTL" )
+#endif
+#endif
 #endif
 #if H_3D_IV_MERGE
@@ -2497,7 +2504,14 @@
   printf("WVSO:%d ", m_bUseWVSO );  
 #endif
+#if MTK_I0099_VPS_EX2
+  printf("LimQtPredFlag:%d ", m_bLimQtPredFlag ? 1 : 0);
+#endif
+#if !MTK_I0099_VPS_EX2 || MTK_I0099_FIX
 #if H_3D_QTLPC
   printf("QTL:%d ", m_bUseQTL);
+#if !MTK_I0099_VPS_EX2
   printf("PC:%d " , m_bUsePC );
+#endif
+#endif
 #endif
 #if H_3D_IV_MERGE
Index: /branches/HTM-11.2-dev0/source/App/TAppEncoder/TAppEncCfg.h
===================================================================
--- /branches/HTM-11.2-dev0/source/App/TAppEncoder/TAppEncCfg.h	(revision 1029)
+++ /branches/HTM-11.2-dev0/source/App/TAppEncoder/TAppEncCfg.h	(revision 1030)
@@ -131,4 +131,7 @@
   Int                    m_iSubPUMPILog2Size;                    
 #endif
+#endif
+#if MTK_I0099_VPS_EX2
+  Bool                   m_bLimQtPredFlag;
 #endif
 #if H_3D_ARP                                                  /// < flag and number of weighting factors in ARP
@@ -479,4 +482,13 @@
   Bool     m_useSingleDepthMode;                          ///< flag for using single depth mode
 #endif
+#if !MTK_I0099_VPS_EX2 || MTK_I0099_FIX
+#if H_3D_QTLPC
+  Bool      m_bUseQTL;                                        ///< flag for using depth QuadTree Limitation
+#if !MTK_I0099_VPS_EX2
+  Bool      m_bUsePC;                                         ///< flag for using Predictive Coding with QTL
+#endif
+#endif
+#endif
+
 #if H_3D_QTLPC
   Bool      m_bUseQTL;                                        ///< flag for using depth QuadTree Limitation
Index: /branches/HTM-11.2-dev0/source/App/TAppEncoder/TAppEncTop.cpp
===================================================================
--- /branches/HTM-11.2-dev0/source/App/TAppEncoder/TAppEncTop.cpp	(revision 1029)
+++ /branches/HTM-11.2-dev0/source/App/TAppEncoder/TAppEncTop.cpp	(revision 1030)
@@ -208,4 +208,13 @@
     m_cTEncTop.setUseSingleDepthMode           ( isDepth ? m_useSingleDepthMode   : false );
 #endif
+#if !MTK_I0099_VPS_EX2 || MTK_I0099_FIX
+#if H_3D_QTLPC
+    m_cTEncTop.setUseQTL                       ( isDepth ? m_bUseQTL               : false );
+#if !MTK_I0099_VPS_EX2    
+    m_cTEncTop.setUsePC                        ( isDepth ? m_bUsePC                : false );
+#endif
+#endif
+#endif
+
 #if H_3D_QTLPC
     m_cTEncTop.setUseQTL                       ( isDepth ? m_bUseQTL               : false );
@@ -1821,4 +1830,7 @@
     {
       vps.setSubPULog2Size         ( layer, (layer != 1) ? 6: 0 ); 
+#if MTK_I0099_VPS_EX2
+      vps.setSubPUMPILog2Size      ( layer, (!isLayerZero) ? m_iSubPUMPILog2Size: 0 ); 
+#endif
     }
     else
@@ -1839,4 +1851,7 @@
     {
       vps.setIvMvPredFlag    (layer, false);
+#if SEC_HLS_CLEANUP_I0100
+      vps.setIvMvScalingFlag (layer, false); 
+#endif
     }
     else
@@ -1850,5 +1865,11 @@
         vps.setIvMvPredFlag         ( layer, !isLayerZero && m_ivMvPredFlag[0] ); 
       }
-    }
+#if SEC_HLS_CLEANUP_I0100
+      vps.setIvMvScalingFlag (layer, m_ivMvScalingFlag); 
+#endif
+    }
+#endif
+#if MTK_I0099_VPS_EX2
+    vps.setLimQtPredFlag         ( layer, isDepth && m_bLimQtPredFlag ); 
 #endif
 #if H_3D_NBDV_REF
@@ -1868,9 +1889,13 @@
 #endif
   }  
+#if !MTK_I0099_VPS_EX2
 #if H_3D_SPIVMP
   vps.setSubPUMPILog2Size( m_iSubPUMPILog2Size );
 #endif
+#endif
 #if H_3D
+#if !SEC_HLS_CLEANUP_I0100
   vps.setIvMvScalingFlag( m_ivMvScalingFlag );   
+#endif
 #endif
 }
Index: /branches/HTM-11.2-dev0/source/Lib/TLibCommon/TComDataCU.cpp
===================================================================
--- /branches/HTM-11.2-dev0/source/Lib/TLibCommon/TComDataCU.cpp	(revision 1029)
+++ /branches/HTM-11.2-dev0/source/Lib/TLibCommon/TComDataCU.cpp	(revision 1030)
@@ -5967,5 +5967,9 @@
     Int iColRefViewId  = pColCU->getSlice()->getRefPic( eColRefPicList, pColCU->getCUMvField(eColRefPicList)->getRefIdx(uiAbsPartAddr))->getViewIndex(); 
     iScale = xGetDistScaleFactor( iCurrViewId, iCurrRefViewId, iColViewId, iColRefViewId );
+#if SEC_HLS_CLEANUP_I0100
+    if ( iScale != 4096 && m_pcSlice->getVPS()->getIvMvScalingFlag(getSlice()->getLayerIdInVps()) ) 
+#else
     if ( iScale != 4096 && m_pcSlice->getVPS()->getIvMvScalingFlag() ) 
+#endif
     {
       rcMv = cColMv.scaleMv( iScale );
@@ -6778,5 +6782,9 @@
   if( getSlice()->getIsDepth() )
   {
+#if MTK_I0099_VPS_EX2
+    iSubPUSize = 1<<getSlice()->getVPS()->getSubPUMPILog2Size(getSlice()->getLayerId());
+#else
     iSubPUSize = 1 << getSlice()->getVPS()->getSubPUMPILog2Size();
+#endif
   }
 
Index: /branches/HTM-11.2-dev0/source/Lib/TLibCommon/TComPrediction.cpp
===================================================================
--- /branches/HTM-11.2-dev0/source/Lib/TLibCommon/TComPrediction.cpp	(revision 1029)
+++ /branches/HTM-11.2-dev0/source/Lib/TLibCommon/TComPrediction.cpp	(revision 1030)
@@ -568,4 +568,10 @@
     pcCU->getSPAbsPartIdx(uiPartAddr, iSPWidth, iSPHeight, i, iNumSPInOneLine, uiSPAddr[i]);
   }
+#if SHARP_ARP_CHROMA_I0104
+  if( pcCU->getARPW( uiPartAddr ) != 0 )
+  {
+    return;
+  }
+#endif
   // horizontal sub-PU merge
   for (Int i=0; i<iNumSP; i++)
@@ -1469,7 +1475,11 @@
   pcCU->clipMv(cMv);
   TComPicYuv* pcPicYuvRef = pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec();
+#if QC_I0129_ARP_FIX
+  xPredInterLumaBlk  ( pcCU, pcPicYuvRef, uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi || ( dW > 0 ), true );
+  xPredInterChromaBlk( pcCU, pcPicYuvRef, uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi || ( dW > 0 ), true );
+#else
   xPredInterLumaBlk  ( pcCU, pcPicYuvRef, uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi, true );
   xPredInterChromaBlk( pcCU, pcPicYuvRef, uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi, true );
-
+#endif
   if( dW > 0 )
   {
@@ -1479,4 +1489,10 @@
     TComMv cMVwithDisparity = cMv + cDistparity.m_acNBDV;
     pcCU->clipMv(cMVwithDisparity);
+#if SHARP_ARP_CHROMA_I0104
+    if (iWidth <= 8)
+    {
+      pYuvB0->clear(); pYuvB1->clear();
+    }
+#endif
 
     assert ( cDistparity.bDV );
@@ -1487,6 +1503,14 @@
     
     pcPicYuvRef = pcPicYuvBaseCol->getPicYuvRec();
+#if QC_I0129_ARP_FIX
+    xPredInterLumaBlk  ( pcCU, pcPicYuvRef, uiPartAddr, &cNBDV, iWidth, iHeight, pYuvB0, true, true );
+#if SHARP_ARP_CHROMA_I0104
+    if (iWidth > 8)
+#endif
+    xPredInterChromaBlk( pcCU, pcPicYuvRef, uiPartAddr, &cNBDV, iWidth, iHeight, pYuvB0, true, true );
+#else
     xPredInterLumaBlk  ( pcCU, pcPicYuvRef, uiPartAddr, &cNBDV, iWidth, iHeight, pYuvB0, bi, true );
     xPredInterChromaBlk( pcCU, pcPicYuvRef, uiPartAddr, &cNBDV, iWidth, iHeight, pYuvB0, bi, true );
+#endif
 #else
     pcPicYuvRef = pcPicYuvBaseCol->getPicYuvRec();
@@ -1496,7 +1520,14 @@
     
     pcPicYuvRef = pcPicYuvBaseRef->getPicYuvRec();
+#if QC_I0129_ARP_FIX
+    xPredInterLumaBlk  ( pcCU, pcPicYuvRef, uiPartAddr, &cMVwithDisparity, iWidth, iHeight, pYuvB1, true, true );
+#if SHARP_ARP_CHROMA_I0104
+    if (iWidth > 8)
+#endif
+    xPredInterChromaBlk( pcCU, pcPicYuvRef, uiPartAddr, &cMVwithDisparity, iWidth, iHeight, pYuvB1, true, true );
+#else
     xPredInterLumaBlk  ( pcCU, pcPicYuvRef, uiPartAddr, &cMVwithDisparity, iWidth, iHeight, pYuvB1, bi, true );
     xPredInterChromaBlk( pcCU, pcPicYuvRef, uiPartAddr, &cMVwithDisparity, iWidth, iHeight, pYuvB1, bi, true );
-
+#endif
     pYuvB0->subtractARP( pYuvB0 , pYuvB1 , uiPartAddr , iWidth , iHeight );
 
@@ -1508,4 +1539,75 @@
   }
 }
+
+#if QC_I0051_ARP_SIMP
+Bool TComPrediction::xCheckBiInterviewARP( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eBaseRefPicList, TComPic*& pcPicYuvCurrTRef, TComMv& cBaseTMV, Int& iCurrTRefPoc )
+{
+  Int         iRefIdx       = pcCU->getCUMvField( eBaseRefPicList )->getRefIdx( uiPartAddr );
+  TComMv      cDMv          = pcCU->getCUMvField( eBaseRefPicList )->getMv( uiPartAddr );
+  TComPic* pcPicYuvBaseCol  = pcCU->getSlice()->getRefPic( eBaseRefPicList, iRefIdx );  
+  TComPicYuv* pcYuvBaseCol  = pcPicYuvBaseCol->getPicYuvRec();
+  Int uiLCUAddr,uiAbsPartAddr;
+  Int irefPUX = pcCU->getCUPelX() + g_auiRasterToPelX[g_auiZscanToRaster[uiPartAddr]] + iWidth/2  + ((cDMv.getHor() + 2)>>2);
+  Int irefPUY = pcCU->getCUPelY() + g_auiRasterToPelY[g_auiZscanToRaster[uiPartAddr]] + iHeight/2 + ((cDMv.getVer() + 2)>>2);
+
+  irefPUX = (Int)Clip3<Int>(0, pcCU->getSlice()->getSPS()-> getPicWidthInLumaSamples()-1, irefPUX);
+  irefPUY = (Int)Clip3<Int>(0, pcCU->getSlice()->getSPS()->getPicHeightInLumaSamples()-1, irefPUY);  
+  pcYuvBaseCol->getCUAddrAndPartIdx( irefPUX, irefPUY, uiLCUAddr, uiAbsPartAddr);
+  TComDataCU *pColCU = pcPicYuvBaseCol->getCU( uiLCUAddr );
+
+  TComPic* pcPicYuvBaseTRef = NULL;
+  pcPicYuvCurrTRef = NULL;
+
+  //If there is available motion in base reference list, use it
+  if(!pColCU->isIntra(uiAbsPartAddr))
+  {
+    for(Int iList = 0; iList < (pColCU->getSlice()->isInterB() ? 2: 1); iList ++)
+    {
+      RefPicList eRefPicListCurr = RefPicList(iList);
+      Int iRef = pColCU->getCUMvField(eRefPicListCurr)->getRefIdx(uiAbsPartAddr);
+      if( iRef != -1)
+      {
+        pcPicYuvBaseTRef = pColCU->getSlice()->getRefPic(eRefPicListCurr, iRef);  
+        Int  iCurrPOC    = pColCU->getSlice()->getPOC();
+        Int  iCurrRefPOC = pcPicYuvBaseTRef->getPOC();
+        Int  iCurrRef    = pcCU->getSlice()->getFirstTRefIdx(eRefPicListCurr);
+#if MTK_I0072_IVARP_SCALING_FIX
+        if( iCurrRef >= 0 && iCurrPOC != iCurrRefPOC)
+#else
+        if( iCurrRef >= 0)
+#endif
+        {
+          pcPicYuvCurrTRef =  pcCU->getSlice()->getRefPic(eRefPicListCurr,iCurrRef);  
+          Int iTargetPOC = pcPicYuvCurrTRef->getPOC();
+          pcPicYuvBaseTRef =  pcCU->getSlice()->getBaseViewRefPic(iTargetPOC,  pcPicYuvBaseCol->getViewIndex() );  
+          if(pcPicYuvBaseTRef)
+          {
+            cBaseTMV = pColCU->getCUMvField(eRefPicListCurr)->getMv(uiAbsPartAddr);
+            Int iScale = pcCU-> xGetDistScaleFactor(iCurrPOC, iTargetPOC, iCurrPOC, iCurrRefPOC);
+            if ( iScale != 4096 )
+            {
+              cBaseTMV = cBaseTMV.scaleMv( iScale );
+            }
+            iCurrTRefPoc = iTargetPOC;
+            return true;
+          }
+        }
+      }
+    }
+  }
+
+  //If there is no available motion in base reference list, use ( 0, 0 )
+  if( pcCU->getSlice()->getFirstTRefIdx( eBaseRefPicList ) >= 0 )
+  {
+    cBaseTMV.set( 0, 0 );
+    pcPicYuvCurrTRef = pcCU->getSlice()->getRefPic( eBaseRefPicList,  pcCU->getSlice()->getFirstTRefIdx( eBaseRefPicList ) );
+    iCurrTRefPoc = pcPicYuvCurrTRef->getPOC();
+    return true;
+  }
+
+  return false;
+}
+#endif
+
 Void TComPrediction::xPredInterUniARPviewRef( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi, TComMvField * pNewMvFiled )
 {
@@ -1541,6 +1643,72 @@
   pcYuvBaseCol->getCUAddrAndPartIdx( irefPUX, irefPUY, uiLCUAddr, uiAbsPartAddr);
   TComDataCU *pColCU = pcPicYuvBaseCol->getCU( uiLCUAddr );
-
+#if QC_I0051_ARP_SIMP
+  if( pcCU->getSlice()->isInterB() && !pcCU->getSlice()->getIsDepth() )
+  {
+    RefPicList eOtherRefList = ( eRefPicList == REF_PIC_LIST_0 ) ? REF_PIC_LIST_1 : REF_PIC_LIST_0;
+    Int iOtherRefIdx = pcCU->getCUMvField( eOtherRefList )->getRefIdx( uiPartAddr );
+    //The other prediction direction is temporal ARP
+    if( iOtherRefIdx >= 0 && pcCU->getSlice()->getViewIndex() == pcCU->getSlice()->getRefPic( eOtherRefList, iOtherRefIdx )->getViewIndex() )
+    {
+      bTMVAvai = true;
+      pcPicYuvBaseTRef = pcCU->getSlice()->getRefPic( eOtherRefList, iOtherRefIdx );
+      Int  iCurrPOC    = pcCU->getSlice()->getPOC();
+      Int  iCurrRefPOC = pcPicYuvBaseTRef->getPOC();
+      Int  iCurrRef    = pcCU->getSlice()->getFirstTRefIdx( eOtherRefList );
+      
+      if( iCurrRef >= 0 )
+      {
+        pcPicYuvCurrTRef =  pcCU->getSlice()->getRefPic( eOtherRefList,iCurrRef );  
+        Int iTargetPOC = pcPicYuvCurrTRef->getPOC();
+        pcPicYuvBaseTRef =  pcCU->getSlice()->getBaseViewRefPic( iTargetPOC,  pcPicYuvBaseCol->getViewIndex() );
+        if( pcPicYuvBaseTRef )
+        {
+          cBaseTMV = pcCU->getCUMvField( eOtherRefList )->getMv( uiPartAddr );
+          Int iScale = pcCU-> xGetDistScaleFactor( iCurrPOC, iTargetPOC, iCurrPOC, iCurrRefPOC );
+          if ( iScale != 4096 )
+          {
+            cBaseTMV = cBaseTMV.scaleMv( iScale );
+          }
+        }
+        else
+        {
+          dW = 0;
+        }
+      }
+      else
+      {
+        dW = 0;
+      }
+    }
+
+    //Both prediction directions are inter-view ARP
+    if ( iOtherRefIdx >= 0 && !bTMVAvai )
+    {
+      RefPicList eBaseList = REF_PIC_LIST_0;
+      Int iCurrTRefPoc;
+      bTMVAvai = ( eBaseList != eRefPicList ) && ( pcCU->getSlice()->getViewIndex() != pcCU->getSlice()->getRefPic( eOtherRefList, iOtherRefIdx )->getViewIndex() );
+
+      if ( bTMVAvai )
+      {
+        if( xCheckBiInterviewARP( pcCU, uiPartAddr, iWidth, iHeight, eBaseList, pcPicYuvCurrTRef, cBaseTMV, iCurrTRefPoc ) )
+        {
+          pcPicYuvBaseTRef = pcCU->getSlice()->getBaseViewRefPic( iCurrTRefPoc,  pcPicYuvBaseCol->getViewIndex() );
+          if ( pcPicYuvBaseTRef == NULL )
+          {
+            dW = 0;
+          }
+        }
+        else
+        {
+          dW = 0;
+        }
+      }
+    }
+  }
+
+  if( !pColCU->isIntra( uiAbsPartAddr ) && !bTMVAvai )
+#else
   if(!pColCU->isIntra(uiAbsPartAddr))
+#endif
   {
     TComMvField puMVField;
@@ -1555,5 +1723,9 @@
         Int  iCurrRefPOC = pcPicYuvBaseTRef->getPOC();
         Int  iCurrRef    = pcCU->getSlice()->getFirstTRefIdx(eRefPicListCurr);
+#if MTK_I0072_IVARP_SCALING_FIX
+        if (iCurrRef >= 0 && iCurrRefPOC != iCurrPOC)
+#else
         if( iCurrRef >= 0)
+#endif
         {
           pcPicYuvCurrTRef =  pcCU->getSlice()->getRefPic(eRefPicListCurr,iCurrRef);  
@@ -1582,8 +1754,11 @@
     pcPicYuvCurrTRef =  pcCU->getSlice()->getRefPic  (eRefPicList,  pcCU->getSlice()->getFirstTRefIdx(eRefPicList));      
   }
-
+#if QC_I0129_ARP_FIX
+  xPredInterLumaBlk  ( pcCU, pcYuvBaseCol, uiPartAddr, &cTempDMv, iWidth, iHeight, rpcYuvPred, bi || ( dW > 0 && bTMVAvai ),        bTMVAvai);
+  xPredInterChromaBlk( pcCU, pcYuvBaseCol, uiPartAddr, &cTempDMv, iWidth, iHeight, rpcYuvPred, bi || ( dW > 0 && bTMVAvai ),        bTMVAvai);
+#else
   xPredInterLumaBlk  ( pcCU, pcYuvBaseCol, uiPartAddr, &cTempDMv, iWidth, iHeight, rpcYuvPred, bi,        bTMVAvai);
   xPredInterChromaBlk( pcCU, pcYuvBaseCol, uiPartAddr, &cTempDMv, iWidth, iHeight, rpcYuvPred, bi,        bTMVAvai);
-
+#endif
   if( dW > 0 && bTMVAvai ) 
   {
@@ -1596,5 +1771,22 @@
     pcCU->clipMv(cBaseTMV);
     pcCU->clipMv(cTempMv);
-
+#if SHARP_ARP_CHROMA_I0104
+    if (iWidth <= 8)
+    {
+      pYuvCurrTRef->clear(); pYuvBaseTRef->clear();
+    }
+#endif
+#if QC_I0129_ARP_FIX
+    xPredInterLumaBlk  ( pcCU, pcYuvCurrTref, uiPartAddr, &cBaseTMV, iWidth, iHeight, pYuvCurrTRef, true,   true);
+#if SHARP_ARP_CHROMA_I0104
+    if (iWidth > 8)
+#endif
+    xPredInterChromaBlk( pcCU, pcYuvCurrTref, uiPartAddr, &cBaseTMV, iWidth, iHeight, pYuvCurrTRef, true,   true);
+    xPredInterLumaBlk  ( pcCU, pcYuvBaseTref, uiPartAddr, &cTempMv,  iWidth, iHeight, pYuvBaseTRef, true,   true); 
+#if SHARP_ARP_CHROMA_I0104
+    if (iWidth > 8)
+#endif
+    xPredInterChromaBlk( pcCU, pcYuvBaseTref, uiPartAddr, &cTempMv,  iWidth, iHeight, pYuvBaseTRef, true,   true); 
+#else
     xPredInterLumaBlk  ( pcCU, pcYuvCurrTref, uiPartAddr, &cBaseTMV, iWidth, iHeight, pYuvCurrTRef, bi,   true);
     xPredInterChromaBlk( pcCU, pcYuvCurrTref, uiPartAddr, &cBaseTMV, iWidth, iHeight, pYuvCurrTRef, bi,   true);
@@ -1602,4 +1794,5 @@
     xPredInterChromaBlk( pcCU, pcYuvBaseTref, uiPartAddr, &cTempMv,  iWidth, iHeight, pYuvBaseTRef, bi,   true); 
 
+#endif
     pYuvCurrTRef->subtractARP( pYuvCurrTRef , pYuvBaseTRef , uiPartAddr , iWidth , iHeight );  
     if(dW == 2)
@@ -2135,12 +2328,18 @@
   Int iRecStride = ( eType == TEXT_LUMA ) ? pRecPic->getStride() : pRecPic->getCStride();
   Int iRefStride = ( eType == TEXT_LUMA ) ? pRefPic->getStride() : pRefPic->getCStride();
+#if SEC_IC_NEIGHBOR_CLIP_I0080
+  Int iRefOffset, iHor, iVer;
+#else
   Int iCUPelX, iCUPelY, iRefX, iRefY, iRefOffset, iHor, iVer;
 
   iCUPelX = pcCU->getCUPelX() + g_auiRasterToPelX[g_auiZscanToRaster[pcCU->getZorderIdxInCU()]];
   iCUPelY = pcCU->getCUPelY() + g_auiRasterToPelY[g_auiZscanToRaster[pcCU->getZorderIdxInCU()]];
+#endif
   iHor = pcCU->getSlice()->getIsDepth() ? pMv->getHor() : ( ( pMv->getHor() + 2 ) >> 2 );
   iVer = pcCU->getSlice()->getIsDepth() ? pMv->getVer() : ( ( pMv->getVer() + 2 ) >> 2 );
+#if !SEC_IC_NEIGHBOR_CLIP_I0080
   iRefX   = iCUPelX + iHor;
   iRefY   = iCUPelY + iVer;
+#endif
   if( eType != TEXT_LUMA )
   {
@@ -2158,5 +2357,9 @@
   Int precShift = std::max(0, (( eType == TEXT_LUMA ) ? g_bitDepthY : g_bitDepthC) - 12);
 
+#if SEC_IC_NEIGHBOR_CLIP_I0080
+  if( pcCU->getPUAbove( uiTmpPartIdx, pcCU->getZorderIdxInCU() ) )
+#else
   if( pcCU->getPUAbove( uiTmpPartIdx, pcCU->getZorderIdxInCU() ) && iCUPelY > 0 && iRefY > 0 )
+#endif
   {
     iRefOffset = iHor + iVer * iRefStride - iRefStride;
@@ -2188,6 +2391,9 @@
   }
 
-
+#if SEC_IC_NEIGHBOR_CLIP_I0080
+  if( pcCU->getPULeft( uiTmpPartIdx, pcCU->getZorderIdxInCU() ) )
+#else
   if( pcCU->getPULeft( uiTmpPartIdx, pcCU->getZorderIdxInCU() ) && iCUPelX > 0 && iRefX > 0 )
+#endif
   {
     iRefOffset = iHor + iVer * iRefStride - 1;
Index: /branches/HTM-11.2-dev0/source/Lib/TLibCommon/TComPrediction.h
===================================================================
--- /branches/HTM-11.2-dev0/source/Lib/TLibCommon/TComPrediction.h	(revision 1029)
+++ /branches/HTM-11.2-dev0/source/Lib/TLibCommon/TComPrediction.h	(revision 1030)
@@ -90,4 +90,7 @@
 #if H_3D_ARP
   Void xPredInterUniARP         ( TComDataCU* pcCU,                          UInt uiPartAddr,               Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi=false, TComMvField * pNewMvFiled = NULL );
+#if QC_I0051_ARP_SIMP
+  Bool xCheckBiInterviewARP     ( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eBaseRefPicList, TComPic*& pcPicYuvCurrTRef, TComMv& cBaseTMV, Int& iCurrTRefPoc );
+#endif
   Void xPredInterUniARPviewRef( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi, TComMvField * pNewMvFiled = NULL );
 #endif
Index: /branches/HTM-11.2-dev0/source/Lib/TLibCommon/TComSlice.cpp
===================================================================
--- /branches/HTM-11.2-dev0/source/Lib/TLibCommon/TComSlice.cpp	(revision 1029)
+++ /branches/HTM-11.2-dev0/source/Lib/TLibCommon/TComSlice.cpp	(revision 1030)
@@ -1952,4 +1952,10 @@
     m_viewIndex         [i] = -1; 
     m_vpsDepthModesFlag [i] = false;
+#if SEC_HLS_CLEANUP_I0100
+    m_ivMvScalingFlag[i] = true; 
+#else
+    m_ivMvScalingFlag = true; 
+#endif
+#endif
 #if SEPARATE_FLAG_I0085
     m_bIVPFlag [i]      = false;
@@ -1986,4 +1992,7 @@
     m_iSubPULog2Size       [ i ] = 0;
 #endif
+#endif
+#if MTK_I0099_VPS_EX2
+    m_bLimQtPredFlag       [ i ] = false;
 #endif
 #if H_3D_VSP
@@ -2518,7 +2527,9 @@
 , m_pcmLog2MaxSize            (  5)
 , m_uiPCMLog2MinSize          (  7)
+#if !MTK_I0099_VPS_EX2
 #if H_3D_QTLPC
 , m_bUseQTL                   (false)
 , m_bUsePC                    (false)
+#endif
 #endif
 , m_bitDepthY                 (  8)
Index: /branches/HTM-11.2-dev0/source/Lib/TLibCommon/TComSlice.h
===================================================================
--- /branches/HTM-11.2-dev0/source/Lib/TLibCommon/TComSlice.h	(revision 1029)
+++ /branches/HTM-11.2-dev0/source/Lib/TLibCommon/TComSlice.h	(revision 1030)
@@ -798,8 +798,18 @@
 #if H_3D_IV_MERGE
   Bool        m_ivMvPredFlag             [ MAX_NUM_LAYERS ]; 
+#if SEC_HLS_CLEANUP_I0100
+  Bool        m_ivMvScalingFlag          [ MAX_NUM_LAYERS ]; 
+#endif
 #if H_3D_SPIVMP
   Int         m_iSubPULog2Size           [MAX_NUM_LAYERS   ];
+#if MTK_I0099_VPS_EX2
+  Int         m_iSubPUMPILog2Size        [MAX_NUM_LAYERS   ];
+#else
   Int         m_iSubPUMPILog2Size;
 #endif
+#endif
+#endif
+#if MTK_I0099_VPS_EX2
+  Bool        m_bLimQtPredFlag           [ MAX_NUM_LAYERS ];
 #endif
 #if H_3D_VSP
@@ -820,5 +830,9 @@
   Int         ***m_aaaiCodedScale ;
   Int         ***m_aaaiCodedOffset;
+
+#if !SEC_HLS_CLEANUP_I0100
   Bool        m_ivMvScalingFlag; 
+#endif
+
 #endif
 #if H_3D_INTER_SDC
@@ -1133,7 +1147,16 @@
   Int     getSubPULog2Size(Int layerIdInVps)           { return m_iSubPULog2Size[layerIdInVps]; }
   Void    setSubPULog2Size(Int layerIdInVps, Int u)    { m_iSubPULog2Size[layerIdInVps] = u;}
+#if MTK_I0099_VPS_EX2
+  Int     getSubPUMPILog2Size(Int layerIdInVps)           { return m_iSubPUMPILog2Size[layerIdInVps]; }
+  Void    setSubPUMPILog2Size(Int layerIdInVps, Int u)    { m_iSubPUMPILog2Size[layerIdInVps] = u;}
+#else
   Int     getSubPUMPILog2Size( )           { return m_iSubPUMPILog2Size; }
   Void    setSubPUMPILog2Size( Int u )     { m_iSubPUMPILog2Size = u;    }
 #endif
+#endif
+#endif
+#if MTK_I0099_VPS_EX2
+  Void    setLimQtPredFlag    ( Int layerIdInVps, Bool val )  { m_bLimQtPredFlag[ layerIdInVps ] = val; }
+  Bool    getLimQtPredFlag    ( Int layerIdInVps ) { return m_bLimQtPredFlag[layerIdInVps];}
 #endif
 #if H_3D_VSP
@@ -1152,6 +1175,12 @@
 #endif
 
+#if SEC_HLS_CLEANUP_I0100
+  Bool    getIvMvScalingFlag   ( Int layerIdInVps )                        { return m_ivMvScalingFlag[ layerIdInVps ]; }
+  Void    setIvMvScalingFlag   (Int layerIdInVps, Bool b )                 { m_ivMvScalingFlag[ layerIdInVps ] = b;    }  
+#else
   Bool    getIvMvScalingFlag   (  )                       { return m_ivMvScalingFlag; }
   Void    setIvMvScalingFlag   ( Bool b )                 { m_ivMvScalingFlag = b;    }  
+#endif
+
 #if H_3D_INTER_SDC
   Bool    getInterSDCFlag      ( Int layerIdInVps )           { return m_bInterSDCFlag[layerIdInVps]; }
@@ -1477,7 +1506,9 @@
   Bool        m_useAMP;
 
+#if !MTK_I0099_VPS_EX2
 #if H_3D_QTLPC
   Bool        m_bUseQTL;
   Bool        m_bUsePC;
+#endif
 #endif
   // Parameter
@@ -1743,4 +1774,5 @@
 
 #endif
+#if !MTK_I0099_VPS_EX2
 #if H_3D_QTLPC
   Void setUseQTL( Bool b ) { m_bUseQTL = b;    }
@@ -1748,4 +1780,5 @@
   Void setUsePC ( Bool b ) { m_bUsePC  = b;    }
   Bool getUsePC ()         { return m_bUsePC;  }
+#endif
 #endif
 #if H_MV
Index: /branches/HTM-11.2-dev0/source/Lib/TLibCommon/TComYuv.cpp
===================================================================
--- /branches/HTM-11.2-dev0/source/Lib/TLibCommon/TComYuv.cpp	(revision 1029)
+++ /branches/HTM-11.2-dev0/source/Lib/TLibCommon/TComYuv.cpp	(revision 1030)
@@ -689,4 +689,8 @@
   UInt iSrc1Stride = pcYuvSrc1->getStride();
   UInt iDstStride  = getStride();
+#if QC_I0129_ARP_FIX
+  Int iIFshift = IF_INTERNAL_PREC - g_bitDepthY;
+  Int iOffSet  = ( 1 << ( iIFshift - 1 ) ) + IF_INTERNAL_OFFS;
+#endif
   for ( y = uiHeight-1; y >= 0; y-- )
   {
@@ -696,5 +700,9 @@
       if( bClip )
       {
+#if QC_I0129_ARP_FIX
+        pDst[x] = ClipY( ( pDst[x] + iOffSet ) >> iIFshift );
+#else
         pDst[x] = ClipY( pDst[x] );
+#endif
       }
     }
@@ -719,4 +727,8 @@
   UInt  iSrc1Stride = pcYuvSrc1->getCStride();
   UInt  iDstStride  = getCStride();
+#if QC_I0129_ARP_FIX
+  Int iIFshift = IF_INTERNAL_PREC - g_bitDepthC;
+  Int iOffSet  = ( 1 << ( iIFshift - 1 ) ) + IF_INTERNAL_OFFS;
+#endif
   for ( y = uiHeight-1; y >= 0; y-- )
   {
@@ -727,6 +739,11 @@
       if( bClip )
       {
+#if QC_I0129_ARP_FIX
+        pDstU[x] = ClipC( ( pDstU[x] + iOffSet ) >> iIFshift );
+        pDstV[x] = ClipC( ( pDstV[x] + iOffSet ) >> iIFshift );
+#else
         pDstU[x] = ClipC( pDstU[x] );
         pDstV[x] = ClipC( pDstV[x] );
+#endif
       }
     }
@@ -744,4 +761,7 @@
 {
   subtractARPLuma  ( pcYuvSrc0, pcYuvSrc1,  uiAbsPartIdx, uiWidth    , uiHeight    );
+#if SHARP_ARP_CHROMA_I0104
+  if (uiWidth > 8)
+#endif
   subtractARPChroma( pcYuvSrc0, pcYuvSrc1,  uiAbsPartIdx, uiWidth>>1 , uiHeight>>1 );
 }
@@ -803,4 +823,7 @@
 {
   multiplyARPLuma( uiAbsPartIdx , uiWidth , uiHeight , dW );
+#if SHARP_ARP_CHROMA_I0104
+  if (uiWidth > 8)
+#endif
   multiplyARPChroma( uiAbsPartIdx , uiWidth >> 1 , uiHeight >> 1 , dW );
 }
Index: /branches/HTM-11.2-dev0/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- /branches/HTM-11.2-dev0/source/Lib/TLibCommon/TypeDef.h	(revision 1029)
+++ /branches/HTM-11.2-dev0/source/Lib/TLibCommon/TypeDef.h	(revision 1030)
@@ -123,4 +123,6 @@
                                               // SEC_IC_ARP_SIG_G0072, Disabling IC when ARP is enabled, option 1 in JCT3V-G0072, part 2 in JCT3V-G0121
                                               // MTK_LOW_LATENCY_IC_ENCODING_H0086  Low-latency IC encoding in JCT3V-H0086
+
+#define SEC_IC_NEIGHBOR_CLIP_I0080        1   // Clipping of neighboring sample position, JCT3V-I0080
 
 
@@ -262,8 +264,14 @@
 #endif
 
+#define MTK_I0099_VPS_EX2                 1  ///< JCT3V-I0099, sub-PU size signaling and lim_qt_pred_flag in VPS extension 2
+#define MTK_I0099_FIX                     1  ///< Fix the problem of removing encoder only QTL 
+
 // Rate Control
 #define KWU_FIX_URQ                       1
 #define KWU_RC_VIEWRC_E0227               0  ///< JCT3V-E0227, view-wise target bitrate allocation
 #define KWU_RC_MADPRED_E0227              0  ///< JCT3V-E0227, inter-view MAD prediction
+
+#define SEC_VPS_CLEANUP_I0090             1
+#define SEC_HLS_CLEANUP_I0100             1
 
 #endif // H_3D
@@ -295,4 +303,8 @@
 #if H_3D_ARP
 #define H_3D_ARP_WFNR                     3
+#define QC_I0129_ARP_FIX                  1
+#define QC_I0051_ARP_SIMP                 1
+#define SHARP_ARP_CHROMA_I0104            1
+#define MTK_I0072_IVARP_SCALING_FIX       1
 #endif
 
Index: /branches/HTM-11.2-dev0/source/Lib/TLibDecoder/TDecCAVLC.cpp
===================================================================
--- /branches/HTM-11.2-dev0/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 1029)
+++ /branches/HTM-11.2-dev0/source/Lib/TLibDecoder/TDecCAVLC.cpp	(revision 1030)
@@ -1051,4 +1051,5 @@
 Void TDecCavlc::parseSPSExtension2( TComSPS* pcSPS, Int viewIndex, Bool depthFlag )
 { 
+#if !MTK_I0099_VPS_EX2
   UInt uiCode; 
 #if H_3D_QTLPC
@@ -1061,4 +1062,5 @@
     pcSPS->setUsePC( uiCode );
   }
+#endif
 #endif
 }
@@ -1756,5 +1758,9 @@
 {
   UInt uiCode; 
+#if SEC_VPS_CLEANUP_I0090
+  for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ )
+#else
   for( Int i = 0; i <= pcVPS->getMaxLayersMinus1(); i++ )
+#endif
   {
 #if H_3D_ARP
@@ -1765,10 +1771,20 @@
     pcVPS->setSubPULog2Size(i, 0);
 #endif
+#if !SEC_VPS_CLEANUP_I0090
     if ( i != 0 )
-    {
+#endif
+    {
+#if MTK_I0099_VPS_EX2
+      READ_FLAG( uiCode, "iv_mv_pred_flag[i]");          pcVPS->setIvMvPredFlag         ( i, uiCode == 1 ? true : false );
+#if SEC_HLS_CLEANUP_I0100
+      READ_FLAG( uiCode, "iv_mv_scaling_flag[i]");       pcVPS->setIvMvScalingFlag         ( i, uiCode == 1 ? true : false );
+#endif
+#endif
       if( !( pcVPS->getDepthId( i ) == 1 ) )
       {
 #if H_3D_IV_MERGE
+#if !MTK_I0099_VPS_EX2
         READ_FLAG( uiCode, "iv_mv_pred_flag[i]");          pcVPS->setIvMvPredFlag         ( i, uiCode == 1 ? true : false );
+#endif
         if( !pcVPS->getNumDirectRefLayers(i) )
         {
@@ -1802,4 +1818,5 @@
       else
       {
+#if !MTK_I0099_VPS_EX2
 #if H_3D_IV_MERGE
         if(i!=1)
@@ -1818,6 +1835,10 @@
         }
 #endif
+#endif
 #if H_3D_IV_MERGE
         READ_FLAG( uiCode, "mpi_flag[i]" );             pcVPS->setMPIFlag( i, uiCode == 1 ? true : false );
+#endif
+#if MTK_I0099_VPS_EX2
+        READ_UVLC (uiCode, "log2_mpi_sub_PU_size_minus3[i]");     pcVPS->setSubPUMPILog2Size(i, uiCode+3);
 #endif
         READ_FLAG( uiCode, "vps_depth_modes_flag[i]" );             pcVPS->setVpsDepthModesFlag( i, uiCode == 1 ? true : false );
@@ -1825,5 +1846,7 @@
         READ_FLAG( uiCode, "ivp_flag[i]" );                   pcVPS->setIVPFlag( i, uiCode == 1 ? true : false );
 #endif
-        //          READ_FLAG( uiCode, "lim_qt_pred_flag[i]");                  pcVPS->setLimQtPreFlag     ( i, uiCode == 1 ? true : false ); 
+#if MTK_I0099_VPS_EX2
+        READ_FLAG( uiCode, "lim_qt_pred_flag[i]");                  pcVPS->setLimQtPredFlag     ( i, uiCode == 1 ? true : false ); 
+#endif
 #if H_3D_INTER_SDC
             READ_FLAG( uiCode, "depth_inter_SDC_flag" );              pcVPS->setInterSDCFlag( i, uiCode ? true : false );
@@ -1838,5 +1861,9 @@
 
   READ_UVLC( uiCamParPrecision, "cp_precision" );
+#if SEC_VPS_CLEANUP_I0090
+  for (UInt viewIndex=1; viewIndex<pcVPS->getNumViews(); viewIndex++)
+#else
   for (UInt viewIndex=0; viewIndex<pcVPS->getNumViews(); viewIndex++)
+#endif
   {
     pcVPS->setCamParPresent         ( viewIndex, false );
@@ -1860,6 +1887,10 @@
     }
   }
+#if !MTK_I0099_VPS_EX2
   READ_UVLC (uiCode, "log2_sub_PU_MPI_size_minus3");              pcVPS->setSubPUMPILog2Size( uiCode + 3 ); 
+#endif
+#if !SEC_HLS_CLEANUP_I0100
   READ_FLAG( uiCode, "iv_mv_scaling_flag");                       pcVPS->setIvMvScalingFlag( uiCode == 1 ? true : false ); 
+#endif
 }
 #endif
@@ -2462,5 +2493,9 @@
     }
 #if H_3D_IC
+#if SEC_HLS_CLEANUP_I0100
+    else if( rpcSlice->getViewIndex() && ( rpcSlice->getSliceType() == P_SLICE || rpcSlice->getSliceType() == B_SLICE ) && !rpcSlice->getIsDepth() && vps->getNumDirectRefLayers( layerId ) > 0 )
+#else
     else if( rpcSlice->getViewIndex() && ( rpcSlice->getSliceType() == P_SLICE || rpcSlice->getSliceType() == B_SLICE ) && !rpcSlice->getIsDepth())
+#endif
     {
       UInt uiCodeTmp = 0;
Index: /branches/HTM-11.2-dev0/source/Lib/TLibDecoder/TDecSbac.cpp
===================================================================
--- /branches/HTM-11.2-dev0/source/Lib/TLibDecoder/TDecSbac.cpp	(revision 1029)
+++ /branches/HTM-11.2-dev0/source/Lib/TLibDecoder/TDecSbac.cpp	(revision 1030)
@@ -780,5 +780,10 @@
   Bool bParseSplitFlag    = true;
 
+#if MTK_I0099_VPS_EX2
+  TComVPS *vps           = pcCU->getPic()->getSlice(0)->getVPS();
+  Bool    bLimQtPredFlag = vps->getLimQtPredFlag(pcCU->getPic()->getSlice(0)->getLayerId());
+#else
   TComSPS *sps            = pcCU->getPic()->getSlice(0)->getSPS();
+#endif
   TComPic *pcTexture      = pcCU->getSlice()->getTexturePic();
   Bool bDepthMapDetect    = (pcTexture != NULL);
@@ -787,5 +792,9 @@
   Bool rapPic = (pcCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || pcCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP || pcCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA);
 
+#if MTK_I0099_VPS_EX2
+  if(bDepthMapDetect && !bIntraSliceDetect && !rapPic && bLimQtPredFlag)
+#else
   if(bDepthMapDetect && !bIntraSliceDetect && !rapPic && sps->getUseQTL() && sps->getUsePC())
+#endif
   {
     TComDataCU *pcTextureCU = pcTexture->getCU(pcCU->getAddr());
@@ -829,5 +838,10 @@
 #if H_3D_QTLPC
   Bool bParsePartSize    = true;
+#if MTK_I0099_VPS_EX2
+  TComVPS *vps           = pcCU->getPic()->getSlice(0)->getVPS();
+  Bool    bLimQtPredFlag = vps->getLimQtPredFlag(pcCU->getPic()->getSlice(0)->getLayerId());
+#else
   TComSPS *sps           = pcCU->getPic()->getSlice(0)->getSPS();
+#endif
   TComPic *pcTexture     = pcCU->getSlice()->getTexturePic();
   Bool bDepthMapDetect   = (pcTexture != NULL);
@@ -838,5 +852,9 @@
   Bool depthDependent = false;
   UInt uiTexturePart = uiMode;
+#if MTK_I0099_VPS_EX2
+  if(bDepthMapDetect && !bIntraSliceDetect && !rapPic && bLimQtPredFlag )
+#else
   if(bDepthMapDetect && !bIntraSliceDetect && !rapPic && sps->getUseQTL() && sps->getUsePC())
+#endif
   {
     TComDataCU *pcTextureCU = pcTexture->getCU(pcCU->getAddr());
Index: /branches/HTM-11.2-dev0/source/Lib/TLibEncoder/TEncCavlc.cpp
===================================================================
--- /branches/HTM-11.2-dev0/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 1029)
+++ /branches/HTM-11.2-dev0/source/Lib/TLibEncoder/TEncCavlc.cpp	(revision 1030)
@@ -887,4 +887,5 @@
 {
 #if H_3D_QTLPC
+#if !MTK_I0099_VPS_EX2
 //GT: This has to go to VPS
 if( depthFlag )
@@ -893,4 +894,5 @@
   WRITE_FLAG( pcSPS->getUsePC()  ? 1 : 0, "use_pc_flag");
 }
+#endif
 #endif
 }
@@ -1558,12 +1560,27 @@
 Void TEncCavlc::codeVPSExtension2( TComVPS* pcVPS )
 { 
+#if SEC_VPS_CLEANUP_I0090
+  for( Int i = 1; i <= pcVPS->getMaxLayersMinus1(); i++ )
+#else
   for( Int i = 0; i <= pcVPS->getMaxLayersMinus1(); i++ )
-  {
+#endif
+  {
+#if !SEC_VPS_CLEANUP_I0090
     if (i!= 0)
-    {
+#endif
+    {
+#if MTK_I0099_VPS_EX2
+      WRITE_FLAG( pcVPS->getIvMvPredFlag         ( i ) ? 1 : 0 , "iv_mv_pred_flag[i]");
+#if SEC_HLS_CLEANUP_I0100
+      WRITE_FLAG( pcVPS->getIvMvScalingFlag( i ) ? 1 : 0 ,       "iv_mv_scaling_flag[i]" );
+#endif
+
+#endif
       if ( !( pcVPS->getDepthId( i ) == 1 ) )
       {
 #if H_3D_IV_MERGE
+#if !MTK_I0099_VPS_EX2
         WRITE_FLAG( pcVPS->getIvMvPredFlag         ( i ) ? 1 : 0 , "iv_mv_pred_flag[i]");
+#endif
 #if H_3D_SPIVMP
         WRITE_UVLC( pcVPS->getSubPULog2Size(i)-3, "log2_sub_PU_size_minus3[i]");
@@ -1585,4 +1602,5 @@
       else
       {
+#if !MTK_I0099_VPS_EX2
         if(i!=1)
         {
@@ -1595,6 +1613,10 @@
         }
 #endif
+#endif
 #if H_3D_IV_MERGE
         WRITE_FLAG( pcVPS->getMPIFlag( i ) ? 1 : 0 ,          "mpi_flag[i]" );
+#endif
+#if MTK_I0099_VPS_EX2
+        WRITE_UVLC( pcVPS->getSubPUMPILog2Size(i)-3, "log2_mpi_sub_PU_size_minus3[i]");
 #endif
         WRITE_FLAG( pcVPS->getVpsDepthModesFlag( i ) ? 1 : 0 ,          "vps_depth_modes_flag[i]" );
@@ -1602,5 +1624,8 @@
         WRITE_FLAG( pcVPS->getIVPFlag( i ) ? 1 : 0 ,               "IVP_flag[i]" );
 #endif
-        //WRITE_FLAG( pcVPS->getLimQtPredFlag    ( i ) ? 1 : 0 ,          "lim_qt_pred_flag[i]"     ); 
+#if MTK_I0099_VPS_EX2
+        WRITE_FLAG( pcVPS->getLimQtPredFlag    ( i ) ? 1 : 0 ,          "lim_qt_pred_flag[i]"     ); 
+#endif
+
 #if H_3D_INTER_SDC
         WRITE_FLAG( pcVPS->getInterSDCFlag( i ) ? 1 : 0, "depth_inter_SDC_flag" );
@@ -1610,5 +1635,9 @@
   }
   WRITE_UVLC( pcVPS->getCamParPrecision(), "cp_precision" );
+#if SEC_VPS_CLEANUP_I0090
+  for (UInt viewIndex=1; viewIndex<pcVPS->getNumViews(); viewIndex++)
+#else
   for (UInt viewIndex=0; viewIndex<pcVPS->getNumViews(); viewIndex++)
+#endif
   {
     WRITE_FLAG( pcVPS->getCamParPresent(viewIndex) ? 1 : 0, "cp_present_flag[i]" );
@@ -1628,7 +1657,11 @@
     }
   }
+#if !MTK_I0099_VPS_EX2
   WRITE_UVLC( pcVPS->getSubPUMPILog2Size( ) - 3, "log2_sub_PU_MPI_size_minus3");
+#endif
 #if H_3D_TMVP
+#if !SEC_HLS_CLEANUP_I0100
   WRITE_FLAG( pcVPS->getIvMvScalingFlag( ) ? 1 : 0 ,          "iv_mv_scaling_flag" );
+#endif
 #endif
 }
@@ -2016,5 +2049,9 @@
     }
 #if H_3D_IC
+#if SEC_HLS_CLEANUP_I0100
+    else if( pcSlice->getViewIndex() && ( pcSlice->getSliceType() == P_SLICE || pcSlice->getSliceType() == B_SLICE ) && !pcSlice->getIsDepth() && vps->getNumDirectRefLayers( layerId ) > 0 )
+#else
     else if( pcSlice->getViewIndex() && ( pcSlice->getSliceType() == P_SLICE || pcSlice->getSliceType() == B_SLICE ) && !pcSlice->getIsDepth())
+#endif
     {
       WRITE_FLAG( pcSlice->getApplyIC() ? 1 : 0, "slice_ic_enable_flag" );
Index: /branches/HTM-11.2-dev0/source/Lib/TLibEncoder/TEncCfg.h
===================================================================
--- /branches/HTM-11.2-dev0/source/Lib/TLibEncoder/TEncCfg.h	(revision 1029)
+++ /branches/HTM-11.2-dev0/source/Lib/TLibEncoder/TEncCfg.h	(revision 1030)
@@ -426,7 +426,11 @@
   Bool      m_useMPI;
 #endif
+#if !MTK_I0099_VPS_EX2 || MTK_I0099_FIX
 #if H_3D_QTLPC
   Bool      m_bUseQTL;
+#if !MTK_I0099_VPS_EX2
   Bool      m_bUsePC;
+#endif
+#endif
 #endif
 #endif
@@ -1022,9 +1026,13 @@
   Bool       getUseSingleDepthMode          ()               { return m_useSingleDepthMode; }
 #endif
+#if !MTK_I0099_VPS_EX2 || MTK_I0099_FIX
 #if H_3D_QTLPC
   Void      setUseQTL                       ( Bool b ) { m_bUseQTL = b;    }
   Bool      getUseQTL                       ()         { return m_bUseQTL; }
+#if !MTK_I0099_VPS_EX2
   Void      setUsePC                        ( Bool b ) { m_bUsePC  = b;    }
   Bool      getUsePC                        ()         { return m_bUsePC;  }
+#endif
+#endif
 #endif
 #if H_3D_IV_MERGE
Index: /branches/HTM-11.2-dev0/source/Lib/TLibEncoder/TEncCu.cpp
===================================================================
--- /branches/HTM-11.2-dev0/source/Lib/TLibEncoder/TEncCu.cpp	(revision 1029)
+++ /branches/HTM-11.2-dev0/source/Lib/TLibEncoder/TEncCu.cpp	(revision 1030)
@@ -409,5 +409,10 @@
 
 #if H_3D_QTLPC
+#if MTK_I0099_VPS_EX2
+  TComVPS *vps            = pcPic->getSlice(0)->getVPS();
+  Bool  bLimQtPredFalg    = vps->getLimQtPredFlag(pcPic->getSlice(0)->getLayerId()); 
+#else
   TComSPS *sps            = pcPic->getSlice(0)->getSPS();
+#endif
   TComPic *pcTexture      = rpcBestCU->getSlice()->getTexturePic();
 
@@ -531,5 +536,13 @@
       //logic for setting bTrySplit using the partition information that is stored of the texture colocated CU
 
+#if MTK_I0099_VPS_EX2
+#if MTK_I0099_FIX
+      if(depthMapDetect && !bIntraSliceDetect && !rapPic && ( m_pcEncCfg->getUseQTL() || bLimQtPredFalg ))
+#else
+      if(depthMapDetect && !bIntraSliceDetect && !rapPic && bLimQtPredFalg)
+#endif
+#else
       if(depthMapDetect && !bIntraSliceDetect && !rapPic && sps->getUseQTL())
+#endif
       {
         TComDataCU* pcTextureCU = pcTexture->getCU( rpcBestCU->getAddr() ); //Corresponding texture LCU
@@ -685,5 +698,13 @@
 
 #if H_3D_QTLPC      
+#if MTK_I0099_VPS_EX2
+#if MTK_I0099_FIX
+      if(depthMapDetect && !bIntraSliceDetect && !rapPic && ( m_pcEncCfg->getUseQTL() || bLimQtPredFalg ))
+#else
+      if(depthMapDetect && !bIntraSliceDetect && !rapPic && bLimQtPredFalg)
+#endif
+#else
       if(depthMapDetect && !bIntraSliceDetect && !rapPic && sps->getUseQTL())
+#endif
       {
         bTrySplitDQP = bTrySplit;
Index: /branches/HTM-11.2-dev0/source/Lib/TLibEncoder/TEncSbac.cpp
===================================================================
--- /branches/HTM-11.2-dev0/source/Lib/TLibEncoder/TEncSbac.cpp	(revision 1029)
+++ /branches/HTM-11.2-dev0/source/Lib/TLibEncoder/TEncSbac.cpp	(revision 1030)
@@ -714,5 +714,10 @@
   PartSize eSize         = pcCU->getPartitionSize( uiAbsPartIdx );
 #if H_3D_QTLPC
+#if MTK_I0099_VPS_EX2
+  TComVPS *vps           = pcCU->getPic()->getSlice(0)->getVPS();
+  Bool    bLimQtPredFlag = vps->getLimQtPredFlag(pcCU->getPic()->getSlice(0)->getLayerId());
+#else
   TComSPS *sps           = pcCU->getPic()->getSlice(0)->getSPS();
+#endif
   TComPic *pcTexture     = pcCU->getSlice()->getTexturePic();
   Bool bDepthMapDetect   = (pcTexture != NULL);
@@ -723,5 +728,9 @@
   Bool depthDependent = false;
   UInt uiTexturePart = eSize;
+#if MTK_I0099_VPS_EX2
+  if(bDepthMapDetect && !bIntraSliceDetect && !rapPic && pcCU->getPic()->getReduceBitsFlag() && bLimQtPredFlag )
+#else
   if(bDepthMapDetect && !bIntraSliceDetect && !rapPic && pcCU->getPic()->getReduceBitsFlag() && sps->getUseQTL() && sps->getUsePC() )
+#endif
   {
     TComDataCU *pcTextureCU = pcTexture->getCU(pcCU->getAddr());
@@ -1081,5 +1090,10 @@
   Bool bCodeSplitFlag    = true;
 
+#if MTK_I0099_VPS_EX2
+  TComVPS *vps           = pcCU->getPic()->getSlice(0)->getVPS();
+  Bool    bLimQtPredFlag = vps->getLimQtPredFlag(pcCU->getPic()->getSlice(0)->getLayerId());
+#else
   TComSPS *sps           = pcCU->getPic()->getSlice(0)->getSPS();
+#endif
   TComPic *pcTexture     = pcCU->getSlice()->getTexturePic();
   Bool bDepthMapDetect   = (pcTexture != NULL);
@@ -1088,5 +1102,9 @@
   Bool rapPic     = (pcCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || pcCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP || pcCU->getSlice()->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA);
 
+#if MTK_I0099_VPS_EX2
+  if(bDepthMapDetect && !bIntraSliceDetect && !rapPic && pcCU->getPic()->getReduceBitsFlag() && bLimQtPredFlag  )
+#else
   if(bDepthMapDetect && !bIntraSliceDetect && !rapPic && pcCU->getPic()->getReduceBitsFlag() && sps->getUseQTL() && sps->getUsePC())
+#endif
   {
     TComDataCU *pcTextureCU = pcTexture->getCU(pcCU->getAddr());
Index: /branches/HTM-11.2-dev0/source/Lib/TLibEncoder/TEncTop.cpp
===================================================================
--- /branches/HTM-11.2-dev0/source/Lib/TLibEncoder/TEncTop.cpp	(revision 1029)
+++ /branches/HTM-11.2-dev0/source/Lib/TLibEncoder/TEncTop.cpp	(revision 1030)
@@ -744,7 +744,9 @@
   m_cSPS.setUseAMP ( m_useAMP );
 
+#if !MTK_I0099_VPS_EX2
 #if H_3D_QTLPC
   m_cSPS.setUseQTL( m_bUseQTL );
   m_cSPS.setUsePC ( m_bUsePC  );
+#endif
 #endif
 
