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