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[NUM_CHROMA_FORMAT]; |
---|
1432 | static const Int m_winUnitY[NUM_CHROMA_FORMAT]; |
---|
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 < NUM_CHROMA_FORMAT); return m_winUnitX[chromaFormatIdc]; } |
---|
1468 | static Int getWinUnitY (Int chromaFormatIdc) { assert (chromaFormatIdc >= 0 && chromaFormatIdc < NUM_CHROMA_FORMAT); 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 | const TComPTL* getPTL() const { return &m_pcPTL; } |
---|
1578 | TComPTL* getPTL() { return &m_pcPTL; } |
---|
1579 | |
---|
1580 | const TComSPSRExt& getSpsRangeExtension() const { return m_spsRangeExtension; } |
---|
1581 | TComSPSRExt& getSpsRangeExtension() { return m_spsRangeExtension; } |
---|
1582 | |
---|
1583 | // Sequence parameter set range extension syntax |
---|
1584 | // WAS: getUseResidualRotation and setUseResidualRotation |
---|
1585 | // Now getSpsRangeExtension().getTransformSkipRotationEnabledFlag and getSpsRangeExtension().setTransformSkipRotationEnabledFlag |
---|
1586 | |
---|
1587 | // WAS: getUseSingleSignificanceMapContext and setUseSingleSignificanceMapContext |
---|
1588 | // Now: getSpsRangeExtension().getTransformSkipContextEnabledFlag and getSpsRangeExtension().setTransformSkipContextEnabledFlag |
---|
1589 | |
---|
1590 | // WAS: getUseResidualDPCM and setUseResidualDPCM |
---|
1591 | // Now: getSpsRangeExtension().getRdpcmEnabledFlag and getSpsRangeExtension().setRdpcmEnabledFlag and |
---|
1592 | |
---|
1593 | // WAS: getUseExtendedPrecision and setUseExtendedPrecision |
---|
1594 | // Now: getSpsRangeExtension().getExtendedPrecisionProcessingFlag and getSpsRangeExtension().setExtendedPrecisionProcessingFlag |
---|
1595 | |
---|
1596 | // WAS: getDisableIntraReferenceSmoothing and setDisableIntraReferenceSmoothing |
---|
1597 | // Now: getSpsRangeExtension().getIntraSmoothingDisabledFlag and getSpsRangeExtension().setIntraSmoothingDisabledFlag |
---|
1598 | |
---|
1599 | // WAS: getUseHighPrecisionPredictionWeighting and setUseHighPrecisionPredictionWeighting |
---|
1600 | // Now: getSpsRangeExtension().getHighPrecisionOffsetsEnabledFlag and getSpsRangeExtension().setHighPrecisionOffsetsEnabledFlag |
---|
1601 | |
---|
1602 | // WAS: getUseGolombRiceParameterAdaptation and setUseGolombRiceParameterAdaptation |
---|
1603 | // Now: getSpsRangeExtension().getPersistentRiceAdaptationEnabledFlag and getSpsRangeExtension().setPersistentRiceAdaptationEnabledFlag |
---|
1604 | |
---|
1605 | // WAS: getAlignCABACBeforeBypass and setAlignCABACBeforeBypass |
---|
1606 | // Now: getSpsRangeExtension().getCabacBypassAlignmentEnabledFlag and getSpsRangeExtension().setCabacBypassAlignmentEnabledFlag |
---|
1607 | |
---|
1608 | #if SVC_EXTENSION |
---|
1609 | Void setLayerId(UInt layerId) { m_layerId = layerId; } |
---|
1610 | UInt getLayerId() const { return m_layerId; } |
---|
1611 | Int getExtensionFlag() const { return m_extensionFlag; } |
---|
1612 | Void setExtensionFlag(Int n) { m_extensionFlag = n; } |
---|
1613 | Bool getMultiLayerExtSpsFlag() const { return m_multiLayerExtSpsFlag; } |
---|
1614 | Void setMultiLayerExtSpsFlag(Bool flag) { m_multiLayerExtSpsFlag = flag; } |
---|
1615 | |
---|
1616 | //These two functions shall be used / called when the syntax element sps_ext_or_max_sub_layers_minus1 and V1CompatibleSPSFlag are implemented |
---|
1617 | Bool getV1CompatibleSPSFlag() const { return m_bV1CompatibleSPSFlag; } |
---|
1618 | Void setV1CompatibleSPSFlag(Bool x) { m_bV1CompatibleSPSFlag = x; } |
---|
1619 | |
---|
1620 | Int getNumDirectRefLayers() const { return m_NumDirectRefLayers; } |
---|
1621 | Void setNumDirectRefLayers(Int n) { m_NumDirectRefLayers = n; } |
---|
1622 | Bool getUpdateRepFormatFlag() const { return m_updateRepFormatFlag; } |
---|
1623 | Void setUpdateRepFormatFlag(Bool x) { m_updateRepFormatFlag = x; } |
---|
1624 | Int getUpdateRepFormatIndex() const { return m_updateRepFormatIndex; } |
---|
1625 | Void setUpdateRepFormatIndex(UInt index) { m_updateRepFormatIndex = index; } |
---|
1626 | Bool getInferScalingListFlag() const { return m_inferScalingListFlag; } |
---|
1627 | UInt getScalingListRefLayerId() const { return m_scalingListRefLayerId; } |
---|
1628 | Void setInferScalingListFlag( Bool flag ) { m_inferScalingListFlag = flag; } |
---|
1629 | Void setScalingListRefLayerId( UInt layerId ) { m_scalingListRefLayerId = layerId; } |
---|
1630 | #endif //SVC_EXTENSION |
---|
1631 | }; |
---|
1632 | |
---|
1633 | |
---|
1634 | /// Reference Picture Lists class |
---|
1635 | |
---|
1636 | class TComRefPicListModification |
---|
1637 | { |
---|
1638 | private: |
---|
1639 | Bool m_refPicListModificationFlagL0; |
---|
1640 | Bool m_refPicListModificationFlagL1; |
---|
1641 | UInt m_RefPicSetIdxL0[REF_PIC_LIST_NUM_IDX]; |
---|
1642 | UInt m_RefPicSetIdxL1[REF_PIC_LIST_NUM_IDX]; |
---|
1643 | |
---|
1644 | public: |
---|
1645 | TComRefPicListModification(); |
---|
1646 | virtual ~TComRefPicListModification(); |
---|
1647 | |
---|
1648 | Void create(); |
---|
1649 | Void destroy(); |
---|
1650 | |
---|
1651 | Bool getRefPicListModificationFlagL0() const { return m_refPicListModificationFlagL0; } |
---|
1652 | Void setRefPicListModificationFlagL0(Bool flag) { m_refPicListModificationFlagL0 = flag; } |
---|
1653 | Bool getRefPicListModificationFlagL1() const { return m_refPicListModificationFlagL1; } |
---|
1654 | Void setRefPicListModificationFlagL1(Bool flag) { m_refPicListModificationFlagL1 = flag; } |
---|
1655 | UInt getRefPicSetIdxL0(UInt idx) const { assert(idx<REF_PIC_LIST_NUM_IDX); return m_RefPicSetIdxL0[idx]; } |
---|
1656 | Void setRefPicSetIdxL0(UInt idx, UInt refPicSetIdx) { assert(idx<REF_PIC_LIST_NUM_IDX); m_RefPicSetIdxL0[idx] = refPicSetIdx; } |
---|
1657 | UInt getRefPicSetIdxL1(UInt idx) const { assert(idx<REF_PIC_LIST_NUM_IDX); return m_RefPicSetIdxL1[idx]; } |
---|
1658 | Void setRefPicSetIdxL1(UInt idx, UInt refPicSetIdx) { assert(idx<REF_PIC_LIST_NUM_IDX); m_RefPicSetIdxL1[idx] = refPicSetIdx; } |
---|
1659 | }; |
---|
1660 | |
---|
1661 | |
---|
1662 | |
---|
1663 | /// PPS RExt class |
---|
1664 | class TComPPSRExt // Names aligned to text specification |
---|
1665 | { |
---|
1666 | private: |
---|
1667 | Int m_log2MaxTransformSkipBlockSize; |
---|
1668 | Bool m_crossComponentPredictionEnabledFlag; |
---|
1669 | |
---|
1670 | // Chroma QP Adjustments |
---|
1671 | Int m_diffCuChromaQpOffsetDepth; |
---|
1672 | Int m_chromaQpOffsetListLen; // size (excludes the null entry used in the following array). |
---|
1673 | 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 |
---|
1674 | |
---|
1675 | UInt m_log2SaoOffsetScale[MAX_NUM_CHANNEL_TYPE]; |
---|
1676 | |
---|
1677 | public: |
---|
1678 | TComPPSRExt(); |
---|
1679 | |
---|
1680 | Bool settingsDifferFromDefaults(const bool bTransformSkipEnabledFlag) const |
---|
1681 | { |
---|
1682 | return (bTransformSkipEnabledFlag && (getLog2MaxTransformSkipBlockSize() !=2)) |
---|
1683 | || (getCrossComponentPredictionEnabledFlag() ) |
---|
1684 | || (getChromaQpOffsetListEnabledFlag() ) |
---|
1685 | || (getLog2SaoOffsetScale(CHANNEL_TYPE_LUMA) !=0 ) |
---|
1686 | || (getLog2SaoOffsetScale(CHANNEL_TYPE_CHROMA) !=0 ); |
---|
1687 | } |
---|
1688 | |
---|
1689 | UInt getLog2MaxTransformSkipBlockSize() const { return m_log2MaxTransformSkipBlockSize; } |
---|
1690 | Void setLog2MaxTransformSkipBlockSize( UInt u ) { m_log2MaxTransformSkipBlockSize = u; } |
---|
1691 | |
---|
1692 | Bool getCrossComponentPredictionEnabledFlag() const { return m_crossComponentPredictionEnabledFlag; } |
---|
1693 | Void setCrossComponentPredictionEnabledFlag(Bool value) { m_crossComponentPredictionEnabledFlag = value; } |
---|
1694 | |
---|
1695 | Void clearChromaQpOffsetList() { m_chromaQpOffsetListLen = 0; } |
---|
1696 | |
---|
1697 | UInt getDiffCuChromaQpOffsetDepth () const { return m_diffCuChromaQpOffsetDepth; } |
---|
1698 | Void setDiffCuChromaQpOffsetDepth ( UInt u ) { m_diffCuChromaQpOffsetDepth = u; } |
---|
1699 | |
---|
1700 | Bool getChromaQpOffsetListEnabledFlag() const { return getChromaQpOffsetListLen()>0; } |
---|
1701 | Int getChromaQpOffsetListLen() const { return m_chromaQpOffsetListLen; } |
---|
1702 | |
---|
1703 | const ChromaQpAdj& getChromaQpOffsetListEntry( Int cuChromaQpOffsetIdxPlus1 ) const |
---|
1704 | { |
---|
1705 | assert(cuChromaQpOffsetIdxPlus1 < m_chromaQpOffsetListLen+1); |
---|
1706 | 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 |
---|
1707 | } |
---|
1708 | |
---|
1709 | Void setChromaQpOffsetListEntry( Int cuChromaQpOffsetIdxPlus1, Int cbOffset, Int crOffset ) |
---|
1710 | { |
---|
1711 | assert (cuChromaQpOffsetIdxPlus1 != 0 && cuChromaQpOffsetIdxPlus1 <= MAX_QP_OFFSET_LIST_SIZE); |
---|
1712 | 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 |
---|
1713 | m_ChromaQpAdjTableIncludingNullEntry[cuChromaQpOffsetIdxPlus1].u.comp.CrOffset = crOffset; |
---|
1714 | m_chromaQpOffsetListLen = max(m_chromaQpOffsetListLen, cuChromaQpOffsetIdxPlus1); |
---|
1715 | } |
---|
1716 | |
---|
1717 | // Now: getPpsRangeExtension().getLog2SaoOffsetScale and getPpsRangeExtension().setLog2SaoOffsetScale |
---|
1718 | UInt getLog2SaoOffsetScale(ChannelType type) const { return m_log2SaoOffsetScale[type]; } |
---|
1719 | Void setLog2SaoOffsetScale(ChannelType type, UInt uiBitShift) { m_log2SaoOffsetScale[type] = uiBitShift; } |
---|
1720 | |
---|
1721 | }; |
---|
1722 | |
---|
1723 | |
---|
1724 | /// PPS class |
---|
1725 | class TComPPS |
---|
1726 | { |
---|
1727 | private: |
---|
1728 | Int m_PPSId; // pic_parameter_set_id |
---|
1729 | Int m_SPSId; // seq_parameter_set_id |
---|
1730 | Int m_picInitQPMinus26; |
---|
1731 | Bool m_useDQP; |
---|
1732 | Bool m_bConstrainedIntraPred; // constrained_intra_pred_flag |
---|
1733 | Bool m_bSliceChromaQpFlag; // slicelevel_chroma_qp_flag |
---|
1734 | |
---|
1735 | // access channel |
---|
1736 | UInt m_uiMaxCuDQPDepth; |
---|
1737 | |
---|
1738 | Int m_chromaCbQpOffset; |
---|
1739 | Int m_chromaCrQpOffset; |
---|
1740 | |
---|
1741 | UInt m_numRefIdxL0DefaultActive; |
---|
1742 | UInt m_numRefIdxL1DefaultActive; |
---|
1743 | |
---|
1744 | Bool m_bUseWeightPred; //!< Use of Weighting Prediction (P_SLICE) |
---|
1745 | Bool m_useWeightedBiPred; //!< Use of Weighting Bi-Prediction (B_SLICE) |
---|
1746 | Bool m_OutputFlagPresentFlag; //!< Indicates the presence of output_flag in slice header |
---|
1747 | Bool m_TransquantBypassEnableFlag; //!< Indicates presence of cu_transquant_bypass_flag in CUs. |
---|
1748 | Bool m_useTransformSkip; |
---|
1749 | Bool m_dependentSliceSegmentsEnabledFlag; //!< Indicates the presence of dependent slices |
---|
1750 | Bool m_tilesEnabledFlag; //!< Indicates the presence of tiles |
---|
1751 | Bool m_entropyCodingSyncEnabledFlag; //!< Indicates the presence of wavefronts |
---|
1752 | |
---|
1753 | Bool m_loopFilterAcrossTilesEnabledFlag; |
---|
1754 | Bool m_uniformSpacingFlag; |
---|
1755 | Int m_numTileColumnsMinus1; |
---|
1756 | Int m_numTileRowsMinus1; |
---|
1757 | std::vector<Int> m_tileColumnWidth; |
---|
1758 | std::vector<Int> m_tileRowHeight; |
---|
1759 | |
---|
1760 | Bool m_signHideFlag; |
---|
1761 | |
---|
1762 | Bool m_cabacInitPresentFlag; |
---|
1763 | |
---|
1764 | Bool m_sliceHeaderExtensionPresentFlag; |
---|
1765 | Bool m_loopFilterAcrossSlicesEnabledFlag; |
---|
1766 | Bool m_deblockingFilterControlPresentFlag; |
---|
1767 | Bool m_deblockingFilterOverrideEnabledFlag; |
---|
1768 | Bool m_picDisableDeblockingFilterFlag; |
---|
1769 | Int m_deblockingFilterBetaOffsetDiv2; //< beta offset for deblocking filter |
---|
1770 | Int m_deblockingFilterTcOffsetDiv2; //< tc offset for deblocking filter |
---|
1771 | Bool m_scalingListPresentFlag; |
---|
1772 | TComScalingList m_scalingList; //!< ScalingList class |
---|
1773 | Bool m_listsModificationPresentFlag; |
---|
1774 | UInt m_log2ParallelMergeLevelMinus2; |
---|
1775 | Int m_numExtraSliceHeaderBits; |
---|
1776 | |
---|
1777 | TComPPSRExt m_ppsRangeExtension; |
---|
1778 | |
---|
1779 | #if SVC_EXTENSION |
---|
1780 | Bool m_extensionFlag; |
---|
1781 | UInt m_layerId; |
---|
1782 | Bool m_inferScalingListFlag; |
---|
1783 | UInt m_scalingListRefLayerId; |
---|
1784 | Bool m_pocResetInfoPresentFlag; |
---|
1785 | UInt m_numRefLayerLocationOffsets; |
---|
1786 | UInt m_refLocationOffsetLayerId[MAX_LAYERS]; |
---|
1787 | Window m_scaledRefLayerWindow[MAX_LAYERS]; |
---|
1788 | Window m_refLayerWindow[MAX_LAYERS]; |
---|
1789 | Bool m_scaledRefLayerOffsetPresentFlag[MAX_LAYERS]; |
---|
1790 | Bool m_refRegionOffsetPresentFlag[MAX_LAYERS]; |
---|
1791 | ResamplingPhase m_resamplingPhase[MAX_LAYERS]; |
---|
1792 | #if CGS_3D_ASYMLUT |
---|
1793 | Int m_nCGSFlag; |
---|
1794 | Int m_nCGSOutputBitDepthY; // not for syntax |
---|
1795 | Int m_nCGSOutputBitDepthC; // not for syntax |
---|
1796 | #endif |
---|
1797 | #endif |
---|
1798 | |
---|
1799 | public: |
---|
1800 | TComPPS(); |
---|
1801 | virtual ~TComPPS(); |
---|
1802 | |
---|
1803 | Int getPPSId() const { return m_PPSId; } |
---|
1804 | Void setPPSId(Int i) { m_PPSId = i; } |
---|
1805 | Int getSPSId() const { return m_SPSId; } |
---|
1806 | Void setSPSId(Int i) { m_SPSId = i; } |
---|
1807 | |
---|
1808 | Int getPicInitQPMinus26() const { return m_picInitQPMinus26; } |
---|
1809 | Void setPicInitQPMinus26( Int i ) { m_picInitQPMinus26 = i; } |
---|
1810 | Bool getUseDQP() const { return m_useDQP; } |
---|
1811 | Void setUseDQP( Bool b ) { m_useDQP = b; } |
---|
1812 | Bool getConstrainedIntraPred() const { return m_bConstrainedIntraPred; } |
---|
1813 | Void setConstrainedIntraPred( Bool b ) { m_bConstrainedIntraPred = b; } |
---|
1814 | Bool getSliceChromaQpFlag() const { return m_bSliceChromaQpFlag; } |
---|
1815 | Void setSliceChromaQpFlag( Bool b ) { m_bSliceChromaQpFlag = b; } |
---|
1816 | |
---|
1817 | Void setMaxCuDQPDepth( UInt u ) { m_uiMaxCuDQPDepth = u; } |
---|
1818 | UInt getMaxCuDQPDepth() const { return m_uiMaxCuDQPDepth; } |
---|
1819 | |
---|
1820 | Void setQpOffset(ComponentID compID, Int i ) |
---|
1821 | { |
---|
1822 | if (compID==COMPONENT_Cb) |
---|
1823 | { |
---|
1824 | m_chromaCbQpOffset = i; |
---|
1825 | } |
---|
1826 | else if (compID==COMPONENT_Cr) |
---|
1827 | { |
---|
1828 | m_chromaCrQpOffset = i; |
---|
1829 | } |
---|
1830 | else |
---|
1831 | { |
---|
1832 | assert(0); |
---|
1833 | } |
---|
1834 | } |
---|
1835 | Int getQpOffset(ComponentID compID) const |
---|
1836 | { |
---|
1837 | return (compID==COMPONENT_Y) ? 0 : (compID==COMPONENT_Cb ? m_chromaCbQpOffset : m_chromaCrQpOffset ); |
---|
1838 | } |
---|
1839 | |
---|
1840 | Void setNumRefIdxL0DefaultActive(UInt ui) { m_numRefIdxL0DefaultActive=ui; } |
---|
1841 | UInt getNumRefIdxL0DefaultActive() const { return m_numRefIdxL0DefaultActive; } |
---|
1842 | Void setNumRefIdxL1DefaultActive(UInt ui) { m_numRefIdxL1DefaultActive=ui; } |
---|
1843 | UInt getNumRefIdxL1DefaultActive() const { return m_numRefIdxL1DefaultActive; } |
---|
1844 | |
---|
1845 | Bool getUseWP() const { return m_bUseWeightPred; } |
---|
1846 | Bool getWPBiPred() const { return m_useWeightedBiPred; } |
---|
1847 | Void setUseWP( Bool b ) { m_bUseWeightPred = b; } |
---|
1848 | Void setWPBiPred( Bool b ) { m_useWeightedBiPred = b; } |
---|
1849 | |
---|
1850 | Void setOutputFlagPresentFlag( Bool b ) { m_OutputFlagPresentFlag = b; } |
---|
1851 | Bool getOutputFlagPresentFlag() const { return m_OutputFlagPresentFlag; } |
---|
1852 | Void setTransquantBypassEnableFlag( Bool b ) { m_TransquantBypassEnableFlag = b; } |
---|
1853 | Bool getTransquantBypassEnableFlag() const { return m_TransquantBypassEnableFlag; } |
---|
1854 | |
---|
1855 | Bool getUseTransformSkip() const { return m_useTransformSkip; } |
---|
1856 | Void setUseTransformSkip( Bool b ) { m_useTransformSkip = b; } |
---|
1857 | |
---|
1858 | Void setLoopFilterAcrossTilesEnabledFlag(Bool b) { m_loopFilterAcrossTilesEnabledFlag = b; } |
---|
1859 | Bool getLoopFilterAcrossTilesEnabledFlag() const { return m_loopFilterAcrossTilesEnabledFlag; } |
---|
1860 | Bool getDependentSliceSegmentsEnabledFlag() const { return m_dependentSliceSegmentsEnabledFlag; } |
---|
1861 | Void setDependentSliceSegmentsEnabledFlag(Bool val) { m_dependentSliceSegmentsEnabledFlag = val; } |
---|
1862 | Bool getEntropyCodingSyncEnabledFlag() const { return m_entropyCodingSyncEnabledFlag; } |
---|
1863 | Void setEntropyCodingSyncEnabledFlag(Bool val) { m_entropyCodingSyncEnabledFlag = val; } |
---|
1864 | |
---|
1865 | Void setTilesEnabledFlag(Bool val) { m_tilesEnabledFlag = val; } |
---|
1866 | Bool getTilesEnabledFlag() const { return m_tilesEnabledFlag; } |
---|
1867 | Void setTileUniformSpacingFlag(Bool b) { m_uniformSpacingFlag = b; } |
---|
1868 | Bool getTileUniformSpacingFlag() const { return m_uniformSpacingFlag; } |
---|
1869 | Void setNumTileColumnsMinus1(Int i) { m_numTileColumnsMinus1 = i; } |
---|
1870 | Int getNumTileColumnsMinus1() const { return m_numTileColumnsMinus1; } |
---|
1871 | Void setTileColumnWidth(const std::vector<Int>& columnWidth ) { m_tileColumnWidth = columnWidth; } |
---|
1872 | UInt getTileColumnWidth(UInt columnIdx) const { return m_tileColumnWidth[columnIdx]; } |
---|
1873 | Void setNumTileRowsMinus1(Int i) { m_numTileRowsMinus1 = i; } |
---|
1874 | Int getNumTileRowsMinus1() const { return m_numTileRowsMinus1; } |
---|
1875 | Void setTileRowHeight(const std::vector<Int>& rowHeight) { m_tileRowHeight = rowHeight; } |
---|
1876 | UInt getTileRowHeight(UInt rowIdx) const { return m_tileRowHeight[rowIdx]; } |
---|
1877 | |
---|
1878 | Void setSignHideFlag( Bool signHideFlag ) { m_signHideFlag = signHideFlag; } |
---|
1879 | Bool getSignHideFlag() const { return m_signHideFlag; } |
---|
1880 | |
---|
1881 | Void setCabacInitPresentFlag( Bool flag ) { m_cabacInitPresentFlag = flag; } |
---|
1882 | Bool getCabacInitPresentFlag() const { return m_cabacInitPresentFlag; } |
---|
1883 | Void setDeblockingFilterControlPresentFlag( Bool val ) { m_deblockingFilterControlPresentFlag = val; } |
---|
1884 | Bool getDeblockingFilterControlPresentFlag() const { return m_deblockingFilterControlPresentFlag; } |
---|
1885 | Void setDeblockingFilterOverrideEnabledFlag( Bool val ) { m_deblockingFilterOverrideEnabledFlag = val; } |
---|
1886 | Bool getDeblockingFilterOverrideEnabledFlag() const { return m_deblockingFilterOverrideEnabledFlag; } |
---|
1887 | Void setPicDisableDeblockingFilterFlag(Bool val) { m_picDisableDeblockingFilterFlag = val; } //!< set offset for deblocking filter disabled |
---|
1888 | Bool getPicDisableDeblockingFilterFlag() const { return m_picDisableDeblockingFilterFlag; } //!< get offset for deblocking filter disabled |
---|
1889 | Void setDeblockingFilterBetaOffsetDiv2(Int val) { m_deblockingFilterBetaOffsetDiv2 = val; } //!< set beta offset for deblocking filter |
---|
1890 | Int getDeblockingFilterBetaOffsetDiv2() const { return m_deblockingFilterBetaOffsetDiv2; } //!< get beta offset for deblocking filter |
---|
1891 | Void setDeblockingFilterTcOffsetDiv2(Int val) { m_deblockingFilterTcOffsetDiv2 = val; } //!< set tc offset for deblocking filter |
---|
1892 | Int getDeblockingFilterTcOffsetDiv2() const { return m_deblockingFilterTcOffsetDiv2; } //!< get tc offset for deblocking filter |
---|
1893 | Bool getScalingListPresentFlag() const { return m_scalingListPresentFlag; } |
---|
1894 | Void setScalingListPresentFlag( Bool b ) { m_scalingListPresentFlag = b; } |
---|
1895 | TComScalingList& getScalingList() { return m_scalingList; } |
---|
1896 | const TComScalingList& getScalingList() const { return m_scalingList; } |
---|
1897 | Bool getListsModificationPresentFlag() const { return m_listsModificationPresentFlag; } |
---|
1898 | Void setListsModificationPresentFlag( Bool b ) { m_listsModificationPresentFlag = b; } |
---|
1899 | UInt getLog2ParallelMergeLevelMinus2() const { return m_log2ParallelMergeLevelMinus2; } |
---|
1900 | Void setLog2ParallelMergeLevelMinus2(UInt mrgLevel) { m_log2ParallelMergeLevelMinus2 = mrgLevel; } |
---|
1901 | Int getNumExtraSliceHeaderBits() const { return m_numExtraSliceHeaderBits; } |
---|
1902 | Void setNumExtraSliceHeaderBits(Int i) { m_numExtraSliceHeaderBits = i; } |
---|
1903 | Void setLoopFilterAcrossSlicesEnabledFlag( Bool bValue ) { m_loopFilterAcrossSlicesEnabledFlag = bValue; } |
---|
1904 | Bool getLoopFilterAcrossSlicesEnabledFlag() const { return m_loopFilterAcrossSlicesEnabledFlag; } |
---|
1905 | Bool getSliceHeaderExtensionPresentFlag() const { return m_sliceHeaderExtensionPresentFlag; } |
---|
1906 | Void setSliceHeaderExtensionPresentFlag(Bool val) { m_sliceHeaderExtensionPresentFlag = val; } |
---|
1907 | |
---|
1908 | const TComPPSRExt& getPpsRangeExtension() const { return m_ppsRangeExtension; } |
---|
1909 | TComPPSRExt& getPpsRangeExtension() { return m_ppsRangeExtension; } |
---|
1910 | |
---|
1911 | // WAS: getTransformSkipLog2MaxSize and setTransformSkipLog2MaxSize |
---|
1912 | // Now: getPpsRangeExtension().getLog2MaxTransformSkipBlockSize and getPpsRangeExtension().setLog2MaxTransformSkipBlockSize |
---|
1913 | |
---|
1914 | // WAS: getUseCrossComponentPrediction and setUseCrossComponentPrediction |
---|
1915 | // Now: getPpsRangeExtension().getCrossComponentPredictionEnabledFlag and getPpsRangeExtension().setCrossComponentPredictionEnabledFlag |
---|
1916 | |
---|
1917 | // WAS: clearChromaQpAdjTable |
---|
1918 | // Now: getPpsRangeExtension().clearChromaQpOffsetList |
---|
1919 | |
---|
1920 | // WAS: getMaxCuChromaQpAdjDepth and setMaxCuChromaQpAdjDepth |
---|
1921 | // Now: getPpsRangeExtension().getDiffCuChromaQpOffsetDepth and getPpsRangeExtension().setDiffCuChromaQpOffsetDepth |
---|
1922 | |
---|
1923 | // WAS: getChromaQpAdjTableSize |
---|
1924 | // Now: getPpsRangeExtension().getChromaQpOffsetListLen |
---|
1925 | |
---|
1926 | // WAS: getChromaQpAdjTableAt and setChromaQpAdjTableAt |
---|
1927 | // Now: getPpsRangeExtension().getChromaQpOffsetListEntry and getPpsRangeExtension().setChromaQpOffsetListEntry |
---|
1928 | |
---|
1929 | // WAS: getSaoOffsetBitShift and setSaoOffsetBitShift |
---|
1930 | // Now: getPpsRangeExtension().getLog2SaoOffsetScale and getPpsRangeExtension().setLog2SaoOffsetScale |
---|
1931 | |
---|
1932 | #if SVC_EXTENSION |
---|
1933 | Int getExtensionFlag() const { return m_extensionFlag; } |
---|
1934 | Void setExtensionFlag(Int n) { m_extensionFlag = n; } |
---|
1935 | UInt getLayerId() const { return m_layerId; } |
---|
1936 | Void setLayerId( UInt layerId ) { m_layerId = layerId; } |
---|
1937 | Bool getInferScalingListFlag() const { return m_inferScalingListFlag; } |
---|
1938 | UInt getScalingListRefLayerId() const { return m_scalingListRefLayerId; } |
---|
1939 | Void setInferScalingListFlag( Bool flag ) { m_inferScalingListFlag = flag; } |
---|
1940 | Void setScalingListRefLayerId( UInt layerId ) { m_scalingListRefLayerId = layerId; } |
---|
1941 | Bool getPocResetInfoPresentFlag() const { return m_pocResetInfoPresentFlag; } |
---|
1942 | Void setPocResetInfoPresentFlag(const Bool val) { m_pocResetInfoPresentFlag = val; } |
---|
1943 | UInt getNumRefLayerLocationOffsets() const { return m_numRefLayerLocationOffsets; } |
---|
1944 | Void setNumRefLayerLocationOffsets(Int x) { m_numRefLayerLocationOffsets = x; } |
---|
1945 | |
---|
1946 | UInt getRefLocationOffsetLayerId(Int x) const { return m_refLocationOffsetLayerId[x]; } |
---|
1947 | Void setRefLocationOffsetLayerId(Int x, UInt id) { m_refLocationOffsetLayerId[x] = id; } |
---|
1948 | const Window& getScaledRefLayerWindowForLayer( Int layerId ) const; |
---|
1949 | |
---|
1950 | Window& getScaledRefLayerWindow( Int x ) { return m_scaledRefLayerWindow[x]; } |
---|
1951 | const Window& getScaledRefLayerWindow( Int x ) const { return m_scaledRefLayerWindow[x]; } |
---|
1952 | const Window& getRefLayerWindowForLayer( Int layerId ) const; |
---|
1953 | Window& getRefLayerWindow( Int x ) { return m_refLayerWindow[x]; } |
---|
1954 | const Window& getRefLayerWindow( Int x ) const { return m_refLayerWindow[x]; } |
---|
1955 | Bool getScaledRefLayerOffsetPresentFlag(Int x) const { return m_scaledRefLayerOffsetPresentFlag[x]; } |
---|
1956 | Void setScaledRefLayerOffsetPresentFlag(Int x, Bool b) { m_scaledRefLayerOffsetPresentFlag[x] = b; } |
---|
1957 | Bool getRefRegionOffsetPresentFlag(Int x) const { return m_refRegionOffsetPresentFlag[x]; } |
---|
1958 | Void setRefRegionOffsetPresentFlag(Int x, Bool b) { m_refRegionOffsetPresentFlag[x] = b; } |
---|
1959 | |
---|
1960 | Int getPhaseHorLuma(Int x) const { return m_resamplingPhase[x].phaseHorLuma; } |
---|
1961 | Int getPhaseVerLuma(Int x) const { return m_resamplingPhase[x].phaseVerLuma; } |
---|
1962 | Int getPhaseHorChroma(Int x) const { return m_resamplingPhase[x].phaseHorChroma; } |
---|
1963 | Int getPhaseVerChroma(Int x) const { return m_resamplingPhase[x].phaseVerChroma; } |
---|
1964 | Void setPhaseHorLuma(Int x, Int val) { m_resamplingPhase[x].phaseHorLuma = val; } |
---|
1965 | Void setPhaseVerLuma(Int x, Int val) { m_resamplingPhase[x].phaseVerLuma = val; } |
---|
1966 | Void setPhaseHorChroma(Int x, Int val) { m_resamplingPhase[x].phaseHorChroma = val; } |
---|
1967 | Void setPhaseVerChroma(Int x, Int val) { m_resamplingPhase[x].phaseVerChroma = val; } |
---|
1968 | Bool getResamplePhaseSetPresentFlag(Int x) const { return m_resamplingPhase[x].phasePresentFlag; } |
---|
1969 | Void setResamplePhaseSetPresentFlag(Int x, Bool b) { m_resamplingPhase[x].phasePresentFlag = b; } |
---|
1970 | |
---|
1971 | Bool hasZeroResamplingPhase(Int refLayerId) const; |
---|
1972 | const ResamplingPhase& getResamplingPhase(Int refLayerId) const; |
---|
1973 | #if CGS_3D_ASYMLUT |
---|
1974 | Int getCGSFlag() const { return m_nCGSFlag; } |
---|
1975 | Void setCGSFlag(Int n) { m_nCGSFlag = n; } |
---|
1976 | Int getCGSOutputBitDepthY() const { return m_nCGSOutputBitDepthY; } |
---|
1977 | Void setCGSOutputBitDepthY(Int n) { m_nCGSOutputBitDepthY = n; } |
---|
1978 | Int getCGSOutputBitDepthC() const { return m_nCGSOutputBitDepthC; } |
---|
1979 | Void setCGSOutputBitDepthC(Int n) { m_nCGSOutputBitDepthC = n; } |
---|
1980 | #endif |
---|
1981 | #endif //SVC_EXTENSION |
---|
1982 | }; |
---|
1983 | |
---|
1984 | struct WPScalingParam |
---|
1985 | { |
---|
1986 | // Explicit weighted prediction parameters parsed in slice header, |
---|
1987 | // or Implicit weighted prediction parameters (8 bits depth values). |
---|
1988 | Bool bPresentFlag; |
---|
1989 | UInt uiLog2WeightDenom; |
---|
1990 | Int iWeight; |
---|
1991 | Int iOffset; |
---|
1992 | |
---|
1993 | // Weighted prediction scaling values built from above parameters (bitdepth scaled): |
---|
1994 | Int w; |
---|
1995 | Int o; |
---|
1996 | Int offset; |
---|
1997 | Int shift; |
---|
1998 | Int round; |
---|
1999 | }; |
---|
2000 | |
---|
2001 | struct WPACDCParam |
---|
2002 | { |
---|
2003 | Int64 iAC; |
---|
2004 | Int64 iDC; |
---|
2005 | #if SVC_EXTENSION |
---|
2006 | Int iSamples; |
---|
2007 | #endif |
---|
2008 | }; |
---|
2009 | |
---|
2010 | /// slice header class |
---|
2011 | class TComSlice |
---|
2012 | { |
---|
2013 | |
---|
2014 | private: |
---|
2015 | // Bitstream writing |
---|
2016 | Bool m_saoEnabledFlag[MAX_NUM_CHANNEL_TYPE]; |
---|
2017 | Int m_iPPSId; ///< picture parameter set ID |
---|
2018 | Bool m_PicOutputFlag; ///< pic_output_flag |
---|
2019 | Int m_iPOC; |
---|
2020 | Int m_iLastIDR; |
---|
2021 | Int m_iAssociatedIRAP; |
---|
2022 | NalUnitType m_iAssociatedIRAPType; |
---|
2023 | TComReferencePictureSet* m_pcRPS; |
---|
2024 | TComReferencePictureSet m_LocalRPS; |
---|
2025 | Int m_iBDidx; |
---|
2026 | TComRefPicListModification m_RefPicListModification; |
---|
2027 | NalUnitType m_eNalUnitType; ///< Nal unit type for the slice |
---|
2028 | SliceType m_eSliceType; |
---|
2029 | Int m_iSliceQp; |
---|
2030 | Bool m_dependentSliceSegmentFlag; |
---|
2031 | #if ADAPTIVE_QP_SELECTION |
---|
2032 | Int m_iSliceQpBase; |
---|
2033 | #endif |
---|
2034 | Bool m_ChromaQpAdjEnabled; |
---|
2035 | Bool m_deblockingFilterDisable; |
---|
2036 | Bool m_deblockingFilterOverrideFlag; //< offsets for deblocking filter inherit from PPS |
---|
2037 | Int m_deblockingFilterBetaOffsetDiv2; //< beta offset for deblocking filter |
---|
2038 | Int m_deblockingFilterTcOffsetDiv2; //< tc offset for deblocking filter |
---|
2039 | Int m_list1IdxToList0Idx[MAX_NUM_REF]; |
---|
2040 | Int m_aiNumRefIdx [NUM_REF_PIC_LIST_01]; // for multiple reference of current slice |
---|
2041 | |
---|
2042 | Bool m_bCheckLDC; |
---|
2043 | |
---|
2044 | // Data |
---|
2045 | Int m_iSliceQpDelta; |
---|
2046 | Int m_iSliceChromaQpDelta[MAX_NUM_COMPONENT]; |
---|
2047 | TComPic* m_apcRefPicList [NUM_REF_PIC_LIST_01][MAX_NUM_REF+1]; |
---|
2048 | Int m_aiRefPOCList [NUM_REF_PIC_LIST_01][MAX_NUM_REF+1]; |
---|
2049 | Bool m_bIsUsedAsLongTerm[NUM_REF_PIC_LIST_01][MAX_NUM_REF+1]; |
---|
2050 | Int m_iDepth; |
---|
2051 | |
---|
2052 | // referenced slice? |
---|
2053 | Bool m_bRefenced; |
---|
2054 | |
---|
2055 | // access channel |
---|
2056 | const TComVPS* m_pcVPS; |
---|
2057 | const TComSPS* m_pcSPS; |
---|
2058 | const TComPPS* m_pcPPS; |
---|
2059 | TComPic* m_pcPic; |
---|
2060 | #if ADAPTIVE_QP_SELECTION |
---|
2061 | TComTrQuant* m_pcTrQuant; |
---|
2062 | #endif |
---|
2063 | Bool m_colFromL0Flag; // collocated picture from List0 flag |
---|
2064 | |
---|
2065 | Bool m_noOutputPriorPicsFlag; |
---|
2066 | Bool m_noRaslOutputFlag; |
---|
2067 | Bool m_handleCraAsBlaFlag; |
---|
2068 | |
---|
2069 | UInt m_colRefIdx; |
---|
2070 | UInt m_maxNumMergeCand; |
---|
2071 | |
---|
2072 | Double m_lambdas[MAX_NUM_COMPONENT]; |
---|
2073 | |
---|
2074 | Bool m_abEqualRef [NUM_REF_PIC_LIST_01][MAX_NUM_REF][MAX_NUM_REF]; |
---|
2075 | UInt m_uiTLayer; |
---|
2076 | Bool m_bTLayerSwitchingFlag; |
---|
2077 | |
---|
2078 | SliceConstraint m_sliceMode; |
---|
2079 | UInt m_sliceArgument; |
---|
2080 | UInt m_sliceCurStartCtuTsAddr; |
---|
2081 | UInt m_sliceCurEndCtuTsAddr; |
---|
2082 | UInt m_sliceIdx; |
---|
2083 | SliceConstraint m_sliceSegmentMode; |
---|
2084 | UInt m_sliceSegmentArgument; |
---|
2085 | UInt m_sliceSegmentCurStartCtuTsAddr; |
---|
2086 | UInt m_sliceSegmentCurEndCtuTsAddr; |
---|
2087 | Bool m_nextSlice; |
---|
2088 | Bool m_nextSliceSegment; |
---|
2089 | UInt m_sliceBits; |
---|
2090 | UInt m_sliceSegmentBits; |
---|
2091 | Bool m_bFinalized; |
---|
2092 | |
---|
2093 | Bool m_bTestWeightPred; |
---|
2094 | Bool m_bTestWeightBiPred; |
---|
2095 | 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] |
---|
2096 | WPACDCParam m_weightACDCParam[MAX_NUM_COMPONENT]; |
---|
2097 | |
---|
2098 | std::vector<UInt> m_substreamSizes; |
---|
2099 | |
---|
2100 | Bool m_cabacInitFlag; |
---|
2101 | |
---|
2102 | Bool m_bLMvdL1Zero; |
---|
2103 | Bool m_temporalLayerNonReferenceFlag; |
---|
2104 | Bool m_LFCrossSliceBoundaryFlag; |
---|
2105 | |
---|
2106 | Bool m_enableTMVPFlag; |
---|
2107 | |
---|
2108 | SliceType m_encCABACTableIdx; // Used to transmit table selection across slices. |
---|
2109 | |
---|
2110 | #if SVC_EXTENSION |
---|
2111 | Int m_associatedIrapPocBeforeReset; |
---|
2112 | Bool m_firstSliceInPic; |
---|
2113 | Bool m_availableForTMVPRefFlag; |
---|
2114 | UInt m_layerId; |
---|
2115 | TComPic* m_pcBaseColPic[MAX_LAYERS]; |
---|
2116 | TComPicYuv* m_pcFullPelBaseRec[MAX_LAYERS]; |
---|
2117 | Int m_numMotionPredRefLayers; |
---|
2118 | Bool m_bMFMEnabledFlag; |
---|
2119 | Int m_colRefLayerIdx; |
---|
2120 | Bool m_altColIndicationFlag; |
---|
2121 | TComPic* m_pcIlpPic; |
---|
2122 | |
---|
2123 | Bool m_interLayerPredEnabledFlag; |
---|
2124 | Int m_activeNumILRRefIdx; //< Active inter-layer reference pictures |
---|
2125 | Int m_interLayerPredLayerIdc [MAX_VPS_LAYER_IDX_PLUS1]; |
---|
2126 | Bool m_bDiscardableFlag; |
---|
2127 | Bool m_bCrossLayerBLAFlag; |
---|
2128 | Int m_pocResetIdc; |
---|
2129 | Int m_pocResetPeriodId; |
---|
2130 | Bool m_fullPocResetFlag; |
---|
2131 | Int m_pocLsbVal; |
---|
2132 | Int m_pocMsbVal; |
---|
2133 | Bool m_pocMsbValRequiredFlag; |
---|
2134 | Bool m_pocMsbValPresentFlag; |
---|
2135 | Bool m_pocMsbValNeeded; |
---|
2136 | Int m_pocResetDeltaPoc; |
---|
2137 | Int m_pocValueBeforeReset; |
---|
2138 | Int m_picOrderCntLsb; |
---|
2139 | #if CGS_3D_ASYMLUT |
---|
2140 | Int m_nCGSOverWritePPS; // for optimization, not output to bitstream |
---|
2141 | #endif |
---|
2142 | #endif //SVC_EXTENSION |
---|
2143 | |
---|
2144 | public: |
---|
2145 | TComSlice(); |
---|
2146 | virtual ~TComSlice(); |
---|
2147 | #if SVC_EXTENSION |
---|
2148 | Void initSlice( UInt layerId ); |
---|
2149 | Void setVPS( const TComVPS* pcVPS ) { m_pcVPS = pcVPS; } |
---|
2150 | #else |
---|
2151 | Void initSlice(); |
---|
2152 | #endif |
---|
2153 | |
---|
2154 | Void setVPS( TComVPS* pcVPS ) { m_pcVPS = pcVPS; } |
---|
2155 | const TComVPS* getVPS() const { return m_pcVPS; } |
---|
2156 | Void setSPS( const TComSPS* pcSPS ) { m_pcSPS = pcSPS; } |
---|
2157 | const TComSPS* getSPS() const { return m_pcSPS; } |
---|
2158 | |
---|
2159 | Void setPPS( const TComPPS* pcPPS ) { m_pcPPS = pcPPS; m_iPPSId = (pcPPS) ? pcPPS->getPPSId() : -1; } |
---|
2160 | const TComPPS* getPPS() const { return m_pcPPS; } |
---|
2161 | |
---|
2162 | Void setPPSId( Int PPSId ) { m_iPPSId = PPSId; } |
---|
2163 | Int getPPSId() const { return m_iPPSId; } |
---|
2164 | Void setPicOutputFlag( Bool b ) { m_PicOutputFlag = b; } |
---|
2165 | Bool getPicOutputFlag() const { return m_PicOutputFlag; } |
---|
2166 | Void setSaoEnabledFlag(ChannelType chType, Bool s) {m_saoEnabledFlag[chType] =s; } |
---|
2167 | Bool getSaoEnabledFlag(ChannelType chType) const { return m_saoEnabledFlag[chType]; } |
---|
2168 | Void setRPS( TComReferencePictureSet *pcRPS ) { m_pcRPS = pcRPS; } |
---|
2169 | TComReferencePictureSet* getRPS() { return m_pcRPS; } |
---|
2170 | TComReferencePictureSet* getLocalRPS() { return &m_LocalRPS; } |
---|
2171 | |
---|
2172 | Void setRPSidx( Int iBDidx ) { m_iBDidx = iBDidx; } |
---|
2173 | Int getRPSidx() const { return m_iBDidx; } |
---|
2174 | TComRefPicListModification* getRefPicListModification() { return &m_RefPicListModification; } |
---|
2175 | Void setLastIDR(Int iIDRPOC) { m_iLastIDR = iIDRPOC; } |
---|
2176 | Int getLastIDR() const { return m_iLastIDR; } |
---|
2177 | Void setAssociatedIRAPPOC(Int iAssociatedIRAPPOC) { m_iAssociatedIRAP = iAssociatedIRAPPOC; } |
---|
2178 | Int getAssociatedIRAPPOC() const { return m_iAssociatedIRAP; } |
---|
2179 | Void setAssociatedIRAPType(NalUnitType associatedIRAPType) { m_iAssociatedIRAPType = associatedIRAPType; } |
---|
2180 | NalUnitType getAssociatedIRAPType() const { return m_iAssociatedIRAPType; } |
---|
2181 | SliceType getSliceType() const { return m_eSliceType; } |
---|
2182 | Int getPOC() const { return m_iPOC; } |
---|
2183 | Int getSliceQp() const { return m_iSliceQp; } |
---|
2184 | Bool getDependentSliceSegmentFlag() const { return m_dependentSliceSegmentFlag; } |
---|
2185 | Void setDependentSliceSegmentFlag(Bool val) { m_dependentSliceSegmentFlag = val; } |
---|
2186 | #if ADAPTIVE_QP_SELECTION |
---|
2187 | Int getSliceQpBase() const { return m_iSliceQpBase; } |
---|
2188 | #endif |
---|
2189 | Int getSliceQpDelta() const { return m_iSliceQpDelta; } |
---|
2190 | Int getSliceChromaQpDelta(ComponentID compID) const { return isLuma(compID) ? 0 : m_iSliceChromaQpDelta[compID]; } |
---|
2191 | Bool getUseChromaQpAdj() const { return m_ChromaQpAdjEnabled; } |
---|
2192 | Bool getDeblockingFilterDisable() const { return m_deblockingFilterDisable; } |
---|
2193 | Bool getDeblockingFilterOverrideFlag() const { return m_deblockingFilterOverrideFlag; } |
---|
2194 | Int getDeblockingFilterBetaOffsetDiv2()const { return m_deblockingFilterBetaOffsetDiv2; } |
---|
2195 | Int getDeblockingFilterTcOffsetDiv2() const { return m_deblockingFilterTcOffsetDiv2; } |
---|
2196 | |
---|
2197 | Int getNumRefIdx( RefPicList e ) const { return m_aiNumRefIdx[e]; } |
---|
2198 | TComPic* getPic() { return m_pcPic; } |
---|
2199 | TComPic* getRefPic( RefPicList e, Int iRefIdx) { return m_apcRefPicList[e][iRefIdx]; } |
---|
2200 | Int getRefPOC( RefPicList e, Int iRefIdx) { return m_aiRefPOCList[e][iRefIdx]; } |
---|
2201 | Int getDepth() const { return m_iDepth; } |
---|
2202 | Bool getColFromL0Flag() const { return m_colFromL0Flag; } |
---|
2203 | UInt getColRefIdx() const { return m_colRefIdx; } |
---|
2204 | Void checkColRefIdx(UInt curSliceIdx, TComPic* pic); |
---|
2205 | Bool getIsUsedAsLongTerm(Int i, Int j) const { return m_bIsUsedAsLongTerm[i][j]; } |
---|
2206 | Void setIsUsedAsLongTerm(Int i, Int j, Bool value) { m_bIsUsedAsLongTerm[i][j] = value; } |
---|
2207 | Bool getCheckLDC() const { return m_bCheckLDC; } |
---|
2208 | Bool getMvdL1ZeroFlag() const { return m_bLMvdL1Zero; } |
---|
2209 | Int getNumRpsCurrTempList() const; |
---|
2210 | Int getList1IdxToList0Idx( Int list1Idx ) const { return m_list1IdxToList0Idx[list1Idx]; } |
---|
2211 | Void setReferenced(Bool b) { m_bRefenced = b; } |
---|
2212 | Bool isReferenced() const { return m_bRefenced; } |
---|
2213 | 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) ); } |
---|
2214 | Void setPOC( Int i ) { m_iPOC = i; } |
---|
2215 | Void setNalUnitType( NalUnitType e ) { m_eNalUnitType = e; } |
---|
2216 | NalUnitType getNalUnitType() const { return m_eNalUnitType; } |
---|
2217 | Bool getRapPicFlag() const; |
---|
2218 | Bool getIdrPicFlag() const { return getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP; } |
---|
2219 | Bool isIRAP() const { return (getNalUnitType() >= 16) && (getNalUnitType() <= 23); } |
---|
2220 | Void checkCRA(const TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, NalUnitType& associatedIRAPType, TComList<TComPic *>& rcListPic); |
---|
2221 | #if NO_CLRAS_OUTPUT_FLAG |
---|
2222 | Void decodingRefreshMarking( TComList<TComPic*>& rcListPic, Bool noClrasOutputFlag, UInt smallestLayerId = 0 ); |
---|
2223 | Void decodingRefreshMarking(Int& pocCRA, Bool& bRefreshPending, TComList<TComPic*>& rcListPic, const bool bEfficientFieldIRAPEnabled, Bool noClrasOutputFlag); |
---|
2224 | #else |
---|
2225 | Void decodingRefreshMarking(Int& pocCRA, Bool& bRefreshPending, TComList<TComPic*>& rcListPic, const bool bEfficientFieldIRAPEnabled); |
---|
2226 | #endif |
---|
2227 | Void setSliceType( SliceType e ) { m_eSliceType = e; } |
---|
2228 | Void setSliceQp( Int i ) { m_iSliceQp = i; } |
---|
2229 | #if ADAPTIVE_QP_SELECTION |
---|
2230 | Void setSliceQpBase( Int i ) { m_iSliceQpBase = i; } |
---|
2231 | #endif |
---|
2232 | Void setSliceQpDelta( Int i ) { m_iSliceQpDelta = i; } |
---|
2233 | Void setSliceChromaQpDelta( ComponentID compID, Int i ) { m_iSliceChromaQpDelta[compID] = isLuma(compID) ? 0 : i; } |
---|
2234 | Void setUseChromaQpAdj( Bool b ) { m_ChromaQpAdjEnabled = b; } |
---|
2235 | Void setDeblockingFilterDisable( Bool b ) { m_deblockingFilterDisable= b; } |
---|
2236 | Void setDeblockingFilterOverrideFlag( Bool b ) { m_deblockingFilterOverrideFlag = b; } |
---|
2237 | Void setDeblockingFilterBetaOffsetDiv2( Int i ) { m_deblockingFilterBetaOffsetDiv2 = i; } |
---|
2238 | Void setDeblockingFilterTcOffsetDiv2( Int i ) { m_deblockingFilterTcOffsetDiv2 = i; } |
---|
2239 | |
---|
2240 | Void setRefPic( TComPic* p, RefPicList e, Int iRefIdx ) { m_apcRefPicList[e][iRefIdx] = p; } |
---|
2241 | Void setRefPOC( Int i, RefPicList e, Int iRefIdx ) { m_aiRefPOCList[e][iRefIdx] = i; } |
---|
2242 | Void setNumRefIdx( RefPicList e, Int i ) { m_aiNumRefIdx[e] = i; } |
---|
2243 | Void setPic( TComPic* p ) { m_pcPic = p; } |
---|
2244 | Void setDepth( Int iDepth ) { m_iDepth = iDepth; } |
---|
2245 | |
---|
2246 | #if SVC_EXTENSION |
---|
2247 | Void setAssociatedIrapPocBeforeReset(Int x) { m_associatedIrapPocBeforeReset = x; } |
---|
2248 | Int getAssociatedIrapPocBeforeReset( ) { return m_associatedIrapPocBeforeReset; } |
---|
2249 | |
---|
2250 | Void setRefPicList( TComList<TComPic*>& rcListPic, Bool checkNumPocTotalCurr = false, TComPic** ilpPic = NULL ); |
---|
2251 | #if CGS_3D_ASYMLUT |
---|
2252 | Int getCGSOverWritePPS() { return m_nCGSOverWritePPS; } |
---|
2253 | Void setCGSOverWritePPS(Int n) { m_nCGSOverWritePPS = n; } |
---|
2254 | #endif |
---|
2255 | #else |
---|
2256 | Void setRefPicList( TComList<TComPic*>& rcListPic, Bool checkNumPocTotalCurr = false ); |
---|
2257 | #endif |
---|
2258 | Void setRefPOCList(); |
---|
2259 | Void setColFromL0Flag( Bool colFromL0 ) { m_colFromL0Flag = colFromL0; } |
---|
2260 | Void setColRefIdx( UInt refIdx) { m_colRefIdx = refIdx; } |
---|
2261 | Void setCheckLDC( Bool b ) { m_bCheckLDC = b; } |
---|
2262 | Void setMvdL1ZeroFlag( Bool b) { m_bLMvdL1Zero = b; } |
---|
2263 | |
---|
2264 | Bool isIntra() const { return m_eSliceType == I_SLICE; } |
---|
2265 | Bool isInterB() const { return m_eSliceType == B_SLICE; } |
---|
2266 | Bool isInterP() const { return m_eSliceType == P_SLICE; } |
---|
2267 | |
---|
2268 | Void setLambdas( const Double lambdas[MAX_NUM_COMPONENT] ) { for (Int component = 0; component < MAX_NUM_COMPONENT; component++) m_lambdas[component] = lambdas[component]; } |
---|
2269 | const Double* getLambdas() const { return m_lambdas; } |
---|
2270 | |
---|
2271 | Void initEqualRef(); |
---|
2272 | Bool isEqualRef( RefPicList e, Int iRefIdx1, Int iRefIdx2 ) |
---|
2273 | { |
---|
2274 | assert(e<NUM_REF_PIC_LIST_01); |
---|
2275 | if (iRefIdx1 < 0 || iRefIdx2 < 0) |
---|
2276 | { |
---|
2277 | return false; |
---|
2278 | } |
---|
2279 | else |
---|
2280 | { |
---|
2281 | return m_abEqualRef[e][iRefIdx1][iRefIdx2]; |
---|
2282 | } |
---|
2283 | } |
---|
2284 | |
---|
2285 | Void setEqualRef( RefPicList e, Int iRefIdx1, Int iRefIdx2, Bool b) |
---|
2286 | { |
---|
2287 | assert(e<NUM_REF_PIC_LIST_01); |
---|
2288 | m_abEqualRef[e][iRefIdx1][iRefIdx2] = m_abEqualRef[e][iRefIdx2][iRefIdx1] = b; |
---|
2289 | } |
---|
2290 | |
---|
2291 | static Void sortPicList( TComList<TComPic*>& rcListPic ); |
---|
2292 | Void setList1IdxToList0Idx(); |
---|
2293 | |
---|
2294 | UInt getTLayer() const { return m_uiTLayer; } |
---|
2295 | Void setTLayer( UInt uiTLayer ) { m_uiTLayer = uiTLayer; } |
---|
2296 | |
---|
2297 | Void setTLayerInfo( UInt uiTLayer ); |
---|
2298 | Void decodingMarking( TComList<TComPic*>& rcListPic, Int iGOPSIze, Int& iMaxRefPicNum ); |
---|
2299 | |
---|
2300 | #if SVC_POC |
---|
2301 | Void checkLeadingPictureRestrictions(TComList<TComPic*>& rcListPic, Bool usePocBeforeReset = false); |
---|
2302 | #else |
---|
2303 | Void checkLeadingPictureRestrictions( TComList<TComPic*>& rcListPic ); |
---|
2304 | #endif |
---|
2305 | Void applyReferencePictureSet( TComList<TComPic*>& rcListPic, const TComReferencePictureSet *RPSList); |
---|
2306 | Bool isTemporalLayerSwitchingPoint( TComList<TComPic*>& rcListPic ); |
---|
2307 | Bool isStepwiseTemporalLayerSwitchingPointCandidate( TComList<TComPic*>& rcListPic ); |
---|
2308 | Int checkThatAllRefPicsAreAvailable( TComList<TComPic*>& rcListPic, const TComReferencePictureSet *pReferencePictureSet, Bool printErrors, Int pocRandomAccess = 0, Bool bUseRecoveryPoint = false); |
---|
2309 | Void createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, const TComReferencePictureSet *pReferencePictureSet, Bool isRAP, Int pocRandomAccess, Bool bUseRecoveryPoint, const Bool bEfficientFieldIRAPEnabled); |
---|
2310 | Void setMaxNumMergeCand(UInt val ) { m_maxNumMergeCand = val; } |
---|
2311 | UInt getMaxNumMergeCand() const { return m_maxNumMergeCand; } |
---|
2312 | |
---|
2313 | Void setNoOutputPriorPicsFlag( Bool val ) { m_noOutputPriorPicsFlag = val; } |
---|
2314 | Bool getNoOutputPriorPicsFlag() const { return m_noOutputPriorPicsFlag; } |
---|
2315 | |
---|
2316 | Void setNoRaslOutputFlag( Bool val ) { m_noRaslOutputFlag = val; } |
---|
2317 | Bool getNoRaslOutputFlag() const { return m_noRaslOutputFlag; } |
---|
2318 | |
---|
2319 | Void setHandleCraAsBlaFlag( Bool val ) { m_handleCraAsBlaFlag = val; } |
---|
2320 | Bool getHandleCraAsBlaFlag() const { return m_handleCraAsBlaFlag; } |
---|
2321 | |
---|
2322 | Void setSliceMode( SliceConstraint mode ) { m_sliceMode = mode; } |
---|
2323 | SliceConstraint getSliceMode() const { return m_sliceMode; } |
---|
2324 | Void setSliceArgument( UInt uiArgument ) { m_sliceArgument = uiArgument; } |
---|
2325 | UInt getSliceArgument() const { return m_sliceArgument; } |
---|
2326 | Void setSliceCurStartCtuTsAddr( UInt ctuTsAddr ) { m_sliceCurStartCtuTsAddr = ctuTsAddr; } // CTU Tile-scan address (as opposed to raster-scan) |
---|
2327 | UInt getSliceCurStartCtuTsAddr() const { return m_sliceCurStartCtuTsAddr; } // CTU Tile-scan address (as opposed to raster-scan) |
---|
2328 | Void setSliceCurEndCtuTsAddr( UInt ctuTsAddr ) { m_sliceCurEndCtuTsAddr = ctuTsAddr; } // CTU Tile-scan address (as opposed to raster-scan) |
---|
2329 | UInt getSliceCurEndCtuTsAddr() const { return m_sliceCurEndCtuTsAddr; } // CTU Tile-scan address (as opposed to raster-scan) |
---|
2330 | Void setSliceIdx( UInt i) { m_sliceIdx = i; } |
---|
2331 | UInt getSliceIdx() const { return m_sliceIdx; } |
---|
2332 | Void copySliceInfo(TComSlice *pcSliceSrc); |
---|
2333 | Void setSliceSegmentMode( SliceConstraint mode ) { m_sliceSegmentMode = mode; } |
---|
2334 | SliceConstraint getSliceSegmentMode() const { return m_sliceSegmentMode; } |
---|
2335 | Void setSliceSegmentArgument( UInt uiArgument ) { m_sliceSegmentArgument = uiArgument; } |
---|
2336 | UInt getSliceSegmentArgument() const { return m_sliceSegmentArgument; } |
---|
2337 | Void setSliceSegmentCurStartCtuTsAddr( UInt ctuTsAddr ) { m_sliceSegmentCurStartCtuTsAddr = ctuTsAddr; } // CTU Tile-scan address (as opposed to raster-scan) |
---|
2338 | UInt getSliceSegmentCurStartCtuTsAddr() const { return m_sliceSegmentCurStartCtuTsAddr; } // CTU Tile-scan address (as opposed to raster-scan) |
---|
2339 | Void setSliceSegmentCurEndCtuTsAddr( UInt ctuTsAddr ) { m_sliceSegmentCurEndCtuTsAddr = ctuTsAddr; } // CTU Tile-scan address (as opposed to raster-scan) |
---|
2340 | UInt getSliceSegmentCurEndCtuTsAddr() const { return m_sliceSegmentCurEndCtuTsAddr; } // CTU Tile-scan address (as opposed to raster-scan) |
---|
2341 | Void setSliceBits( UInt uiVal ) { m_sliceBits = uiVal; } |
---|
2342 | UInt getSliceBits() const { return m_sliceBits; } |
---|
2343 | Void setSliceSegmentBits( UInt uiVal ) { m_sliceSegmentBits = uiVal; } |
---|
2344 | UInt getSliceSegmentBits() const { return m_sliceSegmentBits; } |
---|
2345 | Void setFinalized( Bool uiVal ) { m_bFinalized = uiVal; } |
---|
2346 | Bool getFinalized() const { return m_bFinalized; } |
---|
2347 | Bool testWeightPred( ) const { return m_bTestWeightPred; } |
---|
2348 | Void setTestWeightPred( Bool bValue ) { m_bTestWeightPred = bValue; } |
---|
2349 | Bool testWeightBiPred( ) const { return m_bTestWeightBiPred; } |
---|
2350 | Void setTestWeightBiPred( Bool bValue ) { m_bTestWeightBiPred = bValue; } |
---|
2351 | Void setWpScaling( WPScalingParam wp[NUM_REF_PIC_LIST_01][MAX_NUM_REF][MAX_NUM_COMPONENT] ) |
---|
2352 | { |
---|
2353 | memcpy(m_weightPredTable, wp, sizeof(WPScalingParam)*NUM_REF_PIC_LIST_01*MAX_NUM_REF*MAX_NUM_COMPONENT); |
---|
2354 | } |
---|
2355 | |
---|
2356 | Void getWpScaling( RefPicList e, Int iRefIdx, WPScalingParam *&wp); |
---|
2357 | |
---|
2358 | Void resetWpScaling(); |
---|
2359 | Void initWpScaling(const TComSPS *sps); |
---|
2360 | |
---|
2361 | Void setWpAcDcParam( WPACDCParam wp[MAX_NUM_COMPONENT] ) |
---|
2362 | { |
---|
2363 | memcpy(m_weightACDCParam, wp, sizeof(WPACDCParam)*MAX_NUM_COMPONENT); |
---|
2364 | } |
---|
2365 | |
---|
2366 | Void getWpAcDcParam( WPACDCParam *&wp ); |
---|
2367 | Void initWpAcDcParam(); |
---|
2368 | |
---|
2369 | Void clearSubstreamSizes( ) { return m_substreamSizes.clear(); } |
---|
2370 | UInt getNumberOfSubstreamSizes( ) { return (UInt) m_substreamSizes.size(); } |
---|
2371 | Void addSubstreamSize( UInt size ) { m_substreamSizes.push_back(size); } |
---|
2372 | UInt getSubstreamSize( Int idx ) { assert(idx<getNumberOfSubstreamSizes()); return m_substreamSizes[idx]; } |
---|
2373 | |
---|
2374 | Void setCabacInitFlag( Bool val ) { m_cabacInitFlag = val; } //!< set CABAC initial flag |
---|
2375 | Bool getCabacInitFlag() { return m_cabacInitFlag; } //!< get CABAC initial flag |
---|
2376 | Bool getTemporalLayerNonReferenceFlag() { return m_temporalLayerNonReferenceFlag; } |
---|
2377 | Void setTemporalLayerNonReferenceFlag(Bool x) { m_temporalLayerNonReferenceFlag = x; } |
---|
2378 | Void setLFCrossSliceBoundaryFlag( Bool val ) { m_LFCrossSliceBoundaryFlag = val; } |
---|
2379 | Bool getLFCrossSliceBoundaryFlag() { return m_LFCrossSliceBoundaryFlag; } |
---|
2380 | |
---|
2381 | Void setEnableTMVPFlag( Bool b ) { m_enableTMVPFlag = b; } |
---|
2382 | Bool getEnableTMVPFlag() { return m_enableTMVPFlag; } |
---|
2383 | |
---|
2384 | Void setEncCABACTableIdx( SliceType idx ) { m_encCABACTableIdx = idx; } |
---|
2385 | SliceType getEncCABACTableIdx() const { return m_encCABACTableIdx; } |
---|
2386 | |
---|
2387 | #if SVC_EXTENSION |
---|
2388 | Void setFirstSliceInPic( Bool val ) { m_firstSliceInPic = val; } |
---|
2389 | Bool getFirstSliceInPic() { return m_firstSliceInPic; } |
---|
2390 | Void setAvailableForTMVPRefFlag( Bool b ) { m_availableForTMVPRefFlag = b; } |
---|
2391 | Bool getAvailableForTMVPRefFlag() { return m_availableForTMVPRefFlag; } |
---|
2392 | Bool setBaseColPic( TComList<TComPic*>& rcListPic , UInt refLayerIdc ); |
---|
2393 | Void setBaseColPic(UInt refLayerIdc, TComPic* p) { m_pcBaseColPic[refLayerIdc] = p; } |
---|
2394 | TComPic* getBaseColPic(UInt refLayerIdc) { return m_pcBaseColPic[refLayerIdc]; } |
---|
2395 | TComPic** getBaseColPic() { return &m_pcBaseColPic[0]; } |
---|
2396 | TComPic* getBaseColPic( TComList<TComPic*>& rcListPic ); |
---|
2397 | |
---|
2398 | Void setLayerId(UInt layerId) { m_layerId = layerId; } |
---|
2399 | UInt getLayerId() const { return m_layerId; } |
---|
2400 | UInt getLayerIdx() { return m_pcVPS->getLayerIdxInVps(m_layerId); } |
---|
2401 | |
---|
2402 | Void setFullPelBaseRec( UInt refLayerIdc, TComPicYuv* p) { m_pcFullPelBaseRec[refLayerIdc] = p; } |
---|
2403 | TComPicYuv* getFullPelBaseRec( UInt refLayerIdc) { return m_pcFullPelBaseRec[refLayerIdc]; } |
---|
2404 | |
---|
2405 | Void setRefPicListModificationSvc(); |
---|
2406 | Int getNumILRRefIdx() { return m_pcVPS->getNumDirectRefLayers( m_layerId ); } |
---|
2407 | |
---|
2408 | Int getActiveNumILRRefIdx() { return m_activeNumILRRefIdx; } |
---|
2409 | Void setActiveNumILRRefIdx( Int i ) { m_activeNumILRRefIdx = i; } |
---|
2410 | |
---|
2411 | Int getInterLayerPredLayerIdc(UInt layerIdc) { return m_interLayerPredLayerIdc[layerIdc]; } |
---|
2412 | Void setInterLayerPredLayerIdc(UInt refLayerIdc, UInt layerIdc) { m_interLayerPredLayerIdc[layerIdc] = refLayerIdc; } |
---|
2413 | |
---|
2414 | Void setInterLayerPredEnabledFlag( Bool val ) { m_interLayerPredEnabledFlag = val; } |
---|
2415 | Bool getInterLayerPredEnabledFlag() { return m_interLayerPredEnabledFlag; } |
---|
2416 | |
---|
2417 | Void setNumMotionPredRefLayers(Int i) { m_numMotionPredRefLayers = i; } |
---|
2418 | Int getNumMotionPredRefLayers() { return m_numMotionPredRefLayers; } |
---|
2419 | |
---|
2420 | Void setMFMEnabledFlag(Bool flag) { m_bMFMEnabledFlag = flag; } |
---|
2421 | Bool getMFMEnabledFlag() { return m_bMFMEnabledFlag; } |
---|
2422 | |
---|
2423 | TComPic* getRefPic(TComList<TComPic*>& rcListPic, Int poc) { return xGetRefPic( rcListPic, poc ); } |
---|
2424 | |
---|
2425 | Bool isRADL() { return (m_eNalUnitType == NAL_UNIT_CODED_SLICE_RADL_N || m_eNalUnitType == NAL_UNIT_CODED_SLICE_RADL_R); } |
---|
2426 | Bool isRASL() { return (m_eNalUnitType == NAL_UNIT_CODED_SLICE_RASL_N || m_eNalUnitType == NAL_UNIT_CODED_SLICE_RASL_R); } |
---|
2427 | |
---|
2428 | Bool isIDR() { return (m_eNalUnitType == NAL_UNIT_CODED_SLICE_IDR_W_RADL || m_eNalUnitType == NAL_UNIT_CODED_SLICE_IDR_N_LP); } |
---|
2429 | Bool isCRA() { return m_eNalUnitType == NAL_UNIT_CODED_SLICE_CRA; } |
---|
2430 | 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 ); } |
---|
2431 | Bool isSLNR() |
---|
2432 | { |
---|
2433 | return (m_eNalUnitType == NAL_UNIT_CODED_SLICE_TRAIL_N |
---|
2434 | || m_eNalUnitType == NAL_UNIT_CODED_SLICE_TSA_N |
---|
2435 | || m_eNalUnitType == NAL_UNIT_CODED_SLICE_STSA_N |
---|
2436 | || m_eNalUnitType == NAL_UNIT_CODED_SLICE_RADL_N |
---|
2437 | || m_eNalUnitType == NAL_UNIT_CODED_SLICE_RASL_N |
---|
2438 | || m_eNalUnitType == NAL_UNIT_RESERVED_VCL_N10 |
---|
2439 | || m_eNalUnitType == NAL_UNIT_RESERVED_VCL_N12 |
---|
2440 | || m_eNalUnitType == NAL_UNIT_RESERVED_VCL_N14 ); |
---|
2441 | } |
---|
2442 | |
---|
2443 | Bool getDiscardableFlag () { return m_bDiscardableFlag; } |
---|
2444 | Void setDiscardableFlag (Bool b) { m_bDiscardableFlag = b; } |
---|
2445 | Bool getCrossLayerBLAFlag () { return m_bCrossLayerBLAFlag; } |
---|
2446 | Void setCrossLayerBLAFlag (Bool b) { m_bCrossLayerBLAFlag = b; } |
---|
2447 | |
---|
2448 | Int getNumNegativeRpsCurrTempList(); |
---|
2449 | |
---|
2450 | UInt getPicWidthInLumaSamples(); |
---|
2451 | UInt getPicHeightInLumaSamples(); |
---|
2452 | ChromaFormat getChromaFormatIdc(); |
---|
2453 | UInt getBitDepth(ChannelType type) const; |
---|
2454 | BitDepths& getBitDepths(); |
---|
2455 | Int getQpBDOffset(ChannelType type) const { return (getBitDepth(type) - 8) * 6; } |
---|
2456 | |
---|
2457 | const Window& getConformanceWindow() const; |
---|
2458 | |
---|
2459 | Void setILRPic(TComPic **pcIlpPic); |
---|
2460 | |
---|
2461 | Int getPocResetIdc() { return m_pocResetIdc; } |
---|
2462 | Void setPocResetIdc(Int b) { m_pocResetIdc = b; } |
---|
2463 | Int getPocResetPeriodId() { return m_pocResetPeriodId; } |
---|
2464 | Void setPocResetPeriodId(Int b) { m_pocResetPeriodId = b; } |
---|
2465 | Bool getFullPocResetFlag() { return m_fullPocResetFlag; } |
---|
2466 | Void setFullPocResetFlag(Bool b) { m_fullPocResetFlag = b; } |
---|
2467 | Int getPocLsbVal() { return m_pocLsbVal; } |
---|
2468 | Void setPocLsbVal(Int b) { m_pocLsbVal = b; } |
---|
2469 | Void setPocMsbNeeded(Bool x) { m_pocMsbValNeeded = x; } |
---|
2470 | Bool getPocMsbNeeded() { return m_pocMsbValNeeded; } |
---|
2471 | Int getPocResetDeltaPoc() { return m_pocResetDeltaPoc; } |
---|
2472 | Void setPocResetDeltaPoc(Int x) { m_pocResetDeltaPoc = x; } |
---|
2473 | Int getPocMsbVal() { return m_pocMsbVal; } |
---|
2474 | Void setPocMsbVal(Int b) { m_pocMsbVal = b; } |
---|
2475 | Bool getPocMsbValPresentFlag() { return m_pocMsbValPresentFlag; } |
---|
2476 | Void setPocMsbValPresentFlag(Bool x) { m_pocMsbValPresentFlag = x; } |
---|
2477 | Bool getPocMsbValRequiredFlag() { return m_pocMsbValRequiredFlag; } |
---|
2478 | Void setPocMsbValRequiredFlag(Bool x) { m_pocMsbValRequiredFlag = x; } |
---|
2479 | |
---|
2480 | Bool getBlaPicFlag(); |
---|
2481 | Bool getCraPicFlag(); |
---|
2482 | Bool getRaslPicFlag(); |
---|
2483 | Bool getRadlPicFlag(); |
---|
2484 | Int getPicOrderCntLsb() { return m_picOrderCntLsb; } |
---|
2485 | Void setPicOrderCntLsb(Int x) { m_picOrderCntLsb = x; } |
---|
2486 | |
---|
2487 | Int getPocValueBeforeReset() { return m_pocValueBeforeReset; } |
---|
2488 | Void setPocValueBeforeReset(Int x) { m_pocValueBeforeReset = x ; } |
---|
2489 | Void decrementRefPocValues(Int const decrementValue); |
---|
2490 | Int getCurrMsb( Int currLsb, Int prevLsb, Int prevMsb, Int maxLsbVal ); |
---|
2491 | |
---|
2492 | Int getReferenceLayerIdc( UInt refLayerId ); |
---|
2493 | #endif //SVC_EXTENSION |
---|
2494 | |
---|
2495 | protected: |
---|
2496 | TComPic* xGetRefPic (TComList<TComPic*>& rcListPic, Int poc); |
---|
2497 | TComPic* xGetLongTermRefPic(TComList<TComPic*>& rcListPic, Int poc, Bool pocHasMsb); |
---|
2498 | };// END CLASS DEFINITION TComSlice |
---|
2499 | |
---|
2500 | |
---|
2501 | Void calculateParameterSetChangedFlag(Bool &bChanged, const std::vector<UChar> *pOldData, const std::vector<UChar> &newData); |
---|
2502 | |
---|
2503 | template <class T> class ParameterSetMap |
---|
2504 | { |
---|
2505 | public: |
---|
2506 | template <class Tm> |
---|
2507 | struct MapData |
---|
2508 | { |
---|
2509 | Bool bChanged; |
---|
2510 | std::vector<UChar> *pNaluData; // Can be null |
---|
2511 | Tm* parameterSet; |
---|
2512 | }; |
---|
2513 | |
---|
2514 | ParameterSetMap(Int maxId) |
---|
2515 | :m_maxId (maxId) |
---|
2516 | {} |
---|
2517 | |
---|
2518 | ~ParameterSetMap() |
---|
2519 | { |
---|
2520 | for (typename std::map<Int,MapData<T> >::iterator i = m_paramsetMap.begin(); i!= m_paramsetMap.end(); i++) |
---|
2521 | { |
---|
2522 | delete (*i).second.pNaluData; |
---|
2523 | delete (*i).second.parameterSet; |
---|
2524 | } |
---|
2525 | } |
---|
2526 | |
---|
2527 | Void storePS(Int psId, T *ps, const std::vector<UChar> &naluData) |
---|
2528 | { |
---|
2529 | assert ( psId < m_maxId ); |
---|
2530 | if ( m_paramsetMap.find(psId) != m_paramsetMap.end() ) |
---|
2531 | { |
---|
2532 | MapData<T> &mapData=m_paramsetMap[psId]; |
---|
2533 | |
---|
2534 | // work out changed flag |
---|
2535 | calculateParameterSetChangedFlag(mapData.bChanged, mapData.pNaluData, naluData); |
---|
2536 | delete m_paramsetMap[psId].pNaluData; |
---|
2537 | delete m_paramsetMap[psId].parameterSet; |
---|
2538 | |
---|
2539 | m_paramsetMap[psId].parameterSet = ps; |
---|
2540 | } |
---|
2541 | else |
---|
2542 | { |
---|
2543 | m_paramsetMap[psId].parameterSet = ps; |
---|
2544 | m_paramsetMap[psId].bChanged = false; |
---|
2545 | } |
---|
2546 | m_paramsetMap[psId].pNaluData=new std::vector<UChar>; |
---|
2547 | *(m_paramsetMap[psId].pNaluData) = naluData; |
---|
2548 | } |
---|
2549 | |
---|
2550 | Void clearChangedFlag(Int psId) |
---|
2551 | { |
---|
2552 | if ( m_paramsetMap.find(psId) != m_paramsetMap.end() ) |
---|
2553 | { |
---|
2554 | m_paramsetMap[psId].bChanged=false; |
---|
2555 | } |
---|
2556 | } |
---|
2557 | |
---|
2558 | Bool getChangedFlag(Int psId) const |
---|
2559 | { |
---|
2560 | const typename std::map<Int,MapData<T> >::const_iterator constit=m_paramsetMap.find(psId); |
---|
2561 | if ( constit != m_paramsetMap.end() ) |
---|
2562 | { |
---|
2563 | return constit->second.bChanged; |
---|
2564 | } |
---|
2565 | return false; |
---|
2566 | } |
---|
2567 | |
---|
2568 | T* getPS(Int psId) |
---|
2569 | { |
---|
2570 | typename std::map<Int,MapData<T> >::iterator it=m_paramsetMap.find(psId); |
---|
2571 | return ( it == m_paramsetMap.end() ) ? NULL : (it)->second.parameterSet; |
---|
2572 | } |
---|
2573 | |
---|
2574 | const T* getPS(Int psId) const |
---|
2575 | { |
---|
2576 | typename std::map<Int,MapData<T> >::const_iterator it=m_paramsetMap.find(psId); |
---|
2577 | return ( it == m_paramsetMap.end() ) ? NULL : (it)->second.parameterSet; |
---|
2578 | } |
---|
2579 | |
---|
2580 | T* getFirstPS() |
---|
2581 | { |
---|
2582 | return (m_paramsetMap.begin() == m_paramsetMap.end() ) ? NULL : m_paramsetMap.begin()->second.parameterSet; |
---|
2583 | } |
---|
2584 | |
---|
2585 | private: |
---|
2586 | std::map<Int,MapData<T> > m_paramsetMap; |
---|
2587 | Int m_maxId; |
---|
2588 | }; |
---|
2589 | |
---|
2590 | class ParameterSetManager |
---|
2591 | { |
---|
2592 | public: |
---|
2593 | ParameterSetManager(); |
---|
2594 | virtual ~ParameterSetManager(); |
---|
2595 | |
---|
2596 | //! store sequence parameter set and take ownership of it |
---|
2597 | Void storeVPS(TComVPS *vps, const std::vector<UChar> &naluData) { m_vpsMap.storePS( vps->getVPSId(), vps, naluData); }; |
---|
2598 | //! get pointer to existing video parameter set |
---|
2599 | TComVPS* getVPS(Int vpsId) { return m_vpsMap.getPS(vpsId); }; |
---|
2600 | Bool getVPSChangedFlag(Int vpsId) const { return m_vpsMap.getChangedFlag(vpsId); } |
---|
2601 | Void clearVPSChangedFlag(Int vpsId) { m_vpsMap.clearChangedFlag(vpsId); } |
---|
2602 | TComVPS* getFirstVPS() { return m_vpsMap.getFirstPS(); }; |
---|
2603 | |
---|
2604 | //! store sequence parameter set and take ownership of it |
---|
2605 | Void storeSPS(TComSPS *sps, const std::vector<UChar> &naluData) { m_spsMap.storePS( sps->getSPSId(), sps, naluData); }; |
---|
2606 | //! get pointer to existing sequence parameter set |
---|
2607 | TComSPS* getSPS(Int spsId) { return m_spsMap.getPS(spsId); }; |
---|
2608 | Bool getSPSChangedFlag(Int spsId) const { return m_spsMap.getChangedFlag(spsId); } |
---|
2609 | Void clearSPSChangedFlag(Int spsId) { m_spsMap.clearChangedFlag(spsId); } |
---|
2610 | TComSPS* getFirstSPS() { return m_spsMap.getFirstPS(); }; |
---|
2611 | |
---|
2612 | //! store picture parameter set and take ownership of it |
---|
2613 | Void storePPS(TComPPS *pps, const std::vector<UChar> &naluData) { m_ppsMap.storePS( pps->getPPSId(), pps, naluData); }; |
---|
2614 | //! get pointer to existing picture parameter set |
---|
2615 | TComPPS* getPPS(Int ppsId) { return m_ppsMap.getPS(ppsId); }; |
---|
2616 | Bool getPPSChangedFlag(Int ppsId) const { return m_ppsMap.getChangedFlag(ppsId); } |
---|
2617 | Void clearPPSChangedFlag(Int ppsId) { m_ppsMap.clearChangedFlag(ppsId); } |
---|
2618 | TComPPS* getFirstPPS() { return m_ppsMap.getFirstPS(); }; |
---|
2619 | |
---|
2620 | //! activate a SPS from a active parameter sets SEI message |
---|
2621 | //! \returns true, if activation is successful |
---|
2622 | // Bool activateSPSWithSEI(Int SPSId); |
---|
2623 | |
---|
2624 | //! activate a PPS and depending on isIDR parameter also SPS and VPS |
---|
2625 | //! \returns true, if activation is successful |
---|
2626 | Bool activatePPS(Int ppsId, Bool isIRAP); |
---|
2627 | |
---|
2628 | const TComVPS* getActiveVPS()const { return m_vpsMap.getPS(m_activeVPSId); }; |
---|
2629 | const TComSPS* getActiveSPS()const { return m_spsMap.getPS(m_activeSPSId); }; |
---|
2630 | |
---|
2631 | #if SVC_EXTENSION |
---|
2632 | const TComPPS* getActivePPS()const { return m_ppsMap.getPS(m_activePPSId); }; |
---|
2633 | #endif |
---|
2634 | |
---|
2635 | protected: |
---|
2636 | |
---|
2637 | #if SVC_EXTENSION |
---|
2638 | static ParameterSetMap<TComVPS> m_vpsMap; |
---|
2639 | static ParameterSetMap<TComSPS> m_spsMap; |
---|
2640 | static ParameterSetMap<TComPPS> m_ppsMap; |
---|
2641 | |
---|
2642 | Int m_activePPSId; |
---|
2643 | static Int m_activeVPSId; // -1 for nothing active; |
---|
2644 | #else |
---|
2645 | ParameterSetMap<TComVPS> m_vpsMap; |
---|
2646 | ParameterSetMap<TComSPS> m_spsMap; |
---|
2647 | ParameterSetMap<TComPPS> m_ppsMap; |
---|
2648 | |
---|
2649 | Int m_activeVPSId; // -1 for nothing active |
---|
2650 | #endif |
---|
2651 | |
---|
2652 | Int m_activeSPSId; // -1 for nothing active |
---|
2653 | }; |
---|
2654 | |
---|
2655 | //! \} |
---|
2656 | |
---|
2657 | #endif // __TCOMSLICE__ |
---|