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 TComSlice.h |
---|
35 | \brief slice header and SPS class (header) |
---|
36 | */ |
---|
37 | |
---|
38 | #ifndef __TCOMSLICE__ |
---|
39 | #define __TCOMSLICE__ |
---|
40 | |
---|
41 | #include <cstring> |
---|
42 | #include <map> |
---|
43 | #include <vector> |
---|
44 | #include "CommonDef.h" |
---|
45 | #include "TComRom.h" |
---|
46 | #include "TComList.h" |
---|
47 | |
---|
48 | //! \ingroup TLibCommon |
---|
49 | //! \{ |
---|
50 | |
---|
51 | class TComPic; |
---|
52 | class TComTrQuant; |
---|
53 | #if DEPTH_MAP_GENERATION |
---|
54 | class TComDepthMapGenerator; |
---|
55 | #endif |
---|
56 | #if HHI_INTER_VIEW_RESIDUAL_PRED |
---|
57 | class TComResidualGenerator; |
---|
58 | #endif |
---|
59 | // ==================================================================================================================== |
---|
60 | // Constants |
---|
61 | // ==================================================================================================================== |
---|
62 | |
---|
63 | /// max number of supported APS in software |
---|
64 | #define MAX_NUM_SUPPORTED_APS 1 |
---|
65 | |
---|
66 | // ==================================================================================================================== |
---|
67 | // Class definition |
---|
68 | // ==================================================================================================================== |
---|
69 | |
---|
70 | #if RPS_IN_SPS |
---|
71 | /// Reference Picture Set class |
---|
72 | class TComReferencePictureSet |
---|
73 | { |
---|
74 | private: |
---|
75 | Int m_numberOfPictures; |
---|
76 | Int m_numberOfNegativePictures; |
---|
77 | Int m_numberOfPositivePictures; |
---|
78 | Int m_numberOfLongtermPictures; |
---|
79 | Int m_deltaPOC[MAX_NUM_REF_PICS]; |
---|
80 | Int m_POC[MAX_NUM_REF_PICS]; |
---|
81 | Bool m_used[MAX_NUM_REF_PICS]; |
---|
82 | Bool m_interRPSPrediction; |
---|
83 | Int m_deltaRIdxMinus1; |
---|
84 | Int m_deltaRPS; |
---|
85 | Int m_numRefIdc; |
---|
86 | Int m_refIdc[MAX_NUM_REF_PICS+1]; |
---|
87 | |
---|
88 | public: |
---|
89 | TComReferencePictureSet(); |
---|
90 | virtual ~TComReferencePictureSet(); |
---|
91 | |
---|
92 | Void setNumberOfPictures(Int numberOfPictures); |
---|
93 | Int getNumberOfPictures(); |
---|
94 | Void setNumberOfNegativePictures(Int number) { m_numberOfNegativePictures = number; } |
---|
95 | Int getNumberOfNegativePictures() { return m_numberOfNegativePictures; } |
---|
96 | Void setNumberOfPositivePictures(Int number) { m_numberOfPositivePictures = number; } |
---|
97 | Int getNumberOfPositivePictures() { return m_numberOfPositivePictures; } |
---|
98 | Void setNumberOfLongtermPictures(Int number) { m_numberOfLongtermPictures = number; } |
---|
99 | Int getNumberOfLongtermPictures() { return m_numberOfLongtermPictures; } |
---|
100 | |
---|
101 | Void setDeltaPOC(Int bufferNum, Int deltaPOC); |
---|
102 | Int getDeltaPOC(Int bufferNum); |
---|
103 | Void setPOC(Int bufferNum, Int deltaPOC); |
---|
104 | Int getPOC(Int bufferNum); |
---|
105 | |
---|
106 | Void setUsed(Int bufferNum, Bool used); |
---|
107 | Int getUsed(Int bufferNum); |
---|
108 | |
---|
109 | Void setInterRPSPrediction(Bool flag) { m_interRPSPrediction = flag; } |
---|
110 | Bool getInterRPSPrediction() { return m_interRPSPrediction; } |
---|
111 | Void setDeltaRIdxMinus1(Int x) { m_deltaRIdxMinus1 = x; } |
---|
112 | Int getDeltaRIdxMinus1() { return m_deltaRIdxMinus1; } |
---|
113 | Void setDeltaRPS(Int x) { m_deltaRPS = x; } |
---|
114 | Int getDeltaRPS() { return m_deltaRPS; } |
---|
115 | Void setNumRefIdc(Int x) { m_numRefIdc = x; } |
---|
116 | Int getNumRefIdc() { return m_numRefIdc; } |
---|
117 | |
---|
118 | Void setRefIdc(Int bufferNum, Int refIdc); |
---|
119 | Int getRefIdc(Int bufferNum); |
---|
120 | |
---|
121 | Void sortDeltaPOC(); |
---|
122 | Void printDeltaPOC(); |
---|
123 | }; |
---|
124 | |
---|
125 | /// Reference Picture Set set class |
---|
126 | class TComRPSList |
---|
127 | { |
---|
128 | private: |
---|
129 | Int m_numberOfReferencePictureSets; |
---|
130 | TComReferencePictureSet* m_referencePictureSets; |
---|
131 | |
---|
132 | public: |
---|
133 | TComRPSList(); |
---|
134 | virtual ~TComRPSList(); |
---|
135 | |
---|
136 | Void create (Int numberOfEntries); |
---|
137 | Void destroy (); |
---|
138 | |
---|
139 | |
---|
140 | TComReferencePictureSet* getReferencePictureSet(Int referencePictureSetNum); |
---|
141 | Int getNumberOfReferencePictureSets(); |
---|
142 | Void setNumberOfReferencePictureSets(Int numberOfReferencePictureSets); |
---|
143 | }; |
---|
144 | #endif |
---|
145 | |
---|
146 | #if VIDYO_VPS_INTEGRATION |
---|
147 | /// VPS class |
---|
148 | |
---|
149 | class TComVPS |
---|
150 | { |
---|
151 | private: |
---|
152 | Int m_VPSId; |
---|
153 | UInt m_uiMaxTLayers; |
---|
154 | UInt m_uiMaxLayers; |
---|
155 | Bool m_bTemporalIdNestingFlag; |
---|
156 | |
---|
157 | UInt m_uiExtensionType; |
---|
158 | |
---|
159 | Bool m_bDependentFlag[MAX_LAYER_NUM]; |
---|
160 | UInt m_uiViewId[MAX_LAYER_NUM]; |
---|
161 | Bool m_bDepthFlag[MAX_LAYER_NUM]; |
---|
162 | Int m_iViewOrderIdx[MAX_LAYER_NUM]; |
---|
163 | UInt m_uiDependentLayer[MAX_LAYER_NUM]; |
---|
164 | |
---|
165 | UInt m_numReorderPics[MAX_TLAYER]; |
---|
166 | UInt m_uiMaxDecPicBuffering[MAX_TLAYER]; |
---|
167 | UInt m_uiMaxLatencyIncrease[MAX_TLAYER]; |
---|
168 | |
---|
169 | public: |
---|
170 | TComVPS(); |
---|
171 | virtual ~TComVPS(); |
---|
172 | |
---|
173 | Int getVPSId () { return m_VPSId; } |
---|
174 | Void setVPSId (Int i) { m_VPSId = i; } |
---|
175 | |
---|
176 | UInt getMaxTLayers () { return m_uiMaxTLayers; } |
---|
177 | Void setMaxTLayers (UInt t) { m_uiMaxTLayers = t; } |
---|
178 | |
---|
179 | UInt getMaxLayers () { return m_uiMaxLayers; } |
---|
180 | Void setMaxLayers (UInt l) { m_uiMaxLayers = l; } |
---|
181 | |
---|
182 | Bool getTemporalNestingFlag () { return m_uiMaxLayers; } |
---|
183 | Void setTemporalNestingFlag (UInt t) { m_bTemporalIdNestingFlag = t; } |
---|
184 | |
---|
185 | Void setExtensionType(UInt v) { m_uiExtensionType = v; } |
---|
186 | UInt getExtensionType() { return m_uiExtensionType; } |
---|
187 | |
---|
188 | Void setDependentFlag(Bool d, UInt layer) { m_bDependentFlag[layer] = d; } |
---|
189 | Bool getDependentFlag(UInt layer) { return m_bDependentFlag[layer]; } |
---|
190 | |
---|
191 | Void setViewId(UInt v, UInt layer) { m_uiViewId[layer] = v; } |
---|
192 | UInt getViewId(UInt layer) { return m_uiViewId[layer]; } |
---|
193 | |
---|
194 | Void setDepthFlag(Bool d, UInt layer) { m_bDepthFlag[layer] = d; } |
---|
195 | Bool getDepthFlag(UInt layer) { return m_bDepthFlag[layer]; } |
---|
196 | |
---|
197 | Void setViewOrderIdx(Int v, UInt layer) { m_iViewOrderIdx[layer] = v; } |
---|
198 | Int getViewOrderIdx(UInt layer) { return m_iViewOrderIdx[layer]; } |
---|
199 | |
---|
200 | Void setDependentLayer(UInt v, UInt layer) { m_uiDependentLayer[layer] = v; } |
---|
201 | UInt getDependentLayer(UInt layer) { return m_uiDependentLayer[layer]; } |
---|
202 | |
---|
203 | Void setNumReorderPics(UInt v, UInt tLayer) { m_numReorderPics[tLayer] = v; } |
---|
204 | UInt getNumReorderPics(UInt tLayer) { return m_numReorderPics[tLayer]; } |
---|
205 | |
---|
206 | Void setMaxDecPicBuffering(UInt v, UInt tLayer) { m_uiMaxDecPicBuffering[tLayer] = v; } |
---|
207 | UInt getMaxDecPicBuffering(UInt tLayer) { return m_uiMaxDecPicBuffering[tLayer]; } |
---|
208 | |
---|
209 | Void setMaxLatencyIncrease(UInt v, UInt tLayer) { m_uiMaxLatencyIncrease[tLayer] = v; } |
---|
210 | UInt getMaxLatencyIncrease(UInt tLayer) { return m_uiMaxLatencyIncrease[tLayer]; } |
---|
211 | |
---|
212 | }; |
---|
213 | |
---|
214 | #endif |
---|
215 | |
---|
216 | /// SPS class |
---|
217 | class TComSPS |
---|
218 | { |
---|
219 | private: |
---|
220 | #if VIDYO_VPS_INTEGRATION |
---|
221 | Int m_VPSId; |
---|
222 | #endif |
---|
223 | Int m_SPSId; |
---|
224 | Int m_ProfileIdc; |
---|
225 | Int m_LevelIdc; |
---|
226 | Int m_chromaFormatIdc; |
---|
227 | |
---|
228 | UInt m_uiMaxTLayers; // maximum number of temporal layers |
---|
229 | |
---|
230 | UInt m_uiViewId; |
---|
231 | Int m_iViewOrderIdx; |
---|
232 | Bool m_bDepth; |
---|
233 | UInt m_uiCamParPrecision; |
---|
234 | Bool m_bCamParInSliceHeader; |
---|
235 | Int m_aaiCodedScale [2][MAX_VIEW_NUM]; |
---|
236 | Int m_aaiCodedOffset[2][MAX_VIEW_NUM]; |
---|
237 | |
---|
238 | // Structure |
---|
239 | UInt m_picWidthInLumaSamples; |
---|
240 | UInt m_picHeightInLumaSamples; |
---|
241 | #if PIC_CROPPING |
---|
242 | Bool m_picCroppingFlag; |
---|
243 | Int m_picCropLeftOffset; |
---|
244 | Int m_picCropRightOffset; |
---|
245 | Int m_picCropTopOffset; |
---|
246 | Int m_picCropBottomOffset; |
---|
247 | #else |
---|
248 | Int m_aiPad[2]; |
---|
249 | #endif |
---|
250 | UInt m_uiMaxCUWidth; |
---|
251 | UInt m_uiMaxCUHeight; |
---|
252 | UInt m_uiMaxCUDepth; |
---|
253 | UInt m_uiMinTrDepth; |
---|
254 | UInt m_uiMaxTrDepth; |
---|
255 | #if RPS_IN_SPS |
---|
256 | TComRPSList* m_RPSList; |
---|
257 | Bool m_bLongTermRefsPresent; |
---|
258 | #endif |
---|
259 | #if H0567_DPB_PARAMETERS_PER_TEMPORAL_LAYER |
---|
260 | Int m_numReorderPics[MAX_TLAYER]; |
---|
261 | #else |
---|
262 | Int m_maxNumberOfReferencePictures; |
---|
263 | Int m_numReorderFrames; |
---|
264 | #endif |
---|
265 | |
---|
266 | Int m_iNumberOfUsableInterViewRefs; |
---|
267 | Int m_aiUsableInterViewRefs[MAX_VIEW_NUM]; |
---|
268 | |
---|
269 | // Tool list |
---|
270 | UInt m_uiQuadtreeTULog2MaxSize; |
---|
271 | UInt m_uiQuadtreeTULog2MinSize; |
---|
272 | UInt m_uiQuadtreeTUMaxDepthInter; |
---|
273 | UInt m_uiQuadtreeTUMaxDepthIntra; |
---|
274 | Bool m_usePCM; |
---|
275 | UInt m_pcmLog2MaxSize; |
---|
276 | UInt m_uiPCMLog2MinSize; |
---|
277 | Bool m_bDisInter4x4; |
---|
278 | Bool m_useAMP; |
---|
279 | Bool m_bUseALF; |
---|
280 | #if LCU_SYNTAX_ALF |
---|
281 | Bool m_bALFCoefInSlice; |
---|
282 | #endif |
---|
283 | #if !PIC_CROPPING |
---|
284 | Bool m_bUsePAD; |
---|
285 | #endif |
---|
286 | Bool m_bUseLMChroma; // JL: |
---|
287 | |
---|
288 | Bool m_bUseLComb; |
---|
289 | Bool m_bLCMod; |
---|
290 | Bool m_useNSQT; |
---|
291 | |
---|
292 | #if H0412_REF_PIC_LIST_RESTRICTION |
---|
293 | Bool m_restrictedRefPicListsFlag; |
---|
294 | Bool m_listsModificationPresentFlag; |
---|
295 | #endif |
---|
296 | |
---|
297 | // Parameter |
---|
298 | AMVP_MODE m_aeAMVPMode[MAX_CU_DEPTH]; |
---|
299 | UInt m_uiBitDepth; |
---|
300 | UInt m_uiBitIncrement; |
---|
301 | #if H0736_AVC_STYLE_QP_RANGE |
---|
302 | Int m_qpBDOffsetY; |
---|
303 | Int m_qpBDOffsetC; |
---|
304 | #endif |
---|
305 | |
---|
306 | #if LOSSLESS_CODING |
---|
307 | Bool m_useLossless; |
---|
308 | #endif |
---|
309 | |
---|
310 | UInt m_uiPCMBitDepthLuma; |
---|
311 | UInt m_uiPCMBitDepthChroma; |
---|
312 | Bool m_bPCMFilterDisableFlag; |
---|
313 | |
---|
314 | UInt m_uiBitsForPOC; |
---|
315 | // Max physical transform size |
---|
316 | UInt m_uiMaxTrSize; |
---|
317 | |
---|
318 | Int m_iAMPAcc[MAX_CU_DEPTH]; |
---|
319 | |
---|
320 | Bool m_bLFCrossSliceBoundaryFlag; |
---|
321 | Bool m_bUseSAO; |
---|
322 | #if HHI_MPI |
---|
323 | Bool m_bUseMVI; |
---|
324 | #endif |
---|
325 | |
---|
326 | #if RWTH_SDC_DLT_B0036 |
---|
327 | Bool m_bUseDLT; |
---|
328 | |
---|
329 | UInt m_uiBitsPerDepthValue; |
---|
330 | UInt m_uiNumDepthmapValues; |
---|
331 | UInt* m_uiDepthValue2Idx; |
---|
332 | UInt* m_uiIdx2DepthValue; |
---|
333 | #endif |
---|
334 | |
---|
335 | Bool m_bLFCrossTileBoundaryFlag; |
---|
336 | Int m_iUniformSpacingIdr; |
---|
337 | Int m_iTileBoundaryIndependenceIdr; |
---|
338 | Int m_iNumColumnsMinus1; |
---|
339 | UInt* m_puiColumnWidth; |
---|
340 | Int m_iNumRowsMinus1; |
---|
341 | UInt* m_puiRowHeight; |
---|
342 | |
---|
343 | Bool m_bTemporalIdNestingFlag; // temporal_id_nesting_flag |
---|
344 | |
---|
345 | Bool m_scalingListEnabledFlag; |
---|
346 | #if H0567_DPB_PARAMETERS_PER_TEMPORAL_LAYER |
---|
347 | UInt m_uiMaxDecPicBuffering[MAX_TLAYER]; |
---|
348 | UInt m_uiMaxLatencyIncrease[MAX_TLAYER]; |
---|
349 | #else |
---|
350 | UInt m_uiMaxDecFrameBuffering; |
---|
351 | UInt m_uiMaxLatencyIncrease; |
---|
352 | #endif |
---|
353 | |
---|
354 | Bool m_useDF; |
---|
355 | |
---|
356 | #if TILES_WPP_ENTRY_POINT_SIGNALLING |
---|
357 | UInt m_tilesOrEntropyCodingSyncIdc; |
---|
358 | Int m_numSubstreams; |
---|
359 | #endif |
---|
360 | |
---|
361 | #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX |
---|
362 | Bool m_bUseDMM; |
---|
363 | #endif |
---|
364 | |
---|
365 | #if OL_QTLIMIT_PREDCODING_B0068 |
---|
366 | Bool m_bUseQTLPC; |
---|
367 | #endif |
---|
368 | |
---|
369 | #if DEPTH_MAP_GENERATION |
---|
370 | UInt m_uiPredDepthMapGeneration; |
---|
371 | UInt m_uiPdmPrecision; |
---|
372 | Int m_aiPdmScaleNomDelta[MAX_VIEW_NUM]; |
---|
373 | Int m_aiPdmOffset [MAX_VIEW_NUM]; |
---|
374 | #endif |
---|
375 | |
---|
376 | #if HHI_INTER_VIEW_MOTION_PRED |
---|
377 | UInt m_uiMultiviewMvPredMode; |
---|
378 | #endif |
---|
379 | #if HHI_INTER_VIEW_RESIDUAL_PRED |
---|
380 | UInt m_uiMultiviewResPredMode; |
---|
381 | #endif |
---|
382 | |
---|
383 | #if DEPTH_MAP_GENERATION |
---|
384 | TComDepthMapGenerator* m_pcDepthMapGenerator; |
---|
385 | #endif |
---|
386 | #if HHI_INTER_VIEW_RESIDUAL_PRED |
---|
387 | TComResidualGenerator* m_pcResidualGenerator; |
---|
388 | #endif |
---|
389 | |
---|
390 | public: |
---|
391 | TComSPS(); |
---|
392 | virtual ~TComSPS(); |
---|
393 | #if VIDYO_VPS_INTEGRATION |
---|
394 | Int getVPSId () { return m_VPSId; } |
---|
395 | Void setVPSId (Int i) { m_VPSId = i; } |
---|
396 | #endif |
---|
397 | Int getSPSId () { return m_SPSId; } |
---|
398 | Void setSPSId (Int i) { m_SPSId = i; } |
---|
399 | Int getProfileIdc () { return m_ProfileIdc; } |
---|
400 | Void setProfileIdc (Int i) { m_ProfileIdc = i; } |
---|
401 | Int getLevelIdc () { return m_LevelIdc; } |
---|
402 | Void setLevelIdc (Int i) { m_LevelIdc = i; } |
---|
403 | |
---|
404 | Int getChromaFormatIdc () { return m_chromaFormatIdc; } |
---|
405 | Void setChromaFormatIdc (Int i) { m_chromaFormatIdc = i; } |
---|
406 | |
---|
407 | // structure |
---|
408 | Void setPicWidthInLumaSamples ( UInt u ) { m_picWidthInLumaSamples = u; } |
---|
409 | UInt getPicWidthInLumaSamples () { return m_picWidthInLumaSamples; } |
---|
410 | Void setPicHeightInLumaSamples ( UInt u ) { m_picHeightInLumaSamples = u; } |
---|
411 | UInt getPicHeightInLumaSamples () { return m_picHeightInLumaSamples; } |
---|
412 | |
---|
413 | #if PIC_CROPPING |
---|
414 | Bool getPicCroppingFlag() const { return m_picCroppingFlag; } |
---|
415 | Void setPicCroppingFlag(Bool val) { m_picCroppingFlag = val; } |
---|
416 | Int getPicCropLeftOffset() const { return m_picCropLeftOffset; } |
---|
417 | Void setPicCropLeftOffset(Int val) { m_picCropLeftOffset = val; } |
---|
418 | Int getPicCropRightOffset() const { return m_picCropRightOffset; } |
---|
419 | Void setPicCropRightOffset(Int val) { m_picCropRightOffset = val; } |
---|
420 | Int getPicCropTopOffset() const { return m_picCropTopOffset; } |
---|
421 | Void setPicCropTopOffset(Int val) { m_picCropTopOffset = val; } |
---|
422 | Int getPicCropBottomOffset() const { return m_picCropBottomOffset; } |
---|
423 | Void setPicCropBottomOffset(Int val) { m_picCropBottomOffset = val; } |
---|
424 | #endif |
---|
425 | |
---|
426 | Void setMaxCUWidth ( UInt u ) { m_uiMaxCUWidth = u; } |
---|
427 | UInt getMaxCUWidth () { return m_uiMaxCUWidth; } |
---|
428 | Void setMaxCUHeight ( UInt u ) { m_uiMaxCUHeight = u; } |
---|
429 | UInt getMaxCUHeight () { return m_uiMaxCUHeight; } |
---|
430 | Void setMaxCUDepth ( UInt u ) { m_uiMaxCUDepth = u; } |
---|
431 | UInt getMaxCUDepth () { return m_uiMaxCUDepth; } |
---|
432 | Void setUsePCM ( Bool b ) { m_usePCM = b; } |
---|
433 | Bool getUsePCM () { return m_usePCM; } |
---|
434 | Void setPCMLog2MaxSize ( UInt u ) { m_pcmLog2MaxSize = u; } |
---|
435 | UInt getPCMLog2MaxSize () { return m_pcmLog2MaxSize; } |
---|
436 | Void setPCMLog2MinSize ( UInt u ) { m_uiPCMLog2MinSize = u; } |
---|
437 | UInt getPCMLog2MinSize () { return m_uiPCMLog2MinSize; } |
---|
438 | Void setBitsForPOC ( UInt u ) { m_uiBitsForPOC = u; } |
---|
439 | UInt getBitsForPOC () { return m_uiBitsForPOC; } |
---|
440 | Bool getDisInter4x4() { return m_bDisInter4x4; } |
---|
441 | Void setDisInter4x4 ( Bool b ) { m_bDisInter4x4 = b; } |
---|
442 | Bool getUseAMP() { return m_useAMP; } |
---|
443 | Void setUseAMP( Bool b ) { m_useAMP = b; } |
---|
444 | Void setMinTrDepth ( UInt u ) { m_uiMinTrDepth = u; } |
---|
445 | UInt getMinTrDepth () { return m_uiMinTrDepth; } |
---|
446 | Void setMaxTrDepth ( UInt u ) { m_uiMaxTrDepth = u; } |
---|
447 | UInt getMaxTrDepth () { return m_uiMaxTrDepth; } |
---|
448 | Void setQuadtreeTULog2MaxSize( UInt u ) { m_uiQuadtreeTULog2MaxSize = u; } |
---|
449 | UInt getQuadtreeTULog2MaxSize() { return m_uiQuadtreeTULog2MaxSize; } |
---|
450 | Void setQuadtreeTULog2MinSize( UInt u ) { m_uiQuadtreeTULog2MinSize = u; } |
---|
451 | UInt getQuadtreeTULog2MinSize() { return m_uiQuadtreeTULog2MinSize; } |
---|
452 | Void setQuadtreeTUMaxDepthInter( UInt u ) { m_uiQuadtreeTUMaxDepthInter = u; } |
---|
453 | Void setQuadtreeTUMaxDepthIntra( UInt u ) { m_uiQuadtreeTUMaxDepthIntra = u; } |
---|
454 | UInt getQuadtreeTUMaxDepthInter() { return m_uiQuadtreeTUMaxDepthInter; } |
---|
455 | UInt getQuadtreeTUMaxDepthIntra() { return m_uiQuadtreeTUMaxDepthIntra; } |
---|
456 | #if !PIC_CROPPING |
---|
457 | Void setPad (Int iPad[2]) { m_aiPad[0] = iPad[0]; m_aiPad[1] = iPad[1]; } |
---|
458 | #endif |
---|
459 | #if H0567_DPB_PARAMETERS_PER_TEMPORAL_LAYER |
---|
460 | Void setNumReorderPics(Int i, UInt tlayer) { m_numReorderPics[tlayer] = i; } |
---|
461 | Int getNumReorderPics(UInt tlayer) { return m_numReorderPics[tlayer]; } |
---|
462 | #else |
---|
463 | Void setMaxNumberOfReferencePictures( Int u ) { m_maxNumberOfReferencePictures = u; } |
---|
464 | Int getMaxNumberOfReferencePictures() { return m_maxNumberOfReferencePictures; } |
---|
465 | Void setNumReorderFrames( Int i ) { m_numReorderFrames = i; } |
---|
466 | Int getNumReorderFrames() { return m_numReorderFrames; } |
---|
467 | #endif |
---|
468 | #if RPS_IN_SPS |
---|
469 | Void setRPSList( TComRPSList* RPSList ) { m_RPSList = RPSList; } |
---|
470 | TComRPSList* getRPSList() { return m_RPSList; } |
---|
471 | Bool getLongTermRefsPresent() { return m_bLongTermRefsPresent; } |
---|
472 | Void setLongTermRefsPresent(Bool b) { m_bLongTermRefsPresent=b; } |
---|
473 | #endif |
---|
474 | |
---|
475 | Void setNumberOfUsableInterViewRefs( Int number ) { m_iNumberOfUsableInterViewRefs = number; } |
---|
476 | Int getNumberOfUsableInterViewRefs() { return m_iNumberOfUsableInterViewRefs; } |
---|
477 | Void setUsableInterViewRef( Int pos, Int deltaViewId ) { m_aiUsableInterViewRefs[pos] = deltaViewId; } |
---|
478 | Int getUsableInterViewRef( Int pos ) { return m_aiUsableInterViewRefs[pos]; } |
---|
479 | |
---|
480 | #if !PIC_CROPPING |
---|
481 | Void setPadX ( Int u ) { m_aiPad[0] = u; } |
---|
482 | Void setPadY ( Int u ) { m_aiPad[1] = u; } |
---|
483 | Int getPad ( Int u ) { assert(u < 2); return m_aiPad[u];} |
---|
484 | Int* getPad ( ) { return m_aiPad; } |
---|
485 | #endif |
---|
486 | |
---|
487 | // physical transform |
---|
488 | Void setMaxTrSize ( UInt u ) { m_uiMaxTrSize = u; } |
---|
489 | UInt getMaxTrSize () { return m_uiMaxTrSize; } |
---|
490 | |
---|
491 | // Tool list |
---|
492 | Bool getUseALF () { return m_bUseALF; } |
---|
493 | #if LCU_SYNTAX_ALF |
---|
494 | Void setUseALFCoefInSlice(Bool b) {m_bALFCoefInSlice = b;} |
---|
495 | Bool getUseALFCoefInSlice() {return m_bALFCoefInSlice;} |
---|
496 | #endif |
---|
497 | |
---|
498 | #if !PIC_CROPPING |
---|
499 | Bool getUsePAD () { return m_bUsePAD; } |
---|
500 | Void setUsePAD ( Bool b ) { m_bUsePAD = b; } |
---|
501 | #endif |
---|
502 | Void setUseALF ( Bool b ) { m_bUseALF = b; } |
---|
503 | Void setUseLComb (Bool b) { m_bUseLComb = b; } |
---|
504 | Bool getUseLComb () { return m_bUseLComb; } |
---|
505 | Void setLCMod (Bool b) { m_bLCMod = b; } |
---|
506 | Bool getLCMod () { return m_bLCMod; } |
---|
507 | |
---|
508 | Bool getUseLMChroma () { return m_bUseLMChroma; } |
---|
509 | Void setUseLMChroma ( Bool b ) { m_bUseLMChroma = b; } |
---|
510 | |
---|
511 | #if LOSSLESS_CODING |
---|
512 | Bool getUseLossless () { return m_useLossless; } |
---|
513 | Void setUseLossless ( Bool b ) { m_useLossless = b; } |
---|
514 | #endif |
---|
515 | Bool getUseNSQT() { return m_useNSQT; } |
---|
516 | Void setUseNSQT( Bool b ) { m_useNSQT = b; } |
---|
517 | |
---|
518 | #if H0412_REF_PIC_LIST_RESTRICTION |
---|
519 | Bool getRestrictedRefPicListsFlag () { return m_restrictedRefPicListsFlag; } |
---|
520 | Void setRestrictedRefPicListsFlag ( Bool b ) { m_restrictedRefPicListsFlag = b; } |
---|
521 | Bool getListsModificationPresentFlag () { return m_listsModificationPresentFlag; } |
---|
522 | Void setListsModificationPresentFlag ( Bool b ) { m_listsModificationPresentFlag = b; } |
---|
523 | #endif |
---|
524 | |
---|
525 | // AMVP mode (for each depth) |
---|
526 | AMVP_MODE getAMVPMode ( UInt uiDepth ) { assert(uiDepth < g_uiMaxCUDepth); return m_aeAMVPMode[uiDepth]; } |
---|
527 | Void setAMVPMode ( UInt uiDepth, AMVP_MODE eMode) { assert(uiDepth < g_uiMaxCUDepth); m_aeAMVPMode[uiDepth] = eMode; } |
---|
528 | |
---|
529 | // AMP accuracy |
---|
530 | Int getAMPAcc ( UInt uiDepth ) { return m_iAMPAcc[uiDepth]; } |
---|
531 | Void setAMPAcc ( UInt uiDepth, Int iAccu ) { assert( uiDepth < g_uiMaxCUDepth); m_iAMPAcc[uiDepth] = iAccu; } |
---|
532 | |
---|
533 | // Bit-depth |
---|
534 | UInt getBitDepth () { return m_uiBitDepth; } |
---|
535 | Void setBitDepth ( UInt u ) { m_uiBitDepth = u; } |
---|
536 | UInt getBitIncrement () { return m_uiBitIncrement; } |
---|
537 | Void setBitIncrement ( UInt u ) { m_uiBitIncrement = u; } |
---|
538 | #if H0736_AVC_STYLE_QP_RANGE |
---|
539 | Int getQpBDOffsetY () { return m_qpBDOffsetY; } |
---|
540 | Void setQpBDOffsetY ( Int value ) { m_qpBDOffsetY = value; } |
---|
541 | Int getQpBDOffsetC () { return m_qpBDOffsetC; } |
---|
542 | Void setQpBDOffsetC ( Int value ) { m_qpBDOffsetC = value; } |
---|
543 | #endif |
---|
544 | |
---|
545 | Void setLFCrossSliceBoundaryFlag ( Bool bValue ) { m_bLFCrossSliceBoundaryFlag = bValue; } |
---|
546 | Bool getLFCrossSliceBoundaryFlag () { return m_bLFCrossSliceBoundaryFlag; } |
---|
547 | |
---|
548 | Void setUseDF ( Bool b ) { m_useDF = b; } |
---|
549 | Bool getUseDF () { return m_useDF; } |
---|
550 | |
---|
551 | Void setUseSAO (Bool bVal) {m_bUseSAO = bVal;} |
---|
552 | Bool getUseSAO () {return m_bUseSAO;} |
---|
553 | |
---|
554 | #if HHI_MPI |
---|
555 | Void setUseMVI (Bool bVal) {m_bUseMVI = bVal;} |
---|
556 | Bool getUseMVI () {return m_bUseMVI;} |
---|
557 | #endif |
---|
558 | |
---|
559 | #if RWTH_SDC_DLT_B0036 |
---|
560 | Bool getUseDLT () { return m_bUseDLT; } |
---|
561 | Void setUseDLT ( Bool b ) { m_bUseDLT = b; } |
---|
562 | |
---|
563 | UInt getBitsPerDepthValue() { return m_bUseDLT?m_uiBitsPerDepthValue:g_uiBitDepth; } |
---|
564 | UInt getNumDepthValues() { return m_bUseDLT?m_uiNumDepthmapValues:g_uiIBDI_MAX; } |
---|
565 | UInt depthValue2idx(Pel uiValue) { return m_bUseDLT?m_uiDepthValue2Idx[uiValue]:uiValue; } |
---|
566 | Pel idx2DepthValue(UInt uiIdx) { return m_bUseDLT?m_uiIdx2DepthValue[uiIdx]:uiIdx; } |
---|
567 | Void setDepthLUTs (UInt* uidx2DepthValue = NULL, UInt uiNumDepthValues = 0); |
---|
568 | #endif |
---|
569 | |
---|
570 | UInt getMaxTLayers() { return m_uiMaxTLayers; } |
---|
571 | Void setMaxTLayers( UInt uiMaxTLayers ) { assert( uiMaxTLayers <= MAX_TLAYER ); m_uiMaxTLayers = uiMaxTLayers; } |
---|
572 | |
---|
573 | Bool getTemporalIdNestingFlag() { return m_bTemporalIdNestingFlag; } |
---|
574 | Void setTemporalIdNestingFlag( Bool bValue ) { m_bTemporalIdNestingFlag = bValue; } |
---|
575 | UInt getPCMBitDepthLuma () { return m_uiPCMBitDepthLuma; } |
---|
576 | Void setPCMBitDepthLuma ( UInt u ) { m_uiPCMBitDepthLuma = u; } |
---|
577 | UInt getPCMBitDepthChroma () { return m_uiPCMBitDepthChroma; } |
---|
578 | Void setPCMBitDepthChroma ( UInt u ) { m_uiPCMBitDepthChroma = u; } |
---|
579 | Void setPCMFilterDisableFlag ( Bool bValue ) { m_bPCMFilterDisableFlag = bValue; } |
---|
580 | Bool getPCMFilterDisableFlag () { return m_bPCMFilterDisableFlag; } |
---|
581 | |
---|
582 | Void setLFCrossTileBoundaryFlag ( Bool bValue ) { m_bLFCrossTileBoundaryFlag = bValue; } |
---|
583 | Bool getLFCrossTileBoundaryFlag () { return m_bLFCrossTileBoundaryFlag; } |
---|
584 | Void setUniformSpacingIdr ( Int i ) { m_iUniformSpacingIdr = i; } |
---|
585 | Int getUniformSpacingIdr () { return m_iUniformSpacingIdr; } |
---|
586 | #if !REMOVE_TILE_DEPENDENCE |
---|
587 | Void setTileBoundaryIndependenceIdr ( Int i ) { m_iTileBoundaryIndependenceIdr = i; } |
---|
588 | Int getTileBoundaryIndependenceIdr () { return m_iTileBoundaryIndependenceIdr; } |
---|
589 | #endif |
---|
590 | Void setNumColumnsMinus1 ( Int i ) { m_iNumColumnsMinus1 = i; } |
---|
591 | Int getNumColumnsMinus1 () { return m_iNumColumnsMinus1; } |
---|
592 | Void setColumnWidth ( UInt* columnWidth ) |
---|
593 | { |
---|
594 | if( m_iUniformSpacingIdr == 0 && m_iNumColumnsMinus1 > 0 ) |
---|
595 | { |
---|
596 | m_puiColumnWidth = new UInt[ m_iNumColumnsMinus1 ]; |
---|
597 | |
---|
598 | for(Int i=0; i<m_iNumColumnsMinus1; i++) |
---|
599 | { |
---|
600 | m_puiColumnWidth[i] = columnWidth[i]; |
---|
601 | } |
---|
602 | } |
---|
603 | } |
---|
604 | UInt getColumnWidth (UInt columnIdx) { return *( m_puiColumnWidth + columnIdx ); } |
---|
605 | Void setNumRowsMinus1( Int i ) { m_iNumRowsMinus1 = i; } |
---|
606 | Int getNumRowsMinus1() { return m_iNumRowsMinus1; } |
---|
607 | Void setRowHeight ( UInt* rowHeight ) |
---|
608 | { |
---|
609 | if( m_iUniformSpacingIdr == 0 && m_iNumRowsMinus1 > 0 ) |
---|
610 | { |
---|
611 | m_puiRowHeight = new UInt[ m_iNumRowsMinus1 ]; |
---|
612 | |
---|
613 | for(Int i=0; i<m_iNumRowsMinus1; i++) |
---|
614 | { |
---|
615 | m_puiRowHeight[i] = rowHeight[i]; |
---|
616 | } |
---|
617 | } |
---|
618 | } |
---|
619 | UInt getRowHeight (UInt rowIdx) { return *( m_puiRowHeight + rowIdx ); } |
---|
620 | Bool getScalingListFlag () { return m_scalingListEnabledFlag; } |
---|
621 | Void setScalingListFlag ( Bool b ) { m_scalingListEnabledFlag = b; } |
---|
622 | #if H0567_DPB_PARAMETERS_PER_TEMPORAL_LAYER |
---|
623 | UInt getMaxDecPicBuffering (UInt tlayer) { return m_uiMaxDecPicBuffering[tlayer]; } |
---|
624 | Void setMaxDecPicBuffering ( UInt ui, UInt tlayer ) { m_uiMaxDecPicBuffering[tlayer] = ui; } |
---|
625 | UInt getMaxLatencyIncrease (UInt tlayer) { return m_uiMaxLatencyIncrease[tlayer]; } |
---|
626 | Void setMaxLatencyIncrease ( UInt ui , UInt tlayer) { m_uiMaxLatencyIncrease[tlayer] = ui; } |
---|
627 | #else |
---|
628 | UInt getMaxDecFrameBuffering () { return m_uiMaxDecFrameBuffering; } |
---|
629 | Void setMaxDecFrameBuffering ( UInt ui ) { m_uiMaxDecFrameBuffering = ui; } |
---|
630 | UInt getMaxLatencyIncrease () { return m_uiMaxLatencyIncrease; } |
---|
631 | Void setMaxLatencyIncrease ( UInt ui ) { m_uiMaxLatencyIncrease= ui; } |
---|
632 | #endif |
---|
633 | #if TILES_WPP_ENTRY_POINT_SIGNALLING |
---|
634 | UInt getTilesOrEntropyCodingSyncIdc () { return m_tilesOrEntropyCodingSyncIdc; } |
---|
635 | Void setTilesOrEntropyCodingSyncIdc ( UInt val ) { m_tilesOrEntropyCodingSyncIdc = val; } |
---|
636 | Int getNumSubstreams () { return m_numSubstreams; } |
---|
637 | Void setNumSubstreams ( Int numSubstreams ) { m_numSubstreams = numSubstreams; } |
---|
638 | #endif |
---|
639 | |
---|
640 | #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX |
---|
641 | Bool getUseDMM() { return m_bUseDMM; } |
---|
642 | Void setUseDMM( Bool b ) { m_bUseDMM = b; } |
---|
643 | #endif |
---|
644 | |
---|
645 | #if OL_QTLIMIT_PREDCODING_B0068 |
---|
646 | Void setUseQTLPC( Bool b ) { m_bUseQTLPC = b; } |
---|
647 | Bool getUseQTLPC() { return m_bUseQTLPC; } |
---|
648 | #endif |
---|
649 | |
---|
650 | Void initMultiviewSPS ( UInt uiViewId, Int iViewOrderIdx = 0, UInt uiCamParPrecision = 0, Bool bCamParSlice = false, Int** aaiScale = 0, Int** aaiOffset = 0 ); |
---|
651 | Void initMultiviewSPSDepth ( UInt uiViewId, Int iViewOrderIdx ); |
---|
652 | |
---|
653 | UInt getViewId () { return m_uiViewId; } |
---|
654 | Int getViewOrderIdx () { return m_iViewOrderIdx; } |
---|
655 | Bool isDepth () { return m_bDepth; } |
---|
656 | UInt getCamParPrecision () { return m_uiCamParPrecision; } |
---|
657 | Bool hasCamParInSliceHeader() { return m_bCamParInSliceHeader; } |
---|
658 | Int* getCodedScale () { return m_aaiCodedScale [0]; } |
---|
659 | Int* getCodedOffset () { return m_aaiCodedOffset[0]; } |
---|
660 | Int* getInvCodedScale () { return m_aaiCodedScale [1]; } |
---|
661 | Int* getInvCodedOffset () { return m_aaiCodedOffset[1]; } |
---|
662 | |
---|
663 | |
---|
664 | #if DEPTH_MAP_GENERATION |
---|
665 | Void setPredDepthMapGeneration( UInt uiViewId, Bool bIsDepth, UInt uiPdmGenMode = 0, UInt uiPdmMvPredMode = 0, UInt uiPdmPrec = 0, Int** aaiPdmScaleNomDelta = 0, Int** aaiPdmOffset = 0 ); |
---|
666 | #endif |
---|
667 | #if HHI_INTER_VIEW_RESIDUAL_PRED |
---|
668 | Void setMultiviewResPredMode ( UInt uiResPrdMode ) { m_uiMultiviewResPredMode = uiResPrdMode; } |
---|
669 | #endif |
---|
670 | |
---|
671 | #if DEPTH_MAP_GENERATION |
---|
672 | UInt getPredDepthMapGeneration() { return m_uiPredDepthMapGeneration; } |
---|
673 | UInt getPdmPrecision () { return m_uiPdmPrecision; } |
---|
674 | Int* getPdmScaleNomDelta () { return m_aiPdmScaleNomDelta; } |
---|
675 | Int* getPdmOffset () { return m_aiPdmOffset; } |
---|
676 | #endif |
---|
677 | |
---|
678 | #if HHI_INTER_VIEW_MOTION_PRED |
---|
679 | UInt getMultiviewMvPredMode () { return m_uiMultiviewMvPredMode; } |
---|
680 | #endif |
---|
681 | #if HHI_INTER_VIEW_RESIDUAL_PRED |
---|
682 | UInt getMultiviewResPredMode () { return m_uiMultiviewResPredMode; } |
---|
683 | #endif |
---|
684 | |
---|
685 | #if DEPTH_MAP_GENERATION |
---|
686 | Void setDepthMapGenerator( TComDepthMapGenerator* pcDepthMapGenerator ) { m_pcDepthMapGenerator = pcDepthMapGenerator; } |
---|
687 | TComDepthMapGenerator* getDepthMapGenerator() { return m_pcDepthMapGenerator; } |
---|
688 | #endif |
---|
689 | #if HHI_INTER_VIEW_RESIDUAL_PRED |
---|
690 | Void setResidualGenerator( TComResidualGenerator* pcResidualGenerator ) { m_pcResidualGenerator = pcResidualGenerator; } |
---|
691 | TComResidualGenerator* getResidualGenerator() { return m_pcResidualGenerator; } |
---|
692 | #endif |
---|
693 | }; |
---|
694 | |
---|
695 | #if !RPS_IN_SPS |
---|
696 | /// Reference Picture Set class |
---|
697 | class TComReferencePictureSet |
---|
698 | { |
---|
699 | private: |
---|
700 | Int m_numberOfPictures; |
---|
701 | Int m_numberOfNegativePictures; |
---|
702 | Int m_numberOfPositivePictures; |
---|
703 | Int m_numberOfLongtermPictures; |
---|
704 | Int m_deltaPOC[MAX_NUM_REF_PICS]; |
---|
705 | Int m_POC[MAX_NUM_REF_PICS]; |
---|
706 | Bool m_used[MAX_NUM_REF_PICS]; |
---|
707 | Bool m_interRPSPrediction; |
---|
708 | Int m_deltaRIdxMinus1; |
---|
709 | Int m_deltaRPS; |
---|
710 | Int m_numRefIdc; |
---|
711 | Int m_refIdc[MAX_NUM_REF_PICS+1]; |
---|
712 | |
---|
713 | public: |
---|
714 | TComReferencePictureSet(); |
---|
715 | virtual ~TComReferencePictureSet(); |
---|
716 | |
---|
717 | Void setUsed(Int bufferNum, Bool used); |
---|
718 | Void setDeltaPOC(Int bufferNum, Int deltaPOC); |
---|
719 | Void setPOC(Int bufferNum, Int deltaPOC); |
---|
720 | Void setNumberOfPictures(Int numberOfPictures); |
---|
721 | |
---|
722 | Int getUsed(Int bufferNum); |
---|
723 | Int getDeltaPOC(Int bufferNum); |
---|
724 | Int getPOC(Int bufferNum); |
---|
725 | Int getNumberOfPictures(); |
---|
726 | |
---|
727 | Void setNumberOfNegativePictures(Int number) { m_numberOfNegativePictures = number; } |
---|
728 | Int getNumberOfNegativePictures() { return m_numberOfNegativePictures; } |
---|
729 | Void setNumberOfPositivePictures(Int number) { m_numberOfPositivePictures = number; } |
---|
730 | Int getNumberOfPositivePictures() { return m_numberOfPositivePictures; } |
---|
731 | Void setNumberOfLongtermPictures(Int number) { m_numberOfLongtermPictures = number; } |
---|
732 | Int getNumberOfLongtermPictures() { return m_numberOfLongtermPictures; } |
---|
733 | |
---|
734 | Void setInterRPSPrediction(Bool flag) { m_interRPSPrediction = flag; } |
---|
735 | Bool getInterRPSPrediction() { return m_interRPSPrediction; } |
---|
736 | Void setDeltaRIdxMinus1(Int x) { m_deltaRIdxMinus1 = x; } |
---|
737 | Int getDeltaRIdxMinus1() { return m_deltaRIdxMinus1; } |
---|
738 | Void setDeltaRPS(Int x) { m_deltaRPS = x; } |
---|
739 | Int getDeltaRPS() { return m_deltaRPS; } |
---|
740 | Void setNumRefIdc(Int x) { m_numRefIdc = x; } |
---|
741 | Int getNumRefIdc() { return m_numRefIdc; } |
---|
742 | |
---|
743 | Void setRefIdc(Int bufferNum, Int refIdc); |
---|
744 | Int getRefIdc(Int bufferNum); |
---|
745 | |
---|
746 | Void sortDeltaPOC(); |
---|
747 | Void printDeltaPOC(); |
---|
748 | }; |
---|
749 | |
---|
750 | /// Reference Picture Set set class |
---|
751 | class TComRPSList |
---|
752 | { |
---|
753 | private: |
---|
754 | Int m_numberOfReferencePictureSets; |
---|
755 | TComReferencePictureSet* m_referencePictureSets; |
---|
756 | |
---|
757 | public: |
---|
758 | TComRPSList(); |
---|
759 | virtual ~TComRPSList(); |
---|
760 | |
---|
761 | Void create (Int numberOfEntries); |
---|
762 | Void destroy (); |
---|
763 | |
---|
764 | |
---|
765 | TComReferencePictureSet* getReferencePictureSet(Int referencePictureSetNum); |
---|
766 | Int getNumberOfReferencePictureSets(); |
---|
767 | Void setNumberOfReferencePictureSets(Int numberOfReferencePictureSets); |
---|
768 | }; |
---|
769 | #endif |
---|
770 | |
---|
771 | /// Reference Picture Lists class |
---|
772 | class TComRefPicListModification |
---|
773 | { |
---|
774 | private: |
---|
775 | UInt m_bRefPicListModificationFlagL0; |
---|
776 | UInt m_bRefPicListModificationFlagL1; |
---|
777 | #if !H0137_0138_LIST_MODIFICATION |
---|
778 | UInt m_uiNumberOfRefPicListModificationsL0; |
---|
779 | UInt m_uiNumberOfRefPicListModificationsL1; |
---|
780 | UInt m_ListIdcL0[32]; |
---|
781 | #endif |
---|
782 | UInt m_RefPicSetIdxL0[32]; |
---|
783 | #if !H0137_0138_LIST_MODIFICATION |
---|
784 | UInt m_ListIdcL1[32]; |
---|
785 | #endif |
---|
786 | UInt m_RefPicSetIdxL1[32]; |
---|
787 | |
---|
788 | public: |
---|
789 | TComRefPicListModification(); |
---|
790 | virtual ~TComRefPicListModification(); |
---|
791 | |
---|
792 | Void create (); |
---|
793 | Void destroy (); |
---|
794 | |
---|
795 | Bool getRefPicListModificationFlagL0() { return m_bRefPicListModificationFlagL0; } |
---|
796 | Void setRefPicListModificationFlagL0(Bool flag) { m_bRefPicListModificationFlagL0 = flag; } |
---|
797 | Bool getRefPicListModificationFlagL1() { return m_bRefPicListModificationFlagL1; } |
---|
798 | Void setRefPicListModificationFlagL1(Bool flag) { m_bRefPicListModificationFlagL1 = flag; } |
---|
799 | #if !H0137_0138_LIST_MODIFICATION |
---|
800 | UInt getNumberOfRefPicListModificationsL0() { return m_uiNumberOfRefPicListModificationsL0; } |
---|
801 | Void setNumberOfRefPicListModificationsL0(UInt nr) { m_uiNumberOfRefPicListModificationsL0 = nr; } |
---|
802 | UInt getNumberOfRefPicListModificationsL1() { return m_uiNumberOfRefPicListModificationsL1; } |
---|
803 | Void setNumberOfRefPicListModificationsL1(UInt nr) { m_uiNumberOfRefPicListModificationsL1 = nr; } |
---|
804 | Void setListIdcL0(UInt idx, UInt idc) { m_ListIdcL0[idx] = idc; } |
---|
805 | UInt getListIdcL0(UInt idx) { return m_ListIdcL0[idx]; } |
---|
806 | #endif |
---|
807 | Void setRefPicSetIdxL0(UInt idx, UInt refPicSetIdx) { m_RefPicSetIdxL0[idx] = refPicSetIdx; } |
---|
808 | UInt getRefPicSetIdxL0(UInt idx) { return m_RefPicSetIdxL0[idx]; } |
---|
809 | #if !H0137_0138_LIST_MODIFICATION |
---|
810 | Void setListIdcL1(UInt idx, UInt idc) { m_ListIdcL1[idx] = idc; } |
---|
811 | UInt getListIdcL1(UInt idx) { return m_ListIdcL1[idx]; } |
---|
812 | #endif |
---|
813 | Void setRefPicSetIdxL1(UInt idx, UInt refPicSetIdx) { m_RefPicSetIdxL1[idx] = refPicSetIdx; } |
---|
814 | UInt getRefPicSetIdxL1(UInt idx) { return m_RefPicSetIdxL1[idx]; } |
---|
815 | }; |
---|
816 | |
---|
817 | /// PPS class |
---|
818 | class TComPPS |
---|
819 | { |
---|
820 | private: |
---|
821 | Int m_PPSId; // pic_parameter_set_id |
---|
822 | Int m_SPSId; // seq_parameter_set_id |
---|
823 | Int m_picInitQPMinus26; |
---|
824 | Bool m_useDQP; |
---|
825 | Bool m_bConstrainedIntraPred; // constrained_intra_pred_flag |
---|
826 | |
---|
827 | // access channel |
---|
828 | TComSPS* m_pcSPS; |
---|
829 | #if !RPS_IN_SPS |
---|
830 | TComRPSList* m_RPSList; |
---|
831 | #endif |
---|
832 | UInt m_uiMaxCuDQPDepth; |
---|
833 | UInt m_uiMinCuDQPSize; |
---|
834 | |
---|
835 | Int m_iChromaQpOffset; |
---|
836 | Int m_iChromaQpOffset2nd; |
---|
837 | |
---|
838 | #if !RPS_IN_SPS |
---|
839 | Bool m_bLongTermRefsPresent; |
---|
840 | #endif |
---|
841 | |
---|
842 | #if !H0566_TLA |
---|
843 | UInt m_uiNumTlayerSwitchingFlags; // num_temporal_layer_switching_point_flags |
---|
844 | Bool m_abTLayerSwitchingFlag[ MAX_TLAYER ]; // temporal_layer_switching_point_flag |
---|
845 | #endif |
---|
846 | |
---|
847 | Int m_iSliceGranularity; |
---|
848 | |
---|
849 | Bool m_bUseWeightPred; // Use of Weighting Prediction (P_SLICE) |
---|
850 | UInt m_uiBiPredIdc; // Use of Weighting Bi-Prediction (B_SLICE) |
---|
851 | |
---|
852 | #if H0388 |
---|
853 | Bool m_OutputFlagPresentFlag; // Indicates the presence of output_flag in slice header |
---|
854 | #endif |
---|
855 | |
---|
856 | Int m_iTileBehaviorControlPresentFlag; |
---|
857 | Bool m_bLFCrossTileBoundaryFlag; |
---|
858 | Int m_iColumnRowInfoPresent; |
---|
859 | Int m_iUniformSpacingIdr; |
---|
860 | #if !REMOVE_TILE_DEPENDENCE |
---|
861 | Int m_iTileBoundaryIndependenceIdr; |
---|
862 | #endif |
---|
863 | Int m_iNumColumnsMinus1; |
---|
864 | UInt* m_puiColumnWidth; |
---|
865 | Int m_iNumRowsMinus1; |
---|
866 | UInt* m_puiRowHeight; |
---|
867 | |
---|
868 | Int m_iEntropyCodingMode; // !!! in PPS now, but also remains in slice header! |
---|
869 | #if !WPP_SIMPLIFICATION |
---|
870 | Int m_iEntropyCodingSynchro; |
---|
871 | Bool m_bCabacIstateReset; |
---|
872 | #endif |
---|
873 | Int m_iNumSubstreams; |
---|
874 | |
---|
875 | Bool m_enableTMVPFlag; |
---|
876 | |
---|
877 | #if MULTIBITS_DATA_HIDING |
---|
878 | Int m_signHideFlag; |
---|
879 | Int m_signHidingThreshold; |
---|
880 | #endif |
---|
881 | |
---|
882 | #if CABAC_INIT_FLAG |
---|
883 | Bool m_cabacInitPresentFlag; |
---|
884 | UInt m_encCABACTableIdx; // Used to transmit table selection across slices |
---|
885 | #if POZNAN_CABAC_INIT_FLAG_FIX |
---|
886 | UInt m_encPrevPOC; |
---|
887 | #endif |
---|
888 | #endif |
---|
889 | #if DBL_CONTROL |
---|
890 | Bool m_DeblockingFilterControlPresent; |
---|
891 | #endif |
---|
892 | #if PARALLEL_MERGE |
---|
893 | UInt m_log2ParallelMergeLevelMinus2; |
---|
894 | #endif |
---|
895 | public: |
---|
896 | TComPPS(); |
---|
897 | virtual ~TComPPS(); |
---|
898 | |
---|
899 | Int getPPSId () { return m_PPSId; } |
---|
900 | Void setPPSId (Int i) { m_PPSId = i; } |
---|
901 | Int getSPSId () { return m_SPSId; } |
---|
902 | Void setSPSId (Int i) { m_SPSId = i; } |
---|
903 | |
---|
904 | Int getSliceGranularity() { return m_iSliceGranularity; } |
---|
905 | Void setSliceGranularity( Int i ) { m_iSliceGranularity = i; } |
---|
906 | Int getPicInitQPMinus26 () { return m_picInitQPMinus26; } |
---|
907 | Void setPicInitQPMinus26 ( Int i ) { m_picInitQPMinus26 = i; } |
---|
908 | Bool getUseDQP () { return m_useDQP; } |
---|
909 | Void setUseDQP ( Bool b ) { m_useDQP = b; } |
---|
910 | Bool getConstrainedIntraPred () { return m_bConstrainedIntraPred; } |
---|
911 | Void setConstrainedIntraPred ( Bool b ) { m_bConstrainedIntraPred = b; } |
---|
912 | |
---|
913 | #if !H0566_TLA |
---|
914 | UInt getNumTLayerSwitchingFlags() { return m_uiNumTlayerSwitchingFlags; } |
---|
915 | Void setNumTLayerSwitchingFlags( UInt uiNumTlayerSwitchingFlags ) { assert( uiNumTlayerSwitchingFlags < MAX_TLAYER ); m_uiNumTlayerSwitchingFlags = uiNumTlayerSwitchingFlags; } |
---|
916 | |
---|
917 | Bool getTLayerSwitchingFlag( UInt uiTLayer ) { assert( uiTLayer < MAX_TLAYER ); return m_abTLayerSwitchingFlag[ uiTLayer ]; } |
---|
918 | Void setTLayerSwitchingFlag( UInt uiTLayer, Bool bValue ) { m_abTLayerSwitchingFlag[ uiTLayer ] = bValue; } |
---|
919 | #endif |
---|
920 | |
---|
921 | #if !RPS_IN_SPS |
---|
922 | Bool getLongTermRefsPresent() { return m_bLongTermRefsPresent; } |
---|
923 | Void setLongTermRefsPresent(Bool b) { m_bLongTermRefsPresent=b; } |
---|
924 | #endif |
---|
925 | Void setSPS ( TComSPS* pcSPS ) { m_pcSPS = pcSPS; } |
---|
926 | TComSPS* getSPS () { return m_pcSPS; } |
---|
927 | #if !RPS_IN_SPS |
---|
928 | Void setRPSList ( TComRPSList* RPSList ) { m_RPSList = RPSList; } |
---|
929 | TComRPSList* getRPSList () { return m_RPSList; } |
---|
930 | #endif |
---|
931 | Void setMaxCuDQPDepth ( UInt u ) { m_uiMaxCuDQPDepth = u; } |
---|
932 | UInt getMaxCuDQPDepth () { return m_uiMaxCuDQPDepth;} |
---|
933 | Void setMinCuDQPSize ( UInt u ) { m_uiMinCuDQPSize = u; } |
---|
934 | UInt getMinCuDQPSize () { return m_uiMinCuDQPSize; } |
---|
935 | |
---|
936 | Void setChromaQpOffset ( Int i ) { m_iChromaQpOffset = i; } |
---|
937 | Int getChromaQpOffset () { return m_iChromaQpOffset;} |
---|
938 | Void setChromaQpOffset2nd( Int i ) { m_iChromaQpOffset2nd = i; } |
---|
939 | Int getChromaQpOffset2nd() { return m_iChromaQpOffset2nd;} |
---|
940 | |
---|
941 | Bool getUseWP () { return m_bUseWeightPred; } |
---|
942 | UInt getWPBiPredIdc () { return m_uiBiPredIdc; } |
---|
943 | |
---|
944 | Void setUseWP ( Bool b ) { m_bUseWeightPred = b; } |
---|
945 | Void setWPBiPredIdc ( UInt u ) { m_uiBiPredIdc = u; } |
---|
946 | |
---|
947 | #if H0388 |
---|
948 | Void setOutputFlagPresentFlag( Bool b ) { m_OutputFlagPresentFlag = b; } |
---|
949 | Bool getOutputFlagPresentFlag() { return m_OutputFlagPresentFlag; } |
---|
950 | #endif |
---|
951 | |
---|
952 | Void setTileBehaviorControlPresentFlag ( Int i ) { m_iTileBehaviorControlPresentFlag = i; } |
---|
953 | Int getTileBehaviorControlPresentFlag () { return m_iTileBehaviorControlPresentFlag; } |
---|
954 | Void setLFCrossTileBoundaryFlag ( Bool bValue ) { m_bLFCrossTileBoundaryFlag = bValue; } |
---|
955 | Bool getLFCrossTileBoundaryFlag () { return m_bLFCrossTileBoundaryFlag; } |
---|
956 | Void setColumnRowInfoPresent ( Int i ) { m_iColumnRowInfoPresent = i; } |
---|
957 | Int getColumnRowInfoPresent () { return m_iColumnRowInfoPresent; } |
---|
958 | Void setUniformSpacingIdr ( Int i ) { m_iUniformSpacingIdr = i; } |
---|
959 | Int getUniformSpacingIdr () { return m_iUniformSpacingIdr; } |
---|
960 | #if !REMOVE_TILE_DEPENDENCE |
---|
961 | Void setTileBoundaryIndependenceIdr ( Int i ) { m_iTileBoundaryIndependenceIdr = i; } |
---|
962 | Int getTileBoundaryIndependenceIdr () { return m_iTileBoundaryIndependenceIdr; } |
---|
963 | #endif |
---|
964 | Void setNumColumnsMinus1 ( Int i ) { m_iNumColumnsMinus1 = i; } |
---|
965 | Int getNumColumnsMinus1 () { return m_iNumColumnsMinus1; } |
---|
966 | Void setColumnWidth ( UInt* columnWidth ) |
---|
967 | { |
---|
968 | if( m_iUniformSpacingIdr == 0 && m_iNumColumnsMinus1 > 0 ) |
---|
969 | { |
---|
970 | m_puiColumnWidth = new UInt[ m_iNumColumnsMinus1 ]; |
---|
971 | |
---|
972 | for(Int i=0; i<m_iNumColumnsMinus1; i++) |
---|
973 | { |
---|
974 | m_puiColumnWidth[i] = columnWidth[i]; |
---|
975 | } |
---|
976 | } |
---|
977 | } |
---|
978 | UInt getColumnWidth (UInt columnIdx) { return *( m_puiColumnWidth + columnIdx ); } |
---|
979 | Void setNumRowsMinus1( Int i ) { m_iNumRowsMinus1 = i; } |
---|
980 | Int getNumRowsMinus1() { return m_iNumRowsMinus1; } |
---|
981 | Void setRowHeight ( UInt* rowHeight ) |
---|
982 | { |
---|
983 | if( m_iUniformSpacingIdr == 0 && m_iNumRowsMinus1 > 0 ) |
---|
984 | { |
---|
985 | m_puiRowHeight = new UInt[ m_iNumRowsMinus1 ]; |
---|
986 | |
---|
987 | for(Int i=0; i<m_iNumRowsMinus1; i++) |
---|
988 | { |
---|
989 | m_puiRowHeight[i] = rowHeight[i]; |
---|
990 | } |
---|
991 | } |
---|
992 | } |
---|
993 | UInt getRowHeight (UInt rowIdx) { return *( m_puiRowHeight + rowIdx ); } |
---|
994 | Void setEntropyCodingMode(Int iEntropyCodingMode) { m_iEntropyCodingMode = iEntropyCodingMode; } |
---|
995 | Int getEntropyCodingMode() { return m_iEntropyCodingMode; } |
---|
996 | #if !WPP_SIMPLIFICATION |
---|
997 | Void setEntropyCodingSynchro(Int iEntropyCodingSynchro) { m_iEntropyCodingSynchro = iEntropyCodingSynchro; } |
---|
998 | Int getEntropyCodingSynchro() { return m_iEntropyCodingSynchro; } |
---|
999 | Void setCabacIstateReset(Bool bCabacIstateReset) { m_bCabacIstateReset = bCabacIstateReset; } |
---|
1000 | Bool getCabacIstateReset() { return m_bCabacIstateReset; } |
---|
1001 | #endif |
---|
1002 | Void setNumSubstreams(Int iNumSubstreams) { m_iNumSubstreams = iNumSubstreams; } |
---|
1003 | Int getNumSubstreams() { return m_iNumSubstreams; } |
---|
1004 | |
---|
1005 | #if MULTIBITS_DATA_HIDING |
---|
1006 | Void setSignHideFlag( Int signHideFlag ) { m_signHideFlag = signHideFlag; } |
---|
1007 | Void setTSIG( Int tsig ) { m_signHidingThreshold = tsig; } |
---|
1008 | Int getSignHideFlag() { return m_signHideFlag; } |
---|
1009 | Int getTSIG() { return m_signHidingThreshold; } |
---|
1010 | #endif |
---|
1011 | |
---|
1012 | Void setEnableTMVPFlag( Bool b ) { m_enableTMVPFlag = b; } |
---|
1013 | Bool getEnableTMVPFlag() { return m_enableTMVPFlag; } |
---|
1014 | |
---|
1015 | #if CABAC_INIT_FLAG |
---|
1016 | Void setCabacInitPresentFlag( Bool flag ) { m_cabacInitPresentFlag = flag; } |
---|
1017 | Void setEncCABACTableIdx( Int idx ) { m_encCABACTableIdx = idx; } |
---|
1018 | Bool getCabacInitPresentFlag() { return m_cabacInitPresentFlag; } |
---|
1019 | UInt getEncCABACTableIdx() { return m_encCABACTableIdx; } |
---|
1020 | #if POZNAN_CABAC_INIT_FLAG_FIX |
---|
1021 | Void setEncPrevPOC(UInt uiPOC) { m_encPrevPOC = uiPOC; } |
---|
1022 | UInt getEncPrevPOC() { return m_encPrevPOC; } |
---|
1023 | #endif |
---|
1024 | #endif |
---|
1025 | #if DBL_CONTROL |
---|
1026 | Void setDeblockingFilterControlPresent ( Bool bValue ) { m_DeblockingFilterControlPresent = bValue; } |
---|
1027 | Bool getDeblockingFilterControlPresent () { return m_DeblockingFilterControlPresent; } |
---|
1028 | #endif |
---|
1029 | #if PARALLEL_MERGE |
---|
1030 | UInt getLog2ParallelMergeLevelMinus2 () { return m_log2ParallelMergeLevelMinus2; } |
---|
1031 | Void setLog2ParallelMergeLevelMinus2 (UInt mrgLevel) { m_log2ParallelMergeLevelMinus2 = mrgLevel; } |
---|
1032 | #endif |
---|
1033 | }; |
---|
1034 | |
---|
1035 | /// SCALING_LIST class |
---|
1036 | class TComScalingList |
---|
1037 | { |
---|
1038 | public: |
---|
1039 | TComScalingList(); |
---|
1040 | virtual ~TComScalingList(); |
---|
1041 | Void setScalingListPresentFlag (Bool b) { m_scalingListPresentFlag = b; } |
---|
1042 | Bool getScalingListPresentFlag () { return m_scalingListPresentFlag; } |
---|
1043 | Int* getScalingListAddress (UInt sizeId, UInt listId) { return m_scalingListCoef[sizeId][listId]; } //!< get matrix coefficient |
---|
1044 | Bool checkPredMode (UInt sizeId, UInt listId); |
---|
1045 | Void setRefMatrixId (UInt sizeId, UInt listId, UInt u) { m_refMatrixId[sizeId][listId] = u; } //!< set reference matrix ID |
---|
1046 | UInt getRefMatrixId (UInt sizeId, UInt listId) { return m_refMatrixId[sizeId][listId]; } //!< get reference matrix ID |
---|
1047 | Int* getScalingListDefaultAddress (UInt sizeId, UInt listId); //!< get default matrix coefficient |
---|
1048 | Void processDefaultMarix (UInt sizeId, UInt listId); |
---|
1049 | #if SCALING_LIST |
---|
1050 | Void setScalingListDC (UInt sizeId, UInt listId, UInt u) { m_scalingListDC[sizeId][listId] = u; } //!< set DC value |
---|
1051 | Int getScalingListDC (UInt sizeId, UInt listId) { return m_scalingListDC[sizeId][listId]; } //!< get DC value |
---|
1052 | Void checkDcOfMatrix (); |
---|
1053 | Void setUseDefaultScalingMatrixFlag (UInt sizeId, UInt listId, Bool b) { m_useDefaultScalingMatrixFlag[sizeId][listId] = b; } //!< set default matrix enabled/disabled in each matrix |
---|
1054 | Bool getUseDefaultScalingMatrixFlag (UInt sizeId, UInt listId) { return m_useDefaultScalingMatrixFlag[sizeId][listId]; } //!< get default matrix enabled/disabled in each matrix |
---|
1055 | #endif |
---|
1056 | Void processRefMatrix (UInt sizeId, UInt listId , UInt refListId ); |
---|
1057 | Bool xParseScalingList (char* pchFile); |
---|
1058 | |
---|
1059 | private: |
---|
1060 | Void init (); |
---|
1061 | Void destroy (); |
---|
1062 | #if SCALING_LIST |
---|
1063 | Int m_scalingListDC [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< the DC value of the matrix coefficient for 16x16 |
---|
1064 | Bool m_useDefaultScalingMatrixFlag [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< UseDefaultScalingMatrixFlag |
---|
1065 | #endif |
---|
1066 | UInt m_refMatrixId [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< RefMatrixID |
---|
1067 | Bool m_scalingListPresentFlag; //!< flag for using default matrix |
---|
1068 | UInt m_predMatrixId [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< reference list index |
---|
1069 | Int *m_scalingListCoef [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< quantization matrix |
---|
1070 | }; |
---|
1071 | |
---|
1072 | /// APS class |
---|
1073 | class TComAPS |
---|
1074 | { |
---|
1075 | public: |
---|
1076 | TComAPS(); |
---|
1077 | virtual ~TComAPS(); |
---|
1078 | |
---|
1079 | Void setAPSID (Int iID) {m_apsID = iID; } //!< set APS ID |
---|
1080 | Int getAPSID () {return m_apsID; } //!< get APS ID |
---|
1081 | Void setSaoEnabled (Bool bVal) {m_bSaoEnabled = bVal; } //!< set SAO enabled/disabled in APS |
---|
1082 | Bool getSaoEnabled () {return m_bSaoEnabled; } //!< get SAO enabled/disabled in APS |
---|
1083 | Void setAlfEnabled (Bool bVal) {m_bAlfEnabled = bVal; } //!< set ALF enabled/disabled in APS |
---|
1084 | Bool getAlfEnabled () {return m_bAlfEnabled; } //!< get ALF enabled/disabled in APS |
---|
1085 | |
---|
1086 | #if LCU_SYNTAX_ALF |
---|
1087 | AlfParamSet* getAlfParam () {return m_alfParamSet;} |
---|
1088 | #else |
---|
1089 | ALFParam* getAlfParam () {return m_pAlfParam; } //!< get ALF parameters in APS |
---|
1090 | #endif |
---|
1091 | SAOParam* getSaoParam () {return m_pSaoParam; } //!< get SAO parameters in APS |
---|
1092 | |
---|
1093 | Void createSaoParam(); //!< create SAO parameter object |
---|
1094 | Void destroySaoParam(); //!< destroy SAO parameter object |
---|
1095 | |
---|
1096 | Void createAlfParam(); //!< create ALF parameter object |
---|
1097 | Void destroyAlfParam(); //!< destroy ALF parameter object |
---|
1098 | |
---|
1099 | Void setLoopFilterOffsetInAPS(Bool val) {m_loopFilterOffsetInAPS = val; } //!< set offset for deblocking filter enabled/disabled in APS |
---|
1100 | Bool getLoopFilterOffsetInAPS() {return m_loopFilterOffsetInAPS; } //!< get offset for deblocking filter enabled/disabled in APS |
---|
1101 | Void setLoopFilterDisable(Bool val) {m_loopFilterDisable = val; } //!< set offset for deblocking filter disabled |
---|
1102 | Bool getLoopFilterDisable() {return m_loopFilterDisable; } //!< get offset for deblocking filter disabled |
---|
1103 | Void setLoopFilterBetaOffset(Int val) {m_loopFilterBetaOffsetDiv2 = val; } //!< set beta offset for deblocking filter |
---|
1104 | Int getLoopFilterBetaOffset() {return m_loopFilterBetaOffsetDiv2; } //!< get beta offset for deblocking filter |
---|
1105 | Void setLoopFilterTcOffset(Int val) {m_loopFilterTcOffsetDiv2 = val; } //!< set tc offset for deblocking filter |
---|
1106 | Int getLoopFilterTcOffset() {return m_loopFilterTcOffsetDiv2; } //!< get tc offset for deblocking filter |
---|
1107 | |
---|
1108 | Void createScalingList(); |
---|
1109 | Void destroyScalingList(); |
---|
1110 | Void setScalingListEnabled (Bool bVal) { m_scalingListEnabled = bVal; } //!< set ScalingList enabled/disabled in APS |
---|
1111 | Bool getScalingListEnabled () { return m_scalingListEnabled; } //!< get ScalingList enabled/disabled in APS |
---|
1112 | TComScalingList* getScalingList () { return m_scalingList; } //!< get ScalingList class pointer in APS |
---|
1113 | #if SAO_UNIT_INTERLEAVING |
---|
1114 | Bool getSaoInterleavingFlag() {return m_saoInterleavingFlag;} //!< get SAO interleaving flag in APS |
---|
1115 | Void setSaoInterleavingFlag(Bool bVal) {m_saoInterleavingFlag = bVal;} //!< set SAO interleaving flag in APS |
---|
1116 | #endif |
---|
1117 | |
---|
1118 | private: |
---|
1119 | Int m_apsID; //!< APS ID |
---|
1120 | Bool m_bSaoEnabled; //!< SAO enabled/disabled in APS (true for enabled) |
---|
1121 | Bool m_bAlfEnabled; //!< ALF enabled/disabled in APS (true for enabled) |
---|
1122 | SAOParam* m_pSaoParam; //!< SAO parameter object pointer |
---|
1123 | #if LCU_SYNTAX_ALF |
---|
1124 | AlfParamSet* m_alfParamSet; |
---|
1125 | #else |
---|
1126 | ALFParam* m_pAlfParam; //!< ALF parameter object pointer |
---|
1127 | #endif |
---|
1128 | Bool m_loopFilterOffsetInAPS; //< offset for deblocking filter in 0 = slice header, 1 = APS |
---|
1129 | Bool m_loopFilterDisable; //< Deblocking filter enabled/disabled in APS |
---|
1130 | Int m_loopFilterBetaOffsetDiv2; //< beta offset for deblocking filter |
---|
1131 | Int m_loopFilterTcOffsetDiv2; //< tc offset for deblocking filter |
---|
1132 | Bool m_scalingListEnabled; //!< ScalingList enabled/disabled in APS (true for enabled) |
---|
1133 | TComScalingList* m_scalingList; //!< ScalingList class pointer |
---|
1134 | #if SAO_UNIT_INTERLEAVING |
---|
1135 | Bool m_saoInterleavingFlag; //!< SAO interleaving flag |
---|
1136 | #endif |
---|
1137 | |
---|
1138 | public: |
---|
1139 | TComAPS& operator= (const TComAPS& src); //!< "=" operator for APS object |
---|
1140 | }; |
---|
1141 | |
---|
1142 | typedef struct { |
---|
1143 | // Explicit weighted prediction parameters parsed in slice header, |
---|
1144 | // or Implicit weighted prediction parameters (8 bits depth values). |
---|
1145 | Bool bPresentFlag; |
---|
1146 | UInt uiLog2WeightDenom; |
---|
1147 | Int iWeight; |
---|
1148 | Int iOffset; |
---|
1149 | |
---|
1150 | // Weighted prediction scaling values built from above parameters (bitdepth scaled): |
---|
1151 | Int w, o, offset, shift, round; |
---|
1152 | } wpScalingParam; |
---|
1153 | |
---|
1154 | typedef struct { |
---|
1155 | Int64 iAC; |
---|
1156 | Int64 iDC; |
---|
1157 | } wpACDCParam; |
---|
1158 | |
---|
1159 | /// slice header class |
---|
1160 | class TComSlice |
---|
1161 | { |
---|
1162 | |
---|
1163 | private: |
---|
1164 | // Bitstream writing |
---|
1165 | Int m_iAPSId; //!< APS ID in slice header |
---|
1166 | bool m_alfEnabledFlag; |
---|
1167 | bool m_saoEnabledFlag; |
---|
1168 | #if SAO_UNIT_INTERLEAVING |
---|
1169 | bool m_saoInterleavingFlag; ///< SAO interleaving flag |
---|
1170 | bool m_saoEnabledFlagCb; ///< SAO Cb enabled flag |
---|
1171 | bool m_saoEnabledFlagCr; ///< SAO Cr enabled flag |
---|
1172 | #endif |
---|
1173 | Int m_iPPSId; ///< picture parameter set ID |
---|
1174 | #if H0388 |
---|
1175 | Bool m_PicOutputFlag; ///< pic_output_flag |
---|
1176 | #endif |
---|
1177 | Int m_iPOC; |
---|
1178 | Int m_iLastIDR; |
---|
1179 | static Int m_prevPOC; |
---|
1180 | TComReferencePictureSet *m_pcRPS; |
---|
1181 | TComReferencePictureSet m_LocalRPS; |
---|
1182 | Int m_iBDidx; |
---|
1183 | Int m_iCombinationBDidx; |
---|
1184 | Bool m_bCombineWithReferenceFlag; |
---|
1185 | TComRefPicListModification m_RefPicListModification; |
---|
1186 | NalUnitType m_eNalUnitType; ///< Nal unit type for the slice |
---|
1187 | NalUnitType m_eNalUnitTypeBaseViewMvc; ///< Nal unit type of the base view slice for multiview coding |
---|
1188 | SliceType m_eSliceType; |
---|
1189 | Int m_iSliceQp; |
---|
1190 | #if ADAPTIVE_QP_SELECTION |
---|
1191 | Int m_iSliceQpBase; |
---|
1192 | #endif |
---|
1193 | Bool m_bLoopFilterDisable; |
---|
1194 | Bool m_loopFilterOffsetInAPS; |
---|
1195 | Bool m_inheritDblParamFromAPS; //< offsets for deblocking filter inherit from APS |
---|
1196 | Int m_loopFilterBetaOffsetDiv2; //< beta offset for deblocking filter |
---|
1197 | Int m_loopFilterTcOffsetDiv2; //< tc offset for deblocking filter |
---|
1198 | |
---|
1199 | Int m_aiNumRefIdx [3]; // for multiple reference of current slice |
---|
1200 | |
---|
1201 | Int m_iRefIdxOfLC[2][MAX_NUM_REF_LC]; |
---|
1202 | Int m_eListIdFromIdxOfLC[MAX_NUM_REF_LC]; |
---|
1203 | Int m_iRefIdxFromIdxOfLC[MAX_NUM_REF_LC]; |
---|
1204 | Int m_iRefIdxOfL1FromRefIdxOfL0[MAX_NUM_REF_LC]; |
---|
1205 | Int m_iRefIdxOfL0FromRefIdxOfL1[MAX_NUM_REF_LC]; |
---|
1206 | Bool m_bRefPicListModificationFlagLC; |
---|
1207 | Bool m_bRefPicListCombinationFlag; |
---|
1208 | |
---|
1209 | Bool m_bCheckLDC; |
---|
1210 | |
---|
1211 | // Data |
---|
1212 | Int m_iSliceQpDelta; |
---|
1213 | TComPic* m_apcRefPicList [2][MAX_NUM_REF+1]; |
---|
1214 | Int m_aiRefPOCList [2][MAX_NUM_REF+1]; |
---|
1215 | Int m_aiRefViewIdList[2][MAX_NUM_REF+1]; |
---|
1216 | TComPic* m_pcTexturePic; |
---|
1217 | Int m_iDepth; |
---|
1218 | |
---|
1219 | // referenced slice? |
---|
1220 | Bool m_bRefenced; |
---|
1221 | |
---|
1222 | // access channel |
---|
1223 | #if VIDYO_VPS_INTEGRATION |
---|
1224 | TComVPS* m_pcVPS; |
---|
1225 | #endif |
---|
1226 | TComSPS* m_pcSPS; |
---|
1227 | TComPPS* m_pcPPS; |
---|
1228 | TComPic* m_pcPic; |
---|
1229 | #if ADAPTIVE_QP_SELECTION |
---|
1230 | TComTrQuant* m_pcTrQuant; |
---|
1231 | #endif |
---|
1232 | TComAPS* m_pcAPS; //!< pointer to APS parameter object |
---|
1233 | |
---|
1234 | UInt m_uiColDir; // direction to get colocated CUs |
---|
1235 | |
---|
1236 | #if COLLOCATED_REF_IDX |
---|
1237 | UInt m_colRefIdx; |
---|
1238 | #endif |
---|
1239 | |
---|
1240 | #if ALF_CHROMA_LAMBDA || SAO_CHROMA_LAMBDA |
---|
1241 | Double m_dLambdaLuma; |
---|
1242 | Double m_dLambdaChroma; |
---|
1243 | #else |
---|
1244 | Double m_dLambda; |
---|
1245 | #endif |
---|
1246 | |
---|
1247 | Bool m_abEqualRef [2][MAX_NUM_REF][MAX_NUM_REF]; |
---|
1248 | |
---|
1249 | Bool m_bNoBackPredFlag; |
---|
1250 | Bool m_bRefIdxCombineCoding; |
---|
1251 | |
---|
1252 | UInt m_uiTLayer; |
---|
1253 | Bool m_bTLayerSwitchingFlag; |
---|
1254 | |
---|
1255 | UInt m_uiSliceMode; |
---|
1256 | UInt m_uiSliceArgument; |
---|
1257 | UInt m_uiSliceCurStartCUAddr; |
---|
1258 | UInt m_uiSliceCurEndCUAddr; |
---|
1259 | UInt m_uiSliceIdx; |
---|
1260 | UInt m_uiEntropySliceMode; |
---|
1261 | UInt m_uiEntropySliceArgument; |
---|
1262 | UInt m_uiEntropySliceCurStartCUAddr; |
---|
1263 | UInt m_uiEntropySliceCurEndCUAddr; |
---|
1264 | Bool m_bNextSlice; |
---|
1265 | Bool m_bNextEntropySlice; |
---|
1266 | UInt m_uiSliceBits; |
---|
1267 | UInt m_uiEntropySliceCounter; |
---|
1268 | Bool m_bFinalized; |
---|
1269 | |
---|
1270 | wpScalingParam m_weightPredTable[2][MAX_NUM_REF][3]; // [REF_PIC_LIST_0 or REF_PIC_LIST_1][refIdx][0:Y, 1:U, 2:V] |
---|
1271 | wpACDCParam m_weightACDCParam[3]; // [0:Y, 1:U, 2:V] |
---|
1272 | wpScalingParam m_weightPredTableLC[2*MAX_NUM_REF][3]; // [refIdxLC][0:Y, 1:U, 2:V] |
---|
1273 | |
---|
1274 | UInt *m_uiTileByteLocation; |
---|
1275 | UInt m_uiTileCount; |
---|
1276 | Int m_iTileMarkerFlag; |
---|
1277 | UInt m_uiTileOffstForMultES; |
---|
1278 | |
---|
1279 | UInt* m_puiSubstreamSizes; |
---|
1280 | TComScalingList* m_scalingList; //!< pointer of quantization matrix |
---|
1281 | #if CABAC_INIT_FLAG |
---|
1282 | Bool m_cabacInitFlag; |
---|
1283 | #else |
---|
1284 | Int m_cabacInitIdc; |
---|
1285 | #endif |
---|
1286 | |
---|
1287 | #if H0111_MVD_L1_ZERO |
---|
1288 | Bool m_bLMvdL1Zero; |
---|
1289 | #endif |
---|
1290 | #if TILES_WPP_ENTRY_POINT_SIGNALLING |
---|
1291 | Int m_numEntryPointOffsets; |
---|
1292 | #endif |
---|
1293 | |
---|
1294 | Int m_viewId; |
---|
1295 | Bool m_isDepth; |
---|
1296 | Int m_aaiCodedScale [2][MAX_VIEW_NUM]; |
---|
1297 | Int m_aaiCodedOffset[2][MAX_VIEW_NUM]; |
---|
1298 | |
---|
1299 | #if SONY_COLPIC_AVAILABILITY |
---|
1300 | Int m_iViewOrderIdx; |
---|
1301 | #endif |
---|
1302 | #if LGE_ILLUCOMP_B0045 |
---|
1303 | Bool m_bApplyIC; |
---|
1304 | #endif |
---|
1305 | |
---|
1306 | public: |
---|
1307 | TComSlice(); |
---|
1308 | virtual ~TComSlice(); |
---|
1309 | |
---|
1310 | Void initSlice (); |
---|
1311 | Void initTiles(); |
---|
1312 | |
---|
1313 | #if VIDYO_VPS_INTEGRATION |
---|
1314 | Void setVPS ( TComVPS* pcVPS ) { m_pcVPS = pcVPS; } |
---|
1315 | TComVPS* getVPS () { return m_pcVPS; } |
---|
1316 | #endif |
---|
1317 | Void setSPS ( TComSPS* pcSPS ) { m_pcSPS = pcSPS; } |
---|
1318 | TComSPS* getSPS () { return m_pcSPS; } |
---|
1319 | |
---|
1320 | Void setPPS ( TComPPS* pcPPS ) { assert(pcPPS!=NULL); m_pcPPS = pcPPS; m_iPPSId = pcPPS->getPPSId(); } |
---|
1321 | TComPPS* getPPS () { return m_pcPPS; } |
---|
1322 | |
---|
1323 | #if ADAPTIVE_QP_SELECTION |
---|
1324 | Void setTrQuant ( TComTrQuant* pcTrQuant ) { m_pcTrQuant = pcTrQuant; } |
---|
1325 | TComTrQuant* getTrQuant () { return m_pcTrQuant; } |
---|
1326 | #endif |
---|
1327 | |
---|
1328 | Void setPPSId ( Int PPSId ) { m_iPPSId = PPSId; } |
---|
1329 | Int getPPSId () { return m_iPPSId; } |
---|
1330 | Void setAPS ( TComAPS* pcAPS ) { m_pcAPS = pcAPS; } //!< set APS pointer |
---|
1331 | TComAPS* getAPS () { return m_pcAPS; } //!< get APS pointer |
---|
1332 | Void setAPSId ( Int Id) { m_iAPSId =Id; } //!< set APS ID |
---|
1333 | Int getAPSId () { return m_iAPSId; } //!< get APS ID |
---|
1334 | #if H0388 |
---|
1335 | Void setPicOutputFlag( Bool b ) { m_PicOutputFlag = b; } |
---|
1336 | Bool getPicOutputFlag() { return m_PicOutputFlag; } |
---|
1337 | #endif |
---|
1338 | Void setAlfEnabledFlag(Bool s) {m_alfEnabledFlag =s; } |
---|
1339 | Bool getAlfEnabledFlag() { return m_alfEnabledFlag; } |
---|
1340 | Void setSaoEnabledFlag(Bool s) {m_saoEnabledFlag =s; } |
---|
1341 | Bool getSaoEnabledFlag() { return m_saoEnabledFlag; } |
---|
1342 | #if SAO_UNIT_INTERLEAVING |
---|
1343 | Void setSaoInterleavingFlag(Bool s) {m_saoInterleavingFlag =s; } //!< set SAO interleaving flag |
---|
1344 | Bool getSaoInterleavingFlag() { return m_saoInterleavingFlag; } //!< get SAO interleaving flag |
---|
1345 | Void setSaoEnabledFlagCb(Bool s) {m_saoEnabledFlagCb =s; } //!< set SAO Cb enabled flag |
---|
1346 | Bool getSaoEnabledFlagCb() { return m_saoEnabledFlagCb; } //!< get SAO Cb enabled flag |
---|
1347 | Void setSaoEnabledFlagCr(Bool s) {m_saoEnabledFlagCr =s; } //!< set SAO Cr enabled flag |
---|
1348 | Bool getSaoEnabledFlagCr() { return m_saoEnabledFlagCr; } //!< get SAO Cr enabled flag |
---|
1349 | #endif |
---|
1350 | Void setRPS ( TComReferencePictureSet *pcRPS ) { m_pcRPS = pcRPS; } |
---|
1351 | TComReferencePictureSet* getRPS () { return m_pcRPS; } |
---|
1352 | TComReferencePictureSet* getLocalRPS () { return &m_LocalRPS; } |
---|
1353 | |
---|
1354 | Void setRPSidx ( Int iBDidx ) { m_iBDidx = iBDidx; } |
---|
1355 | Int getRPSidx () { return m_iBDidx; } |
---|
1356 | Void setCombinationBDidx ( Int iCombinationBDidx ) { m_iCombinationBDidx = iCombinationBDidx; } |
---|
1357 | Int getCombinationBDidx () { return m_iCombinationBDidx; } |
---|
1358 | Void setCombineWithReferenceFlag ( Bool bCombineWithReferenceFlag ) { m_bCombineWithReferenceFlag = bCombineWithReferenceFlag; } |
---|
1359 | Bool getCombineWithReferenceFlag () { return m_bCombineWithReferenceFlag; } |
---|
1360 | Int getPrevPOC () { return m_prevPOC; } |
---|
1361 | |
---|
1362 | TComRefPicListModification* getRefPicListModification() { return &m_RefPicListModification; } |
---|
1363 | Void setLastIDR(Int iIDRPOC) { m_iLastIDR = iIDRPOC; } |
---|
1364 | Int getLastIDR() { return m_iLastIDR; } |
---|
1365 | SliceType getSliceType () { return m_eSliceType; } |
---|
1366 | Int getPOC () { return m_iPOC; } |
---|
1367 | Int getSliceQp () { return m_iSliceQp; } |
---|
1368 | #if ADAPTIVE_QP_SELECTION |
---|
1369 | Int getSliceQpBase () { return m_iSliceQpBase; } |
---|
1370 | #endif |
---|
1371 | Int getSliceQpDelta () { return m_iSliceQpDelta; } |
---|
1372 | Bool getLoopFilterDisable() { return m_bLoopFilterDisable; } |
---|
1373 | Bool getLoopFilterOffsetInAPS() { return m_loopFilterOffsetInAPS;} |
---|
1374 | Bool getInheritDblParamFromAPS() { return m_inheritDblParamFromAPS; } |
---|
1375 | Int getLoopFilterBetaOffset() { return m_loopFilterBetaOffsetDiv2; } |
---|
1376 | Int getLoopFilterTcOffset() { return m_loopFilterTcOffsetDiv2; } |
---|
1377 | |
---|
1378 | Int getNumRefIdx ( RefPicList e ) { return m_aiNumRefIdx[e]; } |
---|
1379 | TComPic* getPic () { return m_pcPic; } |
---|
1380 | TComPic* getRefPic ( RefPicList e, Int iRefIdx) { return m_apcRefPicList[e][iRefIdx]; } |
---|
1381 | Int getRefPOC ( RefPicList e, Int iRefIdx) { return m_aiRefPOCList[e][iRefIdx]; } |
---|
1382 | Int getRefViewId ( RefPicList e, Int iRefIdx) { return m_aiRefViewIdList[e][iRefIdx]; } |
---|
1383 | TComPic* getTexturePic () const { return m_pcTexturePic; } |
---|
1384 | #if SONY_COLPIC_AVAILABILITY |
---|
1385 | Int getViewOrderIdx () { return m_iViewOrderIdx; } |
---|
1386 | #endif |
---|
1387 | Int getDepth () { return m_iDepth; } |
---|
1388 | UInt getColDir () { return m_uiColDir; } |
---|
1389 | #if COLLOCATED_REF_IDX |
---|
1390 | Bool getColRefIdx () { return m_colRefIdx; } |
---|
1391 | Void checkColRefIdx (UInt curSliceIdx, TComPic* pic); |
---|
1392 | #endif |
---|
1393 | Bool getCheckLDC () { return m_bCheckLDC; } |
---|
1394 | #if H0111_MVD_L1_ZERO |
---|
1395 | Bool getMvdL1ZeroFlag () { return m_bLMvdL1Zero; } |
---|
1396 | #endif |
---|
1397 | Int getRefIdxOfLC (RefPicList e, Int iRefIdx) { return m_iRefIdxOfLC[e][iRefIdx]; } |
---|
1398 | Int getListIdFromIdxOfLC(Int iRefIdx) { return m_eListIdFromIdxOfLC[iRefIdx]; } |
---|
1399 | Int getRefIdxFromIdxOfLC(Int iRefIdx) { return m_iRefIdxFromIdxOfLC[iRefIdx]; } |
---|
1400 | Int getRefIdxOfL0FromRefIdxOfL1(Int iRefIdx) { return m_iRefIdxOfL0FromRefIdxOfL1[iRefIdx];} |
---|
1401 | Int getRefIdxOfL1FromRefIdxOfL0(Int iRefIdx) { return m_iRefIdxOfL1FromRefIdxOfL0[iRefIdx];} |
---|
1402 | Bool getRefPicListModificationFlagLC() {return m_bRefPicListModificationFlagLC;} |
---|
1403 | Void setRefPicListModificationFlagLC(Bool bflag) {m_bRefPicListModificationFlagLC=bflag;} |
---|
1404 | Bool getRefPicListCombinationFlag() {return m_bRefPicListCombinationFlag;} |
---|
1405 | Void setRefPicListCombinationFlag(Bool bflag) {m_bRefPicListCombinationFlag=bflag;} |
---|
1406 | Void setListIdFromIdxOfLC(Int iRefIdx, UInt uiVal) { m_eListIdFromIdxOfLC[iRefIdx]=uiVal; } |
---|
1407 | Void setRefIdxFromIdxOfLC(Int iRefIdx, UInt uiVal) { m_iRefIdxFromIdxOfLC[iRefIdx]=uiVal; } |
---|
1408 | Void setRefIdxOfLC (RefPicList e, Int iRefIdx, Int RefIdxLC) { m_iRefIdxOfLC[e][iRefIdx]=RefIdxLC;} |
---|
1409 | |
---|
1410 | Void setReferenced(Bool b) { m_bRefenced = b; } |
---|
1411 | Bool isReferenced() { return m_bRefenced; } |
---|
1412 | |
---|
1413 | Void setPOC ( Int i ) { m_iPOC = i; if(getTLayer()==0) m_prevPOC=i; } |
---|
1414 | Void setNalUnitType ( NalUnitType e ) { m_eNalUnitType = e; } |
---|
1415 | NalUnitType getNalUnitType () { return m_eNalUnitType; } |
---|
1416 | Void setNalUnitTypeBaseViewMvc ( NalUnitType e ) { m_eNalUnitTypeBaseViewMvc = e; } |
---|
1417 | NalUnitType getNalUnitTypeBaseViewMvc() { return m_eNalUnitTypeBaseViewMvc; } |
---|
1418 | Void checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, TComList<TComPic*>& rcListPic); |
---|
1419 | Void decodingRefreshMarking(Int& pocCRA, Bool& bRefreshPending, TComList<TComPic*>& rcListPic); |
---|
1420 | Void setSliceType ( SliceType e ) { m_eSliceType = e; } |
---|
1421 | Void setSliceQp ( Int i ) { m_iSliceQp = i; } |
---|
1422 | #if ADAPTIVE_QP_SELECTION |
---|
1423 | Void setSliceQpBase ( Int i ) { m_iSliceQpBase = i; } |
---|
1424 | #endif |
---|
1425 | Void setSliceQpDelta ( Int i ) { m_iSliceQpDelta = i; } |
---|
1426 | Void setLoopFilterDisable( Bool b ) { m_bLoopFilterDisable= b; } |
---|
1427 | Void setLoopFilterOffsetInAPS( Bool b ) { m_loopFilterOffsetInAPS = b;} |
---|
1428 | Void setInheritDblParamFromAPS( Bool b ) { m_inheritDblParamFromAPS = b; } |
---|
1429 | Void setLoopFilterBetaOffset( Int i ) { m_loopFilterBetaOffsetDiv2 = i; } |
---|
1430 | Void setLoopFilterTcOffset( Int i ) { m_loopFilterTcOffsetDiv2 = i; } |
---|
1431 | |
---|
1432 | Void setRefPic ( TComPic* p, RefPicList e, Int iRefIdx ) { m_apcRefPicList[e][iRefIdx] = p; } |
---|
1433 | Void setRefPOC ( Int i, RefPicList e, Int iRefIdx ) { m_aiRefPOCList[e][iRefIdx] = i; } |
---|
1434 | Void setRefViewId ( Int i, RefPicList e, Int iRefIdx ) { m_aiRefViewIdList[e][iRefIdx] = i; } |
---|
1435 | Void setTexturePic ( TComPic *pcTexturePic ) { m_pcTexturePic = pcTexturePic; } |
---|
1436 | #if SONY_COLPIC_AVAILABILITY |
---|
1437 | Void setViewOrderIdx ( Int i ) { m_iViewOrderIdx = i; } |
---|
1438 | #endif |
---|
1439 | Void setNumRefIdx ( RefPicList e, Int i ) { m_aiNumRefIdx[e] = i; } |
---|
1440 | Void setPic ( TComPic* p ) { m_pcPic = p; } |
---|
1441 | Void setDepth ( Int iDepth ) { m_iDepth = iDepth; } |
---|
1442 | |
---|
1443 | Int getNumPocTotalCurr(); |
---|
1444 | Int getNumPocTotalCurrMvc(); |
---|
1445 | Void setRefPicListMvc ( TComList<TComPic*>& rcListPic, std::vector<TComPic*>& rapcInterViewRefPics ); |
---|
1446 | Void setRefPOCnViewListsMvc(); |
---|
1447 | |
---|
1448 | Void setColDir ( UInt uiDir ) { m_uiColDir = uiDir; } |
---|
1449 | #if COLLOCATED_REF_IDX |
---|
1450 | Void setColRefIdx ( UInt refIdx) { m_colRefIdx = refIdx; } |
---|
1451 | #endif |
---|
1452 | Void setCheckLDC ( Bool b ) { m_bCheckLDC = b; } |
---|
1453 | #if H0111_MVD_L1_ZERO |
---|
1454 | Void setMvdL1ZeroFlag ( Bool b) { m_bLMvdL1Zero = b; } |
---|
1455 | #endif |
---|
1456 | |
---|
1457 | Bool isIntra () { return m_eSliceType == I_SLICE; } |
---|
1458 | Bool isInterB () { return m_eSliceType == B_SLICE; } |
---|
1459 | Bool isInterP () { return m_eSliceType == P_SLICE; } |
---|
1460 | |
---|
1461 | #if ALF_CHROMA_LAMBDA || SAO_CHROMA_LAMBDA |
---|
1462 | Void setLambda( Double d, Double e ) { m_dLambdaLuma = d; m_dLambdaChroma = e;} |
---|
1463 | Double getLambdaLuma() { return m_dLambdaLuma; } |
---|
1464 | Double getLambdaChroma() { return m_dLambdaChroma; } |
---|
1465 | #else |
---|
1466 | Void setLambda( Double d ) { m_dLambda = d; } |
---|
1467 | Double getLambda() { return m_dLambda; } |
---|
1468 | #endif |
---|
1469 | |
---|
1470 | Void initEqualRef(); |
---|
1471 | Bool isEqualRef ( RefPicList e, Int iRefIdx1, Int iRefIdx2 ) |
---|
1472 | { |
---|
1473 | if (iRefIdx1 < 0 || iRefIdx2 < 0) return false; |
---|
1474 | return m_abEqualRef[e][iRefIdx1][iRefIdx2]; |
---|
1475 | } |
---|
1476 | |
---|
1477 | Void setEqualRef( RefPicList e, Int iRefIdx1, Int iRefIdx2, Bool b) |
---|
1478 | { |
---|
1479 | m_abEqualRef[e][iRefIdx1][iRefIdx2] = m_abEqualRef[e][iRefIdx2][iRefIdx1] = b; |
---|
1480 | } |
---|
1481 | |
---|
1482 | static Void sortPicList ( TComList<TComPic*>& rcListPic ); |
---|
1483 | |
---|
1484 | Bool getNoBackPredFlag() { return m_bNoBackPredFlag; } |
---|
1485 | Void setNoBackPredFlag( Bool b ) { m_bNoBackPredFlag = b; } |
---|
1486 | Bool getRefIdxCombineCoding() { return m_bRefIdxCombineCoding; } |
---|
1487 | Void setRefIdxCombineCoding( Bool b ) { m_bRefIdxCombineCoding = b; } |
---|
1488 | Void generateCombinedList (); |
---|
1489 | |
---|
1490 | UInt getTLayer () { return m_uiTLayer; } |
---|
1491 | Void setTLayer ( UInt uiTLayer ) { m_uiTLayer = uiTLayer; } |
---|
1492 | |
---|
1493 | #if !H0566_TLA |
---|
1494 | Bool getTLayerSwitchingFlag() { return m_bTLayerSwitchingFlag; } |
---|
1495 | Void setTLayerSwitchingFlag( Bool bValue ) { m_bTLayerSwitchingFlag = bValue; } |
---|
1496 | #endif |
---|
1497 | |
---|
1498 | Void setTLayerInfo( UInt uiTLayer ); |
---|
1499 | Void decodingMarking( TComList<TComPic*>& rcListPic, Int iGOPSIze, Int& iMaxRefPicNum ); |
---|
1500 | Void applyReferencePictureSet( TComList<TComPic*>& rcListPic, TComReferencePictureSet *RPSList); |
---|
1501 | #if H0566_TLA && H0566_TLA_SET_FOR_SWITCHING_POINTS |
---|
1502 | Bool isTemporalLayerSwitchingPoint( TComList<TComPic*>& rcListPic, TComReferencePictureSet *RPSList); |
---|
1503 | #endif |
---|
1504 | #if START_DECODING_AT_CRA |
---|
1505 | Int checkThatAllRefPicsAreAvailable( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool outputFlag, Int pocRandomAccess = 0); |
---|
1506 | #else |
---|
1507 | Int checkThatAllRefPicsAreAvailable( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool outputFlag); |
---|
1508 | #endif |
---|
1509 | Void createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet); |
---|
1510 | |
---|
1511 | Void decodingMarkingForNoTMVP( TComList<TComPic*>& rcListPic, Int currentPOC ); |
---|
1512 | |
---|
1513 | UInt m_uiMaxNumMergeCand; |
---|
1514 | Void setMaxNumMergeCand (UInt maxNumMergeCand ) { m_uiMaxNumMergeCand = maxNumMergeCand; } |
---|
1515 | UInt getMaxNumMergeCand () {return m_uiMaxNumMergeCand; } |
---|
1516 | |
---|
1517 | Void setSliceMode ( UInt uiMode ) { m_uiSliceMode = uiMode; } |
---|
1518 | UInt getSliceMode () { return m_uiSliceMode; } |
---|
1519 | Void setSliceArgument ( UInt uiArgument ) { m_uiSliceArgument = uiArgument; } |
---|
1520 | UInt getSliceArgument () { return m_uiSliceArgument; } |
---|
1521 | Void setSliceCurStartCUAddr ( UInt uiAddr ) { m_uiSliceCurStartCUAddr = uiAddr; } |
---|
1522 | UInt getSliceCurStartCUAddr () { return m_uiSliceCurStartCUAddr; } |
---|
1523 | Void setSliceCurEndCUAddr ( UInt uiAddr ) { m_uiSliceCurEndCUAddr = uiAddr; } |
---|
1524 | UInt getSliceCurEndCUAddr () { return m_uiSliceCurEndCUAddr; } |
---|
1525 | Void setSliceIdx ( UInt i) { m_uiSliceIdx = i; } |
---|
1526 | UInt getSliceIdx () { return m_uiSliceIdx; } |
---|
1527 | Void copySliceInfo (TComSlice *pcSliceSrc); |
---|
1528 | Void setEntropySliceMode ( UInt uiMode ) { m_uiEntropySliceMode = uiMode; } |
---|
1529 | UInt getEntropySliceMode () { return m_uiEntropySliceMode; } |
---|
1530 | Void setEntropySliceArgument ( UInt uiArgument ) { m_uiEntropySliceArgument = uiArgument; } |
---|
1531 | UInt getEntropySliceArgument () { return m_uiEntropySliceArgument; } |
---|
1532 | Void setEntropySliceCurStartCUAddr ( UInt uiAddr ) { m_uiEntropySliceCurStartCUAddr = uiAddr; } |
---|
1533 | UInt getEntropySliceCurStartCUAddr () { return m_uiEntropySliceCurStartCUAddr; } |
---|
1534 | Void setEntropySliceCurEndCUAddr ( UInt uiAddr ) { m_uiEntropySliceCurEndCUAddr = uiAddr; } |
---|
1535 | UInt getEntropySliceCurEndCUAddr () { return m_uiEntropySliceCurEndCUAddr; } |
---|
1536 | Void setNextSlice ( Bool b ) { m_bNextSlice = b; } |
---|
1537 | Bool isNextSlice () { return m_bNextSlice; } |
---|
1538 | Void setNextEntropySlice ( Bool b ) { m_bNextEntropySlice = b; } |
---|
1539 | Bool isNextEntropySlice () { return m_bNextEntropySlice; } |
---|
1540 | Void setSliceBits ( UInt uiVal ) { m_uiSliceBits = uiVal; } |
---|
1541 | UInt getSliceBits () { return m_uiSliceBits; } |
---|
1542 | Void setEntropySliceCounter ( UInt uiVal ) { m_uiEntropySliceCounter = uiVal; } |
---|
1543 | UInt getEntropySliceCounter () { return m_uiEntropySliceCounter; } |
---|
1544 | Void setFinalized ( Bool uiVal ) { m_bFinalized = uiVal; } |
---|
1545 | Bool getFinalized () { return m_bFinalized; } |
---|
1546 | Void setWpScaling ( wpScalingParam wp[2][MAX_NUM_REF][3] ) { memcpy(m_weightPredTable, wp, sizeof(wpScalingParam)*2*MAX_NUM_REF*3); } |
---|
1547 | Void getWpScaling ( RefPicList e, Int iRefIdx, wpScalingParam *&wp); |
---|
1548 | |
---|
1549 | Void resetWpScaling (wpScalingParam wp[2][MAX_NUM_REF][3]); |
---|
1550 | Void initWpScaling (wpScalingParam wp[2][MAX_NUM_REF][3]); |
---|
1551 | Void initWpScaling (); |
---|
1552 | inline Bool applyWP () { return( (m_eSliceType==P_SLICE && m_pcPPS->getUseWP()) || (m_eSliceType==B_SLICE && m_pcPPS->getWPBiPredIdc()) ); } |
---|
1553 | |
---|
1554 | Void setWpAcDcParam ( wpACDCParam wp[3] ) { memcpy(m_weightACDCParam, wp, sizeof(wpACDCParam)*3); } |
---|
1555 | Void getWpAcDcParam ( wpACDCParam *&wp ); |
---|
1556 | Void initWpAcDcParam (); |
---|
1557 | Void copyWPtable (wpScalingParam *&wp_src, wpScalingParam *&wp_dst); |
---|
1558 | Void getWpScalingLC ( Int iRefIdx, wpScalingParam *&wp); |
---|
1559 | Void resetWpScalingLC(wpScalingParam wp[2*MAX_NUM_REF][3]); |
---|
1560 | Void setWpParamforLC(); |
---|
1561 | Void setTileLocationCount ( UInt uiCount ) { m_uiTileCount = uiCount; } |
---|
1562 | UInt getTileLocationCount () { return m_uiTileCount; } |
---|
1563 | Void setTileLocation ( Int i, UInt uiLOC ) { m_uiTileByteLocation[i] = uiLOC; } |
---|
1564 | UInt getTileLocation ( Int i ) { return m_uiTileByteLocation[i]; } |
---|
1565 | Void setTileMarkerFlag ( Int iFlag ) { m_iTileMarkerFlag = iFlag; } |
---|
1566 | Int getTileMarkerFlag () { return m_iTileMarkerFlag; } |
---|
1567 | Void setTileOffstForMultES (UInt uiOffset ) { m_uiTileOffstForMultES = uiOffset; } |
---|
1568 | UInt getTileOffstForMultES () { return m_uiTileOffstForMultES; } |
---|
1569 | Void allocSubstreamSizes ( UInt uiNumSubstreams ); |
---|
1570 | UInt* getSubstreamSizes () { return m_puiSubstreamSizes; } |
---|
1571 | Void setScalingList ( TComScalingList* scalingList ) { m_scalingList = scalingList; } |
---|
1572 | TComScalingList* getScalingList () { return m_scalingList; } |
---|
1573 | Void setDefaultScalingList (); |
---|
1574 | Bool checkDefaultScalingList (); |
---|
1575 | #if CABAC_INIT_FLAG |
---|
1576 | Void setCabacInitFlag ( Bool val ) { m_cabacInitFlag = val; } //!< set CABAC initial flag |
---|
1577 | Bool getCabacInitFlag () { return m_cabacInitFlag; } //!< get CABAC initial flag |
---|
1578 | #else |
---|
1579 | Void setCABACinitIDC(Int iVal) {m_cabacInitIdc = iVal; } //!< set CABAC initial IDC number |
---|
1580 | Int getCABACinitIDC() {return m_cabacInitIdc; } //!< get CABAC initial IDC number |
---|
1581 | #endif |
---|
1582 | #if TILES_WPP_ENTRY_POINT_SIGNALLING |
---|
1583 | Void setNumEntryPointOffsets(Int val) { m_numEntryPointOffsets = val; } |
---|
1584 | Int getNumEntryPointOffsets() { return m_numEntryPointOffsets; } |
---|
1585 | #endif |
---|
1586 | |
---|
1587 | Void setViewId( Int viewId ) { m_viewId = viewId; } |
---|
1588 | Int getViewId() { return m_viewId; } |
---|
1589 | Void setIsDepth( Bool isDepth ) { m_isDepth = isDepth; } |
---|
1590 | Bool getIsDepth() { return m_isDepth; } |
---|
1591 | |
---|
1592 | Void initMultiviewSlice ( Int** aaiScale = 0, Int** aaiOffset = 0 ); |
---|
1593 | |
---|
1594 | Int* getCodedScale () { return m_aaiCodedScale [0]; } |
---|
1595 | Int* getCodedOffset () { return m_aaiCodedOffset[0]; } |
---|
1596 | Int* getInvCodedScale () { return m_aaiCodedScale [1]; } |
---|
1597 | Int* getInvCodedOffset () { return m_aaiCodedOffset[1]; } |
---|
1598 | |
---|
1599 | #if LGE_ILLUCOMP_B0045 |
---|
1600 | Void setApplyIC ( Bool b ) { m_bApplyIC = b; } |
---|
1601 | Bool getApplyIC () { return m_bApplyIC; } |
---|
1602 | Void xSetApplyIC (); |
---|
1603 | #endif |
---|
1604 | |
---|
1605 | protected: |
---|
1606 | TComPic* xGetRefPic (TComList<TComPic*>& rcListPic, UInt uiPOC); |
---|
1607 | TComPic* xGetLongTermRefPic(TComList<TComPic*>& rcListPic, UInt uiPOC); |
---|
1608 | TComPic* xGetInterViewRefPic( std::vector<TComPic*>& rcListIvPic, UInt uiViewId ); |
---|
1609 | };// END CLASS DEFINITION TComSlice |
---|
1610 | |
---|
1611 | |
---|
1612 | template <class T> class ParameterSetMap |
---|
1613 | { |
---|
1614 | public: |
---|
1615 | ParameterSetMap(Int maxId) |
---|
1616 | :m_maxId (maxId) |
---|
1617 | {} |
---|
1618 | |
---|
1619 | ~ParameterSetMap() |
---|
1620 | { |
---|
1621 | for (typename std::map<Int,T *>::iterator i = m_paramsetMap.begin(); i!= m_paramsetMap.end(); i++) |
---|
1622 | { |
---|
1623 | delete (*i).second; |
---|
1624 | } |
---|
1625 | } |
---|
1626 | |
---|
1627 | Void storePS(Int psId, T *ps) |
---|
1628 | { |
---|
1629 | assert ( psId < m_maxId ); |
---|
1630 | if ( m_paramsetMap.find(psId) != m_paramsetMap.end() ) |
---|
1631 | { |
---|
1632 | delete m_paramsetMap[psId]; |
---|
1633 | } |
---|
1634 | m_paramsetMap[psId] = ps; |
---|
1635 | } |
---|
1636 | |
---|
1637 | Void mergePSList(ParameterSetMap<T> &rPsList) |
---|
1638 | { |
---|
1639 | for (typename std::map<Int,T *>::iterator i = rPsList.m_paramsetMap.begin(); i!= rPsList.m_paramsetMap.end(); i++) |
---|
1640 | { |
---|
1641 | storePS(i->first, i->second); |
---|
1642 | } |
---|
1643 | rPsList.m_paramsetMap.clear(); |
---|
1644 | } |
---|
1645 | |
---|
1646 | |
---|
1647 | T* getPS(Int psId) |
---|
1648 | { |
---|
1649 | return ( m_paramsetMap.find(psId) == m_paramsetMap.end() ) ? NULL : m_paramsetMap[psId]; |
---|
1650 | } |
---|
1651 | |
---|
1652 | T* getFirstPS() |
---|
1653 | { |
---|
1654 | return (m_paramsetMap.begin() == m_paramsetMap.end() ) ? NULL : m_paramsetMap.begin()->second; |
---|
1655 | } |
---|
1656 | |
---|
1657 | private: |
---|
1658 | std::map<Int,T *> m_paramsetMap; |
---|
1659 | Int m_maxId; |
---|
1660 | }; |
---|
1661 | |
---|
1662 | class ParameterSetManager |
---|
1663 | { |
---|
1664 | public: |
---|
1665 | ParameterSetManager(); |
---|
1666 | virtual ~ParameterSetManager(); |
---|
1667 | #if VIDYO_VPS_INTEGRATION |
---|
1668 | //! store video parameter set and take ownership of it |
---|
1669 | Void storeVPS(TComVPS *vps) { m_vpsMap.storePS( vps->getVPSId(), vps); }; |
---|
1670 | //! get pointer to existing video parameter set |
---|
1671 | TComVPS* getVPS(Int vpsId) { return m_vpsMap.getPS(vpsId); }; |
---|
1672 | TComVPS* getFirstVPS() { return m_vpsMap.getFirstPS(); }; |
---|
1673 | #endif |
---|
1674 | //! store sequence parameter set and take ownership of it |
---|
1675 | Void storeSPS(TComSPS *sps) { m_spsMap.storePS( sps->getSPSId(), sps); }; |
---|
1676 | //! get pointer to existing sequence parameter set |
---|
1677 | TComSPS* getSPS(Int spsId) { return m_spsMap.getPS(spsId); }; |
---|
1678 | TComSPS* getFirstSPS() { return m_spsMap.getFirstPS(); }; |
---|
1679 | |
---|
1680 | //! store picture parameter set and take ownership of it |
---|
1681 | Void storePPS(TComPPS *pps) { m_ppsMap.storePS( pps->getPPSId(), pps); }; |
---|
1682 | //! get pointer to existing picture parameter set |
---|
1683 | TComPPS* getPPS(Int ppsId) { return m_ppsMap.getPS(ppsId); }; |
---|
1684 | TComPPS* getFirstPPS() { return m_ppsMap.getFirstPS(); }; |
---|
1685 | |
---|
1686 | //! store adaptation parameter set and take ownership of it |
---|
1687 | Void storeAPS(TComAPS *aps) { m_apsMap.storePS( aps->getAPSID(), aps); }; |
---|
1688 | //! getPointer to existing adaptation parameter set |
---|
1689 | TComAPS* getAPS(Int apsId) { return m_apsMap.getPS(apsId); }; |
---|
1690 | |
---|
1691 | protected: |
---|
1692 | ParameterSetMap<TComSPS> m_spsMap; |
---|
1693 | ParameterSetMap<TComPPS> m_ppsMap; |
---|
1694 | ParameterSetMap<TComAPS> m_apsMap; |
---|
1695 | #if VIDYO_VPS_INTEGRATION |
---|
1696 | ParameterSetMap<TComVPS> m_vpsMap; |
---|
1697 | #endif |
---|
1698 | }; |
---|
1699 | |
---|
1700 | //! \} |
---|
1701 | |
---|
1702 | #endif // __TCOMSLICE__ |
---|