Index: /branches/HTM-11.2-dev0/source/Lib/TLibCommon/ContextTables.h
===================================================================
--- /branches/HTM-11.2-dev0/source/Lib/TLibCommon/ContextTables.h	(revision 1028)
+++ /branches/HTM-11.2-dev0/source/Lib/TLibCommon/ContextTables.h	(revision 1029)
@@ -450,9 +450,15 @@
 static const UChar INIT_DBBP_FLAG[3][DBBP_NUM_FLAG_CTX] =
 {
+#if SEC_DBBP_EXPLICIT_SIG_I0077
+  { CNU },
+  { CNU },
+  { CNU },
+#else
   { 161 },
   { 161 },
   { 161 },
-};
-#endif
-
-#endif
+#endif
+};
+#endif
+
+#endif
Index: /branches/HTM-11.2-dev0/source/Lib/TLibCommon/TComDataCU.cpp
===================================================================
--- /branches/HTM-11.2-dev0/source/Lib/TLibCommon/TComDataCU.cpp	(revision 1028)
+++ /branches/HTM-11.2-dev0/source/Lib/TLibCommon/TComDataCU.cpp	(revision 1029)
@@ -3373,4 +3373,5 @@
   for(Int iLoop = 0; iLoop < 2; iLoop ++ ) 
   {
+#if !SEC_SIMP_SHIFTED_DV_I0086
     // IvDcShift (Derived from spatial Iv neighboring blocks)
     if( iLoop == 1 )
@@ -3406,4 +3407,5 @@
       }
     }
+#endif
 
     /// iLoop = 0 --> IvMCShift
@@ -3453,4 +3455,5 @@
 } 
 
+#if !SEC_SIMP_SHIFTED_DV_I0086
 inline Bool TComDataCU::xGetPosFirstAvailDmvCand(Int iCount, Int& posFirstAvailDmvCand )
 {
@@ -3469,4 +3472,5 @@
   return false;  
 }
+#endif
                                       
 #endif
@@ -6146,5 +6150,9 @@
 
   TComMv cMv; 
+#if MTK_I0093
+  Int iDisp     = getSlice()->getDepthToDisparityB( 0 )[ 1 << ( getSlice()->getSPS()->getBitDepthY() - 1 ) ];
+#else
   Int iDisp     = getSlice()->getDepthToDisparityB( 0 )[ 128 ];
+#endif
   cMv.setHor(iDisp);
   cMv.setVer(0);
Index: /branches/HTM-11.2-dev0/source/Lib/TLibCommon/TComDataCU.h
===================================================================
--- /branches/HTM-11.2-dev0/source/Lib/TLibCommon/TComDataCU.h	(revision 1028)
+++ /branches/HTM-11.2-dev0/source/Lib/TLibCommon/TComDataCU.h	(revision 1029)
@@ -250,5 +250,7 @@
 #if H_3D_IV_MERGE
   Bool          xAddIvMRGCand( Int mrgCandIdx, Int& iCount, Int*   ivCandDir, TComMv* ivCandMv, Int* ivCandRefIdx ); 
+#if! SEC_SIMP_SHIFTED_DV_I0086
   Bool          xGetPosFirstAvailDmvCand( Int iCount, Int& iFirDispCand );
+#endif
 #endif
 
Index: /branches/HTM-11.2-dev0/source/Lib/TLibCommon/TComPrediction.cpp
===================================================================
--- /branches/HTM-11.2-dev0/source/Lib/TLibCommon/TComPrediction.cpp	(revision 1028)
+++ /branches/HTM-11.2-dev0/source/Lib/TLibCommon/TComPrediction.cpp	(revision 1029)
@@ -836,5 +836,9 @@
 }
 
+#if SHARP_DBBP_SIMPLE_FLTER_I0109
+Void TComPrediction::combineSegmentsWithMask( TComYuv* pInYuv[2], TComYuv* pOutYuv, Bool* pMask, UInt uiWidth, UInt uiHeight, UInt uiPartAddr, UInt partSize )
+#else
 Void TComPrediction::combineSegmentsWithMask( TComYuv* pInYuv[2], TComYuv* pOutYuv, Bool* pMask, UInt uiWidth, UInt uiHeight, UInt uiPartAddr )
