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