Changeset 1396 in 3DVCSoftware for trunk/source/Lib/TLibRenderer/TRenModel.cpp


Ignore:
Timestamp:
11 Mar 2016, 16:54:51 (8 years ago)
Author:
tech
Message:

Merged HTM-16.0-dev1@1395.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/Lib/TLibRenderer/TRenModel.cpp

    r1313 r1396  
    216216Void
    217217#if H_3D_VSO_EARLY_SKIP
    218 TRenModel::create( Int iNumOfBaseViews, Int iNumOfModels, Int iWidth, Int iHeight, Int iShiftPrec, Int iHoleMargin, Bool bEarlySkip )
     218TRenModel::create( Int iNumOfBaseViews, Int iNumOfModels, Int iWidth, Int iHeight, Int iShiftPrec, Int iHoleMargin, Bool bLimOutput, Bool bEarlySkip )
    219219#else
    220 TRenModel::create( Int iNumOfBaseViews, Int iNumOfModels, Int iWidth, Int iHeight, Int iShiftPrec, Int iHoleMargin )
    221 #endif
    222 {
     220TRenModel::create( Int iNumOfBaseViews, Int iNumOfModels, Int iWidth, Int iHeight, Int iShiftPrec, Int iHoleMargin, Bool bLimOutput )
     221#endif
     222{
     223  m_bLimOutput          = bLimOutput;
     224
    223225  m_iNumOfBaseViews     = iNumOfBaseViews;
    224226  m_iNumOfRenModels     = iNumOfModels;
     
    416418
    417419#if H_3D_VSO_EARLY_SKIP
    418   m_apcRenModels[iModelNum]->create( iMode ,m_iWidth, m_iHeight, m_iShiftPrec, m_aaaiSubPelShiftLut, m_iHoleMargin,  bUseOrgRef, iBlendMode, m_bEarlySkip );
     420#if RM_INIT_FIX
     421  m_apcRenModels[iModelNum]->create( iMode ,m_iWidth, m_iHeight, m_iShiftPrec, m_aaaiSubPelShiftLut, m_iHoleMargin,  bUseOrgRef, ( iMode != 2 )  ? BLEND_NONE : iBlendMode , m_bLimOutput, m_bEarlySkip );
    419422#else
    420   m_apcRenModels[iModelNum]->create( iMode ,m_iWidth, m_iHeight, m_iShiftPrec, m_aaaiSubPelShiftLut, m_iHoleMargin,  bUseOrgRef, iBlendMode );
     423  m_apcRenModels[iModelNum]->create( iMode ,m_iWidth, m_iHeight, m_iShiftPrec, m_aaaiSubPelShiftLut, m_iHoleMargin,  bUseOrgRef, iBlendMode, m_bLimOutput, m_bEarlySkip );
     424#endif
     425
     426#else
     427
     428#if RM_INIT_FIX
     429  m_apcRenModels[iModelNum]->create( iMode ,m_iWidth, m_iHeight, m_iShiftPrec, m_aaaiSubPelShiftLut, m_iHoleMargin,  bUseOrgRef, ( iMode != 2 )  ? BLEND_NONE : iBlendMode, m_bLimOutput );
     430#else
     431  m_apcRenModels[iModelNum]->create( iMode ,m_iWidth, m_iHeight, m_iShiftPrec, m_aaaiSubPelShiftLut, m_iHoleMargin,  bUseOrgRef, iBlendMode, m_bLimOutput );
     432#endif
    421433#endif
    422434
     
    470482
    471483Void
    472 TRenModel::setSingleModel( Int iModelNum, Int** ppiShiftLutLeft, Int** ppiBaseShiftLutLeft, Int** ppiShiftLutRight, Int** ppiBaseShiftLutRight, Int iDistToLeft, TComPicYuv* pcPicYuvRefView )
     484TRenModel::setSingleModel( Int iModelNum, Int** ppiShiftLutLeft, Int** ppiBaseShiftLutLeft, Int** ppiShiftLutRight, Int** ppiBaseShiftLutRight, Int iDistToLeft, TComPicYuv* pcPicYuvRefView, Int iEncViewSIdx)
    473485{
    474486  AOT( iModelNum < 0 || iModelNum > m_iNumOfRenModels );
     
    486498    if ( m_aaeBaseViewPosInModel[iBaseViewIdx][iModelNum] != VIEWPOS_INVALID )
    487499    {
    488       bAnyRefFromOrg = true;
    489500      m_apcRenModels[iModelNum]->setLRView( m_aaeBaseViewPosInModel[iBaseViewIdx][iModelNum],
    490501        ( bSetupFromOrgVideo ? m_aapiOrgVideoPel   : m_aapiCurVideoPel   ) [iBaseViewIdx],
     
    495506  }
    496507
    497   m_apcRenModels[iModelNum]->setup     ( pcPicYuvRefView, ppiShiftLutLeft, ppiBaseShiftLutLeft, ppiShiftLutRight, ppiBaseShiftLutRight, iDistToLeft, false );
    498 
    499   // Setup to Org
    500   if ( bAnyRefFromOrg )
    501   {
    502     // Restore old values
     508  // Render
     509#if !RM_FIX_SETUP
     510  m_apcRenModels[iModelNum]->setupLutAndRef(  pcPicYuvRefView, ppiShiftLutLeft, ppiBaseShiftLutLeft, ppiShiftLutRight, ppiBaseShiftLutRight, iDistToLeft, bAnyRefFromOrg );
     511
     512  // Setup with actual data 
    503513    for (Int iBaseViewIdx = 0; iBaseViewIdx < m_iNumOfBaseViews; iBaseViewIdx++ )
    504514    {
     
    514524      }
    515525    }
    516 
    517     // setup keeping reference rendered from original data
    518     m_apcRenModels[iModelNum]->setup     ( pcPicYuvRefView, ppiShiftLutLeft, ppiBaseShiftLutLeft, ppiShiftLutRight, ppiBaseShiftLutRight, iDistToLeft, true );
    519   }
     526  // Render initial state
     527  AOT( m_bLimOutput && m_aaeBaseViewPosInModel[ iEncViewSIdx ][iModelNum] == VIEWPOS_INVALID );
     528  m_apcRenModels[iModelNum]->setupInitialState( m_bLimOutput ? m_aaeBaseViewPosInModel[ iEncViewSIdx ][iModelNum] : VIEWPOS_INVALID ); 
     529
     530#else
     531  m_apcRenModels[iModelNum]->setupLut(  ppiShiftLutLeft, ppiBaseShiftLutLeft, ppiShiftLutRight, ppiBaseShiftLutRight, iDistToLeft );
     532 
     533  // Copy yuv to reference if given.
     534  AOT( pcPicYuvRefView != NULL && bAnyRefFromOrg );
     535 
     536  if (pcPicYuvRefView )
     537  {
     538    m_apcRenModels[iModelNum]->setupRefView( pcPicYuvRefView );
     539  }
     540
     541  m_apcRenModels[iModelNum]->renderAll( );
     542
     543  // pcPicYuvRefView != NULL &&  bAnyRefFromOrg --> invalid combination
     544  // pcPicYuvRefView != NULL && !bAnyRefFromOrg --> distortion correct; reference view correct; current view correct
     545  // pcPicYuvRefView == NULL &&  bAnyRefFromOrg --> distortion TBD    ; reference view TBD    ; current view TBD
     546  // pcPicYuvRefView == NULL && !bAnyRefFromOrg --> distortion TBD    ; reference view TBD    ; current view correct
     547
     548  if ( pcPicYuvRefView == NULL )
     549  {
     550    // Update reference view
     551    m_apcRenModels[iModelNum]->setStructSynthViewAsRefView(); 
     552
     553    // pcPicYuvRefView != NULL &&  bAnyRefFromOrg --> invalid combination
     554    // pcPicYuvRefView != NULL && !bAnyRefFromOrg --> distortion correct; reference view correct; current view correct
     555    // pcPicYuvRefView == NULL &&  bAnyRefFromOrg --> distortion TBD    ; reference view correct; current view TBD
     556    // pcPicYuvRefView == NULL && !bAnyRefFromOrg --> distortion TBD    ; reference view correct; current view correct
     557
     558    if ( bAnyRefFromOrg )
     559    {   
     560      // Update current view and distortion
     561      for (Int iBaseViewIdx = 0; iBaseViewIdx < m_iNumOfBaseViews; iBaseViewIdx++ )
     562      {
     563        if ( m_aaeBaseViewPosInModel[iBaseViewIdx][iModelNum] != VIEWPOS_INVALID )
     564        {
     565          m_apcRenModels[iModelNum]->setLRView(
     566            m_aaeBaseViewPosInModel[iBaseViewIdx][iModelNum],
     567            m_aapiCurVideoPel      [iBaseViewIdx],
     568            m_aaiCurVideoStrides   [iBaseViewIdx],
     569            m_apiCurDepthPel       [iBaseViewIdx],
     570            m_aiCurDepthStrides    [iBaseViewIdx]
     571          );
     572        }
     573      }
     574      m_apcRenModels[iModelNum]->renderAll( );
     575    }
     576    else
     577    {
     578      // Update to distortion
     579      m_apcRenModels[iModelNum]->resetStructError();
     580    }
     581  }     
     582
     583  if ( m_bLimOutput )
     584  {
     585    AOT( m_aaeBaseViewPosInModel[ iEncViewSIdx ][iModelNum] == VIEWPOS_INVALID );
     586    Int curViewPosInModel = m_aaeBaseViewPosInModel[ iEncViewSIdx ][iModelNum];   
     587    m_apcRenModels[iModelNum]->setLimOutStruct( (curViewPosInModel == VIEWPOS_RIGHT)  ? VIEWPOS_LEFT : VIEWPOS_RIGHT );
     588  } 
     589#endif
    520590}
    521591
     
    549619TRenModel::setupPart ( UInt uiHorOff, Int iUsedHeight )
    550620{
    551   AOT( iUsedHeight > m_iHeight );     
     621//  AOT( iUsedHeight > m_iHeight );     
    552622  m_uiHorOff    = uiHorOff;
    553623  m_iUsedHeight = iUsedHeight;
     
    589659    }
    590660  }
    591 
    592   return ( iDist + (m_iNumOfCurRenModels >> 1) ) / m_iNumOfCurRenModels;
     661  return m_iNumOfCurRenModels > 0 ? ( iDist + (m_iNumOfCurRenModels >> 1) ) / m_iNumOfCurRenModels : 0;
    593662}
    594663
Note: See TracChangeset for help on using the changeset viewer.