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-2013, 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 processDefaultMarix (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 H_3D_VSP |
---|
786 | Bool m_viewSynthesisPredFlag [ MAX_NUM_LAYERS ]; |
---|
787 | #endif |
---|
788 | #if H_3D_NBDV_REF |
---|
789 | Bool m_depthRefinementFlag [ MAX_NUM_LAYERS ]; |
---|
790 | #endif |
---|
791 | Bool m_vpsDepthModesFlag [MAX_NUM_LAYERS ]; |
---|
792 | |
---|
793 | #if H_3D |
---|
794 | UInt m_uiCamParPrecision; |
---|
795 | Bool* m_bCamParInSliceHeader; |
---|
796 | Bool* m_bCamParPresent; |
---|
797 | Int ***m_aaaiCodedScale ; |
---|
798 | Int ***m_aaaiCodedOffset; |
---|
799 | Bool m_ivMvScalingFlag; |
---|
800 | #endif |
---|
801 | #if H_3D_INTER_SDC |
---|
802 | Bool m_bInterSDCFlag[MAX_NUM_LAYERS ]; |
---|
803 | #endif |
---|
804 | #if H_3D_IV_MERGE |
---|
805 | Bool m_bMPIFlag[MAX_NUM_LAYERS ]; |
---|
806 | #endif |
---|
807 | |
---|
808 | #endif |
---|
809 | public: |
---|
810 | TComVPS(); |
---|
811 | virtual ~TComVPS(); |
---|
812 | |
---|
813 | Void createHrdParamBuffer() |
---|
814 | { |
---|
815 | m_hrdParameters = new TComHRD[ getNumHrdParameters() ]; |
---|
816 | m_hrdOpSetIdx = new UInt [ getNumHrdParameters() ]; |
---|
817 | m_cprmsPresentFlag = new Bool [ getNumHrdParameters() ]; |
---|
818 | } |
---|
819 | |
---|
820 | TComHRD* getHrdParameters ( UInt i ) { return &m_hrdParameters[ i ]; } |
---|
821 | UInt getHrdOpSetIdx ( UInt i ) { return m_hrdOpSetIdx[ i ]; } |
---|
822 | Void setHrdOpSetIdx ( UInt val, UInt i ) { m_hrdOpSetIdx[ i ] = val; } |
---|
823 | Bool getCprmsPresentFlag ( UInt i ) { return m_cprmsPresentFlag[ i ]; } |
---|
824 | Void setCprmsPresentFlag ( Bool val, UInt i ) { m_cprmsPresentFlag[ i ] = val; } |
---|
825 | |
---|
826 | Int getVPSId () { return m_VPSId; } |
---|
827 | Void setVPSId (Int i) { m_VPSId = i; } |
---|
828 | |
---|
829 | UInt getMaxTLayers () { return m_uiMaxTLayers; } |
---|
830 | Void setMaxTLayers (UInt t) { m_uiMaxTLayers = t; } |
---|
831 | |
---|
832 | #if H_MV |
---|
833 | UInt getMaxSubLayersMinus1() { return m_uiMaxTLayers - 1; } // For consistency with draft spec |
---|
834 | UInt getMaxLayersMinus1() { return m_uiMaxLayersMinus1; }; |
---|
835 | Void setMaxLayersMinus1(UInt l) { m_uiMaxLayersMinus1 = l; } |
---|
836 | #else |
---|
837 | UInt getMaxLayers () { return m_uiMaxLayers; } |
---|
838 | Void setMaxLayers (UInt l) { m_uiMaxLayers = l; } |
---|
839 | #endif |
---|
840 | |
---|
841 | Bool getTemporalNestingFlag () { return m_bTemporalIdNestingFlag; } |
---|
842 | Void setTemporalNestingFlag (Bool t) { m_bTemporalIdNestingFlag = t; } |
---|
843 | |
---|
844 | Void setNumReorderPics(UInt v, UInt tLayer) { m_numReorderPics[tLayer] = v; } |
---|
845 | UInt getNumReorderPics(UInt tLayer) { return m_numReorderPics[tLayer]; } |
---|
846 | |
---|
847 | Void setMaxDecPicBuffering(UInt v, UInt tLayer) { m_uiMaxDecPicBuffering[tLayer] = v; } |
---|
848 | UInt getMaxDecPicBuffering(UInt tLayer) { return m_uiMaxDecPicBuffering[tLayer]; } |
---|
849 | |
---|
850 | Void setMaxLatencyIncrease(UInt v, UInt tLayer) { m_uiMaxLatencyIncrease[tLayer] = v; } |
---|
851 | UInt getMaxLatencyIncrease(UInt tLayer) { return m_uiMaxLatencyIncrease[tLayer]; } |
---|
852 | |
---|
853 | UInt getNumHrdParameters() { return m_numHrdParameters; } |
---|
854 | Void setNumHrdParameters(UInt v) { m_numHrdParameters = v; } |
---|
855 | |
---|
856 | #if H_MV |
---|
857 | UInt getVpsMaxLayerId() { return m_maxLayerId; } |
---|
858 | Void setVpsMaxLayerId(UInt v) { m_maxLayerId = v; } |
---|
859 | |
---|
860 | UInt getVpsNumLayerSetsMinus1() { return m_vpsNumLayerSetsMinus1; } |
---|
861 | Void setVpsNumLayerSetsMinus1(UInt v) { m_vpsNumLayerSetsMinus1 = v; } |
---|
862 | #else |
---|
863 | UInt getMaxNuhReservedZeroLayerId() { return m_maxNuhReservedZeroLayerId; } |
---|
864 | Void setMaxNuhReservedZeroLayerId(UInt v) { m_maxNuhReservedZeroLayerId = v; } |
---|
865 | |
---|
866 | UInt getMaxOpSets() { return m_numOpSets; } |
---|
867 | Void setMaxOpSets(UInt v) { m_numOpSets = v; } |
---|
868 | #endif |
---|
869 | Bool getLayerIdIncludedFlag(UInt opsIdx, UInt id) { return m_layerIdIncludedFlag[opsIdx][id]; } |
---|
870 | Void setLayerIdIncludedFlag(Bool v, UInt opsIdx, UInt id) { m_layerIdIncludedFlag[opsIdx][id] = v; } |
---|
871 | |
---|
872 | #if H_MV |
---|
873 | TComPTL* getPTL( Int layerSet = 0 ) { return &m_pcPTL[layerSet]; } |
---|
874 | #else |
---|
875 | TComPTL* getPTL() { return &m_pcPTL; } |
---|
876 | #endif |
---|
877 | TimingInfo* getTimingInfo() { return &m_timingInfo; } |
---|
878 | #if H_MV |
---|
879 | Void setAvcBaseLayerFlag( Bool val ) { m_avcBaseLayerFlag = val; } |
---|
880 | Bool getAvcBaseLayerFlag() { return m_avcBaseLayerFlag; } |
---|
881 | |
---|
882 | Void setVpsVuiOffset( Int val ) { m_vpsVuiOffset = val; } |
---|
883 | Int getVpsVuiOffset( ) { return m_vpsVuiOffset; } |
---|
884 | |
---|
885 | Void setSplittingFlag( Bool val ) { m_splittingFlag = val; } |
---|
886 | Bool getSplittingFlag() { return m_splittingFlag; } |
---|
887 | |
---|
888 | Void setScalabilityMaskFlag( UInt val ); |
---|
889 | Void setScalabilityMaskFlag( Int scalType, Bool val ) { m_scalabilityMaskFlag[scalType] = val; } |
---|
890 | Bool getScalabilityMaskFlag( Int scalType ) { return m_scalabilityMaskFlag[scalType]; } |
---|
891 | Int getNumScalabilityTypes( ); |
---|
892 | |
---|
893 | Void setDimensionIdLen( Int sIdx, Int val ) { m_dimensionIdLen[sIdx] = val; } |
---|
894 | Int getDimensionIdLen( Int sIdx ) { assert( m_dimensionIdLen[sIdx] > 0) ; return m_dimensionIdLen[sIdx]; } |
---|
895 | |
---|
896 | Void setVpsNuhLayerIdPresentFlag( Bool val ) { m_vpsNuhLayerIdPresentFlag = val; } |
---|
897 | Bool getVpsNuhLayerIdPresentFlag() { return m_vpsNuhLayerIdPresentFlag; } |
---|
898 | |
---|
899 | Void setLayerIdInNuh( Int layerIdInVps, Int val ) { m_layerIdInNuh[layerIdInVps] = val; } |
---|
900 | Int getLayerIdInNuh( Int layerIdInVps ) { assert( m_layerIdInNuh[layerIdInVps] >= 0 ); return m_layerIdInNuh[layerIdInVps]; } |
---|
901 | |
---|
902 | Bool nuhLayerIdIncluded( Int layerIdinNuh ) { return ( m_layerIdInVps[ layerIdinNuh ] > 0 ); } |
---|
903 | |
---|
904 | Void setDimensionId( Int layerIdInVps, Int scalIdx, Int val ) { m_dimensionId[layerIdInVps][scalIdx] = val; } |
---|
905 | Int getDimensionId( Int layerIdInVps, Int scalIdx ) { return m_dimensionId[layerIdInVps][scalIdx]; } |
---|
906 | |
---|
907 | Void setViewIdLen( Int val ) { m_viewIdLen = val; } |
---|
908 | Int getViewIdLen( ) { return m_viewIdLen; } |
---|
909 | |
---|
910 | Void setViewIdVal( Int viewOrderIndex, Int val ) { m_viewIdVal[viewOrderIndex] = val; } |
---|
911 | Int getViewIdVal( Int viewOrderIndex ) { return m_viewIdVal[viewOrderIndex]; } |
---|
912 | Void setDirectDependencyFlag( Int depLayeridInVps, Int refLayeridInVps, Bool val ) { m_directDependencyFlag[depLayeridInVps][refLayeridInVps] = val; } |
---|
913 | Bool getDirectDependencyFlag( Int depLayeridInVps, Int refLayeridInVps ) { return m_directDependencyFlag[depLayeridInVps][refLayeridInVps]; } |
---|
914 | Void setVpsSubLayersMaxMinus1PresentFlag( Bool flag ) { m_vpsSubLayersMaxMinus1PresentFlag = flag; } |
---|
915 | Bool getVpsSubLayersMaxMinus1PresentFlag( ) { return m_vpsSubLayersMaxMinus1PresentFlag; } |
---|
916 | Void setSubLayersVpsMaxMinus1( Int i, Int val ) { m_subLayersVpsMaxMinus1[i] = val; } |
---|
917 | Int getSubLayersVpsMaxMinus1( Int i ) { return m_subLayersVpsMaxMinus1[i]; } |
---|
918 | Void checkSubLayersVpsMaxMinus1( Int i ) { assert( m_subLayersVpsMaxMinus1[i] >= 0 && m_subLayersVpsMaxMinus1[i] <= m_uiMaxTLayers - 1 ); } |
---|
919 | Void setMaxTidRefPresentFlag( Bool flag ) { m_maxTidRefPresentFlag = flag; } |
---|
920 | Bool getMaxTidRefPresentFlag( ) { return m_maxTidRefPresentFlag; } |
---|
921 | Void setMaxTidIlRefPicsPlus1( Int i, Int j, Int val ) { m_maxTidIlRefPicsPlus1[i][j] = val; } |
---|
922 | Int getMaxTidIlRefPicsPlus1( Int i, Int j ) { return m_maxTidIlRefPicsPlus1[i][j]; } |
---|
923 | Void setAllRefLayersActiveFlag( Bool flag ) { m_allRefLayersActiveFlag = flag; } |
---|
924 | Bool getAllRefLayersActiveFlag( ) { return m_allRefLayersActiveFlag; } |
---|
925 | Void setVpsNumberLayerSetsMinus1( Int val ) { m_vpsNumberLayerSetsMinus1 = val; } |
---|
926 | Int getVpsNumberLayerSetsMinus1( ) { return m_vpsNumberLayerSetsMinus1; } |
---|
927 | |
---|
928 | Void setVpsNumProfileTierLevelMinus1( Int val ) { m_vpsNumProfileTierLevelMinus1 = val; } |
---|
929 | Int getVpsNumProfileTierLevelMinus1( ) { return m_vpsNumProfileTierLevelMinus1; } |
---|
930 | |
---|
931 | Void setVpsProfilePresentFlag( Int idx, Bool val ) { m_vpsProfilePresentFlag[idx] = val; } |
---|
932 | Bool getVpsProfilePresentFlag( Int idx ) { return m_vpsProfilePresentFlag[idx]; } |
---|
933 | |
---|
934 | Void setProfileRefMinus1( Int profileTierLevelIdx, Int val ) { m_profileRefMinus1[ profileTierLevelIdx ] = val; } |
---|
935 | Int getProfileRefMinus1( Int profileTierLevelIdx ) { return m_profileRefMinus1[ profileTierLevelIdx ]; } |
---|
936 | 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. |
---|
937 | Void setMoreOutputLayerSetsThanDefaultFlag( Bool flag ) { m_moreOutputLayerSetsThanDefaultFlag = flag; } |
---|
938 | Bool getMoreOutputLayerSetsThanDefaultFlag() { return m_moreOutputLayerSetsThanDefaultFlag; } |
---|
939 | |
---|
940 | Void setNumAddOutputLayerSetsMinus1( Int val ) { m_numAddOutputLayerSetsMinus1 = val; } |
---|
941 | Int getNumAddOutputLayerSetsMinus1( ) { return m_numAddOutputLayerSetsMinus1; } |
---|
942 | |
---|
943 | Void setDefaultOneTargetOutputLayerIdc( Int val ) { m_defaultOneTargetOutputLayerIdc = val; } |
---|
944 | Int getDefaultOneTargetOutputLayerIdc( ) { return m_defaultOneTargetOutputLayerIdc; } |
---|
945 | Void checkDefaultOneTargetOutputLayerIdc( ) { assert( m_defaultOneTargetOutputLayerIdc >= 0 && m_defaultOneTargetOutputLayerIdc <= 1 ); } |
---|
946 | |
---|
947 | Void setOutputLayerSetIdxMinus1( Int outLayerSetIdx, Int val ) { m_outputLayerSetIdxMinus1[ outLayerSetIdx ] = val; } |
---|
948 | Int getOutputLayerSetIdxMinus1( Int outLayerSetIdx ) { return m_outputLayerSetIdxMinus1[ outLayerSetIdx ]; } |
---|
949 | |
---|
950 | Void setOutputLayerFlag( Int outLayerSetIdx, Int i, Bool flag ) { m_outputLayerFlag[ outLayerSetIdx ][ i ] = flag; } |
---|
951 | Bool getOutputLayerFlag( Int outLayerSetIdx, Int i ) { return m_outputLayerFlag[ outLayerSetIdx ][ i ]; } |
---|
952 | Bool inferOutputLayerFlag( Int layerSetIdx, Int i ) { return ( getDefaultOneTargetOutputLayerIdc( ) == 0 || ( ( getDefaultOneTargetOutputLayerIdc( ) == 1 ) && ( i == m_layerSetLayerIdList[layerSetIdx].size() - 1 ) )); } |
---|
953 | |
---|
954 | Void setProfileLevelTierIdx( Int outLayerSetIdx, Int val ) { m_profileLevelTierIdx[ outLayerSetIdx = val ]; } |
---|
955 | Int getProfileLevelTierIdx( Int outLayerSetIdx ) { return m_profileLevelTierIdx[ outLayerSetIdx ]; } |
---|
956 | Void setAltOutputLayerFlag( Bool flag ) { m_altOutputLayerFlag = flag; } |
---|
957 | Bool getAltOutputLayerFlag( ) { return m_altOutputLayerFlag; } |
---|
958 | |
---|
959 | Void setRepFormatIdxPresentFlag( Bool flag ) { m_repFormatIdxPresentFlag = flag; } |
---|
960 | Bool getRepFormatIdxPresentFlag( ) { return m_repFormatIdxPresentFlag; } |
---|
961 | |
---|
962 | Void setVpsNumRepFormatsMinus1( Int val ) { m_vpsNumRepFormatsMinus1 = val; } |
---|
963 | Int getVpsNumRepFormatsMinus1( ) { return m_vpsNumRepFormatsMinus1; } |
---|
964 | |
---|
965 | Void setVpsRepFormatIdx( Int i, Int val ) { m_vpsRepFormatIdx[i] = val; } |
---|
966 | Int getVpsRepFormatIdx( Int i ) { return m_vpsRepFormatIdx[i]; } |
---|
967 | |
---|
968 | Void setRepFormat( Int i, TComRepFormat* val ) { m_repFormat[i] = val; } |
---|
969 | TComRepFormat* getRepFormat( Int i ) { return m_repFormat[i]; } |
---|
970 | Void setMaxOneActiveRefLayerFlag( Bool flag) { m_maxOneActiveRefLayerFlag = flag; } |
---|
971 | Bool getMaxOneActiveRefLayerFlag( ) { return m_maxOneActiveRefLayerFlag; } |
---|
972 | |
---|
973 | Void setDpbSize( TComDpbSize* val ) { assert( m_dpbSize != 0 ); m_dpbSize = val; } |
---|
974 | TComDpbSize* getDpbSize( ) { return m_dpbSize;} |
---|
975 | |
---|
976 | Void setPocLsbNotPresentFlag( Int i, Bool flag ) { m_pocLsbNotPresentFlag[i] = flag; } |
---|
977 | Bool getPocLsbNotPresentFlag( Int i ) { return m_pocLsbNotPresentFlag[i]; } |
---|
978 | Void setDirectDepTypeLenMinus2( Int val) { m_directDepTypeLenMinus2 = val; } |
---|
979 | Int getDirectDepTypeLenMinus2( ) { return m_directDepTypeLenMinus2; } |
---|
980 | |
---|
981 | Void setDefaultDirectDependencyFlag( Bool flag ) { m_defaultDirectDependencyFlag = flag; } |
---|
982 | Bool getDefaultDirectDependencyFlag( ) { return m_defaultDirectDependencyFlag; } |
---|
983 | |
---|
984 | Void setDefaultDirectDependencyType( Int val ) { m_defaultDirectDependencyType = val; } |
---|
985 | Int getDefaultDirectDependencyType( ) { return m_defaultDirectDependencyType; } |
---|
986 | Void setDirectDependencyType( Int depLayeridInVps, Int refLayeridInVps, Int val) { m_directDependencyType[ depLayeridInVps ][ refLayeridInVps ] = val; } |
---|
987 | Int getDirectDependencyType( Int depLayeridInVps, Int refLayeridInVps) { return m_directDependencyType[ depLayeridInVps ][ refLayeridInVps ]; } |
---|
988 | Void setVpsVuiPresentFlag( Bool flag ) { m_vpsVuiPresentFlag = flag; } |
---|
989 | Bool getVpsVuiPresentFlag( ) { return m_vpsVuiPresentFlag; } |
---|
990 | |
---|
991 | TComVPSVUI* getVPSVUI( ) { return m_vpsVUI; } |
---|
992 | |
---|
993 | // VPS EXTENSION SEMANTICS VARIABLES |
---|
994 | Void setLayerIdInVps( Int layerIdInNuh, Int val ) { m_layerIdInVps[layerIdInNuh] = val; } |
---|
995 | Int getLayerIdInVps( Int layerIdInNuh ) { assert( m_layerIdInVps[layerIdInNuh] >= 0 ); return m_layerIdInVps[layerIdInNuh]; } |
---|
996 | |
---|
997 | Int getScalabilityId ( Int layerIdInVps, ScalabilityType scalType ); |
---|
998 | Int getViewId ( Int layerIdInNuh ) { return m_viewIdVal[ getViewIndex( layerIdInNuh )]; } |
---|
999 | Void setRefLayers(); |
---|
1000 | |
---|
1001 | Int getViewIndex ( Int layerIdInNuh ) { return getScalabilityId( getLayerIdInVps(layerIdInNuh), VIEW_ORDER_INDEX ); } |
---|
1002 | Int getNumViews(); |
---|
1003 | |
---|
1004 | Int getNumDirectRefLayers( Int layerIdInNuh ) { return m_numDirectRefLayers[ layerIdInNuh ]; }; |
---|
1005 | Int getRefLayerId ( Int layerIdInNuh, Int idx );; |
---|
1006 | Bool checkVPSExtensionSyntax(); |
---|
1007 | Int scalTypeToScalIdx ( ScalabilityType scalType ); |
---|
1008 | |
---|
1009 | Int getProfileLevelTierIdxLen() { return gCeilLog2( getVpsNumProfileTierLevelMinus1() + 1 ); }; |
---|
1010 | |
---|
1011 | Int getNumLayersInIdList ( Int lsIdx ); |
---|
1012 | |
---|
1013 | Int getNumOutputLayerSets() ; |
---|
1014 | Int getNumSubDpbs( Int i ) { return getNumLayersInIdList( i ); }; |
---|
1015 | Bool isOutputLayer( Int outLayerSetIdx, Int layerIdInNuh ); |
---|
1016 | Void deriveLayerSetLayerIdList(); |
---|
1017 | Void deriveTargetLayerIdLists(); |
---|
1018 | std::vector<Int> getTargetDecLayerIdList( Int targetOptLayerSetIdx ) { return m_targetDecLayerIdLists[targetOptLayerSetIdx]; }; |
---|
1019 | std::vector<Int> getTargetOptLayerIdList( Int targetOptLayerSetIdx ) { return m_targetDecLayerIdLists[targetOptLayerSetIdx]; }; |
---|
1020 | |
---|
1021 | |
---|
1022 | // inference |
---|
1023 | Int inferDimensionId ( Int i, Int j ); |
---|
1024 | Int inferLastDimsionIdLenMinus1(); |
---|
1025 | |
---|
1026 | // helpers |
---|
1027 | Bool getInDirectDependencyFlag( Int depLayeridInVps, Int refLayeridInVps, Int depth = 0 ); |
---|
1028 | /// VPS EXTENSION 2 SYNTAX ELEMENTS |
---|
1029 | #if H_3D |
---|
1030 | Int getDepthId ( Int layerIdInNuh) { return getScalabilityId( getLayerIdInVps(layerIdInNuh), DEPTH_ID ); } |
---|
1031 | Int getLayerIdInNuh( Int viewIndex, Bool depthFlag ); |
---|
1032 | |
---|
1033 | #if H_3D_ARP |
---|
1034 | UInt getUseAdvRP ( Int layerIdInVps ) { return m_uiUseAdvResPred[layerIdInVps]; } |
---|
1035 | UInt getARPStepNum( Int layerIdInVps ) { return m_uiARPStepNum[layerIdInVps]; } |
---|
1036 | Void setUseAdvRP ( Int layerIdInVps, UInt val ) { m_uiUseAdvResPred[layerIdInVps] = val; } |
---|
1037 | Void setARPStepNum( Int layerIdInVps, UInt val ) { m_uiARPStepNum[layerIdInVps] = val; } |
---|
1038 | #endif |
---|
1039 | |
---|
1040 | Void createCamPars(Int iNumViews); |
---|
1041 | Void deleteCamPars(); |
---|
1042 | Void initCamParaVPS ( UInt uiViewIndex, Bool bCamParPresent = false, UInt uiCamParPrecision = 0, Bool bCamParSlice = false, Int** aaiScale = 0, Int** aaiOffset = 0 ); |
---|
1043 | UInt getCamParPrecision () { return m_uiCamParPrecision; } |
---|
1044 | Bool getCamParPresent ( Int viewIndex ) { return m_bCamParPresent[viewIndex]; } |
---|
1045 | Bool hasCamParInSliceHeader( Int viewIndex ) { return m_bCamParInSliceHeader[viewIndex]; } |
---|
1046 | Void setHasCamParInSliceHeader( Int viewIndex, Bool b ) { m_bCamParInSliceHeader[viewIndex] = b; } |
---|
1047 | Int* getCodedScale ( Int viewIndex ) { return m_aaaiCodedScale [viewIndex][0]; } |
---|
1048 | Int* getCodedOffset ( Int viewIndex ) { return m_aaaiCodedOffset[viewIndex][0]; } |
---|
1049 | Int* getInvCodedScale ( Int viewIndex ) { return m_aaaiCodedScale [viewIndex][1]; } |
---|
1050 | Int* getInvCodedOffset ( Int viewIndex ) { return m_aaaiCodedOffset[viewIndex][1]; } |
---|
1051 | |
---|
1052 | #if H_3D_IV_MERGE |
---|
1053 | Void setIvMvPredFlag ( Int layerIdInVps, Bool val ) { m_ivMvPredFlag[ layerIdInVps ] = val; } |
---|
1054 | Bool getIvMvPredFlag ( Int layerIdInVps ) { return m_ivMvPredFlag[ layerIdInVps ]; }; |
---|
1055 | #if H_3D_SPIVMP |
---|
1056 | Int getSubPULog2Size(Int layerIdInVps) { return m_iSubPULog2Size[layerIdInVps]; } |
---|
1057 | Void setSubPULog2Size(Int layerIdInVps, Int u) { m_iSubPULog2Size[layerIdInVps] = u;} |
---|
1058 | #endif |
---|
1059 | #endif |
---|
1060 | #if H_3D_VSP |
---|
1061 | Void setViewSynthesisPredFlag ( Int layerIdInVps, Bool val ) { m_viewSynthesisPredFlag[ layerIdInVps ] = val; } |
---|
1062 | Bool getViewSynthesisPredFlag ( Int layerIdInVps ) { return m_viewSynthesisPredFlag[ layerIdInVps ]; }; |
---|
1063 | #endif |
---|
1064 | #if H_3D_NBDV_REF |
---|
1065 | Void setDepthRefinementFlag ( Int layerIdInVps, Bool val ) { m_depthRefinementFlag[ layerIdInVps ] = val; } |
---|
1066 | Bool getDepthRefinementFlag ( Int layerIdInVps ) { return m_depthRefinementFlag[ layerIdInVps ]; }; |
---|
1067 | #endif |
---|
1068 | Void setVpsDepthModesFlag( Int layerIdInVps, Bool val ) { m_vpsDepthModesFlag[ layerIdInVps ] = val; } |
---|
1069 | Bool getVpsDepthModesFlag( Int layerIdInVps ) { return m_vpsDepthModesFlag[ layerIdInVps ]; } |
---|
1070 | |
---|
1071 | Bool getIvMvScalingFlag ( ) { return m_ivMvScalingFlag; } |
---|
1072 | Void setIvMvScalingFlag ( Bool b ) { m_ivMvScalingFlag = b; } |
---|
1073 | #if H_3D_INTER_SDC |
---|
1074 | Bool getInterSDCFlag ( Int layerIdInVps ) { return m_bInterSDCFlag[layerIdInVps]; } |
---|
1075 | Void setInterSDCFlag ( Int layerIdInVps, Bool bval ){ m_bInterSDCFlag[layerIdInVps] = bval; } |
---|
1076 | #endif |
---|
1077 | #if H_3D_IV_MERGE |
---|
1078 | Bool getMPIFlag ( Int layerIdInVps ) { return m_bMPIFlag[layerIdInVps]; } |
---|
1079 | Void setMPIFlag ( Int layerIdInVps, Bool bval ){ m_bMPIFlag[layerIdInVps] = bval; } |
---|
1080 | #endif |
---|
1081 | #endif |
---|
1082 | #endif |
---|
1083 | }; |
---|
1084 | |
---|
1085 | #if H_3D |
---|
1086 | class TComDLT |
---|
1087 | { |
---|
1088 | private: |
---|
1089 | Bool m_bDltPresentFlag; |
---|
1090 | Bool m_bUseDLTFlag [ MAX_NUM_LAYERS ]; |
---|
1091 | Bool m_bInterViewDltPredEnableFlag[ MAX_NUM_LAYERS ]; |
---|
1092 | |
---|
1093 | Int m_iBitsPerDepthValue [ MAX_NUM_LAYERS ]; |
---|
1094 | Int m_iNumDepthmapValues [ MAX_NUM_LAYERS ]; |
---|
1095 | Int* m_iDepthValue2Idx [ MAX_NUM_LAYERS ]; |
---|
1096 | Int* m_iIdx2DepthValue [ MAX_NUM_LAYERS ]; |
---|
1097 | |
---|
1098 | Int m_iNumDepthViews; |
---|
1099 | UInt m_uiDepthViewBitDepth; |
---|
1100 | |
---|
1101 | public: |
---|
1102 | TComDLT(); |
---|
1103 | ~TComDLT(); |
---|
1104 | |
---|
1105 | Bool getDltPresentFlag () { return m_bDltPresentFlag; } |
---|
1106 | Void setDltPresentFlag ( Bool b ) { m_bDltPresentFlag = b; } |
---|
1107 | |
---|
1108 | Bool getUseDLTFlag ( Int layerIdInVps ) { return m_bUseDLTFlag[ layerIdInVps ]; } |
---|
1109 | Void setUseDLTFlag ( Int layerIdInVps, Bool b ) { m_bUseDLTFlag[ layerIdInVps ] = b; } |
---|
1110 | |
---|
1111 | Bool getInterViewDltPredEnableFlag( Int layerIdInVps ) { return m_bInterViewDltPredEnableFlag[ layerIdInVps ]; } |
---|
1112 | Void setInterViewDltPredEnableFlag( Int layerIdInVps, Bool b ) { m_bInterViewDltPredEnableFlag[ layerIdInVps ] = b; } |
---|
1113 | |
---|
1114 | Void setNumDepthViews ( Int n ) { m_iNumDepthViews = n; } |
---|
1115 | Int getNumDepthViews () { return m_iNumDepthViews; } |
---|
1116 | |
---|
1117 | Void setDepthViewBitDepth( UInt n ) { m_uiDepthViewBitDepth = n; } |
---|
1118 | UInt getDepthViewBitDepth() { return m_uiDepthViewBitDepth; } |
---|
1119 | |
---|
1120 | Int getBitsPerDepthValue( Int layerIdInVps ) { return getUseDLTFlag(layerIdInVps)?m_iBitsPerDepthValue[layerIdInVps]:g_bitDepthY; } |
---|
1121 | Int getNumDepthValues( Int layerIdInVps ) { return getUseDLTFlag(layerIdInVps)?m_iNumDepthmapValues[layerIdInVps]:((1 << g_bitDepthY)-1); } |
---|
1122 | Int depthValue2idx( Int layerIdInVps, Pel value ) { return getUseDLTFlag(layerIdInVps)?m_iDepthValue2Idx[layerIdInVps][value]:value; } |
---|
1123 | Pel idx2DepthValue( Int layerIdInVps, UInt uiIdx ) { return getUseDLTFlag(layerIdInVps)?m_iIdx2DepthValue[layerIdInVps][uiIdx]:uiIdx; } |
---|
1124 | Void setDepthLUTs( Int layerIdInVps, Int* idx2DepthValue = NULL, Int iNumDepthValues = 0 ); |
---|
1125 | #if H_3D_DELTA_DLT |
---|
1126 | Int* idx2DepthValue( Int layerIdInVps ) { return m_iIdx2DepthValue[layerIdInVps]; } |
---|
1127 | Void getDeltaDLT( Int layerIdInVps, Int* piDLTInRef, UInt uiDLTInRefNum, Int* piDeltaDLTOut, UInt *puiDeltaDLTOutNum ); |
---|
1128 | Void setDeltaDLT( Int layerIdInVps, Int* piDLTInRef, UInt uiDLTInRefNum, Int* piDeltaDLTIn, UInt uiDeltaDLTInNum ); |
---|
1129 | #endif |
---|
1130 | }; |
---|
1131 | #endif |
---|
1132 | |
---|
1133 | class Window |
---|
1134 | { |
---|
1135 | private: |
---|
1136 | Bool m_enabledFlag; |
---|
1137 | Int m_winLeftOffset; |
---|
1138 | Int m_winRightOffset; |
---|
1139 | Int m_winTopOffset; |
---|
1140 | Int m_winBottomOffset; |
---|
1141 | #if H_MV |
---|
1142 | Bool m_scaledFlag; |
---|
1143 | #endif |
---|
1144 | public: |
---|
1145 | Window() |
---|
1146 | : m_enabledFlag (false) |
---|
1147 | , m_winLeftOffset (0) |
---|
1148 | , m_winRightOffset (0) |
---|
1149 | , m_winTopOffset (0) |
---|
1150 | , m_winBottomOffset (0) |
---|
1151 | #if H_MV |
---|
1152 | , m_scaledFlag(true) |
---|
1153 | #endif |
---|
1154 | { } |
---|
1155 | |
---|
1156 | Bool getWindowEnabledFlag() const { return m_enabledFlag; } |
---|
1157 | Void resetWindow() { m_enabledFlag = false; m_winLeftOffset = m_winRightOffset = m_winTopOffset = m_winBottomOffset = 0; } |
---|
1158 | Int getWindowLeftOffset() const { return m_enabledFlag ? m_winLeftOffset : 0; } |
---|
1159 | Void setWindowLeftOffset(Int val) { m_winLeftOffset = val; m_enabledFlag = true; } |
---|
1160 | Int getWindowRightOffset() const { return m_enabledFlag ? m_winRightOffset : 0; } |
---|
1161 | Void setWindowRightOffset(Int val) { m_winRightOffset = val; m_enabledFlag = true; } |
---|
1162 | Int getWindowTopOffset() const { return m_enabledFlag ? m_winTopOffset : 0; } |
---|
1163 | Void setWindowTopOffset(Int val) { m_winTopOffset = val; m_enabledFlag = true; } |
---|
1164 | Int getWindowBottomOffset() const { return m_enabledFlag ? m_winBottomOffset: 0; } |
---|
1165 | Void setWindowBottomOffset(Int val) { m_winBottomOffset = val; m_enabledFlag = true; } |
---|
1166 | |
---|
1167 | #if H_MV |
---|
1168 | Void setScaledFlag(Bool flag) { m_scaledFlag = flag; } |
---|
1169 | Bool getScaledFlag() const { return m_scaledFlag; } |
---|
1170 | Void scaleOffsets( Int scal ) |
---|
1171 | { |
---|
1172 | if (! m_scaledFlag ) |
---|
1173 | { |
---|
1174 | m_scaledFlag = true; |
---|
1175 | m_winLeftOffset *= scal; |
---|
1176 | m_winRightOffset *= scal; |
---|
1177 | m_winTopOffset *= scal; |
---|
1178 | m_winBottomOffset *= scal; |
---|
1179 | } |
---|
1180 | } |
---|
1181 | #endif |
---|
1182 | Void setWindow(Int offsetLeft, Int offsetLRight, Int offsetLTop, Int offsetLBottom) |
---|
1183 | { |
---|
1184 | m_enabledFlag = true; |
---|
1185 | m_winLeftOffset = offsetLeft; |
---|
1186 | m_winRightOffset = offsetLRight; |
---|
1187 | m_winTopOffset = offsetLTop; |
---|
1188 | m_winBottomOffset = offsetLBottom; |
---|
1189 | } |
---|
1190 | }; |
---|
1191 | |
---|
1192 | |
---|
1193 | class TComVUI |
---|
1194 | { |
---|
1195 | private: |
---|
1196 | Bool m_aspectRatioInfoPresentFlag; |
---|
1197 | Int m_aspectRatioIdc; |
---|
1198 | Int m_sarWidth; |
---|
1199 | Int m_sarHeight; |
---|
1200 | Bool m_overscanInfoPresentFlag; |
---|
1201 | Bool m_overscanAppropriateFlag; |
---|
1202 | Bool m_videoSignalTypePresentFlag; |
---|
1203 | Int m_videoFormat; |
---|
1204 | Bool m_videoFullRangeFlag; |
---|
1205 | Bool m_colourDescriptionPresentFlag; |
---|
1206 | Int m_colourPrimaries; |
---|
1207 | Int m_transferCharacteristics; |
---|
1208 | Int m_matrixCoefficients; |
---|
1209 | Bool m_chromaLocInfoPresentFlag; |
---|
1210 | Int m_chromaSampleLocTypeTopField; |
---|
1211 | Int m_chromaSampleLocTypeBottomField; |
---|
1212 | Bool m_neutralChromaIndicationFlag; |
---|
1213 | Bool m_fieldSeqFlag; |
---|
1214 | |
---|
1215 | Window m_defaultDisplayWindow; |
---|
1216 | Bool m_frameFieldInfoPresentFlag; |
---|
1217 | Bool m_hrdParametersPresentFlag; |
---|
1218 | Bool m_bitstreamRestrictionFlag; |
---|
1219 | Bool m_tilesFixedStructureFlag; |
---|
1220 | Bool m_motionVectorsOverPicBoundariesFlag; |
---|
1221 | Bool m_restrictedRefPicListsFlag; |
---|
1222 | Int m_minSpatialSegmentationIdc; |
---|
1223 | Int m_maxBytesPerPicDenom; |
---|
1224 | Int m_maxBitsPerMinCuDenom; |
---|
1225 | Int m_log2MaxMvLengthHorizontal; |
---|
1226 | Int m_log2MaxMvLengthVertical; |
---|
1227 | TComHRD m_hrdParameters; |
---|
1228 | TimingInfo m_timingInfo; |
---|
1229 | |
---|
1230 | public: |
---|
1231 | TComVUI() |
---|
1232 | :m_aspectRatioInfoPresentFlag(false) |
---|
1233 | ,m_aspectRatioIdc(0) |
---|
1234 | ,m_sarWidth(0) |
---|
1235 | ,m_sarHeight(0) |
---|
1236 | ,m_overscanInfoPresentFlag(false) |
---|
1237 | ,m_overscanAppropriateFlag(false) |
---|
1238 | ,m_videoSignalTypePresentFlag(false) |
---|
1239 | ,m_videoFormat(5) |
---|
1240 | ,m_videoFullRangeFlag(false) |
---|
1241 | ,m_colourDescriptionPresentFlag(false) |
---|
1242 | ,m_colourPrimaries(2) |
---|
1243 | ,m_transferCharacteristics(2) |
---|
1244 | ,m_matrixCoefficients(2) |
---|
1245 | ,m_chromaLocInfoPresentFlag(false) |
---|
1246 | ,m_chromaSampleLocTypeTopField(0) |
---|
1247 | ,m_chromaSampleLocTypeBottomField(0) |
---|
1248 | ,m_neutralChromaIndicationFlag(false) |
---|
1249 | ,m_fieldSeqFlag(false) |
---|
1250 | ,m_frameFieldInfoPresentFlag(false) |
---|
1251 | ,m_hrdParametersPresentFlag(false) |
---|
1252 | ,m_bitstreamRestrictionFlag(false) |
---|
1253 | ,m_tilesFixedStructureFlag(false) |
---|
1254 | ,m_motionVectorsOverPicBoundariesFlag(true) |
---|
1255 | ,m_restrictedRefPicListsFlag(1) |
---|
1256 | ,m_minSpatialSegmentationIdc(0) |
---|
1257 | ,m_maxBytesPerPicDenom(2) |
---|
1258 | ,m_maxBitsPerMinCuDenom(1) |
---|
1259 | ,m_log2MaxMvLengthHorizontal(15) |
---|
1260 | ,m_log2MaxMvLengthVertical(15) |
---|
1261 | {} |
---|
1262 | |
---|
1263 | virtual ~TComVUI() {} |
---|
1264 | |
---|
1265 | Bool getAspectRatioInfoPresentFlag() { return m_aspectRatioInfoPresentFlag; } |
---|
1266 | Void setAspectRatioInfoPresentFlag(Bool i) { m_aspectRatioInfoPresentFlag = i; } |
---|
1267 | |
---|
1268 | Int getAspectRatioIdc() { return m_aspectRatioIdc; } |
---|
1269 | Void setAspectRatioIdc(Int i) { m_aspectRatioIdc = i; } |
---|
1270 | |
---|
1271 | Int getSarWidth() { return m_sarWidth; } |
---|
1272 | Void setSarWidth(Int i) { m_sarWidth = i; } |
---|
1273 | |
---|
1274 | Int getSarHeight() { return m_sarHeight; } |
---|
1275 | Void setSarHeight(Int i) { m_sarHeight = i; } |
---|
1276 | |
---|
1277 | Bool getOverscanInfoPresentFlag() { return m_overscanInfoPresentFlag; } |
---|
1278 | Void setOverscanInfoPresentFlag(Bool i) { m_overscanInfoPresentFlag = i; } |
---|
1279 | |
---|
1280 | Bool getOverscanAppropriateFlag() { return m_overscanAppropriateFlag; } |
---|
1281 | Void setOverscanAppropriateFlag(Bool i) { m_overscanAppropriateFlag = i; } |
---|
1282 | |
---|
1283 | Bool getVideoSignalTypePresentFlag() { return m_videoSignalTypePresentFlag; } |
---|
1284 | Void setVideoSignalTypePresentFlag(Bool i) { m_videoSignalTypePresentFlag = i; } |
---|
1285 | |
---|
1286 | Int getVideoFormat() { return m_videoFormat; } |
---|
1287 | Void setVideoFormat(Int i) { m_videoFormat = i; } |
---|
1288 | |
---|
1289 | Bool getVideoFullRangeFlag() { return m_videoFullRangeFlag; } |
---|
1290 | Void setVideoFullRangeFlag(Bool i) { m_videoFullRangeFlag = i; } |
---|
1291 | |
---|
1292 | Bool getColourDescriptionPresentFlag() { return m_colourDescriptionPresentFlag; } |
---|
1293 | Void setColourDescriptionPresentFlag(Bool i) { m_colourDescriptionPresentFlag = i; } |
---|
1294 | |
---|
1295 | Int getColourPrimaries() { return m_colourPrimaries; } |
---|
1296 | Void setColourPrimaries(Int i) { m_colourPrimaries = i; } |
---|
1297 | |
---|
1298 | Int getTransferCharacteristics() { return m_transferCharacteristics; } |
---|
1299 | Void setTransferCharacteristics(Int i) { m_transferCharacteristics = i; } |
---|
1300 | |
---|
1301 | Int getMatrixCoefficients() { return m_matrixCoefficients; } |
---|
1302 | Void setMatrixCoefficients(Int i) { m_matrixCoefficients = i; } |
---|
1303 | |
---|
1304 | Bool getChromaLocInfoPresentFlag() { return m_chromaLocInfoPresentFlag; } |
---|
1305 | Void setChromaLocInfoPresentFlag(Bool i) { m_chromaLocInfoPresentFlag = i; } |
---|
1306 | |
---|
1307 | Int getChromaSampleLocTypeTopField() { return m_chromaSampleLocTypeTopField; } |
---|
1308 | Void setChromaSampleLocTypeTopField(Int i) { m_chromaSampleLocTypeTopField = i; } |
---|
1309 | |
---|
1310 | Int getChromaSampleLocTypeBottomField() { return m_chromaSampleLocTypeBottomField; } |
---|
1311 | Void setChromaSampleLocTypeBottomField(Int i) { m_chromaSampleLocTypeBottomField = i; } |
---|
1312 | |
---|
1313 | Bool getNeutralChromaIndicationFlag() { return m_neutralChromaIndicationFlag; } |
---|
1314 | Void setNeutralChromaIndicationFlag(Bool i) { m_neutralChromaIndicationFlag = i; } |
---|
1315 | |
---|
1316 | Bool getFieldSeqFlag() { return m_fieldSeqFlag; } |
---|
1317 | Void setFieldSeqFlag(Bool i) { m_fieldSeqFlag = i; } |
---|
1318 | |
---|
1319 | Bool getFrameFieldInfoPresentFlag() { return m_frameFieldInfoPresentFlag; } |
---|
1320 | Void setFrameFieldInfoPresentFlag(Bool i) { m_frameFieldInfoPresentFlag = i; } |
---|
1321 | |
---|
1322 | Window& getDefaultDisplayWindow() { return m_defaultDisplayWindow; } |
---|
1323 | Void setDefaultDisplayWindow(Window& defaultDisplayWindow ) { m_defaultDisplayWindow = defaultDisplayWindow; } |
---|
1324 | |
---|
1325 | Bool getHrdParametersPresentFlag() { return m_hrdParametersPresentFlag; } |
---|
1326 | Void setHrdParametersPresentFlag(Bool i) { m_hrdParametersPresentFlag = i; } |
---|
1327 | |
---|
1328 | Bool getBitstreamRestrictionFlag() { return m_bitstreamRestrictionFlag; } |
---|
1329 | Void setBitstreamRestrictionFlag(Bool i) { m_bitstreamRestrictionFlag = i; } |
---|
1330 | |
---|
1331 | Bool getTilesFixedStructureFlag() { return m_tilesFixedStructureFlag; } |
---|
1332 | Void setTilesFixedStructureFlag(Bool i) { m_tilesFixedStructureFlag = i; } |
---|
1333 | |
---|
1334 | Bool getMotionVectorsOverPicBoundariesFlag() { return m_motionVectorsOverPicBoundariesFlag; } |
---|
1335 | Void setMotionVectorsOverPicBoundariesFlag(Bool i) { m_motionVectorsOverPicBoundariesFlag = i; } |
---|
1336 | |
---|
1337 | Bool getRestrictedRefPicListsFlag() { return m_restrictedRefPicListsFlag; } |
---|
1338 | Void setRestrictedRefPicListsFlag(Bool b) { m_restrictedRefPicListsFlag = b; } |
---|
1339 | |
---|
1340 | Int getMinSpatialSegmentationIdc() { return m_minSpatialSegmentationIdc; } |
---|
1341 | Void setMinSpatialSegmentationIdc(Int i) { m_minSpatialSegmentationIdc = i; } |
---|
1342 | Int getMaxBytesPerPicDenom() { return m_maxBytesPerPicDenom; } |
---|
1343 | Void setMaxBytesPerPicDenom(Int i) { m_maxBytesPerPicDenom = i; } |
---|
1344 | |
---|
1345 | Int getMaxBitsPerMinCuDenom() { return m_maxBitsPerMinCuDenom; } |
---|
1346 | Void setMaxBitsPerMinCuDenom(Int i) { m_maxBitsPerMinCuDenom = i; } |
---|
1347 | |
---|
1348 | Int getLog2MaxMvLengthHorizontal() { return m_log2MaxMvLengthHorizontal; } |
---|
1349 | Void setLog2MaxMvLengthHorizontal(Int i) { m_log2MaxMvLengthHorizontal = i; } |
---|
1350 | |
---|
1351 | Int getLog2MaxMvLengthVertical() { return m_log2MaxMvLengthVertical; } |
---|
1352 | Void setLog2MaxMvLengthVertical(Int i) { m_log2MaxMvLengthVertical = i; } |
---|
1353 | |
---|
1354 | TComHRD* getHrdParameters () { return &m_hrdParameters; } |
---|
1355 | TimingInfo* getTimingInfo() { return &m_timingInfo; } |
---|
1356 | #if H_MV |
---|
1357 | Void inferVideoSignalInfo( TComVPS* vps, Int layerIdCurr ); |
---|
1358 | #endif |
---|
1359 | }; |
---|
1360 | |
---|
1361 | /// SPS class |
---|
1362 | class TComSPS |
---|
1363 | { |
---|
1364 | private: |
---|
1365 | Int m_SPSId; |
---|
1366 | Int m_VPSId; |
---|
1367 | Int m_chromaFormatIdc; |
---|
1368 | |
---|
1369 | UInt m_uiMaxTLayers; // maximum number of temporal layers |
---|
1370 | |
---|
1371 | // Structure |
---|
1372 | UInt m_picWidthInLumaSamples; |
---|
1373 | UInt m_picHeightInLumaSamples; |
---|
1374 | |
---|
1375 | Int m_log2MinCodingBlockSize; |
---|
1376 | Int m_log2DiffMaxMinCodingBlockSize; |
---|
1377 | UInt m_uiMaxCUWidth; |
---|
1378 | UInt m_uiMaxCUHeight; |
---|
1379 | UInt m_uiMaxCUDepth; |
---|
1380 | |
---|
1381 | Window m_conformanceWindow; |
---|
1382 | |
---|
1383 | TComRPSList m_RPSList; |
---|
1384 | Bool m_bLongTermRefsPresent; |
---|
1385 | Bool m_TMVPFlagsPresent; |
---|
1386 | Int m_numReorderPics[MAX_TLAYER]; |
---|
1387 | |
---|
1388 | // Tool list |
---|
1389 | UInt m_uiQuadtreeTULog2MaxSize; |
---|
1390 | UInt m_uiQuadtreeTULog2MinSize; |
---|
1391 | UInt m_uiQuadtreeTUMaxDepthInter; |
---|
1392 | UInt m_uiQuadtreeTUMaxDepthIntra; |
---|
1393 | Bool m_usePCM; |
---|
1394 | UInt m_pcmLog2MaxSize; |
---|
1395 | UInt m_uiPCMLog2MinSize; |
---|
1396 | Bool m_useAMP; |
---|
1397 | |
---|
1398 | #if H_3D_QTLPC |
---|
1399 | Bool m_bUseQTL; |
---|
1400 | Bool m_bUsePC; |
---|
1401 | #endif |
---|
1402 | // Parameter |
---|
1403 | Int m_bitDepthY; |
---|
1404 | Int m_bitDepthC; |
---|
1405 | Int m_qpBDOffsetY; |
---|
1406 | Int m_qpBDOffsetC; |
---|
1407 | |
---|
1408 | Bool m_useLossless; |
---|
1409 | |
---|
1410 | UInt m_uiPCMBitDepthLuma; |
---|
1411 | UInt m_uiPCMBitDepthChroma; |
---|
1412 | Bool m_bPCMFilterDisableFlag; |
---|
1413 | |
---|
1414 | UInt m_uiBitsForPOC; |
---|
1415 | UInt m_numLongTermRefPicSPS; |
---|
1416 | UInt m_ltRefPicPocLsbSps[33]; |
---|
1417 | Bool m_usedByCurrPicLtSPSFlag[33]; |
---|
1418 | // Max physical transform size |
---|
1419 | UInt m_uiMaxTrSize; |
---|
1420 | |
---|
1421 | Int m_iAMPAcc[MAX_CU_DEPTH]; |
---|
1422 | Bool m_bUseSAO; |
---|
1423 | |
---|
1424 | Bool m_bTemporalIdNestingFlag; // temporal_id_nesting_flag |
---|
1425 | |
---|
1426 | Bool m_scalingListEnabledFlag; |
---|
1427 | Bool m_scalingListPresentFlag; |
---|
1428 | TComScalingList* m_scalingList; //!< ScalingList class pointer |
---|
1429 | UInt m_uiMaxDecPicBuffering[MAX_TLAYER]; |
---|
1430 | UInt m_uiMaxLatencyIncrease[MAX_TLAYER]; // Really max latency increase plus 1 (value 0 expresses no limit) |
---|
1431 | |
---|
1432 | Bool m_useDF; |
---|
1433 | Bool m_useStrongIntraSmoothing; |
---|
1434 | |
---|
1435 | Bool m_vuiParametersPresentFlag; |
---|
1436 | TComVUI m_vuiParameters; |
---|
1437 | |
---|
1438 | static const Int m_winUnitX[MAX_CHROMA_FORMAT_IDC+1]; |
---|
1439 | static const Int m_winUnitY[MAX_CHROMA_FORMAT_IDC+1]; |
---|
1440 | TComPTL m_pcPTL; |
---|
1441 | #if H_MV |
---|
1442 | TComVPS* m_pcVPS; |
---|
1443 | // SPS |
---|
1444 | Bool m_spsExtensionFlag; |
---|
1445 | Bool m_spsExtensionTypeFlag[PS_EX_T_MAX_NUM]; |
---|
1446 | Bool m_spsInferScalingListFlag; |
---|
1447 | Int m_spsScalingListRefLayerId; |
---|
1448 | Bool m_updateRepFormatFlag; |
---|
1449 | Int m_spsRepFormatIdx; |
---|
1450 | // SPS Extension |
---|
1451 | Bool m_interViewMvVertConstraintFlag; |
---|
1452 | Int m_numScaledRefLayerOffsets; |
---|
1453 | Int m_scaledRefLayerId [MAX_NUM_SCALED_REF_LAYERS]; |
---|
1454 | Int m_scaledRefLayerLeftOffset [MAX_NUM_LAYERS]; |
---|
1455 | Int m_scaledRefLayerTopOffset [MAX_NUM_LAYERS]; |
---|
1456 | Int m_scaledRefLayerRightOffset [MAX_NUM_LAYERS]; |
---|
1457 | Int m_scaledRefLayerBottomOffset[MAX_NUM_LAYERS]; |
---|
1458 | #endif |
---|
1459 | #if H_3D |
---|
1460 | UInt m_uiCamParPrecision; |
---|
1461 | Bool m_bCamParInSliceHeader; |
---|
1462 | Int m_aaiCodedScale [2][MAX_NUM_LAYERS]; |
---|
1463 | Int m_aaiCodedOffset[2][MAX_NUM_LAYERS]; |
---|
1464 | #endif |
---|
1465 | #if H_MV |
---|
1466 | Int m_layerId; |
---|
1467 | #endif |
---|
1468 | public: |
---|
1469 | TComSPS(); |
---|
1470 | virtual ~TComSPS(); |
---|
1471 | |
---|
1472 | Int getVPSId () { return m_VPSId; } |
---|
1473 | Void setVPSId (Int i) { m_VPSId = i; } |
---|
1474 | Int getSPSId () { return m_SPSId; } |
---|
1475 | Void setSPSId (Int i) { m_SPSId = i; } |
---|
1476 | Int getChromaFormatIdc () { return m_chromaFormatIdc; } |
---|
1477 | Void setChromaFormatIdc (Int i) { m_chromaFormatIdc = i; } |
---|
1478 | |
---|
1479 | static Int getWinUnitX (Int chromaFormatIdc) { assert (chromaFormatIdc > 0 && chromaFormatIdc <= MAX_CHROMA_FORMAT_IDC); return m_winUnitX[chromaFormatIdc]; } |
---|
1480 | static Int getWinUnitY (Int chromaFormatIdc) { assert (chromaFormatIdc > 0 && chromaFormatIdc <= MAX_CHROMA_FORMAT_IDC); return m_winUnitY[chromaFormatIdc]; } |
---|
1481 | |
---|
1482 | // structure |
---|
1483 | Void setPicWidthInLumaSamples ( UInt u ) { m_picWidthInLumaSamples = u; } |
---|
1484 | UInt getPicWidthInLumaSamples () { return m_picWidthInLumaSamples; } |
---|
1485 | Void setPicHeightInLumaSamples ( UInt u ) { m_picHeightInLumaSamples = u; } |
---|
1486 | UInt getPicHeightInLumaSamples () { return m_picHeightInLumaSamples; } |
---|
1487 | |
---|
1488 | Window& getConformanceWindow() { return m_conformanceWindow; } |
---|
1489 | Void setConformanceWindow(Window& conformanceWindow ) { m_conformanceWindow = conformanceWindow; } |
---|
1490 | |
---|
1491 | UInt getNumLongTermRefPicSPS() { return m_numLongTermRefPicSPS; } |
---|
1492 | Void setNumLongTermRefPicSPS(UInt val) { m_numLongTermRefPicSPS = val; } |
---|
1493 | |
---|
1494 | UInt getLtRefPicPocLsbSps(UInt index) { return m_ltRefPicPocLsbSps[index]; } |
---|
1495 | Void setLtRefPicPocLsbSps(UInt index, UInt val) { m_ltRefPicPocLsbSps[index] = val; } |
---|
1496 | |
---|
1497 | Bool getUsedByCurrPicLtSPSFlag(Int i) {return m_usedByCurrPicLtSPSFlag[i];} |
---|
1498 | Void setUsedByCurrPicLtSPSFlag(Int i, Bool x) { m_usedByCurrPicLtSPSFlag[i] = x;} |
---|
1499 | |
---|
1500 | Int getLog2MinCodingBlockSize() const { return m_log2MinCodingBlockSize; } |
---|
1501 | Void setLog2MinCodingBlockSize(Int val) { m_log2MinCodingBlockSize = val; } |
---|
1502 | Int getLog2DiffMaxMinCodingBlockSize() const { return m_log2DiffMaxMinCodingBlockSize; } |
---|
1503 | Void setLog2DiffMaxMinCodingBlockSize(Int val) { m_log2DiffMaxMinCodingBlockSize = val; } |
---|
1504 | |
---|
1505 | Void setMaxCUWidth ( UInt u ) { m_uiMaxCUWidth = u; } |
---|
1506 | UInt getMaxCUWidth () { return m_uiMaxCUWidth; } |
---|
1507 | Void setMaxCUHeight ( UInt u ) { m_uiMaxCUHeight = u; } |
---|
1508 | UInt getMaxCUHeight () { return m_uiMaxCUHeight; } |
---|
1509 | Void setMaxCUDepth ( UInt u ) { m_uiMaxCUDepth = u; } |
---|
1510 | UInt getMaxCUDepth () { return m_uiMaxCUDepth; } |
---|
1511 | Void setUsePCM ( Bool b ) { m_usePCM = b; } |
---|
1512 | Bool getUsePCM () { return m_usePCM; } |
---|
1513 | Void setPCMLog2MaxSize ( UInt u ) { m_pcmLog2MaxSize = u; } |
---|
1514 | UInt getPCMLog2MaxSize () { return m_pcmLog2MaxSize; } |
---|
1515 | Void setPCMLog2MinSize ( UInt u ) { m_uiPCMLog2MinSize = u; } |
---|
1516 | UInt getPCMLog2MinSize () { return m_uiPCMLog2MinSize; } |
---|
1517 | Void setBitsForPOC ( UInt u ) { m_uiBitsForPOC = u; } |
---|
1518 | UInt getBitsForPOC () { return m_uiBitsForPOC; } |
---|
1519 | Bool getUseAMP() { return m_useAMP; } |
---|
1520 | Void setUseAMP( Bool b ) { m_useAMP = b; } |
---|
1521 | Void setQuadtreeTULog2MaxSize( UInt u ) { m_uiQuadtreeTULog2MaxSize = u; } |
---|
1522 | UInt getQuadtreeTULog2MaxSize() { return m_uiQuadtreeTULog2MaxSize; } |
---|
1523 | Void setQuadtreeTULog2MinSize( UInt u ) { m_uiQuadtreeTULog2MinSize = u; } |
---|
1524 | UInt getQuadtreeTULog2MinSize() { return m_uiQuadtreeTULog2MinSize; } |
---|
1525 | Void setQuadtreeTUMaxDepthInter( UInt u ) { m_uiQuadtreeTUMaxDepthInter = u; } |
---|
1526 | Void setQuadtreeTUMaxDepthIntra( UInt u ) { m_uiQuadtreeTUMaxDepthIntra = u; } |
---|
1527 | UInt getQuadtreeTUMaxDepthInter() { return m_uiQuadtreeTUMaxDepthInter; } |
---|
1528 | UInt getQuadtreeTUMaxDepthIntra() { return m_uiQuadtreeTUMaxDepthIntra; } |
---|
1529 | Void setNumReorderPics(Int i, UInt tlayer) { m_numReorderPics[tlayer] = i; } |
---|
1530 | Int getNumReorderPics(UInt tlayer) { return m_numReorderPics[tlayer]; } |
---|
1531 | Void createRPSList( Int numRPS ); |
---|
1532 | TComRPSList* getRPSList() { return &m_RPSList; } |
---|
1533 | Bool getLongTermRefsPresent() { return m_bLongTermRefsPresent; } |
---|
1534 | Void setLongTermRefsPresent(Bool b) { m_bLongTermRefsPresent=b; } |
---|
1535 | Bool getTMVPFlagsPresent() { return m_TMVPFlagsPresent; } |
---|
1536 | Void setTMVPFlagsPresent(Bool b) { m_TMVPFlagsPresent=b; } |
---|
1537 | // physical transform |
---|
1538 | Void setMaxTrSize ( UInt u ) { m_uiMaxTrSize = u; } |
---|
1539 | UInt getMaxTrSize () { return m_uiMaxTrSize; } |
---|
1540 | |
---|
1541 | // Tool list |
---|
1542 | Bool getUseLossless () { return m_useLossless; } |
---|
1543 | Void setUseLossless ( Bool b ) { m_useLossless = b; } |
---|
1544 | |
---|
1545 | // AMP accuracy |
---|
1546 | Int getAMPAcc ( UInt uiDepth ) { return m_iAMPAcc[uiDepth]; } |
---|
1547 | Void setAMPAcc ( UInt uiDepth, Int iAccu ) { assert( uiDepth < g_uiMaxCUDepth); m_iAMPAcc[uiDepth] = iAccu; } |
---|
1548 | |
---|
1549 | // Bit-depth |
---|
1550 | Int getBitDepthY() { return m_bitDepthY; } |
---|
1551 | Void setBitDepthY(Int u) { m_bitDepthY = u; } |
---|
1552 | Int getBitDepthC() { return m_bitDepthC; } |
---|
1553 | Void setBitDepthC(Int u) { m_bitDepthC = u; } |
---|
1554 | Int getQpBDOffsetY () { return m_qpBDOffsetY; } |
---|
1555 | Void setQpBDOffsetY ( Int value ) { m_qpBDOffsetY = value; } |
---|
1556 | Int getQpBDOffsetC () { return m_qpBDOffsetC; } |
---|
1557 | Void setQpBDOffsetC ( Int value ) { m_qpBDOffsetC = value; } |
---|
1558 | Void setUseSAO (Bool bVal) {m_bUseSAO = bVal;} |
---|
1559 | Bool getUseSAO () {return m_bUseSAO;} |
---|
1560 | |
---|
1561 | UInt getMaxTLayers() { return m_uiMaxTLayers; } |
---|
1562 | Void setMaxTLayers( UInt uiMaxTLayers ) { assert( uiMaxTLayers <= MAX_TLAYER ); m_uiMaxTLayers = uiMaxTLayers; } |
---|
1563 | |
---|
1564 | Bool getTemporalIdNestingFlag() { return m_bTemporalIdNestingFlag; } |
---|
1565 | Void setTemporalIdNestingFlag( Bool bValue ) { m_bTemporalIdNestingFlag = bValue; } |
---|
1566 | UInt getPCMBitDepthLuma () { return m_uiPCMBitDepthLuma; } |
---|
1567 | Void setPCMBitDepthLuma ( UInt u ) { m_uiPCMBitDepthLuma = u; } |
---|
1568 | UInt getPCMBitDepthChroma () { return m_uiPCMBitDepthChroma; } |
---|
1569 | Void setPCMBitDepthChroma ( UInt u ) { m_uiPCMBitDepthChroma = u; } |
---|
1570 | Void setPCMFilterDisableFlag ( Bool bValue ) { m_bPCMFilterDisableFlag = bValue; } |
---|
1571 | Bool getPCMFilterDisableFlag () { return m_bPCMFilterDisableFlag; } |
---|
1572 | |
---|
1573 | Bool getScalingListFlag () { return m_scalingListEnabledFlag; } |
---|
1574 | Void setScalingListFlag ( Bool b ) { m_scalingListEnabledFlag = b; } |
---|
1575 | Bool getScalingListPresentFlag() { return m_scalingListPresentFlag; } |
---|
1576 | Void setScalingListPresentFlag( Bool b ) { m_scalingListPresentFlag = b; } |
---|
1577 | Void setScalingList ( TComScalingList *scalingList); |
---|
1578 | TComScalingList* getScalingList () { return m_scalingList; } //!< get ScalingList class pointer in SPS |
---|
1579 | UInt getMaxDecPicBuffering (UInt tlayer) { return m_uiMaxDecPicBuffering[tlayer]; } |
---|
1580 | Void setMaxDecPicBuffering ( UInt ui, UInt tlayer ) { m_uiMaxDecPicBuffering[tlayer] = ui; } |
---|
1581 | UInt getMaxLatencyIncrease (UInt tlayer) { return m_uiMaxLatencyIncrease[tlayer]; } |
---|
1582 | Void setMaxLatencyIncrease ( UInt ui , UInt tlayer) { m_uiMaxLatencyIncrease[tlayer] = ui; } |
---|
1583 | |
---|
1584 | Void setUseStrongIntraSmoothing (Bool bVal) {m_useStrongIntraSmoothing = bVal;} |
---|
1585 | Bool getUseStrongIntraSmoothing () {return m_useStrongIntraSmoothing;} |
---|
1586 | |
---|
1587 | Bool getVuiParametersPresentFlag() { return m_vuiParametersPresentFlag; } |
---|
1588 | Void setVuiParametersPresentFlag(Bool b) { m_vuiParametersPresentFlag = b; } |
---|
1589 | TComVUI* getVuiParameters() { return &m_vuiParameters; } |
---|
1590 | Void setHrdParameters( UInt frameRate, UInt numDU, UInt bitRate, Bool randomAccess ); |
---|
1591 | |
---|
1592 | TComPTL* getPTL() { return &m_pcPTL; } |
---|
1593 | #if H_MV |
---|
1594 | Void setSpsExtensionFlag( Bool flag ) { m_spsExtensionFlag = flag; } |
---|
1595 | Bool getSpsExtensionFlag( ) { return m_spsExtensionFlag; } |
---|
1596 | |
---|
1597 | Void setSpsExtensionTypeFlag( Int i, Bool flag ) { m_spsExtensionTypeFlag[i] = flag; } |
---|
1598 | Bool getSpsExtensionTypeFlag( Int i ) { return m_spsExtensionTypeFlag[i]; } |
---|
1599 | Void setVPS ( TComVPS* pcVPS ) { m_pcVPS = pcVPS; } |
---|
1600 | TComVPS* getVPS () { return m_pcVPS; } |
---|
1601 | |
---|
1602 | Void setSpsInferScalingListFlag( Bool flag ) { m_spsInferScalingListFlag = flag; } |
---|
1603 | Bool getSpsInferScalingListFlag( ) { return m_spsInferScalingListFlag; } |
---|
1604 | |
---|
1605 | Void setSpsScalingListRefLayerId( Int val ) { m_spsScalingListRefLayerId = val; } |
---|
1606 | Int getSpsScalingListRefLayerId( ) { return m_spsScalingListRefLayerId; } |
---|
1607 | |
---|
1608 | Void setUpdateRepFormatFlag( Bool flag ) { m_updateRepFormatFlag = flag; } |
---|
1609 | Bool getUpdateRepFormatFlag( ) { return m_updateRepFormatFlag; } |
---|
1610 | Void setSpsRepFormatIdx( Int val ) { m_spsRepFormatIdx = val; } |
---|
1611 | Int getSpsRepFormatIdx( ) { return m_spsRepFormatIdx; } |
---|
1612 | // SPS Extension |
---|
1613 | Void setInterViewMvVertConstraintFlag(Bool val) { m_interViewMvVertConstraintFlag = val; } |
---|
1614 | Bool getInterViewMvVertConstraintFlag() { return m_interViewMvVertConstraintFlag;} |
---|
1615 | |
---|
1616 | Void setNumScaledRefLayerOffsets( Int val ) { m_numScaledRefLayerOffsets = val; } |
---|
1617 | Int getNumScaledRefLayerOffsets( ) { return m_numScaledRefLayerOffsets; } |
---|
1618 | |
---|
1619 | Void setScaledRefLayerId( Int i, Int val ) { m_scaledRefLayerId[i] = val; } |
---|
1620 | Int getScaledRefLayerId( Int i ) { return m_scaledRefLayerId[i]; } |
---|
1621 | |
---|
1622 | Void setScaledRefLayerLeftOffset( Int j, Int val ) { m_scaledRefLayerLeftOffset[j] = val; } |
---|
1623 | Int getScaledRefLayerLeftOffset( Int j ) { return m_scaledRefLayerLeftOffset[j]; } |
---|
1624 | |
---|
1625 | Void setScaledRefLayerTopOffset( Int j, Int val ) { m_scaledRefLayerTopOffset[j] = val; } |
---|
1626 | Int getScaledRefLayerTopOffset( Int j ) { return m_scaledRefLayerTopOffset[j]; } |
---|
1627 | |
---|
1628 | Void setScaledRefLayerRightOffset( Int j, Int val ) { m_scaledRefLayerRightOffset[j] = val; } |
---|
1629 | Int getScaledRefLayerRightOffset( Int j ) { return m_scaledRefLayerRightOffset[j]; } |
---|
1630 | |
---|
1631 | Void setScaledRefLayerBottomOffset( Int j, Int val ) { m_scaledRefLayerBottomOffset[j] = val; } |
---|
1632 | Int getScaledRefLayerBottomOffset( Int j ) { return m_scaledRefLayerBottomOffset[j]; } |
---|
1633 | // Inference |
---|
1634 | Void inferRepFormat( TComVPS* vps, Int layerIdCurr ); |
---|
1635 | |
---|
1636 | Void inferScalingList( TComSPS* spsSrc ); |
---|
1637 | #endif |
---|
1638 | #if H_3D_QTLPC |
---|
1639 | Void setUseQTL( Bool b ) { m_bUseQTL = b; } |
---|
1640 | Bool getUseQTL() { return m_bUseQTL; } |
---|
1641 | Void setUsePC ( Bool b ) { m_bUsePC = b; } |
---|
1642 | Bool getUsePC () { return m_bUsePC; } |
---|
1643 | #endif |
---|
1644 | #if H_MV |
---|
1645 | Int getLayerId () { return m_layerId; } |
---|
1646 | Void setLayerId ( Int val ) { m_layerId = val; } |
---|
1647 | #endif |
---|
1648 | |
---|
1649 | }; |
---|
1650 | |
---|
1651 | /// Reference Picture Lists class |
---|
1652 | class TComRefPicListModification |
---|
1653 | { |
---|
1654 | private: |
---|
1655 | UInt m_bRefPicListModificationFlagL0; |
---|
1656 | UInt m_bRefPicListModificationFlagL1; |
---|
1657 | UInt m_RefPicSetIdxL0[32]; |
---|
1658 | UInt m_RefPicSetIdxL1[32]; |
---|
1659 | |
---|
1660 | public: |
---|
1661 | TComRefPicListModification(); |
---|
1662 | virtual ~TComRefPicListModification(); |
---|
1663 | |
---|
1664 | Void create (); |
---|
1665 | Void destroy (); |
---|
1666 | |
---|
1667 | Bool getRefPicListModificationFlagL0() { return m_bRefPicListModificationFlagL0; } |
---|
1668 | Void setRefPicListModificationFlagL0(Bool flag) { m_bRefPicListModificationFlagL0 = flag; } |
---|
1669 | Bool getRefPicListModificationFlagL1() { return m_bRefPicListModificationFlagL1; } |
---|
1670 | Void setRefPicListModificationFlagL1(Bool flag) { m_bRefPicListModificationFlagL1 = flag; } |
---|
1671 | Void setRefPicSetIdxL0(UInt idx, UInt refPicSetIdx) { m_RefPicSetIdxL0[idx] = refPicSetIdx; } |
---|
1672 | UInt getRefPicSetIdxL0(UInt idx) { return m_RefPicSetIdxL0[idx]; } |
---|
1673 | Void setRefPicSetIdxL1(UInt idx, UInt refPicSetIdx) { m_RefPicSetIdxL1[idx] = refPicSetIdx; } |
---|
1674 | UInt getRefPicSetIdxL1(UInt idx) { return m_RefPicSetIdxL1[idx]; } |
---|
1675 | #if H_MV |
---|
1676 | // Why not an listIdx for all members, would avoid code duplication?? |
---|
1677 | Void setRefPicSetIdxL(UInt li, UInt idx, UInt refPicSetIdx) {( li==0 ? m_RefPicSetIdxL0[idx] : m_RefPicSetIdxL1[idx] ) = refPicSetIdx; } |
---|
1678 | UInt getRefPicSetIdxL(UInt li, UInt idx ) { return ( li == 0 ) ? m_RefPicSetIdxL0[idx] : m_RefPicSetIdxL1[idx] ; } |
---|
1679 | Void setRefPicListModificationFlagL(UInt li, Bool flag) { ( li==0 ? m_bRefPicListModificationFlagL0 : m_bRefPicListModificationFlagL1 ) = flag; } |
---|
1680 | Bool getRefPicListModificationFlagL(UInt li ) { return ( li== 0) ? m_bRefPicListModificationFlagL0 : m_bRefPicListModificationFlagL1; } |
---|
1681 | #endif |
---|
1682 | }; |
---|
1683 | |
---|
1684 | /// PPS class |
---|
1685 | class TComPPS |
---|
1686 | { |
---|
1687 | private: |
---|
1688 | Int m_PPSId; // pic_parameter_set_id |
---|
1689 | Int m_SPSId; // seq_parameter_set_id |
---|
1690 | Int m_picInitQPMinus26; |
---|
1691 | Bool m_useDQP; |
---|
1692 | Bool m_bConstrainedIntraPred; // constrained_intra_pred_flag |
---|
1693 | Bool m_bSliceChromaQpFlag; // slicelevel_chroma_qp_flag |
---|
1694 | |
---|
1695 | // access channel |
---|
1696 | TComSPS* m_pcSPS; |
---|
1697 | UInt m_uiMaxCuDQPDepth; |
---|
1698 | UInt m_uiMinCuDQPSize; |
---|
1699 | |
---|
1700 | Int m_chromaCbQpOffset; |
---|
1701 | Int m_chromaCrQpOffset; |
---|
1702 | |
---|
1703 | UInt m_numRefIdxL0DefaultActive; |
---|
1704 | UInt m_numRefIdxL1DefaultActive; |
---|
1705 | |
---|
1706 | Bool m_bUseWeightPred; // Use of Weighting Prediction (P_SLICE) |
---|
1707 | Bool m_useWeightedBiPred; // Use of Weighting Bi-Prediction (B_SLICE) |
---|
1708 | Bool m_OutputFlagPresentFlag; // Indicates the presence of output_flag in slice header |
---|
1709 | |
---|
1710 | Bool m_TransquantBypassEnableFlag; // Indicates presence of cu_transquant_bypass_flag in CUs. |
---|
1711 | Bool m_useTransformSkip; |
---|
1712 | Bool m_dependentSliceSegmentsEnabledFlag; //!< Indicates the presence of dependent slices |
---|
1713 | Bool m_tilesEnabledFlag; //!< Indicates the presence of tiles |
---|
1714 | Bool m_entropyCodingSyncEnabledFlag; //!< Indicates the presence of wavefronts |
---|
1715 | |
---|
1716 | Bool m_loopFilterAcrossTilesEnabledFlag; |
---|
1717 | Int m_uniformSpacingFlag; |
---|
1718 | Int m_iNumColumnsMinus1; |
---|
1719 | UInt* m_puiColumnWidth; |
---|
1720 | Int m_iNumRowsMinus1; |
---|
1721 | UInt* m_puiRowHeight; |
---|
1722 | |
---|
1723 | Int m_iNumSubstreams; |
---|
1724 | |
---|
1725 | Int m_signHideFlag; |
---|
1726 | |
---|
1727 | Bool m_cabacInitPresentFlag; |
---|
1728 | UInt m_encCABACTableIdx; // Used to transmit table selection across slices |
---|
1729 | |
---|
1730 | Bool m_sliceHeaderExtensionPresentFlag; |
---|
1731 | Bool m_loopFilterAcrossSlicesEnabledFlag; |
---|
1732 | Bool m_deblockingFilterControlPresentFlag; |
---|
1733 | Bool m_deblockingFilterOverrideEnabledFlag; |
---|
1734 | Bool m_picDisableDeblockingFilterFlag; |
---|
1735 | Int m_deblockingFilterBetaOffsetDiv2; //< beta offset for deblocking filter |
---|
1736 | Int m_deblockingFilterTcOffsetDiv2; //< tc offset for deblocking filter |
---|
1737 | Bool m_scalingListPresentFlag; |
---|
1738 | TComScalingList* m_scalingList; //!< ScalingList class pointer |
---|
1739 | Bool m_listsModificationPresentFlag; |
---|
1740 | UInt m_log2ParallelMergeLevelMinus2; |
---|
1741 | Int m_numExtraSliceHeaderBits; |
---|
1742 | |
---|
1743 | #if H_MV |
---|
1744 | Int m_layerId; |
---|
1745 | Bool m_ppsInferScalingListFlag; |
---|
1746 | Int m_ppsScalingListRefLayerId; |
---|
1747 | #endif |
---|
1748 | |
---|
1749 | #if H_3D |
---|
1750 | TComDLT* m_pcDLT; |
---|
1751 | #endif |
---|
1752 | |
---|
1753 | public: |
---|
1754 | TComPPS(); |
---|
1755 | virtual ~TComPPS(); |
---|
1756 | |
---|
1757 | Int getPPSId () { return m_PPSId; } |
---|
1758 | Void setPPSId (Int i) { m_PPSId = i; } |
---|
1759 | Int getSPSId () { return m_SPSId; } |
---|
1760 | Void setSPSId (Int i) { m_SPSId = i; } |
---|
1761 | |
---|
1762 | Int getPicInitQPMinus26 () { return m_picInitQPMinus26; } |
---|
1763 | Void setPicInitQPMinus26 ( Int i ) { m_picInitQPMinus26 = i; } |
---|
1764 | Bool getUseDQP () { return m_useDQP; } |
---|
1765 | Void setUseDQP ( Bool b ) { m_useDQP = b; } |
---|
1766 | Bool getConstrainedIntraPred () { return m_bConstrainedIntraPred; } |
---|
1767 | Void setConstrainedIntraPred ( Bool b ) { m_bConstrainedIntraPred = b; } |
---|
1768 | Bool getSliceChromaQpFlag () { return m_bSliceChromaQpFlag; } |
---|
1769 | Void setSliceChromaQpFlag ( Bool b ) { m_bSliceChromaQpFlag = b; } |
---|
1770 | |
---|
1771 | Void setSPS ( TComSPS* pcSPS ) { m_pcSPS = pcSPS; } |
---|
1772 | TComSPS* getSPS () { return m_pcSPS; } |
---|
1773 | Void setMaxCuDQPDepth ( UInt u ) { m_uiMaxCuDQPDepth = u; } |
---|
1774 | UInt getMaxCuDQPDepth () { return m_uiMaxCuDQPDepth;} |
---|
1775 | Void setMinCuDQPSize ( UInt u ) { m_uiMinCuDQPSize = u; } |
---|
1776 | UInt getMinCuDQPSize () { return m_uiMinCuDQPSize; } |
---|
1777 | |
---|
1778 | #if H_3D |
---|
1779 | Void setDLT ( TComDLT* pcDLT ) { m_pcDLT = pcDLT; } |
---|
1780 | TComDLT* getDLT () { return m_pcDLT; } |
---|
1781 | #endif |
---|
1782 | |
---|
1783 | Void setChromaCbQpOffset( Int i ) { m_chromaCbQpOffset = i; } |
---|
1784 | Int getChromaCbQpOffset() { return m_chromaCbQpOffset; } |
---|
1785 | Void setChromaCrQpOffset( Int i ) { m_chromaCrQpOffset = i; } |
---|
1786 | Int getChromaCrQpOffset() { return m_chromaCrQpOffset; } |
---|
1787 | |
---|
1788 | Void setNumRefIdxL0DefaultActive(UInt ui) { m_numRefIdxL0DefaultActive=ui; } |
---|
1789 | UInt getNumRefIdxL0DefaultActive() { return m_numRefIdxL0DefaultActive; } |
---|
1790 | Void setNumRefIdxL1DefaultActive(UInt ui) { m_numRefIdxL1DefaultActive=ui; } |
---|
1791 | UInt getNumRefIdxL1DefaultActive() { return m_numRefIdxL1DefaultActive; } |
---|
1792 | |
---|
1793 | Bool getUseWP () { return m_bUseWeightPred; } |
---|
1794 | Bool getWPBiPred () { return m_useWeightedBiPred; } |
---|
1795 | Void setUseWP ( Bool b ) { m_bUseWeightPred = b; } |
---|
1796 | Void setWPBiPred ( Bool b ) { m_useWeightedBiPred = b; } |
---|
1797 | Void setOutputFlagPresentFlag( Bool b ) { m_OutputFlagPresentFlag = b; } |
---|
1798 | Bool getOutputFlagPresentFlag() { return m_OutputFlagPresentFlag; } |
---|
1799 | Void setTransquantBypassEnableFlag( Bool b ) { m_TransquantBypassEnableFlag = b; } |
---|
1800 | Bool getTransquantBypassEnableFlag() { return m_TransquantBypassEnableFlag; } |
---|
1801 | |
---|
1802 | Bool getUseTransformSkip () { return m_useTransformSkip; } |
---|
1803 | Void setUseTransformSkip ( Bool b ) { m_useTransformSkip = b; } |
---|
1804 | |
---|
1805 | Void setLoopFilterAcrossTilesEnabledFlag (Bool b) { m_loopFilterAcrossTilesEnabledFlag = b; } |
---|
1806 | Bool getLoopFilterAcrossTilesEnabledFlag () { return m_loopFilterAcrossTilesEnabledFlag; } |
---|
1807 | Bool getDependentSliceSegmentsEnabledFlag() const { return m_dependentSliceSegmentsEnabledFlag; } |
---|
1808 | Void setDependentSliceSegmentsEnabledFlag(Bool val) { m_dependentSliceSegmentsEnabledFlag = val; } |
---|
1809 | Bool getTilesEnabledFlag() const { return m_tilesEnabledFlag; } |
---|
1810 | Void setTilesEnabledFlag(Bool val) { m_tilesEnabledFlag = val; } |
---|
1811 | Bool getEntropyCodingSyncEnabledFlag() const { return m_entropyCodingSyncEnabledFlag; } |
---|
1812 | Void setEntropyCodingSyncEnabledFlag(Bool val) { m_entropyCodingSyncEnabledFlag = val; } |
---|
1813 | Void setUniformSpacingFlag ( Bool b ) { m_uniformSpacingFlag = b; } |
---|
1814 | Bool getUniformSpacingFlag () { return m_uniformSpacingFlag; } |
---|
1815 | Void setNumColumnsMinus1 ( Int i ) { m_iNumColumnsMinus1 = i; } |
---|
1816 | Int getNumColumnsMinus1 () { return m_iNumColumnsMinus1; } |
---|
1817 | Void setColumnWidth ( UInt* columnWidth ) |
---|
1818 | { |
---|
1819 | if( m_uniformSpacingFlag == 0 && m_iNumColumnsMinus1 > 0 ) |
---|
1820 | { |
---|
1821 | m_puiColumnWidth = new UInt[ m_iNumColumnsMinus1 ]; |
---|
1822 | |
---|
1823 | for(Int i=0; i<m_iNumColumnsMinus1; i++) |
---|
1824 | { |
---|
1825 | m_puiColumnWidth[i] = columnWidth[i]; |
---|
1826 | } |
---|
1827 | } |
---|
1828 | } |
---|
1829 | UInt getColumnWidth (UInt columnIdx) { return *( m_puiColumnWidth + columnIdx ); } |
---|
1830 | Void setNumRowsMinus1( Int i ) { m_iNumRowsMinus1 = i; } |
---|
1831 | Int getNumRowsMinus1() { return m_iNumRowsMinus1; } |
---|
1832 | Void setRowHeight ( UInt* rowHeight ) |
---|
1833 | { |
---|
1834 | if( m_uniformSpacingFlag == 0 && m_iNumRowsMinus1 > 0 ) |
---|
1835 | { |
---|
1836 | m_puiRowHeight = new UInt[ m_iNumRowsMinus1 ]; |
---|
1837 | |
---|
1838 | for(Int i=0; i<m_iNumRowsMinus1; i++) |
---|
1839 | { |
---|
1840 | m_puiRowHeight[i] = rowHeight[i]; |
---|
1841 | } |
---|
1842 | } |
---|
1843 | } |
---|
1844 | UInt getRowHeight (UInt rowIdx) { return *( m_puiRowHeight + rowIdx ); } |
---|
1845 | Void setNumSubstreams(Int iNumSubstreams) { m_iNumSubstreams = iNumSubstreams; } |
---|
1846 | Int getNumSubstreams() { return m_iNumSubstreams; } |
---|
1847 | |
---|
1848 | Void setSignHideFlag( Int signHideFlag ) { m_signHideFlag = signHideFlag; } |
---|
1849 | Int getSignHideFlag() { return m_signHideFlag; } |
---|
1850 | |
---|
1851 | Void setCabacInitPresentFlag( Bool flag ) { m_cabacInitPresentFlag = flag; } |
---|
1852 | Void setEncCABACTableIdx( Int idx ) { m_encCABACTableIdx = idx; } |
---|
1853 | Bool getCabacInitPresentFlag() { return m_cabacInitPresentFlag; } |
---|
1854 | UInt getEncCABACTableIdx() { return m_encCABACTableIdx; } |
---|
1855 | Void setDeblockingFilterControlPresentFlag( Bool val ) { m_deblockingFilterControlPresentFlag = val; } |
---|
1856 | Bool getDeblockingFilterControlPresentFlag() { return m_deblockingFilterControlPresentFlag; } |
---|
1857 | Void setDeblockingFilterOverrideEnabledFlag( Bool val ) { m_deblockingFilterOverrideEnabledFlag = val; } |
---|
1858 | Bool getDeblockingFilterOverrideEnabledFlag() { return m_deblockingFilterOverrideEnabledFlag; } |
---|
1859 | Void setPicDisableDeblockingFilterFlag(Bool val) { m_picDisableDeblockingFilterFlag = val; } //!< set offset for deblocking filter disabled |
---|
1860 | Bool getPicDisableDeblockingFilterFlag() { return m_picDisableDeblockingFilterFlag; } //!< get offset for deblocking filter disabled |
---|
1861 | Void setDeblockingFilterBetaOffsetDiv2(Int val) { m_deblockingFilterBetaOffsetDiv2 = val; } //!< set beta offset for deblocking filter |
---|
1862 | Int getDeblockingFilterBetaOffsetDiv2() { return m_deblockingFilterBetaOffsetDiv2; } //!< get beta offset for deblocking filter |
---|
1863 | Void setDeblockingFilterTcOffsetDiv2(Int val) { m_deblockingFilterTcOffsetDiv2 = val; } //!< set tc offset for deblocking filter |
---|
1864 | Int getDeblockingFilterTcOffsetDiv2() { return m_deblockingFilterTcOffsetDiv2; } //!< get tc offset for deblocking filter |
---|
1865 | Bool getScalingListPresentFlag() { return m_scalingListPresentFlag; } |
---|
1866 | Void setScalingListPresentFlag( Bool b ) { m_scalingListPresentFlag = b; } |
---|
1867 | Void setScalingList ( TComScalingList *scalingList); |
---|
1868 | TComScalingList* getScalingList () { return m_scalingList; } //!< get ScalingList class pointer in PPS |
---|
1869 | Bool getListsModificationPresentFlag () { return m_listsModificationPresentFlag; } |
---|
1870 | Void setListsModificationPresentFlag ( Bool b ) { m_listsModificationPresentFlag = b; } |
---|
1871 | UInt getLog2ParallelMergeLevelMinus2 () { return m_log2ParallelMergeLevelMinus2; } |
---|
1872 | Void setLog2ParallelMergeLevelMinus2 (UInt mrgLevel) { m_log2ParallelMergeLevelMinus2 = mrgLevel; } |
---|
1873 | Int getNumExtraSliceHeaderBits() { return m_numExtraSliceHeaderBits; } |
---|
1874 | Void setNumExtraSliceHeaderBits(Int i) { m_numExtraSliceHeaderBits = i; } |
---|
1875 | Void setLoopFilterAcrossSlicesEnabledFlag ( Bool bValue ) { m_loopFilterAcrossSlicesEnabledFlag = bValue; } |
---|
1876 | Bool getLoopFilterAcrossSlicesEnabledFlag () { return m_loopFilterAcrossSlicesEnabledFlag; } |
---|
1877 | Bool getSliceHeaderExtensionPresentFlag () { return m_sliceHeaderExtensionPresentFlag; } |
---|
1878 | Void setSliceHeaderExtensionPresentFlag (Bool val) { m_sliceHeaderExtensionPresentFlag = val; } |
---|
1879 | #if H_MV |
---|
1880 | Void setLayerId( Int val ) { m_layerId = val; } |
---|
1881 | Int getLayerId( ) { return m_layerId; } |
---|
1882 | |
---|
1883 | Void setPpsInferScalingListFlag( Bool flag ) { m_ppsInferScalingListFlag = flag; } |
---|
1884 | Bool getPpsInferScalingListFlag( ) { return m_ppsInferScalingListFlag; } |
---|
1885 | |
---|
1886 | Void setPpsScalingListRefLayerId( Int val ) { m_ppsScalingListRefLayerId = val; } |
---|
1887 | Int getPpsScalingListRefLayerId( ) { return m_ppsScalingListRefLayerId; } |
---|
1888 | #endif |
---|
1889 | }; |
---|
1890 | |
---|
1891 | typedef struct |
---|
1892 | { |
---|
1893 | // Explicit weighted prediction parameters parsed in slice header, |
---|
1894 | // or Implicit weighted prediction parameters (8 bits depth values). |
---|
1895 | Bool bPresentFlag; |
---|
1896 | UInt uiLog2WeightDenom; |
---|
1897 | Int iWeight; |
---|
1898 | Int iOffset; |
---|
1899 | |
---|
1900 | // Weighted prediction scaling values built from above parameters (bitdepth scaled): |
---|
1901 | Int w, o, offset, shift, round; |
---|
1902 | } wpScalingParam; |
---|
1903 | |
---|
1904 | typedef struct |
---|
1905 | { |
---|
1906 | Int64 iAC; |
---|
1907 | Int64 iDC; |
---|
1908 | } wpACDCParam; |
---|
1909 | |
---|
1910 | /// slice header class |
---|
1911 | class TComSlice |
---|
1912 | { |
---|
1913 | |
---|
1914 | private: |
---|
1915 | // Bitstream writing |
---|
1916 | Bool m_saoEnabledFlag; |
---|
1917 | Bool m_saoEnabledFlagChroma; ///< SAO Cb&Cr enabled flag |
---|
1918 | Int m_iPPSId; ///< picture parameter set ID |
---|
1919 | Bool m_PicOutputFlag; ///< pic_output_flag |
---|
1920 | Int m_iPOC; |
---|
1921 | #if H_MV |
---|
1922 | Int m_iPOCBeforeReset; |
---|
1923 | #endif |
---|
1924 | Int m_iLastIDR; |
---|
1925 | Int m_iAssociatedIRAP; |
---|
1926 | NalUnitType m_iAssociatedIRAPType; |
---|
1927 | static Int m_prevTid0POC; |
---|
1928 | TComReferencePictureSet *m_pcRPS; |
---|
1929 | TComReferencePictureSet m_LocalRPS; |
---|
1930 | Int m_iBDidx; |
---|
1931 | TComRefPicListModification m_RefPicListModification; |
---|
1932 | NalUnitType m_eNalUnitType; ///< Nal unit type for the slice |
---|
1933 | SliceType m_eSliceType; |
---|
1934 | Int m_iSliceQp; |
---|
1935 | Bool m_dependentSliceSegmentFlag; |
---|
1936 | #if ADAPTIVE_QP_SELECTION |
---|
1937 | Int m_iSliceQpBase; |
---|
1938 | #endif |
---|
1939 | Bool m_deblockingFilterDisable; |
---|
1940 | Bool m_deblockingFilterOverrideFlag; //< offsets for deblocking filter inherit from PPS |
---|
1941 | Int m_deblockingFilterBetaOffsetDiv2; //< beta offset for deblocking filter |
---|
1942 | Int m_deblockingFilterTcOffsetDiv2; //< tc offset for deblocking filter |
---|
1943 | Int m_list1IdxToList0Idx[MAX_NUM_REF]; |
---|
1944 | Int m_aiNumRefIdx [2]; // for multiple reference of current slice |
---|
1945 | |
---|
1946 | Bool m_bCheckLDC; |
---|
1947 | |
---|
1948 | // Data |
---|
1949 | Int m_iSliceQpDelta; |
---|
1950 | Int m_iSliceQpDeltaCb; |
---|
1951 | Int m_iSliceQpDeltaCr; |
---|
1952 | TComPic* m_apcRefPicList [2][MAX_NUM_REF+1]; |
---|
1953 | Int m_aiRefPOCList [2][MAX_NUM_REF+1]; |
---|
1954 | #if H_MV |
---|
1955 | Int m_aiRefLayerIdList[2][MAX_NUM_REF+1]; |
---|
1956 | #endif |
---|
1957 | Bool m_bIsUsedAsLongTerm[2][MAX_NUM_REF+1]; |
---|
1958 | Int m_iDepth; |
---|
1959 | |
---|
1960 | // referenced slice? |
---|
1961 | Bool m_bRefenced; |
---|
1962 | |
---|
1963 | // access channel |
---|
1964 | TComVPS* m_pcVPS; |
---|
1965 | TComSPS* m_pcSPS; |
---|
1966 | TComPPS* m_pcPPS; |
---|
1967 | TComPic* m_pcPic; |
---|
1968 | #if ADAPTIVE_QP_SELECTION |
---|
1969 | TComTrQuant* m_pcTrQuant; |
---|
1970 | #endif |
---|
1971 | UInt m_colFromL0Flag; // collocated picture from List0 flag |
---|
1972 | |
---|
1973 | UInt m_colRefIdx; |
---|
1974 | UInt m_maxNumMergeCand; |
---|
1975 | |
---|
1976 | |
---|
1977 | #if SAO_CHROMA_LAMBDA |
---|
1978 | Double m_dLambdaLuma; |
---|
1979 | Double m_dLambdaChroma; |
---|
1980 | #else |
---|
1981 | Double m_dLambda; |
---|
1982 | #endif |
---|
1983 | |
---|
1984 | Bool m_abEqualRef [2][MAX_NUM_REF][MAX_NUM_REF]; |
---|
1985 | UInt m_uiTLayer; |
---|
1986 | Bool m_bTLayerSwitchingFlag; |
---|
1987 | |
---|
1988 | UInt m_sliceMode; |
---|
1989 | UInt m_sliceArgument; |
---|
1990 | UInt m_sliceCurStartCUAddr; |
---|
1991 | UInt m_sliceCurEndCUAddr; |
---|
1992 | UInt m_sliceIdx; |
---|
1993 | UInt m_sliceSegmentMode; |
---|
1994 | UInt m_sliceSegmentArgument; |
---|
1995 | UInt m_sliceSegmentCurStartCUAddr; |
---|
1996 | UInt m_sliceSegmentCurEndCUAddr; |
---|
1997 | Bool m_nextSlice; |
---|
1998 | Bool m_nextSliceSegment; |
---|
1999 | UInt m_sliceBits; |
---|
2000 | UInt m_sliceSegmentBits; |
---|
2001 | Bool m_bFinalized; |
---|
2002 | |
---|
2003 | wpScalingParam m_weightPredTable[2][MAX_NUM_REF][3]; // [REF_PIC_LIST_0 or REF_PIC_LIST_1][refIdx][0:Y, 1:U, 2:V] |
---|
2004 | wpACDCParam m_weightACDCParam[3]; // [0:Y, 1:U, 2:V] |
---|
2005 | |
---|
2006 | std::vector<UInt> m_tileByteLocation; |
---|
2007 | UInt m_uiTileOffstForMultES; |
---|
2008 | |
---|
2009 | UInt* m_puiSubstreamSizes; |
---|
2010 | TComScalingList* m_scalingList; //!< pointer of quantization matrix |
---|
2011 | Bool m_cabacInitFlag; |
---|
2012 | |
---|
2013 | Bool m_bLMvdL1Zero; |
---|
2014 | Int m_numEntryPointOffsets; |
---|
2015 | Bool m_temporalLayerNonReferenceFlag; |
---|
2016 | Bool m_LFCrossSliceBoundaryFlag; |
---|
2017 | |
---|
2018 | Bool m_enableTMVPFlag; |
---|
2019 | #if H_MV |
---|
2020 | std::vector<TComPic*>* m_refPicSetInterLayer0; |
---|
2021 | std::vector<TComPic*>* m_refPicSetInterLayer1; |
---|
2022 | Int m_layerId; |
---|
2023 | Int m_viewId; |
---|
2024 | Int m_viewIndex; |
---|
2025 | #if H_3D |
---|
2026 | Bool m_isDepth; |
---|
2027 | #endif |
---|
2028 | |
---|
2029 | // Additional slice header syntax elements |
---|
2030 | Bool m_pocResetFlag; |
---|
2031 | Bool m_crossLayerBlaFlag; |
---|
2032 | Bool m_discardableFlag; |
---|
2033 | Bool m_interLayerPredEnabledFlag; |
---|
2034 | Int m_numInterLayerRefPicsMinus1; |
---|
2035 | Int m_interLayerPredLayerIdc [MAX_NUM_LAYERS]; |
---|
2036 | Int m_aaiCodedScale [2][MAX_NUM_LAYERS]; |
---|
2037 | Int m_aaiCodedOffset[2][MAX_NUM_LAYERS]; |
---|
2038 | #if H_3D_TMVP |
---|
2039 | Int m_aiAlterRefIdx [2]; |
---|
2040 | #endif |
---|
2041 | #if H_3D_ARP |
---|
2042 | Bool m_arpRefPicAvailable[2][MAX_NUM_LAYERS]; |
---|
2043 | TComList<TComPic*> * m_pBaseViewRefPicList[MAX_NUM_LAYERS]; |
---|
2044 | UInt m_nARPStepNum; |
---|
2045 | Int m_aiFirstTRefIdx [2]; |
---|
2046 | #endif |
---|
2047 | #if H_3D_IC |
---|
2048 | Bool m_bApplyIC; |
---|
2049 | Bool m_icSkipParseFlag; |
---|
2050 | #endif |
---|
2051 | #if H_3D |
---|
2052 | TComPic* m_ivPicsCurrPoc [2][MAX_NUM_LAYERS]; |
---|
2053 | Int** m_depthToDisparityB; |
---|
2054 | Int** m_depthToDisparityF; |
---|
2055 | #endif |
---|
2056 | #endif |
---|
2057 | public: |
---|
2058 | TComSlice(); |
---|
2059 | virtual ~TComSlice(); |
---|
2060 | Void initSlice (); |
---|
2061 | |
---|
2062 | Void setVPS ( TComVPS* pcVPS ) { m_pcVPS = pcVPS; } |
---|
2063 | TComVPS* getVPS () { return m_pcVPS; } |
---|
2064 | Void setSPS ( TComSPS* pcSPS ) { m_pcSPS = pcSPS; } |
---|
2065 | TComSPS* getSPS () { return m_pcSPS; } |
---|
2066 | |
---|
2067 | Void setPPS ( TComPPS* pcPPS ) { assert(pcPPS!=NULL); m_pcPPS = pcPPS; m_iPPSId = pcPPS->getPPSId(); } |
---|
2068 | TComPPS* getPPS () { return m_pcPPS; } |
---|
2069 | |
---|
2070 | #if ADAPTIVE_QP_SELECTION |
---|
2071 | Void setTrQuant ( TComTrQuant* pcTrQuant ) { m_pcTrQuant = pcTrQuant; } |
---|
2072 | TComTrQuant* getTrQuant () { return m_pcTrQuant; } |
---|
2073 | #endif |
---|
2074 | |
---|
2075 | Void setPPSId ( Int PPSId ) { m_iPPSId = PPSId; } |
---|
2076 | Int getPPSId () { return m_iPPSId; } |
---|
2077 | Void setPicOutputFlag( Bool b ) { m_PicOutputFlag = b; } |
---|
2078 | Bool getPicOutputFlag() { return m_PicOutputFlag; } |
---|
2079 | Void setSaoEnabledFlag(Bool s) {m_saoEnabledFlag =s; } |
---|
2080 | Bool getSaoEnabledFlag() { return m_saoEnabledFlag; } |
---|
2081 | Void setSaoEnabledFlagChroma(Bool s) {m_saoEnabledFlagChroma =s; } //!< set SAO Cb&Cr enabled flag |
---|
2082 | Bool getSaoEnabledFlagChroma() { return m_saoEnabledFlagChroma; } //!< get SAO Cb&Cr enabled flag |
---|
2083 | Void setRPS ( TComReferencePictureSet *pcRPS ) { m_pcRPS = pcRPS; } |
---|
2084 | TComReferencePictureSet* getRPS () { return m_pcRPS; } |
---|
2085 | TComReferencePictureSet* getLocalRPS () { return &m_LocalRPS; } |
---|
2086 | |
---|
2087 | Void setRPSidx ( Int iBDidx ) { m_iBDidx = iBDidx; } |
---|
2088 | Int getRPSidx () { return m_iBDidx; } |
---|
2089 | Int getPrevTid0POC () { return m_prevTid0POC; } |
---|
2090 | TComRefPicListModification* getRefPicListModification() { return &m_RefPicListModification; } |
---|
2091 | Void setLastIDR(Int iIDRPOC) { m_iLastIDR = iIDRPOC; } |
---|
2092 | Int getLastIDR() { return m_iLastIDR; } |
---|
2093 | Void setAssociatedIRAPPOC(Int iAssociatedIRAPPOC) { m_iAssociatedIRAP = iAssociatedIRAPPOC; } |
---|
2094 | Int getAssociatedIRAPPOC() { return m_iAssociatedIRAP; } |
---|
2095 | Void setAssociatedIRAPType(NalUnitType associatedIRAPType) { m_iAssociatedIRAPType = associatedIRAPType; } |
---|
2096 | NalUnitType getAssociatedIRAPType() { return m_iAssociatedIRAPType; } |
---|
2097 | SliceType getSliceType () { return m_eSliceType; } |
---|
2098 | Int getPOC () { return m_iPOC; } |
---|
2099 | Int getSliceQp () { return m_iSliceQp; } |
---|
2100 | Bool getDependentSliceSegmentFlag() const { return m_dependentSliceSegmentFlag; } |
---|
2101 | void setDependentSliceSegmentFlag(Bool val) { m_dependentSliceSegmentFlag = val; } |
---|
2102 | #if ADAPTIVE_QP_SELECTION |
---|
2103 | Int getSliceQpBase () { return m_iSliceQpBase; } |
---|
2104 | #endif |
---|
2105 | Int getSliceQpDelta () { return m_iSliceQpDelta; } |
---|
2106 | Int getSliceQpDeltaCb () { return m_iSliceQpDeltaCb; } |
---|
2107 | Int getSliceQpDeltaCr () { return m_iSliceQpDeltaCr; } |
---|
2108 | Bool getDeblockingFilterDisable() { return m_deblockingFilterDisable; } |
---|
2109 | Bool getDeblockingFilterOverrideFlag() { return m_deblockingFilterOverrideFlag; } |
---|
2110 | Int getDeblockingFilterBetaOffsetDiv2() { return m_deblockingFilterBetaOffsetDiv2; } |
---|
2111 | Int getDeblockingFilterTcOffsetDiv2() { return m_deblockingFilterTcOffsetDiv2; } |
---|
2112 | |
---|
2113 | Int getNumRefIdx ( RefPicList e ) { return m_aiNumRefIdx[e]; } |
---|
2114 | TComPic* getPic () { return m_pcPic; } |
---|
2115 | TComPic* getRefPic ( RefPicList e, Int iRefIdx) { return m_apcRefPicList[e][iRefIdx]; } |
---|
2116 | Int getRefPOC ( RefPicList e, Int iRefIdx) { return m_aiRefPOCList[e][iRefIdx]; } |
---|
2117 | #if H_3D |
---|
2118 | TComPic* getIvPic ( Bool depthFlag, Int viewIndex){ return m_ivPicsCurrPoc[ depthFlag ? 1 : 0 ][ viewIndex ]; } |
---|
2119 | #endif |
---|
2120 | #if H_3D |
---|
2121 | TComPic* getTexturePic () { return m_ivPicsCurrPoc[0][ m_viewIndex ]; } |
---|
2122 | #endif |
---|
2123 | #if H_3D_IC |
---|
2124 | Void setApplyIC( Bool b ) { m_bApplyIC = b; } |
---|
2125 | Bool getApplyIC() { return m_bApplyIC; } |
---|
2126 | Void xSetApplyIC(); |
---|
2127 | Void setIcSkipParseFlag( Bool b ) { m_icSkipParseFlag = b; } |
---|
2128 | Bool getIcSkipParseFlag() { return m_icSkipParseFlag; } |
---|
2129 | #endif |
---|
2130 | #if H_3D_ARP |
---|
2131 | Void setBaseViewRefPicList( TComList<TComPic*> *pListPic, Int iViewIdx ) { m_pBaseViewRefPicList[iViewIdx] = pListPic; } |
---|
2132 | Void setARPStepNum( TComPicLists*ivPicLists ); |
---|
2133 | TComPic* getBaseViewRefPic ( UInt uiPOC , Int iViewIdx ) { return xGetRefPic( *m_pBaseViewRefPicList[iViewIdx], uiPOC ); } |
---|
2134 | UInt getARPStepNum( ) { return m_nARPStepNum; } |
---|
2135 | #endif |
---|
2136 | Int getDepth () { return m_iDepth; } |
---|
2137 | UInt getColFromL0Flag () { return m_colFromL0Flag; } |
---|
2138 | UInt getColRefIdx () { return m_colRefIdx; } |
---|
2139 | Void checkColRefIdx (UInt curSliceIdx, TComPic* pic); |
---|
2140 | Bool getIsUsedAsLongTerm (Int i, Int j) { return m_bIsUsedAsLongTerm[i][j]; } |
---|
2141 | Void setIsUsedAsLongTerm (Int i, Int j, Bool value) { m_bIsUsedAsLongTerm[i][j] = value; } |
---|
2142 | Bool getCheckLDC () { return m_bCheckLDC; } |
---|
2143 | Bool getMvdL1ZeroFlag () { return m_bLMvdL1Zero; } |
---|
2144 | Int getNumRpsCurrTempList(); |
---|
2145 | Int getList1IdxToList0Idx ( Int list1Idx ) { return m_list1IdxToList0Idx[list1Idx]; } |
---|
2146 | Void setReferenced(Bool b) { m_bRefenced = b; } |
---|
2147 | Bool isReferenced() { return m_bRefenced; } |
---|
2148 | 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) ); } |
---|
2149 | 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;} } |
---|
2150 | Void setNalUnitType ( NalUnitType e ) { m_eNalUnitType = e; } |
---|
2151 | NalUnitType getNalUnitType () const { return m_eNalUnitType; } |
---|
2152 | Bool getRapPicFlag (); |
---|
2153 | Bool getIdrPicFlag () { return getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP; } |
---|
2154 | Bool isIRAP () const { return (getNalUnitType() >= 16) && (getNalUnitType() <= 23); } |
---|
2155 | Void checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, NalUnitType& associatedIRAPType, TComList<TComPic *>& rcListPic); |
---|
2156 | Void decodingRefreshMarking(Int& pocCRA, Bool& bRefreshPending, TComList<TComPic*>& rcListPic); |
---|
2157 | Void setSliceType ( SliceType e ) { m_eSliceType = e; } |
---|
2158 | Void setSliceQp ( Int i ) { m_iSliceQp = i; } |
---|
2159 | #if ADAPTIVE_QP_SELECTION |
---|
2160 | Void setSliceQpBase ( Int i ) { m_iSliceQpBase = i; } |
---|
2161 | #endif |
---|
2162 | Void setSliceQpDelta ( Int i ) { m_iSliceQpDelta = i; } |
---|
2163 | Void setSliceQpDeltaCb ( Int i ) { m_iSliceQpDeltaCb = i; } |
---|
2164 | Void setSliceQpDeltaCr ( Int i ) { m_iSliceQpDeltaCr = i; } |
---|
2165 | Void setDeblockingFilterDisable( Bool b ) { m_deblockingFilterDisable= b; } |
---|
2166 | Void setDeblockingFilterOverrideFlag( Bool b ) { m_deblockingFilterOverrideFlag = b; } |
---|
2167 | Void setDeblockingFilterBetaOffsetDiv2( Int i ) { m_deblockingFilterBetaOffsetDiv2 = i; } |
---|
2168 | Void setDeblockingFilterTcOffsetDiv2( Int i ) { m_deblockingFilterTcOffsetDiv2 = i; } |
---|
2169 | |
---|
2170 | Void setRefPic ( TComPic* p, RefPicList e, Int iRefIdx ) { m_apcRefPicList[e][iRefIdx] = p; } |
---|
2171 | Void setRefPOC ( Int i, RefPicList e, Int iRefIdx ) { m_aiRefPOCList[e][iRefIdx] = i; } |
---|
2172 | Void setNumRefIdx ( RefPicList e, Int i ) { m_aiNumRefIdx[e] = i; } |
---|
2173 | Void setPic ( TComPic* p ) { m_pcPic = p; } |
---|
2174 | Void setDepth ( Int iDepth ) { m_iDepth = iDepth; } |
---|
2175 | |
---|
2176 | #if H_MV |
---|
2177 | Void setPocBeforeReset ( Int i ) { m_iPOCBeforeReset = i; } |
---|
2178 | Int getPocBeforeReset ( ) { return m_iPOCBeforeReset; } |
---|
2179 | Int getRefLayerId ( RefPicList e, Int iRefIdx) { return m_aiRefLayerIdList[e][iRefIdx]; } |
---|
2180 | Void setRefLayerId ( Int i, RefPicList e, Int iRefIdx ) { m_aiRefLayerIdList[e][iRefIdx] = i; } |
---|
2181 | Void getTempRefPicLists ( TComList<TComPic*>& rcListPic, std::vector<TComPic*>& refPicSetInterLayer0, std::vector<TComPic*>& refPicSetInterLayer1, |
---|
2182 | std::vector<TComPic*> rpsCurrList[2], std::vector<Bool> usedAsLongTerm[2], Int& numPocTotalCurr, Bool checkNumPocTotalCurr = false ); |
---|
2183 | |
---|
2184 | Void setRefPicList ( std::vector<TComPic*> rpsCurrList[2], std::vector<Bool> usedAsLongTerm[2], Int numPocTotalCurr, Bool checkNumPocTotalCurr = false ); |
---|
2185 | #else |
---|
2186 | #if FIX1071 |
---|
2187 | Void setRefPicList ( TComList<TComPic*>& rcListPic, Bool checkNumPocTotalCurr = false ); |
---|
2188 | #else |
---|
2189 | Void setRefPicList ( TComList<TComPic*>& rcListPic ); |
---|
2190 | #endif |
---|
2191 | #endif |
---|
2192 | Void setRefPOCList (); |
---|
2193 | Void setColFromL0Flag ( UInt colFromL0 ) { m_colFromL0Flag = colFromL0; } |
---|
2194 | Void setColRefIdx ( UInt refIdx) { m_colRefIdx = refIdx; } |
---|
2195 | Void setCheckLDC ( Bool b ) { m_bCheckLDC = b; } |
---|
2196 | Void setMvdL1ZeroFlag ( Bool b) { m_bLMvdL1Zero = b; } |
---|
2197 | |
---|
2198 | Bool isIntra () { return m_eSliceType == I_SLICE; } |
---|
2199 | Bool isInterB () { return m_eSliceType == B_SLICE; } |
---|
2200 | Bool isInterP () { return m_eSliceType == P_SLICE; } |
---|
2201 | |
---|
2202 | #if SAO_CHROMA_LAMBDA |
---|
2203 | Void setLambda( Double d, Double e ) { m_dLambdaLuma = d; m_dLambdaChroma = e;} |
---|
2204 | Double getLambdaLuma() { return m_dLambdaLuma; } |
---|
2205 | Double getLambdaChroma() { return m_dLambdaChroma; } |
---|
2206 | #else |
---|
2207 | Void setLambda( Double d ) { m_dLambda = d; } |
---|
2208 | Double getLambda() { return m_dLambda; } |
---|
2209 | #endif |
---|
2210 | |
---|
2211 | Void initEqualRef(); |
---|
2212 | Bool isEqualRef ( RefPicList e, Int iRefIdx1, Int iRefIdx2 ) |
---|
2213 | { |
---|
2214 | if (iRefIdx1 < 0 || iRefIdx2 < 0) return false; |
---|
2215 | return m_abEqualRef[e][iRefIdx1][iRefIdx2]; |
---|
2216 | } |
---|
2217 | |
---|
2218 | Void setEqualRef( RefPicList e, Int iRefIdx1, Int iRefIdx2, Bool b) |
---|
2219 | { |
---|
2220 | m_abEqualRef[e][iRefIdx1][iRefIdx2] = m_abEqualRef[e][iRefIdx2][iRefIdx1] = b; |
---|
2221 | } |
---|
2222 | |
---|
2223 | static Void sortPicList ( TComList<TComPic*>& rcListPic ); |
---|
2224 | Void setList1IdxToList0Idx(); |
---|
2225 | |
---|
2226 | UInt getTLayer () { return m_uiTLayer; } |
---|
2227 | Void setTLayer ( UInt uiTLayer ) { m_uiTLayer = uiTLayer; } |
---|
2228 | |
---|
2229 | Void setTLayerInfo( UInt uiTLayer ); |
---|
2230 | Void decodingMarking( TComList<TComPic*>& rcListPic, Int iGOPSIze, Int& iMaxRefPicNum ); |
---|
2231 | Void checkLeadingPictureRestrictions( TComList<TComPic*>& rcListPic ); |
---|
2232 | Void applyReferencePictureSet( TComList<TComPic*>& rcListPic, TComReferencePictureSet *RPSList); |
---|
2233 | #if H_MV |
---|
2234 | Void createInterLayerReferencePictureSet( TComPicLists* ivPicLists, std::vector<TComPic*>& refPicSetInterLayer0, std::vector<TComPic*>& refPicSetInterLayer1 ); |
---|
2235 | static Void markIvRefPicsAsShortTerm ( std::vector<TComPic*> refPicSetInterLayer0, std::vector<TComPic*> refPicSetInterLayer1 ); |
---|
2236 | static Void markCurrPic ( TComPic* currPic );; |
---|
2237 | static Void markIvRefPicsAsUnused ( TComPicLists* ivPicLists, std::vector<Int> targetDecLayerIdSet, TComVPS* vps, Int curLayerId, Int curPoc ); |
---|
2238 | Void printRefPicList(); |
---|
2239 | #endif |
---|
2240 | Bool isTemporalLayerSwitchingPoint( TComList<TComPic*>& rcListPic ); |
---|
2241 | Bool isStepwiseTemporalLayerSwitchingPointCandidate( TComList<TComPic*>& rcListPic ); |
---|
2242 | Int checkThatAllRefPicsAreAvailable( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool printErrors, Int pocRandomAccess = 0); |
---|
2243 | #if FIX1071 |
---|
2244 | Void createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool isRAP); |
---|
2245 | #else |
---|
2246 | Void createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet); |
---|
2247 | #endif |
---|
2248 | |
---|
2249 | Void setMaxNumMergeCand (UInt val ) { m_maxNumMergeCand = val; } |
---|
2250 | UInt getMaxNumMergeCand () { return m_maxNumMergeCand; } |
---|
2251 | |
---|
2252 | Void setSliceMode ( UInt uiMode ) { m_sliceMode = uiMode; } |
---|
2253 | UInt getSliceMode () { return m_sliceMode; } |
---|
2254 | Void setSliceArgument ( UInt uiArgument ) { m_sliceArgument = uiArgument; } |
---|
2255 | UInt getSliceArgument () { return m_sliceArgument; } |
---|
2256 | Void setSliceCurStartCUAddr ( UInt uiAddr ) { m_sliceCurStartCUAddr = uiAddr; } |
---|
2257 | UInt getSliceCurStartCUAddr () { return m_sliceCurStartCUAddr; } |
---|
2258 | Void setSliceCurEndCUAddr ( UInt uiAddr ) { m_sliceCurEndCUAddr = uiAddr; } |
---|
2259 | UInt getSliceCurEndCUAddr () { return m_sliceCurEndCUAddr; } |
---|
2260 | Void setSliceIdx ( UInt i) { m_sliceIdx = i; } |
---|
2261 | UInt getSliceIdx () { return m_sliceIdx; } |
---|
2262 | Void copySliceInfo (TComSlice *pcSliceSrc); |
---|
2263 | Void setSliceSegmentMode ( UInt uiMode ) { m_sliceSegmentMode = uiMode; } |
---|
2264 | UInt getSliceSegmentMode () { return m_sliceSegmentMode; } |
---|
2265 | Void setSliceSegmentArgument ( UInt uiArgument ) { m_sliceSegmentArgument = uiArgument; } |
---|
2266 | UInt getSliceSegmentArgument () { return m_sliceSegmentArgument; } |
---|
2267 | Void setSliceSegmentCurStartCUAddr ( UInt uiAddr ) { m_sliceSegmentCurStartCUAddr = uiAddr; } |
---|
2268 | UInt getSliceSegmentCurStartCUAddr () { return m_sliceSegmentCurStartCUAddr; } |
---|
2269 | Void setSliceSegmentCurEndCUAddr ( UInt uiAddr ) { m_sliceSegmentCurEndCUAddr = uiAddr; } |
---|
2270 | UInt getSliceSegmentCurEndCUAddr () { return m_sliceSegmentCurEndCUAddr; } |
---|
2271 | Void setNextSlice ( Bool b ) { m_nextSlice = b; } |
---|
2272 | Bool isNextSlice () { return m_nextSlice; } |
---|
2273 | Void setNextSliceSegment ( Bool b ) { m_nextSliceSegment = b; } |
---|
2274 | Bool isNextSliceSegment () { return m_nextSliceSegment; } |
---|
2275 | Void setSliceBits ( UInt uiVal ) { m_sliceBits = uiVal; } |
---|
2276 | UInt getSliceBits () { return m_sliceBits; } |
---|
2277 | Void setSliceSegmentBits ( UInt uiVal ) { m_sliceSegmentBits = uiVal; } |
---|
2278 | UInt getSliceSegmentBits () { return m_sliceSegmentBits; } |
---|
2279 | Void setFinalized ( Bool uiVal ) { m_bFinalized = uiVal; } |
---|
2280 | Bool getFinalized () { return m_bFinalized; } |
---|
2281 | Void setWpScaling ( wpScalingParam wp[2][MAX_NUM_REF][3] ) { memcpy(m_weightPredTable, wp, sizeof(wpScalingParam)*2*MAX_NUM_REF*3); } |
---|
2282 | Void getWpScaling ( RefPicList e, Int iRefIdx, wpScalingParam *&wp); |
---|
2283 | |
---|
2284 | Void resetWpScaling (); |
---|
2285 | Void initWpScaling (); |
---|
2286 | inline Bool applyWP () { return( (m_eSliceType==P_SLICE && m_pcPPS->getUseWP()) || (m_eSliceType==B_SLICE && m_pcPPS->getWPBiPred()) ); } |
---|
2287 | |
---|
2288 | Void setWpAcDcParam ( wpACDCParam wp[3] ) { memcpy(m_weightACDCParam, wp, sizeof(wpACDCParam)*3); } |
---|
2289 | Void getWpAcDcParam ( wpACDCParam *&wp ); |
---|
2290 | Void initWpAcDcParam (); |
---|
2291 | |
---|
2292 | Void setTileLocationCount ( UInt cnt ) { return m_tileByteLocation.resize(cnt); } |
---|
2293 | UInt getTileLocationCount () { return (UInt) m_tileByteLocation.size(); } |
---|
2294 | Void setTileLocation ( Int idx, UInt location ) { assert (idx<m_tileByteLocation.size()); |
---|
2295 | m_tileByteLocation[idx] = location; } |
---|
2296 | Void addTileLocation ( UInt location ) { m_tileByteLocation.push_back(location); } |
---|
2297 | UInt getTileLocation ( Int idx ) { return m_tileByteLocation[idx]; } |
---|
2298 | |
---|
2299 | Void setTileOffstForMultES (UInt uiOffset ) { m_uiTileOffstForMultES = uiOffset; } |
---|
2300 | UInt getTileOffstForMultES () { return m_uiTileOffstForMultES; } |
---|
2301 | Void allocSubstreamSizes ( UInt uiNumSubstreams ); |
---|
2302 | UInt* getSubstreamSizes () { return m_puiSubstreamSizes; } |
---|
2303 | Void setScalingList ( TComScalingList* scalingList ) { m_scalingList = scalingList; } |
---|
2304 | TComScalingList* getScalingList () { return m_scalingList; } |
---|
2305 | Void setDefaultScalingList (); |
---|
2306 | Bool checkDefaultScalingList (); |
---|
2307 | Void setCabacInitFlag ( Bool val ) { m_cabacInitFlag = val; } //!< set CABAC initial flag |
---|
2308 | Bool getCabacInitFlag () { return m_cabacInitFlag; } //!< get CABAC initial flag |
---|
2309 | Void setNumEntryPointOffsets(Int val) { m_numEntryPointOffsets = val; } |
---|
2310 | Int getNumEntryPointOffsets() { return m_numEntryPointOffsets; } |
---|
2311 | Bool getTemporalLayerNonReferenceFlag() { return m_temporalLayerNonReferenceFlag;} |
---|
2312 | Void setTemporalLayerNonReferenceFlag(Bool x) { m_temporalLayerNonReferenceFlag = x;} |
---|
2313 | Void setLFCrossSliceBoundaryFlag ( Bool val ) { m_LFCrossSliceBoundaryFlag = val; } |
---|
2314 | Bool getLFCrossSliceBoundaryFlag () { return m_LFCrossSliceBoundaryFlag;} |
---|
2315 | |
---|
2316 | Void setEnableTMVPFlag ( Bool b ) { m_enableTMVPFlag = b; } |
---|
2317 | Bool getEnableTMVPFlag () { return m_enableTMVPFlag;} |
---|
2318 | |
---|
2319 | #if H_MV |
---|
2320 | Void setLayerId ( Int layerId ) { m_layerId = layerId; } |
---|
2321 | Int getLayerId () { return m_layerId; } |
---|
2322 | Int getLayerIdInVps () { return getVPS()->getLayerIdInVps( m_layerId ); }; |
---|
2323 | Void setViewId ( Int viewId ) { m_viewId = viewId; } |
---|
2324 | Int getViewId () { return m_viewId; } |
---|
2325 | Void setViewIndex ( Int viewIndex ) { m_viewIndex = viewIndex; } |
---|
2326 | Int getViewIndex () { return m_viewIndex; } |
---|
2327 | #if H_3D |
---|
2328 | #if H_3D_TMVP |
---|
2329 | Void generateAlterRefforTMVP (); |
---|
2330 | Void setAlterRefIdx ( RefPicList e, Int i ) { m_aiAlterRefIdx[e] = i; } |
---|
2331 | Int getAlterRefIdx ( RefPicList e ) { return m_aiAlterRefIdx[e]; } |
---|
2332 | #endif |
---|
2333 | #if H_3D_ARP |
---|
2334 | Int getFirstTRefIdx ( RefPicList e ) { return m_aiFirstTRefIdx[e]; } |
---|
2335 | Void setFirstTRefIdx ( RefPicList e, Int i ) { m_aiFirstTRefIdx[e] = i; } |
---|
2336 | Bool getArpRefPicAvailable( RefPicList e, Int viewIdx) {return m_arpRefPicAvailable[e][getVPS()->getLayerIdInNuh(viewIdx, 0)]; } |
---|
2337 | #endif |
---|
2338 | Void setIsDepth ( Bool isDepth ) { m_isDepth = isDepth; } |
---|
2339 | Bool getIsDepth () { return m_isDepth; } |
---|
2340 | Void setCamparaSlice ( Int** aaiScale = 0, Int** aaiOffset = 0 ); |
---|
2341 | Int* getCodedScale () { return m_aaiCodedScale [0]; } |
---|
2342 | Int* getCodedOffset () { return m_aaiCodedOffset[0]; } |
---|
2343 | Int* getInvCodedScale () { return m_aaiCodedScale [1]; } |
---|
2344 | Int* getInvCodedOffset () { return m_aaiCodedOffset[1]; } |
---|
2345 | #endif |
---|
2346 | #endif |
---|
2347 | #if H_3D |
---|
2348 | Void setIvPicLists( TComPicLists* m_ivPicLists ); |
---|
2349 | Void setDepthToDisparityLUTs(); |
---|
2350 | |
---|
2351 | Int* getDepthToDisparityB( Int refViewIdx ) { return m_depthToDisparityB[ refViewIdx ]; }; |
---|
2352 | Int* getDepthToDisparityF( Int refViewIdx ) { return m_depthToDisparityF[ refViewIdx ]; }; |
---|
2353 | Bool getVpsDepthModesFlag () { return getVPS()->getVpsDepthModesFlag( getVPS()->getLayerIdInVps( m_layerId ) ); } |
---|
2354 | |
---|
2355 | #endif |
---|
2356 | #if H_MV |
---|
2357 | // Additional slice header syntax elements |
---|
2358 | |
---|
2359 | Void setCrossLayerBlaFlag( Bool flag ) { m_crossLayerBlaFlag = flag; } |
---|
2360 | Bool getCrossLayerBlaFlag( ) { return m_crossLayerBlaFlag; } |
---|
2361 | Void checkCrossLayerBlaFlag ( ) |
---|
2362 | { |
---|
2363 | // 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. |
---|
2364 | if ( getLayerId() != 0 || getNalUnitType() != NAL_UNIT_CODED_SLICE_IDR_W_RADL || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP ) |
---|
2365 | { |
---|
2366 | assert( m_crossLayerBlaFlag == 0 ); |
---|
2367 | } |
---|
2368 | } |
---|
2369 | |
---|
2370 | Void setPocResetFlag( Bool flag ) { m_pocResetFlag = flag; } |
---|
2371 | Bool getPocResetFlag( ) { return m_pocResetFlag; } |
---|
2372 | |
---|
2373 | Void setDiscardableFlag( Bool flag ) { m_discardableFlag = flag; } |
---|
2374 | Bool getDiscardableFlag( ) { return m_discardableFlag; } |
---|
2375 | |
---|
2376 | Void setInterLayerPredEnabledFlag( Bool flag ) { m_interLayerPredEnabledFlag = flag; } |
---|
2377 | Bool getInterLayerPredEnabledFlag( ) { return m_interLayerPredEnabledFlag; } |
---|
2378 | |
---|
2379 | Void setNumInterLayerRefPicsMinus1( Int val ) { m_numInterLayerRefPicsMinus1 = val; } |
---|
2380 | Int getNumInterLayerRefPicsMinus1( ) { return m_numInterLayerRefPicsMinus1; } |
---|
2381 | |
---|
2382 | Void setInterLayerPredLayerIdc( Int i, Int val ) { m_interLayerPredLayerIdc[i] = val; } |
---|
2383 | Int getInterLayerPredLayerIdc( Int i ) { return m_interLayerPredLayerIdc[i]; } |
---|
2384 | |
---|
2385 | // Additional variables derived in slice header semantics |
---|
2386 | Int getNumInterLayerRefPicsMinus1Len( ) { return gCeilLog2( getVPS()->getNumDirectRefLayers( getLayerId() )); } |
---|
2387 | Int getInterLayerPredLayerIdcLen ( ) { return gCeilLog2( getVPS()->getNumDirectRefLayers( getLayerId() )); } |
---|
2388 | |
---|
2389 | Int getRefLayerPicFlag( Int i ); |
---|
2390 | Int getRefLayerPicIdc ( Int j ); |
---|
2391 | Int getNumRefLayerPics( ); |
---|
2392 | |
---|
2393 | Int getNumActiveRefLayerPics( ); |
---|
2394 | |
---|
2395 | Int getNumActiveRefLayerPics0( ) { return (Int) m_refPicSetInterLayer0->size(); }; |
---|
2396 | Int getNumActiveRefLayerPics1( ) { return (Int) m_refPicSetInterLayer1->size(); }; |
---|
2397 | |
---|
2398 | Int getRefPicLayerId ( Int i ); |
---|
2399 | |
---|
2400 | Void setRefPicSetInterLayer ( std::vector<TComPic*>* refPicSetInterLayer0, std::vector<TComPic*>* refPicSetInterLayer1); |
---|
2401 | TComPic* getPicFromRefPicSetInterLayer( Int setIdc, Int layerId ); |
---|
2402 | #endif |
---|
2403 | protected: |
---|
2404 | TComPic* xGetRefPic (TComList<TComPic*>& rcListPic, |
---|
2405 | Int poc); |
---|
2406 | TComPic* xGetLongTermRefPic(TComList<TComPic*>& rcListPic, Int poc, Bool pocHasMsb); |
---|
2407 | #if H_MV |
---|
2408 | TComPic* xGetInterLayerRefPic( std::vector<TComPic*>& rcListIlPic, Int layerId ); |
---|
2409 | #endif |
---|
2410 | };// END CLASS DEFINITION TComSlice |
---|
2411 | |
---|
2412 | |
---|
2413 | template <class T> class ParameterSetMap |
---|
2414 | { |
---|
2415 | public: |
---|
2416 | ParameterSetMap(Int maxId) |
---|
2417 | :m_maxId (maxId) |
---|
2418 | {} |
---|
2419 | |
---|
2420 | ~ParameterSetMap() |
---|
2421 | { |
---|
2422 | for (typename std::map<Int,T *>::iterator i = m_paramsetMap.begin(); i!= m_paramsetMap.end(); i++) |
---|
2423 | { |
---|
2424 | delete (*i).second; |
---|
2425 | } |
---|
2426 | } |
---|
2427 | |
---|
2428 | Void storePS(Int psId, T *ps) |
---|
2429 | { |
---|
2430 | assert ( psId < m_maxId ); |
---|
2431 | if ( m_paramsetMap.find(psId) != m_paramsetMap.end() ) |
---|
2432 | { |
---|
2433 | delete m_paramsetMap[psId]; |
---|
2434 | } |
---|
2435 | m_paramsetMap[psId] = ps; |
---|
2436 | } |
---|
2437 | |
---|
2438 | Void mergePSList(ParameterSetMap<T> &rPsList) |
---|
2439 | { |
---|
2440 | for (typename std::map<Int,T *>::iterator i = rPsList.m_paramsetMap.begin(); i!= rPsList.m_paramsetMap.end(); i++) |
---|
2441 | { |
---|
2442 | storePS(i->first, i->second); |
---|
2443 | } |
---|
2444 | rPsList.m_paramsetMap.clear(); |
---|
2445 | } |
---|
2446 | |
---|
2447 | |
---|
2448 | T* getPS(Int psId) |
---|
2449 | { |
---|
2450 | return ( m_paramsetMap.find(psId) == m_paramsetMap.end() ) ? NULL : m_paramsetMap[psId]; |
---|
2451 | } |
---|
2452 | |
---|
2453 | T* getFirstPS() |
---|
2454 | { |
---|
2455 | return (m_paramsetMap.begin() == m_paramsetMap.end() ) ? NULL : m_paramsetMap.begin()->second; |
---|
2456 | } |
---|
2457 | |
---|
2458 | private: |
---|
2459 | std::map<Int,T *> m_paramsetMap; |
---|
2460 | Int m_maxId; |
---|
2461 | }; |
---|
2462 | |
---|
2463 | class ParameterSetManager |
---|
2464 | { |
---|
2465 | public: |
---|
2466 | ParameterSetManager(); |
---|
2467 | virtual ~ParameterSetManager(); |
---|
2468 | |
---|
2469 | //! store sequence parameter set and take ownership of it |
---|
2470 | Void storeVPS(TComVPS *vps) { m_vpsMap.storePS( vps->getVPSId(), vps); }; |
---|
2471 | //! get pointer to existing video parameter set |
---|
2472 | TComVPS* getVPS(Int vpsId) { return m_vpsMap.getPS(vpsId); }; |
---|
2473 | TComVPS* getFirstVPS() { return m_vpsMap.getFirstPS(); }; |
---|
2474 | |
---|
2475 | //! store sequence parameter set and take ownership of it |
---|
2476 | Void storeSPS(TComSPS *sps) { m_spsMap.storePS( sps->getSPSId(), sps); }; |
---|
2477 | //! get pointer to existing sequence parameter set |
---|
2478 | TComSPS* getSPS(Int spsId) { return m_spsMap.getPS(spsId); }; |
---|
2479 | TComSPS* getFirstSPS() { return m_spsMap.getFirstPS(); }; |
---|
2480 | |
---|
2481 | //! store picture parameter set and take ownership of it |
---|
2482 | Void storePPS(TComPPS *pps) { m_ppsMap.storePS( pps->getPPSId(), pps); }; |
---|
2483 | //! get pointer to existing picture parameter set |
---|
2484 | TComPPS* getPPS(Int ppsId) { return m_ppsMap.getPS(ppsId); }; |
---|
2485 | TComPPS* getFirstPPS() { return m_ppsMap.getFirstPS(); }; |
---|
2486 | |
---|
2487 | //! activate a SPS from a active parameter sets SEI message |
---|
2488 | //! \returns true, if activation is successful |
---|
2489 | #if H_MV |
---|
2490 | Bool activateSPSWithSEI(Int SPSId, Int layerId ); |
---|
2491 | #else |
---|
2492 | Bool activateSPSWithSEI(Int SPSId); |
---|
2493 | #endif |
---|
2494 | |
---|
2495 | //! activate a PPS and depending on isIDR parameter also SPS and VPS |
---|
2496 | //! \returns true, if activation is successful |
---|
2497 | #if H_MV |
---|
2498 | Bool activatePPS(Int ppsId, Bool isIRAP, Int layerId ); |
---|
2499 | #else |
---|
2500 | Bool activatePPS(Int ppsId, Bool isIRAP); |
---|
2501 | #endif |
---|
2502 | |
---|
2503 | TComVPS* getActiveVPS(){ return m_vpsMap.getPS(m_activeVPSId); }; |
---|
2504 | #if H_MV |
---|
2505 | TComSPS* getActiveSPS( Int layerId ){ return m_spsMap.getPS( m_activeSPSId[ layerId ] ); }; |
---|
2506 | TComPPS* getActivePPS( Int layerId ){ return m_ppsMap.getPS( m_activePPSId[ layerId ] ); }; |
---|
2507 | #else |
---|
2508 | TComSPS* getActiveSPS(){ return m_spsMap.getPS(m_activeSPSId); }; |
---|
2509 | TComPPS* getActivePPS(){ return m_ppsMap.getPS(m_activePPSId); }; |
---|
2510 | #endif |
---|
2511 | protected: |
---|
2512 | |
---|
2513 | ParameterSetMap<TComVPS> m_vpsMap; |
---|
2514 | ParameterSetMap<TComSPS> m_spsMap; |
---|
2515 | ParameterSetMap<TComPPS> m_ppsMap; |
---|
2516 | |
---|
2517 | Int m_activeVPSId; |
---|
2518 | #if H_MV |
---|
2519 | Int m_activeSPSId[ MAX_NUM_LAYERS ]; |
---|
2520 | Int m_activePPSId[ MAX_NUM_LAYERS ]; |
---|
2521 | #else |
---|
2522 | Int m_activeSPSId; |
---|
2523 | Int m_activePPSId; |
---|
2524 | #endif |
---|
2525 | |
---|
2526 | }; |
---|
2527 | |
---|
2528 | //! \} |
---|
2529 | |
---|
2530 | #endif // __TCOMSLICE__ |
---|