Changeset 102 in 3DVCSoftware for trunk/source/Lib


Ignore:
Timestamp:
11 Aug 2012, 14:39:19 (13 years ago)
Author:
tech
Message:

SAIT_VSO_EST_A0033 code improvement

Location:
trunk/source/Lib
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/Lib/TAppCommon/TAppComCamPara.cpp

    r100 r102  
    14561456}
    14571457
     1458#if SAIT_VSO_EST_A0033
     1459Void
     1460TAppComCamPara::xSetDispCoeff( UInt uiFrameId, Int iViewIdx )
     1461{
     1462  UInt uiFrame = m_uiFirstFrameId + uiFrameId;
     1463  Int  iSourceViewNum = m_aiBaseViews[ iViewIdx ];
     1464  Double dBaseLine = 0.0;
     1465  Double dFL1, dCS1, dCP1, dZN1, dZF1;
     1466  Bool bInterpolated;
     1467  double dPos[3];
     1468
     1469  if( m_iNumberOfBaseViews == 3 )
     1470  {
     1471    xGetGeometryData( m_aiBaseViews[0], uiFrame, dFL1, dPos[0], dCS1, bInterpolated );
     1472    xGetGeometryData( m_aiBaseViews[1], uiFrame, dFL1, dPos[1], dCS1, bInterpolated );
     1473    xGetGeometryData( m_aiBaseViews[2], uiFrame, dFL1, dPos[2], dCS1, bInterpolated );
     1474
     1475    xGetGeometryData( iSourceViewNum, uiFrame, dFL1, dCP1, dCS1, bInterpolated );
     1476    xGetZNearZFar   ( iSourceViewNum, uiFrame, dZN1, dZF1 );
     1477
     1478    dBaseLine = ( Max( dPos[0], Max( dPos[1], dPos[2] ) ) - Min( dPos[0], Min( dPos[1], dPos[2] ) ) ) / 2.0;
     1479  }
     1480  else if( m_iNumberOfBaseViews == 2 )
     1481  {
     1482    xGetGeometryData( m_aiBaseViews[0], uiFrame, dFL1, dPos[0], dCS1, bInterpolated );
     1483    xGetGeometryData( m_aiBaseViews[1], uiFrame, dFL1, dPos[1], dCS1, bInterpolated );
     1484
     1485    xGetGeometryData( iSourceViewNum, uiFrame, dFL1, dCP1, dCS1, bInterpolated );
     1486    xGetZNearZFar   ( iSourceViewNum, uiFrame, dZN1, dZF1 );
     1487
     1488    dBaseLine = dPos[0] - dPos[1];
     1489  }
     1490
     1491
     1492  m_dDispCoeff = fabs( dFL1 * ( dBaseLine / 2.0 ) / 255.0 * ( 1.0/dZN1 - 1.0/dZF1 ) );
     1493}
     1494#endif
    14581495
    14591496Bool
  • trunk/source/Lib/TAppCommon/TAppComCamPara.h

    r100 r102  
    6767  Bool                m_bCamParsCodedPrecSet;                 ///< Coded Cam Para precision set for current frame;
    6868
     69#if SAIT_VSO_EST_A0033
     70  Double              m_dDispCoeff;
     71#endif
     72
    6973  // view lists
    7074  std::vector<Int>    m_aiViewsInCfgFile;                     ///< views for which parameters are specified in cfg file (from left to right)
     
    184188  UInt                getCurFrameId             ()  { return m_iCurrentFrameId;   }
    185189  static Void         convertNumberString       ( Char* pchViewNumberString, std::vector<Int>& raiViewNumbers, Double dViewNumPrec );
     190
     191#if SAIT_VSO_EST_A0033
     192  Void xSetDispCoeff( UInt uiStartFrameId, Int iViewIdx );
     193  Double getDispCoeff() { return m_dDispCoeff; }
     194#endif
    186195
    187196  // function for getting parameters and parameter arrays
  • trunk/source/Lib/TLibEncoder/TEncGOP.cpp

    r101 r102  
    461461
    462462#if SAIT_VSO_EST_A0033
    463     m_pcRdCost->setVideoRecPicYuv( m_pcEncTop->getEncTop()->xGetPicYuvFromViewTemp( pcSlice->getViewId(), pcSlice->getPOC(), false, true ) );
    464     m_pcRdCost->setDepthPicYuv   ( m_pcEncTop->getEncTop()->xGetPicYuvFromViewTemp( pcSlice->getViewId(), pcSlice->getPOC(), true, false ) );
     463    m_pcRdCost->setVideoRecPicYuv( m_pcEncTop->getEncTop()->getPicYuvFromView( pcSlice->getViewId(), pcSlice->getPOC(), false, true ) );
     464    m_pcRdCost->setDepthPicYuv   ( m_pcEncTop->getEncTop()->getPicYuvFromView( pcSlice->getViewId(), pcSlice->getPOC(), true, false ) );
    465465#endif
    466466
  • trunk/source/Lib/TLibEncoder/TEncSlice.cpp

    r101 r102  
    4242#endif
    4343#include <math.h>
    44 #if SAIT_VSO_EST_A0033
    45 extern Double g_dDispCoeff;
    46 #endif
    4744
    4845//! \ingroup TLibEncoder
     
    376373#endif
    377374
     375#if SAIT_VSO_EST_A0033
     376  m_pcRdCost->setDisparityCoeff( m_pcCfg->getDispCoeff() );
     377#endif
     378
    378379#if RDOQ_CHROMA_LAMBDA
    379380// for RDOQ
     
    727728 if( m_pcCfg->getUseVSO() )
    728729 {
    729    m_pcRdCost->setDisparityCoeff( g_dDispCoeff );  // Temp. code!!!
    730    //printf( "Disp Coeff : %3.4f \n", m_pcRdCost->getDisparityCoeff() );
    731730
    732731   Int frameWidth = m_pcCfg->getSourceWidth();
     
    739738   for( Int y = 0 ; y < m_pcCfg->getSourceHeight() ; y++ )
    740739   {
    741      pVideoRec[-4] = pVideoRec[-3] = pVideoRec[-2] = pVideoRec[-1] = pVideoRec[0];
    742      pVideoRec[frameWidth+3] = pVideoRec[frameWidth+2] = pVideoRec[frameWidth+1] = pVideoRec[frameWidth] = pVideoRec[frameWidth-1];
    743      pDepthOrg[-4] = pDepthOrg[-3] = pDepthOrg[-2] = pDepthOrg[-1] = pDepthOrg[0];
    744      pDepthOrg[frameWidth+3] = pDepthOrg[frameWidth+2] = pDepthOrg[frameWidth+1] = pDepthOrg[frameWidth] = pDepthOrg[frameWidth-1];
     740     pVideoRec[-1] = pVideoRec[0];
     741     pVideoRec[frameWidth] = pVideoRec[frameWidth-1];
     742     pDepthOrg[-1] = pDepthOrg[0];
     743     pDepthOrg[frameWidth] = pDepthOrg[frameWidth-1];
    745744
    746745     pVideoRec += iVideoRecStride;
     
    749748 }
    750749#endif
     750
    751751  TEncTop* pcEncTop = (TEncTop*) m_pcCfg;
    752752  TEncSbac**** ppppcRDSbacCoders    = pcEncTop->getRDSbacCoders();
Note: See TracChangeset for help on using the changeset viewer.