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