Ignore:
Timestamp:
9 Aug 2012, 12:53:16 (14 years ago)
Author:
tech
Message:

Adopted modifications:

  • disparity vector generation (A0097)
  • inter-view motion prediction modification (A0049)
  • simplification of disparity vector derivation (A0126)
  • region boundary chain coding (A0070)
  • residual skip intra (A0087)
  • VSO modification (A0033/A0093)

+ Clean ups + Bug fixes

Update of cfg files (A0033 modification 2)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/Lib/TLibRenderer/TRenSingleModel.h

    r56 r100  
    5555
    5656
     57#if HHI_VSO_RM_ASSERTIONS
     58#define RM_AOT( exp ) AOT ( exp )
     59#define RM_AOF( exp ) AOF ( exp )
     60#else
     61#define RM_AOT( exp ) ((void)0)
     62#define RM_AOF( exp ) ((void)0)
     63#endif
     64
     65#define RenModRemoveBitInc( exp ) bBitInc ? ( RemoveBitIncrement( exp ) ) : ( exp )
     66
    5767class TRenSingleModel
    5868{
     69public:
     70#if LGE_VSO_EARLY_SKIP_A0093
     71  virtual Void   create    ( Int iMode, Int iWidth, Int iHeight, Int iShiftPrec, Int*** aaaiSubPelShiftTable, Int iHoleMargin, Bool bUseOrgRef, Int iBlendMode, Bool bEarlySkip ) = 0;
     72#else
     73  virtual Void   create    ( Int iMode, Int iWidth, Int iHeight, Int iShiftPrec, Int*** aaaiSubPelShiftTable, Int iHoleMargin, Bool bUseOrgRef, Int iBlendMode ) = 0;
     74#endif
     75
     76  // Set Frame dependent data
     77  virtual Void   setLRView ( Int iViewPos, Pel** apiCurVideoPel, Int* aiCurVideoStride, Pel* piCurDepthPel, Int iCurDepthStride ) = 0;
     78  virtual Void   setup     ( TComPicYuv* pcOrgVideo, Int** ppiShiftLutLeft, Int** ppiBaseShiftLutLeft, Int** ppiShiftLutRight,  Int** ppiBaseShiftLutRight,  Int iDistToLeft, Bool bKeepReference, UInt uiHorOffset ) = 0;
     79
     80  // Set Data
     81#ifdef LGE_VSO_EARLY_SKIP_A0093
     82  virtual Void   setDepth  ( Int iViewPos,                 Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData, Pel* piOrgData, Int iOrgStride )  = 0;
     83#else
     84  virtual Void   setDepth  ( Int iViewPos,                 Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData )  = 0;
     85#endif
     86  virtual Void   setVideo  ( Int iViewPos,     Int iPlane, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData ) = 0;
     87
     88  // Get Distortion
     89#ifdef LGE_VSO_EARLY_SKIP_A0093
     90  virtual RMDist getDistDepth  ( Int iViewPos,             Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData, Pel * piOrgData , Int iOrgStride)=0;
     91#else
     92  virtual RMDist getDistDepth  ( Int iViewPos,             Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData ) = 0;
     93#endif
     94  virtual RMDist getDistVideo  ( Int iViewPos, Int iPlane, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData ) = 0;
     95
     96  virtual Void   getSynthVideo  ( Int iViewPos, TComPicYuv* pcPicYuv, UInt uiHorOffset  ) = 0; 
     97  virtual Void   getSynthDepth  ( Int iViewPos, TComPicYuv* pcPicYuv, UInt uiHorOffset  ) = 0;
     98  virtual Void   getRefVideo    ( Int iViewPos, TComPicYuv* pcPicYuv, UInt uiHorOffset  ) = 0;
     99};
     100
     101template < BlenMod iBM, Bool bBitInc >
     102class TRenSingleModelC : public TRenSingleModel
     103{
     104  struct RenModelInPels
     105  {
     106    // video
     107    Pel aiY[5]    ; // y-value
     108#if HHI_VSO_COLOR_PLANES
     109    Pel aiU[5]    ; // u-value
     110    Pel aiV[5]    ; // v-value
     111#endif
     112    // depth
     113    Pel iD        ; // depth
     114
     115    // state
     116    Bool bOccluded; // Occluded
     117  };
     118
     119  struct RenModelOutPels
     120  {
     121    // video
     122    Pel iYLeft    ;
     123    Pel iYRight   ;
     124    Pel iYBlended ;
     125#if HHI_VSO_COLOR_PLANES
     126    Pel iULeft    ;
     127    Pel iURight   ;
     128    Pel iUBlended ;
     129    Pel iVLeft    ;
     130    Pel iVRight   ;
     131    Pel iVBlended ;
     132#endif
     133    // depth
     134    Pel iDLeft    ;
     135    Pel iDRight   ;
     136    Pel iDBlended ;
     137
     138    // state
     139    Int iFilledLeft ;
     140    Int iFilledRight;
     141
     142    // error
     143    Int  iError   ;
     144
     145    // reference
     146    Pel iYRef    ;
     147#if HHI_VSO_COLOR_PLANES
     148    Pel iURef    ;
     149    Pel iVRef    ;
     150#endif       
     151  };
     152
     153
    59154
    60155public:
    61   TRenSingleModel();
    62   ~TRenSingleModel();
     156  TRenSingleModelC();
     157  ~TRenSingleModelC();
    63158
    64159  // Create Model
     160#if LGE_VSO_EARLY_SKIP_A0093
     161  Void   create    ( Int iMode, Int iWidth, Int iHeight, Int iShiftPrec, Int*** aaaiSubPelShiftTable, Int iHoleMargin, Bool bUseOrgRef, Int iBlendMode, Bool bEarlySkip  );
     162#else
    65163  Void   create    ( Int iMode, Int iWidth, Int iHeight, Int iShiftPrec, Int*** aaaiSubPelShiftTable, Int iHoleMargin, Bool bUseOrgRef, Int iBlendMode );
     164#endif
    66165
    67166  // Set Frame dependent data
    68167  Void   setLRView ( Int iViewPos, Pel** apiCurVideoPel, Int* aiCurVideoStride, Pel* piCurDepthPel, Int iCurDepthStride );
    69   Void   setup     ( TComPicYuv* pcOrgVideo, Int** ppiShiftLutLeft, Int** ppiBaseShiftLutLeft, Int** ppiShiftLutRight,  Int** ppiBaseShiftLutRight,  Int iDistToLeft, Bool bKeepReference );
    70 
    71   // Set Data
     168  Void   setup     ( TComPicYuv* pcOrgVideo, Int** ppiShiftLutLeft, Int** ppiBaseShiftLutLeft, Int** ppiShiftLutRight,  Int** ppiBaseShiftLutRight,  Int iDistToLeft, Bool bKeepReference, UInt uiHorOffset );
     169
     170#if LGE_VSO_EARLY_SKIP_A0093
     171  Void   setDepth  ( Int iViewPos,                 Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData, Pel* piOrgData, Int iOrgStride );
     172#else
    72173  Void   setDepth  ( Int iViewPos,                 Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData );
     174#endif
    73175  Void   setVideo  ( Int iViewPos,     Int iPlane, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData );
    74176
    75177  // Get Distortion
     178#ifdef LGE_VSO_EARLY_SKIP_A0093
     179  RMDist getDistDepth  ( Int iViewPos,             Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData, Pel * piOrgData , Int iOrgStride);
     180#else
    76181  RMDist getDistDepth  ( Int iViewPos,             Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData );
     182#endif
    77183  RMDist getDistVideo  ( Int iViewPos, Int iPlane, Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData );
    78184
    79   // Get Rendered Data
    80   Void   getSynthView( Int iViewPos, Pel**& rppiRenVideoPel, Pel*& rpiRenDepthPel, Int& riStride );
    81 
    82   // Get Reference Data
    83   Void   getRefView  ( TComPicYuv*& rpcPicYuvRefView, Pel**& rppiRefVideoPel, Int*& raiStrides );
     185  Void   getSynthVideo  ( Int iViewPos, TComPicYuv* pcPicYuv, UInt uiHorOffset ); 
     186  Void   getSynthDepth  ( Int iViewPos, TComPicYuv* pcPicYuv, UInt uiHorOffset  );
     187  Void   getRefVideo    ( Int iViewPos, TComPicYuv* pcPicYuv, UInt uiHorOffset  );
    84188
    85189private:
     
    90194  /////  Rendering /////
    91195  // Left to Right
    92   __inline RMDist xRenderL            ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData, Bool bSet);
    93   __inline Void   xInitRenderPartL    ( Int iEndChangePos, Int iLastSPos  );
    94   __inline Void   xRenderRangeL       ( Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError );
    95   __inline Void   xRenderShiftedRangeL( Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError );
    96   __inline Void   xFillHoleL          ( Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError );
    97   __inline Void   xExtrapolateMarginL ( Int iCurSPos,                Int iCurPos, RMDist& riError );
    98   __inline Int    xRangeLeftL         ( Int iPos );
    99   __inline Int    xRangeRightL        ( Int iPos );
    100   __inline Int    xRoundL             ( Int iPos );
     196#ifdef LGE_VSO_EARLY_SKIP_A0093
     197                      __inline Bool   xDetectEarlySkipL   ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData,Pel* piOrgData, Int iOrgStride );
     198                      __inline Bool   xDetectEarlySkipR   ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData,Pel* piOrgData, Int iOrgStride );
     199  template<Bool bSet> __inline RMDist xRenderL            ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData, Bool bFast );
     200  template<Bool bSet> __inline RMDist xRenderR            ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData, Bool bFast );
     201#else
     202  template<Bool bSet> __inline RMDist xRenderR            ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData );
     203  template<Bool bSet> __inline RMDist xRenderL            ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData );
     204#endif
     205                      __inline Void   xInitRenderPartL    ( Int iEndChangePos, Int iLastSPos  );
     206  template<Bool bSet> __inline Void   xRenderRangeL       ( Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError );
     207  template<Bool bSet> __inline Void   xRenderShiftedRangeL( Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError );
     208  template<Bool bSet> __inline Void   xFillHoleL          ( Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError );
     209  template<Bool bSet> __inline Void   xExtrapolateMarginL ( Int iCurSPos,                Int iCurPos, RMDist& riError );
     210                      __inline Int    xRangeLeftL         ( Int iPos );
     211                      __inline Int    xRangeRightL        ( Int iPos );
     212                      __inline Int    xRoundL             ( Int iPos );
    101213
    102214  // Right to Left
    103   __inline RMDist xRenderR            ( Int iStartPosX, Int iStartPosY, Int iWidth, Int iHeight, Int iStride, Pel* piNewData, Bool bSet );
    104   __inline Void   xInitRenderPartR    ( Int iStartChangePos, Int iLastSPos );
    105   __inline Void   xRenderShiftedRangeR( Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError );
    106   __inline Void   xRenderRangeR       ( Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError );
    107   __inline Void   xFillHoleR          ( Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError );
    108   __inline Void   xExtrapolateMarginR ( Int iCurSPos,                Int iCurPos, RMDist& riError );
    109   __inline Int    xRangeLeftR         ( Int iPos );
    110   __inline Int    xRangeRightR        ( Int iPos );
    111   __inline Int    xRoundR             ( Int iPos );
     215                      __inline Void   xInitRenderPartR    ( Int iStartChangePos, Int iLastSPos );
     216  template<Bool bSet> __inline Void   xRenderShiftedRangeR( Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError );
     217  template<Bool bSet> __inline Void   xRenderRangeR       ( Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError );
     218  template<Bool bSet> __inline Void   xFillHoleR          ( Int iCurSPos, Int iLastSPos, Int iCurPos, RMDist& riError );
     219  template<Bool bSet> __inline Void   xExtrapolateMarginR ( Int iCurSPos,                Int iCurPos, RMDist& riError );
     220                      __inline Int    xRangeLeftR         ( Int iPos );
     221                      __inline Int    xRangeRightR        ( Int iPos );
     222                      __inline Int    xRoundR             ( Int iPos );
    112223
    113224  // Blending
    114   __inline Void   xSetShiftedPelBlend ( Int iSourcePos, Int iTargetSPos, Pel iFilled, RMDist& riError );
     225  template<Bool bSet> __inline Void   xSetShiftedPelBlend ( Int iSourcePos, Int iTargetSPos, Pel iFilled, RMDist& riError );
    115226
    116227#if HHI_VSO_COLOR_PLANES
     
    125236  __inline Pel    xBlend              ( Pel pVal1, Pel pVal2, Int iWeightVal2 );
    126237
    127 // General
    128   __inline Void   xSetShiftedPel     ( Int iSourcePos, Int iTargetSPos, Pel iFilled, RMDist& riError );
     238  // General
     239  template<Bool bSet> __inline Void xSetShiftedPelL       (Int iSourcePos,                  Int iSubSourcePos, Int iTargetSPos,                   Pel iFilled, RMDist& riError );
     240  template<Bool bSet> __inline Void xSetShiftedPelBlendL  (RenModelInPels* pcInSample, Int iSubSourcePos, RenModelOutPels* pcOutSample, Pel iFilled, RMDist& riError );
     241  template<Bool bSet> __inline Void xSetShiftedPelNoBlendL(RenModelInPels* pcInSample, Int iSubSourcePos, RenModelOutPels* pcOutSample, Pel iFilled, RMDist& riError );
     242
     243  template<Bool bSet> __inline Void xSetShiftedPelR       (Int iSourcePos,                  Int iSubSourcePos, Int iTargetSPos,                   Pel iFilled, RMDist& riError );
     244  template<Bool bSet> __inline Void xSetShiftedPelBlendR  (RenModelInPels* pcInSample, Int iSubSourcePos, RenModelOutPels* pcOutSample, Pel iFilled, RMDist& riError );
     245  template<Bool bSet> __inline Void xSetShiftedPelNoBlendR(RenModelInPels* pcInSample, Int iSubSourcePos, RenModelOutPels* pcOutSample, Pel iFilled, RMDist& riError );
     246
    129247  __inline Int    xShiftNewData      ( Int iPos, Int iPosInNewData );
    130248  __inline Int    xShift             ( Int iPos );
     
    134252
    135253  // Utilities
    136   __inline Void   xInitView  ( Int iViewPos );
    137254  __inline Void   xSetPels   ( Pel*  piPelSource , Int iSourceStride, Int iWidth, Int iHeight, Pel iVal );
    138255  __inline Void   xSetBools  ( Bool* pbSource    , Int iSourceStride, Int iWidth, Int iHeight, Bool bVal );
    139256  __inline Void   xSetInts   ( Int*  piPelSource , Int iSourceStride, Int iWidth, Int iHeight, Int iVal );
     257
     258#if HHI_VSO_COLOR_PLANES
     259  Void            xGetSampleStrTextPtrs ( Int iViewNum, Pel RenModelOutPels::*& rpiSrcY, Pel RenModelOutPels::*& rpiSrcU, Pel RenModelOutPels::*& rpiSrcV );
     260#else 
     261  Void            xGetSampleStrTextPtrs ( Int iViewNum, Pel RenModelOutPels::*& rpiSrcY );
     262#endif
     263  Void            xGetSampleStrDepthPtrs( Int iViewNum, Pel RenModelOutPels::*& rpiSrcD );
     264       
     265  Void            xSetStructRefView            ();
     266  Void            xResetStructError            ();
     267  Void            xInitSampleStructs           ();
     268  Void            xSetStructSynthViewAsRefView ();
     269  Void            xCopy2PicYuv                ( Pel** ppiSrcVideoPel, Int* piStrides, TComPicYuv* rpcPicYuvTarget, UInt uiHorOffset );
     270
     271
     272  template< typename S, typename T>
     273  Void   xCopyFromSampleStruct ( S* ptSource , Int iSourceStride, T S::* ptSourceElement, T* ptTarget, Int iTargetStride, Int iWidth, Int iHeight )
     274  {
     275    for (Int iPosY = 0; iPosY < m_iHeight; iPosY++)
     276    {
     277      for (Int iPosX = 0; iPosX < m_iWidth; iPosX++)
     278      {
     279        ptTarget[iPosX] = ptSource[iPosX].*ptSourceElement;
     280      }
     281      ptSource += iSourceStride;
     282      ptTarget += iTargetStride;
     283    }   
     284  } 
     285
     286  template< typename S, typename T>
     287  Void   xCopyToSampleStruct ( T* ptSource , Int iSourceStride, S* ptTarget, Int iTargetStride, T S::* ptSourceElement, Int iWidth, Int iHeight )
     288  {
     289    for (Int iPosY = 0; iPosY < m_iHeight; iPosY++)
     290    {
     291      for (Int iPosX = 0; iPosX < m_iWidth; iPosX++)
     292      {
     293        ptTarget[iPosX] = ptSource[iPosX].*ptSourceElement;
     294      }
     295      ptSource += iSourceStride;
     296      ptTarget += iTargetStride;
     297    }   
     298  }   
    140299
    141300private:
     
    151310  Int   m_iSampledStride;
    152311
     312  RenModelInPels* m_pcInputSamples[2];
     313  Int                  m_iInputSamplesStride;
     314
    153315  // Base
    154316  Pel** m_aapiBaseVideoPel     [2]; // Dim1: ViewPosition 0->Left, 1->Right; Dim2: Plane  0-> Y, 1->U, 2->V
     
    157319  Pel*  m_apiBaseDepthPel      [2]; // Dim1: ViewPosition
    158320  Int   m_aiBaseDepthStrides   [2]; // Dim1: ViewPosition
     321
    159322
    160323  // LUT
     
    170333  //// Reference Data  ////
    171334  TComPicYuv* m_pcPicYuvRef       ;    // Reference PIcYuv
     335
     336  //// Output Samples
     337  RenModelOutPels* m_pcOutputSamples;
     338  Int                   m_iOutputSamplesStride;
     339
    172340  Pel*  m_aapiRefVideoPel      [3];    // Dim1: Plane  0-> Y, 1->U, 2->V
    173341  Int   m_aiRefVideoStrides    [3];    // Dim1: Plane  0-> Y, 1->U, 2->V
    174 
    175   // Renderer State
    176   Int*  m_piError                 ;
    177   Pel*  m_apiFilled            [2];    // Dim1: ViewPosition
    178   Bool* m_apbOccluded          [2];    // Dim1: ViewPosition
    179   Pel*  m_aapiSynthVideoPel    [3][3]; // Dim1: ViewPosition 0: Left, 1:Right, 2: Merged, Dim2: Plane  0-> Y, 1->U, 2->V
    180   Pel*  m_apiSynthDepthPel     [3];    // Dim1: ViewPosition 0: Left, 1:Right, 2: Merged, Dim2: Plane  0-> Y, 1->U, 2->V
    181342
    182343  // Rendering State
     
    185346  Int   m_iLastOccludedSPosFP;         // Position of last topmost shifted position in FullPels
    186347
    187   Bool  m_bSet;                        // Set Data, or get Error
    188348  Int   m_iCurViewPos;                 // Current View Position 0: Left, 1: Right
    189349  Int   m_iOtherViewPos;               // Other View Position 0: Left, 1: Right
     
    201361  Int   m_iShiftPrec;
    202362  Int   m_iHoleMargin;
    203   Int   m_iBlendMode;
     363#ifdef LGE_VSO_EARLY_SKIP_A0093
     364  Bool  m_bEarlySkip;
     365#endif
    204366
    205367  // Derived settings
     
    209371
    210372  //// Current Pointers ////
    211   Pel*  m_aapiBaseVideoPelRow  [2][3]; // Dim1: ViewPosition 0->Left, 1->Right; Dim2: Plane  0-> Y, 1->U, 2->V
    212   Pel*  m_apiBaseDepthPelRow   [2];    // Dim1: ViewPosition
    213   Bool* m_apbOccludedRow       [2];    // Dim1: ViewPosition
    214   Pel*  m_apiFilledRow         [2];    // Dim1: ViewPosition
    215   Int*  m_apiErrorRow             ;
    216 
    217   Pel*  m_aapiRefVideoPelRow   [3];    // Dim1: Plane  0-> Y, 1->U, 2->V
    218   Pel*  m_aapiSynthVideoPelRow [3][3]; // Dim1: ViewPosition 0: Left, 1:Right, 2: Merged, Dim2: Plane  0-> Y, 1->U, 2->V
    219   Pel*  m_apiSynthDepthPelRow  [3];    // Dim1: ViewPosition 0: Left, 1:Right, 2: Merged
    220 
     373
     374  RenModelInPels*  m_pcInputSamplesRow [2];
     375  RenModelOutPels* m_pcOutputSamplesRow;
    221376
    222377  //// MISC ////
    223378  const Int m_iDistShift;                  // Shift in Distortion computation
     379
     380  //// Early Skip
     381#ifdef LGE_VSO_EARLY_SKIP_A0093
     382  Bool* m_pbHorSkip;
     383#endif
    224384};
    225385
Note: See TracChangeset for help on using the changeset viewer.