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_maxLayerId; |
---|
490 | #else |
---|
491 | UInt m_maxNuhReservedZeroLayerId; |
---|
492 | #endif |
---|
493 | TComHRD* m_hrdParameters; |
---|
494 | UInt* m_hrdOpSetIdx; |
---|
495 | Bool* m_cprmsPresentFlag; |
---|
496 | #if H_MV |
---|
497 | UInt m_vpsNumLayerSetsMinus1; |
---|
498 | Bool m_layerIdIncludedFlag[MAX_VPS_OP_SETS_PLUS1][MAX_VPS_NUH_LAYER_ID_PLUS1]; |
---|
499 | #else |
---|
500 | UInt m_numOpSets; |
---|
501 | Bool m_layerIdIncludedFlag[MAX_VPS_OP_SETS_PLUS1][MAX_VPS_NUH_RESERVED_ZERO_LAYER_ID_PLUS1]; |
---|
502 | #endif |
---|
503 | |
---|
504 | #if H_MV |
---|
505 | TComPTL m_pcPTL[MAX_VPS_OP_SETS_PLUS1]; |
---|
506 | #else |
---|
507 | TComPTL m_pcPTL; |
---|
508 | #endif |
---|
509 | #if SIGNAL_BITRATE_PICRATE_IN_VPS |
---|
510 | TComBitRatePicRateInfo m_bitRatePicRateInfo; |
---|
511 | #endif |
---|
512 | #if L0043_TIMING_INFO |
---|
513 | TimingInfo m_timingInfo; |
---|
514 | #endif |
---|
515 | |
---|
516 | #if H_MV |
---|
517 | /// VPS EXTENSION SYNTAX ELEMENTS |
---|
518 | Bool m_avcBaseLayerFlag; |
---|
519 | Bool m_splittingFlag; |
---|
520 | Bool m_scalabilityMask [MAX_NUM_SCALABILITY_TYPES]; |
---|
521 | Int m_dimensionIdLen [MAX_NUM_SCALABILITY_TYPES]; |
---|
522 | Bool m_vpsNuhLayerIdPresentFlag; |
---|
523 | Int m_layerIdInNuh [MAX_NUM_LAYER_IDS]; |
---|
524 | Int m_dimensionId [MAX_NUM_LAYER_IDS][MAX_NUM_SCALABILITY_TYPES]; |
---|
525 | Bool m_directDependencyFlag [MAX_NUM_LAYER_IDS][MAX_NUM_LAYER_IDS]; |
---|
526 | Int m_maxTidIlRefPicPlus1 [MAX_NUM_LAYERS]; |
---|
527 | Int m_vpsNumberLayerSetsMinus1; |
---|
528 | Int m_vpsNumProfileTierLevelMinus1; |
---|
529 | Bool m_vpsProfilePresentFlag [MAX_VPS_OP_SETS_PLUS1]; |
---|
530 | Int m_profileRefMinus1 [MAX_VPS_PROFILE_TIER_LEVEL]; |
---|
531 | Bool m_moreOutputLayerSetsThanDefaultFlag; |
---|
532 | Int m_numAddOutputLayerSetsMinus1; |
---|
533 | Bool m_defaultOneTargetOutputLayerFlag; |
---|
534 | Int m_outputLayerSetIdxMinus1 [MAX_VPS_OUTPUTLAYER_SETS]; |
---|
535 | Bool m_outputLayerFlag [MAX_VPS_OUTPUTLAYER_SETS][MAX_VPS_NUH_LAYER_ID_PLUS1]; |
---|
536 | Int m_profileLevelTierIdx [MAX_VPS_OUTPUTLAYER_SETS ]; |
---|
537 | Bool m_maxOneActiveRefLayerFlag; |
---|
538 | Int m_directDepTypeLenMinus2; |
---|
539 | Int m_directDependencyType [MAX_NUM_LAYERS] [MAX_NUM_LAYERS]; |
---|
540 | |
---|
541 | // VPS EXTENSION SEMANTICS VARIABLES |
---|
542 | Int m_layerIdInVps [MAX_NUM_LAYERS ]; |
---|
543 | |
---|
544 | Int m_numDirectRefLayers [MAX_NUM_LAYERS]; |
---|
545 | Int m_refLayerId [MAX_NUM_LAYERS][MAX_NUM_LAYERS]; |
---|
546 | |
---|
547 | Int m_numSamplePredRefLayers [MAX_NUM_LAYERS]; |
---|
548 | Bool m_samplePredEnabledFlag [MAX_NUM_LAYERS][MAX_NUM_LAYERS]; |
---|
549 | Int m_samplePredRefLayerId [MAX_NUM_LAYERS][MAX_NUM_LAYERS]; |
---|
550 | |
---|
551 | Int m_numMotionPredRefLayers [MAX_NUM_LAYERS]; |
---|
552 | Bool m_motionPredEnabledFlag [MAX_NUM_LAYERS][MAX_NUM_LAYERS]; |
---|
553 | Int m_motionPredRefLayerId [MAX_NUM_LAYERS][MAX_NUM_LAYERS]; |
---|
554 | #if H_3D |
---|
555 | Int m_viewIndex [MAX_NUM_LAYERS ]; |
---|
556 | #endif |
---|
557 | |
---|
558 | Int xCeilLog2 ( Int val ); |
---|
559 | Int xGetDimBitOffset( Int j ); |
---|
560 | |
---|
561 | #if H_3D_ARP |
---|
562 | UInt m_uiUseAdvResPred [MAX_NUM_LAYERS ]; |
---|
563 | UInt m_uiARPStepNum [MAX_NUM_LAYERS ]; |
---|
564 | #endif |
---|
565 | #if H_3D_IV_MERGE |
---|
566 | Bool m_ivMvPredFlag [ MAX_NUM_LAYERS ]; |
---|
567 | #endif |
---|
568 | #if H_3D_VSP |
---|
569 | Bool m_viewSynthesisPredFlag [ MAX_NUM_LAYERS ]; |
---|
570 | #endif |
---|
571 | #if H_3D_NBDV_REF |
---|
572 | Bool m_depthRefinementFlag [ MAX_NUM_LAYERS ]; |
---|
573 | #endif |
---|
574 | Bool m_vpsDepthModesFlag [MAX_NUM_LAYERS ]; |
---|
575 | #if H_3D_DIM_DLT |
---|
576 | Bool m_bUseDLTFlag [MAX_NUM_LAYERS ]; |
---|
577 | |
---|
578 | Int m_iBitsPerDepthValue [MAX_NUM_LAYERS ]; |
---|
579 | Int m_iNumDepthmapValues [MAX_NUM_LAYERS ]; |
---|
580 | Int* m_iDepthValue2Idx [MAX_NUM_LAYERS ]; |
---|
581 | Int* m_iIdx2DepthValue [MAX_NUM_LAYERS ]; |
---|
582 | #endif |
---|
583 | #if H_3D_TMVP |
---|
584 | Bool m_ivMvScalingFlag; |
---|
585 | #endif |
---|
586 | |
---|
587 | #endif |
---|
588 | public: |
---|
589 | TComVPS(); |
---|
590 | virtual ~TComVPS(); |
---|
591 | |
---|
592 | Void createHrdParamBuffer() |
---|
593 | { |
---|
594 | m_hrdParameters = new TComHRD[ getNumHrdParameters() ]; |
---|
595 | m_hrdOpSetIdx = new UInt [ getNumHrdParameters() ]; |
---|
596 | m_cprmsPresentFlag = new Bool [ getNumHrdParameters() ]; |
---|
597 | } |
---|
598 | |
---|
599 | TComHRD* getHrdParameters ( UInt i ) { return &m_hrdParameters[ i ]; } |
---|
600 | UInt getHrdOpSetIdx ( UInt i ) { return m_hrdOpSetIdx[ i ]; } |
---|
601 | Void setHrdOpSetIdx ( UInt val, UInt i ) { m_hrdOpSetIdx[ i ] = val; } |
---|
602 | Bool getCprmsPresentFlag ( UInt i ) { return m_cprmsPresentFlag[ i ]; } |
---|
603 | Void setCprmsPresentFlag ( Bool val, UInt i ) { m_cprmsPresentFlag[ i ] = val; } |
---|
604 | |
---|
605 | Int getVPSId () { return m_VPSId; } |
---|
606 | Void setVPSId (Int i) { m_VPSId = i; } |
---|
607 | |
---|
608 | UInt getMaxTLayers () { return m_uiMaxTLayers; } |
---|
609 | Void setMaxTLayers (UInt t) { m_uiMaxTLayers = t; } |
---|
610 | |
---|
611 | UInt getMaxLayers () { return m_uiMaxLayers; } |
---|
612 | Void setMaxLayers (UInt l) { m_uiMaxLayers = l; } |
---|
613 | |
---|
614 | Bool getTemporalNestingFlag () { return m_bTemporalIdNestingFlag; } |
---|
615 | Void setTemporalNestingFlag (Bool t) { m_bTemporalIdNestingFlag = t; } |
---|
616 | |
---|
617 | Void setNumReorderPics(UInt v, UInt tLayer) { m_numReorderPics[tLayer] = v; } |
---|
618 | UInt getNumReorderPics(UInt tLayer) { return m_numReorderPics[tLayer]; } |
---|
619 | |
---|
620 | Void setMaxDecPicBuffering(UInt v, UInt tLayer) { m_uiMaxDecPicBuffering[tLayer] = v; } |
---|
621 | UInt getMaxDecPicBuffering(UInt tLayer) { return m_uiMaxDecPicBuffering[tLayer]; } |
---|
622 | |
---|
623 | Void setMaxLatencyIncrease(UInt v, UInt tLayer) { m_uiMaxLatencyIncrease[tLayer] = v; } |
---|
624 | UInt getMaxLatencyIncrease(UInt tLayer) { return m_uiMaxLatencyIncrease[tLayer]; } |
---|
625 | |
---|
626 | UInt getNumHrdParameters() { return m_numHrdParameters; } |
---|
627 | Void setNumHrdParameters(UInt v) { m_numHrdParameters = v; } |
---|
628 | |
---|
629 | #if H_MV |
---|
630 | UInt getVpsMaxLayerId() { return m_maxLayerId; } |
---|
631 | Void setVpsMaxLayerId(UInt v) { m_maxLayerId = v; } |
---|
632 | |
---|
633 | UInt getVpsNumLayerSetsMinus1() { return m_vpsNumLayerSetsMinus1; } |
---|
634 | Void setVpsNumLayerSetsMinus1(UInt v) { m_vpsNumLayerSetsMinus1 = v; } |
---|
635 | #else |
---|
636 | UInt getMaxNuhReservedZeroLayerId() { return m_maxNuhReservedZeroLayerId; } |
---|
637 | Void setMaxNuhReservedZeroLayerId(UInt v) { m_maxNuhReservedZeroLayerId = v; } |
---|
638 | |
---|
639 | UInt getMaxOpSets() { return m_numOpSets; } |
---|
640 | Void setMaxOpSets(UInt v) { m_numOpSets = v; } |
---|
641 | #endif |
---|
642 | Bool getLayerIdIncludedFlag(UInt opsIdx, UInt id) { return m_layerIdIncludedFlag[opsIdx][id]; } |
---|
643 | Void setLayerIdIncludedFlag(Bool v, UInt opsIdx, UInt id) { m_layerIdIncludedFlag[opsIdx][id] = v; } |
---|
644 | |
---|
645 | #if H_MV |
---|
646 | TComPTL* getPTL( Int layerSet = 0 ) { return &m_pcPTL[layerSet]; } |
---|
647 | #else |
---|
648 | TComPTL* getPTL() { return &m_pcPTL; } |
---|
649 | #endif |
---|
650 | #if SIGNAL_BITRATE_PICRATE_IN_VPS |
---|
651 | TComBitRatePicRateInfo *getBitratePicrateInfo() { return &m_bitRatePicRateInfo; } |
---|
652 | #endif |
---|
653 | #if L0043_TIMING_INFO |
---|
654 | TimingInfo* getTimingInfo() { return &m_timingInfo; } |
---|
655 | #endif |
---|
656 | #if H_MV |
---|
657 | Void setAvcBaseLayerFlag( Bool val ) { m_avcBaseLayerFlag = val; } |
---|
658 | Bool getAvcBaseLayerFlag() { return m_avcBaseLayerFlag; } |
---|
659 | |
---|
660 | Void setSplittingFlag( Bool val ) { m_splittingFlag = val; } |
---|
661 | Bool getSplittingFlag() { return m_splittingFlag; } |
---|
662 | |
---|
663 | Void setScalabilityMask( UInt val ); |
---|
664 | |
---|
665 | Void setScalabilityMask( Int scalType, Bool val ) { m_scalabilityMask[scalType] = val; } |
---|
666 | Bool getScalabilityMask( Int scalType ) { return m_scalabilityMask[scalType]; } |
---|
667 | |
---|
668 | Int getNumScalabilityTypes( ); |
---|
669 | |
---|
670 | Void setDimensionIdLen( Int sIdx, Int val ) { m_dimensionIdLen[sIdx] = val; } |
---|
671 | Int getDimensionIdLen( Int sIdx ) { assert( m_dimensionIdLen[sIdx] > 0) ; return m_dimensionIdLen[sIdx]; } |
---|
672 | |
---|
673 | Void setVpsNuhLayerIdPresentFlag( Bool val ) { m_vpsNuhLayerIdPresentFlag = val; } |
---|
674 | Bool getVpsNuhLayerIdPresentFlag() { return m_vpsNuhLayerIdPresentFlag; } |
---|
675 | |
---|
676 | Void setLayerIdInNuh( Int layerIdInVps, Int val ) { m_layerIdInNuh[layerIdInVps] = val; } |
---|
677 | Int getLayerIdInNuh( Int layerIdInVps ) { assert( m_layerIdInNuh[layerIdInVps] >= 0 ); return m_layerIdInNuh[layerIdInVps]; } |
---|
678 | |
---|
679 | Bool nuhLayerIdIncluded( Int layerIdinNuh ) { return ( m_layerIdInVps[ layerIdinNuh ] > 0 ); } |
---|
680 | |
---|
681 | Void setDimensionId( Int layerIdInVps, Int scalIdx, Int val ) { m_dimensionId[layerIdInVps][scalIdx] = val; } |
---|
682 | Int getDimensionId( Int layerIdInVps, Int scalIdx ) { return m_dimensionId[layerIdInVps][scalIdx]; } |
---|
683 | |
---|
684 | Void setDirectDependencyFlag( Int depLayeridInVps, Int refLayeridInVps, Bool val ) { m_directDependencyFlag[depLayeridInVps][refLayeridInVps] = val; } |
---|
685 | Bool getDirectDependencyFlag( Int depLayeridInVps, Int refLayeridInVps ) { return m_directDependencyFlag[depLayeridInVps][refLayeridInVps]; } |
---|
686 | |
---|
687 | Void setMaxTidIlRefPicPlus1( Int layerIdInVps, Int val ) { m_maxTidIlRefPicPlus1[ layerIdInVps ] = val; } |
---|
688 | Int getMaxTidIlRefPicPlus1( Int layerIdInVps ) { return m_maxTidIlRefPicPlus1[ layerIdInVps ]; } |
---|
689 | |
---|
690 | Void setVpsNumberLayerSetsMinus1( Int val ) { m_vpsNumberLayerSetsMinus1 = val; } |
---|
691 | Int getVpsNumberLayerSetsMinus1( ) { return m_vpsNumberLayerSetsMinus1; } |
---|
692 | |
---|
693 | Void setVpsNumProfileTierLevelMinus1( Int val ) { m_vpsNumProfileTierLevelMinus1 = val; } |
---|
694 | Int getVpsNumProfileTierLevelMinus1( ) { return m_vpsNumProfileTierLevelMinus1; } |
---|
695 | |
---|
696 | Void setVpsProfilePresentFlag( Int idx, Bool val ) { m_vpsProfilePresentFlag[idx] = val; } |
---|
697 | Bool getVpsProfilePresentFlag( Int idx ) { return m_vpsProfilePresentFlag[idx]; } |
---|
698 | |
---|
699 | Void setProfileRefMinus1( Int profileTierLevelIdx, Int val ) { m_profileRefMinus1[ profileTierLevelIdx ] = val; } |
---|
700 | Int getProfileRefMinus1( Int profileTierLevelIdx ) { return m_profileRefMinus1[ profileTierLevelIdx ]; } |
---|
701 | |
---|
702 | Void setMoreOutputLayerSetsThanDefaultFlag( Bool flag ) { m_moreOutputLayerSetsThanDefaultFlag = flag; } |
---|
703 | Bool getMoreOutputLayerSetsThanDefaultFlag() { return m_moreOutputLayerSetsThanDefaultFlag; } |
---|
704 | |
---|
705 | Void setNumAddOutputLayerSetsMinus1( Int val ) { m_numAddOutputLayerSetsMinus1 = val; } |
---|
706 | Int getNumAddOutputLayerSetsMinus1( ) { return m_numAddOutputLayerSetsMinus1; } |
---|
707 | |
---|
708 | Void setDefaultOneTargetOutputLayerFlag( Bool flag ) { m_defaultOneTargetOutputLayerFlag = flag; } |
---|
709 | Bool getDefaultOneTargetOutputLayerFlag( ) { return m_defaultOneTargetOutputLayerFlag; } |
---|
710 | |
---|
711 | Void setOutputLayerSetIdxMinus1( Int outLayerSetIdx, Int val ) { m_outputLayerSetIdxMinus1[ outLayerSetIdx ] = val; } |
---|
712 | Int getOutputLayerSetIdxMinus1( Int outLayerSetIdx ) { return m_outputLayerSetIdxMinus1[ outLayerSetIdx ]; } |
---|
713 | |
---|
714 | Void setOutputLayerFlag( Int outLayerSetIdx, Int i, Bool flag ) { m_outputLayerFlag[ outLayerSetIdx ][ i ] = flag; } |
---|
715 | Bool getOutputLayerFlag( Int outLayerSetIdx, Int i ) { return m_outputLayerFlag[ outLayerSetIdx ][ i ]; } |
---|
716 | |
---|
717 | Void setProfileLevelTierIdx( Int outLayerSetIdx, Int val ) { m_profileLevelTierIdx[ outLayerSetIdx = val ]; } |
---|
718 | Int getProfileLevelTierIdx( Int outLayerSetIdx ) { return m_profileLevelTierIdx[ outLayerSetIdx ]; } |
---|
719 | |
---|
720 | Void setMaxOneActiveRefLayerFlag( Bool flag) { m_maxOneActiveRefLayerFlag = flag; } |
---|
721 | Bool getMaxOneActiveRefLayerFlag( ) { return m_maxOneActiveRefLayerFlag; } |
---|
722 | |
---|
723 | Void setDirectDepTypeLenMinus2( Int val) { m_directDepTypeLenMinus2 = val; } |
---|
724 | Int getDirectDepTypeLenMinus2( ) { return m_directDepTypeLenMinus2; } |
---|
725 | |
---|
726 | Void setDirectDependencyType( Int depLayeridInVps, Int refLayeridInVps, Int val) { m_directDependencyType[ depLayeridInVps ][ refLayeridInVps ] = val; } |
---|
727 | Int getDirectDependencyType( Int depLayeridInVps, Int refLayeridInVps) { return m_directDependencyType[ depLayeridInVps ][ refLayeridInVps ]; } |
---|
728 | |
---|
729 | |
---|
730 | // VPS EXTENSION SEMANTICS VARIABLES |
---|
731 | Void setLayerIdInVps( Int layerIdInNuh, Int val ) { m_layerIdInVps[layerIdInNuh] = val; } |
---|
732 | Int getLayerIdInVps( Int layerIdInNuh ) { assert( m_layerIdInVps[layerIdInNuh] >= 0 ); return m_layerIdInVps[layerIdInNuh]; } |
---|
733 | |
---|
734 | Int getScalabilityId ( Int layerIdInVps, ScalabilityType scalType ); |
---|
735 | Int getViewId ( Int layerIdInVps ) { return getScalabilityId( layerIdInVps, VIEW_ID ); } |
---|
736 | |
---|
737 | Void setRefLayers(); |
---|
738 | |
---|
739 | Int getNumDirectRefLayers( Int layerIdInVps ) { return m_numDirectRefLayers[ layerIdInVps ]; }; |
---|
740 | Int getRefLayerId ( Int layerIdInVps, Int idx );; |
---|
741 | |
---|
742 | Int getNumSamplePredRefLayers( Int layerIdInVps ) { return m_numSamplePredRefLayers[layerIdInVps]; } |
---|
743 | Bool getSamplePredEnabledFlag ( Int layerIdInVps, Int idx ) { return m_samplePredEnabledFlag [layerIdInVps][idx]; } |
---|
744 | Int getSamplePredRefLayerId ( Int layerIdInVps, Int idx ) { return m_samplePredRefLayerId [layerIdInVps][idx]; } |
---|
745 | |
---|
746 | Int getNumMotionPredRefLayers( Int layerIdInVps ) { return m_numMotionPredRefLayers[layerIdInVps]; } |
---|
747 | Bool getMotionPredEnabledFlag ( Int layerIdInVps, Int idx ) { return m_motionPredEnabledFlag [layerIdInVps][idx]; } |
---|
748 | Int getMotionPredRefLayerId ( Int layerIdInVps, Int idx ) { return m_motionPredRefLayerId [layerIdInVps][idx]; } |
---|
749 | |
---|
750 | Bool checkVPSExtensionSyntax(); |
---|
751 | Int scalTypeToScalIdx ( ScalabilityType scalType ); |
---|
752 | |
---|
753 | Int getProfileLevelTierIdxLen() { return xCeilLog2( getVpsNumProfileTierLevelMinus1() + 1 ); }; |
---|
754 | Int getNumLayersInIdList ( Int lsIdx );; |
---|
755 | |
---|
756 | // inference |
---|
757 | Int inferDimensionId ( Int i, Int j ); |
---|
758 | Int inferLastDimsionIdLenMinus1(); |
---|
759 | |
---|
760 | #if H_3D |
---|
761 | Void initViewIndex(); |
---|
762 | Int getViewIndex ( Int layerIdInVps ) { return m_viewIndex[ layerIdInVps ]; } |
---|
763 | Int getDepthId ( Int layerIdInVps ) { return getScalabilityId( layerIdInVps, DEPTH_ID ); } |
---|
764 | Int getLayerIdInNuh( Int viewIndex, Bool depthFlag ); |
---|
765 | |
---|
766 | #if H_3D_ARP |
---|
767 | UInt getUseAdvRP ( Int layerIdInVps ) { return m_uiUseAdvResPred[layerIdInVps]; } |
---|
768 | UInt getARPStepNum( Int layerIdInVps ) { return m_uiARPStepNum[layerIdInVps]; } |
---|
769 | Void setUseAdvRP ( Int layerIdInVps, UInt val ) { m_uiUseAdvResPred[layerIdInVps] = val; } |
---|
770 | Void setARPStepNum( Int layerIdInVps, UInt val ) { m_uiARPStepNum[layerIdInVps] = val; } |
---|
771 | #endif |
---|
772 | #if H_3D_IV_MERGE |
---|
773 | Void setIvMvPredFlag ( Int layerIdInVps, Bool val ) { m_ivMvPredFlag[ layerIdInVps ] = val; } |
---|
774 | Bool getIvMvPredFlag ( Int layerIdInVps ) { return m_ivMvPredFlag[ layerIdInVps ]; }; |
---|
775 | #endif |
---|
776 | #if H_3D_VSP |
---|
777 | Void setViewSynthesisPredFlag ( Int layerIdInVps, Bool val ) { m_viewSynthesisPredFlag[ layerIdInVps ] = val; } |
---|
778 | Bool getViewSynthesisPredFlag ( Int layerIdInVps ) { return m_viewSynthesisPredFlag[ layerIdInVps ]; }; |
---|
779 | #endif |
---|
780 | #if H_3D_NBDV_REF |
---|
781 | Void setDepthRefinementFlag ( Int layerIdInVps, Bool val ) { m_depthRefinementFlag[ layerIdInVps ] = val; } |
---|
782 | Bool getDepthRefinementFlag ( Int layerIdInVps ) { return m_depthRefinementFlag[ layerIdInVps ]; }; |
---|
783 | #endif |
---|
784 | Void setVpsDepthModesFlag( Int layerIdInVps, Bool val ) { m_vpsDepthModesFlag[ layerIdInVps ] = val; } |
---|
785 | Bool getVpsDepthModesFlag( Int layerIdInVps ) { return m_vpsDepthModesFlag[ layerIdInVps ]; } |
---|
786 | #if H_3D_DIM_DLT |
---|
787 | Bool getUseDLTFlag ( Int layerIdInVps ) { return m_bUseDLTFlag[ layerIdInVps ]; } |
---|
788 | Void setUseDLTFlag ( Int layerIdInVps, Bool b ) { m_bUseDLTFlag[ layerIdInVps ] = b; } |
---|
789 | |
---|
790 | Int getBitsPerDepthValue( Int layerIdInVps ) { return getUseDLTFlag(layerIdInVps)?m_iBitsPerDepthValue[layerIdInVps]:g_bitDepthY; } |
---|
791 | Int getNumDepthValues( Int layerIdInVps ) { return getUseDLTFlag(layerIdInVps)?m_iNumDepthmapValues[layerIdInVps]:((1 << g_bitDepthY)-1); } |
---|
792 | Int depthValue2idx( Int layerIdInVps, Pel value ) { return getUseDLTFlag(layerIdInVps)?m_iDepthValue2Idx[layerIdInVps][value]:value; } |
---|
793 | Pel idx2DepthValue( Int layerIdInVps, UInt uiIdx ) { return getUseDLTFlag(layerIdInVps)?m_iIdx2DepthValue[layerIdInVps][uiIdx]:uiIdx; } |
---|
794 | Void setDepthLUTs( Int layerIdInVps, Int* idx2DepthValue = NULL, Int iNumDepthValues = 0 ); |
---|
795 | #endif |
---|
796 | |
---|
797 | #if H_3D_TMVP |
---|
798 | Bool getIvMvScalingFlag ( ) { return m_ivMvScalingFlag; } |
---|
799 | Void setIvMvScalingFlag ( Bool b ) { m_ivMvScalingFlag = b; } |
---|
800 | #endif |
---|
801 | |
---|
802 | #endif |
---|
803 | #endif |
---|
804 | }; |
---|
805 | |
---|
806 | class Window |
---|
807 | { |
---|
808 | private: |
---|
809 | Bool m_enabledFlag; |
---|
810 | Int m_winLeftOffset; |
---|
811 | Int m_winRightOffset; |
---|
812 | Int m_winTopOffset; |
---|
813 | Int m_winBottomOffset; |
---|
814 | public: |
---|
815 | Window() |
---|
816 | : m_enabledFlag (false) |
---|
817 | , m_winLeftOffset (0) |
---|
818 | , m_winRightOffset (0) |
---|
819 | , m_winTopOffset (0) |
---|
820 | , m_winBottomOffset (0) |
---|
821 | { } |
---|
822 | |
---|
823 | Bool getWindowEnabledFlag() const { return m_enabledFlag; } |
---|
824 | Void resetWindow() { m_enabledFlag = false; m_winLeftOffset = m_winRightOffset = m_winTopOffset = m_winBottomOffset = 0; } |
---|
825 | Int getWindowLeftOffset() const { return m_enabledFlag ? m_winLeftOffset : 0; } |
---|
826 | Void setWindowLeftOffset(Int val) { m_winLeftOffset = val; m_enabledFlag = true; } |
---|
827 | Int getWindowRightOffset() const { return m_enabledFlag ? m_winRightOffset : 0; } |
---|
828 | Void setWindowRightOffset(Int val) { m_winRightOffset = val; m_enabledFlag = true; } |
---|
829 | Int getWindowTopOffset() const { return m_enabledFlag ? m_winTopOffset : 0; } |
---|
830 | Void setWindowTopOffset(Int val) { m_winTopOffset = val; m_enabledFlag = true; } |
---|
831 | Int getWindowBottomOffset() const { return m_enabledFlag ? m_winBottomOffset: 0; } |
---|
832 | Void setWindowBottomOffset(Int val) { m_winBottomOffset = val; m_enabledFlag = true; } |
---|
833 | |
---|
834 | Void setWindow(Int offsetLeft, Int offsetLRight, Int offsetLTop, Int offsetLBottom) |
---|
835 | { |
---|
836 | m_enabledFlag = true; |
---|
837 | m_winLeftOffset = offsetLeft; |
---|
838 | m_winRightOffset = offsetLRight; |
---|
839 | m_winTopOffset = offsetLTop; |
---|
840 | m_winBottomOffset = offsetLBottom; |
---|
841 | } |
---|
842 | }; |
---|
843 | |
---|
844 | |
---|
845 | class TComVUI |
---|
846 | { |
---|
847 | private: |
---|
848 | Bool m_aspectRatioInfoPresentFlag; |
---|
849 | Int m_aspectRatioIdc; |
---|
850 | Int m_sarWidth; |
---|
851 | Int m_sarHeight; |
---|
852 | Bool m_overscanInfoPresentFlag; |
---|
853 | Bool m_overscanAppropriateFlag; |
---|
854 | Bool m_videoSignalTypePresentFlag; |
---|
855 | Int m_videoFormat; |
---|
856 | Bool m_videoFullRangeFlag; |
---|
857 | Bool m_colourDescriptionPresentFlag; |
---|
858 | Int m_colourPrimaries; |
---|
859 | Int m_transferCharacteristics; |
---|
860 | Int m_matrixCoefficients; |
---|
861 | Bool m_chromaLocInfoPresentFlag; |
---|
862 | Int m_chromaSampleLocTypeTopField; |
---|
863 | Int m_chromaSampleLocTypeBottomField; |
---|
864 | Bool m_neutralChromaIndicationFlag; |
---|
865 | Bool m_fieldSeqFlag; |
---|
866 | |
---|
867 | Window m_defaultDisplayWindow; |
---|
868 | Bool m_frameFieldInfoPresentFlag; |
---|
869 | Bool m_hrdParametersPresentFlag; |
---|
870 | Bool m_bitstreamRestrictionFlag; |
---|
871 | Bool m_tilesFixedStructureFlag; |
---|
872 | Bool m_motionVectorsOverPicBoundariesFlag; |
---|
873 | Bool m_restrictedRefPicListsFlag; |
---|
874 | Int m_minSpatialSegmentationIdc; |
---|
875 | Int m_maxBytesPerPicDenom; |
---|
876 | Int m_maxBitsPerMinCuDenom; |
---|
877 | Int m_log2MaxMvLengthHorizontal; |
---|
878 | Int m_log2MaxMvLengthVertical; |
---|
879 | TComHRD m_hrdParameters; |
---|
880 | #if L0043_TIMING_INFO |
---|
881 | TimingInfo m_timingInfo; |
---|
882 | #else |
---|
883 | Bool m_pocProportionalToTimingFlag; |
---|
884 | Int m_numTicksPocDiffOneMinus1; |
---|
885 | #endif |
---|
886 | #if H_MV |
---|
887 | Bool m_tileBoundariesAlignedFlag; |
---|
888 | #endif |
---|
889 | public: |
---|
890 | TComVUI() |
---|
891 | :m_aspectRatioInfoPresentFlag(false) |
---|
892 | ,m_aspectRatioIdc(0) |
---|
893 | ,m_sarWidth(0) |
---|
894 | ,m_sarHeight(0) |
---|
895 | ,m_overscanInfoPresentFlag(false) |
---|
896 | ,m_overscanAppropriateFlag(false) |
---|
897 | ,m_videoSignalTypePresentFlag(false) |
---|
898 | ,m_videoFormat(5) |
---|
899 | ,m_videoFullRangeFlag(false) |
---|
900 | ,m_colourDescriptionPresentFlag(false) |
---|
901 | ,m_colourPrimaries(2) |
---|
902 | ,m_transferCharacteristics(2) |
---|
903 | ,m_matrixCoefficients(2) |
---|
904 | ,m_chromaLocInfoPresentFlag(false) |
---|
905 | ,m_chromaSampleLocTypeTopField(0) |
---|
906 | ,m_chromaSampleLocTypeBottomField(0) |
---|
907 | ,m_neutralChromaIndicationFlag(false) |
---|
908 | ,m_fieldSeqFlag(false) |
---|
909 | ,m_frameFieldInfoPresentFlag(false) |
---|
910 | ,m_hrdParametersPresentFlag(false) |
---|
911 | ,m_bitstreamRestrictionFlag(false) |
---|
912 | ,m_tilesFixedStructureFlag(false) |
---|
913 | ,m_motionVectorsOverPicBoundariesFlag(true) |
---|
914 | ,m_restrictedRefPicListsFlag(1) |
---|
915 | ,m_minSpatialSegmentationIdc(0) |
---|
916 | ,m_maxBytesPerPicDenom(2) |
---|
917 | ,m_maxBitsPerMinCuDenom(1) |
---|
918 | ,m_log2MaxMvLengthHorizontal(15) |
---|
919 | ,m_log2MaxMvLengthVertical(15) |
---|
920 | #if !L0043_TIMING_INFO |
---|
921 | ,m_pocProportionalToTimingFlag(false) |
---|
922 | ,m_numTicksPocDiffOneMinus1(0) |
---|
923 | #endif |
---|
924 | #if H_MV |
---|
925 | ,m_tileBoundariesAlignedFlag(true) |
---|
926 | #endif |
---|
927 | {} |
---|
928 | |
---|
929 | virtual ~TComVUI() {} |
---|
930 | |
---|
931 | Bool getAspectRatioInfoPresentFlag() { return m_aspectRatioInfoPresentFlag; } |
---|
932 | Void setAspectRatioInfoPresentFlag(Bool i) { m_aspectRatioInfoPresentFlag = i; } |
---|
933 | |
---|
934 | Int getAspectRatioIdc() { return m_aspectRatioIdc; } |
---|
935 | Void setAspectRatioIdc(Int i) { m_aspectRatioIdc = i; } |
---|
936 | |
---|
937 | Int getSarWidth() { return m_sarWidth; } |
---|
938 | Void setSarWidth(Int i) { m_sarWidth = i; } |
---|
939 | |
---|
940 | Int getSarHeight() { return m_sarHeight; } |
---|
941 | Void setSarHeight(Int i) { m_sarHeight = i; } |
---|
942 | |
---|
943 | Bool getOverscanInfoPresentFlag() { return m_overscanInfoPresentFlag; } |
---|
944 | Void setOverscanInfoPresentFlag(Bool i) { m_overscanInfoPresentFlag = i; } |
---|
945 | |
---|
946 | Bool getOverscanAppropriateFlag() { return m_overscanAppropriateFlag; } |
---|
947 | Void setOverscanAppropriateFlag(Bool i) { m_overscanAppropriateFlag = i; } |
---|
948 | |
---|
949 | Bool getVideoSignalTypePresentFlag() { return m_videoSignalTypePresentFlag; } |
---|
950 | Void setVideoSignalTypePresentFlag(Bool i) { m_videoSignalTypePresentFlag = i; } |
---|
951 | |
---|
952 | Int getVideoFormat() { return m_videoFormat; } |
---|
953 | Void setVideoFormat(Int i) { m_videoFormat = i; } |
---|
954 | |
---|
955 | Bool getVideoFullRangeFlag() { return m_videoFullRangeFlag; } |
---|
956 | Void setVideoFullRangeFlag(Bool i) { m_videoFullRangeFlag = i; } |
---|
957 | |
---|
958 | Bool getColourDescriptionPresentFlag() { return m_colourDescriptionPresentFlag; } |
---|
959 | Void setColourDescriptionPresentFlag(Bool i) { m_colourDescriptionPresentFlag = i; } |
---|
960 | |
---|
961 | Int getColourPrimaries() { return m_colourPrimaries; } |
---|
962 | Void setColourPrimaries(Int i) { m_colourPrimaries = i; } |
---|
963 | |
---|
964 | Int getTransferCharacteristics() { return m_transferCharacteristics; } |
---|
965 | Void setTransferCharacteristics(Int i) { m_transferCharacteristics = i; } |
---|
966 | |
---|
967 | Int getMatrixCoefficients() { return m_matrixCoefficients; } |
---|
968 | Void setMatrixCoefficients(Int i) { m_matrixCoefficients = i; } |
---|
969 | |
---|
970 | Bool getChromaLocInfoPresentFlag() { return m_chromaLocInfoPresentFlag; } |
---|
971 | Void setChromaLocInfoPresentFlag(Bool i) { m_chromaLocInfoPresentFlag = i; } |
---|
972 | |
---|
973 | Int getChromaSampleLocTypeTopField() { return m_chromaSampleLocTypeTopField; } |
---|
974 | Void setChromaSampleLocTypeTopField(Int i) { m_chromaSampleLocTypeTopField = i; } |
---|
975 | |
---|
976 | Int getChromaSampleLocTypeBottomField() { return m_chromaSampleLocTypeBottomField; } |
---|
977 | Void setChromaSampleLocTypeBottomField(Int i) { m_chromaSampleLocTypeBottomField = i; } |
---|
978 | |
---|
979 | Bool getNeutralChromaIndicationFlag() { return m_neutralChromaIndicationFlag; } |
---|
980 | Void setNeutralChromaIndicationFlag(Bool i) { m_neutralChromaIndicationFlag = i; } |
---|
981 | |
---|
982 | Bool getFieldSeqFlag() { return m_fieldSeqFlag; } |
---|
983 | Void setFieldSeqFlag(Bool i) { m_fieldSeqFlag = i; } |
---|
984 | |
---|
985 | Bool getFrameFieldInfoPresentFlag() { return m_frameFieldInfoPresentFlag; } |
---|
986 | Void setFrameFieldInfoPresentFlag(Bool i) { m_frameFieldInfoPresentFlag = i; } |
---|
987 | |
---|
988 | Window& getDefaultDisplayWindow() { return m_defaultDisplayWindow; } |
---|
989 | Void setDefaultDisplayWindow(Window& defaultDisplayWindow ) { m_defaultDisplayWindow = defaultDisplayWindow; } |
---|
990 | |
---|
991 | Bool getHrdParametersPresentFlag() { return m_hrdParametersPresentFlag; } |
---|
992 | Void setHrdParametersPresentFlag(Bool i) { m_hrdParametersPresentFlag = i; } |
---|
993 | |
---|
994 | Bool getBitstreamRestrictionFlag() { return m_bitstreamRestrictionFlag; } |
---|
995 | Void setBitstreamRestrictionFlag(Bool i) { m_bitstreamRestrictionFlag = i; } |
---|
996 | |
---|
997 | Bool getTilesFixedStructureFlag() { return m_tilesFixedStructureFlag; } |
---|
998 | Void setTilesFixedStructureFlag(Bool i) { m_tilesFixedStructureFlag = i; } |
---|
999 | |
---|
1000 | Bool getMotionVectorsOverPicBoundariesFlag() { return m_motionVectorsOverPicBoundariesFlag; } |
---|
1001 | Void setMotionVectorsOverPicBoundariesFlag(Bool i) { m_motionVectorsOverPicBoundariesFlag = i; } |
---|
1002 | |
---|
1003 | Bool getRestrictedRefPicListsFlag() { return m_restrictedRefPicListsFlag; } |
---|
1004 | Void setRestrictedRefPicListsFlag(Bool b) { m_restrictedRefPicListsFlag = b; } |
---|
1005 | |
---|
1006 | Int getMinSpatialSegmentationIdc() { return m_minSpatialSegmentationIdc; } |
---|
1007 | Void setMinSpatialSegmentationIdc(Int i) { m_minSpatialSegmentationIdc = i; } |
---|
1008 | Int getMaxBytesPerPicDenom() { return m_maxBytesPerPicDenom; } |
---|
1009 | Void setMaxBytesPerPicDenom(Int i) { m_maxBytesPerPicDenom = i; } |
---|
1010 | |
---|
1011 | Int getMaxBitsPerMinCuDenom() { return m_maxBitsPerMinCuDenom; } |
---|
1012 | Void setMaxBitsPerMinCuDenom(Int i) { m_maxBitsPerMinCuDenom = i; } |
---|
1013 | |
---|
1014 | Int getLog2MaxMvLengthHorizontal() { return m_log2MaxMvLengthHorizontal; } |
---|
1015 | Void setLog2MaxMvLengthHorizontal(Int i) { m_log2MaxMvLengthHorizontal = i; } |
---|
1016 | |
---|
1017 | Int getLog2MaxMvLengthVertical() { return m_log2MaxMvLengthVertical; } |
---|
1018 | Void setLog2MaxMvLengthVertical(Int i) { m_log2MaxMvLengthVertical = i; } |
---|
1019 | |
---|
1020 | TComHRD* getHrdParameters () { return &m_hrdParameters; } |
---|
1021 | #if L0043_TIMING_INFO |
---|
1022 | TimingInfo* getTimingInfo() { return &m_timingInfo; } |
---|
1023 | #else |
---|
1024 | Bool getPocProportionalToTimingFlag() {return m_pocProportionalToTimingFlag; } |
---|
1025 | Void setPocProportionalToTimingFlag(Bool x) {m_pocProportionalToTimingFlag = x;} |
---|
1026 | Int getNumTicksPocDiffOneMinus1() {return m_numTicksPocDiffOneMinus1;} |
---|
1027 | Void setNumTicksPocDiffOneMinus1(Int x) { m_numTicksPocDiffOneMinus1 = x;} |
---|
1028 | #endif |
---|
1029 | #if H_MV |
---|
1030 | Bool getTileBoundariesAlignedFlag( ) { return m_tileBoundariesAlignedFlag; } |
---|
1031 | Void setTileBoundariesAlignedFlag( Bool flag ) { m_tileBoundariesAlignedFlag = flag; } |
---|
1032 | #endif |
---|
1033 | }; |
---|
1034 | |
---|
1035 | /// SPS class |
---|
1036 | class TComSPS |
---|
1037 | { |
---|
1038 | private: |
---|
1039 | Int m_SPSId; |
---|
1040 | Int m_VPSId; |
---|
1041 | Int m_chromaFormatIdc; |
---|
1042 | |
---|
1043 | UInt m_uiMaxTLayers; // maximum number of temporal layers |
---|
1044 | |
---|
1045 | // Structure |
---|
1046 | UInt m_picWidthInLumaSamples; |
---|
1047 | UInt m_picHeightInLumaSamples; |
---|
1048 | |
---|
1049 | Int m_log2MinCodingBlockSize; |
---|
1050 | Int m_log2DiffMaxMinCodingBlockSize; |
---|
1051 | UInt m_uiMaxCUWidth; |
---|
1052 | UInt m_uiMaxCUHeight; |
---|
1053 | UInt m_uiMaxCUDepth; |
---|
1054 | |
---|
1055 | Window m_conformanceWindow; |
---|
1056 | |
---|
1057 | TComRPSList m_RPSList; |
---|
1058 | Bool m_bLongTermRefsPresent; |
---|
1059 | Bool m_TMVPFlagsPresent; |
---|
1060 | Int m_numReorderPics[MAX_TLAYER]; |
---|
1061 | |
---|
1062 | // Tool list |
---|
1063 | UInt m_uiQuadtreeTULog2MaxSize; |
---|
1064 | UInt m_uiQuadtreeTULog2MinSize; |
---|
1065 | UInt m_uiQuadtreeTUMaxDepthInter; |
---|
1066 | UInt m_uiQuadtreeTUMaxDepthIntra; |
---|
1067 | Bool m_usePCM; |
---|
1068 | UInt m_pcmLog2MaxSize; |
---|
1069 | UInt m_uiPCMLog2MinSize; |
---|
1070 | Bool m_useAMP; |
---|
1071 | |
---|
1072 | #if !L0034_COMBINED_LIST_CLEANUP |
---|
1073 | Bool m_bUseLComb; |
---|
1074 | #endif |
---|
1075 | |
---|
1076 | // Parameter |
---|
1077 | Int m_bitDepthY; |
---|
1078 | Int m_bitDepthC; |
---|
1079 | Int m_qpBDOffsetY; |
---|
1080 | Int m_qpBDOffsetC; |
---|
1081 | |
---|
1082 | Bool m_useLossless; |
---|
1083 | |
---|
1084 | UInt m_uiPCMBitDepthLuma; |
---|
1085 | UInt m_uiPCMBitDepthChroma; |
---|
1086 | Bool m_bPCMFilterDisableFlag; |
---|
1087 | |
---|
1088 | UInt m_uiBitsForPOC; |
---|
1089 | UInt m_numLongTermRefPicSPS; |
---|
1090 | UInt m_ltRefPicPocLsbSps[33]; |
---|
1091 | Bool m_usedByCurrPicLtSPSFlag[33]; |
---|
1092 | // Max physical transform size |
---|
1093 | UInt m_uiMaxTrSize; |
---|
1094 | |
---|
1095 | Int m_iAMPAcc[MAX_CU_DEPTH]; |
---|
1096 | Bool m_bUseSAO; |
---|
1097 | |
---|
1098 | Bool m_bTemporalIdNestingFlag; // temporal_id_nesting_flag |
---|
1099 | |
---|
1100 | Bool m_scalingListEnabledFlag; |
---|
1101 | Bool m_scalingListPresentFlag; |
---|
1102 | TComScalingList* m_scalingList; //!< ScalingList class pointer |
---|
1103 | UInt m_uiMaxDecPicBuffering[MAX_TLAYER]; |
---|
1104 | UInt m_uiMaxLatencyIncrease[MAX_TLAYER]; |
---|
1105 | |
---|
1106 | Bool m_useDF; |
---|
1107 | Bool m_useStrongIntraSmoothing; |
---|
1108 | |
---|
1109 | Bool m_vuiParametersPresentFlag; |
---|
1110 | TComVUI m_vuiParameters; |
---|
1111 | |
---|
1112 | static const Int m_winUnitX[MAX_CHROMA_FORMAT_IDC+1]; |
---|
1113 | static const Int m_winUnitY[MAX_CHROMA_FORMAT_IDC+1]; |
---|
1114 | TComPTL m_pcPTL; |
---|
1115 | #if H_MV |
---|
1116 | Bool m_interViewMvVertConstraintFlag; |
---|
1117 | Int m_numIlpRestrictedRefLayers ; |
---|
1118 | Int m_minSpatialSegmentOffsetPlus1[MAX_NUM_LAYERS]; |
---|
1119 | Bool m_ctuBasedOffsetEnabledFlag [MAX_NUM_LAYERS]; |
---|
1120 | Int m_minHorizontalCtuOffsetPlus1 [MAX_NUM_LAYERS]; |
---|
1121 | #endif |
---|
1122 | #if H_3D |
---|
1123 | UInt m_uiCamParPrecision; |
---|
1124 | Bool m_bCamParInSliceHeader; |
---|
1125 | Int m_aaiCodedScale [2][MAX_NUM_LAYERS]; |
---|
1126 | Int m_aaiCodedOffset[2][MAX_NUM_LAYERS]; |
---|
1127 | #endif |
---|
1128 | #if H_MV |
---|
1129 | Int m_layerId; |
---|
1130 | #endif |
---|
1131 | public: |
---|
1132 | TComSPS(); |
---|
1133 | virtual ~TComSPS(); |
---|
1134 | |
---|
1135 | Int getVPSId () { return m_VPSId; } |
---|
1136 | Void setVPSId (Int i) { m_VPSId = i; } |
---|
1137 | Int getSPSId () { return m_SPSId; } |
---|
1138 | Void setSPSId (Int i) { m_SPSId = i; } |
---|
1139 | Int getChromaFormatIdc () { return m_chromaFormatIdc; } |
---|
1140 | Void setChromaFormatIdc (Int i) { m_chromaFormatIdc = i; } |
---|
1141 | |
---|
1142 | static Int getWinUnitX (Int chromaFormatIdc) { assert (chromaFormatIdc > 0 && chromaFormatIdc <= MAX_CHROMA_FORMAT_IDC); return m_winUnitX[chromaFormatIdc]; } |
---|
1143 | static Int getWinUnitY (Int chromaFormatIdc) { assert (chromaFormatIdc > 0 && chromaFormatIdc <= MAX_CHROMA_FORMAT_IDC); return m_winUnitY[chromaFormatIdc]; } |
---|
1144 | |
---|
1145 | // structure |
---|
1146 | Void setPicWidthInLumaSamples ( UInt u ) { m_picWidthInLumaSamples = u; } |
---|
1147 | UInt getPicWidthInLumaSamples () { return m_picWidthInLumaSamples; } |
---|
1148 | Void setPicHeightInLumaSamples ( UInt u ) { m_picHeightInLumaSamples = u; } |
---|
1149 | UInt getPicHeightInLumaSamples () { return m_picHeightInLumaSamples; } |
---|
1150 | |
---|
1151 | Window& getConformanceWindow() { return m_conformanceWindow; } |
---|
1152 | Void setConformanceWindow(Window& conformanceWindow ) { m_conformanceWindow = conformanceWindow; } |
---|
1153 | |
---|
1154 | UInt getNumLongTermRefPicSPS() { return m_numLongTermRefPicSPS; } |
---|
1155 | Void setNumLongTermRefPicSPS(UInt val) { m_numLongTermRefPicSPS = val; } |
---|
1156 | |
---|
1157 | UInt getLtRefPicPocLsbSps(UInt index) { return m_ltRefPicPocLsbSps[index]; } |
---|
1158 | Void setLtRefPicPocLsbSps(UInt index, UInt val) { m_ltRefPicPocLsbSps[index] = val; } |
---|
1159 | |
---|
1160 | Bool getUsedByCurrPicLtSPSFlag(Int i) {return m_usedByCurrPicLtSPSFlag[i];} |
---|
1161 | Void setUsedByCurrPicLtSPSFlag(Int i, Bool x) { m_usedByCurrPicLtSPSFlag[i] = x;} |
---|
1162 | |
---|
1163 | Int getLog2MinCodingBlockSize() const { return m_log2MinCodingBlockSize; } |
---|
1164 | Void setLog2MinCodingBlockSize(Int val) { m_log2MinCodingBlockSize = val; } |
---|
1165 | Int getLog2DiffMaxMinCodingBlockSize() const { return m_log2DiffMaxMinCodingBlockSize; } |
---|
1166 | Void setLog2DiffMaxMinCodingBlockSize(Int val) { m_log2DiffMaxMinCodingBlockSize = val; } |
---|
1167 | |
---|
1168 | Void setMaxCUWidth ( UInt u ) { m_uiMaxCUWidth = u; } |
---|
1169 | UInt getMaxCUWidth () { return m_uiMaxCUWidth; } |
---|
1170 | Void setMaxCUHeight ( UInt u ) { m_uiMaxCUHeight = u; } |
---|
1171 | UInt getMaxCUHeight () { return m_uiMaxCUHeight; } |
---|
1172 | Void setMaxCUDepth ( UInt u ) { m_uiMaxCUDepth = u; } |
---|
1173 | UInt getMaxCUDepth () { return m_uiMaxCUDepth; } |
---|
1174 | Void setUsePCM ( Bool b ) { m_usePCM = b; } |
---|
1175 | Bool getUsePCM () { return m_usePCM; } |
---|
1176 | Void setPCMLog2MaxSize ( UInt u ) { m_pcmLog2MaxSize = u; } |
---|
1177 | UInt getPCMLog2MaxSize () { return m_pcmLog2MaxSize; } |
---|
1178 | Void setPCMLog2MinSize ( UInt u ) { m_uiPCMLog2MinSize = u; } |
---|
1179 | UInt getPCMLog2MinSize () { return m_uiPCMLog2MinSize; } |
---|
1180 | Void setBitsForPOC ( UInt u ) { m_uiBitsForPOC = u; } |
---|
1181 | UInt getBitsForPOC () { return m_uiBitsForPOC; } |
---|
1182 | Bool getUseAMP() { return m_useAMP; } |
---|
1183 | Void setUseAMP( Bool b ) { m_useAMP = b; } |
---|
1184 | Void setQuadtreeTULog2MaxSize( UInt u ) { m_uiQuadtreeTULog2MaxSize = u; } |
---|
1185 | UInt getQuadtreeTULog2MaxSize() { return m_uiQuadtreeTULog2MaxSize; } |
---|
1186 | Void setQuadtreeTULog2MinSize( UInt u ) { m_uiQuadtreeTULog2MinSize = u; } |
---|
1187 | UInt getQuadtreeTULog2MinSize() { return m_uiQuadtreeTULog2MinSize; } |
---|
1188 | Void setQuadtreeTUMaxDepthInter( UInt u ) { m_uiQuadtreeTUMaxDepthInter = u; } |
---|
1189 | Void setQuadtreeTUMaxDepthIntra( UInt u ) { m_uiQuadtreeTUMaxDepthIntra = u; } |
---|
1190 | UInt getQuadtreeTUMaxDepthInter() { return m_uiQuadtreeTUMaxDepthInter; } |
---|
1191 | UInt getQuadtreeTUMaxDepthIntra() { return m_uiQuadtreeTUMaxDepthIntra; } |
---|
1192 | Void setNumReorderPics(Int i, UInt tlayer) { m_numReorderPics[tlayer] = i; } |
---|
1193 | Int getNumReorderPics(UInt tlayer) { return m_numReorderPics[tlayer]; } |
---|
1194 | Void createRPSList( Int numRPS ); |
---|
1195 | TComRPSList* getRPSList() { return &m_RPSList; } |
---|
1196 | Bool getLongTermRefsPresent() { return m_bLongTermRefsPresent; } |
---|
1197 | Void setLongTermRefsPresent(Bool b) { m_bLongTermRefsPresent=b; } |
---|
1198 | Bool getTMVPFlagsPresent() { return m_TMVPFlagsPresent; } |
---|
1199 | Void setTMVPFlagsPresent(Bool b) { m_TMVPFlagsPresent=b; } |
---|
1200 | // physical transform |
---|
1201 | Void setMaxTrSize ( UInt u ) { m_uiMaxTrSize = u; } |
---|
1202 | UInt getMaxTrSize () { return m_uiMaxTrSize; } |
---|
1203 | |
---|
1204 | // Tool list |
---|
1205 | #if !L0034_COMBINED_LIST_CLEANUP |
---|
1206 | Void setUseLComb (Bool b) { m_bUseLComb = b; } |
---|
1207 | Bool getUseLComb () { return m_bUseLComb; } |
---|
1208 | #endif |
---|
1209 | |
---|
1210 | Bool getUseLossless () { return m_useLossless; } |
---|
1211 | Void setUseLossless ( Bool b ) { m_useLossless = b; } |
---|
1212 | |
---|
1213 | // AMP accuracy |
---|
1214 | Int getAMPAcc ( UInt uiDepth ) { return m_iAMPAcc[uiDepth]; } |
---|
1215 | Void setAMPAcc ( UInt uiDepth, Int iAccu ) { assert( uiDepth < g_uiMaxCUDepth); m_iAMPAcc[uiDepth] = iAccu; } |
---|
1216 | |
---|
1217 | // Bit-depth |
---|
1218 | Int getBitDepthY() { return m_bitDepthY; } |
---|
1219 | Void setBitDepthY(Int u) { m_bitDepthY = u; } |
---|
1220 | Int getBitDepthC() { return m_bitDepthC; } |
---|
1221 | Void setBitDepthC(Int u) { m_bitDepthC = u; } |
---|
1222 | Int getQpBDOffsetY () { return m_qpBDOffsetY; } |
---|
1223 | Void setQpBDOffsetY ( Int value ) { m_qpBDOffsetY = value; } |
---|
1224 | Int getQpBDOffsetC () { return m_qpBDOffsetC; } |
---|
1225 | Void setQpBDOffsetC ( Int value ) { m_qpBDOffsetC = value; } |
---|
1226 | Void setUseSAO (Bool bVal) {m_bUseSAO = bVal;} |
---|
1227 | Bool getUseSAO () {return m_bUseSAO;} |
---|
1228 | |
---|
1229 | UInt getMaxTLayers() { return m_uiMaxTLayers; } |
---|
1230 | Void setMaxTLayers( UInt uiMaxTLayers ) { assert( uiMaxTLayers <= MAX_TLAYER ); m_uiMaxTLayers = uiMaxTLayers; } |
---|
1231 | |
---|
1232 | Bool getTemporalIdNestingFlag() { return m_bTemporalIdNestingFlag; } |
---|
1233 | Void setTemporalIdNestingFlag( Bool bValue ) { m_bTemporalIdNestingFlag = bValue; } |
---|
1234 | UInt getPCMBitDepthLuma () { return m_uiPCMBitDepthLuma; } |
---|
1235 | Void setPCMBitDepthLuma ( UInt u ) { m_uiPCMBitDepthLuma = u; } |
---|
1236 | UInt getPCMBitDepthChroma () { return m_uiPCMBitDepthChroma; } |
---|
1237 | Void setPCMBitDepthChroma ( UInt u ) { m_uiPCMBitDepthChroma = u; } |
---|
1238 | Void setPCMFilterDisableFlag ( Bool bValue ) { m_bPCMFilterDisableFlag = bValue; } |
---|
1239 | Bool getPCMFilterDisableFlag () { return m_bPCMFilterDisableFlag; } |
---|
1240 | |
---|
1241 | Bool getScalingListFlag () { return m_scalingListEnabledFlag; } |
---|
1242 | Void setScalingListFlag ( Bool b ) { m_scalingListEnabledFlag = b; } |
---|
1243 | Bool getScalingListPresentFlag() { return m_scalingListPresentFlag; } |
---|
1244 | Void setScalingListPresentFlag( Bool b ) { m_scalingListPresentFlag = b; } |
---|
1245 | Void setScalingList ( TComScalingList *scalingList); |
---|
1246 | TComScalingList* getScalingList () { return m_scalingList; } //!< get ScalingList class pointer in SPS |
---|
1247 | UInt getMaxDecPicBuffering (UInt tlayer) { return m_uiMaxDecPicBuffering[tlayer]; } |
---|
1248 | Void setMaxDecPicBuffering ( UInt ui, UInt tlayer ) { m_uiMaxDecPicBuffering[tlayer] = ui; } |
---|
1249 | UInt getMaxLatencyIncrease (UInt tlayer) { return m_uiMaxLatencyIncrease[tlayer]; } |
---|
1250 | Void setMaxLatencyIncrease ( UInt ui , UInt tlayer) { m_uiMaxLatencyIncrease[tlayer] = ui; } |
---|
1251 | |
---|
1252 | Void setUseStrongIntraSmoothing (Bool bVal) {m_useStrongIntraSmoothing = bVal;} |
---|
1253 | Bool getUseStrongIntraSmoothing () {return m_useStrongIntraSmoothing;} |
---|
1254 | |
---|
1255 | Bool getVuiParametersPresentFlag() { return m_vuiParametersPresentFlag; } |
---|
1256 | Void setVuiParametersPresentFlag(Bool b) { m_vuiParametersPresentFlag = b; } |
---|
1257 | TComVUI* getVuiParameters() { return &m_vuiParameters; } |
---|
1258 | Void setHrdParameters( UInt frameRate, UInt numDU, UInt bitRate, Bool randomAccess ); |
---|
1259 | |
---|
1260 | TComPTL* getPTL() { return &m_pcPTL; } |
---|
1261 | #if H_MV |
---|
1262 | Void setInterViewMvVertConstraintFlag(Bool val) { m_interViewMvVertConstraintFlag = val; } |
---|
1263 | Bool getInterViewMvVertConstraintFlag() { return m_interViewMvVertConstraintFlag;} |
---|
1264 | |
---|
1265 | //// sps_extension_vui_parameters( ) |
---|
1266 | Void setNumIlpRestrictedRefLayers ( Int val ) { m_numIlpRestrictedRefLayers = val;} |
---|
1267 | Int getNumIlpRestrictedRefLayers ( ) { return m_numIlpRestrictedRefLayers ;} |
---|
1268 | |
---|
1269 | Void setMinSpatialSegmentOffsetPlus1( Int i, Int val ) { m_minSpatialSegmentOffsetPlus1[ i ] = val;} |
---|
1270 | Int getMinSpatialSegmentOffsetPlus1( Int i ) { return m_minSpatialSegmentOffsetPlus1[ i ];} |
---|
1271 | |
---|
1272 | Void setCtuBasedOffsetEnabledFlag ( Int i, Bool flag ) { m_ctuBasedOffsetEnabledFlag [ i ] = flag;} |
---|
1273 | Bool getCtuBasedOffsetEnabledFlag ( Int i ) { return m_ctuBasedOffsetEnabledFlag [ i ];} |
---|
1274 | |
---|
1275 | Void setMinHorizontalCtuOffsetPlus1 ( Int i, Int val ) { m_minHorizontalCtuOffsetPlus1 [ i ] = val;} |
---|
1276 | Int getMinHorizontalCtuOffsetPlus1 ( Int i ) { return m_minHorizontalCtuOffsetPlus1 [ i ];} |
---|
1277 | #endif |
---|
1278 | #if H_3D |
---|
1279 | Void initCamParaSPS ( UInt uiViewIndex, UInt uiCamParPrecision = 0, Bool bCamParSlice = false, Int** aaiScale = 0, Int** aaiOffset = 0 ); |
---|
1280 | UInt getCamParPrecision () { return m_uiCamParPrecision; } |
---|
1281 | Bool hasCamParInSliceHeader() { return m_bCamParInSliceHeader; } |
---|
1282 | Int* getCodedScale () { return m_aaiCodedScale [0]; } |
---|
1283 | Int* getCodedOffset () { return m_aaiCodedOffset[0]; } |
---|
1284 | Int* getInvCodedScale () { return m_aaiCodedScale [1]; } |
---|
1285 | Int* getInvCodedOffset () { return m_aaiCodedOffset[1]; } |
---|
1286 | #endif |
---|
1287 | #if H_MV |
---|
1288 | Int getLayerId () { return m_layerId; } |
---|
1289 | Void setLayerId ( Int val ) { m_layerId = val; } |
---|
1290 | #endif |
---|
1291 | |
---|
1292 | }; |
---|
1293 | |
---|
1294 | /// Reference Picture Lists class |
---|
1295 | class TComRefPicListModification |
---|
1296 | { |
---|
1297 | private: |
---|
1298 | UInt m_bRefPicListModificationFlagL0; |
---|
1299 | UInt m_bRefPicListModificationFlagL1; |
---|
1300 | UInt m_RefPicSetIdxL0[32]; |
---|
1301 | UInt m_RefPicSetIdxL1[32]; |
---|
1302 | |
---|
1303 | public: |
---|
1304 | TComRefPicListModification(); |
---|
1305 | virtual ~TComRefPicListModification(); |
---|
1306 | |
---|
1307 | Void create (); |
---|
1308 | Void destroy (); |
---|
1309 | |
---|
1310 | Bool getRefPicListModificationFlagL0() { return m_bRefPicListModificationFlagL0; } |
---|
1311 | Void setRefPicListModificationFlagL0(Bool flag) { m_bRefPicListModificationFlagL0 = flag; } |
---|
1312 | Bool getRefPicListModificationFlagL1() { return m_bRefPicListModificationFlagL1; } |
---|
1313 | Void setRefPicListModificationFlagL1(Bool flag) { m_bRefPicListModificationFlagL1 = flag; } |
---|
1314 | Void setRefPicSetIdxL0(UInt idx, UInt refPicSetIdx) { m_RefPicSetIdxL0[idx] = refPicSetIdx; } |
---|
1315 | UInt getRefPicSetIdxL0(UInt idx) { return m_RefPicSetIdxL0[idx]; } |
---|
1316 | Void setRefPicSetIdxL1(UInt idx, UInt refPicSetIdx) { m_RefPicSetIdxL1[idx] = refPicSetIdx; } |
---|
1317 | UInt getRefPicSetIdxL1(UInt idx) { return m_RefPicSetIdxL1[idx]; } |
---|
1318 | #if H_MV |
---|
1319 | // Why not an listIdx for all members, would avoid code duplication?? |
---|
1320 | Void setRefPicSetIdxL(UInt li, UInt idx, UInt refPicSetIdx) {( li==0 ? m_RefPicSetIdxL0[idx] : m_RefPicSetIdxL1[idx] ) = refPicSetIdx; } |
---|
1321 | UInt getRefPicSetIdxL(UInt li, UInt idx ) { return ( li == 0 ) ? m_RefPicSetIdxL0[idx] : m_RefPicSetIdxL1[idx] ; } |
---|
1322 | Void setRefPicListModificationFlagL(UInt li, Bool flag) { ( li==0 ? m_bRefPicListModificationFlagL0 : m_bRefPicListModificationFlagL1 ) = flag; } |
---|
1323 | Bool getRefPicListModificationFlagL(UInt li ) { return ( li== 0) ? m_bRefPicListModificationFlagL0 : m_bRefPicListModificationFlagL1; } |
---|
1324 | #endif |
---|
1325 | }; |
---|
1326 | |
---|
1327 | /// PPS class |
---|
1328 | class TComPPS |
---|
1329 | { |
---|
1330 | private: |
---|
1331 | Int m_PPSId; // pic_parameter_set_id |
---|
1332 | Int m_SPSId; // seq_parameter_set_id |
---|
1333 | Int m_picInitQPMinus26; |
---|
1334 | Bool m_useDQP; |
---|
1335 | Bool m_bConstrainedIntraPred; // constrained_intra_pred_flag |
---|
1336 | Bool m_bSliceChromaQpFlag; // slicelevel_chroma_qp_flag |
---|
1337 | |
---|
1338 | // access channel |
---|
1339 | TComSPS* m_pcSPS; |
---|
1340 | UInt m_uiMaxCuDQPDepth; |
---|
1341 | UInt m_uiMinCuDQPSize; |
---|
1342 | |
---|
1343 | Int m_chromaCbQpOffset; |
---|
1344 | Int m_chromaCrQpOffset; |
---|
1345 | |
---|
1346 | UInt m_numRefIdxL0DefaultActive; |
---|
1347 | UInt m_numRefIdxL1DefaultActive; |
---|
1348 | |
---|
1349 | Bool m_bUseWeightPred; // Use of Weighting Prediction (P_SLICE) |
---|
1350 | Bool m_useWeightedBiPred; // Use of Weighting Bi-Prediction (B_SLICE) |
---|
1351 | Bool m_OutputFlagPresentFlag; // Indicates the presence of output_flag in slice header |
---|
1352 | |
---|
1353 | Bool m_TransquantBypassEnableFlag; // Indicates presence of cu_transquant_bypass_flag in CUs. |
---|
1354 | Bool m_useTransformSkip; |
---|
1355 | Bool m_dependentSliceSegmentsEnabledFlag; //!< Indicates the presence of dependent slices |
---|
1356 | Bool m_tilesEnabledFlag; //!< Indicates the presence of tiles |
---|
1357 | Bool m_entropyCodingSyncEnabledFlag; //!< Indicates the presence of wavefronts |
---|
1358 | |
---|
1359 | Bool m_loopFilterAcrossTilesEnabledFlag; |
---|
1360 | Int m_uniformSpacingFlag; |
---|
1361 | Int m_iNumColumnsMinus1; |
---|
1362 | UInt* m_puiColumnWidth; |
---|
1363 | Int m_iNumRowsMinus1; |
---|
1364 | UInt* m_puiRowHeight; |
---|
1365 | |
---|
1366 | Int m_iNumSubstreams; |
---|
1367 | |
---|
1368 | Int m_signHideFlag; |
---|
1369 | |
---|
1370 | Bool m_cabacInitPresentFlag; |
---|
1371 | UInt m_encCABACTableIdx; // Used to transmit table selection across slices |
---|
1372 | |
---|
1373 | Bool m_sliceHeaderExtensionPresentFlag; |
---|
1374 | Bool m_loopFilterAcrossSlicesEnabledFlag; |
---|
1375 | Bool m_deblockingFilterControlPresentFlag; |
---|
1376 | Bool m_deblockingFilterOverrideEnabledFlag; |
---|
1377 | Bool m_picDisableDeblockingFilterFlag; |
---|
1378 | Int m_deblockingFilterBetaOffsetDiv2; //< beta offset for deblocking filter |
---|
1379 | Int m_deblockingFilterTcOffsetDiv2; //< tc offset for deblocking filter |
---|
1380 | Bool m_scalingListPresentFlag; |
---|
1381 | TComScalingList* m_scalingList; //!< ScalingList class pointer |
---|
1382 | Bool m_listsModificationPresentFlag; |
---|
1383 | UInt m_log2ParallelMergeLevelMinus2; |
---|
1384 | Int m_numExtraSliceHeaderBits; |
---|
1385 | |
---|
1386 | public: |
---|
1387 | TComPPS(); |
---|
1388 | virtual ~TComPPS(); |
---|
1389 | |
---|
1390 | Int getPPSId () { return m_PPSId; } |
---|
1391 | Void setPPSId (Int i) { m_PPSId = i; } |
---|
1392 | Int getSPSId () { return m_SPSId; } |
---|
1393 | Void setSPSId (Int i) { m_SPSId = i; } |
---|
1394 | |
---|
1395 | Int getPicInitQPMinus26 () { return m_picInitQPMinus26; } |
---|
1396 | Void setPicInitQPMinus26 ( Int i ) { m_picInitQPMinus26 = i; } |
---|
1397 | Bool getUseDQP () { return m_useDQP; } |
---|
1398 | Void setUseDQP ( Bool b ) { m_useDQP = b; } |
---|
1399 | Bool getConstrainedIntraPred () { return m_bConstrainedIntraPred; } |
---|
1400 | Void setConstrainedIntraPred ( Bool b ) { m_bConstrainedIntraPred = b; } |
---|
1401 | Bool getSliceChromaQpFlag () { return m_bSliceChromaQpFlag; } |
---|
1402 | Void setSliceChromaQpFlag ( Bool b ) { m_bSliceChromaQpFlag = b; } |
---|
1403 | |
---|
1404 | Void setSPS ( TComSPS* pcSPS ) { m_pcSPS = pcSPS; } |
---|
1405 | TComSPS* getSPS () { return m_pcSPS; } |
---|
1406 | Void setMaxCuDQPDepth ( UInt u ) { m_uiMaxCuDQPDepth = u; } |
---|
1407 | UInt getMaxCuDQPDepth () { return m_uiMaxCuDQPDepth;} |
---|
1408 | Void setMinCuDQPSize ( UInt u ) { m_uiMinCuDQPSize = u; } |
---|
1409 | UInt getMinCuDQPSize () { return m_uiMinCuDQPSize; } |
---|
1410 | |
---|
1411 | Void setChromaCbQpOffset( Int i ) { m_chromaCbQpOffset = i; } |
---|
1412 | Int getChromaCbQpOffset() { return m_chromaCbQpOffset; } |
---|
1413 | Void setChromaCrQpOffset( Int i ) { m_chromaCrQpOffset = i; } |
---|
1414 | Int getChromaCrQpOffset() { return m_chromaCrQpOffset; } |
---|
1415 | |
---|
1416 | Void setNumRefIdxL0DefaultActive(UInt ui) { m_numRefIdxL0DefaultActive=ui; } |
---|
1417 | UInt getNumRefIdxL0DefaultActive() { return m_numRefIdxL0DefaultActive; } |
---|
1418 | Void setNumRefIdxL1DefaultActive(UInt ui) { m_numRefIdxL1DefaultActive=ui; } |
---|
1419 | UInt getNumRefIdxL1DefaultActive() { return m_numRefIdxL1DefaultActive; } |
---|
1420 | |
---|
1421 | Bool getUseWP () { return m_bUseWeightPred; } |
---|
1422 | Bool getWPBiPred () { return m_useWeightedBiPred; } |
---|
1423 | Void setUseWP ( Bool b ) { m_bUseWeightPred = b; } |
---|
1424 | Void setWPBiPred ( Bool b ) { m_useWeightedBiPred = b; } |
---|
1425 | Void setOutputFlagPresentFlag( Bool b ) { m_OutputFlagPresentFlag = b; } |
---|
1426 | Bool getOutputFlagPresentFlag() { return m_OutputFlagPresentFlag; } |
---|
1427 | Void setTransquantBypassEnableFlag( Bool b ) { m_TransquantBypassEnableFlag = b; } |
---|
1428 | Bool getTransquantBypassEnableFlag() { return m_TransquantBypassEnableFlag; } |
---|
1429 | |
---|
1430 | Bool getUseTransformSkip () { return m_useTransformSkip; } |
---|
1431 | Void setUseTransformSkip ( Bool b ) { m_useTransformSkip = b; } |
---|
1432 | |
---|
1433 | Void setLoopFilterAcrossTilesEnabledFlag (Bool b) { m_loopFilterAcrossTilesEnabledFlag = b; } |
---|
1434 | Bool getLoopFilterAcrossTilesEnabledFlag () { return m_loopFilterAcrossTilesEnabledFlag; } |
---|
1435 | Bool getDependentSliceSegmentsEnabledFlag() const { return m_dependentSliceSegmentsEnabledFlag; } |
---|
1436 | Void setDependentSliceSegmentsEnabledFlag(Bool val) { m_dependentSliceSegmentsEnabledFlag = val; } |
---|
1437 | Bool getTilesEnabledFlag() const { return m_tilesEnabledFlag; } |
---|
1438 | Void setTilesEnabledFlag(Bool val) { m_tilesEnabledFlag = val; } |
---|
1439 | Bool getEntropyCodingSyncEnabledFlag() const { return m_entropyCodingSyncEnabledFlag; } |
---|
1440 | Void setEntropyCodingSyncEnabledFlag(Bool val) { m_entropyCodingSyncEnabledFlag = val; } |
---|
1441 | Void setUniformSpacingFlag ( Bool b ) { m_uniformSpacingFlag = b; } |
---|
1442 | Bool getUniformSpacingFlag () { return m_uniformSpacingFlag; } |
---|
1443 | Void setNumColumnsMinus1 ( Int i ) { m_iNumColumnsMinus1 = i; } |
---|
1444 | Int getNumColumnsMinus1 () { return m_iNumColumnsMinus1; } |
---|
1445 | Void setColumnWidth ( UInt* columnWidth ) |
---|
1446 | { |
---|
1447 | if( m_uniformSpacingFlag == 0 && m_iNumColumnsMinus1 > 0 ) |
---|
1448 | { |
---|
1449 | m_puiColumnWidth = new UInt[ m_iNumColumnsMinus1 ]; |
---|
1450 | |
---|
1451 | for(Int i=0; i<m_iNumColumnsMinus1; i++) |
---|
1452 | { |
---|
1453 | m_puiColumnWidth[i] = columnWidth[i]; |
---|
1454 | } |
---|
1455 | } |
---|
1456 | } |
---|
1457 | UInt getColumnWidth (UInt columnIdx) { return *( m_puiColumnWidth + columnIdx ); } |
---|
1458 | Void setNumRowsMinus1( Int i ) { m_iNumRowsMinus1 = i; } |
---|
1459 | Int getNumRowsMinus1() { return m_iNumRowsMinus1; } |
---|
1460 | Void setRowHeight ( UInt* rowHeight ) |
---|
1461 | { |
---|
1462 | if( m_uniformSpacingFlag == 0 && m_iNumRowsMinus1 > 0 ) |
---|
1463 | { |
---|
1464 | m_puiRowHeight = new UInt[ m_iNumRowsMinus1 ]; |
---|
1465 | |
---|
1466 | for(Int i=0; i<m_iNumRowsMinus1; i++) |
---|
1467 | { |
---|
1468 | m_puiRowHeight[i] = rowHeight[i]; |
---|
1469 | } |
---|
1470 | } |
---|
1471 | } |
---|
1472 | UInt getRowHeight (UInt rowIdx) { return *( m_puiRowHeight + rowIdx ); } |
---|
1473 | Void setNumSubstreams(Int iNumSubstreams) { m_iNumSubstreams = iNumSubstreams; } |
---|
1474 | Int getNumSubstreams() { return m_iNumSubstreams; } |
---|
1475 | |
---|
1476 | Void setSignHideFlag( Int signHideFlag ) { m_signHideFlag = signHideFlag; } |
---|
1477 | Int getSignHideFlag() { return m_signHideFlag; } |
---|
1478 | |
---|
1479 | Void setCabacInitPresentFlag( Bool flag ) { m_cabacInitPresentFlag = flag; } |
---|
1480 | Void setEncCABACTableIdx( Int idx ) { m_encCABACTableIdx = idx; } |
---|
1481 | Bool getCabacInitPresentFlag() { return m_cabacInitPresentFlag; } |
---|
1482 | UInt getEncCABACTableIdx() { return m_encCABACTableIdx; } |
---|
1483 | Void setDeblockingFilterControlPresentFlag( Bool val ) { m_deblockingFilterControlPresentFlag = val; } |
---|
1484 | Bool getDeblockingFilterControlPresentFlag() { return m_deblockingFilterControlPresentFlag; } |
---|
1485 | Void setDeblockingFilterOverrideEnabledFlag( Bool val ) { m_deblockingFilterOverrideEnabledFlag = val; } |
---|
1486 | Bool getDeblockingFilterOverrideEnabledFlag() { return m_deblockingFilterOverrideEnabledFlag; } |
---|
1487 | Void setPicDisableDeblockingFilterFlag(Bool val) { m_picDisableDeblockingFilterFlag = val; } //!< set offset for deblocking filter disabled |
---|
1488 | Bool getPicDisableDeblockingFilterFlag() { return m_picDisableDeblockingFilterFlag; } //!< get offset for deblocking filter disabled |
---|
1489 | Void setDeblockingFilterBetaOffsetDiv2(Int val) { m_deblockingFilterBetaOffsetDiv2 = val; } //!< set beta offset for deblocking filter |
---|
1490 | Int getDeblockingFilterBetaOffsetDiv2() { return m_deblockingFilterBetaOffsetDiv2; } //!< get beta offset for deblocking filter |
---|
1491 | Void setDeblockingFilterTcOffsetDiv2(Int val) { m_deblockingFilterTcOffsetDiv2 = val; } //!< set tc offset for deblocking filter |
---|
1492 | Int getDeblockingFilterTcOffsetDiv2() { return m_deblockingFilterTcOffsetDiv2; } //!< get tc offset for deblocking filter |
---|
1493 | Bool getScalingListPresentFlag() { return m_scalingListPresentFlag; } |
---|
1494 | Void setScalingListPresentFlag( Bool b ) { m_scalingListPresentFlag = b; } |
---|
1495 | Void setScalingList ( TComScalingList *scalingList); |
---|
1496 | TComScalingList* getScalingList () { return m_scalingList; } //!< get ScalingList class pointer in PPS |
---|
1497 | Bool getListsModificationPresentFlag () { return m_listsModificationPresentFlag; } |
---|
1498 | Void setListsModificationPresentFlag ( Bool b ) { m_listsModificationPresentFlag = b; } |
---|
1499 | UInt getLog2ParallelMergeLevelMinus2 () { return m_log2ParallelMergeLevelMinus2; } |
---|
1500 | Void setLog2ParallelMergeLevelMinus2 (UInt mrgLevel) { m_log2ParallelMergeLevelMinus2 = mrgLevel; } |
---|
1501 | Int getNumExtraSliceHeaderBits() { return m_numExtraSliceHeaderBits; } |
---|
1502 | Void setNumExtraSliceHeaderBits(Int i) { m_numExtraSliceHeaderBits = i; } |
---|
1503 | Void setLoopFilterAcrossSlicesEnabledFlag ( Bool bValue ) { m_loopFilterAcrossSlicesEnabledFlag = bValue; } |
---|
1504 | Bool getLoopFilterAcrossSlicesEnabledFlag () { return m_loopFilterAcrossSlicesEnabledFlag; } |
---|
1505 | Bool getSliceHeaderExtensionPresentFlag () { return m_sliceHeaderExtensionPresentFlag; } |
---|
1506 | Void setSliceHeaderExtensionPresentFlag (Bool val) { m_sliceHeaderExtensionPresentFlag = val; } |
---|
1507 | }; |
---|
1508 | |
---|
1509 | typedef struct |
---|
1510 | { |
---|
1511 | // Explicit weighted prediction parameters parsed in slice header, |
---|
1512 | // or Implicit weighted prediction parameters (8 bits depth values). |
---|
1513 | Bool bPresentFlag; |
---|
1514 | UInt uiLog2WeightDenom; |
---|
1515 | Int iWeight; |
---|
1516 | Int iOffset; |
---|
1517 | |
---|
1518 | // Weighted prediction scaling values built from above parameters (bitdepth scaled): |
---|
1519 | Int w, o, offset, shift, round; |
---|
1520 | } wpScalingParam; |
---|
1521 | |
---|
1522 | typedef struct |
---|
1523 | { |
---|
1524 | Int64 iAC; |
---|
1525 | Int64 iDC; |
---|
1526 | } wpACDCParam; |
---|
1527 | |
---|
1528 | /// slice header class |
---|
1529 | class TComSlice |
---|
1530 | { |
---|
1531 | |
---|
1532 | private: |
---|
1533 | // Bitstream writing |
---|
1534 | Bool m_saoEnabledFlag; |
---|
1535 | Bool m_saoEnabledFlagChroma; ///< SAO Cb&Cr enabled flag |
---|
1536 | Int m_iPPSId; ///< picture parameter set ID |
---|
1537 | Bool m_PicOutputFlag; ///< pic_output_flag |
---|
1538 | Int m_iPOC; |
---|
1539 | Int m_iLastIDR; |
---|
1540 | static Int m_prevPOC; |
---|
1541 | TComReferencePictureSet *m_pcRPS; |
---|
1542 | TComReferencePictureSet m_LocalRPS; |
---|
1543 | Int m_iBDidx; |
---|
1544 | TComRefPicListModification m_RefPicListModification; |
---|
1545 | NalUnitType m_eNalUnitType; ///< Nal unit type for the slice |
---|
1546 | SliceType m_eSliceType; |
---|
1547 | Int m_iSliceQp; |
---|
1548 | Bool m_dependentSliceSegmentFlag; |
---|
1549 | #if ADAPTIVE_QP_SELECTION |
---|
1550 | Int m_iSliceQpBase; |
---|
1551 | #endif |
---|
1552 | Bool m_deblockingFilterDisable; |
---|
1553 | Bool m_deblockingFilterOverrideFlag; //< offsets for deblocking filter inherit from PPS |
---|
1554 | Int m_deblockingFilterBetaOffsetDiv2; //< beta offset for deblocking filter |
---|
1555 | Int m_deblockingFilterTcOffsetDiv2; //< tc offset for deblocking filter |
---|
1556 | #if L0034_COMBINED_LIST_CLEANUP |
---|
1557 | Int m_list1IdxToList0Idx[MAX_NUM_REF]; |
---|
1558 | Int m_aiNumRefIdx [2]; // for multiple reference of current slice |
---|
1559 | #else |
---|
1560 | Int m_aiNumRefIdx [3]; // for multiple reference of current slice |
---|
1561 | |
---|
1562 | Int m_iRefIdxOfLC[2][MAX_NUM_REF_LC]; |
---|
1563 | Int m_eListIdFromIdxOfLC[MAX_NUM_REF_LC]; |
---|
1564 | Int m_iRefIdxFromIdxOfLC[MAX_NUM_REF_LC]; |
---|
1565 | Int m_iRefIdxOfL1FromRefIdxOfL0[MAX_NUM_REF_LC]; |
---|
1566 | Int m_iRefIdxOfL0FromRefIdxOfL1[MAX_NUM_REF_LC]; |
---|
1567 | Bool m_bRefPicListModificationFlagLC; |
---|
1568 | Bool m_bRefPicListCombinationFlag; |
---|
1569 | #endif |
---|
1570 | |
---|
1571 | Bool m_bCheckLDC; |
---|
1572 | |
---|
1573 | // Data |
---|
1574 | Int m_iSliceQpDelta; |
---|
1575 | Int m_iSliceQpDeltaCb; |
---|
1576 | Int m_iSliceQpDeltaCr; |
---|
1577 | TComPic* m_apcRefPicList [2][MAX_NUM_REF+1]; |
---|
1578 | Int m_aiRefPOCList [2][MAX_NUM_REF+1]; |
---|
1579 | #if H_MV |
---|
1580 | Int m_aiRefLayerIdList[2][MAX_NUM_REF+1]; |
---|
1581 | #endif |
---|
1582 | Bool m_bIsUsedAsLongTerm[2][MAX_NUM_REF+1]; |
---|
1583 | Int m_iDepth; |
---|
1584 | |
---|
1585 | // referenced slice? |
---|
1586 | Bool m_bRefenced; |
---|
1587 | |
---|
1588 | // access channel |
---|
1589 | TComVPS* m_pcVPS; |
---|
1590 | TComSPS* m_pcSPS; |
---|
1591 | TComPPS* m_pcPPS; |
---|
1592 | TComPic* m_pcPic; |
---|
1593 | #if ADAPTIVE_QP_SELECTION |
---|
1594 | TComTrQuant* m_pcTrQuant; |
---|
1595 | #endif |
---|
1596 | UInt m_colFromL0Flag; // collocated picture from List0 flag |
---|
1597 | |
---|
1598 | UInt m_colRefIdx; |
---|
1599 | UInt m_maxNumMergeCand; |
---|
1600 | |
---|
1601 | |
---|
1602 | #if SAO_CHROMA_LAMBDA |
---|
1603 | Double m_dLambdaLuma; |
---|
1604 | Double m_dLambdaChroma; |
---|
1605 | #else |
---|
1606 | Double m_dLambda; |
---|
1607 | #endif |
---|
1608 | |
---|
1609 | Bool m_abEqualRef [2][MAX_NUM_REF][MAX_NUM_REF]; |
---|
1610 | #if !L0034_COMBINED_LIST_CLEANUP |
---|
1611 | Bool m_bNoBackPredFlag; |
---|
1612 | #endif |
---|
1613 | UInt m_uiTLayer; |
---|
1614 | Bool m_bTLayerSwitchingFlag; |
---|
1615 | |
---|
1616 | UInt m_sliceMode; |
---|
1617 | UInt m_sliceArgument; |
---|
1618 | UInt m_sliceCurStartCUAddr; |
---|
1619 | UInt m_sliceCurEndCUAddr; |
---|
1620 | UInt m_sliceIdx; |
---|
1621 | UInt m_sliceSegmentMode; |
---|
1622 | UInt m_sliceSegmentArgument; |
---|
1623 | UInt m_sliceSegmentCurStartCUAddr; |
---|
1624 | UInt m_sliceSegmentCurEndCUAddr; |
---|
1625 | Bool m_nextSlice; |
---|
1626 | Bool m_nextSliceSegment; |
---|
1627 | UInt m_sliceBits; |
---|
1628 | UInt m_sliceSegmentBits; |
---|
1629 | Bool m_bFinalized; |
---|
1630 | |
---|
1631 | wpScalingParam m_weightPredTable[2][MAX_NUM_REF][3]; // [REF_PIC_LIST_0 or REF_PIC_LIST_1][refIdx][0:Y, 1:U, 2:V] |
---|
1632 | wpACDCParam m_weightACDCParam[3]; // [0:Y, 1:U, 2:V] |
---|
1633 | |
---|
1634 | std::vector<UInt> m_tileByteLocation; |
---|
1635 | UInt m_uiTileOffstForMultES; |
---|
1636 | |
---|
1637 | UInt* m_puiSubstreamSizes; |
---|
1638 | TComScalingList* m_scalingList; //!< pointer of quantization matrix |
---|
1639 | Bool m_cabacInitFlag; |
---|
1640 | |
---|
1641 | Bool m_bLMvdL1Zero; |
---|
1642 | Int m_numEntryPointOffsets; |
---|
1643 | Bool m_temporalLayerNonReferenceFlag; |
---|
1644 | Bool m_LFCrossSliceBoundaryFlag; |
---|
1645 | |
---|
1646 | Bool m_enableTMVPFlag; |
---|
1647 | #if H_MV |
---|
1648 | std::vector<TComPic*>* m_refPicSetInterLayer; |
---|
1649 | Int m_layerId; |
---|
1650 | Int m_viewId; |
---|
1651 | #if H_3D |
---|
1652 | Int m_viewIndex; |
---|
1653 | Bool m_isDepth; |
---|
1654 | Int m_aaiCodedScale [2][MAX_NUM_LAYERS]; |
---|
1655 | Int m_aaiCodedOffset[2][MAX_NUM_LAYERS]; |
---|
1656 | #if H_3D_TMVP |
---|
1657 | Int m_aiAlterRefIdx [2]; |
---|
1658 | #endif |
---|
1659 | #if H_3D_ARP |
---|
1660 | TComList<TComPic*> * m_pBaseViewRefPicList[MAX_NUM_LAYERS]; |
---|
1661 | UInt m_nARPStepNum; |
---|
1662 | #endif |
---|
1663 | #if H_3D_IC |
---|
1664 | Bool m_bApplyIC; |
---|
1665 | Bool m_icSkipParseFlag; |
---|
1666 | #endif |
---|
1667 | |
---|
1668 | #if H_3D_GEN |
---|
1669 | TComPic* m_ivPicsCurrPoc [2][MAX_NUM_LAYERS]; |
---|
1670 | Int** m_depthToDisparityB; |
---|
1671 | Int** m_depthToDisparityF; |
---|
1672 | #endif |
---|
1673 | #endif |
---|
1674 | #endif |
---|
1675 | #if H_MV |
---|
1676 | // Additional slice header syntax elements |
---|
1677 | Bool m_discardableFlag; |
---|
1678 | Bool m_interLayerPredEnabledFlag; |
---|
1679 | Int m_numInterLayerRefPicsMinus1; |
---|
1680 | Int m_interLayerPredLayerIdc [MAX_NUM_LAYERS]; |
---|
1681 | Bool m_interLayerSamplePredOnlyFlag; |
---|
1682 | Bool m_altCollocatedIndicationFlag; |
---|
1683 | Int m_collocatedRefLayerIdx; |
---|
1684 | // Additional slice header semantics variables |
---|
1685 | Int m_numActiveMotionPredRefLayers; |
---|
1686 | Int m_activeMotionPredRefLayerId [ MAX_NUM_LAYER_IDS ]; |
---|
1687 | |
---|
1688 | #endif |
---|
1689 | |
---|
1690 | public: |
---|
1691 | TComSlice(); |
---|
1692 | virtual ~TComSlice(); |
---|
1693 | Void initSlice (); |
---|
1694 | |
---|
1695 | Void setVPS ( TComVPS* pcVPS ) { m_pcVPS = pcVPS; } |
---|
1696 | TComVPS* getVPS () { return m_pcVPS; } |
---|
1697 | Void setSPS ( TComSPS* pcSPS ) { m_pcSPS = pcSPS; } |
---|
1698 | TComSPS* getSPS () { return m_pcSPS; } |
---|
1699 | |
---|
1700 | Void setPPS ( TComPPS* pcPPS ) { assert(pcPPS!=NULL); m_pcPPS = pcPPS; m_iPPSId = pcPPS->getPPSId(); } |
---|
1701 | TComPPS* getPPS () { return m_pcPPS; } |
---|
1702 | |
---|
1703 | #if ADAPTIVE_QP_SELECTION |
---|
1704 | Void setTrQuant ( TComTrQuant* pcTrQuant ) { m_pcTrQuant = pcTrQuant; } |
---|
1705 | TComTrQuant* getTrQuant () { return m_pcTrQuant; } |
---|
1706 | #endif |
---|
1707 | |
---|
1708 | Void setPPSId ( Int PPSId ) { m_iPPSId = PPSId; } |
---|
1709 | Int getPPSId () { return m_iPPSId; } |
---|
1710 | Void setPicOutputFlag( Bool b ) { m_PicOutputFlag = b; } |
---|
1711 | Bool getPicOutputFlag() { return m_PicOutputFlag; } |
---|
1712 | Void setSaoEnabledFlag(Bool s) {m_saoEnabledFlag =s; } |
---|
1713 | Bool getSaoEnabledFlag() { return m_saoEnabledFlag; } |
---|
1714 | Void setSaoEnabledFlagChroma(Bool s) {m_saoEnabledFlagChroma =s; } //!< set SAO Cb&Cr enabled flag |
---|
1715 | Bool getSaoEnabledFlagChroma() { return m_saoEnabledFlagChroma; } //!< get SAO Cb&Cr enabled flag |
---|
1716 | Void setRPS ( TComReferencePictureSet *pcRPS ) { m_pcRPS = pcRPS; } |
---|
1717 | TComReferencePictureSet* getRPS () { return m_pcRPS; } |
---|
1718 | TComReferencePictureSet* getLocalRPS () { return &m_LocalRPS; } |
---|
1719 | |
---|
1720 | Void setRPSidx ( Int iBDidx ) { m_iBDidx = iBDidx; } |
---|
1721 | Int getRPSidx () { return m_iBDidx; } |
---|
1722 | Int getPrevPOC () { return m_prevPOC; } |
---|
1723 | TComRefPicListModification* getRefPicListModification() { return &m_RefPicListModification; } |
---|
1724 | Void setLastIDR(Int iIDRPOC) { m_iLastIDR = iIDRPOC; } |
---|
1725 | Int getLastIDR() { return m_iLastIDR; } |
---|
1726 | SliceType getSliceType () { return m_eSliceType; } |
---|
1727 | Int getPOC () { return m_iPOC; } |
---|
1728 | Int getSliceQp () { return m_iSliceQp; } |
---|
1729 | Bool getDependentSliceSegmentFlag() const { return m_dependentSliceSegmentFlag; } |
---|
1730 | void setDependentSliceSegmentFlag(Bool val) { m_dependentSliceSegmentFlag = val; } |
---|
1731 | #if ADAPTIVE_QP_SELECTION |
---|
1732 | Int getSliceQpBase () { return m_iSliceQpBase; } |
---|
1733 | #endif |
---|
1734 | Int getSliceQpDelta () { return m_iSliceQpDelta; } |
---|
1735 | Int getSliceQpDeltaCb () { return m_iSliceQpDeltaCb; } |
---|
1736 | Int getSliceQpDeltaCr () { return m_iSliceQpDeltaCr; } |
---|
1737 | Bool getDeblockingFilterDisable() { return m_deblockingFilterDisable; } |
---|
1738 | Bool getDeblockingFilterOverrideFlag() { return m_deblockingFilterOverrideFlag; } |
---|
1739 | Int getDeblockingFilterBetaOffsetDiv2() { return m_deblockingFilterBetaOffsetDiv2; } |
---|
1740 | Int getDeblockingFilterTcOffsetDiv2() { return m_deblockingFilterTcOffsetDiv2; } |
---|
1741 | |
---|
1742 | Int getNumRefIdx ( RefPicList e ) { return m_aiNumRefIdx[e]; } |
---|
1743 | TComPic* getPic () { return m_pcPic; } |
---|
1744 | TComPic* getRefPic ( RefPicList e, Int iRefIdx) { return m_apcRefPicList[e][iRefIdx]; } |
---|
1745 | Int getRefPOC ( RefPicList e, Int iRefIdx) { return m_aiRefPOCList[e][iRefIdx]; } |
---|
1746 | #if H_3D_GEN |
---|
1747 | TComPic* getIvPic ( Bool depthFlag, Int viewIndex){ return m_ivPicsCurrPoc[ depthFlag ? 1 : 0 ][ viewIndex ]; } |
---|
1748 | #endif |
---|
1749 | #if H_3D_IV_MERGE |
---|
1750 | TComPic* getTexturePic () { return m_ivPicsCurrPoc[0][ m_viewIndex ]; } |
---|
1751 | #endif |
---|
1752 | #if H_3D_IC |
---|
1753 | Void setApplyIC( Bool b ) { m_bApplyIC = b; } |
---|
1754 | Bool getApplyIC() { return m_bApplyIC; } |
---|
1755 | Void xSetApplyIC(); |
---|
1756 | Void setIcSkipParseFlag( Bool b ) { m_icSkipParseFlag = b; } |
---|
1757 | Bool getIcSkipParseFlag() { return m_icSkipParseFlag; } |
---|
1758 | #endif |
---|
1759 | #if H_3D_ARP |
---|
1760 | Void setBaseViewRefPicList( TComList<TComPic*> *pListPic, Int iViewIdx ) { m_pBaseViewRefPicList[iViewIdx] = pListPic; } |
---|
1761 | Void setARPStepNum(); |
---|
1762 | TComPic* getBaseViewRefPic ( UInt uiPOC , Int iViewIdx ) { return xGetRefPic( *m_pBaseViewRefPicList[iViewIdx], uiPOC ); } |
---|
1763 | UInt getARPStepNum( ) { return m_nARPStepNum; } |
---|
1764 | #endif |
---|
1765 | |
---|
1766 | Int getDepth () { return m_iDepth; } |
---|
1767 | UInt getColFromL0Flag () { return m_colFromL0Flag; } |
---|
1768 | UInt getColRefIdx () { return m_colRefIdx; } |
---|
1769 | Void checkColRefIdx (UInt curSliceIdx, TComPic* pic); |
---|
1770 | Bool getIsUsedAsLongTerm (Int i, Int j) { return m_bIsUsedAsLongTerm[i][j]; } |
---|
1771 | Bool getCheckLDC () { return m_bCheckLDC; } |
---|
1772 | Bool getMvdL1ZeroFlag () { return m_bLMvdL1Zero; } |
---|
1773 | #if H_MV && !H_MV_FIX1071 // This is a temporary fix of the temporary fix L0177 |
---|
1774 | Int getNumRpsCurrTempList( TComReferencePictureSet* rps = NULL ); |
---|
1775 | #else |
---|
1776 | Int getNumRpsCurrTempList(); |
---|
1777 | #endif |
---|
1778 | #if L0034_COMBINED_LIST_CLEANUP |
---|
1779 | Int getList1IdxToList0Idx ( Int list1Idx ) { return m_list1IdxToList0Idx[list1Idx]; } |
---|
1780 | #else |
---|
1781 | Int getRefIdxOfLC (RefPicList e, Int iRefIdx) { return m_iRefIdxOfLC[e][iRefIdx]; } |
---|
1782 | Int getListIdFromIdxOfLC(Int iRefIdx) { return m_eListIdFromIdxOfLC[iRefIdx]; } |
---|
1783 | Int getRefIdxFromIdxOfLC(Int iRefIdx) { return m_iRefIdxFromIdxOfLC[iRefIdx]; } |
---|
1784 | Int getRefIdxOfL0FromRefIdxOfL1(Int iRefIdx) { return m_iRefIdxOfL0FromRefIdxOfL1[iRefIdx];} |
---|
1785 | Int getRefIdxOfL1FromRefIdxOfL0(Int iRefIdx) { return m_iRefIdxOfL1FromRefIdxOfL0[iRefIdx];} |
---|
1786 | Bool getRefPicListModificationFlagLC() {return m_bRefPicListModificationFlagLC;} |
---|
1787 | Void setRefPicListModificationFlagLC(Bool bflag) {m_bRefPicListModificationFlagLC=bflag;} |
---|
1788 | Bool getRefPicListCombinationFlag() {return m_bRefPicListCombinationFlag;} |
---|
1789 | Void setRefPicListCombinationFlag(Bool bflag) {m_bRefPicListCombinationFlag=bflag;} |
---|
1790 | #endif |
---|
1791 | Void setReferenced(Bool b) { m_bRefenced = b; } |
---|
1792 | Bool isReferenced() { return m_bRefenced; } |
---|
1793 | Void setPOC ( Int i ) { m_iPOC = i; if(getTLayer()==0) m_prevPOC=i; } |
---|
1794 | Void setNalUnitType ( NalUnitType e ) { m_eNalUnitType = e; } |
---|
1795 | NalUnitType getNalUnitType () const { return m_eNalUnitType; } |
---|
1796 | Bool getRapPicFlag (); |
---|
1797 | Bool getIdrPicFlag () { return getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP; } |
---|
1798 | Bool isIRAP () const { return (getNalUnitType() >= 16) && (getNalUnitType() <= 23); } |
---|
1799 | Void checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, Bool& prevRAPisBLA, TComList<TComPic *>& rcListPic); |
---|
1800 | Void decodingRefreshMarking(Int& pocCRA, Bool& bRefreshPending, TComList<TComPic*>& rcListPic); |
---|
1801 | Void setSliceType ( SliceType e ) { m_eSliceType = e; } |
---|
1802 | Void setSliceQp ( Int i ) { m_iSliceQp = i; } |
---|
1803 | #if ADAPTIVE_QP_SELECTION |
---|
1804 | Void setSliceQpBase ( Int i ) { m_iSliceQpBase = i; } |
---|
1805 | #endif |
---|
1806 | Void setSliceQpDelta ( Int i ) { m_iSliceQpDelta = i; } |
---|
1807 | Void setSliceQpDeltaCb ( Int i ) { m_iSliceQpDeltaCb = i; } |
---|
1808 | Void setSliceQpDeltaCr ( Int i ) { m_iSliceQpDeltaCr = i; } |
---|
1809 | Void setDeblockingFilterDisable( Bool b ) { m_deblockingFilterDisable= b; } |
---|
1810 | Void setDeblockingFilterOverrideFlag( Bool b ) { m_deblockingFilterOverrideFlag = b; } |
---|
1811 | Void setDeblockingFilterBetaOffsetDiv2( Int i ) { m_deblockingFilterBetaOffsetDiv2 = i; } |
---|
1812 | Void setDeblockingFilterTcOffsetDiv2( Int i ) { m_deblockingFilterTcOffsetDiv2 = i; } |
---|
1813 | |
---|
1814 | Void setRefPic ( TComPic* p, RefPicList e, Int iRefIdx ) { m_apcRefPicList[e][iRefIdx] = p; } |
---|
1815 | Void setRefPOC ( Int i, RefPicList e, Int iRefIdx ) { m_aiRefPOCList[e][iRefIdx] = i; } |
---|
1816 | Void setNumRefIdx ( RefPicList e, Int i ) { m_aiNumRefIdx[e] = i; } |
---|
1817 | Void setPic ( TComPic* p ) { m_pcPic = p; } |
---|
1818 | Void setDepth ( Int iDepth ) { m_iDepth = iDepth; } |
---|
1819 | |
---|
1820 | #if H_MV |
---|
1821 | Int getRefLayerId ( RefPicList e, Int iRefIdx) { return m_aiRefLayerIdList[e][iRefIdx]; } |
---|
1822 | Void setRefLayerId ( Int i, RefPicList e, Int iRefIdx ) { m_aiRefLayerIdList[e][iRefIdx] = i; } |
---|
1823 | #endif |
---|
1824 | #if H_MV |
---|
1825 | Void setRefPicList ( TComList<TComPic*>& rcListPic, std::vector<TComPic*>& interLayerRefPicSet , Bool checkNumPocTotalCurr = false ); |
---|
1826 | #else |
---|
1827 | #if FIX1071 |
---|
1828 | Void setRefPicList ( TComList<TComPic*>& rcListPic, Bool checkNumPocTotalCurr = false ); |
---|
1829 | #else |
---|
1830 | Void setRefPicList ( TComList<TComPic*>& rcListPic ); |
---|
1831 | #endif |
---|
1832 | #endif |
---|
1833 | Void setRefPOCList (); |
---|
1834 | Void setColFromL0Flag ( UInt colFromL0 ) { m_colFromL0Flag = colFromL0; } |
---|
1835 | Void setColRefIdx ( UInt refIdx) { m_colRefIdx = refIdx; } |
---|
1836 | Void setCheckLDC ( Bool b ) { m_bCheckLDC = b; } |
---|
1837 | Void setMvdL1ZeroFlag ( Bool b) { m_bLMvdL1Zero = b; } |
---|
1838 | |
---|
1839 | Bool isIntra () { return m_eSliceType == I_SLICE; } |
---|
1840 | Bool isInterB () { return m_eSliceType == B_SLICE; } |
---|
1841 | Bool isInterP () { return m_eSliceType == P_SLICE; } |
---|
1842 | |
---|
1843 | #if SAO_CHROMA_LAMBDA |
---|
1844 | Void setLambda( Double d, Double e ) { m_dLambdaLuma = d; m_dLambdaChroma = e;} |
---|
1845 | Double getLambdaLuma() { return m_dLambdaLuma; } |
---|
1846 | Double getLambdaChroma() { return m_dLambdaChroma; } |
---|
1847 | #else |
---|
1848 | Void setLambda( Double d ) { m_dLambda = d; } |
---|
1849 | Double getLambda() { return m_dLambda; } |
---|
1850 | #endif |
---|
1851 | |
---|
1852 | Void initEqualRef(); |
---|
1853 | Bool isEqualRef ( RefPicList e, Int iRefIdx1, Int iRefIdx2 ) |
---|
1854 | { |
---|
1855 | if (iRefIdx1 < 0 || iRefIdx2 < 0) return false; |
---|
1856 | return m_abEqualRef[e][iRefIdx1][iRefIdx2]; |
---|
1857 | } |
---|
1858 | |
---|
1859 | Void setEqualRef( RefPicList e, Int iRefIdx1, Int iRefIdx2, Bool b) |
---|
1860 | { |
---|
1861 | m_abEqualRef[e][iRefIdx1][iRefIdx2] = m_abEqualRef[e][iRefIdx2][iRefIdx1] = b; |
---|
1862 | } |
---|
1863 | |
---|
1864 | static Void sortPicList ( TComList<TComPic*>& rcListPic ); |
---|
1865 | #if L0034_COMBINED_LIST_CLEANUP |
---|
1866 | Void setList1IdxToList0Idx(); |
---|
1867 | #else |
---|
1868 | Bool getNoBackPredFlag() { return m_bNoBackPredFlag; } |
---|
1869 | Void setNoBackPredFlag( Bool b ) { m_bNoBackPredFlag = b; } |
---|
1870 | Void generateCombinedList (); |
---|
1871 | #endif |
---|
1872 | |
---|
1873 | UInt getTLayer () { return m_uiTLayer; } |
---|
1874 | Void setTLayer ( UInt uiTLayer ) { m_uiTLayer = uiTLayer; } |
---|
1875 | |
---|
1876 | Void setTLayerInfo( UInt uiTLayer ); |
---|
1877 | Void decodingMarking( TComList<TComPic*>& rcListPic, Int iGOPSIze, Int& iMaxRefPicNum ); |
---|
1878 | Void applyReferencePictureSet( TComList<TComPic*>& rcListPic, TComReferencePictureSet *RPSList); |
---|
1879 | #if H_MV |
---|
1880 | Void createAndApplyIvReferencePictureSet( TComPicLists* ivPicLists, std::vector<TComPic*>& refPicSetInterLayer ); |
---|
1881 | static Void markIvRefPicsAsShortTerm ( std::vector<TComPic*> refPicSetInterLayer ); |
---|
1882 | static Void markCurrPic ( TComPic* currPic );; |
---|
1883 | static Void markIvRefPicsAsUnused ( TComPicLists* ivPicLists, std::vector<Int> targetDecLayerIdSet, TComVPS* vps, Int curLayerId, Int curPoc ); |
---|
1884 | |
---|
1885 | |
---|
1886 | Void xPrintRefPicList(); |
---|
1887 | #endif |
---|
1888 | Bool isTemporalLayerSwitchingPoint( TComList<TComPic*>& rcListPic ); |
---|
1889 | Bool isStepwiseTemporalLayerSwitchingPointCandidate( TComList<TComPic*>& rcListPic ); |
---|
1890 | Int checkThatAllRefPicsAreAvailable( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool printErrors, Int pocRandomAccess = 0); |
---|
1891 | #if FIX1071 && H_MV_FIX1071 |
---|
1892 | Void createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool isRAP); |
---|
1893 | #else |
---|
1894 | Void createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet); |
---|
1895 | #endif |
---|
1896 | |
---|
1897 | Void setMaxNumMergeCand (UInt val ) { m_maxNumMergeCand = val; } |
---|
1898 | UInt getMaxNumMergeCand () { return m_maxNumMergeCand; } |
---|
1899 | |
---|
1900 | Void setSliceMode ( UInt uiMode ) { m_sliceMode = uiMode; } |
---|
1901 | UInt getSliceMode () { return m_sliceMode; } |
---|
1902 | Void setSliceArgument ( UInt uiArgument ) { m_sliceArgument = uiArgument; } |
---|
1903 | UInt getSliceArgument () { return m_sliceArgument; } |
---|
1904 | Void setSliceCurStartCUAddr ( UInt uiAddr ) { m_sliceCurStartCUAddr = uiAddr; } |
---|
1905 | UInt getSliceCurStartCUAddr () { return m_sliceCurStartCUAddr; } |
---|
1906 | Void setSliceCurEndCUAddr ( UInt uiAddr ) { m_sliceCurEndCUAddr = uiAddr; } |
---|
1907 | UInt getSliceCurEndCUAddr () { return m_sliceCurEndCUAddr; } |
---|
1908 | Void setSliceIdx ( UInt i) { m_sliceIdx = i; } |
---|
1909 | UInt getSliceIdx () { return m_sliceIdx; } |
---|
1910 | Void copySliceInfo (TComSlice *pcSliceSrc); |
---|
1911 | Void setSliceSegmentMode ( UInt uiMode ) { m_sliceSegmentMode = uiMode; } |
---|
1912 | UInt getSliceSegmentMode () { return m_sliceSegmentMode; } |
---|
1913 | Void setSliceSegmentArgument ( UInt uiArgument ) { m_sliceSegmentArgument = uiArgument; } |
---|
1914 | UInt getSliceSegmentArgument () { return m_sliceSegmentArgument; } |
---|
1915 | Void setSliceSegmentCurStartCUAddr ( UInt uiAddr ) { m_sliceSegmentCurStartCUAddr = uiAddr; } |
---|
1916 | UInt getSliceSegmentCurStartCUAddr () { return m_sliceSegmentCurStartCUAddr; } |
---|
1917 | Void setSliceSegmentCurEndCUAddr ( UInt uiAddr ) { m_sliceSegmentCurEndCUAddr = uiAddr; } |
---|
1918 | UInt getSliceSegmentCurEndCUAddr () { return m_sliceSegmentCurEndCUAddr; } |
---|
1919 | Void setNextSlice ( Bool b ) { m_nextSlice = b; } |
---|
1920 | Bool isNextSlice () { return m_nextSlice; } |
---|
1921 | Void setNextSliceSegment ( Bool b ) { m_nextSliceSegment = b; } |
---|
1922 | Bool isNextSliceSegment () { return m_nextSliceSegment; } |
---|
1923 | Void setSliceBits ( UInt uiVal ) { m_sliceBits = uiVal; } |
---|
1924 | UInt getSliceBits () { return m_sliceBits; } |
---|
1925 | Void setSliceSegmentBits ( UInt uiVal ) { m_sliceSegmentBits = uiVal; } |
---|
1926 | UInt getSliceSegmentBits () { return m_sliceSegmentBits; } |
---|
1927 | Void setFinalized ( Bool uiVal ) { m_bFinalized = uiVal; } |
---|
1928 | Bool getFinalized () { return m_bFinalized; } |
---|
1929 | Void setWpScaling ( wpScalingParam wp[2][MAX_NUM_REF][3] ) { memcpy(m_weightPredTable, wp, sizeof(wpScalingParam)*2*MAX_NUM_REF*3); } |
---|
1930 | Void getWpScaling ( RefPicList e, Int iRefIdx, wpScalingParam *&wp); |
---|
1931 | |
---|
1932 | Void resetWpScaling (); |
---|
1933 | Void initWpScaling (); |
---|
1934 | inline Bool applyWP () { return( (m_eSliceType==P_SLICE && m_pcPPS->getUseWP()) || (m_eSliceType==B_SLICE && m_pcPPS->getWPBiPred()) ); } |
---|
1935 | |
---|
1936 | Void setWpAcDcParam ( wpACDCParam wp[3] ) { memcpy(m_weightACDCParam, wp, sizeof(wpACDCParam)*3); } |
---|
1937 | Void getWpAcDcParam ( wpACDCParam *&wp ); |
---|
1938 | Void initWpAcDcParam (); |
---|
1939 | |
---|
1940 | Void setTileLocationCount ( UInt cnt ) { return m_tileByteLocation.resize(cnt); } |
---|
1941 | UInt getTileLocationCount () { return (UInt) m_tileByteLocation.size(); } |
---|
1942 | Void setTileLocation ( Int idx, UInt location ) { assert (idx<m_tileByteLocation.size()); |
---|
1943 | m_tileByteLocation[idx] = location; } |
---|
1944 | Void addTileLocation ( UInt location ) { m_tileByteLocation.push_back(location); } |
---|
1945 | UInt getTileLocation ( Int idx ) { return m_tileByteLocation[idx]; } |
---|
1946 | |
---|
1947 | Void setTileOffstForMultES (UInt uiOffset ) { m_uiTileOffstForMultES = uiOffset; } |
---|
1948 | UInt getTileOffstForMultES () { return m_uiTileOffstForMultES; } |
---|
1949 | Void allocSubstreamSizes ( UInt uiNumSubstreams ); |
---|
1950 | UInt* getSubstreamSizes () { return m_puiSubstreamSizes; } |
---|
1951 | Void setScalingList ( TComScalingList* scalingList ) { m_scalingList = scalingList; } |
---|
1952 | TComScalingList* getScalingList () { return m_scalingList; } |
---|
1953 | Void setDefaultScalingList (); |
---|
1954 | Bool checkDefaultScalingList (); |
---|
1955 | Void setCabacInitFlag ( Bool val ) { m_cabacInitFlag = val; } //!< set CABAC initial flag |
---|
1956 | Bool getCabacInitFlag () { return m_cabacInitFlag; } //!< get CABAC initial flag |
---|
1957 | Void setNumEntryPointOffsets(Int val) { m_numEntryPointOffsets = val; } |
---|
1958 | Int getNumEntryPointOffsets() { return m_numEntryPointOffsets; } |
---|
1959 | Bool getTemporalLayerNonReferenceFlag() { return m_temporalLayerNonReferenceFlag;} |
---|
1960 | Void setTemporalLayerNonReferenceFlag(Bool x) { m_temporalLayerNonReferenceFlag = x;} |
---|
1961 | Void setLFCrossSliceBoundaryFlag ( Bool val ) { m_LFCrossSliceBoundaryFlag = val; } |
---|
1962 | Bool getLFCrossSliceBoundaryFlag () { return m_LFCrossSliceBoundaryFlag;} |
---|
1963 | |
---|
1964 | Void setEnableTMVPFlag ( Bool b ) { m_enableTMVPFlag = b; } |
---|
1965 | Bool getEnableTMVPFlag () { return m_enableTMVPFlag;} |
---|
1966 | |
---|
1967 | #if H_MV |
---|
1968 | Void setLayerId ( Int layerId ) { m_layerId = layerId; } |
---|
1969 | Int getLayerId () { return m_layerId; } |
---|
1970 | Int getLayerIdInVps () { return getVPS()->getLayerIdInVps( m_layerId ); }; |
---|
1971 | Void setViewId ( Int viewId ) { m_viewId = viewId; } |
---|
1972 | Int getViewId () { return m_viewId; } |
---|
1973 | #if H_3D |
---|
1974 | #if H_3D_TMVP |
---|
1975 | Void generateAlterRefforTMVP (); |
---|
1976 | Void setAlterRefIdx ( RefPicList e, Int i ) { m_aiAlterRefIdx[e] = i; } |
---|
1977 | Int getAlterRefIdx ( RefPicList e ) { return m_aiAlterRefIdx[e]; } |
---|
1978 | #endif |
---|
1979 | Void setViewIndex ( Int viewIndex ) { m_viewIndex = viewIndex; } |
---|
1980 | Int getViewIndex () { return m_viewIndex; } |
---|
1981 | Void setIsDepth ( Bool isDepth ) { m_isDepth = isDepth; } |
---|
1982 | Bool getIsDepth () { return m_isDepth; } |
---|
1983 | Void setCamparaSlice ( Int** aaiScale = 0, Int** aaiOffset = 0 ); |
---|
1984 | Int* getCodedScale () { return m_aaiCodedScale [0]; } |
---|
1985 | Int* getCodedOffset () { return m_aaiCodedOffset[0]; } |
---|
1986 | Int* getInvCodedScale () { return m_aaiCodedScale [1]; } |
---|
1987 | Int* getInvCodedOffset () { return m_aaiCodedOffset[1]; } |
---|
1988 | #endif |
---|
1989 | #endif |
---|
1990 | #if H_3D_GEN |
---|
1991 | Void setIvPicLists( TComPicLists* m_ivPicLists ); |
---|
1992 | Void setDepthToDisparityLUTs(); |
---|
1993 | |
---|
1994 | Int* getDepthToDisparityB( Int refViewIdx ) { return m_depthToDisparityB[ refViewIdx ]; }; |
---|
1995 | Int* getDepthToDisparityF( Int refViewIdx ) { return m_depthToDisparityF[ refViewIdx ]; }; |
---|
1996 | Bool getVpsDepthModesFlag () { return getVPS()->getVpsDepthModesFlag( getVPS()->getLayerIdInVps( m_layerId ) ); } |
---|
1997 | |
---|
1998 | #endif |
---|
1999 | #if H_MV |
---|
2000 | // Additional slice header syntax elements |
---|
2001 | Void setDiscardableFlag( Bool flag ) { m_discardableFlag = flag; } |
---|
2002 | Bool getDiscardableFlag( ) { return m_discardableFlag; } |
---|
2003 | |
---|
2004 | Void setInterLayerPredEnabledFlag( Bool flag ) { m_interLayerPredEnabledFlag = flag; } |
---|
2005 | Bool getInterLayerPredEnabledFlag( ) { return m_interLayerPredEnabledFlag; } |
---|
2006 | |
---|
2007 | Void setNumInterLayerRefPicsMinus1( Int val ) { m_numInterLayerRefPicsMinus1 = val; } |
---|
2008 | Int getNumInterLayerRefPicsMinus1( ) { return m_numInterLayerRefPicsMinus1; } |
---|
2009 | |
---|
2010 | Void setInterLayerPredLayerIdc( Int i, Int val ) { m_interLayerPredLayerIdc[i] = val; } |
---|
2011 | Int getInterLayerPredLayerIdc( Int i ) { return m_interLayerPredLayerIdc[i]; } |
---|
2012 | |
---|
2013 | Void setInterLayerSamplePredOnlyFlag( Bool flag ) { m_interLayerSamplePredOnlyFlag = flag; } |
---|
2014 | Bool getInterLayerSamplePredOnlyFlag( ) { return m_interLayerSamplePredOnlyFlag; } |
---|
2015 | |
---|
2016 | Void setAltCollocatedIndicationFlag( Bool flag ) { m_altCollocatedIndicationFlag = flag; } |
---|
2017 | Bool getAltCollocatedIndicationFlag( ) { return m_altCollocatedIndicationFlag; } |
---|
2018 | |
---|
2019 | Void setCollocatedRefLayerIdx( Int val ) { m_collocatedRefLayerIdx = val; } |
---|
2020 | Int getCollocatedRefLayerIdx( ) { return m_collocatedRefLayerIdx; } |
---|
2021 | |
---|
2022 | // Additional variables derived in slice header semantics |
---|
2023 | Int getNumInterLayerRefPicsMinus1Len( ) { return xCeilLog2( getVPS()->getNumDirectRefLayers( getLayerIdInVps() )); } |
---|
2024 | Int getInterLayerPredLayerIdcLen ( ) { return xCeilLog2( getVPS()->getNumDirectRefLayers( getLayerIdInVps() )); } |
---|
2025 | |
---|
2026 | Int getNumActiveRefLayerPics( ); |
---|
2027 | Int getRefPicLayerId ( Int i ); |
---|
2028 | |
---|
2029 | Void setActiveMotionPredRefLayers ( ); |
---|
2030 | |
---|
2031 | Int getNumActiveMotionPredRefLayers( ) { return m_numActiveMotionPredRefLayers; } |
---|
2032 | Int getActiveMotionPredRefLayerId ( Int i ) { return m_activeMotionPredRefLayerId[i]; } |
---|
2033 | |
---|
2034 | Bool getInterRefEnabledInRPLFlag( ); |
---|
2035 | |
---|
2036 | Void setRefPicSetInterLayer ( std::vector<TComPic*>* m_refPicSetInterLayer ); |
---|
2037 | TComPic* getPicFromRefPicSetInterLayer( Int layerId ); |
---|
2038 | |
---|
2039 | #endif |
---|
2040 | |
---|
2041 | protected: |
---|
2042 | TComPic* xGetRefPic (TComList<TComPic*>& rcListPic, |
---|
2043 | Int poc); |
---|
2044 | TComPic* xGetLongTermRefPic(TComList<TComPic*>& rcListPic, Int poc, Bool pocHasMsb); |
---|
2045 | #if H_MV |
---|
2046 | Int xCeilLog2( Int val ); |
---|
2047 | TComPic* xGetInterLayerRefPic( std::vector<TComPic*>& rcListIlPic, Int layerId ); |
---|
2048 | #endif |
---|
2049 | };// END CLASS DEFINITION TComSlice |
---|
2050 | |
---|
2051 | |
---|
2052 | template <class T> class ParameterSetMap |
---|
2053 | { |
---|
2054 | public: |
---|
2055 | ParameterSetMap(Int maxId) |
---|
2056 | :m_maxId (maxId) |
---|
2057 | {} |
---|
2058 | |
---|
2059 | ~ParameterSetMap() |
---|
2060 | { |
---|
2061 | for (typename std::map<Int,T *>::iterator i = m_paramsetMap.begin(); i!= m_paramsetMap.end(); i++) |
---|
2062 | { |
---|
2063 | delete (*i).second; |
---|
2064 | } |
---|
2065 | } |
---|
2066 | |
---|
2067 | Void storePS(Int psId, T *ps) |
---|
2068 | { |
---|
2069 | assert ( psId < m_maxId ); |
---|
2070 | if ( m_paramsetMap.find(psId) != m_paramsetMap.end() ) |
---|
2071 | { |
---|
2072 | delete m_paramsetMap[psId]; |
---|
2073 | } |
---|
2074 | m_paramsetMap[psId] = ps; |
---|
2075 | } |
---|
2076 | |
---|
2077 | Void mergePSList(ParameterSetMap<T> &rPsList) |
---|
2078 | { |
---|
2079 | for (typename std::map<Int,T *>::iterator i = rPsList.m_paramsetMap.begin(); i!= rPsList.m_paramsetMap.end(); i++) |
---|
2080 | { |
---|
2081 | storePS(i->first, i->second); |
---|
2082 | } |
---|
2083 | rPsList.m_paramsetMap.clear(); |
---|
2084 | } |
---|
2085 | |
---|
2086 | |
---|
2087 | T* getPS(Int psId) |
---|
2088 | { |
---|
2089 | return ( m_paramsetMap.find(psId) == m_paramsetMap.end() ) ? NULL : m_paramsetMap[psId]; |
---|
2090 | } |
---|
2091 | |
---|
2092 | T* getFirstPS() |
---|
2093 | { |
---|
2094 | return (m_paramsetMap.begin() == m_paramsetMap.end() ) ? NULL : m_paramsetMap.begin()->second; |
---|
2095 | } |
---|
2096 | |
---|
2097 | private: |
---|
2098 | std::map<Int,T *> m_paramsetMap; |
---|
2099 | Int m_maxId; |
---|
2100 | }; |
---|
2101 | |
---|
2102 | class ParameterSetManager |
---|
2103 | { |
---|
2104 | public: |
---|
2105 | ParameterSetManager(); |
---|
2106 | virtual ~ParameterSetManager(); |
---|
2107 | |
---|
2108 | //! store sequence parameter set and take ownership of it |
---|
2109 | Void storeVPS(TComVPS *vps) { m_vpsMap.storePS( vps->getVPSId(), vps); }; |
---|
2110 | //! get pointer to existing video parameter set |
---|
2111 | TComVPS* getVPS(Int vpsId) { return m_vpsMap.getPS(vpsId); }; |
---|
2112 | TComVPS* getFirstVPS() { return m_vpsMap.getFirstPS(); }; |
---|
2113 | |
---|
2114 | //! store sequence parameter set and take ownership of it |
---|
2115 | Void storeSPS(TComSPS *sps) { m_spsMap.storePS( sps->getSPSId(), sps); }; |
---|
2116 | //! get pointer to existing sequence parameter set |
---|
2117 | TComSPS* getSPS(Int spsId) { return m_spsMap.getPS(spsId); }; |
---|
2118 | TComSPS* getFirstSPS() { return m_spsMap.getFirstPS(); }; |
---|
2119 | |
---|
2120 | //! store picture parameter set and take ownership of it |
---|
2121 | Void storePPS(TComPPS *pps) { m_ppsMap.storePS( pps->getPPSId(), pps); }; |
---|
2122 | //! get pointer to existing picture parameter set |
---|
2123 | TComPPS* getPPS(Int ppsId) { return m_ppsMap.getPS(ppsId); }; |
---|
2124 | TComPPS* getFirstPPS() { return m_ppsMap.getFirstPS(); }; |
---|
2125 | |
---|
2126 | //! activate a SPS from a active parameter sets SEI message |
---|
2127 | //! \returns true, if activation is successful |
---|
2128 | Bool activateSPSWithSEI(Int SPSId); |
---|
2129 | |
---|
2130 | //! activate a PPS and depending on isIDR parameter also SPS and VPS |
---|
2131 | //! \returns true, if activation is successful |
---|
2132 | Bool activatePPS(Int ppsId, Bool isIRAP); |
---|
2133 | |
---|
2134 | TComVPS* getActiveVPS(){ return m_vpsMap.getPS(m_activeVPSId); }; |
---|
2135 | TComSPS* getActiveSPS(){ return m_spsMap.getPS(m_activeSPSId); }; |
---|
2136 | TComPPS* getActivePPS(){ return m_ppsMap.getPS(m_activePPSId); }; |
---|
2137 | |
---|
2138 | protected: |
---|
2139 | |
---|
2140 | ParameterSetMap<TComVPS> m_vpsMap; |
---|
2141 | ParameterSetMap<TComSPS> m_spsMap; |
---|
2142 | ParameterSetMap<TComPPS> m_ppsMap; |
---|
2143 | |
---|
2144 | Int m_activeVPSId; |
---|
2145 | Int m_activeSPSId; |
---|
2146 | Int m_activePPSId; |
---|
2147 | }; |
---|
2148 | |
---|
2149 | //! \} |
---|
2150 | |
---|
2151 | #endif // __TCOMSLICE__ |
---|