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