Changeset 28 in 3DVCSoftware for branches/0.3-poznan-univ/source/App/TAppCommon


Ignore:
Timestamp:
24 Feb 2012, 20:22:58 (13 years ago)
Author:
poznan-univ
Message:

Poznan Tools

  • Encoding only disoccluded CUs in depended views
  • Depth based motion prediction
  • Texture QP adjustment based on depth data
  • Nonlinear depth representation
Location:
branches/0.3-poznan-univ/source/App/TAppCommon
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/0.3-poznan-univ/source/App/TAppCommon/TAppComCamPara.cpp

    r21 r28  
    7676
    7777      radLUT        [ uiSourceView ][ uiTargetView ]      = new Double*[ 2 ];
    78       radLUT        [ uiSourceView ][ uiTargetView ][ 0 ] = new Double [ 257 ];
    79       radLUT        [ uiSourceView ][ uiTargetView ][ 1 ] = new Double [ 257 ];
     78      radLUT        [ uiSourceView ][ uiTargetView ][ 0 ] = new Double [ SizeOfLUT+1 ];
     79      radLUT        [ uiSourceView ][ uiTargetView ][ 1 ] = new Double [ SizeOfLUT+1 ];
    8080
    8181      raiLUT        [ uiSourceView ][ uiTargetView ]      = new Int*   [ 2 ];
    82       raiLUT        [ uiSourceView ][ uiTargetView ][ 0 ] = new Int    [ 257 ];
    83       raiLUT        [ uiSourceView ][ uiTargetView ][ 1 ] = new Int    [ 257 ];
     82      raiLUT        [ uiSourceView ][ uiTargetView ][ 0 ] = new Int    [ SizeOfLUT+1 ];
     83      raiLUT        [ uiSourceView ][ uiTargetView ][ 1 ] = new Int    [ SizeOfLUT+1 ];
    8484    }
    8585  }
     
    877877      radShiftParams[ uiSourceView][ uiTargetView ][ 1 ] = dOffset;
    878878
    879       for( UInt uiDepthValue = 0; uiDepthValue < 256; uiDepthValue++ )
    880       {
     879#if POZNAN_NONLINEAR_DEPTH
     880      TComNonlinearDepthBackward cNonlinearDepthBwd(m_fDepthPower, (POZNAN_LUT_INCREASED_PRECISION) ? g_uiBitIncrement : 0, (POZNAN_LUT_INCREASED_PRECISION) ? g_uiBitIncrement : 0);
     881#endif
     882
     883      for( UInt uiDepthValue = 0; uiDepthValue < SizeOfLUT; uiDepthValue++ )
     884      {
     885        Double  dDepthValue = (Double)uiDepthValue;
     886        Int64   iDepthValue = (Int64)uiDepthValue;
     887#if POZNAN_NONLINEAR_DEPTH
     888        dDepthValue = cNonlinearDepthBwd(dDepthValue);
     889        iDepthValue = (Int64)(dDepthValue+0.5);
     890#endif
     891#if POZNAN_LUT_INCREASED_PRECISION
     892        dDepthValue /= (1<<g_uiBitIncrement);
     893#endif
    881894        // real-valued look-up tables
    882         Double  dShiftLuma      = ( (Double)uiDepthValue * dScale + dOffset ) * Double( 1 << m_iLog2Precision );
     895
     896        Double  dShiftLuma      = ( dDepthValue * dScale + dOffset ) * Double( 1 << m_iLog2Precision );
    883897        Double  dShiftChroma    = dShiftLuma / 2;
    884898        radLUT[ uiSourceView ][ uiTargetView ][ 0 ][ uiDepthValue ] = dShiftLuma;
     
    886900
    887901        // integer-valued look-up tables
    888         Int64   iTempScale      = (Int64)uiDepthValue * iScale;
     902        Int64   iTempScale      = iDepthValue * iScale;
     903#if POZNAN_LUT_INCREASED_PRECISION
     904        iTempScale >>= g_uiBitIncrement;
     905#endif
    889906        Int64   iTestScale      = ( iTempScale + iOffset       );   // for checking accuracy of camera parameters
    890907        Int64   iShiftLuma      = ( iTempScale + iOffsetLuma   ) >> iLog2DivLuma;
     
    899916      }
    900917
    901       radLUT[ uiSourceView ][ uiTargetView ][ 0 ][ 256 ] = radLUT[ uiSourceView ][ uiTargetView ][ 0 ][ 255 ];
    902       radLUT[ uiSourceView ][ uiTargetView ][ 1 ][ 256 ] = radLUT[ uiSourceView ][ uiTargetView ][ 1 ][ 255 ];
    903       raiLUT[ uiSourceView ][ uiTargetView ][ 0 ][ 256 ] = raiLUT[ uiSourceView ][ uiTargetView ][ 0 ][ 255 ];
    904       raiLUT[ uiSourceView ][ uiTargetView ][ 1 ][ 256 ] = raiLUT[ uiSourceView ][ uiTargetView ][ 1 ][ 255 ];
     918      radLUT[ uiSourceView ][ uiTargetView ][ 0 ][ SizeOfLUT ] = radLUT[ uiSourceView ][ uiTargetView ][ 0 ][ SizeOfLUT-1 ];
     919      radLUT[ uiSourceView ][ uiTargetView ][ 1 ][ SizeOfLUT ] = radLUT[ uiSourceView ][ uiTargetView ][ 1 ][ SizeOfLUT-1 ];
     920      raiLUT[ uiSourceView ][ uiTargetView ][ 0 ][ SizeOfLUT ] = raiLUT[ uiSourceView ][ uiTargetView ][ 0 ][ SizeOfLUT-1 ];
     921      raiLUT[ uiSourceView ][ uiTargetView ][ 1 ][ SizeOfLUT ] = raiLUT[ uiSourceView ][ uiTargetView ][ 1 ][ SizeOfLUT-1 ];
    905922    }
    906923  }
     
    12351252                      Char*  pchSynthViewNumbers,
    12361253                      std::vector<Int>* paiSynthViewNumbers,
    1237                       Int    iLog2Precision )
     1254                      Int    iLog2Precision
     1255#if POZNAN_NONLINEAR_DEPTH
     1256                      ,Float fDepthPower
     1257#endif
     1258                      )
    12381259{
    12391260  //===== set miscellaneous variables =====
     
    12431264  m_uiCamParsCodedPrecision = uiCodedCamParsPrecision;
    12441265  m_iLog2Precision          = iLog2Precision;
     1266
     1267#if POZNAN_NONLINEAR_DEPTH
     1268  m_fDepthPower             = fDepthPower;
     1269#endif
    12451270
    12461271  xReadCameraParameterFile( pchCfgFileName );
     
    14601485}
    14611486
     1487#if POZNAN_SYNTH
     1488Bool
     1489TAppComCamPara::getNearestBaseView( Int iSynthViewIdx, Int &riNearestViewIdx, Int &riRelDistToLeft, Bool& rbRenderFromLeft)
     1490{
     1491  riNearestViewIdx = 0;
     1492
     1493  Bool bDecencdingVN = ( m_aiSortedBaseViews.size() >= 2 && m_aiSortedBaseViews[ 0 ] > m_aiSortedBaseViews[ 1 ] );
     1494  Int  iFactor       = ( bDecencdingVN ? -1 : 1 );
     1495
     1496  if( ( m_aiBaseId2SortedId[iSynthViewIdx] - m_aiBaseId2SortedId[riNearestViewIdx] ) * iFactor  <= 0 )
     1497  {
     1498    rbRenderFromLeft = true;
     1499  }
     1500  else
     1501  {
     1502    rbRenderFromLeft = false;
     1503  }
     1504
     1505  riRelDistToLeft = 128; //Not used for now;
     1506
     1507  return true;
     1508}
     1509#endif
     1510
     1511
     1512
    14621513Int TAppComCamPara::getRelDistLeft( Int iSynthViewIdx, Int iLeftViewIdx, Int iRightViewIdx )
    14631514{
     
    14741525  return xGetViewId(m_aiRelSynthViewsNum, iRelNum );
    14751526}
     1527
     1528
     1529#if POZNAN_MP
     1530Bool
     1531TAppComCamPara::isLeftView( Int iSynthViewIdx, Int iNearestViewIdx)
     1532{
     1533  Bool bDecencdingVN = ( m_aiSortedBaseViews.size() >= 2 && m_aiSortedBaseViews[ 0 ] > m_aiSortedBaseViews[ 1 ] );
     1534  Int  iFactor       = ( bDecencdingVN ? -1 : 1 );
     1535
     1536  if( ( m_aiBaseId2SortedId[iSynthViewIdx] - m_aiBaseId2SortedId[iNearestViewIdx] ) * iFactor  <= 0 ) return true;
     1537  else return false;
     1538}
     1539#endif
  • branches/0.3-poznan-univ/source/App/TAppCommon/TAppComCamPara.h

    r5 r28  
    104104  Int****             m_aiSynthViewShiftLUT;                                                                    ///< Disparity LUT
    105105
     106#if POZNAN_NONLINEAR_DEPTH
     107  Float               m_fDepthPower;
     108#endif
    106109
    107110protected:
     
    161164                Char*   pchSynthViewNumbers,
    162165                std::vector<Int>* paiSynthViewNumbers,
    163                 Int     iLog2Precision );
     166                Int     iLog2Precision
     167#if POZNAN_NONLINEAR_DEPTH
     168                ,Float  fDepthPower
     169#endif
     170                );
    164171
    165172  Void init   ( UInt    uiInputBitDepth,
     
    170177                std::vector<Int>* paiSynthViewNumbers,
    171178                Int     iLog2Precision
     179#if POZNAN_NONLINEAR_DEPTH
     180                ,Float  fDepthPower
     181#endif
    172182              );
    173183
     
    182192  Int                 synthRelNum2Idx           ( Int iRelNum );
    183193  Bool getLeftRightBaseView( Int iSynthViewIdx, Int &riLeftViewIdx, Int &riRightViewIdx, Int &riRelDistToLeft, Bool& rbIsBaseView );
     194#if POZNAN_SYNTH
     195  Bool getNearestBaseView( Int iSynthViewIdx, Int &riNearestViewIdx, Int &riRelDistToLeft, Bool& rbRenderFromLeft);
     196#endif
     197
    184198  Int                 getRelDistLeft            ( Int iSynthViewIdx, Int   iLeftViewIdx, Int iRightViewIdx );
    185199  UInt                getCurFrameId             ()  { return m_iCurrentFrameId;   }
    186200  static Void         convertNumberString       ( Char* pchViewNumberString, std::vector<Int>& raiViewNumbers, Double dViewNumPrec );
     201
     202#if POZNAN_MP
     203  Bool isLeftView( Int iSynthViewIdx, Int iNearestViewIdx);
     204#endif
    187205
    188206  // function for getting parameters and parameter arrays
Note: See TracChangeset for help on using the changeset viewer.