Ignore:
Timestamp:
13 Aug 2015, 17:38:13 (9 years ago)
Author:
tech
Message:

Merged 14.1-update-dev1@1312.

File:
1 edited

Legend:

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

    r1179 r1313  
    22 * License, included below. This software may be subject to other third party
    33 * and contributor rights, including patent rights, and no such rights are
    4  * granted under this license. 
     4 * granted under this license.
    55 *
    66 * Copyright (c) 2010-2015, ITU/ISO/IEC
     
    4545//! \{
    4646
     47
    4748// ====================================================================================================================
    4849// Constants
    4950// ====================================================================================================================
    5051
    51 #define MAX_SAO_TRUNCATED_BITDEPTH     10
     52#define MAX_SAO_TRUNCATED_BITDEPTH     10
     53
    5254// ====================================================================================================================
    5355// Class definition
    5456// ====================================================================================================================
    55 extern UInt g_saoMaxOffsetQVal[NUM_SAO_COMPONENTS];
    5657
    57 #if SAO_SGN_FUNC
    58 template <typename T> int sgn(T val)
     58template <typename T> Int sgn(T val)
    5959{
    6060  return (T(0) < val) - (val < T(0));
    6161}
    62 #endif
    6362
    6463class TComSampleAdaptiveOffset
     
    6867  virtual ~TComSampleAdaptiveOffset();
    6968  Void SAOProcess(TComPic* pDecPic);
    70   Void create( Int picWidth, Int picHeight, UInt maxCUWidth, UInt maxCUHeight, UInt maxCUDepth );
     69  Void create( Int picWidth, Int picHeight, ChromaFormat format, UInt maxCUWidth, UInt maxCUHeight, UInt maxCUDepth, UInt lumaBitShift, UInt chromaBitShift );
    7170  Void destroy();
    7271  Void reconstructBlkSAOParams(TComPic* pic, SAOBlkParam* saoBlkParams);
    7372  Void PCMLFDisableProcess (TComPic* pcPic);
     73  static Int getMaxOffsetQVal(const Int channelBitDepth) { return (1<<(std::min<Int>(channelBitDepth,MAX_SAO_TRUNCATED_BITDEPTH)-5))-1; } //Table 9-32, inclusive
     74
    7475protected:
    75   Void offsetBlock(Int compIdx, Int typeIdx, Int* offset, Pel* srcBlk, Pel* resBlk, Int srcStride, Int resStride,  Int width, Int height
     76  Void offsetBlock(const Int channelBitDepth, Int typeIdx, Int* offset, Pel* srcBlk, Pel* resBlk, Int srcStride, Int resStride,  Int width, Int height
    7677                  , Bool isLeftAvail, Bool isRightAvail, Bool isAboveAvail, Bool isBelowAvail, Bool isAboveLeftAvail, Bool isAboveRightAvail, Bool isBelowLeftAvail, Bool isBelowRightAvail);
    77   Pel* getPicBuf(TComPicYuv* pPicYuv, Int compIdx);
    78   Void invertQuantOffsets(Int compIdx, Int typeIdc, Int typeAuxInfo, Int* dstOffsets, Int* srcOffsets);
    79   Void reconstructBlkSAOParam(SAOBlkParam& recParam, std::vector<SAOBlkParam*>& mergeList);
    80   Int  getMergeList(TComPic* pic, Int ctu, SAOBlkParam* blkParams, std::vector<SAOBlkParam*>& mergeList);
    81   Void offsetCTU(Int ctu, TComPicYuv* srcYuv, TComPicYuv* resYuv, SAOBlkParam& saoblkParam, TComPic* pPic);
     78  Void invertQuantOffsets(ComponentID compIdx, Int typeIdc, Int typeAuxInfo, Int* dstOffsets, Int* srcOffsets);
     79  Void reconstructBlkSAOParam(SAOBlkParam& recParam, SAOBlkParam* mergeList[NUM_SAO_MERGE_TYPES]);
     80  Int  getMergeList(TComPic* pic, Int ctuRsAddr, SAOBlkParam* blkParams, SAOBlkParam* mergeList[NUM_SAO_MERGE_TYPES]);
     81  Void offsetCTU(Int ctuRsAddr, TComPicYuv* srcYuv, TComPicYuv* resYuv, SAOBlkParam& saoblkParam, TComPic* pPic);
    8282  Void xPCMRestoration(TComPic* pcPic);
    8383  Void xPCMCURestoration ( TComDataCU* pcCU, UInt uiAbsZorderIdx, UInt uiDepth );
    84   Void xPCMSampleRestoration (TComDataCU* pcCU, UInt uiAbsZorderIdx, UInt uiDepth, TextType ttText);
     84  Void xPCMSampleRestoration (TComDataCU* pcCU, UInt uiAbsZorderIdx, UInt uiDepth, const ComponentID compID);
    8585protected:
    86   UInt m_offsetStepLog2[NUM_SAO_COMPONENTS]; //offset step 
    87   Int* m_offsetClip[NUM_SAO_COMPONENTS]; //clip table for fast operation
    88 #if !SAO_SGN_FUNC
    89   Short* m_sign; //sign table for fast operation
    90 #endif
     86  UInt m_offsetStepLog2[MAX_NUM_COMPONENT]; //offset step
    9187  TComPicYuv*   m_tempPicYuv; //temporary buffer
    9288  Int m_picWidth;
     
    9793  Int m_numCTUInHeight;
    9894  Int m_numCTUsPic;
    99  
    100  
     95
     96
    10197  Int m_lineBufWidth;
    10298  Char* m_signLineBuf1;
    10399  Char* m_signLineBuf2;
     100  ChromaFormat m_chromaFormatIDC;
    104101private:
    105   Bool m_picSAOEnabled[NUM_SAO_COMPONENTS];
    106   Int*   m_offsetClipTable[NUM_SAO_COMPONENTS];
    107 #if !SAO_SGN_FUNC
    108   Short* m_signTable;
    109 #endif
     102  Bool m_picSAOEnabled[MAX_NUM_COMPONENT];
    110103};
    111104
Note: See TracChangeset for help on using the changeset viewer.