Changeset 1313 in 3DVCSoftware for trunk/source/Lib/TLibEncoder/TEncSampleAdaptiveOffset.h
- Timestamp:
- 13 Aug 2015, 17:38:13 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/Lib/TLibEncoder/TEncSampleAdaptiveOffset.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 … … 32 32 */ 33 33 34 /** 34 /** 35 35 \file TEncSampleAdaptiveOffset.h 36 36 \brief estimation part of sample adaptive offset class (header) … … 82 82 return *this; 83 83 } 84 #if SAO_ENCODE_ALLOW_USE_PREDEBLOCK85 84 const SAOStatData& operator+= (const SAOStatData& src) 86 85 { … … 92 91 return *this; 93 92 } 94 #endif95 93 }; 96 94 … … 102 100 103 101 //interface 104 #if SAO_ENCODE_ALLOW_USE_PREDEBLOCK105 102 Void createEncData(Bool isPreDBFSamplesUsed); 106 #else107 Void createEncData();108 #endif109 103 Void destroyEncData(); 110 104 Void initRDOCabacCoder(TEncSbac* pcRDGoOnSbacCoder, TComSlice* pcSlice) ; 111 Void SAOProcess(TComPic* pPic, Bool* sliceEnabled, const Double *lambdas 112 #if SAO_ENCODE_ALLOW_USE_PREDEBLOCK 113 , Bool isPreDBFSamplesUsed 114 #endif 115 ); 105 Void SAOProcess(TComPic* pPic, Bool* sliceEnabled, const Double *lambdas, const Bool bTestSAODisableAtPictureLevel, const Double saoEncodingRate, const Double saoEncodingRateChroma, Bool isPreDBFSamplesUsed); 116 106 public: //methods 117 #if SAO_ENCODE_ALLOW_USE_PREDEBLOCK 118 Void getPreDBFStatistics(TComPic* pPic); 119 #endif 107 Void getPreDBFStatistics(TComPic* pPic); 120 108 private: //methods 121 Void getStatistics(SAOStatData*** blkStats, TComPicYuv* orgYuv, TComPicYuv* srcYuv,TComPic* pPic 122 #if SAO_ENCODE_ALLOW_USE_PREDEBLOCK 123 , Bool isCalculatePreDeblockSamples = false 124 #endif 125 ); 126 Void decidePicParams(Bool* sliceEnabled, Int picTempLayer); 127 Void decideBlkParams(TComPic* pic, Bool* sliceEnabled, SAOStatData*** blkStats, TComPicYuv* srcYuv, TComPicYuv* resYuv, SAOBlkParam* reconParams, SAOBlkParam* codedParams); 128 Void getBlkStats(Int compIdx, SAOStatData* statsDataTypes, Pel* srcBlk, Pel* orgBlk, Int srcStride, Int orgStride, Int width, Int height, Bool isLeftAvail, Bool isRightAvail, Bool isAboveAvail, Bool isBelowAvail, Bool isAboveLeftAvail, Bool isAboveRightAvail, Bool isBelowLeftAvail, Bool isBelowRightAvail 129 #if SAO_ENCODE_ALLOW_USE_PREDEBLOCK 130 , Bool isCalculatePreDeblockSamples 131 #endif 132 ); 133 Void deriveModeNewRDO(Int ctu, std::vector<SAOBlkParam*>& mergeList, Bool* sliceEnabled, SAOStatData*** blkStats, SAOBlkParam& modeParam, Double& modeNormCost, TEncSbac** cabacCoderRDO, Int inCabacLabel); 134 Void deriveModeMergeRDO(Int ctu, std::vector<SAOBlkParam*>& mergeList, Bool* sliceEnabled, SAOStatData*** blkStats, SAOBlkParam& modeParam, Double& modeNormCost, TEncSbac** cabacCoderRDO, Int inCabacLabel); 135 Int64 getDistortion(Int ctu, Int compIdx, Int typeIdc, Int typeAuxInfo, Int* offsetVal, SAOStatData& statData); 136 Void deriveOffsets(Int ctu, Int compIdx, Int typeIdc, SAOStatData& statData, Int* quantOffsets, Int& typeAuxInfo); 109 Void getStatistics(SAOStatData*** blkStats, TComPicYuv* orgYuv, TComPicYuv* srcYuv,TComPic* pPic, Bool isCalculatePreDeblockSamples = false); 110 Void decidePicParams(Bool* sliceEnabled, Int picTempLayer, const Double saoEncodingRate, const Double saoEncodingRateChroma); 111 Void decideBlkParams(TComPic* pic, Bool* sliceEnabled, SAOStatData*** blkStats, TComPicYuv* srcYuv, TComPicYuv* resYuv, SAOBlkParam* reconParams, SAOBlkParam* codedParams, const Bool bTestSAODisableAtPictureLevel, const Double saoEncodingRate, const Double saoEncodingRateChroma); 112 Void getBlkStats(const ComponentID compIdx, const Int channelBitDepth, SAOStatData* statsDataTypes, Pel* srcBlk, Pel* orgBlk, Int srcStride, Int orgStride, Int width, Int height, Bool isLeftAvail, Bool isRightAvail, Bool isAboveAvail, Bool isBelowAvail, Bool isAboveLeftAvail, Bool isAboveRightAvail, Bool isCalculatePreDeblockSamples); 113 Void deriveModeNewRDO(const BitDepths &bitDepths, Int ctuRsAddr, SAOBlkParam* mergeList[NUM_SAO_MERGE_TYPES], Bool* sliceEnabled, SAOStatData*** blkStats, SAOBlkParam& modeParam, Double& modeNormCost, TEncSbac** cabacCoderRDO, Int inCabacLabel); 114 Void deriveModeMergeRDO(const BitDepths &bitDepths, Int ctuRsAddr, SAOBlkParam* mergeList[NUM_SAO_MERGE_TYPES], Bool* sliceEnabled, SAOStatData*** blkStats, SAOBlkParam& modeParam, Double& modeNormCost, TEncSbac** cabacCoderRDO, Int inCabacLabel); 115 Int64 getDistortion(const Int channelBitDepth, Int typeIdc, Int typeAuxInfo, Int* offsetVal, SAOStatData& statData); 116 Void deriveOffsets(ComponentID compIdx, const Int channelBitDepth, Int typeIdc, SAOStatData& statData, Int* quantOffsets, Int& typeAuxInfo); 137 117 inline Int64 estSaoDist(Int64 count, Int64 offset, Int64 diffSum, Int shift); 138 inline Int estIterOffset(Int typeIdx, Int classIdx, Double lambda, Int offsetInput, Int64 count, Int64 diffSum, Int shift, Int bitIncrease, Int64& bestDist, Double& bestCost, Int offsetTh ); 139 #if SAO_ENCODE_ALLOW_USE_PREDEBLOCK 118 inline Int estIterOffset(Int typeIdx, Double lambda, Int offsetInput, Int64 count, Int64 diffSum, Int shift, Int bitIncrease, Int64& bestDist, Double& bestCost, Int offsetTh ); 140 119 Void addPreDBFStatistics(SAOStatData*** blkStats); 141 #endif142 120 private: //members 143 121 //for RDO 144 TEncSbac** m_pppcRDSbacCoder; 122 TEncSbac** m_pppcRDSbacCoder; 145 123 TEncSbac* m_pcRDGoOnSbacCoder; 146 TEncBinCABACCounter** m_pppcBinCoderCABAC; 147 Double m_lambda[NUM_SAO_COMPONENTS]; 124 #if FAST_BIT_EST 125 TEncBinCABACCounter** m_pppcBinCoderCABAC; 126 #else 127 TEncBinCABAC** m_pppcBinCoderCABAC; 128 #endif 129 Double m_lambda[MAX_NUM_COMPONENT]; 148 130 149 131 //statistics 150 132 SAOStatData*** m_statData; //[ctu][comp][classes] 151 #if SAO_ENCODE_ALLOW_USE_PREDEBLOCK152 133 SAOStatData*** m_preDBFstatData; 153 #endif 154 #if SAO_ENCODING_CHOICE 155 Double m_saoDisabledRate[NUM_SAO_COMPONENTS][MAX_TLAYER]; 156 #endif 157 Int m_skipLinesR[NUM_SAO_COMPONENTS][NUM_SAO_NEW_TYPES]; 158 Int m_skipLinesB[NUM_SAO_COMPONENTS][NUM_SAO_NEW_TYPES]; 134 Double m_saoDisabledRate[MAX_NUM_COMPONENT][MAX_TLAYER]; 135 Int m_skipLinesR[MAX_NUM_COMPONENT][NUM_SAO_NEW_TYPES]; 136 Int m_skipLinesB[MAX_NUM_COMPONENT][NUM_SAO_NEW_TYPES]; 159 137 }; 138 139 160 140 //! \} 161 141
Note: See TracChangeset for help on using the changeset viewer.