1 | /* The copyright in this software is being made available under the BSD |
---|
2 | * License, included below. This software may be subject to other third party |
---|
3 | * and contributor rights, including patent rights, and no such rights are |
---|
4 | * granted under this license. |
---|
5 | * |
---|
6 | * Copyright (c) 2010-2012, ITU/ISO/IEC |
---|
7 | * All rights reserved. |
---|
8 | * |
---|
9 | * Redistribution and use in source and binary forms, with or without |
---|
10 | * modification, are permitted provided that the following conditions are met: |
---|
11 | * |
---|
12 | * * Redistributions of source code must retain the above copyright notice, |
---|
13 | * this list of conditions and the following disclaimer. |
---|
14 | * * Redistributions in binary form must reproduce the above copyright notice, |
---|
15 | * this list of conditions and the following disclaimer in the documentation |
---|
16 | * and/or other materials provided with the distribution. |
---|
17 | * * Neither the name of the ITU/ISO/IEC nor the names of its contributors may |
---|
18 | * be used to endorse or promote products derived from this software without |
---|
19 | * specific prior written permission. |
---|
20 | * |
---|
21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
---|
22 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
---|
23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
---|
24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS |
---|
25 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
---|
26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
---|
27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
---|
28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
---|
29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
---|
30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF |
---|
31 | * THE POSSIBILITY OF SUCH DAMAGE. |
---|
32 | */ |
---|
33 | |
---|
34 | /** \file TEncEntropy.h |
---|
35 | \brief entropy encoder class (header) |
---|
36 | */ |
---|
37 | |
---|
38 | #ifndef __TENCENTROPY__ |
---|
39 | #define __TENCENTROPY__ |
---|
40 | |
---|
41 | #include "TLibCommon/TComSlice.h" |
---|
42 | #include "TLibCommon/TComDataCU.h" |
---|
43 | #include "TLibCommon/TComBitStream.h" |
---|
44 | #include "TLibCommon/ContextModel.h" |
---|
45 | #include "TLibCommon/TComPic.h" |
---|
46 | #include "TLibCommon/TComTrQuant.h" |
---|
47 | #include "TLibCommon/TComAdaptiveLoopFilter.h" |
---|
48 | #include "TLibCommon/TComSampleAdaptiveOffset.h" |
---|
49 | |
---|
50 | class TEncSbac; |
---|
51 | class TEncCavlc; |
---|
52 | class SEI; |
---|
53 | |
---|
54 | // ==================================================================================================================== |
---|
55 | // Class definition |
---|
56 | // ==================================================================================================================== |
---|
57 | |
---|
58 | /// entropy encoder pure class |
---|
59 | class TEncEntropyIf |
---|
60 | { |
---|
61 | public: |
---|
62 | virtual Bool getAlfCtrl() = 0; |
---|
63 | virtual UInt getMaxAlfCtrlDepth() = 0; |
---|
64 | virtual Void setAlfCtrl(Bool bAlfCtrl) = 0; |
---|
65 | virtual Void setMaxAlfCtrlDepth(UInt uiMaxAlfCtrlDepth) = 0; |
---|
66 | |
---|
67 | virtual Void resetEntropy () = 0; |
---|
68 | #if CABAC_INIT_FLAG |
---|
69 | virtual Void determineCabacInitIdx () = 0; |
---|
70 | #endif |
---|
71 | virtual Void setBitstream ( TComBitIf* p ) = 0; |
---|
72 | virtual Void setSlice ( TComSlice* p ) = 0; |
---|
73 | virtual Void resetBits () = 0; |
---|
74 | virtual Void resetCoeffCost () = 0; |
---|
75 | virtual UInt getNumberOfWrittenBits() = 0; |
---|
76 | virtual UInt getCoeffCost () = 0; |
---|
77 | |
---|
78 | #if VIDYO_VPS_INTEGRATION |
---|
79 | virtual Void codeVPS ( TComVPS* pcVPS ) = 0; |
---|
80 | #endif |
---|
81 | |
---|
82 | #if HHI_MPI |
---|
83 | virtual Void codeSPS ( TComSPS* pcSPS, Bool bIsDepth ) = 0; |
---|
84 | #else |
---|
85 | virtual Void codeSPS ( TComSPS* pcSPS ) = 0; |
---|
86 | #endif |
---|
87 | virtual Void codePPS ( TComPPS* pcPPS ) = 0; |
---|
88 | virtual void codeSEI(const SEI&) = 0; |
---|
89 | virtual Void codeSliceHeader ( TComSlice* pcSlice ) = 0; |
---|
90 | virtual Void codeTileMarkerFlag ( TComSlice* pcSlice ) = 0; |
---|
91 | |
---|
92 | #if TILES_WPP_ENTRY_POINT_SIGNALLING |
---|
93 | virtual Void codeTilesWPPEntryPoint ( TComSlice* pSlice ) = 0; |
---|
94 | #else |
---|
95 | virtual Void codeSliceHeaderSubstreamTable( TComSlice* pcSlice ) = 0; |
---|
96 | #endif |
---|
97 | virtual Void codeTerminatingBit ( UInt uilsLast ) = 0; |
---|
98 | virtual Void codeSliceFinish () = 0; |
---|
99 | #if OL_FLUSH |
---|
100 | virtual Void codeFlush () = 0; |
---|
101 | virtual Void encodeStart () = 0; |
---|
102 | #endif |
---|
103 | |
---|
104 | virtual Void codeAlfCtrlDepth() = 0; |
---|
105 | #if HHI_INTER_VIEW_MOTION_PRED |
---|
106 | virtual Void codeMVPIdx ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefList, Int iNum ) = 0; |
---|
107 | #else |
---|
108 | virtual Void codeMVPIdx ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefList ) = 0; |
---|
109 | #endif |
---|
110 | virtual Void codeScalingList ( TComScalingList* scalingList ) = 0; |
---|
111 | |
---|
112 | public: |
---|
113 | virtual Void codeAlfCtrlFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; |
---|
114 | virtual Void codeApsExtensionFlag () = 0; |
---|
115 | |
---|
116 | virtual Void codeSkipFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; |
---|
117 | #if LGE_ILLUCOMP_B0045 |
---|
118 | virtual Void codeICFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; |
---|
119 | #endif |
---|
120 | virtual Void codeMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; |
---|
121 | virtual Void codeMergeIndex ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; |
---|
122 | #if HHI_INTER_VIEW_RESIDUAL_PRED |
---|
123 | virtual Void codeResPredFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; |
---|
124 | #endif |
---|
125 | virtual Void codeSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; |
---|
126 | |
---|
127 | virtual Void codePartSize ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; |
---|
128 | virtual Void codePredMode ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; |
---|
129 | |
---|
130 | #if BURST_IPCM |
---|
131 | virtual Void codeIPCMInfo ( TComDataCU* pcCU, UInt uiAbsPartIdx, Int numIPCM, Bool firstIPCMFlag) = 0; |
---|
132 | #else |
---|
133 | virtual Void codeIPCMInfo ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; |
---|
134 | #endif |
---|
135 | |
---|
136 | virtual Void codeTransformSubdivFlag( UInt uiSymbol, UInt uiCtx ) = 0; |
---|
137 | virtual Void codeQtCbf ( TComDataCU* pcCU, UInt uiAbsPartIdx, TextType eType, UInt uiTrDepth ) = 0; |
---|
138 | virtual Void codeQtRootCbf ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; |
---|
139 | virtual Void codeIntraDirLumaAng( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; |
---|
140 | |
---|
141 | virtual Void codeIntraDirChroma( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; |
---|
142 | virtual Void codeInterDir ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; |
---|
143 | virtual Void codeRefFrmIdx ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefList ) = 0; |
---|
144 | virtual Void codeMvd ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefList ) = 0; |
---|
145 | virtual Void codeDeltaQP ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; |
---|
146 | virtual Void codeCoeffNxN ( TComDataCU* pcCU, TCoeff* pcCoef, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, UInt uiDepth, TextType eTType ) = 0; |
---|
147 | |
---|
148 | virtual Void codeAlfFlag ( UInt uiCode ) = 0; |
---|
149 | virtual Void codeAlfUvlc ( UInt uiCode ) = 0; |
---|
150 | virtual Void codeAlfSvlc ( Int iCode ) = 0; |
---|
151 | #if LCU_SYNTAX_ALF |
---|
152 | virtual Void codeAlfFixedLengthIdx( UInt idx, UInt numFilterSetsInBuffer) = 0; |
---|
153 | virtual Void codeAPSAlflag(UInt uiCode) = 0; |
---|
154 | #endif |
---|
155 | /// set slice granularity |
---|
156 | virtual Void setSliceGranularity(Int iSliceGranularity) = 0; |
---|
157 | |
---|
158 | /// get slice granularity |
---|
159 | virtual Int getSliceGranularity() = 0; |
---|
160 | |
---|
161 | virtual Void codeAlfCtrlFlag ( UInt uiSymbol ) = 0; |
---|
162 | virtual Void codeSaoFlag ( UInt uiCode ) = 0; |
---|
163 | virtual Void codeSaoUvlc ( UInt uiCode ) = 0; |
---|
164 | virtual Void codeSaoSvlc ( Int iCode ) = 0; |
---|
165 | #if SAO_UNIT_INTERLEAVING |
---|
166 | virtual Void codeSaoRun ( UInt uiCode, UInt uiMaxValue ) = 0; |
---|
167 | virtual Void codeSaoMergeLeft ( UInt uiCode, UInt uiCompIdx ) = 0; |
---|
168 | virtual Void codeSaoMergeUp ( UInt uiCode) = 0; |
---|
169 | virtual Void codeSaoTypeIdx ( UInt uiCode) = 0; |
---|
170 | virtual Void codeSaoUflc ( UInt uiCode) = 0; |
---|
171 | #endif |
---|
172 | virtual Void estBit (estBitsSbacStruct* pcEstBitsSbac, Int width, Int height, TextType eTType) = 0; |
---|
173 | |
---|
174 | virtual Void updateContextTables ( SliceType eSliceType, Int iQp, Bool bExecuteFinish ) = 0; |
---|
175 | virtual Void updateContextTables ( SliceType eSliceType, Int iQp ) = 0; |
---|
176 | virtual Void writeTileMarker ( UInt uiTileIdx, UInt uiBitsUsed ) = 0; |
---|
177 | |
---|
178 | virtual Void codeAPSInitInfo (TComAPS* pcAPS)= 0; |
---|
179 | virtual Void codeFinish (Bool bEnd)= 0; |
---|
180 | |
---|
181 | virtual Void codeDFFlag (UInt uiCode, const Char *pSymbolName) = 0; |
---|
182 | virtual Void codeDFSvlc (Int iCode, const Char *pSymbolName) = 0; |
---|
183 | |
---|
184 | virtual ~TEncEntropyIf() {} |
---|
185 | |
---|
186 | }; |
---|
187 | |
---|
188 | /// entropy encoder class |
---|
189 | class TEncEntropy |
---|
190 | { |
---|
191 | private: |
---|
192 | UInt m_uiBakAbsPartIdx; |
---|
193 | UInt m_uiBakChromaOffset; |
---|
194 | #if UNIFIED_TRANSFORM_TREE |
---|
195 | UInt m_bakAbsPartIdxCU; |
---|
196 | #endif |
---|
197 | |
---|
198 | public: |
---|
199 | Void setEntropyCoder ( TEncEntropyIf* e, TComSlice* pcSlice ); |
---|
200 | Void setBitstream ( TComBitIf* p ) { m_pcEntropyCoderIf->setBitstream(p); } |
---|
201 | Void resetBits () { m_pcEntropyCoderIf->resetBits(); } |
---|
202 | Void resetCoeffCost () { m_pcEntropyCoderIf->resetCoeffCost(); } |
---|
203 | UInt getNumberOfWrittenBits () { return m_pcEntropyCoderIf->getNumberOfWrittenBits(); } |
---|
204 | UInt getCoeffCost () { return m_pcEntropyCoderIf->getCoeffCost(); } |
---|
205 | Void resetEntropy () { m_pcEntropyCoderIf->resetEntropy(); } |
---|
206 | #if CABAC_INIT_FLAG |
---|
207 | Void determineCabacInitIdx () { m_pcEntropyCoderIf->determineCabacInitIdx(); } |
---|
208 | #endif |
---|
209 | |
---|
210 | Void encodeSliceHeader ( TComSlice* pcSlice ); |
---|
211 | Void encodeTileMarkerFlag (TComSlice* pcSlice) {m_pcEntropyCoderIf->codeTileMarkerFlag(pcSlice);} |
---|
212 | #if TILES_WPP_ENTRY_POINT_SIGNALLING |
---|
213 | Void encodeTilesWPPEntryPoint( TComSlice* pSlice ); |
---|
214 | #else |
---|
215 | Void encodeSliceHeaderSubstreamTable( TComSlice* pcSlice ); |
---|
216 | #endif |
---|
217 | Void encodeTerminatingBit ( UInt uiIsLast ); |
---|
218 | Void encodeSliceFinish (); |
---|
219 | #if OL_FLUSH |
---|
220 | Void encodeFlush (); |
---|
221 | Void encodeStart (); |
---|
222 | #endif |
---|
223 | #if LCU_SYNTAX_ALF |
---|
224 | Void encodeAlfFlag(UInt code) {m_pcEntropyCoderIf->codeAlfFlag(code);} |
---|
225 | Void encodeAlfStoredFilterSetIdx(UInt idx, UInt numFilterSetsInBuffer); |
---|
226 | Void encodeAlfFixedLengthRun(UInt run, UInt rx, UInt numLCUInWidth); |
---|
227 | Void encodeAlfParam(AlfParamSet* pAlfParamSet, Bool bSentInAPS = true, Int firstLCUAddr = 0, Bool alfAcrossSlice= true); |
---|
228 | Void encodeAlfParamSet(AlfParamSet* pAlfParamSet, Int numLCUInWidth, Int numLCU, Int firstLCUAddr, Bool alfAcrossSlice, Int startCompIdx, Int endCompIdx); |
---|
229 | Bool getAlfRepeatRowFlag(Int compIdx, AlfParamSet* pAlfParamSet, Int lcuIdx, Int lcuPos, Int startlcuPosX, Int endlcuPosX, Int numLCUInWidth); |
---|
230 | Int getAlfRun(Int compIdx, AlfParamSet* pAlfParamSet, Int lcuIdxInSlice, Int lcuPos, Int startlcuPosX, Int endlcuPosX); |
---|
231 | Void encodeAPSAlfFlag(UInt code) {m_pcEntropyCoderIf->codeAPSAlflag(code);} |
---|
232 | #endif |
---|
233 | Void encodeAlfParam(ALFParam* pAlfParam); |
---|
234 | |
---|
235 | TEncEntropyIf* m_pcEntropyCoderIf; |
---|
236 | |
---|
237 | public: |
---|
238 | #if VIDYO_VPS_INTEGRATION |
---|
239 | Void encodeVPS ( TComVPS* pcVPS); |
---|
240 | #endif |
---|
241 | // SPS |
---|
242 | #if HHI_MPI |
---|
243 | Void encodeSPS ( TComSPS* pcSPS, Bool bIsDepth ); |
---|
244 | #else |
---|
245 | Void encodeSPS ( TComSPS* pcSPS ); |
---|
246 | #endif |
---|
247 | Void encodePPS ( TComPPS* pcPPS ); |
---|
248 | void encodeSEI(const SEI&); |
---|
249 | Bool getAlfCtrl() {return m_pcEntropyCoderIf->getAlfCtrl();} |
---|
250 | UInt getMaxAlfCtrlDepth() {return m_pcEntropyCoderIf->getMaxAlfCtrlDepth();} |
---|
251 | Void setAlfCtrl(Bool bAlfCtrl) {m_pcEntropyCoderIf->setAlfCtrl(bAlfCtrl);} |
---|
252 | Void setMaxAlfCtrlDepth(UInt uiMaxAlfCtrlDepth) {m_pcEntropyCoderIf->setMaxAlfCtrlDepth(uiMaxAlfCtrlDepth);} |
---|
253 | |
---|
254 | Void encodeSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, Bool bRD = false ); |
---|
255 | #if LGE_ILLUCOMP_B0045 |
---|
256 | Void encodeICFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); |
---|
257 | #endif |
---|
258 | Void encodeSkipFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); |
---|
259 | Void encodePUWise ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); |
---|
260 | Void encodeInterDirPU ( TComDataCU* pcSubCU, UInt uiAbsPartIdx ); |
---|
261 | Void encodeRefFrmIdxPU ( TComDataCU* pcSubCU, UInt uiAbsPartIdx, RefPicList eRefList ); |
---|
262 | Void encodeMvdPU ( TComDataCU* pcSubCU, UInt uiAbsPartIdx, RefPicList eRefList ); |
---|
263 | Void encodeMVPIdxPU ( TComDataCU* pcSubCU, UInt uiAbsPartIdx, RefPicList eRefList ); |
---|
264 | Void encodeMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiPUIdx ); |
---|
265 | Void encodeMergeIndex ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiPUIdx, Bool bRD = false ); |
---|
266 | #if HHI_INTER_VIEW_RESIDUAL_PRED |
---|
267 | Void encodeResPredFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiPUIdx, Bool bRD = false ); |
---|
268 | #endif |
---|
269 | Void encodeAlfCtrlFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); |
---|
270 | |
---|
271 | /// set slice granularity |
---|
272 | Void setSliceGranularity (Int iSliceGranularity) {m_pcEntropyCoderIf->setSliceGranularity(iSliceGranularity);} |
---|
273 | |
---|
274 | /// encode ALF CU control flag |
---|
275 | Void encodeAlfCtrlFlag(UInt uiFlag); |
---|
276 | |
---|
277 | Void encodeApsExtensionFlag() {m_pcEntropyCoderIf->codeApsExtensionFlag();}; |
---|
278 | |
---|
279 | Void encodeAlfCtrlParam(AlfCUCtrlInfo& cAlfParam, Int iNumCUsInPic); |
---|
280 | |
---|
281 | Void encodePredMode ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); |
---|
282 | Void encodePartSize ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, Bool bRD = false ); |
---|
283 | Void encodeIPCMInfo ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); |
---|
284 | Void encodePredInfo ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); |
---|
285 | Void encodeIntraDirModeLuma ( TComDataCU* pcCU, UInt uiAbsPartIdx ); |
---|
286 | |
---|
287 | Void encodeIntraDirModeChroma( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); |
---|
288 | |
---|
289 | #if !UNIFIED_TRANSFORM_TREE |
---|
290 | Void encodeTransformIdx ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, Bool bRD = false ); |
---|
291 | #endif |
---|
292 | Void encodeTransformSubdivFlag( UInt uiSymbol, UInt uiCtx ); |
---|
293 | Void encodeQtCbf ( TComDataCU* pcCU, UInt uiAbsPartIdx, TextType eType, UInt uiTrDepth ); |
---|
294 | Void encodeQtRootCbf ( TComDataCU* pcCU, UInt uiAbsPartIdx ); |
---|
295 | Void encodeQP ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); |
---|
296 | Void updateContextTables ( SliceType eSliceType, Int iQp, Bool bExecuteFinish ) { m_pcEntropyCoderIf->updateContextTables( eSliceType, iQp, bExecuteFinish ); } |
---|
297 | Void updateContextTables ( SliceType eSliceType, Int iQp ) { m_pcEntropyCoderIf->updateContextTables( eSliceType, iQp, true ); } |
---|
298 | Void writeTileMarker ( UInt uiTileIdx, UInt uiBitsUsed ) { m_pcEntropyCoderIf->writeTileMarker( uiTileIdx, uiBitsUsed ); } |
---|
299 | |
---|
300 | Void encodeAPSInitInfo (TComAPS* pcAPS) {m_pcEntropyCoderIf->codeAPSInitInfo(pcAPS);} |
---|
301 | Void encodeFinish (Bool bEnd) {m_pcEntropyCoderIf->codeFinish(bEnd);} |
---|
302 | Void encodeScalingList ( TComScalingList* scalingList ); |
---|
303 | Void encodeDFParams (TComAPS* pcAPS); |
---|
304 | |
---|
305 | private: |
---|
306 | #if UNIFIED_TRANSFORM_TREE |
---|
307 | Void xEncodeTransform ( TComDataCU* pcCU,UInt offsetLumaOffset, UInt offsetChroma, UInt uiAbsPartIdx, UInt absTUPartIdx, UInt uiDepth, UInt width, UInt height, UInt uiTrIdx, UInt uiInnerQuadIdx, UInt& uiYCbfFront3, UInt& uiUCbfFront3, UInt& uiVCbfFront3, Bool& bCodeDQP ); |
---|
308 | #else |
---|
309 | Void xEncodeTransformSubdiv ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt absTUPartIdx, UInt uiDepth, UInt uiInnerQuadIdx, UInt& uiYCbfFront3, UInt& uiUCbfFront3, UInt& uiVCbfFront3 ); |
---|
310 | Void xEncodeCoeff ( TComDataCU* pcCU, UInt uiLumaOffset, UInt uiChromaOffset, UInt uiAbsPartIdx, UInt uiDepth, UInt uiWidth, UInt uiHeight, UInt uiTrIdx, UInt uiCurrTrIdx, Bool& bCodeDQP ); |
---|
311 | #endif // !UNIFIED_TRANSFORM_TREE |
---|
312 | public: |
---|
313 | Void encodeCoeff ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiWidth, UInt uiHeight, Bool& bCodeDQP ); |
---|
314 | |
---|
315 | Void encodeCoeffNxN ( TComDataCU* pcCU, TCoeff* pcCoeff, UInt uiAbsPartIdx, UInt uiTrWidth, UInt uiTrHeight, UInt uiDepth, TextType eType ); |
---|
316 | |
---|
317 | Void estimateBit ( estBitsSbacStruct* pcEstBitsSbac, Int width, Int height, TextType eTType); |
---|
318 | |
---|
319 | // ALF-related |
---|
320 | Void codeAuxCountBit(ALFParam* pAlfParam, Int64* ruiRate); |
---|
321 | Void codeFiltCountBit(ALFParam* pAlfParam, Int64* ruiRate); |
---|
322 | Void codeAux (ALFParam* pAlfParam); |
---|
323 | Void codeFilt (ALFParam* pAlfParam); |
---|
324 | Int codeFilterCoeff(ALFParam* ALFp); |
---|
325 | Int writeFilterCodingParams(int minKStart, int minScanVal, int maxScanVal, int kMinTab[]); |
---|
326 | |
---|
327 | Int writeFilterCoeffs(int sqrFiltLength, int filters_per_group, int pDepthInt[], |
---|
328 | int **FilterCoeff, int kMinTab[]); |
---|
329 | Int golombEncode(int coeff, int k); |
---|
330 | Int lengthGolomb(int coeffVal, int k); |
---|
331 | #if SAO_UNIT_INTERLEAVING |
---|
332 | Void encodeSaoUnit(Int rx, Int ry, Int compIdx, SAOParam* saoParam, Int repeatedRow); |
---|
333 | Void encodeSaoOffset(SaoLcuParam* saoLcuParam); |
---|
334 | Void encodeSaoUnitInterleaving(Int rx, Int ry, SAOParam* saoParam, TComDataCU* cu, Int cuAddrInSlice, Int cuAddrUpInSlice, Bool lfCrossSliceBoundaryFlag); |
---|
335 | Void encodeSaoParam (TComAPS* aps); |
---|
336 | #else |
---|
337 | Void encodeSaoOnePart (SAOParam* pSaoParam, Int iPartIdx, Int iYCbCr); |
---|
338 | Void encodeQuadTreeSplitFlag(SAOParam* pSaoParam, Int iPartIdx, Int iYCbCr); |
---|
339 | Void encodeSaoParam (SAOParam* pSaoParam); |
---|
340 | #endif |
---|
341 | |
---|
342 | static Int countNonZeroCoeffs( TCoeff* pcCoef, UInt uiSize ); |
---|
343 | |
---|
344 | };// END CLASS DEFINITION TEncEntropy |
---|
345 | |
---|
346 | //! \} |
---|
347 | |
---|
348 | #endif // __TENCENTROPY__ |
---|
349 | |
---|