Ignore:
Timestamp:
16 Aug 2013, 10:38:21 (11 years ago)
Author:
ntt
Message:

Integration for the adoptions in E0207, E0208, and E0141 by NTT.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-DEV-2.0-dev1-NTT/source/Lib/TLibCommon/TComPrediction.cpp

    r566 r576  
    6363  if (m_pDepthBlock != NULL)
    6464      free(m_pDepthBlock);
     65#if NTT_VSP_COMMON_E0207_E0208
     66  m_cYuvDepthOnVsp.destroy();
     67#endif
    6568#endif
    6669
     
    119122    m_acYuvPredBase[0] .create( g_uiMaxCUWidth, g_uiMaxCUHeight );
    120123    m_acYuvPredBase[1] .create( g_uiMaxCUWidth, g_uiMaxCUHeight );
     124#endif
     125#if NTT_VSP_COMMON_E0207_E0208
     126    m_cYuvDepthOnVsp.create( g_uiMaxCUWidth, g_uiMaxCUHeight );
    121127#endif
    122128  }
     
    729735#endif
    730736  pcCU->clipMv(cDv);
     737
     738#if NTT_VSP_COMMON_E0207_E0208
     739  // fetch virtual depth map
     740#if NTT_VSP_VECTOR_CLIP_E0208
     741  pcBaseViewDepthPicYuv->extendPicBorder();
     742#endif
     743  xGetVirtualDepth( pcCU, pcBaseViewDepthPicYuv, &cDv, uiPartAddr, iWidth, iHeight, &m_cYuvDepthOnVsp );
     744  // sub-PU based compensation
     745  xPredInterLumaBlkFromDM   ( pcCU, pcBaseViewTxtPicYuv, &m_cYuvDepthOnVsp, pShiftLUT, &cDv, uiPartAddr, iWidth, iHeight, pcCU->getSlice()->getIsDepth(), rpcYuvPred, bi );
     746  xPredInterChromaBlkFromDM ( pcCU, pcBaseViewTxtPicYuv, &m_cYuvDepthOnVsp, pShiftLUT, &cDv, uiPartAddr, iWidth, iHeight, pcCU->getSlice()->getIsDepth(), rpcYuvPred, bi );
     747#else
    731748  UInt uiAbsPartIdx = pcCU->getZorderIdxInCU();
    732749  Int iBlkX = ( pcCU->getAddr() % pRefPicBaseDepth->getFrameWidthInCU() ) * g_uiMaxCUWidth  + g_auiRasterToPelX[ g_auiZscanToRaster[ uiAbsPartIdx ] ];
     
    734751  xPredInterLumaBlkFromDM  ( pcBaseViewTxtPicYuv, pcBaseViewDepthPicYuv, pShiftLUT, &cDv, uiPartAddr, iBlkX,    iBlkY,    iWidth,    iHeight,    pcCU->getSlice()->getIsDepth(), rpcYuvPred, bi );
    735752  xPredInterChromaBlkFromDM( pcBaseViewTxtPicYuv, pcBaseViewDepthPicYuv, pShiftLUT, &cDv, uiPartAddr, iBlkX>>1, iBlkY>>1, iWidth>>1, iHeight>>1, pcCU->getSlice()->getIsDepth(), rpcYuvPred, bi );
     753#endif
     754
    736755}
    737756#endif
     
    15131532
    15141533#if H_3D_VSP
     1534
     1535#if NTT_VSP_COMMON_E0207_E0208
     1536// not fully support iRatioTxtPerDepth* != 1
     1537Void TComPrediction::xGetVirtualDepth( TComDataCU *pcCU, TComPicYuv *pcPicRefDepth, TComMv *pcMv, UInt partAddr, Int iWidth, Int iHeight, TComYuv *pcYuvDepth, Int iRatioTxtPerDepthX, Int iRatioTxtPerDepthY )
     1538{
     1539  Int nTxtPerDepthX = H_3D_VSP_BLOCKSIZE;
     1540  Int nTxtPerDepthY = H_3D_VSP_BLOCKSIZE;
     1541
     1542  Int refDepStride = pcPicRefDepth->getStride();
     1543
     1544#if NTT_VSP_VECTOR_CLIP_E0208
     1545
     1546  Int refDepOffset = ( (pcMv->getHor()+2) >> 2 ) + ( (pcMv->getVer()+2) >> 2 ) * refDepStride;
     1547
     1548#if 1 // // iRatioTxtPerDepthX==1 && iRatioTxtPerDepthY==1
     1549  Pel *refDepth    = pcPicRefDepth->getLumaAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() + partAddr );
     1550#else
     1551  Pel *refDepth    = pcPicRefDepth->getLumaAddr( );
     1552  Int iPosX, iPosY;
     1553  pcCU->getPic()->getPicYuvRec()->getTopLeftSamplePos( pcCU->getAddr(), pcCU->getZorderIdxInCU() + partAddr, iPosX, iPosY ); // top-left position in texture
     1554  iPosX /= iRatioTxtPerDepthX; // texture position -> depth postion
     1555  iPosY /= iRatioTxtPerDepthY;
     1556  refDepOffset += iPosX + iPosY * refDepStride;
     1557
     1558  iWidth  /= iRatioTxtPerDepthX; // texture size -> depth size
     1559  iHeight /= iRatioTxtPerDepthY;
     1560#endif
     1561
     1562  refDepth += refDepOffset;
     1563
     1564#else // NTT_VSP_VECTOR_CLIP_E0208
     1565
     1566  Int widthDepth = pcPicRefDepth->getWidth();
     1567  Int heightDepth = pcPicRefDepth->getHeight();
     1568  Int iPosX, iPosY;
     1569  pcCU->getPic()->getPicYuvRec()->getTopLeftSamplePos( pcCU->getAddr(), pcCU->getZorderIdxInCU() + partAddr, iPosX, iPosY ); // top-left position in texture
     1570  iPosX /= iRatioTxtPerDepthX; // texture position -> depth postion
     1571  iPosY /= iRatioTxtPerDepthY;
     1572 
     1573  iPosX = Clip3(0, widthDepth-iWidth,   iPosX + ((pcMv->getHor()+2)>>2));
     1574  iPosY = Clip3(0, heightDepth-iHeight, iPosY + ((pcMv->getVer()+2)>>2));
     1575 
     1576  Pel *refDepth  = pcPicRefDepth->getLumaAddr() + iPosX + iPosY * refDepStride;
     1577
     1578#endif // NTT_VSP_VECTOR_CLIP_E0208
     1579
     1580  Int depStride = pcYuvDepth->getStride();
     1581  Pel *depth = pcYuvDepth->getLumaAddr();
     1582
     1583#if NTT_VSP_ADAPTIVE_SPLIT_E0207
     1584
     1585  if( iWidth<8 || iHeight<8 )
     1586  { // no split
     1587    Int rightOffset = iWidth - 1;
     1588    Int depStrideBlock = depStride * nTxtPerDepthY;
     1589    Pel *refDepthTop = refDepth;
     1590    Pel *refDepthBot = refDepthTop + (iHeight-1)*refDepStride;
     1591
     1592    Pel maxDepth = refDepthTop[0] > refDepthBot[0] ? refDepthTop[0] : refDepthBot[0];
     1593    if( maxDepth < refDepthTop[rightOffset] ) maxDepth = refDepthTop[rightOffset];
     1594    if( maxDepth < refDepthBot[rightOffset] ) maxDepth = refDepthBot[rightOffset];
     1595
     1596    for( Int sY=0; sY<iHeight; sY+=nTxtPerDepthY )
     1597    {
     1598      for( Int sX=0; sX<iWidth; sX+=nTxtPerDepthX )
     1599      {
     1600        depth[sX] = maxDepth;
     1601      }
     1602      depth += depStrideBlock;
     1603    }
     1604  }
     1605  else
     1606  { // split to 4x8, or 8x4
     1607    Int blocksize    = 8;
     1608    Int subblocksize = 4;
     1609    Int depStrideBlock = depStride * blocksize;
     1610    Pel *depthTmp = NULL;
     1611    Int depStrideTmp = depStride * nTxtPerDepthY;
     1612    Int offset[4] = { 0, subblocksize-1, subblocksize, blocksize-1 };
     1613    Pel *refDepthTmp[4] = { NULL, NULL, NULL, NULL };
     1614    Pel repDepth4x8[2] = {0, 0};
     1615    Pel repDepth8x4[2] = {0, 0};
     1616
     1617    Int refDepStrideBlock    = refDepStride * blocksize;
     1618    Int refDepStrideSubBlock = refDepStride * subblocksize;
     1619
     1620    refDepthTmp[0] = refDepth;
     1621    refDepthTmp[2] = refDepthTmp[0] + refDepStrideSubBlock;
     1622    refDepthTmp[1] = refDepthTmp[2] - refDepStride;
     1623    refDepthTmp[3] = refDepthTmp[1] + refDepStrideSubBlock;
     1624
     1625    for( Int y=0; y<iHeight; y+=blocksize )
     1626    {
     1627      for( Int x=0; x<iWidth; x+=blocksize )
     1628      {
     1629        Bool ULvsBR = false, URvsBL = false;
     1630
     1631        ULvsBR = refDepthTmp[0][x+offset[0]] < refDepthTmp[3][x+offset[3]];
     1632        URvsBL = refDepthTmp[0][x+offset[3]] < refDepthTmp[3][x+offset[0]];
     1633
     1634        if( ULvsBR ^ URvsBL )
     1635        { // 4x8
     1636          repDepth4x8[0] = refDepthTmp[0][x+offset[0]] > refDepthTmp[0][x+offset[1]] ? refDepthTmp[0][x+offset[0]] : refDepthTmp[0][x+offset[1]];
     1637          if( repDepth4x8[0] < refDepthTmp[3][x+offset[0]] ) repDepth4x8[0] = refDepthTmp[3][x+offset[0]];
     1638          if( repDepth4x8[0] < refDepthTmp[3][x+offset[1]] ) repDepth4x8[0] = refDepthTmp[3][x+offset[1]];
     1639          repDepth4x8[1] = refDepthTmp[0][x+offset[2]] > refDepthTmp[0][x+offset[3]] ? refDepthTmp[0][x+offset[2]] : refDepthTmp[0][x+offset[3]];
     1640          if( repDepth4x8[1] < refDepthTmp[3][x+offset[2]] ) repDepth4x8[1] = refDepthTmp[3][x+offset[2]];
     1641          if( repDepth4x8[1] < refDepthTmp[3][x+offset[3]] ) repDepth4x8[1] = refDepthTmp[3][x+offset[3]];
     1642
     1643          depthTmp = &depth[x];
     1644          for( Int sY=0; sY<blocksize; sY+=nTxtPerDepthY )
     1645          {
     1646            for( Int sX=0; sX<subblocksize; sX+=nTxtPerDepthX )
     1647            {
     1648              depthTmp[sX] = repDepth4x8[0];
     1649            }
     1650            depthTmp += depStrideTmp;
     1651          }
     1652          depthTmp = &depth[x+subblocksize];
     1653          for( Int sY=0; sY<blocksize; sY+=nTxtPerDepthY )
     1654          {
     1655            for( Int sX=0; sX<subblocksize; sX+=nTxtPerDepthX )
     1656            {
     1657              depthTmp[sX] = repDepth4x8[1];
     1658            }
     1659            depthTmp += depStrideTmp;
     1660          }
     1661        }
     1662        else
     1663        { // 8x4
     1664          repDepth8x4[0] = refDepthTmp[0][x+offset[0]] > refDepthTmp[0][x+offset[3]] ? refDepthTmp[0][x+offset[0]] : refDepthTmp[0][x+offset[3]];
     1665          if( repDepth8x4[0] < refDepthTmp[1][x+offset[0]] ) repDepth8x4[0] = refDepthTmp[1][x+offset[0]];
     1666          if( repDepth8x4[0] < refDepthTmp[1][x+offset[3]] ) repDepth8x4[0] = refDepthTmp[1][x+offset[3]];
     1667          repDepth8x4[1] = refDepthTmp[2][x+offset[0]] > refDepthTmp[2][x+offset[3]] ? refDepthTmp[2][x+offset[0]] : refDepthTmp[2][x+offset[3]];
     1668          if( repDepth8x4[1] < refDepthTmp[3][x+offset[0]] ) repDepth8x4[1] = refDepthTmp[3][x+offset[0]];
     1669          if( repDepth8x4[1] < refDepthTmp[3][x+offset[3]] ) repDepth8x4[1] = refDepthTmp[3][x+offset[3]];
     1670         
     1671          depthTmp = &depth[x];
     1672          for( Int sY=0; sY<subblocksize; sY+=nTxtPerDepthY )
     1673          {
     1674            for( Int sX=0; sX<blocksize; sX+=nTxtPerDepthX )
     1675            {
     1676              depthTmp[sX] = repDepth8x4[0];
     1677            }
     1678            depthTmp += depStrideTmp;
     1679          }
     1680          for( Int sY=0; sY<subblocksize; sY+=nTxtPerDepthY )
     1681          {
     1682            for( Int sX=0; sX<blocksize; sX+=nTxtPerDepthX )
     1683            {
     1684              depthTmp[sX] = repDepth8x4[1];
     1685            }
     1686            depthTmp += depStrideTmp;
     1687          }
     1688        }
     1689      }
     1690      refDepthTmp[0] += refDepStrideBlock;
     1691      refDepthTmp[1] += refDepStrideBlock;
     1692      refDepthTmp[2] += refDepStrideBlock;
     1693      refDepthTmp[3] += refDepStrideBlock;
     1694      depth       += depStrideBlock;
     1695    }
     1696  }
     1697
     1698#else // NTT_VSP_ADAPTIVE_SPLIT_E0207
     1699
     1700  Int rightOffset = nTxtPerDepthX - 1;
     1701  Int depStrideBlock = depStride * nTxtPerDepthY;
     1702  Int refDepStrideBlock = refDepStride * nTxtPerDepthY;
     1703  Pel *refDepthTop = refDepth;
     1704  Pel *refDepthBot = refDepthTop + (nTxtPerDepthY-1)*refDepStride;
     1705
     1706  for( Int y=0; y<iHeight; y+= nTxtPerDepthY )
     1707  {
     1708    for( Int x=0; x<iWidth; x+=nTxtPerDepthX )
     1709    {
     1710      Pel maxDepth = refDepthTop[x] > refDepthBot[x] ? refDepthTop[x] : refDepthBot[x];
     1711
     1712      if( maxDepth < refDepthTop[x+rightOffset] ) maxDepth = refDepthTop[x+rightOffset];
     1713      if( maxDepth < refDepthBot[x+rightOffset] ) maxDepth = refDepthBot[x+rightOffset];
     1714
     1715      depth[x] = maxDepth;
     1716
     1717    }
     1718    refDepthTop += refDepStrideBlock;
     1719    refDepthBot += refDepStrideBlock;
     1720    depth       += depStrideBlock;
     1721  }
     1722
     1723#endif // NTT_VSP_ADAPTIVE_SPLIT_E0207
     1724}
     1725
     1726Void TComPrediction::xPredInterLumaBlkFromDM( TComDataCU *pcCU, TComPicYuv *pcPicRef, TComYuv *pcYuvDepth, Int* pShiftLUT, TComMv *pcMv, UInt partAddr, Int iWidth, Int iHeight, Bool bIsDepth, TComYuv *&pcYuvDst, Bool bIsBi )
     1727{
     1728  Int nTxtPerDepthX = H_3D_VSP_BLOCKSIZE;
     1729  Int nTxtPerDepthY = H_3D_VSP_BLOCKSIZE;
     1730 
     1731  Int refStride = pcPicRef->getStride();
     1732  Int dstStride = pcYuvDst->getStride();
     1733  Int depStride = pcYuvDepth->getStride();
     1734  Int refStrideBlock = refStride  * nTxtPerDepthY;
     1735  Int dstStrideBlock = dstStride * nTxtPerDepthY;
     1736  Int depStrideBlock = depStride * nTxtPerDepthY;
     1737
     1738  Pel *ref    = pcPicRef->getLumaAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() + partAddr );
     1739  Pel *dst    = pcYuvDst->getLumaAddr(partAddr);
     1740  Pel *depth  = pcYuvDepth->getLumaAddr();
     1741 
     1742#if !(NTT_VSP_DC_BUGFIX_E0208)
     1743  Int widthLuma = pcPicRef->getWidth();
     1744  Int iPosX, iPosY;
     1745  pcCU->getPic()->getPicYuvRec()->getTopLeftSamplePos( pcCU->getAddr(), pcCU->getZorderIdxInCU() + partAddr, iPosX, iPosY ); // top-left position in texture
     1746#endif
     1747
     1748#if H_3D_VSP_BLOCKSIZE == 1
     1749#if H_3D_VSP_CONSTRAINED
     1750  //get LUT based horizontal reference range
     1751  Int range = xGetConstrainedSize(iWidth, iHeight);
     1752
     1753  // The minimum depth value
     1754  Int minRelativePos = MAX_INT;
     1755  Int maxRelativePos = MIN_INT;
     1756
     1757  Pel* depthTemp, *depthInitial=depth;
     1758  for (Int yTxt = 0; yTxt < iHeight; yTxt++)
     1759  {
     1760    for (Int xTxt = 0; xTxt < iWidth; xTxt++)
     1761    {
     1762      if (depthPosX+xTxt < widthDepth)
     1763        depthTemp = depthInitial + xTxt;
     1764      else
     1765        depthTemp = depthInitial + (widthDepth - depthPosX - 1);
     1766
     1767      Int disparity = pShiftLUT[ *depthTemp ]; // << iShiftPrec;
     1768      Int disparityInt = disparity >> 2;
     1769
     1770      if( disparity <= 0)
     1771      {
     1772        if (minRelativePos > disparityInt+xTxt)
     1773            minRelativePos = disparityInt+xTxt;
     1774      }
     1775      else
     1776      {
     1777        if (maxRelativePos < disparityInt+xTxt)
     1778            maxRelativePos = disparityInt+xTxt;
     1779      }
     1780    }
     1781    if (depthPosY+yTxt < heightDepth)
     1782      depthInitial = depthInitial + depStride;
     1783  }
     1784
     1785  Int disparity_tmp = pShiftLUT[ *depth ]; // << iShiftPrec;
     1786  if (disparity_tmp <= 0)
     1787    maxRelativePos = minRelativePos + range -1 ;
     1788  else
     1789    minRelativePos = maxRelativePos - range +1 ;
     1790#endif
     1791#endif // H_3D_VSP_BLOCKSIZE == 1
     1792
     1793  TComMv cDv(0, 0);
     1794
     1795  for ( Int yTxt = 0; yTxt < iHeight; yTxt += nTxtPerDepthY )
     1796  {
     1797    for ( Int xTxt = 0; xTxt < iWidth; xTxt += nTxtPerDepthX )
     1798    {
     1799      Pel repDepth = depth[ xTxt ];
     1800      assert( repDepth >= 0 && repDepth <= 255 );
     1801
     1802      Int disparity = pShiftLUT[ repDepth ]; // remove << iShiftPrec ??
     1803      Int xFrac = disparity & 0x3;
     1804
     1805#if NTT_VSP_DC_BUGFIX_E0208
     1806
     1807      cDv.setHor( disparity );
     1808      pcCU->clipMv( cDv );
     1809
     1810      Int refOffset = xTxt + (cDv.getHor() >> 2);
     1811     
     1812#if H_3D_VSP_CONSTRAINED
     1813      if(refOffset<minRelativePos || refOffset>maxRelativePos)
     1814        xFrac = 0;
     1815      refOffset = Clip3(minRelativePos, maxRelativePos, refOffset);
     1816#endif
     1817
     1818      assert( ref[refOffset] >= 0 && ref[refOffset]<= 255 );
     1819      m_if.filterHorLuma( &ref[refOffset], refStride, &dst[xTxt], dstStride, nTxtPerDepthX, nTxtPerDepthY, xFrac, !bIsBi );
     1820
     1821#else // NTT_VSP_DC_BUGFIX_E0208
     1822
     1823      for( Int j=0; j < nTxtPerDepthX; j++ )
     1824      {
     1825        Int refOffset = xTxt+j + (disparity >> 2);
     1826#if H_3D_VSP_CONSTRAINED
     1827        if(refOffset<minRelativePos || refOffset>maxRelativePos)
     1828          xFrac = 0;
     1829        refOffset = Clip3(minRelativePos, maxRelativePos, refOffset);
     1830#endif
     1831        Int absX  = iPosX + refOffset;
     1832
     1833        if (xFrac == 0)
     1834          absX = Clip3(0, widthLuma-1, absX);
     1835        else
     1836          absX = Clip3(4, widthLuma-5, absX);
     1837
     1838        refOffset = absX - iPosX;
     1839        assert( ref[refOffset] >= 0 && ref[refOffset] <= 255 );
     1840       
     1841        m_if.filterHorLuma( &ref[refOffset], refStride, &dst[xTxt+j], dstStride, 1, nTxtPerDepthY, xFrac, !bIsBi );
     1842      }
     1843
     1844#endif // NTT_VSP_DC_BUGFIX_E0208
     1845
     1846    }
     1847    ref   += refStrideBlock;
     1848    dst   += dstStrideBlock;
     1849    depth += depStrideBlock;
     1850  }
     1851
     1852}
     1853
     1854Void TComPrediction::xPredInterChromaBlkFromDM  ( TComDataCU *pcCU, TComPicYuv *pcPicRef, TComYuv *pcYuvDepth, Int* pShiftLUT, TComMv *pcMv, UInt partAddr, Int iWidth, Int iHeight, Bool bIsDepth, TComYuv *&pcYuvDst, Bool bIsBi )
     1855{
     1856#if (H_3D_VSP_BLOCKSIZE==1)
     1857  Int nTxtPerDepthX = 1;
     1858  Int nTxtPerDepthY = 1;
     1859#else
     1860  Int nTxtPerDepthX = H_3D_VSP_BLOCKSIZE >> 1;
     1861  Int nTxtPerDepthY = H_3D_VSP_BLOCKSIZE >> 1;
     1862#endif
     1863
     1864  Int refStride = pcPicRef->getCStride();
     1865  Int dstStride = pcYuvDst->getCStride();
     1866  Int depStride = pcYuvDepth->getStride();
     1867  Int refStrideBlock = refStride * nTxtPerDepthY;
     1868  Int dstStrideBlock = dstStride * nTxtPerDepthY;
     1869  Int depStrideBlock = depStride * (nTxtPerDepthY<<1);
     1870
     1871  Pel *refCb  = pcPicRef->getCbAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() + partAddr );
     1872  Pel *refCr  = pcPicRef->getCrAddr( pcCU->getAddr(), pcCU->getZorderIdxInCU() + partAddr );
     1873  Pel *dstCb  = pcYuvDst->getCbAddr(partAddr);
     1874  Pel *dstCr  = pcYuvDst->getCrAddr(partAddr);
     1875  Pel *depth  = pcYuvDepth->getLumaAddr();
     1876
     1877#if 0 // not necessary??
     1878  if (bIsDepth)
     1879  {
     1880    Pel val = 128;
     1881    iHeight >>=1; // luma to chroma
     1882    iWidth >>=1;
     1883    if ( bIsBi )
     1884    {
     1885      Int shift = IF_INTERNAL_PREC - ( g_uiBitDepth + g_uiBitIncrement );
     1886      val = (val << shift) - (Pel)IF_INTERNAL_OFFS;
     1887    }
     1888    for (Int y = 0; y < iHeight; y++)
     1889    {
     1890      for (Int x = 0; x < iWidth; x++)
     1891      {
     1892        dstCb[x] = val;
     1893        dstCr[x] = val;
     1894      }
     1895      dstCb += dstStride;
     1896      dstCr += dstStride;
     1897    }
     1898    return;
     1899  }
     1900#endif
     1901
     1902#if !(NTT_VSP_DC_BUGFIX_E0208)
     1903  Int widthChroma = pcPicRef->getWidth() >> 1;
     1904  Int iPosX, iPosY;
     1905  pcCU->getPic()->getPicYuvRec()->getTopLeftSamplePos( pcCU->getAddr(), pcCU->getZorderIdxInCU() + partAddr, iPosX, iPosY ); // top-left position in texture
     1906  iPosX >>= 1;
     1907  iPosY >>= 1;
     1908#endif
     1909 
     1910#if H_3D_VSP_BLOCKSIZE == 1
     1911#if H_3D_VSP_CONSTRAINED
     1912  //get LUT based horizontal reference range
     1913  Int range = xGetConstrainedSize(iWidth, iHeight, false);
     1914
     1915  // The minimum depth value
     1916  Int minRelativePos = MAX_INT;
     1917  Int maxRelativePos = MIN_INT;
     1918
     1919  Int depthTmp;
     1920  for (Int yTxt=0; yTxt<iHeight; yTxt++)
     1921  {
     1922    for (Int xTxt=0; xTxt<iWidth; xTxt++)
     1923    {
     1924      depthTmp = m_pDepthBlock[xTxt+yTxt*dW];
     1925      Int disparity = pShiftLUT[ depthTmp ]; // << iShiftPrec;
     1926      Int disparityInt = disparity >> 3;//in chroma resolution
     1927
     1928      if (disparityInt < 0)
     1929      {
     1930        if (minRelativePos > disparityInt+xTxt)
     1931            minRelativePos = disparityInt+xTxt;
     1932      }
     1933      else
     1934      {
     1935        if (maxRelativePos < disparityInt+xTxt)
     1936            maxRelativePos = disparityInt+xTxt;
     1937      }
     1938    }
     1939  }
     1940
     1941  depthTmp = m_pDepthBlock[0];
     1942  Int disparity_tmp = pShiftLUT[ depthTmp ]; // << iShiftPrec;
     1943  if ( disparity_tmp < 0 )
     1944    maxRelativePos = minRelativePos + range - 1;
     1945  else
     1946    minRelativePos = maxRelativePos - range + 1;
     1947
     1948#endif // H_3D_VSP_CONSTRAINED
     1949#endif // H_3D_VSP_BLOCKSIZE == 1
     1950
     1951  TComMv cDv(0, 0);
     1952  // luma size -> chroma size
     1953  iHeight >>= 1;
     1954  iWidth  >>= 1;
     1955
     1956  for ( Int yTxt = 0; yTxt < iHeight; yTxt += nTxtPerDepthY )
     1957  {
     1958    for ( Int xTxt = 0; xTxt < iWidth; xTxt += nTxtPerDepthX )
     1959    {
     1960      Pel repDepth = depth[ xTxt<<1 ];
     1961      assert( repDepth >= 0 && repDepth <= 255 );
     1962
     1963      Int disparity = pShiftLUT[ repDepth ]; // remove << iShiftPrec;
     1964      Int xFrac = disparity & 0x7;
     1965     
     1966#if NTT_VSP_DC_BUGFIX_E0208
     1967
     1968      cDv.setHor( disparity );
     1969      pcCU->clipMv( cDv );
     1970
     1971      Int refOffset = xTxt + (cDv.getHor() >> 3);
     1972
     1973#if H_3D_VSP_CONSTRAINED
     1974      if(refOffset<minRelativePos || refOffset>maxRelativePos)
     1975        xFrac = 0;
     1976      refOffset = Clip3(minRelativePos, maxRelativePos, refOffset);
     1977#endif
     1978
     1979      assert( refCb[refOffset] >= 0 && refCb[refOffset]<= 255 );
     1980      assert( refCr[refOffset] >= 0 && refCr[refOffset]<= 255 );
     1981
     1982      m_if.filterHorChroma( &refCb[refOffset], refStride, &dstCb[xTxt], dstStride, nTxtPerDepthX, nTxtPerDepthY, xFrac, !bIsBi );
     1983      m_if.filterHorChroma( &refCr[refOffset], refStride, &dstCr[xTxt], dstStride, nTxtPerDepthX, nTxtPerDepthY, xFrac, !bIsBi );
     1984
     1985#else // NTT_VSP_DC_BUGFIX_E0208
     1986     
     1987      for( Int j=0; j < nTxtPerDepthX; j++ )
     1988      {
     1989        Int refOffset = xTxt+j + (disparity >> 3);
     1990#if H_3D_VSP_CONSTRAINED
     1991        if(refOffset<minRelativePos || refOffset>maxRelativePos)
     1992          xFrac = 0;
     1993        refOffset = Clip3(minRelativePos, maxRelativePos, refOffset);
     1994#endif
     1995        Int absX  = iPosX + refOffset;
     1996
     1997        if (xFrac == 0)
     1998          absX = Clip3(0, widthChroma-1, absX);
     1999        else
     2000          absX = Clip3(4, widthChroma-5, absX);
     2001
     2002        refOffset = absX - iPosX;
     2003        assert( refCb[refOffset] >= 0 && refCb[refOffset] <= 255 );
     2004        assert( refCr[refOffset] >= 0 && refCr[refOffset] <= 255 );
     2005
     2006        m_if.filterHorChroma( &refCb[refOffset], refStride, &dstCb[xTxt+j], dstStride, 1, nTxtPerDepthY, xFrac, !bIsBi );
     2007        m_if.filterHorChroma( &refCr[refOffset], refStride, &dstCr[xTxt+j], dstStride, 1, nTxtPerDepthY, xFrac, !bIsBi );
     2008      }
     2009
     2010#endif // NTT_VSP_DC_BUGFIX_E0208
     2011    }
     2012    refCb += refStrideBlock;
     2013    refCr += refStrideBlock;
     2014    dstCb += dstStrideBlock;
     2015    dstCr += dstStrideBlock;
     2016    depth += depStrideBlock;
     2017  }
     2018
     2019}
     2020#else // NTT_VSP_COMMON_E0207_E0208
     2021
    15152022// Input:
    15162023// refPic: Ref picture. Full picture, with padding
     
    19662473}
    19672474
     2475#endif // NTT_VSP_COMMON_E0207_E0208
     2476
    19682477#if H_3D_VSP_CONSTRAINED
    19692478Int TComPrediction::xGetConstrainedSize(Int nPbW, Int nPbH, Bool bLuma)
Note: See TracChangeset for help on using the changeset viewer.