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 | #if SET_SLICE_LAYER_ID |
---|
1292 | Void initSlice ( UInt layerId ); |
---|
1293 | #else |
---|
1294 | Void initSlice (); |
---|
1295 | #endif |
---|
1296 | |
---|
1297 | Void setVPS ( TComVPS* pcVPS ) { m_pcVPS = pcVPS; } |
---|
1298 | TComVPS* getVPS () { return m_pcVPS; } |
---|
1299 | Void setSPS ( TComSPS* pcSPS ) { m_pcSPS = pcSPS; } |
---|
1300 | TComSPS* getSPS () { return m_pcSPS; } |
---|
1301 | |
---|
1302 | Void setPPS ( TComPPS* pcPPS ) { assert(pcPPS!=NULL); m_pcPPS = pcPPS; m_iPPSId = pcPPS->getPPSId(); } |
---|
1303 | TComPPS* getPPS () { return m_pcPPS; } |
---|
1304 | |
---|
1305 | #if ADAPTIVE_QP_SELECTION |
---|
1306 | Void setTrQuant ( TComTrQuant* pcTrQuant ) { m_pcTrQuant = pcTrQuant; } |
---|
1307 | TComTrQuant* getTrQuant () { return m_pcTrQuant; } |
---|
1308 | #endif |
---|
1309 | |
---|
1310 | Void setPPSId ( Int PPSId ) { m_iPPSId = PPSId; } |
---|
1311 | Int getPPSId () { return m_iPPSId; } |
---|
1312 | #if !REMOVE_APS |
---|
1313 | Void setAPS ( TComAPS* pcAPS ) { m_pcAPS = pcAPS; } //!< set APS pointer |
---|
1314 | TComAPS* getAPS () { return m_pcAPS; } //!< get APS pointer |
---|
1315 | Void setAPSId ( Int Id) { m_iAPSId =Id; } //!< set APS ID |
---|
1316 | Int getAPSId () { return m_iAPSId; } //!< get APS ID |
---|
1317 | #endif |
---|
1318 | Void setPicOutputFlag( Bool b ) { m_PicOutputFlag = b; } |
---|
1319 | Bool getPicOutputFlag() { return m_PicOutputFlag; } |
---|
1320 | #if !REMOVE_ALF |
---|
1321 | Void setAlfEnabledFlag(Bool b, Int compIdx) { m_alfEnabledFlag[compIdx] = b; } |
---|
1322 | Bool getAlfEnabledFlag(Int compIdx) { return m_alfEnabledFlag[compIdx]; } |
---|
1323 | #endif |
---|
1324 | Void setSaoEnabledFlag(Bool s) {m_saoEnabledFlag =s; } |
---|
1325 | Bool getSaoEnabledFlag() { return m_saoEnabledFlag; } |
---|
1326 | #if SAO_TYPE_SHARING |
---|
1327 | Void setSaoEnabledFlagChroma(Bool s) {m_saoEnabledFlagChroma =s; } //!< set SAO Cb&Cr enabled flag |
---|
1328 | Bool getSaoEnabledFlagChroma() { return m_saoEnabledFlagChroma; } //!< get SAO Cb&Cr enabled flag |
---|
1329 | #else |
---|
1330 | Void setSaoEnabledFlagCb(Bool s) {m_saoEnabledFlagCb =s; } //!< set SAO Cb enabled flag |
---|
1331 | Bool getSaoEnabledFlagCb() { return m_saoEnabledFlagCb; } //!< get SAO Cb enabled flag |
---|
1332 | Void setSaoEnabledFlagCr(Bool s) {m_saoEnabledFlagCr =s; } //!< set SAO Cr enabled flag |
---|
1333 | Bool getSaoEnabledFlagCr() { return m_saoEnabledFlagCr; } //!< get SAO Cr enabled flag |
---|
1334 | #endif |
---|
1335 | Void setRPS ( TComReferencePictureSet *pcRPS ) { m_pcRPS = pcRPS; } |
---|
1336 | TComReferencePictureSet* getRPS () { return m_pcRPS; } |
---|
1337 | TComReferencePictureSet* getLocalRPS () { return &m_LocalRPS; } |
---|
1338 | |
---|
1339 | Void setRPSidx ( Int iBDidx ) { m_iBDidx = iBDidx; } |
---|
1340 | Int getRPSidx () { return m_iBDidx; } |
---|
1341 | Void setCombinationBDidx ( Int iCombinationBDidx ) { m_iCombinationBDidx = iCombinationBDidx; } |
---|
1342 | Int getCombinationBDidx () { return m_iCombinationBDidx; } |
---|
1343 | Void setCombineWithReferenceFlag ( Bool bCombineWithReferenceFlag ) { m_bCombineWithReferenceFlag = bCombineWithReferenceFlag; } |
---|
1344 | Bool getCombineWithReferenceFlag () { return m_bCombineWithReferenceFlag; } |
---|
1345 | #if PREVREFPIC_DEFN |
---|
1346 | Int getPrevPOC () { return m_prevPOC[getTLayer()]; } |
---|
1347 | #else |
---|
1348 | Int getPrevPOC () { return m_prevPOC; } |
---|
1349 | #endif |
---|
1350 | TComRefPicListModification* getRefPicListModification() { return &m_RefPicListModification; } |
---|
1351 | Void setLastIDR(Int iIDRPOC) { m_iLastIDR = iIDRPOC; } |
---|
1352 | Int getLastIDR() { return m_iLastIDR; } |
---|
1353 | SliceType getSliceType () { return m_eSliceType; } |
---|
1354 | Int getPOC () { return m_iPOC; } |
---|
1355 | Int getSliceQp () { return m_iSliceQp; } |
---|
1356 | #if SLICEHEADER_SYNTAX_FIX |
---|
1357 | Bool getDependentSliceFlag() const { return m_dependentSliceFlag; } |
---|
1358 | void setDependentSliceFlag(Bool val) { m_dependentSliceFlag = val; } |
---|
1359 | #endif |
---|
1360 | #if ADAPTIVE_QP_SELECTION |
---|
1361 | Int getSliceQpBase () { return m_iSliceQpBase; } |
---|
1362 | #endif |
---|
1363 | Int getSliceQpDelta () { return m_iSliceQpDelta; } |
---|
1364 | #if CHROMA_QP_EXTENSION |
---|
1365 | Int getSliceQpDeltaCb () { return m_iSliceQpDeltaCb; } |
---|
1366 | Int getSliceQpDeltaCr () { return m_iSliceQpDeltaCr; } |
---|
1367 | #endif |
---|
1368 | Bool getDeblockingFilterDisable() { return m_deblockingFilterDisable; } |
---|
1369 | Bool getDeblockingFilterOverrideFlag() { return m_deblockingFilterOverrideFlag; } |
---|
1370 | Int getDeblockingFilterBetaOffsetDiv2() { return m_deblockingFilterBetaOffsetDiv2; } |
---|
1371 | Int getDeblockingFilterTcOffsetDiv2() { return m_deblockingFilterTcOffsetDiv2; } |
---|
1372 | |
---|
1373 | Int getNumRefIdx ( RefPicList e ) { return m_aiNumRefIdx[e]; } |
---|
1374 | TComPic* getPic () { return m_pcPic; } |
---|
1375 | TComPic* getRefPic ( RefPicList e, Int iRefIdx) { return m_apcRefPicList[e][iRefIdx]; } |
---|
1376 | Int getRefPOC ( RefPicList e, Int iRefIdx) { return m_aiRefPOCList[e][iRefIdx]; } |
---|
1377 | Int getDepth () { return m_iDepth; } |
---|
1378 | UInt getColFromL0Flag () { return m_colFromL0Flag; } |
---|
1379 | UInt getColRefIdx () { return m_colRefIdx; } |
---|
1380 | Void checkColRefIdx (UInt curSliceIdx, TComPic* pic); |
---|
1381 | Bool getCheckLDC () { return m_bCheckLDC; } |
---|
1382 | Bool getMvdL1ZeroFlag () { return m_bLMvdL1Zero; } |
---|
1383 | Int getNumRpsCurrTempList(); |
---|
1384 | Int getRefIdxOfLC (RefPicList e, Int iRefIdx) { return m_iRefIdxOfLC[e][iRefIdx]; } |
---|
1385 | Int getListIdFromIdxOfLC(Int iRefIdx) { return m_eListIdFromIdxOfLC[iRefIdx]; } |
---|
1386 | Int getRefIdxFromIdxOfLC(Int iRefIdx) { return m_iRefIdxFromIdxOfLC[iRefIdx]; } |
---|
1387 | Int getRefIdxOfL0FromRefIdxOfL1(Int iRefIdx) { return m_iRefIdxOfL0FromRefIdxOfL1[iRefIdx];} |
---|
1388 | Int getRefIdxOfL1FromRefIdxOfL0(Int iRefIdx) { return m_iRefIdxOfL1FromRefIdxOfL0[iRefIdx];} |
---|
1389 | Bool getRefPicListModificationFlagLC() {return m_bRefPicListModificationFlagLC;} |
---|
1390 | Void setRefPicListModificationFlagLC(Bool bflag) {m_bRefPicListModificationFlagLC=bflag;} |
---|
1391 | Bool getRefPicListCombinationFlag() {return m_bRefPicListCombinationFlag;} |
---|
1392 | Void setRefPicListCombinationFlag(Bool bflag) {m_bRefPicListCombinationFlag=bflag;} |
---|
1393 | Void setReferenced(Bool b) { m_bRefenced = b; } |
---|
1394 | Bool isReferenced() { return m_bRefenced; } |
---|
1395 | #if PREVREFPIC_DEFN |
---|
1396 | Void setPOC ( Int i ) |
---|
1397 | { |
---|
1398 | m_iPOC = i; |
---|
1399 | if (isReferenced()) |
---|
1400 | { |
---|
1401 | for (Int j = getTLayer(); j < (getSPS()->getMaxTLayers()); j++) |
---|
1402 | { |
---|
1403 | m_prevPOC[j] = i; |
---|
1404 | } |
---|
1405 | } |
---|
1406 | } |
---|
1407 | #else |
---|
1408 | Void setPOC ( Int i ) { m_iPOC = i; if(getTLayer()==0) m_prevPOC=i; } |
---|
1409 | #endif |
---|
1410 | Void setNalUnitType ( NalUnitType e ) { m_eNalUnitType = e; } |
---|
1411 | NalUnitType getNalUnitType () { return m_eNalUnitType; } |
---|
1412 | Bool getRapPicFlag (); |
---|
1413 | #if SUPPORT_FOR_RAP_N_LP |
---|
1414 | Bool getIdrPicFlag () { return getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP; } |
---|
1415 | #endif |
---|
1416 | Void checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, Bool& prevRAPisBLA, TComList<TComPic*>& rcListPic); |
---|
1417 | Void decodingRefreshMarking(Int& pocCRA, Bool& bRefreshPending, TComList<TComPic*>& rcListPic); |
---|
1418 | Void setSliceType ( SliceType e ) { m_eSliceType = e; } |
---|
1419 | Void setSliceQp ( Int i ) { m_iSliceQp = i; } |
---|
1420 | #if ADAPTIVE_QP_SELECTION |
---|
1421 | Void setSliceQpBase ( Int i ) { m_iSliceQpBase = i; } |
---|
1422 | #endif |
---|
1423 | Void setSliceQpDelta ( Int i ) { m_iSliceQpDelta = i; } |
---|
1424 | #if CHROMA_QP_EXTENSION |
---|
1425 | Void setSliceQpDeltaCb ( Int i ) { m_iSliceQpDeltaCb = i; } |
---|
1426 | Void setSliceQpDeltaCr ( Int i ) { m_iSliceQpDeltaCr = i; } |
---|
1427 | #endif |
---|
1428 | Void setDeblockingFilterDisable( Bool b ) { m_deblockingFilterDisable= b; } |
---|
1429 | Void setDeblockingFilterOverrideFlag( Bool b ) { m_deblockingFilterOverrideFlag = b; } |
---|
1430 | Void setDeblockingFilterBetaOffsetDiv2( Int i ) { m_deblockingFilterBetaOffsetDiv2 = i; } |
---|
1431 | Void setDeblockingFilterTcOffsetDiv2( Int i ) { m_deblockingFilterTcOffsetDiv2 = i; } |
---|
1432 | |
---|
1433 | Void setRefPic ( TComPic* p, RefPicList e, Int iRefIdx ) { m_apcRefPicList[e][iRefIdx] = p; } |
---|
1434 | Void setRefPOC ( Int i, RefPicList e, Int iRefIdx ) { m_aiRefPOCList[e][iRefIdx] = i; } |
---|
1435 | Void setNumRefIdx ( RefPicList e, Int i ) { m_aiNumRefIdx[e] = i; } |
---|
1436 | Void setPic ( TComPic* p ) { m_pcPic = p; } |
---|
1437 | Void setDepth ( Int iDepth ) { m_iDepth = iDepth; } |
---|
1438 | |
---|
1439 | #if SVC_EXTENSION |
---|
1440 | Void setBaseColPic ( TComPic* p) { m_pcBaseColPic = p; } |
---|
1441 | Void setBaseColPic ( TComList<TComPic*>& rcListPic , UInt layerID ); |
---|
1442 | TComPic* getBaseColPic () { return m_pcBaseColPic; } |
---|
1443 | |
---|
1444 | Void setLayerId (UInt layerId) { m_layerId = layerId; } |
---|
1445 | UInt getLayerId () { return m_layerId; } |
---|
1446 | |
---|
1447 | Void setFullPelBaseRec ( TComPicYuv* p) { m_pcFullPelBaseRec = p; } |
---|
1448 | TComPicYuv* getFullPelBaseRec () { return m_pcFullPelBaseRec; } |
---|
1449 | #endif |
---|
1450 | Void setRefPicList ( TComList<TComPic*>& rcListPic ); |
---|
1451 | Void setRefPOCList (); |
---|
1452 | Void setColFromL0Flag ( UInt colFromL0 ) { m_colFromL0Flag = colFromL0; } |
---|
1453 | Void setColRefIdx ( UInt refIdx) { m_colRefIdx = refIdx; } |
---|
1454 | Void setCheckLDC ( Bool b ) { m_bCheckLDC = b; } |
---|
1455 | Void setMvdL1ZeroFlag ( Bool b) { m_bLMvdL1Zero = b; } |
---|
1456 | |
---|
1457 | Bool isIntra () { return m_eSliceType == I_SLICE; } |
---|
1458 | Bool isInterB () { return m_eSliceType == B_SLICE; } |
---|
1459 | Bool isInterP () { return m_eSliceType == P_SLICE; } |
---|
1460 | |
---|
1461 | #if ALF_CHROMA_LAMBDA || SAO_CHROMA_LAMBDA |
---|
1462 | Void setLambda( Double d, Double e ) { m_dLambdaLuma = d; m_dLambdaChroma = e;} |
---|
1463 | Double getLambdaLuma() { return m_dLambdaLuma; } |
---|
1464 | Double getLambdaChroma() { return m_dLambdaChroma; } |
---|
1465 | #else |
---|
1466 | Void setLambda( Double d ) { m_dLambda = d; } |
---|
1467 | Double getLambda() { return m_dLambda; } |
---|
1468 | #endif |
---|
1469 | |
---|
1470 | Void initEqualRef(); |
---|
1471 | Bool isEqualRef ( RefPicList e, Int iRefIdx1, Int iRefIdx2 ) |
---|
1472 | { |
---|
1473 | if (iRefIdx1 < 0 || iRefIdx2 < 0) return false; |
---|
1474 | return m_abEqualRef[e][iRefIdx1][iRefIdx2]; |
---|
1475 | } |
---|
1476 | |
---|
1477 | Void setEqualRef( RefPicList e, Int iRefIdx1, Int iRefIdx2, Bool b) |
---|
1478 | { |
---|
1479 | m_abEqualRef[e][iRefIdx1][iRefIdx2] = m_abEqualRef[e][iRefIdx2][iRefIdx1] = b; |
---|
1480 | } |
---|
1481 | |
---|
1482 | static Void sortPicList ( TComList<TComPic*>& rcListPic ); |
---|
1483 | |
---|
1484 | Bool getNoBackPredFlag() { return m_bNoBackPredFlag; } |
---|
1485 | Void setNoBackPredFlag( Bool b ) { m_bNoBackPredFlag = b; } |
---|
1486 | Void generateCombinedList (); |
---|
1487 | |
---|
1488 | UInt getTLayer () { return m_uiTLayer; } |
---|
1489 | Void setTLayer ( UInt uiTLayer ) { m_uiTLayer = uiTLayer; } |
---|
1490 | |
---|
1491 | Void setTLayerInfo( UInt uiTLayer ); |
---|
1492 | Void decodingMarking( TComList<TComPic*>& rcListPic, Int iGOPSIze, Int& iMaxRefPicNum ); |
---|
1493 | Void applyReferencePictureSet( TComList<TComPic*>& rcListPic, TComReferencePictureSet *RPSList); |
---|
1494 | Bool isTemporalLayerSwitchingPoint( TComList<TComPic*>& rcListPic, TComReferencePictureSet *RPSList); |
---|
1495 | #if STSA |
---|
1496 | Bool isStepwiseTemporalLayerSwitchingPointCandidate( TComList<TComPic*>& rcListPic, TComReferencePictureSet *RPSList); |
---|
1497 | #endif |
---|
1498 | Int checkThatAllRefPicsAreAvailable( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool printErrors, Int pocRandomAccess = 0); |
---|
1499 | Void createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet); |
---|
1500 | |
---|
1501 | Void setMaxNumMergeCand (UInt val ) { m_maxNumMergeCand = val; } |
---|
1502 | UInt getMaxNumMergeCand () { return m_maxNumMergeCand; } |
---|
1503 | |
---|
1504 | Void setSliceMode ( UInt uiMode ) { m_uiSliceMode = uiMode; } |
---|
1505 | UInt getSliceMode () { return m_uiSliceMode; } |
---|
1506 | Void setSliceArgument ( UInt uiArgument ) { m_uiSliceArgument = uiArgument; } |
---|
1507 | UInt getSliceArgument () { return m_uiSliceArgument; } |
---|
1508 | Void setSliceCurStartCUAddr ( UInt uiAddr ) { m_uiSliceCurStartCUAddr = uiAddr; } |
---|
1509 | UInt getSliceCurStartCUAddr () { return m_uiSliceCurStartCUAddr; } |
---|
1510 | Void setSliceCurEndCUAddr ( UInt uiAddr ) { m_uiSliceCurEndCUAddr = uiAddr; } |
---|
1511 | UInt getSliceCurEndCUAddr () { return m_uiSliceCurEndCUAddr; } |
---|
1512 | Void setSliceIdx ( UInt i) { m_uiSliceIdx = i; } |
---|
1513 | UInt getSliceIdx () { return m_uiSliceIdx; } |
---|
1514 | Void copySliceInfo (TComSlice *pcSliceSrc); |
---|
1515 | Void setDependentSliceMode ( UInt uiMode ) { m_uiDependentSliceMode = uiMode; } |
---|
1516 | UInt getDependentSliceMode () { return m_uiDependentSliceMode; } |
---|
1517 | Void setDependentSliceArgument ( UInt uiArgument ) { m_uiDependentSliceArgument = uiArgument; } |
---|
1518 | UInt getDependentSliceArgument () { return m_uiDependentSliceArgument; } |
---|
1519 | Void setDependentSliceCurStartCUAddr ( UInt uiAddr ) { m_uiDependentSliceCurStartCUAddr = uiAddr; } |
---|
1520 | UInt getDependentSliceCurStartCUAddr () { return m_uiDependentSliceCurStartCUAddr; } |
---|
1521 | Void setDependentSliceCurEndCUAddr ( UInt uiAddr ) { m_uiDependentSliceCurEndCUAddr = uiAddr; } |
---|
1522 | UInt getDependentSliceCurEndCUAddr () { return m_uiDependentSliceCurEndCUAddr; } |
---|
1523 | Void setNextSlice ( Bool b ) { m_bNextSlice = b; } |
---|
1524 | Bool isNextSlice () { return m_bNextSlice; } |
---|
1525 | Void setNextDependentSlice ( Bool b ) { m_bNextDependentSlice = b; } |
---|
1526 | Bool isNextDependentSlice () { return m_bNextDependentSlice; } |
---|
1527 | Void setSliceBits ( UInt uiVal ) { m_uiSliceBits = uiVal; } |
---|
1528 | UInt getSliceBits () { return m_uiSliceBits; } |
---|
1529 | Void setDependentSliceCounter ( UInt uiVal ) { m_uiDependentSliceCounter = uiVal; } |
---|
1530 | UInt getDependentSliceCounter () { return m_uiDependentSliceCounter; } |
---|
1531 | Void setFinalized ( Bool uiVal ) { m_bFinalized = uiVal; } |
---|
1532 | Bool getFinalized () { return m_bFinalized; } |
---|
1533 | Void setWpScaling ( wpScalingParam wp[2][MAX_NUM_REF][3] ) { memcpy(m_weightPredTable, wp, sizeof(wpScalingParam)*2*MAX_NUM_REF*3); } |
---|
1534 | Void getWpScaling ( RefPicList e, Int iRefIdx, wpScalingParam *&wp); |
---|
1535 | |
---|
1536 | Void resetWpScaling (wpScalingParam wp[2][MAX_NUM_REF][3]); |
---|
1537 | Void initWpScaling (wpScalingParam wp[2][MAX_NUM_REF][3]); |
---|
1538 | Void initWpScaling (); |
---|
1539 | inline Bool applyWP () { return( (m_eSliceType==P_SLICE && m_pcPPS->getUseWP()) || (m_eSliceType==B_SLICE && m_pcPPS->getWPBiPred()) ); } |
---|
1540 | |
---|
1541 | Void setWpAcDcParam ( wpACDCParam wp[3] ) { memcpy(m_weightACDCParam, wp, sizeof(wpACDCParam)*3); } |
---|
1542 | Void getWpAcDcParam ( wpACDCParam *&wp ); |
---|
1543 | Void initWpAcDcParam (); |
---|
1544 | |
---|
1545 | Void setTileLocationCount ( UInt cnt ) { return m_tileByteLocation.resize(cnt); } |
---|
1546 | UInt getTileLocationCount () { return (UInt) m_tileByteLocation.size(); } |
---|
1547 | Void setTileLocation ( Int idx, UInt location ) { assert (idx<m_tileByteLocation.size()); |
---|
1548 | m_tileByteLocation[idx] = location; } |
---|
1549 | Void addTileLocation ( UInt location ) { m_tileByteLocation.push_back(location); } |
---|
1550 | UInt getTileLocation ( Int idx ) { return m_tileByteLocation[idx]; } |
---|
1551 | |
---|
1552 | Void setTileOffstForMultES (UInt uiOffset ) { m_uiTileOffstForMultES = uiOffset; } |
---|
1553 | UInt getTileOffstForMultES () { return m_uiTileOffstForMultES; } |
---|
1554 | Void allocSubstreamSizes ( UInt uiNumSubstreams ); |
---|
1555 | UInt* getSubstreamSizes () { return m_puiSubstreamSizes; } |
---|
1556 | Void setScalingList ( TComScalingList* scalingList ) { m_scalingList = scalingList; } |
---|
1557 | TComScalingList* getScalingList () { return m_scalingList; } |
---|
1558 | Void setDefaultScalingList (); |
---|
1559 | Bool checkDefaultScalingList (); |
---|
1560 | Void setCabacInitFlag ( Bool val ) { m_cabacInitFlag = val; } //!< set CABAC initial flag |
---|
1561 | Bool getCabacInitFlag () { return m_cabacInitFlag; } //!< get CABAC initial flag |
---|
1562 | Void setNumEntryPointOffsets(Int val) { m_numEntryPointOffsets = val; } |
---|
1563 | Int getNumEntryPointOffsets() { return m_numEntryPointOffsets; } |
---|
1564 | #if TEMPORAL_LAYER_NON_REFERENCE |
---|
1565 | Bool getTemporalLayerNonReferenceFlag() { return m_temporalLayerNonReferenceFlag;} |
---|
1566 | Void setTemporalLayerNonReferenceFlag(Bool x) { m_temporalLayerNonReferenceFlag = x;} |
---|
1567 | #endif |
---|
1568 | #if !REMOVE_NAL_REF_FLAG |
---|
1569 | Bool getNalRefFlag() { return m_nalRefFlag;} |
---|
1570 | Void setNalRefFlag(Bool x) { m_nalRefFlag = x;} |
---|
1571 | #endif |
---|
1572 | Void setLFCrossSliceBoundaryFlag ( Bool val ) { m_LFCrossSliceBoundaryFlag = val; } |
---|
1573 | Bool getLFCrossSliceBoundaryFlag () { return m_LFCrossSliceBoundaryFlag;} |
---|
1574 | |
---|
1575 | Void setEnableTMVPFlag ( Bool b ) { m_enableTMVPFlag = b; } |
---|
1576 | Bool getEnableTMVPFlag () { return m_enableTMVPFlag;} |
---|
1577 | #if REF_IDX_FRAMEWORK |
---|
1578 | Void addRefPicList( TComPic **pIlpPicList, Int iRefPicNum, Int iInsertOffset=0 ); |
---|
1579 | #endif |
---|
1580 | protected: |
---|
1581 | TComPic* xGetRefPic (TComList<TComPic*>& rcListPic, |
---|
1582 | UInt uiPOC); |
---|
1583 | TComPic* xGetLongTermRefPic (TComList<TComPic*>& rcListPic, |
---|
1584 | UInt uiPOC); |
---|
1585 | };// END CLASS DEFINITION TComSlice |
---|
1586 | |
---|
1587 | |
---|
1588 | template <class T> class ParameterSetMap |
---|
1589 | { |
---|
1590 | public: |
---|
1591 | ParameterSetMap(Int maxId) |
---|
1592 | :m_maxId (maxId) |
---|
1593 | {} |
---|
1594 | |
---|
1595 | ~ParameterSetMap() |
---|
1596 | { |
---|
1597 | for (typename std::map<Int,T *>::iterator i = m_paramsetMap.begin(); i!= m_paramsetMap.end(); i++) |
---|
1598 | { |
---|
1599 | delete (*i).second; |
---|
1600 | } |
---|
1601 | } |
---|
1602 | |
---|
1603 | Void storePS(Int psId, T *ps) |
---|
1604 | { |
---|
1605 | assert ( psId < m_maxId ); |
---|
1606 | if ( m_paramsetMap.find(psId) != m_paramsetMap.end() ) |
---|
1607 | { |
---|
1608 | delete m_paramsetMap[psId]; |
---|
1609 | } |
---|
1610 | m_paramsetMap[psId] = ps; |
---|
1611 | } |
---|
1612 | |
---|
1613 | Void mergePSList(ParameterSetMap<T> &rPsList) |
---|
1614 | { |
---|
1615 | for (typename std::map<Int,T *>::iterator i = rPsList.m_paramsetMap.begin(); i!= rPsList.m_paramsetMap.end(); i++) |
---|
1616 | { |
---|
1617 | storePS(i->first, i->second); |
---|
1618 | } |
---|
1619 | rPsList.m_paramsetMap.clear(); |
---|
1620 | } |
---|
1621 | |
---|
1622 | |
---|
1623 | T* getPS(Int psId) |
---|
1624 | { |
---|
1625 | return ( m_paramsetMap.find(psId) == m_paramsetMap.end() ) ? NULL : m_paramsetMap[psId]; |
---|
1626 | } |
---|
1627 | |
---|
1628 | T* getFirstPS() |
---|
1629 | { |
---|
1630 | return (m_paramsetMap.begin() == m_paramsetMap.end() ) ? NULL : m_paramsetMap.begin()->second; |
---|
1631 | } |
---|
1632 | |
---|
1633 | private: |
---|
1634 | std::map<Int,T *> m_paramsetMap; |
---|
1635 | Int m_maxId; |
---|
1636 | }; |
---|
1637 | |
---|
1638 | class ParameterSetManager |
---|
1639 | { |
---|
1640 | public: |
---|
1641 | ParameterSetManager(); |
---|
1642 | virtual ~ParameterSetManager(); |
---|
1643 | |
---|
1644 | //! store sequence parameter set and take ownership of it |
---|
1645 | Void storeVPS(TComVPS *vps) { m_vpsMap.storePS( vps->getVPSId(), vps); }; |
---|
1646 | //! get pointer to existing video parameter set |
---|
1647 | TComVPS* getVPS(Int vpsId) { return m_vpsMap.getPS(vpsId); }; |
---|
1648 | TComVPS* getFirstVPS() { return m_vpsMap.getFirstPS(); }; |
---|
1649 | |
---|
1650 | //! store sequence parameter set and take ownership of it |
---|
1651 | Void storeSPS(TComSPS *sps) { m_spsMap.storePS( sps->getSPSId(), sps); }; |
---|
1652 | //! get pointer to existing sequence parameter set |
---|
1653 | TComSPS* getSPS(Int spsId) { return m_spsMap.getPS(spsId); }; |
---|
1654 | TComSPS* getFirstSPS() { return m_spsMap.getFirstPS(); }; |
---|
1655 | |
---|
1656 | //! store picture parameter set and take ownership of it |
---|
1657 | Void storePPS(TComPPS *pps) { m_ppsMap.storePS( pps->getPPSId(), pps); }; |
---|
1658 | //! get pointer to existing picture parameter set |
---|
1659 | TComPPS* getPPS(Int ppsId) { return m_ppsMap.getPS(ppsId); }; |
---|
1660 | TComPPS* getFirstPPS() { return m_ppsMap.getFirstPS(); }; |
---|
1661 | |
---|
1662 | #if !REMOVE_APS |
---|
1663 | //! store adaptation parameter set and take ownership of it |
---|
1664 | Void storeAPS(TComAPS *aps) { m_apsMap.storePS( aps->getAPSID(), aps); }; |
---|
1665 | //! getPointer to existing adaptation parameter set |
---|
1666 | TComAPS* getAPS(Int apsId) { return m_apsMap.getPS(apsId); }; |
---|
1667 | #endif |
---|
1668 | protected: |
---|
1669 | |
---|
1670 | ParameterSetMap<TComVPS> m_vpsMap; |
---|
1671 | ParameterSetMap<TComSPS> m_spsMap; |
---|
1672 | ParameterSetMap<TComPPS> m_ppsMap; |
---|
1673 | #if !REMOVE_APS |
---|
1674 | ParameterSetMap<TComAPS> m_apsMap; |
---|
1675 | #endif |
---|
1676 | }; |
---|
1677 | |
---|
1678 | //! \} |
---|
1679 | |
---|
1680 | #endif // __TCOMSLICE__ |
---|