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