+#endif
 {
   Pel*  piSrc[2]    = {pInYuv[0]->getLumaAddr(uiPartAddr), pInYuv[1]->getLumaAddr(uiPartAddr)};
@@ -844,5 +848,7 @@
   
   UInt  uiMaskStride= MAX_CU_SIZE;
+#if !SHARP_DBBP_SIMPLE_FLTER_I0109
   Pel  filSrc = 0;
+#endif
   Pel* tmpTar = 0;
   tmpTar = (Pel *)xMalloc(Pel, uiWidth*uiHeight);
@@ -868,4 +874,42 @@
   }
   
+#if SHARP_DBBP_SIMPLE_FLTER_I0109
+  if (partSize == SIZE_Nx2N)
+  {
+    for (Int y=0; y<uiHeight; y++)
+    {
+      for (Int x=0; x<uiWidth; x++)
+      {
+        Bool l = (x==0)?pMaskStart[y*uiMaskStride+x]:pMaskStart[y*uiMaskStride+x-1];
+        Bool r = (x==uiWidth-1)?pMaskStart[y*uiMaskStride+x]:pMaskStart[y*uiMaskStride+x+1];
+        
+        Pel left, right;
+        left   = (x==0)          ? tmpTar[y*uiWidth+x] : tmpTar[y*uiWidth+x-1];
+        right  = (x==uiWidth-1)  ? tmpTar[y*uiWidth+x] : tmpTar[y*uiWidth+x+1];
+        
+        piDst[x] = (l!=r) ? ClipY( Pel(( left + (tmpTar[y*uiWidth+x] << 1) + right ) >> 2 )) : tmpTar[y*uiWidth+x]; 
+      }
+      piDst     += uiDstStride;
+    }
+  }
+  else // SIZE_2NxN
+  {
+    for (Int y=0; y<uiHeight; y++)
+    {
+      for (Int x=0; x<uiWidth; x++)
+      {
+        Bool t = (y==0)?pMaskStart[y*uiMaskStride+x]:pMaskStart[(y-1)*uiMaskStride+x];
+        Bool b = (y==uiHeight-1)?pMaskStart[y*uiMaskStride+x]:pMaskStart[(y+1)*uiMaskStride+x];
+        
+        Pel top, bottom;
+        top    = (y==0)          ? tmpTar[y*uiWidth+x] : tmpTar[(y-1)*uiWidth+x];
+        bottom = (y==uiHeight-1) ? tmpTar[y*uiWidth+x] : tmpTar[(y+1)*uiWidth+x];
+        
+        piDst[x] = (t!=b) ? ClipY( Pel(( top + (tmpTar[y*uiWidth+x] << 1) + bottom ) >> 2 )) : tmpTar[y*uiWidth+x];
+      }
+      piDst     += uiDstStride;
+    }
+  }
+#else
   for (Int y=0; y<uiHeight; y++)
   {
@@ -901,4 +945,6 @@
     piDst     += uiDstStride;
   }
+#endif
+
   if ( tmpTar    ) { xFree(tmpTar);             tmpTar        = NULL; }
   
@@ -937,4 +983,72 @@
   }
 
