Ignore:
Timestamp:
31 Dec 2012, 18:33:14 (12 years ago)
Author:
mitsubishi-htm
Message:

A final release, as planned

  • Migrate to HTM 5.1
  • For VC project files, only VC9 file is updated
  • To be used as an additional anchor for CE1.h for 3rd JCTVC meeting at Geneva
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibRenderer/TRenSingleModel.cpp

    r193 r213  
    3636#include "TRenSingleModel.h"
    3737
     38#if !QC_MVHEVC_B0046
    3839////////////// TRENSINGLE MODEL ///////////////
    3940template <BlenMod iBM, Bool bBitInc>
     
    4445  m_iHeight = -1;
    4546  m_iStride = -1;
    46 #if FIX_VSO_SETUP
    4747  m_iUsedHeight = -1;
    4848  m_iHorOffset  = -1;
    49 #endif
    5049  m_iMode   = -1;
    5150  m_iPad    = PICYUV_PAD;
     
    104103  if ( m_pcInputSamples [1] ) delete[] m_pcInputSamples [1];
    105104
    106 #if FIX_MEM_LEAKS
    107105  if ( m_pcOutputSamples    ) delete[] m_pcOutputSamples   ;
    108 #else
    109   if ( m_pcOutputSamples    ) delete   m_pcOutputSamples   ;
    110 #endif
    111 
    112 #if FIX_MEM_LEAKS
     106
    113107  if ( m_piInvZLUTLeft  ) delete[] m_piInvZLUTLeft ;
    114108  if ( m_piInvZLUTRight ) delete[] m_piInvZLUTRight;
     
    117111  if ( m_aapiRefVideoPel[1] ) delete[] ( m_aapiRefVideoPel[1] - ( m_aiRefVideoStrides[1] * m_iPad + m_iPad ) );
    118112  if ( m_aapiRefVideoPel[2] ) delete[] ( m_aapiRefVideoPel[2] - ( m_aiRefVideoStrides[2] * m_iPad + m_iPad ) );
    119 #endif
    120113}
    121114
     
    197190  Int iOffsetX = ( iViewPos == VIEWPOS_RIGHT ) ? 1 : 0;
    198191
    199 #if FIX_VSO_SETUP
    200192  for ( Int iPosY = 0; iPosY < m_iUsedHeight; iPosY++ )
    201 #else
    202   for ( Int iPosY = 0; iPosY < m_iHeight; iPosY++ )
    203 #endif
    204193  {
    205194    if ( iViewPos == VIEWPOS_RIGHT )
     
    245234
    246235}
    247 #if FIX_VSO_SETUP
    248236template <BlenMod iBM, Bool bBitInc> Void
    249237TRenSingleModelC<iBM,bBitInc>::setupPart ( UInt uiHorOffset,       Int iUsedHeight )
     
    254242  m_iHorOffset  = (Int) uiHorOffset;
    255243}
    256 #endif
    257244
    258245template <BlenMod iBM, Bool bBitInc> Void
    259 #if FIX_VSO_SETUP
    260246TRenSingleModelC<iBM,bBitInc>::setup( TComPicYuv* pcOrgVideo, Int** ppiShiftLutLeft, Int** ppiBaseShiftLutLeft, Int** ppiShiftLutRight,  Int** ppiBaseShiftLutRight,  Int iDistToLeft, Bool bKeepReference )
    261 #else
    262 TRenSingleModelC<iBM,bBitInc>::setup( TComPicYuv* pcOrgVideo, Int** ppiShiftLutLeft, Int** ppiBaseShiftLutLeft, Int** ppiShiftLutRight,  Int** ppiBaseShiftLutRight,  Int iDistToLeft, Bool bKeepReference, UInt uiHorOff )
    263 #endif
    264247{
    265248  AOT( !m_bUseOrgRef && pcOrgVideo );
     
    275258  if ( pcOrgVideo && !bKeepReference )
    276259  {
    277 #if FIX_VSO_SETUP
    278260    TRenFilter::copy(             pcOrgVideo->getLumaAddr() +  m_iHorOffset       * pcOrgVideo->getStride() , pcOrgVideo->getStride() , m_iWidth,      m_iUsedHeight,      m_aapiRefVideoPel[0], m_aiRefVideoStrides[0]);
    279261    TRenFilter::sampleCUpHorUp(0, pcOrgVideo->getCbAddr()   + (m_iHorOffset >> 1) * pcOrgVideo->getCStride(), pcOrgVideo->getCStride(), m_iWidth >> 1, m_iUsedHeight >> 1, m_aapiRefVideoPel[1], m_aiRefVideoStrides[1]);
    280262    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 #else
    282     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 #endif
    286263    xSetStructRefView();
    287264  }
     
    290267  xResetStructError();
    291268  xInitSampleStructs();
    292 #if FIX_VSO_SETUP
    293269  switch ( m_iMode )
    294270  { 
     
    320296    AOT(true);
    321297  }
    322 #else
    323   switch ( m_iMode )
    324   { 
    325   case 0:   
    326 #if LGE_VSO_EARLY_SKIP_A0093
    327     xRenderL<true>( 0, 0, m_iWidth, m_iHeight, m_aiBaseDepthStrides[0], m_apiBaseDepthPel[0],false );
    328 #else
    329     xRenderL<true>( 0, 0, m_iWidth, m_iHeight, m_aiBaseDepthStrides[0], m_apiBaseDepthPel[0] );
    330 #endif   
    331     break;
    332   case 1:   
    333 #ifdef LGE_VSO_EARLY_SKIP_A0093
    334     xRenderR<true>( 0, 0, m_iWidth, m_iHeight, m_aiBaseDepthStrides[1], m_apiBaseDepthPel[1],false);
    335 #else
    336     xRenderR<true>( 0, 0, m_iWidth, m_iHeight, m_aiBaseDepthStrides[1], m_apiBaseDepthPel[1] );
    337 #endif
    338     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_A0093
    342     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 #else     
    345     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 #endif
    348     break;
    349   default:
    350     AOT(true);
    351   }
    352 #endif
    353298
    354299  // Get Rendered View as Reference
     
    413358#endif 
    414359
    415 #if FIX_VSO_SETUP
    416360  for ( Int iPosY = 0; iPosY < m_iUsedHeight; iPosY++ )
    417 #else
    418   for ( Int iPosY = 0; iPosY < m_iHeight; iPosY++ )
    419 #endif
    420361  {
    421362    for ( Int iPosX = 0; iPosX < m_iWidth; iPosX++ )
     
    470411#endif
    471412
    472 #if FIX_VSO_SETUP
    473413  for ( Int iPosY = 0; iPosY < m_iUsedHeight; iPosY++ )
    474 #else
    475   for ( Int iPosY = 0; iPosY < m_iHeight; iPosY++ )
    476 #endif
    477414  {
    478415    for ( Int iPosX = 0; iPosX < m_iWidth; iPosX++ )
     
    617554}
    618555
    619 #if FIX_VSO_SETUP
    620556template <BlenMod iBM, Bool bBitInc> Void
    621557TRenSingleModelC<iBM,bBitInc>::getSynthVideo( Int iViewPos, TComPicYuv* pcPicYuv )
     
    648584#endif 
    649585}
    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
    684587template <BlenMod iBM, Bool bBitInc> Void
    685588TRenSingleModelC<iBM,bBitInc>::getSynthDepth( Int iViewPos, TComPicYuv* pcPicYuv )
     
    695598}
    696599
    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
    713601template <BlenMod iBM, Bool bBitInc> Void
    714602TRenSingleModelC<iBM,bBitInc>::getRefVideo ( Int iViewPos, TComPicYuv* pcPicYuv )
     
    742630#endif 
    743631}
    744 #else
    745 template <BlenMod iBM, Bool bBitInc> Void
    746 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_PLANES
    752   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 sampling
    758 
    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 #else
    772   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 #endif 
    775 }
    776 #endif
    777632
    778633template <BlenMod iBM, Bool bBitInc> RMDist
     
    20181873}
    20191874
    2020 #if FIX_VSO_SETUP
    20211875template <BlenMod iBM, Bool bBitInc> Void
    20221876TRenSingleModelC<iBM,bBitInc>::xCopy2PicYuv( Pel** ppiSrcVideoPel, Int* piStrides, TComPicYuv* rpcPicYuvTarget )
     
    20261880  TRenFilter::sampleDown2Tap13( ppiSrcVideoPel[2], piStrides[2], m_iWidth, m_iUsedHeight, rpcPicYuvTarget->getCrAddr  () + (m_iHorOffset >> 1) * rpcPicYuvTarget->getCStride(), rpcPicYuvTarget->getCStride() );
    20271881}
    2028 #else
    2029 template <BlenMod iBM, Bool bBitInc> Void
    2030 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 #endif
    20371882
    20381883template class TRenSingleModelC<BLEND_NONE ,true>;
     
    21121957}
    21131958#endif
     1959#endif
     1960
Note: See TracChangeset for help on using the changeset viewer.