Changeset 56 in 3DVCSoftware for trunk/source/Lib/TLibCommon/TComMotionInfo.h


Ignore:
Timestamp:
11 May 2012, 21:20:17 (13 years ago)
Author:
hschwarz
Message:

updated trunk (move to HM6.1)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/Lib/TLibCommon/TComMotionInfo.h

    r5 r56  
    22 * License, included below. This software may be subject to other third party
    33 * and contributor rights, including patent rights, and no such rights are
    4  * granted under this license.
     4 * granted under this license. 
    55 *
    6  * Copyright (c) 2010-2011, ISO/IEC
     6 * Copyright (c) 2010-2012, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    1515 *    this list of conditions and the following disclaimer in the documentation
    1616 *    and/or other materials provided with the distribution.
    17  *  * Neither the name of the ISO/IEC nor the names of its contributors may
     17 *  * Neither the name of the ITU/ISO/IEC nor the names of its contributors may
    1818 *    be used to endorse or promote products derived from this software without
    1919 *    specific prior written permission.
     
    3232 */
    3333
    34 
    35 
    3634/** \file     TComMotionInfo.h
    3735    \brief    motion information handling classes (header)
     
    4644#include "TComMv.h"
    4745
     46//! \ingroup TLibCommon
     47//! \{
     48
    4849// ====================================================================================================================
    4950// Type definition
     
    5354typedef struct _AMVPInfo
    5455{
    55   TComMv m_acMvCand[ AMVP_MAX_NUM_CANDS ];  ///< array of motion vector predictor candidates
     56  TComMv m_acMvCand[ AMVP_MAX_NUM_CANDS_MEM ];  ///< array of motion vector predictor candidates
    5657  Int    iN;                                ///< number of motion vector predictor candidates
    5758} AMVPInfo;
     
    6970 
    7071public:
    71   TComMvField() :
    72   m_iRefIdx (-1)
    73   {
    74   }
     72  TComMvField() : m_iRefIdx( NOT_VALID ) {}
    7573 
    76   Void setMvField ( TComMv cMv, Int iRefIdx )
     74  Void setMvField( TComMv const & cMv, Int iRefIdx )
    7775  {
    7876    m_acMv    = cMv;
     
    8078  }
    8179 
    82   TComMv& getMv     ()      { return  m_acMv;             }
    83   Int     getRefIdx ()      { return  m_iRefIdx;          }
     80  Void setRefIdx( Int refIdx ) { m_iRefIdx = refIdx; }
    8481 
    85   Int     getHor    ()      { return  m_acMv.getHor();    }
    86   Int     getVer    ()      { return  m_acMv.getVer();    }
     82  TComMv const & getMv() const { return  m_acMv; }
     83  TComMv       & getMv()       { return  m_acMv; }
     84 
     85  Int getRefIdx() const { return  m_iRefIdx;       }
     86  Int getHor   () const { return  m_acMv.getHor(); }
     87  Int getVer   () const { return  m_acMv.getVer(); }
    8788};
    8889
     
    9394  TComMv*   m_pcMv;
    9495  TComMv*   m_pcMvd;
    95   Int*      m_piRefIdx;
     96  Char*     m_piRefIdx;
    9697  UInt      m_uiNumPartition;
    9798  AMVPInfo  m_cAMVPInfo;
     99   
     100  template <typename T>
     101  Void setAll( T *p, T const & val, PartSize eCUMode, Int iPartAddr, UInt uiDepth, Int iPartIdx );
     102
    98103public:
    99   TComCUMvField()
    100   {
    101     m_pcMv     = NULL;
    102     m_pcMvd    = NULL;
    103     m_piRefIdx = NULL;
    104   }
    105   ~TComCUMvField()
    106   {
    107     m_pcMv     = NULL;
    108     m_pcMvd    = NULL;
    109     m_piRefIdx = NULL;
    110   }
    111  
     104  TComCUMvField() : m_pcMv(NULL), m_pcMvd(NULL), m_piRefIdx(NULL), m_uiNumPartition(0) {}
     105  ~TComCUMvField() {}
     106
    112107  // ------------------------------------------------------------------------------------------------------------------
    113108  // create / destroy
    114109  // ------------------------------------------------------------------------------------------------------------------
    115110 
    116   Void    create        ( UInt uiNumPartition );
    117   Void    destroy       ();
     111  Void    create( UInt uiNumPartition );
     112  Void    destroy();
    118113 
    119114  // ------------------------------------------------------------------------------------------------------------------
    120115  // clear / copy
    121116  // ------------------------------------------------------------------------------------------------------------------
     117
     118  Void    clearMvField();
    122119 
    123   Void    clearMv       ( Int iPartAddr, UInt uiDepth );
    124   Void    clearMvd      ( Int iPartAddr, UInt uiDepth );
    125   Void    clearMvField  ();
    126  
    127   Void    copyFrom          ( TComCUMvField* pcCUMvFieldSrc, Int iNumPartSrc, Int iPartAddrDst );
    128   Void    copyTo            ( TComCUMvField* pcCUMvFieldDst, Int iPartAddrDst );
    129   Void    copyTo            ( TComCUMvField* pcCUMvFieldDst, Int iPartAddrDst, UInt uiOffset, UInt uiNumPart );
    130   Void    copyMvTo          ( TComCUMvField* pcCUMvFieldDst, Int iPartAddrDst );
     120  Void    copyFrom( TComCUMvField const * pcCUMvFieldSrc, Int iNumPartSrc, Int iPartAddrDst );
     121  Void    copyTo  ( TComCUMvField* pcCUMvFieldDst, Int iPartAddrDst ) const;
     122  Void    copyTo  ( TComCUMvField* pcCUMvFieldDst, Int iPartAddrDst, UInt uiOffset, UInt uiNumPart ) const;
    131123 
    132124  // ------------------------------------------------------------------------------------------------------------------
     
    134126  // ------------------------------------------------------------------------------------------------------------------
    135127 
    136   TComMv& getMv             ( Int iIdx )               { return  m_pcMv    [iIdx]; }
    137   TComMv* getMv             ()                         { return  m_pcMv;           }
    138   TComMv& getMvd            ( Int iIdx )               { return  m_pcMvd   [iIdx]; }
    139   TComMv* getMvd            ()                         { return  m_pcMvd;          }
    140   Int     getRefIdx         ( Int iIdx )               { return  m_piRefIdx[iIdx]; }
    141   Int*    getRefIdx         ()                         { return  m_piRefIdx;       }
     128  TComMv const & getMv    ( Int iIdx ) const { return  m_pcMv    [iIdx]; }
     129  TComMv const & getMvd   ( Int iIdx ) const { return  m_pcMvd   [iIdx]; }
     130  Int            getRefIdx( Int iIdx ) const { return  m_piRefIdx[iIdx]; }
    142131 
    143132  AMVPInfo* getAMVPInfo () { return &m_cAMVPInfo; }
     133 
    144134  // ------------------------------------------------------------------------------------------------------------------
    145135  // set
    146136  // ------------------------------------------------------------------------------------------------------------------
    147137 
    148   Void    setMv             ( TComMv  cMv,     Int iIdx ) { m_pcMv    [iIdx] = cMv;     }
    149   Void    setMvd            ( TComMv  cMvd,    Int iIdx ) { m_pcMvd   [iIdx] = cMvd;    }
    150   Void    setRefIdx         ( Int     iRefIdx, Int iIdx ) { m_piRefIdx[iIdx] = iRefIdx; }
     138  Void    setAllMv     ( TComMv const & rcMv,         PartSize eCUMode, Int iPartAddr, UInt uiDepth, Int iPartIdx=0 );
     139  Void    setAllMvd    ( TComMv const & rcMvd,        PartSize eCUMode, Int iPartAddr, UInt uiDepth, Int iPartIdx=0 );
     140  Void    setAllRefIdx ( Int iRefIdx,                 PartSize eMbMode, Int iPartAddr, UInt uiDepth, Int iPartIdx=0 );
     141  Void    setAllMvField( TComMvField const & mvField, PartSize eMbMode, Int iPartAddr, UInt uiDepth, Int iPartIdx=0 );
     142
     143  Void setNumPartition( Int iNumPart )
     144  {
     145    m_uiNumPartition = iNumPart;
     146  }
    151147 
    152   Void    setMvPtr          ( TComMv*  cMvPtr     ) { m_pcMv    = cMvPtr;         }
    153   Void    setMvdPtr         ( TComMv*  cMvdPtr    ) { m_pcMvd  = cMvdPtr;         }
    154   Void    setRefIdxPtr      ( Int*     iRefIdxPtr ) { m_piRefIdx = iRefIdxPtr;    }
    155   Void    setNumPartition   ( Int      iNumPart   ) { m_uiNumPartition=iNumPart;  }
     148  Void linkToWithOffset( TComCUMvField const * src, Int offset )
     149  {
     150    m_pcMv     = src->m_pcMv     + offset;
     151    m_pcMvd    = src->m_pcMvd    + offset;
     152    m_piRefIdx = src->m_piRefIdx + offset;
     153  }
    156154 
    157   Void    setAllMv          ( TComMv& rcMv,    PartSize eCUMode, Int iPartAddr, Int iPartIdx, UInt uiDepth );
    158   Void    setAllMvd         ( TComMv& rcMvd,   PartSize eCUMode, Int iPartAddr, Int iPartIdx, UInt uiDepth );
    159   Void    setAllRefIdx      ( Int     iRefIdx, PartSize eMbMode, Int iPartAddr, Int iPartIdx, UInt uiDepth );
    160   Void    setAllMvField     ( TComMv& rcMv, Int iRefIdx, PartSize eMbMode, Int iPartAddr, Int iPartIdx, UInt uiDepth );
    161  
    162 #if AMVP_BUFFERCOMPRESS
    163   Void    compress          (PredMode* pePredMode,UChar* puhInterDir);
    164 #endif
    165  
     155#if HHI_MPI
     156  Void compress(Char* pePredMode, UChar* puhInterDir, Int scale);
     157#else
     158  Void compress(Char* pePredMode, Int scale);
     159#endif
     160#if HHI_FULL_PEL_DEPTH_MAP_MV_ACC
     161  Void decreaseMvAccuracy( Int iPartAddr, Int iNumPart, Int iShift );
     162#endif
    166163};
    167164
     165//! \}
     166
    168167#endif // __TCOMMOTIONINFO__
    169 
Note: See TracChangeset for help on using the changeset viewer.