Ignore:
Timestamp:
1 Nov 2012, 19:22:41 (12 years ago)
Author:
mitsubishi-htm
Message:

Initial integration of VSP into HTM 4.0.1. The version used for JCT3V-B0102 at Shanghai meeting.

  • VC9 project/solution files updated. Other Visual C++ project/solution files are not updated.
  • Linux make file updated.

TODO

  • A second release is expected to include some bug fix and improvements on the interface, e.g. to move switches from macro definition to the configuration file.
  • A third release is expected after being integrated within HTM 5.x, which is to be used for CE1.h anchor.
Location:
branches/HTM-4.0.1-VSP-dev0/source/Lib/TAppCommon
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TAppCommon/TAppComCamPara.cpp

    r165 r166  
    8989}
    9090
     91#if NTT_SUBPEL
     92Void
     93TAppComCamPara::xCreateLUTs_Subpel( UInt uiNumberSourceViews, UInt uiNumberTargetViews, Int****& raiLUT0, Int****& raiLUT1 )
     94{
     95  AOF( m_uiBitDepthForLUT == 8 );
     96  AOF( raiLUT0 == NULL && raiLUT1 == NULL );
     97
     98  uiNumberSourceViews = Max( 1, uiNumberSourceViews );
     99  uiNumberTargetViews = Max( 1, uiNumberTargetViews );
     100
     101  raiLUT0         = new Int   ***[ uiNumberSourceViews ];
     102  raiLUT1         = new Int   ***[ uiNumberSourceViews ];
     103
     104  for( UInt uiSourceView = 0; uiSourceView < uiNumberSourceViews; uiSourceView++ )
     105  {
     106    raiLUT0        [ uiSourceView ] = new Int   **[ uiNumberTargetViews ];
     107    raiLUT1        [ uiSourceView ] = new Int   **[ uiNumberTargetViews ];
     108
     109    for( UInt uiTargetView = 0; uiTargetView < uiNumberTargetViews; uiTargetView++ )
     110    {
     111      raiLUT0        [ uiSourceView ][ uiTargetView ]      = new Int*   [ 2 ];
     112      raiLUT0        [ uiSourceView ][ uiTargetView ][ 0 ] = new Int    [ 257 ];
     113      raiLUT0        [ uiSourceView ][ uiTargetView ][ 1 ] = new Int    [ 257 ];
     114      raiLUT1        [ uiSourceView ][ uiTargetView ]      = new Int*   [ 2 ];
     115      raiLUT1        [ uiSourceView ][ uiTargetView ][ 0 ] = new Int    [ 257 ];
     116      raiLUT1        [ uiSourceView ][ uiTargetView ][ 1 ] = new Int    [ 257 ];
     117    }
     118  }
     119}
     120#endif
    91121
    92122Void
     
    928958}
    929959
     960#if NTT_SUBPEL
     961Void
     962TAppComCamPara::xSetShiftParametersAndLUT( UInt uiNumberSourceViews, UInt uiNumberTargetViews, UInt uiFrame, Int****& raiLUT_Disp, Int****& raiLUT_Fracpos )
     963{
     964  if( uiNumberSourceViews <= 1 || uiNumberTargetViews == 0 )
     965  {
     966    return;
     967  }
     968  AOF( raiLUT_Disp != NULL && raiLUT_Fracpos != NULL );
     969  AOF( m_uiBitDepthForLUT == 8 );
     970
     971  Int     iLog2Div = m_uiBitDepthForLUT + m_uiCamParsCodedPrecision + 1 - m_iLog2Precision;   AOF( iLog2Div > 0 );
     972  for( UInt uiSourceView = 0; uiSourceView < uiNumberSourceViews; uiSourceView++ )
     973  {
     974    for( UInt uiTargetView = 0; uiTargetView < uiNumberTargetViews; uiTargetView++ )
     975    {
     976      // integer-valued scale and offset
     977      Int64 iScale, iOffset;
     978      xGetShiftParameterInt ( uiSourceView, uiTargetView, uiFrame, false, true, iScale, iOffset );
     979
     980      // offsets including rounding offsets
     981      iOffset += ( 1 << iLog2Div ) >> 1;
     982
     983      for( UInt uiDepthValue = 0; uiDepthValue < 256; uiDepthValue++ )
     984      {
     985        Int64   iTempScale      = (Int64)uiDepthValue * iScale;
     986        Int     iShiftSubpel    = (Int) (( iTempScale + iOffset ) >> iLog2Div);
     987        Int     iShiftPelLuma   = iShiftSubpel >> m_iLog2Precision; // better to have rounding ?
     988        Int     iShiftPelChroma = iShiftPelLuma >> 1;
     989
     990        raiLUT_Disp   [ uiSourceView ][ uiTargetView ][ 0 ][ uiDepthValue ] = iShiftPelLuma;
     991        raiLUT_Disp   [ uiSourceView ][ uiTargetView ][ 1 ][ uiDepthValue ] = iShiftPelChroma;
     992        raiLUT_Fracpos[ uiSourceView ][ uiTargetView ][ 0 ][ uiDepthValue ] = iShiftSubpel - ( iShiftPelLuma << m_iLog2Precision );
     993        raiLUT_Fracpos[ uiSourceView ][ uiTargetView ][ 1 ][ uiDepthValue ] = iShiftSubpel - ( iShiftPelChroma << (m_iLog2Precision+1) );
     994
     995#if 0 // NTT bugfix
     996        if ( raiLUT_Fracpos[ uiSourceView ][ uiTargetView ][ 0 ][ uiDepthValue ] < 0 )
     997          raiLUT_Fracpos[ uiSourceView ][ uiTargetView ][ 0 ][ uiDepthValue ] = -4 - raiLUT_Fracpos[ uiSourceView ][ uiTargetView ][ 0 ][ uiDepthValue ];
     998        if ( raiLUT_Fracpos[ uiSourceView ][ uiTargetView ][ 1 ][ uiDepthValue ] < 0 )
     999          raiLUT_Fracpos[ uiSourceView ][ uiTargetView ][ 1 ][ uiDepthValue ] = -4 - raiLUT_Fracpos[ uiSourceView ][ uiTargetView ][ 1 ][ uiDepthValue ];
     1000#endif
     1001
     1002#if _DEBUG
     1003        AOF( (raiLUT_Fracpos[ uiSourceView ][ uiTargetView ][ 0 ][ uiDepthValue ]>> m_iLog2Precision   ) == 0 );
     1004        AOF( (raiLUT_Fracpos[ uiSourceView ][ uiTargetView ][ 1 ][ uiDepthValue ]>>(m_iLog2Precision+1)) == 0 );
     1005#endif
     1006      }
     1007
     1008      raiLUT_Disp   [ uiSourceView ][ uiTargetView ][ 0 ][ 256 ] = raiLUT_Disp   [ uiSourceView ][ uiTargetView ][ 0 ][ 255 ];
     1009      raiLUT_Disp   [ uiSourceView ][ uiTargetView ][ 1 ][ 256 ] = raiLUT_Disp   [ uiSourceView ][ uiTargetView ][ 1 ][ 255 ];
     1010      raiLUT_Fracpos[ uiSourceView ][ uiTargetView ][ 0 ][ 256 ] = raiLUT_Fracpos[ uiSourceView ][ uiTargetView ][ 0 ][ 255 ];
     1011      raiLUT_Fracpos[ uiSourceView ][ uiTargetView ][ 1 ][ 256 ] = raiLUT_Fracpos[ uiSourceView ][ uiTargetView ][ 1 ][ 255 ];
     1012    }
     1013  }
     1014}
     1015#endif
    9301016
    9311017Void
     
    9361022  xSetShiftParametersAndLUT( (UInt)m_iNumberOfBaseViews, (UInt)m_iNumberOfBaseViews,  uiFrame, false, m_adBaseViewShiftLUT,  m_aiBaseViewShiftLUT,  m_adBaseViewShiftParameter,  m_aiBaseViewShiftParameter  );
    9371023  xSetShiftParametersAndLUT( (UInt)m_iNumberOfBaseViews, (UInt)m_iNumberOfSynthViews, uiFrame, true,  m_adSynthViewShiftLUT, m_aiSynthViewShiftLUT, m_adSynthViewShiftParameter, m_aiSynthViewShiftParameter );
     1024#if NTT_SUBPEL
     1025  xSetShiftParametersAndLUT( (UInt)m_iNumberOfBaseViews, (UInt)m_iNumberOfBaseViews,  uiFrame, m_aiBaseViewShiftLUT_ipel, m_aiBaseViewShiftLUT_fpos );
     1026#endif
    9381027};
    9391028
     
    10661155  m_aiSynthViewShiftLUT       = 0;
    10671156
     1157#if NTT_SUBPEL
     1158  m_aiBaseViewShiftLUT_ipel   = 0;
     1159  m_aiBaseViewShiftLUT_fpos   = 0;
     1160#endif
     1161
    10681162  m_bSetupFromCoded           = false;
    10691163  m_bCamParsCodedPrecSet      = false;
     
    10911185  xDeleteArray( m_aaiPdmScaleNomDelta,       m_iNumberOfBaseViews );
    10921186  xDeleteArray( m_aaiPdmOffset,              m_iNumberOfBaseViews );
     1187
     1188#if NTT_SUBPEL
     1189  xDeleteArray( m_aiBaseViewShiftLUT_ipel,   m_iNumberOfBaseViews, m_iNumberOfBaseViews,  2 );
     1190  xDeleteArray( m_aiBaseViewShiftLUT_fpos,   m_iNumberOfBaseViews, m_iNumberOfBaseViews,  2 );
     1191#endif
    10931192}
    10941193
     
    13371436  xCreate2dArray( (UInt)m_iNumberOfBaseViews, (UInt)m_iNumberOfBaseViews,  m_aaiPdmOffset            );
    13381437
     1438#if NTT_SUBPEL
     1439  xCreateLUTs_Subpel( (UInt)m_iNumberOfBaseViews, (UInt)m_iNumberOfBaseViews,  m_aiBaseViewShiftLUT_ipel,  m_aiBaseViewShiftLUT_fpos);
     1440#endif
     1441
    13391442  //===== init disparity to virtual depth conversion parameters =====
    13401443  xSetPdmConversionParams();
  • branches/HTM-4.0.1-VSP-dev0/source/Lib/TAppCommon/TAppComCamPara.h

    r165 r166  
    107107  Int****             m_aiSynthViewShiftLUT;                   ///< Disparity LUT
    108108
     109#if NTT_SUBPEL
     110  Int****             m_aiBaseViewShiftLUT_ipel;              ///< Disparity LUT
     111  Int****             m_aiBaseViewShiftLUT_fpos;              ///< Disparity LUT
     112#endif
    109113
    110114protected:
     
    117121  template<class T> Void  xDeleteArray  ( T*& rpt, UInt uiSize );
    118122
     123#if NTT_SUBPEL
     124  Void                    xCreateLUTs_Subpel  ( UInt uiNumberSourceViews, UInt uiNumberTargetViews, Int****& raiLUT0, Int****& raiLUT1 );
     125#endif
     126
    119127  // functions for reading, initialization, sorting, getting data, etc.
    120128  Void  xReadCameraParameterFile  ( Char* pchCfgFileName );
     
    143151  Void  xSetShiftParametersAndLUT ( UInt uiNumViewDim1, UInt uiNumViewDim2, UInt uiFrame, Bool bExternalReference, Double****& radLUT, Int****& raiLUT, Double***& radShiftParams, Int64***& raiShiftParams );
    144152  Void  xSetShiftParametersAndLUT ( UInt uiFrame );
    145 
     153#if NTT_SUBPEL
     154  Void  xSetShiftParametersAndLUT ( UInt uiNumViewDim1, UInt uiNumViewDim2, UInt uiFrame, Int****& raiLUT_Disp, Int****& raiLUT_Fracpos );
     155#endif
    146156
    147157  // getting conversion parameters for disparity to virtual depth conversion
     
    211221  Int****             getSynthViewShiftLUTI     ()  { return m_aiSynthViewShiftLUT;  }
    212222  Int****             getBaseViewShiftLUTI      ()  { return m_aiBaseViewShiftLUT;   }
     223
     224#if NTT_SUBPEL
     225  Int****             getBaseViewIPelLUT        ()  { return m_aiBaseViewShiftLUT_ipel;   }
     226  Int****             getBaseViewFPosLUT        ()  { return m_aiBaseViewShiftLUT_fpos;   }
     227#endif
    213228
    214229  Bool                getVaryingCameraParameters()  { return m_bCamParsVaryOverTime;    }
Note: See TracChangeset for help on using the changeset viewer.