Changeset 12 in 3DVCSoftware for branches/0.2-poznan-univ/source/Lib/TLibRenderer/TRenTop.cpp
- Timestamp:
- 6 Feb 2012, 00:52:17 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/0.2-poznan-univ/source/Lib/TLibRenderer/TRenTop.cpp
r11 r12 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]; … … 266 266 PelImage cInputDepth ( pcPicYuvDepth , true); 267 267 PelImage cOutputImage( pcPicYuvSynthOut ); 268 268 269 269 m_pcOutputImage->init(); 270 270 m_pcFilled ->assign(REN_IS_HOLE); 271 271 272 xPreProcessDepth ( &cInputDepth, &cInputDepth); 272 273 xConvertInputData( &cInputImage, &cInputDepth, m_pcInputImage, m_pcInputDepth, !bRenderFromLeft ); … … 279 280 }; 280 281 281 #if POZNAN_ SYNTH282 #if POZNAN_CU_SYNTH || POZNAN_CU_SKIP 282 283 Void TRenTop::extrapolateAvailabilityView( TComPicYuv* pcPicYuvVideo, TComPicYuv* pcPicYuvDepth, TComPicYuv* pcPicYuvSynthOut, TComPicYuv* pcPicYuvAvailOut, Bool bRenderFromLeft ) 283 284 { … … 292 293 PelImage cFillImage( pcPicYuvAvailOut ); 293 294 295 printf("0"); 294 296 m_pcOutputImage->init(); 295 297 m_pcFilled ->assign(REN_IS_HOLE); 296 298 printf("1"); 297 299 xPreProcessDepth ( &cInputDepth, &cInputDepth); 300 printf("2"); 298 301 xConvertInputData( &cInputImage, &cInputDepth, m_pcInputImage, m_pcInputDepth, !bRenderFromLeft ); 302 printf("3"); 299 303 xShiftPixels(m_pcInputImage, m_pcInputDepth, m_pcOutputImage, &cFillImage, bRenderFromLeft); 304 printf("4"); 300 305 xRemBoundaryNoise ( m_pcOutputImage, &cFillImage, m_pcOutputImage, bRenderFromLeft); // Erode 306 printf("5"); 301 307 xFillHoles ( m_pcOutputImage, &cFillImage, m_pcOutputImage, bRenderFromLeft); 308 printf("6"); 302 309 xConvertOutputData( m_pcOutputImage, &cOutputImage, !bRenderFromLeft ); 303 310 if (!bRenderFromLeft) TRenFilter::mirrorHor( &cFillImage ); 304 311 //xConvertOutputData( m_pcFilled, &cFillImage, !bRenderFromLeft ); 312 printf("7"); 305 313 xPostProcessImage (&cOutputImage, &cOutputImage); 314 printf("8"); 306 315 xCutMargin ( &cOutputImage ); 316 printf("9"); 307 317 }; 308 318 #endif … … 497 507 498 508 // compute disparity and shift 499 iShiftedPos = ( iPosX << m_iRelShiftLUTPrec ) - m_aiShiftLUTCur[RemoveBitIncrement ( pcDepthData[iPosX])];509 iShiftedPos = ( iPosX << m_iRelShiftLUTPrec ) - m_aiShiftLUTCur[RemoveBitIncrementLUT( pcDepthData[iPosX])]; 500 510 501 511 if (iPosX == 0) … … 651 661 652 662 // compute disparity and shift 653 assert( RemoveBitIncrement (pcDepthData[iPosX]) >= 0 && RemoveBitIncrement(pcDepthData[iPosX]) <= 256);654 dPrevShiftedPos = (Double) iPosX - m_adShiftLUTCur[ RemoveBitIncrement (pcDepthData[iPosX])];663 assert( RemoveBitIncrementLUT(pcDepthData[iPosX]) >= 0 && RemoveBitIncrementLUT(pcDepthData[iPosX]) <= SizeOfLUT ); 664 dPrevShiftedPos = (Double) iPosX - m_adShiftLUTCur[ RemoveBitIncrementLUT(pcDepthData[iPosX])]; 655 665 656 666 if (iPosX == 0) … … 832 842 for(Int iPosX = 0; iPosX < iWidth; iPosX++) 833 843 { 834 assert( RemoveBitIncrement (pcDepthData[iPosX]) >= 0 && RemoveBitIncrement(pcDepthData[iPosX]) <= 256);835 Int iShiftedPos = iPosX - m_aiShiftLUTCur[ RemoveBitIncrement (pcDepthData[iPosX])] ;844 assert( RemoveBitIncrementLUT(pcDepthData[iPosX]) >= 0 && RemoveBitIncrementLUT(pcDepthData[iPosX]) <= SizeOfLUT ); 845 Int iShiftedPos = iPosX - m_aiShiftLUTCur[ RemoveBitIncrementLUT(pcDepthData[iPosX])] ; 836 846 if (iShiftedPos < iWidth && iShiftedPos >= 0) 837 847 { … … 907 917 for(Int iPosX = 0; iPosX < iOutputWidth; iPosX ++) 908 918 { 909 Int iBackShiftedPos = (iPosX << m_iRelShiftLUTPrec) - m_aiShiftLUTCur[ RemoveBitIncrement ( pcDepthData[iPosX] )];919 Int iBackShiftedPos = (iPosX << m_iRelShiftLUTPrec) - m_aiShiftLUTCur[ RemoveBitIncrementLUT( pcDepthData[iPosX] )]; 910 920 if( ( pcFilledData[iPosX] == REN_IS_FILLED ) && (iBackShiftedPos >= 0 ) && ( iBackShiftedPos < iInputWidth ) ) 911 921 { … … 980 990 { 981 991 // compute disparity and shift 982 iShiftedPos = iPosX - m_aiShiftLUTCur[RemoveBitIncrement (pcDepthData[iPosX])];992 iShiftedPos = iPosX - m_aiShiftLUTCur[RemoveBitIncrementLUT(pcDepthData[iPosX])]; 983 993 984 994 if ( iPosX == 0 ) … … 1865 1875 if ( (pcFilledRightData[uiXPos] != REN_IS_HOLE ) && ( pcFilledLeftData[uiXPos] != REN_IS_HOLE) ) 1866 1876 { 1867 Int iDepthDifference = m_piInvZLUTLeft[RemoveBitIncrement (pcLeftDepthData[uiXPos])] - m_piInvZLUTRight[RemoveBitIncrement(pcRightDepthData[uiXPos])];1877 Int iDepthDifference = m_piInvZLUTLeft[RemoveBitIncrementLUT(pcLeftDepthData[uiXPos])] - m_piInvZLUTRight[RemoveBitIncrementLUT(pcRightDepthData[uiXPos])]; 1868 1878 1869 1879 if ( abs ( iDepthDifference ) <= m_iBlendZThres ) … … 1894 1904 else if ( (pcFilledRightData[uiXPos] == REN_IS_HOLE) && (pcFilledLeftData[uiXPos] == REN_IS_HOLE)) 1895 1905 { 1896 pcOutputData[uiXPos] = m_piInvZLUTLeft[RemoveBitIncrement ( pcLeftDepthData[uiXPos])] < m_piInvZLUTRight[RemoveBitIncrement(pcRightDepthData[uiXPos])] ? pcLeftVideoData[uiXPos] : pcRightVideoData[uiXPos];1906 pcOutputData[uiXPos] = m_piInvZLUTLeft[RemoveBitIncrementLUT( pcLeftDepthData[uiXPos])] < m_piInvZLUTRight[RemoveBitIncrementLUT(pcRightDepthData[uiXPos])] ? pcLeftVideoData[uiXPos] : pcRightVideoData[uiXPos]; 1897 1907 } 1898 1908 else … … 2058 2068 2059 2069 m_ppdShiftLUTRightMirror = new Double*[2]; 2060 m_ppdShiftLUTRightMirror[0] = new Double [ 257];2061 m_ppdShiftLUTRightMirror[1] = new Double [ 257];2070 m_ppdShiftLUTRightMirror[0] = new Double [SizeOfLUT+1]; 2071 m_ppdShiftLUTRightMirror[1] = new Double [SizeOfLUT+1]; 2062 2072 2063 2073 m_adShiftLUTCur = 0; … … 2066 2076 m_ppiShiftLUTRight = 0; 2067 2077 m_ppiShiftLUTRightMirror = new Int*[2]; 2068 m_ppiShiftLUTRightMirror[0] = new Int[ 257];2069 m_ppiShiftLUTRightMirror[1] = new Int[ 257];2078 m_ppiShiftLUTRightMirror[0] = new Int[SizeOfLUT+1]; 2079 m_ppiShiftLUTRightMirror[1] = new Int[SizeOfLUT+1]; 2070 2080 2071 2081 m_aiShiftLUTCur = 0; 2072 m_piInvZLUTLeft = new Int[ 257];2073 m_piInvZLUTRight = new Int[ 257];2082 m_piInvZLUTLeft = new Int[SizeOfLUT+1]; 2083 m_piInvZLUTRight = new Int[SizeOfLUT+1]; 2074 2084 2075 2085 // Buffers
Note: See TracChangeset for help on using the changeset viewer.