Changeset 706 in 3DVCSoftware for branches/HTM-8.2-dev1-Sharp2
- Timestamp:
- 20 Nov 2013, 01:48:42 (11 years ago)
- 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 1670 1670 Pel *depth = yuvDepth->getLumaAddr(); 1671 1671 1672 #if !SHARP_VSP_BLOCK_IN_AMP_F0102 1672 1673 if( width<8 || height<8 ) 1673 1674 { // no split … … 1707 1708 Pel repDepth4x8[2] = {0, 0}; 1708 1709 Pel repDepth8x4[2] = {0, 0}; 1710 #endif 1709 1711 1710 1712 #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 1711 1722 Int refDepStrideBlock = refDepStride * blocksize; 1712 1723 Int refDepStrideSubBlock = refDepStride * subblocksize; … … 1717 1728 refDepthTmp[3] = refDepthTmp[1] + refDepStrideSubBlock; 1718 1729 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 1719 1802 for( Int y=0; y<height; y+=blocksize ) 1720 1803 { … … 1812 1895 depth += depStrideBlock; 1813 1896 } 1897 #endif // SHARP_VSP_BLOCK_IN_AMP_F0102 1814 1898 #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 1815 1953 Int refDepStrideBlock = refDepStride * height; 1816 1954 Int refDepStrideSubBlock = refDepStride * height/2; … … 1935 2073 } 1936 2074 } 1937 #endif 1938 } 2075 #endif 2076 #endif 2077 #if !SHARP_VSP_BLOCK_IN_AMP_F0102 2078 } 2079 #endif 1939 2080 1940 2081 -
branches/HTM-8.2-dev1-Sharp2/source/Lib/TLibCommon/TypeDef.h
r704 r706 226 226 #if H_3D_VSP 227 227 #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 228 230 #define H_3D_VSP_BLOCKSIZE 4 // Supported values: 1, 2, and 4 229 231 #if H_3D_VSP_BLOCKSIZE == 1
Note: See TracChangeset for help on using the changeset viewer.