Changeset 704 in 3DVCSoftware
- Timestamp:
- 16 Nov 2013, 03:51:33 (11 years ago)
- Location:
- branches/HTM-8.2-dev1-MTK-LG/source/Lib/TLibCommon
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-8.2-dev1-MTK-LG/source/Lib/TLibCommon/TComPrediction.cpp
r693 r704 751 751 // fetch virtual depth map 752 752 pcBaseViewDepthPicYuv->extendPicBorder(); 753 754 #if MTK_F0109_LG_F0120_VSP_BLOCK 755 Int vspSize=0; 756 xGetVirtualDepth( pcCU, pcBaseViewDepthPicYuv, &cDv, uiPartAddr, iWidth, iHeight, &m_cYuvDepthOnVsp,vspSize ); 757 // sub-PU based compensation 758 xPredInterLumaBlkFromDM ( pcCU, pcBaseViewTxtPicYuv, &m_cYuvDepthOnVsp, pShiftLUT, &cDv, uiPartAddr, iWidth, iHeight, pcCU->getSlice()->getIsDepth(), rpcYuvPred, bi, vspSize); 759 xPredInterChromaBlkFromDM ( pcCU, pcBaseViewTxtPicYuv, &m_cYuvDepthOnVsp, pShiftLUT, &cDv, uiPartAddr, iWidth, iHeight, pcCU->getSlice()->getIsDepth(), rpcYuvPred, bi, vspSize); 760 #else 753 761 xGetVirtualDepth( pcCU, pcBaseViewDepthPicYuv, &cDv, uiPartAddr, iWidth, iHeight, &m_cYuvDepthOnVsp ); 754 762 // sub-PU based compensation 755 763 xPredInterLumaBlkFromDM ( pcCU, pcBaseViewTxtPicYuv, &m_cYuvDepthOnVsp, pShiftLUT, &cDv, uiPartAddr, iWidth, iHeight, pcCU->getSlice()->getIsDepth(), rpcYuvPred, bi ); 756 764 xPredInterChromaBlkFromDM ( pcCU, pcBaseViewTxtPicYuv, &m_cYuvDepthOnVsp, pShiftLUT, &cDv, uiPartAddr, iWidth, iHeight, pcCU->getSlice()->getIsDepth(), rpcYuvPred, bi ); 765 #endif 757 766 } 758 767 #endif … … 1629 1638 #if H_3D_VSP 1630 1639 // not fully support iRatioTxtPerDepth* != 1 1640 #if MTK_F0109_LG_F0120_VSP_BLOCK 1641 Void TComPrediction::xGetVirtualDepth( TComDataCU *cu, TComPicYuv *picRefDepth, TComMv *mv, UInt partAddr, Int width, Int height, TComYuv *yuvDepth, Int &vspSize, Int ratioTxtPerDepthX, Int ratioTxtPerDepthY ) 1642 #else 1631 1643 Void TComPrediction::xGetVirtualDepth( TComDataCU *cu, TComPicYuv *picRefDepth, TComMv *mv, UInt partAddr, Int width, Int height, TComYuv *yuvDepth, Int ratioTxtPerDepthX, Int ratioTxtPerDepthY ) 1644 #endif 1632 1645 { 1633 1646 Int nTxtPerDepthX = H_3D_VSP_BLOCKSIZE; … … 1676 1689 depth += depStrideBlock; 1677 1690 } 1691 #if MTK_F0109_LG_F0120_VSP_BLOCK 1692 if(width==4) 1693 vspSize=0; 1694 else 1695 vspSize=1; 1696 #endif 1678 1697 } 1679 1698 else … … 1689 1708 Pel repDepth8x4[2] = {0, 0}; 1690 1709 1710 #if !MTK_F0109_LG_F0120_VSP_BLOCK 1691 1711 Int refDepStrideBlock = refDepStride * blocksize; 1692 1712 Int refDepStrideSubBlock = refDepStride * subblocksize; … … 1792 1812 depth += depStrideBlock; 1793 1813 } 1794 } 1795 1796 1797 } 1798 1814 #else 1815 Int refDepStrideBlock = refDepStride * height; 1816 Int refDepStrideSubBlock = refDepStride * height/2; 1817 refDepthTmp[0] = refDepth; 1818 refDepthTmp[2] = refDepthTmp[0] + refDepStrideSubBlock; 1819 refDepthTmp[1] = refDepthTmp[2] - refDepStride; 1820 refDepthTmp[3] = refDepthTmp[1] + refDepStrideSubBlock; 1821 offset[3] = width-1; 1822 Bool ULvsBR = false, URvsBL = false; 1823 ULvsBR = refDepthTmp[0][0+offset[0]] < refDepthTmp[3][0+offset[3]]; 1824 URvsBL = refDepthTmp[0][0+offset[3]] < refDepthTmp[3][0+offset[0]]; 1825 refDepStrideBlock = refDepStride * blocksize; 1826 refDepStrideSubBlock = refDepStride * subblocksize; 1827 refDepthTmp[0] = refDepth; 1828 refDepthTmp[2] = refDepthTmp[0] + refDepStrideSubBlock; 1829 refDepthTmp[1] = refDepthTmp[2] - refDepStride; 1830 refDepthTmp[3] = refDepthTmp[1] + refDepStrideSubBlock; 1831 offset[3] = blocksize-1; 1832 if( ULvsBR ^ URvsBL ) 1833 { 1834 vspSize = 0;//4x8 1835 for( Int y=0; y<height; y+=blocksize ) 1836 { 1837 for( Int x=0; x<width; x+=blocksize ) 1838 { 1839 { // 4x8 1840 repDepth4x8[0] = refDepthTmp[0][x+offset[0]] > refDepthTmp[0][x+offset[1]] ? refDepthTmp[0][x+offset[0]] : refDepthTmp[0][x+offset[1]]; 1841 if( repDepth4x8[0] < refDepthTmp[3][x+offset[0]] ) 1842 { 1843 repDepth4x8[0] = refDepthTmp[3][x+offset[0]]; 1844 } 1845 if( repDepth4x8[0] < refDepthTmp[3][x+offset[1]] ) 1846 { 1847 repDepth4x8[0] = refDepthTmp[3][x+offset[1]]; 1848 } 1849 repDepth4x8[1] = refDepthTmp[0][x+offset[2]] > refDepthTmp[0][x+offset[3]] ? refDepthTmp[0][x+offset[2]] : refDepthTmp[0][x+offset[3]]; 1850 if( repDepth4x8[1] < refDepthTmp[3][x+offset[2]] ) 1851 { 1852 repDepth4x8[1] = refDepthTmp[3][x+offset[2]]; 1853 } 1854 if( repDepth4x8[1] < refDepthTmp[3][x+offset[3]] ) 1855 { 1856 repDepth4x8[1] = refDepthTmp[3][x+offset[3]]; 1857 } 1858 1859 depthTmp = &depth[x]; 1860 for( Int sY=0; sY<blocksize; sY+=nTxtPerDepthY ) 1861 { 1862 for( Int sX=0; sX<subblocksize; sX+=nTxtPerDepthX ) 1863 { 1864 depthTmp[sX] = repDepth4x8[0]; 1865 } 1866 depthTmp += depStrideTmp; 1867 } 1868 depthTmp = &depth[x+subblocksize]; 1869 for( Int sY=0; sY<blocksize; sY+=nTxtPerDepthY ) 1870 { 1871 for( Int sX=0; sX<subblocksize; sX+=nTxtPerDepthX ) 1872 { 1873 depthTmp[sX] = repDepth4x8[1]; 1874 } 1875 depthTmp += depStrideTmp; 1876 } 1877 } 1878 } 1879 refDepthTmp[0] += refDepStrideBlock; 1880 refDepthTmp[1] += refDepStrideBlock; 1881 refDepthTmp[2] += refDepStrideBlock; 1882 refDepthTmp[3] += refDepStrideBlock; 1883 depth += depStrideBlock; 1884 } 1885 } 1886 else 1887 { // 8x4 1888 vspSize = 1; 1889 for( Int y=0; y<height; y+=blocksize ) 1890 { 1891 for( Int x=0; x<width; x+=blocksize ) 1892 { 1893 repDepth8x4[0] = refDepthTmp[0][x+offset[0]] > refDepthTmp[0][x+offset[3]] ? refDepthTmp[0][x+offset[0]] : refDepthTmp[0][x+offset[3]]; 1894 if( repDepth8x4[0] < refDepthTmp[1][x+offset[0]] ) 1895 { 1896 repDepth8x4[0] = refDepthTmp[1][x+offset[0]]; 1897 } 1898 if( repDepth8x4[0] < refDepthTmp[1][x+offset[3]] ) 1899 { 1900 repDepth8x4[0] = refDepthTmp[1][x+offset[3]]; 1901 } 1902 repDepth8x4[1] = refDepthTmp[2][x+offset[0]] > refDepthTmp[2][x+offset[3]] ? refDepthTmp[2][x+offset[0]] : refDepthTmp[2][x+offset[3]]; 1903 if( repDepth8x4[1] < refDepthTmp[3][x+offset[0]] ) 1904 { 1905 repDepth8x4[1] = refDepthTmp[3][x+offset[0]]; 1906 } 1907 if( repDepth8x4[1] < refDepthTmp[3][x+offset[3]] ) 1908 { 1909 repDepth8x4[1] = refDepthTmp[3][x+offset[3]]; 1910 } 1911 1912 depthTmp = &depth[x]; 1913 for( Int sY=0; sY<subblocksize; sY+=nTxtPerDepthY ) 1914 { 1915 for( Int sX=0; sX<blocksize; sX+=nTxtPerDepthX ) 1916 { 1917 depthTmp[sX] = repDepth8x4[0]; 1918 } 1919 depthTmp += depStrideTmp; 1920 } 1921 for( Int sY=0; sY<subblocksize; sY+=nTxtPerDepthY ) 1922 { 1923 for( Int sX=0; sX<blocksize; sX+=nTxtPerDepthX ) 1924 { 1925 depthTmp[sX] = repDepth8x4[1]; 1926 } 1927 depthTmp += depStrideTmp; 1928 } 1929 } 1930 refDepthTmp[0] += refDepStrideBlock; 1931 refDepthTmp[1] += refDepStrideBlock; 1932 refDepthTmp[2] += refDepStrideBlock; 1933 refDepthTmp[3] += refDepStrideBlock; 1934 depth += depStrideBlock; 1935 } 1936 } 1937 #endif 1938 } 1939 1940 1941 } 1942 #if MTK_F0109_LG_F0120_VSP_BLOCK 1943 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, Int vspSize) 1944 #else 1799 1945 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 ) 1946 #endif 1800 1947 { 1801 1948 Int nTxtPerDepthX = H_3D_VSP_BLOCKSIZE; 1802 1949 Int nTxtPerDepthY = H_3D_VSP_BLOCKSIZE; 1803 1950 1951 #if MTK_F0109_LG_F0120_VSP_BLOCK 1952 nTxtPerDepthX = nTxtPerDepthX << vspSize; 1953 nTxtPerDepthY = nTxtPerDepthY << (1-vspSize); 1954 #endif 1804 1955 Int refStride = picRef->getStride(); 1805 1956 Int dstStride = yuvDst->getStride(); … … 1906 2057 1907 2058 } 1908 2059 #if MTK_F0109_LG_F0120_VSP_BLOCK 2060 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, Int vspSize) 2061 #else 1909 2062 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 ) 2063 #endif 1910 2064 { 1911 2065 #if (H_3D_VSP_BLOCKSIZE==1) … … 1917 2071 #endif 1918 2072 2073 #if MTK_F0109_LG_F0120_VSP_BLOCK 2074 nTxtPerDepthX = nTxtPerDepthX << vspSize; 2075 nTxtPerDepthY = nTxtPerDepthY << (1-vspSize); 2076 #endif 1919 2077 Int refStride = picRef->getCStride(); 1920 2078 Int dstStride = yuvDst->getCStride(); -
branches/HTM-8.2-dev1-MTK-LG/source/Lib/TLibCommon/TComPrediction.h
r666 r704 123 123 124 124 #if H_3D_VSP 125 #if MTK_F0109_LG_F0120_VSP_BLOCK 126 Void xGetVirtualDepth ( TComDataCU *cu, TComPicYuv *picRefDepth, TComMv *dv, UInt partAddr, Int width, Int height, TComYuv *yuvDepth, Int &vspSize, Int txtPerDepthX=1, Int txtPerDepthY=1 ); 127 Void xPredInterLumaBlkFromDM ( TComDataCU *cu, TComPicYuv *picRef, TComYuv *yuvDepth, Int* shiftLUT, TComMv *mv, UInt partAddr, Int width, Int height, Bool isDepth, TComYuv *&pcYuvDst, Bool isBi, Int vspSize); 128 Void xPredInterChromaBlkFromDM ( TComDataCU *cu, TComPicYuv *picRef, TComYuv *yuvDepth, Int* shiftLUT, TComMv *mv, UInt partAddr, Int width, Int height, Bool isDepth, TComYuv *&pcYuvDst, Bool isBi, Int vspSize); 129 #else 125 130 Void xGetVirtualDepth ( TComDataCU *cu, TComPicYuv *picRefDepth, TComMv *dv, UInt partAddr, Int width, Int height, TComYuv *yuvDepth, Int txtPerDepthX=1, Int txtPerDepthY=1 ); 126 131 Void xPredInterLumaBlkFromDM ( TComDataCU *cu, TComPicYuv *picRef, TComYuv *yuvDepth, Int* shiftLUT, TComMv *mv, UInt partAddr, Int width, Int height, Bool isDepth, TComYuv *&pcYuvDst, Bool isBi ); 127 132 Void xPredInterChromaBlkFromDM ( TComDataCU *cu, TComPicYuv *picRef, TComYuv *yuvDepth, Int* shiftLUT, TComMv *mv, UInt partAddr, Int width, Int height, Bool isDepth, TComYuv *&pcYuvDst, Bool isBi ); 133 #endif 128 134 #endif 129 135 -
branches/HTM-8.2-dev1-MTK-LG/source/Lib/TLibCommon/TypeDef.h
r693 r704 225 225 ///// ***** VIEW SYNTHESIS PREDICTION ********* 226 226 #if H_3D_VSP 227 #define MTK_F0109_LG_F0120_VSP_BLOCK 1 // MTK_LG_SIMPLIFY_VSP_BLOCK_PARTITION_F0109_F0120 227 228 #define H_3D_VSP_BLOCKSIZE 4 // Supported values: 1, 2, and 4 228 229 #if H_3D_VSP_BLOCKSIZE == 1
Note: See TracChangeset for help on using the changeset viewer.