Changeset 102 in 3DVCSoftware for trunk


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

SAIT_VSO_EST_A0033 code improvement

Location:
trunk/source
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/App/TAppEncoder/TAppEncCfg.h

    r100 r102  
    295295#endif
    296296#if SAIT_VSO_EST_A0033
    297   Bool      m_bUseEstimatedVSD;                           ///< Flag for using model based VSD estimation instead of VSO for some encoder decisions (JCT3V-A0033 modification 3)
    298   Double    m_dDispCoeff;
     297  Bool      m_bUseEstimatedVSD;                           ///< Flag for using model based VSD estimation instead of VSO for some encoder decisions (JCT3V-A0033 modification 3) 
    299298#endif
    300299
  • trunk/source/App/TAppEncoder/TAppEncTop.cpp

    r101 r102  
    922922      for(Int iViewIdx=0; iViewIdx < m_iNumberOfViews; iViewIdx++ )
    923923      {
     924#if SAIT_VSO_EST_A0033
     925        if( m_bUseVSO && iNextPoc < m_iFrameToBeEncoded )
     926        {
     927          m_cCameraData.xSetDispCoeff( iNextPoc, iViewIdx );
     928          m_acTEncDepthTopList[iViewIdx]->setDispCoeff( m_cCameraData.getDispCoeff() );
     929        }
     930#endif
    924931        iNumEncoded = 0;
    925932        // call encoding function for one frame
     
    11561163};
    11571164
    1158 #if SAIT_VSO_EST_A0033
    1159 TComPicYuv* TAppEncTop::xGetPicYuvFromViewTemp( Int iViewIdx, Int iPoc, Bool bDepth, Bool bRecon )
    1160 {
    1161   TComPic*    pcPic = xGetPicFromView( iViewIdx, iPoc, bDepth);
    1162   TComPicYuv* pcPicYuv = NULL;
    1163 
    1164   if (pcPic != NULL)
    1165   {
    1166     if( bRecon )
    1167     {
    1168       if ( pcPic->getReconMark() )
    1169       {
    1170         pcPicYuv = pcPic->getPicYuvRec();
    1171       }
    1172     }
    1173     else
    1174     {
    1175       pcPicYuv = pcPic->getPicYuvOrg();
    1176     }
    1177   };
    1178 
    1179   return pcPicYuv;
    1180 };
    1181 #endif
    1182 
    11831165/**
    11841166 *
  • trunk/source/App/TAppEncoder/TAppEncTop.h

    r101 r102  
    123123  TAppEncTop();
    124124  virtual ~TAppEncTop();
    125  
    126 #if SAIT_VSO_EST_A0033
    127   TComPicYuv* xGetPicYuvFromViewTemp( Int iViewIdx, Int iPoc, Bool bDepth, Bool bRecon );
    128 #endif
     125
    129126
    130127  Void        encode      ();                               ///< main encoding function
  • 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.