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