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|QC_MVHEVC_B0046 |
---|
79 | virtual Void codeVPS ( TComVPS* pcVPS ) = 0; |
---|
80 | #endif |
---|
81 | |
---|
82 | #if HHI_MPI || H3D_QTL |
---|
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 | virtual Void codeTilesWPPEntryPoint ( TComSlice* pSlice ) = 0; |
---|
93 | virtual Void codeTerminatingBit ( UInt uilsLast ) = 0; |
---|
94 | virtual Void codeSliceFinish () = 0; |
---|
95 | virtual Void codeFlush () = 0; |
---|
96 | virtual Void encodeStart () = 0; |
---|
97 | |
---|
98 | virtual Void codeAlfCtrlDepth() = 0; |
---|
99 | #if H3D_IVMP |
---|
100 | virtual Void codeMVPIdx ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefList, Int iNum ) = 0; |
---|
101 | #else |
---|
102 | virtual Void codeMVPIdx ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefList ) = 0; |
---|
103 | #endif |
---|
104 | virtual Void codeScalingList ( TComScalingList* scalingList ) = 0; |
---|
105 | |
---|
106 | public: |
---|
107 | virtual Void codeAlfCtrlFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; |
---|
108 | virtual Void codeApsExtensionFlag () = 0; |
---|
109 | |
---|
110 | virtual Void codeSkipFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; |
---|
111 | #if LGE_ILLUCOMP_B0045 |
---|
112 | virtual Void codeICFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; |
---|
113 | #endif |
---|
114 | virtual Void codeMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; |
---|
115 | virtual Void codeMergeIndex ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; |
---|
116 | #if H3D_IVRP |
---|
117 | virtual Void codeResPredFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; |
---|
118 | #endif |
---|
119 | #if QC_ARP_D0177 |
---|
120 | virtual Void codeARPW ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; |
---|
121 | #endif |
---|
122 | virtual Void codeSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; |
---|
123 | |
---|
124 | virtual Void codePartSize ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; |
---|
125 | virtual Void codePredMode ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; |
---|
126 | |
---|
127 | #if RWTH_SDC_DLT_B0036 |
---|
128 | #if !PKU_QC_DEPTH_INTRA_UNI_D0195 |
---|
129 | virtual Void codeSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; |
---|
130 | #endif |
---|
131 | virtual Void codeSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment ) = 0; |
---|
132 | #if !PKU_QC_DEPTH_INTRA_UNI_D0195 |
---|
133 | virtual Void codeSDCPredMode ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; |
---|
134 | #endif |
---|
135 | #endif |
---|
136 | |
---|
137 | virtual Void codeIPCMInfo ( TComDataCU* pcCU, UInt uiAbsPartIdx, Int numIPCM, Bool firstIPCMFlag) = 0; |
---|
138 | |
---|
139 | virtual Void codeTransformSubdivFlag( UInt uiSymbol, UInt uiCtx ) = 0; |
---|
140 | virtual Void codeQtCbf ( TComDataCU* pcCU, UInt uiAbsPartIdx, TextType eType, UInt uiTrDepth ) = 0; |
---|
141 | virtual Void codeQtRootCbf ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; |
---|
142 | virtual Void codeIntraDirLumaAng( TComDataCU* pcCU, UInt uiAbsPartIdx |
---|
143 | #if PKU_QC_DEPTH_INTRA_UNI_D0195 |
---|
144 | , Bool bSdcRD = false |
---|
145 | #endif |
---|
146 | ) = 0; |
---|
147 | |
---|
148 | virtual Void codeIntraDirChroma( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; |
---|
149 | virtual Void codeInterDir ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; |
---|
150 | virtual Void codeRefFrmIdx ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefList ) = 0; |
---|
151 | virtual Void codeMvd ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefList ) = 0; |
---|
152 | virtual Void codeDeltaQP ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; |
---|
153 | virtual Void codeCoeffNxN ( TComDataCU* pcCU, TCoeff* pcCoef, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, UInt uiDepth, TextType eTType ) = 0; |
---|
154 | |
---|
155 | virtual Void codeAlfFlag ( UInt uiCode ) = 0; |
---|
156 | virtual Void codeAlfUvlc ( UInt uiCode ) = 0; |
---|
157 | virtual Void codeAlfSvlc ( Int iCode ) = 0; |
---|
158 | virtual Void codeAlfFixedLengthIdx( UInt idx, UInt numFilterSetsInBuffer) = 0; |
---|
159 | virtual Void codeAPSAlflag(UInt uiCode) = 0; |
---|
160 | /// set slice granularity |
---|
161 | virtual Void setSliceGranularity(Int iSliceGranularity) = 0; |
---|
162 | |
---|
163 | /// get slice granularity |
---|
164 | virtual Int getSliceGranularity() = 0; |
---|
165 | |
---|
166 | virtual Void codeAlfCtrlFlag ( UInt uiSymbol ) = 0; |
---|
167 | #if LGE_SAO_MIGRATION_D0091 |
---|
168 | virtual Void codeSAOSign ( UInt code ) = 0; |
---|
169 | virtual Void codeSaoMaxUvlc ( UInt code, UInt maxSymbol ) = 0; |
---|
170 | virtual Void codeSaoMerge ( UInt uiCode ) = 0; |
---|
171 | virtual Void codeSaoTypeIdx ( UInt uiCode) = 0; |
---|
172 | virtual Void codeSaoUflc ( UInt uiLength, UInt uiCode ) = 0; |
---|
173 | #else |
---|
174 | virtual Void codeSaoFlag ( UInt uiCode ) = 0; |
---|
175 | virtual Void codeSaoUvlc ( UInt uiCode ) = 0; |
---|
176 | virtual Void codeSaoSvlc ( Int iCode ) = 0; |
---|
177 | virtual Void codeSaoRun ( UInt uiCode, UInt uiMaxValue ) = 0; |
---|
178 | virtual Void codeSaoMergeLeft ( UInt uiCode, UInt uiCompIdx ) = 0; |
---|
179 | virtual Void codeSaoMergeUp ( UInt uiCode) = 0; |
---|
180 | virtual Void codeSaoTypeIdx ( UInt uiCode) = 0; |
---|
181 | virtual Void codeSaoUflc ( UInt uiCode) = 0; |
---|
182 | #endif |
---|
183 | virtual Void estBit (estBitsSbacStruct* pcEstBitsSbac, Int width, Int height, TextType eTType) = 0; |
---|
184 | |
---|
185 | virtual Void updateContextTables ( SliceType eSliceType, Int iQp, Bool bExecuteFinish ) = 0; |
---|
186 | virtual Void updateContextTables ( SliceType eSliceType, Int iQp ) = 0; |
---|
187 | virtual Void writeTileMarker ( UInt uiTileIdx, UInt uiBitsUsed ) = 0; |
---|
188 | |
---|
189 | virtual Void codeAPSInitInfo (TComAPS* pcAPS)= 0; |
---|
190 | virtual Void codeFinish (Bool bEnd)= 0; |
---|
191 | |
---|
192 | virtual Void codeDFFlag (UInt uiCode, const Char *pSymbolName) = 0; |
---|
193 | virtual Void codeDFSvlc (Int iCode, const Char *pSymbolName) = 0; |
---|
194 | |
---|
195 | virtual ~TEncEntropyIf() {} |
---|
196 | |
---|
197 | }; |
---|
198 | |
---|
199 | /// entropy encoder class |
---|
200 | class TEncEntropy |
---|
201 | { |
---|
202 | private: |
---|
203 | UInt m_uiBakAbsPartIdx; |
---|
204 | UInt m_uiBakChromaOffset; |
---|
205 | UInt m_bakAbsPartIdxCU; |
---|
206 | |
---|
207 | public: |
---|
208 | Void setEntropyCoder ( TEncEntropyIf* e, TComSlice* pcSlice ); |
---|
209 | Void setBitstream ( TComBitIf* p ) { m_pcEntropyCoderIf->setBitstream(p); } |
---|
210 | Void resetBits () { m_pcEntropyCoderIf->resetBits(); } |
---|
211 | Void resetCoeffCost () { m_pcEntropyCoderIf->resetCoeffCost(); } |
---|
212 | UInt getNumberOfWrittenBits () { return m_pcEntropyCoderIf->getNumberOfWrittenBits(); } |
---|
213 | UInt getCoeffCost () { return m_pcEntropyCoderIf->getCoeffCost(); } |
---|
214 | Void resetEntropy () { m_pcEntropyCoderIf->resetEntropy(); } |
---|
215 | #if CABAC_INIT_FLAG |
---|
216 | Void determineCabacInitIdx () { m_pcEntropyCoderIf->determineCabacInitIdx(); } |
---|
217 | #endif |
---|
218 | |
---|
219 | Void encodeSliceHeader ( TComSlice* pcSlice ); |
---|
220 | Void encodeTileMarkerFlag (TComSlice* pcSlice) {m_pcEntropyCoderIf->codeTileMarkerFlag(pcSlice);} |
---|
221 | Void encodeTilesWPPEntryPoint( TComSlice* pSlice ); |
---|
222 | Void encodeTerminatingBit ( UInt uiIsLast ); |
---|
223 | Void encodeSliceFinish (); |
---|
224 | Void encodeFlush (); |
---|
225 | Void encodeStart (); |
---|
226 | Void encodeAlfFlag(UInt code) {m_pcEntropyCoderIf->codeAlfFlag(code);} |
---|
227 | Void encodeAlfStoredFilterSetIdx(UInt idx, UInt numFilterSetsInBuffer); |
---|
228 | Void encodeAlfFixedLengthRun(UInt run, UInt rx, UInt numLCUInWidth); |
---|
229 | Void encodeAlfParam(AlfParamSet* pAlfParamSet, Bool bSentInAPS = true, Int firstLCUAddr = 0, Bool alfAcrossSlice= true); |
---|
230 | Void encodeAlfParamSet(AlfParamSet* pAlfParamSet, Int numLCUInWidth, Int numLCU, Int firstLCUAddr, Bool alfAcrossSlice, Int startCompIdx, Int endCompIdx); |
---|
231 | Bool getAlfRepeatRowFlag(Int compIdx, AlfParamSet* pAlfParamSet, Int lcuIdx, Int lcuPos, Int startlcuPosX, Int endlcuPosX, Int numLCUInWidth); |
---|
232 | Int getAlfRun(Int compIdx, AlfParamSet* pAlfParamSet, Int lcuIdxInSlice, Int lcuPos, Int startlcuPosX, Int endlcuPosX); |
---|
233 | Void encodeAPSAlfFlag(UInt code) {m_pcEntropyCoderIf->codeAPSAlflag(code);} |
---|
234 | Void encodeAlfParam(ALFParam* pAlfParam); |
---|
235 | |
---|
236 | TEncEntropyIf* m_pcEntropyCoderIf; |
---|
237 | |
---|
238 | public: |
---|
239 | #if VIDYO_VPS_INTEGRATION|QC_MVHEVC_B0046 |
---|
240 | Void encodeVPS ( TComVPS* pcVPS); |
---|
241 | #endif |
---|
242 | // SPS |
---|
243 | #if HHI_MPI || H3D_QTL |
---|
244 | Void encodeSPS ( TComSPS* pcSPS, Bool bIsDepth ); |
---|
245 | #else |
---|
246 | Void encodeSPS ( TComSPS* pcSPS ); |
---|
247 | #endif |
---|
248 | Void encodePPS ( TComPPS* pcPPS ); |
---|
249 | void encodeSEI(const SEI&); |
---|
250 | Bool getAlfCtrl() {return m_pcEntropyCoderIf->getAlfCtrl();} |
---|
251 | UInt getMaxAlfCtrlDepth() {return m_pcEntropyCoderIf->getMaxAlfCtrlDepth();} |
---|
252 | Void setAlfCtrl(Bool bAlfCtrl) {m_pcEntropyCoderIf->setAlfCtrl(bAlfCtrl);} |
---|
253 | Void setMaxAlfCtrlDepth(UInt uiMaxAlfCtrlDepth) {m_pcEntropyCoderIf->setMaxAlfCtrlDepth(uiMaxAlfCtrlDepth);} |
---|
254 | |
---|
255 | Void encodeSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, Bool bRD = false ); |
---|
256 | #if LGE_ILLUCOMP_B0045 |
---|
257 | Void encodeICFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false |
---|
258 | #if LGE_ILLUCOMP_DEPTH_C0046 |
---|
259 | , UInt uiDepth = 0 |
---|
260 | #endif |
---|
261 | ); |
---|
262 | #endif |
---|
263 | Void encodeSkipFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); |
---|
264 | Void encodePUWise ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); |
---|
265 | Void encodeInterDirPU ( TComDataCU* pcSubCU, UInt uiAbsPartIdx ); |
---|
266 | Void encodeRefFrmIdxPU ( TComDataCU* pcSubCU, UInt uiAbsPartIdx, RefPicList eRefList ); |
---|
267 | Void encodeMvdPU ( TComDataCU* pcSubCU, UInt uiAbsPartIdx, RefPicList eRefList ); |
---|
268 | Void encodeMVPIdxPU ( TComDataCU* pcSubCU, UInt uiAbsPartIdx, RefPicList eRefList ); |
---|
269 | Void encodeMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiPUIdx ); |
---|
270 | Void encodeMergeIndex ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiPUIdx, Bool bRD = false ); |
---|
271 | #if QC_ARP_D0177 |
---|
272 | Void encodeARPW ( TComDataCU* pcCU, UInt uiAbspartIdx , Bool bRD = false, UInt uiDepth = -1); |
---|
273 | #endif |
---|
274 | Void encodeAlfCtrlFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); |
---|
275 | |
---|
276 | /// set slice granularity |
---|
277 | Void setSliceGranularity (Int iSliceGranularity) {m_pcEntropyCoderIf->setSliceGranularity(iSliceGranularity);} |
---|
278 | |
---|
279 | /// encode ALF CU control flag |
---|
280 | Void encodeAlfCtrlFlag(UInt uiFlag); |
---|
281 | |
---|
282 | Void encodeApsExtensionFlag() {m_pcEntropyCoderIf->codeApsExtensionFlag();}; |
---|
283 | |
---|
284 | Void encodeAlfCtrlParam(AlfCUCtrlInfo& cAlfParam, Int iNumCUsInPic); |
---|
285 | |
---|
286 | Void encodePredMode ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); |
---|
287 | Void encodePartSize ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, Bool bRD = false ); |
---|
288 | Void encodeIPCMInfo ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); |
---|
289 | Void encodePredInfo ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false |
---|
290 | #if PKU_QC_DEPTH_INTRA_UNI_D0195 |
---|
291 | ,Bool bSdcRD = false |
---|
292 | #endif |
---|
293 | ); |
---|
294 | Void encodeIntraDirModeLuma ( TComDataCU* pcCU, UInt uiAbsPartIdx |
---|
295 | #if PKU_QC_DEPTH_INTRA_UNI_D0195 |
---|
296 | ,Bool bSdcRD = false |
---|
297 | #endif |
---|
298 | ); |
---|
299 | |
---|
300 | Void encodeIntraDirModeChroma( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); |
---|
301 | |
---|
302 | Void encodeTransformSubdivFlag( UInt uiSymbol, UInt uiCtx ); |
---|
303 | Void encodeQtCbf ( TComDataCU* pcCU, UInt uiAbsPartIdx, TextType eType, UInt uiTrDepth ); |
---|
304 | Void encodeQtRootCbf ( TComDataCU* pcCU, UInt uiAbsPartIdx ); |
---|
305 | Void encodeQP ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); |
---|
306 | Void updateContextTables ( SliceType eSliceType, Int iQp, Bool bExecuteFinish ) { m_pcEntropyCoderIf->updateContextTables( eSliceType, iQp, bExecuteFinish ); } |
---|
307 | Void updateContextTables ( SliceType eSliceType, Int iQp ) { m_pcEntropyCoderIf->updateContextTables( eSliceType, iQp, true ); } |
---|
308 | Void writeTileMarker ( UInt uiTileIdx, UInt uiBitsUsed ) { m_pcEntropyCoderIf->writeTileMarker( uiTileIdx, uiBitsUsed ); } |
---|
309 | |
---|
310 | Void encodeAPSInitInfo (TComAPS* pcAPS) {m_pcEntropyCoderIf->codeAPSInitInfo(pcAPS);} |
---|
311 | Void encodeFinish (Bool bEnd) {m_pcEntropyCoderIf->codeFinish(bEnd);} |
---|
312 | Void encodeScalingList ( TComScalingList* scalingList ); |
---|
313 | Void encodeDFParams (TComAPS* pcAPS); |
---|
314 | |
---|
315 | #if RWTH_SDC_DLT_B0036 |
---|
316 | #if !PKU_QC_DEPTH_INTRA_UNI_D0195 |
---|
317 | Void encodeSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); |
---|
318 | #endif |
---|
319 | Void encodeSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); |
---|
320 | #if !PKU_QC_DEPTH_INTRA_UNI_D0195 |
---|
321 | Void encodeSDCPredMode ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); |
---|
322 | #endif |
---|
323 | #endif |
---|
324 | |
---|
325 | private: |
---|
326 | 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 ); |
---|
327 | public: |
---|
328 | Void encodeCoeff ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiWidth, UInt uiHeight, Bool& bCodeDQP ); |
---|
329 | |
---|
330 | Void encodeCoeffNxN ( TComDataCU* pcCU, TCoeff* pcCoeff, UInt uiAbsPartIdx, UInt uiTrWidth, UInt uiTrHeight, UInt uiDepth, TextType eType ); |
---|
331 | |
---|
332 | Void estimateBit ( estBitsSbacStruct* pcEstBitsSbac, Int width, Int height, TextType eTType); |
---|
333 | |
---|
334 | // ALF-related |
---|
335 | Void codeAuxCountBit(ALFParam* pAlfParam, Int64* ruiRate); |
---|
336 | Void codeFiltCountBit(ALFParam* pAlfParam, Int64* ruiRate); |
---|
337 | Void codeAux (ALFParam* pAlfParam); |
---|
338 | Void codeFilt (ALFParam* pAlfParam); |
---|
339 | Int codeFilterCoeff(ALFParam* ALFp); |
---|
340 | Int writeFilterCodingParams(int minKStart, int minScanVal, int maxScanVal, int kMinTab[]); |
---|
341 | |
---|
342 | Int writeFilterCoeffs(int sqrFiltLength, int filters_per_group, int pDepthInt[], |
---|
343 | int **FilterCoeff, int kMinTab[]); |
---|
344 | Int golombEncode(int coeff, int k); |
---|
345 | Int lengthGolomb(int coeffVal, int k); |
---|
346 | #if LGE_SAO_MIGRATION_D0091 |
---|
347 | Void encodeSaoOffset(SaoLcuParam* saoLcuParam, UInt compIdx); |
---|
348 | Void encodeSaoUnitInterleaving(Int compIdx, Bool saoFlag, Int rx, Int ry, SaoLcuParam* saoLcuParam, Int cuAddrInSlice, Int cuAddrUpInSlice, Int allowMergeLeft, Int allowMergeUp); |
---|
349 | #else |
---|
350 | Void encodeSaoUnit(Int rx, Int ry, Int compIdx, SAOParam* saoParam, Int repeatedRow); |
---|
351 | Void encodeSaoOffset(SaoLcuParam* saoLcuParam); |
---|
352 | Void encodeSaoUnitInterleaving(Int rx, Int ry, SAOParam* saoParam, TComDataCU* cu, Int cuAddrInSlice, Int cuAddrUpInSlice, Bool lfCrossSliceBoundaryFlag); |
---|
353 | Void encodeSaoParam (TComAPS* aps); |
---|
354 | #endif |
---|
355 | |
---|
356 | static Int countNonZeroCoeffs( TCoeff* pcCoef, UInt uiSize ); |
---|
357 | |
---|
358 | };// END CLASS DEFINITION TEncEntropy |
---|
359 | |
---|
360 | //! \} |
---|
361 | |
---|
362 | #endif // __TENCENTROPY__ |
---|
363 | |
---|