+#if SHARP_DBBP_SIMPLE_FLTER_I0109
+  if (partSize == SIZE_Nx2N)
+  {
+    for (Int y=0; y<uiHeightC; y++)
+    {
+      for (Int x=0; x<uiWidthC; x++)
+      {
+        Bool l = (x==0)?pMaskStart[y*2*uiMaskStride+x*2]:pMaskStart[y*2*uiMaskStride+(x-1)*2];
+        Bool r = (x==uiWidthC-1)?pMaskStart[y*2*uiMaskStride+x*2]:pMaskStart[y*2*uiMaskStride+(x+1)*2];
+
+        Pel leftU, rightU;
+        leftU   = (x==0)           ? tmpTarU[y*uiWidthC+x] : tmpTarU[y*uiWidthC+x-1];
+        rightU  = (x==uiWidthC-1)  ? tmpTarU[y*uiWidthC+x] : tmpTarU[y*uiWidthC+x+1];
+        Pel leftV, rightV;
+        leftV   = (x==0)           ? tmpTarV[y*uiWidthC+x] : tmpTarV[y*uiWidthC+x-1];
+        rightV  = (x==uiWidthC-1)  ? tmpTarV[y*uiWidthC+x] : tmpTarV[y*uiWidthC+x+1];
+
+        if (l!=r)
+        {
+          filSrcU = ClipC( Pel(( leftU + (tmpTarU[y*uiWidthC+x] << 1) + rightU ) >> 2 ));
+          filSrcV = ClipC( Pel(( leftV + (tmpTarV[y*uiWidthC+x] << 1) + rightV ) >> 2 ));
+        }
+        else
+        {
+          filSrcU = tmpTarU[y*uiWidthC+x];
+          filSrcV = tmpTarV[y*uiWidthC+x];
+        }
+        piDstU[x] = filSrcU;
+        piDstV[x] = filSrcV;
+      }
+      piDstU      += uiDstStrideC;
+      piDstV      += uiDstStrideC;
+    }
+  }
+  else
+  {
+    for (Int y=0; y<uiHeightC; y++)
+    {
+      for (Int x=0; x<uiWidthC; x++)
+      {
+        Bool t = (y==0)?pMaskStart[y*2*uiMaskStride+x*2]:pMaskStart[(y-1)*2*uiMaskStride+x*2];
+        Bool b = (y==uiHeightC-1)?pMaskStart[y*2*uiMaskStride+x*2]:pMaskStart[(y+1)*2*uiMaskStride+x*2];
+
+        Pel topU, bottomU;
+        topU    = (y==0)           ? tmpTarU[y*uiWidthC+x] : tmpTarU[(y-1)*uiWidthC+x];
+        bottomU = (y==uiHeightC-1) ? tmpTarU[y*uiWidthC+x] : tmpTarU[(y+1)*uiWidthC+x];
+        Pel topV, bottomV;
+        topV    = (y==0)           ? tmpTarV[y*uiWidthC+x] : tmpTarV[(y-1)*uiWidthC+x];
+        bottomV = (y==uiHeightC-1) ? tmpTarV[y*uiWidthC+x] : tmpTarV[(y+1)*uiWidthC+x];
+
+        if (t!=b)
+        {
+          filSrcU = ClipC( Pel(( topU + (tmpTarU[y*uiWidthC+x] << 1) + bottomU ) >> 2 ));
+          filSrcV = ClipC( Pel(( topV + (tmpTarV[y*uiWidthC+x] << 1) + bottomV ) >> 2 ));
+        }
+        else
+        {
+          filSrcU = tmpTarU[y*uiWidthC+x];
+          filSrcV = tmpTarV[y*uiWidthC+x];
+        }
+        piDstU[x] = filSrcU;
+        piDstV[x] = filSrcV;
+      }
+      piDstU      += uiDstStrideC;
+      piDstV      += uiDstStrideC;
+    }
+  }
+#else
   for (Int y=0; y<uiHeightC; y++)
   {
@@ -982,4 +1096,5 @@
     piDstV      += uiDstStrideC;
   }
+#endif
   if ( tmpTarU    ) { xFree(tmpTarU);             tmpTarU        = NULL; }
   if ( tmpTarV    ) { xFree(tmpTarV);             tmpTarV        = NULL; }
Index: /branches/HTM-11.2-dev0/source/Lib/TLibCommon/TComPrediction.h
===================================================================
--- /branches/HTM-11.2-dev0/source/Lib/TLibCommon/TComPrediction.h	(revision 1028)
+++ /branches/HTM-11.2-dev0/source/Lib/TLibCommon/TComPrediction.h	(revision 1029)
@@ -176,5 +176,9 @@
   PartSize      getPartitionSizeFromDepth(Pel* pDepthPels, UInt uiDepthStride, UInt uiSize);
   Bool          getSegmentMaskFromDepth( Pel* pDepthPels, UInt uiDepthStride, UInt uiWidth, UInt uiHeight, Bool* pMask );
