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