Changeset 28 in 3DVCSoftware for branches/0.3-poznan-univ/source/Lib/TLibRenderer/TRenTop.cpp
- Timestamp:
- 24 Feb 2012, 20:22:58 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/0.3-poznan-univ/source/Lib/TLibRenderer/TRenTop.cpp
r5 r28 242 242 for( UInt uiPlane = 0; uiPlane < 2; uiPlane++) 243 243 { 244 for (UInt uiDepthValue = 0; uiDepthValue <= 256; uiDepthValue++)244 for (UInt uiDepthValue = 0; uiDepthValue <= SizeOfLUT; uiDepthValue++) 245 245 { 246 246 m_ppdShiftLUTRightMirror[uiPlane][uiDepthValue] = - m_ppdShiftLUTRight[uiPlane][uiDepthValue]; … … 280 280 }; 281 281 282 #if POZNAN_SYNTH 283 Void TRenTop::extrapolateAvailabilityView( TComPicYuv* pcPicYuvVideo, TComPicYuv* pcPicYuvDepth, TComPicYuv* pcPicYuvSynthOut, TComPicYuv* pcPicYuvAvailOut, Bool bRenderFromLeft ) 284 { 285 AOF( m_bExtrapolate ); 286 AOF( bRenderFromLeft ? m_ppiShiftLUTLeft || m_ppdShiftLUTLeft : m_ppiShiftLUTRight || m_ppdShiftLUTRight ); 287 AOF( m_auiInputResolution[0] == pcPicYuvVideo->getWidth ()); 288 AOF( m_auiInputResolution[1] == pcPicYuvVideo->getHeight()); 289 290 PelImage cInputImage ( pcPicYuvVideo ); 291 PelImage cInputDepth ( pcPicYuvDepth , true); 292 PelImage cOutputImage( pcPicYuvSynthOut ); 293 PelImage cFillImage( pcPicYuvAvailOut ); 294 295 m_pcOutputImage->init(); 296 m_pcFilled ->assign(REN_IS_HOLE); 297 298 xPreProcessDepth ( &cInputDepth, &cInputDepth); 299 xConvertInputData( &cInputImage, &cInputDepth, m_pcInputImage, m_pcInputDepth, !bRenderFromLeft ); 300 xShiftPixels(m_pcInputImage, m_pcInputDepth, m_pcOutputImage, &cFillImage, bRenderFromLeft); 301 xRemBoundaryNoise ( m_pcOutputImage, &cFillImage, m_pcOutputImage, bRenderFromLeft); // Erode 302 xFillHoles ( m_pcOutputImage, &cFillImage, m_pcOutputImage, bRenderFromLeft); 303 xConvertOutputData( m_pcOutputImage, &cOutputImage, !bRenderFromLeft ); 304 if (!bRenderFromLeft) TRenFilter::mirrorHor( &cFillImage ); 305 //xConvertOutputData( m_pcFilled, &cFillImage, !bRenderFromLeft ); 306 xPostProcessImage (&cOutputImage, &cOutputImage); 307 xCutMargin ( &cOutputImage ); 308 }; 309 #endif 310 282 311 Void TRenTop::getUsedSamplesMap( TComPicYuv* pcPicYuvDepth, TComPicYuv* pcUsedSampleMap, Bool bRenderFromLeft ) 283 312 { … … 469 498 470 499 // compute disparity and shift 471 iShiftedPos = ( iPosX << m_iRelShiftLUTPrec ) - m_aiShiftLUTCur[RemoveBitIncrement ( pcDepthData[iPosX])];500 iShiftedPos = ( iPosX << m_iRelShiftLUTPrec ) - m_aiShiftLUTCur[RemoveBitIncrementLUT( pcDepthData[iPosX])]; 472 501 473 502 if (iPosX == 0) … … 623 652 624 653 // compute disparity and shift 625 assert( RemoveBitIncrement (pcDepthData[iPosX]) >= 0 && RemoveBitIncrement(pcDepthData[iPosX]) <= 256);626 dPrevShiftedPos = (Double) iPosX - m_adShiftLUTCur[ RemoveBitIncrement (pcDepthData[iPosX])];654 assert( RemoveBitIncrementLUT(pcDepthData[iPosX]) >= 0 && RemoveBitIncrementLUT(pcDepthData[iPosX]) <= SizeOfLUT ); 655 dPrevShiftedPos = (Double) iPosX - m_adShiftLUTCur[ RemoveBitIncrementLUT(pcDepthData[iPosX])]; 627 656 628 657 if (iPosX == 0) … … 804 833 for(Int iPosX = 0; iPosX < iWidth; iPosX++) 805 834 { 806 assert( RemoveBitIncrement (pcDepthData[iPosX]) >= 0 && RemoveBitIncrement(pcDepthData[iPosX]) <= 256);807 Int iShiftedPos = iPosX - m_aiShiftLUTCur[ RemoveBitIncrement (pcDepthData[iPosX])] ;835 assert( RemoveBitIncrementLUT(pcDepthData[iPosX]) >= 0 && RemoveBitIncrementLUT(pcDepthData[iPosX]) <= SizeOfLUT ); 836 Int iShiftedPos = iPosX - m_aiShiftLUTCur[ RemoveBitIncrementLUT(pcDepthData[iPosX])] ; 808 837 if (iShiftedPos < iWidth && iShiftedPos >= 0) 809 838 { … … 879 908 for(Int iPosX = 0; iPosX < iOutputWidth; iPosX ++) 880 909 { 881 Int iBackShiftedPos = (iPosX << m_iRelShiftLUTPrec) - m_aiShiftLUTCur[ RemoveBitIncrement ( pcDepthData[iPosX] )];910 Int iBackShiftedPos = (iPosX << m_iRelShiftLUTPrec) - m_aiShiftLUTCur[ RemoveBitIncrementLUT( pcDepthData[iPosX] )]; 882 911 if( ( pcFilledData[iPosX] == REN_IS_FILLED ) && (iBackShiftedPos >= 0 ) && ( iBackShiftedPos < iInputWidth ) ) 883 912 { … … 952 981 { 953 982 // compute disparity and shift 954 iShiftedPos = iPosX - m_aiShiftLUTCur[RemoveBitIncrement (pcDepthData[iPosX])];983 iShiftedPos = iPosX - m_aiShiftLUTCur[RemoveBitIncrementLUT(pcDepthData[iPosX])]; 955 984 956 985 if ( iPosX == 0 ) … … 1837 1866 if ( (pcFilledRightData[uiXPos] != REN_IS_HOLE ) && ( pcFilledLeftData[uiXPos] != REN_IS_HOLE) ) 1838 1867 { 1839 Int iDepthDifference = m_piInvZLUTLeft[RemoveBitIncrement (pcLeftDepthData[uiXPos])] - m_piInvZLUTRight[RemoveBitIncrement(pcRightDepthData[uiXPos])];1868 Int iDepthDifference = m_piInvZLUTLeft[RemoveBitIncrementLUT(pcLeftDepthData[uiXPos])] - m_piInvZLUTRight[RemoveBitIncrementLUT(pcRightDepthData[uiXPos])]; 1840 1869 1841 1870 if ( abs ( iDepthDifference ) <= m_iBlendZThres ) … … 1866 1895 else if ( (pcFilledRightData[uiXPos] == REN_IS_HOLE) && (pcFilledLeftData[uiXPos] == REN_IS_HOLE)) 1867 1896 { 1868 pcOutputData[uiXPos] = m_piInvZLUTLeft[RemoveBitIncrement ( pcLeftDepthData[uiXPos])] < m_piInvZLUTRight[RemoveBitIncrement(pcRightDepthData[uiXPos])] ? pcLeftVideoData[uiXPos] : pcRightVideoData[uiXPos];1897 pcOutputData[uiXPos] = m_piInvZLUTLeft[RemoveBitIncrementLUT( pcLeftDepthData[uiXPos])] < m_piInvZLUTRight[RemoveBitIncrementLUT(pcRightDepthData[uiXPos])] ? pcLeftVideoData[uiXPos] : pcRightVideoData[uiXPos]; 1869 1898 } 1870 1899 else … … 2030 2059 2031 2060 m_ppdShiftLUTRightMirror = new Double*[2]; 2032 m_ppdShiftLUTRightMirror[0] = new Double [ 257];2033 m_ppdShiftLUTRightMirror[1] = new Double [ 257];2061 m_ppdShiftLUTRightMirror[0] = new Double [SizeOfLUT+1]; 2062 m_ppdShiftLUTRightMirror[1] = new Double [SizeOfLUT+1]; 2034 2063 2035 2064 m_adShiftLUTCur = 0; … … 2038 2067 m_ppiShiftLUTRight = 0; 2039 2068 m_ppiShiftLUTRightMirror = new Int*[2]; 2040 m_ppiShiftLUTRightMirror[0] = new Int[ 257];2041 m_ppiShiftLUTRightMirror[1] = new Int[ 257];2069 m_ppiShiftLUTRightMirror[0] = new Int[SizeOfLUT+1]; 2070 m_ppiShiftLUTRightMirror[1] = new Int[SizeOfLUT+1]; 2042 2071 2043 2072 m_aiShiftLUTCur = 0; 2044 m_piInvZLUTLeft = new Int[ 257];2045 m_piInvZLUTRight = new Int[ 257];2073 m_piInvZLUTLeft = new Int[SizeOfLUT+1]; 2074 m_piInvZLUTRight = new Int[SizeOfLUT+1]; 2046 2075 2047 2076 // Buffers
Note: See TracChangeset for help on using the changeset viewer.