+#if SHARP_DBBP_SIMPLE_FLTER_I0109
+  Void          combineSegmentsWithMask( TComYuv* pInYuv[2], TComYuv* pOutYuv, Bool* pMask, UInt uiWidth, UInt uiHeight, UInt uiPartAddr, UInt partSize );
+#else
   Void          combineSegmentsWithMask( TComYuv* pInYuv[2], TComYuv* pOutYuv, Bool* pMask, UInt uiWidth, UInt uiHeight, UInt uiPartAddr = 0 );
+#endif
 #endif
 
Index: /branches/HTM-11.2-dev0/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- /branches/HTM-11.2-dev0/source/Lib/TLibCommon/TypeDef.h	(revision 1028)
+++ /branches/HTM-11.2-dev0/source/Lib/TLibCommon/TypeDef.h	(revision 1029)
@@ -68,4 +68,5 @@
 #define BUG_FIX_TK65        1
 
+#define MTK_I0093           1
 /////////////////////////////////////////////////////////////////////////////////////////
 ///////////////////////////////////   MAJOR DEFINES   ///////////////////////////////////  
@@ -172,4 +173,6 @@
                                               // MTK_DIS_SPBIP8X4_H0205        Disable bi-prediction for 8x4 and 4x8 sub PU and remove the SPIVMP 2Nx2N restriction
                                               // SEC_ADAPT_DISABLE_IVMP        Disalbing IVMP merge candidates when IC is enabled, JCT3V-H0070
+
+#define SEC_SIMP_SHIFTED_DV_I0086         1   // Simplification of Shifted DV candidate, JCT3V-I0086
 
 #define H_3D_TMVP                         1   // QC_TMVP_C0047 
@@ -237,4 +240,7 @@
                                               // H_3D_FIX_DBBP_IVMP        Fix . Enable IVMP is always disabled, when DBBP is enabled. The original intention is to disable Sub-PU IVMP when DBBP is enabled, not to disable IVMP itself. 
 
+#define SEC_DBBP_EXPLICIT_SIG_I0077       1   // Remove the partition derivation and signal dbbp_flag only when the partion mode is 2NxN/Nx2N, JCT3V-I0077
+#define SEC_DBBP_DISALLOW_8x8_I0078       1   // Disallow DBBP in 8x8 CU, JCT3V-I0078
+#define SHARP_DBBP_SIMPLE_FLTER_I0109     1   // Simple condition and one dimensional dilter for DBBP
 #define SEC_DBBP_DMM4_THRESHOLD_I0076     1   // Simplification of threshold derivation for DBBP and DMM4, JCT3V-I0076
 
Index: /branches/HTM-11.2-dev0/source/Lib/TLibDecoder/TDecCu.cpp
===================================================================
--- /branches/HTM-11.2-dev0/source/Lib/TLibDecoder/TDecCu.cpp	(revision 1028)
+++ /branches/HTM-11.2-dev0/source/Lib/TLibDecoder/TDecCu.cpp	(revision 1029)
@@ -924,5 +924,9 @@
   
   // reconstruct final prediction signal by combining both segments
+#if SHARP_DBBP_SIMPLE_FLTER_I0109
+  m_pcPrediction->combineSegmentsWithMask(apSegPredYuv, m_ppcYuvReco[uiDepth], pMask, pcCU->getWidth(0), pcCU->getHeight(0), 0, ePartSize);
+#else
   m_pcPrediction->combineSegmentsWithMask(apSegPredYuv, m_ppcYuvReco[uiDepth], pMask, pcCU->getWidth(0), pcCU->getHeight(0));
+#endif
   
   // inter recon
Index: /branches/HTM-11.2-dev0/source/Lib/TLibDecoder/TDecEntropy.cpp
===================================================================
--- /branches/HTM-11.2-dev0/source/Lib/TLibDecoder/TDecEntropy.cpp	(revision 1028)
+++ /branches/HTM-11.2-dev0/source/Lib/TLibDecoder/TDecEntropy.cpp	(revision 1029)
@@ -153,8 +153,20 @@
 #if H_3D_DBBP
 
