Ignore:
Timestamp:
20 Feb 2013, 22:07:43 (12 years ago)
Author:
tech
Message:

Reintegrated branch 5.1-dev0 rev. 295.

File:
1 edited

Legend:

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

    r56 r296  
    4949// ====================================================================================================================
    5050
    51 #if LCU_SYNTAX_ALF
    5251  #define LCUALF_QP_DEPENDENT_BITS    1 
    53 #endif
    54 
    55 #if ALF_SINGLE_FILTER_SHAPE
     52
    5653#define ALF_FILTER_LEN       10
    5754#define ALF_MAX_NUM_COEF     ALF_FILTER_LEN    //!< maximum number of filter coefficients
    58 #else
    59 #define ALF_MAX_NUM_COEF      9                                       //!< maximum number of filter coefficients
    60 #endif
    6155#define MAX_SQR_FILT_LENGTH   41                                      //!< ((max_horizontal_tap * max_vertical_tap) / 2 + 1) = ((11 * 5) / 2 + 1)
    6256
    63 #if LCU_SYNTAX_ALF && LCUALF_QP_DEPENDENT_BITS
     57#if LCUALF_QP_DEPENDENT_BITS
    6458#define ALF_QP1               28
    6559#define ALF_QP2               34
     
    7872
    7973
    80 #if LCU_SYNTAX_ALF
    8174/// Luma/Chroma component ID
    8275enum ALFComponentID
     
    9689  NUM_ALF_MERGE_TYPE
    9790};
    98 #else
    99 ///
    100 /// Chroma component ID
    101 ///
    102 enum AlfChromaID
    103 {
    104   ALF_Cb = 0,
    105   ALF_Cr = 1
    106 };
    107 
    108 
    109 ///
    110 /// Adaptation mode ID
    111 ///
    112 enum ALFClassficationMethod
    113 {
    114   ALF_BA =0,
    115   ALF_RA,
    116   NUM_ALF_CLASS_METHOD
    117 };
    118 #endif
    11991///
    12092/// Filter shape
     
    12294enum ALFFilterShape
    12395{
    124 #if ALF_SINGLE_FILTER_SHAPE
    12596  ALF_CROSS9x7_SQUARE3x3 = 0,
    126 #else
    127   ALF_STAR5x5 = 0,
    128   ALF_CROSS9x9,
    129 #endif
    13097  NUM_ALF_FILTER_SHAPE
    13198};
    13299
    133 #if LCU_SYNTAX_ALF
    134100extern Int* kTableTabShapes[NUM_ALF_FILTER_SHAPE];
    135 #endif
    136 #if ALF_SINGLE_FILTER_SHAPE
    137101extern Int depthIntShape1Sym[ALF_MAX_NUM_COEF+1];
    138 #else
    139 extern Int depthIntShape0Sym[10];
    140 extern Int depthIntShape1Sym[10];
    141 #endif
    142102extern Int *pDepthIntTabShapes[NUM_ALF_FILTER_SHAPE];
    143103
     
    156116  const AlfCUCtrlInfo& operator= (const AlfCUCtrlInfo& src);  //!< "=" operator
    157117  AlfCUCtrlInfo():cu_control_flag(0), num_alf_cu_flag(0), alf_max_depth(0) {} //!< constructor
    158 #if LCU_SYNTAX_ALF
    159118  Void reset();
    160 #endif
    161119};
    162120
     
    190148
    191149  // filter shape information
    192 #if ALF_SINGLE_FILTER_SHAPE
    193150  static Int weightsShape1Sym[ALF_MAX_NUM_COEF+1];
    194 #else
    195   static Int weightsShape0Sym[10];
    196   static Int weightsShape1Sym[10];
    197 #endif
    198151  static Int *weightsTabShapes[NUM_ALF_FILTER_SHAPE];
    199152  static Int m_sqrFiltLengthTab[NUM_ALF_FILTER_SHAPE];
     
    209162  //classification
    210163  Int      m_varIndTab[NO_VAR_BINS];
    211 #if !LCU_SYNTAX_ALF
    212   UInt     m_uiVarGenMethod;
    213   Pel** m_varImgMethods[NUM_ALF_CLASS_METHOD];
    214 #endif
    215164  Pel** m_varImg;
    216165
     
    237186  std::vector< std::vector< AlfLCUInfo* > > *m_pvpSliceTileAlfLCU;
    238187
    239 #if LCU_SYNTAX_ALF
    240188  Int m_suWidth;
    241189  Int m_suHeight;
     
    245193  Bool m_isNonCrossSlice;
    246194  Int m_alfQP;
    247 #endif
    248195
    249196private: //private member variables
     
    252199protected: //protected methods
    253200
    254 #if LCU_SYNTAX_ALF
    255201  Void createLCUAlfInfo();
    256202  Void destroyLCUAlfInfo();
     
    266212  Bool isEnabledComponent(ALFParam** alfLCUParam);
    267213  Int  getAlfPrecisionBit(Int qp);
    268 #if ALF_SINGLE_FILTER_SHAPE
    269214  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 #endif
    271215  Void calcOneRegionVar(Pel **imgYvar, Pel *imgYpad, Int stride, Bool isOnlyOneGroup, Int yPos, Int yPosEnd, Int xPos, Int xPosEnd);
    272 #endif
    273216
    274217
    275218  Void InitAlfLCUInfo(AlfLCUInfo& rAlfLCU, Int sliceID, Int tileID, TComDataCU* pcCU, UInt maxNumSUInLCU);
    276 #if !LCU_SYNTAX_ALF
    277   Void createRegionIndexMap(Pel **imgY_var, Int img_width, Int img_height); //!< create RA index for regions
    278   Void calcVar(Pel **imgYvar, Pel *imgYpad, Int stride, Int adaptationMode); //!< Calculate ALF grouping indices for block-based (BA) mode
    279   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 region
    280   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 region
    282   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 coefficients
    286 #endif
    287219  Void checkFilterCoeffValue( Int *filter, Int filterLength, Bool isChroma );
    288 #if !LCU_SYNTAX_ALF
    289   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 #endif
    295220  Void setAlfCtrlFlags(AlfCUCtrlInfo* pAlfParam, TComDataCU *pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt &idx);
    296221  Void transferCtrlFlagsFromAlfParam(std::vector<AlfCUCtrlInfo>& vAlfParamSlices); //!< Copy ALF CU control flags from ALF parameters for slices 
     
    299224  Void copyRegion(std::vector<AlfLCUInfo*> &vpAlfLCU, Pel* pPicDst, Pel* pPicSrc, Int stride, Int formatShift = 0);
    300225  Void extendRegionBorder(std::vector<AlfLCUInfo*> &vpAlfLCU, Pel* pPelSrc, Int stride, Int formatShift = 0);
    301 #if !LCU_SYNTAX_ALF 
    302   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 #endif
    305226  Int  getCtrlFlagsFromAlfParam(AlfLCUInfo* pcAlfLCU, Int iAlfDepth, UInt* puiFlags);
    306227
     
    317238  Void destroy ();
    318239
    319 #if LCU_SYNTAX_ALF
    320240  Void ALFProcess          (TComPic* pcPic, std::vector<AlfCUCtrlInfo>& vAlfCUCtrlParam, Bool isAlfCoefInSlice);
    321241  Void resetLCUAlfInfo     ();
     
    324244
    325245  ALFParam*** getAlfLCUParam() {return m_alfFiltInfo;}
    326 #else
    327   Void predictALFCoeffChroma  ( ALFParam* pAlfParam );                  //!< prediction of chroma ALF coefficients
    328 #if ALF_CHROMA_COEF_PRED_HARMONIZATION
    329   Void reconstructALFCoeffChroma( ALFParam* pAlfParam );
    330 #endif
    331   Void ALFProcess             ( TComPic* pcPic, ALFParam* pcAlfParam, std::vector<AlfCUCtrlInfo>& vAlfCUCtrlParam ); ///< interface function for ALF process
    332 
    333   Void allocALFParam  ( ALFParam* pAlfParam ); //!< allocate ALF parameters
    334   Void freeALFParam   ( ALFParam* pAlfParam ); //!< free ALF parameters
    335   Void copyALFParam   ( ALFParam* pDesAlfParam, ALFParam* pSrcAlfParam ); //!< copy ALF parameters
    336 #endif
    337246  Int  getNumCUsInPic()  {return m_uiNumCUsInFrame;} //!< get number of LCU in picture for ALF process
    338 #if LCU_SYNTAX_ALF
    339247  Void createPicAlfInfo (TComPic* pcPic, Int uiNumSlicesInPic = 1, Int alfQP = 26);
    340 #else
    341   Void createPicAlfInfo (TComPic* pcPic, Int numSlicesInPic = 1);
    342 #endif
    343248  Void destroyPicAlfInfo();
    344249
Note: See TracChangeset for help on using the changeset viewer.