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