Changeset 578 in 3DVCSoftware for branches/HTMDEV2.0dev1NTT/source/Lib/TLibCommon/TComPrediction.cpp
 Timestamp:
 16 Aug 2013, 14:40:59 (11 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

branches/HTMDEV2.0dev1NTT/source/Lib/TLibCommon/TComPrediction.cpp
r576 r578 1535 1535 #if NTT_VSP_COMMON_E0207_E0208 1536 1536 // not fully support iRatioTxtPerDepth* != 1 1537 Void TComPrediction::xGetVirtualDepth( TComDataCU * pcCU, TComPicYuv *pcPicRefDepth, TComMv *pcMv, UInt partAddr, Int iWidth, Int iHeight, TComYuv *pcYuvDepth, Int iRatioTxtPerDepthX, Int iRatioTxtPerDepthY )1537 Void TComPrediction::xGetVirtualDepth( TComDataCU *cu, TComPicYuv *picRefDepth, TComMv *mv, UInt partAddr, Int width, Int height, TComYuv *yuvDepth, Int ratioTxtPerDepthX, Int ratioTxtPerDepthY ) 1538 1538 { 1539 1539 Int nTxtPerDepthX = H_3D_VSP_BLOCKSIZE; 1540 1540 Int nTxtPerDepthY = H_3D_VSP_BLOCKSIZE; 1541 1541 1542 Int refDepStride = p cPicRefDepth>getStride();1542 Int refDepStride = picRefDepth>getStride(); 1543 1543 1544 1544 #if NTT_VSP_VECTOR_CLIP_E0208 1545 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 ); // topleft position in texture1554 iPosX /= iRatioTxtPerDepthX; // texture position > depth postion1555 iPosY /= iRatioTxtPerDepthY;1556 refDepOffset += iPosX + iPosY * refDepStride;1557 1558 iWidth /= iRatioTxtPerDepthX; // texture size > depth size1559 iHeight /= iRatioTxtPerDepthY;1560 #endif 1546 Int refDepOffset = ( (mv>getHor()+2) >> 2 ) + ( (mv>getVer()+2) >> 2 ) * refDepStride; 1547 Pel *refDepth = picRefDepth>getLumaAddr( cu>getAddr(), cu>getZorderIdxInCU() + partAddr ); 1548 1549 if( ratioTxtPerDepthX!=1  ratioTxtPerDepthY!=1 ) 1550 { 1551 Int posX, posY; 1552 refDepth = picRefDepth>getLumaAddr( ); 1553 cu>getPic()>getPicYuvRec()>getTopLeftSamplePos( cu>getAddr(), cu>getZorderIdxInCU() + partAddr, posX, posY ); // topleft position in texture 1554 posX /= ratioTxtPerDepthX; // texture position > depth postion 1555 posY /= ratioTxtPerDepthY; 1556 refDepOffset += posX + posY * refDepStride; 1557 1558 width /= ratioTxtPerDepthX; // texture size > depth size 1559 height /= ratioTxtPerDepthY; 1560 } 1561 1561 1562 1562 refDepth += refDepOffset; … … 1564 1564 #else // NTT_VSP_VECTOR_CLIP_E0208 1565 1565 1566 Int widthDepth = p cPicRefDepth>getWidth();1567 Int heightDepth = p cPicRefDepth>getHeight();1568 Int iPosX, iPosY;1569 pcCU>getPic()>getPicYuvRec()>getTopLeftSamplePos( pcCU>getAddr(), pcCU>getZorderIdxInCU() + partAddr, iPosX, iPosY ); // topleft position in texture1570 iPosX /= iRatioTxtPerDepthX; // texture position > depth postion1571 iPosY /= iRatioTxtPerDepthY;1566 Int widthDepth = picRefDepth>getWidth(); 1567 Int heightDepth = picRefDepth>getHeight(); 1568 Int posX, posY; 1569 cu>getPic()>getPicYuvRec()>getTopLeftSamplePos( cu>getAddr(), cu>getZorderIdxInCU() + partAddr, posX, posY ); // topleft position in texture 1570 posX /= ratioTxtPerDepthX; // texture position > depth postion 1571 posY /= ratioTxtPerDepthY; 1572 1572 1573 iPosX = Clip3(0, widthDepthiWidth, iPosX + ((pcMv>getHor()+2)>>2));1574 iPosY = Clip3(0, heightDepthiHeight, iPosY + ((pcMv>getVer()+2)>>2));1573 posX = Clip3(0, widthDepthwidth, posX + ((mv>getHor()+2)>>2)); 1574 posY = Clip3(0, heightDepthheight, posY + ((mv>getVer()+2)>>2)); 1575 1575 1576 Pel *refDepth = p cPicRefDepth>getLumaAddr() + iPosX + iPosY * refDepStride;1576 Pel *refDepth = picRefDepth>getLumaAddr() + posX + posY * refDepStride; 1577 1577 1578 1578 #endif // NTT_VSP_VECTOR_CLIP_E0208 1579 1579 1580 Int depStride = pcYuvDepth>getStride();1581 Pel *depth = pcYuvDepth>getLumaAddr();1580 Int depStride = yuvDepth>getStride(); 1581 Pel *depth = yuvDepth>getLumaAddr(); 1582 1582 1583 1583 #if NTT_VSP_ADAPTIVE_SPLIT_E0207 1584 1584 1585 if( iWidth<8  iHeight<8 )1585 if( width<8  height<8 ) 1586 1586 { // no split 1587 Int rightOffset = iWidth  1;1587 Int rightOffset = width  1; 1588 1588 Int depStrideBlock = depStride * nTxtPerDepthY; 1589 1589 Pel *refDepthTop = refDepth; 1590 Pel *refDepthBot = refDepthTop + ( iHeight1)*refDepStride;1590 Pel *refDepthBot = refDepthTop + (height1)*refDepStride; 1591 1591 1592 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 )1593 if( maxDepth < refDepthTop[rightOffset] ) { maxDepth = refDepthTop[rightOffset]; } 1594 if( maxDepth < refDepthBot[rightOffset] ) { maxDepth = refDepthBot[rightOffset]; } 1595 1596 for( Int sY=0; sY<height; sY+=nTxtPerDepthY ) 1597 { 1598 for( Int sX=0; sX<width; sX+=nTxtPerDepthX ) 1599 1599 { 1600 1600 depth[sX] = maxDepth; … … 1623 1623 refDepthTmp[3] = refDepthTmp[1] + refDepStrideSubBlock; 1624 1624 1625 for( Int y=0; y< iHeight; y+=blocksize )1626 { 1627 for( Int x=0; x< iWidth; x+=blocksize )1625 for( Int y=0; y<height; y+=blocksize ) 1626 { 1627 for( Int x=0; x<width; x+=blocksize ) 1628 1628 { 1629 1629 Bool ULvsBR = false, URvsBL = false; … … 1635 1635 { // 4x8 1636 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]]; 1637 if( repDepth4x8[0] < refDepthTmp[3][x+offset[0]] ) 1638 { 1639 repDepth4x8[0] = refDepthTmp[3][x+offset[0]]; 1640 } 1641 if( repDepth4x8[0] < refDepthTmp[3][x+offset[1]] ) 1642 { 1643 repDepth4x8[0] = refDepthTmp[3][x+offset[1]]; 1644 } 1639 1645 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]]; 1646 if( repDepth4x8[1] < refDepthTmp[3][x+offset[2]] ) 1647 { 1648 repDepth4x8[1] = refDepthTmp[3][x+offset[2]]; 1649 } 1650 if( repDepth4x8[1] < refDepthTmp[3][x+offset[3]] ) 1651 { 1652 repDepth4x8[1] = refDepthTmp[3][x+offset[3]]; 1653 } 1642 1654 1643 1655 depthTmp = &depth[x]; … … 1663 1675 { // 8x4 1664 1676 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]]; 1677 if( repDepth8x4[0] < refDepthTmp[1][x+offset[0]] ) 1678 { 1679 repDepth8x4[0] = refDepthTmp[1][x+offset[0]]; 1680 } 1681 if( repDepth8x4[0] < refDepthTmp[1][x+offset[3]] ) 1682 { 1683 repDepth8x4[0] = refDepthTmp[1][x+offset[3]]; 1684 } 1667 1685 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]]; 1686 if( repDepth8x4[1] < refDepthTmp[3][x+offset[0]] ) 1687 { 1688 repDepth8x4[1] = refDepthTmp[3][x+offset[0]]; 1689 } 1690 if( repDepth8x4[1] < refDepthTmp[3][x+offset[3]] ) 1691 { 1692 repDepth8x4[1] = refDepthTmp[3][x+offset[3]]; 1693 } 1670 1694 1671 1695 depthTmp = &depth[x]; … … 1704 1728 Pel *refDepthBot = refDepthTop + (nTxtPerDepthY1)*refDepStride; 1705 1729 1706 for( Int y=0; y< iHeight; y+= nTxtPerDepthY )1707 { 1708 for( Int x=0; x< iWidth; x+=nTxtPerDepthX )1730 for( Int y=0; y<height; y+= nTxtPerDepthY ) 1731 { 1732 for( Int x=0; x<width; x+=nTxtPerDepthX ) 1709 1733 { 1710 1734 Pel maxDepth = refDepthTop[x] > refDepthBot[x] ? refDepthTop[x] : refDepthBot[x]; 1711 1735 1712 if( maxDepth < refDepthTop[x+rightOffset] ) maxDepth = refDepthTop[x+rightOffset]; 1713 if( maxDepth < refDepthBot[x+rightOffset] ) maxDepth = refDepthBot[x+rightOffset]; 1736 if( maxDepth < refDepthTop[x+rightOffset] ) 1737 { 1738 maxDepth = refDepthTop[x+rightOffset]; 1739 } 1740 if( maxDepth < refDepthBot[x+rightOffset] ) 1741 { 1742 maxDepth = refDepthBot[x+rightOffset]; 1743 } 1714 1744 1715 1745 depth[x] = maxDepth; … … 1724 1754 } 1725 1755 1726 Void TComPrediction::xPredInterLumaBlkFromDM( TComDataCU * pcCU, TComPicYuv *pcPicRef, TComYuv *pcYuvDepth, Int* pShiftLUT, TComMv *pcMv, UInt partAddr, Int iWidth, Int iHeight, Bool bIsDepth, TComYuv *&pcYuvDst, Bool bIsBi )1756 Void TComPrediction::xPredInterLumaBlkFromDM( TComDataCU *cu, TComPicYuv *picRef, TComYuv *yuvDepth, Int* shiftLUT, TComMv *mv, UInt partAddr, Int width, Int height, Bool isDepth, TComYuv *&yuvDst, Bool isBi ) 1727 1757 { 1728 1758 Int nTxtPerDepthX = H_3D_VSP_BLOCKSIZE; 1729 1759 Int nTxtPerDepthY = H_3D_VSP_BLOCKSIZE; 1730 1760 1731 Int refStride = p cPicRef>getStride();1732 Int dstStride = pcYuvDst>getStride();1733 Int depStride = pcYuvDepth>getStride();1761 Int refStride = picRef>getStride(); 1762 Int dstStride = yuvDst>getStride(); 1763 Int depStride = yuvDepth>getStride(); 1734 1764 Int refStrideBlock = refStride * nTxtPerDepthY; 1735 1765 Int dstStrideBlock = dstStride * nTxtPerDepthY; 1736 1766 Int depStrideBlock = depStride * nTxtPerDepthY; 1737 1767 1738 Pel *ref = p cPicRef>getLumaAddr( pcCU>getAddr(), pcCU>getZorderIdxInCU() + partAddr );1739 Pel *dst = pcYuvDst>getLumaAddr(partAddr);1740 Pel *depth = pcYuvDepth>getLumaAddr();1768 Pel *ref = picRef>getLumaAddr( cu>getAddr(), cu>getZorderIdxInCU() + partAddr ); 1769 Pel *dst = yuvDst>getLumaAddr(partAddr); 1770 Pel *depth = yuvDepth>getLumaAddr(); 1741 1771 1742 1772 #if !(NTT_VSP_DC_BUGFIX_E0208) 1743 Int widthLuma = p cPicRef>getWidth();1744 Int iPosX, iPosY;1745 pcCU>getPic()>getPicYuvRec()>getTopLeftSamplePos( pcCU>getAddr(), pcCU>getZorderIdxInCU() + partAddr, iPosX, iPosY ); // topleft position in texture1773 Int widthLuma = picRef>getWidth(); 1774 Int posX, posY; 1775 cu>getPic()>getPicYuvRec()>getTopLeftSamplePos( cu>getAddr(), cu>getZorderIdxInCU() + partAddr, posX, posY ); // topleft position in texture 1746 1776 #endif 1747 1777 … … 1749 1779 #if H_3D_VSP_CONSTRAINED 1750 1780 //get LUT based horizontal reference range 1751 Int range = xGetConstrainedSize( iWidth, iHeight);1781 Int range = xGetConstrainedSize(width, height); 1752 1782 1753 1783 // The minimum depth value … … 1756 1786 1757 1787 Pel* depthTemp, *depthInitial=depth; 1758 for (Int yTxt = 0; yTxt < iHeight; yTxt++)1759 { 1760 for (Int xTxt = 0; xTxt < iWidth; xTxt++)1788 for (Int yTxt = 0; yTxt < height; yTxt++) 1789 { 1790 for (Int xTxt = 0; xTxt < width; xTxt++) 1761 1791 { 1762 1792 if (depthPosX+xTxt < widthDepth) 1793 { 1763 1794 depthTemp = depthInitial + xTxt; 1795 } 1764 1796 else 1797 { 1765 1798 depthTemp = depthInitial + (widthDepth  depthPosX  1); 1766 1767 Int disparity = pShiftLUT[ *depthTemp ]; // << iShiftPrec; 1799 } 1800 1801 Int disparity = shiftLUT[ *depthTemp ]; // << iShiftPrec; 1768 1802 Int disparityInt = disparity >> 2; 1769 1803 … … 1771 1805 { 1772 1806 if (minRelativePos > disparityInt+xTxt) 1773 minRelativePos = disparityInt+xTxt; 1807 { 1808 minRelativePos = disparityInt+xTxt; 1809 } 1774 1810 } 1775 1811 else 1776 1812 { 1777 1813 if (maxRelativePos < disparityInt+xTxt) 1778 maxRelativePos = disparityInt+xTxt; 1814 { 1815 maxRelativePos = disparityInt+xTxt; 1816 } 1779 1817 } 1780 1818 } 1781 1819 if (depthPosY+yTxt < heightDepth) 1820 { 1782 1821 depthInitial = depthInitial + depStride; 1783 } 1784 1785 Int disparity_tmp = pShiftLUT[ *depth ]; // << iShiftPrec; 1822 } 1823 } 1824 1825 Int disparity_tmp = shiftLUT[ *depth ]; // << iShiftPrec; 1786 1826 if (disparity_tmp <= 0) 1827 { 1787 1828 maxRelativePos = minRelativePos + range 1 ; 1829 } 1788 1830 else 1831 { 1789 1832 minRelativePos = maxRelativePos  range +1 ; 1833 } 1790 1834 #endif 1791 1835 #endif // H_3D_VSP_BLOCKSIZE == 1 1792 1836 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 )1837 TComMv dv(0, 0); 1838 1839 for ( Int yTxt = 0; yTxt < height; yTxt += nTxtPerDepthY ) 1840 { 1841 for ( Int xTxt = 0; xTxt < width; xTxt += nTxtPerDepthX ) 1798 1842 { 1799 1843 Pel repDepth = depth[ xTxt ]; 1800 1844 assert( repDepth >= 0 && repDepth <= 255 ); 1801 1845 1802 Int disparity = pShiftLUT[ repDepth ]; // remove << iShiftPrec ??1846 Int disparity = shiftLUT[ repDepth ]; // remove << iShiftPrec ?? 1803 1847 Int xFrac = disparity & 0x3; 1804 1848 1805 1849 #if NTT_VSP_DC_BUGFIX_E0208 1806 1850 1807 cDv.setHor( disparity );1808 pcCU>clipMv( cDv );1809 1810 Int refOffset = xTxt + ( cDv.getHor() >> 2);1851 dv.setHor( disparity ); 1852 cu>clipMv( dv ); 1853 1854 Int refOffset = xTxt + (dv.getHor() >> 2); 1811 1855 1812 1856 #if H_3D_VSP_CONSTRAINED 1813 1857 if(refOffset<minRelativePos  refOffset>maxRelativePos) 1858 { 1814 1859 xFrac = 0; 1860 } 1815 1861 refOffset = Clip3(minRelativePos, maxRelativePos, refOffset); 1816 1862 #endif 1817 1863 1818 1864 assert( ref[refOffset] >= 0 && ref[refOffset]<= 255 ); 1819 m_if.filterHorLuma( &ref[refOffset], refStride, &dst[xTxt], dstStride, nTxtPerDepthX, nTxtPerDepthY, xFrac, ! bIsBi );1865 m_if.filterHorLuma( &ref[refOffset], refStride, &dst[xTxt], dstStride, nTxtPerDepthX, nTxtPerDepthY, xFrac, !isBi ); 1820 1866 1821 1867 #else // NTT_VSP_DC_BUGFIX_E0208 … … 1826 1872 #if H_3D_VSP_CONSTRAINED 1827 1873 if(refOffset<minRelativePos  refOffset>maxRelativePos) 1874 { 1828 1875 xFrac = 0; 1876 } 1829 1877 refOffset = Clip3(minRelativePos, maxRelativePos, refOffset); 1830 1878 #endif 1831 Int absX = iPosX + refOffset;1879 Int absX = posX + refOffset; 1832 1880 1833 1881 if (xFrac == 0) 1882 { 1834 1883 absX = Clip3(0, widthLuma1, absX); 1884 } 1835 1885 else 1886 { 1836 1887 absX = Clip3(4, widthLuma5, absX); 1837 1838 refOffset = absX  iPosX; 1888 } 1889 1890 refOffset = absX  posX; 1839 1891 assert( ref[refOffset] >= 0 && ref[refOffset] <= 255 ); 1840 1892 1841 m_if.filterHorLuma( &ref[refOffset], refStride, &dst[xTxt+j], dstStride, 1, nTxtPerDepthY, xFrac, ! bIsBi );1893 m_if.filterHorLuma( &ref[refOffset], refStride, &dst[xTxt+j], dstStride, 1, nTxtPerDepthY, xFrac, !isBi ); 1842 1894 } 1843 1895 … … 1852 1904 } 1853 1905 1854 Void TComPrediction::xPredInterChromaBlkFromDM ( TComDataCU * pcCU, TComPicYuv *pcPicRef, TComYuv *pcYuvDepth, Int* pShiftLUT, TComMv *pcMv, UInt partAddr, Int iWidth, Int iHeight, Bool bIsDepth, TComYuv *&pcYuvDst, Bool bIsBi )1906 Void TComPrediction::xPredInterChromaBlkFromDM ( TComDataCU *cu, TComPicYuv *picRef, TComYuv *yuvDepth, Int* shiftLUT, TComMv *mv, UInt partAddr, Int width, Int height, Bool isDepth, TComYuv *&yuvDst, Bool isBi ) 1855 1907 { 1856 1908 #if (H_3D_VSP_BLOCKSIZE==1) … … 1862 1914 #endif 1863 1915 1864 Int refStride = p cPicRef>getCStride();1865 Int dstStride = pcYuvDst>getCStride();1866 Int depStride = pcYuvDepth>getStride();1916 Int refStride = picRef>getCStride(); 1917 Int dstStride = yuvDst>getCStride(); 1918 Int depStride = yuvDepth>getStride(); 1867 1919 Int refStrideBlock = refStride * nTxtPerDepthY; 1868 1920 Int dstStrideBlock = dstStride * nTxtPerDepthY; 1869 1921 Int depStrideBlock = depStride * (nTxtPerDepthY<<1); 1870 1922 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 1923 Pel *refCb = picRef>getCbAddr( cu>getAddr(), cu>getZorderIdxInCU() + partAddr ); 1924 Pel *refCr = picRef>getCrAddr( cu>getAddr(), cu>getZorderIdxInCU() + partAddr ); 1925 Pel *dstCb = yuvDst>getCbAddr(partAddr); 1926 Pel *dstCr = yuvDst>getCrAddr(partAddr); 1927 Pel *depth = yuvDepth>getLumaAddr(); 1901 1928 1902 1929 #if !(NTT_VSP_DC_BUGFIX_E0208) 1903 Int widthChroma = p cPicRef>getWidth() >> 1;1904 Int iPosX, iPosY;1905 pcCU>getPic()>getPicYuvRec()>getTopLeftSamplePos( pcCU>getAddr(), pcCU>getZorderIdxInCU() + partAddr, iPosX, iPosY ); // topleft position in texture1906 iPosX >>= 1;1907 iPosY >>= 1;1930 Int widthChroma = picRef>getWidth() >> 1; 1931 Int posX, posY; 1932 cu>getPic()>getPicYuvRec()>getTopLeftSamplePos( cu>getAddr(), cu>getZorderIdxInCU() + partAddr, posX, posY ); // topleft position in texture 1933 posX >>= 1; 1934 posY >>= 1; 1908 1935 #endif 1909 1936 … … 1911 1938 #if H_3D_VSP_CONSTRAINED 1912 1939 //get LUT based horizontal reference range 1913 Int range = xGetConstrainedSize( iWidth, iHeight, false);1940 Int range = xGetConstrainedSize(width, height, false); 1914 1941 1915 1942 // The minimum depth value … … 1918 1945 1919 1946 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;1947 for (Int yTxt=0; yTxt<height; yTxt++) 1948 { 1949 for (Int xTxt=0; xTxt<width; xTxt++) 1950 { 1951 depthTmp = m_pDepthBlock[xTxt+yTxt*width]; 1952 Int disparity = shiftLUT[ depthTmp ]; // << iShiftPrec; 1926 1953 Int disparityInt = disparity >> 3;//in chroma resolution 1927 1954 … … 1929 1956 { 1930 1957 if (minRelativePos > disparityInt+xTxt) 1931 minRelativePos = disparityInt+xTxt; 1958 { 1959 minRelativePos = disparityInt+xTxt; 1960 } 1932 1961 } 1933 1962 else 1934 1963 { 1935 1964 if (maxRelativePos < disparityInt+xTxt) 1936 maxRelativePos = disparityInt+xTxt; 1965 { 1966 maxRelativePos = disparityInt+xTxt; 1967 } 1937 1968 } 1938 1969 } … … 1940 1971 1941 1972 depthTmp = m_pDepthBlock[0]; 1942 Int disparity_tmp = pShiftLUT[ depthTmp ]; // << iShiftPrec;1973 Int disparity_tmp = shiftLUT[ depthTmp ]; // << iShiftPrec; 1943 1974 if ( disparity_tmp < 0 ) 1975 { 1944 1976 maxRelativePos = minRelativePos + range  1; 1977 } 1945 1978 else 1979 { 1946 1980 minRelativePos = maxRelativePos  range + 1; 1981 } 1947 1982 1948 1983 #endif // H_3D_VSP_CONSTRAINED 1949 1984 #endif // H_3D_VSP_BLOCKSIZE == 1 1950 1985 1951 TComMv cDv(0, 0);1986 TComMv dv(0, 0); 1952 1987 // 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 )1988 height >>= 1; 1989 width >>= 1; 1990 1991 for ( Int yTxt = 0; yTxt < height; yTxt += nTxtPerDepthY ) 1992 { 1993 for ( Int xTxt = 0; xTxt < width; xTxt += nTxtPerDepthX ) 1959 1994 { 1960 1995 Pel repDepth = depth[ xTxt<<1 ]; 1961 1996 assert( repDepth >= 0 && repDepth <= 255 ); 1962 1997 1963 Int disparity = pShiftLUT[ repDepth ]; // remove << iShiftPrec;1998 Int disparity = shiftLUT[ repDepth ]; // remove << iShiftPrec; 1964 1999 Int xFrac = disparity & 0x7; 1965 2000 1966 2001 #if NTT_VSP_DC_BUGFIX_E0208 1967 2002 1968 cDv.setHor( disparity );1969 pcCU>clipMv( cDv );1970 1971 Int refOffset = xTxt + ( cDv.getHor() >> 3);2003 dv.setHor( disparity ); 2004 cu>clipMv( dv ); 2005 2006 Int refOffset = xTxt + (dv.getHor() >> 3); 1972 2007 1973 2008 #if H_3D_VSP_CONSTRAINED 1974 2009 if(refOffset<minRelativePos  refOffset>maxRelativePos) 2010 { 1975 2011 xFrac = 0; 2012 } 1976 2013 refOffset = Clip3(minRelativePos, maxRelativePos, refOffset); 1977 2014 #endif … … 1980 2017 assert( refCr[refOffset] >= 0 && refCr[refOffset]<= 255 ); 1981 2018 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 );2019 m_if.filterHorChroma( &refCb[refOffset], refStride, &dstCb[xTxt], dstStride, nTxtPerDepthX, nTxtPerDepthY, xFrac, !isBi ); 2020 m_if.filterHorChroma( &refCr[refOffset], refStride, &dstCr[xTxt], dstStride, nTxtPerDepthX, nTxtPerDepthY, xFrac, !isBi ); 1984 2021 1985 2022 #else // NTT_VSP_DC_BUGFIX_E0208 … … 1990 2027 #if H_3D_VSP_CONSTRAINED 1991 2028 if(refOffset<minRelativePos  refOffset>maxRelativePos) 2029 { 1992 2030 xFrac = 0; 2031 } 1993 2032 refOffset = Clip3(minRelativePos, maxRelativePos, refOffset); 1994 2033 #endif 1995 Int absX = iPosX + refOffset;2034 Int absX = posX + refOffset; 1996 2035 1997 2036 if (xFrac == 0) 2037 { 1998 2038 absX = Clip3(0, widthChroma1, absX); 2039 } 1999 2040 else 2041 { 2000 2042 absX = Clip3(4, widthChroma5, absX); 2001 2002 refOffset = absX  iPosX; 2043 } 2044 2045 refOffset = absX  posX; 2003 2046 assert( refCb[refOffset] >= 0 && refCb[refOffset] <= 255 ); 2004 2047 assert( refCr[refOffset] >= 0 && refCr[refOffset] <= 255 ); 2005 2048 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 );2049 m_if.filterHorChroma( &refCb[refOffset], refStride, &dstCb[xTxt+j], dstStride, 1, nTxtPerDepthY, xFrac, !isBi ); 2050 m_if.filterHorChroma( &refCr[refOffset], refStride, &dstCr[xTxt+j], dstStride, 1, nTxtPerDepthY, xFrac, !isBi ); 2008 2051 } 2009 2052
Note: See TracChangeset for help on using the changeset viewer.