Changeset 5 in 3DVCSoftware for trunk/source/Lib/TLibRenderer/TRenTop.cpp
- Timestamp:
- 12 Dec 2011, 18:35:44 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/Lib/TLibRenderer/TRenTop.cpp
r2 r5 1 /* The copyright in this software is being made available under the BSD 2 * License, included below. This software may be subject to other third party 3 * and contributor rights, including patent rights, and no such rights are 4 * granted under this license. 5 * 6 * Copyright (c) 2010-2011, ISO/IEC 7 * All rights reserved. 8 * 9 * Redistribution and use in source and binary forms, with or without 10 * modification, are permitted provided that the following conditions are met: 11 * 12 * * Redistributions of source code must retain the above copyright notice, 13 * this list of conditions and the following disclaimer. 14 * * Redistributions in binary form must reproduce the above copyright notice, 15 * this list of conditions and the following disclaimer in the documentation 16 * and/or other materials provided with the distribution. 17 * * Neither the name of the ISO/IEC nor the names of its contributors may 18 * be used to endorse or promote products derived from this software without 19 * specific prior written permission. 20 * 21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 25 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 31 * THE POSSIBILITY OF SUCH DAMAGE. 32 */ 33 1 34 2 35 #include "TRenImage.h" … … 879 912 Void TRenTop::xShiftPlanePixels8Tap( PelImagePlane** apcInputPlanes, PelImagePlane* pcDepthPlane, PelImagePlane** apcOutputPlanes, PelImagePlane* pcFilledPlane, UInt uiNumberOfPlanes ) 880 913 { 881 882 914 Bool bRenderDepth = (apcInputPlanes[0] == pcDepthPlane); 883 915 … … 1496 1528 } 1497 1529 1498 Void TRenTop::xChangePixels( PelImage* pcDispImage )1499 {1500 if (m_uNumelauiChangePixels < 3 )1501 {1502 return;1503 };1504 1505 UInt* puiCP = m_auiChangePixels;1506 UInt uiWidth = pcDispImage->getPlane(0)->getWidth();1507 1508 for (UInt uiIdx = 0; uiIdx < m_uNumelauiChangePixels; uiIdx+= 3 )1509 {1510 pcDispImage->getPlane(0)->getPlaneData()[ puiCP[ uiIdx ] * uiWidth + puiCP[ uiIdx + 1 ] ] = puiCP[uiIdx + 2 ];1511 };1512 };1513 1514 1530 1515 1531 Void TRenTop::xCutPlaneMargin( PelImagePlane* pcImagePlane, Pel cFill, UInt uiScale ) … … 1603 1619 Pel* pcLeftImageData = (*apcLeftPlane) ->getPlaneData(); 1604 1620 1605 //Int iSumLeft = 0; 1606 //Int iSumRight = 0; 1607 //Int iSumLeftSquare = 0; 1608 //Int iSumRightSquare = 0; 1621 1609 1622 1610 1623 for (UInt uiYPos = 0; uiYPos < iHeight; uiYPos++ ) 1611 1624 { 1612 //Int iRowSumLeft = 0;1613 //Int iRowSumRight = 0;1614 //Int iRowSumLeftSquare = 0;1615 //Int iRowSumRightSquare = 0;1616 1617 1625 for (UInt uiXPos = 0; uiXPos < iWidth; uiXPos++ ) 1618 1626 { … … 1621 1629 aiHistLeft [pcLeftImageData [uiXPos] ]++; 1622 1630 aiHistRight[pcRightImageData [uiXPos] ]++; 1623 //iNumElem++;1624 //iRowSumLeft += ;1625 //iRowSumRight += pcRightImageData [uiXPos];1626 //iRowSumLeftSquare += pcLeftImageData [uiXPos] * pcLeftImageData [uiXPos];1627 //iRowSumRightSquare += pcRightImageData [uiXPos] * pcRightImageData[uiXPos];1628 1631 } 1629 1632 } … … 1660 1663 while( iCurChangeVal <= g_uiIBDI_MAX ) 1661 1664 { 1662 #if 0 //GERHARD_DEBUG1663 std::cout << iCumSumBase << " " << iCumSumChange << " " << iCurBaseVal << " " << iCurChangeVal << std::endl;1664 #endif1665 1665 if ( iCumSumBase == iCumSumChange ) 1666 1666 { … … 1710 1710 delete[] aiHistRight; 1711 1711 delete[] aiConvLUT ; 1712 1713 1714 1712 } 1715 1713 … … 1892 1890 } 1893 1891 1894 1895 Void TRenTop::xReEstimateDisp( Pel* pcInputLeftImageRow, Pel* pcInputRightImageRow, Int iLeftImageStride, Int iRightImageStride, Int iPosX, Pel cLeftDepth, Pel cRightDepth, Int iLut, Pel& rcBestDepth, Int& riBestSAD )1896 {1897 Int iHalfBlkSizeMin1 = 3;1898 UInt uiStep = m_iRelShiftLUTPrec;1899 1900 AOT(iHalfBlkSizeMin1 > 3);1901 1902 Pel cInc = (cRightDepth < cLeftDepth) ? 1 : -1;1903 1904 UInt uiBestSAD = -1;1905 1906 for (Pel cCurDepth = cRightDepth; cCurDepth <= cLeftDepth; cCurDepth += cInc )1907 {1908 Int iShiftLeft = m_ppiShiftLUTLeft [iLut][ RemoveBitIncrement( cCurDepth)];1909 Int iShiftRight = m_ppiShiftLUTLeft [iLut][ RemoveBitIncrement( cCurDepth)];1910 1911 Int iShiftedPosLeft = iPosX - iShiftLeft;1912 Int iShiftedPosRight = iPosX - iShiftRight;1913 1914 if ( !(( iShiftedPosLeft < 0 ) || (iShiftedPosLeft >= m_uiSampledWidth) || ( iShiftedPosRight < 0 ) || (iShiftedPosRight >= m_uiSampledWidth)))1915 {1916 Pel* pcCurLeftIm = pcInputLeftImageRow - iLeftImageStride * iHalfBlkSizeMin1 - iHalfBlkSizeMin1*uiStep - iShiftLeft;1917 Pel* pcCurRightIm = pcInputRightImageRow - iRightImageStride * iHalfBlkSizeMin1 - iHalfBlkSizeMin1*uiStep - iShiftRight;1918 1919 UInt uiSAD = 0;1920 1921 for ( Int iCurPosY= 0; iCurPosY < (iHalfBlkSizeMin1 << 1) + 1; iCurPosY++ )1922 {1923 for ( Int iCurPosX = 0; iCurPosX < (iHalfBlkSizeMin1 << 1) * uiStep + uiStep; iCurPosX += uiStep )1924 {1925 uiSAD += abs( pcCurLeftIm[iCurPosX] - pcCurRightIm[iCurPosX] );1926 }1927 pcCurLeftIm += iLeftImageStride;1928 pcCurRightIm += iRightImageStride;1929 }1930 1931 if (uiSAD < uiBestSAD)1932 {1933 uiBestSAD = uiSAD;1934 rcBestDepth = cCurDepth;1935 }1936 }1937 }1938 }1939 1940 Int TRenTop::xVSRSHoleCount( Pel* pcFilledData, Int iFilledStride, Int iCenterPosX, Int iCenterPosY )1941 {1942 // Counts holes in a 6x6 Block around iPosX and iPosY1943 //GT: currently not supported for rendering in up sampled domain ( padding to less )1944 if ( m_iLog2SamplingFactor > 0 )1945 {1946 return 0;1947 }1948 1949 Int iHalfBlkSizeY = 3;1950 Int iHalfBlkSizeX = 3; // iHalfBlkSizeY * ( 1 << m_iLog2SamplingFactor );1951 1952 Int iNumOfHolePels = 0;1953 pcFilledData -= ( iHalfBlkSizeX + iHalfBlkSizeY * iFilledStride );1954 1955 for (Int iPosY = 0; iPosY < (iHalfBlkSizeY << 1) + 1; iPosY++)1956 {1957 for (Int iPosX = 0; iPosX < (iHalfBlkSizeX << 1) + 1; iPosX++)1958 {1959 if (*pcFilledData == REN_IS_HOLE)1960 {1961 iNumOfHolePels++;1962 }1963 pcFilledData++;1964 }1965 pcFilledData += iFilledStride;1966 }1967 return iNumOfHolePels;1968 }1969 1970 1892 // Temporal Filter from Zhejiang University: (a little different from m16041: Temporal Improvement Method in View Synthesis) 1971 1893 Void TRenTop::temporalFilterVSRS( TComPicYuv* pcPicYuvVideoCur, TComPicYuv* pcPicYuvDepthCur, TComPicYuv* pcPicYuvVideoLast, TComPicYuv* pcPicYuvDepthLast, Bool bFirstFrame ) … … 2095 2017 // PostProcessing 2096 2018 m_iPostProcMode = eRenPostProNone; 2097 2098 //ChangePixels2099 m_auiChangePixels[0] = 0;2100 m_uNumelauiChangePixels = 0;2101 2019 2102 2020 // Cut … … 2211 2129 m_iPostProcMode = iPostProcMode; 2212 2130 2213 //ChangePixels2214 m_auiChangePixels[0] = 0;2215 m_uNumelauiChangePixels = 0;2216 2217 2131 // Used pel map 2218 2132 m_iUsedPelMapMarExt = iUsedPelMapMarExt; … … 2262 2176 2263 2177 2264 Void TRenTop::xGetChangePixels( UInt& ruiNumPixels, UInt* & rauiChangePixels )2265 {2266 ruiNumPixels = m_uNumelauiChangePixels;2267 rauiChangePixels = m_auiChangePixels;2268 }2269 2270 2178 TRenTop::~TRenTop() 2271 2179 {
Note: See TracChangeset for help on using the changeset viewer.