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