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