Changeset 608 in 3DVCSoftware for trunk/source/Lib/TLibCommon/TComWedgelet.h


Ignore:
Timestamp:
1 Sep 2013, 22:47:26 (11 years ago)
Author:
tech
Message:

Merged DEV-2.0-dev0@604.

File:
1 edited

Legend:

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

    r296 r608  
    4343#include <vector>
    4444
     45#if H_3D_DIM
     46#define DIM_OFFSET     (NUM_INTRA_MODE+1) // offset for DMM and RBC mode numbers (PM: not consistent with spec, but non-overlapping with chroma, see DM_CHROMA_IDX)
     47#define DIM_MIN_SIZE                   4  // min. block size for DMM and RBC modes
     48#define DIM_MAX_SIZE                  32  // max. block size for DMM and RBC modes
     49
     50enum DIM_IDX
     51{
     52#if SEC_DMM2_E0146
     53  DMM1_IDX = 0,
     54  DMM3_IDX = 1,
     55  DMM4_IDX = 2,
     56  RBC_IDX  = 3
     57#else
     58  DMM1_IDX = 0,
     59  DMM2_IDX = 3,
     60  DMM3_IDX = 1,
     61  DMM4_IDX = 2,
     62  RBC_IDX  = 4
     63#endif
     64};
     65#if SEC_DMM2_E0146
     66#define DMM_NUM_TYPE   3
     67#else
     68#define DMM_NUM_TYPE   4
     69#endif
     70#define RBC_NUM_TYPE   1
     71#define DIM_NUM_TYPE   (DMM_NUM_TYPE+RBC_NUM_TYPE)
     72#define DIM_NO_IDX     MAX_UINT
     73
     74__inline UInt getDimType  ( Int intraMode ) { Int dimType = (intraMode-DIM_OFFSET)/2; return (dimType >= 0 && dimType < DIM_NUM_TYPE) ? (UInt)dimType : DIM_NO_IDX; }
     75__inline Bool isDimMode   ( Int intraMode ) { return (getDimType( intraMode ) < DIM_NUM_TYPE); }
     76__inline Bool isDimDeltaDC( Int intraMode ) { return (isDimMode( intraMode ) && ((intraMode-DIM_OFFSET)%2) == 1); }
     77#endif
     78
     79#if H_3D_DIM_RBC
     80#define RBC_THRESHOLD              20
     81#define RBC_MAX_EDGE_NUM_PER_4x4   8
     82#define RBC_MAX_DISTANCE           255
     83#endif
     84
     85#if H_3D_DIM_DMM
     86#define DMM_NO_WEDGEINDEX       MAX_UINT
     87#define DMM_NUM_WEDGE_REFINES   8
     88#if !SEC_DMM2_E0146
     89#define DMM2_DELTAEND_MAX       4
     90#endif
     91#define DMM3_SIMPLIFY_TR        1
     92
    4593enum WedgeResolution
    4694{
     
    5098};
    5199
    52 #if HHI_DMM_PRED_TEX || HHI_DMM_WEDGE_INTRA
    53 #define NUM_WEDGE_REFINES 8
    54 #define NO_IDX MAX_UINT
    55 #endif
    56100
    57101// ====================================================================================================================
     
    67111  UChar           m_uhOri;                      // orientation index
    68112  WedgeResolution m_eWedgeRes;                  // start/end pos resolution
    69 #if HHI_DMM_PRED_TEX || HHI_DMM_WEDGE_INTRA
    70113  Bool            m_bIsCoarse;
    71114  UInt            m_uiAng;
    72 #endif
    73115
    74116  UInt  m_uiWidth;
     
    99141  UChar           getEndY    () { return m_uhYe; }
    100142  UChar           getOri     () { return m_uhOri; }
    101 #if HHI_DMM_PRED_TEX || HHI_DMM_WEDGE_INTRA
    102143  Bool            getIsCoarse() { return m_bIsCoarse; }
    103144  UInt            getAng     () { return m_uiAng; }
    104   Void            findClosetAngle();
    105145
    106146  Void  setWedgelet( UChar uhXs, UChar uhYs, UChar uhXe, UChar uhYe, UChar uhOri, WedgeResolution eWedgeRes, Bool bIsCoarse = false );
    107 #else
    108   Void  setWedgelet( UChar uhXs, UChar uhYs, UChar uhXe, UChar uhYe, UChar uhOri, WedgeResolution eWedgeRes );
    109 #endif
     147  Void  findClosestAngle();
    110148
    111149  Bool  checkNotPlain();
     
    113151  Bool  checkInvIdentical( Bool* pbRefPattern );
    114152
    115 #if HHI_DMM_WEDGE_INTRA
     153  // functions for DMM2 prediction
    116154  Bool  checkPredDirAbovePossible( UInt uiPredDirBlockSize, UInt uiPredDirBlockOffsett );
    117155  Bool  checkPredDirLeftPossible ( UInt uiPredDirBlockSize, UInt uiPredDirBlockOffsett );
    118 
    119156  Void  getPredDirStartEndAbove( UChar& ruhXs, UChar& ruhYs, UChar& ruhXe, UChar& ruhYe, UInt uiPredDirBlockSize, UInt uiPredDirBlockOffset, Int iDeltaEnd );
    120157  Void  getPredDirStartEndLeft ( UChar& ruhXs, UChar& ruhYs, UChar& ruhXe, UChar& ruhYe, UInt uiPredDirBlockSize, UInt uiPredDirBlockOffset, Int iDeltaEnd );
    121 #endif
    122158};  // END CLASS DEFINITION TComWedgelet
    123159
     
    153189typedef std::vector<TComWedgeRef> WedgeRefList;
    154190
    155 #if HHI_DMM_PRED_TEX || HHI_DMM_WEDGE_INTRA
    156191// ====================================================================================================================
    157192// Class definition TComWedgeNode
     
    161196private:
    162197  UInt            m_uiPatternIdx;
    163   UInt            m_uiRefineIdx[NUM_WEDGE_REFINES];
     198  UInt            m_uiRefineIdx[DMM_NUM_WEDGE_REFINES];
    164199
    165200public:
     
    176211// type definition wedgelet node list
    177212typedef std::vector<TComWedgeNode> WedgeNodeList;
    178 #endif
    179 
    180 #if HHI_DMM_PRED_TEX
    181 enum WedgeDist
    182 {
    183   WedgeDist_SAD  = 0,
    184   WedgeDist_SSE  = 4,
    185 };
    186 
    187 class WedgeDistParam;
    188 typedef UInt (*FpWedgeDistFunc) (WedgeDistParam*);
    189 
    190 /// distortion parameter class
    191 class WedgeDistParam
    192 {
    193 public:
    194   Pel*  pOrg;
    195   Pel*  pCur;
    196   Int   iStrideOrg;
    197   Int   iStrideCur;
    198   Int   iRows;
    199   Int   iCols;
    200   Int   iStep;
    201   FpWedgeDistFunc DistFunc;
    202   Int   iSubShift;
    203 
    204   WedgeDistParam()
    205   {
    206     pOrg = NULL;
    207     pCur = NULL;
    208     iStrideOrg = 0;
    209     iStrideCur = 0;
    210     iRows = 0;
    211     iCols = 0;
    212     iStep = 1;
    213     DistFunc = NULL;
    214     iSubShift = 0;
    215   }
    216 };
    217 
    218 // ====================================================================================================================
    219 // Class definition TComWedgeDist
    220 // ====================================================================================================================
    221 class TComWedgeDist
    222 {
    223 private:
    224   Int                     m_iBlkWidth;
    225   Int                     m_iBlkHeight;
    226   FpWedgeDistFunc         m_afpDistortFunc[8];
    227 
    228 public:
    229   TComWedgeDist();
    230   virtual ~TComWedgeDist();
    231 
    232   Void init();
    233   Void setDistParam( UInt uiBlkWidth, UInt uiBlkHeight, WedgeDist eWDist, WedgeDistParam& rcDistParam );
    234   UInt getDistPart( Pel* piCur, Int iCurStride,  Pel* piOrg, Int iOrgStride, UInt uiBlkWidth, UInt uiBlkHeight, WedgeDist eWDist = WedgeDist_SAD );
    235 
    236 private:
    237   static UInt xGetSAD4          ( WedgeDistParam* pcDtParam );
    238   static UInt xGetSAD8          ( WedgeDistParam* pcDtParam );
    239   static UInt xGetSAD16         ( WedgeDistParam* pcDtParam );
    240   static UInt xGetSAD32         ( WedgeDistParam* pcDtParam );
    241 
    242   static UInt xGetSSE4          ( WedgeDistParam* pcDtParam );
    243   static UInt xGetSSE8          ( WedgeDistParam* pcDtParam );
    244   static UInt xGetSSE16         ( WedgeDistParam* pcDtParam );
    245   static UInt xGetSSE32         ( WedgeDistParam* pcDtParam );
    246 
    247 };// END CLASS DEFINITION TComWedgeDist
    248 #endif
     213#endif //H_3D_DIM_DMM
     214
    249215
    250216// ====================================================================================================================
Note: See TracChangeset for help on using the changeset viewer.