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