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