+#if SEC_DBBP_EXPLICIT_SIG_I0077
+#if SEC_DBBP_DISALLOW_8x8_I0078
+  if( pcCU->getSlice()->getVPS()->getUseDBBP(pcCU->getSlice()->getLayerIdInVps()) && (pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2NxN || pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_Nx2N) && pcCU->getWidth(uiAbsPartIdx) > 8 )
+#else
+  if( pcCU->getSlice()->getVPS()->getUseDBBP(pcCU->getSlice()->getLayerIdInVps()) && (pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2NxN || pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_Nx2N) )
+#endif
+#else
+#if SEC_DBBP_DISALLOW_8x8_I0078
+  if( pcCU->getSlice()->getVPS()->getUseDBBP(pcCU->getSlice()->getLayerIdInVps()) && pcCU->getWidth(uiAbsPartIdx) > 8 )
+#else
   if( pcCU->getSlice()->getVPS()->getUseDBBP(pcCU->getSlice()->getLayerIdInVps()) )
+#endif
+#endif
   {
     decodeDBBPFlag(pcCU, uiAbsPartIdx, uiDepth);
-    
+#if !SEC_DBBP_EXPLICIT_SIG_I0077    
     if( pcCU->getDBBPFlag(uiAbsPartIdx) )
     {
@@ -180,4 +192,5 @@
       pcCU->setDBBPFlagSubParts(true, uiAbsPartIdx+uiPUOffset, 1, uiDepth);
     }
+#endif
   }
 #endif
Index: /branches/HTM-11.2-dev0/source/Lib/TLibDecoder/TDecSbac.cpp
===================================================================
--- /branches/HTM-11.2-dev0/source/Lib/TLibDecoder/TDecSbac.cpp	(revision 1028)
+++ /branches/HTM-11.2-dev0/source/Lib/TLibDecoder/TDecSbac.cpp	(revision 1029)
@@ -2262,4 +2262,11 @@
   m_pcTDecBinIf->decodeBin( uiSymbol, m_cDBBPFlagSCModel.get( 0, 0, 0 ) );
   
+#if SEC_DBBP_EXPLICIT_SIG_I0077
+  PartSize ePartSize = pcCU->getPartitionSize( uiAbsPartIdx );
+  AOF( ePartSize == SIZE_2NxN || ePartSize == SIZE_Nx2N );
+  UInt uiPUOffset = ( g_auiPUOffset[UInt( ePartSize )] << ( ( pcCU->getSlice()->getSPS()->getMaxCUDepth() - uiDepth ) << 1 ) ) >> 4;
+  pcCU->setDBBPFlagSubParts(uiSymbol, uiAbsPartIdx, 0, uiDepth);
+  pcCU->setDBBPFlagSubParts(uiSymbol, uiAbsPartIdx+uiPUOffset, 1, uiDepth);
+#else
   if( uiSymbol )
   {
@@ -2268,4 +2275,5 @@
     pcCU->setDBBPFlagSubParts(true, uiAbsPartIdx + 2*uiCurrPartNumQ, 1, uiDepth);
   }
+#endif
 }
 #endif
Index: /branches/HTM-11.2-dev0/source/Lib/TLibEncoder/TEncCu.cpp
===================================================================
--- /branches/HTM-11.2-dev0/source/Lib/TLibEncoder/TEncCu.cpp	(revision 1028)
+++ /branches/HTM-11.2-dev0/source/Lib/TLibEncoder/TEncCu.cpp	(revision 1029)
@@ -2545,4 +2545,11 @@
   AOF( uiWidth == uiHeight );
   
+#if SEC_DBBP_DISALLOW_8x8_I0078
+  if(uiWidth <= 8)
+  {
+    return;
+  }
+#endif
+  
   rpcTempCU->setPartSizeSubParts( SIZE_2Nx2N,  0, uhDepth );
   
@@ -2641,5 +2648,9 @@
   
   // reconstruct final prediction signal by combining both segments
