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 | |
---|
54 | #if SVC_EXTENSION |
---|
55 | class TComPicYuv; |
---|
56 | #endif |
---|
57 | // ==================================================================================================================== |
---|
58 | // Constants |
---|
59 | // ==================================================================================================================== |
---|
60 | |
---|
61 | /// max number of supported APS in software |
---|
62 | #define MAX_NUM_SUPPORTED_APS 1 |
---|
63 | |
---|
64 | // ==================================================================================================================== |
---|
65 | // Class definition |
---|
66 | // ==================================================================================================================== |
---|
67 | |
---|
68 | /// Reference Picture Set class |
---|
69 | class TComReferencePictureSet |
---|
70 | { |
---|
71 | private: |
---|
72 | Int m_numberOfPictures; |
---|
73 | Int m_numberOfNegativePictures; |
---|
74 | Int m_numberOfPositivePictures; |
---|
75 | Int m_numberOfLongtermPictures; |
---|
76 | Int m_deltaPOC[MAX_NUM_REF_PICS]; |
---|
77 | Int m_POC[MAX_NUM_REF_PICS]; |
---|
78 | Bool m_used[MAX_NUM_REF_PICS]; |
---|
79 | Bool m_interRPSPrediction; |
---|
80 | Int m_deltaRIdxMinus1; |
---|
81 | Int m_deltaRPS; |
---|
82 | Int m_numRefIdc; |
---|
83 | Int m_refIdc[MAX_NUM_REF_PICS+1]; |
---|
84 | Bool m_bCheckLTMSB[MAX_NUM_REF_PICS]; |
---|
85 | Int m_pocLSBLT[MAX_NUM_REF_PICS]; |
---|
86 | Int m_deltaPOCMSBCycleLT[MAX_NUM_REF_PICS]; |
---|
87 | Bool m_deltaPocMSBPresentFlag[MAX_NUM_REF_PICS]; |
---|
88 | |
---|
89 | public: |
---|
90 | TComReferencePictureSet(); |
---|
91 | virtual ~TComReferencePictureSet(); |
---|
92 | Int getPocLSBLT(Int i) { return m_pocLSBLT[i]; } |
---|
93 | Void setPocLSBLT(Int i, Int x) { m_pocLSBLT[i] = x; } |
---|
94 | Int getDeltaPocMSBCycleLT(Int i) { return m_deltaPOCMSBCycleLT[i]; } |
---|
95 | Void setDeltaPocMSBCycleLT(Int i, Int x) { m_deltaPOCMSBCycleLT[i] = x; } |
---|
96 | Bool getDeltaPocMSBPresentFlag(Int i) { return m_deltaPocMSBPresentFlag[i]; } |
---|
97 | Void setDeltaPocMSBPresentFlag(Int i, Bool x) { m_deltaPocMSBPresentFlag[i] = x; } |
---|
98 | Void setUsed(Int bufferNum, Bool used); |
---|
99 | Void setDeltaPOC(Int bufferNum, Int deltaPOC); |
---|
100 | Void setPOC(Int bufferNum, Int deltaPOC); |
---|
101 | Void setNumberOfPictures(Int numberOfPictures); |
---|
102 | Void setCheckLTMSBPresent(Int bufferNum, Bool b ); |
---|
103 | Bool getCheckLTMSBPresent(Int bufferNum); |
---|
104 | |
---|
105 | Int getUsed(Int bufferNum); |
---|
106 | Int getDeltaPOC(Int bufferNum); |
---|
107 | Int getPOC(Int bufferNum); |
---|
108 | Int getNumberOfPictures(); |
---|
109 | |
---|
110 | Void setNumberOfNegativePictures(Int number) { m_numberOfNegativePictures = number; } |
---|
111 | Int getNumberOfNegativePictures() { return m_numberOfNegativePictures; } |
---|
112 | Void setNumberOfPositivePictures(Int number) { m_numberOfPositivePictures = number; } |
---|
113 | Int getNumberOfPositivePictures() { return m_numberOfPositivePictures; } |
---|
114 | Void setNumberOfLongtermPictures(Int number) { m_numberOfLongtermPictures = number; } |
---|
115 | Int getNumberOfLongtermPictures() { return m_numberOfLongtermPictures; } |
---|
116 | |
---|
117 | Void setInterRPSPrediction(Bool flag) { m_interRPSPrediction = flag; } |
---|
118 | Bool getInterRPSPrediction() { return m_interRPSPrediction; } |
---|
119 | Void setDeltaRIdxMinus1(Int x) { m_deltaRIdxMinus1 = x; } |
---|
120 | Int getDeltaRIdxMinus1() { return m_deltaRIdxMinus1; } |
---|
121 | Void setDeltaRPS(Int x) { m_deltaRPS = x; } |
---|
122 | Int getDeltaRPS() { return m_deltaRPS; } |
---|
123 | Void setNumRefIdc(Int x) { m_numRefIdc = x; } |
---|
124 | Int getNumRefIdc() { return m_numRefIdc; } |
---|
125 | |
---|
126 | Void setRefIdc(Int bufferNum, Int refIdc); |
---|
127 | Int getRefIdc(Int bufferNum); |
---|
128 | |
---|
129 | Void sortDeltaPOC(); |
---|
130 | Void printDeltaPOC(); |
---|
131 | }; |
---|
132 | |
---|
133 | /// Reference Picture Set set class |
---|
134 | class TComRPSList |
---|
135 | { |
---|
136 | private: |
---|
137 | Int m_numberOfReferencePictureSets; |
---|
138 | TComReferencePictureSet* m_referencePictureSets; |
---|
139 | |
---|
140 | public: |
---|
141 | TComRPSList(); |
---|
142 | virtual ~TComRPSList(); |
---|
143 | |
---|
144 | Void create (Int numberOfEntries); |
---|
145 | Void destroy (); |
---|
146 | |
---|
147 | |
---|
148 | TComReferencePictureSet* getReferencePictureSet(Int referencePictureSetNum); |
---|
149 | Int getNumberOfReferencePictureSets(); |
---|
150 | Void setNumberOfReferencePictureSets(Int numberOfReferencePictureSets); |
---|
151 | }; |
---|
152 | |
---|
153 | /// SCALING_LIST class |
---|
154 | class TComScalingList |
---|
155 | { |
---|
156 | public: |
---|
157 | TComScalingList(); |
---|
158 | virtual ~TComScalingList(); |
---|
159 | Void setScalingListPresentFlag (Bool b) { m_scalingListPresentFlag = b; } |
---|
160 | Bool getScalingListPresentFlag () { return m_scalingListPresentFlag; } |
---|
161 | #if TS_FLAT_QUANTIZATION_MATRIX |
---|
162 | Bool getUseTransformSkip () { return m_useTransformSkip; } |
---|
163 | Void setUseTransformSkip (Bool b) { m_useTransformSkip = b; } |
---|
164 | #endif |
---|
165 | Int* getScalingListAddress (UInt sizeId, UInt listId) { return m_scalingListCoef[sizeId][listId]; } //!< get matrix coefficient |
---|
166 | Bool checkPredMode (UInt sizeId, UInt listId); |
---|
167 | Void setRefMatrixId (UInt sizeId, UInt listId, UInt u) { m_refMatrixId[sizeId][listId] = u; } //!< set reference matrix ID |
---|
168 | UInt getRefMatrixId (UInt sizeId, UInt listId) { return m_refMatrixId[sizeId][listId]; } //!< get reference matrix ID |
---|
169 | Int* getScalingListDefaultAddress (UInt sizeId, UInt listId); //!< get default matrix coefficient |
---|
170 | Void processDefaultMarix (UInt sizeId, UInt listId); |
---|
171 | Void setScalingListDC (UInt sizeId, UInt listId, UInt u) { m_scalingListDC[sizeId][listId] = u; } //!< set DC value |
---|
172 | |
---|
173 | Int getScalingListDC (UInt sizeId, UInt listId) { return m_scalingListDC[sizeId][listId]; } //!< get DC value |
---|
174 | Void checkDcOfMatrix (); |
---|
175 | Void processRefMatrix (UInt sizeId, UInt listId , UInt refListId ); |
---|
176 | Bool xParseScalingList (char* pchFile); |
---|
177 | |
---|
178 | private: |
---|
179 | Void init (); |
---|
180 | Void destroy (); |
---|
181 | Int m_scalingListDC [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< the DC value of the matrix coefficient for 16x16 |
---|
182 | Bool m_useDefaultScalingMatrixFlag [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< UseDefaultScalingMatrixFlag |
---|
183 | UInt m_refMatrixId [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< RefMatrixID |
---|
184 | Bool m_scalingListPresentFlag; //!< flag for using default matrix |
---|
185 | UInt m_predMatrixId [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< reference list index |
---|
186 | Int *m_scalingListCoef [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< quantization matrix |
---|
187 | #if TS_FLAT_QUANTIZATION_MATRIX |
---|
188 | Bool m_useTransformSkip; //!< transform skipping flag for setting default scaling matrix for 4x4 |
---|
189 | #endif |
---|
190 | }; |
---|
191 | |
---|
192 | #if PROFILE_TIER_LEVEL_SYNTAX |
---|
193 | class ProfileTierLevel{ |
---|
194 | Int m_profileSpace; |
---|
195 | Bool m_tierFlag; |
---|
196 | Int m_profileIdc; |
---|
197 | Bool m_profileCompatibilityFlag[32]; |
---|
198 | Int m_levelIdc; |
---|
199 | |
---|
200 | public: |
---|
201 | ProfileTierLevel(); |
---|
202 | |
---|
203 | Int getProfileSpace() const { return m_profileSpace; } |
---|
204 | Void setProfileSpace(Int x) { m_profileSpace = x; } |
---|
205 | |
---|
206 | Bool getTierFlag() const { return m_tierFlag; } |
---|
207 | Void setTierFlag(Bool x) { m_tierFlag = x; } |
---|
208 | |
---|
209 | Int getProfileIdc() const { return m_profileIdc; } |
---|
210 | Void setProfileIdc(Int x) { m_profileIdc = x; } |
---|
211 | |
---|
212 | Bool getProfileCompatibilityFlag(Int i) const { return m_profileCompatibilityFlag[i]; } |
---|
213 | Void setProfileCompatibilityFlag(Int i, Bool x) { m_profileCompatibilityFlag[i] = x; } |
---|
214 | |
---|
215 | Int getLevelIdc() const { return m_levelIdc; } |
---|
216 | Void setLevelIdc(Int x) { m_levelIdc = x; } |
---|
217 | }; |
---|
218 | |
---|
219 | |
---|
220 | class TComPTL{ |
---|
221 | ProfileTierLevel m_generalPTL; |
---|
222 | ProfileTierLevel m_subLayerPTL[6]; // max. value of max_sub_layers_minus1 is 6 |
---|
223 | Bool m_subLayerProfilePresentFlag[6]; |
---|
224 | Bool m_subLayerLevelPresentFlag[6]; |
---|
225 | |
---|
226 | public: |
---|
227 | TComPTL(); |
---|
228 | Bool getSubLayerProfilePresentFlag(Int i) const { return m_subLayerProfilePresentFlag[i]; } |
---|
229 | Void setSubLayerProfilePresentFlag(Int i, Bool x) { m_subLayerProfilePresentFlag[i] = x; } |
---|
230 | |
---|
231 | Bool getSubLayerLevelPresentFlag(Int i) const { return m_subLayerLevelPresentFlag[i]; } |
---|
232 | Void setSubLayerLevelPresentFlag(Int i, Bool x) { m_subLayerLevelPresentFlag[i] = x; } |
---|
233 | |
---|
234 | ProfileTierLevel* getGeneralPTL() { return &m_generalPTL; } |
---|
235 | ProfileTierLevel* getSubLayerPTL(Int i) { return &m_subLayerPTL[i]; } |
---|
236 | }; |
---|
237 | #endif |
---|
238 | /// VPS class |
---|
239 | |
---|
240 | class TComVPS |
---|
241 | { |
---|
242 | private: |
---|
243 | Int m_VPSId; |
---|
244 | UInt m_uiMaxTLayers; |
---|
245 | UInt m_uiMaxLayers; |
---|
246 | Bool m_bTemporalIdNestingFlag; |
---|
247 | |
---|
248 | UInt m_numReorderPics[MAX_TLAYER]; |
---|
249 | UInt m_uiMaxDecPicBuffering[MAX_TLAYER]; |
---|
250 | UInt m_uiMaxLatencyIncrease[MAX_TLAYER]; |
---|
251 | #if VPS_SYNTAX_CHANGES |
---|
252 | TComPTL m_pcPTL; |
---|
253 | #endif |
---|
254 | public: |
---|
255 | TComVPS(); |
---|
256 | virtual ~TComVPS(); |
---|
257 | |
---|
258 | Int getVPSId () { return m_VPSId; } |
---|
259 | Void setVPSId (Int i) { m_VPSId = i; } |
---|
260 | |
---|
261 | UInt getMaxTLayers () { return m_uiMaxTLayers; } |
---|
262 | Void setMaxTLayers (UInt t) { m_uiMaxTLayers = t; } |
---|
263 | |
---|
264 | UInt getMaxLayers () { return m_uiMaxLayers; } |
---|
265 | Void setMaxLayers (UInt l) { m_uiMaxLayers = l; } |
---|
266 | |
---|
267 | Bool getTemporalNestingFlag () { return m_bTemporalIdNestingFlag; } |
---|
268 | Void setTemporalNestingFlag (Bool t) { m_bTemporalIdNestingFlag = t; } |
---|
269 | |
---|
270 | Void setNumReorderPics(UInt v, UInt tLayer) { m_numReorderPics[tLayer] = v; } |
---|
271 | UInt getNumReorderPics(UInt tLayer) { return m_numReorderPics[tLayer]; } |
---|
272 | |
---|
273 | Void setMaxDecPicBuffering(UInt v, UInt tLayer) { m_uiMaxDecPicBuffering[tLayer] = v; } |
---|
274 | UInt getMaxDecPicBuffering(UInt tLayer) { return m_uiMaxDecPicBuffering[tLayer]; } |
---|
275 | |
---|
276 | Void setMaxLatencyIncrease(UInt v, UInt tLayer) { m_uiMaxLatencyIncrease[tLayer] = v; } |
---|
277 | UInt getMaxLatencyIncrease(UInt tLayer) { return m_uiMaxLatencyIncrease[tLayer]; } |
---|
278 | #if VPS_SYNTAX_CHANGES |
---|
279 | TComPTL* getPTL() { return &m_pcPTL; } |
---|
280 | #endif |
---|
281 | }; |
---|
282 | |
---|
283 | #if BUFFERING_PERIOD_AND_TIMING_SEI |
---|
284 | struct HrdSubLayerInfo |
---|
285 | { |
---|
286 | Bool fixedPicRateFlag; |
---|
287 | UInt picDurationInTcMinus1; |
---|
288 | Bool lowDelayHrdFlag; |
---|
289 | UInt cpbCntMinus1; |
---|
290 | UInt bitRateValueMinus1[MAX_CPB_CNT][2]; |
---|
291 | UInt cpbSizeValue [MAX_CPB_CNT][2]; |
---|
292 | UInt cbrFlag [MAX_CPB_CNT][2]; |
---|
293 | }; |
---|
294 | #endif |
---|
295 | #if SUPPORT_FOR_VUI |
---|
296 | class TComVUI |
---|
297 | { |
---|
298 | private: |
---|
299 | Bool m_aspectRatioInfoPresentFlag; |
---|
300 | Int m_aspectRatioIdc; |
---|
301 | Int m_sarWidth; |
---|
302 | Int m_sarHeight; |
---|
303 | Bool m_overscanInfoPresentFlag; |
---|
304 | Bool m_overscanAppropriateFlag; |
---|
305 | Bool m_videoSignalTypePresentFlag; |
---|
306 | Int m_videoFormat; |
---|
307 | Bool m_videoFullRangeFlag; |
---|
308 | Bool m_colourDescriptionPresentFlag; |
---|
309 | Int m_colourPrimaries; |
---|
310 | Int m_transferCharacteristics; |
---|
311 | Int m_matrixCoefficients; |
---|
312 | Bool m_chromaLocInfoPresentFlag; |
---|
313 | Int m_chromaSampleLocTypeTopField; |
---|
314 | Int m_chromaSampleLocTypeBottomField; |
---|
315 | Bool m_neutralChromaIndicationFlag; |
---|
316 | Bool m_fieldSeqFlag; |
---|
317 | Bool m_hrdParametersPresentFlag; |
---|
318 | Bool m_bitstreamRestrictionFlag; |
---|
319 | Bool m_tilesFixedStructureFlag; |
---|
320 | Bool m_motionVectorsOverPicBoundariesFlag; |
---|
321 | Int m_maxBytesPerPicDenom; |
---|
322 | Int m_maxBitsPerMinCuDenom; |
---|
323 | Int m_log2MaxMvLengthHorizontal; |
---|
324 | Int m_log2MaxMvLengthVertical; |
---|
325 | #if BUFFERING_PERIOD_AND_TIMING_SEI |
---|
326 | Bool m_timingInfoPresentFlag; |
---|
327 | UInt m_numUnitsInTick; |
---|
328 | UInt m_timeScale; |
---|
329 | Bool m_nalHrdParametersPresentFlag; |
---|
330 | Bool m_vclHrdParametersPresentFlag; |
---|
331 | Bool m_subPicCpbParamsPresentFlag; |
---|
332 | UInt m_tickDivisorMinus2; |
---|
333 | UInt m_duCpbRemovalDelayLengthMinus1; |
---|
334 | UInt m_bitRateScale; |
---|
335 | UInt m_cpbSizeScale; |
---|
336 | UInt m_initialCpbRemovalDelayLengthMinus1; |
---|
337 | UInt m_cpbRemovalDelayLengthMinus1; |
---|
338 | UInt m_dpbOutputDelayLengthMinus1; |
---|
339 | UInt m_numDU; |
---|
340 | HrdSubLayerInfo m_HRD[MAX_TLAYER]; |
---|
341 | #endif |
---|
342 | public: |
---|
343 | TComVUI() |
---|
344 | :m_aspectRatioInfoPresentFlag(false) |
---|
345 | ,m_aspectRatioIdc(0) |
---|
346 | ,m_sarWidth(0) |
---|
347 | ,m_sarHeight(0) |
---|
348 | ,m_overscanInfoPresentFlag(false) |
---|
349 | ,m_overscanAppropriateFlag(false) |
---|
350 | ,m_videoSignalTypePresentFlag(false) |
---|
351 | ,m_videoFormat(5) |
---|
352 | ,m_videoFullRangeFlag(false) |
---|
353 | ,m_colourDescriptionPresentFlag(false) |
---|
354 | ,m_colourPrimaries(2) |
---|
355 | ,m_transferCharacteristics(2) |
---|
356 | ,m_matrixCoefficients(2) |
---|
357 | ,m_chromaLocInfoPresentFlag(false) |
---|
358 | ,m_chromaSampleLocTypeTopField(0) |
---|
359 | ,m_chromaSampleLocTypeBottomField(0) |
---|
360 | ,m_neutralChromaIndicationFlag(false) |
---|
361 | ,m_fieldSeqFlag(false) |
---|
362 | ,m_hrdParametersPresentFlag(false) |
---|
363 | ,m_bitstreamRestrictionFlag(false) |
---|
364 | ,m_tilesFixedStructureFlag(false) |
---|
365 | ,m_motionVectorsOverPicBoundariesFlag(true) |
---|
366 | ,m_maxBytesPerPicDenom(2) |
---|
367 | ,m_maxBitsPerMinCuDenom(1) |
---|
368 | ,m_log2MaxMvLengthHorizontal(15) |
---|
369 | ,m_log2MaxMvLengthVertical(15) |
---|
370 | #if BUFFERING_PERIOD_AND_TIMING_SEI |
---|
371 | ,m_timingInfoPresentFlag(false) |
---|
372 | ,m_numUnitsInTick(1001) |
---|
373 | ,m_timeScale(60000) |
---|
374 | ,m_nalHrdParametersPresentFlag(0) |
---|
375 | ,m_vclHrdParametersPresentFlag(0) |
---|
376 | ,m_subPicCpbParamsPresentFlag(false) |
---|
377 | ,m_tickDivisorMinus2(0) |
---|
378 | ,m_duCpbRemovalDelayLengthMinus1(0) |
---|
379 | ,m_bitRateScale(0) |
---|
380 | ,m_cpbSizeScale(0) |
---|
381 | ,m_initialCpbRemovalDelayLengthMinus1(0) |
---|
382 | ,m_cpbRemovalDelayLengthMinus1(0) |
---|
383 | ,m_dpbOutputDelayLengthMinus1(0) |
---|
384 | #endif |
---|
385 | {} |
---|
386 | |
---|
387 | virtual ~TComVUI() {} |
---|
388 | |
---|
389 | Bool getAspectRatioInfoPresentFlag() { return m_aspectRatioInfoPresentFlag; } |
---|
390 | Void setAspectRatioInfoPresentFlag(Bool i) { m_aspectRatioInfoPresentFlag = i; } |
---|
391 | |
---|
392 | Int getAspectRatioIdc() { return m_aspectRatioIdc; } |
---|
393 | Void setAspectRatioIdc(Int i) { m_aspectRatioIdc = i; } |
---|
394 | |
---|
395 | Int getSarWidth() { return m_sarWidth; } |
---|
396 | Void setSarWidth(Int i) { m_sarWidth = i; } |
---|
397 | |
---|
398 | Int getSarHeight() { return m_sarHeight; } |
---|
399 | Void setSarHeight(Int i) { m_sarHeight = i; } |
---|
400 | |
---|
401 | Bool getOverscanInfoPresentFlag() { return m_overscanInfoPresentFlag; } |
---|
402 | Void setOverscanInfoPresentFlag(Bool i) { m_overscanInfoPresentFlag = i; } |
---|
403 | |
---|
404 | Bool getOverscanAppropriateFlag() { return m_overscanAppropriateFlag; } |
---|
405 | Void setOverscanAppropriateFlag(Bool i) { m_overscanAppropriateFlag = i; } |
---|
406 | |
---|
407 | Bool getVideoSignalTypePresentFlag() { return m_videoSignalTypePresentFlag; } |
---|
408 | Void setVideoSignalTypePresentFlag(Bool i) { m_videoSignalTypePresentFlag = i; } |
---|
409 | |
---|
410 | Int getVideoFormat() { return m_videoFormat; } |
---|
411 | Void setVideoFormat(Int i) { m_videoFormat = i; } |
---|
412 | |
---|
413 | Bool getVideoFullRangeFlag() { return m_videoFullRangeFlag; } |
---|
414 | Void setVideoFullRangeFlag(Bool i) { m_videoFullRangeFlag = i; } |
---|
415 | |
---|
416 | Bool getColourDescriptionPresentFlag() { return m_colourDescriptionPresentFlag; } |
---|
417 | Void setColourDescriptionPresentFlag(Bool i) { m_colourDescriptionPresentFlag = i; } |
---|
418 | |
---|
419 | Int getColourPrimaries() { return m_colourPrimaries; } |
---|
420 | Void setColourPrimaries(Int i) { m_colourPrimaries = i; } |
---|
421 | |
---|
422 | Int getTransferCharacteristics() { return m_transferCharacteristics; } |
---|
423 | Void setTransferCharacteristics(Int i) { m_transferCharacteristics = i; } |
---|
424 | |
---|
425 | Int getMatrixCoefficients() { return m_matrixCoefficients; } |
---|
426 | Void setMatrixCoefficients(Int i) { m_matrixCoefficients = i; } |
---|
427 | |
---|
428 | Bool getChromaLocInfoPresentFlag() { return m_chromaLocInfoPresentFlag; } |
---|
429 | Void setChromaLocInfoPresentFlag(Bool i) { m_chromaLocInfoPresentFlag = i; } |
---|
430 | |
---|
431 | Int getChromaSampleLocTypeTopField() { return m_chromaSampleLocTypeTopField; } |
---|
432 | Void setChromaSampleLocTypeTopField(Int i) { m_chromaSampleLocTypeTopField = i; } |
---|
433 | |
---|
434 | Int getChromaSampleLocTypeBottomField() { return m_chromaSampleLocTypeBottomField; } |
---|
435 | Void setChromaSampleLocTypeBottomField(Int i) { m_chromaSampleLocTypeBottomField = i; } |
---|
436 | |
---|
437 | Bool getNeutralChromaIndicationFlag() { return m_neutralChromaIndicationFlag; } |
---|
438 | Void setNeutralChromaIndicationFlag(Bool i) { m_neutralChromaIndicationFlag = i; } |
---|
439 | |
---|
440 | Bool getFieldSeqFlag() { return m_fieldSeqFlag; } |
---|
441 | Void setFieldSeqFlag(Bool i) { m_fieldSeqFlag = i; } |
---|
442 | |
---|
443 | Bool getHrdParametersPresentFlag() { return m_hrdParametersPresentFlag; } |
---|
444 | Void setHrdParametersPresentFlag(Bool i) { m_hrdParametersPresentFlag = i; } |
---|
445 | |
---|
446 | Bool getBitstreamRestrictionFlag() { return m_bitstreamRestrictionFlag; } |
---|
447 | Void setBitstreamRestrictionFlag(Bool i) { m_bitstreamRestrictionFlag = i; } |
---|
448 | |
---|
449 | Bool getTilesFixedStructureFlag() { return m_tilesFixedStructureFlag; } |
---|
450 | Void setTilesFixedStructureFlag(Bool i) { m_tilesFixedStructureFlag = i; } |
---|
451 | |
---|
452 | Bool getMotionVectorsOverPicBoundariesFlag() { return m_motionVectorsOverPicBoundariesFlag; } |
---|
453 | Void setMotionVectorsOverPicBoundariesFlag(Bool i) { m_motionVectorsOverPicBoundariesFlag = i; } |
---|
454 | |
---|
455 | Int getMaxBytesPerPicDenom() { return m_maxBytesPerPicDenom; } |
---|
456 | Void setMaxBytesPerPicDenom(Int i) { m_maxBytesPerPicDenom = i; } |
---|
457 | |
---|
458 | Int getMaxBitsPerMinCuDenom() { return m_maxBitsPerMinCuDenom; } |
---|
459 | Void setMaxBitsPerMinCuDenom(Int i) { m_maxBitsPerMinCuDenom = i; } |
---|
460 | |
---|
461 | Int getLog2MaxMvLengthHorizontal() { return m_log2MaxMvLengthHorizontal; } |
---|
462 | Void setLog2MaxMvLengthHorizontal(Int i) { m_log2MaxMvLengthHorizontal = i; } |
---|
463 | |
---|
464 | Int getLog2MaxMvLengthVertical() { return m_log2MaxMvLengthVertical; } |
---|
465 | Void setLog2MaxMvLengthVertical(Int i) { m_log2MaxMvLengthVertical = i; } |
---|
466 | |
---|
467 | #if BUFFERING_PERIOD_AND_TIMING_SEI |
---|
468 | Void setTimingInfoPresentFlag ( Bool flag ) { m_timingInfoPresentFlag = flag; } |
---|
469 | Bool getTimingInfoPresentFlag ( ) { return m_timingInfoPresentFlag; } |
---|
470 | |
---|
471 | Void setNumUnitsInTick ( UInt value ) { m_numUnitsInTick = value; } |
---|
472 | UInt getNumUnitsInTick ( ) { return m_numUnitsInTick; } |
---|
473 | |
---|
474 | Void setTimeScale ( UInt value ) { m_timeScale = value; } |
---|
475 | UInt getTimeScale ( ) { return m_timeScale; } |
---|
476 | |
---|
477 | Void setNalHrdParametersPresentFlag ( Bool flag ) { m_nalHrdParametersPresentFlag = flag; } |
---|
478 | Bool getNalHrdParametersPresentFlag ( ) { return m_nalHrdParametersPresentFlag; } |
---|
479 | |
---|
480 | Void setVclHrdParametersPresentFlag ( Bool flag ) { m_vclHrdParametersPresentFlag = flag; } |
---|
481 | Bool getVclHrdParametersPresentFlag ( ) { return m_vclHrdParametersPresentFlag; } |
---|
482 | |
---|
483 | Void setSubPicCpbParamsPresentFlag ( Bool flag ) { m_subPicCpbParamsPresentFlag = flag; } |
---|
484 | Bool getSubPicCpbParamsPresentFlag ( ) { return m_subPicCpbParamsPresentFlag; } |
---|
485 | |
---|
486 | Void setTickDivisorMinus2 ( UInt value ) { m_tickDivisorMinus2 = value; } |
---|
487 | UInt getTickDivisorMinus2 ( ) { return m_tickDivisorMinus2; } |
---|
488 | |
---|
489 | Void setDuCpbRemovalDelayLengthMinus1 ( UInt value ) { m_duCpbRemovalDelayLengthMinus1 = value; } |
---|
490 | UInt getDuCpbRemovalDelayLengthMinus1 ( ) { return m_duCpbRemovalDelayLengthMinus1; } |
---|
491 | |
---|
492 | Void setBitRateScale ( UInt value ) { m_bitRateScale = value; } |
---|
493 | UInt getBitRateScale ( ) { return m_bitRateScale; } |
---|
494 | |
---|
495 | Void setCpbSizeScale ( UInt value ) { m_cpbSizeScale = value; } |
---|
496 | UInt getCpbSizeScale ( ) { return m_cpbSizeScale; } |
---|
497 | |
---|
498 | Void setInitialCpbRemovalDelayLengthMinus1( UInt value ) { m_initialCpbRemovalDelayLengthMinus1 = value; } |
---|
499 | UInt getInitialCpbRemovalDelayLengthMinus1( ) { return m_initialCpbRemovalDelayLengthMinus1; } |
---|
500 | |
---|
501 | Void setCpbRemovalDelayLengthMinus1 ( UInt value ) { m_cpbRemovalDelayLengthMinus1 = value; } |
---|
502 | UInt getCpbRemovalDelayLengthMinus1 ( ) { return m_cpbRemovalDelayLengthMinus1; } |
---|
503 | |
---|
504 | Void setDpbOutputDelayLengthMinus1 ( UInt value ) { m_dpbOutputDelayLengthMinus1 = value; } |
---|
505 | UInt getDpbOutputDelayLengthMinus1 ( ) { return m_dpbOutputDelayLengthMinus1; } |
---|
506 | |
---|
507 | Void setFixedPicRateFlag ( Int layer, Bool flag ) { m_HRD[layer].fixedPicRateFlag = flag; } |
---|
508 | Bool getFixedPicRateFlag ( Int layer ) { return m_HRD[layer].fixedPicRateFlag; } |
---|
509 | |
---|
510 | Void setPicDurationInTcMinus1 ( Int layer, UInt value ) { m_HRD[layer].picDurationInTcMinus1 = value; } |
---|
511 | UInt getPicDurationInTcMinus1 ( Int layer ) { return m_HRD[layer].picDurationInTcMinus1; } |
---|
512 | |
---|
513 | Void setLowDelayHrdFlag ( Int layer, Bool flag ) { m_HRD[layer].lowDelayHrdFlag = flag; } |
---|
514 | Bool getLowDelayHrdFlag ( Int layer ) { return m_HRD[layer].lowDelayHrdFlag; } |
---|
515 | |
---|
516 | Void setCpbCntMinus1 ( Int layer, UInt value ) { m_HRD[layer].cpbCntMinus1 = value; } |
---|
517 | UInt getCpbCntMinus1 ( Int layer ) { return m_HRD[layer].cpbCntMinus1; } |
---|
518 | |
---|
519 | Void setBitRateValueMinus1 ( Int layer, Int cpbcnt, Int nalOrVcl, UInt value ) { m_HRD[layer].bitRateValueMinus1[cpbcnt][nalOrVcl] = value; } |
---|
520 | UInt getBitRateValueMinus1 ( Int layer, Int cpbcnt, Int nalOrVcl ) { return m_HRD[layer].bitRateValueMinus1[cpbcnt][nalOrVcl]; } |
---|
521 | |
---|
522 | Void setCpbSizeValueMinus1 ( Int layer, Int cpbcnt, Int nalOrVcl, UInt value ) { m_HRD[layer].cpbSizeValue[cpbcnt][nalOrVcl] = value; } |
---|
523 | UInt getCpbSizeValueMinus1 ( Int layer, Int cpbcnt, Int nalOrVcl ) { return m_HRD[layer].cpbSizeValue[cpbcnt][nalOrVcl]; } |
---|
524 | |
---|
525 | Void setCbrFlag ( Int layer, Int cpbcnt, Int nalOrVcl, UInt value ) { m_HRD[layer].cbrFlag[cpbcnt][nalOrVcl] = value; } |
---|
526 | Bool getCbrFlag ( Int layer, Int cpbcnt, Int nalOrVcl ) { return m_HRD[layer].cbrFlag[cpbcnt][nalOrVcl]; } |
---|
527 | |
---|
528 | Void setNumDU ( UInt value ) { m_numDU = value; } |
---|
529 | UInt getNumDU ( ) { return m_numDU; } |
---|
530 | #endif |
---|
531 | }; |
---|
532 | #endif |
---|
533 | |
---|
534 | /// SPS class |
---|
535 | class TComSPS |
---|
536 | { |
---|
537 | private: |
---|
538 | Int m_SPSId; |
---|
539 | #if !SPS_SYNTAX_CHANGES |
---|
540 | Int m_ProfileSpace; |
---|
541 | Int m_ProfileIdc; |
---|
542 | Int m_ReservedIndicatorFlags; |
---|
543 | Int m_LevelIdc; |
---|
544 | UInt m_ProfileCompatibility; |
---|
545 | #endif |
---|
546 | Int m_VPSId; |
---|
547 | Int m_chromaFormatIdc; |
---|
548 | |
---|
549 | UInt m_uiMaxTLayers; // maximum number of temporal layers |
---|
550 | |
---|
551 | // Structure |
---|
552 | UInt m_picWidthInLumaSamples; |
---|
553 | UInt m_picHeightInLumaSamples; |
---|
554 | Bool m_picCroppingFlag; |
---|
555 | Int m_picCropLeftOffset; |
---|
556 | Int m_picCropRightOffset; |
---|
557 | Int m_picCropTopOffset; |
---|
558 | Int m_picCropBottomOffset; |
---|
559 | UInt m_uiMaxCUWidth; |
---|
560 | UInt m_uiMaxCUHeight; |
---|
561 | UInt m_uiMaxCUDepth; |
---|
562 | UInt m_uiMinTrDepth; |
---|
563 | UInt m_uiMaxTrDepth; |
---|
564 | TComRPSList m_RPSList; |
---|
565 | Bool m_bLongTermRefsPresent; |
---|
566 | Bool m_TMVPFlagsPresent; |
---|
567 | Int m_numReorderPics[MAX_TLAYER]; |
---|
568 | |
---|
569 | // Tool list |
---|
570 | UInt m_uiQuadtreeTULog2MaxSize; |
---|
571 | UInt m_uiQuadtreeTULog2MinSize; |
---|
572 | UInt m_uiQuadtreeTUMaxDepthInter; |
---|
573 | UInt m_uiQuadtreeTUMaxDepthIntra; |
---|
574 | Bool m_usePCM; |
---|
575 | UInt m_pcmLog2MaxSize; |
---|
576 | UInt m_uiPCMLog2MinSize; |
---|
577 | Bool m_useAMP; |
---|
578 | #if !REMOVE_ALF |
---|
579 | Bool m_bUseALF; |
---|
580 | #endif |
---|
581 | #if !REMOVE_LMCHROMA |
---|
582 | Bool m_bUseLMChroma; // JL: |
---|
583 | #endif |
---|
584 | |
---|
585 | #if !PPS_TS_FLAG |
---|
586 | Bool m_useTransformSkip; |
---|
587 | Bool m_useTransformSkipFast; |
---|
588 | #endif |
---|
589 | |
---|
590 | Bool m_bUseLComb; |
---|
591 | #if !REMOVE_NSQT |
---|
592 | Bool m_useNSQT; |
---|
593 | #endif |
---|
594 | |
---|
595 | Bool m_restrictedRefPicListsFlag; |
---|
596 | Bool m_listsModificationPresentFlag; |
---|
597 | |
---|
598 | // Parameter |
---|
599 | #if !SPS_AMVP_CLEANUP |
---|
600 | AMVP_MODE m_aeAMVPMode[MAX_CU_DEPTH]; |
---|
601 | #endif |
---|
602 | UInt m_uiBitDepth; |
---|
603 | UInt m_uiBitIncrement; |
---|
604 | Int m_qpBDOffsetY; |
---|
605 | Int m_qpBDOffsetC; |
---|
606 | |
---|
607 | Bool m_useLossless; |
---|
608 | |
---|
609 | UInt m_uiPCMBitDepthLuma; |
---|
610 | UInt m_uiPCMBitDepthChroma; |
---|
611 | Bool m_bPCMFilterDisableFlag; |
---|
612 | |
---|
613 | UInt m_uiBitsForPOC; |
---|
614 | #if LTRP_IN_SPS |
---|
615 | UInt m_numLongTermRefPicSPS; |
---|
616 | UInt m_ltRefPicPocLsbSps[33]; |
---|
617 | Bool m_usedByCurrPicLtSPSFlag[33]; |
---|
618 | #endif |
---|
619 | // Max physical transform size |
---|
620 | UInt m_uiMaxTrSize; |
---|
621 | |
---|
622 | Int m_iAMPAcc[MAX_CU_DEPTH]; |
---|
623 | #if !MOVE_LOOP_FILTER_SLICES_FLAG |
---|
624 | Bool m_bLFCrossSliceBoundaryFlag; |
---|
625 | #endif |
---|
626 | Bool m_bUseSAO; |
---|
627 | |
---|
628 | Bool m_bTemporalIdNestingFlag; // temporal_id_nesting_flag |
---|
629 | |
---|
630 | Bool m_scalingListEnabledFlag; |
---|
631 | Bool m_scalingListPresentFlag; |
---|
632 | TComScalingList* m_scalingList; //!< ScalingList class pointer |
---|
633 | UInt m_uiMaxDecPicBuffering[MAX_TLAYER]; |
---|
634 | UInt m_uiMaxLatencyIncrease[MAX_TLAYER]; |
---|
635 | |
---|
636 | Bool m_useDF; |
---|
637 | |
---|
638 | #if SUPPORT_FOR_VUI |
---|
639 | Bool m_vuiParametersPresentFlag; |
---|
640 | TComVUI m_vuiParameters; |
---|
641 | #endif |
---|
642 | |
---|
643 | static const Int m_cropUnitX[MAX_CHROMA_FORMAT_IDC+1]; |
---|
644 | static const Int m_cropUnitY[MAX_CHROMA_FORMAT_IDC+1]; |
---|
645 | #if SPS_SYNTAX_CHANGES |
---|
646 | TComPTL m_pcPTL; |
---|
647 | #endif |
---|
648 | #if SVC_EXTENSION |
---|
649 | UInt m_layerId; |
---|
650 | #endif |
---|
651 | public: |
---|
652 | TComSPS(); |
---|
653 | virtual ~TComSPS(); |
---|
654 | |
---|
655 | Int getVPSId () { return m_VPSId; } |
---|
656 | Void setVPSId (Int i) { m_VPSId = i; } |
---|
657 | Int getSPSId () { return m_SPSId; } |
---|
658 | Void setSPSId (Int i) { m_SPSId = i; } |
---|
659 | #if !SPS_SYNTAX_CHANGES |
---|
660 | Int getProfileSpace () { return m_ProfileSpace; } |
---|
661 | Void setProfileSpace (Int i) { m_ProfileSpace = i; } |
---|
662 | Int getProfileIdc () { return m_ProfileIdc; } |
---|
663 | Void setProfileIdc (Int i) { m_ProfileIdc = i; if (m_ProfileSpace == 0) m_ProfileCompatibility |= (1 << (i - 1)); } |
---|
664 | Int getRsvdIndFlags () { return m_ReservedIndicatorFlags; } |
---|
665 | Void setRsvdIndFlags (Int i) { m_ReservedIndicatorFlags = i; } |
---|
666 | Int getLevelIdc () { return m_LevelIdc; } |
---|
667 | Void setLevelIdc (Int i) { m_LevelIdc = i; } |
---|
668 | UInt getProfileCompat () { return m_ProfileCompatibility; } |
---|
669 | Void setProfileCompat (UInt i) { m_ProfileCompatibility = i; if (m_ProfileIdc != 0 && m_ProfileSpace == 0) m_ProfileCompatibility |= (1 << (m_ProfileIdc - 1)); } |
---|
670 | #endif |
---|
671 | Int getChromaFormatIdc () { return m_chromaFormatIdc; } |
---|
672 | Void setChromaFormatIdc (Int i) { m_chromaFormatIdc = i; } |
---|
673 | |
---|
674 | static Int getCropUnitX (Int chromaFormatIdc) { assert (chromaFormatIdc > 0 && chromaFormatIdc <= MAX_CHROMA_FORMAT_IDC); return m_cropUnitX[chromaFormatIdc]; } |
---|
675 | static Int getCropUnitY (Int chromaFormatIdc) { assert (chromaFormatIdc > 0 && chromaFormatIdc <= MAX_CHROMA_FORMAT_IDC); return m_cropUnitY[chromaFormatIdc]; } |
---|
676 | |
---|
677 | // structure |
---|
678 | Void setPicWidthInLumaSamples ( UInt u ) { m_picWidthInLumaSamples = u; } |
---|
679 | UInt getPicWidthInLumaSamples () { return m_picWidthInLumaSamples; } |
---|
680 | Void setPicHeightInLumaSamples ( UInt u ) { m_picHeightInLumaSamples = u; } |
---|
681 | UInt getPicHeightInLumaSamples () { return m_picHeightInLumaSamples; } |
---|
682 | |
---|
683 | Bool getPicCroppingFlag() const { return m_picCroppingFlag; } |
---|
684 | Void setPicCroppingFlag(Bool val) { m_picCroppingFlag = val; } |
---|
685 | Int getPicCropLeftOffset() const { return m_picCropLeftOffset; } |
---|
686 | Void setPicCropLeftOffset(Int val) { m_picCropLeftOffset = val; } |
---|
687 | Int getPicCropRightOffset() const { return m_picCropRightOffset; } |
---|
688 | Void setPicCropRightOffset(Int val) { m_picCropRightOffset = val; } |
---|
689 | Int getPicCropTopOffset() const { return m_picCropTopOffset; } |
---|
690 | Void setPicCropTopOffset(Int val) { m_picCropTopOffset = val; } |
---|
691 | Int getPicCropBottomOffset() const { return m_picCropBottomOffset; } |
---|
692 | Void setPicCropBottomOffset(Int val) { m_picCropBottomOffset = val; } |
---|
693 | #if LTRP_IN_SPS |
---|
694 | UInt getNumLongTermRefPicSPS() { return m_numLongTermRefPicSPS; } |
---|
695 | Void setNumLongTermRefPicSPS(UInt val) { m_numLongTermRefPicSPS = val; } |
---|
696 | |
---|
697 | UInt getLtRefPicPocLsbSps(UInt index) { return m_ltRefPicPocLsbSps[index]; } |
---|
698 | Void setLtRefPicPocLsbSps(UInt index, UInt val) { m_ltRefPicPocLsbSps[index] = val; } |
---|
699 | |
---|
700 | Bool getUsedByCurrPicLtSPSFlag(Int i) {return m_usedByCurrPicLtSPSFlag[i];} |
---|
701 | Void setUsedByCurrPicLtSPSFlag(Int i, Bool x) { m_usedByCurrPicLtSPSFlag[i] = x;} |
---|
702 | #endif |
---|
703 | Void setMaxCUWidth ( UInt u ) { m_uiMaxCUWidth = u; } |
---|
704 | UInt getMaxCUWidth () { return m_uiMaxCUWidth; } |
---|
705 | Void setMaxCUHeight ( UInt u ) { m_uiMaxCUHeight = u; } |
---|
706 | UInt getMaxCUHeight () { return m_uiMaxCUHeight; } |
---|
707 | Void setMaxCUDepth ( UInt u ) { m_uiMaxCUDepth = u; } |
---|
708 | UInt getMaxCUDepth () { return m_uiMaxCUDepth; } |
---|
709 | Void setUsePCM ( Bool b ) { m_usePCM = b; } |
---|
710 | Bool getUsePCM () { return m_usePCM; } |
---|
711 | Void setPCMLog2MaxSize ( UInt u ) { m_pcmLog2MaxSize = u; } |
---|
712 | UInt getPCMLog2MaxSize () { return m_pcmLog2MaxSize; } |
---|
713 | Void setPCMLog2MinSize ( UInt u ) { m_uiPCMLog2MinSize = u; } |
---|
714 | UInt getPCMLog2MinSize () { return m_uiPCMLog2MinSize; } |
---|
715 | Void setBitsForPOC ( UInt u ) { m_uiBitsForPOC = u; } |
---|
716 | UInt getBitsForPOC () { return m_uiBitsForPOC; } |
---|
717 | Bool getUseAMP() { return m_useAMP; } |
---|
718 | Void setUseAMP( Bool b ) { m_useAMP = b; } |
---|
719 | Void setMinTrDepth ( UInt u ) { m_uiMinTrDepth = u; } |
---|
720 | UInt getMinTrDepth () { return m_uiMinTrDepth; } |
---|
721 | Void setMaxTrDepth ( UInt u ) { m_uiMaxTrDepth = u; } |
---|
722 | UInt getMaxTrDepth () { return m_uiMaxTrDepth; } |
---|
723 | Void setQuadtreeTULog2MaxSize( UInt u ) { m_uiQuadtreeTULog2MaxSize = u; } |
---|
724 | UInt getQuadtreeTULog2MaxSize() { return m_uiQuadtreeTULog2MaxSize; } |
---|
725 | Void setQuadtreeTULog2MinSize( UInt u ) { m_uiQuadtreeTULog2MinSize = u; } |
---|
726 | UInt getQuadtreeTULog2MinSize() { return m_uiQuadtreeTULog2MinSize; } |
---|
727 | Void setQuadtreeTUMaxDepthInter( UInt u ) { m_uiQuadtreeTUMaxDepthInter = u; } |
---|
728 | Void setQuadtreeTUMaxDepthIntra( UInt u ) { m_uiQuadtreeTUMaxDepthIntra = u; } |
---|
729 | UInt getQuadtreeTUMaxDepthInter() { return m_uiQuadtreeTUMaxDepthInter; } |
---|
730 | UInt getQuadtreeTUMaxDepthIntra() { return m_uiQuadtreeTUMaxDepthIntra; } |
---|
731 | Void setNumReorderPics(Int i, UInt tlayer) { m_numReorderPics[tlayer] = i; } |
---|
732 | Int getNumReorderPics(UInt tlayer) { return m_numReorderPics[tlayer]; } |
---|
733 | Void createRPSList( Int numRPS ); |
---|
734 | TComRPSList* getRPSList() { return &m_RPSList; } |
---|
735 | Bool getLongTermRefsPresent() { return m_bLongTermRefsPresent; } |
---|
736 | Void setLongTermRefsPresent(Bool b) { m_bLongTermRefsPresent=b; } |
---|
737 | Bool getTMVPFlagsPresent() { return m_TMVPFlagsPresent; } |
---|
738 | Void setTMVPFlagsPresent(Bool b) { m_TMVPFlagsPresent=b; } |
---|
739 | // physical transform |
---|
740 | Void setMaxTrSize ( UInt u ) { m_uiMaxTrSize = u; } |
---|
741 | UInt getMaxTrSize () { return m_uiMaxTrSize; } |
---|
742 | |
---|
743 | // Tool list |
---|
744 | #if !REMOVE_ALF |
---|
745 | Bool getUseALF () { return m_bUseALF; } |
---|
746 | Void setUseALF ( Bool b ) { m_bUseALF = b; } |
---|
747 | #endif |
---|
748 | Void setUseLComb (Bool b) { m_bUseLComb = b; } |
---|
749 | Bool getUseLComb () { return m_bUseLComb; } |
---|
750 | #if !REMOVE_LMCHROMA |
---|
751 | Bool getUseLMChroma () { return m_bUseLMChroma; } |
---|
752 | Void setUseLMChroma ( Bool b ) { m_bUseLMChroma = b; } |
---|
753 | #endif |
---|
754 | |
---|
755 | #if !PPS_TS_FLAG |
---|
756 | Bool getUseTransformSkip () { return m_useTransformSkip; } |
---|
757 | Void setUseTransformSkip ( Bool b ) { m_useTransformSkip = b; } |
---|
758 | Bool getUseTransformSkipFast () { return m_useTransformSkipFast; } |
---|
759 | Void setUseTransformSkipFast ( Bool b ) { m_useTransformSkipFast = b; } |
---|
760 | #endif |
---|
761 | |
---|
762 | Bool getUseLossless () { return m_useLossless; } |
---|
763 | Void setUseLossless ( Bool b ) { m_useLossless = b; } |
---|
764 | #if !REMOVE_NSQT |
---|
765 | Bool getUseNSQT() { return m_useNSQT; } |
---|
766 | Void setUseNSQT( Bool b ) { m_useNSQT = b; } |
---|
767 | #endif |
---|
768 | |
---|
769 | Bool getRestrictedRefPicListsFlag () { return m_restrictedRefPicListsFlag; } |
---|
770 | Void setRestrictedRefPicListsFlag ( Bool b ) { m_restrictedRefPicListsFlag = b; } |
---|
771 | Bool getListsModificationPresentFlag () { return m_listsModificationPresentFlag; } |
---|
772 | Void setListsModificationPresentFlag ( Bool b ) { m_listsModificationPresentFlag = b; } |
---|
773 | |
---|
774 | #if !SPS_AMVP_CLEANUP |
---|
775 | // AMVP mode (for each depth) |
---|
776 | AMVP_MODE getAMVPMode ( UInt uiDepth ) { assert(uiDepth < g_uiMaxCUDepth); return m_aeAMVPMode[uiDepth]; } |
---|
777 | Void setAMVPMode ( UInt uiDepth, AMVP_MODE eMode) { assert(uiDepth < g_uiMaxCUDepth); m_aeAMVPMode[uiDepth] = eMode; } |
---|
778 | #endif |
---|
779 | |
---|
780 | // AMP accuracy |
---|
781 | Int getAMPAcc ( UInt uiDepth ) { return m_iAMPAcc[uiDepth]; } |
---|
782 | Void setAMPAcc ( UInt uiDepth, Int iAccu ) { assert( uiDepth < g_uiMaxCUDepth); m_iAMPAcc[uiDepth] = iAccu; } |
---|
783 | |
---|
784 | // Bit-depth |
---|
785 | UInt getBitDepth () { return m_uiBitDepth; } |
---|
786 | Void setBitDepth ( UInt u ) { m_uiBitDepth = u; } |
---|
787 | UInt getBitIncrement () { return m_uiBitIncrement; } |
---|
788 | Void setBitIncrement ( UInt u ) { m_uiBitIncrement = u; } |
---|
789 | Int getQpBDOffsetY () { return m_qpBDOffsetY; } |
---|
790 | Void setQpBDOffsetY ( Int value ) { m_qpBDOffsetY = value; } |
---|
791 | Int getQpBDOffsetC () { return m_qpBDOffsetC; } |
---|
792 | Void setQpBDOffsetC ( Int value ) { m_qpBDOffsetC = value; } |
---|
793 | #if !MOVE_LOOP_FILTER_SLICES_FLAG |
---|
794 | Void setLFCrossSliceBoundaryFlag ( Bool bValue ) { m_bLFCrossSliceBoundaryFlag = bValue; } |
---|
795 | Bool getLFCrossSliceBoundaryFlag () { return m_bLFCrossSliceBoundaryFlag; } |
---|
796 | #endif |
---|
797 | Void setUseSAO (Bool bVal) {m_bUseSAO = bVal;} |
---|
798 | Bool getUseSAO () {return m_bUseSAO;} |
---|
799 | |
---|
800 | UInt getMaxTLayers() { return m_uiMaxTLayers; } |
---|
801 | Void setMaxTLayers( UInt uiMaxTLayers ) { assert( uiMaxTLayers <= MAX_TLAYER ); m_uiMaxTLayers = uiMaxTLayers; } |
---|
802 | |
---|
803 | Bool getTemporalIdNestingFlag() { return m_bTemporalIdNestingFlag; } |
---|
804 | Void setTemporalIdNestingFlag( Bool bValue ) { m_bTemporalIdNestingFlag = bValue; } |
---|
805 | UInt getPCMBitDepthLuma () { return m_uiPCMBitDepthLuma; } |
---|
806 | Void setPCMBitDepthLuma ( UInt u ) { m_uiPCMBitDepthLuma = u; } |
---|
807 | UInt getPCMBitDepthChroma () { return m_uiPCMBitDepthChroma; } |
---|
808 | Void setPCMBitDepthChroma ( UInt u ) { m_uiPCMBitDepthChroma = u; } |
---|
809 | Void setPCMFilterDisableFlag ( Bool bValue ) { m_bPCMFilterDisableFlag = bValue; } |
---|
810 | Bool getPCMFilterDisableFlag () { return m_bPCMFilterDisableFlag; } |
---|
811 | |
---|
812 | Bool getScalingListFlag () { return m_scalingListEnabledFlag; } |
---|
813 | Void setScalingListFlag ( Bool b ) { m_scalingListEnabledFlag = b; } |
---|
814 | Bool getScalingListPresentFlag() { return m_scalingListPresentFlag; } |
---|
815 | Void setScalingListPresentFlag( Bool b ) { m_scalingListPresentFlag = b; } |
---|
816 | Void setScalingList ( TComScalingList *scalingList); |
---|
817 | TComScalingList* getScalingList () { return m_scalingList; } //!< get ScalingList class pointer in SPS |
---|
818 | UInt getMaxDecPicBuffering (UInt tlayer) { return m_uiMaxDecPicBuffering[tlayer]; } |
---|
819 | Void setMaxDecPicBuffering ( UInt ui, UInt tlayer ) { m_uiMaxDecPicBuffering[tlayer] = ui; } |
---|
820 | UInt getMaxLatencyIncrease (UInt tlayer) { return m_uiMaxLatencyIncrease[tlayer]; } |
---|
821 | Void setMaxLatencyIncrease ( UInt ui , UInt tlayer) { m_uiMaxLatencyIncrease[tlayer] = ui; } |
---|
822 | |
---|
823 | #if SUPPORT_FOR_VUI |
---|
824 | Bool getVuiParametersPresentFlag() { return m_vuiParametersPresentFlag; } |
---|
825 | Void setVuiParametersPresentFlag(Bool b) { m_vuiParametersPresentFlag = b; } |
---|
826 | TComVUI* getVuiParameters() { return &m_vuiParameters; } |
---|
827 | #if BUFFERING_PERIOD_AND_TIMING_SEI |
---|
828 | Void setHrdParameters( UInt frameRate, UInt numDU, UInt bitRate, Bool randomAccess ); |
---|
829 | #endif |
---|
830 | #endif |
---|
831 | |
---|
832 | #if SPS_SYNTAX_CHANGES |
---|
833 | TComPTL* getPTL() { return &m_pcPTL; } |
---|
834 | #endif |
---|
835 | #if SVC_EXTENSION |
---|
836 | Void setLayerId(UInt layerId) { m_layerId = layerId; } |
---|
837 | UInt getLayerId() { return m_layerId; } |
---|
838 | #endif |
---|
839 | }; |
---|
840 | |
---|
841 | /// Reference Picture Lists class |
---|
842 | class TComRefPicListModification |
---|
843 | { |
---|
844 | private: |
---|
845 | UInt m_bRefPicListModificationFlagL0; |
---|
846 | UInt m_bRefPicListModificationFlagL1; |
---|
847 | UInt m_RefPicSetIdxL0[32]; |
---|
848 | UInt m_RefPicSetIdxL1[32]; |
---|
849 | |
---|
850 | public: |
---|
851 | TComRefPicListModification(); |
---|
852 | virtual ~TComRefPicListModification(); |
---|
853 | |
---|
854 | Void create (); |
---|
855 | Void destroy (); |
---|
856 | |
---|
857 | Bool getRefPicListModificationFlagL0() { return m_bRefPicListModificationFlagL0; } |
---|
858 | Void setRefPicListModificationFlagL0(Bool flag) { m_bRefPicListModificationFlagL0 = flag; } |
---|
859 | Bool getRefPicListModificationFlagL1() { return m_bRefPicListModificationFlagL1; } |
---|
860 | Void setRefPicListModificationFlagL1(Bool flag) { m_bRefPicListModificationFlagL1 = flag; } |
---|
861 | Void setRefPicSetIdxL0(UInt idx, UInt refPicSetIdx) { m_RefPicSetIdxL0[idx] = refPicSetIdx; } |
---|
862 | UInt getRefPicSetIdxL0(UInt idx) { return m_RefPicSetIdxL0[idx]; } |
---|
863 | Void setRefPicSetIdxL1(UInt idx, UInt refPicSetIdx) { m_RefPicSetIdxL1[idx] = refPicSetIdx; } |
---|
864 | UInt getRefPicSetIdxL1(UInt idx) { return m_RefPicSetIdxL1[idx]; } |
---|
865 | }; |
---|
866 | |
---|
867 | /// PPS class |
---|
868 | class TComPPS |
---|
869 | { |
---|
870 | private: |
---|
871 | Int m_PPSId; // pic_parameter_set_id |
---|
872 | Int m_SPSId; // seq_parameter_set_id |
---|
873 | Int m_picInitQPMinus26; |
---|
874 | Bool m_useDQP; |
---|
875 | Bool m_bConstrainedIntraPred; // constrained_intra_pred_flag |
---|
876 | #if CHROMA_QP_EXTENSION |
---|
877 | Bool m_bSliceChromaQpFlag; // slicelevel_chroma_qp_flag |
---|
878 | #endif |
---|
879 | |
---|
880 | // access channel |
---|
881 | TComSPS* m_pcSPS; |
---|
882 | UInt m_uiMaxCuDQPDepth; |
---|
883 | UInt m_uiMinCuDQPSize; |
---|
884 | |
---|
885 | Int m_chromaCbQpOffset; |
---|
886 | Int m_chromaCrQpOffset; |
---|
887 | |
---|
888 | UInt m_numRefIdxL0DefaultActive; |
---|
889 | UInt m_numRefIdxL1DefaultActive; |
---|
890 | |
---|
891 | #if !REMOVE_FGS |
---|
892 | Int m_iSliceGranularity; |
---|
893 | #endif |
---|
894 | |
---|
895 | Bool m_bUseWeightPred; // Use of Weighting Prediction (P_SLICE) |
---|
896 | Bool m_useWeightedBiPred; // Use of Weighting Bi-Prediction (B_SLICE) |
---|
897 | Bool m_OutputFlagPresentFlag; // Indicates the presence of output_flag in slice header |
---|
898 | |
---|
899 | Bool m_TransquantBypassEnableFlag; // Indicates presence of cu_transquant_bypass_flag in CUs. |
---|
900 | #if PPS_TS_FLAG |
---|
901 | Bool m_useTransformSkip; |
---|
902 | #endif |
---|
903 | #if !TILES_WPP_ENTROPYSLICES_FLAGS |
---|
904 | #if DEPENDENT_SLICES |
---|
905 | Bool m_bDependentSliceEnabledFlag; // Indicates the presence of dependent_slices_flag in slice header |
---|
906 | Bool m_bCabacIndependentFlag; // Indicates the presence of dependent_slices_flag in slice header |
---|
907 | #endif |
---|
908 | UInt m_tilesOrEntropyCodingSyncIdc; |
---|
909 | #else |
---|
910 | Bool m_dependentSliceEnabledFlag; //!< Indicates the presence of dependent slices |
---|
911 | Bool m_tilesEnabledFlag; //!< Indicates the presence of tiles |
---|
912 | Bool m_entropyCodingSyncEnabledFlag; //!< Indicates the presence of wavefronts |
---|
913 | Bool m_entropySliceEnabledFlag; //!< Indicates the presence of entropy slices |
---|
914 | #endif |
---|
915 | |
---|
916 | Bool m_loopFilterAcrossTilesEnabledFlag; |
---|
917 | Int m_uniformSpacingFlag; |
---|
918 | Int m_iNumColumnsMinus1; |
---|
919 | UInt* m_puiColumnWidth; |
---|
920 | Int m_iNumRowsMinus1; |
---|
921 | UInt* m_puiRowHeight; |
---|
922 | |
---|
923 | Int m_iNumSubstreams; |
---|
924 | |
---|
925 | Int m_signHideFlag; |
---|
926 | |
---|
927 | Bool m_cabacInitPresentFlag; |
---|
928 | UInt m_encCABACTableIdx; // Used to transmit table selection across slices |
---|
929 | |
---|
930 | #if SLICE_HEADER_EXTENSION |
---|
931 | Bool m_sliceHeaderExtensionPresentFlag; |
---|
932 | #endif |
---|
933 | #if MOVE_LOOP_FILTER_SLICES_FLAG |
---|
934 | Bool m_loopFilterAcrossSlicesEnabledFlag; |
---|
935 | #endif |
---|
936 | Bool m_deblockingFilterControlPresentFlag; |
---|
937 | Bool m_deblockingFilterOverrideEnabledFlag; |
---|
938 | Bool m_picDisableDeblockingFilterFlag; |
---|
939 | Int m_deblockingFilterBetaOffsetDiv2; //< beta offset for deblocking filter |
---|
940 | Int m_deblockingFilterTcOffsetDiv2; //< tc offset for deblocking filter |
---|
941 | Bool m_scalingListPresentFlag; |
---|
942 | TComScalingList* m_scalingList; //!< ScalingList class pointer |
---|
943 | UInt m_log2ParallelMergeLevelMinus2; |
---|
944 | public: |
---|
945 | TComPPS(); |
---|
946 | virtual ~TComPPS(); |
---|
947 | |
---|
948 | Int getPPSId () { return m_PPSId; } |
---|
949 | Void setPPSId (Int i) { m_PPSId = i; } |
---|
950 | Int getSPSId () { return m_SPSId; } |
---|
951 | Void setSPSId (Int i) { m_SPSId = i; } |
---|
952 | |
---|
953 | #if !REMOVE_FGS |
---|
954 | Int getSliceGranularity() { return m_iSliceGranularity; } |
---|
955 | Void setSliceGranularity( Int i ) { m_iSliceGranularity = i; } |
---|
956 | #endif |
---|
957 | Int getPicInitQPMinus26 () { return m_picInitQPMinus26; } |
---|
958 | Void setPicInitQPMinus26 ( Int i ) { m_picInitQPMinus26 = i; } |
---|
959 | Bool getUseDQP () { return m_useDQP; } |
---|
960 | Void setUseDQP ( Bool b ) { m_useDQP = b; } |
---|
961 | Bool getConstrainedIntraPred () { return m_bConstrainedIntraPred; } |
---|
962 | Void setConstrainedIntraPred ( Bool b ) { m_bConstrainedIntraPred = b; } |
---|
963 | #if CHROMA_QP_EXTENSION |
---|
964 | Bool getSliceChromaQpFlag () { return m_bSliceChromaQpFlag; } |
---|
965 | Void setSliceChromaQpFlag ( Bool b ) { m_bSliceChromaQpFlag = b; } |
---|
966 | #endif |
---|
967 | |
---|
968 | Void setSPS ( TComSPS* pcSPS ) { m_pcSPS = pcSPS; } |
---|
969 | TComSPS* getSPS () { return m_pcSPS; } |
---|
970 | Void setMaxCuDQPDepth ( UInt u ) { m_uiMaxCuDQPDepth = u; } |
---|
971 | UInt getMaxCuDQPDepth () { return m_uiMaxCuDQPDepth;} |
---|
972 | Void setMinCuDQPSize ( UInt u ) { m_uiMinCuDQPSize = u; } |
---|
973 | UInt getMinCuDQPSize () { return m_uiMinCuDQPSize; } |
---|
974 | |
---|
975 | Void setChromaCbQpOffset( Int i ) { m_chromaCbQpOffset = i; } |
---|
976 | Int getChromaCbQpOffset() { return m_chromaCbQpOffset; } |
---|
977 | Void setChromaCrQpOffset( Int i ) { m_chromaCrQpOffset = i; } |
---|
978 | Int getChromaCrQpOffset() { return m_chromaCrQpOffset; } |
---|
979 | |
---|
980 | Void setNumRefIdxL0DefaultActive(UInt ui) { m_numRefIdxL0DefaultActive=ui; } |
---|
981 | UInt getNumRefIdxL0DefaultActive() { return m_numRefIdxL0DefaultActive; } |
---|
982 | Void setNumRefIdxL1DefaultActive(UInt ui) { m_numRefIdxL1DefaultActive=ui; } |
---|
983 | UInt getNumRefIdxL1DefaultActive() { return m_numRefIdxL1DefaultActive; } |
---|
984 | |
---|
985 | Bool getUseWP () { return m_bUseWeightPred; } |
---|
986 | Bool getWPBiPred () { return m_useWeightedBiPred; } |
---|
987 | Void setUseWP ( Bool b ) { m_bUseWeightPred = b; } |
---|
988 | Void setWPBiPred ( Bool b ) { m_useWeightedBiPred = b; } |
---|
989 | Void setOutputFlagPresentFlag( Bool b ) { m_OutputFlagPresentFlag = b; } |
---|
990 | Bool getOutputFlagPresentFlag() { return m_OutputFlagPresentFlag; } |
---|
991 | #if !TILES_WPP_ENTROPYSLICES_FLAGS |
---|
992 | #if DEPENDENT_SLICES |
---|
993 | Void setDependentSliceEnabledFlag( Bool b ) { m_bDependentSliceEnabledFlag = b; } |
---|
994 | Bool getDependentSliceEnabledFlag() { return m_bDependentSliceEnabledFlag; } |
---|
995 | Void setCabacIndependentFlag( Bool b ) { m_bCabacIndependentFlag = b; } |
---|
996 | Bool getCabacIndependentFlag() { return m_bCabacIndependentFlag; } |
---|
997 | #endif |
---|
998 | #endif |
---|
999 | Void setTransquantBypassEnableFlag( Bool b ) { m_TransquantBypassEnableFlag = b; } |
---|
1000 | Bool getTransquantBypassEnableFlag() { return m_TransquantBypassEnableFlag; } |
---|
1001 | |
---|
1002 | #if PPS_TS_FLAG |
---|
1003 | Bool getUseTransformSkip () { return m_useTransformSkip; } |
---|
1004 | Void setUseTransformSkip ( Bool b ) { m_useTransformSkip = b; } |
---|
1005 | #endif |
---|
1006 | |
---|
1007 | Void setLoopFilterAcrossTilesEnabledFlag (Bool b) { m_loopFilterAcrossTilesEnabledFlag = b; } |
---|
1008 | Bool getLoopFilterAcrossTilesEnabledFlag () { return m_loopFilterAcrossTilesEnabledFlag; } |
---|
1009 | #if TILES_WPP_ENTROPYSLICES_FLAGS |
---|
1010 | Bool getDependentSliceEnabledFlag() const { return m_dependentSliceEnabledFlag; } |
---|
1011 | Void setDependentSliceEnabledFlag(Bool val) { m_dependentSliceEnabledFlag = val; } |
---|
1012 | Bool getTilesEnabledFlag() const { return m_tilesEnabledFlag; } |
---|
1013 | Void setTilesEnabledFlag(Bool val) { m_tilesEnabledFlag = val; } |
---|
1014 | Bool getEntropyCodingSyncEnabledFlag() const { return m_entropyCodingSyncEnabledFlag; } |
---|
1015 | Void setEntropyCodingSyncEnabledFlag(Bool val) { m_entropyCodingSyncEnabledFlag = val; } |
---|
1016 | Bool getEntropySliceEnabledFlag() const { return m_entropySliceEnabledFlag; } |
---|
1017 | Void setEntropySliceEnabledFlag(Bool val) { m_entropySliceEnabledFlag = val; } |
---|
1018 | #else |
---|
1019 | UInt getTilesOrEntropyCodingSyncIdc () { return m_tilesOrEntropyCodingSyncIdc; } |
---|
1020 | Void setTilesOrEntropyCodingSyncIdc ( UInt val ) { m_tilesOrEntropyCodingSyncIdc = val; } |
---|
1021 | #endif |
---|
1022 | Void setUniformSpacingFlag ( Bool b ) { m_uniformSpacingFlag = b; } |
---|
1023 | Bool getUniformSpacingFlag () { return m_uniformSpacingFlag; } |
---|
1024 | Void setNumColumnsMinus1 ( Int i ) { m_iNumColumnsMinus1 = i; } |
---|
1025 | Int getNumColumnsMinus1 () { return m_iNumColumnsMinus1; } |
---|
1026 | Void setColumnWidth ( UInt* columnWidth ) |
---|
1027 | { |
---|
1028 | if( m_uniformSpacingFlag == 0 && m_iNumColumnsMinus1 > 0 ) |
---|
1029 | { |
---|
1030 | m_puiColumnWidth = new UInt[ m_iNumColumnsMinus1 ]; |
---|
1031 | |
---|
1032 | for(Int i=0; i<m_iNumColumnsMinus1; i++) |
---|
1033 | { |
---|
1034 | m_puiColumnWidth[i] = columnWidth[i]; |
---|
1035 | } |
---|
1036 | } |
---|
1037 | } |
---|
1038 | UInt getColumnWidth (UInt columnIdx) { return *( m_puiColumnWidth + columnIdx ); } |
---|
1039 | Void setNumRowsMinus1( Int i ) { m_iNumRowsMinus1 = i; } |
---|
1040 | Int getNumRowsMinus1() { return m_iNumRowsMinus1; } |
---|
1041 | Void setRowHeight ( UInt* rowHeight ) |
---|
1042 | { |
---|
1043 | if( m_uniformSpacingFlag == 0 && m_iNumRowsMinus1 > 0 ) |
---|
1044 | { |
---|
1045 | m_puiRowHeight = new UInt[ m_iNumRowsMinus1 ]; |
---|
1046 | |
---|
1047 | for(Int i=0; i<m_iNumRowsMinus1; i++) |
---|
1048 | { |
---|
1049 | m_puiRowHeight[i] = rowHeight[i]; |
---|
1050 | } |
---|
1051 | } |
---|
1052 | } |
---|
1053 | UInt getRowHeight (UInt rowIdx) { return *( m_puiRowHeight + rowIdx ); } |
---|
1054 | Void setNumSubstreams(Int iNumSubstreams) { m_iNumSubstreams = iNumSubstreams; } |
---|
1055 | Int getNumSubstreams() { return m_iNumSubstreams; } |
---|
1056 | |
---|
1057 | Void setSignHideFlag( Int signHideFlag ) { m_signHideFlag = signHideFlag; } |
---|
1058 | Int getSignHideFlag() { return m_signHideFlag; } |
---|
1059 | |
---|
1060 | Void setCabacInitPresentFlag( Bool flag ) { m_cabacInitPresentFlag = flag; } |
---|
1061 | Void setEncCABACTableIdx( Int idx ) { m_encCABACTableIdx = idx; } |
---|
1062 | Bool getCabacInitPresentFlag() { return m_cabacInitPresentFlag; } |
---|
1063 | UInt getEncCABACTableIdx() { return m_encCABACTableIdx; } |
---|
1064 | Void setDeblockingFilterControlPresentFlag( Bool val ) { m_deblockingFilterControlPresentFlag = val; } |
---|
1065 | Bool getDeblockingFilterControlPresentFlag() { return m_deblockingFilterControlPresentFlag; } |
---|
1066 | Void setDeblockingFilterOverrideEnabledFlag( Bool val ) { m_deblockingFilterOverrideEnabledFlag = val; } |
---|
1067 | Bool getDeblockingFilterOverrideEnabledFlag() { return m_deblockingFilterOverrideEnabledFlag; } |
---|
1068 | Void setPicDisableDeblockingFilterFlag(Bool val) { m_picDisableDeblockingFilterFlag = val; } //!< set offset for deblocking filter disabled |
---|
1069 | Bool getPicDisableDeblockingFilterFlag() { return m_picDisableDeblockingFilterFlag; } //!< get offset for deblocking filter disabled |
---|
1070 | Void setDeblockingFilterBetaOffsetDiv2(Int val) { m_deblockingFilterBetaOffsetDiv2 = val; } //!< set beta offset for deblocking filter |
---|
1071 | Int getDeblockingFilterBetaOffsetDiv2() { return m_deblockingFilterBetaOffsetDiv2; } //!< get beta offset for deblocking filter |
---|
1072 | Void setDeblockingFilterTcOffsetDiv2(Int val) { m_deblockingFilterTcOffsetDiv2 = val; } //!< set tc offset for deblocking filter |
---|
1073 | Int getDeblockingFilterTcOffsetDiv2() { return m_deblockingFilterTcOffsetDiv2; } //!< get tc offset for deblocking filter |
---|
1074 | Bool getScalingListPresentFlag() { return m_scalingListPresentFlag; } |
---|
1075 | Void setScalingListPresentFlag( Bool b ) { m_scalingListPresentFlag = b; } |
---|
1076 | Void setScalingList ( TComScalingList *scalingList); |
---|
1077 | TComScalingList* getScalingList () { return m_scalingList; } //!< get ScalingList class pointer in PPS |
---|
1078 | UInt getLog2ParallelMergeLevelMinus2 () { return m_log2ParallelMergeLevelMinus2; } |
---|
1079 | Void setLog2ParallelMergeLevelMinus2 (UInt mrgLevel) { m_log2ParallelMergeLevelMinus2 = mrgLevel; } |
---|
1080 | #if MOVE_LOOP_FILTER_SLICES_FLAG |
---|
1081 | Void setLoopFilterAcrossSlicesEnabledFlag ( Bool bValue ) { m_loopFilterAcrossSlicesEnabledFlag = bValue; } |
---|
1082 | Bool getLoopFilterAcrossSlicesEnabledFlag () { return m_loopFilterAcrossSlicesEnabledFlag; } |
---|
1083 | #endif |
---|
1084 | #if SLICE_HEADER_EXTENSION |
---|
1085 | Bool getSliceHeaderExtensionPresentFlag () { return m_sliceHeaderExtensionPresentFlag; } |
---|
1086 | Void setSliceHeaderExtensionPresentFlag (Bool val) { m_sliceHeaderExtensionPresentFlag = val; } |
---|
1087 | #endif |
---|
1088 | }; |
---|
1089 | |
---|
1090 | #if !REMOVE_APS |
---|
1091 | /// APS class |
---|
1092 | class TComAPS |
---|
1093 | { |
---|
1094 | public: |
---|
1095 | TComAPS(); |
---|
1096 | virtual ~TComAPS(); |
---|
1097 | |
---|
1098 | Void setAPSID (Int iID) {m_apsID = iID; } //!< set APS ID |
---|
1099 | Int getAPSID () {return m_apsID; } //!< get APS ID |
---|
1100 | #if !REMOVE_ALF |
---|
1101 | ALFParam** getAlfParam () { return m_alfParam;} |
---|
1102 | Bool getAlfEnabled(Int compIdx) { return (m_alfParam[compIdx] == NULL)?(false):(m_alfParam[compIdx]->alf_flag ==1);} |
---|
1103 | Void setAlfEnabled(Bool bVal, Int compIdx) { m_alfParam[compIdx]->alf_flag= (bVal?1:0); } //!< set ALF enabled/disabled in APS |
---|
1104 | #endif |
---|
1105 | SAOParam* getSaoParam () {return m_pSaoParam; } //!< get SAO parameters in APS |
---|
1106 | |
---|
1107 | Void createSaoParam(); //!< create SAO parameter object |
---|
1108 | Void destroySaoParam(); //!< destroy SAO parameter object |
---|
1109 | |
---|
1110 | #if !REMOVE_ALF |
---|
1111 | Void createAlfParam(); //!< create ALF parameter object |
---|
1112 | Void destroyAlfParam(); //!< destroy ALF parameter object |
---|
1113 | #endif |
---|
1114 | private: |
---|
1115 | Int m_apsID; //!< APS ID |
---|
1116 | SAOParam* m_pSaoParam; //!< SAO parameter object pointer |
---|
1117 | #if !REMOVE_ALF |
---|
1118 | ALFParam* m_alfParam[3]; |
---|
1119 | #endif |
---|
1120 | public: |
---|
1121 | TComAPS& operator= (const TComAPS& src); //!< "=" operator for APS object |
---|
1122 | }; |
---|
1123 | #endif |
---|
1124 | |
---|
1125 | typedef struct { |
---|
1126 | // Explicit weighted prediction parameters parsed in slice header, |
---|
1127 | // or Implicit weighted prediction parameters (8 bits depth values). |
---|
1128 | Bool bPresentFlag; |
---|
1129 | UInt uiLog2WeightDenom; |
---|
1130 | Int iWeight; |
---|
1131 | Int iOffset; |
---|
1132 | |
---|
1133 | // Weighted prediction scaling values built from above parameters (bitdepth scaled): |
---|
1134 | Int w, o, offset, shift, round; |
---|
1135 | } wpScalingParam; |
---|
1136 | |
---|
1137 | typedef struct { |
---|
1138 | Int64 iAC; |
---|
1139 | Int64 iDC; |
---|
1140 | } wpACDCParam; |
---|
1141 | |
---|
1142 | /// slice header class |
---|
1143 | class TComSlice |
---|
1144 | { |
---|
1145 | |
---|
1146 | private: |
---|
1147 | // Bitstream writing |
---|
1148 | #if !REMOVE_APS |
---|
1149 | Int m_iAPSId; //!< APS ID in slice header |
---|
1150 | #endif |
---|
1151 | #if !REMOVE_ALF |
---|
1152 | Bool m_alfEnabledFlag[3]; |
---|
1153 | #endif |
---|
1154 | bool m_saoEnabledFlag; |
---|
1155 | #if SAO_TYPE_SHARING |
---|
1156 | bool m_saoEnabledFlagChroma; ///< SAO Cb&Cr enabled flag |
---|
1157 | #else |
---|
1158 | bool m_saoEnabledFlagCb; ///< SAO Cb enabled flag |
---|
1159 | bool m_saoEnabledFlagCr; ///< SAO Cr enabled flag |
---|
1160 | #endif |
---|
1161 | Int m_iPPSId; ///< picture parameter set ID |
---|
1162 | Bool m_PicOutputFlag; ///< pic_output_flag |
---|
1163 | Int m_iPOC; |
---|
1164 | Int m_iLastIDR; |
---|
1165 | #if PREVREFPIC_DEFN |
---|
1166 | static Int m_prevPOC[MAX_TLAYER]; |
---|
1167 | #else |
---|
1168 | static Int m_prevPOC; |
---|
1169 | #endif |
---|
1170 | TComReferencePictureSet *m_pcRPS; |
---|
1171 | TComReferencePictureSet m_LocalRPS; |
---|
1172 | Int m_iBDidx; |
---|
1173 | Int m_iCombinationBDidx; |
---|
1174 | Bool m_bCombineWithReferenceFlag; |
---|
1175 | TComRefPicListModification m_RefPicListModification; |
---|
1176 | NalUnitType m_eNalUnitType; ///< Nal unit type for the slice |
---|
1177 | SliceType m_eSliceType; |
---|
1178 | Int m_iSliceQp; |
---|
1179 | #if SLICEHEADER_SYNTAX_FIX |
---|
1180 | Bool m_dependentSliceFlag; |
---|
1181 | #endif |
---|
1182 | #if ADAPTIVE_QP_SELECTION |
---|
1183 | Int m_iSliceQpBase; |
---|
1184 | #endif |
---|
1185 | Bool m_deblockingFilterDisable; |
---|
1186 | Bool m_deblockingFilterOverrideFlag; //< offsets for deblocking filter inherit from PPS |
---|
1187 | Int m_deblockingFilterBetaOffsetDiv2; //< beta offset for deblocking filter |
---|
1188 | Int m_deblockingFilterTcOffsetDiv2; //< tc offset for deblocking filter |
---|
1189 | |
---|
1190 | Int m_aiNumRefIdx [3]; // for multiple reference of current slice |
---|
1191 | |
---|
1192 | Int m_iRefIdxOfLC[2][MAX_NUM_REF_LC]; |
---|
1193 | Int m_eListIdFromIdxOfLC[MAX_NUM_REF_LC]; |
---|
1194 | Int m_iRefIdxFromIdxOfLC[MAX_NUM_REF_LC]; |
---|
1195 | Int m_iRefIdxOfL1FromRefIdxOfL0[MAX_NUM_REF_LC]; |
---|
1196 | Int m_iRefIdxOfL0FromRefIdxOfL1[MAX_NUM_REF_LC]; |
---|
1197 | Bool m_bRefPicListModificationFlagLC; |
---|
1198 | Bool m_bRefPicListCombinationFlag; |
---|
1199 | |
---|
1200 | Bool m_bCheckLDC; |
---|
1201 | |
---|
1202 | // Data |
---|
1203 | Int m_iSliceQpDelta; |
---|
1204 | #if CHROMA_QP_EXTENSION |
---|
1205 | Int m_iSliceQpDeltaCb; |
---|
1206 | Int m_iSliceQpDeltaCr; |
---|
1207 | #endif |
---|
1208 | TComPic* m_apcRefPicList [2][MAX_NUM_REF+1]; |
---|
1209 | Int m_aiRefPOCList [2][MAX_NUM_REF+1]; |
---|
1210 | Int m_iDepth; |
---|
1211 | |
---|
1212 | // referenced slice? |
---|
1213 | Bool m_bRefenced; |
---|
1214 | |
---|
1215 | // access channel |
---|
1216 | TComVPS* m_pcVPS; |
---|
1217 | TComSPS* m_pcSPS; |
---|
1218 | TComPPS* m_pcPPS; |
---|
1219 | TComPic* m_pcPic; |
---|
1220 | #if ADAPTIVE_QP_SELECTION |
---|
1221 | TComTrQuant* m_pcTrQuant; |
---|
1222 | #endif |
---|
1223 | #if !REMOVE_APS |
---|
1224 | TComAPS* m_pcAPS; //!< pointer to APS parameter object |
---|
1225 | #endif |
---|
1226 | UInt m_colFromL0Flag; // collocated picture from List0 flag |
---|
1227 | |
---|
1228 | UInt m_colRefIdx; |
---|
1229 | UInt m_maxNumMergeCand; |
---|
1230 | |
---|
1231 | |
---|
1232 | #if ALF_CHROMA_LAMBDA || SAO_CHROMA_LAMBDA |
---|
1233 | Double m_dLambdaLuma; |
---|
1234 | Double m_dLambdaChroma; |
---|
1235 | #else |
---|
1236 | Double m_dLambda; |
---|
1237 | #endif |
---|
1238 | |
---|
1239 | Bool m_abEqualRef [2][MAX_NUM_REF][MAX_NUM_REF]; |
---|
1240 | |
---|
1241 | Bool m_bNoBackPredFlag; |
---|
1242 | UInt m_uiTLayer; |
---|
1243 | #if SVC_EXTENSION |
---|
1244 | UInt m_layerId; |
---|
1245 | TComPic* m_pcBaseColPic; |
---|
1246 | TComPicYuv* m_pcFullPelBaseRec; |
---|
1247 | #endif |
---|
1248 | Bool m_bTLayerSwitchingFlag; |
---|
1249 | |
---|
1250 | UInt m_uiSliceMode; |
---|
1251 | UInt m_uiSliceArgument; |
---|
1252 | UInt m_uiSliceCurStartCUAddr; |
---|
1253 | UInt m_uiSliceCurEndCUAddr; |
---|
1254 | UInt m_uiSliceIdx; |
---|
1255 | UInt m_uiDependentSliceMode; |
---|
1256 | UInt m_uiDependentSliceArgument; |
---|
1257 | UInt m_uiDependentSliceCurStartCUAddr; |
---|
1258 | UInt m_uiDependentSliceCurEndCUAddr; |
---|
1259 | Bool m_bNextSlice; |
---|
1260 | Bool m_bNextDependentSlice; |
---|
1261 | UInt m_uiSliceBits; |
---|
1262 | UInt m_uiDependentSliceCounter; |
---|
1263 | Bool m_bFinalized; |
---|
1264 | |
---|
1265 | wpScalingParam m_weightPredTable[2][MAX_NUM_REF][3]; // [REF_PIC_LIST_0 or REF_PIC_LIST_1][refIdx][0:Y, 1:U, 2:V] |
---|
1266 | wpACDCParam m_weightACDCParam[3]; // [0:Y, 1:U, 2:V] |
---|
1267 | wpScalingParam m_weightPredTableLC[2*MAX_NUM_REF][3]; // [refIdxLC][0:Y, 1:U, 2:V] |
---|
1268 | |
---|
1269 | std::vector<UInt> m_tileByteLocation; |
---|
1270 | UInt m_uiTileOffstForMultES; |
---|
1271 | |
---|
1272 | UInt* m_puiSubstreamSizes; |
---|
1273 | TComScalingList* m_scalingList; //!< pointer of quantization matrix |
---|
1274 | Bool m_cabacInitFlag; |
---|
1275 | |
---|
1276 | Bool m_bLMvdL1Zero; |
---|
1277 | Int m_numEntryPointOffsets; |
---|
1278 | #if TEMPORAL_LAYER_NON_REFERENCE |
---|
1279 | Bool m_temporalLayerNonReferenceFlag; |
---|
1280 | #endif |
---|
1281 | #if !REMOVE_NAL_REF_FLAG |
---|
1282 | Bool m_nalRefFlag; |
---|
1283 | #endif |
---|
1284 | Bool m_LFCrossSliceBoundaryFlag; |
---|
1285 | |
---|
1286 | Bool m_enableTMVPFlag; |
---|
1287 | |
---|
1288 | public: |
---|
1289 | TComSlice(); |
---|
1290 | virtual ~TComSlice(); |
---|
1291 | Void initSlice (); |
---|
1292 | |
---|
1293 | Void setVPS ( TComVPS* pcVPS ) { m_pcVPS = pcVPS; } |
---|
1294 | TComVPS* getVPS () { return m_pcVPS; } |
---|
1295 | Void setSPS ( TComSPS* pcSPS ) { m_pcSPS = pcSPS; } |
---|
1296 | TComSPS* getSPS () { return m_pcSPS; } |
---|
1297 | |
---|
1298 | Void setPPS ( TComPPS* pcPPS ) { assert(pcPPS!=NULL); m_pcPPS = pcPPS; m_iPPSId = pcPPS->getPPSId(); } |
---|
1299 | TComPPS* getPPS () { return m_pcPPS; } |
---|
1300 | |
---|
1301 | #if ADAPTIVE_QP_SELECTION |
---|
1302 | Void setTrQuant ( TComTrQuant* pcTrQuant ) { m_pcTrQuant = pcTrQuant; } |
---|
1303 | TComTrQuant* getTrQuant () { return m_pcTrQuant; } |
---|
1304 | #endif |
---|
1305 | |
---|
1306 | Void setPPSId ( Int PPSId ) { m_iPPSId = PPSId; } |
---|
1307 | Int getPPSId () { return m_iPPSId; } |
---|
1308 | #if !REMOVE_APS |
---|
1309 | Void setAPS ( TComAPS* pcAPS ) { m_pcAPS = pcAPS; } //!< set APS pointer |
---|
1310 | TComAPS* getAPS () { return m_pcAPS; } //!< get APS pointer |
---|
1311 | Void setAPSId ( Int Id) { m_iAPSId =Id; } //!< set APS ID |
---|
1312 | Int getAPSId () { return m_iAPSId; } //!< get APS ID |
---|
1313 | #endif |
---|
1314 | Void setPicOutputFlag( Bool b ) { m_PicOutputFlag = b; } |
---|
1315 | Bool getPicOutputFlag() { return m_PicOutputFlag; } |
---|
1316 | #if !REMOVE_ALF |
---|
1317 | Void setAlfEnabledFlag(Bool b, Int compIdx) { m_alfEnabledFlag[compIdx] = b; } |
---|
1318 | Bool getAlfEnabledFlag(Int compIdx) { return m_alfEnabledFlag[compIdx]; } |
---|
1319 | #endif |
---|
1320 | Void setSaoEnabledFlag(Bool s) {m_saoEnabledFlag =s; } |
---|
1321 | Bool getSaoEnabledFlag() { return m_saoEnabledFlag; } |
---|
1322 | #if SAO_TYPE_SHARING |
---|
1323 | Void setSaoEnabledFlagChroma(Bool s) {m_saoEnabledFlagChroma =s; } //!< set SAO Cb&Cr enabled flag |
---|
1324 | Bool getSaoEnabledFlagChroma() { return m_saoEnabledFlagChroma; } //!< get SAO Cb&Cr enabled flag |
---|
1325 | #else |
---|
1326 | Void setSaoEnabledFlagCb(Bool s) {m_saoEnabledFlagCb =s; } //!< set SAO Cb enabled flag |
---|
1327 | Bool getSaoEnabledFlagCb() { return m_saoEnabledFlagCb; } //!< get SAO Cb enabled flag |
---|
1328 | Void setSaoEnabledFlagCr(Bool s) {m_saoEnabledFlagCr =s; } //!< set SAO Cr enabled flag |
---|
1329 | Bool getSaoEnabledFlagCr() { return m_saoEnabledFlagCr; } //!< get SAO Cr enabled flag |
---|
1330 | #endif |
---|
1331 | Void setRPS ( TComReferencePictureSet *pcRPS ) { m_pcRPS = pcRPS; } |
---|
1332 | TComReferencePictureSet* getRPS () { return m_pcRPS; } |
---|
1333 | TComReferencePictureSet* getLocalRPS () { return &m_LocalRPS; } |
---|
1334 | |
---|
1335 | Void setRPSidx ( Int iBDidx ) { m_iBDidx = iBDidx; } |
---|
1336 | Int getRPSidx () { return m_iBDidx; } |
---|
1337 | Void setCombinationBDidx ( Int iCombinationBDidx ) { m_iCombinationBDidx = iCombinationBDidx; } |
---|
1338 | Int getCombinationBDidx () { return m_iCombinationBDidx; } |
---|
1339 | Void setCombineWithReferenceFlag ( Bool bCombineWithReferenceFlag ) { m_bCombineWithReferenceFlag = bCombineWithReferenceFlag; } |
---|
1340 | Bool getCombineWithReferenceFlag () { return m_bCombineWithReferenceFlag; } |
---|
1341 | #if PREVREFPIC_DEFN |
---|
1342 | Int getPrevPOC () { return m_prevPOC[getTLayer()]; } |
---|
1343 | #else |
---|
1344 | Int getPrevPOC () { return m_prevPOC; } |
---|
1345 | #endif |
---|
1346 | TComRefPicListModification* getRefPicListModification() { return &m_RefPicListModification; } |
---|
1347 | Void setLastIDR(Int iIDRPOC) { m_iLastIDR = iIDRPOC; } |
---|
1348 | Int getLastIDR() { return m_iLastIDR; } |
---|
1349 | SliceType getSliceType () { return m_eSliceType; } |
---|
1350 | Int getPOC () { return m_iPOC; } |
---|
1351 | Int getSliceQp () { return m_iSliceQp; } |
---|
1352 | #if SLICEHEADER_SYNTAX_FIX |
---|
1353 | Bool getDependentSliceFlag() const { return m_dependentSliceFlag; } |
---|
1354 | void setDependentSliceFlag(Bool val) { m_dependentSliceFlag = val; } |
---|
1355 | #endif |
---|
1356 | #if ADAPTIVE_QP_SELECTION |
---|
1357 | Int getSliceQpBase () { return m_iSliceQpBase; } |
---|
1358 | #endif |
---|
1359 | Int getSliceQpDelta () { return m_iSliceQpDelta; } |
---|
1360 | #if CHROMA_QP_EXTENSION |
---|
1361 | Int getSliceQpDeltaCb () { return m_iSliceQpDeltaCb; } |
---|
1362 | Int getSliceQpDeltaCr () { return m_iSliceQpDeltaCr; } |
---|
1363 | #endif |
---|
1364 | Bool getDeblockingFilterDisable() { return m_deblockingFilterDisable; } |
---|
1365 | Bool getDeblockingFilterOverrideFlag() { return m_deblockingFilterOverrideFlag; } |
---|
1366 | Int getDeblockingFilterBetaOffsetDiv2() { return m_deblockingFilterBetaOffsetDiv2; } |
---|
1367 | Int getDeblockingFilterTcOffsetDiv2() { return m_deblockingFilterTcOffsetDiv2; } |
---|
1368 | |
---|
1369 | Int getNumRefIdx ( RefPicList e ) { return m_aiNumRefIdx[e]; } |
---|
1370 | TComPic* getPic () { return m_pcPic; } |
---|
1371 | TComPic* getRefPic ( RefPicList e, Int iRefIdx) { return m_apcRefPicList[e][iRefIdx]; } |
---|
1372 | Int getRefPOC ( RefPicList e, Int iRefIdx) { return m_aiRefPOCList[e][iRefIdx]; } |
---|
1373 | Int getDepth () { return m_iDepth; } |
---|
1374 | UInt getColFromL0Flag () { return m_colFromL0Flag; } |
---|
1375 | UInt getColRefIdx () { return m_colRefIdx; } |
---|
1376 | Void checkColRefIdx (UInt curSliceIdx, TComPic* pic); |
---|
1377 | Bool getCheckLDC () { return m_bCheckLDC; } |
---|
1378 | Bool getMvdL1ZeroFlag () { return m_bLMvdL1Zero; } |
---|
1379 | Int getNumRpsCurrTempList(); |
---|
1380 | Int getRefIdxOfLC (RefPicList e, Int iRefIdx) { return m_iRefIdxOfLC[e][iRefIdx]; } |
---|
1381 | Int getListIdFromIdxOfLC(Int iRefIdx) { return m_eListIdFromIdxOfLC[iRefIdx]; } |
---|
1382 | Int getRefIdxFromIdxOfLC(Int iRefIdx) { return m_iRefIdxFromIdxOfLC[iRefIdx]; } |
---|
1383 | Int getRefIdxOfL0FromRefIdxOfL1(Int iRefIdx) { return m_iRefIdxOfL0FromRefIdxOfL1[iRefIdx];} |
---|
1384 | Int getRefIdxOfL1FromRefIdxOfL0(Int iRefIdx) { return m_iRefIdxOfL1FromRefIdxOfL0[iRefIdx];} |
---|
1385 | Bool getRefPicListModificationFlagLC() {return m_bRefPicListModificationFlagLC;} |
---|
1386 | Void setRefPicListModificationFlagLC(Bool bflag) {m_bRefPicListModificationFlagLC=bflag;} |
---|
1387 | Bool getRefPicListCombinationFlag() {return m_bRefPicListCombinationFlag;} |
---|
1388 | Void setRefPicListCombinationFlag(Bool bflag) {m_bRefPicListCombinationFlag=bflag;} |
---|
1389 | Void setReferenced(Bool b) { m_bRefenced = b; } |
---|
1390 | Bool isReferenced() { return m_bRefenced; } |
---|
1391 | #if PREVREFPIC_DEFN |
---|
1392 | Void setPOC ( Int i ) |
---|
1393 | { |
---|
1394 | m_iPOC = i; |
---|
1395 | if (isReferenced()) |
---|
1396 | { |
---|
1397 | for (Int j = getTLayer(); j < (getSPS()->getMaxTLayers()); j++) |
---|
1398 | { |
---|
1399 | m_prevPOC[j] = i; |
---|
1400 | } |
---|
1401 | } |
---|
1402 | } |
---|
1403 | #else |
---|
1404 | Void setPOC ( Int i ) { m_iPOC = i; if(getTLayer()==0) m_prevPOC=i; } |
---|
1405 | #endif |
---|
1406 | Void setNalUnitType ( NalUnitType e ) { m_eNalUnitType = e; } |
---|
1407 | NalUnitType getNalUnitType () { return m_eNalUnitType; } |
---|
1408 | Bool getRapPicFlag (); |
---|
1409 | #if SUPPORT_FOR_RAP_N_LP |
---|
1410 | Bool getIdrPicFlag () { return getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP; } |
---|
1411 | #endif |
---|
1412 | Void checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, Bool& prevRAPisBLA, TComList<TComPic*>& rcListPic); |
---|
1413 | Void decodingRefreshMarking(Int& pocCRA, Bool& bRefreshPending, TComList<TComPic*>& rcListPic); |
---|
1414 | Void setSliceType ( SliceType e ) { m_eSliceType = e; } |
---|
1415 | Void setSliceQp ( Int i ) { m_iSliceQp = i; } |
---|
1416 | #if ADAPTIVE_QP_SELECTION |
---|
1417 | Void setSliceQpBase ( Int i ) { m_iSliceQpBase = i; } |
---|
1418 | #endif |
---|
1419 | Void setSliceQpDelta ( Int i ) { m_iSliceQpDelta = i; } |
---|
1420 | #if CHROMA_QP_EXTENSION |
---|
1421 | Void setSliceQpDeltaCb ( Int i ) { m_iSliceQpDeltaCb = i; } |
---|
1422 | Void setSliceQpDeltaCr ( Int i ) { m_iSliceQpDeltaCr = i; } |
---|
1423 | #endif |
---|
1424 | Void setDeblockingFilterDisable( Bool b ) { m_deblockingFilterDisable= b; } |
---|
1425 | Void setDeblockingFilterOverrideFlag( Bool b ) { m_deblockingFilterOverrideFlag = b; } |
---|
1426 | Void setDeblockingFilterBetaOffsetDiv2( Int i ) { m_deblockingFilterBetaOffsetDiv2 = i; } |
---|
1427 | Void setDeblockingFilterTcOffsetDiv2( Int i ) { m_deblockingFilterTcOffsetDiv2 = i; } |
---|
1428 | |
---|
1429 | Void setRefPic ( TComPic* p, RefPicList e, Int iRefIdx ) { m_apcRefPicList[e][iRefIdx] = p; } |
---|
1430 | Void setRefPOC ( Int i, RefPicList e, Int iRefIdx ) { m_aiRefPOCList[e][iRefIdx] = i; } |
---|
1431 | Void setNumRefIdx ( RefPicList e, Int i ) { m_aiNumRefIdx[e] = i; } |
---|
1432 | Void setPic ( TComPic* p ) { m_pcPic = p; } |
---|
1433 | Void setDepth ( Int iDepth ) { m_iDepth = iDepth; } |
---|
1434 | |
---|
1435 | #if SVC_EXTENSION |
---|
1436 | Void setBaseColPic ( TComPic* p) { m_pcBaseColPic = p; } |
---|
1437 | Void setBaseColPic ( TComList<TComPic*>& rcListPic , UInt layerID ); |
---|
1438 | TComPic* getBaseColPic () { return m_pcBaseColPic; } |
---|
1439 | |
---|
1440 | Void setLayerId (UInt layerId) { m_layerId = layerId; } |
---|
1441 | UInt getLayerId () { return m_layerId; } |
---|
1442 | |
---|
1443 | Void setFullPelBaseRec ( TComPicYuv* p) { m_pcFullPelBaseRec = p; } |
---|
1444 | TComPicYuv* getFullPelBaseRec () { return m_pcFullPelBaseRec; } |
---|
1445 | #endif |
---|
1446 | Void setRefPicList ( TComList<TComPic*>& rcListPic ); |
---|
1447 | Void setRefPOCList (); |
---|
1448 | Void setColFromL0Flag ( UInt colFromL0 ) { m_colFromL0Flag = colFromL0; } |
---|
1449 | Void setColRefIdx ( UInt refIdx) { m_colRefIdx = refIdx; } |
---|
1450 | Void setCheckLDC ( Bool b ) { m_bCheckLDC = b; } |
---|
1451 | Void setMvdL1ZeroFlag ( Bool b) { m_bLMvdL1Zero = b; } |
---|
1452 | |
---|
1453 | Bool isIntra () { return m_eSliceType == I_SLICE; } |
---|
1454 | Bool isInterB () { return m_eSliceType == B_SLICE; } |
---|
1455 | Bool isInterP () { return m_eSliceType == P_SLICE; } |
---|
1456 | |
---|
1457 | #if ALF_CHROMA_LAMBDA || SAO_CHROMA_LAMBDA |
---|
1458 | Void setLambda( Double d, Double e ) { m_dLambdaLuma = d; m_dLambdaChroma = e;} |
---|
1459 | Double getLambdaLuma() { return m_dLambdaLuma; } |
---|
1460 | Double getLambdaChroma() { return m_dLambdaChroma; } |
---|
1461 | #else |
---|
1462 | Void setLambda( Double d ) { m_dLambda = d; } |
---|
1463 | Double getLambda() { return m_dLambda; } |
---|
1464 | #endif |
---|
1465 | |
---|
1466 | Void initEqualRef(); |
---|
1467 | Bool isEqualRef ( RefPicList e, Int iRefIdx1, Int iRefIdx2 ) |
---|
1468 | { |
---|
1469 | if (iRefIdx1 < 0 || iRefIdx2 < 0) return false; |
---|
1470 | return m_abEqualRef[e][iRefIdx1][iRefIdx2]; |
---|
1471 | } |
---|
1472 | |
---|
1473 | Void setEqualRef( RefPicList e, Int iRefIdx1, Int iRefIdx2, Bool b) |
---|
1474 | { |
---|
1475 | m_abEqualRef[e][iRefIdx1][iRefIdx2] = m_abEqualRef[e][iRefIdx2][iRefIdx1] = b; |
---|
1476 | } |
---|
1477 | |
---|
1478 | static Void sortPicList ( TComList<TComPic*>& rcListPic ); |
---|
1479 | |
---|
1480 | Bool getNoBackPredFlag() { return m_bNoBackPredFlag; } |
---|
1481 | Void setNoBackPredFlag( Bool b ) { m_bNoBackPredFlag = b; } |
---|
1482 | Void generateCombinedList (); |
---|
1483 | |
---|
1484 | UInt getTLayer () { return m_uiTLayer; } |
---|
1485 | Void setTLayer ( UInt uiTLayer ) { m_uiTLayer = uiTLayer; } |
---|
1486 | |
---|
1487 | Void setTLayerInfo( UInt uiTLayer ); |
---|
1488 | Void decodingMarking( TComList<TComPic*>& rcListPic, Int iGOPSIze, Int& iMaxRefPicNum ); |
---|
1489 | Void applyReferencePictureSet( TComList<TComPic*>& rcListPic, TComReferencePictureSet *RPSList); |
---|
1490 | Bool isTemporalLayerSwitchingPoint( TComList<TComPic*>& rcListPic, TComReferencePictureSet *RPSList); |
---|
1491 | #if STSA |
---|
1492 | Bool isStepwiseTemporalLayerSwitchingPointCandidate( TComList<TComPic*>& rcListPic, TComReferencePictureSet *RPSList); |
---|
1493 | #endif |
---|
1494 | Int checkThatAllRefPicsAreAvailable( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool printErrors, Int pocRandomAccess = 0); |
---|
1495 | Void createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet); |
---|
1496 | |
---|
1497 | Void setMaxNumMergeCand (UInt val ) { m_maxNumMergeCand = val; } |
---|
1498 | UInt getMaxNumMergeCand () { return m_maxNumMergeCand; } |
---|
1499 | |
---|
1500 | Void setSliceMode ( UInt uiMode ) { m_uiSliceMode = uiMode; } |
---|
1501 | UInt getSliceMode () { return m_uiSliceMode; } |
---|
1502 | Void setSliceArgument ( UInt uiArgument ) { m_uiSliceArgument = uiArgument; } |
---|
1503 | UInt getSliceArgument () { return m_uiSliceArgument; } |
---|
1504 | Void setSliceCurStartCUAddr ( UInt uiAddr ) { m_uiSliceCurStartCUAddr = uiAddr; } |
---|
1505 | UInt getSliceCurStartCUAddr () { return m_uiSliceCurStartCUAddr; } |
---|
1506 | Void setSliceCurEndCUAddr ( UInt uiAddr ) { m_uiSliceCurEndCUAddr = uiAddr; } |
---|
1507 | UInt getSliceCurEndCUAddr () { return m_uiSliceCurEndCUAddr; } |
---|
1508 | Void setSliceIdx ( UInt i) { m_uiSliceIdx = i; } |
---|
1509 | UInt getSliceIdx () { return m_uiSliceIdx; } |
---|
1510 | Void copySliceInfo (TComSlice *pcSliceSrc); |
---|
1511 | Void setDependentSliceMode ( UInt uiMode ) { m_uiDependentSliceMode = uiMode; } |
---|
1512 | UInt getDependentSliceMode () { return m_uiDependentSliceMode; } |
---|
1513 | Void setDependentSliceArgument ( UInt uiArgument ) { m_uiDependentSliceArgument = uiArgument; } |
---|
1514 | UInt getDependentSliceArgument () { return m_uiDependentSliceArgument; } |
---|
1515 | Void setDependentSliceCurStartCUAddr ( UInt uiAddr ) { m_uiDependentSliceCurStartCUAddr = uiAddr; } |
---|
1516 | UInt getDependentSliceCurStartCUAddr () { return m_uiDependentSliceCurStartCUAddr; } |
---|
1517 | Void setDependentSliceCurEndCUAddr ( UInt uiAddr ) { m_uiDependentSliceCurEndCUAddr = uiAddr; } |
---|
1518 | UInt getDependentSliceCurEndCUAddr () { return m_uiDependentSliceCurEndCUAddr; } |
---|
1519 | Void setNextSlice ( Bool b ) { m_bNextSlice = b; } |
---|
1520 | Bool isNextSlice () { return m_bNextSlice; } |
---|
1521 | Void setNextDependentSlice ( Bool b ) { m_bNextDependentSlice = b; } |
---|
1522 | Bool isNextDependentSlice () { return m_bNextDependentSlice; } |
---|
1523 | Void setSliceBits ( UInt uiVal ) { m_uiSliceBits = uiVal; } |
---|
1524 | UInt getSliceBits () { return m_uiSliceBits; } |
---|
1525 | Void setDependentSliceCounter ( UInt uiVal ) { m_uiDependentSliceCounter = uiVal; } |
---|
1526 | UInt getDependentSliceCounter () { return m_uiDependentSliceCounter; } |
---|
1527 | Void setFinalized ( Bool uiVal ) { m_bFinalized = uiVal; } |
---|
1528 | Bool getFinalized () { return m_bFinalized; } |
---|
1529 | Void setWpScaling ( wpScalingParam wp[2][MAX_NUM_REF][3] ) { memcpy(m_weightPredTable, wp, sizeof(wpScalingParam)*2*MAX_NUM_REF*3); } |
---|
1530 | Void getWpScaling ( RefPicList e, Int iRefIdx, wpScalingParam *&wp); |
---|
1531 | |
---|
1532 | Void resetWpScaling (wpScalingParam wp[2][MAX_NUM_REF][3]); |
---|
1533 | Void initWpScaling (wpScalingParam wp[2][MAX_NUM_REF][3]); |
---|
1534 | Void initWpScaling (); |
---|
1535 | inline Bool applyWP () { return( (m_eSliceType==P_SLICE && m_pcPPS->getUseWP()) || (m_eSliceType==B_SLICE && m_pcPPS->getWPBiPred()) ); } |
---|
1536 | |
---|
1537 | Void setWpAcDcParam ( wpACDCParam wp[3] ) { memcpy(m_weightACDCParam, wp, sizeof(wpACDCParam)*3); } |
---|
1538 | Void getWpAcDcParam ( wpACDCParam *&wp ); |
---|
1539 | Void initWpAcDcParam (); |
---|
1540 | |
---|
1541 | Void setTileLocationCount ( UInt cnt ) { return m_tileByteLocation.resize(cnt); } |
---|
1542 | UInt getTileLocationCount () { return (UInt) m_tileByteLocation.size(); } |
---|
1543 | Void setTileLocation ( Int idx, UInt location ) { assert (idx<m_tileByteLocation.size()); |
---|
1544 | m_tileByteLocation[idx] = location; } |
---|
1545 | Void addTileLocation ( UInt location ) { m_tileByteLocation.push_back(location); } |
---|
1546 | UInt getTileLocation ( Int idx ) { return m_tileByteLocation[idx]; } |
---|
1547 | |
---|
1548 | Void setTileOffstForMultES (UInt uiOffset ) { m_uiTileOffstForMultES = uiOffset; } |
---|
1549 | UInt getTileOffstForMultES () { return m_uiTileOffstForMultES; } |
---|
1550 | Void allocSubstreamSizes ( UInt uiNumSubstreams ); |
---|
1551 | UInt* getSubstreamSizes () { return m_puiSubstreamSizes; } |
---|
1552 | Void setScalingList ( TComScalingList* scalingList ) { m_scalingList = scalingList; } |
---|
1553 | TComScalingList* getScalingList () { return m_scalingList; } |
---|
1554 | Void setDefaultScalingList (); |
---|
1555 | Bool checkDefaultScalingList (); |
---|
1556 | Void setCabacInitFlag ( Bool val ) { m_cabacInitFlag = val; } //!< set CABAC initial flag |
---|
1557 | Bool getCabacInitFlag () { return m_cabacInitFlag; } //!< get CABAC initial flag |
---|
1558 | Void setNumEntryPointOffsets(Int val) { m_numEntryPointOffsets = val; } |
---|
1559 | Int getNumEntryPointOffsets() { return m_numEntryPointOffsets; } |
---|
1560 | #if TEMPORAL_LAYER_NON_REFERENCE |
---|
1561 | Bool getTemporalLayerNonReferenceFlag() { return m_temporalLayerNonReferenceFlag;} |
---|
1562 | Void setTemporalLayerNonReferenceFlag(Bool x) { m_temporalLayerNonReferenceFlag = x;} |
---|
1563 | #endif |
---|
1564 | #if !REMOVE_NAL_REF_FLAG |
---|
1565 | Bool getNalRefFlag() { return m_nalRefFlag;} |
---|
1566 | Void setNalRefFlag(Bool x) { m_nalRefFlag = x;} |
---|
1567 | #endif |
---|
1568 | Void setLFCrossSliceBoundaryFlag ( Bool val ) { m_LFCrossSliceBoundaryFlag = val; } |
---|
1569 | Bool getLFCrossSliceBoundaryFlag () { return m_LFCrossSliceBoundaryFlag;} |
---|
1570 | |
---|
1571 | Void setEnableTMVPFlag ( Bool b ) { m_enableTMVPFlag = b; } |
---|
1572 | Bool getEnableTMVPFlag () { return m_enableTMVPFlag;} |
---|
1573 | #if REF_IDX_FRAMEWORK |
---|
1574 | Void addRefPicList( TComPic **pIlpPicList, Int iRefPicNum, Int iInsertOffset=0 ); |
---|
1575 | #endif |
---|
1576 | protected: |
---|
1577 | TComPic* xGetRefPic (TComList<TComPic*>& rcListPic, |
---|
1578 | UInt uiPOC); |
---|
1579 | TComPic* xGetLongTermRefPic (TComList<TComPic*>& rcListPic, |
---|
1580 | UInt uiPOC); |
---|
1581 | };// END CLASS DEFINITION TComSlice |
---|
1582 | |
---|
1583 | |
---|
1584 | template <class T> class ParameterSetMap |
---|
1585 | { |
---|
1586 | public: |
---|
1587 | ParameterSetMap(Int maxId) |
---|
1588 | :m_maxId (maxId) |
---|
1589 | {} |
---|
1590 | |
---|
1591 | ~ParameterSetMap() |
---|
1592 | { |
---|
1593 | for (typename std::map<Int,T *>::iterator i = m_paramsetMap.begin(); i!= m_paramsetMap.end(); i++) |
---|
1594 | { |
---|
1595 | delete (*i).second; |
---|
1596 | } |
---|
1597 | } |
---|
1598 | |
---|
1599 | Void storePS(Int psId, T *ps) |
---|
1600 | { |
---|
1601 | assert ( psId < m_maxId ); |
---|
1602 | if ( m_paramsetMap.find(psId) != m_paramsetMap.end() ) |
---|
1603 | { |
---|
1604 | delete m_paramsetMap[psId]; |
---|
1605 | } |
---|
1606 | m_paramsetMap[psId] = ps; |
---|
1607 | } |
---|
1608 | |
---|
1609 | Void mergePSList(ParameterSetMap<T> &rPsList) |
---|
1610 | { |
---|
1611 | for (typename std::map<Int,T *>::iterator i = rPsList.m_paramsetMap.begin(); i!= rPsList.m_paramsetMap.end(); i++) |
---|
1612 | { |
---|
1613 | storePS(i->first, i->second); |
---|
1614 | } |
---|
1615 | rPsList.m_paramsetMap.clear(); |
---|
1616 | } |
---|
1617 | |
---|
1618 | |
---|
1619 | T* getPS(Int psId) |
---|
1620 | { |
---|
1621 | return ( m_paramsetMap.find(psId) == m_paramsetMap.end() ) ? NULL : m_paramsetMap[psId]; |
---|
1622 | } |
---|
1623 | |
---|
1624 | T* getFirstPS() |
---|
1625 | { |
---|
1626 | return (m_paramsetMap.begin() == m_paramsetMap.end() ) ? NULL : m_paramsetMap.begin()->second; |
---|
1627 | } |
---|
1628 | |
---|
1629 | private: |
---|
1630 | std::map<Int,T *> m_paramsetMap; |
---|
1631 | Int m_maxId; |
---|
1632 | }; |
---|
1633 | |
---|
1634 | class ParameterSetManager |
---|
1635 | { |
---|
1636 | public: |
---|
1637 | ParameterSetManager(); |
---|
1638 | virtual ~ParameterSetManager(); |
---|
1639 | |
---|
1640 | //! store sequence parameter set and take ownership of it |
---|
1641 | Void storeVPS(TComVPS *vps) { m_vpsMap.storePS( vps->getVPSId(), vps); }; |
---|
1642 | //! get pointer to existing video parameter set |
---|
1643 | TComVPS* getVPS(Int vpsId) { return m_vpsMap.getPS(vpsId); }; |
---|
1644 | TComVPS* getFirstVPS() { return m_vpsMap.getFirstPS(); }; |
---|
1645 | |
---|
1646 | //! store sequence parameter set and take ownership of it |
---|
1647 | Void storeSPS(TComSPS *sps) { m_spsMap.storePS( sps->getSPSId(), sps); }; |
---|
1648 | //! get pointer to existing sequence parameter set |
---|
1649 | TComSPS* getSPS(Int spsId) { return m_spsMap.getPS(spsId); }; |
---|
1650 | TComSPS* getFirstSPS() { return m_spsMap.getFirstPS(); }; |
---|
1651 | |
---|
1652 | //! store picture parameter set and take ownership of it |
---|
1653 | Void storePPS(TComPPS *pps) { m_ppsMap.storePS( pps->getPPSId(), pps); }; |
---|
1654 | //! get pointer to existing picture parameter set |
---|
1655 | TComPPS* getPPS(Int ppsId) { return m_ppsMap.getPS(ppsId); }; |
---|
1656 | TComPPS* getFirstPPS() { return m_ppsMap.getFirstPS(); }; |
---|
1657 | |
---|
1658 | #if !REMOVE_APS |
---|
1659 | //! store adaptation parameter set and take ownership of it |
---|
1660 | Void storeAPS(TComAPS *aps) { m_apsMap.storePS( aps->getAPSID(), aps); }; |
---|
1661 | //! getPointer to existing adaptation parameter set |
---|
1662 | TComAPS* getAPS(Int apsId) { return m_apsMap.getPS(apsId); }; |
---|
1663 | #endif |
---|
1664 | protected: |
---|
1665 | |
---|
1666 | ParameterSetMap<TComVPS> m_vpsMap; |
---|
1667 | ParameterSetMap<TComSPS> m_spsMap; |
---|
1668 | ParameterSetMap<TComPPS> m_ppsMap; |
---|
1669 | #if !REMOVE_APS |
---|
1670 | ParameterSetMap<TComAPS> m_apsMap; |
---|
1671 | #endif |
---|
1672 | }; |
---|
1673 | |
---|
1674 | //! \} |
---|
1675 | |
---|
1676 | #endif // __TCOMSLICE__ |
---|