Changeset 1313 in 3DVCSoftware for trunk/source/Lib/TLibRenderer/TRenTop.cpp
- Timestamp:
- 13 Aug 2015, 17:38:13 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/Lib/TLibRenderer/TRenTop.cpp
r1179 r1313 40 40 #include <math.h> 41 41 #include "../TLibCommon/CommonDef.h" 42 #if H_3D42 #if NH_3D 43 43 44 44 … … 114 114 if (uiPlane == 0) 115 115 { 116 TRenFilter ::sampleHorUp ( iLog2SamplingFactor, pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride());116 TRenFilter<REN_BIT_DEPTH>::sampleHorUp ( iLog2SamplingFactor, pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride()); 117 117 } 118 118 else … … 120 120 if ( m_bUVUp ) 121 121 { 122 TRenFilter ::sampleCUpHorUp( iLog2SamplingFactor, pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride());122 TRenFilter<REN_BIT_DEPTH>::sampleCUpHorUp( iLog2SamplingFactor, pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride()); 123 123 } 124 124 else 125 125 { 126 TRenFilter ::sampleCHorUp ( iLog2SamplingFactor, pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride());126 TRenFilter<REN_BIT_DEPTH>::sampleCHorUp ( iLog2SamplingFactor, pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride()); 127 127 } 128 128 } … … 147 147 AOT( iLog2SamplingFactor > 2); 148 148 149 TRenFilter ::sampleHorUp(iLog2SamplingFactor, pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride());149 TRenFilter<REN_BIT_DEPTH>::sampleHorUp(iLog2SamplingFactor, pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride()); 150 150 151 151 if ( !m_bUVUp ) //GT: depth down … … 154 154 PelImagePlane* pcTempPlane = new PelImagePlane(pcOrgInputImage->getPlane(0)->getWidth(), ( pcOrgInputImage->getPlane(0)->getHeight() >> 1), REN_LUMA_MARGIN ); 155 155 156 TRenFilter ::sampleVerDown2Tap13(pcOrgInputImage->getPlane(0), pcTempPlane, PICYUV_PAD);156 TRenFilter<REN_BIT_DEPTH>::sampleVerDown2Tap13(pcOrgInputImage->getPlane(0), pcTempPlane, PICYUV_PAD); 157 157 pcConvPlane = pcConvInputImage->getPlane(1); 158 158 159 159 if ( iLog2SamplingFactor == 0 ) 160 160 { 161 TRenFilter ::sampleHorDown2Tap13(pcTempPlane, pcConvPlane, 0 );161 TRenFilter<REN_BIT_DEPTH>::sampleHorDown2Tap13(pcTempPlane, pcConvPlane, 0 ); 162 162 } 163 163 else 164 164 { 165 TRenFilter ::sampleHorUp ( iLog2SamplingFactor - 1, pcTempPlane->getPlaneData(), pcTempPlane->getStride(), pcTempPlane->getWidth(), pcTempPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride());165 TRenFilter<REN_BIT_DEPTH>::sampleHorUp ( iLog2SamplingFactor - 1, pcTempPlane->getPlaneData(), pcTempPlane->getStride(), pcTempPlane->getWidth(), pcTempPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride()); 166 166 } 167 167 delete pcTempPlane; … … 175 175 { 176 176 m_pcTempImage->assign( pcOrgInputImage ); 177 TRenFilter ::mirrorHor( m_pcTempImage );177 TRenFilter<REN_BIT_DEPTH>::mirrorHor( m_pcTempImage ); 178 178 m_pcTempImage->extendMargin(); 179 179 xConvertInputVideo( m_pcTempImage, pcConvInputImage ); 180 180 181 181 m_pcTempImage->getPlane(0)->assign( pcOrgInputDepth->getPlane(0) ); 182 TRenFilter ::mirrorHor( m_pcTempImage->getPlane(0) );182 TRenFilter<REN_BIT_DEPTH>::mirrorHor( m_pcTempImage->getPlane(0) ); 183 183 m_pcTempImage->getPlane(0)->extendMargin(); 184 184 xConvertInputDepth( m_pcTempImage, pcConvInputDepth ); … … 209 209 if ( uiPlane == 0 ) 210 210 { 211 TRenFilter ::sampleHorDown( iLog2SamplingFactor, pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride());211 TRenFilter<REN_BIT_DEPTH>::sampleHorDown( iLog2SamplingFactor, pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride()); 212 212 } 213 213 else … … 215 215 if ( m_bUVUp ) 216 216 { 217 TRenFilter ::sampleCDownHorDown( iLog2SamplingFactor, pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride());217 TRenFilter<REN_BIT_DEPTH>::sampleCDownHorDown( iLog2SamplingFactor, pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride()); 218 218 } 219 219 else 220 220 { 221 TRenFilter ::sampleCHorDown ( iLog2SamplingFactor, pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride());221 TRenFilter<REN_BIT_DEPTH>::sampleCHorDown ( iLog2SamplingFactor, pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride()); 222 222 } 223 223 } … … 226 226 if ( bMirror ) 227 227 { 228 TRenFilter ::mirrorHor( pcConvOutputImage );228 TRenFilter<REN_BIT_DEPTH>::mirrorHor( pcConvOutputImage ); 229 229 } 230 230 … … 253 253 if ( !m_bExtrapolate ) 254 254 { 255 TRenFilter ::setupZLUT( m_bBlendUseDistWeight, m_iBlendZThresPerc, iRelDistToLeft, ppiBaseShiftLUTLeft, ppiBaseShiftLUTRight, m_iBlendZThres, m_iBlendDistWeight, m_piInvZLUTLeft, m_piInvZLUTRight);255 TRenFilter<REN_BIT_DEPTH>::setupZLUT( m_bBlendUseDistWeight, m_iBlendZThresPerc, iRelDistToLeft, ppiBaseShiftLUTLeft, ppiBaseShiftLUTRight, m_iBlendZThres, m_iBlendDistWeight, m_piInvZLUTLeft, m_piInvZLUTRight); 256 256 } 257 257 } … … 261 261 AOF( m_bExtrapolate ); 262 262 AOF( bRenderFromLeft ? m_ppiShiftLUTLeft || m_ppdShiftLUTLeft : m_ppiShiftLUTRight || m_ppdShiftLUTRight ); 263 AOF( m_auiInputResolution[0] == pcPicYuvVideo->getWidth ( ));264 AOF( m_auiInputResolution[1] == pcPicYuvVideo->getHeight( ));263 AOF( m_auiInputResolution[0] == pcPicYuvVideo->getWidth ( COMPONENT_Y )); 264 AOF( m_auiInputResolution[1] == pcPicYuvVideo->getHeight( COMPONENT_Y )); 265 265 266 266 PelImage cInputImage ( pcPicYuvVideo ); … … 284 284 { 285 285 AOF( bRenderFromLeft ? m_ppiShiftLUTLeft && m_ppdShiftLUTLeft : m_ppiShiftLUTRight && m_ppdShiftLUTRight ); 286 AOF(m_auiInputResolution[0] == pcPicYuvDepth->getWidth ( ));287 AOF(m_auiInputResolution[1] == pcPicYuvDepth->getHeight( ));286 AOF(m_auiInputResolution[0] == pcPicYuvDepth->getWidth (COMPONENT_Y)); 287 AOF(m_auiInputResolution[1] == pcPicYuvDepth->getHeight(COMPONENT_Y)); 288 288 289 289 PelImage cInputDepth ( pcPicYuvDepth , true); … … 300 300 if ( !bRenderFromLeft ) 301 301 { 302 TRenFilter ::mirrorHor( m_pcFilled );303 } 304 305 TRenFilter ::filledToUsedPelMap( m_pcFilled, &cOutputImage, m_iUsedPelMapMarExt );302 TRenFilter<REN_BIT_DEPTH>::mirrorHor( m_pcFilled ); 303 } 304 305 TRenFilter<REN_BIT_DEPTH>::filledToUsedPelMap( m_pcFilled, &cOutputImage, m_iUsedPelMapMarExt ); 306 306 }; 307 307 … … 310 310 { 311 311 assert( !m_bExtrapolate ); 312 assert( m_auiInputResolution[0] == pcPicYuvVideoLeft ->getWidth ( ) );313 assert( m_auiInputResolution[1] == pcPicYuvVideoRight->getHeight( ) );312 assert( m_auiInputResolution[0] == pcPicYuvVideoLeft ->getWidth ( COMPONENT_Y ) ); 313 assert( m_auiInputResolution[1] == pcPicYuvVideoRight->getHeight( COMPONENT_Y ) ); 314 314 315 315 AOT( iBlendMode == 3); … … 363 363 xCreateAlphaMap( m_pcRightFilled, m_pcRightFilled, false ); 364 364 365 TRenFilter ::mirrorHor( m_pcRightOutputImage );366 TRenFilter ::mirrorHor( m_pcRightOutputDepth );367 TRenFilter ::mirrorHor( m_pcRightFilled );365 TRenFilter<REN_BIT_DEPTH>::mirrorHor( m_pcRightOutputImage ); 366 TRenFilter<REN_BIT_DEPTH>::mirrorHor( m_pcRightOutputDepth ); 367 TRenFilter<REN_BIT_DEPTH>::mirrorHor( m_pcRightFilled ); 368 368 369 369 xEnhSimilarity( m_pcLeftOutputImage, m_pcRightOutputImage, m_pcLeftFilled, m_pcRightFilled ); … … 377 377 xCreateAlphaMap ( m_pcLeftFilled, m_pcLeftFilled, true ); 378 378 379 TRenFilter ::mirrorHor( m_pcRightInputImage );379 TRenFilter<REN_BIT_DEPTH>::mirrorHor( m_pcRightInputImage ); 380 380 xBackShiftPixels ( m_pcRightInputImage, m_pcOutputDepth, m_pcRightOutputImage, m_pcRightFilled , true ); 381 381 xFillHoles ( m_pcRightOutputImage, m_pcRightFilled, m_pcRightOutputImage, true); 382 382 383 TRenFilter ::mirrorHor( m_pcRightFilled );383 TRenFilter<REN_BIT_DEPTH>::mirrorHor( m_pcRightFilled ); 384 384 xCreateAlphaMap ( m_pcRightFilled, m_pcRightFilled, true ); 385 TRenFilter ::mirrorHor( m_pcRightFilled );385 TRenFilter<REN_BIT_DEPTH>::mirrorHor( m_pcRightFilled ); 386 386 } 387 387 … … 415 415 { 416 416 case eRenPreProBinom: 417 TRenFilter ::binominal(pcOutImage, pcTemp, m_iPreFilterSize);417 TRenFilter<REN_BIT_DEPTH>::binominal(pcOutImage, pcTemp, m_iPreFilterSize); 418 418 break; 419 419 case eRenPreProNone: … … 607 607 { 608 608 apcDiffPlane[uiCurPlane] = new IntImagePlane( iWidth, iHeight, apcInputPlanes[uiCurPlane]->getPad()); 609 TRenFilter ::diffHorSym(apcInputPlanes[uiCurPlane] , apcDiffPlane[uiCurPlane]);609 TRenFilter<REN_BIT_DEPTH>::diffHorSym(apcInputPlanes[uiCurPlane] , apcDiffPlane[uiCurPlane]); 610 610 ppiDiffPlanes[uiCurPlane] = apcDiffPlane[uiCurPlane]->getPlaneData(); 611 611 } … … 659 659 for( UInt uiCurPlane = 0; uiCurPlane < uiNumberOfPlanes; uiCurPlane++) 660 660 { 661 cVal = TRenFilter ::interpCHSpline(iInterPolPos, dShiftedPos, dPrevShiftedPos, apcInputData[uiCurPlane][iPosX - 1], ppiDiffPlanes[uiCurPlane][iPosX - 1], apcInputData[uiCurPlane][iPosX], ppiDiffPlanes[uiCurPlane][iPosX] );661 cVal = TRenFilter<REN_BIT_DEPTH>::interpCHSpline(iInterPolPos, dShiftedPos, dPrevShiftedPos, apcInputData[uiCurPlane][iPosX - 1], ppiDiffPlanes[uiCurPlane][iPosX - 1], apcInputData[uiCurPlane][iPosX], ppiDiffPlanes[uiCurPlane][iPosX] ); 662 662 apcOutputData[uiCurPlane][iInterPolPos] = cVal; 663 663 } … … 1516 1516 { 1517 1517 case eRenPostProMed: 1518 TRenFilter ::lineMedian3(pcTemp);1518 TRenFilter<REN_BIT_DEPTH>::lineMedian3(pcTemp); 1519 1519 break; 1520 1520 case eRenPostProNone: … … 1599 1599 1600 1600 Void TRenTop::xEnhSimilarityPlane ( PelImagePlane** apcLeftPlane, PelImagePlane** apcRightPlane, PelImagePlane* pcFilledLeftPlane, PelImagePlane* pcFilledRightPlane, UInt uiNumberOfPlanes ) 1601 { 1602 AOF( g_bitDepthC == g_bitDepthY ); 1601 { 1603 1602 AOT( m_iSimEnhBaseView != 1 && m_iSimEnhBaseView != 2 ); 1604 1603 Int iWidth = (*apcRightPlane)->getWidth (); 1605 1604 Int iHeight = (*apcRightPlane)->getHeight(); 1606 1605 1607 Int* aiHistLeft = new Int[ ((Int64)1 ) << g_bitDepthY];1608 Int* aiHistRight = new Int[ ((Int64)1 ) << g_bitDepthY];1609 Pel* aiConvLUT = new Pel[ ((Int64)1 ) << g_bitDepthY];1606 Int* aiHistLeft = new Int[ ((Int64)1 ) << REN_BIT_DEPTH ]; 1607 Int* aiHistRight = new Int[ ((Int64)1 ) << REN_BIT_DEPTH ]; 1608 Pel* aiConvLUT = new Pel[ ((Int64)1 ) << REN_BIT_DEPTH ]; 1610 1609 1611 1610 for (UInt uiCurPlane = 0; uiCurPlane < uiNumberOfPlanes; uiCurPlane++ ) 1612 1611 { 1613 for (Int iCurVal = 0 ; iCurVal < ( 1 << g_bitDepthY); iCurVal++)1612 for (Int iCurVal = 0 ; iCurVal < ( 1 << REN_BIT_DEPTH ); iCurVal++) 1614 1613 { 1615 1614 aiHistLeft [iCurVal] = 0; … … 1658 1657 Int iCheckSumRight = 0; 1659 1658 1660 for (Int iCurVal = 0 ; iCurVal < ( 1 << g_bitDepthY); iCurVal++)1659 for (Int iCurVal = 0 ; iCurVal < ( 1 << REN_BIT_DEPTH ); iCurVal++) 1661 1660 { 1662 1661 iCheckSumLeft += aiHistLeft [iCurVal]; … … 1665 1664 1666 1665 1667 while( iCurChangeVal < ( 1 << g_bitDepthY) )1666 while( iCurChangeVal < ( 1 << REN_BIT_DEPTH ) ) 1668 1667 { 1669 1668 if ( iCumSumBase == iCumSumChange ) 1670 1669 { 1671 aiConvLUT[iCurChangeVal] = std::min( iCurBaseVal, ( 1 << g_bitDepthY) - 1 );1670 aiConvLUT[iCurChangeVal] = std::min( iCurBaseVal, ( 1 << REN_BIT_DEPTH ) - 1 ); 1672 1671 iCurBaseVal ++; 1673 1672 iCurChangeVal++; 1674 1673 iCumSumChange += aiHistChange[iCurChangeVal]; 1675 if (iCurBaseVal < ( 1 << g_bitDepthY) )1674 if (iCurBaseVal < ( 1 << REN_BIT_DEPTH ) ) 1676 1675 { 1677 1676 iCumSumBase += aiHistBase [iCurBaseVal] ; … … 1681 1680 { 1682 1681 iCurBaseVal++; 1683 if (iCurBaseVal < ( 1 << g_bitDepthY) )1682 if (iCurBaseVal < ( 1 << REN_BIT_DEPTH ) ) 1684 1683 { 1685 1684 iCumSumBase += aiHistBase [iCurBaseVal] ; … … 1688 1687 else if ( iCumSumBase > iCumSumChange) 1689 1688 { 1690 aiConvLUT[iCurChangeVal] = std::min(iCurBaseVal, ( 1 << g_bitDepthY)-1);1689 aiConvLUT[iCurChangeVal] = std::min(iCurBaseVal, ( 1 << REN_BIT_DEPTH )-1); 1691 1690 iCurChangeVal++; 1692 1691 iCumSumChange += aiHistChange [iCurChangeVal] ; … … 1897 1896 Void TRenTop::temporalFilterVSRS( TComPicYuv* pcPicYuvVideoCur, TComPicYuv* pcPicYuvDepthCur, TComPicYuv* pcPicYuvVideoLast, TComPicYuv* pcPicYuvDepthLast, Bool bFirstFrame ) 1898 1897 { 1899 AOF( g_bitDepthY == g_bitDepthC );1900 1898 Int iSADThres = 100 ; //threshold of sad in 4*4 block motion detection 1901 1899 … … 1906 1904 Int* piFlagMoving = m_aiBlkMoving + 2; 1907 1905 1908 Int iVideoCurStride = pcPicYuvVideoCur ->getStride( );1909 Int iVideoLastStride = pcPicYuvVideoLast->getStride( );1910 Int iDepthCurStride = pcPicYuvDepthCur ->getStride( );1911 Int iDepthLastStride = pcPicYuvDepthLast->getStride( );1912 1913 Pel* pcVideoCurData = pcPicYuvVideoCur ->get LumaAddr();1914 Pel* pcVideoLastData = pcPicYuvVideoLast->get LumaAddr();1915 Pel* pcDepthCurData = pcPicYuvDepthCur ->get LumaAddr();1916 Pel* pcDepthLastData = pcPicYuvDepthLast->get LumaAddr();1906 Int iVideoCurStride = pcPicYuvVideoCur ->getStride( COMPONENT_Y ); 1907 Int iVideoLastStride = pcPicYuvVideoLast->getStride( COMPONENT_Y ); 1908 Int iDepthCurStride = pcPicYuvDepthCur ->getStride( COMPONENT_Y ); 1909 Int iDepthLastStride = pcPicYuvDepthLast->getStride( COMPONENT_Y ); 1910 1911 Pel* pcVideoCurData = pcPicYuvVideoCur ->getAddr( COMPONENT_Y ); 1912 Pel* pcVideoLastData = pcPicYuvVideoLast->getAddr( COMPONENT_Y ); 1913 Pel* pcDepthCurData = pcPicYuvDepthCur ->getAddr( COMPONENT_Y ); 1914 Pel* pcDepthLastData = pcPicYuvDepthLast->getAddr( COMPONENT_Y ); 1917 1915 1918 1916 Pel* pcVideoCurDataFrm = pcVideoCurData ; … … 1964 1962 { //Weight: 0.75 1965 1963 Int iFilt = (( (pcDepthLastDataBlk[iCurPosX] << 1 ) + pcDepthLastDataBlk[iCurPosX] + pcDepthCurDataBlk[iCurPosX] + 2 ) >> 2 ); 1966 assert( (iFilt >= 0) && (iFilt < ( 1 << g_bitDepthY) ) );1964 assert( (iFilt >= 0) && (iFilt < ( 1 << REN_BIT_DEPTH ) ) ); 1967 1965 pcDepthCurDataBlk[iCurPosX] = pcDepthLastDataBlk[iCurPosX]; 1968 1966 pcDepthCurDataBlk[iCurPosX] = iFilt; … … 2169 2167 } 2170 2168 2171 TRenFilter ::setSubPelShiftLUT(m_iRelShiftLUTPrec, m_aaiSubPelShift, -1);2169 TRenFilter<REN_BIT_DEPTH>::setSubPelShiftLUT(m_iRelShiftLUTPrec, m_aaiSubPelShift, -1); 2172 2170 } 2173 2171 … … 2235 2233 if(m_aiBlkMoving != NULL ) delete[] m_aiBlkMoving; 2236 2234 } 2237 #endif // H_3D2238 2235 #endif // NH_3D 2236
Note: See TracChangeset for help on using the changeset viewer.