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 | #if H_MV |
---|
54 | class TComPicLists; |
---|
55 | class TComVPS; |
---|
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 | #if H_MV |
---|
171 | Void inferFrom ( TComScalingList* srcScLi ); |
---|
172 | #endif |
---|
173 | |
---|
174 | private: |
---|
175 | Void init (); |
---|
176 | Void destroy (); |
---|
177 | Int m_scalingListDC [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< the DC value of the matrix coefficient for 16x16 |
---|
178 | Bool m_useDefaultScalingMatrixFlag [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< UseDefaultScalingMatrixFlag |
---|
179 | UInt m_refMatrixId [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< RefMatrixID |
---|
180 | Bool m_scalingListPresentFlag; //!< flag for using default matrix |
---|
181 | UInt m_predMatrixId [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< reference list index |
---|
182 | Int *m_scalingListCoef [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< quantization matrix |
---|
183 | }; |
---|
184 | |
---|
185 | class ProfileTierLevel |
---|
186 | { |
---|
187 | Int m_profileSpace; |
---|
188 | Bool m_tierFlag; |
---|
189 | Int m_profileIdc; |
---|
190 | Bool m_profileCompatibilityFlag[32]; |
---|
191 | Int m_levelIdc; |
---|
192 | |
---|
193 | Bool m_progressiveSourceFlag; |
---|
194 | Bool m_interlacedSourceFlag; |
---|
195 | Bool m_nonPackedConstraintFlag; |
---|
196 | Bool m_frameOnlyConstraintFlag; |
---|
197 | |
---|
198 | public: |
---|
199 | ProfileTierLevel(); |
---|
200 | |
---|
201 | Int getProfileSpace() const { return m_profileSpace; } |
---|
202 | Void setProfileSpace(Int x) { m_profileSpace = x; } |
---|
203 | |
---|
204 | Bool getTierFlag() const { return m_tierFlag; } |
---|
205 | Void setTierFlag(Bool x) { m_tierFlag = x; } |
---|
206 | |
---|
207 | Int getProfileIdc() const { return m_profileIdc; } |
---|
208 | Void setProfileIdc(Int x) { m_profileIdc = x; } |
---|
209 | |
---|
210 | Bool getProfileCompatibilityFlag(Int i) const { return m_profileCompatibilityFlag[i]; } |
---|
211 | Void setProfileCompatibilityFlag(Int i, Bool x) { m_profileCompatibilityFlag[i] = x; } |
---|
212 | |
---|
213 | Int getLevelIdc() const { return m_levelIdc; } |
---|
214 | Void setLevelIdc(Int x) { m_levelIdc = x; } |
---|
215 | |
---|
216 | Bool getProgressiveSourceFlag() const { return m_progressiveSourceFlag; } |
---|
217 | Void setProgressiveSourceFlag(Bool b) { m_progressiveSourceFlag = b; } |
---|
218 | |
---|
219 | Bool getInterlacedSourceFlag() const { return m_interlacedSourceFlag; } |
---|
220 | Void setInterlacedSourceFlag(Bool b) { m_interlacedSourceFlag = b; } |
---|
221 | |
---|
222 | Bool getNonPackedConstraintFlag() const { return m_nonPackedConstraintFlag; } |
---|
223 | Void setNonPackedConstraintFlag(Bool b) { m_nonPackedConstraintFlag = b; } |
---|
224 | |
---|
225 | Bool getFrameOnlyConstraintFlag() const { return m_frameOnlyConstraintFlag; } |
---|
226 | Void setFrameOnlyConstraintFlag(Bool b) { m_frameOnlyConstraintFlag = b; } |
---|
227 | }; |
---|
228 | |
---|
229 | |
---|
230 | class TComPTL |
---|
231 | { |
---|
232 | ProfileTierLevel m_generalPTL; |
---|
233 | ProfileTierLevel m_subLayerPTL[6]; // max. value of max_sub_layers_minus1 is 6 |
---|
234 | Bool m_subLayerProfilePresentFlag[6]; |
---|
235 | Bool m_subLayerLevelPresentFlag[6]; |
---|
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 H_MV |
---|
248 | Void copyLevelFrom( TComPTL* source ); |
---|
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 H_MV |
---|
406 | |
---|
407 | class TComVideoSignalInfo |
---|
408 | { |
---|
409 | private: |
---|
410 | Int m_videoVpsFormat; |
---|
411 | Bool m_videoFullRangeVpsFlag; |
---|
412 | Int m_colourPrimariesVps; |
---|
413 | Int m_transferCharacteristicsVps; |
---|
414 | Int m_matrixCoeffsVps; |
---|
415 | public: |
---|
416 | Void setVideoVpsFormat( Int val ) { m_videoVpsFormat = val; } |
---|
417 | Int getVideoVpsFormat( ) { return m_videoVpsFormat; } |
---|
418 | |
---|
419 | Void setVideoFullRangeVpsFlag( Bool flag ) { m_videoFullRangeVpsFlag = flag; } |
---|
420 | Bool getVideoFullRangeVpsFlag( ) { return m_videoFullRangeVpsFlag; } |
---|
421 | |
---|
422 | Void setColourPrimariesVps( Int val ) { m_colourPrimariesVps = val; } |
---|
423 | Int getColourPrimariesVps( ) { return m_colourPrimariesVps; } |
---|
424 | |
---|
425 | Void setTransferCharacteristicsVps( Int val ) { m_transferCharacteristicsVps = val; } |
---|
426 | Int getTransferCharacteristicsVps( ) { return m_transferCharacteristicsVps; } |
---|
427 | |
---|
428 | Void setMatrixCoeffsVps( Int val ) { m_matrixCoeffsVps = val; } |
---|
429 | Int getMatrixCoeffsVps( ) { return m_matrixCoeffsVps; } |
---|
430 | }; |
---|
431 | class TComVpsVuiBspHrdParameters |
---|
432 | { |
---|
433 | private: |
---|
434 | Int m_vpsNumBspHrdParametersMinus1; |
---|
435 | Bool m_bspCprmsPresentFlag[MAX_NUM_BSP_HRD_PARAMETERS]; |
---|
436 | Int m_numBitstreamPartitions[MAX_VPS_OP_SETS_PLUS1]; |
---|
437 | Bool m_layerInBspFlag[MAX_VPS_OP_SETS_PLUS1][MAX_NUM_BSP_HRD_PARAMETERS][MAX_NUM_LAYERS]; |
---|
438 | Int m_numBspSchedCombinations[MAX_VPS_OP_SETS_PLUS1]; |
---|
439 | Int m_bspCombHrdIdx[MAX_VPS_OP_SETS_PLUS1][MAX_NUM_BSP_HRD_PARAMETERS][MAX_NUM_BSP_SCHED_COMBINATION]; |
---|
440 | Int m_bspCombSchedIdx[MAX_VPS_OP_SETS_PLUS1][MAX_NUM_BSP_HRD_PARAMETERS][MAX_NUM_BSP_SCHED_COMBINATION]; |
---|
441 | TComHRD* m_hrdParameters[MAX_NUM_BSP_HRD_PARAMETERS]; |
---|
442 | public: |
---|
443 | |
---|
444 | Void setVpsNumBspHrdParametersMinus1( Int val ) { m_vpsNumBspHrdParametersMinus1 = val; } |
---|
445 | Int getVpsNumBspHrdParametersMinus1( ) { return m_vpsNumBspHrdParametersMinus1; } |
---|
446 | |
---|
447 | Void setBspCprmsPresentFlag( Int i, Bool flag ) { m_bspCprmsPresentFlag[i] = flag; } |
---|
448 | Bool getBspCprmsPresentFlag( Int i ) { return m_bspCprmsPresentFlag[i]; } |
---|
449 | |
---|
450 | Void setNumBitstreamPartitions( Int h, Int val ) { m_numBitstreamPartitions[h] = val; } |
---|
451 | Int getNumBitstreamPartitions( Int h ) { return m_numBitstreamPartitions[h]; } |
---|
452 | |
---|
453 | Void setLayerInBspFlag( Int h, Int i, Int j, Bool flag ) { m_layerInBspFlag[h][i][j] = flag; } |
---|
454 | Bool getLayerInBspFlag( Int h, Int i, Int j ) { return m_layerInBspFlag[h][i][j]; } |
---|
455 | Void checkLayerInBspFlag ( TComVPS* vps, Int h ); |
---|
456 | |
---|
457 | Void setNumBspSchedCombinations( Int h, Int val ) { m_numBspSchedCombinations[h] = val; } |
---|
458 | Int getNumBspSchedCombinations( Int h ) { return m_numBspSchedCombinations[h]; } |
---|
459 | |
---|
460 | Void setBspCombHrdIdx( Int h, Int i, Int j, Int val ) { m_bspCombHrdIdx[h][i][j] = val; } |
---|
461 | Int getBspCombHrdIdx( Int h, Int i, Int j ) { return m_bspCombHrdIdx[h][i][j]; } |
---|
462 | |
---|
463 | Void setBspCombSchedIdx( Int h, Int i, Int j, Int val ) { m_bspCombSchedIdx[h][i][j] = val; } |
---|
464 | Int getBspCombSchedIdx( Int h, Int i, Int j ) { return m_bspCombSchedIdx[h][i][j]; } |
---|
465 | |
---|
466 | Void setHrdParametermeters( Int k, TComHRD* val ) { m_hrdParameters[k] = val; }; |
---|
467 | TComHRD* getHrdParametermeters( Int k ) { return m_hrdParameters[k]; }; |
---|
468 | }; |
---|
469 | |
---|
470 | class TComVPSVUI |
---|
471 | { |
---|
472 | private: |
---|
473 | Bool m_crossLayerPicTypeAlignedFlag; |
---|
474 | Bool m_crossLayerIrapAlignedFlag; |
---|
475 | Bool m_allLayersIdrAlignedFlag; |
---|
476 | Bool m_bitRatePresentVpsFlag; |
---|
477 | Bool m_picRatePresentVpsFlag; |
---|
478 | Bool m_bitRatePresentFlag [MAX_VPS_OP_SETS_PLUS1][MAX_TLAYER]; |
---|
479 | Bool m_picRatePresentFlag [MAX_VPS_OP_SETS_PLUS1][MAX_TLAYER]; |
---|
480 | Int m_avgBitRate [MAX_VPS_OP_SETS_PLUS1][MAX_TLAYER]; |
---|
481 | Int m_maxBitRate [MAX_VPS_OP_SETS_PLUS1][MAX_TLAYER]; |
---|
482 | Int m_constantPicRateIdc [MAX_VPS_OP_SETS_PLUS1][MAX_TLAYER]; |
---|
483 | Int m_avgPicRate [MAX_VPS_OP_SETS_PLUS1][MAX_TLAYER]; |
---|
484 | Bool m_videoSignalInfoIdxPresentFlag; |
---|
485 | Int m_vpsNumVideoSignalInfoMinus1; |
---|
486 | TComVideoSignalInfo* m_videoSignalInfo[MAX_NUM_VIDEO_SIGNAL_INFO]; |
---|
487 | Int m_vpsVideoSignalInfoIdx [MAX_NUM_VIDEO_SIGNAL_INFO]; |
---|
488 | Bool m_tilesNotInUseFlag; |
---|
489 | Bool m_tilesInUseFlag [MAX_NUM_LAYERS]; |
---|
490 | Bool m_loopFilterNotAcrossTilesFlag[MAX_NUM_LAYERS]; |
---|
491 | Bool m_tileBoundariesAlignedFlag [MAX_NUM_LAYERS][MAX_NUM_LAYERS]; |
---|
492 | Bool m_wppNotInUseFlag; |
---|
493 | Bool m_wppInUseFlag [MAX_NUM_LAYERS]; |
---|
494 | Bool m_ilpRestrictedRefLayersFlag; |
---|
495 | Int m_minSpatialSegmentOffsetPlus1[MAX_NUM_LAYERS][MAX_NUM_LAYERS]; |
---|
496 | Bool m_ctuBasedOffsetEnabledFlag [MAX_NUM_LAYERS][MAX_NUM_LAYERS]; |
---|
497 | Int m_minHorizontalCtuOffsetPlus1 [MAX_NUM_LAYERS][MAX_NUM_LAYERS]; |
---|
498 | Bool m_vpsVuiBspHrdPresentFlag; |
---|
499 | TComVpsVuiBspHrdParameters* m_vpsVuiBspHrdParameters; |
---|
500 | Bool m_baseLayerParameterSetCompatibilityFlag[MAX_NUM_LAYERS]; |
---|
501 | |
---|
502 | public: |
---|
503 | TComVPSVUI(); |
---|
504 | ~TComVPSVUI(); |
---|
505 | Void setCrossLayerPicTypeAlignedFlag( Bool flag ) { m_crossLayerPicTypeAlignedFlag = flag; } |
---|
506 | Bool getCrossLayerPicTypeAlignedFlag( ) { return m_crossLayerPicTypeAlignedFlag; } |
---|
507 | |
---|
508 | Void setCrossLayerIrapAlignedFlag( Bool flag ) { m_crossLayerIrapAlignedFlag = flag; } |
---|
509 | Bool getCrossLayerIrapAlignedFlag( ) { return m_crossLayerIrapAlignedFlag; } |
---|
510 | |
---|
511 | Void setAllLayersIdrAlignedFlag( Bool flag ) { m_allLayersIdrAlignedFlag = flag; } |
---|
512 | Bool getAllLayersIdrAlignedFlag( ) { return m_allLayersIdrAlignedFlag; } |
---|
513 | |
---|
514 | Void setBitRatePresentVpsFlag( Bool flag ) { m_bitRatePresentVpsFlag = flag; } |
---|
515 | Bool getBitRatePresentVpsFlag( ) { return m_bitRatePresentVpsFlag; } |
---|
516 | |
---|
517 | Void setPicRatePresentVpsFlag( Bool flag ) { m_picRatePresentVpsFlag = flag; } |
---|
518 | Bool getPicRatePresentVpsFlag( ) { return m_picRatePresentVpsFlag; } |
---|
519 | |
---|
520 | Void setBitRatePresentFlag( Int i, Int j, Bool flag ) { m_bitRatePresentFlag[i][j] = flag; } |
---|
521 | Bool getBitRatePresentFlag( Int i, Int j ) { return m_bitRatePresentFlag[i][j]; } |
---|
522 | |
---|
523 | Void setPicRatePresentFlag( Int i, Int j, Bool flag ) { m_picRatePresentFlag[i][j] = flag; } |
---|
524 | Bool getPicRatePresentFlag( Int i, Int j ) { return m_picRatePresentFlag[i][j]; } |
---|
525 | |
---|
526 | Void setAvgBitRate( Int i, Int j, Int val ) { m_avgBitRate[i][j] = val; } |
---|
527 | Int getAvgBitRate( Int i, Int j ) { return m_avgBitRate[i][j]; } |
---|
528 | |
---|
529 | Void setMaxBitRate( Int i, Int j, Int val ) { m_maxBitRate[i][j] = val; } |
---|
530 | Int getMaxBitRate( Int i, Int j ) { return m_maxBitRate[i][j]; } |
---|
531 | |
---|
532 | Void setConstantPicRateIdc( Int i, Int j, Int val ) { m_constantPicRateIdc[i][j] = val; } |
---|
533 | Int getConstantPicRateIdc( Int i, Int j ) { return m_constantPicRateIdc[i][j]; } |
---|
534 | |
---|
535 | Void setAvgPicRate( Int i, Int j, Int val ) { m_avgPicRate[i][j] = val; } |
---|
536 | Int getAvgPicRate( Int i, Int j ) { return m_avgPicRate[i][j]; } |
---|
537 | |
---|
538 | Void setVideoSignalInfoIdxPresentFlag( Bool flag ) { m_videoSignalInfoIdxPresentFlag = flag; } |
---|
539 | Bool getVideoSignalInfoIdxPresentFlag( ) { return m_videoSignalInfoIdxPresentFlag; } |
---|
540 | |
---|
541 | Void setVideoSignalInfo( Int i, TComVideoSignalInfo* val ) { m_videoSignalInfo[i] = val; } |
---|
542 | TComVideoSignalInfo* getVideoSignalInfo( Int i ) { return m_videoSignalInfo[i]; } |
---|
543 | |
---|
544 | Void setVpsNumVideoSignalInfoMinus1( Int val ) { m_vpsNumVideoSignalInfoMinus1 = val; } |
---|
545 | Int getVpsNumVideoSignalInfoMinus1( ) { return m_vpsNumVideoSignalInfoMinus1; } |
---|
546 | |
---|
547 | Void setVpsVideoSignalInfoIdx( Int i, Int val ) { m_vpsVideoSignalInfoIdx[i] = val; } |
---|
548 | Int getVpsVideoSignalInfoIdx( Int i ) { return m_vpsVideoSignalInfoIdx[i]; } |
---|
549 | |
---|
550 | Void setTilesNotInUseFlag( Bool flag ) { m_tilesNotInUseFlag = flag; } |
---|
551 | Bool getTilesNotInUseFlag( ) { return m_tilesNotInUseFlag; } |
---|
552 | |
---|
553 | Void setTilesInUseFlag( Int i, Bool flag ) { m_tilesInUseFlag[i] = flag; } |
---|
554 | Bool getTilesInUseFlag( Int i ) { return m_tilesInUseFlag[i]; } |
---|
555 | |
---|
556 | Void setLoopFilterNotAcrossTilesFlag( Int i, Int val ) { m_loopFilterNotAcrossTilesFlag[i] = val; } |
---|
557 | Bool getLoopFilterNotAcrossTilesFlag( Int i ) { return m_loopFilterNotAcrossTilesFlag[i]; } |
---|
558 | |
---|
559 | Void setTileBoundariesAlignedFlag( Int i, Int j, Bool flag ) { m_tileBoundariesAlignedFlag[i][j] = flag; } |
---|
560 | Bool getTileBoundariesAlignedFlag( Int i, Int j ) { return m_tileBoundariesAlignedFlag[i][j]; } |
---|
561 | |
---|
562 | Void setWppNotInUseFlag( Bool flag ) { m_wppNotInUseFlag = flag; } |
---|
563 | Bool getWppNotInUseFlag( ) { return m_wppNotInUseFlag; } |
---|
564 | |
---|
565 | Void setWppInUseFlag( Int i, Bool flag ) { m_wppInUseFlag[i] = flag; } |
---|
566 | Bool getWppInUseFlag( Int i ) { return m_wppInUseFlag[i]; } |
---|
567 | |
---|
568 | Void setIlpRestrictedRefLayersFlag( Bool flag ) { m_ilpRestrictedRefLayersFlag = flag; } |
---|
569 | Bool getIlpRestrictedRefLayersFlag( ) { return m_ilpRestrictedRefLayersFlag; } |
---|
570 | |
---|
571 | Void setMinSpatialSegmentOffsetPlus1( Int i, Int j, Int val ) { m_minSpatialSegmentOffsetPlus1[i][j] = val; } |
---|
572 | Int getMinSpatialSegmentOffsetPlus1( Int i, Int j ) { return m_minSpatialSegmentOffsetPlus1[i][j]; } |
---|
573 | |
---|
574 | Void setCtuBasedOffsetEnabledFlag( Int i, Int j, Bool flag ) { m_ctuBasedOffsetEnabledFlag[i][j] = flag; } |
---|
575 | Bool getCtuBasedOffsetEnabledFlag( Int i, Int j ) { return m_ctuBasedOffsetEnabledFlag[i][j]; } |
---|
576 | |
---|
577 | Void setMinHorizontalCtuOffsetPlus1( Int i, Int j, Int val ) { m_minHorizontalCtuOffsetPlus1[i][j] = val; } |
---|
578 | Int getMinHorizontalCtuOffsetPlus1( Int i, Int j ) { return m_minHorizontalCtuOffsetPlus1[i][j]; } |
---|
579 | |
---|
580 | Void setVpsVuiBspHrdPresentFlag( Bool flag ) { m_vpsVuiBspHrdPresentFlag = flag; } |
---|
581 | Bool getVpsVuiBspHrdPresentFlag( ) { return m_vpsVuiBspHrdPresentFlag; } |
---|
582 | |
---|
583 | Void setVpsVuiBspHrdParameters( TComVpsVuiBspHrdParameters* val) { m_vpsVuiBspHrdParameters = val; } |
---|
584 | TComVpsVuiBspHrdParameters* getVpsVuiBspHrdParameters( ) { return m_vpsVuiBspHrdParameters; } |
---|
585 | |
---|
586 | Void setBaseLayerParameterSetCompatibilityFlag( Int i, Bool flag ) { m_baseLayerParameterSetCompatibilityFlag[i] = flag; } |
---|
587 | Bool getBaseLayerParameterSetCompatibilityFlag( Int i ) { return m_baseLayerParameterSetCompatibilityFlag[i]; } |
---|
588 | |
---|
589 | Void inferVpsVui( Bool encoderFlag ); |
---|
590 | }; |
---|
591 | |
---|
592 | class TComRepFormat |
---|
593 | { |
---|
594 | private: |
---|
595 | Bool m_chromaAndBitDepthVpsPresentFlag; |
---|
596 | Int m_chromaFormatVpsIdc; |
---|
597 | Bool m_separateColourPlaneVpsFlag; |
---|
598 | Int m_picWidthVpsInLumaSamples; |
---|
599 | Int m_picHeightVpsInLumaSamples; |
---|
600 | Int m_bitDepthVpsLumaMinus8; |
---|
601 | Int m_bitDepthVpsChromaMinus8; |
---|
602 | |
---|
603 | public: |
---|
604 | TComRepFormat() { }; |
---|
605 | |
---|
606 | Void setChromaAndBitDepthVpsPresentFlag( Bool flag ) { m_chromaAndBitDepthVpsPresentFlag = flag; } |
---|
607 | Bool getChromaAndBitDepthVpsPresentFlag( ) { return m_chromaAndBitDepthVpsPresentFlag; } |
---|
608 | Void checkChromaAndBitDepthVpsPresentFlag( Int i ) { assert( i != 0 || m_chromaAndBitDepthVpsPresentFlag ); } // The value of chroma_and_bit_depth_vps_present_flag of the first rep_format( ) syntax structure in the VPS shall be equal to 1. |
---|
609 | Void inferChromaAndBitDepth( TComRepFormat* prevRepFormat, Bool encoderFlag ); |
---|
610 | |
---|
611 | Void setChromaFormatVpsIdc( Int val ) { m_chromaFormatVpsIdc = val; } |
---|
612 | Int getChromaFormatVpsIdc( ) { return m_chromaFormatVpsIdc; } |
---|
613 | |
---|
614 | Void setSeparateColourPlaneVpsFlag( Bool flag ) { m_separateColourPlaneVpsFlag = flag; } |
---|
615 | Bool getSeparateColourPlaneVpsFlag( ) { return m_separateColourPlaneVpsFlag; } |
---|
616 | |
---|
617 | Void setPicWidthVpsInLumaSamples( Int val ) { m_picWidthVpsInLumaSamples = val; } |
---|
618 | Int getPicWidthVpsInLumaSamples( ) { return m_picWidthVpsInLumaSamples; } |
---|
619 | |
---|
620 | Void setPicHeightVpsInLumaSamples( Int val ) { m_picHeightVpsInLumaSamples = val; } |
---|
621 | Int getPicHeightVpsInLumaSamples( ) { return m_picHeightVpsInLumaSamples; } |
---|
622 | |
---|
623 | Void setBitDepthVpsLumaMinus8( Int val ) { m_bitDepthVpsLumaMinus8 = val; } |
---|
624 | Int getBitDepthVpsLumaMinus8( ) { return m_bitDepthVpsLumaMinus8; } |
---|
625 | |
---|
626 | Void setBitDepthVpsChromaMinus8( Int val ) { m_bitDepthVpsChromaMinus8 = val; } |
---|
627 | Int getBitDepthVpsChromaMinus8( ) { return m_bitDepthVpsChromaMinus8; } |
---|
628 | }; |
---|
629 | |
---|
630 | |
---|
631 | class TComDpbSize |
---|
632 | { |
---|
633 | private: |
---|
634 | Bool m_subLayerFlagInfoPresentFlag[MAX_VPS_OUTPUTLAYER_SETS]; |
---|
635 | Bool m_subLayerDpbInfoPresentFlag [MAX_VPS_OUTPUTLAYER_SETS][MAX_TLAYER]; |
---|
636 | Int m_maxVpsDecPicBufferingMinus1[MAX_VPS_OUTPUTLAYER_SETS][MAX_NUM_LAYER_IDS][MAX_TLAYER];; |
---|
637 | Int m_maxVpsNumReorderPics [MAX_VPS_OUTPUTLAYER_SETS][MAX_TLAYER]; |
---|
638 | #if H_MV_HLS7_GEN |
---|
639 | Int m_maxVpsLayerDecPicBuffMinus1[TO_BE_SPECIFIED][TO_BE_SPECIFIED][TO_BE_SPECIFIED]; |
---|
640 | #endif |
---|
641 | Int m_maxVpsLatencyIncreasePlus1 [MAX_VPS_OUTPUTLAYER_SETS][MAX_TLAYER]; |
---|
642 | |
---|
643 | public: |
---|
644 | TComDpbSize( ); |
---|
645 | |
---|
646 | Void setSubLayerFlagInfoPresentFlag( Int i, Bool flag ) { m_subLayerFlagInfoPresentFlag[i] = flag; } |
---|
647 | Bool getSubLayerFlagInfoPresentFlag( Int i ) { return m_subLayerFlagInfoPresentFlag[i]; } |
---|
648 | |
---|
649 | Void setSubLayerDpbInfoPresentFlag( Int i, Int j, Bool flag ) { m_subLayerDpbInfoPresentFlag[i][j] = flag; } |
---|
650 | Bool getSubLayerDpbInfoPresentFlag( Int i, Int j ) { return m_subLayerDpbInfoPresentFlag[i][j]; } |
---|
651 | |
---|
652 | Void setMaxVpsDecPicBufferingMinus1( Int i, Int k, Int j, Int val ) { m_maxVpsDecPicBufferingMinus1[i][k][j] = val; } |
---|
653 | Int getMaxVpsDecPicBufferingMinus1( Int i, Int k, Int j ) { return m_maxVpsDecPicBufferingMinus1[i][k][j]; } |
---|
654 | |
---|
655 | Void setMaxVpsNumReorderPics( Int i, Int j, Int val ) { m_maxVpsNumReorderPics[i][j] = val; } |
---|
656 | Int getMaxVpsNumReorderPics( Int i, Int j ) { return m_maxVpsNumReorderPics[i][j]; } |
---|
657 | #if H_MV_HLS7_GEN |
---|
658 | Void setMaxVpsLayerDecPicBuffMinus1( Int i, Int k, Int j, Int val ) { m_maxVpsLayerDecPicBuffMinus1[i][k][j] = val; } |
---|
659 | Int getMaxVpsLayerDecPicBuffMinus1( Int i, Int k, Int j ) { return m_maxVpsLayerDecPicBuffMinus1[i][k][j]; } |
---|
660 | #endif |
---|
661 | Void setMaxVpsLatencyIncreasePlus1( Int i, Int j, Int val ) { m_maxVpsLatencyIncreasePlus1[i][j] = val; } |
---|
662 | Int getMaxVpsLatencyIncreasePlus1( Int i, Int j ) { return m_maxVpsLatencyIncreasePlus1[i][j]; } |
---|
663 | }; |
---|
664 | #endif |
---|
665 | class TComVPS |
---|
666 | { |
---|
667 | private: |
---|
668 | Int m_VPSId; |
---|
669 | UInt m_uiMaxTLayers; |
---|
670 | |
---|
671 | #if H_MV |
---|
672 | UInt m_uiMaxLayersMinus1; |
---|
673 | #else |
---|
674 | UInt m_uiMaxLayers; |
---|
675 | #endif |
---|
676 | Bool m_bTemporalIdNestingFlag; |
---|
677 | |
---|
678 | UInt m_numReorderPics[MAX_TLAYER]; |
---|
679 | UInt m_uiMaxDecPicBuffering[MAX_TLAYER]; |
---|
680 | UInt m_uiMaxLatencyIncrease[MAX_TLAYER]; // Really max latency increase plus 1 (value 0 expresses no limit) |
---|
681 | |
---|
682 | UInt m_numHrdParameters; |
---|
683 | #if H_MV |
---|
684 | UInt m_maxLayerId; |
---|
685 | #else |
---|
686 | UInt m_maxNuhReservedZeroLayerId; |
---|
687 | #endif |
---|
688 | TComHRD* m_hrdParameters; |
---|
689 | UInt* m_hrdOpSetIdx; |
---|
690 | Bool* m_cprmsPresentFlag; |
---|
691 | #if H_MV |
---|
692 | UInt m_vpsNumLayerSetsMinus1; |
---|
693 | Bool m_layerIdIncludedFlag[MAX_VPS_OP_SETS_PLUS1][MAX_VPS_NUH_LAYER_ID_PLUS1]; |
---|
694 | #else |
---|
695 | UInt m_numOpSets; |
---|
696 | Bool m_layerIdIncludedFlag[MAX_VPS_OP_SETS_PLUS1][MAX_VPS_NUH_RESERVED_ZERO_LAYER_ID_PLUS1]; |
---|
697 | #endif |
---|
698 | |
---|
699 | #if H_MV |
---|
700 | TComPTL m_pcPTL[MAX_VPS_OP_SETS_PLUS1]; |
---|
701 | #else |
---|
702 | TComPTL m_pcPTL; |
---|
703 | #endif |
---|
704 | TimingInfo m_timingInfo; |
---|
705 | #if H_MV |
---|
706 | /// VPS EXTENSION SYNTAX ELEMENTS |
---|
707 | Bool m_avcBaseLayerFlag; |
---|
708 | Int m_vpsNonVuiExtensionLength; |
---|
709 | Bool m_splittingFlag; |
---|
710 | Bool m_scalabilityMaskFlag [MAX_NUM_SCALABILITY_TYPES]; |
---|
711 | Int m_dimensionIdLen [MAX_NUM_SCALABILITY_TYPES]; |
---|
712 | Bool m_vpsNuhLayerIdPresentFlag; |
---|
713 | Int m_layerIdInNuh [MAX_NUM_LAYER_IDS]; |
---|
714 | Int m_dimensionId [MAX_NUM_LAYER_IDS][MAX_NUM_SCALABILITY_TYPES]; |
---|
715 | |
---|
716 | Int m_viewIdLen; |
---|
717 | Int m_viewIdVal [MAX_NUM_LAYERS]; |
---|
718 | Bool m_directDependencyFlag [MAX_NUM_LAYER_IDS][MAX_NUM_LAYER_IDS]; |
---|
719 | Bool m_vpsSubLayersMaxMinus1PresentFlag; |
---|
720 | Int m_subLayersVpsMaxMinus1 [MAX_NUM_LAYERS]; |
---|
721 | Bool m_maxTidRefPresentFlag; |
---|
722 | Int m_maxTidIlRefPicsPlus1 [MAX_NUM_LAYERS][MAX_NUM_LAYERS]; |
---|
723 | Bool m_allRefLayersActiveFlag; |
---|
724 | Int m_vpsNumProfileTierLevelMinus1; |
---|
725 | Bool m_vpsProfilePresentFlag [MAX_VPS_OP_SETS_PLUS1]; |
---|
726 | |
---|
727 | Int m_numAddOutputLayerSets; |
---|
728 | Int m_defaultTargetOutputLayerIdc; |
---|
729 | |
---|
730 | Int m_outputLayerSetIdxMinus1 [MAX_VPS_OUTPUTLAYER_SETS]; |
---|
731 | Bool m_outputLayerFlag [MAX_VPS_OUTPUTLAYER_SETS][MAX_VPS_NUH_LAYER_ID_PLUS1]; |
---|
732 | Int m_profileLevelTierIdx [MAX_VPS_OUTPUTLAYER_SETS ]; |
---|
733 | Bool m_altOutputLayerFlag [MAX_VPS_OUTPUTLAYER_SETS]; |
---|
734 | Bool m_repFormatIdxPresentFlag; |
---|
735 | Int m_vpsNumRepFormatsMinus1; |
---|
736 | Int m_vpsRepFormatIdx [MAX_NUM_LAYERS]; |
---|
737 | TComRepFormat* m_repFormat [MAX_NUM_LAYERS]; |
---|
738 | Bool m_maxOneActiveRefLayerFlag; |
---|
739 | #if H_MV_HLS7_GEN |
---|
740 | Bool m_vpsPocLsbAlignedFlag; |
---|
741 | #endif |
---|
742 | Bool m_pocLsbNotPresentFlag [MAX_NUM_LAYERS]; |
---|
743 | |
---|
744 | TComDpbSize* m_dpbSize; |
---|
745 | Int m_directDepTypeLenMinus2; |
---|
746 | Bool m_defaultDirectDependencyFlag; |
---|
747 | Int m_defaultDirectDependencyType; |
---|
748 | |
---|
749 | #if H_MV_HLS7_GEN |
---|
750 | Int m_directDependencyType [MAX_NUM_LAYERS] [MAX_NUM_LAYERS]; |
---|
751 | #endif |
---|
752 | Bool m_vpsVuiPresentFlag; |
---|
753 | TComVPSVUI* m_vpsVUI; |
---|
754 | #if !H_MV_HLS7_GEN |
---|
755 | Int m_directDependencyType [MAX_NUM_LAYERS] [MAX_NUM_LAYERS]; |
---|
756 | #endif |
---|
757 | |
---|
758 | // VPS EXTENSION SEMANTICS VARIABLES |
---|
759 | Int m_layerIdInVps [MAX_NUM_LAYERS ]; |
---|
760 | |
---|
761 | Int m_numDirectRefLayers [MAX_NUM_LAYERS]; |
---|
762 | Int m_refLayerId [MAX_NUM_LAYERS][MAX_NUM_LAYERS]; |
---|
763 | |
---|
764 | Int m_numSamplePredRefLayers [MAX_NUM_LAYERS]; |
---|
765 | Bool m_samplePredEnabledFlag [MAX_NUM_LAYERS][MAX_NUM_LAYERS]; |
---|
766 | Int m_samplePredRefLayerId [MAX_NUM_LAYERS][MAX_NUM_LAYERS]; |
---|
767 | |
---|
768 | Int m_numMotionPredRefLayers [MAX_NUM_LAYERS]; |
---|
769 | Bool m_motionPredEnabledFlag [MAX_NUM_LAYERS][MAX_NUM_LAYERS]; |
---|
770 | Int m_motionPredRefLayerId [MAX_NUM_LAYERS][MAX_NUM_LAYERS]; |
---|
771 | Int m_viewIndex [MAX_NUM_LAYERS ]; |
---|
772 | |
---|
773 | std::vector< std::vector< Int> > m_targetDecLayerIdLists; //[TargetOptLayerSetIdx][i] |
---|
774 | std::vector< std::vector< Int> > m_targetOptLayerIdLists; |
---|
775 | std::vector< std::vector< Int> > m_layerSetLayerIdList; |
---|
776 | |
---|
777 | |
---|
778 | Int xGetDimBitOffset( Int j ); |
---|
779 | |
---|
780 | // VPS EXTENSION 2 SYNTAX ELEMENTS |
---|
781 | #if H_3D_ARP |
---|
782 | UInt m_uiUseAdvResPred [MAX_NUM_LAYERS ]; |
---|
783 | UInt m_uiARPStepNum [MAX_NUM_LAYERS ]; |
---|
784 | #endif |
---|
785 | #if H_3D_IV_MERGE |
---|
786 | Bool m_ivMvPredFlag [ MAX_NUM_LAYERS ]; |
---|
787 | #if H_3D_SPIVMP |
---|
788 | Int m_iSubPULog2Size [MAX_NUM_LAYERS ]; |
---|
789 | Int m_iSubPUMPILog2Size; |
---|
790 | #endif |
---|
791 | #endif |
---|
792 | #if H_3D_VSP |
---|
793 | Bool m_viewSynthesisPredFlag [ MAX_NUM_LAYERS ]; |
---|
794 | #endif |
---|
795 | #if H_3D_NBDV_REF |
---|
796 | Bool m_depthRefinementFlag [ MAX_NUM_LAYERS ]; |
---|
797 | #endif |
---|
798 | Bool m_vpsDepthModesFlag [MAX_NUM_LAYERS ]; |
---|
799 | |
---|
800 | #if H_3D |
---|
801 | UInt m_uiCamParPrecision; |
---|
802 | Bool* m_bCamParInSliceHeader; |
---|
803 | Bool* m_bCamParPresent; |
---|
804 | Int ***m_aaaiCodedScale ; |
---|
805 | Int ***m_aaaiCodedOffset; |
---|
806 | Bool m_ivMvScalingFlag; |
---|
807 | #endif |
---|
808 | #if H_3D_INTER_SDC |
---|
809 | Bool m_bInterSDCFlag[MAX_NUM_LAYERS ]; |
---|
810 | #endif |
---|
811 | #if H_3D_DBBP |
---|
812 | Bool m_dbbpFlag[MAX_NUM_LAYERS]; |
---|
813 | #endif |
---|
814 | #if H_3D_IV_MERGE |
---|
815 | Bool m_bMPIFlag[MAX_NUM_LAYERS ]; |
---|
816 | #endif |
---|
817 | |
---|
818 | #endif |
---|
819 | public: |
---|
820 | TComVPS(); |
---|
821 | virtual ~TComVPS(); |
---|
822 | |
---|
823 | Void createHrdParamBuffer() |
---|
824 | { |
---|
825 | m_hrdParameters = new TComHRD[ getNumHrdParameters() ]; |
---|
826 | m_hrdOpSetIdx = new UInt [ getNumHrdParameters() ]; |
---|
827 | m_cprmsPresentFlag = new Bool [ getNumHrdParameters() ]; |
---|
828 | } |
---|
829 | |
---|
830 | TComHRD* getHrdParameters ( UInt i ) { return &m_hrdParameters[ i ]; } |
---|
831 | UInt getHrdOpSetIdx ( UInt i ) { return m_hrdOpSetIdx[ i ]; } |
---|
832 | Void setHrdOpSetIdx ( UInt val, UInt i ) { m_hrdOpSetIdx[ i ] = val; } |
---|
833 | Bool getCprmsPresentFlag ( UInt i ) { return m_cprmsPresentFlag[ i ]; } |
---|
834 | Void setCprmsPresentFlag ( Bool val, UInt i ) { m_cprmsPresentFlag[ i ] = val; } |
---|
835 | |
---|
836 | Int getVPSId () { return m_VPSId; } |
---|
837 | Void setVPSId (Int i) { m_VPSId = i; } |
---|
838 | |
---|
839 | UInt getMaxTLayers () { return m_uiMaxTLayers; } |
---|
840 | Void setMaxTLayers (UInt t) { m_uiMaxTLayers = t; } |
---|
841 | |
---|
842 | #if H_MV |
---|
843 | UInt getMaxSubLayersMinus1() { return m_uiMaxTLayers - 1; } // For consistency with draft spec |
---|
844 | UInt getMaxLayersMinus1() { return m_uiMaxLayersMinus1; }; |
---|
845 | Void setMaxLayersMinus1(UInt l) { m_uiMaxLayersMinus1 = l; } |
---|
846 | #else |
---|
847 | UInt getMaxLayers () { return m_uiMaxLayers; } |
---|
848 | Void setMaxLayers (UInt l) { m_uiMaxLayers = l; } |
---|
849 | #endif |
---|
850 | |
---|
851 | Bool getTemporalNestingFlag () { return m_bTemporalIdNestingFlag; } |
---|
852 | Void setTemporalNestingFlag (Bool t) { m_bTemporalIdNestingFlag = t; } |
---|
853 | |
---|
854 | Void setNumReorderPics(UInt v, UInt tLayer) { m_numReorderPics[tLayer] = v; } |
---|
855 | UInt getNumReorderPics(UInt tLayer) { return m_numReorderPics[tLayer]; } |
---|
856 | |
---|
857 | Void setMaxDecPicBuffering(UInt v, UInt tLayer) { assert(tLayer < MAX_TLAYER); m_uiMaxDecPicBuffering[tLayer] = v; } |
---|
858 | UInt getMaxDecPicBuffering(UInt tLayer) { return m_uiMaxDecPicBuffering[tLayer]; } |
---|
859 | |
---|
860 | Void setMaxLatencyIncrease(UInt v, UInt tLayer) { m_uiMaxLatencyIncrease[tLayer] = v; } |
---|
861 | UInt getMaxLatencyIncrease(UInt tLayer) { return m_uiMaxLatencyIncrease[tLayer]; } |
---|
862 | |
---|
863 | UInt getNumHrdParameters() { return m_numHrdParameters; } |
---|
864 | Void setNumHrdParameters(UInt v) { m_numHrdParameters = v; } |
---|
865 | |
---|
866 | #if H_MV |
---|
867 | UInt getVpsMaxLayerId() { return m_maxLayerId; } |
---|
868 | Void setVpsMaxLayerId(UInt v) { m_maxLayerId = v; } |
---|
869 | |
---|
870 | UInt getVpsNumLayerSetsMinus1() { return m_vpsNumLayerSetsMinus1; } |
---|
871 | Void setVpsNumLayerSetsMinus1(UInt v) { m_vpsNumLayerSetsMinus1 = v; } |
---|
872 | #else |
---|
873 | UInt getMaxNuhReservedZeroLayerId() { return m_maxNuhReservedZeroLayerId; } |
---|
874 | Void setMaxNuhReservedZeroLayerId(UInt v) { m_maxNuhReservedZeroLayerId = v; } |
---|
875 | |
---|
876 | UInt getMaxOpSets() { return m_numOpSets; } |
---|
877 | Void setMaxOpSets(UInt v) { m_numOpSets = v; } |
---|
878 | #endif |
---|
879 | Bool getLayerIdIncludedFlag(UInt opsIdx, UInt id) { return m_layerIdIncludedFlag[opsIdx][id]; } |
---|
880 | Void setLayerIdIncludedFlag(Bool v, UInt opsIdx, UInt id) { m_layerIdIncludedFlag[opsIdx][id] = v; } |
---|
881 | |
---|
882 | #if H_MV |
---|
883 | TComPTL* getPTL( Int layerSet = 0 ) { return &m_pcPTL[layerSet]; } |
---|
884 | #else |
---|
885 | TComPTL* getPTL() { return &m_pcPTL; } |
---|
886 | #endif |
---|
887 | TimingInfo* getTimingInfo() { return &m_timingInfo; } |
---|
888 | #if H_MV |
---|
889 | Void setAvcBaseLayerFlag( Bool val ) { m_avcBaseLayerFlag = val; } |
---|
890 | Bool getAvcBaseLayerFlag() { return m_avcBaseLayerFlag; } |
---|
891 | |
---|
892 | Void setVpsNonVuiExtensionLength( Int val ) { m_vpsNonVuiExtensionLength = val; } |
---|
893 | Int getVpsNonVuiExtensionLength( ) { return m_vpsNonVuiExtensionLength; } |
---|
894 | |
---|
895 | Void setSplittingFlag( Bool val ) { m_splittingFlag = val; } |
---|
896 | Bool getSplittingFlag() { return m_splittingFlag; } |
---|
897 | |
---|
898 | Void setScalabilityMaskFlag( UInt val ); |
---|
899 | Void setScalabilityMaskFlag( Int scalType, Bool val ) { m_scalabilityMaskFlag[scalType] = val; } |
---|
900 | Bool getScalabilityMaskFlag( Int scalType ) { return m_scalabilityMaskFlag[scalType]; } |
---|
901 | |
---|
902 | Int getNumScalabilityTypes( ); |
---|
903 | |
---|
904 | Void setDimensionIdLen( Int sIdx, Int val ) { m_dimensionIdLen[sIdx] = val; } |
---|
905 | Int getDimensionIdLen( Int sIdx ) { assert( m_dimensionIdLen[sIdx] > 0) ; return m_dimensionIdLen[sIdx]; } |
---|
906 | |
---|
907 | Void setVpsNuhLayerIdPresentFlag( Bool val ) { m_vpsNuhLayerIdPresentFlag = val; } |
---|
908 | Bool getVpsNuhLayerIdPresentFlag() { return m_vpsNuhLayerIdPresentFlag; } |
---|
909 | |
---|
910 | Void setLayerIdInNuh( Int layerIdInVps, Int val ) { m_layerIdInNuh[layerIdInVps] = val; } |
---|
911 | Int getLayerIdInNuh( Int layerIdInVps ) { assert( m_layerIdInNuh[layerIdInVps] >= 0 ); return m_layerIdInNuh[layerIdInVps]; } |
---|
912 | |
---|
913 | Bool nuhLayerIdIncluded( Int layerIdinNuh ) { return ( m_layerIdInVps[ layerIdinNuh ] > 0 ); } |
---|
914 | |
---|
915 | Void setDimensionId( Int layerIdInVps, Int scalIdx, Int val ) { m_dimensionId[layerIdInVps][scalIdx] = val; } |
---|
916 | Int getDimensionId( Int layerIdInVps, Int scalIdx ) { return m_dimensionId[layerIdInVps][scalIdx]; } |
---|
917 | |
---|
918 | Void setViewIdLen( Int val ) { m_viewIdLen = val; } |
---|
919 | Int getViewIdLen( ) { return m_viewIdLen; } |
---|
920 | |
---|
921 | Void setViewIdVal( Int viewOrderIndex, Int val ) { m_viewIdVal[viewOrderIndex] = val; } |
---|
922 | Int getViewIdVal( Int viewOrderIndex ) { return m_viewIdVal[viewOrderIndex]; } |
---|
923 | |
---|
924 | Void setDirectDependencyFlag( Int depLayeridInVps, Int refLayeridInVps, Bool val ) { m_directDependencyFlag[depLayeridInVps][refLayeridInVps] = val; } |
---|
925 | Bool getDirectDependencyFlag( Int depLayeridInVps, Int refLayeridInVps ) { return m_directDependencyFlag[depLayeridInVps][refLayeridInVps]; } |
---|
926 | |
---|
927 | Void setVpsSubLayersMaxMinus1PresentFlag( Bool flag ) { m_vpsSubLayersMaxMinus1PresentFlag = flag; } |
---|
928 | Bool getVpsSubLayersMaxMinus1PresentFlag( ) { return m_vpsSubLayersMaxMinus1PresentFlag; } |
---|
929 | |
---|
930 | Void setSubLayersVpsMaxMinus1( Int i, Int val ) { m_subLayersVpsMaxMinus1[i] = val; } |
---|
931 | Int getSubLayersVpsMaxMinus1( Int i ) { return m_subLayersVpsMaxMinus1[i]; } |
---|
932 | Void checkSubLayersVpsMaxMinus1( Int i ) { assert( m_subLayersVpsMaxMinus1[i] >= 0 && m_subLayersVpsMaxMinus1[i] <= m_uiMaxTLayers - 1 ); } |
---|
933 | |
---|
934 | Void setMaxTidRefPresentFlag( Bool flag ) { m_maxTidRefPresentFlag = flag; } |
---|
935 | Bool getMaxTidRefPresentFlag( ) { return m_maxTidRefPresentFlag; } |
---|
936 | |
---|
937 | Void setMaxTidIlRefPicsPlus1( Int i, Int j, Int val ) { m_maxTidIlRefPicsPlus1[i][j] = val; } |
---|
938 | Int getMaxTidIlRefPicsPlus1( Int i, Int j ) { return m_maxTidIlRefPicsPlus1[i][j]; } |
---|
939 | |
---|
940 | Void setAllRefLayersActiveFlag( Bool flag ) { m_allRefLayersActiveFlag = flag; } |
---|
941 | Bool getAllRefLayersActiveFlag( ) { return m_allRefLayersActiveFlag; } |
---|
942 | |
---|
943 | Void setVpsNumProfileTierLevelMinus1( Int val ) { m_vpsNumProfileTierLevelMinus1 = val; } |
---|
944 | Int getVpsNumProfileTierLevelMinus1( ) { return m_vpsNumProfileTierLevelMinus1; } |
---|
945 | |
---|
946 | Void setVpsProfilePresentFlag( Int idx, Bool val ) { m_vpsProfilePresentFlag[idx] = val; } |
---|
947 | Bool getVpsProfilePresentFlag( Int idx ) { return m_vpsProfilePresentFlag[idx]; } |
---|
948 | |
---|
949 | Void setNumAddOutputLayerSets( Int val ) { m_numAddOutputLayerSets = val; } |
---|
950 | Int getNumAddOutputLayerSets( ) { return m_numAddOutputLayerSets; } |
---|
951 | |
---|
952 | Void setDefaultTargetOutputLayerIdc( Int val ) { m_defaultTargetOutputLayerIdc = val; } |
---|
953 | Int getDefaultTargetOutputLayerIdc( ) { return m_defaultTargetOutputLayerIdc; } |
---|
954 | |
---|
955 | Void setOutputLayerSetIdxMinus1( Int outLayerSetIdx, Int val ) { m_outputLayerSetIdxMinus1[ outLayerSetIdx ] = val; } |
---|
956 | Int getOutputLayerSetIdxMinus1( Int outLayerSetIdx ) { return m_outputLayerSetIdxMinus1[ outLayerSetIdx ]; } |
---|
957 | |
---|
958 | Void setOutputLayerFlag( Int outLayerSetIdx, Int i, Bool flag ) { m_outputLayerFlag[ outLayerSetIdx ][ i ] = flag; } |
---|
959 | Bool getOutputLayerFlag( Int outLayerSetIdx, Int i ) { return m_outputLayerFlag[ outLayerSetIdx ][ i ]; } |
---|
960 | |
---|
961 | Bool inferOutputLayerFlag( Int i, Int j ); |
---|
962 | |
---|
963 | Void setProfileLevelTierIdx( Int outLayerSetIdx, Int val ) { m_profileLevelTierIdx[ outLayerSetIdx ] = val; } |
---|
964 | Int getProfileLevelTierIdx( Int outLayerSetIdx ) { return m_profileLevelTierIdx[ outLayerSetIdx ]; } |
---|
965 | |
---|
966 | Void setAltOutputLayerFlag( Int i, Bool flag ) { m_altOutputLayerFlag[i] = flag; } |
---|
967 | Bool getAltOutputLayerFlag( Int i ) { return m_altOutputLayerFlag[i]; } |
---|
968 | |
---|
969 | Void setRepFormatIdxPresentFlag( Bool flag ) { m_repFormatIdxPresentFlag = flag; } |
---|
970 | Bool getRepFormatIdxPresentFlag( ) { return m_repFormatIdxPresentFlag; } |
---|
971 | |
---|
972 | Void setVpsNumRepFormatsMinus1( Int val ) { m_vpsNumRepFormatsMinus1 = val; } |
---|
973 | Int getVpsNumRepFormatsMinus1( ) { return m_vpsNumRepFormatsMinus1; } |
---|
974 | |
---|
975 | Void setVpsRepFormatIdx( Int i, Int val ) { m_vpsRepFormatIdx[i] = val; } |
---|
976 | Int getVpsRepFormatIdx( Int i ) { return m_vpsRepFormatIdx[i]; } |
---|
977 | |
---|
978 | Void setRepFormat( Int i, TComRepFormat* val ) { m_repFormat[i] = val; } |
---|
979 | TComRepFormat* getRepFormat( Int i ) { return m_repFormat[i]; } |
---|
980 | |
---|
981 | Void setMaxOneActiveRefLayerFlag( Bool flag) { m_maxOneActiveRefLayerFlag = flag; } |
---|
982 | Bool getMaxOneActiveRefLayerFlag( ) { return m_maxOneActiveRefLayerFlag; } |
---|
983 | |
---|
984 | #if H_MV_HLS7_GEN |
---|
985 | Void setVpsPocLsbAlignedFlag( Bool flag ) { m_vpsPocLsbAlignedFlag = flag; } |
---|
986 | Bool getVpsPocLsbAlignedFlag( ) { return m_vpsPocLsbAlignedFlag; } |
---|
987 | #endif |
---|
988 | |
---|
989 | Void setDpbSize( TComDpbSize* val ) { assert( m_dpbSize != 0 ); m_dpbSize = val; } |
---|
990 | TComDpbSize* getDpbSize( ) { return m_dpbSize;} |
---|
991 | |
---|
992 | Void setPocLsbNotPresentFlag( Int i, Bool flag ) { m_pocLsbNotPresentFlag[i] = flag; } |
---|
993 | Bool getPocLsbNotPresentFlag( Int i ) { return m_pocLsbNotPresentFlag[i]; } |
---|
994 | |
---|
995 | Void setDirectDepTypeLenMinus2( Int val) { m_directDepTypeLenMinus2 = val; } |
---|
996 | Int getDirectDepTypeLenMinus2( ) { return m_directDepTypeLenMinus2; } |
---|
997 | |
---|
998 | Void setDefaultDirectDependencyFlag( Bool flag ) { m_defaultDirectDependencyFlag = flag; } |
---|
999 | Bool getDefaultDirectDependencyFlag( ) { return m_defaultDirectDependencyFlag; } |
---|
1000 | |
---|
1001 | Void setDefaultDirectDependencyType( Int val ) { m_defaultDirectDependencyType = val; } |
---|
1002 | Int getDefaultDirectDependencyType( ) { return m_defaultDirectDependencyType; } |
---|
1003 | |
---|
1004 | Void setDirectDependencyType( Int depLayeridInVps, Int refLayeridInVps, Int val) { m_directDependencyType[ depLayeridInVps ][ refLayeridInVps ] = val; } |
---|
1005 | Int getDirectDependencyType( Int depLayeridInVps, Int refLayeridInVps) { return m_directDependencyType[ depLayeridInVps ][ refLayeridInVps ]; } |
---|
1006 | |
---|
1007 | Void setVpsVuiPresentFlag( Bool flag ) { m_vpsVuiPresentFlag = flag; } |
---|
1008 | Bool getVpsVuiPresentFlag( ) { return m_vpsVuiPresentFlag; } |
---|
1009 | |
---|
1010 | TComVPSVUI* getVPSVUI( ) { return m_vpsVUI; } |
---|
1011 | |
---|
1012 | // VPS EXTENSION SEMANTICS VARIABLES |
---|
1013 | Void setLayerIdInVps( Int layerIdInNuh, Int val ) { m_layerIdInVps[layerIdInNuh] = val; } |
---|
1014 | Int getLayerIdInVps( Int layerIdInNuh ) { assert( m_layerIdInVps[layerIdInNuh] >= 0 ); return m_layerIdInVps[layerIdInNuh]; } |
---|
1015 | |
---|
1016 | Int getScalabilityId ( Int layerIdInVps, ScalabilityType scalType ); |
---|
1017 | Int getViewId ( Int layerIdInNuh ) { return m_viewIdVal[ getViewIndex( layerIdInNuh )]; } |
---|
1018 | Void setRefLayers(); |
---|
1019 | |
---|
1020 | Int getViewIndex ( Int layerIdInNuh ) { return getScalabilityId( getLayerIdInVps(layerIdInNuh), VIEW_ORDER_INDEX ); } |
---|
1021 | Int getNumViews(); |
---|
1022 | |
---|
1023 | Int getNumDirectRefLayers( Int layerIdInNuh ) { return m_numDirectRefLayers[ layerIdInNuh ]; }; |
---|
1024 | Int getRefLayerId ( Int layerIdInNuh, Int idx );; |
---|
1025 | Bool checkVPSExtensionSyntax(); |
---|
1026 | Int scalTypeToScalIdx ( ScalabilityType scalType ); |
---|
1027 | |
---|
1028 | Int getProfileLevelTierIdxLen() { return gCeilLog2( getVpsNumProfileTierLevelMinus1() + 1 ); }; |
---|
1029 | Int getVpsRepFormatIdxLen() { return gCeilLog2( getVpsNumRepFormatsMinus1() + 1 ); }; |
---|
1030 | |
---|
1031 | Int getNumLayersInIdList ( Int lsIdx ); |
---|
1032 | |
---|
1033 | Int getNumOutputLayerSets() ; |
---|
1034 | Int getNumSubDpbs( Int i ) { return getNumLayersInIdList( i ); }; |
---|
1035 | Bool isOutputLayer( Int outLayerSetIdx, Int layerIdInNuh ); |
---|
1036 | Void deriveLayerSetLayerIdList(); |
---|
1037 | |
---|
1038 | Int getLayerSetIdxForOutputLayerSet( Int i ) { return ( i <= getVpsNumLayerSetsMinus1() ) ? i : getOutputLayerSetIdxMinus1( i ) + 1 ; }; |
---|
1039 | |
---|
1040 | Void initTargetLayerIdLists ( ); |
---|
1041 | Void deriveTargetLayerIdList ( Int i ); |
---|
1042 | |
---|
1043 | std::vector<Int> getTargetDecLayerIdList( Int targetDecLayerSetIdx ) { return m_targetDecLayerIdLists[targetDecLayerSetIdx]; }; |
---|
1044 | std::vector<Int> getTargetOptLayerIdList( Int targetOptLayerSetIdx ) { return m_targetOptLayerIdLists[targetOptLayerSetIdx]; }; |
---|
1045 | |
---|
1046 | Int getNumOutputLayersInOutputLayerSet( Int i ) { return (Int) getTargetOptLayerIdList( i ).size(); }; |
---|
1047 | Int getOlsHighestOutputLayerId( Int i ) { return getTargetOptLayerIdList( i ).back(); }; |
---|
1048 | |
---|
1049 | Int getMaxSubLayersInLayerSetMinus1( Int i ); |
---|
1050 | |
---|
1051 | // inference |
---|
1052 | Int inferDimensionId ( Int i, Int j ); |
---|
1053 | Int inferLastDimsionIdLenMinus1(); |
---|
1054 | |
---|
1055 | // helpers |
---|
1056 | Bool getInDirectDependencyFlag( Int depLayeridInVps, Int refLayeridInVps, Int depth = 0 ); |
---|
1057 | /// VPS EXTENSION 2 SYNTAX ELEMENTS |
---|
1058 | #if H_3D |
---|
1059 | Int getDepthId ( Int layerIdInNuh) { return getScalabilityId( getLayerIdInVps(layerIdInNuh), DEPTH_ID ); } |
---|
1060 | Int getLayerIdInNuh( Int viewIndex, Bool depthFlag ); |
---|
1061 | |
---|
1062 | #if H_3D_ARP |
---|
1063 | UInt getUseAdvRP ( Int layerIdInVps ) { return m_uiUseAdvResPred[layerIdInVps]; } |
---|
1064 | UInt getARPStepNum( Int layerIdInVps ) { return m_uiARPStepNum[layerIdInVps]; } |
---|
1065 | Void setUseAdvRP ( Int layerIdInVps, UInt val ) { m_uiUseAdvResPred[layerIdInVps] = val; } |
---|
1066 | Void setARPStepNum( Int layerIdInVps, UInt val ) { m_uiARPStepNum[layerIdInVps] = val; } |
---|
1067 | #endif |
---|
1068 | |
---|
1069 | Void createCamPars(Int iNumViews); |
---|
1070 | Void deleteCamPars(); |
---|
1071 | Void initCamParaVPS ( UInt uiViewIndex, Bool bCamParPresent = false, UInt uiCamParPrecision = 0, Bool bCamParSlice = false, Int** aaiScale = 0, Int** aaiOffset = 0 ); |
---|
1072 | UInt getCamParPrecision () { return m_uiCamParPrecision; } |
---|
1073 | Bool getCamParPresent ( Int viewIndex ) { return m_bCamParPresent[viewIndex]; } |
---|
1074 | Void setCamParPresent ( Int viewIndex, Bool val ) { m_bCamParPresent[viewIndex] = val; } |
---|
1075 | Bool hasCamParInSliceHeader( Int viewIndex ) { return m_bCamParInSliceHeader[viewIndex]; } |
---|
1076 | Void setHasCamParInSliceHeader( Int viewIndex, Bool b ) { m_bCamParInSliceHeader[viewIndex] = b; } |
---|
1077 | Int* getCodedScale ( Int viewIndex ) { return m_aaaiCodedScale [viewIndex][0]; } |
---|
1078 | Int* getCodedOffset ( Int viewIndex ) { return m_aaaiCodedOffset[viewIndex][0]; } |
---|
1079 | Int* getInvCodedScale ( Int viewIndex ) { return m_aaaiCodedScale [viewIndex][1]; } |
---|
1080 | Int* getInvCodedOffset ( Int viewIndex ) { return m_aaaiCodedOffset[viewIndex][1]; } |
---|
1081 | |
---|
1082 | #if H_3D_IV_MERGE |
---|
1083 | Void setIvMvPredFlag ( Int layerIdInVps, Bool val ) { m_ivMvPredFlag[ layerIdInVps ] = val; } |
---|
1084 | Bool getIvMvPredFlag ( Int layerIdInVps ) { return m_ivMvPredFlag[ layerIdInVps ]; }; |
---|
1085 | #if H_3D_SPIVMP |
---|
1086 | Int getSubPULog2Size(Int layerIdInVps) { return m_iSubPULog2Size[layerIdInVps]; } |
---|
1087 | Void setSubPULog2Size(Int layerIdInVps, Int u) { m_iSubPULog2Size[layerIdInVps] = u;} |
---|
1088 | Int getSubPUMPILog2Size( ) { return m_iSubPUMPILog2Size; } |
---|
1089 | Void setSubPUMPILog2Size( Int u ) { m_iSubPUMPILog2Size = u; } |
---|
1090 | #endif |
---|
1091 | #endif |
---|
1092 | #if H_3D_VSP |
---|
1093 | Void setViewSynthesisPredFlag ( Int layerIdInVps, Bool val ) { m_viewSynthesisPredFlag[ layerIdInVps ] = val; } |
---|
1094 | Bool getViewSynthesisPredFlag ( Int layerIdInVps ) { return m_viewSynthesisPredFlag[ layerIdInVps ]; }; |
---|
1095 | #endif |
---|
1096 | #if H_3D_NBDV_REF |
---|
1097 | Void setDepthRefinementFlag ( Int layerIdInVps, Bool val ) { m_depthRefinementFlag[ layerIdInVps ] = val; } |
---|
1098 | Bool getDepthRefinementFlag ( Int layerIdInVps ) { return m_depthRefinementFlag[ layerIdInVps ]; }; |
---|
1099 | #endif |
---|
1100 | Void setVpsDepthModesFlag( Int layerIdInVps, Bool val ) { m_vpsDepthModesFlag[ layerIdInVps ] = val; } |
---|
1101 | Bool getVpsDepthModesFlag( Int layerIdInVps ) { return m_vpsDepthModesFlag[ layerIdInVps ]; } |
---|
1102 | |
---|
1103 | Bool getIvMvScalingFlag ( ) { return m_ivMvScalingFlag; } |
---|
1104 | Void setIvMvScalingFlag ( Bool b ) { m_ivMvScalingFlag = b; } |
---|
1105 | #if H_3D_INTER_SDC |
---|
1106 | Bool getInterSDCFlag ( Int layerIdInVps ) { return m_bInterSDCFlag[layerIdInVps]; } |
---|
1107 | Void setInterSDCFlag ( Int layerIdInVps, Bool bval ){ m_bInterSDCFlag[layerIdInVps] = bval; } |
---|
1108 | #endif |
---|
1109 | #if H_3D_DBBP |
---|
1110 | Bool getUseDBBP ( Int layerIdInVps ) { return m_dbbpFlag[layerIdInVps]; } |
---|
1111 | Void setUseDBBP ( Int layerIdInVps, Bool bval ){ m_dbbpFlag[layerIdInVps] = bval; } |
---|
1112 | #endif |
---|
1113 | #if H_3D_IV_MERGE |
---|
1114 | Bool getMPIFlag ( Int layerIdInVps ) { return m_bMPIFlag[layerIdInVps]; } |
---|
1115 | Void setMPIFlag ( Int layerIdInVps, Bool bval ){ m_bMPIFlag[layerIdInVps] = bval; } |
---|
1116 | #endif |
---|
1117 | #endif |
---|
1118 | #endif |
---|
1119 | }; |
---|
1120 | |
---|
1121 | #if H_3D |
---|
1122 | class TComDLT |
---|
1123 | { |
---|
1124 | private: |
---|
1125 | Bool m_bDltPresentFlag; |
---|
1126 | Bool m_bUseDLTFlag [ MAX_NUM_LAYERS ]; |
---|
1127 | Bool m_bInterViewDltPredEnableFlag[ MAX_NUM_LAYERS ]; |
---|
1128 | |
---|
1129 | Int m_iBitsPerDepthValue [ MAX_NUM_LAYERS ]; |
---|
1130 | Int m_iNumDepthmapValues [ MAX_NUM_LAYERS ]; |
---|
1131 | Int* m_iDepthValue2Idx [ MAX_NUM_LAYERS ]; |
---|
1132 | Int* m_iIdx2DepthValue [ MAX_NUM_LAYERS ]; |
---|
1133 | |
---|
1134 | Int m_iNumDepthViews; |
---|
1135 | UInt m_uiDepthViewBitDepth; |
---|
1136 | |
---|
1137 | public: |
---|
1138 | TComDLT(); |
---|
1139 | ~TComDLT(); |
---|
1140 | |
---|
1141 | Bool getDltPresentFlag () { return m_bDltPresentFlag; } |
---|
1142 | Void setDltPresentFlag ( Bool b ) { m_bDltPresentFlag = b; } |
---|
1143 | |
---|
1144 | Bool getUseDLTFlag ( Int layerIdInVps ) { return m_bUseDLTFlag[ layerIdInVps ]; } |
---|
1145 | Void setUseDLTFlag ( Int layerIdInVps, Bool b ) { m_bUseDLTFlag[ layerIdInVps ] = b; } |
---|
1146 | |
---|
1147 | Bool getInterViewDltPredEnableFlag( Int layerIdInVps ) { return m_bInterViewDltPredEnableFlag[ layerIdInVps ]; } |
---|
1148 | Void setInterViewDltPredEnableFlag( Int layerIdInVps, Bool b ) { m_bInterViewDltPredEnableFlag[ layerIdInVps ] = b; } |
---|
1149 | |
---|
1150 | Void setNumDepthViews ( Int n ) { m_iNumDepthViews = n; } |
---|
1151 | Int getNumDepthViews () { return m_iNumDepthViews; } |
---|
1152 | |
---|
1153 | Void setDepthViewBitDepth( UInt n ) { m_uiDepthViewBitDepth = n; } |
---|
1154 | UInt getDepthViewBitDepth() { return m_uiDepthViewBitDepth; } |
---|
1155 | |
---|
1156 | Int getBitsPerDepthValue( Int layerIdInVps ) { return getUseDLTFlag(layerIdInVps)?m_iBitsPerDepthValue[layerIdInVps]:g_bitDepthY; } |
---|
1157 | Int getNumDepthValues( Int layerIdInVps ) { return getUseDLTFlag(layerIdInVps)?m_iNumDepthmapValues[layerIdInVps]:((1 << g_bitDepthY)-1); } |
---|
1158 | Int depthValue2idx( Int layerIdInVps, Pel value ) { return getUseDLTFlag(layerIdInVps)?m_iDepthValue2Idx[layerIdInVps][value]:value; } |
---|
1159 | Pel idx2DepthValue( Int layerIdInVps, UInt uiIdx ) { return getUseDLTFlag(layerIdInVps)?m_iIdx2DepthValue[layerIdInVps][uiIdx]:uiIdx; } |
---|
1160 | Void setDepthLUTs( Int layerIdInVps, Int* idx2DepthValue = NULL, Int iNumDepthValues = 0 ); |
---|
1161 | #if H_3D_DELTA_DLT |
---|
1162 | Int* idx2DepthValue( Int layerIdInVps ) { return m_iIdx2DepthValue[layerIdInVps]; } |
---|
1163 | Void getDeltaDLT( Int layerIdInVps, Int* piDLTInRef, UInt uiDLTInRefNum, Int* piDeltaDLTOut, UInt *puiDeltaDLTOutNum ); |
---|
1164 | Void setDeltaDLT( Int layerIdInVps, Int* piDLTInRef, UInt uiDLTInRefNum, Int* piDeltaDLTIn, UInt uiDeltaDLTInNum ); |
---|
1165 | #endif |
---|
1166 | }; |
---|
1167 | #endif |
---|
1168 | |
---|
1169 | class Window |
---|
1170 | { |
---|
1171 | private: |
---|
1172 | Bool m_enabledFlag; |
---|
1173 | Int m_winLeftOffset; |
---|
1174 | Int m_winRightOffset; |
---|
1175 | Int m_winTopOffset; |
---|
1176 | Int m_winBottomOffset; |
---|
1177 | #if H_MV |
---|
1178 | Bool m_scaledFlag; |
---|
1179 | #endif |
---|
1180 | public: |
---|
1181 | Window() |
---|
1182 | : m_enabledFlag (false) |
---|
1183 | , m_winLeftOffset (0) |
---|
1184 | , m_winRightOffset (0) |
---|
1185 | , m_winTopOffset (0) |
---|
1186 | , m_winBottomOffset (0) |
---|
1187 | #if H_MV |
---|
1188 | , m_scaledFlag(true) |
---|
1189 | #endif |
---|
1190 | { } |
---|
1191 | |
---|
1192 | Bool getWindowEnabledFlag() const { return m_enabledFlag; } |
---|
1193 | Void resetWindow() { m_enabledFlag = false; m_winLeftOffset = m_winRightOffset = m_winTopOffset = m_winBottomOffset = 0; } |
---|
1194 | Int getWindowLeftOffset() const { return m_enabledFlag ? m_winLeftOffset : 0; } |
---|
1195 | Void setWindowLeftOffset(Int val) { m_winLeftOffset = val; m_enabledFlag = true; } |
---|
1196 | Int getWindowRightOffset() const { return m_enabledFlag ? m_winRightOffset : 0; } |
---|
1197 | Void setWindowRightOffset(Int val) { m_winRightOffset = val; m_enabledFlag = true; } |
---|
1198 | Int getWindowTopOffset() const { return m_enabledFlag ? m_winTopOffset : 0; } |
---|
1199 | Void setWindowTopOffset(Int val) { m_winTopOffset = val; m_enabledFlag = true; } |
---|
1200 | Int getWindowBottomOffset() const { return m_enabledFlag ? m_winBottomOffset: 0; } |
---|
1201 | Void setWindowBottomOffset(Int val) { m_winBottomOffset = val; m_enabledFlag = true; } |
---|
1202 | |
---|
1203 | #if H_MV |
---|
1204 | Void setScaledFlag(Bool flag) { m_scaledFlag = flag; } |
---|
1205 | Bool getScaledFlag() const { return m_scaledFlag; } |
---|
1206 | Void scaleOffsets( Int scal ) |
---|
1207 | { |
---|
1208 | if (! m_scaledFlag ) |
---|
1209 | { |
---|
1210 | m_scaledFlag = true; |
---|
1211 | m_winLeftOffset *= scal; |
---|
1212 | m_winRightOffset *= scal; |
---|
1213 | m_winTopOffset *= scal; |
---|
1214 | m_winBottomOffset *= scal; |
---|
1215 | } |
---|
1216 | } |
---|
1217 | #endif |
---|
1218 | Void setWindow(Int offsetLeft, Int offsetLRight, Int offsetLTop, Int offsetLBottom) |
---|
1219 | { |
---|
1220 | m_enabledFlag = true; |
---|
1221 | m_winLeftOffset = offsetLeft; |
---|
1222 | m_winRightOffset = offsetLRight; |
---|
1223 | m_winTopOffset = offsetLTop; |
---|
1224 | m_winBottomOffset = offsetLBottom; |
---|
1225 | } |
---|
1226 | }; |
---|
1227 | |
---|
1228 | |
---|
1229 | class TComVUI |
---|
1230 | { |
---|
1231 | private: |
---|
1232 | Bool m_aspectRatioInfoPresentFlag; |
---|
1233 | Int m_aspectRatioIdc; |
---|
1234 | Int m_sarWidth; |
---|
1235 | Int m_sarHeight; |
---|
1236 | Bool m_overscanInfoPresentFlag; |
---|
1237 | Bool m_overscanAppropriateFlag; |
---|
1238 | Bool m_videoSignalTypePresentFlag; |
---|
1239 | Int m_videoFormat; |
---|
1240 | Bool m_videoFullRangeFlag; |
---|
1241 | Bool m_colourDescriptionPresentFlag; |
---|
1242 | Int m_colourPrimaries; |
---|
1243 | Int m_transferCharacteristics; |
---|
1244 | Int m_matrixCoefficients; |
---|
1245 | Bool m_chromaLocInfoPresentFlag; |
---|
1246 | Int m_chromaSampleLocTypeTopField; |
---|
1247 | Int m_chromaSampleLocTypeBottomField; |
---|
1248 | Bool m_neutralChromaIndicationFlag; |
---|
1249 | Bool m_fieldSeqFlag; |
---|
1250 | |
---|
1251 | Window m_defaultDisplayWindow; |
---|
1252 | Bool m_frameFieldInfoPresentFlag; |
---|
1253 | Bool m_hrdParametersPresentFlag; |
---|
1254 | Bool m_bitstreamRestrictionFlag; |
---|
1255 | Bool m_tilesFixedStructureFlag; |
---|
1256 | Bool m_motionVectorsOverPicBoundariesFlag; |
---|
1257 | Bool m_restrictedRefPicListsFlag; |
---|
1258 | Int m_minSpatialSegmentationIdc; |
---|
1259 | Int m_maxBytesPerPicDenom; |
---|
1260 | Int m_maxBitsPerMinCuDenom; |
---|
1261 | Int m_log2MaxMvLengthHorizontal; |
---|
1262 | Int m_log2MaxMvLengthVertical; |
---|
1263 | TComHRD m_hrdParameters; |
---|
1264 | TimingInfo m_timingInfo; |
---|
1265 | |
---|
1266 | public: |
---|
1267 | TComVUI() |
---|
1268 | :m_aspectRatioInfoPresentFlag(false) |
---|
1269 | ,m_aspectRatioIdc(0) |
---|
1270 | ,m_sarWidth(0) |
---|
1271 | ,m_sarHeight(0) |
---|
1272 | ,m_overscanInfoPresentFlag(false) |
---|
1273 | ,m_overscanAppropriateFlag(false) |
---|
1274 | ,m_videoSignalTypePresentFlag(false) |
---|
1275 | ,m_videoFormat(5) |
---|
1276 | ,m_videoFullRangeFlag(false) |
---|
1277 | ,m_colourDescriptionPresentFlag(false) |
---|
1278 | ,m_colourPrimaries(2) |
---|
1279 | ,m_transferCharacteristics(2) |
---|
1280 | ,m_matrixCoefficients(2) |
---|
1281 | ,m_chromaLocInfoPresentFlag(false) |
---|
1282 | ,m_chromaSampleLocTypeTopField(0) |
---|
1283 | ,m_chromaSampleLocTypeBottomField(0) |
---|
1284 | ,m_neutralChromaIndicationFlag(false) |
---|
1285 | ,m_fieldSeqFlag(false) |
---|
1286 | ,m_frameFieldInfoPresentFlag(false) |
---|
1287 | ,m_hrdParametersPresentFlag(false) |
---|
1288 | ,m_bitstreamRestrictionFlag(false) |
---|
1289 | ,m_tilesFixedStructureFlag(false) |
---|
1290 | ,m_motionVectorsOverPicBoundariesFlag(true) |
---|
1291 | ,m_restrictedRefPicListsFlag(1) |
---|
1292 | ,m_minSpatialSegmentationIdc(0) |
---|
1293 | ,m_maxBytesPerPicDenom(2) |
---|
1294 | ,m_maxBitsPerMinCuDenom(1) |
---|
1295 | ,m_log2MaxMvLengthHorizontal(15) |
---|
1296 | ,m_log2MaxMvLengthVertical(15) |
---|
1297 | {} |
---|
1298 | |
---|
1299 | virtual ~TComVUI() {} |
---|
1300 | |
---|
1301 | Bool getAspectRatioInfoPresentFlag() { return m_aspectRatioInfoPresentFlag; } |
---|
1302 | Void setAspectRatioInfoPresentFlag(Bool i) { m_aspectRatioInfoPresentFlag = i; } |
---|
1303 | |
---|
1304 | Int getAspectRatioIdc() { return m_aspectRatioIdc; } |
---|
1305 | Void setAspectRatioIdc(Int i) { m_aspectRatioIdc = i; } |
---|
1306 | |
---|
1307 | Int getSarWidth() { return m_sarWidth; } |
---|
1308 | Void setSarWidth(Int i) { m_sarWidth = i; } |
---|
1309 | |
---|
1310 | Int getSarHeight() { return m_sarHeight; } |
---|
1311 | Void setSarHeight(Int i) { m_sarHeight = i; } |
---|
1312 | |
---|
1313 | Bool getOverscanInfoPresentFlag() { return m_overscanInfoPresentFlag; } |
---|
1314 | Void setOverscanInfoPresentFlag(Bool i) { m_overscanInfoPresentFlag = i; } |
---|
1315 | |
---|
1316 | Bool getOverscanAppropriateFlag() { return m_overscanAppropriateFlag; } |
---|
1317 | Void setOverscanAppropriateFlag(Bool i) { m_overscanAppropriateFlag = i; } |
---|
1318 | |
---|
1319 | Bool getVideoSignalTypePresentFlag() { return m_videoSignalTypePresentFlag; } |
---|
1320 | Void setVideoSignalTypePresentFlag(Bool i) { m_videoSignalTypePresentFlag = i; } |
---|
1321 | |
---|
1322 | Int getVideoFormat() { return m_videoFormat; } |
---|
1323 | Void setVideoFormat(Int i) { m_videoFormat = i; } |
---|
1324 | |
---|
1325 | Bool getVideoFullRangeFlag() { return m_videoFullRangeFlag; } |
---|
1326 | Void setVideoFullRangeFlag(Bool i) { m_videoFullRangeFlag = i; } |
---|
1327 | |
---|
1328 | Bool getColourDescriptionPresentFlag() { return m_colourDescriptionPresentFlag; } |
---|
1329 | Void setColourDescriptionPresentFlag(Bool i) { m_colourDescriptionPresentFlag = i; } |
---|
1330 | |
---|
1331 | Int getColourPrimaries() { return m_colourPrimaries; } |
---|
1332 | Void setColourPrimaries(Int i) { m_colourPrimaries = i; } |
---|
1333 | |
---|
1334 | Int getTransferCharacteristics() { return m_transferCharacteristics; } |
---|
1335 | Void setTransferCharacteristics(Int i) { m_transferCharacteristics = i; } |
---|
1336 | |
---|
1337 | Int getMatrixCoefficients() { return m_matrixCoefficients; } |
---|
1338 | Void setMatrixCoefficients(Int i) { m_matrixCoefficients = i; } |
---|
1339 | |
---|
1340 | Bool getChromaLocInfoPresentFlag() { return m_chromaLocInfoPresentFlag; } |
---|
1341 | Void setChromaLocInfoPresentFlag(Bool i) { m_chromaLocInfoPresentFlag = i; } |
---|
1342 | |
---|
1343 | Int getChromaSampleLocTypeTopField() { return m_chromaSampleLocTypeTopField; } |
---|
1344 | Void setChromaSampleLocTypeTopField(Int i) { m_chromaSampleLocTypeTopField = i; } |
---|
1345 | |
---|
1346 | Int getChromaSampleLocTypeBottomField() { return m_chromaSampleLocTypeBottomField; } |
---|
1347 | Void setChromaSampleLocTypeBottomField(Int i) { m_chromaSampleLocTypeBottomField = i; } |
---|
1348 | |
---|
1349 | Bool getNeutralChromaIndicationFlag() { return m_neutralChromaIndicationFlag; } |
---|
1350 | Void setNeutralChromaIndicationFlag(Bool i) { m_neutralChromaIndicationFlag = i; } |
---|
1351 | |
---|
1352 | Bool getFieldSeqFlag() { return m_fieldSeqFlag; } |
---|
1353 | Void setFieldSeqFlag(Bool i) { m_fieldSeqFlag = i; } |
---|
1354 | |
---|
1355 | Bool getFrameFieldInfoPresentFlag() { return m_frameFieldInfoPresentFlag; } |
---|
1356 | Void setFrameFieldInfoPresentFlag(Bool i) { m_frameFieldInfoPresentFlag = i; } |
---|
1357 | |
---|
1358 | Window& getDefaultDisplayWindow() { return m_defaultDisplayWindow; } |
---|
1359 | Void setDefaultDisplayWindow(Window& defaultDisplayWindow ) { m_defaultDisplayWindow = defaultDisplayWindow; } |
---|
1360 | |
---|
1361 | Bool getHrdParametersPresentFlag() { return m_hrdParametersPresentFlag; } |
---|
1362 | Void setHrdParametersPresentFlag(Bool i) { m_hrdParametersPresentFlag = i; } |
---|
1363 | |
---|
1364 | Bool getBitstreamRestrictionFlag() { return m_bitstreamRestrictionFlag; } |
---|
1365 | Void setBitstreamRestrictionFlag(Bool i) { m_bitstreamRestrictionFlag = i; } |
---|
1366 | |
---|
1367 | Bool getTilesFixedStructureFlag() { return m_tilesFixedStructureFlag; } |
---|
1368 | Void setTilesFixedStructureFlag(Bool i) { m_tilesFixedStructureFlag = i; } |
---|
1369 | |
---|
1370 | Bool getMotionVectorsOverPicBoundariesFlag() { return m_motionVectorsOverPicBoundariesFlag; } |
---|
1371 | Void setMotionVectorsOverPicBoundariesFlag(Bool i) { m_motionVectorsOverPicBoundariesFlag = i; } |
---|
1372 | |
---|
1373 | Bool getRestrictedRefPicListsFlag() { return m_restrictedRefPicListsFlag; } |
---|
1374 | Void setRestrictedRefPicListsFlag(Bool b) { m_restrictedRefPicListsFlag = b; } |
---|
1375 | |
---|
1376 | Int getMinSpatialSegmentationIdc() { return m_minSpatialSegmentationIdc; } |
---|
1377 | Void setMinSpatialSegmentationIdc(Int i) { m_minSpatialSegmentationIdc = i; } |
---|
1378 | Int getMaxBytesPerPicDenom() { return m_maxBytesPerPicDenom; } |
---|
1379 | Void setMaxBytesPerPicDenom(Int i) { m_maxBytesPerPicDenom = i; } |
---|
1380 | |
---|
1381 | Int getMaxBitsPerMinCuDenom() { return m_maxBitsPerMinCuDenom; } |
---|
1382 | Void setMaxBitsPerMinCuDenom(Int i) { m_maxBitsPerMinCuDenom = i; } |
---|
1383 | |
---|
1384 | Int getLog2MaxMvLengthHorizontal() { return m_log2MaxMvLengthHorizontal; } |
---|
1385 | Void setLog2MaxMvLengthHorizontal(Int i) { m_log2MaxMvLengthHorizontal = i; } |
---|
1386 | |
---|
1387 | Int getLog2MaxMvLengthVertical() { return m_log2MaxMvLengthVertical; } |
---|
1388 | Void setLog2MaxMvLengthVertical(Int i) { m_log2MaxMvLengthVertical = i; } |
---|
1389 | |
---|
1390 | TComHRD* getHrdParameters () { return &m_hrdParameters; } |
---|
1391 | TimingInfo* getTimingInfo() { return &m_timingInfo; } |
---|
1392 | #if H_MV |
---|
1393 | Void inferVideoSignalInfo( TComVPS* vps, Int layerIdCurr ); |
---|
1394 | #endif |
---|
1395 | }; |
---|
1396 | |
---|
1397 | /// SPS class |
---|
1398 | class TComSPS |
---|
1399 | { |
---|
1400 | private: |
---|
1401 | Int m_SPSId; |
---|
1402 | Int m_VPSId; |
---|
1403 | Int m_chromaFormatIdc; |
---|
1404 | |
---|
1405 | UInt m_uiMaxTLayers; // maximum number of temporal layers |
---|
1406 | |
---|
1407 | // Structure |
---|
1408 | UInt m_picWidthInLumaSamples; |
---|
1409 | UInt m_picHeightInLumaSamples; |
---|
1410 | |
---|
1411 | Int m_log2MinCodingBlockSize; |
---|
1412 | Int m_log2DiffMaxMinCodingBlockSize; |
---|
1413 | UInt m_uiMaxCUWidth; |
---|
1414 | UInt m_uiMaxCUHeight; |
---|
1415 | UInt m_uiMaxCUDepth; |
---|
1416 | |
---|
1417 | Window m_conformanceWindow; |
---|
1418 | |
---|
1419 | TComRPSList m_RPSList; |
---|
1420 | Bool m_bLongTermRefsPresent; |
---|
1421 | Bool m_TMVPFlagsPresent; |
---|
1422 | Int m_numReorderPics[MAX_TLAYER]; |
---|
1423 | |
---|
1424 | // Tool list |
---|
1425 | UInt m_uiQuadtreeTULog2MaxSize; |
---|
1426 | UInt m_uiQuadtreeTULog2MinSize; |
---|
1427 | UInt m_uiQuadtreeTUMaxDepthInter; |
---|
1428 | UInt m_uiQuadtreeTUMaxDepthIntra; |
---|
1429 | Bool m_usePCM; |
---|
1430 | UInt m_pcmLog2MaxSize; |
---|
1431 | UInt m_uiPCMLog2MinSize; |
---|
1432 | Bool m_useAMP; |
---|
1433 | |
---|
1434 | #if H_3D_QTLPC |
---|
1435 | Bool m_bUseQTL; |
---|
1436 | Bool m_bUsePC; |
---|
1437 | #endif |
---|
1438 | // Parameter |
---|
1439 | Int m_bitDepthY; |
---|
1440 | Int m_bitDepthC; |
---|
1441 | Int m_qpBDOffsetY; |
---|
1442 | Int m_qpBDOffsetC; |
---|
1443 | |
---|
1444 | UInt m_uiPCMBitDepthLuma; |
---|
1445 | UInt m_uiPCMBitDepthChroma; |
---|
1446 | Bool m_bPCMFilterDisableFlag; |
---|
1447 | |
---|
1448 | UInt m_uiBitsForPOC; |
---|
1449 | UInt m_numLongTermRefPicSPS; |
---|
1450 | UInt m_ltRefPicPocLsbSps[33]; |
---|
1451 | Bool m_usedByCurrPicLtSPSFlag[33]; |
---|
1452 | // Max physical transform size |
---|
1453 | UInt m_uiMaxTrSize; |
---|
1454 | |
---|
1455 | Int m_iAMPAcc[MAX_CU_DEPTH]; |
---|
1456 | Bool m_bUseSAO; |
---|
1457 | |
---|
1458 | Bool m_bTemporalIdNestingFlag; // temporal_id_nesting_flag |
---|
1459 | |
---|
1460 | Bool m_scalingListEnabledFlag; |
---|
1461 | Bool m_scalingListPresentFlag; |
---|
1462 | TComScalingList* m_scalingList; //!< ScalingList class pointer |
---|
1463 | UInt m_uiMaxDecPicBuffering[MAX_TLAYER]; |
---|
1464 | UInt m_uiMaxLatencyIncrease[MAX_TLAYER]; // Really max latency increase plus 1 (value 0 expresses no limit) |
---|
1465 | |
---|
1466 | Bool m_useDF; |
---|
1467 | Bool m_useStrongIntraSmoothing; |
---|
1468 | |
---|
1469 | Bool m_vuiParametersPresentFlag; |
---|
1470 | TComVUI m_vuiParameters; |
---|
1471 | |
---|
1472 | static const Int m_winUnitX[MAX_CHROMA_FORMAT_IDC+1]; |
---|
1473 | static const Int m_winUnitY[MAX_CHROMA_FORMAT_IDC+1]; |
---|
1474 | TComPTL m_pcPTL; |
---|
1475 | #if H_MV |
---|
1476 | TComVPS* m_pcVPS; |
---|
1477 | // SPS |
---|
1478 | Bool m_spsExtensionFlag; |
---|
1479 | Bool m_spsExtensionTypeFlag[PS_EX_T_MAX_NUM]; |
---|
1480 | Bool m_spsInferScalingListFlag; |
---|
1481 | Int m_spsScalingListRefLayerId; |
---|
1482 | Bool m_updateRepFormatFlag; |
---|
1483 | Int m_spsRepFormatIdx; |
---|
1484 | // SPS Extension |
---|
1485 | Bool m_interViewMvVertConstraintFlag; |
---|
1486 | Int m_numScaledRefLayerOffsets; |
---|
1487 | Int m_scaledRefLayerId [MAX_NUM_SCALED_REF_LAYERS]; |
---|
1488 | Int m_scaledRefLayerLeftOffset [MAX_NUM_LAYERS]; |
---|
1489 | Int m_scaledRefLayerTopOffset [MAX_NUM_LAYERS]; |
---|
1490 | Int m_scaledRefLayerRightOffset [MAX_NUM_LAYERS]; |
---|
1491 | Int m_scaledRefLayerBottomOffset[MAX_NUM_LAYERS]; |
---|
1492 | #endif |
---|
1493 | #if H_3D |
---|
1494 | UInt m_uiCamParPrecision; |
---|
1495 | Bool m_bCamParInSliceHeader; |
---|
1496 | Int m_aaiCodedScale [2][MAX_NUM_LAYERS]; |
---|
1497 | Int m_aaiCodedOffset[2][MAX_NUM_LAYERS]; |
---|
1498 | #endif |
---|
1499 | #if H_MV |
---|
1500 | Int m_layerId; |
---|
1501 | #endif |
---|
1502 | public: |
---|
1503 | TComSPS(); |
---|
1504 | virtual ~TComSPS(); |
---|
1505 | |
---|
1506 | Int getVPSId () { return m_VPSId; } |
---|
1507 | Void setVPSId (Int i) { m_VPSId = i; } |
---|
1508 | Int getSPSId () { return m_SPSId; } |
---|
1509 | Void setSPSId (Int i) { m_SPSId = i; } |
---|
1510 | Int getChromaFormatIdc () { return m_chromaFormatIdc; } |
---|
1511 | Void setChromaFormatIdc (Int i) { m_chromaFormatIdc = i; } |
---|
1512 | |
---|
1513 | static Int getWinUnitX (Int chromaFormatIdc) { assert (chromaFormatIdc > 0 && chromaFormatIdc <= MAX_CHROMA_FORMAT_IDC); return m_winUnitX[chromaFormatIdc]; } |
---|
1514 | static Int getWinUnitY (Int chromaFormatIdc) { assert (chromaFormatIdc > 0 && chromaFormatIdc <= MAX_CHROMA_FORMAT_IDC); return m_winUnitY[chromaFormatIdc]; } |
---|
1515 | |
---|
1516 | // structure |
---|
1517 | Void setPicWidthInLumaSamples ( UInt u ) { m_picWidthInLumaSamples = u; } |
---|
1518 | UInt getPicWidthInLumaSamples () { return m_picWidthInLumaSamples; } |
---|
1519 | Void setPicHeightInLumaSamples ( UInt u ) { m_picHeightInLumaSamples = u; } |
---|
1520 | UInt getPicHeightInLumaSamples () { return m_picHeightInLumaSamples; } |
---|
1521 | |
---|
1522 | Window& getConformanceWindow() { return m_conformanceWindow; } |
---|
1523 | Void setConformanceWindow(Window& conformanceWindow ) { m_conformanceWindow = conformanceWindow; } |
---|
1524 | |
---|
1525 | UInt getNumLongTermRefPicSPS() { return m_numLongTermRefPicSPS; } |
---|
1526 | Void setNumLongTermRefPicSPS(UInt val) { m_numLongTermRefPicSPS = val; } |
---|
1527 | |
---|
1528 | UInt getLtRefPicPocLsbSps(UInt index) { return m_ltRefPicPocLsbSps[index]; } |
---|
1529 | Void setLtRefPicPocLsbSps(UInt index, UInt val) { m_ltRefPicPocLsbSps[index] = val; } |
---|
1530 | |
---|
1531 | Bool getUsedByCurrPicLtSPSFlag(Int i) {return m_usedByCurrPicLtSPSFlag[i];} |
---|
1532 | Void setUsedByCurrPicLtSPSFlag(Int i, Bool x) { m_usedByCurrPicLtSPSFlag[i] = x;} |
---|
1533 | |
---|
1534 | Int getLog2MinCodingBlockSize() const { return m_log2MinCodingBlockSize; } |
---|
1535 | Void setLog2MinCodingBlockSize(Int val) { m_log2MinCodingBlockSize = val; } |
---|
1536 | Int getLog2DiffMaxMinCodingBlockSize() const { return m_log2DiffMaxMinCodingBlockSize; } |
---|
1537 | Void setLog2DiffMaxMinCodingBlockSize(Int val) { m_log2DiffMaxMinCodingBlockSize = val; } |
---|
1538 | |
---|
1539 | Void setMaxCUWidth ( UInt u ) { m_uiMaxCUWidth = u; } |
---|
1540 | UInt getMaxCUWidth () { return m_uiMaxCUWidth; } |
---|
1541 | Void setMaxCUHeight ( UInt u ) { m_uiMaxCUHeight = u; } |
---|
1542 | UInt getMaxCUHeight () { return m_uiMaxCUHeight; } |
---|
1543 | Void setMaxCUDepth ( UInt u ) { m_uiMaxCUDepth = u; } |
---|
1544 | UInt getMaxCUDepth () { return m_uiMaxCUDepth; } |
---|
1545 | Void setUsePCM ( Bool b ) { m_usePCM = b; } |
---|
1546 | Bool getUsePCM () { return m_usePCM; } |
---|
1547 | Void setPCMLog2MaxSize ( UInt u ) { m_pcmLog2MaxSize = u; } |
---|
1548 | UInt getPCMLog2MaxSize () { return m_pcmLog2MaxSize; } |
---|
1549 | Void setPCMLog2MinSize ( UInt u ) { m_uiPCMLog2MinSize = u; } |
---|
1550 | UInt getPCMLog2MinSize () { return m_uiPCMLog2MinSize; } |
---|
1551 | Void setBitsForPOC ( UInt u ) { m_uiBitsForPOC = u; } |
---|
1552 | UInt getBitsForPOC () { return m_uiBitsForPOC; } |
---|
1553 | Bool getUseAMP() { return m_useAMP; } |
---|
1554 | Void setUseAMP( Bool b ) { m_useAMP = b; } |
---|
1555 | Void setQuadtreeTULog2MaxSize( UInt u ) { m_uiQuadtreeTULog2MaxSize = u; } |
---|
1556 | UInt getQuadtreeTULog2MaxSize() { return m_uiQuadtreeTULog2MaxSize; } |
---|
1557 | Void setQuadtreeTULog2MinSize( UInt u ) { m_uiQuadtreeTULog2MinSize = u; } |
---|
1558 | UInt getQuadtreeTULog2MinSize() { return m_uiQuadtreeTULog2MinSize; } |
---|
1559 | Void setQuadtreeTUMaxDepthInter( UInt u ) { m_uiQuadtreeTUMaxDepthInter = u; } |
---|
1560 | Void setQuadtreeTUMaxDepthIntra( UInt u ) { m_uiQuadtreeTUMaxDepthIntra = u; } |
---|
1561 | UInt getQuadtreeTUMaxDepthInter() { return m_uiQuadtreeTUMaxDepthInter; } |
---|
1562 | UInt getQuadtreeTUMaxDepthIntra() { return m_uiQuadtreeTUMaxDepthIntra; } |
---|
1563 | Void setNumReorderPics(Int i, UInt tlayer) { m_numReorderPics[tlayer] = i; } |
---|
1564 | Int getNumReorderPics(UInt tlayer) { return m_numReorderPics[tlayer]; } |
---|
1565 | Void createRPSList( Int numRPS ); |
---|
1566 | TComRPSList* getRPSList() { return &m_RPSList; } |
---|
1567 | Bool getLongTermRefsPresent() { return m_bLongTermRefsPresent; } |
---|
1568 | Void setLongTermRefsPresent(Bool b) { m_bLongTermRefsPresent=b; } |
---|
1569 | Bool getTMVPFlagsPresent() { return m_TMVPFlagsPresent; } |
---|
1570 | Void setTMVPFlagsPresent(Bool b) { m_TMVPFlagsPresent=b; } |
---|
1571 | // physical transform |
---|
1572 | Void setMaxTrSize ( UInt u ) { m_uiMaxTrSize = u; } |
---|
1573 | UInt getMaxTrSize () { return m_uiMaxTrSize; } |
---|
1574 | |
---|
1575 | // AMP accuracy |
---|
1576 | Int getAMPAcc ( UInt uiDepth ) { return m_iAMPAcc[uiDepth]; } |
---|
1577 | Void setAMPAcc ( UInt uiDepth, Int iAccu ) { assert( uiDepth < g_uiMaxCUDepth); m_iAMPAcc[uiDepth] = iAccu; } |
---|
1578 | |
---|
1579 | // Bit-depth |
---|
1580 | Int getBitDepthY() { return m_bitDepthY; } |
---|
1581 | Void setBitDepthY(Int u) { m_bitDepthY = u; } |
---|
1582 | Int getBitDepthC() { return m_bitDepthC; } |
---|
1583 | Void setBitDepthC(Int u) { m_bitDepthC = u; } |
---|
1584 | Int getQpBDOffsetY () { return m_qpBDOffsetY; } |
---|
1585 | Void setQpBDOffsetY ( Int value ) { m_qpBDOffsetY = value; } |
---|
1586 | Int getQpBDOffsetC () { return m_qpBDOffsetC; } |
---|
1587 | Void setQpBDOffsetC ( Int value ) { m_qpBDOffsetC = value; } |
---|
1588 | Void setUseSAO (Bool bVal) {m_bUseSAO = bVal;} |
---|
1589 | Bool getUseSAO () {return m_bUseSAO;} |
---|
1590 | |
---|
1591 | UInt getMaxTLayers() { return m_uiMaxTLayers; } |
---|
1592 | Void setMaxTLayers( UInt uiMaxTLayers ) { assert( uiMaxTLayers <= MAX_TLAYER ); m_uiMaxTLayers = uiMaxTLayers; } |
---|
1593 | |
---|
1594 | Bool getTemporalIdNestingFlag() { return m_bTemporalIdNestingFlag; } |
---|
1595 | Void setTemporalIdNestingFlag( Bool bValue ) { m_bTemporalIdNestingFlag = bValue; } |
---|
1596 | UInt getPCMBitDepthLuma () { return m_uiPCMBitDepthLuma; } |
---|
1597 | Void setPCMBitDepthLuma ( UInt u ) { m_uiPCMBitDepthLuma = u; } |
---|
1598 | UInt getPCMBitDepthChroma () { return m_uiPCMBitDepthChroma; } |
---|
1599 | Void setPCMBitDepthChroma ( UInt u ) { m_uiPCMBitDepthChroma = u; } |
---|
1600 | Void setPCMFilterDisableFlag ( Bool bValue ) { m_bPCMFilterDisableFlag = bValue; } |
---|
1601 | Bool getPCMFilterDisableFlag () { return m_bPCMFilterDisableFlag; } |
---|
1602 | |
---|
1603 | Bool getScalingListFlag () { return m_scalingListEnabledFlag; } |
---|
1604 | Void setScalingListFlag ( Bool b ) { m_scalingListEnabledFlag = b; } |
---|
1605 | Bool getScalingListPresentFlag() { return m_scalingListPresentFlag; } |
---|
1606 | Void setScalingListPresentFlag( Bool b ) { m_scalingListPresentFlag = b; } |
---|
1607 | Void setScalingList ( TComScalingList *scalingList); |
---|
1608 | TComScalingList* getScalingList () { return m_scalingList; } //!< get ScalingList class pointer in SPS |
---|
1609 | UInt getMaxDecPicBuffering (UInt tlayer) { return m_uiMaxDecPicBuffering[tlayer]; } |
---|
1610 | Void setMaxDecPicBuffering ( UInt ui, UInt tlayer ) { assert(tlayer < MAX_TLAYER); m_uiMaxDecPicBuffering[tlayer] = ui; } |
---|
1611 | UInt getMaxLatencyIncrease (UInt tlayer) { return m_uiMaxLatencyIncrease[tlayer]; } |
---|
1612 | Void setMaxLatencyIncrease ( UInt ui , UInt tlayer) { m_uiMaxLatencyIncrease[tlayer] = ui; } |
---|
1613 | |
---|
1614 | Void setUseStrongIntraSmoothing (Bool bVal) {m_useStrongIntraSmoothing = bVal;} |
---|
1615 | Bool getUseStrongIntraSmoothing () {return m_useStrongIntraSmoothing;} |
---|
1616 | |
---|
1617 | Bool getVuiParametersPresentFlag() { return m_vuiParametersPresentFlag; } |
---|
1618 | Void setVuiParametersPresentFlag(Bool b) { m_vuiParametersPresentFlag = b; } |
---|
1619 | TComVUI* getVuiParameters() { return &m_vuiParameters; } |
---|
1620 | Void setHrdParameters( UInt frameRate, UInt numDU, UInt bitRate, Bool randomAccess ); |
---|
1621 | |
---|
1622 | TComPTL* getPTL() { return &m_pcPTL; } |
---|
1623 | #if H_MV |
---|
1624 | Void setSpsExtensionFlag( Bool flag ) { m_spsExtensionFlag = flag; } |
---|
1625 | Bool getSpsExtensionFlag( ) { return m_spsExtensionFlag; } |
---|
1626 | |
---|
1627 | Void setSpsExtensionTypeFlag( Int i, Bool flag ) { m_spsExtensionTypeFlag[i] = flag; } |
---|
1628 | Bool getSpsExtensionTypeFlag( Int i ) { return m_spsExtensionTypeFlag[i]; } |
---|
1629 | Void setVPS ( TComVPS* pcVPS ) { m_pcVPS = pcVPS; } |
---|
1630 | TComVPS* getVPS () { return m_pcVPS; } |
---|
1631 | |
---|
1632 | Void setSpsInferScalingListFlag( Bool flag ) { m_spsInferScalingListFlag = flag; } |
---|
1633 | Bool getSpsInferScalingListFlag( ) { return m_spsInferScalingListFlag; } |
---|
1634 | |
---|
1635 | Void setSpsScalingListRefLayerId( Int val ) { m_spsScalingListRefLayerId = val; } |
---|
1636 | Int getSpsScalingListRefLayerId( ) { return m_spsScalingListRefLayerId; } |
---|
1637 | |
---|
1638 | Void setUpdateRepFormatFlag( Bool flag ) { m_updateRepFormatFlag = flag; } |
---|
1639 | Bool getUpdateRepFormatFlag( ) { return m_updateRepFormatFlag; } |
---|
1640 | Void setSpsRepFormatIdx( Int val ) { m_spsRepFormatIdx = val; } |
---|
1641 | Int getSpsRepFormatIdx( ) { return m_spsRepFormatIdx; } |
---|
1642 | // SPS Extension |
---|
1643 | Void setInterViewMvVertConstraintFlag(Bool val) { m_interViewMvVertConstraintFlag = val; } |
---|
1644 | Bool getInterViewMvVertConstraintFlag() { return m_interViewMvVertConstraintFlag;} |
---|
1645 | |
---|
1646 | Void setNumScaledRefLayerOffsets( Int val ) { m_numScaledRefLayerOffsets = val; } |
---|
1647 | Int getNumScaledRefLayerOffsets( ) { return m_numScaledRefLayerOffsets; } |
---|
1648 | |
---|
1649 | Void setScaledRefLayerId( Int i, Int val ) { m_scaledRefLayerId[i] = val; } |
---|
1650 | Int getScaledRefLayerId( Int i ) { return m_scaledRefLayerId[i]; } |
---|
1651 | |
---|
1652 | Void setScaledRefLayerLeftOffset( Int j, Int val ) { m_scaledRefLayerLeftOffset[j] = val; } |
---|
1653 | Int getScaledRefLayerLeftOffset( Int j ) { return m_scaledRefLayerLeftOffset[j]; } |
---|
1654 | |
---|
1655 | Void setScaledRefLayerTopOffset( Int j, Int val ) { m_scaledRefLayerTopOffset[j] = val; } |
---|
1656 | Int getScaledRefLayerTopOffset( Int j ) { return m_scaledRefLayerTopOffset[j]; } |
---|
1657 | |
---|
1658 | Void setScaledRefLayerRightOffset( Int j, Int val ) { m_scaledRefLayerRightOffset[j] = val; } |
---|
1659 | Int getScaledRefLayerRightOffset( Int j ) { return m_scaledRefLayerRightOffset[j]; } |
---|
1660 | |
---|
1661 | Void setScaledRefLayerBottomOffset( Int j, Int val ) { m_scaledRefLayerBottomOffset[j] = val; } |
---|
1662 | Int getScaledRefLayerBottomOffset( Int j ) { return m_scaledRefLayerBottomOffset[j]; } |
---|
1663 | // Inference |
---|
1664 | Void inferRepFormat( TComVPS* vps, Int layerIdCurr ); |
---|
1665 | |
---|
1666 | Void inferScalingList( TComSPS* spsSrc ); |
---|
1667 | #endif |
---|
1668 | #if H_3D_QTLPC |
---|
1669 | Void setUseQTL( Bool b ) { m_bUseQTL = b; } |
---|
1670 | Bool getUseQTL() { return m_bUseQTL; } |
---|
1671 | Void setUsePC ( Bool b ) { m_bUsePC = b; } |
---|
1672 | Bool getUsePC () { return m_bUsePC; } |
---|
1673 | #endif |
---|
1674 | #if H_MV |
---|
1675 | Int getLayerId () { return m_layerId; } |
---|
1676 | Void setLayerId ( Int val ) { m_layerId = val; } |
---|
1677 | #endif |
---|
1678 | |
---|
1679 | }; |
---|
1680 | |
---|
1681 | /// Reference Picture Lists class |
---|
1682 | class TComRefPicListModification |
---|
1683 | { |
---|
1684 | private: |
---|
1685 | UInt m_bRefPicListModificationFlagL0; |
---|
1686 | UInt m_bRefPicListModificationFlagL1; |
---|
1687 | UInt m_RefPicSetIdxL0[32]; |
---|
1688 | UInt m_RefPicSetIdxL1[32]; |
---|
1689 | |
---|
1690 | public: |
---|
1691 | TComRefPicListModification(); |
---|
1692 | virtual ~TComRefPicListModification(); |
---|
1693 | |
---|
1694 | Void create (); |
---|
1695 | Void destroy (); |
---|
1696 | |
---|
1697 | Bool getRefPicListModificationFlagL0() { return m_bRefPicListModificationFlagL0; } |
---|
1698 | Void setRefPicListModificationFlagL0(Bool flag) { m_bRefPicListModificationFlagL0 = flag; } |
---|
1699 | Bool getRefPicListModificationFlagL1() { return m_bRefPicListModificationFlagL1; } |
---|
1700 | Void setRefPicListModificationFlagL1(Bool flag) { m_bRefPicListModificationFlagL1 = flag; } |
---|
1701 | Void setRefPicSetIdxL0(UInt idx, UInt refPicSetIdx) { m_RefPicSetIdxL0[idx] = refPicSetIdx; } |
---|
1702 | UInt getRefPicSetIdxL0(UInt idx) { return m_RefPicSetIdxL0[idx]; } |
---|
1703 | Void setRefPicSetIdxL1(UInt idx, UInt refPicSetIdx) { m_RefPicSetIdxL1[idx] = refPicSetIdx; } |
---|
1704 | UInt getRefPicSetIdxL1(UInt idx) { return m_RefPicSetIdxL1[idx]; } |
---|
1705 | #if H_MV |
---|
1706 | // Why not an listIdx for all members, would avoid code duplication?? |
---|
1707 | Void setRefPicSetIdxL(UInt li, UInt idx, UInt refPicSetIdx) {( li==0 ? m_RefPicSetIdxL0[idx] : m_RefPicSetIdxL1[idx] ) = refPicSetIdx; } |
---|
1708 | UInt getRefPicSetIdxL(UInt li, UInt idx ) { return ( li == 0 ) ? m_RefPicSetIdxL0[idx] : m_RefPicSetIdxL1[idx] ; } |
---|
1709 | Void setRefPicListModificationFlagL(UInt li, Bool flag) { ( li==0 ? m_bRefPicListModificationFlagL0 : m_bRefPicListModificationFlagL1 ) = flag; } |
---|
1710 | Bool getRefPicListModificationFlagL(UInt li ) { return ( li== 0) ? m_bRefPicListModificationFlagL0 : m_bRefPicListModificationFlagL1; } |
---|
1711 | #endif |
---|
1712 | }; |
---|
1713 | |
---|
1714 | /// PPS class |
---|
1715 | class TComPPS |
---|
1716 | { |
---|
1717 | private: |
---|
1718 | Int m_PPSId; // pic_parameter_set_id |
---|
1719 | Int m_SPSId; // seq_parameter_set_id |
---|
1720 | Int m_picInitQPMinus26; |
---|
1721 | Bool m_useDQP; |
---|
1722 | Bool m_bConstrainedIntraPred; // constrained_intra_pred_flag |
---|
1723 | Bool m_bSliceChromaQpFlag; // slicelevel_chroma_qp_flag |
---|
1724 | |
---|
1725 | // access channel |
---|
1726 | TComSPS* m_pcSPS; |
---|
1727 | UInt m_uiMaxCuDQPDepth; |
---|
1728 | UInt m_uiMinCuDQPSize; |
---|
1729 | |
---|
1730 | Int m_chromaCbQpOffset; |
---|
1731 | Int m_chromaCrQpOffset; |
---|
1732 | |
---|
1733 | UInt m_numRefIdxL0DefaultActive; |
---|
1734 | UInt m_numRefIdxL1DefaultActive; |
---|
1735 | |
---|
1736 | Bool m_bUseWeightPred; // Use of Weighting Prediction (P_SLICE) |
---|
1737 | Bool m_useWeightedBiPred; // Use of Weighting Bi-Prediction (B_SLICE) |
---|
1738 | Bool m_OutputFlagPresentFlag; // Indicates the presence of output_flag in slice header |
---|
1739 | |
---|
1740 | Bool m_TransquantBypassEnableFlag; // Indicates presence of cu_transquant_bypass_flag in CUs. |
---|
1741 | Bool m_useTransformSkip; |
---|
1742 | Bool m_dependentSliceSegmentsEnabledFlag; //!< Indicates the presence of dependent slices |
---|
1743 | Bool m_tilesEnabledFlag; //!< Indicates the presence of tiles |
---|
1744 | Bool m_entropyCodingSyncEnabledFlag; //!< Indicates the presence of wavefronts |
---|
1745 | |
---|
1746 | Bool m_loopFilterAcrossTilesEnabledFlag; |
---|
1747 | Int m_uniformSpacingFlag; |
---|
1748 | Int m_iNumColumnsMinus1; |
---|
1749 | UInt* m_puiColumnWidth; |
---|
1750 | Int m_iNumRowsMinus1; |
---|
1751 | UInt* m_puiRowHeight; |
---|
1752 | |
---|
1753 | Int m_iNumSubstreams; |
---|
1754 | |
---|
1755 | Int m_signHideFlag; |
---|
1756 | |
---|
1757 | Bool m_cabacInitPresentFlag; |
---|
1758 | UInt m_encCABACTableIdx; // Used to transmit table selection across slices |
---|
1759 | |
---|
1760 | Bool m_sliceHeaderExtensionPresentFlag; |
---|
1761 | Bool m_loopFilterAcrossSlicesEnabledFlag; |
---|
1762 | Bool m_deblockingFilterControlPresentFlag; |
---|
1763 | Bool m_deblockingFilterOverrideEnabledFlag; |
---|
1764 | Bool m_picDisableDeblockingFilterFlag; |
---|
1765 | Int m_deblockingFilterBetaOffsetDiv2; //< beta offset for deblocking filter |
---|
1766 | Int m_deblockingFilterTcOffsetDiv2; //< tc offset for deblocking filter |
---|
1767 | Bool m_scalingListPresentFlag; |
---|
1768 | TComScalingList* m_scalingList; //!< ScalingList class pointer |
---|
1769 | Bool m_listsModificationPresentFlag; |
---|
1770 | UInt m_log2ParallelMergeLevelMinus2; |
---|
1771 | Int m_numExtraSliceHeaderBits; |
---|
1772 | |
---|
1773 | #if H_MV |
---|
1774 | Int m_layerId; |
---|
1775 | Bool m_ppsInferScalingListFlag; |
---|
1776 | Int m_ppsScalingListRefLayerId; |
---|
1777 | |
---|
1778 | Bool m_ppsExtensionTypeFlag[PS_EX_T_MAX_NUM]; |
---|
1779 | Bool m_pocResetInfoPresentFlag; |
---|
1780 | #endif |
---|
1781 | |
---|
1782 | #if H_3D |
---|
1783 | TComDLT* m_pcDLT; |
---|
1784 | #endif |
---|
1785 | |
---|
1786 | public: |
---|
1787 | TComPPS(); |
---|
1788 | virtual ~TComPPS(); |
---|
1789 | |
---|
1790 | Int getPPSId () { return m_PPSId; } |
---|
1791 | Void setPPSId (Int i) { m_PPSId = i; } |
---|
1792 | Int getSPSId () { return m_SPSId; } |
---|
1793 | Void setSPSId (Int i) { m_SPSId = i; } |
---|
1794 | |
---|
1795 | Int getPicInitQPMinus26 () { return m_picInitQPMinus26; } |
---|
1796 | Void setPicInitQPMinus26 ( Int i ) { m_picInitQPMinus26 = i; } |
---|
1797 | Bool getUseDQP () { return m_useDQP; } |
---|
1798 | Void setUseDQP ( Bool b ) { m_useDQP = b; } |
---|
1799 | Bool getConstrainedIntraPred () { return m_bConstrainedIntraPred; } |
---|
1800 | Void setConstrainedIntraPred ( Bool b ) { m_bConstrainedIntraPred = b; } |
---|
1801 | Bool getSliceChromaQpFlag () { return m_bSliceChromaQpFlag; } |
---|
1802 | Void setSliceChromaQpFlag ( Bool b ) { m_bSliceChromaQpFlag = b; } |
---|
1803 | |
---|
1804 | Void setSPS ( TComSPS* pcSPS ) { m_pcSPS = pcSPS; } |
---|
1805 | TComSPS* getSPS () { return m_pcSPS; } |
---|
1806 | Void setMaxCuDQPDepth ( UInt u ) { m_uiMaxCuDQPDepth = u; } |
---|
1807 | UInt getMaxCuDQPDepth () { return m_uiMaxCuDQPDepth;} |
---|
1808 | Void setMinCuDQPSize ( UInt u ) { m_uiMinCuDQPSize = u; } |
---|
1809 | UInt getMinCuDQPSize () { return m_uiMinCuDQPSize; } |
---|
1810 | |
---|
1811 | #if H_3D |
---|
1812 | Void setDLT ( TComDLT* pcDLT ) { m_pcDLT = pcDLT; } |
---|
1813 | TComDLT* getDLT () { return m_pcDLT; } |
---|
1814 | #endif |
---|
1815 | |
---|
1816 | Void setChromaCbQpOffset( Int i ) { m_chromaCbQpOffset = i; } |
---|
1817 | Int getChromaCbQpOffset() { return m_chromaCbQpOffset; } |
---|
1818 | Void setChromaCrQpOffset( Int i ) { m_chromaCrQpOffset = i; } |
---|
1819 | Int getChromaCrQpOffset() { return m_chromaCrQpOffset; } |
---|
1820 | |
---|
1821 | Void setNumRefIdxL0DefaultActive(UInt ui) { m_numRefIdxL0DefaultActive=ui; } |
---|
1822 | UInt getNumRefIdxL0DefaultActive() { return m_numRefIdxL0DefaultActive; } |
---|
1823 | Void setNumRefIdxL1DefaultActive(UInt ui) { m_numRefIdxL1DefaultActive=ui; } |
---|
1824 | UInt getNumRefIdxL1DefaultActive() { return m_numRefIdxL1DefaultActive; } |
---|
1825 | |
---|
1826 | Bool getUseWP () { return m_bUseWeightPred; } |
---|
1827 | Bool getWPBiPred () { return m_useWeightedBiPred; } |
---|
1828 | Void setUseWP ( Bool b ) { m_bUseWeightPred = b; } |
---|
1829 | Void setWPBiPred ( Bool b ) { m_useWeightedBiPred = b; } |
---|
1830 | Void setOutputFlagPresentFlag( Bool b ) { m_OutputFlagPresentFlag = b; } |
---|
1831 | Bool getOutputFlagPresentFlag() { return m_OutputFlagPresentFlag; } |
---|
1832 | Void setTransquantBypassEnableFlag( Bool b ) { m_TransquantBypassEnableFlag = b; } |
---|
1833 | Bool getTransquantBypassEnableFlag() { return m_TransquantBypassEnableFlag; } |
---|
1834 | |
---|
1835 | Bool getUseTransformSkip () { return m_useTransformSkip; } |
---|
1836 | Void setUseTransformSkip ( Bool b ) { m_useTransformSkip = b; } |
---|
1837 | |
---|
1838 | Void setLoopFilterAcrossTilesEnabledFlag (Bool b) { m_loopFilterAcrossTilesEnabledFlag = b; } |
---|
1839 | Bool getLoopFilterAcrossTilesEnabledFlag () { return m_loopFilterAcrossTilesEnabledFlag; } |
---|
1840 | Bool getDependentSliceSegmentsEnabledFlag() const { return m_dependentSliceSegmentsEnabledFlag; } |
---|
1841 | Void setDependentSliceSegmentsEnabledFlag(Bool val) { m_dependentSliceSegmentsEnabledFlag = val; } |
---|
1842 | Bool getTilesEnabledFlag() const { return m_tilesEnabledFlag; } |
---|
1843 | Void setTilesEnabledFlag(Bool val) { m_tilesEnabledFlag = val; } |
---|
1844 | Bool getEntropyCodingSyncEnabledFlag() const { return m_entropyCodingSyncEnabledFlag; } |
---|
1845 | Void setEntropyCodingSyncEnabledFlag(Bool val) { m_entropyCodingSyncEnabledFlag = val; } |
---|
1846 | Void setUniformSpacingFlag ( Bool b ) { m_uniformSpacingFlag = b; } |
---|
1847 | Bool getUniformSpacingFlag () { return m_uniformSpacingFlag; } |
---|
1848 | Void setNumColumnsMinus1 ( Int i ) { m_iNumColumnsMinus1 = i; } |
---|
1849 | Int getNumColumnsMinus1 () { return m_iNumColumnsMinus1; } |
---|
1850 | Void setColumnWidth ( UInt* columnWidth ) |
---|
1851 | { |
---|
1852 | if( m_uniformSpacingFlag == 0 && m_iNumColumnsMinus1 > 0 ) |
---|
1853 | { |
---|
1854 | m_puiColumnWidth = new UInt[ m_iNumColumnsMinus1 ]; |
---|
1855 | |
---|
1856 | for(Int i=0; i<m_iNumColumnsMinus1; i++) |
---|
1857 | { |
---|
1858 | m_puiColumnWidth[i] = columnWidth[i]; |
---|
1859 | } |
---|
1860 | } |
---|
1861 | } |
---|
1862 | UInt getColumnWidth (UInt columnIdx) { return *( m_puiColumnWidth + columnIdx ); } |
---|
1863 | Void setNumRowsMinus1( Int i ) { m_iNumRowsMinus1 = i; } |
---|
1864 | Int getNumRowsMinus1() { return m_iNumRowsMinus1; } |
---|
1865 | Void setRowHeight ( UInt* rowHeight ) |
---|
1866 | { |
---|
1867 | if( m_uniformSpacingFlag == 0 && m_iNumRowsMinus1 > 0 ) |
---|
1868 | { |
---|
1869 | m_puiRowHeight = new UInt[ m_iNumRowsMinus1 ]; |
---|
1870 | |
---|
1871 | for(Int i=0; i<m_iNumRowsMinus1; i++) |
---|
1872 | { |
---|
1873 | m_puiRowHeight[i] = rowHeight[i]; |
---|
1874 | } |
---|
1875 | } |
---|
1876 | } |
---|
1877 | UInt getRowHeight (UInt rowIdx) { return *( m_puiRowHeight + rowIdx ); } |
---|
1878 | Void setNumSubstreams(Int iNumSubstreams) { m_iNumSubstreams = iNumSubstreams; } |
---|
1879 | Int getNumSubstreams() { return m_iNumSubstreams; } |
---|
1880 | |
---|
1881 | Void setSignHideFlag( Int signHideFlag ) { m_signHideFlag = signHideFlag; } |
---|
1882 | Int getSignHideFlag() { return m_signHideFlag; } |
---|
1883 | |
---|
1884 | Void setCabacInitPresentFlag( Bool flag ) { m_cabacInitPresentFlag = flag; } |
---|
1885 | Void setEncCABACTableIdx( Int idx ) { m_encCABACTableIdx = idx; } |
---|
1886 | Bool getCabacInitPresentFlag() { return m_cabacInitPresentFlag; } |
---|
1887 | UInt getEncCABACTableIdx() { return m_encCABACTableIdx; } |
---|
1888 | Void setDeblockingFilterControlPresentFlag( Bool val ) { m_deblockingFilterControlPresentFlag = val; } |
---|
1889 | Bool getDeblockingFilterControlPresentFlag() { return m_deblockingFilterControlPresentFlag; } |
---|
1890 | Void setDeblockingFilterOverrideEnabledFlag( Bool val ) { m_deblockingFilterOverrideEnabledFlag = val; } |
---|
1891 | Bool getDeblockingFilterOverrideEnabledFlag() { return m_deblockingFilterOverrideEnabledFlag; } |
---|
1892 | Void setPicDisableDeblockingFilterFlag(Bool val) { m_picDisableDeblockingFilterFlag = val; } //!< set offset for deblocking filter disabled |
---|
1893 | Bool getPicDisableDeblockingFilterFlag() { return m_picDisableDeblockingFilterFlag; } //!< get offset for deblocking filter disabled |
---|
1894 | Void setDeblockingFilterBetaOffsetDiv2(Int val) { m_deblockingFilterBetaOffsetDiv2 = val; } //!< set beta offset for deblocking filter |
---|
1895 | Int getDeblockingFilterBetaOffsetDiv2() { return m_deblockingFilterBetaOffsetDiv2; } //!< get beta offset for deblocking filter |
---|
1896 | Void setDeblockingFilterTcOffsetDiv2(Int val) { m_deblockingFilterTcOffsetDiv2 = val; } //!< set tc offset for deblocking filter |
---|
1897 | Int getDeblockingFilterTcOffsetDiv2() { return m_deblockingFilterTcOffsetDiv2; } //!< get tc offset for deblocking filter |
---|
1898 | Bool getScalingListPresentFlag() { return m_scalingListPresentFlag; } |
---|
1899 | Void setScalingListPresentFlag( Bool b ) { m_scalingListPresentFlag = b; } |
---|
1900 | Void setScalingList ( TComScalingList *scalingList); |
---|
1901 | TComScalingList* getScalingList () { return m_scalingList; } //!< get ScalingList class pointer in PPS |
---|
1902 | Bool getListsModificationPresentFlag () { return m_listsModificationPresentFlag; } |
---|
1903 | Void setListsModificationPresentFlag ( Bool b ) { m_listsModificationPresentFlag = b; } |
---|
1904 | UInt getLog2ParallelMergeLevelMinus2 () { return m_log2ParallelMergeLevelMinus2; } |
---|
1905 | Void setLog2ParallelMergeLevelMinus2 (UInt mrgLevel) { m_log2ParallelMergeLevelMinus2 = mrgLevel; } |
---|
1906 | Int getNumExtraSliceHeaderBits() { return m_numExtraSliceHeaderBits; } |
---|
1907 | Void setNumExtraSliceHeaderBits(Int i) { m_numExtraSliceHeaderBits = i; } |
---|
1908 | Void setLoopFilterAcrossSlicesEnabledFlag ( Bool bValue ) { m_loopFilterAcrossSlicesEnabledFlag = bValue; } |
---|
1909 | Bool getLoopFilterAcrossSlicesEnabledFlag () { return m_loopFilterAcrossSlicesEnabledFlag; } |
---|
1910 | Bool getSliceHeaderExtensionPresentFlag () { return m_sliceHeaderExtensionPresentFlag; } |
---|
1911 | Void setSliceHeaderExtensionPresentFlag (Bool val) { m_sliceHeaderExtensionPresentFlag = val; } |
---|
1912 | #if H_MV |
---|
1913 | Void setLayerId( Int val ) { m_layerId = val; } |
---|
1914 | Int getLayerId( ) { return m_layerId; } |
---|
1915 | |
---|
1916 | Void setPpsInferScalingListFlag( Bool flag ) { m_ppsInferScalingListFlag = flag; } |
---|
1917 | Bool getPpsInferScalingListFlag( ) { return m_ppsInferScalingListFlag; } |
---|
1918 | |
---|
1919 | Void setPpsScalingListRefLayerId( Int val ) { m_ppsScalingListRefLayerId = val; } |
---|
1920 | Int getPpsScalingListRefLayerId( ) { return m_ppsScalingListRefLayerId; } |
---|
1921 | |
---|
1922 | Void setPpsExtensionTypeFlag( Int i, Bool flag ) { m_ppsExtensionTypeFlag[i] = flag; } |
---|
1923 | Bool getPpsExtensionTypeFlag( Int i ) { return m_ppsExtensionTypeFlag[i]; } |
---|
1924 | |
---|
1925 | Void setPocResetInfoPresentFlag( Bool flag ) { m_pocResetInfoPresentFlag = flag; } |
---|
1926 | Bool getPocResetInfoPresentFlag( ) { return m_pocResetInfoPresentFlag; } |
---|
1927 | #endif |
---|
1928 | }; |
---|
1929 | |
---|
1930 | typedef struct |
---|
1931 | { |
---|
1932 | // Explicit weighted prediction parameters parsed in slice header, |
---|
1933 | // or Implicit weighted prediction parameters (8 bits depth values). |
---|
1934 | Bool bPresentFlag; |
---|
1935 | UInt uiLog2WeightDenom; |
---|
1936 | Int iWeight; |
---|
1937 | Int iOffset; |
---|
1938 | |
---|
1939 | // Weighted prediction scaling values built from above parameters (bitdepth scaled): |
---|
1940 | Int w, o, offset, shift, round; |
---|
1941 | } wpScalingParam; |
---|
1942 | |
---|
1943 | typedef struct |
---|
1944 | { |
---|
1945 | Int64 iAC; |
---|
1946 | Int64 iDC; |
---|
1947 | } wpACDCParam; |
---|
1948 | |
---|
1949 | /// slice header class |
---|
1950 | class TComSlice |
---|
1951 | { |
---|
1952 | |
---|
1953 | private: |
---|
1954 | // Bitstream writing |
---|
1955 | Bool m_saoEnabledFlag; |
---|
1956 | Bool m_saoEnabledFlagChroma; ///< SAO Cb&Cr enabled flag |
---|
1957 | Int m_iPPSId; ///< picture parameter set ID |
---|
1958 | Bool m_PicOutputFlag; ///< pic_output_flag |
---|
1959 | Int m_iPOC; |
---|
1960 | #if H_MV |
---|
1961 | Int m_iPOCBeforeReset; |
---|
1962 | #endif |
---|
1963 | Int m_iLastIDR; |
---|
1964 | Int m_iAssociatedIRAP; |
---|
1965 | NalUnitType m_iAssociatedIRAPType; |
---|
1966 | static Int m_prevTid0POC; |
---|
1967 | TComReferencePictureSet *m_pcRPS; |
---|
1968 | TComReferencePictureSet m_LocalRPS; |
---|
1969 | Int m_iBDidx; |
---|
1970 | TComRefPicListModification m_RefPicListModification; |
---|
1971 | NalUnitType m_eNalUnitType; ///< Nal unit type for the slice |
---|
1972 | SliceType m_eSliceType; |
---|
1973 | Int m_iSliceQp; |
---|
1974 | Bool m_dependentSliceSegmentFlag; |
---|
1975 | #if ADAPTIVE_QP_SELECTION |
---|
1976 | Int m_iSliceQpBase; |
---|
1977 | #endif |
---|
1978 | Bool m_deblockingFilterDisable; |
---|
1979 | Bool m_deblockingFilterOverrideFlag; //< offsets for deblocking filter inherit from PPS |
---|
1980 | Int m_deblockingFilterBetaOffsetDiv2; //< beta offset for deblocking filter |
---|
1981 | Int m_deblockingFilterTcOffsetDiv2; //< tc offset for deblocking filter |
---|
1982 | Int m_list1IdxToList0Idx[MAX_NUM_REF]; |
---|
1983 | Int m_aiNumRefIdx [2]; // for multiple reference of current slice |
---|
1984 | |
---|
1985 | Bool m_bCheckLDC; |
---|
1986 | |
---|
1987 | // Data |
---|
1988 | Int m_iSliceQpDelta; |
---|
1989 | Int m_iSliceQpDeltaCb; |
---|
1990 | Int m_iSliceQpDeltaCr; |
---|
1991 | TComPic* m_apcRefPicList [2][MAX_NUM_REF+1]; |
---|
1992 | Int m_aiRefPOCList [2][MAX_NUM_REF+1]; |
---|
1993 | #if H_MV |
---|
1994 | Int m_aiRefLayerIdList[2][MAX_NUM_REF+1]; |
---|
1995 | #endif |
---|
1996 | Bool m_bIsUsedAsLongTerm[2][MAX_NUM_REF+1]; |
---|
1997 | Int m_iDepth; |
---|
1998 | |
---|
1999 | // referenced slice? |
---|
2000 | Bool m_bRefenced; |
---|
2001 | |
---|
2002 | // access channel |
---|
2003 | TComVPS* m_pcVPS; |
---|
2004 | TComSPS* m_pcSPS; |
---|
2005 | TComPPS* m_pcPPS; |
---|
2006 | TComPic* m_pcPic; |
---|
2007 | #if ADAPTIVE_QP_SELECTION |
---|
2008 | TComTrQuant* m_pcTrQuant; |
---|
2009 | #endif |
---|
2010 | UInt m_colFromL0Flag; // collocated picture from List0 flag |
---|
2011 | |
---|
2012 | UInt m_colRefIdx; |
---|
2013 | UInt m_maxNumMergeCand; |
---|
2014 | |
---|
2015 | Double m_lambdas[3]; |
---|
2016 | |
---|
2017 | Bool m_abEqualRef [2][MAX_NUM_REF][MAX_NUM_REF]; |
---|
2018 | UInt m_uiTLayer; |
---|
2019 | Bool m_bTLayerSwitchingFlag; |
---|
2020 | |
---|
2021 | UInt m_sliceMode; |
---|
2022 | UInt m_sliceArgument; |
---|
2023 | UInt m_sliceCurStartCUAddr; |
---|
2024 | UInt m_sliceCurEndCUAddr; |
---|
2025 | UInt m_sliceIdx; |
---|
2026 | UInt m_sliceSegmentMode; |
---|
2027 | UInt m_sliceSegmentArgument; |
---|
2028 | UInt m_sliceSegmentCurStartCUAddr; |
---|
2029 | UInt m_sliceSegmentCurEndCUAddr; |
---|
2030 | Bool m_nextSlice; |
---|
2031 | Bool m_nextSliceSegment; |
---|
2032 | UInt m_sliceBits; |
---|
2033 | UInt m_sliceSegmentBits; |
---|
2034 | Bool m_bFinalized; |
---|
2035 | |
---|
2036 | wpScalingParam m_weightPredTable[2][MAX_NUM_REF][3]; // [REF_PIC_LIST_0 or REF_PIC_LIST_1][refIdx][0:Y, 1:U, 2:V] |
---|
2037 | wpACDCParam m_weightACDCParam[3]; // [0:Y, 1:U, 2:V] |
---|
2038 | |
---|
2039 | std::vector<UInt> m_tileByteLocation; |
---|
2040 | UInt m_uiTileOffstForMultES; |
---|
2041 | |
---|
2042 | UInt* m_puiSubstreamSizes; |
---|
2043 | TComScalingList* m_scalingList; //!< pointer of quantization matrix |
---|
2044 | Bool m_cabacInitFlag; |
---|
2045 | |
---|
2046 | Bool m_bLMvdL1Zero; |
---|
2047 | Int m_numEntryPointOffsets; |
---|
2048 | Bool m_temporalLayerNonReferenceFlag; |
---|
2049 | Bool m_LFCrossSliceBoundaryFlag; |
---|
2050 | |
---|
2051 | Bool m_enableTMVPFlag; |
---|
2052 | #if H_MV |
---|
2053 | std::vector<TComPic*>* m_refPicSetInterLayer0; |
---|
2054 | std::vector<TComPic*>* m_refPicSetInterLayer1; |
---|
2055 | Int m_layerId; |
---|
2056 | Int m_viewId; |
---|
2057 | Int m_viewIndex; |
---|
2058 | #if H_3D |
---|
2059 | Bool m_isDepth; |
---|
2060 | #endif |
---|
2061 | |
---|
2062 | // Additional slice header syntax elements |
---|
2063 | #if !H_MV_HLS7_GEN |
---|
2064 | Bool m_pocResetFlag; |
---|
2065 | #endif |
---|
2066 | Bool m_crossLayerBlaFlag; |
---|
2067 | Bool m_discardableFlag; |
---|
2068 | Bool m_interLayerPredEnabledFlag; |
---|
2069 | Int m_numInterLayerRefPicsMinus1; |
---|
2070 | Int m_interLayerPredLayerIdc [MAX_NUM_LAYERS]; |
---|
2071 | |
---|
2072 | Int m_sliceSegmentHeaderExtensionLength; |
---|
2073 | Int m_pocResetIdc; |
---|
2074 | Int m_pocResetPeriodId; |
---|
2075 | Bool m_fullPocResetFlag; |
---|
2076 | Int m_pocLsbVal; |
---|
2077 | Bool m_pocMsbValPresentFlag; |
---|
2078 | Int m_pocMsbVal; |
---|
2079 | Bool m_pocMsbValRequiredFlag; |
---|
2080 | |
---|
2081 | #if H_3D |
---|
2082 | Int m_aaiCodedScale [2][MAX_NUM_LAYERS]; |
---|
2083 | Int m_aaiCodedOffset[2][MAX_NUM_LAYERS]; |
---|
2084 | #endif |
---|
2085 | #if H_3D_TMVP |
---|
2086 | Int m_aiAlterRefIdx [2]; |
---|
2087 | #endif |
---|
2088 | #if H_3D_ARP |
---|
2089 | Bool m_arpRefPicAvailable[2][MAX_NUM_LAYERS]; |
---|
2090 | TComList<TComPic*> * m_pBaseViewRefPicList[MAX_NUM_LAYERS]; |
---|
2091 | UInt m_nARPStepNum; |
---|
2092 | Int m_aiFirstTRefIdx [2]; |
---|
2093 | #endif |
---|
2094 | #if H_3D_IC |
---|
2095 | Bool m_bApplyIC; |
---|
2096 | Bool m_icSkipParseFlag; |
---|
2097 | #endif |
---|
2098 | #if H_3D |
---|
2099 | TComPic* m_ivPicsCurrPoc [2][MAX_NUM_LAYERS]; |
---|
2100 | Int** m_depthToDisparityB; |
---|
2101 | Int** m_depthToDisparityF; |
---|
2102 | #endif |
---|
2103 | #endif |
---|
2104 | |
---|
2105 | #if H_3D_DDD |
---|
2106 | Int m_aiDDDInvScale [MAX_NUM_LAYERS]; |
---|
2107 | Int m_aiDDDInvOffset[MAX_NUM_LAYERS]; |
---|
2108 | UInt m_aiDDDShift [MAX_NUM_LAYERS]; |
---|
2109 | #endif |
---|
2110 | |
---|
2111 | public: |
---|
2112 | TComSlice(); |
---|
2113 | virtual ~TComSlice(); |
---|
2114 | Void initSlice (); |
---|
2115 | |
---|
2116 | Void setVPS ( TComVPS* pcVPS ) { m_pcVPS = pcVPS; } |
---|
2117 | TComVPS* getVPS () { return m_pcVPS; } |
---|
2118 | Void setSPS ( TComSPS* pcSPS ) { m_pcSPS = pcSPS; } |
---|
2119 | TComSPS* getSPS () { return m_pcSPS; } |
---|
2120 | |
---|
2121 | Void setPPS ( TComPPS* pcPPS ) { assert(pcPPS!=NULL); m_pcPPS = pcPPS; m_iPPSId = pcPPS->getPPSId(); } |
---|
2122 | TComPPS* getPPS () { return m_pcPPS; } |
---|
2123 | |
---|
2124 | #if ADAPTIVE_QP_SELECTION |
---|
2125 | Void setTrQuant ( TComTrQuant* pcTrQuant ) { m_pcTrQuant = pcTrQuant; } |
---|
2126 | TComTrQuant* getTrQuant () { return m_pcTrQuant; } |
---|
2127 | #endif |
---|
2128 | |
---|
2129 | Void setPPSId ( Int PPSId ) { m_iPPSId = PPSId; } |
---|
2130 | Int getPPSId () { return m_iPPSId; } |
---|
2131 | Void setPicOutputFlag( Bool b ) { m_PicOutputFlag = b; } |
---|
2132 | Bool getPicOutputFlag() { return m_PicOutputFlag; } |
---|
2133 | Void setSaoEnabledFlag(Bool s) {m_saoEnabledFlag =s; } |
---|
2134 | Bool getSaoEnabledFlag() { return m_saoEnabledFlag; } |
---|
2135 | Void setSaoEnabledFlagChroma(Bool s) {m_saoEnabledFlagChroma =s; } //!< set SAO Cb&Cr enabled flag |
---|
2136 | Bool getSaoEnabledFlagChroma() { return m_saoEnabledFlagChroma; } //!< get SAO Cb&Cr enabled flag |
---|
2137 | Void setRPS ( TComReferencePictureSet *pcRPS ) { m_pcRPS = pcRPS; } |
---|
2138 | TComReferencePictureSet* getRPS () { return m_pcRPS; } |
---|
2139 | TComReferencePictureSet* getLocalRPS () { return &m_LocalRPS; } |
---|
2140 | |
---|
2141 | Void setRPSidx ( Int iBDidx ) { m_iBDidx = iBDidx; } |
---|
2142 | Int getRPSidx () { return m_iBDidx; } |
---|
2143 | Int getPrevTid0POC () { return m_prevTid0POC; } |
---|
2144 | TComRefPicListModification* getRefPicListModification() { return &m_RefPicListModification; } |
---|
2145 | Void setLastIDR(Int iIDRPOC) { m_iLastIDR = iIDRPOC; } |
---|
2146 | Int getLastIDR() { return m_iLastIDR; } |
---|
2147 | Void setAssociatedIRAPPOC(Int iAssociatedIRAPPOC) { m_iAssociatedIRAP = iAssociatedIRAPPOC; } |
---|
2148 | Int getAssociatedIRAPPOC() { return m_iAssociatedIRAP; } |
---|
2149 | Void setAssociatedIRAPType(NalUnitType associatedIRAPType) { m_iAssociatedIRAPType = associatedIRAPType; } |
---|
2150 | NalUnitType getAssociatedIRAPType() { return m_iAssociatedIRAPType; } |
---|
2151 | SliceType getSliceType () { return m_eSliceType; } |
---|
2152 | Int getPOC () { return m_iPOC; } |
---|
2153 | Int getSliceQp () { return m_iSliceQp; } |
---|
2154 | Bool getDependentSliceSegmentFlag() const { return m_dependentSliceSegmentFlag; } |
---|
2155 | void setDependentSliceSegmentFlag(Bool val) { m_dependentSliceSegmentFlag = val; } |
---|
2156 | #if ADAPTIVE_QP_SELECTION |
---|
2157 | Int getSliceQpBase () { return m_iSliceQpBase; } |
---|
2158 | #endif |
---|
2159 | Int getSliceQpDelta () { return m_iSliceQpDelta; } |
---|
2160 | Int getSliceQpDeltaCb () { return m_iSliceQpDeltaCb; } |
---|
2161 | Int getSliceQpDeltaCr () { return m_iSliceQpDeltaCr; } |
---|
2162 | Bool getDeblockingFilterDisable() { return m_deblockingFilterDisable; } |
---|
2163 | Bool getDeblockingFilterOverrideFlag() { return m_deblockingFilterOverrideFlag; } |
---|
2164 | Int getDeblockingFilterBetaOffsetDiv2() { return m_deblockingFilterBetaOffsetDiv2; } |
---|
2165 | Int getDeblockingFilterTcOffsetDiv2() { return m_deblockingFilterTcOffsetDiv2; } |
---|
2166 | |
---|
2167 | Int getNumRefIdx ( RefPicList e ) { return m_aiNumRefIdx[e]; } |
---|
2168 | TComPic* getPic () { return m_pcPic; } |
---|
2169 | TComPic* getRefPic ( RefPicList e, Int iRefIdx) { return m_apcRefPicList[e][iRefIdx]; } |
---|
2170 | Int getRefPOC ( RefPicList e, Int iRefIdx) { return m_aiRefPOCList[e][iRefIdx]; } |
---|
2171 | #if H_3D |
---|
2172 | TComPic* getIvPic ( Bool depthFlag, Int viewIndex){ return m_ivPicsCurrPoc[ depthFlag ? 1 : 0 ][ viewIndex ]; } |
---|
2173 | #endif |
---|
2174 | #if H_3D |
---|
2175 | TComPic* getTexturePic () { return m_ivPicsCurrPoc[0][ m_viewIndex ]; } |
---|
2176 | #endif |
---|
2177 | #if H_3D_IC |
---|
2178 | Void setApplyIC( Bool b ) { m_bApplyIC = b; } |
---|
2179 | Bool getApplyIC() { return m_bApplyIC; } |
---|
2180 | Void xSetApplyIC(); |
---|
2181 | Void setIcSkipParseFlag( Bool b ) { m_icSkipParseFlag = b; } |
---|
2182 | Bool getIcSkipParseFlag() { return m_icSkipParseFlag; } |
---|
2183 | #endif |
---|
2184 | #if H_3D_ARP |
---|
2185 | Void setBaseViewRefPicList( TComList<TComPic*> *pListPic, Int iViewIdx ) { m_pBaseViewRefPicList[iViewIdx] = pListPic; } |
---|
2186 | Void setARPStepNum( TComPicLists*ivPicLists ); |
---|
2187 | TComPic* getBaseViewRefPic ( UInt uiPOC , Int iViewIdx ) { return xGetRefPic( *m_pBaseViewRefPicList[iViewIdx], uiPOC ); } |
---|
2188 | UInt getARPStepNum( ) { return m_nARPStepNum; } |
---|
2189 | #endif |
---|
2190 | Int getDepth () { return m_iDepth; } |
---|
2191 | UInt getColFromL0Flag () { return m_colFromL0Flag; } |
---|
2192 | UInt getColRefIdx () { return m_colRefIdx; } |
---|
2193 | Void checkColRefIdx (UInt curSliceIdx, TComPic* pic); |
---|
2194 | Bool getIsUsedAsLongTerm (Int i, Int j) { return m_bIsUsedAsLongTerm[i][j]; } |
---|
2195 | Void setIsUsedAsLongTerm (Int i, Int j, Bool value) { m_bIsUsedAsLongTerm[i][j] = value; } |
---|
2196 | Bool getCheckLDC () { return m_bCheckLDC; } |
---|
2197 | Bool getMvdL1ZeroFlag () { return m_bLMvdL1Zero; } |
---|
2198 | Int getNumRpsCurrTempList(); |
---|
2199 | Int getList1IdxToList0Idx ( Int list1Idx ) { return m_list1IdxToList0Idx[list1Idx]; } |
---|
2200 | Void setReferenced(Bool b) { m_bRefenced = b; } |
---|
2201 | Bool isReferenced() { return m_bRefenced; } |
---|
2202 | 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) ); } |
---|
2203 | 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;} } |
---|
2204 | Void setNalUnitType ( NalUnitType e ) { m_eNalUnitType = e; } |
---|
2205 | NalUnitType getNalUnitType () const { return m_eNalUnitType; } |
---|
2206 | Bool getRapPicFlag (); |
---|
2207 | Bool getIdrPicFlag () { return getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP; } |
---|
2208 | Bool isIRAP () const { return (getNalUnitType() >= 16) && (getNalUnitType() <= 23); } |
---|
2209 | Void checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, NalUnitType& associatedIRAPType, TComList<TComPic *>& rcListPic); |
---|
2210 | Void decodingRefreshMarking(Int& pocCRA, Bool& bRefreshPending, TComList<TComPic*>& rcListPic); |
---|
2211 | Void setSliceType ( SliceType e ) { m_eSliceType = e; } |
---|
2212 | Void setSliceQp ( Int i ) { m_iSliceQp = i; } |
---|
2213 | #if ADAPTIVE_QP_SELECTION |
---|
2214 | Void setSliceQpBase ( Int i ) { m_iSliceQpBase = i; } |
---|
2215 | #endif |
---|
2216 | Void setSliceQpDelta ( Int i ) { m_iSliceQpDelta = i; } |
---|
2217 | Void setSliceQpDeltaCb ( Int i ) { m_iSliceQpDeltaCb = i; } |
---|
2218 | Void setSliceQpDeltaCr ( Int i ) { m_iSliceQpDeltaCr = i; } |
---|
2219 | Void setDeblockingFilterDisable( Bool b ) { m_deblockingFilterDisable= b; } |
---|
2220 | Void setDeblockingFilterOverrideFlag( Bool b ) { m_deblockingFilterOverrideFlag = b; } |
---|
2221 | Void setDeblockingFilterBetaOffsetDiv2( Int i ) { m_deblockingFilterBetaOffsetDiv2 = i; } |
---|
2222 | Void setDeblockingFilterTcOffsetDiv2( Int i ) { m_deblockingFilterTcOffsetDiv2 = i; } |
---|
2223 | |
---|
2224 | Void setRefPic ( TComPic* p, RefPicList e, Int iRefIdx ) { m_apcRefPicList[e][iRefIdx] = p; } |
---|
2225 | Void setRefPOC ( Int i, RefPicList e, Int iRefIdx ) { m_aiRefPOCList[e][iRefIdx] = i; } |
---|
2226 | Void setNumRefIdx ( RefPicList e, Int i ) { m_aiNumRefIdx[e] = i; } |
---|
2227 | Void setPic ( TComPic* p ) { m_pcPic = p; } |
---|
2228 | Void setDepth ( Int iDepth ) { m_iDepth = iDepth; } |
---|
2229 | |
---|
2230 | #if H_MV |
---|
2231 | Void setPocBeforeReset ( Int i ) { m_iPOCBeforeReset = i; } |
---|
2232 | Int getPocBeforeReset ( ) { return m_iPOCBeforeReset; } |
---|
2233 | Int getRefLayerId ( RefPicList e, Int iRefIdx) { return m_aiRefLayerIdList[e][iRefIdx]; } |
---|
2234 | Void setRefLayerId ( Int i, RefPicList e, Int iRefIdx ) { m_aiRefLayerIdList[e][iRefIdx] = i; } |
---|
2235 | Void getTempRefPicLists ( TComList<TComPic*>& rcListPic, std::vector<TComPic*>& refPicSetInterLayer0, std::vector<TComPic*>& refPicSetInterLayer1, |
---|
2236 | std::vector<TComPic*> rpsCurrList[2], std::vector<Bool> usedAsLongTerm[2], Int& numPocTotalCurr, Bool checkNumPocTotalCurr = false ); |
---|
2237 | |
---|
2238 | Void setRefPicList ( std::vector<TComPic*> rpsCurrList[2], std::vector<Bool> usedAsLongTerm[2], Int numPocTotalCurr, Bool checkNumPocTotalCurr = false ); |
---|
2239 | #else |
---|
2240 | Void setRefPicList ( TComList<TComPic*>& rcListPic, Bool checkNumPocTotalCurr = false ); |
---|
2241 | #endif |
---|
2242 | Void setRefPOCList (); |
---|
2243 | Void setColFromL0Flag ( UInt colFromL0 ) { m_colFromL0Flag = colFromL0; } |
---|
2244 | Void setColRefIdx ( UInt refIdx) { m_colRefIdx = refIdx; } |
---|
2245 | Void setCheckLDC ( Bool b ) { m_bCheckLDC = b; } |
---|
2246 | Void setMvdL1ZeroFlag ( Bool b) { m_bLMvdL1Zero = b; } |
---|
2247 | |
---|
2248 | Bool isIntra () { return m_eSliceType == I_SLICE; } |
---|
2249 | Bool isInterB () { return m_eSliceType == B_SLICE; } |
---|
2250 | Bool isInterP () { return m_eSliceType == P_SLICE; } |
---|
2251 | |
---|
2252 | Void setLambdas ( const Double lambdas[3] ) { for (Int component = 0; component < 3; component++) m_lambdas[component] = lambdas[component]; } |
---|
2253 | const Double* getLambdas() const { return m_lambdas; } |
---|
2254 | |
---|
2255 | Void initEqualRef(); |
---|
2256 | Bool isEqualRef ( RefPicList e, Int iRefIdx1, Int iRefIdx2 ) |
---|
2257 | { |
---|
2258 | if (iRefIdx1 < 0 || iRefIdx2 < 0) return false; |
---|
2259 | return m_abEqualRef[e][iRefIdx1][iRefIdx2]; |
---|
2260 | } |
---|
2261 | |
---|
2262 | Void setEqualRef( RefPicList e, Int iRefIdx1, Int iRefIdx2, Bool b) |
---|
2263 | { |
---|
2264 | m_abEqualRef[e][iRefIdx1][iRefIdx2] = m_abEqualRef[e][iRefIdx2][iRefIdx1] = b; |
---|
2265 | } |
---|
2266 | |
---|
2267 | static Void sortPicList ( TComList<TComPic*>& rcListPic ); |
---|
2268 | Void setList1IdxToList0Idx(); |
---|
2269 | |
---|
2270 | UInt getTLayer () { return m_uiTLayer; } |
---|
2271 | Void setTLayer ( UInt uiTLayer ) { m_uiTLayer = uiTLayer; } |
---|
2272 | |
---|
2273 | Void setTLayerInfo( UInt uiTLayer ); |
---|
2274 | Void decodingMarking( TComList<TComPic*>& rcListPic, Int iGOPSIze, Int& iMaxRefPicNum ); |
---|
2275 | Void checkLeadingPictureRestrictions( TComList<TComPic*>& rcListPic ); |
---|
2276 | Void applyReferencePictureSet( TComList<TComPic*>& rcListPic, TComReferencePictureSet *RPSList); |
---|
2277 | #if H_MV |
---|
2278 | Void createInterLayerReferencePictureSet( TComPicLists* ivPicLists, std::vector<TComPic*>& refPicSetInterLayer0, std::vector<TComPic*>& refPicSetInterLayer1 ); |
---|
2279 | static Void markIvRefPicsAsShortTerm ( std::vector<TComPic*> refPicSetInterLayer0, std::vector<TComPic*> refPicSetInterLayer1 ); |
---|
2280 | static Void markCurrPic ( TComPic* currPic );; |
---|
2281 | static Void markIvRefPicsAsUnused ( TComPicLists* ivPicLists, std::vector<Int> targetDecLayerIdSet, TComVPS* vps, Int curLayerId, Int curPoc ); |
---|
2282 | Void printRefPicList(); |
---|
2283 | #endif |
---|
2284 | Bool isTemporalLayerSwitchingPoint( TComList<TComPic*>& rcListPic ); |
---|
2285 | Bool isStepwiseTemporalLayerSwitchingPointCandidate( TComList<TComPic*>& rcListPic ); |
---|
2286 | Int checkThatAllRefPicsAreAvailable( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool printErrors, Int pocRandomAccess = 0); |
---|
2287 | Void createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool isRAP); |
---|
2288 | |
---|
2289 | Void setMaxNumMergeCand (UInt val ) { m_maxNumMergeCand = val; } |
---|
2290 | UInt getMaxNumMergeCand () { return m_maxNumMergeCand; } |
---|
2291 | |
---|
2292 | Void setSliceMode ( UInt uiMode ) { m_sliceMode = uiMode; } |
---|
2293 | UInt getSliceMode () { return m_sliceMode; } |
---|
2294 | Void setSliceArgument ( UInt uiArgument ) { m_sliceArgument = uiArgument; } |
---|
2295 | UInt getSliceArgument () { return m_sliceArgument; } |
---|
2296 | Void setSliceCurStartCUAddr ( UInt uiAddr ) { m_sliceCurStartCUAddr = uiAddr; } |
---|
2297 | UInt getSliceCurStartCUAddr () { return m_sliceCurStartCUAddr; } |
---|
2298 | Void setSliceCurEndCUAddr ( UInt uiAddr ) { m_sliceCurEndCUAddr = uiAddr; } |
---|
2299 | UInt getSliceCurEndCUAddr () { return m_sliceCurEndCUAddr; } |
---|
2300 | Void setSliceIdx ( UInt i) { m_sliceIdx = i; } |
---|
2301 | UInt getSliceIdx () { return m_sliceIdx; } |
---|
2302 | Void copySliceInfo (TComSlice *pcSliceSrc); |
---|
2303 | Void setSliceSegmentMode ( UInt uiMode ) { m_sliceSegmentMode = uiMode; } |
---|
2304 | UInt getSliceSegmentMode () { return m_sliceSegmentMode; } |
---|
2305 | Void setSliceSegmentArgument ( UInt uiArgument ) { m_sliceSegmentArgument = uiArgument; } |
---|
2306 | UInt getSliceSegmentArgument () { return m_sliceSegmentArgument; } |
---|
2307 | Void setSliceSegmentCurStartCUAddr ( UInt uiAddr ) { m_sliceSegmentCurStartCUAddr = uiAddr; } |
---|
2308 | UInt getSliceSegmentCurStartCUAddr () { return m_sliceSegmentCurStartCUAddr; } |
---|
2309 | Void setSliceSegmentCurEndCUAddr ( UInt uiAddr ) { m_sliceSegmentCurEndCUAddr = uiAddr; } |
---|
2310 | UInt getSliceSegmentCurEndCUAddr () { return m_sliceSegmentCurEndCUAddr; } |
---|
2311 | Void setNextSlice ( Bool b ) { m_nextSlice = b; } |
---|
2312 | Bool isNextSlice () { return m_nextSlice; } |
---|
2313 | Void setNextSliceSegment ( Bool b ) { m_nextSliceSegment = b; } |
---|
2314 | Bool isNextSliceSegment () { return m_nextSliceSegment; } |
---|
2315 | Void setSliceBits ( UInt uiVal ) { m_sliceBits = uiVal; } |
---|
2316 | UInt getSliceBits () { return m_sliceBits; } |
---|
2317 | Void setSliceSegmentBits ( UInt uiVal ) { m_sliceSegmentBits = uiVal; } |
---|
2318 | UInt getSliceSegmentBits () { return m_sliceSegmentBits; } |
---|
2319 | Void setFinalized ( Bool uiVal ) { m_bFinalized = uiVal; } |
---|
2320 | Bool getFinalized () { return m_bFinalized; } |
---|
2321 | Void setWpScaling ( wpScalingParam wp[2][MAX_NUM_REF][3] ) { memcpy(m_weightPredTable, wp, sizeof(wpScalingParam)*2*MAX_NUM_REF*3); } |
---|
2322 | Void getWpScaling ( RefPicList e, Int iRefIdx, wpScalingParam *&wp); |
---|
2323 | |
---|
2324 | Void resetWpScaling (); |
---|
2325 | Void initWpScaling (); |
---|
2326 | inline Bool applyWP () { return( (m_eSliceType==P_SLICE && m_pcPPS->getUseWP()) || (m_eSliceType==B_SLICE && m_pcPPS->getWPBiPred()) ); } |
---|
2327 | |
---|
2328 | Void setWpAcDcParam ( wpACDCParam wp[3] ) { memcpy(m_weightACDCParam, wp, sizeof(wpACDCParam)*3); } |
---|
2329 | Void getWpAcDcParam ( wpACDCParam *&wp ); |
---|
2330 | Void initWpAcDcParam (); |
---|
2331 | |
---|
2332 | Void setTileLocationCount ( UInt cnt ) { return m_tileByteLocation.resize(cnt); } |
---|
2333 | UInt getTileLocationCount () { return (UInt) m_tileByteLocation.size(); } |
---|
2334 | Void setTileLocation ( Int idx, UInt location ) { assert (idx<m_tileByteLocation.size()); |
---|
2335 | m_tileByteLocation[idx] = location; } |
---|
2336 | Void addTileLocation ( UInt location ) { m_tileByteLocation.push_back(location); } |
---|
2337 | UInt getTileLocation ( Int idx ) { return m_tileByteLocation[idx]; } |
---|
2338 | |
---|
2339 | Void setTileOffstForMultES (UInt uiOffset ) { m_uiTileOffstForMultES = uiOffset; } |
---|
2340 | UInt getTileOffstForMultES () { return m_uiTileOffstForMultES; } |
---|
2341 | Void allocSubstreamSizes ( UInt uiNumSubstreams ); |
---|
2342 | UInt* getSubstreamSizes () { return m_puiSubstreamSizes; } |
---|
2343 | Void setScalingList ( TComScalingList* scalingList ) { m_scalingList = scalingList; } |
---|
2344 | TComScalingList* getScalingList () { return m_scalingList; } |
---|
2345 | Void setDefaultScalingList (); |
---|
2346 | Bool checkDefaultScalingList (); |
---|
2347 | Void setCabacInitFlag ( Bool val ) { m_cabacInitFlag = val; } //!< set CABAC initial flag |
---|
2348 | Bool getCabacInitFlag () { return m_cabacInitFlag; } //!< get CABAC initial flag |
---|
2349 | Void setNumEntryPointOffsets(Int val) { m_numEntryPointOffsets = val; } |
---|
2350 | Int getNumEntryPointOffsets() { return m_numEntryPointOffsets; } |
---|
2351 | Bool getTemporalLayerNonReferenceFlag() { return m_temporalLayerNonReferenceFlag;} |
---|
2352 | Void setTemporalLayerNonReferenceFlag(Bool x) { m_temporalLayerNonReferenceFlag = x;} |
---|
2353 | Void setLFCrossSliceBoundaryFlag ( Bool val ) { m_LFCrossSliceBoundaryFlag = val; } |
---|
2354 | Bool getLFCrossSliceBoundaryFlag () { return m_LFCrossSliceBoundaryFlag;} |
---|
2355 | |
---|
2356 | Void setEnableTMVPFlag ( Bool b ) { m_enableTMVPFlag = b; } |
---|
2357 | Bool getEnableTMVPFlag () { return m_enableTMVPFlag;} |
---|
2358 | |
---|
2359 | #if H_MV |
---|
2360 | Void setLayerId ( Int layerId ) { m_layerId = layerId; } |
---|
2361 | Int getLayerId () { return m_layerId; } |
---|
2362 | Int getLayerIdInVps () { return getVPS()->getLayerIdInVps( m_layerId ); }; |
---|
2363 | Void setViewId ( Int viewId ) { m_viewId = viewId; } |
---|
2364 | Int getViewId () { return m_viewId; } |
---|
2365 | Void setViewIndex ( Int viewIndex ) { m_viewIndex = viewIndex; } |
---|
2366 | Int getViewIndex () { return m_viewIndex; } |
---|
2367 | #if H_3D |
---|
2368 | #if H_3D_TMVP |
---|
2369 | Void generateAlterRefforTMVP (); |
---|
2370 | Void setAlterRefIdx ( RefPicList e, Int i ) { m_aiAlterRefIdx[e] = i; } |
---|
2371 | Int getAlterRefIdx ( RefPicList e ) { return m_aiAlterRefIdx[e]; } |
---|
2372 | #endif |
---|
2373 | #if H_3D_ARP |
---|
2374 | Int getFirstTRefIdx ( RefPicList e ) { return m_aiFirstTRefIdx[e]; } |
---|
2375 | Void setFirstTRefIdx ( RefPicList e, Int i ) { m_aiFirstTRefIdx[e] = i; } |
---|
2376 | Bool getArpRefPicAvailable( RefPicList e, Int viewIdx) {return m_arpRefPicAvailable[e][getVPS()->getLayerIdInNuh(viewIdx, 0)]; } |
---|
2377 | #endif |
---|
2378 | Void setIsDepth ( Bool isDepth ) { m_isDepth = isDepth; } |
---|
2379 | Bool getIsDepth () { return m_isDepth; } |
---|
2380 | Void setCamparaSlice ( Int** aaiScale = 0, Int** aaiOffset = 0 ); |
---|
2381 | Int* getCodedScale () { return m_aaiCodedScale [0]; } |
---|
2382 | Int* getCodedOffset () { return m_aaiCodedOffset[0]; } |
---|
2383 | Int* getInvCodedScale () { return m_aaiCodedScale [1]; } |
---|
2384 | Int* getInvCodedOffset () { return m_aaiCodedOffset[1]; } |
---|
2385 | #endif |
---|
2386 | #endif |
---|
2387 | #if H_3D |
---|
2388 | Void setIvPicLists( TComPicLists* m_ivPicLists ); |
---|
2389 | Void setDepthToDisparityLUTs(); |
---|
2390 | |
---|
2391 | Int* getDepthToDisparityB( Int refViewIdx ) { return m_depthToDisparityB[ refViewIdx ]; }; |
---|
2392 | Int* getDepthToDisparityF( Int refViewIdx ) { return m_depthToDisparityF[ refViewIdx ]; }; |
---|
2393 | Bool getVpsDepthModesFlag () { return getVPS()->getVpsDepthModesFlag( getVPS()->getLayerIdInVps( m_layerId ) ); } |
---|
2394 | |
---|
2395 | #endif |
---|
2396 | #if H_MV |
---|
2397 | // Additional slice header syntax elements |
---|
2398 | |
---|
2399 | Void setCrossLayerBlaFlag( Bool flag ) { m_crossLayerBlaFlag = flag; } |
---|
2400 | Bool getCrossLayerBlaFlag( ) { return m_crossLayerBlaFlag; } |
---|
2401 | Void checkCrossLayerBlaFlag ( ) |
---|
2402 | { |
---|
2403 | // cross_layer_bla_flag shall be equal to 0 for pictures with nal_unit_type not equal to IDR_W_RADL or IDR_N_LP or with nuh_layer_id not equal to 0. |
---|
2404 | if ( getLayerId() != 0 || getNalUnitType() != NAL_UNIT_CODED_SLICE_IDR_W_RADL || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP ) |
---|
2405 | { |
---|
2406 | assert( m_crossLayerBlaFlag == 0 ); |
---|
2407 | } |
---|
2408 | } |
---|
2409 | |
---|
2410 | #if !H_MV_HLS7_GEN |
---|
2411 | Void setPocResetFlag( Bool flag ) { m_pocResetFlag = flag; } |
---|
2412 | Bool getPocResetFlag( ) { return m_pocResetFlag; } |
---|
2413 | #endif |
---|
2414 | |
---|
2415 | Void setDiscardableFlag( Bool flag ) { m_discardableFlag = flag; } |
---|
2416 | Bool getDiscardableFlag( ) { return m_discardableFlag; } |
---|
2417 | |
---|
2418 | Void setInterLayerPredEnabledFlag( Bool flag ) { m_interLayerPredEnabledFlag = flag; } |
---|
2419 | Bool getInterLayerPredEnabledFlag( ) { return m_interLayerPredEnabledFlag; } |
---|
2420 | |
---|
2421 | Void setNumInterLayerRefPicsMinus1( Int val ) { m_numInterLayerRefPicsMinus1 = val; } |
---|
2422 | Int getNumInterLayerRefPicsMinus1( ) { return m_numInterLayerRefPicsMinus1; } |
---|
2423 | |
---|
2424 | Void setInterLayerPredLayerIdc( Int i, Int val ) { m_interLayerPredLayerIdc[i] = val; } |
---|
2425 | Int getInterLayerPredLayerIdc( Int i ) { return m_interLayerPredLayerIdc[i]; } |
---|
2426 | |
---|
2427 | Void setSliceSegmentHeaderExtensionLength( Int val ) { m_sliceSegmentHeaderExtensionLength = val; } |
---|
2428 | Int getSliceSegmentHeaderExtensionLength( ) { return m_sliceSegmentHeaderExtensionLength; } |
---|
2429 | |
---|
2430 | Void setPocResetIdc( Int val ) { m_pocResetIdc = val; } |
---|
2431 | Int getPocResetIdc( ) { return m_pocResetIdc; } |
---|
2432 | |
---|
2433 | Void setPocResetPeriodId( Int val ) { m_pocResetPeriodId = val; } |
---|
2434 | Int getPocResetPeriodId( ) { return m_pocResetPeriodId; } |
---|
2435 | |
---|
2436 | Void setFullPocResetFlag( Bool flag ) { m_fullPocResetFlag = flag; } |
---|
2437 | Bool getFullPocResetFlag( ) { return m_fullPocResetFlag; } |
---|
2438 | |
---|
2439 | Void setPocLsbVal( Int val ) { m_pocLsbVal = val; } |
---|
2440 | Int getPocLsbVal( ) { return m_pocLsbVal; } |
---|
2441 | |
---|
2442 | Void setPocMsbValPresentFlag( Bool flag ) { m_pocMsbValPresentFlag = flag; } |
---|
2443 | Bool getPocMsbValPresentFlag( ) { return m_pocMsbValPresentFlag; } |
---|
2444 | |
---|
2445 | Void setPocMsbVal( Int val ) { m_pocMsbVal = val; } |
---|
2446 | Int getPocMsbVal( ) { return m_pocMsbVal; } |
---|
2447 | |
---|
2448 | Bool getPocMsbValRequiredFlag() { return m_pocMsbValRequiredFlag; } |
---|
2449 | Void setPocMsbValRequiredFlag(Bool x) { m_pocMsbValRequiredFlag = x; } |
---|
2450 | |
---|
2451 | UInt getPocLsbValLen() { return getSPS()->getBitsForPOC(); }; //log2_max_pic_order_cnt_lsb_minus4 + 4 |
---|
2452 | |
---|
2453 | Bool getBlaPicFlag () |
---|
2454 | { |
---|
2455 | return getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP |
---|
2456 | || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL |
---|
2457 | || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP; |
---|
2458 | } |
---|
2459 | Bool getCraPicFlag () |
---|
2460 | { |
---|
2461 | return getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA; |
---|
2462 | } |
---|
2463 | |
---|
2464 | // Additional variables derived in slice header semantics |
---|
2465 | Int getNumInterLayerRefPicsMinus1Len( ) { return gCeilLog2( getVPS()->getNumDirectRefLayers( getLayerId() )); } |
---|
2466 | Int getInterLayerPredLayerIdcLen ( ) { return gCeilLog2( getVPS()->getNumDirectRefLayers( getLayerId() )); } |
---|
2467 | |
---|
2468 | Int getRefLayerPicFlag( Int i ); |
---|
2469 | Int getRefLayerPicIdc ( Int j ); |
---|
2470 | Int getNumRefLayerPics( ); |
---|
2471 | |
---|
2472 | Int getNumActiveRefLayerPics( ); |
---|
2473 | |
---|
2474 | Int getNumActiveRefLayerPics0( ) { return (Int) m_refPicSetInterLayer0->size(); }; |
---|
2475 | Int getNumActiveRefLayerPics1( ) { return (Int) m_refPicSetInterLayer1->size(); }; |
---|
2476 | |
---|
2477 | Int getRefPicLayerId ( Int i ); |
---|
2478 | |
---|
2479 | Void setRefPicSetInterLayer ( std::vector<TComPic*>* refPicSetInterLayer0, std::vector<TComPic*>* refPicSetInterLayer1); |
---|
2480 | TComPic* getPicFromRefPicSetInterLayer( Int setIdc, Int layerId ); |
---|
2481 | |
---|
2482 | #endif |
---|
2483 | #if H_3D_DDD |
---|
2484 | Void InitializeDDDPara( UInt uiCamParsCodedPrecision, Int iCodedScale,Int iCodedOffset, Int iBaseViewIdx ); |
---|
2485 | Int getDepthFromDV( Int iDV, Int iBaseViewIdx ) |
---|
2486 | { |
---|
2487 | return ClipY(( iDV * m_aiDDDInvScale[ iBaseViewIdx ] + m_aiDDDInvOffset[ iBaseViewIdx ] ) >> m_aiDDDShift[ iBaseViewIdx ]); |
---|
2488 | } |
---|
2489 | #endif |
---|
2490 | |
---|
2491 | protected: |
---|
2492 | TComPic* xGetRefPic (TComList<TComPic*>& rcListPic, |
---|
2493 | Int poc); |
---|
2494 | TComPic* xGetLongTermRefPic(TComList<TComPic*>& rcListPic, Int poc, Bool pocHasMsb); |
---|
2495 | #if H_MV |
---|
2496 | TComPic* xGetInterLayerRefPic( std::vector<TComPic*>& rcListIlPic, Int layerId ); |
---|
2497 | #endif |
---|
2498 | };// END CLASS DEFINITION TComSlice |
---|
2499 | |
---|
2500 | |
---|
2501 | template <class T> class ParameterSetMap |
---|
2502 | { |
---|
2503 | public: |
---|
2504 | ParameterSetMap(Int maxId) |
---|
2505 | :m_maxId (maxId) |
---|
2506 | {} |
---|
2507 | |
---|
2508 | ~ParameterSetMap() |
---|
2509 | { |
---|
2510 | for (typename std::map<Int,T *>::iterator i = m_paramsetMap.begin(); i!= m_paramsetMap.end(); i++) |
---|
2511 | { |
---|
2512 | delete (*i).second; |
---|
2513 | } |
---|
2514 | } |
---|
2515 | |
---|
2516 | Void storePS(Int psId, T *ps) |
---|
2517 | { |
---|
2518 | assert ( psId < m_maxId ); |
---|
2519 | if ( m_paramsetMap.find(psId) != m_paramsetMap.end() ) |
---|
2520 | { |
---|
2521 | delete m_paramsetMap[psId]; |
---|
2522 | } |
---|
2523 | m_paramsetMap[psId] = ps; |
---|
2524 | } |
---|
2525 | |
---|
2526 | Void mergePSList(ParameterSetMap<T> &rPsList) |
---|
2527 | { |
---|
2528 | for (typename std::map<Int,T *>::iterator i = rPsList.m_paramsetMap.begin(); i!= rPsList.m_paramsetMap.end(); i++) |
---|
2529 | { |
---|
2530 | storePS(i->first, i->second); |
---|
2531 | } |
---|
2532 | rPsList.m_paramsetMap.clear(); |
---|
2533 | } |
---|
2534 | |
---|
2535 | |
---|
2536 | T* getPS(Int psId) |
---|
2537 | { |
---|
2538 | return ( m_paramsetMap.find(psId) == m_paramsetMap.end() ) ? NULL : m_paramsetMap[psId]; |
---|
2539 | } |
---|
2540 | |
---|
2541 | T* getFirstPS() |
---|
2542 | { |
---|
2543 | return (m_paramsetMap.begin() == m_paramsetMap.end() ) ? NULL : m_paramsetMap.begin()->second; |
---|
2544 | } |
---|
2545 | |
---|
2546 | private: |
---|
2547 | std::map<Int,T *> m_paramsetMap; |
---|
2548 | Int m_maxId; |
---|
2549 | }; |
---|
2550 | |
---|
2551 | class ParameterSetManager |
---|
2552 | { |
---|
2553 | public: |
---|
2554 | ParameterSetManager(); |
---|
2555 | virtual ~ParameterSetManager(); |
---|
2556 | |
---|
2557 | //! store sequence parameter set and take ownership of it |
---|
2558 | Void storeVPS(TComVPS *vps) { m_vpsMap.storePS( vps->getVPSId(), vps); }; |
---|
2559 | //! get pointer to existing video parameter set |
---|
2560 | TComVPS* getVPS(Int vpsId) { return m_vpsMap.getPS(vpsId); }; |
---|
2561 | TComVPS* getFirstVPS() { return m_vpsMap.getFirstPS(); }; |
---|
2562 | |
---|
2563 | //! store sequence parameter set and take ownership of it |
---|
2564 | Void storeSPS(TComSPS *sps) { m_spsMap.storePS( sps->getSPSId(), sps); }; |
---|
2565 | //! get pointer to existing sequence parameter set |
---|
2566 | TComSPS* getSPS(Int spsId) { return m_spsMap.getPS(spsId); }; |
---|
2567 | TComSPS* getFirstSPS() { return m_spsMap.getFirstPS(); }; |
---|
2568 | |
---|
2569 | //! store picture parameter set and take ownership of it |
---|
2570 | Void storePPS(TComPPS *pps) { m_ppsMap.storePS( pps->getPPSId(), pps); }; |
---|
2571 | //! get pointer to existing picture parameter set |
---|
2572 | TComPPS* getPPS(Int ppsId) { return m_ppsMap.getPS(ppsId); }; |
---|
2573 | TComPPS* getFirstPPS() { return m_ppsMap.getFirstPS(); }; |
---|
2574 | |
---|
2575 | //! activate a SPS from a active parameter sets SEI message |
---|
2576 | //! \returns true, if activation is successful |
---|
2577 | #if H_MV |
---|
2578 | Bool activateSPSWithSEI(Int SPSId, Int layerId ); |
---|
2579 | #else |
---|
2580 | Bool activateSPSWithSEI(Int SPSId); |
---|
2581 | #endif |
---|
2582 | |
---|
2583 | //! activate a PPS and depending on isIDR parameter also SPS and VPS |
---|
2584 | //! \returns true, if activation is successful |
---|
2585 | #if H_MV |
---|
2586 | Bool activatePPS(Int ppsId, Bool isIRAP, Int layerId ); |
---|
2587 | #else |
---|
2588 | Bool activatePPS(Int ppsId, Bool isIRAP); |
---|
2589 | #endif |
---|
2590 | |
---|
2591 | TComVPS* getActiveVPS(){ return m_vpsMap.getPS(m_activeVPSId); }; |
---|
2592 | #if H_MV |
---|
2593 | TComSPS* getActiveSPS( Int layerId ){ return m_spsMap.getPS( m_activeSPSId[ layerId ] ); }; |
---|
2594 | TComPPS* getActivePPS( Int layerId ){ return m_ppsMap.getPS( m_activePPSId[ layerId ] ); }; |
---|
2595 | #else |
---|
2596 | TComSPS* getActiveSPS(){ return m_spsMap.getPS(m_activeSPSId); }; |
---|
2597 | TComPPS* getActivePPS(){ return m_ppsMap.getPS(m_activePPSId); }; |
---|
2598 | #endif |
---|
2599 | protected: |
---|
2600 | |
---|
2601 | ParameterSetMap<TComVPS> m_vpsMap; |
---|
2602 | ParameterSetMap<TComSPS> m_spsMap; |
---|
2603 | ParameterSetMap<TComPPS> m_ppsMap; |
---|
2604 | |
---|
2605 | Int m_activeVPSId; |
---|
2606 | #if H_MV |
---|
2607 | Int m_activeSPSId[ MAX_NUM_LAYERS ]; |
---|
2608 | Int m_activePPSId[ MAX_NUM_LAYERS ]; |
---|
2609 | #else |
---|
2610 | Int m_activeSPSId; |
---|
2611 | Int m_activePPSId; |
---|
2612 | #endif |
---|
2613 | |
---|
2614 | }; |
---|
2615 | |
---|
2616 | //! \} |
---|
2617 | |
---|
2618 | #endif // __TCOMSLICE__ |
---|