Changeset 608 in 3DVCSoftware for trunk/source/Lib/TLibCommon/TComWedgelet.h
- Timestamp:
- 1 Sep 2013, 22:47:26 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/Lib/TLibCommon/TComWedgelet.h
r296 r608 43 43 #include <vector> 44 44 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 50 enum 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 45 93 enum WedgeResolution 46 94 { … … 50 98 }; 51 99 52 #if HHI_DMM_PRED_TEX || HHI_DMM_WEDGE_INTRA53 #define NUM_WEDGE_REFINES 854 #define NO_IDX MAX_UINT55 #endif56 100 57 101 // ==================================================================================================================== … … 67 111 UChar m_uhOri; // orientation index 68 112 WedgeResolution m_eWedgeRes; // start/end pos resolution 69 #if HHI_DMM_PRED_TEX || HHI_DMM_WEDGE_INTRA70 113 Bool m_bIsCoarse; 71 114 UInt m_uiAng; 72 #endif73 115 74 116 UInt m_uiWidth; … … 99 141 UChar getEndY () { return m_uhYe; } 100 142 UChar getOri () { return m_uhOri; } 101 #if HHI_DMM_PRED_TEX || HHI_DMM_WEDGE_INTRA102 143 Bool getIsCoarse() { return m_bIsCoarse; } 103 144 UInt getAng () { return m_uiAng; } 104 Void findClosetAngle();105 145 106 146 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(); 110 148 111 149 Bool checkNotPlain(); … … 113 151 Bool checkInvIdentical( Bool* pbRefPattern ); 114 152 115 #if HHI_DMM_WEDGE_INTRA 153 // functions for DMM2 prediction 116 154 Bool checkPredDirAbovePossible( UInt uiPredDirBlockSize, UInt uiPredDirBlockOffsett ); 117 155 Bool checkPredDirLeftPossible ( UInt uiPredDirBlockSize, UInt uiPredDirBlockOffsett ); 118 119 156 Void getPredDirStartEndAbove( UChar& ruhXs, UChar& ruhYs, UChar& ruhXe, UChar& ruhYe, UInt uiPredDirBlockSize, UInt uiPredDirBlockOffset, Int iDeltaEnd ); 120 157 Void getPredDirStartEndLeft ( UChar& ruhXs, UChar& ruhYs, UChar& ruhXe, UChar& ruhYe, UInt uiPredDirBlockSize, UInt uiPredDirBlockOffset, Int iDeltaEnd ); 121 #endif122 158 }; // END CLASS DEFINITION TComWedgelet 123 159 … … 153 189 typedef std::vector<TComWedgeRef> WedgeRefList; 154 190 155 #if HHI_DMM_PRED_TEX || HHI_DMM_WEDGE_INTRA156 191 // ==================================================================================================================== 157 192 // Class definition TComWedgeNode … … 161 196 private: 162 197 UInt m_uiPatternIdx; 163 UInt m_uiRefineIdx[ NUM_WEDGE_REFINES];198 UInt m_uiRefineIdx[DMM_NUM_WEDGE_REFINES]; 164 199 165 200 public: … … 176 211 // type definition wedgelet node list 177 212 typedef 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 249 215 250 216 // ====================================================================================================================
Note: See TracChangeset for help on using the changeset viewer.