Index: branches/HTM-8.2-dev1-Sharp2/source/Lib/TLibCommon/TComPrediction.cpp
===================================================================
--- branches/HTM-8.2-dev1-Sharp2/source/Lib/TLibCommon/TComPrediction.cpp	(revision 705)
+++ branches/HTM-8.2-dev1-Sharp2/source/Lib/TLibCommon/TComPrediction.cpp	(revision 706)
@@ -1670,4 +1670,5 @@
   Pel *depth = yuvDepth->getLumaAddr();
 
+#if !SHARP_VSP_BLOCK_IN_AMP_F0102
   if( width<8 || height<8 )
   { // no split
@@ -1707,6 +1708,16 @@
     Pel repDepth4x8[2] = {0, 0};
     Pel repDepth8x4[2] = {0, 0};
+#endif
 
 #if !MTK_F0109_LG_F0120_VSP_BLOCK
+#if SHARP_VSP_BLOCK_IN_AMP_F0102
+    Int blocksize    = 8;
+    Int subblocksize = 4;
+    Int depStrideBlock = depStride * blocksize;
+    Pel *depthTmp = NULL;
+    Int depStrideTmp = depStride * nTxtPerDepthY;
+    Int offset[4] = { 0, subblocksize-1, subblocksize, blocksize-1 };
+    Pel *refDepthTmp[4] = { NULL, NULL, NULL, NULL };
+#endif
     Int refDepStrideBlock    = refDepStride * blocksize;
     Int refDepStrideSubBlock = refDepStride * subblocksize;
@@ -1717,4 +1728,76 @@
     refDepthTmp[3] = refDepthTmp[1] + refDepStrideSubBlock;
 
+#if SHARP_VSP_BLOCK_IN_AMP_F0102
+    Int subBlockW, subBlockH;
+    Int blockW, blockH;
+    subBlockW = subBlockH = 8;
+    if (height % 8)
+    {
+      subBlockW = 8;
+      subBlockH = 4;
+      blockW = width;  // no further split
+      blockH = height; // no further split
+    }
+    else if (width % 8)
+    {
+      subBlockW = 4;
+      subBlockH = 8;
+      blockW = width;  // no further split
+      blockH = height; // no further split
+    }
+    else
+    {
+      blockW = blockH = 8;
+    }
+    for( Int y=0; y<height; y+=blockH )
+    {
+      for( Int x=0; x<width; x+=blockW )
+      {
+        if (blockW == 8 && blockH == 8)
+        {
+          Bool ULvsBR = false, URvsBL = false;
+          ULvsBR = refDepthTmp[0][x+offset[0]] < refDepthTmp[3][x+offset[3]];
+          URvsBL = refDepthTmp[0][x+offset[3]] < refDepthTmp[3][x+offset[0]];
+          if( ULvsBR ^ URvsBL )
+          { // 4x8
+            subBlockW = 4;
+            subBlockH = 8;
+          }
+          else
+          {
+            subBlockW = 8;
+            subBlockH = 4;
+          }
+        }
+        for( Int yy=0; yy<blockH; yy+=subBlockH )
+        {
+          for( Int xx=0; xx<blockW; xx+=subBlockW )
+          {
+            Pel  maxDepthVal = 0;
+            Int xP0, xP1, yP0, yP1;
+            xP0 = x+xx;
+            xP1 = x+xx+subBlockW-1;
+            yP0 = yy;
+            yP1 = yy+subBlockH-1;
+            maxDepthVal = std::max( maxDepthVal, refDepthTmp[0][xP0+yP0*refDepStride]);
+            maxDepthVal = std::max( maxDepthVal, refDepthTmp[0][xP1+yP0*refDepStride]);
+            maxDepthVal = std::max( maxDepthVal, refDepthTmp[0][xP0+yP1*refDepStride]);
+            maxDepthVal = std::max( maxDepthVal, refDepthTmp[0][xP1+yP1*refDepStride]);
+            depthTmp = &depth[x+xx+yy*depStride];
+            for( Int sY=0; sY<subBlockH; sY+=nTxtPerDepthY )
+            {
+              for( Int sX=0; sX<subBlockW; sX+=nTxtPerDepthX )
+              {
+                depthTmp[sX] = maxDepthVal;
+              }
+              depthTmp += depStrideTmp;
+            }
+          }
+        }
+      }
+      refDepthTmp[0] += refDepStrideBlock;
+      depth       += depStrideBlock;
+    }
+#else // SHARP_VSP_BLOCK_IN_AMP_F0102
     for( Int y=0; y<height; y+=blocksize )
     {
@@ -1812,5 +1895,60 @@
       depth       += depStrideBlock;
     }
+#endif // SHARP_VSP_BLOCK_IN_AMP_F0102
 #else
+#if SHARP_VSP_BLOCK_IN_AMP_F0102
+  if ((height % 8))
+  {
+    vspSize = 1; // 8x4
+  }
+  else if ((width % 8))
+  {
+    vspSize = 0; // 4x8
+  }
+  else
+  {
+    Bool ULvsBR, URvsBL;
+    ULvsBR = refDepth[0]       < refDepth[refDepStride * (height-1) + width-1];
+    URvsBL = refDepth[width-1] < refDepth[refDepStride * (height-1)];
+    vspSize = ( ULvsBR ^ URvsBL ) ? 0 : 1;
+  }
+  Int subBlockW, subBlockH;
+  Int depStrideTmp = depStride * nTxtPerDepthY;
+  if (vspSize)
+  {
+    subBlockW = 8;
+    subBlockH = 4;
+  }
+  else
+  {
+    subBlockW = 4;
+    subBlockH = 8;
+  }
+  for( Int y=0; y<height; y+=subBlockH )
+  {
+    Pel *refDepthTmp[4];
+    refDepthTmp[0] = refDepth + refDepStride * y;
+    refDepthTmp[1] = refDepthTmp[0] + subBlockW - 1;
+    refDepthTmp[2] = refDepthTmp[0] + refDepStride * (subBlockH - 1);
+    refDepthTmp[3] = refDepthTmp[2] + subBlockW - 1;
+    for( Int x=0; x<width; x+=subBlockW )
+    {
+      Pel  maxDepthVal;
+      maxDepthVal = refDepthTmp[0][x];
+      maxDepthVal = std::max( maxDepthVal, refDepthTmp[1][x]);
+      maxDepthVal = std::max( maxDepthVal, refDepthTmp[2][x]);
+      maxDepthVal = std::max( maxDepthVal, refDepthTmp[3][x]);
+      Pel *depthTmp = &depth[x+y*depStride];
+      for( Int sY=0; sY<subBlockH; sY+=nTxtPerDepthY )
+      {
+        for( Int sX=0; sX<subBlockW; sX+=nTxtPerDepthX )
+        {
+          depthTmp[sX] = maxDepthVal;
+        }
+        depthTmp += depStrideTmp;
+      }
+    }
+  }
+#else // SHARP_VSP_BLOCK_IN_AMP_F0102
     Int refDepStrideBlock    = refDepStride * height;
     Int refDepStrideSubBlock = refDepStride * height/2;
@@ -1935,6 +2073,9 @@
     }
   }
-#endif
-  }
+#endif    
+#endif
+#if !SHARP_VSP_BLOCK_IN_AMP_F0102
+  }
+#endif
 
 
Index: branches/HTM-8.2-dev1-Sharp2/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- branches/HTM-8.2-dev1-Sharp2/source/Lib/TLibCommon/TypeDef.h	(revision 705)
+++ branches/HTM-8.2-dev1-Sharp2/source/Lib/TLibCommon/TypeDef.h	(revision 706)
@@ -226,4 +226,6 @@
 #if H_3D_VSP
 #define MTK_F0109_LG_F0120_VSP_BLOCK      1   // MTK_LG_SIMPLIFY_VSP_BLOCK_PARTITION_F0109_F0120  
+#define SHARP_VSP_BLOCK_IN_AMP_F0102      1   // VSP partitioning for AMP
+#define FIX_VSP                           0
 #define H_3D_VSP_BLOCKSIZE                4   // Supported values: 1, 2, and 4
 #if H_3D_VSP_BLOCKSIZE == 1
