Changeset 166 in 3DVCSoftware for branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibRenderer/TRenTop.cpp
- Timestamp:
- 1 Nov 2012, 19:22:41 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibRenderer/TRenTop.cpp
r100 r166 127 127 } 128 128 129 #if NTT_SUBPEL 130 Void TRenTop::xConvertInputVideoSubpel( PelImage* pcOrgInputImage, PelImage* pcConvInputImage, PelImage* pcInputDepth, Bool bMirror ) 131 { 132 PelImagePlane* pcOrgPlane; 133 PelImagePlane* pcConvPlane; 134 PelImagePlane* pcDepthPlane; 135 PelImagePlane* pcTmpPlane; 136 137 Int ** ppiFposLUT = bMirror ? m_ppiFposLUTRightMirror : m_ppiFposLUTLeft; 138 139 AOT( m_iLog2SamplingFactor ); 140 AOF( m_iInterpolationMode == eRenInt8Tap2 ); 141 142 pcDepthPlane = pcInputDepth->getPlane( 0 ); 143 pcTmpPlane = pcConvInputImage->getPlane( 0 ); 144 145 AOF( m_bUVUp ); // Currently only m_bUVUp=true is supported 146 for (UInt uiPlane = 1; uiPlane < 3; uiPlane++) 147 { 148 pcOrgPlane = pcOrgInputImage ->getPlane(uiPlane); 149 pcConvPlane = pcConvInputImage->getPlane(uiPlane); 150 151 if ( m_bUVUp ) 152 { 153 TRenFilter::sampleCVerUp (pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight() , pcTmpPlane ->getPlaneData(), pcTmpPlane ->getStride() ); 154 TRenFilter::sampleCConvHorUp(pcTmpPlane->getPlaneData(), pcTmpPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight()*2, pcConvPlane->getPlaneData(), pcConvPlane->getStride(), pcDepthPlane->getPlaneData(), pcDepthPlane->getStride(), ppiFposLUT ); 155 } 156 else 157 { 158 TRenFilter::sampleCConv (pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight()*2, pcConvPlane->getPlaneData(), pcConvPlane->getStride(), pcDepthPlane->getPlaneData(), pcDepthPlane->getStride(), ppiFposLUT ); 159 } 160 } 161 162 pcOrgPlane = pcOrgInputImage ->getPlane(0); 163 pcConvPlane = pcConvInputImage->getPlane(0); 164 TRenFilter::sampleConv(pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride(), pcDepthPlane->getPlaneData(), pcDepthPlane->getStride(), ppiFposLUT); 165 } 166 167 Void TRenTop::xConvertInputDepthSubpel( PelImage* pcOrgInputImage, PelImage* pcConvInputImage) 168 { 169 PelImagePlane* pcOrgPlane ; 170 PelImagePlane* pcConvPlane; 171 172 // Full Plane 173 pcOrgPlane = pcOrgInputImage ->getPlane(0); 174 pcConvPlane = pcConvInputImage->getPlane(0); 175 176 AOT( m_iLog2SamplingFactor ); 177 AOF( m_iInterpolationMode == eRenInt8Tap2 ); 178 179 TRenFilter::sampleHorUp(m_iLog2SamplingFactor, pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride()); 180 181 AOF( m_bUVUp ); 182 if ( !m_bUVUp ) //GT: depth down 183 { 184 // Quarter Plane 185 PelImagePlane* pcTempPlane = new PelImagePlane(pcOrgInputImage->getPlane(0)->getWidth(), ( pcOrgInputImage->getPlane(0)->getHeight() >> 1), REN_LUMA_MARGIN ); 186 187 TRenFilter::sampleVerDown2Tap13(pcOrgInputImage->getPlane(0), pcTempPlane, PICYUV_PAD); 188 pcConvPlane = pcConvInputImage->getPlane(1); 189 190 if ( m_iLog2SamplingFactor == 0 ) 191 { 192 TRenFilter::sampleHorDown2Tap13(pcTempPlane, pcConvPlane, 0 ); 193 } 194 else 195 { 196 TRenFilter::sampleHorUp ( m_iLog2SamplingFactor - 1, pcTempPlane->getPlaneData(), pcTempPlane->getStride(), pcTempPlane->getWidth(), pcTempPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride()); 197 } 198 delete pcTempPlane; 199 } 200 } 201 #endif 202 129 203 Void TRenTop::xConvertInputDepth( PelImage* pcOrgInputImage, PelImage* pcConvInputImage) 130 204 { … … 193 267 } 194 268 269 #if NTT_SUBPEL 270 Void TRenTop::xConvertInputDataSubpel( PelImage* pcOrgInputImage, PelImage* pcOrgInputDepth, PelImage* pcConvInputImage, PelImage* pcConvInputDepth, Bool bMirror ) 271 { 272 //ToDo: remove unnecessary copying 273 if ( bMirror ) 274 { 275 m_pcTempImage->getPlane(0)->assign( pcOrgInputDepth->getPlane(0) ); 276 TRenFilter::mirrorHor( m_pcTempImage->getPlane(0) ); 277 m_pcTempImage->getPlane(0)->extendMargin(); 278 xConvertInputDepthSubpel( m_pcTempImage, pcConvInputDepth ); 279 280 m_pcTempImage->assign( pcOrgInputImage ); 281 TRenFilter::mirrorHor( m_pcTempImage ); 282 m_pcTempImage->extendMargin(); 283 xConvertInputVideoSubpel( m_pcTempImage, pcConvInputImage, pcConvInputDepth, bMirror ); 284 } 285 else 286 { 287 m_pcTempImage->getPlane(0)->assign( pcOrgInputDepth->getPlane(0) ); 288 m_pcTempImage->getPlane(0)->extendMargin(); 289 xConvertInputDepthSubpel( m_pcTempImage, pcConvInputDepth ); 290 291 m_pcTempImage->assign( pcOrgInputImage ); 292 m_pcTempImage->extendMargin(); 293 xConvertInputVideoSubpel( m_pcTempImage, pcConvInputImage, pcConvInputDepth, bMirror ); 294 } 295 } 296 #endif 195 297 196 298 Void TRenTop::xConvertOutputData( PelImage* pcOrgOutputImage, PelImage* pcConvOutputImage, Bool bMirror ) … … 229 331 } 230 332 333 #if VSP_N 334 Void TRenTop::xConvertOutputDataPlane0( PelImage* pcOrgOutputImage, PelImage* pcConvOutputImage, Bool bMirror ) 335 { 336 Int iLog2SamplingFactor = m_iLog2SamplingFactor; 337 338 PelImagePlane* pcOrgPlane = pcOrgOutputImage ->getPlane(0); 339 PelImagePlane* pcConvPlane = pcConvOutputImage->getPlane(0); 340 341 pcOrgPlane->extendMargin(); 342 343 TRenFilter::sampleHorDown( iLog2SamplingFactor, pcOrgPlane->getPlaneData(), pcOrgPlane->getStride(), pcOrgPlane->getWidth(), pcOrgPlane->getHeight(), pcConvPlane->getPlaneData(), pcConvPlane->getStride()); 344 345 if ( bMirror ) 346 { 347 TRenFilter::mirrorHor( pcConvOutputImage ); 348 } 349 350 } 351 #endif 352 231 353 Void TRenTop::setShiftLUTs( Double** ppdShiftLUTLeft, Int** ppiShiftLUTLeft, Int** ppiBaseShiftLUTLeft, Double** ppdShiftLUTRight, Int** ppiShiftLUTRight, Int** ppiBaseShiftLUTRight, Int iRelDistToLeft ) 232 354 { … … 254 376 } 255 377 } 378 379 #if NTT_SUBPEL 380 Void TRenTop::setFposLUTs( Int** ppiFposLUTLeft, Int** ppiFposLUTRight ) 381 { 382 m_ppiFposLUTLeft = ppiFposLUTLeft; 383 m_ppiFposLUTRight = ppiFposLUTRight; 384 385 if ( m_ppiFposLUTRight != NULL ) 386 { 387 for( UInt uiPlane = 0; uiPlane < 2; uiPlane++) 388 { 389 for (UInt uiDepthValue = 0; uiDepthValue <= 256; uiDepthValue++) 390 { 391 m_ppiFposLUTRightMirror[uiPlane][uiDepthValue] = - m_ppiFposLUTRight[uiPlane][uiDepthValue]; 392 } 393 } 394 } 395 } 396 #endif 256 397 257 398 Void TRenTop::extrapolateView( TComPicYuv* pcPicYuvVideo, TComPicYuv* pcPicYuvDepth, TComPicYuv* pcPicYuvSynthOut, Bool bRenderFromLeft ) … … 278 419 xCutMargin ( &cOutputImage ); 279 420 }; 421 422 #if VSP_N 423 Void TRenTop::extrapolateAvailabilityView( TComPicYuv* pcPicYuvVideo, TComPicYuv* pcPicYuvDepth, TComPicYuv* pcPicYuvSynthOut, TComPicYuv* pcPicYuvAvailOut, Bool bRenderFromLeft ) 424 { 425 AOF( m_bExtrapolate ); 426 AOF( bRenderFromLeft ? m_ppiShiftLUTLeft || m_ppdShiftLUTLeft : m_ppiShiftLUTRight || m_ppdShiftLUTRight ); 427 AOF( m_auiInputResolution[0] == pcPicYuvVideo->getWidth ()); 428 AOF( m_auiInputResolution[1] == pcPicYuvVideo->getHeight()); 429 430 PelImage cInputImage ( pcPicYuvVideo ); 431 PelImage cInputDepth ( pcPicYuvDepth , true); 432 PelImage cOutputImage( pcPicYuvSynthOut ); 433 PelImage cFillImage ( pcPicYuvAvailOut ); 434 435 m_pcOutputImage->init(); 436 m_pcFilled ->assign(REN_IS_HOLE); 437 438 xPreProcessDepth ( &cInputDepth, &cInputDepth); 439 #if NTT_SUBPEL 440 if( m_iInterpolationMode == eRenInt8Tap2 ) 441 xConvertInputDataSubpel(&cInputImage, &cInputDepth, m_pcInputImage, m_pcInputDepth, !bRenderFromLeft ); 442 else 443 xConvertInputData( &cInputImage, &cInputDepth, m_pcInputImage, m_pcInputDepth, !bRenderFromLeft ); 444 #else 445 xConvertInputData( &cInputImage, &cInputDepth, m_pcInputImage, m_pcInputDepth, !bRenderFromLeft ); 446 #endif 447 xShiftPixels(m_pcInputImage, m_pcInputDepth, m_pcOutputImage, m_pcFilled, bRenderFromLeft); 448 xRemBoundaryNoise ( m_pcOutputImage, m_pcFilled, m_pcOutputImage, bRenderFromLeft); // Erode 449 xFillHoles ( m_pcOutputImage, m_pcFilled, m_pcOutputImage, bRenderFromLeft); 450 xConvertOutputData( m_pcOutputImage, &cOutputImage, !bRenderFromLeft ); 451 //if (!bRenderFromLeft) TRenFilter::mirrorHor( &cFillImage ); 452 xConvertOutputDataPlane0( m_pcFilled, &cFillImage, !bRenderFromLeft ); 453 xPostProcessImage (&cOutputImage, &cOutputImage); 454 xCutMargin ( &cOutputImage ); 455 }; 456 #endif 280 457 281 458 Void TRenTop::getUsedSamplesMap( TComPicYuv* pcPicYuvDepth, TComPicYuv* pcUsedSampleMap, Bool bRenderFromLeft ) … … 751 928 { 752 929 case eRenIntFullPel: 930 #if NTT_SUBPEL 931 case eRenInt8Tap2: 932 #endif 753 933 xShiftPlanePixelsFullPel( apcInPlane, pcDepthPlane, apcOutPlane, pcPlaneFilled, uiNumberOfPlanes); 754 934 break; … … 826 1006 } 827 1007 pcFilledData[iShiftedPos] = REN_IS_FILLED; 1008 1009 #if NTT_SUBPEL 1010 if(m_bInstantHoleFilling && (iDiff > 0) ) 1011 { 1012 Int iRefPos = (iPrevShiftedPos == -1) ? iShiftedPos : iPrevShiftedPos; 1013 1014 for (Int iCurPos = iPrevShiftedPos+1; iCurPos < iShiftedPos; iCurPos++) 1015 { 1016 for( UInt uiCurPlane = 0; uiCurPlane < uiNumberOfPlanes; uiCurPlane++) 1017 { 1018 apcOutputData[uiCurPlane][iCurPos] = apcOutputData[uiCurPlane][iRefPos]; 1019 } 1020 pcFilledData[iCurPos] = REN_IS_FILLED; 1021 } 1022 } 1023 #endif 828 1024 } 829 1025 iPrevShiftedPos = iShiftedPos; 830 1026 } 831 1027 } 1028 #if NTT_SUBPEL 1029 if( (iPrevShiftedPos+1) != iWidth ) 1030 { 1031 for (Int iCurPos = iPrevShiftedPos+1; iCurPos < iWidth; iCurPos++) 1032 { 1033 for( UInt uiCurPlane = 0; uiCurPlane < uiNumberOfPlanes; uiCurPlane++) 1034 { 1035 apcOutputData[uiCurPlane][iCurPos] = apcOutputData[uiCurPlane][iPrevShiftedPos]; 1036 } 1037 pcFilledData[iCurPos] = REN_IS_FILLED; 1038 } 1039 } 1040 #endif 832 1041 for( UInt uiCurPlane = 0; uiCurPlane < uiNumberOfPlanes; uiCurPlane++) 833 1042 { … … 1450 1659 1451 1660 for( Int iXPos = iSourcePos + 1; iXPos < iWidth; iXPos++) 1452 1661 { 1453 1662 for( UInt uiCurPlane = 0; uiCurPlane < uiNumberOfPlanes; uiCurPlane++) 1454 1663 { 1455 1664 apcOutputData[uiCurPlane][iXPos] = apcInputData[uiCurPlane][iSourcePos]; 1456 1665 } 1457 1666 } 1458 1667 1459 1668 // Fill Left Gap … … 1469 1678 { 1470 1679 apcOutputData[uiCurPlane][iXPos] = apcInputData[uiCurPlane][iSourcePos]; 1471 1472 1680 } 1681 } 1473 1682 1474 1683 // Go to next line … … 2032 2241 m_ppiShiftLUTRightMirror[0] = new Int[257]; 2033 2242 m_ppiShiftLUTRightMirror[1] = new Int[257]; 2243 2244 #if NTT_SUBPEL 2245 m_ppiFposLUTLeft = 0; 2246 m_ppiFposLUTRight = 0; 2247 m_ppiFposLUTRightMirror = new Int*[2]; 2248 m_ppiFposLUTRightMirror[0] = new Int[257]; 2249 m_ppiFposLUTRightMirror[1] = new Int[257]; 2250 #endif 2034 2251 2035 2252 m_aiShiftLUTCur = 0; … … 2116 2333 m_iHoleFillingMode = iHoleFillingMode; 2117 2334 2335 #if NTT_SUBPEL 2336 m_bInstantHoleFilling = (m_iInterpolationMode == eRenInt8Tap || m_iInterpolationMode == eRenInt8Tap2 ) && (m_iHoleFillingMode != 0 ); 2337 #else 2118 2338 m_bInstantHoleFilling = (m_iInterpolationMode == eRenInt8Tap ) && (m_iHoleFillingMode != 0 ); 2339 #endif 2119 2340 2120 2341 // PostProcessing … … 2154 2375 { 2155 2376 m_aaiSubPelShift[uiEntry] = new Int[ iNumEntries ]; 2156 2377 } 2157 2378 2158 2379 TRenFilter::setSubPelShiftLUT(m_iRelShiftLUTPrec, m_aaiSubPelShift, -1); … … 2184 2405 }; 2185 2406 2407 #if NTT_SUBPEL 2408 if ( m_ppiFposLUTRightMirror != NULL ) 2409 { 2410 delete[] m_ppiFposLUTRightMirror[0]; 2411 delete[] m_ppiFposLUTRightMirror[1]; 2412 delete[] m_ppiFposLUTRightMirror; 2413 }; 2414 #endif 2415 2186 2416 if (m_piInvZLUTLeft != NULL ) delete[] m_piInvZLUTLeft ; 2187 2417 if (m_piInvZLUTLeft != NULL ) delete[] m_piInvZLUTRight ;
Note: See TracChangeset for help on using the changeset viewer.