Changeset 706 in 3DVCSoftware


Ignore:
Timestamp:
20 Nov 2013, 01:48:42 (10 years ago)
Author:
sharpjp-htm
Message:

Integration of F0102

Location:
branches/HTM-8.2-dev1-Sharp2
Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-8.2-dev1-Sharp2/source/Lib/TLibCommon/TComPrediction.cpp

    r704 r706  
    16701670  Pel *depth = yuvDepth->getLumaAddr();
    16711671
     1672#if !SHARP_VSP_BLOCK_IN_AMP_F0102
    16721673  if( width<8 || height<8 )
    16731674  { // no split
     
    17071708    Pel repDepth4x8[2] = {0, 0};
    17081709    Pel repDepth8x4[2] = {0, 0};
     1710#endif
    17091711
    17101712#if !MTK_F0109_LG_F0120_VSP_BLOCK
     1713#if SHARP_VSP_BLOCK_IN_AMP_F0102
     1714    Int blocksize    = 8;
     1715    Int subblocksize = 4;
     1716    Int depStrideBlock = depStride * blocksize;
     1717    Pel *depthTmp = NULL;
     1718    Int depStrideTmp = depStride * nTxtPerDepthY;
     1719    Int offset[4] = { 0, subblocksize-1, subblocksize, blocksize-1 };
     1720    Pel *refDepthTmp[4] = { NULL, NULL, NULL, NULL };
     1721#endif
    17111722    Int refDepStrideBlock    = refDepStride * blocksize;
    17121723    Int refDepStrideSubBlock = refDepStride * subblocksize;
     
    17171728    refDepthTmp[3] = refDepthTmp[1] + refDepStrideSubBlock;
    17181729
     1730#if SHARP_VSP_BLOCK_IN_AMP_F0102
     1731    Int subBlockW, subBlockH;
     1732    Int blockW, blockH;
     1733    subBlockW = subBlockH = 8;
     1734    if (height % 8)
     1735    {
     1736      subBlockW = 8;
     1737      subBlockH = 4;
     1738      blockW = width;  // no further split
     1739      blockH = height; // no further split
     1740    }
     1741    else if (width % 8)
     1742    {
     1743      subBlockW = 4;
     1744      subBlockH = 8;
     1745      blockW = width;  // no further split
     1746      blockH = height; // no further split
     1747    }
     1748    else
     1749    {
     1750      blockW = blockH = 8;
     1751    }
     1752    for( Int y=0; y<height; y+=blockH )
     1753    {
     1754      for( Int x=0; x<width; x+=blockW )
     1755      {
     1756        if (blockW == 8 && blockH == 8)
     1757        {
     1758          Bool ULvsBR = false, URvsBL = false;
     1759          ULvsBR = refDepthTmp[0][x+offset[0]] < refDepthTmp[3][x+offset[3]];
     1760          URvsBL = refDepthTmp[0][x+offset[3]] < refDepthTmp[3][x+offset[0]];
     1761          if( ULvsBR ^ URvsBL )
     1762          { // 4x8
     1763            subBlockW = 4;
     1764            subBlockH = 8;
     1765          }
     1766          else
     1767          {
     1768            subBlockW = 8;
     1769            subBlockH = 4;
     1770          }
     1771        }
     1772        for( Int yy=0; yy<blockH; yy+=subBlockH )
     1773        {
     1774          for( Int xx=0; xx<blockW; xx+=subBlockW )
     1775          {
     1776            Pel  maxDepthVal = 0;
     1777            Int xP0, xP1, yP0, yP1;
     1778            xP0 = x+xx;
     1779            xP1 = x+xx+subBlockW-1;
     1780            yP0 = yy;
     1781            yP1 = yy+subBlockH-1;
     1782            maxDepthVal = std::max( maxDepthVal, refDepthTmp[0][xP0+yP0*refDepStride]);
     1783            maxDepthVal = std::max( maxDepthVal, refDepthTmp[0][xP1+yP0*refDepStride]);
     1784            maxDepthVal = std::max( maxDepthVal, refDepthTmp[0][xP0+yP1*refDepStride]);
     1785            maxDepthVal = std::max( maxDepthVal, refDepthTmp[0][xP1+yP1*refDepStride]);
     1786            depthTmp = &depth[x+xx+yy*depStride];
     1787            for( Int sY=0; sY<subBlockH; sY+=nTxtPerDepthY )
     1788            {
     1789              for( Int sX=0; sX<subBlockW; sX+=nTxtPerDepthX )
     1790              {
     1791                depthTmp[sX] = maxDepthVal;
     1792              }
     1793              depthTmp += depStrideTmp;
     1794            }
     1795          }
     1796        }
     1797      }
     1798      refDepthTmp[0] += refDepStrideBlock;
     1799      depth       += depStrideBlock;
     1800    }
     1801#else // SHARP_VSP_BLOCK_IN_AMP_F0102
    17191802    for( Int y=0; y<height; y+=blocksize )
    17201803    {
     
    18121895      depth       += depStrideBlock;
    18131896    }
     1897#endif // SHARP_VSP_BLOCK_IN_AMP_F0102
    18141898#else
     1899#if SHARP_VSP_BLOCK_IN_AMP_F0102
     1900  if ((height % 8))
     1901  {
     1902    vspSize = 1; // 8x4
     1903  }
     1904  else if ((width % 8))
     1905  {
     1906    vspSize = 0; // 4x8
     1907  }
     1908  else
     1909  {
     1910    Bool ULvsBR, URvsBL;
     1911    ULvsBR = refDepth[0]       < refDepth[refDepStride * (height-1) + width-1];
     1912    URvsBL = refDepth[width-1] < refDepth[refDepStride * (height-1)];
     1913    vspSize = ( ULvsBR ^ URvsBL ) ? 0 : 1;
     1914  }
     1915  Int subBlockW, subBlockH;
     1916  Int depStrideTmp = depStride * nTxtPerDepthY;
     1917  if (vspSize)
     1918  {
     1919    subBlockW = 8;
     1920    subBlockH = 4;
     1921  }
     1922  else
     1923  {
     1924    subBlockW = 4;
     1925    subBlockH = 8;
     1926  }
     1927  for( Int y=0; y<height; y+=subBlockH )
     1928  {
     1929    Pel *refDepthTmp[4];
     1930    refDepthTmp[0] = refDepth + refDepStride * y;
     1931    refDepthTmp[1] = refDepthTmp[0] + subBlockW - 1;
     1932    refDepthTmp[2] = refDepthTmp[0] + refDepStride * (subBlockH - 1);
     1933    refDepthTmp[3] = refDepthTmp[2] + subBlockW - 1;
     1934    for( Int x=0; x<width; x+=subBlockW )
     1935    {
     1936      Pel  maxDepthVal;
     1937      maxDepthVal = refDepthTmp[0][x];
     1938      maxDepthVal = std::max( maxDepthVal, refDepthTmp[1][x]);
     1939      maxDepthVal = std::max( maxDepthVal, refDepthTmp[2][x]);
     1940      maxDepthVal = std::max( maxDepthVal, refDepthTmp[3][x]);
     1941      Pel *depthTmp = &depth[x+y*depStride];
     1942      for( Int sY=0; sY<subBlockH; sY+=nTxtPerDepthY )
     1943      {
     1944        for( Int sX=0; sX<subBlockW; sX+=nTxtPerDepthX )
     1945        {
     1946          depthTmp[sX] = maxDepthVal;
     1947        }
     1948        depthTmp += depStrideTmp;
     1949      }
     1950    }
     1951  }
     1952#else // SHARP_VSP_BLOCK_IN_AMP_F0102
    18151953    Int refDepStrideBlock    = refDepStride * height;
    18161954    Int refDepStrideSubBlock = refDepStride * height/2;
     
    19352073    }
    19362074  }
    1937 #endif
    1938   }
     2075#endif   
     2076#endif
     2077#if !SHARP_VSP_BLOCK_IN_AMP_F0102
     2078  }
     2079#endif
    19392080
    19402081
  • branches/HTM-8.2-dev1-Sharp2/source/Lib/TLibCommon/TypeDef.h

    r704 r706  
    226226#if H_3D_VSP
    227227#define MTK_F0109_LG_F0120_VSP_BLOCK      1   // MTK_LG_SIMPLIFY_VSP_BLOCK_PARTITION_F0109_F0120 
     228#define SHARP_VSP_BLOCK_IN_AMP_F0102      1   // VSP partitioning for AMP
     229#define FIX_VSP                           0
    228230#define H_3D_VSP_BLOCKSIZE                4   // Supported values: 1, 2, and 4
    229231#if H_3D_VSP_BLOCKSIZE == 1
Note: See TracChangeset for help on using the changeset viewer.