Changeset 1313 in 3DVCSoftware for trunk/source/Lib/TLibCommon/TComSampleAdaptiveOffset.h
- Timestamp:
- 13 Aug 2015, 17:38:13 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/Lib/TLibCommon/TComSampleAdaptiveOffset.h
r1179 r1313 2 2 * License, included below. This software may be subject to other third party 3 3 * and contributor rights, including patent rights, and no such rights are 4 * granted under this license. 4 * granted under this license. 5 5 * 6 6 * Copyright (c) 2010-2015, ITU/ISO/IEC … … 45 45 //! \{ 46 46 47 47 48 // ==================================================================================================================== 48 49 // Constants 49 50 // ==================================================================================================================== 50 51 51 #define MAX_SAO_TRUNCATED_BITDEPTH 10 52 #define MAX_SAO_TRUNCATED_BITDEPTH 10 53 52 54 // ==================================================================================================================== 53 55 // Class definition 54 56 // ==================================================================================================================== 55 extern UInt g_saoMaxOffsetQVal[NUM_SAO_COMPONENTS];56 57 57 #if SAO_SGN_FUNC 58 template <typename T> int sgn(T val) 58 template <typename T> Int sgn(T val) 59 59 { 60 60 return (T(0) < val) - (val < T(0)); 61 61 } 62 #endif63 62 64 63 class TComSampleAdaptiveOffset … … 68 67 virtual ~TComSampleAdaptiveOffset(); 69 68 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 ); 71 70 Void destroy(); 72 71 Void reconstructBlkSAOParams(TComPic* pic, SAOBlkParam* saoBlkParams); 73 72 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 74 75 protected: 75 Void offsetBlock( Int compIdx, Int typeIdx, Int* offset, Pel* srcBlk, Pel* resBlk, Int srcStride, Int resStride, Int width, Int height76 Void offsetBlock(const Int channelBitDepth, Int typeIdx, Int* offset, Pel* srcBlk, Pel* resBlk, Int srcStride, Int resStride, Int width, Int height 76 77 , 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); 82 82 Void xPCMRestoration(TComPic* pcPic); 83 83 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); 85 85 protected: 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 91 87 TComPicYuv* m_tempPicYuv; //temporary buffer 92 88 Int m_picWidth; … … 97 93 Int m_numCTUInHeight; 98 94 Int m_numCTUsPic; 99 100 95 96 101 97 Int m_lineBufWidth; 102 98 Char* m_signLineBuf1; 103 99 Char* m_signLineBuf2; 100 ChromaFormat m_chromaFormatIDC; 104 101 private: 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]; 110 103 }; 111 104
Note: See TracChangeset for help on using the changeset viewer.