Changeset 213 in 3DVCSoftware for branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibRenderer/TRenSingleModel.cpp
- Timestamp:
- 31 Dec 2012, 18:33:14 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibRenderer/TRenSingleModel.cpp
r193 r213 36 36 #include "TRenSingleModel.h" 37 37 38 #if !QC_MVHEVC_B0046 38 39 ////////////// TRENSINGLE MODEL /////////////// 39 40 template <BlenMod iBM, Bool bBitInc> … … 44 45 m_iHeight = -1; 45 46 m_iStride = -1; 46 #if FIX_VSO_SETUP47 47 m_iUsedHeight = -1; 48 48 m_iHorOffset = -1; 49 #endif50 49 m_iMode = -1; 51 50 m_iPad = PICYUV_PAD; … … 104 103 if ( m_pcInputSamples [1] ) delete[] m_pcInputSamples [1]; 105 104 106 #if FIX_MEM_LEAKS107 105 if ( m_pcOutputSamples ) delete[] m_pcOutputSamples ; 108 #else 109 if ( m_pcOutputSamples ) delete m_pcOutputSamples ; 110 #endif 111 112 #if FIX_MEM_LEAKS 106 113 107 if ( m_piInvZLUTLeft ) delete[] m_piInvZLUTLeft ; 114 108 if ( m_piInvZLUTRight ) delete[] m_piInvZLUTRight; … … 117 111 if ( m_aapiRefVideoPel[1] ) delete[] ( m_aapiRefVideoPel[1] - ( m_aiRefVideoStrides[1] * m_iPad + m_iPad ) ); 118 112 if ( m_aapiRefVideoPel[2] ) delete[] ( m_aapiRefVideoPel[2] - ( m_aiRefVideoStrides[2] * m_iPad + m_iPad ) ); 119 #endif120 113 } 121 114 … … 197 190 Int iOffsetX = ( iViewPos == VIEWPOS_RIGHT ) ? 1 : 0; 198 191 199 #if FIX_VSO_SETUP200 192 for ( Int iPosY = 0; iPosY < m_iUsedHeight; iPosY++ ) 201 #else202 for ( Int iPosY = 0; iPosY < m_iHeight; iPosY++ )203 #endif204 193 { 205 194 if ( iViewPos == VIEWPOS_RIGHT ) … … 245 234 246 235 } 247 #if FIX_VSO_SETUP248 236 template <BlenMod iBM, Bool bBitInc> Void 249 237 TRenSingleModelC<iBM,bBitInc>::setupPart ( UInt uiHorOffset, Int iUsedHeight ) … … 254 242 m_iHorOffset = (Int) uiHorOffset; 255 243 } 256 #endif257 244 258 245 template <BlenMod iBM, Bool bBitInc> Void 259 #if FIX_VSO_SETUP260 246 TRenSingleModelC<iBM,bBitInc>::setup( TComPicYuv* pcOrgVideo, Int** ppiShiftLutLeft, Int** ppiBaseShiftLutLeft, Int** ppiShiftLutRight, Int** ppiBaseShiftLutRight, Int iDistToLeft, Bool bKeepReference ) 261 #else262 TRenSingleModelC<iBM,bBitInc>::setup( TComPicYuv* pcOrgVideo, Int** ppiShiftLutLeft, Int** ppiBaseShiftLutLeft, Int** ppiShiftLutRight, Int** ppiBaseShiftLutRight, Int iDistToLeft, Bool bKeepReference, UInt uiHorOff )263 #endif264 247 { 265 248 AOT( !m_bUseOrgRef && pcOrgVideo ); … … 275 258 if ( pcOrgVideo && !bKeepReference ) 276 259 { 277 #if FIX_VSO_SETUP278 260 TRenFilter::copy( pcOrgVideo->getLumaAddr() + m_iHorOffset * pcOrgVideo->getStride() , pcOrgVideo->getStride() , m_iWidth, m_iUsedHeight, m_aapiRefVideoPel[0], m_aiRefVideoStrides[0]); 279 261 TRenFilter::sampleCUpHorUp(0, pcOrgVideo->getCbAddr() + (m_iHorOffset >> 1) * pcOrgVideo->getCStride(), pcOrgVideo->getCStride(), m_iWidth >> 1, m_iUsedHeight >> 1, m_aapiRefVideoPel[1], m_aiRefVideoStrides[1]); 280 262 TRenFilter::sampleCUpHorUp(0, pcOrgVideo->getCrAddr() + (m_iHorOffset >> 1) * pcOrgVideo->getCStride(), pcOrgVideo->getCStride(), m_iWidth >> 1, m_iUsedHeight >> 1, m_aapiRefVideoPel[2], m_aiRefVideoStrides[2]); 281 #else282 TRenFilter::copy( pcOrgVideo->getLumaAddr() + uiHorOff * pcOrgVideo->getStride() , pcOrgVideo->getStride() , m_iWidth, m_iHeight, m_aapiRefVideoPel[0], m_aiRefVideoStrides[0]);283 TRenFilter::sampleCUpHorUp(0, pcOrgVideo->getCbAddr() + (uiHorOff >> 1) * pcOrgVideo->getCStride(), pcOrgVideo->getCStride(), m_iWidth >> 1, m_iHeight >> 1, m_aapiRefVideoPel[1], m_aiRefVideoStrides[1]);284 TRenFilter::sampleCUpHorUp(0, pcOrgVideo->getCrAddr() + (uiHorOff >> 1) * pcOrgVideo->getCStride(), pcOrgVideo->getCStride(), m_iWidth >> 1, m_iHeight >> 1, m_aapiRefVideoPel[2], m_aiRefVideoStrides[2]);285 #endif286 263 xSetStructRefView(); 287 264 } … … 290 267 xResetStructError(); 291 268 xInitSampleStructs(); 292 #if FIX_VSO_SETUP293 269 switch ( m_iMode ) 294 270 { … … 320 296 AOT(true); 321 297 } 322 #else323 switch ( m_iMode )324 {325 case 0:326 #if LGE_VSO_EARLY_SKIP_A0093327 xRenderL<true>( 0, 0, m_iWidth, m_iHeight, m_aiBaseDepthStrides[0], m_apiBaseDepthPel[0],false );328 #else329 xRenderL<true>( 0, 0, m_iWidth, m_iHeight, m_aiBaseDepthStrides[0], m_apiBaseDepthPel[0] );330 #endif331 break;332 case 1:333 #ifdef LGE_VSO_EARLY_SKIP_A0093334 xRenderR<true>( 0, 0, m_iWidth, m_iHeight, m_aiBaseDepthStrides[1], m_apiBaseDepthPel[1],false);335 #else336 xRenderR<true>( 0, 0, m_iWidth, m_iHeight, m_aiBaseDepthStrides[1], m_apiBaseDepthPel[1] );337 #endif338 break;339 case 2:340 TRenFilter::setupZLUT( true, 30, iDistToLeft, ppiBaseShiftLutLeft, ppiBaseShiftLutRight, m_iBlendZThres, m_iBlendDistWeight, m_piInvZLUTLeft, m_piInvZLUTRight );341 #ifdef LGE_VSO_EARLY_SKIP_A0093342 xRenderL<true>( 0, 0, m_iWidth, m_iHeight, m_aiBaseDepthStrides[0], m_apiBaseDepthPel[0],false);343 xRenderR<true>( 0, 0, m_iWidth, m_iHeight, m_aiBaseDepthStrides[1], m_apiBaseDepthPel[1],false);344 #else345 xRenderL<true>( 0, 0, m_iWidth, m_iHeight, m_aiBaseDepthStrides[0], m_apiBaseDepthPel[0] );346 xRenderR<true>( 0, 0, m_iWidth, m_iHeight, m_aiBaseDepthStrides[1], m_apiBaseDepthPel[1] );347 #endif348 break;349 default:350 AOT(true);351 }352 #endif353 298 354 299 // Get Rendered View as Reference … … 413 358 #endif 414 359 415 #if FIX_VSO_SETUP416 360 for ( Int iPosY = 0; iPosY < m_iUsedHeight; iPosY++ ) 417 #else418 for ( Int iPosY = 0; iPosY < m_iHeight; iPosY++ )419 #endif420 361 { 421 362 for ( Int iPosX = 0; iPosX < m_iWidth; iPosX++ ) … … 470 411 #endif 471 412 472 #if FIX_VSO_SETUP473 413 for ( Int iPosY = 0; iPosY < m_iUsedHeight; iPosY++ ) 474 #else475 for ( Int iPosY = 0; iPosY < m_iHeight; iPosY++ )476 #endif477 414 { 478 415 for ( Int iPosX = 0; iPosX < m_iWidth; iPosX++ ) … … 617 554 } 618 555 619 #if FIX_VSO_SETUP620 556 template <BlenMod iBM, Bool bBitInc> Void 621 557 TRenSingleModelC<iBM,bBitInc>::getSynthVideo( Int iViewPos, TComPicYuv* pcPicYuv ) … … 648 584 #endif 649 585 } 650 #else 651 template <BlenMod iBM, Bool bBitInc> Void 652 TRenSingleModelC<iBM,bBitInc>::getSynthVideo( Int iViewPos, TComPicYuv* pcPicYuv, UInt uiHorOffset ) 653 { 654 AOT( pcPicYuv->getWidth() != m_iWidth ); 655 AOT( pcPicYuv->getHeight() > m_iHeight + uiHorOffset ); 656 657 #if HHI_VSO_COLOR_PLANES 658 Pel RenModelOutPels::* piText[3] = { NULL, NULL, NULL }; 659 xGetSampleStrTextPtrs(iViewPos, piText[0], piText[1], piText[2]); 660 661 // Temp image for chroma down sampling 662 PelImage cTempImage( m_iWidth, m_iHeight, 3, 0); 663 664 Int aiStrides[3]; 665 Pel* apiData [3]; 666 667 cTempImage.getDataAndStrides( apiData, aiStrides ); 668 669 for (UInt uiCurPlane = 0; uiCurPlane < 3; uiCurPlane++ ) 670 { 671 xCopyFromSampleStruct( m_pcOutputSamples, m_iOutputSamplesStride, piText[uiCurPlane], apiData[uiCurPlane], aiStrides[uiCurPlane] , m_iWidth, m_iHeight); 672 } 673 xCopy2PicYuv( apiData, aiStrides, pcPicYuv, uiHorOffset ); 674 #else 675 Pel RenModelOutPels::* piY; 676 xGetSampleStrTextPtrs(iViewPos, piY); 677 xCopyFromSampleStruct( m_pcOutputSamples, m_iOutputSamplesStride, piY, pcPicYuv->getLumaAddr() + uiHorOffset * pcPicYuv->getStride(), pcPicYuv->getStride(), m_iWidth, m_iHeight ); 678 pcPicYuv->setChromaTo( 128 << g_uiBitIncrement ); 679 #endif 680 } 681 #endif 682 683 #if FIX_VSO_SETUP 586 684 587 template <BlenMod iBM, Bool bBitInc> Void 685 588 TRenSingleModelC<iBM,bBitInc>::getSynthDepth( Int iViewPos, TComPicYuv* pcPicYuv ) … … 695 598 } 696 599 697 #else 698 template <BlenMod iBM, Bool bBitInc> Void 699 TRenSingleModelC<iBM,bBitInc>::getSynthDepth( Int iViewPos, TComPicYuv* pcPicYuv, UInt uiHorOff ) 700 { 701 AOT( iViewPos != 0 && iViewPos != 1); 702 AOT( pcPicYuv->getWidth() != m_iWidth ); 703 AOT( pcPicYuv->getHeight() > m_iHeight + uiHorOff ); 704 705 Pel RenModelOutPels::* piD = 0; 706 xGetSampleStrDepthPtrs(iViewPos, piD); 707 xCopyFromSampleStruct( m_pcOutputSamples, m_iOutputSamplesStride, piD, pcPicYuv->getLumaAddr() + pcPicYuv->getStride() * uiHorOff, pcPicYuv->getStride(), m_iWidth, m_iHeight ); 708 pcPicYuv->setChromaTo( 128 << g_uiBitIncrement ); 709 } 710 #endif 711 712 #if FIX_VSO_SETUP 600 713 601 template <BlenMod iBM, Bool bBitInc> Void 714 602 TRenSingleModelC<iBM,bBitInc>::getRefVideo ( Int iViewPos, TComPicYuv* pcPicYuv ) … … 742 630 #endif 743 631 } 744 #else745 template <BlenMod iBM, Bool bBitInc> Void746 TRenSingleModelC<iBM,bBitInc>::getRefVideo ( Int iViewPos, TComPicYuv* pcPicYuv, UInt uiHorOffset )747 {748 AOT( pcPicYuv->getWidth() != m_iWidth );749 AOT( pcPicYuv->getHeight() > m_iHeight + uiHorOffset);750 751 #if HHI_VSO_COLOR_PLANES752 Pel RenModelOutPels::* piText[3];753 piText[0] = &RenModelOutPels::iYRef;754 piText[1] = &RenModelOutPels::iURef;755 piText[2] = &RenModelOutPels::iVRef;756 757 // Temp image for chroma down sampling758 759 PelImage cTempImage( m_iWidth, m_iHeight, 3, 0);760 Int aiStrides[3];761 Pel* apiData [3];762 763 cTempImage.getDataAndStrides( apiData, aiStrides );764 765 for (UInt uiCurPlane = 0; uiCurPlane < 3; uiCurPlane++ )766 {767 xCopyFromSampleStruct( m_pcOutputSamples, m_iOutputSamplesStride, piText[uiCurPlane], apiData[uiCurPlane], aiStrides[uiCurPlane] , m_iWidth, m_iHeight);768 }769 770 xCopy2PicYuv( apiData, aiStrides, pcPicYuv, uiHorOffset );771 #else772 xCopyFromSampleStruct( m_pcOutputSamples, m_iOutputSamplesStride, &RenModelOutPels::iYRef, pcPicYuv->getLumaAddr() * pcPicYuv->getStride() + uiHorOffset, pcPicYuv->getStride(), m_iWidth, m_iHeight );773 pcPicYuv->setChromaTo( 128 << g_uiBitIncrement );774 #endif775 }776 #endif777 632 778 633 template <BlenMod iBM, Bool bBitInc> RMDist … … 2018 1873 } 2019 1874 2020 #if FIX_VSO_SETUP2021 1875 template <BlenMod iBM, Bool bBitInc> Void 2022 1876 TRenSingleModelC<iBM,bBitInc>::xCopy2PicYuv( Pel** ppiSrcVideoPel, Int* piStrides, TComPicYuv* rpcPicYuvTarget ) … … 2026 1880 TRenFilter::sampleDown2Tap13( ppiSrcVideoPel[2], piStrides[2], m_iWidth, m_iUsedHeight, rpcPicYuvTarget->getCrAddr () + (m_iHorOffset >> 1) * rpcPicYuvTarget->getCStride(), rpcPicYuvTarget->getCStride() ); 2027 1881 } 2028 #else2029 template <BlenMod iBM, Bool bBitInc> Void2030 TRenSingleModelC<iBM,bBitInc>::xCopy2PicYuv( Pel** ppiSrcVideoPel, Int* piStrides, TComPicYuv* rpcPicYuvTarget, UInt uiHorOffset )2031 {2032 TRenFilter::copy ( ppiSrcVideoPel[0], piStrides[0], m_iWidth, m_iHeight, rpcPicYuvTarget->getLumaAddr() + uiHorOffset * rpcPicYuvTarget->getStride() , rpcPicYuvTarget->getStride () );2033 TRenFilter::sampleDown2Tap13( ppiSrcVideoPel[1], piStrides[1], m_iWidth, m_iHeight, rpcPicYuvTarget->getCbAddr () + (uiHorOffset >> 1) * rpcPicYuvTarget->getCStride(), rpcPicYuvTarget->getCStride() );2034 TRenFilter::sampleDown2Tap13( ppiSrcVideoPel[2], piStrides[2], m_iWidth, m_iHeight, rpcPicYuvTarget->getCrAddr () + (uiHorOffset >> 1) * rpcPicYuvTarget->getCStride(), rpcPicYuvTarget->getCStride() );2035 }2036 #endif2037 1882 2038 1883 template class TRenSingleModelC<BLEND_NONE ,true>; … … 2112 1957 } 2113 1958 #endif 1959 #endif 1960
Note: See TracChangeset for help on using the changeset viewer.