Changeset 28 in 3DVCSoftware for branches/0.3-poznan-univ/source/Lib/TLibRenderer
- Timestamp:
- 24 Feb 2012, 20:22:58 (13 years ago)
- Location:
- branches/0.3-poznan-univ/source/Lib/TLibRenderer
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/0.3-poznan-univ/source/Lib/TLibRenderer/TRenFilter.cpp
r5 r28 66 66 riBlendDistWeight = bBlendUseDistWeight ? iRelDistToLeft : 1 << (REN_VDWEIGHT_PREC - 1); 67 67 68 for (UInt uiDepthValue = 0; uiDepthValue <= 256; uiDepthValue++)68 for (UInt uiDepthValue = 0; uiDepthValue <= SizeOfLUT; uiDepthValue++) 69 69 { 70 70 //GT: retrieve depth approx from shift … … 73 73 } 74 74 // Set Threshold 75 riBlendZThres = ( max( abs(piInvZLUTLeft[0]- piInvZLUTLeft[ 255]), abs(piInvZLUTRight[0]- piInvZLUTRight[255]) ) * iBlendZThresPerc + 50) / 100;75 riBlendZThres = ( max( abs(piInvZLUTLeft[0]- piInvZLUTLeft[SizeOfLUT-1]), abs(piInvZLUTRight[0]- piInvZLUTRight[SizeOfLUT-1]) ) * iBlendZThresPerc + 50) / 100; 76 76 } 77 77 -
branches/0.3-poznan-univ/source/Lib/TLibRenderer/TRenSingleModel.cpp
r5 r28 139 139 if (m_iMode == 2) 140 140 { 141 m_piInvZLUTLeft = new Int[ 257];142 m_piInvZLUTRight = new Int[ 257];141 m_piInvZLUTLeft = new Int[SizeOfLUT+1]; 142 m_piInvZLUTRight = new Int[SizeOfLUT+1]; 143 143 } 144 144 … … 448 448 m_iLastOccludedSPosFP = xRangeLeftL( m_iLastOccludedSPos ); 449 449 xExtrapolateMarginL ( iCurSPos, iEndChangePos, iError ); 450 iMinChangedSPos = Min( iMinChangedSPos, (iEndChangePos << m_iShiftPrec) - m_ppiCurLUT[0][ RemoveBitIncrement ( Max(m_apiBaseDepthPelRow[m_iCurViewPos][iEndChangePos], m_piNewDepthData[iPosXinNewData] )) ]);450 iMinChangedSPos = Min( iMinChangedSPos, (iEndChangePos << m_iShiftPrec) - m_ppiCurLUT[0][ RemoveBitIncrementLUT( Max(m_apiBaseDepthPelRow[m_iCurViewPos][iEndChangePos], m_piNewDepthData[iPosXinNewData] )) ]); 451 451 iLastSPos = iCurSPos; 452 452 m_iLastDepth = m_iCurDepth; … … 466 466 { 467 467 // Get minimal changed sample position 468 iMinChangedSPos = Min( iMinChangedSPos, (iCurPosX << m_iShiftPrec) - m_ppiCurLUT[0][ RemoveBitIncrement ( Max(m_apiBaseDepthPelRow[m_iCurViewPos][iCurPosX], m_piNewDepthData[iPosXinNewData] )) ]);468 iMinChangedSPos = Min( iMinChangedSPos, (iCurPosX << m_iShiftPrec) - m_ppiCurLUT[0][ RemoveBitIncrementLUT( Max(m_apiBaseDepthPelRow[m_iCurViewPos][iCurPosX], m_piNewDepthData[iPosXinNewData] )) ]); 469 469 Int iCurSPos = xShiftNewData(iCurPosX,iPosXinNewData); 470 470 m_iCurDepth = m_piNewDepthData[iPosXinNewData]; … … 541 541 m_iLastOccludedSPosFP = xRangeRightR( m_iLastOccludedSPos ); 542 542 xExtrapolateMarginR ( iCurSPos, iStartChangePos, iError ); 543 iMaxChangedSPos = Max( iMaxChangedSPos, (iStartChangePos << m_iShiftPrec) - m_ppiCurLUT[0][ RemoveBitIncrement ( Max(m_apiBaseDepthPelRow[m_iCurViewPos][iStartChangePos], m_piNewDepthData[iPosXinNewData] )) ]);543 iMaxChangedSPos = Max( iMaxChangedSPos, (iStartChangePos << m_iShiftPrec) - m_ppiCurLUT[0][ RemoveBitIncrementLUT( Max(m_apiBaseDepthPelRow[m_iCurViewPos][iStartChangePos], m_piNewDepthData[iPosXinNewData] )) ]); 544 544 iLastSPos = iCurSPos; 545 545 m_iLastDepth = m_iCurDepth; … … 559 559 { 560 560 // Get minimal changed sample position 561 iMaxChangedSPos = Max( iMaxChangedSPos, (iCurPosX << m_iShiftPrec) - m_ppiCurLUT[0][ RemoveBitIncrement ( Max(m_apiBaseDepthPelRow[m_iCurViewPos][iCurPosX], m_piNewDepthData[iPosXinNewData] )) ]);561 iMaxChangedSPos = Max( iMaxChangedSPos, (iCurPosX << m_iShiftPrec) - m_ppiCurLUT[0][ RemoveBitIncrementLUT( Max(m_apiBaseDepthPelRow[m_iCurViewPos][iCurPosX], m_piNewDepthData[iPosXinNewData] )) ]); 562 562 Int iCurSPos = xShiftNewData(iCurPosX,iPosXinNewData); 563 563 m_iCurDepth = m_piNewDepthData[iPosXinNewData]; … … 948 948 AOF( iPosInNewData < m_iNewDataWidth ); 949 949 950 return (iPosX << m_iShiftPrec) - m_ppiCurLUT[0][ RemoveBitIncrement ( m_piNewDepthData[iPosInNewData] )];950 return (iPosX << m_iShiftPrec) - m_ppiCurLUT[0][ RemoveBitIncrementLUT( m_piNewDepthData[iPosInNewData] )]; 951 951 } 952 952 … … 956 956 AOT( iPosX < 0); 957 957 AOF( iPosX < m_iWidth); 958 return (iPosX << m_iShiftPrec) - m_ppiCurLUT[0][ RemoveBitIncrement ( m_apiBaseDepthPelRow[m_iCurViewPos][iPosX] )];958 return (iPosX << m_iShiftPrec) - m_ppiCurLUT[0][ RemoveBitIncrementLUT( m_apiBaseDepthPelRow[m_iCurViewPos][iPosX] )]; 959 959 } 960 960 … … 1149 1149 m_aapiSynthVideoPelRow [1][2][iTargetSPos] , 1150 1150 #endif 1151 m_piInvZLUTLeft [RemoveBitIncrement (m_iThisDepth) ],1152 m_piInvZLUTRight[RemoveBitIncrement (m_apiSynthDepthPelRow[1] [iTargetSPos])],1151 m_piInvZLUTLeft [RemoveBitIncrementLUT(m_iThisDepth) ], 1152 m_piInvZLUTRight[RemoveBitIncrementLUT(m_apiSynthDepthPelRow[1] [iTargetSPos])], 1153 1153 iFilled, 1154 1154 m_apiFilledRow [1] [iTargetSPos] , … … 1171 1171 m_aapiBaseVideoPelRow [1][2][iSourcePos ], 1172 1172 #endif 1173 m_piInvZLUTLeft [RemoveBitIncrement (m_apiSynthDepthPelRow[0] [iTargetSPos])],1174 m_piInvZLUTRight[RemoveBitIncrement (m_iThisDepth) ],1173 m_piInvZLUTLeft [RemoveBitIncrementLUT(m_apiSynthDepthPelRow[0] [iTargetSPos])], 1174 m_piInvZLUTRight[RemoveBitIncrementLUT(m_iThisDepth) ], 1175 1175 m_apiFilledRow [0] [iTargetSPos], 1176 1176 iFilled , -
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 -
branches/0.3-poznan-univ/source/Lib/TLibRenderer/TRenTop.h
r5 r28 109 109 Int iBlendMode, 110 110 Int iSimEnhBaseView ); 111 112 #if POZNAN_SYNTH 113 Void extrapolateAvailabilityView 114 ( TComPicYuv* pcPicYuvVideo, 115 TComPicYuv* pcPicYuvDepth, 116 TComPicYuv* pcPicYuvSynthOut, 117 TComPicYuv* pcPicYuvAvailOut, 118 Bool bRenderFromLeft ); 119 #endif 111 120 // Tools 112 121 Void getUsedSamplesMap ( TComPicYuv* pcPicYuvDepth,
Note: See TracChangeset for help on using the changeset viewer.