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