Ignore:
Timestamp:
27 Mar 2014, 10:11:29 (10 years ago)
Author:
tech
Message:

Merged HTM-10.0-dev0@871. (MV-HEVC 7 HLS)

File:
1 edited

Legend:

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

    r608 r872  
    44 * granted under this license. 
    55 *
    6  * Copyright (c) 2010-2013, ITU/ISO/IEC
     6 * Copyright (c) 2010-2014, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    4949// ====================================================================================================================
    5050
    51 #define SAO_MAX_DEPTH                 4
    52 #define SAO_BO_BITS                   5
    53 #define LUMA_GROUP_NUM                (1<<SAO_BO_BITS)
    54 #define MAX_NUM_SAO_OFFSETS           4
    55 #define MAX_NUM_SAO_CLASS             33
     51#define MAX_SAO_TRUNCATED_BITDEPTH     10
    5652// ====================================================================================================================
    5753// Class definition
    5854// ====================================================================================================================
     55extern UInt g_saoMaxOffsetQVal[NUM_SAO_COMPONENTS];
    5956
    60 /// Sample Adaptive Offset class
    6157class TComSampleAdaptiveOffset
    6258{
     59public:
     60  TComSampleAdaptiveOffset();
     61  virtual ~TComSampleAdaptiveOffset();
     62  Void SAOProcess(TComPic* pDecPic);
     63  Void create( Int picWidth, Int picHeight, UInt maxCUWidth, UInt maxCUHeight, UInt maxCUDepth );
     64  Void destroy();
     65  Void reconstructBlkSAOParams(TComPic* pic, SAOBlkParam* saoBlkParams);
     66  Void PCMLFDisableProcess (TComPic* pcPic);
    6367protected:
    64   TComPic*          m_pcPic;
     68  Void offsetBlock(Int compIdx, Int typeIdx, Int* offset, Pel* srcBlk, Pel* resBlk, Int srcStride, Int resStride,  Int width, Int height
     69                  , Bool isLeftAvail, Bool isRightAvail, Bool isAboveAvail, Bool isBelowAvail, Bool isAboveLeftAvail, Bool isAboveRightAvail, Bool isBelowLeftAvail, Bool isBelowRightAvail);
     70  Pel* getPicBuf(TComPicYuv* pPicYuv, Int compIdx);
     71  Void invertQuantOffsets(Int compIdx, Int typeIdc, Int typeAuxInfo, Int* dstOffsets, Int* srcOffsets);
     72  Void reconstructBlkSAOParam(SAOBlkParam& recParam, std::vector<SAOBlkParam*>& mergeList);
     73  Int  getMergeList(TComPic* pic, Int ctu, SAOBlkParam* blkParams, std::vector<SAOBlkParam*>& mergeList);
     74  Void offsetCTU(Int ctu, TComPicYuv* srcYuv, TComPicYuv* resYuv, SAOBlkParam& saoblkParam, TComPic* pPic);
     75  Void xPCMRestoration(TComPic* pcPic);
     76  Void xPCMCURestoration ( TComDataCU* pcCU, UInt uiAbsZorderIdx, UInt uiDepth );
     77  Void xPCMSampleRestoration (TComDataCU* pcCU, UInt uiAbsZorderIdx, UInt uiDepth, TextType ttText);
     78protected:
     79  UInt m_offsetStepLog2[NUM_SAO_COMPONENTS]; //offset step 
     80  Int* m_offsetClip[NUM_SAO_COMPONENTS]; //clip table for fast operation
     81  Short* m_sign; //sign table for fast operation
     82  TComPicYuv*   m_tempPicYuv; //temporary buffer
     83  Int m_picWidth;
     84  Int m_picHeight;
     85  Int m_maxCUWidth;
     86  Int m_maxCUHeight;
     87  Int m_numCTUInWidth;
     88  Int m_numCTUInHeight;
     89  Int m_numCTUsPic;
     90 
     91 
     92  Int m_lineBufWidth;
     93  Char* m_signLineBuf1;
     94  Char* m_signLineBuf2;
     95private:
     96  Bool m_picSAOEnabled[NUM_SAO_COMPONENTS];
     97  Int*   m_offsetClipTable[NUM_SAO_COMPONENTS];
     98  Short* m_signTable;
    6599
    66   static const UInt m_uiMaxDepth;
    67   static const Int m_aiNumCulPartsLevel[5];
    68   static const UInt m_auiEoTable[9];
    69   Int *m_iOffsetBo;
    70   Int *m_iChromaOffsetBo;
    71   Int m_iOffsetEo[LUMA_GROUP_NUM];
    72 
    73   Int  m_iPicWidth;
    74   Int  m_iPicHeight;
    75   UInt m_uiMaxSplitLevel;
    76   UInt m_uiMaxCUWidth;
    77   UInt m_uiMaxCUHeight;
    78   Int  m_iNumCuInWidth;
    79   Int  m_iNumCuInHeight;
    80   Int  m_iNumTotalParts;
    81   static const Int m_iNumClass[MAX_NUM_SAO_TYPE];
    82 
    83   UInt m_uiSaoBitIncreaseY;
    84   UInt m_uiSaoBitIncreaseC;  //for chroma
    85   UInt m_uiQP;
    86 
    87   Pel   *m_pClipTable;
    88   Pel   *m_pClipTableBase;
    89   Pel   *m_lumaTableBo;
    90   Pel   *m_pChromaClipTable;
    91   Pel   *m_pChromaClipTableBase;
    92   Pel   *m_chromaTableBo;
    93   Int   *m_iUpBuff1;
    94   Int   *m_iUpBuff2;
    95   Int   *m_iUpBufft;
    96   Int   *ipSwap;
    97   Bool  m_bUseNIF;       //!< true for performing non-cross slice boundary ALF
    98   TComPicYuv* m_pcYuvTmp;    //!< temporary picture buffer pointer when non-across slice/tile boundary SAO is enabled
    99 
    100   Pel* m_pTmpU1;
    101   Pel* m_pTmpU2;
    102   Pel* m_pTmpL1;
    103   Pel* m_pTmpL2;
    104   Int     m_maxNumOffsetsPerPic;
    105   Bool    m_saoLcuBoundary;
    106   Bool    m_saoLcuBasedOptimization;
    107 
    108   Void xPCMRestoration        (TComPic* pcPic);
    109   Void xPCMCURestoration      (TComDataCU* pcCU, UInt uiAbsZorderIdx, UInt uiDepth);
    110   Void xPCMSampleRestoration  (TComDataCU* pcCU, UInt uiAbsZorderIdx, UInt uiDepth, TextType ttText);
    111 public:
    112   TComSampleAdaptiveOffset         ();
    113   virtual ~TComSampleAdaptiveOffset();
    114 
    115   Void create( UInt uiSourceWidth, UInt uiSourceHeight, UInt uiMaxCUWidth, UInt uiMaxCUHeight );
    116   Void destroy ();
    117 
    118   Int  convertLevelRowCol2Idx(Int level, Int row, Int col);
    119 
    120   Void initSAOParam   (SAOParam *pcSaoParam, Int iPartLevel, Int iPartRow, Int iPartCol, Int iParentPartIdx, Int StartCUX, Int EndCUX, Int StartCUY, Int EndCUY, Int iYCbCr);
    121   Void allocSaoParam  (SAOParam* pcSaoParam);
    122   Void resetSAOParam  (SAOParam *pcSaoParam);
    123   static Void freeSaoParam   (SAOParam *pcSaoParam);
    124  
    125   Void SAOProcess(SAOParam* pcSaoParam);
    126   Void processSaoCu(Int iAddr, Int iSaoType, Int iYCbCr);
    127   Pel* getPicYuvAddr(TComPicYuv* pcPicYuv, Int iYCbCr,Int iAddr = 0);
    128 
    129   Void processSaoCuOrg(Int iAddr, Int iPartIdx, Int iYCbCr);  //!< LCU-basd SAO process without slice granularity
    130   Void createPicSaoInfo(TComPic* pcPic);
    131   Void destroyPicSaoInfo();
    132   Void processSaoBlock(Pel* pDec, Pel* pRest, Int stride, Int iSaoType, UInt width, UInt height, Bool* pbBorderAvail, Int iYCbCr);
    133 
    134   Void resetLcuPart(SaoLcuParam* saoLcuParam);
    135   Void convertQT2SaoUnit(SAOParam* saoParam, UInt partIdx, Int yCbCr);
    136   Void convertOnePart2SaoUnit(SAOParam *saoParam, UInt partIdx, Int yCbCr);
    137   Void processSaoUnitAll(SaoLcuParam* saoLcuParam, Bool oneUnitFlag, Int yCbCr);
    138   Void setSaoLcuBoundary (Bool bVal)  {m_saoLcuBoundary = bVal;}
    139   Bool getSaoLcuBoundary ()           {return m_saoLcuBoundary;}
    140   Void setSaoLcuBasedOptimization (Bool bVal)  {m_saoLcuBasedOptimization = bVal;}
    141   Bool getSaoLcuBasedOptimization ()           {return m_saoLcuBasedOptimization;}
    142   Void resetSaoUnit(SaoLcuParam* saoUnit);
    143   Void copySaoUnit(SaoLcuParam* saoUnitDst, SaoLcuParam* saoUnitSrc );
    144   Void PCMLFDisableProcess    ( TComPic* pcPic);                        ///< interface function for ALF process
    145100};
    146101
Note: See TracChangeset for help on using the changeset viewer.