1 | /* The copyright in this software is being made available under the BSD |
---|
2 | * License, included below. This software may be subject to other third party |
---|
3 | * and contributor rights, including patent rights, and no such rights are |
---|
4 | * granted under this license. |
---|
5 | * |
---|
6 | * Copyright (c) 2010-2013, ITU/ISO/IEC |
---|
7 | * All rights reserved. |
---|
8 | * |
---|
9 | * Redistribution and use in source and binary forms, with or without |
---|
10 | * modification, are permitted provided that the following conditions are met: |
---|
11 | * |
---|
12 | * * Redistributions of source code must retain the above copyright notice, |
---|
13 | * this list of conditions and the following disclaimer. |
---|
14 | * * Redistributions in binary form must reproduce the above copyright notice, |
---|
15 | * this list of conditions and the following disclaimer in the documentation |
---|
16 | * and/or other materials provided with the distribution. |
---|
17 | * * Neither the name of the ITU/ISO/IEC nor the names of its contributors may |
---|
18 | * be used to endorse or promote products derived from this software without |
---|
19 | * specific prior written permission. |
---|
20 | * |
---|
21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
---|
22 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
---|
23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
---|
24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS |
---|
25 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
---|
26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
---|
27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
---|
28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
---|
29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
---|
30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF |
---|
31 | * THE POSSIBILITY OF SUCH DAMAGE. |
---|
32 | */ |
---|
33 | |
---|
34 | /** \file TComSlice.h |
---|
35 | \brief slice header and SPS class (header) |
---|
36 | */ |
---|
37 | |
---|
38 | #ifndef __TCOMSLICE__ |
---|
39 | #define __TCOMSLICE__ |
---|
40 | |
---|
41 | #include <cstring> |
---|
42 | #include <map> |
---|
43 | #include <vector> |
---|
44 | #include "CommonDef.h" |
---|
45 | #include "TComRom.h" |
---|
46 | #include "TComList.h" |
---|
47 | |
---|
48 | //! \ingroup TLibCommon |
---|
49 | //! \{ |
---|
50 | |
---|
51 | class TComPic; |
---|
52 | class TComTrQuant; |
---|
53 | |
---|
54 | #if SVC_EXTENSION |
---|
55 | class TComPicYuv; |
---|
56 | #endif |
---|
57 | // ==================================================================================================================== |
---|
58 | // Constants |
---|
59 | // ==================================================================================================================== |
---|
60 | |
---|
61 | // ==================================================================================================================== |
---|
62 | // Class definition |
---|
63 | // ==================================================================================================================== |
---|
64 | |
---|
65 | /// Reference Picture Set class |
---|
66 | class TComReferencePictureSet |
---|
67 | { |
---|
68 | private: |
---|
69 | Int m_numberOfPictures; |
---|
70 | Int m_numberOfNegativePictures; |
---|
71 | Int m_numberOfPositivePictures; |
---|
72 | Int m_numberOfLongtermPictures; |
---|
73 | Int m_deltaPOC[MAX_NUM_REF_PICS]; |
---|
74 | Int m_POC[MAX_NUM_REF_PICS]; |
---|
75 | Bool m_used[MAX_NUM_REF_PICS]; |
---|
76 | Bool m_interRPSPrediction; |
---|
77 | Int m_deltaRIdxMinus1; |
---|
78 | Int m_deltaRPS; |
---|
79 | Int m_numRefIdc; |
---|
80 | Int m_refIdc[MAX_NUM_REF_PICS+1]; |
---|
81 | Bool m_bCheckLTMSB[MAX_NUM_REF_PICS]; |
---|
82 | Int m_pocLSBLT[MAX_NUM_REF_PICS]; |
---|
83 | Int m_deltaPOCMSBCycleLT[MAX_NUM_REF_PICS]; |
---|
84 | Bool m_deltaPocMSBPresentFlag[MAX_NUM_REF_PICS]; |
---|
85 | |
---|
86 | public: |
---|
87 | TComReferencePictureSet(); |
---|
88 | virtual ~TComReferencePictureSet(); |
---|
89 | Int getPocLSBLT(Int i) { return m_pocLSBLT[i]; } |
---|
90 | Void setPocLSBLT(Int i, Int x) { m_pocLSBLT[i] = x; } |
---|
91 | Int getDeltaPocMSBCycleLT(Int i) { return m_deltaPOCMSBCycleLT[i]; } |
---|
92 | Void setDeltaPocMSBCycleLT(Int i, Int x) { m_deltaPOCMSBCycleLT[i] = x; } |
---|
93 | Bool getDeltaPocMSBPresentFlag(Int i) { return m_deltaPocMSBPresentFlag[i]; } |
---|
94 | Void setDeltaPocMSBPresentFlag(Int i, Bool x) { m_deltaPocMSBPresentFlag[i] = x; } |
---|
95 | Void setUsed(Int bufferNum, Bool used); |
---|
96 | Void setDeltaPOC(Int bufferNum, Int deltaPOC); |
---|
97 | Void setPOC(Int bufferNum, Int deltaPOC); |
---|
98 | Void setNumberOfPictures(Int numberOfPictures); |
---|
99 | Void setCheckLTMSBPresent(Int bufferNum, Bool b ); |
---|
100 | Bool getCheckLTMSBPresent(Int bufferNum); |
---|
101 | |
---|
102 | Int getUsed(Int bufferNum); |
---|
103 | Int getDeltaPOC(Int bufferNum); |
---|
104 | Int getPOC(Int bufferNum); |
---|
105 | Int getNumberOfPictures(); |
---|
106 | |
---|
107 | Void setNumberOfNegativePictures(Int number) { m_numberOfNegativePictures = number; } |
---|
108 | Int getNumberOfNegativePictures() { return m_numberOfNegativePictures; } |
---|
109 | Void setNumberOfPositivePictures(Int number) { m_numberOfPositivePictures = number; } |
---|
110 | Int getNumberOfPositivePictures() { return m_numberOfPositivePictures; } |
---|
111 | Void setNumberOfLongtermPictures(Int number) { m_numberOfLongtermPictures = number; } |
---|
112 | Int getNumberOfLongtermPictures() { return m_numberOfLongtermPictures; } |
---|
113 | |
---|
114 | Void setInterRPSPrediction(Bool flag) { m_interRPSPrediction = flag; } |
---|
115 | Bool getInterRPSPrediction() { return m_interRPSPrediction; } |
---|
116 | Void setDeltaRIdxMinus1(Int x) { m_deltaRIdxMinus1 = x; } |
---|
117 | Int getDeltaRIdxMinus1() { return m_deltaRIdxMinus1; } |
---|
118 | Void setDeltaRPS(Int x) { m_deltaRPS = x; } |
---|
119 | Int getDeltaRPS() { return m_deltaRPS; } |
---|
120 | Void setNumRefIdc(Int x) { m_numRefIdc = x; } |
---|
121 | Int getNumRefIdc() { return m_numRefIdc; } |
---|
122 | |
---|
123 | Void setRefIdc(Int bufferNum, Int refIdc); |
---|
124 | Int getRefIdc(Int bufferNum); |
---|
125 | |
---|
126 | Void sortDeltaPOC(); |
---|
127 | Void printDeltaPOC(); |
---|
128 | }; |
---|
129 | |
---|
130 | /// Reference Picture Set set class |
---|
131 | class TComRPSList |
---|
132 | { |
---|
133 | private: |
---|
134 | Int m_numberOfReferencePictureSets; |
---|
135 | TComReferencePictureSet* m_referencePictureSets; |
---|
136 | |
---|
137 | public: |
---|
138 | TComRPSList(); |
---|
139 | virtual ~TComRPSList(); |
---|
140 | |
---|
141 | Void create (Int numberOfEntries); |
---|
142 | Void destroy (); |
---|
143 | |
---|
144 | |
---|
145 | TComReferencePictureSet* getReferencePictureSet(Int referencePictureSetNum); |
---|
146 | Int getNumberOfReferencePictureSets(); |
---|
147 | Void setNumberOfReferencePictureSets(Int numberOfReferencePictureSets); |
---|
148 | }; |
---|
149 | |
---|
150 | /// SCALING_LIST class |
---|
151 | class TComScalingList |
---|
152 | { |
---|
153 | public: |
---|
154 | TComScalingList(); |
---|
155 | virtual ~TComScalingList(); |
---|
156 | Void setScalingListPresentFlag (Bool b) { m_scalingListPresentFlag = b; } |
---|
157 | Bool getScalingListPresentFlag () { return m_scalingListPresentFlag; } |
---|
158 | Bool getUseTransformSkip () { return m_useTransformSkip; } |
---|
159 | Void setUseTransformSkip (Bool b) { m_useTransformSkip = b; } |
---|
160 | Int* getScalingListAddress (UInt sizeId, UInt listId) { return m_scalingListCoef[sizeId][listId]; } //!< get matrix coefficient |
---|
161 | Bool checkPredMode (UInt sizeId, UInt listId); |
---|
162 | Void setRefMatrixId (UInt sizeId, UInt listId, UInt u) { m_refMatrixId[sizeId][listId] = u; } //!< set reference matrix ID |
---|
163 | UInt getRefMatrixId (UInt sizeId, UInt listId) { return m_refMatrixId[sizeId][listId]; } //!< get reference matrix ID |
---|
164 | Int* getScalingListDefaultAddress (UInt sizeId, UInt listId); //!< get default matrix coefficient |
---|
165 | Void processDefaultMarix (UInt sizeId, UInt listId); |
---|
166 | Void setScalingListDC (UInt sizeId, UInt listId, UInt u) { m_scalingListDC[sizeId][listId] = u; } //!< set DC value |
---|
167 | |
---|
168 | Int getScalingListDC (UInt sizeId, UInt listId) { return m_scalingListDC[sizeId][listId]; } //!< get DC value |
---|
169 | Void checkDcOfMatrix (); |
---|
170 | Void processRefMatrix (UInt sizeId, UInt listId , UInt refListId ); |
---|
171 | Bool xParseScalingList (Char* pchFile); |
---|
172 | |
---|
173 | private: |
---|
174 | Void init (); |
---|
175 | Void destroy (); |
---|
176 | Int m_scalingListDC [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< the DC value of the matrix coefficient for 16x16 |
---|
177 | Bool m_useDefaultScalingMatrixFlag [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< UseDefaultScalingMatrixFlag |
---|
178 | UInt m_refMatrixId [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< RefMatrixID |
---|
179 | Bool m_scalingListPresentFlag; //!< flag for using default matrix |
---|
180 | UInt m_predMatrixId [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< reference list index |
---|
181 | Int *m_scalingListCoef [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< quantization matrix |
---|
182 | Bool m_useTransformSkip; //!< transform skipping flag for setting default scaling matrix for 4x4 |
---|
183 | }; |
---|
184 | |
---|
185 | class ProfileTierLevel |
---|
186 | { |
---|
187 | Int m_profileSpace; |
---|
188 | Bool m_tierFlag; |
---|
189 | Int m_profileIdc; |
---|
190 | Bool m_profileCompatibilityFlag[32]; |
---|
191 | Int m_levelIdc; |
---|
192 | |
---|
193 | #if L0046_CONSTRAINT_FLAGS |
---|
194 | Bool m_progressiveSourceFlag; |
---|
195 | Bool m_interlacedSourceFlag; |
---|
196 | Bool m_nonPackedConstraintFlag; |
---|
197 | Bool m_frameOnlyConstraintFlag; |
---|
198 | #endif |
---|
199 | |
---|
200 | public: |
---|
201 | ProfileTierLevel(); |
---|
202 | |
---|
203 | Int getProfileSpace() const { return m_profileSpace; } |
---|
204 | Void setProfileSpace(Int x) { m_profileSpace = x; } |
---|
205 | |
---|
206 | Bool getTierFlag() const { return m_tierFlag; } |
---|
207 | Void setTierFlag(Bool x) { m_tierFlag = x; } |
---|
208 | |
---|
209 | Int getProfileIdc() const { return m_profileIdc; } |
---|
210 | Void setProfileIdc(Int x) { m_profileIdc = x; } |
---|
211 | |
---|
212 | Bool getProfileCompatibilityFlag(Int i) const { return m_profileCompatibilityFlag[i]; } |
---|
213 | Void setProfileCompatibilityFlag(Int i, Bool x) { m_profileCompatibilityFlag[i] = x; } |
---|
214 | |
---|
215 | Int getLevelIdc() const { return m_levelIdc; } |
---|
216 | Void setLevelIdc(Int x) { m_levelIdc = x; } |
---|
217 | |
---|
218 | #if L0046_CONSTRAINT_FLAGS |
---|
219 | Bool getProgressiveSourceFlag() const { return m_progressiveSourceFlag; } |
---|
220 | Void setProgressiveSourceFlag(Bool b) { m_progressiveSourceFlag = b; } |
---|
221 | |
---|
222 | Bool getInterlacedSourceFlag() const { return m_interlacedSourceFlag; } |
---|
223 | Void setInterlacedSourceFlag(Bool b) { m_interlacedSourceFlag = b; } |
---|
224 | |
---|
225 | Bool getNonPackedConstraintFlag() const { return m_nonPackedConstraintFlag; } |
---|
226 | Void setNonPackedConstraintFlag(Bool b) { m_nonPackedConstraintFlag = b; } |
---|
227 | |
---|
228 | Bool getFrameOnlyConstraintFlag() const { return m_frameOnlyConstraintFlag; } |
---|
229 | Void setFrameOnlyConstraintFlag(Bool b) { m_frameOnlyConstraintFlag = b; } |
---|
230 | #endif |
---|
231 | #if VPS_EXTN_PROFILE_INFO |
---|
232 | Void copyProfileInfo(ProfileTierLevel *ptl); |
---|
233 | #endif |
---|
234 | }; |
---|
235 | |
---|
236 | |
---|
237 | class TComPTL |
---|
238 | { |
---|
239 | ProfileTierLevel m_generalPTL; |
---|
240 | ProfileTierLevel m_subLayerPTL[6]; // max. value of max_sub_layers_minus1 is 6 |
---|
241 | Bool m_subLayerProfilePresentFlag[6]; |
---|
242 | Bool m_subLayerLevelPresentFlag[6]; |
---|
243 | |
---|
244 | public: |
---|
245 | TComPTL(); |
---|
246 | Bool getSubLayerProfilePresentFlag(Int i) const { return m_subLayerProfilePresentFlag[i]; } |
---|
247 | Void setSubLayerProfilePresentFlag(Int i, Bool x) { m_subLayerProfilePresentFlag[i] = x; } |
---|
248 | |
---|
249 | Bool getSubLayerLevelPresentFlag(Int i) const { return m_subLayerLevelPresentFlag[i]; } |
---|
250 | Void setSubLayerLevelPresentFlag(Int i, Bool x) { m_subLayerLevelPresentFlag[i] = x; } |
---|
251 | |
---|
252 | ProfileTierLevel* getGeneralPTL() { return &m_generalPTL; } |
---|
253 | ProfileTierLevel* getSubLayerPTL(Int i) { return &m_subLayerPTL[i]; } |
---|
254 | #if VPS_EXTN_PROFILE_INFO |
---|
255 | Void copyProfileInfo(TComPTL *ptl); |
---|
256 | #endif |
---|
257 | }; |
---|
258 | /// VPS class |
---|
259 | |
---|
260 | #if SIGNAL_BITRATE_PICRATE_IN_VPS |
---|
261 | class TComBitRatePicRateInfo |
---|
262 | { |
---|
263 | Bool m_bitRateInfoPresentFlag[MAX_TLAYER]; |
---|
264 | Bool m_picRateInfoPresentFlag[MAX_TLAYER]; |
---|
265 | Int m_avgBitRate[MAX_TLAYER]; |
---|
266 | Int m_maxBitRate[MAX_TLAYER]; |
---|
267 | Int m_constantPicRateIdc[MAX_TLAYER]; |
---|
268 | Int m_avgPicRate[MAX_TLAYER]; |
---|
269 | public: |
---|
270 | TComBitRatePicRateInfo(); |
---|
271 | Bool getBitRateInfoPresentFlag(Int i) {return m_bitRateInfoPresentFlag[i];} |
---|
272 | Void setBitRateInfoPresentFlag(Int i, Bool x) {m_bitRateInfoPresentFlag[i] = x;} |
---|
273 | |
---|
274 | Bool getPicRateInfoPresentFlag(Int i) {return m_picRateInfoPresentFlag[i];} |
---|
275 | Void setPicRateInfoPresentFlag(Int i, Bool x) {m_picRateInfoPresentFlag[i] = x;} |
---|
276 | |
---|
277 | Int getAvgBitRate(Int i) {return m_avgBitRate[i];} |
---|
278 | Void setAvgBitRate(Int i, Int x) {m_avgBitRate[i] = x;} |
---|
279 | |
---|
280 | Int getMaxBitRate(Int i) {return m_maxBitRate[i];} |
---|
281 | Void setMaxBitRate(Int i, Int x) {m_maxBitRate[i] = x;} |
---|
282 | |
---|
283 | Int getConstantPicRateIdc(Int i) {return m_constantPicRateIdc[i];} |
---|
284 | Void setConstantPicRateIdc(Int i, Int x) {m_constantPicRateIdc[i] = x;} |
---|
285 | |
---|
286 | Int getAvgPicRate(Int i) {return m_avgPicRate[i];} |
---|
287 | Void setAvgPicRate(Int i, Int x) {m_avgPicRate[i] = x;} |
---|
288 | }; |
---|
289 | #endif |
---|
290 | |
---|
291 | struct HrdSubLayerInfo |
---|
292 | { |
---|
293 | Bool fixedPicRateFlag; |
---|
294 | Bool fixedPicRateWithinCvsFlag; |
---|
295 | UInt picDurationInTcMinus1; |
---|
296 | Bool lowDelayHrdFlag; |
---|
297 | UInt cpbCntMinus1; |
---|
298 | UInt bitRateValueMinus1[MAX_CPB_CNT][2]; |
---|
299 | UInt cpbSizeValue [MAX_CPB_CNT][2]; |
---|
300 | UInt ducpbSizeValue [MAX_CPB_CNT][2]; |
---|
301 | UInt cbrFlag [MAX_CPB_CNT][2]; |
---|
302 | #if L0363_DU_BIT_RATE |
---|
303 | UInt duBitRateValue [MAX_CPB_CNT][2]; |
---|
304 | #endif |
---|
305 | }; |
---|
306 | |
---|
307 | class TComHRD |
---|
308 | { |
---|
309 | private: |
---|
310 | #if !L0043_TIMING_INFO |
---|
311 | Bool m_timingInfoPresentFlag; |
---|
312 | UInt m_numUnitsInTick; |
---|
313 | UInt m_timeScale; |
---|
314 | #endif |
---|
315 | Bool m_nalHrdParametersPresentFlag; |
---|
316 | Bool m_vclHrdParametersPresentFlag; |
---|
317 | Bool m_subPicCpbParamsPresentFlag; |
---|
318 | UInt m_tickDivisorMinus2; |
---|
319 | UInt m_duCpbRemovalDelayLengthMinus1; |
---|
320 | Bool m_subPicCpbParamsInPicTimingSEIFlag; |
---|
321 | #if L0044_DU_DPB_OUTPUT_DELAY_HRD |
---|
322 | UInt m_dpbOutputDelayDuLengthMinus1; |
---|
323 | #endif |
---|
324 | UInt m_bitRateScale; |
---|
325 | UInt m_cpbSizeScale; |
---|
326 | UInt m_ducpbSizeScale; |
---|
327 | UInt m_initialCpbRemovalDelayLengthMinus1; |
---|
328 | UInt m_cpbRemovalDelayLengthMinus1; |
---|
329 | UInt m_dpbOutputDelayLengthMinus1; |
---|
330 | UInt m_numDU; |
---|
331 | HrdSubLayerInfo m_HRD[MAX_TLAYER]; |
---|
332 | |
---|
333 | public: |
---|
334 | TComHRD() |
---|
335 | #if !L0043_TIMING_INFO |
---|
336 | :m_timingInfoPresentFlag(false) |
---|
337 | ,m_numUnitsInTick(1001) |
---|
338 | ,m_timeScale(60000) |
---|
339 | ,m_nalHrdParametersPresentFlag(0) |
---|
340 | #else |
---|
341 | :m_nalHrdParametersPresentFlag(0) |
---|
342 | #endif |
---|
343 | ,m_vclHrdParametersPresentFlag(0) |
---|
344 | ,m_subPicCpbParamsPresentFlag(false) |
---|
345 | ,m_tickDivisorMinus2(0) |
---|
346 | ,m_duCpbRemovalDelayLengthMinus1(0) |
---|
347 | ,m_subPicCpbParamsInPicTimingSEIFlag(false) |
---|
348 | #if L0044_DU_DPB_OUTPUT_DELAY_HRD |
---|
349 | ,m_dpbOutputDelayDuLengthMinus1(0) |
---|
350 | #endif |
---|
351 | ,m_bitRateScale(0) |
---|
352 | ,m_cpbSizeScale(0) |
---|
353 | ,m_initialCpbRemovalDelayLengthMinus1(0) |
---|
354 | ,m_cpbRemovalDelayLengthMinus1(0) |
---|
355 | ,m_dpbOutputDelayLengthMinus1(0) |
---|
356 | {} |
---|
357 | |
---|
358 | virtual ~TComHRD() {} |
---|
359 | #if !L0043_TIMING_INFO |
---|
360 | Void setTimingInfoPresentFlag ( Bool flag ) { m_timingInfoPresentFlag = flag; } |
---|
361 | Bool getTimingInfoPresentFlag ( ) { return m_timingInfoPresentFlag; } |
---|
362 | |
---|
363 | Void setNumUnitsInTick ( UInt value ) { m_numUnitsInTick = value; } |
---|
364 | UInt getNumUnitsInTick ( ) { return m_numUnitsInTick; } |
---|
365 | |
---|
366 | Void setTimeScale ( UInt value ) { m_timeScale = value; } |
---|
367 | UInt getTimeScale ( ) { return m_timeScale; } |
---|
368 | #endif |
---|
369 | |
---|
370 | Void setNalHrdParametersPresentFlag ( Bool flag ) { m_nalHrdParametersPresentFlag = flag; } |
---|
371 | Bool getNalHrdParametersPresentFlag ( ) { return m_nalHrdParametersPresentFlag; } |
---|
372 | |
---|
373 | Void setVclHrdParametersPresentFlag ( Bool flag ) { m_vclHrdParametersPresentFlag = flag; } |
---|
374 | Bool getVclHrdParametersPresentFlag ( ) { return m_vclHrdParametersPresentFlag; } |
---|
375 | |
---|
376 | Void setSubPicCpbParamsPresentFlag ( Bool flag ) { m_subPicCpbParamsPresentFlag = flag; } |
---|
377 | Bool getSubPicCpbParamsPresentFlag ( ) { return m_subPicCpbParamsPresentFlag; } |
---|
378 | |
---|
379 | Void setTickDivisorMinus2 ( UInt value ) { m_tickDivisorMinus2 = value; } |
---|
380 | UInt getTickDivisorMinus2 ( ) { return m_tickDivisorMinus2; } |
---|
381 | |
---|
382 | Void setDuCpbRemovalDelayLengthMinus1 ( UInt value ) { m_duCpbRemovalDelayLengthMinus1 = value; } |
---|
383 | UInt getDuCpbRemovalDelayLengthMinus1 ( ) { return m_duCpbRemovalDelayLengthMinus1; } |
---|
384 | |
---|
385 | Void setSubPicCpbParamsInPicTimingSEIFlag ( Bool flag) { m_subPicCpbParamsInPicTimingSEIFlag = flag; } |
---|
386 | Bool getSubPicCpbParamsInPicTimingSEIFlag () { return m_subPicCpbParamsInPicTimingSEIFlag; } |
---|
387 | |
---|
388 | #if L0044_DU_DPB_OUTPUT_DELAY_HRD |
---|
389 | Void setDpbOutputDelayDuLengthMinus1 (UInt value ) { m_dpbOutputDelayDuLengthMinus1 = value; } |
---|
390 | UInt getDpbOutputDelayDuLengthMinus1 () { return m_dpbOutputDelayDuLengthMinus1; } |
---|
391 | #endif |
---|
392 | |
---|
393 | Void setBitRateScale ( UInt value ) { m_bitRateScale = value; } |
---|
394 | UInt getBitRateScale ( ) { return m_bitRateScale; } |
---|
395 | |
---|
396 | Void setCpbSizeScale ( UInt value ) { m_cpbSizeScale = value; } |
---|
397 | UInt getCpbSizeScale ( ) { return m_cpbSizeScale; } |
---|
398 | Void setDuCpbSizeScale ( UInt value ) { m_ducpbSizeScale = value; } |
---|
399 | UInt getDuCpbSizeScale ( ) { return m_ducpbSizeScale; } |
---|
400 | |
---|
401 | Void setInitialCpbRemovalDelayLengthMinus1( UInt value ) { m_initialCpbRemovalDelayLengthMinus1 = value; } |
---|
402 | UInt getInitialCpbRemovalDelayLengthMinus1( ) { return m_initialCpbRemovalDelayLengthMinus1; } |
---|
403 | |
---|
404 | Void setCpbRemovalDelayLengthMinus1 ( UInt value ) { m_cpbRemovalDelayLengthMinus1 = value; } |
---|
405 | UInt getCpbRemovalDelayLengthMinus1 ( ) { return m_cpbRemovalDelayLengthMinus1; } |
---|
406 | |
---|
407 | Void setDpbOutputDelayLengthMinus1 ( UInt value ) { m_dpbOutputDelayLengthMinus1 = value; } |
---|
408 | UInt getDpbOutputDelayLengthMinus1 ( ) { return m_dpbOutputDelayLengthMinus1; } |
---|
409 | |
---|
410 | Void setFixedPicRateFlag ( Int layer, Bool flag ) { m_HRD[layer].fixedPicRateFlag = flag; } |
---|
411 | Bool getFixedPicRateFlag ( Int layer ) { return m_HRD[layer].fixedPicRateFlag; } |
---|
412 | |
---|
413 | Void setFixedPicRateWithinCvsFlag ( Int layer, Bool flag ) { m_HRD[layer].fixedPicRateWithinCvsFlag = flag; } |
---|
414 | Bool getFixedPicRateWithinCvsFlag ( Int layer ) { return m_HRD[layer].fixedPicRateWithinCvsFlag; } |
---|
415 | |
---|
416 | Void setPicDurationInTcMinus1 ( Int layer, UInt value ) { m_HRD[layer].picDurationInTcMinus1 = value; } |
---|
417 | UInt getPicDurationInTcMinus1 ( Int layer ) { return m_HRD[layer].picDurationInTcMinus1; } |
---|
418 | |
---|
419 | Void setLowDelayHrdFlag ( Int layer, Bool flag ) { m_HRD[layer].lowDelayHrdFlag = flag; } |
---|
420 | Bool getLowDelayHrdFlag ( Int layer ) { return m_HRD[layer].lowDelayHrdFlag; } |
---|
421 | |
---|
422 | Void setCpbCntMinus1 ( Int layer, UInt value ) { m_HRD[layer].cpbCntMinus1 = value; } |
---|
423 | UInt getCpbCntMinus1 ( Int layer ) { return m_HRD[layer].cpbCntMinus1; } |
---|
424 | |
---|
425 | Void setBitRateValueMinus1 ( Int layer, Int cpbcnt, Int nalOrVcl, UInt value ) { m_HRD[layer].bitRateValueMinus1[cpbcnt][nalOrVcl] = value; } |
---|
426 | UInt getBitRateValueMinus1 ( Int layer, Int cpbcnt, Int nalOrVcl ) { return m_HRD[layer].bitRateValueMinus1[cpbcnt][nalOrVcl]; } |
---|
427 | |
---|
428 | Void setCpbSizeValueMinus1 ( Int layer, Int cpbcnt, Int nalOrVcl, UInt value ) { m_HRD[layer].cpbSizeValue[cpbcnt][nalOrVcl] = value; } |
---|
429 | UInt getCpbSizeValueMinus1 ( Int layer, Int cpbcnt, Int nalOrVcl ) { return m_HRD[layer].cpbSizeValue[cpbcnt][nalOrVcl]; } |
---|
430 | Void setDuCpbSizeValueMinus1 ( Int layer, Int cpbcnt, Int nalOrVcl, UInt value ) { m_HRD[layer].ducpbSizeValue[cpbcnt][nalOrVcl] = value; } |
---|
431 | UInt getDuCpbSizeValueMinus1 ( Int layer, Int cpbcnt, Int nalOrVcl ) { return m_HRD[layer].ducpbSizeValue[cpbcnt][nalOrVcl]; } |
---|
432 | #if L0363_DU_BIT_RATE |
---|
433 | Void setDuBitRateValueMinus1 ( Int layer, Int cpbcnt, Int nalOrVcl, UInt value ) { m_HRD[layer].duBitRateValue[cpbcnt][nalOrVcl] = value; } |
---|
434 | UInt getDuBitRateValueMinus1 (Int layer, Int cpbcnt, Int nalOrVcl ) { return m_HRD[layer].duBitRateValue[cpbcnt][nalOrVcl]; } |
---|
435 | #endif |
---|
436 | Void setCbrFlag ( Int layer, Int cpbcnt, Int nalOrVcl, UInt value ) { m_HRD[layer].cbrFlag[cpbcnt][nalOrVcl] = value; } |
---|
437 | Bool getCbrFlag ( Int layer, Int cpbcnt, Int nalOrVcl ) { return m_HRD[layer].cbrFlag[cpbcnt][nalOrVcl]; } |
---|
438 | |
---|
439 | Void setNumDU ( UInt value ) { m_numDU = value; } |
---|
440 | UInt getNumDU ( ) { return m_numDU; } |
---|
441 | #if L0045_CONDITION_SIGNALLING |
---|
442 | Bool getCpbDpbDelaysPresentFlag() { return getNalHrdParametersPresentFlag() || getVclHrdParametersPresentFlag(); } |
---|
443 | #endif |
---|
444 | }; |
---|
445 | |
---|
446 | #if L0043_TIMING_INFO |
---|
447 | class TimingInfo |
---|
448 | { |
---|
449 | Bool m_timingInfoPresentFlag; |
---|
450 | UInt m_numUnitsInTick; |
---|
451 | UInt m_timeScale; |
---|
452 | Bool m_pocProportionalToTimingFlag; |
---|
453 | Int m_numTicksPocDiffOneMinus1; |
---|
454 | public: |
---|
455 | TimingInfo() |
---|
456 | : m_timingInfoPresentFlag(false) |
---|
457 | , m_numUnitsInTick(1001) |
---|
458 | , m_timeScale(60000) |
---|
459 | , m_pocProportionalToTimingFlag(false) |
---|
460 | , m_numTicksPocDiffOneMinus1(0) {} |
---|
461 | |
---|
462 | Void setTimingInfoPresentFlag ( Bool flag ) { m_timingInfoPresentFlag = flag; } |
---|
463 | Bool getTimingInfoPresentFlag ( ) { return m_timingInfoPresentFlag; } |
---|
464 | |
---|
465 | Void setNumUnitsInTick ( UInt value ) { m_numUnitsInTick = value; } |
---|
466 | UInt getNumUnitsInTick ( ) { return m_numUnitsInTick; } |
---|
467 | |
---|
468 | Void setTimeScale ( UInt value ) { m_timeScale = value; } |
---|
469 | UInt getTimeScale ( ) { return m_timeScale; } |
---|
470 | |
---|
471 | Bool getPocProportionalToTimingFlag ( ) { return m_pocProportionalToTimingFlag; } |
---|
472 | Void setPocProportionalToTimingFlag (Bool x ) { m_pocProportionalToTimingFlag = x; } |
---|
473 | |
---|
474 | Int getNumTicksPocDiffOneMinus1 ( ) { return m_numTicksPocDiffOneMinus1; } |
---|
475 | Void setNumTicksPocDiffOneMinus1 (Int x ) { m_numTicksPocDiffOneMinus1 = x; } |
---|
476 | }; |
---|
477 | #endif |
---|
478 | |
---|
479 | class TComVPS |
---|
480 | { |
---|
481 | private: |
---|
482 | Int m_VPSId; |
---|
483 | UInt m_uiMaxTLayers; |
---|
484 | UInt m_uiMaxLayers; |
---|
485 | Bool m_bTemporalIdNestingFlag; |
---|
486 | |
---|
487 | UInt m_numReorderPics[MAX_TLAYER]; |
---|
488 | UInt m_uiMaxDecPicBuffering[MAX_TLAYER]; |
---|
489 | UInt m_uiMaxLatencyIncrease[MAX_TLAYER]; |
---|
490 | |
---|
491 | UInt m_numHrdParameters; |
---|
492 | #if !VPS_RENAME |
---|
493 | UInt m_maxNuhReservedZeroLayerId; |
---|
494 | #endif |
---|
495 | TComHRD* m_hrdParameters; |
---|
496 | UInt* m_hrdOpSetIdx; |
---|
497 | Bool* m_cprmsPresentFlag; |
---|
498 | #if VPS_RENAME |
---|
499 | UInt m_maxLayerId; |
---|
500 | UInt m_numLayerSets; |
---|
501 | Bool m_layerIdIncludedFlag[MAX_VPS_LAYER_SETS_PLUS1][MAX_VPS_LAYER_ID_PLUS1]; |
---|
502 | #else |
---|
503 | UInt m_numOpSets; |
---|
504 | Bool m_layerIdIncludedFlag[MAX_VPS_OP_SETS_PLUS1][MAX_VPS_NUH_RESERVED_ZERO_LAYER_ID_PLUS1]; |
---|
505 | #endif |
---|
506 | #if DERIVE_LAYER_ID_LIST_VARIABLES |
---|
507 | Int m_layerSetLayerIdList[MAX_VPS_LAYER_SETS_PLUS1][MAX_VPS_LAYER_ID_PLUS1]; |
---|
508 | Int m_numLayerInIdList[MAX_VPS_LAYER_SETS_PLUS1]; |
---|
509 | #endif |
---|
510 | TComPTL m_pcPTL; |
---|
511 | #if SIGNAL_BITRATE_PICRATE_IN_VPS |
---|
512 | TComBitRatePicRateInfo m_bitRatePicRateInfo; |
---|
513 | #endif |
---|
514 | #if L0043_TIMING_INFO |
---|
515 | TimingInfo m_timingInfo; |
---|
516 | #endif |
---|
517 | |
---|
518 | // ------------------------------------------ |
---|
519 | // Variables related to VPS extensions |
---|
520 | // ------------------------------------------ |
---|
521 | #if VPS_EXTN_MASK_AND_DIM_INFO |
---|
522 | Bool m_avcBaseLayerFlag; // For now, always set to true. |
---|
523 | Bool m_splittingFlag; |
---|
524 | Bool m_scalabilityMask[MAX_VPS_NUM_SCALABILITY_TYPES]; |
---|
525 | UInt m_dimensionIdLen[MAX_VPS_NUM_SCALABILITY_TYPES]; |
---|
526 | Bool m_nuhLayerIdPresentFlag; |
---|
527 | UInt m_layerIdInNuh[MAX_VPS_LAYER_ID_PLUS1]; // Maps layer ID in the VPS with layer_id_in_nuh |
---|
528 | UInt m_dimensionId[MAX_VPS_LAYER_ID_PLUS1][MAX_VPS_NUM_SCALABILITY_TYPES]; |
---|
529 | |
---|
530 | // Below are derived variables |
---|
531 | UInt m_numScalabilityTypes; |
---|
532 | UInt m_layerIdInVps[MAX_VPS_LAYER_ID_PLUS1]; // Maps layer_id_in_nuh with the layer ID in the VPS |
---|
533 | #endif |
---|
534 | #if VPS_EXTN_PROFILE_INFO |
---|
535 | // Profile-tier-level signalling related |
---|
536 | Bool m_profilePresentFlag[MAX_VPS_LAYER_SETS_PLUS1]; // The value with index 0 will not be used. |
---|
537 | UInt m_profileLayerSetRef[MAX_VPS_LAYER_SETS_PLUS1]; // The value with index 0 will not be used. |
---|
538 | std::vector<TComPTL> m_pcPTLForExtn; |
---|
539 | #endif |
---|
540 | #if VPS_EXTN_OP_LAYER_SETS |
---|
541 | // .. More declarations here |
---|
542 | // Target output layer signalling related |
---|
543 | UInt m_numOutputLayerSets; |
---|
544 | UInt m_outputLayerSetIdx[MAX_VPS_LAYER_SETS_PLUS1]; |
---|
545 | Bool m_outputLayerFlag[MAX_VPS_LAYER_SETS_PLUS1][MAX_VPS_LAYER_ID_PLUS1]; |
---|
546 | #endif |
---|
547 | #if VPS_EXTN_DIRECT_REF_LAYERS |
---|
548 | Bool m_directDependencyFlag[MAX_VPS_LAYER_ID_PLUS1][MAX_VPS_LAYER_ID_PLUS1]; |
---|
549 | UInt m_numDirectRefLayers[MAX_VPS_LAYER_ID_PLUS1]; |
---|
550 | UInt m_refLayerId[MAX_VPS_LAYER_ID_PLUS1][MAX_VPS_LAYER_ID_PLUS1]; |
---|
551 | #endif |
---|
552 | #if VPS_PROFILE_OUTPUT_LAYERS |
---|
553 | UInt m_numProfileTierLevel; |
---|
554 | Bool m_moreOutputLayerSetsThanDefaultFlag; |
---|
555 | Int m_numAddOutputLayerSets; |
---|
556 | Bool m_defaultOneTargetOutputLayerFlag; |
---|
557 | Int m_profileLevelTierIdx[64]; |
---|
558 | #endif |
---|
559 | #if JCTVC_M0458_INTERLAYER_RPS_SIG |
---|
560 | Bool m_maxOneActiveRefLayerFlag; |
---|
561 | #endif |
---|
562 | #if JCTVC_M0203_INTERLAYER_PRED_IDC |
---|
563 | UInt m_maxSublayerForIlpPlus1[MAX_VPS_LAYER_ID_PLUS1 - 1]; |
---|
564 | #endif |
---|
565 | public: |
---|
566 | TComVPS(); |
---|
567 | virtual ~TComVPS(); |
---|
568 | |
---|
569 | Void createHrdParamBuffer() |
---|
570 | { |
---|
571 | m_hrdParameters = new TComHRD[ getNumHrdParameters() ]; |
---|
572 | m_hrdOpSetIdx = new UInt [ getNumHrdParameters() ]; |
---|
573 | m_cprmsPresentFlag = new Bool [ getNumHrdParameters() ]; |
---|
574 | } |
---|
575 | |
---|
576 | TComHRD* getHrdParameters ( UInt i ) { return &m_hrdParameters[ i ]; } |
---|
577 | UInt getHrdOpSetIdx ( UInt i ) { return m_hrdOpSetIdx[ i ]; } |
---|
578 | Void setHrdOpSetIdx ( UInt val, UInt i ) { m_hrdOpSetIdx[ i ] = val; } |
---|
579 | Bool getCprmsPresentFlag ( UInt i ) { return m_cprmsPresentFlag[ i ]; } |
---|
580 | Void setCprmsPresentFlag ( Bool val, UInt i ) { m_cprmsPresentFlag[ i ] = val; } |
---|
581 | |
---|
582 | Int getVPSId () { return m_VPSId; } |
---|
583 | Void setVPSId (Int i) { m_VPSId = i; } |
---|
584 | |
---|
585 | UInt getMaxTLayers () { return m_uiMaxTLayers; } |
---|
586 | Void setMaxTLayers (UInt t) { m_uiMaxTLayers = t; } |
---|
587 | |
---|
588 | UInt getMaxLayers () { return m_uiMaxLayers; } |
---|
589 | Void setMaxLayers (UInt l) { m_uiMaxLayers = l; } |
---|
590 | |
---|
591 | Bool getTemporalNestingFlag () { return m_bTemporalIdNestingFlag; } |
---|
592 | Void setTemporalNestingFlag (Bool t) { m_bTemporalIdNestingFlag = t; } |
---|
593 | |
---|
594 | Void setNumReorderPics(UInt v, UInt tLayer) { m_numReorderPics[tLayer] = v; } |
---|
595 | UInt getNumReorderPics(UInt tLayer) { return m_numReorderPics[tLayer]; } |
---|
596 | |
---|
597 | Void setMaxDecPicBuffering(UInt v, UInt tLayer) { m_uiMaxDecPicBuffering[tLayer] = v; } |
---|
598 | UInt getMaxDecPicBuffering(UInt tLayer) { return m_uiMaxDecPicBuffering[tLayer]; } |
---|
599 | |
---|
600 | Void setMaxLatencyIncrease(UInt v, UInt tLayer) { m_uiMaxLatencyIncrease[tLayer] = v; } |
---|
601 | UInt getMaxLatencyIncrease(UInt tLayer) { return m_uiMaxLatencyIncrease[tLayer]; } |
---|
602 | |
---|
603 | UInt getNumHrdParameters() { return m_numHrdParameters; } |
---|
604 | Void setNumHrdParameters(UInt v) { m_numHrdParameters = v; } |
---|
605 | |
---|
606 | #if VPS_RENAME |
---|
607 | UInt getMaxLayerId() { return m_maxLayerId; } |
---|
608 | Void setMaxLayerId(UInt v) { m_maxLayerId = v; } |
---|
609 | |
---|
610 | UInt getNumLayerSets() { return m_numLayerSets; } |
---|
611 | Void setNumLayerSets(UInt v) { m_numLayerSets = v; } |
---|
612 | #else |
---|
613 | UInt getMaxNuhReservedZeroLayerId() { return m_maxNuhReservedZeroLayerId; } |
---|
614 | Void setMaxNuhReservedZeroLayerId(UInt v) { m_maxNuhReservedZeroLayerId = v; } |
---|
615 | |
---|
616 | UInt getMaxOpSets() { return m_numOpSets; } |
---|
617 | Void setMaxOpSets(UInt v) { m_numOpSets = v; } |
---|
618 | #endif |
---|
619 | Bool getLayerIdIncludedFlag(UInt opsIdx, UInt id) { return m_layerIdIncludedFlag[opsIdx][id]; } |
---|
620 | Void setLayerIdIncludedFlag(Bool v, UInt opsIdx, UInt id) { m_layerIdIncludedFlag[opsIdx][id] = v; } |
---|
621 | #if DERIVE_LAYER_ID_LIST_VARIABLES |
---|
622 | Int getLayerSetLayerIdList(Int set, Int layerId) { return m_layerSetLayerIdList[set][layerId]; } |
---|
623 | Void setLayerSetLayerIdList(Int set, Int layerId, Int x) { m_layerSetLayerIdList[set][layerId] = x ; } |
---|
624 | |
---|
625 | Int getNumLayersInIdList(Int set) { return m_numLayerInIdList[set]; } |
---|
626 | Void setNumLayersInIdList(Int set, Int x) { m_numLayerInIdList[set] = x ; } |
---|
627 | |
---|
628 | Void deriveLayerIdListVariables(); |
---|
629 | #endif |
---|
630 | TComPTL* getPTL() { return &m_pcPTL; } |
---|
631 | #if SIGNAL_BITRATE_PICRATE_IN_VPS |
---|
632 | TComBitRatePicRateInfo *getBitratePicrateInfo() { return &m_bitRatePicRateInfo; } |
---|
633 | #endif |
---|
634 | #if L0043_TIMING_INFO |
---|
635 | TimingInfo* getTimingInfo() { return &m_timingInfo; } |
---|
636 | #endif |
---|
637 | #if VPS_EXTN_MASK_AND_DIM_INFO |
---|
638 | Bool getAvcBaseLayerFlag() { return m_avcBaseLayerFlag; } |
---|
639 | Void setAvcBaseLayerFlag(Bool x) { m_avcBaseLayerFlag = x; } |
---|
640 | |
---|
641 | Bool getSplittingFlag() { return m_splittingFlag; } |
---|
642 | Void setSplittingFlag(Bool x) { m_splittingFlag = x; } |
---|
643 | |
---|
644 | Bool getScalabilityMask(Int id) { return m_scalabilityMask[id]; } |
---|
645 | Void setScalabilityMask(Int id, Bool x) { m_scalabilityMask[id] = x; } |
---|
646 | |
---|
647 | UInt getDimensionIdLen(Int id) { return m_dimensionIdLen[id]; } |
---|
648 | Void setDimensionIdLen(Int id, UInt x) { m_dimensionIdLen[id] = x; } |
---|
649 | |
---|
650 | Bool getNuhLayerIdPresentFlag() { return m_nuhLayerIdPresentFlag; } |
---|
651 | Void setNuhLayerIdPresentFlag(Bool x) { m_nuhLayerIdPresentFlag = x; } |
---|
652 | |
---|
653 | UInt getLayerIdInNuh(Int id) { return m_layerIdInNuh[id]; } |
---|
654 | Void setLayerIdInNuh(Int id, UInt x) { m_layerIdInNuh[id] = x; } |
---|
655 | |
---|
656 | UInt getDimensionId(Int lyrId, Int id) { return m_dimensionId[lyrId][id]; } |
---|
657 | Void setDimensionId(Int lyrId, Int id, UInt x) { m_dimensionId[lyrId][id] = x; } |
---|
658 | |
---|
659 | UInt getNumScalabilityTypes() { return m_numScalabilityTypes; } |
---|
660 | Void setNumScalabilityTypes(UInt x) { m_numScalabilityTypes = x; } |
---|
661 | |
---|
662 | UInt getLayerIdInVps(Int id) { return m_layerIdInVps[id]; } |
---|
663 | Void setLayerIdInVps(Int id, UInt x) { m_layerIdInVps[id] = x; } |
---|
664 | #endif |
---|
665 | #if VPS_EXTN_PROFILE_INFO |
---|
666 | Bool getProfilePresentFlag(Int id) { return m_profilePresentFlag[id]; } |
---|
667 | Void setProfilePresentFlag(Int id, Bool x) { m_profilePresentFlag[id] = x; } |
---|
668 | |
---|
669 | UInt getProfileLayerSetRef(Int id) { return m_profileLayerSetRef[id]; } |
---|
670 | Void setProfileLayerSetRef(Int id, Bool x) { m_profileLayerSetRef[id] = x; } |
---|
671 | |
---|
672 | std::vector<TComPTL>* getPTLForExtnPtr() { return &m_pcPTLForExtn; } |
---|
673 | TComPTL* getPTLForExtn(Int id) { return &m_pcPTLForExtn[id]; } |
---|
674 | #endif |
---|
675 | #if VPS_EXTN_OP_LAYER_SETS |
---|
676 | // Target output layer signalling related |
---|
677 | UInt getNumOutputLayerSets() { return m_numOutputLayerSets; } |
---|
678 | Void setNumOutputLayerSets(Int x) { m_numOutputLayerSets = x; } |
---|
679 | |
---|
680 | UInt getOutputLayerSetIdx(Int idx) { return m_outputLayerSetIdx[idx]; } |
---|
681 | Void setOutputLayerSetIdx(Int idx, UInt x) { m_outputLayerSetIdx[idx] = x; } |
---|
682 | |
---|
683 | Bool getOutputLayerFlag(Int layerSet, Int layerId) { return m_outputLayerFlag[layerSet][layerId]; } |
---|
684 | Void setOutputLayerFlag(Int layerSet, Int layerId, Bool x) { m_outputLayerFlag[layerSet][layerId] = x; } |
---|
685 | #endif |
---|
686 | #if VPS_EXTN_DIRECT_REF_LAYERS |
---|
687 | // Direct dependency of layers |
---|
688 | Bool getDirectDependencyFlag(Int currLayerId, Int refLayerId) { return m_directDependencyFlag[currLayerId][refLayerId]; } |
---|
689 | Void setDirectDependencyFlag(Int currLayerId, Int refLayerId, Bool x) { m_directDependencyFlag[currLayerId][refLayerId] = x; } |
---|
690 | |
---|
691 | UInt getNumDirectRefLayers(Int layerId) { return m_numDirectRefLayers[layerId]; } |
---|
692 | Void setNumDirectRefLayers(Int layerId, UInt refLayerNum) { m_numDirectRefLayers[layerId] = refLayerNum; } |
---|
693 | |
---|
694 | UInt getRefLayerId(Int layerId, Int refLayerIdx) { return m_refLayerId[layerId][refLayerIdx]; } |
---|
695 | Void setRefLayerId(Int layerId, Int refLayerIdx, UInt refLayerId) { m_refLayerId[layerId][refLayerIdx] = refLayerId; } |
---|
696 | #endif |
---|
697 | #if VPS_PROFILE_OUTPUT_LAYERS |
---|
698 | UInt getNumProfileTierLevel() { return m_numProfileTierLevel; } |
---|
699 | Void setNumProfileTierLevel(Int x) { m_numProfileTierLevel = x; } |
---|
700 | |
---|
701 | Bool getMoreOutputLayerSetsThanDefaultFlag() { return m_moreOutputLayerSetsThanDefaultFlag;} |
---|
702 | Void setMoreOutputLayerSetsThanDefaultFlag(Bool x) { m_moreOutputLayerSetsThanDefaultFlag = x ;} |
---|
703 | |
---|
704 | Int getNumAddOutputLayerSets() { return m_numAddOutputLayerSets; } |
---|
705 | Void setNumAddOutputLayerSets(Int x) { m_numAddOutputLayerSets = x ; } |
---|
706 | |
---|
707 | Bool getDefaultOneTargetOutputLayerFlag() { return m_defaultOneTargetOutputLayerFlag;} |
---|
708 | Void setDefaultOneTargetOutputLayerFlag(Bool x) { m_defaultOneTargetOutputLayerFlag= x ;} |
---|
709 | |
---|
710 | Int getProfileLevelTierIdx(Int i) { return m_profileLevelTierIdx[i]; } |
---|
711 | Void setProfileLevelTierIdx(Int i, Int x) { m_profileLevelTierIdx[i] = x ; } |
---|
712 | #endif |
---|
713 | #if JCTVC_M0458_INTERLAYER_RPS_SIG |
---|
714 | Bool getMaxOneActiveRefLayerFlag() { return m_maxOneActiveRefLayerFlag; } |
---|
715 | Void setMaxOneActiveRefLayerFlag(Bool x) { m_maxOneActiveRefLayerFlag = x; } |
---|
716 | #endif |
---|
717 | #if JCTVC_M0203_INTERLAYER_PRED_IDC |
---|
718 | Bool getMaxSublayerForIlpPlus1(Int layerId) { return m_maxSublayerForIlpPlus1[layerId]; } |
---|
719 | Void setMaxSublayerForIlpPlus1(Int layerId, UInt maxSublayer) { m_maxSublayerForIlpPlus1[layerId] = maxSublayer; } |
---|
720 | #endif |
---|
721 | }; |
---|
722 | |
---|
723 | class Window |
---|
724 | { |
---|
725 | private: |
---|
726 | Bool m_enabledFlag; |
---|
727 | Int m_winLeftOffset; |
---|
728 | Int m_winRightOffset; |
---|
729 | Int m_winTopOffset; |
---|
730 | Int m_winBottomOffset; |
---|
731 | public: |
---|
732 | Window() |
---|
733 | : m_enabledFlag (false) |
---|
734 | , m_winLeftOffset (0) |
---|
735 | , m_winRightOffset (0) |
---|
736 | , m_winTopOffset (0) |
---|
737 | , m_winBottomOffset (0) |
---|
738 | { } |
---|
739 | |
---|
740 | Bool getWindowEnabledFlag() const { return m_enabledFlag; } |
---|
741 | Void resetWindow() { m_enabledFlag = false; m_winLeftOffset = m_winRightOffset = m_winTopOffset = m_winBottomOffset = 0; } |
---|
742 | Int getWindowLeftOffset() const { return m_enabledFlag ? m_winLeftOffset : 0; } |
---|
743 | Void setWindowLeftOffset(Int val) { m_winLeftOffset = val; m_enabledFlag = true; } |
---|
744 | Int getWindowRightOffset() const { return m_enabledFlag ? m_winRightOffset : 0; } |
---|
745 | Void setWindowRightOffset(Int val) { m_winRightOffset = val; m_enabledFlag = true; } |
---|
746 | Int getWindowTopOffset() const { return m_enabledFlag ? m_winTopOffset : 0; } |
---|
747 | Void setWindowTopOffset(Int val) { m_winTopOffset = val; m_enabledFlag = true; } |
---|
748 | Int getWindowBottomOffset() const { return m_enabledFlag ? m_winBottomOffset: 0; } |
---|
749 | Void setWindowBottomOffset(Int val) { m_winBottomOffset = val; m_enabledFlag = true; } |
---|
750 | |
---|
751 | Void setWindow(Int offsetLeft, Int offsetLRight, Int offsetLTop, Int offsetLBottom) |
---|
752 | { |
---|
753 | m_enabledFlag = true; |
---|
754 | m_winLeftOffset = offsetLeft; |
---|
755 | m_winRightOffset = offsetLRight; |
---|
756 | m_winTopOffset = offsetLTop; |
---|
757 | m_winBottomOffset = offsetLBottom; |
---|
758 | } |
---|
759 | }; |
---|
760 | |
---|
761 | |
---|
762 | class TComVUI |
---|
763 | { |
---|
764 | private: |
---|
765 | Bool m_aspectRatioInfoPresentFlag; |
---|
766 | Int m_aspectRatioIdc; |
---|
767 | Int m_sarWidth; |
---|
768 | Int m_sarHeight; |
---|
769 | Bool m_overscanInfoPresentFlag; |
---|
770 | Bool m_overscanAppropriateFlag; |
---|
771 | Bool m_videoSignalTypePresentFlag; |
---|
772 | Int m_videoFormat; |
---|
773 | Bool m_videoFullRangeFlag; |
---|
774 | Bool m_colourDescriptionPresentFlag; |
---|
775 | Int m_colourPrimaries; |
---|
776 | Int m_transferCharacteristics; |
---|
777 | Int m_matrixCoefficients; |
---|
778 | Bool m_chromaLocInfoPresentFlag; |
---|
779 | Int m_chromaSampleLocTypeTopField; |
---|
780 | Int m_chromaSampleLocTypeBottomField; |
---|
781 | Bool m_neutralChromaIndicationFlag; |
---|
782 | Bool m_fieldSeqFlag; |
---|
783 | |
---|
784 | Window m_defaultDisplayWindow; |
---|
785 | Bool m_frameFieldInfoPresentFlag; |
---|
786 | Bool m_hrdParametersPresentFlag; |
---|
787 | Bool m_bitstreamRestrictionFlag; |
---|
788 | Bool m_tilesFixedStructureFlag; |
---|
789 | Bool m_motionVectorsOverPicBoundariesFlag; |
---|
790 | Bool m_restrictedRefPicListsFlag; |
---|
791 | Int m_minSpatialSegmentationIdc; |
---|
792 | Int m_maxBytesPerPicDenom; |
---|
793 | Int m_maxBitsPerMinCuDenom; |
---|
794 | Int m_log2MaxMvLengthHorizontal; |
---|
795 | Int m_log2MaxMvLengthVertical; |
---|
796 | TComHRD m_hrdParameters; |
---|
797 | #if L0043_TIMING_INFO |
---|
798 | TimingInfo m_timingInfo; |
---|
799 | #else |
---|
800 | Bool m_pocProportionalToTimingFlag; |
---|
801 | Int m_numTicksPocDiffOneMinus1; |
---|
802 | #endif |
---|
803 | |
---|
804 | public: |
---|
805 | TComVUI() |
---|
806 | :m_aspectRatioInfoPresentFlag(false) |
---|
807 | ,m_aspectRatioIdc(0) |
---|
808 | ,m_sarWidth(0) |
---|
809 | ,m_sarHeight(0) |
---|
810 | ,m_overscanInfoPresentFlag(false) |
---|
811 | ,m_overscanAppropriateFlag(false) |
---|
812 | ,m_videoSignalTypePresentFlag(false) |
---|
813 | ,m_videoFormat(5) |
---|
814 | ,m_videoFullRangeFlag(false) |
---|
815 | ,m_colourDescriptionPresentFlag(false) |
---|
816 | ,m_colourPrimaries(2) |
---|
817 | ,m_transferCharacteristics(2) |
---|
818 | ,m_matrixCoefficients(2) |
---|
819 | ,m_chromaLocInfoPresentFlag(false) |
---|
820 | ,m_chromaSampleLocTypeTopField(0) |
---|
821 | ,m_chromaSampleLocTypeBottomField(0) |
---|
822 | ,m_neutralChromaIndicationFlag(false) |
---|
823 | ,m_fieldSeqFlag(false) |
---|
824 | ,m_frameFieldInfoPresentFlag(false) |
---|
825 | ,m_hrdParametersPresentFlag(false) |
---|
826 | ,m_bitstreamRestrictionFlag(false) |
---|
827 | ,m_tilesFixedStructureFlag(false) |
---|
828 | ,m_motionVectorsOverPicBoundariesFlag(true) |
---|
829 | ,m_restrictedRefPicListsFlag(1) |
---|
830 | ,m_minSpatialSegmentationIdc(0) |
---|
831 | ,m_maxBytesPerPicDenom(2) |
---|
832 | ,m_maxBitsPerMinCuDenom(1) |
---|
833 | ,m_log2MaxMvLengthHorizontal(15) |
---|
834 | ,m_log2MaxMvLengthVertical(15) |
---|
835 | #if !L0043_TIMING_INFO |
---|
836 | ,m_pocProportionalToTimingFlag(false) |
---|
837 | ,m_numTicksPocDiffOneMinus1(0) |
---|
838 | #endif |
---|
839 | {} |
---|
840 | |
---|
841 | virtual ~TComVUI() {} |
---|
842 | |
---|
843 | Bool getAspectRatioInfoPresentFlag() { return m_aspectRatioInfoPresentFlag; } |
---|
844 | Void setAspectRatioInfoPresentFlag(Bool i) { m_aspectRatioInfoPresentFlag = i; } |
---|
845 | |
---|
846 | Int getAspectRatioIdc() { return m_aspectRatioIdc; } |
---|
847 | Void setAspectRatioIdc(Int i) { m_aspectRatioIdc = i; } |
---|
848 | |
---|
849 | Int getSarWidth() { return m_sarWidth; } |
---|
850 | Void setSarWidth(Int i) { m_sarWidth = i; } |
---|
851 | |
---|
852 | Int getSarHeight() { return m_sarHeight; } |
---|
853 | Void setSarHeight(Int i) { m_sarHeight = i; } |
---|
854 | |
---|
855 | Bool getOverscanInfoPresentFlag() { return m_overscanInfoPresentFlag; } |
---|
856 | Void setOverscanInfoPresentFlag(Bool i) { m_overscanInfoPresentFlag = i; } |
---|
857 | |
---|
858 | Bool getOverscanAppropriateFlag() { return m_overscanAppropriateFlag; } |
---|
859 | Void setOverscanAppropriateFlag(Bool i) { m_overscanAppropriateFlag = i; } |
---|
860 | |
---|
861 | Bool getVideoSignalTypePresentFlag() { return m_videoSignalTypePresentFlag; } |
---|
862 | Void setVideoSignalTypePresentFlag(Bool i) { m_videoSignalTypePresentFlag = i; } |
---|
863 | |
---|
864 | Int getVideoFormat() { return m_videoFormat; } |
---|
865 | Void setVideoFormat(Int i) { m_videoFormat = i; } |
---|
866 | |
---|
867 | Bool getVideoFullRangeFlag() { return m_videoFullRangeFlag; } |
---|
868 | Void setVideoFullRangeFlag(Bool i) { m_videoFullRangeFlag = i; } |
---|
869 | |
---|
870 | Bool getColourDescriptionPresentFlag() { return m_colourDescriptionPresentFlag; } |
---|
871 | Void setColourDescriptionPresentFlag(Bool i) { m_colourDescriptionPresentFlag = i; } |
---|
872 | |
---|
873 | Int getColourPrimaries() { return m_colourPrimaries; } |
---|
874 | Void setColourPrimaries(Int i) { m_colourPrimaries = i; } |
---|
875 | |
---|
876 | Int getTransferCharacteristics() { return m_transferCharacteristics; } |
---|
877 | Void setTransferCharacteristics(Int i) { m_transferCharacteristics = i; } |
---|
878 | |
---|
879 | Int getMatrixCoefficients() { return m_matrixCoefficients; } |
---|
880 | Void setMatrixCoefficients(Int i) { m_matrixCoefficients = i; } |
---|
881 | |
---|
882 | Bool getChromaLocInfoPresentFlag() { return m_chromaLocInfoPresentFlag; } |
---|
883 | Void setChromaLocInfoPresentFlag(Bool i) { m_chromaLocInfoPresentFlag = i; } |
---|
884 | |
---|
885 | Int getChromaSampleLocTypeTopField() { return m_chromaSampleLocTypeTopField; } |
---|
886 | Void setChromaSampleLocTypeTopField(Int i) { m_chromaSampleLocTypeTopField = i; } |
---|
887 | |
---|
888 | Int getChromaSampleLocTypeBottomField() { return m_chromaSampleLocTypeBottomField; } |
---|
889 | Void setChromaSampleLocTypeBottomField(Int i) { m_chromaSampleLocTypeBottomField = i; } |
---|
890 | |
---|
891 | Bool getNeutralChromaIndicationFlag() { return m_neutralChromaIndicationFlag; } |
---|
892 | Void setNeutralChromaIndicationFlag(Bool i) { m_neutralChromaIndicationFlag = i; } |
---|
893 | |
---|
894 | Bool getFieldSeqFlag() { return m_fieldSeqFlag; } |
---|
895 | Void setFieldSeqFlag(Bool i) { m_fieldSeqFlag = i; } |
---|
896 | |
---|
897 | Bool getFrameFieldInfoPresentFlag() { return m_frameFieldInfoPresentFlag; } |
---|
898 | Void setFrameFieldInfoPresentFlag(Bool i) { m_frameFieldInfoPresentFlag = i; } |
---|
899 | |
---|
900 | Window& getDefaultDisplayWindow() { return m_defaultDisplayWindow; } |
---|
901 | Void setDefaultDisplayWindow(Window& defaultDisplayWindow ) { m_defaultDisplayWindow = defaultDisplayWindow; } |
---|
902 | |
---|
903 | Bool getHrdParametersPresentFlag() { return m_hrdParametersPresentFlag; } |
---|
904 | Void setHrdParametersPresentFlag(Bool i) { m_hrdParametersPresentFlag = i; } |
---|
905 | |
---|
906 | Bool getBitstreamRestrictionFlag() { return m_bitstreamRestrictionFlag; } |
---|
907 | Void setBitstreamRestrictionFlag(Bool i) { m_bitstreamRestrictionFlag = i; } |
---|
908 | |
---|
909 | Bool getTilesFixedStructureFlag() { return m_tilesFixedStructureFlag; } |
---|
910 | Void setTilesFixedStructureFlag(Bool i) { m_tilesFixedStructureFlag = i; } |
---|
911 | |
---|
912 | Bool getMotionVectorsOverPicBoundariesFlag() { return m_motionVectorsOverPicBoundariesFlag; } |
---|
913 | Void setMotionVectorsOverPicBoundariesFlag(Bool i) { m_motionVectorsOverPicBoundariesFlag = i; } |
---|
914 | |
---|
915 | Bool getRestrictedRefPicListsFlag() { return m_restrictedRefPicListsFlag; } |
---|
916 | Void setRestrictedRefPicListsFlag(Bool b) { m_restrictedRefPicListsFlag = b; } |
---|
917 | |
---|
918 | Int getMinSpatialSegmentationIdc() { return m_minSpatialSegmentationIdc; } |
---|
919 | Void setMinSpatialSegmentationIdc(Int i) { m_minSpatialSegmentationIdc = i; } |
---|
920 | Int getMaxBytesPerPicDenom() { return m_maxBytesPerPicDenom; } |
---|
921 | Void setMaxBytesPerPicDenom(Int i) { m_maxBytesPerPicDenom = i; } |
---|
922 | |
---|
923 | Int getMaxBitsPerMinCuDenom() { return m_maxBitsPerMinCuDenom; } |
---|
924 | Void setMaxBitsPerMinCuDenom(Int i) { m_maxBitsPerMinCuDenom = i; } |
---|
925 | |
---|
926 | Int getLog2MaxMvLengthHorizontal() { return m_log2MaxMvLengthHorizontal; } |
---|
927 | Void setLog2MaxMvLengthHorizontal(Int i) { m_log2MaxMvLengthHorizontal = i; } |
---|
928 | |
---|
929 | Int getLog2MaxMvLengthVertical() { return m_log2MaxMvLengthVertical; } |
---|
930 | Void setLog2MaxMvLengthVertical(Int i) { m_log2MaxMvLengthVertical = i; } |
---|
931 | |
---|
932 | TComHRD* getHrdParameters () { return &m_hrdParameters; } |
---|
933 | #if L0043_TIMING_INFO |
---|
934 | TimingInfo* getTimingInfo() { return &m_timingInfo; } |
---|
935 | #else |
---|
936 | Bool getPocProportionalToTimingFlag() {return m_pocProportionalToTimingFlag; } |
---|
937 | Void setPocProportionalToTimingFlag(Bool x) {m_pocProportionalToTimingFlag = x;} |
---|
938 | Int getNumTicksPocDiffOneMinus1() {return m_numTicksPocDiffOneMinus1;} |
---|
939 | Void setNumTicksPocDiffOneMinus1(Int x) { m_numTicksPocDiffOneMinus1 = x;} |
---|
940 | #endif |
---|
941 | }; |
---|
942 | |
---|
943 | /// SPS class |
---|
944 | class TComSPS |
---|
945 | { |
---|
946 | private: |
---|
947 | Int m_SPSId; |
---|
948 | Int m_VPSId; |
---|
949 | Int m_chromaFormatIdc; |
---|
950 | |
---|
951 | UInt m_uiMaxTLayers; // maximum number of temporal layers |
---|
952 | |
---|
953 | // Structure |
---|
954 | UInt m_picWidthInLumaSamples; |
---|
955 | UInt m_picHeightInLumaSamples; |
---|
956 | |
---|
957 | Int m_log2MinCodingBlockSize; |
---|
958 | Int m_log2DiffMaxMinCodingBlockSize; |
---|
959 | UInt m_uiMaxCUWidth; |
---|
960 | UInt m_uiMaxCUHeight; |
---|
961 | UInt m_uiMaxCUDepth; |
---|
962 | |
---|
963 | Window m_conformanceWindow; |
---|
964 | |
---|
965 | TComRPSList m_RPSList; |
---|
966 | Bool m_bLongTermRefsPresent; |
---|
967 | Bool m_TMVPFlagsPresent; |
---|
968 | Int m_numReorderPics[MAX_TLAYER]; |
---|
969 | |
---|
970 | // Tool list |
---|
971 | UInt m_uiQuadtreeTULog2MaxSize; |
---|
972 | UInt m_uiQuadtreeTULog2MinSize; |
---|
973 | UInt m_uiQuadtreeTUMaxDepthInter; |
---|
974 | UInt m_uiQuadtreeTUMaxDepthIntra; |
---|
975 | Bool m_usePCM; |
---|
976 | UInt m_pcmLog2MaxSize; |
---|
977 | UInt m_uiPCMLog2MinSize; |
---|
978 | Bool m_useAMP; |
---|
979 | |
---|
980 | #if !L0034_COMBINED_LIST_CLEANUP |
---|
981 | Bool m_bUseLComb; |
---|
982 | #endif |
---|
983 | |
---|
984 | // Parameter |
---|
985 | Int m_bitDepthY; |
---|
986 | Int m_bitDepthC; |
---|
987 | Int m_qpBDOffsetY; |
---|
988 | Int m_qpBDOffsetC; |
---|
989 | |
---|
990 | Bool m_useLossless; |
---|
991 | |
---|
992 | UInt m_uiPCMBitDepthLuma; |
---|
993 | UInt m_uiPCMBitDepthChroma; |
---|
994 | Bool m_bPCMFilterDisableFlag; |
---|
995 | |
---|
996 | UInt m_uiBitsForPOC; |
---|
997 | UInt m_numLongTermRefPicSPS; |
---|
998 | UInt m_ltRefPicPocLsbSps[33]; |
---|
999 | Bool m_usedByCurrPicLtSPSFlag[33]; |
---|
1000 | // Max physical transform size |
---|
1001 | UInt m_uiMaxTrSize; |
---|
1002 | |
---|
1003 | Int m_iAMPAcc[MAX_CU_DEPTH]; |
---|
1004 | Bool m_bUseSAO; |
---|
1005 | |
---|
1006 | Bool m_bTemporalIdNestingFlag; // temporal_id_nesting_flag |
---|
1007 | |
---|
1008 | Bool m_scalingListEnabledFlag; |
---|
1009 | Bool m_scalingListPresentFlag; |
---|
1010 | TComScalingList* m_scalingList; //!< ScalingList class pointer |
---|
1011 | UInt m_uiMaxDecPicBuffering[MAX_TLAYER]; |
---|
1012 | UInt m_uiMaxLatencyIncrease[MAX_TLAYER]; |
---|
1013 | |
---|
1014 | Bool m_useDF; |
---|
1015 | Bool m_useStrongIntraSmoothing; |
---|
1016 | |
---|
1017 | Bool m_vuiParametersPresentFlag; |
---|
1018 | TComVUI m_vuiParameters; |
---|
1019 | |
---|
1020 | static const Int m_winUnitX[MAX_CHROMA_FORMAT_IDC+1]; |
---|
1021 | static const Int m_winUnitY[MAX_CHROMA_FORMAT_IDC+1]; |
---|
1022 | TComPTL m_pcPTL; |
---|
1023 | |
---|
1024 | #if SVC_EXTENSION |
---|
1025 | UInt m_layerId; |
---|
1026 | #endif |
---|
1027 | #if REF_IDX_MFM |
---|
1028 | Bool m_bMFMEnabledFlag; |
---|
1029 | #endif |
---|
1030 | #if SCALED_REF_LAYER_OFFSETS |
---|
1031 | Window m_scaledRefLayerWindow; |
---|
1032 | #endif |
---|
1033 | public: |
---|
1034 | TComSPS(); |
---|
1035 | virtual ~TComSPS(); |
---|
1036 | |
---|
1037 | Int getVPSId () { return m_VPSId; } |
---|
1038 | Void setVPSId (Int i) { m_VPSId = i; } |
---|
1039 | Int getSPSId () { return m_SPSId; } |
---|
1040 | Void setSPSId (Int i) { m_SPSId = i; } |
---|
1041 | Int getChromaFormatIdc () { return m_chromaFormatIdc; } |
---|
1042 | Void setChromaFormatIdc (Int i) { m_chromaFormatIdc = i; } |
---|
1043 | |
---|
1044 | static Int getWinUnitX (Int chromaFormatIdc) { assert (chromaFormatIdc > 0 && chromaFormatIdc <= MAX_CHROMA_FORMAT_IDC); return m_winUnitX[chromaFormatIdc]; } |
---|
1045 | static Int getWinUnitY (Int chromaFormatIdc) { assert (chromaFormatIdc > 0 && chromaFormatIdc <= MAX_CHROMA_FORMAT_IDC); return m_winUnitY[chromaFormatIdc]; } |
---|
1046 | |
---|
1047 | // structure |
---|
1048 | Void setPicWidthInLumaSamples ( UInt u ) { m_picWidthInLumaSamples = u; } |
---|
1049 | UInt getPicWidthInLumaSamples () { return m_picWidthInLumaSamples; } |
---|
1050 | Void setPicHeightInLumaSamples ( UInt u ) { m_picHeightInLumaSamples = u; } |
---|
1051 | UInt getPicHeightInLumaSamples () { return m_picHeightInLumaSamples; } |
---|
1052 | |
---|
1053 | Window& getConformanceWindow() { return m_conformanceWindow; } |
---|
1054 | Void setConformanceWindow(Window& conformanceWindow ) { m_conformanceWindow = conformanceWindow; } |
---|
1055 | |
---|
1056 | UInt getNumLongTermRefPicSPS() { return m_numLongTermRefPicSPS; } |
---|
1057 | Void setNumLongTermRefPicSPS(UInt val) { m_numLongTermRefPicSPS = val; } |
---|
1058 | |
---|
1059 | UInt getLtRefPicPocLsbSps(UInt index) { return m_ltRefPicPocLsbSps[index]; } |
---|
1060 | Void setLtRefPicPocLsbSps(UInt index, UInt val) { m_ltRefPicPocLsbSps[index] = val; } |
---|
1061 | |
---|
1062 | Bool getUsedByCurrPicLtSPSFlag(Int i) {return m_usedByCurrPicLtSPSFlag[i];} |
---|
1063 | Void setUsedByCurrPicLtSPSFlag(Int i, Bool x) { m_usedByCurrPicLtSPSFlag[i] = x;} |
---|
1064 | |
---|
1065 | Int getLog2MinCodingBlockSize() const { return m_log2MinCodingBlockSize; } |
---|
1066 | Void setLog2MinCodingBlockSize(Int val) { m_log2MinCodingBlockSize = val; } |
---|
1067 | Int getLog2DiffMaxMinCodingBlockSize() const { return m_log2DiffMaxMinCodingBlockSize; } |
---|
1068 | Void setLog2DiffMaxMinCodingBlockSize(Int val) { m_log2DiffMaxMinCodingBlockSize = val; } |
---|
1069 | |
---|
1070 | Void setMaxCUWidth ( UInt u ) { m_uiMaxCUWidth = u; } |
---|
1071 | UInt getMaxCUWidth () { return m_uiMaxCUWidth; } |
---|
1072 | Void setMaxCUHeight ( UInt u ) { m_uiMaxCUHeight = u; } |
---|
1073 | UInt getMaxCUHeight () { return m_uiMaxCUHeight; } |
---|
1074 | Void setMaxCUDepth ( UInt u ) { m_uiMaxCUDepth = u; } |
---|
1075 | UInt getMaxCUDepth () { return m_uiMaxCUDepth; } |
---|
1076 | Void setUsePCM ( Bool b ) { m_usePCM = b; } |
---|
1077 | Bool getUsePCM () { return m_usePCM; } |
---|
1078 | Void setPCMLog2MaxSize ( UInt u ) { m_pcmLog2MaxSize = u; } |
---|
1079 | UInt getPCMLog2MaxSize () { return m_pcmLog2MaxSize; } |
---|
1080 | Void setPCMLog2MinSize ( UInt u ) { m_uiPCMLog2MinSize = u; } |
---|
1081 | UInt getPCMLog2MinSize () { return m_uiPCMLog2MinSize; } |
---|
1082 | Void setBitsForPOC ( UInt u ) { m_uiBitsForPOC = u; } |
---|
1083 | UInt getBitsForPOC () { return m_uiBitsForPOC; } |
---|
1084 | Bool getUseAMP() { return m_useAMP; } |
---|
1085 | Void setUseAMP( Bool b ) { m_useAMP = b; } |
---|
1086 | Void setQuadtreeTULog2MaxSize( UInt u ) { m_uiQuadtreeTULog2MaxSize = u; } |
---|
1087 | UInt getQuadtreeTULog2MaxSize() { return m_uiQuadtreeTULog2MaxSize; } |
---|
1088 | Void setQuadtreeTULog2MinSize( UInt u ) { m_uiQuadtreeTULog2MinSize = u; } |
---|
1089 | UInt getQuadtreeTULog2MinSize() { return m_uiQuadtreeTULog2MinSize; } |
---|
1090 | Void setQuadtreeTUMaxDepthInter( UInt u ) { m_uiQuadtreeTUMaxDepthInter = u; } |
---|
1091 | Void setQuadtreeTUMaxDepthIntra( UInt u ) { m_uiQuadtreeTUMaxDepthIntra = u; } |
---|
1092 | UInt getQuadtreeTUMaxDepthInter() { return m_uiQuadtreeTUMaxDepthInter; } |
---|
1093 | UInt getQuadtreeTUMaxDepthIntra() { return m_uiQuadtreeTUMaxDepthIntra; } |
---|
1094 | Void setNumReorderPics(Int i, UInt tlayer) { m_numReorderPics[tlayer] = i; } |
---|
1095 | Int getNumReorderPics(UInt tlayer) { return m_numReorderPics[tlayer]; } |
---|
1096 | Void createRPSList( Int numRPS ); |
---|
1097 | TComRPSList* getRPSList() { return &m_RPSList; } |
---|
1098 | Bool getLongTermRefsPresent() { return m_bLongTermRefsPresent; } |
---|
1099 | Void setLongTermRefsPresent(Bool b) { m_bLongTermRefsPresent=b; } |
---|
1100 | Bool getTMVPFlagsPresent() { return m_TMVPFlagsPresent; } |
---|
1101 | Void setTMVPFlagsPresent(Bool b) { m_TMVPFlagsPresent=b; } |
---|
1102 | // physical transform |
---|
1103 | Void setMaxTrSize ( UInt u ) { m_uiMaxTrSize = u; } |
---|
1104 | UInt getMaxTrSize () { return m_uiMaxTrSize; } |
---|
1105 | |
---|
1106 | // Tool list |
---|
1107 | #if !L0034_COMBINED_LIST_CLEANUP |
---|
1108 | Void setUseLComb (Bool b) { m_bUseLComb = b; } |
---|
1109 | Bool getUseLComb () { return m_bUseLComb; } |
---|
1110 | #endif |
---|
1111 | |
---|
1112 | Bool getUseLossless () { return m_useLossless; } |
---|
1113 | Void setUseLossless ( Bool b ) { m_useLossless = b; } |
---|
1114 | |
---|
1115 | // AMP accuracy |
---|
1116 | Int getAMPAcc ( UInt uiDepth ) { return m_iAMPAcc[uiDepth]; } |
---|
1117 | Void setAMPAcc ( UInt uiDepth, Int iAccu ) { assert( uiDepth < g_uiMaxCUDepth); m_iAMPAcc[uiDepth] = iAccu; } |
---|
1118 | |
---|
1119 | // Bit-depth |
---|
1120 | Int getBitDepthY() { return m_bitDepthY; } |
---|
1121 | Void setBitDepthY(Int u) { m_bitDepthY = u; } |
---|
1122 | Int getBitDepthC() { return m_bitDepthC; } |
---|
1123 | Void setBitDepthC(Int u) { m_bitDepthC = u; } |
---|
1124 | Int getQpBDOffsetY () { return m_qpBDOffsetY; } |
---|
1125 | Void setQpBDOffsetY ( Int value ) { m_qpBDOffsetY = value; } |
---|
1126 | Int getQpBDOffsetC () { return m_qpBDOffsetC; } |
---|
1127 | Void setQpBDOffsetC ( Int value ) { m_qpBDOffsetC = value; } |
---|
1128 | Void setUseSAO (Bool bVal) {m_bUseSAO = bVal;} |
---|
1129 | Bool getUseSAO () {return m_bUseSAO;} |
---|
1130 | |
---|
1131 | UInt getMaxTLayers() { return m_uiMaxTLayers; } |
---|
1132 | Void setMaxTLayers( UInt uiMaxTLayers ) { assert( uiMaxTLayers <= MAX_TLAYER ); m_uiMaxTLayers = uiMaxTLayers; } |
---|
1133 | |
---|
1134 | Bool getTemporalIdNestingFlag() { return m_bTemporalIdNestingFlag; } |
---|
1135 | Void setTemporalIdNestingFlag( Bool bValue ) { m_bTemporalIdNestingFlag = bValue; } |
---|
1136 | UInt getPCMBitDepthLuma () { return m_uiPCMBitDepthLuma; } |
---|
1137 | Void setPCMBitDepthLuma ( UInt u ) { m_uiPCMBitDepthLuma = u; } |
---|
1138 | UInt getPCMBitDepthChroma () { return m_uiPCMBitDepthChroma; } |
---|
1139 | Void setPCMBitDepthChroma ( UInt u ) { m_uiPCMBitDepthChroma = u; } |
---|
1140 | Void setPCMFilterDisableFlag ( Bool bValue ) { m_bPCMFilterDisableFlag = bValue; } |
---|
1141 | Bool getPCMFilterDisableFlag () { return m_bPCMFilterDisableFlag; } |
---|
1142 | |
---|
1143 | Bool getScalingListFlag () { return m_scalingListEnabledFlag; } |
---|
1144 | Void setScalingListFlag ( Bool b ) { m_scalingListEnabledFlag = b; } |
---|
1145 | Bool getScalingListPresentFlag() { return m_scalingListPresentFlag; } |
---|
1146 | Void setScalingListPresentFlag( Bool b ) { m_scalingListPresentFlag = b; } |
---|
1147 | Void setScalingList ( TComScalingList *scalingList); |
---|
1148 | TComScalingList* getScalingList () { return m_scalingList; } //!< get ScalingList class pointer in SPS |
---|
1149 | UInt getMaxDecPicBuffering (UInt tlayer) { return m_uiMaxDecPicBuffering[tlayer]; } |
---|
1150 | Void setMaxDecPicBuffering ( UInt ui, UInt tlayer ) { m_uiMaxDecPicBuffering[tlayer] = ui; } |
---|
1151 | UInt getMaxLatencyIncrease (UInt tlayer) { return m_uiMaxLatencyIncrease[tlayer]; } |
---|
1152 | Void setMaxLatencyIncrease ( UInt ui , UInt tlayer) { m_uiMaxLatencyIncrease[tlayer] = ui; } |
---|
1153 | |
---|
1154 | Void setUseStrongIntraSmoothing (Bool bVal) {m_useStrongIntraSmoothing = bVal;} |
---|
1155 | Bool getUseStrongIntraSmoothing () {return m_useStrongIntraSmoothing;} |
---|
1156 | |
---|
1157 | Bool getVuiParametersPresentFlag() { return m_vuiParametersPresentFlag; } |
---|
1158 | Void setVuiParametersPresentFlag(Bool b) { m_vuiParametersPresentFlag = b; } |
---|
1159 | TComVUI* getVuiParameters() { return &m_vuiParameters; } |
---|
1160 | Void setHrdParameters( UInt frameRate, UInt numDU, UInt bitRate, Bool randomAccess ); |
---|
1161 | |
---|
1162 | TComPTL* getPTL() { return &m_pcPTL; } |
---|
1163 | |
---|
1164 | #if SVC_EXTENSION |
---|
1165 | Void setLayerId(UInt layerId) { m_layerId = layerId; } |
---|
1166 | UInt getLayerId() { return m_layerId; } |
---|
1167 | #endif |
---|
1168 | #if REF_IDX_MFM |
---|
1169 | Void setMFMEnabledFlag(Bool flag) {m_bMFMEnabledFlag = flag;} |
---|
1170 | Bool getMFMEnabledFlag() {return m_bMFMEnabledFlag;} |
---|
1171 | #endif |
---|
1172 | #if SCALED_REF_LAYER_OFFSETS |
---|
1173 | Window& getScaledRefLayerWindow( ) { return m_scaledRefLayerWindow; } |
---|
1174 | #endif |
---|
1175 | }; |
---|
1176 | |
---|
1177 | /// Reference Picture Lists class |
---|
1178 | class TComRefPicListModification |
---|
1179 | { |
---|
1180 | private: |
---|
1181 | UInt m_bRefPicListModificationFlagL0; |
---|
1182 | UInt m_bRefPicListModificationFlagL1; |
---|
1183 | UInt m_RefPicSetIdxL0[32]; |
---|
1184 | UInt m_RefPicSetIdxL1[32]; |
---|
1185 | |
---|
1186 | public: |
---|
1187 | TComRefPicListModification(); |
---|
1188 | virtual ~TComRefPicListModification(); |
---|
1189 | |
---|
1190 | Void create (); |
---|
1191 | Void destroy (); |
---|
1192 | |
---|
1193 | Bool getRefPicListModificationFlagL0() { return m_bRefPicListModificationFlagL0; } |
---|
1194 | Void setRefPicListModificationFlagL0(Bool flag) { m_bRefPicListModificationFlagL0 = flag; } |
---|
1195 | Bool getRefPicListModificationFlagL1() { return m_bRefPicListModificationFlagL1; } |
---|
1196 | Void setRefPicListModificationFlagL1(Bool flag) { m_bRefPicListModificationFlagL1 = flag; } |
---|
1197 | Void setRefPicSetIdxL0(UInt idx, UInt refPicSetIdx) { m_RefPicSetIdxL0[idx] = refPicSetIdx; } |
---|
1198 | UInt getRefPicSetIdxL0(UInt idx) { return m_RefPicSetIdxL0[idx]; } |
---|
1199 | Void setRefPicSetIdxL1(UInt idx, UInt refPicSetIdx) { m_RefPicSetIdxL1[idx] = refPicSetIdx; } |
---|
1200 | UInt getRefPicSetIdxL1(UInt idx) { return m_RefPicSetIdxL1[idx]; } |
---|
1201 | }; |
---|
1202 | |
---|
1203 | /// PPS class |
---|
1204 | class TComPPS |
---|
1205 | { |
---|
1206 | private: |
---|
1207 | Int m_PPSId; // pic_parameter_set_id |
---|
1208 | Int m_SPSId; // seq_parameter_set_id |
---|
1209 | Int m_picInitQPMinus26; |
---|
1210 | Bool m_useDQP; |
---|
1211 | Bool m_bConstrainedIntraPred; // constrained_intra_pred_flag |
---|
1212 | Bool m_bSliceChromaQpFlag; // slicelevel_chroma_qp_flag |
---|
1213 | |
---|
1214 | // access channel |
---|
1215 | TComSPS* m_pcSPS; |
---|
1216 | UInt m_uiMaxCuDQPDepth; |
---|
1217 | UInt m_uiMinCuDQPSize; |
---|
1218 | |
---|
1219 | Int m_chromaCbQpOffset; |
---|
1220 | Int m_chromaCrQpOffset; |
---|
1221 | |
---|
1222 | UInt m_numRefIdxL0DefaultActive; |
---|
1223 | UInt m_numRefIdxL1DefaultActive; |
---|
1224 | |
---|
1225 | Bool m_bUseWeightPred; // Use of Weighting Prediction (P_SLICE) |
---|
1226 | Bool m_useWeightedBiPred; // Use of Weighting Bi-Prediction (B_SLICE) |
---|
1227 | Bool m_OutputFlagPresentFlag; // Indicates the presence of output_flag in slice header |
---|
1228 | |
---|
1229 | Bool m_TransquantBypassEnableFlag; // Indicates presence of cu_transquant_bypass_flag in CUs. |
---|
1230 | Bool m_useTransformSkip; |
---|
1231 | Bool m_dependentSliceSegmentsEnabledFlag; //!< Indicates the presence of dependent slices |
---|
1232 | Bool m_tilesEnabledFlag; //!< Indicates the presence of tiles |
---|
1233 | Bool m_entropyCodingSyncEnabledFlag; //!< Indicates the presence of wavefronts |
---|
1234 | |
---|
1235 | Bool m_loopFilterAcrossTilesEnabledFlag; |
---|
1236 | Int m_uniformSpacingFlag; |
---|
1237 | Int m_iNumColumnsMinus1; |
---|
1238 | UInt* m_puiColumnWidth; |
---|
1239 | Int m_iNumRowsMinus1; |
---|
1240 | UInt* m_puiRowHeight; |
---|
1241 | |
---|
1242 | Int m_iNumSubstreams; |
---|
1243 | |
---|
1244 | Int m_signHideFlag; |
---|
1245 | |
---|
1246 | Bool m_cabacInitPresentFlag; |
---|
1247 | UInt m_encCABACTableIdx; // Used to transmit table selection across slices |
---|
1248 | |
---|
1249 | Bool m_sliceHeaderExtensionPresentFlag; |
---|
1250 | Bool m_loopFilterAcrossSlicesEnabledFlag; |
---|
1251 | Bool m_deblockingFilterControlPresentFlag; |
---|
1252 | Bool m_deblockingFilterOverrideEnabledFlag; |
---|
1253 | Bool m_picDisableDeblockingFilterFlag; |
---|
1254 | Int m_deblockingFilterBetaOffsetDiv2; //< beta offset for deblocking filter |
---|
1255 | Int m_deblockingFilterTcOffsetDiv2; //< tc offset for deblocking filter |
---|
1256 | Bool m_scalingListPresentFlag; |
---|
1257 | TComScalingList* m_scalingList; //!< ScalingList class pointer |
---|
1258 | Bool m_listsModificationPresentFlag; |
---|
1259 | UInt m_log2ParallelMergeLevelMinus2; |
---|
1260 | Int m_numExtraSliceHeaderBits; |
---|
1261 | |
---|
1262 | public: |
---|
1263 | TComPPS(); |
---|
1264 | virtual ~TComPPS(); |
---|
1265 | |
---|
1266 | Int getPPSId () { return m_PPSId; } |
---|
1267 | Void setPPSId (Int i) { m_PPSId = i; } |
---|
1268 | Int getSPSId () { return m_SPSId; } |
---|
1269 | Void setSPSId (Int i) { m_SPSId = i; } |
---|
1270 | |
---|
1271 | Int getPicInitQPMinus26 () { return m_picInitQPMinus26; } |
---|
1272 | Void setPicInitQPMinus26 ( Int i ) { m_picInitQPMinus26 = i; } |
---|
1273 | Bool getUseDQP () { return m_useDQP; } |
---|
1274 | Void setUseDQP ( Bool b ) { m_useDQP = b; } |
---|
1275 | Bool getConstrainedIntraPred () { return m_bConstrainedIntraPred; } |
---|
1276 | Void setConstrainedIntraPred ( Bool b ) { m_bConstrainedIntraPred = b; } |
---|
1277 | Bool getSliceChromaQpFlag () { return m_bSliceChromaQpFlag; } |
---|
1278 | Void setSliceChromaQpFlag ( Bool b ) { m_bSliceChromaQpFlag = b; } |
---|
1279 | |
---|
1280 | Void setSPS ( TComSPS* pcSPS ) { m_pcSPS = pcSPS; } |
---|
1281 | TComSPS* getSPS () { return m_pcSPS; } |
---|
1282 | Void setMaxCuDQPDepth ( UInt u ) { m_uiMaxCuDQPDepth = u; } |
---|
1283 | UInt getMaxCuDQPDepth () { return m_uiMaxCuDQPDepth;} |
---|
1284 | Void setMinCuDQPSize ( UInt u ) { m_uiMinCuDQPSize = u; } |
---|
1285 | UInt getMinCuDQPSize () { return m_uiMinCuDQPSize; } |
---|
1286 | |
---|
1287 | Void setChromaCbQpOffset( Int i ) { m_chromaCbQpOffset = i; } |
---|
1288 | Int getChromaCbQpOffset() { return m_chromaCbQpOffset; } |
---|
1289 | Void setChromaCrQpOffset( Int i ) { m_chromaCrQpOffset = i; } |
---|
1290 | Int getChromaCrQpOffset() { return m_chromaCrQpOffset; } |
---|
1291 | |
---|
1292 | Void setNumRefIdxL0DefaultActive(UInt ui) { m_numRefIdxL0DefaultActive=ui; } |
---|
1293 | UInt getNumRefIdxL0DefaultActive() { return m_numRefIdxL0DefaultActive; } |
---|
1294 | Void setNumRefIdxL1DefaultActive(UInt ui) { m_numRefIdxL1DefaultActive=ui; } |
---|
1295 | UInt getNumRefIdxL1DefaultActive() { return m_numRefIdxL1DefaultActive; } |
---|
1296 | |
---|
1297 | Bool getUseWP () { return m_bUseWeightPred; } |
---|
1298 | Bool getWPBiPred () { return m_useWeightedBiPred; } |
---|
1299 | Void setUseWP ( Bool b ) { m_bUseWeightPred = b; } |
---|
1300 | Void setWPBiPred ( Bool b ) { m_useWeightedBiPred = b; } |
---|
1301 | Void setOutputFlagPresentFlag( Bool b ) { m_OutputFlagPresentFlag = b; } |
---|
1302 | Bool getOutputFlagPresentFlag() { return m_OutputFlagPresentFlag; } |
---|
1303 | Void setTransquantBypassEnableFlag( Bool b ) { m_TransquantBypassEnableFlag = b; } |
---|
1304 | Bool getTransquantBypassEnableFlag() { return m_TransquantBypassEnableFlag; } |
---|
1305 | |
---|
1306 | Bool getUseTransformSkip () { return m_useTransformSkip; } |
---|
1307 | Void setUseTransformSkip ( Bool b ) { m_useTransformSkip = b; } |
---|
1308 | |
---|
1309 | Void setLoopFilterAcrossTilesEnabledFlag (Bool b) { m_loopFilterAcrossTilesEnabledFlag = b; } |
---|
1310 | Bool getLoopFilterAcrossTilesEnabledFlag () { return m_loopFilterAcrossTilesEnabledFlag; } |
---|
1311 | Bool getDependentSliceSegmentsEnabledFlag() const { return m_dependentSliceSegmentsEnabledFlag; } |
---|
1312 | Void setDependentSliceSegmentsEnabledFlag(Bool val) { m_dependentSliceSegmentsEnabledFlag = val; } |
---|
1313 | Bool getTilesEnabledFlag() const { return m_tilesEnabledFlag; } |
---|
1314 | Void setTilesEnabledFlag(Bool val) { m_tilesEnabledFlag = val; } |
---|
1315 | Bool getEntropyCodingSyncEnabledFlag() const { return m_entropyCodingSyncEnabledFlag; } |
---|
1316 | Void setEntropyCodingSyncEnabledFlag(Bool val) { m_entropyCodingSyncEnabledFlag = val; } |
---|
1317 | Void setUniformSpacingFlag ( Bool b ) { m_uniformSpacingFlag = b; } |
---|
1318 | Bool getUniformSpacingFlag () { return m_uniformSpacingFlag; } |
---|
1319 | Void setNumColumnsMinus1 ( Int i ) { m_iNumColumnsMinus1 = i; } |
---|
1320 | Int getNumColumnsMinus1 () { return m_iNumColumnsMinus1; } |
---|
1321 | Void setColumnWidth ( UInt* columnWidth ) |
---|
1322 | { |
---|
1323 | if( m_uniformSpacingFlag == 0 && m_iNumColumnsMinus1 > 0 ) |
---|
1324 | { |
---|
1325 | m_puiColumnWidth = new UInt[ m_iNumColumnsMinus1 ]; |
---|
1326 | |
---|
1327 | for(Int i=0; i<m_iNumColumnsMinus1; i++) |
---|
1328 | { |
---|
1329 | m_puiColumnWidth[i] = columnWidth[i]; |
---|
1330 | } |
---|
1331 | } |
---|
1332 | } |
---|
1333 | UInt getColumnWidth (UInt columnIdx) { return *( m_puiColumnWidth + columnIdx ); } |
---|
1334 | Void setNumRowsMinus1( Int i ) { m_iNumRowsMinus1 = i; } |
---|
1335 | Int getNumRowsMinus1() { return m_iNumRowsMinus1; } |
---|
1336 | Void setRowHeight ( UInt* rowHeight ) |
---|
1337 | { |
---|
1338 | if( m_uniformSpacingFlag == 0 && m_iNumRowsMinus1 > 0 ) |
---|
1339 | { |
---|
1340 | m_puiRowHeight = new UInt[ m_iNumRowsMinus1 ]; |
---|
1341 | |
---|
1342 | for(Int i=0; i<m_iNumRowsMinus1; i++) |
---|
1343 | { |
---|
1344 | m_puiRowHeight[i] = rowHeight[i]; |
---|
1345 | } |
---|
1346 | } |
---|
1347 | } |
---|
1348 | UInt getRowHeight (UInt rowIdx) { return *( m_puiRowHeight + rowIdx ); } |
---|
1349 | Void setNumSubstreams(Int iNumSubstreams) { m_iNumSubstreams = iNumSubstreams; } |
---|
1350 | Int getNumSubstreams() { return m_iNumSubstreams; } |
---|
1351 | |
---|
1352 | Void setSignHideFlag( Int signHideFlag ) { m_signHideFlag = signHideFlag; } |
---|
1353 | Int getSignHideFlag() { return m_signHideFlag; } |
---|
1354 | |
---|
1355 | Void setCabacInitPresentFlag( Bool flag ) { m_cabacInitPresentFlag = flag; } |
---|
1356 | Void setEncCABACTableIdx( Int idx ) { m_encCABACTableIdx = idx; } |
---|
1357 | Bool getCabacInitPresentFlag() { return m_cabacInitPresentFlag; } |
---|
1358 | UInt getEncCABACTableIdx() { return m_encCABACTableIdx; } |
---|
1359 | Void setDeblockingFilterControlPresentFlag( Bool val ) { m_deblockingFilterControlPresentFlag = val; } |
---|
1360 | Bool getDeblockingFilterControlPresentFlag() { return m_deblockingFilterControlPresentFlag; } |
---|
1361 | Void setDeblockingFilterOverrideEnabledFlag( Bool val ) { m_deblockingFilterOverrideEnabledFlag = val; } |
---|
1362 | Bool getDeblockingFilterOverrideEnabledFlag() { return m_deblockingFilterOverrideEnabledFlag; } |
---|
1363 | Void setPicDisableDeblockingFilterFlag(Bool val) { m_picDisableDeblockingFilterFlag = val; } //!< set offset for deblocking filter disabled |
---|
1364 | Bool getPicDisableDeblockingFilterFlag() { return m_picDisableDeblockingFilterFlag; } //!< get offset for deblocking filter disabled |
---|
1365 | Void setDeblockingFilterBetaOffsetDiv2(Int val) { m_deblockingFilterBetaOffsetDiv2 = val; } //!< set beta offset for deblocking filter |
---|
1366 | Int getDeblockingFilterBetaOffsetDiv2() { return m_deblockingFilterBetaOffsetDiv2; } //!< get beta offset for deblocking filter |
---|
1367 | Void setDeblockingFilterTcOffsetDiv2(Int val) { m_deblockingFilterTcOffsetDiv2 = val; } //!< set tc offset for deblocking filter |
---|
1368 | Int getDeblockingFilterTcOffsetDiv2() { return m_deblockingFilterTcOffsetDiv2; } //!< get tc offset for deblocking filter |
---|
1369 | Bool getScalingListPresentFlag() { return m_scalingListPresentFlag; } |
---|
1370 | Void setScalingListPresentFlag( Bool b ) { m_scalingListPresentFlag = b; } |
---|
1371 | Void setScalingList ( TComScalingList *scalingList); |
---|
1372 | TComScalingList* getScalingList () { return m_scalingList; } //!< get ScalingList class pointer in PPS |
---|
1373 | Bool getListsModificationPresentFlag () { return m_listsModificationPresentFlag; } |
---|
1374 | Void setListsModificationPresentFlag ( Bool b ) { m_listsModificationPresentFlag = b; } |
---|
1375 | UInt getLog2ParallelMergeLevelMinus2 () { return m_log2ParallelMergeLevelMinus2; } |
---|
1376 | Void setLog2ParallelMergeLevelMinus2 (UInt mrgLevel) { m_log2ParallelMergeLevelMinus2 = mrgLevel; } |
---|
1377 | Int getNumExtraSliceHeaderBits() { return m_numExtraSliceHeaderBits; } |
---|
1378 | Void setNumExtraSliceHeaderBits(Int i) { m_numExtraSliceHeaderBits = i; } |
---|
1379 | Void setLoopFilterAcrossSlicesEnabledFlag ( Bool bValue ) { m_loopFilterAcrossSlicesEnabledFlag = bValue; } |
---|
1380 | Bool getLoopFilterAcrossSlicesEnabledFlag () { return m_loopFilterAcrossSlicesEnabledFlag; } |
---|
1381 | Bool getSliceHeaderExtensionPresentFlag () { return m_sliceHeaderExtensionPresentFlag; } |
---|
1382 | Void setSliceHeaderExtensionPresentFlag (Bool val) { m_sliceHeaderExtensionPresentFlag = val; } |
---|
1383 | }; |
---|
1384 | |
---|
1385 | typedef struct |
---|
1386 | { |
---|
1387 | // Explicit weighted prediction parameters parsed in slice header, |
---|
1388 | // or Implicit weighted prediction parameters (8 bits depth values). |
---|
1389 | Bool bPresentFlag; |
---|
1390 | UInt uiLog2WeightDenom; |
---|
1391 | Int iWeight; |
---|
1392 | Int iOffset; |
---|
1393 | |
---|
1394 | // Weighted prediction scaling values built from above parameters (bitdepth scaled): |
---|
1395 | Int w, o, offset, shift, round; |
---|
1396 | } wpScalingParam; |
---|
1397 | |
---|
1398 | typedef struct |
---|
1399 | { |
---|
1400 | Int64 iAC; |
---|
1401 | Int64 iDC; |
---|
1402 | } wpACDCParam; |
---|
1403 | |
---|
1404 | /// slice header class |
---|
1405 | class TComSlice |
---|
1406 | { |
---|
1407 | |
---|
1408 | private: |
---|
1409 | // Bitstream writing |
---|
1410 | Bool m_saoEnabledFlag; |
---|
1411 | Bool m_saoEnabledFlagChroma; ///< SAO Cb&Cr enabled flag |
---|
1412 | Int m_iPPSId; ///< picture parameter set ID |
---|
1413 | Bool m_PicOutputFlag; ///< pic_output_flag |
---|
1414 | Int m_iPOC; |
---|
1415 | Int m_iLastIDR; |
---|
1416 | static Int m_prevPOC; |
---|
1417 | TComReferencePictureSet *m_pcRPS; |
---|
1418 | TComReferencePictureSet m_LocalRPS; |
---|
1419 | Int m_iBDidx; |
---|
1420 | TComRefPicListModification m_RefPicListModification; |
---|
1421 | NalUnitType m_eNalUnitType; ///< Nal unit type for the slice |
---|
1422 | SliceType m_eSliceType; |
---|
1423 | Int m_iSliceQp; |
---|
1424 | Bool m_dependentSliceSegmentFlag; |
---|
1425 | #if ADAPTIVE_QP_SELECTION |
---|
1426 | Int m_iSliceQpBase; |
---|
1427 | #endif |
---|
1428 | Bool m_deblockingFilterDisable; |
---|
1429 | Bool m_deblockingFilterOverrideFlag; //< offsets for deblocking filter inherit from PPS |
---|
1430 | Int m_deblockingFilterBetaOffsetDiv2; //< beta offset for deblocking filter |
---|
1431 | Int m_deblockingFilterTcOffsetDiv2; //< tc offset for deblocking filter |
---|
1432 | #if JCTVC_M0458_INTERLAYER_RPS_SIG |
---|
1433 | Int m_activeNumILRRefIdx; //< Active inter-layer reference pictures |
---|
1434 | Int m_interLayerPredLayerIdc [MAX_VPS_LAYER_ID_PLUS1]; |
---|
1435 | #else |
---|
1436 | #if REF_IDX_FRAMEWORK |
---|
1437 | Int m_numILRRefIdx; //< for inter-layer reference picture ser |
---|
1438 | #endif |
---|
1439 | #endif |
---|
1440 | #if L0034_COMBINED_LIST_CLEANUP |
---|
1441 | Int m_list1IdxToList0Idx[MAX_NUM_REF]; |
---|
1442 | Int m_aiNumRefIdx [2]; // for multiple reference of current slice |
---|
1443 | #else |
---|
1444 | Int m_aiNumRefIdx [3]; // for multiple reference of current slice |
---|
1445 | Int m_iRefIdxOfLC[2][MAX_NUM_REF_LC]; |
---|
1446 | Int m_eListIdFromIdxOfLC[MAX_NUM_REF_LC]; |
---|
1447 | Int m_iRefIdxFromIdxOfLC[MAX_NUM_REF_LC]; |
---|
1448 | Int m_iRefIdxOfL1FromRefIdxOfL0[MAX_NUM_REF_LC]; |
---|
1449 | Int m_iRefIdxOfL0FromRefIdxOfL1[MAX_NUM_REF_LC]; |
---|
1450 | Bool m_bRefPicListModificationFlagLC; |
---|
1451 | Bool m_bRefPicListCombinationFlag; |
---|
1452 | #endif |
---|
1453 | |
---|
1454 | Bool m_bCheckLDC; |
---|
1455 | |
---|
1456 | // Data |
---|
1457 | Int m_iSliceQpDelta; |
---|
1458 | Int m_iSliceQpDeltaCb; |
---|
1459 | Int m_iSliceQpDeltaCr; |
---|
1460 | TComPic* m_apcRefPicList [2][MAX_NUM_REF+1]; |
---|
1461 | Int m_aiRefPOCList [2][MAX_NUM_REF+1]; |
---|
1462 | Bool m_bIsUsedAsLongTerm[2][MAX_NUM_REF+1]; |
---|
1463 | Int m_iDepth; |
---|
1464 | |
---|
1465 | // referenced slice? |
---|
1466 | Bool m_bRefenced; |
---|
1467 | |
---|
1468 | // access channel |
---|
1469 | TComVPS* m_pcVPS; |
---|
1470 | TComSPS* m_pcSPS; |
---|
1471 | TComPPS* m_pcPPS; |
---|
1472 | TComPic* m_pcPic; |
---|
1473 | #if ADAPTIVE_QP_SELECTION |
---|
1474 | TComTrQuant* m_pcTrQuant; |
---|
1475 | #endif |
---|
1476 | UInt m_colFromL0Flag; // collocated picture from List0 flag |
---|
1477 | |
---|
1478 | UInt m_colRefIdx; |
---|
1479 | UInt m_maxNumMergeCand; |
---|
1480 | |
---|
1481 | |
---|
1482 | #if SAO_CHROMA_LAMBDA |
---|
1483 | Double m_dLambdaLuma; |
---|
1484 | Double m_dLambdaChroma; |
---|
1485 | #else |
---|
1486 | Double m_dLambda; |
---|
1487 | #endif |
---|
1488 | |
---|
1489 | Bool m_abEqualRef [2][MAX_NUM_REF][MAX_NUM_REF]; |
---|
1490 | #if !L0034_COMBINED_LIST_CLEANUP |
---|
1491 | Bool m_bNoBackPredFlag; |
---|
1492 | #endif |
---|
1493 | UInt m_uiTLayer; |
---|
1494 | #if SVC_EXTENSION |
---|
1495 | UInt m_layerId; |
---|
1496 | TComPic* m_pcBaseColPic[MAX_LAYERS]; |
---|
1497 | TComPicYuv* m_pcFullPelBaseRec[MAX_LAYERS]; |
---|
1498 | #endif |
---|
1499 | Bool m_bTLayerSwitchingFlag; |
---|
1500 | |
---|
1501 | UInt m_sliceMode; |
---|
1502 | UInt m_sliceArgument; |
---|
1503 | UInt m_sliceCurStartCUAddr; |
---|
1504 | UInt m_sliceCurEndCUAddr; |
---|
1505 | UInt m_sliceIdx; |
---|
1506 | UInt m_sliceSegmentMode; |
---|
1507 | UInt m_sliceSegmentArgument; |
---|
1508 | UInt m_sliceSegmentCurStartCUAddr; |
---|
1509 | UInt m_sliceSegmentCurEndCUAddr; |
---|
1510 | Bool m_nextSlice; |
---|
1511 | Bool m_nextSliceSegment; |
---|
1512 | UInt m_sliceBits; |
---|
1513 | UInt m_sliceSegmentBits; |
---|
1514 | Bool m_bFinalized; |
---|
1515 | |
---|
1516 | wpScalingParam m_weightPredTable[2][MAX_NUM_REF][3]; // [REF_PIC_LIST_0 or REF_PIC_LIST_1][refIdx][0:Y, 1:U, 2:V] |
---|
1517 | wpACDCParam m_weightACDCParam[3]; // [0:Y, 1:U, 2:V] |
---|
1518 | |
---|
1519 | std::vector<UInt> m_tileByteLocation; |
---|
1520 | UInt m_uiTileOffstForMultES; |
---|
1521 | |
---|
1522 | UInt* m_puiSubstreamSizes; |
---|
1523 | TComScalingList* m_scalingList; //!< pointer of quantization matrix |
---|
1524 | Bool m_cabacInitFlag; |
---|
1525 | |
---|
1526 | Bool m_bLMvdL1Zero; |
---|
1527 | Int m_numEntryPointOffsets; |
---|
1528 | Bool m_temporalLayerNonReferenceFlag; |
---|
1529 | Bool m_LFCrossSliceBoundaryFlag; |
---|
1530 | |
---|
1531 | Bool m_enableTMVPFlag; |
---|
1532 | #if JCTVC_M0458_INTERLAYER_RPS_SIG |
---|
1533 | Bool m_interLayerPredEnabledFlag; |
---|
1534 | #endif |
---|
1535 | public: |
---|
1536 | TComSlice(); |
---|
1537 | virtual ~TComSlice(); |
---|
1538 | #if SVC_EXTENSION |
---|
1539 | Void initSlice ( UInt layerId ); |
---|
1540 | #else |
---|
1541 | Void initSlice (); |
---|
1542 | #endif |
---|
1543 | |
---|
1544 | Void setVPS ( TComVPS* pcVPS ) { m_pcVPS = pcVPS; } |
---|
1545 | TComVPS* getVPS () { return m_pcVPS; } |
---|
1546 | Void setSPS ( TComSPS* pcSPS ) { m_pcSPS = pcSPS; } |
---|
1547 | TComSPS* getSPS () { return m_pcSPS; } |
---|
1548 | |
---|
1549 | Void setPPS ( TComPPS* pcPPS ) { assert(pcPPS!=NULL); m_pcPPS = pcPPS; m_iPPSId = pcPPS->getPPSId(); } |
---|
1550 | TComPPS* getPPS () { return m_pcPPS; } |
---|
1551 | |
---|
1552 | #if ADAPTIVE_QP_SELECTION |
---|
1553 | Void setTrQuant ( TComTrQuant* pcTrQuant ) { m_pcTrQuant = pcTrQuant; } |
---|
1554 | TComTrQuant* getTrQuant () { return m_pcTrQuant; } |
---|
1555 | #endif |
---|
1556 | |
---|
1557 | Void setPPSId ( Int PPSId ) { m_iPPSId = PPSId; } |
---|
1558 | Int getPPSId () { return m_iPPSId; } |
---|
1559 | Void setPicOutputFlag( Bool b ) { m_PicOutputFlag = b; } |
---|
1560 | Bool getPicOutputFlag() { return m_PicOutputFlag; } |
---|
1561 | Void setSaoEnabledFlag(Bool s) {m_saoEnabledFlag =s; } |
---|
1562 | Bool getSaoEnabledFlag() { return m_saoEnabledFlag; } |
---|
1563 | Void setSaoEnabledFlagChroma(Bool s) {m_saoEnabledFlagChroma =s; } //!< set SAO Cb&Cr enabled flag |
---|
1564 | Bool getSaoEnabledFlagChroma() { return m_saoEnabledFlagChroma; } //!< get SAO Cb&Cr enabled flag |
---|
1565 | Void setRPS ( TComReferencePictureSet *pcRPS ) { m_pcRPS = pcRPS; } |
---|
1566 | TComReferencePictureSet* getRPS () { return m_pcRPS; } |
---|
1567 | TComReferencePictureSet* getLocalRPS () { return &m_LocalRPS; } |
---|
1568 | |
---|
1569 | Void setRPSidx ( Int iBDidx ) { m_iBDidx = iBDidx; } |
---|
1570 | Int getRPSidx () { return m_iBDidx; } |
---|
1571 | Int getPrevPOC () { return m_prevPOC; } |
---|
1572 | TComRefPicListModification* getRefPicListModification() { return &m_RefPicListModification; } |
---|
1573 | Void setLastIDR(Int iIDRPOC) { m_iLastIDR = iIDRPOC; } |
---|
1574 | Int getLastIDR() { return m_iLastIDR; } |
---|
1575 | SliceType getSliceType () { return m_eSliceType; } |
---|
1576 | Int getPOC () { return m_iPOC; } |
---|
1577 | Int getSliceQp () { return m_iSliceQp; } |
---|
1578 | Bool getDependentSliceSegmentFlag() const { return m_dependentSliceSegmentFlag; } |
---|
1579 | void setDependentSliceSegmentFlag(Bool val) { m_dependentSliceSegmentFlag = val; } |
---|
1580 | #if ADAPTIVE_QP_SELECTION |
---|
1581 | Int getSliceQpBase () { return m_iSliceQpBase; } |
---|
1582 | #endif |
---|
1583 | Int getSliceQpDelta () { return m_iSliceQpDelta; } |
---|
1584 | Int getSliceQpDeltaCb () { return m_iSliceQpDeltaCb; } |
---|
1585 | Int getSliceQpDeltaCr () { return m_iSliceQpDeltaCr; } |
---|
1586 | Bool getDeblockingFilterDisable() { return m_deblockingFilterDisable; } |
---|
1587 | Bool getDeblockingFilterOverrideFlag() { return m_deblockingFilterOverrideFlag; } |
---|
1588 | Int getDeblockingFilterBetaOffsetDiv2() { return m_deblockingFilterBetaOffsetDiv2; } |
---|
1589 | Int getDeblockingFilterTcOffsetDiv2() { return m_deblockingFilterTcOffsetDiv2; } |
---|
1590 | |
---|
1591 | Int getNumRefIdx ( RefPicList e ) { return m_aiNumRefIdx[e]; } |
---|
1592 | TComPic* getPic () { return m_pcPic; } |
---|
1593 | TComPic* getRefPic ( RefPicList e, Int iRefIdx) { return m_apcRefPicList[e][iRefIdx]; } |
---|
1594 | Int getRefPOC ( RefPicList e, Int iRefIdx) { return m_aiRefPOCList[e][iRefIdx]; } |
---|
1595 | Int getDepth () { return m_iDepth; } |
---|
1596 | UInt getColFromL0Flag () { return m_colFromL0Flag; } |
---|
1597 | UInt getColRefIdx () { return m_colRefIdx; } |
---|
1598 | Void checkColRefIdx (UInt curSliceIdx, TComPic* pic); |
---|
1599 | Bool getIsUsedAsLongTerm (Int i, Int j) { return m_bIsUsedAsLongTerm[i][j]; } |
---|
1600 | Bool getCheckLDC () { return m_bCheckLDC; } |
---|
1601 | Bool getMvdL1ZeroFlag () { return m_bLMvdL1Zero; } |
---|
1602 | Int getNumRpsCurrTempList(); |
---|
1603 | #if L0034_COMBINED_LIST_CLEANUP |
---|
1604 | Int getList1IdxToList0Idx ( Int list1Idx ) { return m_list1IdxToList0Idx[list1Idx]; } |
---|
1605 | #else |
---|
1606 | Int getRefIdxOfLC (RefPicList e, Int iRefIdx) { return m_iRefIdxOfLC[e][iRefIdx]; } |
---|
1607 | Int getListIdFromIdxOfLC(Int iRefIdx) { return m_eListIdFromIdxOfLC[iRefIdx]; } |
---|
1608 | Int getRefIdxFromIdxOfLC(Int iRefIdx) { return m_iRefIdxFromIdxOfLC[iRefIdx]; } |
---|
1609 | Int getRefIdxOfL0FromRefIdxOfL1(Int iRefIdx) { return m_iRefIdxOfL0FromRefIdxOfL1[iRefIdx];} |
---|
1610 | Int getRefIdxOfL1FromRefIdxOfL0(Int iRefIdx) { return m_iRefIdxOfL1FromRefIdxOfL0[iRefIdx];} |
---|
1611 | Bool getRefPicListModificationFlagLC() {return m_bRefPicListModificationFlagLC;} |
---|
1612 | Void setRefPicListModificationFlagLC(Bool bflag) {m_bRefPicListModificationFlagLC=bflag;} |
---|
1613 | Bool getRefPicListCombinationFlag() {return m_bRefPicListCombinationFlag;} |
---|
1614 | Void setRefPicListCombinationFlag(Bool bflag) {m_bRefPicListCombinationFlag=bflag;} |
---|
1615 | #endif |
---|
1616 | Void setReferenced(Bool b) { m_bRefenced = b; } |
---|
1617 | Bool isReferenced() { return m_bRefenced; } |
---|
1618 | Void setPOC ( Int i ) { m_iPOC = i; if(getTLayer()==0) m_prevPOC=i; } |
---|
1619 | Void setNalUnitType ( NalUnitType e ) { m_eNalUnitType = e; } |
---|
1620 | NalUnitType getNalUnitType () const { return m_eNalUnitType; } |
---|
1621 | Bool getRapPicFlag (); |
---|
1622 | Bool getIdrPicFlag () { return getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP; } |
---|
1623 | Bool isIRAP () const { return (getNalUnitType() >= 16) && (getNalUnitType() <= 23); } |
---|
1624 | #if RESTR_CHK |
---|
1625 | Bool isRADL() { return (m_eNalUnitType == NAL_UNIT_CODED_SLICE_RADL_N || m_eNalUnitType == NAL_UNIT_CODED_SLICE_RADL_R); } |
---|
1626 | Bool isRASL() { return (m_eNalUnitType == NAL_UNIT_CODED_SLICE_RASL_N || m_eNalUnitType == NAL_UNIT_CODED_SLICE_RASL_R); } |
---|
1627 | #endif |
---|
1628 | |
---|
1629 | Void checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, Bool& prevRAPisBLA, TComList<TComPic *>& rcListPic); |
---|
1630 | Void decodingRefreshMarking(Int& pocCRA, Bool& bRefreshPending, TComList<TComPic*>& rcListPic); |
---|
1631 | Void setSliceType ( SliceType e ) { m_eSliceType = e; } |
---|
1632 | Void setSliceQp ( Int i ) { m_iSliceQp = i; } |
---|
1633 | #if ADAPTIVE_QP_SELECTION |
---|
1634 | Void setSliceQpBase ( Int i ) { m_iSliceQpBase = i; } |
---|
1635 | #endif |
---|
1636 | Void setSliceQpDelta ( Int i ) { m_iSliceQpDelta = i; } |
---|
1637 | Void setSliceQpDeltaCb ( Int i ) { m_iSliceQpDeltaCb = i; } |
---|
1638 | Void setSliceQpDeltaCr ( Int i ) { m_iSliceQpDeltaCr = i; } |
---|
1639 | Void setDeblockingFilterDisable( Bool b ) { m_deblockingFilterDisable= b; } |
---|
1640 | Void setDeblockingFilterOverrideFlag( Bool b ) { m_deblockingFilterOverrideFlag = b; } |
---|
1641 | Void setDeblockingFilterBetaOffsetDiv2( Int i ) { m_deblockingFilterBetaOffsetDiv2 = i; } |
---|
1642 | Void setDeblockingFilterTcOffsetDiv2( Int i ) { m_deblockingFilterTcOffsetDiv2 = i; } |
---|
1643 | |
---|
1644 | Void setRefPic ( TComPic* p, RefPicList e, Int iRefIdx ) { m_apcRefPicList[e][iRefIdx] = p; } |
---|
1645 | Void setRefPOC ( Int i, RefPicList e, Int iRefIdx ) { m_aiRefPOCList[e][iRefIdx] = i; } |
---|
1646 | Void setNumRefIdx ( RefPicList e, Int i ) { m_aiNumRefIdx[e] = i; } |
---|
1647 | Void setPic ( TComPic* p ) { m_pcPic = p; } |
---|
1648 | Void setDepth ( Int iDepth ) { m_iDepth = iDepth; } |
---|
1649 | |
---|
1650 | #if FIX1071 |
---|
1651 | Void setRefPicList ( TComList<TComPic*>& rcListPic, Bool checkNumPocTotalCurr = false, TComPic** ilpPic = NULL ); |
---|
1652 | #else |
---|
1653 | Void setRefPicList ( TComList<TComPic*>& rcListPic ); |
---|
1654 | #endif |
---|
1655 | Void setRefPOCList (); |
---|
1656 | Void setColFromL0Flag ( UInt colFromL0 ) { m_colFromL0Flag = colFromL0; } |
---|
1657 | Void setColRefIdx ( UInt refIdx) { m_colRefIdx = refIdx; } |
---|
1658 | Void setCheckLDC ( Bool b ) { m_bCheckLDC = b; } |
---|
1659 | Void setMvdL1ZeroFlag ( Bool b) { m_bLMvdL1Zero = b; } |
---|
1660 | |
---|
1661 | Bool isIntra () { return m_eSliceType == I_SLICE; } |
---|
1662 | Bool isInterB () { return m_eSliceType == B_SLICE; } |
---|
1663 | Bool isInterP () { return m_eSliceType == P_SLICE; } |
---|
1664 | |
---|
1665 | #if SAO_CHROMA_LAMBDA |
---|
1666 | Void setLambda( Double d, Double e ) { m_dLambdaLuma = d; m_dLambdaChroma = e;} |
---|
1667 | Double getLambdaLuma() { return m_dLambdaLuma; } |
---|
1668 | Double getLambdaChroma() { return m_dLambdaChroma; } |
---|
1669 | #else |
---|
1670 | Void setLambda( Double d ) { m_dLambda = d; } |
---|
1671 | Double getLambda() { return m_dLambda; } |
---|
1672 | #endif |
---|
1673 | |
---|
1674 | Void initEqualRef(); |
---|
1675 | Bool isEqualRef ( RefPicList e, Int iRefIdx1, Int iRefIdx2 ) |
---|
1676 | { |
---|
1677 | if (iRefIdx1 < 0 || iRefIdx2 < 0) return false; |
---|
1678 | return m_abEqualRef[e][iRefIdx1][iRefIdx2]; |
---|
1679 | } |
---|
1680 | |
---|
1681 | Void setEqualRef( RefPicList e, Int iRefIdx1, Int iRefIdx2, Bool b) |
---|
1682 | { |
---|
1683 | m_abEqualRef[e][iRefIdx1][iRefIdx2] = m_abEqualRef[e][iRefIdx2][iRefIdx1] = b; |
---|
1684 | } |
---|
1685 | |
---|
1686 | static Void sortPicList ( TComList<TComPic*>& rcListPic ); |
---|
1687 | #if L0034_COMBINED_LIST_CLEANUP |
---|
1688 | Void setList1IdxToList0Idx(); |
---|
1689 | #else |
---|
1690 | Bool getNoBackPredFlag() { return m_bNoBackPredFlag; } |
---|
1691 | Void setNoBackPredFlag( Bool b ) { m_bNoBackPredFlag = b; } |
---|
1692 | Void generateCombinedList (); |
---|
1693 | #endif |
---|
1694 | |
---|
1695 | UInt getTLayer () { return m_uiTLayer; } |
---|
1696 | Void setTLayer ( UInt uiTLayer ) { m_uiTLayer = uiTLayer; } |
---|
1697 | |
---|
1698 | Void setTLayerInfo( UInt uiTLayer ); |
---|
1699 | Void decodingMarking( TComList<TComPic*>& rcListPic, Int iGOPSIze, Int& iMaxRefPicNum ); |
---|
1700 | Void applyReferencePictureSet( TComList<TComPic*>& rcListPic, TComReferencePictureSet *RPSList); |
---|
1701 | Bool isTemporalLayerSwitchingPoint( TComList<TComPic*>& rcListPic ); |
---|
1702 | Bool isStepwiseTemporalLayerSwitchingPointCandidate( TComList<TComPic*>& rcListPic ); |
---|
1703 | Int checkThatAllRefPicsAreAvailable( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool printErrors, Int pocRandomAccess = 0); |
---|
1704 | Void createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet); |
---|
1705 | |
---|
1706 | Void setMaxNumMergeCand (UInt val ) { m_maxNumMergeCand = val; } |
---|
1707 | UInt getMaxNumMergeCand () { return m_maxNumMergeCand; } |
---|
1708 | |
---|
1709 | Void setSliceMode ( UInt uiMode ) { m_sliceMode = uiMode; } |
---|
1710 | UInt getSliceMode () { return m_sliceMode; } |
---|
1711 | Void setSliceArgument ( UInt uiArgument ) { m_sliceArgument = uiArgument; } |
---|
1712 | UInt getSliceArgument () { return m_sliceArgument; } |
---|
1713 | Void setSliceCurStartCUAddr ( UInt uiAddr ) { m_sliceCurStartCUAddr = uiAddr; } |
---|
1714 | UInt getSliceCurStartCUAddr () { return m_sliceCurStartCUAddr; } |
---|
1715 | Void setSliceCurEndCUAddr ( UInt uiAddr ) { m_sliceCurEndCUAddr = uiAddr; } |
---|
1716 | UInt getSliceCurEndCUAddr () { return m_sliceCurEndCUAddr; } |
---|
1717 | Void setSliceIdx ( UInt i) { m_sliceIdx = i; } |
---|
1718 | UInt getSliceIdx () { return m_sliceIdx; } |
---|
1719 | Void copySliceInfo (TComSlice *pcSliceSrc); |
---|
1720 | Void setSliceSegmentMode ( UInt uiMode ) { m_sliceSegmentMode = uiMode; } |
---|
1721 | UInt getSliceSegmentMode () { return m_sliceSegmentMode; } |
---|
1722 | Void setSliceSegmentArgument ( UInt uiArgument ) { m_sliceSegmentArgument = uiArgument; } |
---|
1723 | UInt getSliceSegmentArgument () { return m_sliceSegmentArgument; } |
---|
1724 | Void setSliceSegmentCurStartCUAddr ( UInt uiAddr ) { m_sliceSegmentCurStartCUAddr = uiAddr; } |
---|
1725 | UInt getSliceSegmentCurStartCUAddr () { return m_sliceSegmentCurStartCUAddr; } |
---|
1726 | Void setSliceSegmentCurEndCUAddr ( UInt uiAddr ) { m_sliceSegmentCurEndCUAddr = uiAddr; } |
---|
1727 | UInt getSliceSegmentCurEndCUAddr () { return m_sliceSegmentCurEndCUAddr; } |
---|
1728 | Void setNextSlice ( Bool b ) { m_nextSlice = b; } |
---|
1729 | Bool isNextSlice () { return m_nextSlice; } |
---|
1730 | Void setNextSliceSegment ( Bool b ) { m_nextSliceSegment = b; } |
---|
1731 | Bool isNextSliceSegment () { return m_nextSliceSegment; } |
---|
1732 | Void setSliceBits ( UInt uiVal ) { m_sliceBits = uiVal; } |
---|
1733 | UInt getSliceBits () { return m_sliceBits; } |
---|
1734 | Void setSliceSegmentBits ( UInt uiVal ) { m_sliceSegmentBits = uiVal; } |
---|
1735 | UInt getSliceSegmentBits () { return m_sliceSegmentBits; } |
---|
1736 | Void setFinalized ( Bool uiVal ) { m_bFinalized = uiVal; } |
---|
1737 | Bool getFinalized () { return m_bFinalized; } |
---|
1738 | Void setWpScaling ( wpScalingParam wp[2][MAX_NUM_REF][3] ) { memcpy(m_weightPredTable, wp, sizeof(wpScalingParam)*2*MAX_NUM_REF*3); } |
---|
1739 | Void getWpScaling ( RefPicList e, Int iRefIdx, wpScalingParam *&wp); |
---|
1740 | |
---|
1741 | Void resetWpScaling (); |
---|
1742 | Void initWpScaling (); |
---|
1743 | inline Bool applyWP () { return( (m_eSliceType==P_SLICE && m_pcPPS->getUseWP()) || (m_eSliceType==B_SLICE && m_pcPPS->getWPBiPred()) ); } |
---|
1744 | |
---|
1745 | Void setWpAcDcParam ( wpACDCParam wp[3] ) { memcpy(m_weightACDCParam, wp, sizeof(wpACDCParam)*3); } |
---|
1746 | Void getWpAcDcParam ( wpACDCParam *&wp ); |
---|
1747 | Void initWpAcDcParam (); |
---|
1748 | |
---|
1749 | Void setTileLocationCount ( UInt cnt ) { return m_tileByteLocation.resize(cnt); } |
---|
1750 | UInt getTileLocationCount () { return (UInt) m_tileByteLocation.size(); } |
---|
1751 | Void setTileLocation ( Int idx, UInt location ) { assert (idx<m_tileByteLocation.size()); |
---|
1752 | m_tileByteLocation[idx] = location; } |
---|
1753 | Void addTileLocation ( UInt location ) { m_tileByteLocation.push_back(location); } |
---|
1754 | UInt getTileLocation ( Int idx ) { return m_tileByteLocation[idx]; } |
---|
1755 | |
---|
1756 | Void setTileOffstForMultES (UInt uiOffset ) { m_uiTileOffstForMultES = uiOffset; } |
---|
1757 | UInt getTileOffstForMultES () { return m_uiTileOffstForMultES; } |
---|
1758 | Void allocSubstreamSizes ( UInt uiNumSubstreams ); |
---|
1759 | UInt* getSubstreamSizes () { return m_puiSubstreamSizes; } |
---|
1760 | Void setScalingList ( TComScalingList* scalingList ) { m_scalingList = scalingList; } |
---|
1761 | TComScalingList* getScalingList () { return m_scalingList; } |
---|
1762 | Void setDefaultScalingList (); |
---|
1763 | Bool checkDefaultScalingList (); |
---|
1764 | Void setCabacInitFlag ( Bool val ) { m_cabacInitFlag = val; } //!< set CABAC initial flag |
---|
1765 | Bool getCabacInitFlag () { return m_cabacInitFlag; } //!< get CABAC initial flag |
---|
1766 | Void setNumEntryPointOffsets(Int val) { m_numEntryPointOffsets = val; } |
---|
1767 | Int getNumEntryPointOffsets() { return m_numEntryPointOffsets; } |
---|
1768 | Bool getTemporalLayerNonReferenceFlag() { return m_temporalLayerNonReferenceFlag;} |
---|
1769 | Void setTemporalLayerNonReferenceFlag(Bool x) { m_temporalLayerNonReferenceFlag = x;} |
---|
1770 | Void setLFCrossSliceBoundaryFlag ( Bool val ) { m_LFCrossSliceBoundaryFlag = val; } |
---|
1771 | Bool getLFCrossSliceBoundaryFlag () { return m_LFCrossSliceBoundaryFlag;} |
---|
1772 | |
---|
1773 | Void setEnableTMVPFlag ( Bool b ) { m_enableTMVPFlag = b; } |
---|
1774 | Bool getEnableTMVPFlag () { return m_enableTMVPFlag;} |
---|
1775 | |
---|
1776 | #if SVC_EXTENSION |
---|
1777 | Void setBaseColPic ( TComList<TComPic*>& rcListPic , UInt refLayerIdc ); |
---|
1778 | Void setBaseColPic (UInt refLayerIdc, TComPic* p) { m_pcBaseColPic[refLayerIdc] = p; } |
---|
1779 | TComPic* getBaseColPic (UInt refLayerIdc) { return m_pcBaseColPic[refLayerIdc]; } |
---|
1780 | TComPic** getBaseColPic () { return &m_pcBaseColPic[0]; } |
---|
1781 | |
---|
1782 | Void setLayerId (UInt layerId) { m_layerId = layerId; } |
---|
1783 | UInt getLayerId () { return m_layerId; } |
---|
1784 | |
---|
1785 | Void setFullPelBaseRec (UInt refLayerIdc, TComPicYuv* p) { m_pcFullPelBaseRec[refLayerIdc] = p; } |
---|
1786 | TComPicYuv* getFullPelBaseRec (UInt refLayerIdc) { return m_pcFullPelBaseRec[refLayerIdc]; } |
---|
1787 | |
---|
1788 | #if AVC_SYNTAX |
---|
1789 | Void initBaseLayerRPL( TComSlice *pcSlice ); |
---|
1790 | #endif |
---|
1791 | |
---|
1792 | #if REF_IDX_FRAMEWORK |
---|
1793 | Void setRefPicListModificationSvc(); |
---|
1794 | Int getNumILRRefIdx ( ) { return m_pcVPS->getNumDirectRefLayers( m_layerId ); } |
---|
1795 | |
---|
1796 | #if REF_IDX_MFM |
---|
1797 | Void setRefPOCListILP(TComPic** ilpPic, TComPic** pcRefPicRL); |
---|
1798 | #endif |
---|
1799 | |
---|
1800 | #if JCTVC_M0458_INTERLAYER_RPS_SIG |
---|
1801 | Int getActiveNumILRRefIdx ( ) { return m_activeNumILRRefIdx; } |
---|
1802 | Void setActiveNumILRRefIdx ( Int i ) { m_activeNumILRRefIdx = i; } |
---|
1803 | |
---|
1804 | Int getInterLayerPredLayerIdc (UInt layerIdx) { return m_interLayerPredLayerIdc[layerIdx];} |
---|
1805 | Void setInterLayerPredLayerIdc (UInt refLayerIdc, UInt layerIdx) { m_interLayerPredLayerIdc[layerIdx] = refLayerIdc; } |
---|
1806 | |
---|
1807 | Void setInterLayerPredEnabledFlag ( Bool val ) { m_interLayerPredEnabledFlag = val; } |
---|
1808 | Bool getInterLayerPredEnabledFlag () { return m_interLayerPredEnabledFlag;} |
---|
1809 | #else |
---|
1810 | Void setNumILRRefIdx ( Int i ) { m_numILRRefIdx = i; } |
---|
1811 | #endif |
---|
1812 | #endif |
---|
1813 | |
---|
1814 | TComPic* getRefPic(TComList<TComPic*>& rcListPic, Int poc) { return xGetRefPic( rcListPic, poc ); } |
---|
1815 | |
---|
1816 | #endif //SVC_EXTENSION |
---|
1817 | |
---|
1818 | protected: |
---|
1819 | TComPic* xGetRefPic (TComList<TComPic*>& rcListPic, |
---|
1820 | Int poc); |
---|
1821 | TComPic* xGetLongTermRefPic(TComList<TComPic*>& rcListPic, Int poc, Bool pocHasMsb); |
---|
1822 | };// END CLASS DEFINITION TComSlice |
---|
1823 | |
---|
1824 | |
---|
1825 | template <class T> class ParameterSetMap |
---|
1826 | { |
---|
1827 | public: |
---|
1828 | ParameterSetMap(Int maxId) |
---|
1829 | :m_maxId (maxId) |
---|
1830 | {} |
---|
1831 | |
---|
1832 | ~ParameterSetMap() |
---|
1833 | { |
---|
1834 | for (typename std::map<Int,T *>::iterator i = m_paramsetMap.begin(); i!= m_paramsetMap.end(); i++) |
---|
1835 | { |
---|
1836 | delete (*i).second; |
---|
1837 | } |
---|
1838 | } |
---|
1839 | |
---|
1840 | Void storePS(Int psId, T *ps) |
---|
1841 | { |
---|
1842 | assert ( psId < m_maxId ); |
---|
1843 | if ( m_paramsetMap.find(psId) != m_paramsetMap.end() ) |
---|
1844 | { |
---|
1845 | delete m_paramsetMap[psId]; |
---|
1846 | } |
---|
1847 | m_paramsetMap[psId] = ps; |
---|
1848 | } |
---|
1849 | |
---|
1850 | Void mergePSList(ParameterSetMap<T> &rPsList) |
---|
1851 | { |
---|
1852 | for (typename std::map<Int,T *>::iterator i = rPsList.m_paramsetMap.begin(); i!= rPsList.m_paramsetMap.end(); i++) |
---|
1853 | { |
---|
1854 | storePS(i->first, i->second); |
---|
1855 | } |
---|
1856 | rPsList.m_paramsetMap.clear(); |
---|
1857 | } |
---|
1858 | |
---|
1859 | |
---|
1860 | T* getPS(Int psId) |
---|
1861 | { |
---|
1862 | return ( m_paramsetMap.find(psId) == m_paramsetMap.end() ) ? NULL : m_paramsetMap[psId]; |
---|
1863 | } |
---|
1864 | |
---|
1865 | T* getFirstPS() |
---|
1866 | { |
---|
1867 | return (m_paramsetMap.begin() == m_paramsetMap.end() ) ? NULL : m_paramsetMap.begin()->second; |
---|
1868 | } |
---|
1869 | |
---|
1870 | private: |
---|
1871 | std::map<Int,T *> m_paramsetMap; |
---|
1872 | Int m_maxId; |
---|
1873 | }; |
---|
1874 | |
---|
1875 | class ParameterSetManager |
---|
1876 | { |
---|
1877 | public: |
---|
1878 | ParameterSetManager(); |
---|
1879 | virtual ~ParameterSetManager(); |
---|
1880 | |
---|
1881 | //! store sequence parameter set and take ownership of it |
---|
1882 | Void storeVPS(TComVPS *vps) { m_vpsMap.storePS( vps->getVPSId(), vps); }; |
---|
1883 | //! get pointer to existing video parameter set |
---|
1884 | TComVPS* getVPS(Int vpsId) { return m_vpsMap.getPS(vpsId); }; |
---|
1885 | TComVPS* getFirstVPS() { return m_vpsMap.getFirstPS(); }; |
---|
1886 | |
---|
1887 | //! store sequence parameter set and take ownership of it |
---|
1888 | Void storeSPS(TComSPS *sps) { m_spsMap.storePS( sps->getSPSId(), sps); }; |
---|
1889 | //! get pointer to existing sequence parameter set |
---|
1890 | TComSPS* getSPS(Int spsId) { return m_spsMap.getPS(spsId); }; |
---|
1891 | TComSPS* getFirstSPS() { return m_spsMap.getFirstPS(); }; |
---|
1892 | |
---|
1893 | //! store picture parameter set and take ownership of it |
---|
1894 | Void storePPS(TComPPS *pps) { m_ppsMap.storePS( pps->getPPSId(), pps); }; |
---|
1895 | //! get pointer to existing picture parameter set |
---|
1896 | TComPPS* getPPS(Int ppsId) { return m_ppsMap.getPS(ppsId); }; |
---|
1897 | TComPPS* getFirstPPS() { return m_ppsMap.getFirstPS(); }; |
---|
1898 | |
---|
1899 | //! activate a SPS from a active parameter sets SEI message |
---|
1900 | //! \returns true, if activation is successful |
---|
1901 | Bool activateSPSWithSEI(Int SPSId); |
---|
1902 | |
---|
1903 | //! activate a PPS and depending on isIDR parameter also SPS and VPS |
---|
1904 | //! \returns true, if activation is successful |
---|
1905 | Bool activatePPS(Int ppsId, Bool isIRAP); |
---|
1906 | |
---|
1907 | TComVPS* getActiveVPS(){ return m_vpsMap.getPS(m_activeVPSId); }; |
---|
1908 | TComSPS* getActiveSPS(){ return m_spsMap.getPS(m_activeSPSId); }; |
---|
1909 | TComPPS* getActivePPS(){ return m_ppsMap.getPS(m_activePPSId); }; |
---|
1910 | |
---|
1911 | protected: |
---|
1912 | |
---|
1913 | #if SVC_EXTENSION |
---|
1914 | static ParameterSetMap<TComVPS> m_vpsMap; |
---|
1915 | #else |
---|
1916 | ParameterSetMap<TComVPS> m_vpsMap; |
---|
1917 | #endif |
---|
1918 | ParameterSetMap<TComSPS> m_spsMap; |
---|
1919 | ParameterSetMap<TComPPS> m_ppsMap; |
---|
1920 | |
---|
1921 | #if SVC_EXTENSION |
---|
1922 | static Int m_activeVPSId; |
---|
1923 | #else |
---|
1924 | Int m_activeVPSId; |
---|
1925 | #endif |
---|
1926 | Int m_activeSPSId; |
---|
1927 | Int m_activePPSId; |
---|
1928 | }; |
---|
1929 | |
---|
1930 | //! \} |
---|
1931 | |
---|
1932 | #endif // __TCOMSLICE__ |
---|