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-2014, 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 | // ==================================================================================================================== |
---|
62 | // Class definition |
---|
63 | // ==================================================================================================================== |
---|
64 | |
---|
65 | /// Reference Picture Set class |
---|
66 | class TComReferencePictureSet |
---|
67 | { |
---|
68 | private: |
---|
69 | Int m_numberOfPictures; |
---|
70 | Int m_numberOfNegativePictures; |
---|
71 | Int m_numberOfPositivePictures; |
---|
72 | Int m_numberOfLongtermPictures; |
---|
73 | Int m_deltaPOC[MAX_NUM_REF_PICS]; |
---|
74 | Int m_POC[MAX_NUM_REF_PICS]; |
---|
75 | Bool m_used[MAX_NUM_REF_PICS]; |
---|
76 | Bool m_interRPSPrediction; |
---|
77 | Int m_deltaRIdxMinus1; |
---|
78 | Int m_deltaRPS; |
---|
79 | Int m_numRefIdc; |
---|
80 | Int m_refIdc[MAX_NUM_REF_PICS+1]; |
---|
81 | Bool m_bCheckLTMSB[MAX_NUM_REF_PICS]; |
---|
82 | Int m_pocLSBLT[MAX_NUM_REF_PICS]; |
---|
83 | Int m_deltaPOCMSBCycleLT[MAX_NUM_REF_PICS]; |
---|
84 | Bool m_deltaPocMSBPresentFlag[MAX_NUM_REF_PICS]; |
---|
85 | |
---|
86 | public: |
---|
87 | TComReferencePictureSet(); |
---|
88 | virtual ~TComReferencePictureSet(); |
---|
89 | Int getPocLSBLT(Int i) { return m_pocLSBLT[i]; } |
---|
90 | Void setPocLSBLT(Int i, Int x) { m_pocLSBLT[i] = x; } |
---|
91 | Int getDeltaPocMSBCycleLT(Int i) { return m_deltaPOCMSBCycleLT[i]; } |
---|
92 | Void setDeltaPocMSBCycleLT(Int i, Int x) { m_deltaPOCMSBCycleLT[i] = x; } |
---|
93 | Bool getDeltaPocMSBPresentFlag(Int i) { return m_deltaPocMSBPresentFlag[i]; } |
---|
94 | Void setDeltaPocMSBPresentFlag(Int i, Bool x) { m_deltaPocMSBPresentFlag[i] = x; } |
---|
95 | Void setUsed(Int bufferNum, Bool used); |
---|
96 | Void setDeltaPOC(Int bufferNum, Int deltaPOC); |
---|
97 | Void setPOC(Int bufferNum, Int deltaPOC); |
---|
98 | Void setNumberOfPictures(Int numberOfPictures); |
---|
99 | Void setCheckLTMSBPresent(Int bufferNum, Bool b ); |
---|
100 | Bool getCheckLTMSBPresent(Int bufferNum); |
---|
101 | |
---|
102 | Int getUsed(Int bufferNum); |
---|
103 | Int getDeltaPOC(Int bufferNum); |
---|
104 | Int getPOC(Int bufferNum); |
---|
105 | Int getNumberOfPictures(); |
---|
106 | |
---|
107 | Void setNumberOfNegativePictures(Int number) { m_numberOfNegativePictures = number; } |
---|
108 | Int getNumberOfNegativePictures() { return m_numberOfNegativePictures; } |
---|
109 | Void setNumberOfPositivePictures(Int number) { m_numberOfPositivePictures = number; } |
---|
110 | Int getNumberOfPositivePictures() { return m_numberOfPositivePictures; } |
---|
111 | Void setNumberOfLongtermPictures(Int number) { m_numberOfLongtermPictures = number; } |
---|
112 | Int getNumberOfLongtermPictures() { return m_numberOfLongtermPictures; } |
---|
113 | |
---|
114 | Void setInterRPSPrediction(Bool flag) { m_interRPSPrediction = flag; } |
---|
115 | Bool getInterRPSPrediction() { return m_interRPSPrediction; } |
---|
116 | Void setDeltaRIdxMinus1(Int x) { m_deltaRIdxMinus1 = x; } |
---|
117 | Int getDeltaRIdxMinus1() { return m_deltaRIdxMinus1; } |
---|
118 | Void setDeltaRPS(Int x) { m_deltaRPS = x; } |
---|
119 | Int getDeltaRPS() { return m_deltaRPS; } |
---|
120 | Void setNumRefIdc(Int x) { m_numRefIdc = x; } |
---|
121 | Int getNumRefIdc() { return m_numRefIdc; } |
---|
122 | |
---|
123 | Void setRefIdc(Int bufferNum, Int refIdc); |
---|
124 | Int getRefIdc(Int bufferNum); |
---|
125 | |
---|
126 | Void sortDeltaPOC(); |
---|
127 | Void printDeltaPOC(); |
---|
128 | }; |
---|
129 | |
---|
130 | /// Reference Picture Set set class |
---|
131 | class TComRPSList |
---|
132 | { |
---|
133 | private: |
---|
134 | Int m_numberOfReferencePictureSets; |
---|
135 | TComReferencePictureSet* m_referencePictureSets; |
---|
136 | |
---|
137 | public: |
---|
138 | TComRPSList(); |
---|
139 | virtual ~TComRPSList(); |
---|
140 | |
---|
141 | Void create (Int numberOfEntries); |
---|
142 | Void destroy (); |
---|
143 | |
---|
144 | |
---|
145 | TComReferencePictureSet* getReferencePictureSet(Int referencePictureSetNum); |
---|
146 | Int getNumberOfReferencePictureSets(); |
---|
147 | Void setNumberOfReferencePictureSets(Int numberOfReferencePictureSets); |
---|
148 | }; |
---|
149 | |
---|
150 | /// SCALING_LIST class |
---|
151 | class TComScalingList |
---|
152 | { |
---|
153 | public: |
---|
154 | TComScalingList(); |
---|
155 | virtual ~TComScalingList(); |
---|
156 | Void setScalingListPresentFlag (Bool b) { m_scalingListPresentFlag = b; } |
---|
157 | Bool getScalingListPresentFlag () { return m_scalingListPresentFlag; } |
---|
158 | Int* getScalingListAddress (UInt sizeId, UInt listId) { return m_scalingListCoef[sizeId][listId]; } //!< get matrix coefficient |
---|
159 | Bool checkPredMode (UInt sizeId, UInt listId); |
---|
160 | Void setRefMatrixId (UInt sizeId, UInt listId, UInt u) { m_refMatrixId[sizeId][listId] = u; } //!< set reference matrix ID |
---|
161 | UInt getRefMatrixId (UInt sizeId, UInt listId) { return m_refMatrixId[sizeId][listId]; } //!< get reference matrix ID |
---|
162 | Int* getScalingListDefaultAddress (UInt sizeId, UInt listId); //!< get default matrix coefficient |
---|
163 | Void processDefaultMatrix (UInt sizeId, UInt listId); |
---|
164 | Void setScalingListDC (UInt sizeId, UInt listId, UInt u) { m_scalingListDC[sizeId][listId] = u; } //!< set DC value |
---|
165 | |
---|
166 | Int getScalingListDC (UInt sizeId, UInt listId) { return m_scalingListDC[sizeId][listId]; } //!< get DC value |
---|
167 | Void checkDcOfMatrix (); |
---|
168 | Void processRefMatrix (UInt sizeId, UInt listId , UInt refListId ); |
---|
169 | Bool xParseScalingList (Char* pchFile); |
---|
170 | |
---|
171 | private: |
---|
172 | Void init (); |
---|
173 | Void destroy (); |
---|
174 | Int m_scalingListDC [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< the DC value of the matrix coefficient for 16x16 |
---|
175 | Bool m_useDefaultScalingMatrixFlag [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< UseDefaultScalingMatrixFlag |
---|
176 | UInt m_refMatrixId [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< RefMatrixID |
---|
177 | Bool m_scalingListPresentFlag; //!< flag for using default matrix |
---|
178 | UInt m_predMatrixId [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< reference list index |
---|
179 | Int *m_scalingListCoef [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< quantization matrix |
---|
180 | }; |
---|
181 | |
---|
182 | class ProfileTierLevel |
---|
183 | { |
---|
184 | Int m_profileSpace; |
---|
185 | Bool m_tierFlag; |
---|
186 | Int m_profileIdc; |
---|
187 | Bool m_profileCompatibilityFlag[32]; |
---|
188 | Int m_levelIdc; |
---|
189 | |
---|
190 | Bool m_progressiveSourceFlag; |
---|
191 | Bool m_interlacedSourceFlag; |
---|
192 | Bool m_nonPackedConstraintFlag; |
---|
193 | Bool m_frameOnlyConstraintFlag; |
---|
194 | |
---|
195 | public: |
---|
196 | ProfileTierLevel(); |
---|
197 | |
---|
198 | Int getProfileSpace() const { return m_profileSpace; } |
---|
199 | Void setProfileSpace(Int x) { m_profileSpace = x; } |
---|
200 | |
---|
201 | Bool getTierFlag() const { return m_tierFlag; } |
---|
202 | Void setTierFlag(Bool x) { m_tierFlag = x; } |
---|
203 | |
---|
204 | Int getProfileIdc() const { return m_profileIdc; } |
---|
205 | Void setProfileIdc(Int x) { m_profileIdc = x; } |
---|
206 | |
---|
207 | Bool getProfileCompatibilityFlag(Int i) const { return m_profileCompatibilityFlag[i]; } |
---|
208 | Void setProfileCompatibilityFlag(Int i, Bool x) { m_profileCompatibilityFlag[i] = x; } |
---|
209 | |
---|
210 | Int getLevelIdc() const { return m_levelIdc; } |
---|
211 | Void setLevelIdc(Int x) { m_levelIdc = x; } |
---|
212 | |
---|
213 | Bool getProgressiveSourceFlag() const { return m_progressiveSourceFlag; } |
---|
214 | Void setProgressiveSourceFlag(Bool b) { m_progressiveSourceFlag = b; } |
---|
215 | |
---|
216 | Bool getInterlacedSourceFlag() const { return m_interlacedSourceFlag; } |
---|
217 | Void setInterlacedSourceFlag(Bool b) { m_interlacedSourceFlag = b; } |
---|
218 | |
---|
219 | Bool getNonPackedConstraintFlag() const { return m_nonPackedConstraintFlag; } |
---|
220 | Void setNonPackedConstraintFlag(Bool b) { m_nonPackedConstraintFlag = b; } |
---|
221 | |
---|
222 | Bool getFrameOnlyConstraintFlag() const { return m_frameOnlyConstraintFlag; } |
---|
223 | Void setFrameOnlyConstraintFlag(Bool b) { m_frameOnlyConstraintFlag = b; } |
---|
224 | #if VPS_EXTN_PROFILE_INFO |
---|
225 | Void copyProfileInfo(ProfileTierLevel *ptl); |
---|
226 | #endif |
---|
227 | }; |
---|
228 | |
---|
229 | |
---|
230 | class TComPTL |
---|
231 | { |
---|
232 | ProfileTierLevel m_generalPTL; |
---|
233 | ProfileTierLevel m_subLayerPTL [MAX_TLAYER-1]; // max. value of max_sub_layers_minus1 is MAX_TLAYER-1 (= 6) |
---|
234 | Bool m_subLayerProfilePresentFlag [MAX_TLAYER-1]; |
---|
235 | Bool m_subLayerLevelPresentFlag [MAX_TLAYER-1]; |
---|
236 | |
---|
237 | public: |
---|
238 | TComPTL(); |
---|
239 | Bool getSubLayerProfilePresentFlag(Int i) const { return m_subLayerProfilePresentFlag[i]; } |
---|
240 | Void setSubLayerProfilePresentFlag(Int i, Bool x) { m_subLayerProfilePresentFlag[i] = x; } |
---|
241 | |
---|
242 | Bool getSubLayerLevelPresentFlag(Int i) const { return m_subLayerLevelPresentFlag[i]; } |
---|
243 | Void setSubLayerLevelPresentFlag(Int i, Bool x) { m_subLayerLevelPresentFlag[i] = x; } |
---|
244 | |
---|
245 | ProfileTierLevel* getGeneralPTL() { return &m_generalPTL; } |
---|
246 | ProfileTierLevel* getSubLayerPTL(Int i) { return &m_subLayerPTL[i]; } |
---|
247 | #if VPS_EXTN_PROFILE_INFO |
---|
248 | Void copyProfileInfo(TComPTL *ptl); |
---|
249 | #endif |
---|
250 | }; |
---|
251 | /// VPS class |
---|
252 | |
---|
253 | struct HrdSubLayerInfo |
---|
254 | { |
---|
255 | Bool fixedPicRateFlag; |
---|
256 | Bool fixedPicRateWithinCvsFlag; |
---|
257 | UInt picDurationInTcMinus1; |
---|
258 | Bool lowDelayHrdFlag; |
---|
259 | UInt cpbCntMinus1; |
---|
260 | UInt bitRateValueMinus1[MAX_CPB_CNT][2]; |
---|
261 | UInt cpbSizeValue [MAX_CPB_CNT][2]; |
---|
262 | UInt ducpbSizeValue [MAX_CPB_CNT][2]; |
---|
263 | UInt cbrFlag [MAX_CPB_CNT][2]; |
---|
264 | UInt duBitRateValue [MAX_CPB_CNT][2]; |
---|
265 | }; |
---|
266 | |
---|
267 | class TComHRD |
---|
268 | { |
---|
269 | private: |
---|
270 | Bool m_nalHrdParametersPresentFlag; |
---|
271 | Bool m_vclHrdParametersPresentFlag; |
---|
272 | Bool m_subPicCpbParamsPresentFlag; |
---|
273 | UInt m_tickDivisorMinus2; |
---|
274 | UInt m_duCpbRemovalDelayLengthMinus1; |
---|
275 | Bool m_subPicCpbParamsInPicTimingSEIFlag; |
---|
276 | UInt m_dpbOutputDelayDuLengthMinus1; |
---|
277 | UInt m_bitRateScale; |
---|
278 | UInt m_cpbSizeScale; |
---|
279 | UInt m_ducpbSizeScale; |
---|
280 | UInt m_initialCpbRemovalDelayLengthMinus1; |
---|
281 | UInt m_cpbRemovalDelayLengthMinus1; |
---|
282 | UInt m_dpbOutputDelayLengthMinus1; |
---|
283 | UInt m_numDU; |
---|
284 | HrdSubLayerInfo m_HRD[MAX_TLAYER]; |
---|
285 | |
---|
286 | public: |
---|
287 | TComHRD() |
---|
288 | :m_nalHrdParametersPresentFlag(0) |
---|
289 | ,m_vclHrdParametersPresentFlag(0) |
---|
290 | ,m_subPicCpbParamsPresentFlag(false) |
---|
291 | ,m_tickDivisorMinus2(0) |
---|
292 | ,m_duCpbRemovalDelayLengthMinus1(0) |
---|
293 | ,m_subPicCpbParamsInPicTimingSEIFlag(false) |
---|
294 | ,m_dpbOutputDelayDuLengthMinus1(0) |
---|
295 | ,m_bitRateScale(0) |
---|
296 | ,m_cpbSizeScale(0) |
---|
297 | ,m_initialCpbRemovalDelayLengthMinus1(0) |
---|
298 | ,m_cpbRemovalDelayLengthMinus1(0) |
---|
299 | ,m_dpbOutputDelayLengthMinus1(0) |
---|
300 | {} |
---|
301 | |
---|
302 | virtual ~TComHRD() {} |
---|
303 | |
---|
304 | Void setNalHrdParametersPresentFlag ( Bool flag ) { m_nalHrdParametersPresentFlag = flag; } |
---|
305 | Bool getNalHrdParametersPresentFlag ( ) { return m_nalHrdParametersPresentFlag; } |
---|
306 | |
---|
307 | Void setVclHrdParametersPresentFlag ( Bool flag ) { m_vclHrdParametersPresentFlag = flag; } |
---|
308 | Bool getVclHrdParametersPresentFlag ( ) { return m_vclHrdParametersPresentFlag; } |
---|
309 | |
---|
310 | Void setSubPicCpbParamsPresentFlag ( Bool flag ) { m_subPicCpbParamsPresentFlag = flag; } |
---|
311 | Bool getSubPicCpbParamsPresentFlag ( ) { return m_subPicCpbParamsPresentFlag; } |
---|
312 | |
---|
313 | Void setTickDivisorMinus2 ( UInt value ) { m_tickDivisorMinus2 = value; } |
---|
314 | UInt getTickDivisorMinus2 ( ) { return m_tickDivisorMinus2; } |
---|
315 | |
---|
316 | Void setDuCpbRemovalDelayLengthMinus1 ( UInt value ) { m_duCpbRemovalDelayLengthMinus1 = value; } |
---|
317 | UInt getDuCpbRemovalDelayLengthMinus1 ( ) { return m_duCpbRemovalDelayLengthMinus1; } |
---|
318 | |
---|
319 | Void setSubPicCpbParamsInPicTimingSEIFlag ( Bool flag) { m_subPicCpbParamsInPicTimingSEIFlag = flag; } |
---|
320 | Bool getSubPicCpbParamsInPicTimingSEIFlag () { return m_subPicCpbParamsInPicTimingSEIFlag; } |
---|
321 | |
---|
322 | Void setDpbOutputDelayDuLengthMinus1 (UInt value ) { m_dpbOutputDelayDuLengthMinus1 = value; } |
---|
323 | UInt getDpbOutputDelayDuLengthMinus1 () { return m_dpbOutputDelayDuLengthMinus1; } |
---|
324 | |
---|
325 | Void setBitRateScale ( UInt value ) { m_bitRateScale = value; } |
---|
326 | UInt getBitRateScale ( ) { return m_bitRateScale; } |
---|
327 | |
---|
328 | Void setCpbSizeScale ( UInt value ) { m_cpbSizeScale = value; } |
---|
329 | UInt getCpbSizeScale ( ) { return m_cpbSizeScale; } |
---|
330 | Void setDuCpbSizeScale ( UInt value ) { m_ducpbSizeScale = value; } |
---|
331 | UInt getDuCpbSizeScale ( ) { return m_ducpbSizeScale; } |
---|
332 | |
---|
333 | Void setInitialCpbRemovalDelayLengthMinus1( UInt value ) { m_initialCpbRemovalDelayLengthMinus1 = value; } |
---|
334 | UInt getInitialCpbRemovalDelayLengthMinus1( ) { return m_initialCpbRemovalDelayLengthMinus1; } |
---|
335 | |
---|
336 | Void setCpbRemovalDelayLengthMinus1 ( UInt value ) { m_cpbRemovalDelayLengthMinus1 = value; } |
---|
337 | UInt getCpbRemovalDelayLengthMinus1 ( ) { return m_cpbRemovalDelayLengthMinus1; } |
---|
338 | |
---|
339 | Void setDpbOutputDelayLengthMinus1 ( UInt value ) { m_dpbOutputDelayLengthMinus1 = value; } |
---|
340 | UInt getDpbOutputDelayLengthMinus1 ( ) { return m_dpbOutputDelayLengthMinus1; } |
---|
341 | |
---|
342 | Void setFixedPicRateFlag ( Int layer, Bool flag ) { m_HRD[layer].fixedPicRateFlag = flag; } |
---|
343 | Bool getFixedPicRateFlag ( Int layer ) { return m_HRD[layer].fixedPicRateFlag; } |
---|
344 | |
---|
345 | Void setFixedPicRateWithinCvsFlag ( Int layer, Bool flag ) { m_HRD[layer].fixedPicRateWithinCvsFlag = flag; } |
---|
346 | Bool getFixedPicRateWithinCvsFlag ( Int layer ) { return m_HRD[layer].fixedPicRateWithinCvsFlag; } |
---|
347 | |
---|
348 | Void setPicDurationInTcMinus1 ( Int layer, UInt value ) { m_HRD[layer].picDurationInTcMinus1 = value; } |
---|
349 | UInt getPicDurationInTcMinus1 ( Int layer ) { return m_HRD[layer].picDurationInTcMinus1; } |
---|
350 | |
---|
351 | Void setLowDelayHrdFlag ( Int layer, Bool flag ) { m_HRD[layer].lowDelayHrdFlag = flag; } |
---|
352 | Bool getLowDelayHrdFlag ( Int layer ) { return m_HRD[layer].lowDelayHrdFlag; } |
---|
353 | |
---|
354 | Void setCpbCntMinus1 ( Int layer, UInt value ) { m_HRD[layer].cpbCntMinus1 = value; } |
---|
355 | UInt getCpbCntMinus1 ( Int layer ) { return m_HRD[layer].cpbCntMinus1; } |
---|
356 | |
---|
357 | Void setBitRateValueMinus1 ( Int layer, Int cpbcnt, Int nalOrVcl, UInt value ) { m_HRD[layer].bitRateValueMinus1[cpbcnt][nalOrVcl] = value; } |
---|
358 | UInt getBitRateValueMinus1 ( Int layer, Int cpbcnt, Int nalOrVcl ) { return m_HRD[layer].bitRateValueMinus1[cpbcnt][nalOrVcl]; } |
---|
359 | |
---|
360 | Void setCpbSizeValueMinus1 ( Int layer, Int cpbcnt, Int nalOrVcl, UInt value ) { m_HRD[layer].cpbSizeValue[cpbcnt][nalOrVcl] = value; } |
---|
361 | UInt getCpbSizeValueMinus1 ( Int layer, Int cpbcnt, Int nalOrVcl ) { return m_HRD[layer].cpbSizeValue[cpbcnt][nalOrVcl]; } |
---|
362 | Void setDuCpbSizeValueMinus1 ( Int layer, Int cpbcnt, Int nalOrVcl, UInt value ) { m_HRD[layer].ducpbSizeValue[cpbcnt][nalOrVcl] = value; } |
---|
363 | UInt getDuCpbSizeValueMinus1 ( Int layer, Int cpbcnt, Int nalOrVcl ) { return m_HRD[layer].ducpbSizeValue[cpbcnt][nalOrVcl]; } |
---|
364 | Void setDuBitRateValueMinus1 ( Int layer, Int cpbcnt, Int nalOrVcl, UInt value ) { m_HRD[layer].duBitRateValue[cpbcnt][nalOrVcl] = value; } |
---|
365 | UInt getDuBitRateValueMinus1 (Int layer, Int cpbcnt, Int nalOrVcl ) { return m_HRD[layer].duBitRateValue[cpbcnt][nalOrVcl]; } |
---|
366 | Void setCbrFlag ( Int layer, Int cpbcnt, Int nalOrVcl, UInt value ) { m_HRD[layer].cbrFlag[cpbcnt][nalOrVcl] = value; } |
---|
367 | Bool getCbrFlag ( Int layer, Int cpbcnt, Int nalOrVcl ) { return m_HRD[layer].cbrFlag[cpbcnt][nalOrVcl]; } |
---|
368 | |
---|
369 | Void setNumDU ( UInt value ) { m_numDU = value; } |
---|
370 | UInt getNumDU ( ) { return m_numDU; } |
---|
371 | Bool getCpbDpbDelaysPresentFlag() { return getNalHrdParametersPresentFlag() || getVclHrdParametersPresentFlag(); } |
---|
372 | }; |
---|
373 | |
---|
374 | class TimingInfo |
---|
375 | { |
---|
376 | Bool m_timingInfoPresentFlag; |
---|
377 | UInt m_numUnitsInTick; |
---|
378 | UInt m_timeScale; |
---|
379 | Bool m_pocProportionalToTimingFlag; |
---|
380 | Int m_numTicksPocDiffOneMinus1; |
---|
381 | public: |
---|
382 | TimingInfo() |
---|
383 | : m_timingInfoPresentFlag(false) |
---|
384 | , m_numUnitsInTick(1001) |
---|
385 | , m_timeScale(60000) |
---|
386 | , m_pocProportionalToTimingFlag(false) |
---|
387 | , m_numTicksPocDiffOneMinus1(0) {} |
---|
388 | |
---|
389 | Void setTimingInfoPresentFlag ( Bool flag ) { m_timingInfoPresentFlag = flag; } |
---|
390 | Bool getTimingInfoPresentFlag ( ) { return m_timingInfoPresentFlag; } |
---|
391 | |
---|
392 | Void setNumUnitsInTick ( UInt value ) { m_numUnitsInTick = value; } |
---|
393 | UInt getNumUnitsInTick ( ) { return m_numUnitsInTick; } |
---|
394 | |
---|
395 | Void setTimeScale ( UInt value ) { m_timeScale = value; } |
---|
396 | UInt getTimeScale ( ) { return m_timeScale; } |
---|
397 | |
---|
398 | Bool getPocProportionalToTimingFlag ( ) { return m_pocProportionalToTimingFlag; } |
---|
399 | Void setPocProportionalToTimingFlag (Bool x ) { m_pocProportionalToTimingFlag = x; } |
---|
400 | |
---|
401 | Int getNumTicksPocDiffOneMinus1 ( ) { return m_numTicksPocDiffOneMinus1; } |
---|
402 | Void setNumTicksPocDiffOneMinus1 (Int x ) { m_numTicksPocDiffOneMinus1 = x; } |
---|
403 | }; |
---|
404 | |
---|
405 | #if REPN_FORMAT_IN_VPS |
---|
406 | class RepFormat |
---|
407 | { |
---|
408 | #if REPN_FORMAT_CONTROL_FLAG |
---|
409 | Bool m_chromaAndBitDepthVpsPresentFlag; |
---|
410 | #endif |
---|
411 | #if AUXILIARY_PICTURES |
---|
412 | ChromaFormat m_chromaFormatVpsIdc; |
---|
413 | #else |
---|
414 | Int m_chromaFormatVpsIdc; |
---|
415 | #endif |
---|
416 | Bool m_separateColourPlaneVpsFlag; |
---|
417 | Int m_picWidthVpsInLumaSamples; |
---|
418 | Int m_picHeightVpsInLumaSamples; |
---|
419 | Int m_bitDepthVpsLuma; // coded as minus8 |
---|
420 | Int m_bitDepthVpsChroma; // coded as minus8 |
---|
421 | |
---|
422 | public: |
---|
423 | RepFormat(); |
---|
424 | #if RESOLUTION_BASED_DPB |
---|
425 | Void init(); |
---|
426 | RepFormat& operator= (const RepFormat &); |
---|
427 | static Bool checkSameSubDpb(const RepFormat &x, const RepFormat &y); |
---|
428 | #endif |
---|
429 | #if REPN_FORMAT_CONTROL_FLAG |
---|
430 | Bool getChromaAndBitDepthVpsPresentFlag() { return m_chromaAndBitDepthVpsPresentFlag; } |
---|
431 | void setChromaAndBitDepthVpsPresentFlag(Bool x) { m_chromaAndBitDepthVpsPresentFlag = x; } |
---|
432 | #endif |
---|
433 | |
---|
434 | #if AUXILIARY_PICTURES |
---|
435 | ChromaFormat getChromaFormatVpsIdc() { return m_chromaFormatVpsIdc; } |
---|
436 | Void setChromaFormatVpsIdc(ChromaFormat x) { m_chromaFormatVpsIdc = x; } |
---|
437 | #else |
---|
438 | Int getChromaFormatVpsIdc() { return m_chromaFormatVpsIdc; } |
---|
439 | Void setChromaFormatVpsIdc(Int x) { m_chromaFormatVpsIdc = x; } |
---|
440 | #endif |
---|
441 | |
---|
442 | Bool getSeparateColourPlaneVpsFlag() { return m_separateColourPlaneVpsFlag; } |
---|
443 | Void setSeparateColourPlaneVpsFlag(Bool x) { m_separateColourPlaneVpsFlag = x; } |
---|
444 | |
---|
445 | Int getPicWidthVpsInLumaSamples() { return m_picWidthVpsInLumaSamples; } |
---|
446 | Void setPicWidthVpsInLumaSamples(Int x) { m_picWidthVpsInLumaSamples = x; } |
---|
447 | |
---|
448 | Int getPicHeightVpsInLumaSamples() { return m_picHeightVpsInLumaSamples; } |
---|
449 | Void setPicHeightVpsInLumaSamples(Int x) { m_picHeightVpsInLumaSamples = x; } |
---|
450 | |
---|
451 | Int getBitDepthVpsLuma() { return m_bitDepthVpsLuma; } |
---|
452 | Void setBitDepthVpsLuma(Int x) { m_bitDepthVpsLuma = x; } |
---|
453 | |
---|
454 | Int getBitDepthVpsChroma() { return m_bitDepthVpsChroma; } |
---|
455 | Void setBitDepthVpsChroma(Int x) { m_bitDepthVpsChroma = x; } |
---|
456 | }; |
---|
457 | #endif |
---|
458 | class TComVPS |
---|
459 | { |
---|
460 | private: |
---|
461 | Int m_VPSId; |
---|
462 | UInt m_uiMaxTLayers; |
---|
463 | UInt m_uiMaxLayers; |
---|
464 | Bool m_bTemporalIdNestingFlag; |
---|
465 | |
---|
466 | UInt m_numReorderPics[MAX_TLAYER]; |
---|
467 | UInt m_uiMaxDecPicBuffering[MAX_TLAYER]; |
---|
468 | UInt m_uiMaxLatencyIncrease[MAX_TLAYER]; // Really max latency increase plus 1 (value 0 expresses no limit) |
---|
469 | |
---|
470 | UInt m_numHrdParameters; |
---|
471 | #if !VPS_RENAME |
---|
472 | UInt m_maxNuhReservedZeroLayerId; |
---|
473 | #endif |
---|
474 | TComHRD* m_hrdParameters; |
---|
475 | UInt* m_hrdOpSetIdx; |
---|
476 | Bool* m_cprmsPresentFlag; |
---|
477 | #if !SVC_EXTENSION |
---|
478 | UInt m_numOpSets; |
---|
479 | Bool m_layerIdIncludedFlag[MAX_VPS_OP_SETS_PLUS1][MAX_VPS_NUH_RESERVED_ZERO_LAYER_ID_PLUS1]; |
---|
480 | #endif |
---|
481 | TComPTL m_pcPTL; |
---|
482 | TimingInfo m_timingInfo; |
---|
483 | |
---|
484 | #if SVC_EXTENSION |
---|
485 | #if DERIVE_LAYER_ID_LIST_VARIABLES |
---|
486 | Int m_layerSetLayerIdList[MAX_VPS_LAYER_SETS_PLUS1][MAX_VPS_LAYER_ID_PLUS1]; |
---|
487 | Int m_numLayerInIdList[MAX_VPS_LAYER_SETS_PLUS1]; |
---|
488 | #endif |
---|
489 | #if !P0125_REVERT_VPS_EXTN_OFFSET_TO_RESERVED |
---|
490 | #if VPS_EXTN_OFFSET |
---|
491 | UInt m_extensionOffset; |
---|
492 | #endif |
---|
493 | #endif |
---|
494 | #if VPS_RENAME |
---|
495 | UInt m_maxLayerId; |
---|
496 | UInt m_numLayerSets; |
---|
497 | Bool m_layerIdIncludedFlag[MAX_VPS_LAYER_SETS_PLUS1][MAX_VPS_LAYER_ID_PLUS1]; |
---|
498 | #endif |
---|
499 | |
---|
500 | // ------------------------------------------ |
---|
501 | // Variables related to VPS extensions |
---|
502 | // ------------------------------------------ |
---|
503 | #if VPS_EXTN_MASK_AND_DIM_INFO |
---|
504 | Bool m_avcBaseLayerFlag; // For now, always set to true. |
---|
505 | Bool m_splittingFlag; |
---|
506 | Bool m_scalabilityMask[MAX_VPS_NUM_SCALABILITY_TYPES]; |
---|
507 | UInt m_dimensionIdLen[MAX_VPS_NUM_SCALABILITY_TYPES]; |
---|
508 | Bool m_nuhLayerIdPresentFlag; |
---|
509 | UInt m_layerIdInNuh[MAX_VPS_LAYER_ID_PLUS1]; // Maps layer ID in the VPS with layer_id_in_nuh |
---|
510 | UInt m_dimensionId[MAX_VPS_LAYER_ID_PLUS1][MAX_VPS_NUM_SCALABILITY_TYPES]; |
---|
511 | |
---|
512 | // Below are derived variables |
---|
513 | UInt m_numScalabilityTypes; |
---|
514 | UInt m_layerIdInVps[MAX_VPS_LAYER_ID_PLUS1]; // Maps layer_id_in_nuh with the layer ID in the VPS |
---|
515 | #endif |
---|
516 | #if BITRATE_PICRATE_SIGNALLING |
---|
517 | UInt m_maxSLInLayerSetMinus1[MAX_VPS_LAYER_SETS_PLUS1]; |
---|
518 | #endif |
---|
519 | |
---|
520 | #if ILP_SSH_SIG |
---|
521 | Bool m_ilpSshSignalingEnabledFlag; |
---|
522 | #endif |
---|
523 | #if VPS_EXTN_PROFILE_INFO |
---|
524 | // Profile-tier-level signalling related |
---|
525 | Bool m_profilePresentFlag[MAX_VPS_LAYER_SETS_PLUS1]; // The value with index 0 will not be used. |
---|
526 | #if !P0048_REMOVE_PROFILE_REF |
---|
527 | UInt m_profileLayerSetRef[MAX_VPS_LAYER_SETS_PLUS1]; // The value with index 0 will not be used. |
---|
528 | #endif |
---|
529 | std::vector<TComPTL> m_pcPTLForExtn; |
---|
530 | #endif |
---|
531 | #if VPS_EXTN_OP_LAYER_SETS |
---|
532 | // .. More declarations here |
---|
533 | // Target output layer signalling related |
---|
534 | UInt m_numOutputLayerSets; |
---|
535 | UInt m_outputLayerSetIdx[MAX_VPS_LAYER_SETS_PLUS1]; |
---|
536 | Bool m_outputLayerFlag[MAX_VPS_LAYER_SETS_PLUS1][MAX_VPS_LAYER_ID_PLUS1]; |
---|
537 | #endif |
---|
538 | #if VPS_EXTN_DIRECT_REF_LAYERS |
---|
539 | Bool m_directDependencyFlag[MAX_VPS_LAYER_ID_PLUS1][MAX_VPS_LAYER_ID_PLUS1]; |
---|
540 | UInt m_numDirectRefLayers[MAX_VPS_LAYER_ID_PLUS1]; |
---|
541 | UInt m_refLayerId[MAX_VPS_LAYER_ID_PLUS1][MAX_VPS_LAYER_ID_PLUS1]; |
---|
542 | UInt m_directDepTypeLen; |
---|
543 | #if O0096_DEFAULT_DEPENDENCY_TYPE |
---|
544 | Bool m_defaultDirectDependencyTypeFlag; |
---|
545 | UInt m_defaultDirectDependencyType; |
---|
546 | #endif |
---|
547 | UInt m_directDependencyType[MAX_VPS_LAYER_ID_PLUS1][MAX_VPS_LAYER_ID_PLUS1]; |
---|
548 | #endif |
---|
549 | UInt m_numProfileTierLevel; |
---|
550 | #if !VPS_EXTN_UEV_CODING |
---|
551 | Bool m_moreOutputLayerSetsThanDefaultFlag; |
---|
552 | #endif |
---|
553 | Int m_numAddOutputLayerSets; |
---|
554 | #if P0295_DEFAULT_OUT_LAYER_IDC |
---|
555 | UInt m_defaultTargetOutputLayerIdc; |
---|
556 | #else |
---|
557 | #if O0109_DEFAULT_ONE_OUT_LAYER_IDC |
---|
558 | UInt m_defaultOneTargetOutputLayerIdc; |
---|
559 | #else |
---|
560 | Bool m_defaultOneTargetOutputLayerFlag; |
---|
561 | #endif |
---|
562 | #endif |
---|
563 | Int m_profileLevelTierIdx[64]; |
---|
564 | Bool m_maxOneActiveRefLayerFlag; |
---|
565 | #if O0062_POC_LSB_NOT_PRESENT_FLAG |
---|
566 | Bool m_pocLsbNotPresentFlag[MAX_VPS_LAYER_ID_PLUS1]; |
---|
567 | #endif |
---|
568 | #if O0223_PICTURE_TYPES_ALIGN_FLAG |
---|
569 | Bool m_crossLayerPictureTypeAlignFlag; |
---|
570 | #endif |
---|
571 | #if N0147_IRAP_ALIGN_FLAG |
---|
572 | Bool m_crossLayerIrapAlignFlag; |
---|
573 | #endif |
---|
574 | #if P0068_CROSS_LAYER_ALIGNED_IDR_ONLY_FOR_IRAP_FLAG |
---|
575 | Bool m_crossLayerAlignedIdrOnlyFlag; |
---|
576 | #endif |
---|
577 | #if O0225_MAX_TID_FOR_REF_LAYERS |
---|
578 | UInt m_maxTidIlRefPicsPlus1[MAX_VPS_LAYER_ID_PLUS1 - 1][MAX_VPS_LAYER_ID_PLUS1]; |
---|
579 | #else |
---|
580 | UInt m_maxTidIlRefPicsPlus1[MAX_VPS_LAYER_ID_PLUS1 - 1]; |
---|
581 | #endif |
---|
582 | Bool m_maxTidRefPresentFlag; |
---|
583 | #if VPS_TSLAYERS |
---|
584 | Bool m_maxTSLayersPresentFlag; |
---|
585 | UInt m_maxTSLayerMinus1[MAX_LAYERS]; |
---|
586 | #endif |
---|
587 | #if M0040_ADAPTIVE_RESOLUTION_CHANGE |
---|
588 | Bool m_singleLayerForNonIrapFlag; |
---|
589 | #endif |
---|
590 | #if HIGHER_LAYER_IRAP_SKIP_FLAG |
---|
591 | Bool m_higherLayerIrapSkipFlag; |
---|
592 | #endif |
---|
593 | #if VPS_VUI_TILES_NOT_IN_USE__FLAG |
---|
594 | Bool m_tilesNotInUseFlag; |
---|
595 | Bool m_tilesInUseFlag[MAX_VPS_LAYER_ID_PLUS1]; |
---|
596 | Bool m_loopFilterNotAcrossTilesFlag[MAX_VPS_LAYER_ID_PLUS1]; |
---|
597 | #endif |
---|
598 | #if TILE_BOUNDARY_ALIGNED_FLAG |
---|
599 | Bool m_tileBoundariesAlignedFlag[MAX_VPS_LAYER_ID_PLUS1][MAX_VPS_LAYER_ID_PLUS1]; |
---|
600 | #endif |
---|
601 | #if VPS_VUI_WPP_NOT_IN_USE__FLAG |
---|
602 | Bool m_wppNotInUseFlag; |
---|
603 | Bool m_wppInUseFlag[MAX_VPS_LAYER_ID_PLUS1]; |
---|
604 | #endif |
---|
605 | #if N0160_VUI_EXT_ILP_REF |
---|
606 | Bool m_ilpRestrictedRefLayersFlag; |
---|
607 | Int m_minSpatialSegmentOffsetPlus1[MAX_VPS_LAYER_ID_PLUS1][MAX_VPS_LAYER_ID_PLUS1]; |
---|
608 | Bool m_ctuBasedOffsetEnabledFlag [MAX_VPS_LAYER_ID_PLUS1][MAX_VPS_LAYER_ID_PLUS1]; |
---|
609 | Int m_minHorizontalCtuOffsetPlus1 [MAX_VPS_LAYER_ID_PLUS1][MAX_VPS_LAYER_ID_PLUS1]; |
---|
610 | #endif |
---|
611 | #if VPS_VUI_VIDEO_SIGNAL |
---|
612 | Bool m_vidSigPresentVpsFlag; |
---|
613 | Int m_vpsVidSigInfo; |
---|
614 | Int m_vpsVidSigIdx[MAX_VPS_LAYER_ID_PLUS1]; |
---|
615 | Int m_vpsVidFormat[16]; |
---|
616 | Bool m_vpsFullRangeFlag[16]; |
---|
617 | Int m_vpsColorPrimaries[16]; |
---|
618 | Int m_vpsTransChar[16]; |
---|
619 | Int m_vpsMatCoeff[16]; |
---|
620 | #endif |
---|
621 | #if VPS_VUI_BITRATE_PICRATE |
---|
622 | Bool m_bitRatePresentVpsFlag; |
---|
623 | Bool m_picRatePresentVpsFlag; |
---|
624 | Bool m_bitRatePresentFlag [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER]; |
---|
625 | Bool m_picRatePresentFlag [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER]; |
---|
626 | Int m_avgBitRate [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER]; |
---|
627 | Int m_maxBitRate [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER]; |
---|
628 | Int m_constPicRateIdc [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER]; |
---|
629 | Int m_avgPicRate [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER]; |
---|
630 | #endif |
---|
631 | |
---|
632 | #if P0312_VERT_PHASE_ADJ |
---|
633 | Bool m_vpsVuiVertPhaseInUseFlag; |
---|
634 | #endif |
---|
635 | |
---|
636 | #if P0300_ALT_OUTPUT_LAYER_FLAG |
---|
637 | Bool m_altOutputLayerFlag[MAX_VPS_LAYER_SETS_PLUS1]; |
---|
638 | #else |
---|
639 | #if O0153_ALT_OUTPUT_LAYER_FLAG |
---|
640 | Bool m_altOutputLayerFlag; |
---|
641 | #endif |
---|
642 | #endif |
---|
643 | #if REPN_FORMAT_IN_VPS |
---|
644 | Bool m_repFormatIdxPresentFlag; |
---|
645 | Int m_vpsNumRepFormats; // coded as minus1 |
---|
646 | RepFormat m_vpsRepFormat[16]; |
---|
647 | Int m_vpsRepFormatIdx[16]; |
---|
648 | #endif |
---|
649 | #if VIEW_ID_RELATED_SIGNALING |
---|
650 | #if O0109_VIEW_ID_LEN |
---|
651 | Int m_viewIdLen; |
---|
652 | #else |
---|
653 | Int m_viewIdLenMinus1; |
---|
654 | #endif |
---|
655 | Int m_viewIdVal [MAX_LAYERS]; |
---|
656 | #endif |
---|
657 | |
---|
658 | #if O0215_PHASE_ALIGNMENT |
---|
659 | Bool m_phaseAlignFlag; |
---|
660 | #endif |
---|
661 | |
---|
662 | #if O0092_0094_DEPENDENCY_CONSTRAINT |
---|
663 | Int m_numberRefLayers[MAX_NUM_LAYER_IDS]; // number of direct and indirect reference layers of a coding layer |
---|
664 | Bool m_recursiveRefLayerFlag[MAX_NUM_LAYER_IDS][MAX_NUM_LAYER_IDS]; // flag to indicate if j-th layer is a direct or indirect reference layer of i-th layer |
---|
665 | #endif |
---|
666 | #if SPS_DPB_PARAMS |
---|
667 | Int m_TolsIdx; |
---|
668 | #endif |
---|
669 | #if VPS_DPB_SIZE_TABLE |
---|
670 | Bool m_subLayerFlagInfoPresentFlag [MAX_VPS_OP_LAYER_SETS_PLUS1]; |
---|
671 | Bool m_subLayerDpbInfoPresentFlag [MAX_VPS_OP_LAYER_SETS_PLUS1][MAX_LAYERS]; |
---|
672 | Int m_maxVpsDecPicBufferingMinus1 [MAX_VPS_OP_LAYER_SETS_PLUS1][MAX_LAYERS][MAX_TLAYER]; |
---|
673 | #if RESOLUTION_BASED_DPB |
---|
674 | Int m_maxVpsLayerDecPicBuffMinus1 [MAX_VPS_OP_LAYER_SETS_PLUS1][MAX_LAYERS][MAX_TLAYER]; |
---|
675 | #endif |
---|
676 | Int m_maxVpsNumReorderPics [MAX_VPS_OP_LAYER_SETS_PLUS1][MAX_LAYERS]; |
---|
677 | Int m_maxVpsLatencyIncreasePlus1 [MAX_VPS_OP_LAYER_SETS_PLUS1][MAX_LAYERS]; |
---|
678 | #if CHANGE_NUMSUBDPB_IDX |
---|
679 | Int m_numSubDpbs [MAX_VPS_LAYER_SETS_PLUS1]; |
---|
680 | #else |
---|
681 | Int m_numSubDpbs [MAX_VPS_OP_LAYER_SETS_PLUS1]; |
---|
682 | #endif |
---|
683 | #endif |
---|
684 | |
---|
685 | #if O0109_MOVE_VPS_VUI_FLAG |
---|
686 | Bool m_vpsVuiPresentFlag; |
---|
687 | #endif |
---|
688 | Bool m_vpsExtensionFlag; |
---|
689 | |
---|
690 | #if O0164_MULTI_LAYER_HRD |
---|
691 | Bool m_vpsVuiBspHrdPresentFlag; |
---|
692 | UInt m_vpsNumBspHrdParametersMinus1; |
---|
693 | Bool m_bspCprmsPresentFlag[MAX_VPS_LAYER_SETS_PLUS1]; |
---|
694 | TComHRD *m_bspHrd; |
---|
695 | UInt m_numBitstreamPartitions[MAX_VPS_LAYER_SETS_PLUS1]; |
---|
696 | Bool m_layerInBspFlag[MAX_VPS_LAYER_SETS_PLUS1][8][MAX_LAYERS]; |
---|
697 | UInt m_numBspSchedCombinations[MAX_VPS_LAYER_SETS_PLUS1]; |
---|
698 | UInt m_bspCombHrdIdx[MAX_VPS_LAYER_SETS_PLUS1][16][16]; |
---|
699 | UInt m_bspCombSchedIdx[MAX_VPS_LAYER_SETS_PLUS1][16][16]; |
---|
700 | #endif |
---|
701 | |
---|
702 | #if P0182_VPS_VUI_PS_FLAG |
---|
703 | UInt m_SPSId[MAX_LAYERS]; |
---|
704 | UInt m_PPSId[MAX_LAYERS]; |
---|
705 | UInt m_baseLayerPSCompatibilityFlag[MAX_LAYERS]; |
---|
706 | #endif |
---|
707 | |
---|
708 | #if !P0307_REMOVE_VPS_VUI_OFFSET |
---|
709 | #if VPS_VUI_OFFSET |
---|
710 | Int m_vpsVuiOffset; |
---|
711 | #endif |
---|
712 | #endif |
---|
713 | #if P0307_VPS_NON_VUI_EXTENSION |
---|
714 | Int m_vpsNonVuiExtLength; |
---|
715 | #endif |
---|
716 | #if RESOLUTION_BASED_DPB |
---|
717 | Int m_subDpbAssigned [MAX_VPS_LAYER_SETS_PLUS1][MAX_LAYERS]; |
---|
718 | #endif |
---|
719 | #endif //SVC_EXTENSION |
---|
720 | public: |
---|
721 | TComVPS(); |
---|
722 | virtual ~TComVPS(); |
---|
723 | |
---|
724 | Void createHrdParamBuffer() |
---|
725 | { |
---|
726 | m_hrdParameters = new TComHRD[ getNumHrdParameters() ]; |
---|
727 | m_hrdOpSetIdx = new UInt [ getNumHrdParameters() ]; |
---|
728 | m_cprmsPresentFlag = new Bool [ getNumHrdParameters() ]; |
---|
729 | } |
---|
730 | |
---|
731 | #if O0164_MULTI_LAYER_HRD |
---|
732 | Void createBspHrdParamBuffer(UInt numHrds) |
---|
733 | { |
---|
734 | m_bspHrd = new TComHRD[ numHrds ]; |
---|
735 | // m_hrdOpSetIdx = new UInt [ getNumHrdParameters() ]; |
---|
736 | // m_cprmsPresentFlag = new Bool [ getNumHrdParameters() ]; |
---|
737 | } |
---|
738 | #endif |
---|
739 | |
---|
740 | TComHRD* getHrdParameters ( UInt i ) { return &m_hrdParameters[ i ]; } |
---|
741 | UInt getHrdOpSetIdx ( UInt i ) { return m_hrdOpSetIdx[ i ]; } |
---|
742 | Void setHrdOpSetIdx ( UInt val, UInt i ) { m_hrdOpSetIdx[ i ] = val; } |
---|
743 | Bool getCprmsPresentFlag ( UInt i ) { return m_cprmsPresentFlag[ i ]; } |
---|
744 | Void setCprmsPresentFlag ( Bool val, UInt i ) { m_cprmsPresentFlag[ i ] = val; } |
---|
745 | |
---|
746 | Int getVPSId () { return m_VPSId; } |
---|
747 | Void setVPSId (Int i) { m_VPSId = i; } |
---|
748 | |
---|
749 | UInt getMaxTLayers () { return m_uiMaxTLayers; } |
---|
750 | Void setMaxTLayers (UInt t) { m_uiMaxTLayers = t; } |
---|
751 | |
---|
752 | UInt getMaxLayers () { return m_uiMaxLayers; } |
---|
753 | Void setMaxLayers (UInt l) { m_uiMaxLayers = l; } |
---|
754 | |
---|
755 | Bool getTemporalNestingFlag () { return m_bTemporalIdNestingFlag; } |
---|
756 | Void setTemporalNestingFlag (Bool t) { m_bTemporalIdNestingFlag = t; } |
---|
757 | |
---|
758 | Void setNumReorderPics(UInt v, UInt tLayer) { m_numReorderPics[tLayer] = v; } |
---|
759 | UInt getNumReorderPics(UInt tLayer) { return m_numReorderPics[tLayer]; } |
---|
760 | |
---|
761 | Void setMaxDecPicBuffering(UInt v, UInt tLayer) { assert(tLayer < MAX_TLAYER); m_uiMaxDecPicBuffering[tLayer] = v; } |
---|
762 | UInt getMaxDecPicBuffering(UInt tLayer) { return m_uiMaxDecPicBuffering[tLayer]; } |
---|
763 | |
---|
764 | Void setMaxLatencyIncrease(UInt v, UInt tLayer) { m_uiMaxLatencyIncrease[tLayer] = v; } |
---|
765 | UInt getMaxLatencyIncrease(UInt tLayer) { return m_uiMaxLatencyIncrease[tLayer]; } |
---|
766 | |
---|
767 | UInt getNumHrdParameters() { return m_numHrdParameters; } |
---|
768 | Void setNumHrdParameters(UInt v) { m_numHrdParameters = v; } |
---|
769 | |
---|
770 | #if !SVC_EXTENSION |
---|
771 | UInt getMaxNuhReservedZeroLayerId() { return m_maxNuhReservedZeroLayerId; } |
---|
772 | Void setMaxNuhReservedZeroLayerId(UInt v) { m_maxNuhReservedZeroLayerId = v; } |
---|
773 | |
---|
774 | UInt getMaxOpSets() { return m_numOpSets; } |
---|
775 | Void setMaxOpSets(UInt v) { m_numOpSets = v; } |
---|
776 | #endif |
---|
777 | Bool getLayerIdIncludedFlag(UInt opsIdx, UInt id) { return m_layerIdIncludedFlag[opsIdx][id]; } |
---|
778 | Void setLayerIdIncludedFlag(Bool v, UInt opsIdx, UInt id) { m_layerIdIncludedFlag[opsIdx][id] = v; } |
---|
779 | |
---|
780 | TComPTL* getPTL() { return &m_pcPTL; } |
---|
781 | TimingInfo* getTimingInfo() { return &m_timingInfo; } |
---|
782 | |
---|
783 | #if SVC_EXTENSION |
---|
784 | #if DERIVE_LAYER_ID_LIST_VARIABLES |
---|
785 | Int getLayerSetLayerIdList(Int set, Int layerId) { return m_layerSetLayerIdList[set][layerId]; } |
---|
786 | Void setLayerSetLayerIdList(Int set, Int layerId, Int x) { m_layerSetLayerIdList[set][layerId] = x ; } |
---|
787 | |
---|
788 | Int getNumLayersInIdList(Int set) { return m_numLayerInIdList[set]; } |
---|
789 | Void setNumLayersInIdList(Int set, Int x) { m_numLayerInIdList[set] = x ; } |
---|
790 | |
---|
791 | Void deriveLayerIdListVariables(); |
---|
792 | #endif |
---|
793 | #if VPS_DPB_SIZE_TABLE |
---|
794 | Void deriveNumberOfSubDpbs(); |
---|
795 | #endif |
---|
796 | |
---|
797 | #if O0092_0094_DEPENDENCY_CONSTRAINT |
---|
798 | Void setRefLayersFlags(Int currLayerId); |
---|
799 | Bool getRecursiveRefLayerFlag(Int currLayerId, Int refLayerId) { return m_recursiveRefLayerFlag[currLayerId][refLayerId];} |
---|
800 | Void setRecursiveRefLayerFlag(Int currLayerId, Int refLayerId, Bool x) { m_recursiveRefLayerFlag[currLayerId][refLayerId] = x; } |
---|
801 | Int getNumRefLayers(Int currLayerId) { return m_numberRefLayers[currLayerId]; } |
---|
802 | Void setNumRefLayers(); |
---|
803 | #endif |
---|
804 | #if VPS_RENAME |
---|
805 | UInt getMaxLayerId() { return m_maxLayerId; } |
---|
806 | Void setMaxLayerId(UInt v) { m_maxLayerId = v; } |
---|
807 | |
---|
808 | UInt getNumLayerSets() { return m_numLayerSets; } |
---|
809 | Void setNumLayerSets(UInt v) { m_numLayerSets = v; } |
---|
810 | #endif |
---|
811 | #if VPS_EXTN_MASK_AND_DIM_INFO |
---|
812 | Bool getAvcBaseLayerFlag() { return m_avcBaseLayerFlag; } |
---|
813 | Void setAvcBaseLayerFlag(Bool x) { m_avcBaseLayerFlag = x; } |
---|
814 | |
---|
815 | Bool getSplittingFlag() { return m_splittingFlag; } |
---|
816 | Void setSplittingFlag(Bool x) { m_splittingFlag = x; } |
---|
817 | |
---|
818 | Bool getScalabilityMask(Int id) { return m_scalabilityMask[id]; } |
---|
819 | Void setScalabilityMask(Int id, Bool x) { m_scalabilityMask[id] = x; } |
---|
820 | |
---|
821 | UInt getDimensionIdLen(Int id) { return m_dimensionIdLen[id]; } |
---|
822 | Void setDimensionIdLen(Int id, UInt x) { m_dimensionIdLen[id] = x; } |
---|
823 | |
---|
824 | Bool getNuhLayerIdPresentFlag() { return m_nuhLayerIdPresentFlag; } |
---|
825 | Void setNuhLayerIdPresentFlag(Bool x) { m_nuhLayerIdPresentFlag = x; } |
---|
826 | |
---|
827 | UInt getLayerIdInNuh(Int id) { return m_layerIdInNuh[id]; } |
---|
828 | Void setLayerIdInNuh(Int id, UInt x) { m_layerIdInNuh[id] = x; } |
---|
829 | |
---|
830 | UInt getDimensionId(Int lyrId, Int id) { return m_dimensionId[lyrId][id]; } |
---|
831 | Void setDimensionId(Int lyrId, Int id, UInt x) { m_dimensionId[lyrId][id] = x; } |
---|
832 | |
---|
833 | UInt getNumScalabilityTypes() { return m_numScalabilityTypes; } |
---|
834 | Void setNumScalabilityTypes(UInt x) { m_numScalabilityTypes = x; } |
---|
835 | |
---|
836 | UInt getLayerIdInVps(Int id) { return m_layerIdInVps[id]; } |
---|
837 | Void setLayerIdInVps(Int id, UInt x) { m_layerIdInVps[id] = x; } |
---|
838 | #endif |
---|
839 | #if BITRATE_PICRATE_SIGNALLING |
---|
840 | UInt getMaxSLayersInLayerSetMinus1(Int ls) { return m_maxSLInLayerSetMinus1[ls]; } |
---|
841 | Void setMaxSLayersInLayerSetMinus1(Int ls, Int x) { m_maxSLInLayerSetMinus1[ls] = x; } |
---|
842 | #endif |
---|
843 | #if ILP_SSH_SIG |
---|
844 | Bool getIlpSshSignalingEnabledFlag() { return m_ilpSshSignalingEnabledFlag;} |
---|
845 | Void setIlpSshSignalingEnabledFlag(Bool x) { m_ilpSshSignalingEnabledFlag = x;} |
---|
846 | #endif |
---|
847 | #if VPS_EXTN_PROFILE_INFO |
---|
848 | Bool getProfilePresentFlag(Int id) { return m_profilePresentFlag[id]; } |
---|
849 | Void setProfilePresentFlag(Int id, Bool x) { m_profilePresentFlag[id] = x; } |
---|
850 | |
---|
851 | #if !P0048_REMOVE_PROFILE_REF |
---|
852 | UInt getProfileLayerSetRef(Int id) { return m_profileLayerSetRef[id]; } |
---|
853 | Void setProfileLayerSetRef(Int id, Bool x) { m_profileLayerSetRef[id] = x; } |
---|
854 | #endif |
---|
855 | |
---|
856 | std::vector<TComPTL>* getPTLForExtnPtr() { return &m_pcPTLForExtn; } |
---|
857 | TComPTL* getPTLForExtn(Int id) { return &m_pcPTLForExtn[id]; } |
---|
858 | #endif |
---|
859 | #if VPS_EXTN_OP_LAYER_SETS |
---|
860 | // Target output layer signalling related |
---|
861 | UInt getNumOutputLayerSets() { return m_numOutputLayerSets; } |
---|
862 | Void setNumOutputLayerSets(Int x) { m_numOutputLayerSets = x; } |
---|
863 | |
---|
864 | UInt getOutputLayerSetIdx(Int idx) { return m_outputLayerSetIdx[idx]; } |
---|
865 | Void setOutputLayerSetIdx(Int idx, UInt x) { m_outputLayerSetIdx[idx] = x; } |
---|
866 | |
---|
867 | Bool getOutputLayerFlag(Int layerSet, Int layerId) { return m_outputLayerFlag[layerSet][layerId]; } |
---|
868 | Void setOutputLayerFlag(Int layerSet, Int layerId, Bool x) { m_outputLayerFlag[layerSet][layerId] = x; } |
---|
869 | #endif |
---|
870 | #if VPS_EXTN_DIRECT_REF_LAYERS |
---|
871 | // Direct dependency of layers |
---|
872 | Bool getDirectDependencyFlag(Int currLayerId, Int refLayerId) { return m_directDependencyFlag[currLayerId][refLayerId]; } |
---|
873 | Void setDirectDependencyFlag(Int currLayerId, Int refLayerId, Bool x) { m_directDependencyFlag[currLayerId][refLayerId] = x; } |
---|
874 | |
---|
875 | UInt getNumDirectRefLayers(Int layerId) { return m_numDirectRefLayers[layerId]; } |
---|
876 | Void setNumDirectRefLayers(Int layerId, UInt refLayerNum) { m_numDirectRefLayers[layerId] = refLayerNum; } |
---|
877 | |
---|
878 | UInt getRefLayerId(Int layerId, Int refLayerIdx) { return m_refLayerId[layerId][refLayerIdx]; } |
---|
879 | Void setRefLayerId(Int layerId, Int refLayerIdx, UInt refLayerId) { m_refLayerId[layerId][refLayerIdx] = refLayerId; } |
---|
880 | |
---|
881 | UInt getDirectDepTypeLen() { return m_directDepTypeLen; } |
---|
882 | Void setDirectDepTypeLen(UInt x) { m_directDepTypeLen = x; } |
---|
883 | #if O0096_DEFAULT_DEPENDENCY_TYPE |
---|
884 | Bool getDefaultDirectDependencyTypeFlag() { return m_defaultDirectDependencyTypeFlag; } |
---|
885 | Void setDefaultDirectDependecyTypeFlag(Bool x) { m_defaultDirectDependencyTypeFlag = x; } |
---|
886 | UInt getDefaultDirectDependencyType() { return m_defaultDirectDependencyType; } |
---|
887 | Void setDefaultDirectDependecyType(UInt x) { m_defaultDirectDependencyType = x; } |
---|
888 | #endif |
---|
889 | UInt getDirectDependencyType(Int currLayerId, Int refLayerId) { return m_directDependencyType[currLayerId][refLayerId]; } |
---|
890 | Void setDirectDependencyType(Int currLayerId, Int refLayerId, UInt x) { m_directDependencyType[currLayerId][refLayerId] = x; } |
---|
891 | Bool isSamplePredictionType(Int currLayerId, Int refLayerId) { assert(currLayerId != refLayerId); return ( ( m_directDependencyType[currLayerId][refLayerId] + 1 ) & 1 ) ? true : false; } |
---|
892 | Bool isMotionPredictionType(Int currLayerId, Int refLayerId) { assert(currLayerId != refLayerId); return ( ( ( m_directDependencyType[currLayerId][refLayerId] + 1 ) & 2 ) >> 1 ) ? true : false; } |
---|
893 | #endif |
---|
894 | UInt getNumProfileTierLevel() { return m_numProfileTierLevel; } |
---|
895 | Void setNumProfileTierLevel(Int x) { m_numProfileTierLevel = x; } |
---|
896 | |
---|
897 | #if !VPS_EXTN_UEV_CODING |
---|
898 | Bool getMoreOutputLayerSetsThanDefaultFlag() { return m_moreOutputLayerSetsThanDefaultFlag;} |
---|
899 | Void setMoreOutputLayerSetsThanDefaultFlag(Bool x) { m_moreOutputLayerSetsThanDefaultFlag = x ;} |
---|
900 | #endif |
---|
901 | |
---|
902 | Int getNumAddOutputLayerSets() { return m_numAddOutputLayerSets; } |
---|
903 | Void setNumAddOutputLayerSets(Int x) { m_numAddOutputLayerSets = x ; } |
---|
904 | |
---|
905 | #if P0295_DEFAULT_OUT_LAYER_IDC |
---|
906 | UInt getDefaultTargetOutputLayerIdc() { return m_defaultTargetOutputLayerIdc;} |
---|
907 | Void setDefaultTargetOutputLayerIdc(UInt x) { m_defaultTargetOutputLayerIdc = x ;} |
---|
908 | #else |
---|
909 | #if O0109_DEFAULT_ONE_OUT_LAYER_IDC |
---|
910 | UInt getDefaultOneTargetOutputLayerIdc() { return m_defaultOneTargetOutputLayerIdc;} |
---|
911 | Void setDefaultOneTargetOutputLayerIdc(UInt x) { m_defaultOneTargetOutputLayerIdc= x ;} |
---|
912 | #else |
---|
913 | Bool getDefaultOneTargetOutputLayerFlag() { return m_defaultOneTargetOutputLayerFlag;} |
---|
914 | Void setDefaultOneTargetOutputLayerFlag(Bool x) { m_defaultOneTargetOutputLayerFlag= x ;} |
---|
915 | #endif |
---|
916 | #endif |
---|
917 | Int getProfileLevelTierIdx(Int i) { return m_profileLevelTierIdx[i]; } |
---|
918 | Void setProfileLevelTierIdx(Int i, Int x) { m_profileLevelTierIdx[i] = x ; } |
---|
919 | Bool getMaxOneActiveRefLayerFlag() { return m_maxOneActiveRefLayerFlag; } |
---|
920 | Void setMaxOneActiveRefLayerFlag(Bool x) { m_maxOneActiveRefLayerFlag = x; } |
---|
921 | #if O0062_POC_LSB_NOT_PRESENT_FLAG |
---|
922 | UInt getPocLsbNotPresentFlag(Int i) { return m_pocLsbNotPresentFlag[i]; } |
---|
923 | Void setPocLsbNotPresentFlag(Int i, Bool x) { m_pocLsbNotPresentFlag[i] = x; } |
---|
924 | #endif |
---|
925 | #if O0223_PICTURE_TYPES_ALIGN_FLAG |
---|
926 | Bool getCrossLayerPictureTypeAlignFlag() { return m_crossLayerPictureTypeAlignFlag; } |
---|
927 | Void setCrossLayerPictureTypeAlignFlag(Bool x) { m_crossLayerPictureTypeAlignFlag = x; } |
---|
928 | #endif |
---|
929 | #if P0068_CROSS_LAYER_ALIGNED_IDR_ONLY_FOR_IRAP_FLAG |
---|
930 | Bool getCrossLayerAlignedIdrOnlyFlag() { return m_crossLayerAlignedIdrOnlyFlag; } |
---|
931 | Void setCrossLayerAlignedIdrOnlyFlag(Bool x) { m_crossLayerAlignedIdrOnlyFlag = x; } |
---|
932 | #endif |
---|
933 | #if N0147_IRAP_ALIGN_FLAG |
---|
934 | Bool getCrossLayerIrapAlignFlag() { return m_crossLayerIrapAlignFlag; } |
---|
935 | Void setCrossLayerIrapAlignFlag(Bool x) { m_crossLayerIrapAlignFlag = x; } |
---|
936 | #endif |
---|
937 | #if O0225_MAX_TID_FOR_REF_LAYERS |
---|
938 | UInt getMaxTidIlRefPicsPlus1(Int layerId, Int refLayerId) { return m_maxTidIlRefPicsPlus1[layerId][refLayerId]; } |
---|
939 | Void setMaxTidIlRefPicsPlus1(Int layerId, Int refLayerId, UInt maxSublayer) { m_maxTidIlRefPicsPlus1[layerId][refLayerId] = maxSublayer; } |
---|
940 | #else |
---|
941 | UInt getMaxTidIlRefPicsPlus1(Int layerId) { return m_maxTidIlRefPicsPlus1[layerId]; } |
---|
942 | Void setMaxTidIlRefPicsPlus1(Int layerId, UInt maxSublayer) { m_maxTidIlRefPicsPlus1[layerId] = maxSublayer; } |
---|
943 | #endif |
---|
944 | Bool getMaxTidRefPresentFlag() { return m_maxTidRefPresentFlag ;} |
---|
945 | Void setMaxTidRefPresentFlag(Bool x) { m_maxTidRefPresentFlag = x;} |
---|
946 | #if VPS_TSLAYERS |
---|
947 | Bool getMaxTSLayersPresentFlag() { return m_maxTSLayersPresentFlag ;} |
---|
948 | Void setMaxTSLayersPresentFlag(Bool x) { m_maxTSLayersPresentFlag = x;} |
---|
949 | UInt getMaxTSLayersMinus1(Int layerId) { return m_maxTSLayerMinus1[layerId];} |
---|
950 | Void setMaxTSLayersMinus1(Int layerId, UInt maxTSublayer) { m_maxTSLayerMinus1[layerId] = maxTSublayer;} |
---|
951 | #endif |
---|
952 | #if M0040_ADAPTIVE_RESOLUTION_CHANGE |
---|
953 | Bool getSingleLayerForNonIrapFlag() { return m_singleLayerForNonIrapFlag; } |
---|
954 | Void setSingleLayerForNonIrapFlag(Bool x) { m_singleLayerForNonIrapFlag = x; } |
---|
955 | #endif |
---|
956 | #if HIGHER_LAYER_IRAP_SKIP_FLAG |
---|
957 | Bool getHigherLayerIrapSkipFlag() { return m_higherLayerIrapSkipFlag; } |
---|
958 | Void setHigherLayerIrapSkipFlag(Bool x) { m_higherLayerIrapSkipFlag = x; } |
---|
959 | #endif |
---|
960 | #if VPS_VUI_TILES_NOT_IN_USE__FLAG |
---|
961 | Bool getTilesNotInUseFlag() { return m_tilesNotInUseFlag; } |
---|
962 | Void setTilesNotInUseFlag(Bool x); |
---|
963 | Bool getTilesInUseFlag(Int currLayerId) { return m_tilesInUseFlag[currLayerId]; } |
---|
964 | Void setTilesInUseFlag(Int currLayerId, Bool x) { m_tilesInUseFlag[currLayerId] = x; } |
---|
965 | Bool getLoopFilterNotAcrossTilesFlag(Int currLayerId) { return m_loopFilterNotAcrossTilesFlag[currLayerId]; } |
---|
966 | Void setLoopFilterNotAcrossTilesFlag(Int currLayerId, Bool x) { m_loopFilterNotAcrossTilesFlag[currLayerId] = x; } |
---|
967 | #endif |
---|
968 | #if TILE_BOUNDARY_ALIGNED_FLAG |
---|
969 | Bool getTileBoundariesAlignedFlag(Int currLayerId, Int refLayerId) { return m_tileBoundariesAlignedFlag[currLayerId][refLayerId]; } |
---|
970 | Void setTileBoundariesAlignedFlag(Int currLayerId, Int refLayerId, Bool x) { m_tileBoundariesAlignedFlag[currLayerId][refLayerId] = x; } |
---|
971 | #endif |
---|
972 | #if VPS_VUI_WPP_NOT_IN_USE__FLAG |
---|
973 | Bool getWppNotInUseFlag() { return m_wppNotInUseFlag; } |
---|
974 | Void setWppNotInUseFlag(Bool x); |
---|
975 | Bool getWppInUseFlag(Int currLayerId) { return m_wppInUseFlag[currLayerId]; } |
---|
976 | Void setWppInUseFlag(Int currLayerId, Bool x) { m_wppInUseFlag[currLayerId] = x; } |
---|
977 | #endif |
---|
978 | #if N0160_VUI_EXT_ILP_REF |
---|
979 | Bool getIlpRestrictedRefLayersFlag ( ) { return m_ilpRestrictedRefLayersFlag ;} |
---|
980 | Void setIlpRestrictedRefLayersFlag ( Int val ) { m_ilpRestrictedRefLayersFlag = val;} |
---|
981 | |
---|
982 | Int getMinSpatialSegmentOffsetPlus1( Int currLayerId, Int refLayerId ) { return m_minSpatialSegmentOffsetPlus1[currLayerId][refLayerId];} |
---|
983 | Void setMinSpatialSegmentOffsetPlus1( Int currLayerId, Int refLayerId, Int val ) { m_minSpatialSegmentOffsetPlus1[currLayerId][refLayerId] = val;} |
---|
984 | |
---|
985 | Bool getCtuBasedOffsetEnabledFlag ( Int currLayerId, Int refLayerId ) { return m_ctuBasedOffsetEnabledFlag[currLayerId][refLayerId];} |
---|
986 | Void setCtuBasedOffsetEnabledFlag ( Int currLayerId, Int refLayerId, Bool flag ) { m_ctuBasedOffsetEnabledFlag[currLayerId][refLayerId] = flag;} |
---|
987 | |
---|
988 | Int getMinHorizontalCtuOffsetPlus1 ( Int currLayerId, Int refLayerId ) { return m_minHorizontalCtuOffsetPlus1[currLayerId][refLayerId];} |
---|
989 | Void setMinHorizontalCtuOffsetPlus1 ( Int currLayerId, Int refLayerId, Int val ) { m_minHorizontalCtuOffsetPlus1[currLayerId][refLayerId] = val;} |
---|
990 | #endif |
---|
991 | #if VPS_VUI_VIDEO_SIGNAL |
---|
992 | Bool getVideoSigPresentVpsFlag() { return m_vidSigPresentVpsFlag; } |
---|
993 | Void setVideoSigPresentVpsFlag(Bool x) { m_vidSigPresentVpsFlag = x; } |
---|
994 | Int getNumVideoSignalInfo() { return m_vpsVidSigInfo; } |
---|
995 | Void setNumVideoSignalInfo(Int x) { m_vpsVidSigInfo = x; } |
---|
996 | Int getVideoSignalInfoIdx(Int idx) { return m_vpsVidSigIdx[idx]; } |
---|
997 | Void setVideoSignalInfoIdx(Int idx, Int x) { m_vpsVidSigIdx[idx] = x; } |
---|
998 | Int getVideoVPSFormat(Int idx) { return m_vpsVidFormat[idx]; } |
---|
999 | Void setVideoVPSFormat(Int idx, Int x) { m_vpsVidFormat[idx] = x; } |
---|
1000 | Bool getVideoFullRangeVpsFlag(Int idx) { return m_vpsFullRangeFlag[idx];} |
---|
1001 | Void setVideoFullRangeVpsFlag(Int idx, Bool x) { m_vpsFullRangeFlag[idx] = x; } |
---|
1002 | Int getColorPrimaries(Int idx) { return m_vpsColorPrimaries[idx]; } |
---|
1003 | Void setColorPrimaries(Int idx, Int x) { m_vpsColorPrimaries[idx] = x; } |
---|
1004 | Int getTransCharacter(Int idx) { return m_vpsTransChar[idx]; } |
---|
1005 | Void setTransCharacter(Int idx, Int x) { m_vpsTransChar[idx] = x; } |
---|
1006 | Int getMaxtrixCoeff(Int idx) { return m_vpsMatCoeff[idx]; } |
---|
1007 | Void setMaxtrixCoeff(Int idx, Int x) { m_vpsMatCoeff[idx] = x; } |
---|
1008 | #endif |
---|
1009 | #if VPS_VUI_BITRATE_PICRATE |
---|
1010 | Bool getBitRatePresentVpsFlag() { return m_bitRatePresentVpsFlag; } |
---|
1011 | Void setBitRatePresentVpsFlag(Bool x) { m_bitRatePresentVpsFlag = x; } |
---|
1012 | Bool getPicRatePresentVpsFlag() { return m_picRatePresentVpsFlag; } |
---|
1013 | Void setPicRatePresentVpsFlag(Bool x) { m_picRatePresentVpsFlag = x; } |
---|
1014 | |
---|
1015 | Bool getBitRatePresentFlag(Int i, Int j) { return m_bitRatePresentFlag[i][j]; } |
---|
1016 | Void setBitRatePresentFlag(Int i, Int j, Bool x) { m_bitRatePresentFlag[i][j] = x; } |
---|
1017 | Bool getPicRatePresentFlag(Int i, Int j) { return m_picRatePresentFlag[i][j]; } |
---|
1018 | Void setPicRatePresentFlag(Int i, Int j, Bool x) { m_picRatePresentFlag[i][j] = x; } |
---|
1019 | |
---|
1020 | Int getAvgBitRate(Int i, Int j) { return m_avgBitRate[i][j]; } |
---|
1021 | Void setAvgBitRate(Int i, Int j, Int x) { m_avgBitRate[i][j] = x; } |
---|
1022 | Int getMaxBitRate(Int i, Int j) { return m_maxBitRate[i][j]; } |
---|
1023 | Void setMaxBitRate(Int i, Int j, Int x) { m_maxBitRate[i][j] = x; } |
---|
1024 | |
---|
1025 | Int getConstPicRateIdc(Int i, Int j) { return m_constPicRateIdc[i][j]; } |
---|
1026 | Void setConstPicRateIdc(Int i, Int j, Int x) { m_constPicRateIdc[i][j] = x; } |
---|
1027 | Int getAvgPicRate(Int i, Int j) { return m_avgPicRate[i][j]; } |
---|
1028 | Void setAvgPicRate(Int i, Int j, Int x) { m_avgPicRate[i][j] = x; } |
---|
1029 | #endif |
---|
1030 | #if O0164_MULTI_LAYER_HRD |
---|
1031 | Bool getVpsVuiBspHrdPresentFlag() { return m_vpsVuiBspHrdPresentFlag; } |
---|
1032 | Void setVpsVuiBspHrdPresentFlag(Bool x) { m_vpsVuiBspHrdPresentFlag = x; } |
---|
1033 | UInt getVpsNumBspHrdParametersMinus1() { return m_vpsNumBspHrdParametersMinus1; } |
---|
1034 | Void setVpsNumBspHrdParametersMinus1(UInt i) { m_vpsNumBspHrdParametersMinus1 = i; } |
---|
1035 | Bool getBspCprmsPresentFlag(UInt i) { return m_bspCprmsPresentFlag[i]; } |
---|
1036 | Void setBspCprmsPresentFlag(UInt i, Bool val) { m_bspCprmsPresentFlag[i] = val; } |
---|
1037 | TComHRD* getBspHrd(UInt i) { return &m_bspHrd[i]; } |
---|
1038 | UInt getNumBitstreamPartitions(UInt i) { return m_numBitstreamPartitions[i]; } |
---|
1039 | Void setNumBitstreamPartitions(UInt i, UInt val) { m_numBitstreamPartitions[i] = val; } |
---|
1040 | UInt getLayerInBspFlag(UInt h, UInt i, UInt j) { return m_layerInBspFlag[h][i][j]; } |
---|
1041 | Void setLayerInBspFlag(UInt h, UInt i, UInt j, UInt val) { m_layerInBspFlag[h][i][j] = val; } |
---|
1042 | UInt getNumBspSchedCombinations(UInt i) { return m_numBspSchedCombinations[i]; } |
---|
1043 | Void setNumBspSchedCombinations(UInt i, UInt val) { m_numBspSchedCombinations[i] = val; } |
---|
1044 | UInt getBspCombHrdIdx(UInt h, UInt i, UInt j) { return m_bspCombHrdIdx[h][i][j]; } |
---|
1045 | Void setBspCombHrdIdx(UInt h, UInt i, UInt j, UInt val) { m_bspCombHrdIdx[h][i][j] = val; } |
---|
1046 | UInt getBspCombSchedIdx(UInt h, UInt i, UInt j) { return m_bspCombSchedIdx[h][i][j]; } |
---|
1047 | Void setBspCombSchedIdx(UInt h, UInt i, UInt j, UInt val) { m_bspCombSchedIdx[h][i][j] = val; } |
---|
1048 | #endif |
---|
1049 | #if P0182_VPS_VUI_PS_FLAG |
---|
1050 | Int getSPSId (Int layer) { return m_SPSId[layer]; } |
---|
1051 | Void setSPSId (Int layer, Int val) { m_SPSId[layer] = val; } |
---|
1052 | Int getPPSId (Int layer) { return m_PPSId[layer]; } |
---|
1053 | Void setPPSId (Int layer, Int val) { m_PPSId[layer] = val; } |
---|
1054 | Void setBaseLayerPSCompatibilityFlag (Int layer, int val) { m_baseLayerPSCompatibilityFlag[layer] = val; } |
---|
1055 | Int getBaseLayerPSCompatibilityFlag (Int layer) { return m_baseLayerPSCompatibilityFlag[layer];} |
---|
1056 | #endif |
---|
1057 | |
---|
1058 | #if P0312_VERT_PHASE_ADJ |
---|
1059 | Bool getVpsVuiVertPhaseInUseFlag() { return m_vpsVuiVertPhaseInUseFlag; } |
---|
1060 | Void setVpsVuiVertPhaseInUseFlag(Bool x) { m_vpsVuiVertPhaseInUseFlag = x; } |
---|
1061 | #endif |
---|
1062 | |
---|
1063 | #if P0300_ALT_OUTPUT_LAYER_FLAG |
---|
1064 | Bool getAltOuputLayerFlag(Int idx) { return m_altOutputLayerFlag[idx]; } |
---|
1065 | Void setAltOuputLayerFlag(Int idx, Bool x) { m_altOutputLayerFlag[idx] = x; } |
---|
1066 | #else |
---|
1067 | #if O0153_ALT_OUTPUT_LAYER_FLAG |
---|
1068 | Bool getAltOuputLayerFlag() { return m_altOutputLayerFlag; } |
---|
1069 | Void setAltOuputLayerFlag(Bool x) { m_altOutputLayerFlag = x; } |
---|
1070 | #endif |
---|
1071 | #endif |
---|
1072 | #if REPN_FORMAT_IN_VPS |
---|
1073 | Bool getRepFormatIdxPresentFlag() { return m_repFormatIdxPresentFlag; } |
---|
1074 | Void setRepFormatIdxPresentFlag(Bool x) { m_repFormatIdxPresentFlag = x; } |
---|
1075 | |
---|
1076 | Int getVpsNumRepFormats() { return m_vpsNumRepFormats; } |
---|
1077 | Void setVpsNumRepFormats(Int x) { m_vpsNumRepFormats = x; } |
---|
1078 | |
---|
1079 | RepFormat* getVpsRepFormat(Int idx) { return &m_vpsRepFormat[idx]; } |
---|
1080 | |
---|
1081 | Int getVpsRepFormatIdx(Int idx) { return m_vpsRepFormatIdx[idx]; } |
---|
1082 | Void setVpsRepFormatIdx(Int idx, Int x) { m_vpsRepFormatIdx[idx] = x; } |
---|
1083 | #endif |
---|
1084 | #if VIEW_ID_RELATED_SIGNALING |
---|
1085 | #if O0109_VIEW_ID_LEN |
---|
1086 | Void setViewIdLen( Int val ) { m_viewIdLen = val; } |
---|
1087 | Int getViewIdLen( ) { return m_viewIdLen; } |
---|
1088 | #else |
---|
1089 | Void setViewIdLenMinus1( Int val ) { m_viewIdLenMinus1 = val; } |
---|
1090 | Int getViewIdLenMinus1( ) { return m_viewIdLenMinus1; } |
---|
1091 | #endif |
---|
1092 | |
---|
1093 | Void setViewIdVal( Int viewOrderIndex, Int val ) { m_viewIdVal[viewOrderIndex] = val; } |
---|
1094 | Int getViewIdVal( Int viewOrderIndex ) { return m_viewIdVal[viewOrderIndex]; } |
---|
1095 | Int getScalabilityId(Int, ScalabilityType scalType ); |
---|
1096 | |
---|
1097 | Int getViewIndex ( Int layerIdInNuh ) { return getScalabilityId( getLayerIdInVps(layerIdInNuh), VIEW_ORDER_INDEX ); } |
---|
1098 | |
---|
1099 | Int getNumViews(); |
---|
1100 | Int scalTypeToScalIdx( ScalabilityType scalType ); |
---|
1101 | #endif |
---|
1102 | #if !P0125_REVERT_VPS_EXTN_OFFSET_TO_RESERVED |
---|
1103 | #if VPS_EXTN_OFFSET |
---|
1104 | Int getExtensionOffset() { return m_extensionOffset; } |
---|
1105 | Void setExtensionOffset( UInt offset ) { m_extensionOffset = offset; } |
---|
1106 | #endif |
---|
1107 | #endif |
---|
1108 | #if O0215_PHASE_ALIGNMENT |
---|
1109 | Bool getPhaseAlignFlag() { return m_phaseAlignFlag; } |
---|
1110 | Void setPhaseAlignFlag(Bool x) { m_phaseAlignFlag = x; } |
---|
1111 | #endif |
---|
1112 | #if VPS_DPB_SIZE_TABLE |
---|
1113 | Bool getSubLayerFlagInfoPresentFlag(Int i) {return m_subLayerFlagInfoPresentFlag[i]; } |
---|
1114 | Void setSubLayerFlagInfoPresentFlag(Int i, Bool x) {m_subLayerFlagInfoPresentFlag[i] = x; } |
---|
1115 | |
---|
1116 | Bool getSubLayerDpbInfoPresentFlag(Int i, Int j) {return m_subLayerDpbInfoPresentFlag[i][j]; } |
---|
1117 | Void setSubLayerDpbInfoPresentFlag(Int i, Int j, Bool x) {m_subLayerDpbInfoPresentFlag[i][j] = x; } |
---|
1118 | |
---|
1119 | // For the 0-th output layer set, use the date from the active SPS for base layer. |
---|
1120 | Int getMaxVpsDecPicBufferingMinus1(Int i, Int k, Int j) { assert(i != 0); return m_maxVpsDecPicBufferingMinus1[i][k][j]; } |
---|
1121 | Void setMaxVpsDecPicBufferingMinus1(Int i, Int k, Int j, Int x) { m_maxVpsDecPicBufferingMinus1[i][k][j] = x; } |
---|
1122 | |
---|
1123 | #if RESOLUTION_BASED_DPB |
---|
1124 | Int getMaxVpsLayerDecPicBuffMinus1(Int i, Int k, Int j) { assert(i != 0); return m_maxVpsLayerDecPicBuffMinus1[i][k][j]; } |
---|
1125 | Void setMaxVpsLayerDecPicBuffMinus1(Int i, Int k, Int j, Int x) { m_maxVpsLayerDecPicBuffMinus1[i][k][j] = x; } |
---|
1126 | #endif |
---|
1127 | |
---|
1128 | Int getMaxVpsNumReorderPics(Int i, Int j) { assert(i != 0); return m_maxVpsNumReorderPics[i][j]; } |
---|
1129 | Void setMaxVpsNumReorderPics(Int i, Int j, Int x) { m_maxVpsNumReorderPics[i][j] = x; } |
---|
1130 | |
---|
1131 | Int getMaxVpsLatencyIncreasePlus1(Int i, Int j) { assert(i != 0); return m_maxVpsLatencyIncreasePlus1[i][j]; } |
---|
1132 | Void setMaxVpsLatencyIncreasePlus1(Int i, Int j, Int x) { m_maxVpsLatencyIncreasePlus1[i][j] = x; } |
---|
1133 | |
---|
1134 | Int getNumSubDpbs(Int i) { return m_numSubDpbs[i]; } |
---|
1135 | Void setNumSubDpbs(Int i, Int x) { m_numSubDpbs[i] = x; } |
---|
1136 | Void determineSubDpbInfoFlags(); |
---|
1137 | #endif |
---|
1138 | |
---|
1139 | #if O0109_MOVE_VPS_VUI_FLAG |
---|
1140 | Bool getVpsVuiPresentFlag() { return m_vpsVuiPresentFlag; } |
---|
1141 | Void setVpsVuiPresentFlag(Bool x) { m_vpsVuiPresentFlag = x; } |
---|
1142 | #endif |
---|
1143 | Bool getVpsExtensionFlag() { return m_vpsExtensionFlag; } |
---|
1144 | Void setVpsExtensionFlag(Bool x) { m_vpsExtensionFlag = x; } |
---|
1145 | |
---|
1146 | #if !P0307_REMOVE_VPS_VUI_OFFSET |
---|
1147 | #if VPS_VUI_OFFSET |
---|
1148 | Int getVpsVuiOffset() { return m_vpsVuiOffset; } |
---|
1149 | Void setVpsVuiOffset(Int x) { m_vpsVuiOffset = x; } |
---|
1150 | #endif |
---|
1151 | #endif |
---|
1152 | #if P0307_VPS_NON_VUI_EXTENSION |
---|
1153 | Int getVpsNonVuiExtLength() { return m_vpsNonVuiExtLength; } |
---|
1154 | Void setVpsNonVuiExtLength(Int x) { m_vpsNonVuiExtLength = x; } |
---|
1155 | #endif |
---|
1156 | #if RESOLUTION_BASED_DPB |
---|
1157 | Void assignSubDpbIndices(); |
---|
1158 | Int getSubDpbAssigned (Int lsIdx, Int layerIdx) { return m_subDpbAssigned[lsIdx][layerIdx]; } |
---|
1159 | Int findLayerIdxInLayerSet ( Int lsIdx, Int nuhLayerId ); |
---|
1160 | #endif |
---|
1161 | #if O0164_MULTI_LAYER_HRD |
---|
1162 | Void setBspHrdParameters( UInt hrdIdx, UInt frameRate, UInt numDU, UInt bitRate, Bool randomAccess ); |
---|
1163 | #endif |
---|
1164 | #endif //SVC_EXTENSION |
---|
1165 | }; |
---|
1166 | |
---|
1167 | class Window |
---|
1168 | { |
---|
1169 | private: |
---|
1170 | Bool m_enabledFlag; |
---|
1171 | Int m_winLeftOffset; |
---|
1172 | Int m_winRightOffset; |
---|
1173 | Int m_winTopOffset; |
---|
1174 | Int m_winBottomOffset; |
---|
1175 | #if P0312_VERT_PHASE_ADJ |
---|
1176 | Bool m_vertPhasePositionEnableFlag; |
---|
1177 | #endif |
---|
1178 | public: |
---|
1179 | Window() |
---|
1180 | : m_enabledFlag (false) |
---|
1181 | , m_winLeftOffset (0) |
---|
1182 | , m_winRightOffset (0) |
---|
1183 | , m_winTopOffset (0) |
---|
1184 | , m_winBottomOffset (0) |
---|
1185 | #if P0312_VERT_PHASE_ADJ |
---|
1186 | , m_vertPhasePositionEnableFlag(false) |
---|
1187 | #endif |
---|
1188 | { } |
---|
1189 | |
---|
1190 | Bool getWindowEnabledFlag() const { return m_enabledFlag; } |
---|
1191 | #if P0312_VERT_PHASE_ADJ |
---|
1192 | Void resetWindow() { m_enabledFlag = false; m_winLeftOffset = m_winRightOffset = m_winTopOffset = m_winBottomOffset = 0; m_vertPhasePositionEnableFlag = false; } |
---|
1193 | #else |
---|
1194 | Void resetWindow() { m_enabledFlag = false; m_winLeftOffset = m_winRightOffset = m_winTopOffset = m_winBottomOffset = 0;} |
---|
1195 | #endif |
---|
1196 | Int getWindowLeftOffset() const { return m_enabledFlag ? m_winLeftOffset : 0; } |
---|
1197 | Void setWindowLeftOffset(Int val) { m_winLeftOffset = val; m_enabledFlag = true; } |
---|
1198 | Int getWindowRightOffset() const { return m_enabledFlag ? m_winRightOffset : 0; } |
---|
1199 | Void setWindowRightOffset(Int val) { m_winRightOffset = val; m_enabledFlag = true; } |
---|
1200 | Int getWindowTopOffset() const { return m_enabledFlag ? m_winTopOffset : 0; } |
---|
1201 | Void setWindowTopOffset(Int val) { m_winTopOffset = val; m_enabledFlag = true; } |
---|
1202 | Int getWindowBottomOffset() const { return m_enabledFlag ? m_winBottomOffset: 0; } |
---|
1203 | Void setWindowBottomOffset(Int val) { m_winBottomOffset = val; m_enabledFlag = true; } |
---|
1204 | |
---|
1205 | #if P0312_VERT_PHASE_ADJ |
---|
1206 | Bool getVertPhasePositionEnableFlag() const { return m_vertPhasePositionEnableFlag; } |
---|
1207 | Void setVertPhasePositionEnableFlag(Bool val) { m_vertPhasePositionEnableFlag = val; } |
---|
1208 | Void setWindow(Int offsetLeft, Int offsetLRight, Int offsetLTop, Int offsetLBottom, Bool vertPhasePositionEnableFlag = 0) |
---|
1209 | #else |
---|
1210 | Void setWindow(Int offsetLeft, Int offsetLRight, Int offsetLTop, Int offsetLBottom) |
---|
1211 | #endif |
---|
1212 | { |
---|
1213 | m_enabledFlag = true; |
---|
1214 | m_winLeftOffset = offsetLeft; |
---|
1215 | m_winRightOffset = offsetLRight; |
---|
1216 | m_winTopOffset = offsetLTop; |
---|
1217 | m_winBottomOffset = offsetLBottom; |
---|
1218 | #if P0312_VERT_PHASE_ADJ |
---|
1219 | m_vertPhasePositionEnableFlag = vertPhasePositionEnableFlag; |
---|
1220 | #endif |
---|
1221 | } |
---|
1222 | }; |
---|
1223 | |
---|
1224 | |
---|
1225 | class TComVUI |
---|
1226 | { |
---|
1227 | private: |
---|
1228 | Bool m_aspectRatioInfoPresentFlag; |
---|
1229 | Int m_aspectRatioIdc; |
---|
1230 | Int m_sarWidth; |
---|
1231 | Int m_sarHeight; |
---|
1232 | Bool m_overscanInfoPresentFlag; |
---|
1233 | Bool m_overscanAppropriateFlag; |
---|
1234 | Bool m_videoSignalTypePresentFlag; |
---|
1235 | Int m_videoFormat; |
---|
1236 | Bool m_videoFullRangeFlag; |
---|
1237 | Bool m_colourDescriptionPresentFlag; |
---|
1238 | Int m_colourPrimaries; |
---|
1239 | Int m_transferCharacteristics; |
---|
1240 | Int m_matrixCoefficients; |
---|
1241 | Bool m_chromaLocInfoPresentFlag; |
---|
1242 | Int m_chromaSampleLocTypeTopField; |
---|
1243 | Int m_chromaSampleLocTypeBottomField; |
---|
1244 | Bool m_neutralChromaIndicationFlag; |
---|
1245 | Bool m_fieldSeqFlag; |
---|
1246 | |
---|
1247 | Window m_defaultDisplayWindow; |
---|
1248 | Bool m_frameFieldInfoPresentFlag; |
---|
1249 | Bool m_hrdParametersPresentFlag; |
---|
1250 | Bool m_bitstreamRestrictionFlag; |
---|
1251 | Bool m_tilesFixedStructureFlag; |
---|
1252 | Bool m_motionVectorsOverPicBoundariesFlag; |
---|
1253 | Bool m_restrictedRefPicListsFlag; |
---|
1254 | Int m_minSpatialSegmentationIdc; |
---|
1255 | Int m_maxBytesPerPicDenom; |
---|
1256 | Int m_maxBitsPerMinCuDenom; |
---|
1257 | Int m_log2MaxMvLengthHorizontal; |
---|
1258 | Int m_log2MaxMvLengthVertical; |
---|
1259 | TComHRD m_hrdParameters; |
---|
1260 | TimingInfo m_timingInfo; |
---|
1261 | |
---|
1262 | public: |
---|
1263 | TComVUI() |
---|
1264 | :m_aspectRatioInfoPresentFlag(false) |
---|
1265 | ,m_aspectRatioIdc(0) |
---|
1266 | ,m_sarWidth(0) |
---|
1267 | ,m_sarHeight(0) |
---|
1268 | ,m_overscanInfoPresentFlag(false) |
---|
1269 | ,m_overscanAppropriateFlag(false) |
---|
1270 | ,m_videoSignalTypePresentFlag(false) |
---|
1271 | ,m_videoFormat(5) |
---|
1272 | ,m_videoFullRangeFlag(false) |
---|
1273 | ,m_colourDescriptionPresentFlag(false) |
---|
1274 | ,m_colourPrimaries(2) |
---|
1275 | ,m_transferCharacteristics(2) |
---|
1276 | ,m_matrixCoefficients(2) |
---|
1277 | ,m_chromaLocInfoPresentFlag(false) |
---|
1278 | ,m_chromaSampleLocTypeTopField(0) |
---|
1279 | ,m_chromaSampleLocTypeBottomField(0) |
---|
1280 | ,m_neutralChromaIndicationFlag(false) |
---|
1281 | ,m_fieldSeqFlag(false) |
---|
1282 | ,m_frameFieldInfoPresentFlag(false) |
---|
1283 | ,m_hrdParametersPresentFlag(false) |
---|
1284 | ,m_bitstreamRestrictionFlag(false) |
---|
1285 | ,m_tilesFixedStructureFlag(false) |
---|
1286 | ,m_motionVectorsOverPicBoundariesFlag(true) |
---|
1287 | ,m_restrictedRefPicListsFlag(1) |
---|
1288 | ,m_minSpatialSegmentationIdc(0) |
---|
1289 | ,m_maxBytesPerPicDenom(2) |
---|
1290 | ,m_maxBitsPerMinCuDenom(1) |
---|
1291 | ,m_log2MaxMvLengthHorizontal(15) |
---|
1292 | ,m_log2MaxMvLengthVertical(15) |
---|
1293 | {} |
---|
1294 | |
---|
1295 | virtual ~TComVUI() {} |
---|
1296 | |
---|
1297 | Bool getAspectRatioInfoPresentFlag() { return m_aspectRatioInfoPresentFlag; } |
---|
1298 | Void setAspectRatioInfoPresentFlag(Bool i) { m_aspectRatioInfoPresentFlag = i; } |
---|
1299 | |
---|
1300 | Int getAspectRatioIdc() { return m_aspectRatioIdc; } |
---|
1301 | Void setAspectRatioIdc(Int i) { m_aspectRatioIdc = i; } |
---|
1302 | |
---|
1303 | Int getSarWidth() { return m_sarWidth; } |
---|
1304 | Void setSarWidth(Int i) { m_sarWidth = i; } |
---|
1305 | |
---|
1306 | Int getSarHeight() { return m_sarHeight; } |
---|
1307 | Void setSarHeight(Int i) { m_sarHeight = i; } |
---|
1308 | |
---|
1309 | Bool getOverscanInfoPresentFlag() { return m_overscanInfoPresentFlag; } |
---|
1310 | Void setOverscanInfoPresentFlag(Bool i) { m_overscanInfoPresentFlag = i; } |
---|
1311 | |
---|
1312 | Bool getOverscanAppropriateFlag() { return m_overscanAppropriateFlag; } |
---|
1313 | Void setOverscanAppropriateFlag(Bool i) { m_overscanAppropriateFlag = i; } |
---|
1314 | |
---|
1315 | Bool getVideoSignalTypePresentFlag() { return m_videoSignalTypePresentFlag; } |
---|
1316 | Void setVideoSignalTypePresentFlag(Bool i) { m_videoSignalTypePresentFlag = i; } |
---|
1317 | |
---|
1318 | Int getVideoFormat() { return m_videoFormat; } |
---|
1319 | Void setVideoFormat(Int i) { m_videoFormat = i; } |
---|
1320 | |
---|
1321 | Bool getVideoFullRangeFlag() { return m_videoFullRangeFlag; } |
---|
1322 | Void setVideoFullRangeFlag(Bool i) { m_videoFullRangeFlag = i; } |
---|
1323 | |
---|
1324 | Bool getColourDescriptionPresentFlag() { return m_colourDescriptionPresentFlag; } |
---|
1325 | Void setColourDescriptionPresentFlag(Bool i) { m_colourDescriptionPresentFlag = i; } |
---|
1326 | |
---|
1327 | Int getColourPrimaries() { return m_colourPrimaries; } |
---|
1328 | Void setColourPrimaries(Int i) { m_colourPrimaries = i; } |
---|
1329 | |
---|
1330 | Int getTransferCharacteristics() { return m_transferCharacteristics; } |
---|
1331 | Void setTransferCharacteristics(Int i) { m_transferCharacteristics = i; } |
---|
1332 | |
---|
1333 | Int getMatrixCoefficients() { return m_matrixCoefficients; } |
---|
1334 | Void setMatrixCoefficients(Int i) { m_matrixCoefficients = i; } |
---|
1335 | |
---|
1336 | Bool getChromaLocInfoPresentFlag() { return m_chromaLocInfoPresentFlag; } |
---|
1337 | Void setChromaLocInfoPresentFlag(Bool i) { m_chromaLocInfoPresentFlag = i; } |
---|
1338 | |
---|
1339 | Int getChromaSampleLocTypeTopField() { return m_chromaSampleLocTypeTopField; } |
---|
1340 | Void setChromaSampleLocTypeTopField(Int i) { m_chromaSampleLocTypeTopField = i; } |
---|
1341 | |
---|
1342 | Int getChromaSampleLocTypeBottomField() { return m_chromaSampleLocTypeBottomField; } |
---|
1343 | Void setChromaSampleLocTypeBottomField(Int i) { m_chromaSampleLocTypeBottomField = i; } |
---|
1344 | |
---|
1345 | Bool getNeutralChromaIndicationFlag() { return m_neutralChromaIndicationFlag; } |
---|
1346 | Void setNeutralChromaIndicationFlag(Bool i) { m_neutralChromaIndicationFlag = i; } |
---|
1347 | |
---|
1348 | Bool getFieldSeqFlag() { return m_fieldSeqFlag; } |
---|
1349 | Void setFieldSeqFlag(Bool i) { m_fieldSeqFlag = i; } |
---|
1350 | |
---|
1351 | Bool getFrameFieldInfoPresentFlag() { return m_frameFieldInfoPresentFlag; } |
---|
1352 | Void setFrameFieldInfoPresentFlag(Bool i) { m_frameFieldInfoPresentFlag = i; } |
---|
1353 | |
---|
1354 | Window& getDefaultDisplayWindow() { return m_defaultDisplayWindow; } |
---|
1355 | Void setDefaultDisplayWindow(Window& defaultDisplayWindow ) { m_defaultDisplayWindow = defaultDisplayWindow; } |
---|
1356 | |
---|
1357 | Bool getHrdParametersPresentFlag() { return m_hrdParametersPresentFlag; } |
---|
1358 | Void setHrdParametersPresentFlag(Bool i) { m_hrdParametersPresentFlag = i; } |
---|
1359 | |
---|
1360 | Bool getBitstreamRestrictionFlag() { return m_bitstreamRestrictionFlag; } |
---|
1361 | Void setBitstreamRestrictionFlag(Bool i) { m_bitstreamRestrictionFlag = i; } |
---|
1362 | |
---|
1363 | Bool getTilesFixedStructureFlag() { return m_tilesFixedStructureFlag; } |
---|
1364 | Void setTilesFixedStructureFlag(Bool i) { m_tilesFixedStructureFlag = i; } |
---|
1365 | |
---|
1366 | Bool getMotionVectorsOverPicBoundariesFlag() { return m_motionVectorsOverPicBoundariesFlag; } |
---|
1367 | Void setMotionVectorsOverPicBoundariesFlag(Bool i) { m_motionVectorsOverPicBoundariesFlag = i; } |
---|
1368 | |
---|
1369 | Bool getRestrictedRefPicListsFlag() { return m_restrictedRefPicListsFlag; } |
---|
1370 | Void setRestrictedRefPicListsFlag(Bool b) { m_restrictedRefPicListsFlag = b; } |
---|
1371 | |
---|
1372 | Int getMinSpatialSegmentationIdc() { return m_minSpatialSegmentationIdc; } |
---|
1373 | Void setMinSpatialSegmentationIdc(Int i) { m_minSpatialSegmentationIdc = i; } |
---|
1374 | Int getMaxBytesPerPicDenom() { return m_maxBytesPerPicDenom; } |
---|
1375 | Void setMaxBytesPerPicDenom(Int i) { m_maxBytesPerPicDenom = i; } |
---|
1376 | |
---|
1377 | Int getMaxBitsPerMinCuDenom() { return m_maxBitsPerMinCuDenom; } |
---|
1378 | Void setMaxBitsPerMinCuDenom(Int i) { m_maxBitsPerMinCuDenom = i; } |
---|
1379 | |
---|
1380 | Int getLog2MaxMvLengthHorizontal() { return m_log2MaxMvLengthHorizontal; } |
---|
1381 | Void setLog2MaxMvLengthHorizontal(Int i) { m_log2MaxMvLengthHorizontal = i; } |
---|
1382 | |
---|
1383 | Int getLog2MaxMvLengthVertical() { return m_log2MaxMvLengthVertical; } |
---|
1384 | Void setLog2MaxMvLengthVertical(Int i) { m_log2MaxMvLengthVertical = i; } |
---|
1385 | |
---|
1386 | TComHRD* getHrdParameters () { return &m_hrdParameters; } |
---|
1387 | TimingInfo* getTimingInfo() { return &m_timingInfo; } |
---|
1388 | }; |
---|
1389 | |
---|
1390 | /// SPS class |
---|
1391 | class TComSPS |
---|
1392 | { |
---|
1393 | private: |
---|
1394 | Int m_SPSId; |
---|
1395 | Int m_VPSId; |
---|
1396 | #if AUXILIARY_PICTURES |
---|
1397 | ChromaFormat m_chromaFormatIdc; |
---|
1398 | #else |
---|
1399 | Int m_chromaFormatIdc; |
---|
1400 | #endif |
---|
1401 | |
---|
1402 | UInt m_uiMaxTLayers; // maximum number of temporal layers |
---|
1403 | |
---|
1404 | // Structure |
---|
1405 | UInt m_picWidthInLumaSamples; |
---|
1406 | UInt m_picHeightInLumaSamples; |
---|
1407 | |
---|
1408 | Int m_log2MinCodingBlockSize; |
---|
1409 | Int m_log2DiffMaxMinCodingBlockSize; |
---|
1410 | UInt m_uiMaxCUWidth; |
---|
1411 | UInt m_uiMaxCUHeight; |
---|
1412 | UInt m_uiMaxCUDepth; |
---|
1413 | |
---|
1414 | Window m_conformanceWindow; |
---|
1415 | |
---|
1416 | TComRPSList m_RPSList; |
---|
1417 | Bool m_bLongTermRefsPresent; |
---|
1418 | Bool m_TMVPFlagsPresent; |
---|
1419 | Int m_numReorderPics[MAX_TLAYER]; |
---|
1420 | |
---|
1421 | // Tool list |
---|
1422 | UInt m_uiQuadtreeTULog2MaxSize; |
---|
1423 | UInt m_uiQuadtreeTULog2MinSize; |
---|
1424 | UInt m_uiQuadtreeTUMaxDepthInter; |
---|
1425 | UInt m_uiQuadtreeTUMaxDepthIntra; |
---|
1426 | Bool m_usePCM; |
---|
1427 | UInt m_pcmLog2MaxSize; |
---|
1428 | UInt m_uiPCMLog2MinSize; |
---|
1429 | Bool m_useAMP; |
---|
1430 | |
---|
1431 | // Parameter |
---|
1432 | Int m_bitDepthY; |
---|
1433 | Int m_bitDepthC; |
---|
1434 | Int m_qpBDOffsetY; |
---|
1435 | Int m_qpBDOffsetC; |
---|
1436 | |
---|
1437 | UInt m_uiPCMBitDepthLuma; |
---|
1438 | UInt m_uiPCMBitDepthChroma; |
---|
1439 | Bool m_bPCMFilterDisableFlag; |
---|
1440 | |
---|
1441 | UInt m_uiBitsForPOC; |
---|
1442 | UInt m_numLongTermRefPicSPS; |
---|
1443 | UInt m_ltRefPicPocLsbSps[33]; |
---|
1444 | Bool m_usedByCurrPicLtSPSFlag[33]; |
---|
1445 | // Max physical transform size |
---|
1446 | UInt m_uiMaxTrSize; |
---|
1447 | |
---|
1448 | Int m_iAMPAcc[MAX_CU_DEPTH]; |
---|
1449 | Bool m_bUseSAO; |
---|
1450 | |
---|
1451 | Bool m_bTemporalIdNestingFlag; // temporal_id_nesting_flag |
---|
1452 | |
---|
1453 | Bool m_scalingListEnabledFlag; |
---|
1454 | Bool m_scalingListPresentFlag; |
---|
1455 | TComScalingList* m_scalingList; //!< ScalingList class pointer |
---|
1456 | UInt m_uiMaxDecPicBuffering[MAX_TLAYER]; |
---|
1457 | UInt m_uiMaxLatencyIncrease[MAX_TLAYER]; // Really max latency increase plus 1 (value 0 expresses no limit) |
---|
1458 | |
---|
1459 | Bool m_useDF; |
---|
1460 | Bool m_useStrongIntraSmoothing; |
---|
1461 | |
---|
1462 | Bool m_vuiParametersPresentFlag; |
---|
1463 | TComVUI m_vuiParameters; |
---|
1464 | |
---|
1465 | static const Int m_winUnitX[MAX_CHROMA_FORMAT_IDC+1]; |
---|
1466 | static const Int m_winUnitY[MAX_CHROMA_FORMAT_IDC+1]; |
---|
1467 | TComPTL m_pcPTL; |
---|
1468 | |
---|
1469 | #if SVC_EXTENSION |
---|
1470 | UInt m_layerId; |
---|
1471 | UInt m_numScaledRefLayerOffsets; |
---|
1472 | #if P0312_VERT_PHASE_ADJ |
---|
1473 | Bool m_vertPhasePositionEnableFlag[MAX_LAYERS]; |
---|
1474 | #endif |
---|
1475 | #if O0098_SCALED_REF_LAYER_ID |
---|
1476 | UInt m_scaledRefLayerId[MAX_LAYERS]; |
---|
1477 | #endif |
---|
1478 | Window m_scaledRefLayerWindow[MAX_LAYERS]; |
---|
1479 | #if REPN_FORMAT_IN_VPS |
---|
1480 | Bool m_updateRepFormatFlag; |
---|
1481 | #if O0096_REP_FORMAT_INDEX |
---|
1482 | UInt m_updateRepFormatIndex; |
---|
1483 | #endif |
---|
1484 | #endif |
---|
1485 | #if SCALINGLIST_INFERRING |
---|
1486 | Bool m_inferScalingListFlag; |
---|
1487 | UInt m_scalingListRefLayerId; |
---|
1488 | #endif |
---|
1489 | #endif //SVC_EXTENSION |
---|
1490 | public: |
---|
1491 | TComSPS(); |
---|
1492 | virtual ~TComSPS(); |
---|
1493 | |
---|
1494 | Int getVPSId () { return m_VPSId; } |
---|
1495 | Void setVPSId (Int i) { m_VPSId = i; } |
---|
1496 | Int getSPSId () { return m_SPSId; } |
---|
1497 | Void setSPSId (Int i) { m_SPSId = i; } |
---|
1498 | |
---|
1499 | #if AUXILIARY_PICTURES |
---|
1500 | ChromaFormat getChromaFormatIdc () { return m_chromaFormatIdc; } |
---|
1501 | Void setChromaFormatIdc (ChromaFormat i) { m_chromaFormatIdc = i; } |
---|
1502 | |
---|
1503 | static Int getWinUnitX (Int chromaFormatIdc) { assert (chromaFormatIdc >= 0 && chromaFormatIdc <= MAX_CHROMA_FORMAT_IDC); return m_winUnitX[chromaFormatIdc]; } |
---|
1504 | static Int getWinUnitY (Int chromaFormatIdc) { assert (chromaFormatIdc >= 0 && chromaFormatIdc <= MAX_CHROMA_FORMAT_IDC); return m_winUnitY[chromaFormatIdc]; } |
---|
1505 | #else |
---|
1506 | Int getChromaFormatIdc () { return m_chromaFormatIdc; } |
---|
1507 | Void setChromaFormatIdc (Int i) { m_chromaFormatIdc = i; } |
---|
1508 | |
---|
1509 | static Int getWinUnitX (Int chromaFormatIdc) { assert (chromaFormatIdc > 0 && chromaFormatIdc <= MAX_CHROMA_FORMAT_IDC); return m_winUnitX[chromaFormatIdc]; } |
---|
1510 | static Int getWinUnitY (Int chromaFormatIdc) { assert (chromaFormatIdc > 0 && chromaFormatIdc <= MAX_CHROMA_FORMAT_IDC); return m_winUnitY[chromaFormatIdc]; } |
---|
1511 | #endif |
---|
1512 | |
---|
1513 | // structure |
---|
1514 | Void setPicWidthInLumaSamples ( UInt u ) { m_picWidthInLumaSamples = u; } |
---|
1515 | UInt getPicWidthInLumaSamples () { return m_picWidthInLumaSamples; } |
---|
1516 | Void setPicHeightInLumaSamples ( UInt u ) { m_picHeightInLumaSamples = u; } |
---|
1517 | UInt getPicHeightInLumaSamples () { return m_picHeightInLumaSamples; } |
---|
1518 | |
---|
1519 | Window& getConformanceWindow() { return m_conformanceWindow; } |
---|
1520 | Void setConformanceWindow(Window& conformanceWindow ) { m_conformanceWindow = conformanceWindow; } |
---|
1521 | |
---|
1522 | UInt getNumLongTermRefPicSPS() { return m_numLongTermRefPicSPS; } |
---|
1523 | Void setNumLongTermRefPicSPS(UInt val) { m_numLongTermRefPicSPS = val; } |
---|
1524 | |
---|
1525 | UInt getLtRefPicPocLsbSps(UInt index) { return m_ltRefPicPocLsbSps[index]; } |
---|
1526 | Void setLtRefPicPocLsbSps(UInt index, UInt val) { m_ltRefPicPocLsbSps[index] = val; } |
---|
1527 | |
---|
1528 | Bool getUsedByCurrPicLtSPSFlag(Int i) {return m_usedByCurrPicLtSPSFlag[i];} |
---|
1529 | Void setUsedByCurrPicLtSPSFlag(Int i, Bool x) { m_usedByCurrPicLtSPSFlag[i] = x;} |
---|
1530 | |
---|
1531 | Int getLog2MinCodingBlockSize() const { return m_log2MinCodingBlockSize; } |
---|
1532 | Void setLog2MinCodingBlockSize(Int val) { m_log2MinCodingBlockSize = val; } |
---|
1533 | Int getLog2DiffMaxMinCodingBlockSize() const { return m_log2DiffMaxMinCodingBlockSize; } |
---|
1534 | Void setLog2DiffMaxMinCodingBlockSize(Int val) { m_log2DiffMaxMinCodingBlockSize = val; } |
---|
1535 | |
---|
1536 | Void setMaxCUWidth ( UInt u ) { m_uiMaxCUWidth = u; } |
---|
1537 | UInt getMaxCUWidth () { return m_uiMaxCUWidth; } |
---|
1538 | Void setMaxCUHeight ( UInt u ) { m_uiMaxCUHeight = u; } |
---|
1539 | UInt getMaxCUHeight () { return m_uiMaxCUHeight; } |
---|
1540 | Void setMaxCUDepth ( UInt u ) { m_uiMaxCUDepth = u; } |
---|
1541 | UInt getMaxCUDepth () { return m_uiMaxCUDepth; } |
---|
1542 | Void setUsePCM ( Bool b ) { m_usePCM = b; } |
---|
1543 | Bool getUsePCM () { return m_usePCM; } |
---|
1544 | Void setPCMLog2MaxSize ( UInt u ) { m_pcmLog2MaxSize = u; } |
---|
1545 | UInt getPCMLog2MaxSize () { return m_pcmLog2MaxSize; } |
---|
1546 | Void setPCMLog2MinSize ( UInt u ) { m_uiPCMLog2MinSize = u; } |
---|
1547 | UInt getPCMLog2MinSize () { return m_uiPCMLog2MinSize; } |
---|
1548 | Void setBitsForPOC ( UInt u ) { m_uiBitsForPOC = u; } |
---|
1549 | UInt getBitsForPOC () { return m_uiBitsForPOC; } |
---|
1550 | Bool getUseAMP() { return m_useAMP; } |
---|
1551 | Void setUseAMP( Bool b ) { m_useAMP = b; } |
---|
1552 | Void setQuadtreeTULog2MaxSize( UInt u ) { m_uiQuadtreeTULog2MaxSize = u; } |
---|
1553 | UInt getQuadtreeTULog2MaxSize() { return m_uiQuadtreeTULog2MaxSize; } |
---|
1554 | Void setQuadtreeTULog2MinSize( UInt u ) { m_uiQuadtreeTULog2MinSize = u; } |
---|
1555 | UInt getQuadtreeTULog2MinSize() { return m_uiQuadtreeTULog2MinSize; } |
---|
1556 | Void setQuadtreeTUMaxDepthInter( UInt u ) { m_uiQuadtreeTUMaxDepthInter = u; } |
---|
1557 | Void setQuadtreeTUMaxDepthIntra( UInt u ) { m_uiQuadtreeTUMaxDepthIntra = u; } |
---|
1558 | UInt getQuadtreeTUMaxDepthInter() { return m_uiQuadtreeTUMaxDepthInter; } |
---|
1559 | UInt getQuadtreeTUMaxDepthIntra() { return m_uiQuadtreeTUMaxDepthIntra; } |
---|
1560 | Void setNumReorderPics(Int i, UInt tlayer) { m_numReorderPics[tlayer] = i; } |
---|
1561 | Int getNumReorderPics(UInt tlayer) { return m_numReorderPics[tlayer]; } |
---|
1562 | Void createRPSList( Int numRPS ); |
---|
1563 | TComRPSList* getRPSList() { return &m_RPSList; } |
---|
1564 | Bool getLongTermRefsPresent() { return m_bLongTermRefsPresent; } |
---|
1565 | Void setLongTermRefsPresent(Bool b) { m_bLongTermRefsPresent=b; } |
---|
1566 | Bool getTMVPFlagsPresent() { return m_TMVPFlagsPresent; } |
---|
1567 | Void setTMVPFlagsPresent(Bool b) { m_TMVPFlagsPresent=b; } |
---|
1568 | // physical transform |
---|
1569 | Void setMaxTrSize ( UInt u ) { m_uiMaxTrSize = u; } |
---|
1570 | UInt getMaxTrSize () { return m_uiMaxTrSize; } |
---|
1571 | |
---|
1572 | // AMP accuracy |
---|
1573 | Int getAMPAcc ( UInt uiDepth ) { return m_iAMPAcc[uiDepth]; } |
---|
1574 | Void setAMPAcc ( UInt uiDepth, Int iAccu ) { assert( uiDepth < g_uiMaxCUDepth); m_iAMPAcc[uiDepth] = iAccu; } |
---|
1575 | |
---|
1576 | // Bit-depth |
---|
1577 | Int getBitDepthY() { return m_bitDepthY; } |
---|
1578 | Void setBitDepthY(Int u) { m_bitDepthY = u; } |
---|
1579 | Int getBitDepthC() { return m_bitDepthC; } |
---|
1580 | Void setBitDepthC(Int u) { m_bitDepthC = u; } |
---|
1581 | Int getQpBDOffsetY () { return m_qpBDOffsetY; } |
---|
1582 | Void setQpBDOffsetY ( Int value ) { m_qpBDOffsetY = value; } |
---|
1583 | Int getQpBDOffsetC () { return m_qpBDOffsetC; } |
---|
1584 | Void setQpBDOffsetC ( Int value ) { m_qpBDOffsetC = value; } |
---|
1585 | Void setUseSAO (Bool bVal) {m_bUseSAO = bVal;} |
---|
1586 | Bool getUseSAO () {return m_bUseSAO;} |
---|
1587 | |
---|
1588 | UInt getMaxTLayers() { return m_uiMaxTLayers; } |
---|
1589 | Void setMaxTLayers( UInt uiMaxTLayers ) { assert( uiMaxTLayers <= MAX_TLAYER ); m_uiMaxTLayers = uiMaxTLayers; } |
---|
1590 | |
---|
1591 | Bool getTemporalIdNestingFlag() { return m_bTemporalIdNestingFlag; } |
---|
1592 | Void setTemporalIdNestingFlag( Bool bValue ) { m_bTemporalIdNestingFlag = bValue; } |
---|
1593 | UInt getPCMBitDepthLuma () { return m_uiPCMBitDepthLuma; } |
---|
1594 | Void setPCMBitDepthLuma ( UInt u ) { m_uiPCMBitDepthLuma = u; } |
---|
1595 | UInt getPCMBitDepthChroma () { return m_uiPCMBitDepthChroma; } |
---|
1596 | Void setPCMBitDepthChroma ( UInt u ) { m_uiPCMBitDepthChroma = u; } |
---|
1597 | Void setPCMFilterDisableFlag ( Bool bValue ) { m_bPCMFilterDisableFlag = bValue; } |
---|
1598 | Bool getPCMFilterDisableFlag () { return m_bPCMFilterDisableFlag; } |
---|
1599 | |
---|
1600 | Bool getScalingListFlag () { return m_scalingListEnabledFlag; } |
---|
1601 | Void setScalingListFlag ( Bool b ) { m_scalingListEnabledFlag = b; } |
---|
1602 | Bool getScalingListPresentFlag() { return m_scalingListPresentFlag; } |
---|
1603 | Void setScalingListPresentFlag( Bool b ) { m_scalingListPresentFlag = b; } |
---|
1604 | |
---|
1605 | #if SCALINGLIST_INFERRING |
---|
1606 | Void setScalingList( TComScalingList *scalingList ) { m_scalingList = scalingList; } |
---|
1607 | #else |
---|
1608 | Void setScalingList ( TComScalingList *scalingList); |
---|
1609 | #endif |
---|
1610 | TComScalingList* getScalingList () { return m_scalingList; } //!< get ScalingList class pointer in SPS |
---|
1611 | UInt getMaxDecPicBuffering (UInt tlayer) { return m_uiMaxDecPicBuffering[tlayer]; } |
---|
1612 | Void setMaxDecPicBuffering ( UInt ui, UInt tlayer ) { assert(tlayer < MAX_TLAYER); m_uiMaxDecPicBuffering[tlayer] = ui; } |
---|
1613 | UInt getMaxLatencyIncrease (UInt tlayer) { return m_uiMaxLatencyIncrease[tlayer]; } |
---|
1614 | Void setMaxLatencyIncrease ( UInt ui , UInt tlayer) { m_uiMaxLatencyIncrease[tlayer] = ui; } |
---|
1615 | |
---|
1616 | Void setUseStrongIntraSmoothing (Bool bVal) {m_useStrongIntraSmoothing = bVal;} |
---|
1617 | Bool getUseStrongIntraSmoothing () {return m_useStrongIntraSmoothing;} |
---|
1618 | |
---|
1619 | Bool getVuiParametersPresentFlag() { return m_vuiParametersPresentFlag; } |
---|
1620 | Void setVuiParametersPresentFlag(Bool b) { m_vuiParametersPresentFlag = b; } |
---|
1621 | TComVUI* getVuiParameters() { return &m_vuiParameters; } |
---|
1622 | Void setHrdParameters( UInt frameRate, UInt numDU, UInt bitRate, Bool randomAccess ); |
---|
1623 | |
---|
1624 | TComPTL* getPTL() { return &m_pcPTL; } |
---|
1625 | |
---|
1626 | #if SVC_EXTENSION |
---|
1627 | Void setLayerId(UInt layerId) { m_layerId = layerId; } |
---|
1628 | UInt getLayerId() { return m_layerId; } |
---|
1629 | UInt getNumScaledRefLayerOffsets() { return m_numScaledRefLayerOffsets; } |
---|
1630 | Void setNumScaledRefLayerOffsets(Int x) { m_numScaledRefLayerOffsets = x; } |
---|
1631 | #if P0312_VERT_PHASE_ADJ |
---|
1632 | Bool getVertPhasePositionEnableFlag(Int x) { return m_vertPhasePositionEnableFlag[x]; } |
---|
1633 | Void setVertPhasePositionEnableFlag(Int x, Bool b) { m_vertPhasePositionEnableFlag[x] = b; } |
---|
1634 | #endif |
---|
1635 | #if O0098_SCALED_REF_LAYER_ID |
---|
1636 | UInt getScaledRefLayerId(Int x) { return m_scaledRefLayerId[x]; } |
---|
1637 | Void setScaledRefLayerId(Int x, UInt id) { m_scaledRefLayerId[x] = id; } |
---|
1638 | Window& getScaledRefLayerWindowForLayer( Int layerId ); |
---|
1639 | #endif |
---|
1640 | Window& getScaledRefLayerWindow( Int x ) { return m_scaledRefLayerWindow[x]; } |
---|
1641 | #if REPN_FORMAT_IN_VPS |
---|
1642 | Bool getUpdateRepFormatFlag() { return m_updateRepFormatFlag; } |
---|
1643 | Void setUpdateRepFormatFlag(Bool x) { m_updateRepFormatFlag = x; } |
---|
1644 | #if O0096_REP_FORMAT_INDEX |
---|
1645 | Int getUpdateRepFormatIndex() { return m_updateRepFormatIndex; } |
---|
1646 | Void setUpdateRepFormatIndex(UInt index) { m_updateRepFormatIndex = index; } |
---|
1647 | #endif |
---|
1648 | #endif |
---|
1649 | #if SCALINGLIST_INFERRING |
---|
1650 | Bool getInferScalingListFlag() { return m_inferScalingListFlag; } |
---|
1651 | UInt getScalingListRefLayerId() { return m_scalingListRefLayerId; } |
---|
1652 | Void setInferScalingListFlag( Bool flag ) { m_inferScalingListFlag = flag; } |
---|
1653 | Void setScalingListRefLayerId( UInt layerId ) { m_scalingListRefLayerId = layerId; } |
---|
1654 | #endif |
---|
1655 | #endif //SVC_EXTENSION |
---|
1656 | }; |
---|
1657 | |
---|
1658 | /// Reference Picture Lists class |
---|
1659 | class TComRefPicListModification |
---|
1660 | { |
---|
1661 | private: |
---|
1662 | UInt m_bRefPicListModificationFlagL0; |
---|
1663 | UInt m_bRefPicListModificationFlagL1; |
---|
1664 | UInt m_RefPicSetIdxL0[32]; |
---|
1665 | UInt m_RefPicSetIdxL1[32]; |
---|
1666 | |
---|
1667 | public: |
---|
1668 | TComRefPicListModification(); |
---|
1669 | virtual ~TComRefPicListModification(); |
---|
1670 | |
---|
1671 | Void create (); |
---|
1672 | Void destroy (); |
---|
1673 | |
---|
1674 | Bool getRefPicListModificationFlagL0() { return m_bRefPicListModificationFlagL0; } |
---|
1675 | Void setRefPicListModificationFlagL0(Bool flag) { m_bRefPicListModificationFlagL0 = flag; } |
---|
1676 | Bool getRefPicListModificationFlagL1() { return m_bRefPicListModificationFlagL1; } |
---|
1677 | Void setRefPicListModificationFlagL1(Bool flag) { m_bRefPicListModificationFlagL1 = flag; } |
---|
1678 | Void setRefPicSetIdxL0(UInt idx, UInt refPicSetIdx) { m_RefPicSetIdxL0[idx] = refPicSetIdx; } |
---|
1679 | UInt getRefPicSetIdxL0(UInt idx) { return m_RefPicSetIdxL0[idx]; } |
---|
1680 | Void setRefPicSetIdxL1(UInt idx, UInt refPicSetIdx) { m_RefPicSetIdxL1[idx] = refPicSetIdx; } |
---|
1681 | UInt getRefPicSetIdxL1(UInt idx) { return m_RefPicSetIdxL1[idx]; } |
---|
1682 | }; |
---|
1683 | |
---|
1684 | /// PPS class |
---|
1685 | class TComPPS |
---|
1686 | { |
---|
1687 | private: |
---|
1688 | Int m_PPSId; // pic_parameter_set_id |
---|
1689 | Int m_SPSId; // seq_parameter_set_id |
---|
1690 | Int m_picInitQPMinus26; |
---|
1691 | Bool m_useDQP; |
---|
1692 | Bool m_bConstrainedIntraPred; // constrained_intra_pred_flag |
---|
1693 | Bool m_bSliceChromaQpFlag; // slicelevel_chroma_qp_flag |
---|
1694 | |
---|
1695 | // access channel |
---|
1696 | TComSPS* m_pcSPS; |
---|
1697 | UInt m_uiMaxCuDQPDepth; |
---|
1698 | UInt m_uiMinCuDQPSize; |
---|
1699 | |
---|
1700 | Int m_chromaCbQpOffset; |
---|
1701 | Int m_chromaCrQpOffset; |
---|
1702 | |
---|
1703 | UInt m_numRefIdxL0DefaultActive; |
---|
1704 | UInt m_numRefIdxL1DefaultActive; |
---|
1705 | |
---|
1706 | Bool m_bUseWeightPred; // Use of Weighting Prediction (P_SLICE) |
---|
1707 | Bool m_useWeightedBiPred; // Use of Weighting Bi-Prediction (B_SLICE) |
---|
1708 | Bool m_OutputFlagPresentFlag; // Indicates the presence of output_flag in slice header |
---|
1709 | |
---|
1710 | Bool m_TransquantBypassEnableFlag; // Indicates presence of cu_transquant_bypass_flag in CUs. |
---|
1711 | Bool m_useTransformSkip; |
---|
1712 | Bool m_dependentSliceSegmentsEnabledFlag; //!< Indicates the presence of dependent slices |
---|
1713 | Bool m_tilesEnabledFlag; //!< Indicates the presence of tiles |
---|
1714 | Bool m_entropyCodingSyncEnabledFlag; //!< Indicates the presence of wavefronts |
---|
1715 | |
---|
1716 | Bool m_loopFilterAcrossTilesEnabledFlag; |
---|
1717 | Int m_uniformSpacingFlag; |
---|
1718 | Int m_iNumColumnsMinus1; |
---|
1719 | UInt* m_puiColumnWidth; |
---|
1720 | Int m_iNumRowsMinus1; |
---|
1721 | UInt* m_puiRowHeight; |
---|
1722 | |
---|
1723 | Int m_iNumSubstreams; |
---|
1724 | |
---|
1725 | Int m_signHideFlag; |
---|
1726 | |
---|
1727 | Bool m_cabacInitPresentFlag; |
---|
1728 | UInt m_encCABACTableIdx; // Used to transmit table selection across slices |
---|
1729 | |
---|
1730 | Bool m_sliceHeaderExtensionPresentFlag; |
---|
1731 | Bool m_loopFilterAcrossSlicesEnabledFlag; |
---|
1732 | Bool m_deblockingFilterControlPresentFlag; |
---|
1733 | Bool m_deblockingFilterOverrideEnabledFlag; |
---|
1734 | Bool m_picDisableDeblockingFilterFlag; |
---|
1735 | Int m_deblockingFilterBetaOffsetDiv2; //< beta offset for deblocking filter |
---|
1736 | Int m_deblockingFilterTcOffsetDiv2; //< tc offset for deblocking filter |
---|
1737 | Bool m_scalingListPresentFlag; |
---|
1738 | TComScalingList* m_scalingList; //!< ScalingList class pointer |
---|
1739 | Bool m_listsModificationPresentFlag; |
---|
1740 | UInt m_log2ParallelMergeLevelMinus2; |
---|
1741 | Int m_numExtraSliceHeaderBits; |
---|
1742 | |
---|
1743 | #if SVC_EXTENSION |
---|
1744 | #if SCALINGLIST_INFERRING |
---|
1745 | UInt m_layerId; |
---|
1746 | Bool m_inferScalingListFlag; |
---|
1747 | UInt m_scalingListRefLayerId; |
---|
1748 | #endif |
---|
1749 | #if POC_RESET_IDC |
---|
1750 | Bool m_pocResetInfoPresentFlag; |
---|
1751 | #endif |
---|
1752 | #if Q0048_CGS_3D_ASYMLUT |
---|
1753 | Int m_nCGSFlag; |
---|
1754 | Int m_nCGSOutputBitDepthY; // not for syntax |
---|
1755 | Int m_nCGSOutputBitDepthC; // not for syntax |
---|
1756 | #endif |
---|
1757 | #endif |
---|
1758 | |
---|
1759 | public: |
---|
1760 | TComPPS(); |
---|
1761 | virtual ~TComPPS(); |
---|
1762 | |
---|
1763 | Int getPPSId () { return m_PPSId; } |
---|
1764 | Void setPPSId (Int i) { m_PPSId = i; } |
---|
1765 | Int getSPSId () { return m_SPSId; } |
---|
1766 | Void setSPSId (Int i) { m_SPSId = i; } |
---|
1767 | |
---|
1768 | Int getPicInitQPMinus26 () { return m_picInitQPMinus26; } |
---|
1769 | Void setPicInitQPMinus26 ( Int i ) { m_picInitQPMinus26 = i; } |
---|
1770 | Bool getUseDQP () { return m_useDQP; } |
---|
1771 | Void setUseDQP ( Bool b ) { m_useDQP = b; } |
---|
1772 | Bool getConstrainedIntraPred () { return m_bConstrainedIntraPred; } |
---|
1773 | Void setConstrainedIntraPred ( Bool b ) { m_bConstrainedIntraPred = b; } |
---|
1774 | Bool getSliceChromaQpFlag () { return m_bSliceChromaQpFlag; } |
---|
1775 | Void setSliceChromaQpFlag ( Bool b ) { m_bSliceChromaQpFlag = b; } |
---|
1776 | |
---|
1777 | Void setSPS ( TComSPS* pcSPS ) { m_pcSPS = pcSPS; } |
---|
1778 | TComSPS* getSPS () { return m_pcSPS; } |
---|
1779 | Void setMaxCuDQPDepth ( UInt u ) { m_uiMaxCuDQPDepth = u; } |
---|
1780 | UInt getMaxCuDQPDepth () { return m_uiMaxCuDQPDepth;} |
---|
1781 | Void setMinCuDQPSize ( UInt u ) { m_uiMinCuDQPSize = u; } |
---|
1782 | UInt getMinCuDQPSize () { return m_uiMinCuDQPSize; } |
---|
1783 | |
---|
1784 | Void setChromaCbQpOffset( Int i ) { m_chromaCbQpOffset = i; } |
---|
1785 | Int getChromaCbQpOffset() { return m_chromaCbQpOffset; } |
---|
1786 | Void setChromaCrQpOffset( Int i ) { m_chromaCrQpOffset = i; } |
---|
1787 | Int getChromaCrQpOffset() { return m_chromaCrQpOffset; } |
---|
1788 | |
---|
1789 | Void setNumRefIdxL0DefaultActive(UInt ui) { m_numRefIdxL0DefaultActive=ui; } |
---|
1790 | UInt getNumRefIdxL0DefaultActive() { return m_numRefIdxL0DefaultActive; } |
---|
1791 | Void setNumRefIdxL1DefaultActive(UInt ui) { m_numRefIdxL1DefaultActive=ui; } |
---|
1792 | UInt getNumRefIdxL1DefaultActive() { return m_numRefIdxL1DefaultActive; } |
---|
1793 | |
---|
1794 | Bool getUseWP () { return m_bUseWeightPred; } |
---|
1795 | Bool getWPBiPred () { return m_useWeightedBiPred; } |
---|
1796 | Void setUseWP ( Bool b ) { m_bUseWeightPred = b; } |
---|
1797 | Void setWPBiPred ( Bool b ) { m_useWeightedBiPred = b; } |
---|
1798 | Void setOutputFlagPresentFlag( Bool b ) { m_OutputFlagPresentFlag = b; } |
---|
1799 | Bool getOutputFlagPresentFlag() { return m_OutputFlagPresentFlag; } |
---|
1800 | Void setTransquantBypassEnableFlag( Bool b ) { m_TransquantBypassEnableFlag = b; } |
---|
1801 | Bool getTransquantBypassEnableFlag() { return m_TransquantBypassEnableFlag; } |
---|
1802 | |
---|
1803 | Bool getUseTransformSkip () { return m_useTransformSkip; } |
---|
1804 | Void setUseTransformSkip ( Bool b ) { m_useTransformSkip = b; } |
---|
1805 | |
---|
1806 | Void setLoopFilterAcrossTilesEnabledFlag (Bool b) { m_loopFilterAcrossTilesEnabledFlag = b; } |
---|
1807 | Bool getLoopFilterAcrossTilesEnabledFlag () { return m_loopFilterAcrossTilesEnabledFlag; } |
---|
1808 | Bool getDependentSliceSegmentsEnabledFlag() const { return m_dependentSliceSegmentsEnabledFlag; } |
---|
1809 | Void setDependentSliceSegmentsEnabledFlag(Bool val) { m_dependentSliceSegmentsEnabledFlag = val; } |
---|
1810 | Bool getTilesEnabledFlag() const { return m_tilesEnabledFlag; } |
---|
1811 | Void setTilesEnabledFlag(Bool val) { m_tilesEnabledFlag = val; } |
---|
1812 | Bool getEntropyCodingSyncEnabledFlag() const { return m_entropyCodingSyncEnabledFlag; } |
---|
1813 | Void setEntropyCodingSyncEnabledFlag(Bool val) { m_entropyCodingSyncEnabledFlag = val; } |
---|
1814 | Void setUniformSpacingFlag ( Bool b ) { m_uniformSpacingFlag = b; } |
---|
1815 | Bool getUniformSpacingFlag () { return m_uniformSpacingFlag; } |
---|
1816 | Void setNumColumnsMinus1 ( Int i ) { m_iNumColumnsMinus1 = i; } |
---|
1817 | Int getNumColumnsMinus1 () { return m_iNumColumnsMinus1; } |
---|
1818 | Void setColumnWidth ( UInt* columnWidth ) |
---|
1819 | { |
---|
1820 | if( m_uniformSpacingFlag == 0 && m_iNumColumnsMinus1 > 0 ) |
---|
1821 | { |
---|
1822 | m_puiColumnWidth = new UInt[ m_iNumColumnsMinus1 ]; |
---|
1823 | |
---|
1824 | for(Int i=0; i<m_iNumColumnsMinus1; i++) |
---|
1825 | { |
---|
1826 | m_puiColumnWidth[i] = columnWidth[i]; |
---|
1827 | } |
---|
1828 | } |
---|
1829 | } |
---|
1830 | UInt getColumnWidth (UInt columnIdx) { return *( m_puiColumnWidth + columnIdx ); } |
---|
1831 | Void setNumRowsMinus1( Int i ) { m_iNumRowsMinus1 = i; } |
---|
1832 | Int getNumRowsMinus1() { return m_iNumRowsMinus1; } |
---|
1833 | Void setRowHeight ( UInt* rowHeight ) |
---|
1834 | { |
---|
1835 | if( m_uniformSpacingFlag == 0 && m_iNumRowsMinus1 > 0 ) |
---|
1836 | { |
---|
1837 | m_puiRowHeight = new UInt[ m_iNumRowsMinus1 ]; |
---|
1838 | |
---|
1839 | for(Int i=0; i<m_iNumRowsMinus1; i++) |
---|
1840 | { |
---|
1841 | m_puiRowHeight[i] = rowHeight[i]; |
---|
1842 | } |
---|
1843 | } |
---|
1844 | } |
---|
1845 | UInt getRowHeight (UInt rowIdx) { return *( m_puiRowHeight + rowIdx ); } |
---|
1846 | Void setNumSubstreams(Int iNumSubstreams) { m_iNumSubstreams = iNumSubstreams; } |
---|
1847 | Int getNumSubstreams() { return m_iNumSubstreams; } |
---|
1848 | |
---|
1849 | Void setSignHideFlag( Int signHideFlag ) { m_signHideFlag = signHideFlag; } |
---|
1850 | Int getSignHideFlag() { return m_signHideFlag; } |
---|
1851 | |
---|
1852 | Void setCabacInitPresentFlag( Bool flag ) { m_cabacInitPresentFlag = flag; } |
---|
1853 | Void setEncCABACTableIdx( Int idx ) { m_encCABACTableIdx = idx; } |
---|
1854 | Bool getCabacInitPresentFlag() { return m_cabacInitPresentFlag; } |
---|
1855 | UInt getEncCABACTableIdx() { return m_encCABACTableIdx; } |
---|
1856 | Void setDeblockingFilterControlPresentFlag( Bool val ) { m_deblockingFilterControlPresentFlag = val; } |
---|
1857 | Bool getDeblockingFilterControlPresentFlag() { return m_deblockingFilterControlPresentFlag; } |
---|
1858 | Void setDeblockingFilterOverrideEnabledFlag( Bool val ) { m_deblockingFilterOverrideEnabledFlag = val; } |
---|
1859 | Bool getDeblockingFilterOverrideEnabledFlag() { return m_deblockingFilterOverrideEnabledFlag; } |
---|
1860 | Void setPicDisableDeblockingFilterFlag(Bool val) { m_picDisableDeblockingFilterFlag = val; } //!< set offset for deblocking filter disabled |
---|
1861 | Bool getPicDisableDeblockingFilterFlag() { return m_picDisableDeblockingFilterFlag; } //!< get offset for deblocking filter disabled |
---|
1862 | Void setDeblockingFilterBetaOffsetDiv2(Int val) { m_deblockingFilterBetaOffsetDiv2 = val; } //!< set beta offset for deblocking filter |
---|
1863 | Int getDeblockingFilterBetaOffsetDiv2() { return m_deblockingFilterBetaOffsetDiv2; } //!< get beta offset for deblocking filter |
---|
1864 | Void setDeblockingFilterTcOffsetDiv2(Int val) { m_deblockingFilterTcOffsetDiv2 = val; } //!< set tc offset for deblocking filter |
---|
1865 | Int getDeblockingFilterTcOffsetDiv2() { return m_deblockingFilterTcOffsetDiv2; } //!< get tc offset for deblocking filter |
---|
1866 | Bool getScalingListPresentFlag() { return m_scalingListPresentFlag; } |
---|
1867 | Void setScalingListPresentFlag( Bool b ) { m_scalingListPresentFlag = b; } |
---|
1868 | |
---|
1869 | #if SCALINGLIST_INFERRING |
---|
1870 | UInt getLayerId() { return m_layerId; } |
---|
1871 | Void setLayerId( UInt layerId ) { m_layerId = layerId; } |
---|
1872 | Bool getInferScalingListFlag() { return m_inferScalingListFlag; } |
---|
1873 | UInt getScalingListRefLayerId() { return m_scalingListRefLayerId; } |
---|
1874 | Void setInferScalingListFlag( Bool flag ) { m_inferScalingListFlag = flag; } |
---|
1875 | Void setScalingListRefLayerId( UInt layerId ) { m_scalingListRefLayerId = layerId; } |
---|
1876 | #endif |
---|
1877 | |
---|
1878 | #if SCALINGLIST_INFERRING |
---|
1879 | Void setScalingList( TComScalingList *scalingList ) { m_scalingList = scalingList; } |
---|
1880 | #else |
---|
1881 | Void setScalingList ( TComScalingList *scalingList); |
---|
1882 | #endif |
---|
1883 | TComScalingList* getScalingList () { return m_scalingList; } //!< get ScalingList class pointer in PPS |
---|
1884 | Bool getListsModificationPresentFlag () { return m_listsModificationPresentFlag; } |
---|
1885 | Void setListsModificationPresentFlag ( Bool b ) { m_listsModificationPresentFlag = b; } |
---|
1886 | UInt getLog2ParallelMergeLevelMinus2 () { return m_log2ParallelMergeLevelMinus2; } |
---|
1887 | Void setLog2ParallelMergeLevelMinus2 (UInt mrgLevel) { m_log2ParallelMergeLevelMinus2 = mrgLevel; } |
---|
1888 | Int getNumExtraSliceHeaderBits() { return m_numExtraSliceHeaderBits; } |
---|
1889 | Void setNumExtraSliceHeaderBits(Int i) { m_numExtraSliceHeaderBits = i; } |
---|
1890 | Void setLoopFilterAcrossSlicesEnabledFlag ( Bool bValue ) { m_loopFilterAcrossSlicesEnabledFlag = bValue; } |
---|
1891 | Bool getLoopFilterAcrossSlicesEnabledFlag () { return m_loopFilterAcrossSlicesEnabledFlag; } |
---|
1892 | Bool getSliceHeaderExtensionPresentFlag () { return m_sliceHeaderExtensionPresentFlag; } |
---|
1893 | Void setSliceHeaderExtensionPresentFlag (Bool val) { m_sliceHeaderExtensionPresentFlag = val; } |
---|
1894 | #if POC_RESET_IDC |
---|
1895 | Bool getPocResetInfoPresentFlag () { return m_pocResetInfoPresentFlag; } |
---|
1896 | Void setPocResetInfoPresentFlag (const Bool val) { m_pocResetInfoPresentFlag = val; } |
---|
1897 | #endif |
---|
1898 | #if Q0048_CGS_3D_ASYMLUT |
---|
1899 | Int getCGSFlag() { return m_nCGSFlag; } |
---|
1900 | Void setCGSFlag(Int n) { m_nCGSFlag = n; } |
---|
1901 | Int getCGSOutputBitDepthY() { return m_nCGSOutputBitDepthY; } |
---|
1902 | Void setCGSOutputBitDepthY(Int n){ m_nCGSOutputBitDepthY = n; } |
---|
1903 | Int getCGSOutputBitDepthC() { return m_nCGSOutputBitDepthC; } |
---|
1904 | Void setCGSOutputBitDepthC(Int n){ m_nCGSOutputBitDepthC = n; } |
---|
1905 | #endif |
---|
1906 | }; |
---|
1907 | |
---|
1908 | typedef struct |
---|
1909 | { |
---|
1910 | // Explicit weighted prediction parameters parsed in slice header, |
---|
1911 | // or Implicit weighted prediction parameters (8 bits depth values). |
---|
1912 | Bool bPresentFlag; |
---|
1913 | UInt uiLog2WeightDenom; |
---|
1914 | Int iWeight; |
---|
1915 | Int iOffset; |
---|
1916 | |
---|
1917 | // Weighted prediction scaling values built from above parameters (bitdepth scaled): |
---|
1918 | Int w, o, offset, shift, round; |
---|
1919 | } wpScalingParam; |
---|
1920 | |
---|
1921 | typedef struct |
---|
1922 | { |
---|
1923 | Int64 iAC; |
---|
1924 | Int64 iDC; |
---|
1925 | #if O0194_WEIGHTED_PREDICTION_CGS |
---|
1926 | Int iSamples; |
---|
1927 | #endif |
---|
1928 | } wpACDCParam; |
---|
1929 | |
---|
1930 | /// slice header class |
---|
1931 | class TComSlice |
---|
1932 | { |
---|
1933 | |
---|
1934 | private: |
---|
1935 | // Bitstream writing |
---|
1936 | Bool m_saoEnabledFlag; |
---|
1937 | Bool m_saoEnabledFlagChroma; ///< SAO Cb&Cr enabled flag |
---|
1938 | Int m_iPPSId; ///< picture parameter set ID |
---|
1939 | Bool m_PicOutputFlag; ///< pic_output_flag |
---|
1940 | Int m_iPOC; |
---|
1941 | Int m_iLastIDR; |
---|
1942 | Int m_iAssociatedIRAP; |
---|
1943 | NalUnitType m_iAssociatedIRAPType; |
---|
1944 | static Int m_prevTid0POC; |
---|
1945 | TComReferencePictureSet *m_pcRPS; |
---|
1946 | TComReferencePictureSet m_LocalRPS; |
---|
1947 | Int m_iBDidx; |
---|
1948 | TComRefPicListModification m_RefPicListModification; |
---|
1949 | NalUnitType m_eNalUnitType; ///< Nal unit type for the slice |
---|
1950 | SliceType m_eSliceType; |
---|
1951 | Int m_iSliceQp; |
---|
1952 | Bool m_dependentSliceSegmentFlag; |
---|
1953 | #if ADAPTIVE_QP_SELECTION |
---|
1954 | Int m_iSliceQpBase; |
---|
1955 | #endif |
---|
1956 | Bool m_deblockingFilterDisable; |
---|
1957 | Bool m_deblockingFilterOverrideFlag; //< offsets for deblocking filter inherit from PPS |
---|
1958 | Int m_deblockingFilterBetaOffsetDiv2; //< beta offset for deblocking filter |
---|
1959 | Int m_deblockingFilterTcOffsetDiv2; //< tc offset for deblocking filter |
---|
1960 | Int m_list1IdxToList0Idx[MAX_NUM_REF]; |
---|
1961 | Int m_aiNumRefIdx [2]; // for multiple reference of current slice |
---|
1962 | |
---|
1963 | Bool m_bCheckLDC; |
---|
1964 | |
---|
1965 | // Data |
---|
1966 | Int m_iSliceQpDelta; |
---|
1967 | Int m_iSliceQpDeltaCb; |
---|
1968 | Int m_iSliceQpDeltaCr; |
---|
1969 | TComPic* m_apcRefPicList [2][MAX_NUM_REF+1]; |
---|
1970 | Int m_aiRefPOCList [2][MAX_NUM_REF+1]; |
---|
1971 | Bool m_bIsUsedAsLongTerm[2][MAX_NUM_REF+1]; |
---|
1972 | Int m_iDepth; |
---|
1973 | |
---|
1974 | // referenced slice? |
---|
1975 | Bool m_bRefenced; |
---|
1976 | |
---|
1977 | // access channel |
---|
1978 | TComVPS* m_pcVPS; |
---|
1979 | TComSPS* m_pcSPS; |
---|
1980 | TComPPS* m_pcPPS; |
---|
1981 | TComPic* m_pcPic; |
---|
1982 | #if ADAPTIVE_QP_SELECTION |
---|
1983 | TComTrQuant* m_pcTrQuant; |
---|
1984 | #endif |
---|
1985 | UInt m_colFromL0Flag; // collocated picture from List0 flag |
---|
1986 | |
---|
1987 | #if SETTING_NO_OUT_PIC_PRIOR |
---|
1988 | Bool m_noOutputPriorPicsFlag; |
---|
1989 | Bool m_noRaslOutputFlag; |
---|
1990 | Bool m_handleCraAsBlaFlag; |
---|
1991 | #endif |
---|
1992 | |
---|
1993 | UInt m_colRefIdx; |
---|
1994 | UInt m_maxNumMergeCand; |
---|
1995 | |
---|
1996 | Double m_lambdas[3]; |
---|
1997 | |
---|
1998 | Bool m_abEqualRef [2][MAX_NUM_REF][MAX_NUM_REF]; |
---|
1999 | UInt m_uiTLayer; |
---|
2000 | Bool m_bTLayerSwitchingFlag; |
---|
2001 | |
---|
2002 | UInt m_sliceMode; |
---|
2003 | UInt m_sliceArgument; |
---|
2004 | UInt m_sliceCurStartCUAddr; |
---|
2005 | UInt m_sliceCurEndCUAddr; |
---|
2006 | UInt m_sliceIdx; |
---|
2007 | UInt m_sliceSegmentMode; |
---|
2008 | UInt m_sliceSegmentArgument; |
---|
2009 | UInt m_sliceSegmentCurStartCUAddr; |
---|
2010 | UInt m_sliceSegmentCurEndCUAddr; |
---|
2011 | Bool m_nextSlice; |
---|
2012 | Bool m_nextSliceSegment; |
---|
2013 | UInt m_sliceBits; |
---|
2014 | UInt m_sliceSegmentBits; |
---|
2015 | Bool m_bFinalized; |
---|
2016 | |
---|
2017 | wpScalingParam m_weightPredTable[2][MAX_NUM_REF][3]; // [REF_PIC_LIST_0 or REF_PIC_LIST_1][refIdx][0:Y, 1:U, 2:V] |
---|
2018 | wpACDCParam m_weightACDCParam[3]; // [0:Y, 1:U, 2:V] |
---|
2019 | |
---|
2020 | std::vector<UInt> m_tileByteLocation; |
---|
2021 | UInt m_uiTileOffstForMultES; |
---|
2022 | |
---|
2023 | UInt* m_puiSubstreamSizes; |
---|
2024 | TComScalingList* m_scalingList; //!< pointer of quantization matrix |
---|
2025 | Bool m_cabacInitFlag; |
---|
2026 | |
---|
2027 | Bool m_bLMvdL1Zero; |
---|
2028 | Int m_numEntryPointOffsets; |
---|
2029 | Bool m_temporalLayerNonReferenceFlag; |
---|
2030 | Bool m_LFCrossSliceBoundaryFlag; |
---|
2031 | |
---|
2032 | Bool m_enableTMVPFlag; |
---|
2033 | |
---|
2034 | #if SVC_EXTENSION |
---|
2035 | UInt m_layerId; |
---|
2036 | TComPic* m_pcBaseColPic[MAX_LAYERS]; |
---|
2037 | TComPicYuv* m_pcFullPelBaseRec[MAX_LAYERS]; |
---|
2038 | Int m_numMotionPredRefLayers; |
---|
2039 | #if REF_IDX_MFM |
---|
2040 | Bool m_bMFMEnabledFlag; |
---|
2041 | Int m_colRefLayerIdx; |
---|
2042 | Bool m_altColIndicationFlag; |
---|
2043 | TComPic* m_pcIlpPic; |
---|
2044 | #endif |
---|
2045 | |
---|
2046 | Bool m_interLayerPredEnabledFlag; |
---|
2047 | Int m_activeNumILRRefIdx; //< Active inter-layer reference pictures |
---|
2048 | Int m_interLayerPredLayerIdc [MAX_VPS_LAYER_ID_PLUS1]; |
---|
2049 | #if P0312_VERT_PHASE_ADJ |
---|
2050 | Bool m_vertPhasePositionFlag[MAX_VPS_LAYER_ID_PLUS1]; |
---|
2051 | #endif |
---|
2052 | #if POC_RESET_FLAG |
---|
2053 | Bool m_bPocResetFlag; |
---|
2054 | Int m_pocValueBeforeReset; |
---|
2055 | #endif |
---|
2056 | Bool m_bDiscardableFlag; |
---|
2057 | #if O0149_CROSS_LAYER_BLA_FLAG |
---|
2058 | Bool m_bCrossLayerBLAFlag; |
---|
2059 | #endif |
---|
2060 | #if POC_RESET_IDC_SIGNALLING |
---|
2061 | Int m_pocResetIdc; |
---|
2062 | Int m_pocResetPeriodId; |
---|
2063 | Bool m_fullPocResetFlag; |
---|
2064 | Int m_pocLsbVal; |
---|
2065 | Int m_pocMsbVal; |
---|
2066 | Bool m_pocMsbValRequiredFlag; |
---|
2067 | Bool m_pocMsbValPresentFlag; |
---|
2068 | #endif |
---|
2069 | #if Q0048_CGS_3D_ASYMLUT |
---|
2070 | Int m_nCGSOverWritePPS; // for optimization, not output to bitstream |
---|
2071 | #endif |
---|
2072 | #endif //SVC_EXTENSION |
---|
2073 | |
---|
2074 | public: |
---|
2075 | TComSlice(); |
---|
2076 | virtual ~TComSlice(); |
---|
2077 | #if SVC_EXTENSION |
---|
2078 | Void initSlice ( UInt layerId ); |
---|
2079 | #else |
---|
2080 | Void initSlice (); |
---|
2081 | #endif |
---|
2082 | |
---|
2083 | Void setVPS ( TComVPS* pcVPS ) { m_pcVPS = pcVPS; } |
---|
2084 | TComVPS* getVPS () { return m_pcVPS; } |
---|
2085 | Void setSPS ( TComSPS* pcSPS ) { m_pcSPS = pcSPS; } |
---|
2086 | TComSPS* getSPS () { return m_pcSPS; } |
---|
2087 | |
---|
2088 | Void setPPS ( TComPPS* pcPPS ) { assert(pcPPS!=NULL); m_pcPPS = pcPPS; m_iPPSId = pcPPS->getPPSId(); } |
---|
2089 | TComPPS* getPPS () { return m_pcPPS; } |
---|
2090 | |
---|
2091 | #if ADAPTIVE_QP_SELECTION |
---|
2092 | Void setTrQuant ( TComTrQuant* pcTrQuant ) { m_pcTrQuant = pcTrQuant; } |
---|
2093 | TComTrQuant* getTrQuant () { return m_pcTrQuant; } |
---|
2094 | #endif |
---|
2095 | |
---|
2096 | Void setPPSId ( Int PPSId ) { m_iPPSId = PPSId; } |
---|
2097 | Int getPPSId () { return m_iPPSId; } |
---|
2098 | Void setPicOutputFlag( Bool b ) { m_PicOutputFlag = b; } |
---|
2099 | Bool getPicOutputFlag() { return m_PicOutputFlag; } |
---|
2100 | Void setSaoEnabledFlag(Bool s) {m_saoEnabledFlag =s; } |
---|
2101 | Bool getSaoEnabledFlag() { return m_saoEnabledFlag; } |
---|
2102 | Void setSaoEnabledFlagChroma(Bool s) {m_saoEnabledFlagChroma =s; } //!< set SAO Cb&Cr enabled flag |
---|
2103 | Bool getSaoEnabledFlagChroma() { return m_saoEnabledFlagChroma; } //!< get SAO Cb&Cr enabled flag |
---|
2104 | Void setRPS ( TComReferencePictureSet *pcRPS ) { m_pcRPS = pcRPS; } |
---|
2105 | TComReferencePictureSet* getRPS () { return m_pcRPS; } |
---|
2106 | TComReferencePictureSet* getLocalRPS () { return &m_LocalRPS; } |
---|
2107 | |
---|
2108 | Void setRPSidx ( Int iBDidx ) { m_iBDidx = iBDidx; } |
---|
2109 | Int getRPSidx () { return m_iBDidx; } |
---|
2110 | Int getPrevTid0POC () { return m_prevTid0POC; } |
---|
2111 | #if PREVTID0_POC_RESET |
---|
2112 | Void adjustPrevTid0POC (Int adj) { m_prevTid0POC=m_prevTid0POC-adj; } |
---|
2113 | #endif |
---|
2114 | TComRefPicListModification* getRefPicListModification() { return &m_RefPicListModification; } |
---|
2115 | Void setLastIDR(Int iIDRPOC) { m_iLastIDR = iIDRPOC; } |
---|
2116 | Int getLastIDR() { return m_iLastIDR; } |
---|
2117 | Void setAssociatedIRAPPOC(Int iAssociatedIRAPPOC) { m_iAssociatedIRAP = iAssociatedIRAPPOC; } |
---|
2118 | Int getAssociatedIRAPPOC() { return m_iAssociatedIRAP; } |
---|
2119 | Void setAssociatedIRAPType(NalUnitType associatedIRAPType) { m_iAssociatedIRAPType = associatedIRAPType; } |
---|
2120 | NalUnitType getAssociatedIRAPType() { return m_iAssociatedIRAPType; } |
---|
2121 | SliceType getSliceType () { return m_eSliceType; } |
---|
2122 | Int getPOC () { return m_iPOC; } |
---|
2123 | Int getSliceQp () { return m_iSliceQp; } |
---|
2124 | Bool getDependentSliceSegmentFlag() const { return m_dependentSliceSegmentFlag; } |
---|
2125 | void setDependentSliceSegmentFlag(Bool val) { m_dependentSliceSegmentFlag = val; } |
---|
2126 | #if ADAPTIVE_QP_SELECTION |
---|
2127 | Int getSliceQpBase () { return m_iSliceQpBase; } |
---|
2128 | #endif |
---|
2129 | Int getSliceQpDelta () { return m_iSliceQpDelta; } |
---|
2130 | Int getSliceQpDeltaCb () { return m_iSliceQpDeltaCb; } |
---|
2131 | Int getSliceQpDeltaCr () { return m_iSliceQpDeltaCr; } |
---|
2132 | Bool getDeblockingFilterDisable() { return m_deblockingFilterDisable; } |
---|
2133 | Bool getDeblockingFilterOverrideFlag() { return m_deblockingFilterOverrideFlag; } |
---|
2134 | Int getDeblockingFilterBetaOffsetDiv2() { return m_deblockingFilterBetaOffsetDiv2; } |
---|
2135 | Int getDeblockingFilterTcOffsetDiv2() { return m_deblockingFilterTcOffsetDiv2; } |
---|
2136 | |
---|
2137 | Int getNumRefIdx ( RefPicList e ) { return m_aiNumRefIdx[e]; } |
---|
2138 | TComPic* getPic () { return m_pcPic; } |
---|
2139 | TComPic* getRefPic ( RefPicList e, Int iRefIdx) { return m_apcRefPicList[e][iRefIdx]; } |
---|
2140 | Int getRefPOC ( RefPicList e, Int iRefIdx) { return m_aiRefPOCList[e][iRefIdx]; } |
---|
2141 | Int getDepth () { return m_iDepth; } |
---|
2142 | UInt getColFromL0Flag () { return m_colFromL0Flag; } |
---|
2143 | UInt getColRefIdx () { return m_colRefIdx; } |
---|
2144 | Void checkColRefIdx (UInt curSliceIdx, TComPic* pic); |
---|
2145 | Bool getIsUsedAsLongTerm (Int i, Int j) { return m_bIsUsedAsLongTerm[i][j]; } |
---|
2146 | Void setIsUsedAsLongTerm (Int i, Int j, Bool value) { m_bIsUsedAsLongTerm[i][j] = value; } |
---|
2147 | Bool getCheckLDC () { return m_bCheckLDC; } |
---|
2148 | Bool getMvdL1ZeroFlag () { return m_bLMvdL1Zero; } |
---|
2149 | Int getNumRpsCurrTempList(); |
---|
2150 | Int getList1IdxToList0Idx ( Int list1Idx ) { return m_list1IdxToList0Idx[list1Idx]; } |
---|
2151 | Void setReferenced(Bool b) { m_bRefenced = b; } |
---|
2152 | Bool isReferenced() { return m_bRefenced; } |
---|
2153 | Bool isReferenceNalu() { return ((getNalUnitType() <= NAL_UNIT_RESERVED_VCL_R15) && (getNalUnitType()%2 != 0)) || ((getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP) && (getNalUnitType() <= NAL_UNIT_RESERVED_IRAP_VCL23) ); } |
---|
2154 | Void setPOC ( Int i ) { m_iPOC = i; if ((getTLayer()==0) && (isReferenceNalu() && (getNalUnitType()!=NAL_UNIT_CODED_SLICE_RASL_R)&& (getNalUnitType()!=NAL_UNIT_CODED_SLICE_RADL_R))) {m_prevTid0POC=i;} } |
---|
2155 | Void setNalUnitType ( NalUnitType e ) { m_eNalUnitType = e; } |
---|
2156 | NalUnitType getNalUnitType () const { return m_eNalUnitType; } |
---|
2157 | Bool getRapPicFlag (); |
---|
2158 | Bool getIdrPicFlag () { return getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP; } |
---|
2159 | Bool isIRAP () const { return (getNalUnitType() >= 16) && (getNalUnitType() <= 23); } |
---|
2160 | Void checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, NalUnitType& associatedIRAPType, TComList<TComPic *>& rcListPic); |
---|
2161 | #if NO_CLRAS_OUTPUT_FLAG |
---|
2162 | Void decodingRefreshMarking( TComList<TComPic*>& rcListPic, Bool noClrasOutputFlag ); |
---|
2163 | Void decodingRefreshMarking(Int& pocCRA, Bool& bRefreshPending, TComList<TComPic*>& rcListPic, Bool noClrasOutputFlag); |
---|
2164 | #else |
---|
2165 | Void decodingRefreshMarking(Int& pocCRA, Bool& bRefreshPending, TComList<TComPic*>& rcListPic); |
---|
2166 | #endif |
---|
2167 | Void setSliceType ( SliceType e ) { m_eSliceType = e; } |
---|
2168 | Void setSliceQp ( Int i ) { m_iSliceQp = i; } |
---|
2169 | #if ADAPTIVE_QP_SELECTION |
---|
2170 | Void setSliceQpBase ( Int i ) { m_iSliceQpBase = i; } |
---|
2171 | #endif |
---|
2172 | Void setSliceQpDelta ( Int i ) { m_iSliceQpDelta = i; } |
---|
2173 | Void setSliceQpDeltaCb ( Int i ) { m_iSliceQpDeltaCb = i; } |
---|
2174 | Void setSliceQpDeltaCr ( Int i ) { m_iSliceQpDeltaCr = i; } |
---|
2175 | Void setDeblockingFilterDisable( Bool b ) { m_deblockingFilterDisable= b; } |
---|
2176 | Void setDeblockingFilterOverrideFlag( Bool b ) { m_deblockingFilterOverrideFlag = b; } |
---|
2177 | Void setDeblockingFilterBetaOffsetDiv2( Int i ) { m_deblockingFilterBetaOffsetDiv2 = i; } |
---|
2178 | Void setDeblockingFilterTcOffsetDiv2( Int i ) { m_deblockingFilterTcOffsetDiv2 = i; } |
---|
2179 | |
---|
2180 | Void setRefPic ( TComPic* p, RefPicList e, Int iRefIdx ) { m_apcRefPicList[e][iRefIdx] = p; } |
---|
2181 | Void setRefPOC ( Int i, RefPicList e, Int iRefIdx ) { m_aiRefPOCList[e][iRefIdx] = i; } |
---|
2182 | Void setNumRefIdx ( RefPicList e, Int i ) { m_aiNumRefIdx[e] = i; } |
---|
2183 | Void setPic ( TComPic* p ) { m_pcPic = p; } |
---|
2184 | Void setDepth ( Int iDepth ) { m_iDepth = iDepth; } |
---|
2185 | |
---|
2186 | #if SVC_EXTENSION |
---|
2187 | Void setRefPicList ( TComList<TComPic*>& rcListPic, Bool checkNumPocTotalCurr = false, TComPic** ilpPic = NULL ); |
---|
2188 | #if Q0048_CGS_3D_ASYMLUT |
---|
2189 | Int getCGSOverWritePPS() { return m_nCGSOverWritePPS; } |
---|
2190 | Void setCGSOverWritePPS(Int n) { m_nCGSOverWritePPS = n; } |
---|
2191 | #endif |
---|
2192 | #else |
---|
2193 | Void setRefPicList ( TComList<TComPic*>& rcListPic, Bool checkNumPocTotalCurr = false ); |
---|
2194 | #endif |
---|
2195 | Void setRefPOCList (); |
---|
2196 | Void setColFromL0Flag ( UInt colFromL0 ) { m_colFromL0Flag = colFromL0; } |
---|
2197 | Void setColRefIdx ( UInt refIdx) { m_colRefIdx = refIdx; } |
---|
2198 | Void setCheckLDC ( Bool b ) { m_bCheckLDC = b; } |
---|
2199 | Void setMvdL1ZeroFlag ( Bool b) { m_bLMvdL1Zero = b; } |
---|
2200 | |
---|
2201 | Bool isIntra () { return m_eSliceType == I_SLICE; } |
---|
2202 | Bool isInterB () { return m_eSliceType == B_SLICE; } |
---|
2203 | Bool isInterP () { return m_eSliceType == P_SLICE; } |
---|
2204 | |
---|
2205 | Void setLambdas ( const Double lambdas[3] ) { for (Int component = 0; component < 3; component++) m_lambdas[component] = lambdas[component]; } |
---|
2206 | const Double* getLambdas() const { return m_lambdas; } |
---|
2207 | |
---|
2208 | Void initEqualRef(); |
---|
2209 | Bool isEqualRef ( RefPicList e, Int iRefIdx1, Int iRefIdx2 ) |
---|
2210 | { |
---|
2211 | if (iRefIdx1 < 0 || iRefIdx2 < 0) return false; |
---|
2212 | return m_abEqualRef[e][iRefIdx1][iRefIdx2]; |
---|
2213 | } |
---|
2214 | |
---|
2215 | Void setEqualRef( RefPicList e, Int iRefIdx1, Int iRefIdx2, Bool b) |
---|
2216 | { |
---|
2217 | m_abEqualRef[e][iRefIdx1][iRefIdx2] = m_abEqualRef[e][iRefIdx2][iRefIdx1] = b; |
---|
2218 | } |
---|
2219 | |
---|
2220 | static Void sortPicList ( TComList<TComPic*>& rcListPic ); |
---|
2221 | Void setList1IdxToList0Idx(); |
---|
2222 | |
---|
2223 | UInt getTLayer () { return m_uiTLayer; } |
---|
2224 | Void setTLayer ( UInt uiTLayer ) { m_uiTLayer = uiTLayer; } |
---|
2225 | |
---|
2226 | Void setTLayerInfo( UInt uiTLayer ); |
---|
2227 | Void decodingMarking( TComList<TComPic*>& rcListPic, Int iGOPSIze, Int& iMaxRefPicNum ); |
---|
2228 | Void checkLeadingPictureRestrictions( TComList<TComPic*>& rcListPic ); |
---|
2229 | Void applyReferencePictureSet( TComList<TComPic*>& rcListPic, TComReferencePictureSet *RPSList); |
---|
2230 | Bool isTemporalLayerSwitchingPoint( TComList<TComPic*>& rcListPic ); |
---|
2231 | Bool isStepwiseTemporalLayerSwitchingPointCandidate( TComList<TComPic*>& rcListPic ); |
---|
2232 | #if ALLOW_RECOVERY_POINT_AS_RAP |
---|
2233 | Int checkThatAllRefPicsAreAvailable( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool printErrors, Int pocRandomAccess = 0, Bool bUseRecoveryPoint = false); |
---|
2234 | Void createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool isRAP, Int pocRandomAccess = 0, Bool bUseRecoveryPoint = false); |
---|
2235 | #else |
---|
2236 | Int checkThatAllRefPicsAreAvailable( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool printErrors, Int pocRandomAccess = 0); |
---|
2237 | Void createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool isRAP); |
---|
2238 | #endif |
---|
2239 | |
---|
2240 | Void setMaxNumMergeCand (UInt val ) { m_maxNumMergeCand = val; } |
---|
2241 | UInt getMaxNumMergeCand () { return m_maxNumMergeCand; } |
---|
2242 | |
---|
2243 | #if SETTING_NO_OUT_PIC_PRIOR |
---|
2244 | Void setNoOutputPriorPicsFlag ( Bool val ) { m_noOutputPriorPicsFlag = val; } |
---|
2245 | Bool getNoOutputPriorPicsFlag () { return m_noOutputPriorPicsFlag; } |
---|
2246 | |
---|
2247 | Void setNoRaslOutputFlag ( Bool val ) { m_noRaslOutputFlag = val; } |
---|
2248 | Bool getNoRaslOutputFlag () { return m_noRaslOutputFlag; } |
---|
2249 | |
---|
2250 | Void setHandleCraAsBlaFlag ( Bool val ) { m_handleCraAsBlaFlag = val; } |
---|
2251 | Bool getHandleCraAsBlaFlag () { return m_handleCraAsBlaFlag; } |
---|
2252 | #endif |
---|
2253 | |
---|
2254 | Void setSliceMode ( UInt uiMode ) { m_sliceMode = uiMode; } |
---|
2255 | UInt getSliceMode () { return m_sliceMode; } |
---|
2256 | Void setSliceArgument ( UInt uiArgument ) { m_sliceArgument = uiArgument; } |
---|
2257 | UInt getSliceArgument () { return m_sliceArgument; } |
---|
2258 | Void setSliceCurStartCUAddr ( UInt uiAddr ) { m_sliceCurStartCUAddr = uiAddr; } |
---|
2259 | UInt getSliceCurStartCUAddr () { return m_sliceCurStartCUAddr; } |
---|
2260 | Void setSliceCurEndCUAddr ( UInt uiAddr ) { m_sliceCurEndCUAddr = uiAddr; } |
---|
2261 | UInt getSliceCurEndCUAddr () { return m_sliceCurEndCUAddr; } |
---|
2262 | Void setSliceIdx ( UInt i) { m_sliceIdx = i; } |
---|
2263 | UInt getSliceIdx () { return m_sliceIdx; } |
---|
2264 | Void copySliceInfo (TComSlice *pcSliceSrc); |
---|
2265 | Void setSliceSegmentMode ( UInt uiMode ) { m_sliceSegmentMode = uiMode; } |
---|
2266 | UInt getSliceSegmentMode () { return m_sliceSegmentMode; } |
---|
2267 | Void setSliceSegmentArgument ( UInt uiArgument ) { m_sliceSegmentArgument = uiArgument; } |
---|
2268 | UInt getSliceSegmentArgument () { return m_sliceSegmentArgument; } |
---|
2269 | Void setSliceSegmentCurStartCUAddr ( UInt uiAddr ) { m_sliceSegmentCurStartCUAddr = uiAddr; } |
---|
2270 | UInt getSliceSegmentCurStartCUAddr () { return m_sliceSegmentCurStartCUAddr; } |
---|
2271 | Void setSliceSegmentCurEndCUAddr ( UInt uiAddr ) { m_sliceSegmentCurEndCUAddr = uiAddr; } |
---|
2272 | UInt getSliceSegmentCurEndCUAddr () { return m_sliceSegmentCurEndCUAddr; } |
---|
2273 | Void setNextSlice ( Bool b ) { m_nextSlice = b; } |
---|
2274 | Bool isNextSlice () { return m_nextSlice; } |
---|
2275 | Void setNextSliceSegment ( Bool b ) { m_nextSliceSegment = b; } |
---|
2276 | Bool isNextSliceSegment () { return m_nextSliceSegment; } |
---|
2277 | Void setSliceBits ( UInt uiVal ) { m_sliceBits = uiVal; } |
---|
2278 | UInt getSliceBits () { return m_sliceBits; } |
---|
2279 | Void setSliceSegmentBits ( UInt uiVal ) { m_sliceSegmentBits = uiVal; } |
---|
2280 | UInt getSliceSegmentBits () { return m_sliceSegmentBits; } |
---|
2281 | Void setFinalized ( Bool uiVal ) { m_bFinalized = uiVal; } |
---|
2282 | Bool getFinalized () { return m_bFinalized; } |
---|
2283 | Void setWpScaling ( wpScalingParam wp[2][MAX_NUM_REF][3] ) { memcpy(m_weightPredTable, wp, sizeof(wpScalingParam)*2*MAX_NUM_REF*3); } |
---|
2284 | Void getWpScaling ( RefPicList e, Int iRefIdx, wpScalingParam *&wp); |
---|
2285 | |
---|
2286 | Void resetWpScaling (); |
---|
2287 | Void initWpScaling (); |
---|
2288 | inline Bool applyWP () { return( (m_eSliceType==P_SLICE && m_pcPPS->getUseWP()) || (m_eSliceType==B_SLICE && m_pcPPS->getWPBiPred()) ); } |
---|
2289 | |
---|
2290 | Void setWpAcDcParam ( wpACDCParam wp[3] ) { memcpy(m_weightACDCParam, wp, sizeof(wpACDCParam)*3); } |
---|
2291 | Void getWpAcDcParam ( wpACDCParam *&wp ); |
---|
2292 | Void initWpAcDcParam (); |
---|
2293 | |
---|
2294 | Void setTileLocationCount ( UInt cnt ) { return m_tileByteLocation.resize(cnt); } |
---|
2295 | UInt getTileLocationCount () { return (UInt) m_tileByteLocation.size(); } |
---|
2296 | Void setTileLocation ( Int idx, UInt location ) { assert (idx<m_tileByteLocation.size()); |
---|
2297 | m_tileByteLocation[idx] = location; } |
---|
2298 | Void addTileLocation ( UInt location ) { m_tileByteLocation.push_back(location); } |
---|
2299 | UInt getTileLocation ( Int idx ) { return m_tileByteLocation[idx]; } |
---|
2300 | |
---|
2301 | Void setTileOffstForMultES (UInt uiOffset ) { m_uiTileOffstForMultES = uiOffset; } |
---|
2302 | UInt getTileOffstForMultES () { return m_uiTileOffstForMultES; } |
---|
2303 | Void allocSubstreamSizes ( UInt uiNumSubstreams ); |
---|
2304 | UInt* getSubstreamSizes () { return m_puiSubstreamSizes; } |
---|
2305 | Void setScalingList ( TComScalingList* scalingList ) { m_scalingList = scalingList; } |
---|
2306 | TComScalingList* getScalingList () { return m_scalingList; } |
---|
2307 | Void setDefaultScalingList (); |
---|
2308 | Bool checkDefaultScalingList (); |
---|
2309 | Void setCabacInitFlag ( Bool val ) { m_cabacInitFlag = val; } //!< set CABAC initial flag |
---|
2310 | Bool getCabacInitFlag () { return m_cabacInitFlag; } //!< get CABAC initial flag |
---|
2311 | Void setNumEntryPointOffsets(Int val) { m_numEntryPointOffsets = val; } |
---|
2312 | Int getNumEntryPointOffsets() { return m_numEntryPointOffsets; } |
---|
2313 | Bool getTemporalLayerNonReferenceFlag() { return m_temporalLayerNonReferenceFlag;} |
---|
2314 | Void setTemporalLayerNonReferenceFlag(Bool x) { m_temporalLayerNonReferenceFlag = x;} |
---|
2315 | Void setLFCrossSliceBoundaryFlag ( Bool val ) { m_LFCrossSliceBoundaryFlag = val; } |
---|
2316 | Bool getLFCrossSliceBoundaryFlag () { return m_LFCrossSliceBoundaryFlag;} |
---|
2317 | |
---|
2318 | Void setEnableTMVPFlag ( Bool b ) { m_enableTMVPFlag = b; } |
---|
2319 | Bool getEnableTMVPFlag () { return m_enableTMVPFlag;} |
---|
2320 | |
---|
2321 | #if SVC_EXTENSION |
---|
2322 | Bool setBaseColPic ( TComList<TComPic*>& rcListPic , UInt refLayerIdc ); |
---|
2323 | Void setBaseColPic (UInt refLayerIdc, TComPic* p) { m_pcBaseColPic[refLayerIdc] = p; } |
---|
2324 | TComPic* getBaseColPic (UInt refLayerIdc) { return m_pcBaseColPic[refLayerIdc]; } |
---|
2325 | TComPic** getBaseColPic () { return &m_pcBaseColPic[0]; } |
---|
2326 | #if MFM_ENCCONSTRAINT |
---|
2327 | TComPic* getBaseColPic( TComList<TComPic*>& rcListPic ); |
---|
2328 | #endif |
---|
2329 | |
---|
2330 | Void setLayerId (UInt layerId) { m_layerId = layerId; } |
---|
2331 | UInt getLayerId () { return m_layerId; } |
---|
2332 | |
---|
2333 | Void setFullPelBaseRec (UInt refLayerIdc, TComPicYuv* p) { m_pcFullPelBaseRec[refLayerIdc] = p; } |
---|
2334 | TComPicYuv* getFullPelBaseRec (UInt refLayerIdc) { return m_pcFullPelBaseRec[refLayerIdc]; } |
---|
2335 | |
---|
2336 | #if AVC_SYNTAX |
---|
2337 | Void initBaseLayerRPL( TComSlice *pcSlice ); |
---|
2338 | #endif |
---|
2339 | |
---|
2340 | Void setRefPicListModificationSvc(); |
---|
2341 | Int getNumILRRefIdx ( ) { return m_pcVPS->getNumDirectRefLayers( m_layerId ); } |
---|
2342 | |
---|
2343 | #if REF_IDX_MFM |
---|
2344 | Void setRefPOCListILP(TComPic** ilpPic, TComPic** pcRefPicRL); |
---|
2345 | #endif |
---|
2346 | |
---|
2347 | Int getActiveNumILRRefIdx ( ) { return m_activeNumILRRefIdx; } |
---|
2348 | Void setActiveNumILRRefIdx ( Int i ) { m_activeNumILRRefIdx = i; } |
---|
2349 | |
---|
2350 | Int getInterLayerPredLayerIdc (UInt layerIdx) { return m_interLayerPredLayerIdc[layerIdx];} |
---|
2351 | Void setInterLayerPredLayerIdc (UInt refLayerIdc, UInt layerIdx) { m_interLayerPredLayerIdc[layerIdx] = refLayerIdc; } |
---|
2352 | |
---|
2353 | Void setInterLayerPredEnabledFlag ( Bool val ) { m_interLayerPredEnabledFlag = val; } |
---|
2354 | Bool getInterLayerPredEnabledFlag () { return m_interLayerPredEnabledFlag;} |
---|
2355 | |
---|
2356 | #if P0312_VERT_PHASE_ADJ |
---|
2357 | Int getVertPhasePositionFlag (UInt layerIdx) { return m_vertPhasePositionFlag[layerIdx];} |
---|
2358 | Void setVertPhasePositionFlag (Bool b, UInt layerIdx) { m_vertPhasePositionFlag[layerIdx] = b; } |
---|
2359 | #endif |
---|
2360 | |
---|
2361 | Void setNumMotionPredRefLayers(int i) { m_numMotionPredRefLayers = i; } |
---|
2362 | Int getNumMotionPredRefLayers() { return m_numMotionPredRefLayers; } |
---|
2363 | #if REF_IDX_MFM |
---|
2364 | Void setMFMEnabledFlag(Bool flag) { m_bMFMEnabledFlag = flag; } |
---|
2365 | Bool getMFMEnabledFlag() { return m_bMFMEnabledFlag; } |
---|
2366 | #endif |
---|
2367 | |
---|
2368 | TComPic* getRefPic(TComList<TComPic*>& rcListPic, Int poc) { return xGetRefPic( rcListPic, poc ); } |
---|
2369 | |
---|
2370 | Bool isRADL() { return (m_eNalUnitType == NAL_UNIT_CODED_SLICE_RADL_N || m_eNalUnitType == NAL_UNIT_CODED_SLICE_RADL_R); } |
---|
2371 | Bool isRASL() { return (m_eNalUnitType == NAL_UNIT_CODED_SLICE_RASL_N || m_eNalUnitType == NAL_UNIT_CODED_SLICE_RASL_R); } |
---|
2372 | |
---|
2373 | #if POC_RESET_FLAG |
---|
2374 | Bool getPocResetFlag () { return m_bPocResetFlag; } |
---|
2375 | Void setPocResetFlag (Bool b) { m_bPocResetFlag = b; } |
---|
2376 | Int getPocValueBeforeReset () { return m_pocValueBeforeReset; } |
---|
2377 | Void setPocValueBeforeReset (Int x) { m_pocValueBeforeReset = x ; } |
---|
2378 | #endif |
---|
2379 | Bool getDiscardableFlag () { return m_bDiscardableFlag; } |
---|
2380 | Void setDiscardableFlag (Bool b) { m_bDiscardableFlag = b; } |
---|
2381 | #if O0149_CROSS_LAYER_BLA_FLAG |
---|
2382 | Bool getCrossLayerBLAFlag () { return m_bCrossLayerBLAFlag; } |
---|
2383 | Void setCrossLayerBLAFlag (Bool b) { m_bCrossLayerBLAFlag = b; } |
---|
2384 | #endif |
---|
2385 | |
---|
2386 | #if RPL_INIT_N0316_N0082 |
---|
2387 | Int getNumNegativeRpsCurrTempList(); |
---|
2388 | #endif |
---|
2389 | |
---|
2390 | #if REPN_FORMAT_IN_VPS |
---|
2391 | UInt getPicWidthInLumaSamples(); |
---|
2392 | UInt getPicHeightInLumaSamples(); |
---|
2393 | #if AUXILIARY_PICTURES |
---|
2394 | ChromaFormat getChromaFormatIdc(); |
---|
2395 | #else |
---|
2396 | UInt getChromaFormatIdc(); |
---|
2397 | #endif |
---|
2398 | UInt getBitDepthY(); |
---|
2399 | UInt getBitDepthC(); |
---|
2400 | Int getQpBDOffsetY(); |
---|
2401 | Int getQpBDOffsetC(); |
---|
2402 | #endif |
---|
2403 | |
---|
2404 | Void setILRPic(TComPic **pcIlpPic); |
---|
2405 | #if POC_RESET_IDC_SIGNALLING |
---|
2406 | Int getPocResetIdc () { return m_pocResetIdc; } |
---|
2407 | Void setPocResetIdc (Int b) { m_pocResetIdc = b; } |
---|
2408 | Int getPocResetPeriodId () { return m_pocResetPeriodId; } |
---|
2409 | Void setPocResetPeriodId (Int b) { m_pocResetPeriodId = b; } |
---|
2410 | Bool getFullPocResetFlag () { return m_fullPocResetFlag; } |
---|
2411 | Void setFullPocResetFlag (Bool b) { m_fullPocResetFlag = b; } |
---|
2412 | Int getPocLsbVal () { return m_pocLsbVal; } |
---|
2413 | Void setPocLsbVal (Int b) { m_pocLsbVal = b; } |
---|
2414 | Int getPocMsbVal () { return m_pocMsbVal; } |
---|
2415 | Void setPocMsbVal (Int b) { m_pocMsbVal = b; } |
---|
2416 | Bool getPocMsbValPresentFlag () { return m_pocMsbValPresentFlag; } |
---|
2417 | Void setPocMsbValPresentFlag (Bool x) { m_pocMsbValPresentFlag = x; } |
---|
2418 | Bool getPocMsbValRequiredFlag () { return m_pocMsbValRequiredFlag; } |
---|
2419 | Void setPocMsbValRequiredFlag (Bool x) { m_pocMsbValRequiredFlag = x; } |
---|
2420 | #endif |
---|
2421 | |
---|
2422 | #if NO_OUTPUT_OF_PRIOR_PICS |
---|
2423 | Bool getBlaPicFlag (); |
---|
2424 | Bool getCraPicFlag (); |
---|
2425 | #endif |
---|
2426 | |
---|
2427 | #endif //SVC_EXTENSION |
---|
2428 | protected: |
---|
2429 | TComPic* xGetRefPic (TComList<TComPic*>& rcListPic, |
---|
2430 | Int poc); |
---|
2431 | TComPic* xGetLongTermRefPic(TComList<TComPic*>& rcListPic, Int poc, Bool pocHasMsb); |
---|
2432 | };// END CLASS DEFINITION TComSlice |
---|
2433 | |
---|
2434 | |
---|
2435 | template <class T> class ParameterSetMap |
---|
2436 | { |
---|
2437 | public: |
---|
2438 | ParameterSetMap(Int maxId) |
---|
2439 | :m_maxId (maxId) |
---|
2440 | {} |
---|
2441 | |
---|
2442 | ~ParameterSetMap() |
---|
2443 | { |
---|
2444 | for (typename std::map<Int,T *>::iterator i = m_paramsetMap.begin(); i!= m_paramsetMap.end(); i++) |
---|
2445 | { |
---|
2446 | delete (*i).second; |
---|
2447 | } |
---|
2448 | } |
---|
2449 | |
---|
2450 | Void storePS(Int psId, T *ps) |
---|
2451 | { |
---|
2452 | assert ( psId < m_maxId ); |
---|
2453 | if ( m_paramsetMap.find(psId) != m_paramsetMap.end() ) |
---|
2454 | { |
---|
2455 | delete m_paramsetMap[psId]; |
---|
2456 | } |
---|
2457 | m_paramsetMap[psId] = ps; |
---|
2458 | } |
---|
2459 | |
---|
2460 | Void mergePSList(ParameterSetMap<T> &rPsList) |
---|
2461 | { |
---|
2462 | for (typename std::map<Int,T *>::iterator i = rPsList.m_paramsetMap.begin(); i!= rPsList.m_paramsetMap.end(); i++) |
---|
2463 | { |
---|
2464 | storePS(i->first, i->second); |
---|
2465 | } |
---|
2466 | rPsList.m_paramsetMap.clear(); |
---|
2467 | } |
---|
2468 | |
---|
2469 | |
---|
2470 | T* getPS(Int psId) |
---|
2471 | { |
---|
2472 | return ( m_paramsetMap.find(psId) == m_paramsetMap.end() ) ? NULL : m_paramsetMap[psId]; |
---|
2473 | } |
---|
2474 | |
---|
2475 | T* getFirstPS() |
---|
2476 | { |
---|
2477 | return (m_paramsetMap.begin() == m_paramsetMap.end() ) ? NULL : m_paramsetMap.begin()->second; |
---|
2478 | } |
---|
2479 | |
---|
2480 | private: |
---|
2481 | std::map<Int,T *> m_paramsetMap; |
---|
2482 | Int m_maxId; |
---|
2483 | }; |
---|
2484 | |
---|
2485 | class ParameterSetManager |
---|
2486 | { |
---|
2487 | public: |
---|
2488 | ParameterSetManager(); |
---|
2489 | virtual ~ParameterSetManager(); |
---|
2490 | |
---|
2491 | //! store sequence parameter set and take ownership of it |
---|
2492 | Void storeVPS(TComVPS *vps) { m_vpsMap.storePS( vps->getVPSId(), vps); }; |
---|
2493 | //! get pointer to existing video parameter set |
---|
2494 | TComVPS* getVPS(Int vpsId) { return m_vpsMap.getPS(vpsId); }; |
---|
2495 | TComVPS* getFirstVPS() { return m_vpsMap.getFirstPS(); }; |
---|
2496 | |
---|
2497 | //! store sequence parameter set and take ownership of it |
---|
2498 | Void storeSPS(TComSPS *sps) { m_spsMap.storePS( sps->getSPSId(), sps); }; |
---|
2499 | //! get pointer to existing sequence parameter set |
---|
2500 | TComSPS* getSPS(Int spsId) { return m_spsMap.getPS(spsId); }; |
---|
2501 | TComSPS* getFirstSPS() { return m_spsMap.getFirstPS(); }; |
---|
2502 | |
---|
2503 | //! store picture parameter set and take ownership of it |
---|
2504 | Void storePPS(TComPPS *pps) { m_ppsMap.storePS( pps->getPPSId(), pps); }; |
---|
2505 | //! get pointer to existing picture parameter set |
---|
2506 | TComPPS* getPPS(Int ppsId) { return m_ppsMap.getPS(ppsId); }; |
---|
2507 | TComPPS* getFirstPPS() { return m_ppsMap.getFirstPS(); }; |
---|
2508 | |
---|
2509 | //! activate a SPS from a active parameter sets SEI message |
---|
2510 | //! \returns true, if activation is successful |
---|
2511 | Bool activateSPSWithSEI(Int SPSId); |
---|
2512 | |
---|
2513 | //! activate a PPS and depending on isIDR parameter also SPS and VPS |
---|
2514 | //! \returns true, if activation is successful |
---|
2515 | Bool activatePPS(Int ppsId, Bool isIRAP); |
---|
2516 | |
---|
2517 | TComVPS* getActiveVPS(){ return m_vpsMap.getPS(m_activeVPSId); }; |
---|
2518 | TComSPS* getActiveSPS(){ return m_spsMap.getPS(m_activeSPSId); }; |
---|
2519 | TComPPS* getActivePPS(){ return m_ppsMap.getPS(m_activePPSId); }; |
---|
2520 | |
---|
2521 | protected: |
---|
2522 | |
---|
2523 | #if SVC_EXTENSION |
---|
2524 | static ParameterSetMap<TComVPS> m_vpsMap; |
---|
2525 | #else |
---|
2526 | ParameterSetMap<TComVPS> m_vpsMap; |
---|
2527 | #endif |
---|
2528 | ParameterSetMap<TComSPS> m_spsMap; |
---|
2529 | ParameterSetMap<TComPPS> m_ppsMap; |
---|
2530 | |
---|
2531 | #if SVC_EXTENSION |
---|
2532 | static Int m_activeVPSId; |
---|
2533 | #else |
---|
2534 | Int m_activeVPSId; |
---|
2535 | #endif |
---|
2536 | Int m_activeSPSId; |
---|
2537 | Int m_activePPSId; |
---|
2538 | }; |
---|
2539 | |
---|
2540 | //! \} |
---|
2541 | |
---|
2542 | #endif // __TCOMSLICE__ |
---|