+#if SHARP_DBBP_SIMPLE_FLTER_I0109
+  m_pcPredSearch->combineSegmentsWithMask(apPredYuv, m_ppcPredYuvTemp[uhDepth], pMask, uiWidth, uiHeight, 0, eVirtualPartSize);
+#else
   m_pcPredSearch->combineSegmentsWithMask(apPredYuv, m_ppcPredYuvTemp[uhDepth], pMask, uiWidth, uiHeight);
+#endif
   
   m_pcPredSearch->encodeResAndCalcRdInterCU( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcResiYuvBest[uhDepth], m_ppcRecoYuvTemp[uhDepth], false );
Index: /branches/HTM-11.2-dev0/source/Lib/TLibEncoder/TEncEntropy.cpp
===================================================================
--- /branches/HTM-11.2-dev0/source/Lib/TLibEncoder/TEncEntropy.cpp	(revision 1028)
+++ /branches/HTM-11.2-dev0/source/Lib/TLibEncoder/TEncEntropy.cpp	(revision 1029)
@@ -262,4 +262,5 @@
   
 #if H_3D_DBBP
+#if! SEC_DBBP_EXPLICIT_SIG_I0077
   PartSize eVirtualPartSize = pcCU->getPartitionSize(uiAbsPartIdx);
   if( pcCU->getDBBPFlag(uiAbsPartIdx) )
@@ -271,12 +272,25 @@
   }
 #endif
+#endif
   
   m_pcEntropyCoderIf->codePartSize( pcCU, uiAbsPartIdx, uiDepth );
   
 #if H_3D_DBBP
+#if SEC_DBBP_EXPLICIT_SIG_I0077
+#if SEC_DBBP_DISALLOW_8x8_I0078
+  if( pcCU->getSlice()->getVPS()->getUseDBBP(pcCU->getSlice()->getLayerIdInVps()) && (pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2NxN || pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_Nx2N) && pcCU->getWidth(uiAbsPartIdx) > 8 )
+#else
+  if( pcCU->getSlice()->getVPS()->getUseDBBP(pcCU->getSlice()->getLayerIdInVps()) && (pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2NxN || pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_Nx2N) )
+#endif
+#else
+#if SEC_DBBP_DISALLOW_8x8_I0078
+  if( pcCU->getSlice()->getVPS()->getUseDBBP(pcCU->getSlice()->getLayerIdInVps()) && pcCU->getWidth(uiAbsPartIdx) > 8 )
+#else
   if( pcCU->getSlice()->getVPS()->getUseDBBP(pcCU->getSlice()->getLayerIdInVps()) )
+#endif
+#endif
   {
     encodeDBBPFlag(pcCU, uiAbsPartIdx, bRD);
-    
+#if !SEC_DBBP_EXPLICIT_SIG_I0077
     if( pcCU->getDBBPFlag(uiAbsPartIdx) )
     {
@@ -284,4 +298,5 @@
       pcCU->setPartSizeSubParts(eVirtualPartSize, uiAbsPartIdx, uiDepth);
     }
+#endif
   }
 #endif
Index: /branches/HTM-11.2-dev0/source/Lib/TLibEncoder/TEncSbac.cpp
===================================================================
--- /branches/HTM-11.2-dev0/source/Lib/TLibEncoder/TEncSbac.cpp	(revision 1028)
+++ /branches/HTM-11.2-dev0/source/Lib/TLibEncoder/TEncSbac.cpp	(revision 1029)
@@ -2418,4 +2418,8 @@
 Void TEncSbac::codeDBBPFlag( TComDataCU* pcCU, UInt uiAbsPartIdx )
 {
+#if SEC_DBBP_EXPLICIT_SIG_I0077
+  PartSize ePartSize = pcCU->getPartitionSize( uiAbsPartIdx );
+  AOF( ePartSize == SIZE_2NxN || ePartSize == SIZE_Nx2N );
+#endif
   AOF( pcCU->getSlice()->getVPS()->getUseDBBP(pcCU->getSlice()->getLayerIdInVps()) );
   AOF( !pcCU->getSlice()->getIsDepth() );
