Changeset 296 in 3DVCSoftware for trunk/source/Lib/TLibCommon/TComAdaptiveLoopFilter.h
- Timestamp:
- 20 Feb 2013, 22:07:43 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/Lib/TLibCommon/TComAdaptiveLoopFilter.h
r56 r296 49 49 // ==================================================================================================================== 50 50 51 #if LCU_SYNTAX_ALF52 51 #define LCUALF_QP_DEPENDENT_BITS 1 53 #endif 54 55 #if ALF_SINGLE_FILTER_SHAPE 52 56 53 #define ALF_FILTER_LEN 10 57 54 #define ALF_MAX_NUM_COEF ALF_FILTER_LEN //!< maximum number of filter coefficients 58 #else59 #define ALF_MAX_NUM_COEF 9 //!< maximum number of filter coefficients60 #endif61 55 #define MAX_SQR_FILT_LENGTH 41 //!< ((max_horizontal_tap * max_vertical_tap) / 2 + 1) = ((11 * 5) / 2 + 1) 62 56 63 #if LCU _SYNTAX_ALF && LCUALF_QP_DEPENDENT_BITS57 #if LCUALF_QP_DEPENDENT_BITS 64 58 #define ALF_QP1 28 65 59 #define ALF_QP2 34 … … 78 72 79 73 80 #if LCU_SYNTAX_ALF81 74 /// Luma/Chroma component ID 82 75 enum ALFComponentID … … 96 89 NUM_ALF_MERGE_TYPE 97 90 }; 98 #else99 ///100 /// Chroma component ID101 ///102 enum AlfChromaID103 {104 ALF_Cb = 0,105 ALF_Cr = 1106 };107 108 109 ///110 /// Adaptation mode ID111 ///112 enum ALFClassficationMethod113 {114 ALF_BA =0,115 ALF_RA,116 NUM_ALF_CLASS_METHOD117 };118 #endif119 91 /// 120 92 /// Filter shape … … 122 94 enum ALFFilterShape 123 95 { 124 #if ALF_SINGLE_FILTER_SHAPE125 96 ALF_CROSS9x7_SQUARE3x3 = 0, 126 #else127 ALF_STAR5x5 = 0,128 ALF_CROSS9x9,129 #endif130 97 NUM_ALF_FILTER_SHAPE 131 98 }; 132 99 133 #if LCU_SYNTAX_ALF134 100 extern Int* kTableTabShapes[NUM_ALF_FILTER_SHAPE]; 135 #endif136 #if ALF_SINGLE_FILTER_SHAPE137 101 extern Int depthIntShape1Sym[ALF_MAX_NUM_COEF+1]; 138 #else139 extern Int depthIntShape0Sym[10];140 extern Int depthIntShape1Sym[10];141 #endif142 102 extern Int *pDepthIntTabShapes[NUM_ALF_FILTER_SHAPE]; 143 103 … … 156 116 const AlfCUCtrlInfo& operator= (const AlfCUCtrlInfo& src); //!< "=" operator 157 117 AlfCUCtrlInfo():cu_control_flag(0), num_alf_cu_flag(0), alf_max_depth(0) {} //!< constructor 158 #if LCU_SYNTAX_ALF159 118 Void reset(); 160 #endif161 119 }; 162 120 … … 190 148 191 149 // filter shape information 192 #if ALF_SINGLE_FILTER_SHAPE193 150 static Int weightsShape1Sym[ALF_MAX_NUM_COEF+1]; 194 #else195 static Int weightsShape0Sym[10];196 static Int weightsShape1Sym[10];197 #endif198 151 static Int *weightsTabShapes[NUM_ALF_FILTER_SHAPE]; 199 152 static Int m_sqrFiltLengthTab[NUM_ALF_FILTER_SHAPE]; … … 209 162 //classification 210 163 Int m_varIndTab[NO_VAR_BINS]; 211 #if !LCU_SYNTAX_ALF212 UInt m_uiVarGenMethod;213 Pel** m_varImgMethods[NUM_ALF_CLASS_METHOD];214 #endif215 164 Pel** m_varImg; 216 165 … … 237 186 std::vector< std::vector< AlfLCUInfo* > > *m_pvpSliceTileAlfLCU; 238 187 239 #if LCU_SYNTAX_ALF240 188 Int m_suWidth; 241 189 Int m_suHeight; … … 245 193 Bool m_isNonCrossSlice; 246 194 Int m_alfQP; 247 #endif248 195 249 196 private: //private member variables … … 252 199 protected: //protected methods 253 200 254 #if LCU_SYNTAX_ALF255 201 Void createLCUAlfInfo(); 256 202 Void destroyLCUAlfInfo(); … … 266 212 Bool isEnabledComponent(ALFParam** alfLCUParam); 267 213 Int getAlfPrecisionBit(Int qp); 268 #if ALF_SINGLE_FILTER_SHAPE269 214 Void filterOneCompRegion(Pel *imgRes, Pel *imgPad, Int stride, Bool isChroma, Int yPos, Int yPosEnd, Int xPos, Int xPosEnd, Int** filterSet, Int* mergeTable, Pel** varImg); 270 #endif271 215 Void calcOneRegionVar(Pel **imgYvar, Pel *imgYpad, Int stride, Bool isOnlyOneGroup, Int yPos, Int yPosEnd, Int xPos, Int xPosEnd); 272 #endif273 216 274 217 275 218 Void InitAlfLCUInfo(AlfLCUInfo& rAlfLCU, Int sliceID, Int tileID, TComDataCU* pcCU, UInt maxNumSUInLCU); 276 #if !LCU_SYNTAX_ALF277 Void createRegionIndexMap(Pel **imgY_var, Int img_width, Int img_height); //!< create RA index for regions278 Void calcVar(Pel **imgYvar, Pel *imgYpad, Int stride, Int adaptationMode); //!< Calculate ALF grouping indices for block-based (BA) mode279 Void filterLuma(Pel *pImgYRes, Pel *pImgYPad, Int stride, Int ypos, Int yposEnd, Int xpos, Int xposEnd, Int filtNo, Int** filterSet, Int* mergeTable, Pel** ppVarImg); //!< filtering operation for luma region280 Void filterChroma(Pel *pImgRes, Pel *pImgPad, Int stride, Int ypos, Int yposEnd, Int xpos, Int xposEnd, Int filtNo, Int* coef);281 Void filterChromaRegion(std::vector<AlfLCUInfo*> &vpAlfLCU, Pel* pDec, Pel* pRest, Int stride, Int *coeff, Int filtNo, Int chromaFormatShift); //!< filtering operation for chroma region282 Void xCUAdaptive (TComPic* pcPic, Int filtNo, Pel *imgYFilt, Pel *imgYRec, Int Stride);283 Void xSubCUAdaptive(TComDataCU* pcCU, Int filtNo, Pel *imgYFilt, Pel *imgYRec, UInt uiAbsPartIdx, UInt uiDepth, Int Stride);284 Void reconstructFilterCoeffs(ALFParam* pcAlfParam,int **pfilterCoeffSym);285 Void predictALFCoeffLuma ( ALFParam* pAlfParam ); //!< prediction of luma ALF coefficients286 #endif287 219 Void checkFilterCoeffValue( Int *filter, Int filterLength, Bool isChroma ); 288 #if !LCU_SYNTAX_ALF289 Void decodeFilterSet(ALFParam* pcAlfParam, Int* varIndTab, Int** filterCoeff);290 Void xALFChroma ( ALFParam* pcAlfParam, TComPicYuv* pcPicDec, TComPicYuv* pcPicRest );291 Void xFilterChromaSlices(Int componentID, TComPicYuv* pcPicDecYuv, TComPicYuv* pcPicRestYuv, Int *coeff, Int filtNo, Int chromaFormatShift);292 Void xFilterChromaOneCmp(Int componentID, TComPicYuv *pDecYuv, TComPicYuv *pRestYuv, Int shape, Int *pCoeff);293 Void xALFLuma( TComPic* pcPic, ALFParam* pcAlfParam, std::vector<AlfCUCtrlInfo>& vAlfCUCtrlParam, TComPicYuv* pcPicDec, TComPicYuv* pcPicRest );294 #endif295 220 Void setAlfCtrlFlags(AlfCUCtrlInfo* pAlfParam, TComDataCU *pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt &idx); 296 221 Void transferCtrlFlagsFromAlfParam(std::vector<AlfCUCtrlInfo>& vAlfParamSlices); //!< Copy ALF CU control flags from ALF parameters for slices … … 299 224 Void copyRegion(std::vector<AlfLCUInfo*> &vpAlfLCU, Pel* pPicDst, Pel* pPicSrc, Int stride, Int formatShift = 0); 300 225 Void extendRegionBorder(std::vector<AlfLCUInfo*> &vpAlfLCU, Pel* pPelSrc, Int stride, Int formatShift = 0); 301 #if !LCU_SYNTAX_ALF302 Void filterLumaRegion (std::vector<AlfLCUInfo*> &vpAlfLCU, Pel* imgDec, Pel* imgRest, Int stride, Int filtNo, Int** filterCoeff, Int* mergeTable, Pel** varImg);303 Void xCUAdaptiveRegion(std::vector<AlfLCUInfo*> &vpAlfLCU, Pel* imgDec, Pel* imgRest, Int stride, Int filtNo, Int** filterCoeff, Int* mergeTable, Pel** varImg);304 #endif305 226 Int getCtrlFlagsFromAlfParam(AlfLCUInfo* pcAlfLCU, Int iAlfDepth, UInt* puiFlags); 306 227 … … 317 238 Void destroy (); 318 239 319 #if LCU_SYNTAX_ALF320 240 Void ALFProcess (TComPic* pcPic, std::vector<AlfCUCtrlInfo>& vAlfCUCtrlParam, Bool isAlfCoefInSlice); 321 241 Void resetLCUAlfInfo (); … … 324 244 325 245 ALFParam*** getAlfLCUParam() {return m_alfFiltInfo;} 326 #else327 Void predictALFCoeffChroma ( ALFParam* pAlfParam ); //!< prediction of chroma ALF coefficients328 #if ALF_CHROMA_COEF_PRED_HARMONIZATION329 Void reconstructALFCoeffChroma( ALFParam* pAlfParam );330 #endif331 Void ALFProcess ( TComPic* pcPic, ALFParam* pcAlfParam, std::vector<AlfCUCtrlInfo>& vAlfCUCtrlParam ); ///< interface function for ALF process332 333 Void allocALFParam ( ALFParam* pAlfParam ); //!< allocate ALF parameters334 Void freeALFParam ( ALFParam* pAlfParam ); //!< free ALF parameters335 Void copyALFParam ( ALFParam* pDesAlfParam, ALFParam* pSrcAlfParam ); //!< copy ALF parameters336 #endif337 246 Int getNumCUsInPic() {return m_uiNumCUsInFrame;} //!< get number of LCU in picture for ALF process 338 #if LCU_SYNTAX_ALF339 247 Void createPicAlfInfo (TComPic* pcPic, Int uiNumSlicesInPic = 1, Int alfQP = 26); 340 #else341 Void createPicAlfInfo (TComPic* pcPic, Int numSlicesInPic = 1);342 #endif343 248 Void destroyPicAlfInfo(); 344 249
Note: See TracChangeset for help on using the changeset viewer.