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 | Int* getScalingListAddress (UInt sizeId, UInt listId) { return m_scalingListCoef[sizeId][listId]; } //!< get matrix coefficient |
---|
158 | Bool checkPredMode (UInt sizeId, UInt listId); |
---|
159 | Void setRefMatrixId (UInt sizeId, UInt listId, UInt u) { m_refMatrixId[sizeId][listId] = u; } //!< set reference matrix ID |
---|
160 | UInt getRefMatrixId (UInt sizeId, UInt listId) { return m_refMatrixId[sizeId][listId]; } //!< get reference matrix ID |
---|
161 | Int* getScalingListDefaultAddress (UInt sizeId, UInt listId); //!< get default matrix coefficient |
---|
162 | Void processDefaultMarix (UInt sizeId, UInt listId); |
---|
163 | Void setScalingListDC (UInt sizeId, UInt listId, UInt u) { m_scalingListDC[sizeId][listId] = u; } //!< set DC value |
---|
164 | |
---|
165 | Int getScalingListDC (UInt sizeId, UInt listId) { return m_scalingListDC[sizeId][listId]; } //!< get DC value |
---|
166 | Void checkDcOfMatrix (); |
---|
167 | Void processRefMatrix (UInt sizeId, UInt listId , UInt refListId ); |
---|
168 | Bool xParseScalingList (Char* pchFile); |
---|
169 | #if H_MV |
---|
170 | Void inferFrom ( TComScalingList* srcScLi ); |
---|
171 | #endif |
---|
172 | |
---|
173 | private: |
---|
174 | Void init (); |
---|
175 | Void destroy (); |
---|
176 | Int m_scalingListDC [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< the DC value of the matrix coefficient for 16x16 |
---|
177 | Bool m_useDefaultScalingMatrixFlag [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< UseDefaultScalingMatrixFlag |
---|
178 | UInt m_refMatrixId [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< RefMatrixID |
---|
179 | Bool m_scalingListPresentFlag; //!< flag for using default matrix |
---|
180 | UInt m_predMatrixId [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< reference list index |
---|
181 | Int *m_scalingListCoef [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< quantization matrix |
---|
182 | }; |
---|
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 | Bool m_progressiveSourceFlag; |
---|
193 | Bool m_interlacedSourceFlag; |
---|
194 | Bool m_nonPackedConstraintFlag; |
---|
195 | Bool m_frameOnlyConstraintFlag; |
---|
196 | |
---|
197 | public: |
---|
198 | ProfileTierLevel(); |
---|
199 | |
---|
200 | Int getProfileSpace() const { return m_profileSpace; } |
---|
201 | Void setProfileSpace(Int x) { m_profileSpace = x; } |
---|
202 | |
---|
203 | Bool getTierFlag() const { return m_tierFlag; } |
---|
204 | Void setTierFlag(Bool x) { m_tierFlag = x; } |
---|
205 | |
---|
206 | Int getProfileIdc() const { return m_profileIdc; } |
---|
207 | Void setProfileIdc(Int x) { m_profileIdc = x; } |
---|
208 | |
---|
209 | Bool getProfileCompatibilityFlag(Int i) const { return m_profileCompatibilityFlag[i]; } |
---|
210 | Void setProfileCompatibilityFlag(Int i, Bool x) { m_profileCompatibilityFlag[i] = x; } |
---|
211 | |
---|
212 | Int getLevelIdc() const { return m_levelIdc; } |
---|
213 | Void setLevelIdc(Int x) { m_levelIdc = x; } |
---|
214 | |
---|
215 | Bool getProgressiveSourceFlag() const { return m_progressiveSourceFlag; } |
---|
216 | Void setProgressiveSourceFlag(Bool b) { m_progressiveSourceFlag = b; } |
---|
217 | |
---|
218 | Bool getInterlacedSourceFlag() const { return m_interlacedSourceFlag; } |
---|
219 | Void setInterlacedSourceFlag(Bool b) { m_interlacedSourceFlag = b; } |
---|
220 | |
---|
221 | Bool getNonPackedConstraintFlag() const { return m_nonPackedConstraintFlag; } |
---|
222 | Void setNonPackedConstraintFlag(Bool b) { m_nonPackedConstraintFlag = b; } |
---|
223 | |
---|
224 | Bool getFrameOnlyConstraintFlag() const { return m_frameOnlyConstraintFlag; } |
---|
225 | Void setFrameOnlyConstraintFlag(Bool b) { m_frameOnlyConstraintFlag = b; } |
---|
226 | }; |
---|
227 | |
---|
228 | |
---|
229 | class TComPTL |
---|
230 | { |
---|
231 | ProfileTierLevel m_generalPTL; |
---|
232 | ProfileTierLevel m_subLayerPTL[6]; // max. value of max_sub_layers_minus1 is 6 |
---|
233 | Bool m_subLayerProfilePresentFlag[6]; |
---|
234 | Bool m_subLayerLevelPresentFlag[6]; |
---|
235 | |
---|
236 | public: |
---|
237 | TComPTL(); |
---|
238 | Bool getSubLayerProfilePresentFlag(Int i) const { return m_subLayerProfilePresentFlag[i]; } |
---|
239 | Void setSubLayerProfilePresentFlag(Int i, Bool x) { m_subLayerProfilePresentFlag[i] = x; } |
---|
240 | |
---|
241 | Bool getSubLayerLevelPresentFlag(Int i) const { return m_subLayerLevelPresentFlag[i]; } |
---|
242 | Void setSubLayerLevelPresentFlag(Int i, Bool x) { m_subLayerLevelPresentFlag[i] = x; } |
---|
243 | |
---|
244 | ProfileTierLevel* getGeneralPTL() { return &m_generalPTL; } |
---|
245 | ProfileTierLevel* getSubLayerPTL(Int i) { return &m_subLayerPTL[i]; } |
---|
246 | #if H_MV |
---|
247 | Void copyLevelFrom( TComPTL* source ); |
---|
248 | #endif |
---|
249 | }; |
---|
250 | /// VPS class |
---|
251 | |
---|
252 | struct HrdSubLayerInfo |
---|
253 | { |
---|
254 | Bool fixedPicRateFlag; |
---|
255 | Bool fixedPicRateWithinCvsFlag; |
---|
256 | UInt picDurationInTcMinus1; |
---|
257 | Bool lowDelayHrdFlag; |
---|
258 | UInt cpbCntMinus1; |
---|
259 | UInt bitRateValueMinus1[MAX_CPB_CNT][2]; |
---|
260 | UInt cpbSizeValue [MAX_CPB_CNT][2]; |
---|
261 | UInt ducpbSizeValue [MAX_CPB_CNT][2]; |
---|
262 | UInt cbrFlag [MAX_CPB_CNT][2]; |
---|
263 | UInt duBitRateValue [MAX_CPB_CNT][2]; |
---|
264 | }; |
---|
265 | |
---|
266 | class TComHRD |
---|
267 | { |
---|
268 | private: |
---|
269 | Bool m_nalHrdParametersPresentFlag; |
---|
270 | Bool m_vclHrdParametersPresentFlag; |
---|
271 | Bool m_subPicCpbParamsPresentFlag; |
---|
272 | UInt m_tickDivisorMinus2; |
---|
273 | UInt m_duCpbRemovalDelayLengthMinus1; |
---|
274 | Bool m_subPicCpbParamsInPicTimingSEIFlag; |
---|
275 | UInt m_dpbOutputDelayDuLengthMinus1; |
---|
276 | UInt m_bitRateScale; |
---|
277 | UInt m_cpbSizeScale; |
---|
278 | UInt m_ducpbSizeScale; |
---|
279 | UInt m_initialCpbRemovalDelayLengthMinus1; |
---|
280 | UInt m_cpbRemovalDelayLengthMinus1; |
---|
281 | UInt m_dpbOutputDelayLengthMinus1; |
---|
282 | UInt m_numDU; |
---|
283 | HrdSubLayerInfo m_HRD[MAX_TLAYER]; |
---|
284 | |
---|
285 | public: |
---|
286 | TComHRD() |
---|
287 | :m_nalHrdParametersPresentFlag(0) |
---|
288 | ,m_vclHrdParametersPresentFlag(0) |
---|
289 | ,m_subPicCpbParamsPresentFlag(false) |
---|
290 | ,m_tickDivisorMinus2(0) |
---|
291 | ,m_duCpbRemovalDelayLengthMinus1(0) |
---|
292 | ,m_subPicCpbParamsInPicTimingSEIFlag(false) |
---|
293 | ,m_dpbOutputDelayDuLengthMinus1(0) |
---|
294 | ,m_bitRateScale(0) |
---|
295 | ,m_cpbSizeScale(0) |
---|
296 | ,m_initialCpbRemovalDelayLengthMinus1(0) |
---|
297 | ,m_cpbRemovalDelayLengthMinus1(0) |
---|
298 | ,m_dpbOutputDelayLengthMinus1(0) |
---|
299 | {} |
---|
300 | |
---|
301 | virtual ~TComHRD() {} |
---|
302 | |
---|
303 | Void setNalHrdParametersPresentFlag ( Bool flag ) { m_nalHrdParametersPresentFlag = flag; } |
---|
304 | Bool getNalHrdParametersPresentFlag ( ) { return m_nalHrdParametersPresentFlag; } |
---|
305 | |
---|
306 | Void setVclHrdParametersPresentFlag ( Bool flag ) { m_vclHrdParametersPresentFlag = flag; } |
---|
307 | Bool getVclHrdParametersPresentFlag ( ) { return m_vclHrdParametersPresentFlag; } |
---|
308 | |
---|
309 | Void setSubPicCpbParamsPresentFlag ( Bool flag ) { m_subPicCpbParamsPresentFlag = flag; } |
---|
310 | Bool getSubPicCpbParamsPresentFlag ( ) { return m_subPicCpbParamsPresentFlag; } |
---|
311 | |
---|
312 | Void setTickDivisorMinus2 ( UInt value ) { m_tickDivisorMinus2 = value; } |
---|
313 | UInt getTickDivisorMinus2 ( ) { return m_tickDivisorMinus2; } |
---|
314 | |
---|
315 | Void setDuCpbRemovalDelayLengthMinus1 ( UInt value ) { m_duCpbRemovalDelayLengthMinus1 = value; } |
---|
316 | UInt getDuCpbRemovalDelayLengthMinus1 ( ) { return m_duCpbRemovalDelayLengthMinus1; } |
---|
317 | |
---|
318 | Void setSubPicCpbParamsInPicTimingSEIFlag ( Bool flag) { m_subPicCpbParamsInPicTimingSEIFlag = flag; } |
---|
319 | Bool getSubPicCpbParamsInPicTimingSEIFlag () { return m_subPicCpbParamsInPicTimingSEIFlag; } |
---|
320 | |
---|
321 | Void setDpbOutputDelayDuLengthMinus1 (UInt value ) { m_dpbOutputDelayDuLengthMinus1 = value; } |
---|
322 | UInt getDpbOutputDelayDuLengthMinus1 () { return m_dpbOutputDelayDuLengthMinus1; } |
---|
323 | |
---|
324 | Void setBitRateScale ( UInt value ) { m_bitRateScale = value; } |
---|
325 | UInt getBitRateScale ( ) { return m_bitRateScale; } |
---|
326 | |
---|
327 | Void setCpbSizeScale ( UInt value ) { m_cpbSizeScale = value; } |
---|
328 | UInt getCpbSizeScale ( ) { return m_cpbSizeScale; } |
---|
329 | Void setDuCpbSizeScale ( UInt value ) { m_ducpbSizeScale = value; } |
---|
330 | UInt getDuCpbSizeScale ( ) { return m_ducpbSizeScale; } |
---|
331 | |
---|
332 | Void setInitialCpbRemovalDelayLengthMinus1( UInt value ) { m_initialCpbRemovalDelayLengthMinus1 = value; } |
---|
333 | UInt getInitialCpbRemovalDelayLengthMinus1( ) { return m_initialCpbRemovalDelayLengthMinus1; } |
---|
334 | |
---|
335 | Void setCpbRemovalDelayLengthMinus1 ( UInt value ) { m_cpbRemovalDelayLengthMinus1 = value; } |
---|
336 | UInt getCpbRemovalDelayLengthMinus1 ( ) { return m_cpbRemovalDelayLengthMinus1; } |
---|
337 | |
---|
338 | Void setDpbOutputDelayLengthMinus1 ( UInt value ) { m_dpbOutputDelayLengthMinus1 = value; } |
---|
339 | UInt getDpbOutputDelayLengthMinus1 ( ) { return m_dpbOutputDelayLengthMinus1; } |
---|
340 | |
---|
341 | Void setFixedPicRateFlag ( Int layer, Bool flag ) { m_HRD[layer].fixedPicRateFlag = flag; } |
---|
342 | Bool getFixedPicRateFlag ( Int layer ) { return m_HRD[layer].fixedPicRateFlag; } |
---|
343 | |
---|
344 | Void setFixedPicRateWithinCvsFlag ( Int layer, Bool flag ) { m_HRD[layer].fixedPicRateWithinCvsFlag = flag; } |
---|
345 | Bool getFixedPicRateWithinCvsFlag ( Int layer ) { return m_HRD[layer].fixedPicRateWithinCvsFlag; } |
---|
346 | |
---|
347 | Void setPicDurationInTcMinus1 ( Int layer, UInt value ) { m_HRD[layer].picDurationInTcMinus1 = value; } |
---|
348 | UInt getPicDurationInTcMinus1 ( Int layer ) { return m_HRD[layer].picDurationInTcMinus1; } |
---|
349 | |
---|
350 | Void setLowDelayHrdFlag ( Int layer, Bool flag ) { m_HRD[layer].lowDelayHrdFlag = flag; } |
---|
351 | Bool getLowDelayHrdFlag ( Int layer ) { return m_HRD[layer].lowDelayHrdFlag; } |
---|
352 | |
---|
353 | Void setCpbCntMinus1 ( Int layer, UInt value ) { m_HRD[layer].cpbCntMinus1 = value; } |
---|
354 | UInt getCpbCntMinus1 ( Int layer ) { return m_HRD[layer].cpbCntMinus1; } |
---|
355 | |
---|
356 | Void setBitRateValueMinus1 ( Int layer, Int cpbcnt, Int nalOrVcl, UInt value ) { m_HRD[layer].bitRateValueMinus1[cpbcnt][nalOrVcl] = value; } |
---|
357 | UInt getBitRateValueMinus1 ( Int layer, Int cpbcnt, Int nalOrVcl ) { return m_HRD[layer].bitRateValueMinus1[cpbcnt][nalOrVcl]; } |
---|
358 | |
---|
359 | Void setCpbSizeValueMinus1 ( Int layer, Int cpbcnt, Int nalOrVcl, UInt value ) { m_HRD[layer].cpbSizeValue[cpbcnt][nalOrVcl] = value; } |
---|
360 | UInt getCpbSizeValueMinus1 ( Int layer, Int cpbcnt, Int nalOrVcl ) { return m_HRD[layer].cpbSizeValue[cpbcnt][nalOrVcl]; } |
---|
361 | Void setDuCpbSizeValueMinus1 ( Int layer, Int cpbcnt, Int nalOrVcl, UInt value ) { m_HRD[layer].ducpbSizeValue[cpbcnt][nalOrVcl] = value; } |
---|
362 | UInt getDuCpbSizeValueMinus1 ( Int layer, Int cpbcnt, Int nalOrVcl ) { return m_HRD[layer].ducpbSizeValue[cpbcnt][nalOrVcl]; } |
---|
363 | Void setDuBitRateValueMinus1 ( Int layer, Int cpbcnt, Int nalOrVcl, UInt value ) { m_HRD[layer].duBitRateValue[cpbcnt][nalOrVcl] = value; } |
---|
364 | UInt getDuBitRateValueMinus1 (Int layer, Int cpbcnt, Int nalOrVcl ) { return m_HRD[layer].duBitRateValue[cpbcnt][nalOrVcl]; } |
---|
365 | Void setCbrFlag ( Int layer, Int cpbcnt, Int nalOrVcl, UInt value ) { m_HRD[layer].cbrFlag[cpbcnt][nalOrVcl] = value; } |
---|
366 | Bool getCbrFlag ( Int layer, Int cpbcnt, Int nalOrVcl ) { return m_HRD[layer].cbrFlag[cpbcnt][nalOrVcl]; } |
---|
367 | |
---|
368 | Void setNumDU ( UInt value ) { m_numDU = value; } |
---|
369 | UInt getNumDU ( ) { return m_numDU; } |
---|
370 | Bool getCpbDpbDelaysPresentFlag() { return getNalHrdParametersPresentFlag() || getVclHrdParametersPresentFlag(); } |
---|
371 | }; |
---|
372 | |
---|
373 | class TimingInfo |
---|
374 | { |
---|
375 | Bool m_timingInfoPresentFlag; |
---|
376 | UInt m_numUnitsInTick; |
---|
377 | UInt m_timeScale; |
---|
378 | Bool m_pocProportionalToTimingFlag; |
---|
379 | Int m_numTicksPocDiffOneMinus1; |
---|
380 | public: |
---|
381 | TimingInfo() |
---|
382 | : m_timingInfoPresentFlag(false) |
---|
383 | , m_numUnitsInTick(1001) |
---|
384 | , m_timeScale(60000) |
---|
385 | , m_pocProportionalToTimingFlag(false) |
---|
386 | , m_numTicksPocDiffOneMinus1(0) {} |
---|
387 | |
---|
388 | Void setTimingInfoPresentFlag ( Bool flag ) { m_timingInfoPresentFlag = flag; } |
---|
389 | Bool getTimingInfoPresentFlag ( ) { return m_timingInfoPresentFlag; } |
---|
390 | |
---|
391 | Void setNumUnitsInTick ( UInt value ) { m_numUnitsInTick = value; } |
---|
392 | UInt getNumUnitsInTick ( ) { return m_numUnitsInTick; } |
---|
393 | |
---|
394 | Void setTimeScale ( UInt value ) { m_timeScale = value; } |
---|
395 | UInt getTimeScale ( ) { return m_timeScale; } |
---|
396 | |
---|
397 | Bool getPocProportionalToTimingFlag ( ) { return m_pocProportionalToTimingFlag; } |
---|
398 | Void setPocProportionalToTimingFlag (Bool x ) { m_pocProportionalToTimingFlag = x; } |
---|
399 | |
---|
400 | Int getNumTicksPocDiffOneMinus1 ( ) { return m_numTicksPocDiffOneMinus1; } |
---|
401 | Void setNumTicksPocDiffOneMinus1 (Int x ) { m_numTicksPocDiffOneMinus1 = x; } |
---|
402 | }; |
---|
403 | |
---|
404 | #if H_MV |
---|
405 | class TComVPSVUI |
---|
406 | { |
---|
407 | private: |
---|
408 | Bool m_bitRatePresentVpsFlag; |
---|
409 | Bool m_picRatePresentVpsFlag; |
---|
410 | Bool m_bitRatePresentFlag [MAX_VPS_OP_SETS_PLUS1][MAX_TLAYER]; |
---|
411 | Bool m_picRatePresentFlag [MAX_VPS_OP_SETS_PLUS1][MAX_TLAYER]; |
---|
412 | Int m_avgBitRate [MAX_VPS_OP_SETS_PLUS1][MAX_TLAYER]; |
---|
413 | Int m_maxBitRate [MAX_VPS_OP_SETS_PLUS1][MAX_TLAYER]; |
---|
414 | Int m_constantPicRateIdc [MAX_VPS_OP_SETS_PLUS1][MAX_TLAYER]; |
---|
415 | Int m_avgPicRate [MAX_VPS_OP_SETS_PLUS1][MAX_TLAYER]; |
---|
416 | Bool m_tileBoundariesAlignedFlag [MAX_NUM_LAYERS][MAX_NUM_LAYERS]; |
---|
417 | Bool m_ilpRestrictedRefLayersFlag; |
---|
418 | Int m_minSpatialSegmentOffsetPlus1[MAX_NUM_LAYERS][MAX_NUM_LAYERS]; |
---|
419 | Bool m_ctuBasedOffsetEnabledFlag [MAX_NUM_LAYERS][MAX_NUM_LAYERS]; |
---|
420 | Int m_minHorizontalCtuOffsetPlus1 [MAX_NUM_LAYERS][MAX_NUM_LAYERS]; |
---|
421 | |
---|
422 | public: |
---|
423 | TComVPSVUI();; |
---|
424 | |
---|
425 | Void setBitRatePresentVpsFlag( Bool flag ) { m_bitRatePresentVpsFlag = flag; } |
---|
426 | Bool getBitRatePresentVpsFlag( ) { return m_bitRatePresentVpsFlag; } |
---|
427 | |
---|
428 | Void setPicRatePresentVpsFlag( Bool flag ) { m_picRatePresentVpsFlag = flag; } |
---|
429 | Bool getPicRatePresentVpsFlag( ) { return m_picRatePresentVpsFlag; } |
---|
430 | |
---|
431 | Void setBitRatePresentFlag( Int i, Int j, Bool flag ) { m_bitRatePresentFlag[i][j] = flag; } |
---|
432 | Bool getBitRatePresentFlag( Int i, Int j ) { return m_bitRatePresentFlag[i][j]; } |
---|
433 | |
---|
434 | Void setPicRatePresentFlag( Int i, Int j, Bool flag ) { m_picRatePresentFlag[i][j] = flag; } |
---|
435 | Bool getPicRatePresentFlag( Int i, Int j ) { return m_picRatePresentFlag[i][j]; } |
---|
436 | |
---|
437 | Void setAvgBitRate( Int i, Int j, Int val ) { m_avgBitRate[i][j] = val; } |
---|
438 | Int getAvgBitRate( Int i, Int j ) { return m_avgBitRate[i][j]; } |
---|
439 | |
---|
440 | Void setMaxBitRate( Int i, Int j, Int val ) { m_maxBitRate[i][j] = val; } |
---|
441 | Int getMaxBitRate( Int i, Int j ) { return m_maxBitRate[i][j]; } |
---|
442 | |
---|
443 | Void setConstantPicRateIdc( Int i, Int j, Int val ) { m_constantPicRateIdc[i][j] = val; } |
---|
444 | Int getConstantPicRateIdc( Int i, Int j ) { return m_constantPicRateIdc[i][j]; } |
---|
445 | |
---|
446 | Void setAvgPicRate( Int i, Int j, Int val ) { m_avgPicRate[i][j] = val; } |
---|
447 | Int getAvgPicRate( Int i, Int j ) { return m_avgPicRate[i][j]; } |
---|
448 | |
---|
449 | Void setTileBoundariesAlignedFlag( Int i, Int j, Bool flag ) { m_tileBoundariesAlignedFlag[i][j] = flag; } |
---|
450 | Bool getTileBoundariesAlignedFlag( Int i, Int j ) { return m_tileBoundariesAlignedFlag[i][j]; } |
---|
451 | |
---|
452 | Void setIlpRestrictedRefLayersFlag( Bool flag ) { m_ilpRestrictedRefLayersFlag = flag; } |
---|
453 | Bool getIlpRestrictedRefLayersFlag( ) { return m_ilpRestrictedRefLayersFlag; } |
---|
454 | |
---|
455 | Void setMinSpatialSegmentOffsetPlus1( Int i, Int j, Int val ) { m_minSpatialSegmentOffsetPlus1[i][j] = val; } |
---|
456 | Int getMinSpatialSegmentOffsetPlus1( Int i, Int j ) { return m_minSpatialSegmentOffsetPlus1[i][j]; } |
---|
457 | |
---|
458 | Void setCtuBasedOffsetEnabledFlag( Int i, Int j, Bool flag ) { m_ctuBasedOffsetEnabledFlag[i][j] = flag; } |
---|
459 | Bool getCtuBasedOffsetEnabledFlag( Int i, Int j ) { return m_ctuBasedOffsetEnabledFlag[i][j]; } |
---|
460 | |
---|
461 | Void setMinHorizontalCtuOffsetPlus1( Int i, Int j, Int val ) { m_minHorizontalCtuOffsetPlus1[i][j] = val; } |
---|
462 | Int getMinHorizontalCtuOffsetPlus1( Int i, Int j ) { return m_minHorizontalCtuOffsetPlus1[i][j]; } |
---|
463 | |
---|
464 | }; |
---|
465 | |
---|
466 | class TComRepFormat |
---|
467 | { |
---|
468 | private: |
---|
469 | Int m_chromaFormatVpsIdc; |
---|
470 | Bool m_separateColourPlaneVpsFlag; |
---|
471 | Int m_picWidthVpsInLumaSamples; |
---|
472 | Int m_picHeightVpsInLumaSamples; |
---|
473 | Int m_bitDepthVpsLumaMinus8; |
---|
474 | Int m_bitDepthVpsChromaMinus8; |
---|
475 | |
---|
476 | public: |
---|
477 | TComRepFormat() { }; |
---|
478 | |
---|
479 | Void setChromaFormatVpsIdc( Int val ) { m_chromaFormatVpsIdc = val; } |
---|
480 | Int getChromaFormatVpsIdc( ) { return m_chromaFormatVpsIdc; } |
---|
481 | |
---|
482 | Void setSeparateColourPlaneVpsFlag( Bool flag ) { m_separateColourPlaneVpsFlag = flag; } |
---|
483 | Bool getSeparateColourPlaneVpsFlag( ) { return m_separateColourPlaneVpsFlag; } |
---|
484 | |
---|
485 | Void setPicWidthVpsInLumaSamples( Int val ) { m_picWidthVpsInLumaSamples = val; } |
---|
486 | Int getPicWidthVpsInLumaSamples( ) { return m_picWidthVpsInLumaSamples; } |
---|
487 | |
---|
488 | Void setPicHeightVpsInLumaSamples( Int val ) { m_picHeightVpsInLumaSamples = val; } |
---|
489 | Int getPicHeightVpsInLumaSamples( ) { return m_picHeightVpsInLumaSamples; } |
---|
490 | |
---|
491 | Void setBitDepthVpsLumaMinus8( Int val ) { m_bitDepthVpsLumaMinus8 = val; } |
---|
492 | Int getBitDepthVpsLumaMinus8( ) { return m_bitDepthVpsLumaMinus8; } |
---|
493 | |
---|
494 | Void setBitDepthVpsChromaMinus8( Int val ) { m_bitDepthVpsChromaMinus8 = val; } |
---|
495 | Int getBitDepthVpsChromaMinus8( ) { return m_bitDepthVpsChromaMinus8; } |
---|
496 | }; |
---|
497 | #endif |
---|
498 | |
---|
499 | class TComVPS |
---|
500 | { |
---|
501 | private: |
---|
502 | Int m_VPSId; |
---|
503 | UInt m_uiMaxTLayers; |
---|
504 | |
---|
505 | #if H_MV |
---|
506 | UInt m_uiMaxLayersMinus1; |
---|
507 | #else |
---|
508 | UInt m_uiMaxLayers; |
---|
509 | #endif |
---|
510 | Bool m_bTemporalIdNestingFlag; |
---|
511 | |
---|
512 | UInt m_numReorderPics[MAX_TLAYER]; |
---|
513 | UInt m_uiMaxDecPicBuffering[MAX_TLAYER]; |
---|
514 | UInt m_uiMaxLatencyIncrease[MAX_TLAYER]; // Really max latency increase plus 1 (value 0 expresses no limit) |
---|
515 | |
---|
516 | UInt m_numHrdParameters; |
---|
517 | #if H_MV |
---|
518 | UInt m_maxLayerId; |
---|
519 | #else |
---|
520 | UInt m_maxNuhReservedZeroLayerId; |
---|
521 | #endif |
---|
522 | TComHRD* m_hrdParameters; |
---|
523 | UInt* m_hrdOpSetIdx; |
---|
524 | Bool* m_cprmsPresentFlag; |
---|
525 | #if H_MV |
---|
526 | UInt m_vpsNumLayerSetsMinus1; |
---|
527 | Bool m_layerIdIncludedFlag[MAX_VPS_OP_SETS_PLUS1][MAX_VPS_NUH_LAYER_ID_PLUS1]; |
---|
528 | #else |
---|
529 | UInt m_numOpSets; |
---|
530 | Bool m_layerIdIncludedFlag[MAX_VPS_OP_SETS_PLUS1][MAX_VPS_NUH_RESERVED_ZERO_LAYER_ID_PLUS1]; |
---|
531 | #endif |
---|
532 | |
---|
533 | #if H_MV |
---|
534 | TComPTL m_pcPTL[MAX_VPS_OP_SETS_PLUS1]; |
---|
535 | #else |
---|
536 | TComPTL m_pcPTL; |
---|
537 | #endif |
---|
538 | TimingInfo m_timingInfo; |
---|
539 | #if H_MV |
---|
540 | /// VPS EXTENSION SYNTAX ELEMENTS |
---|
541 | Bool m_avcBaseLayerFlag; |
---|
542 | Int m_vpsVuiOffset; |
---|
543 | Bool m_splittingFlag; |
---|
544 | Bool m_scalabilityMaskFlag [MAX_NUM_SCALABILITY_TYPES]; |
---|
545 | Int m_dimensionIdLen [MAX_NUM_SCALABILITY_TYPES]; |
---|
546 | Bool m_vpsNuhLayerIdPresentFlag; |
---|
547 | Int m_layerIdInNuh [MAX_NUM_LAYER_IDS]; |
---|
548 | Int m_dimensionId [MAX_NUM_LAYER_IDS][MAX_NUM_SCALABILITY_TYPES]; |
---|
549 | Int m_viewIdLenMinus1; |
---|
550 | Int m_viewIdVal [MAX_NUM_LAYERS]; |
---|
551 | Bool m_directDependencyFlag [MAX_NUM_LAYER_IDS][MAX_NUM_LAYER_IDS]; |
---|
552 | Bool m_maxTidRefPresentFlag; |
---|
553 | Int m_maxTidIlRefPicPlus1 [MAX_NUM_LAYERS]; |
---|
554 | Bool m_allRefLayersActiveFlag; |
---|
555 | Int m_vpsNumberLayerSetsMinus1; |
---|
556 | Int m_vpsNumProfileTierLevelMinus1; |
---|
557 | Bool m_vpsProfilePresentFlag [MAX_VPS_OP_SETS_PLUS1]; |
---|
558 | Int m_profileRefMinus1 [MAX_VPS_PROFILE_TIER_LEVEL]; |
---|
559 | Bool m_moreOutputLayerSetsThanDefaultFlag; |
---|
560 | Int m_numAddOutputLayerSetsMinus1; |
---|
561 | Bool m_defaultOneTargetOutputLayerFlag; |
---|
562 | Int m_outputLayerSetIdxMinus1 [MAX_VPS_OUTPUTLAYER_SETS]; |
---|
563 | Bool m_outputLayerFlag [MAX_VPS_OUTPUTLAYER_SETS][MAX_VPS_NUH_LAYER_ID_PLUS1]; |
---|
564 | Int m_profileLevelTierIdx [MAX_VPS_OUTPUTLAYER_SETS ]; |
---|
565 | Bool m_repFormatIdxPresentFlag; |
---|
566 | Int m_vpsNumRepFormatsMinus1; |
---|
567 | Int m_vpsRepFormatIdx [MAX_NUM_LAYERS]; |
---|
568 | TComRepFormat* m_repFormat [MAX_NUM_LAYERS]; |
---|
569 | Bool m_maxOneActiveRefLayerFlag; |
---|
570 | Bool m_crossLayerIrapAlignedFlag; |
---|
571 | Int m_directDepTypeLenMinus2; |
---|
572 | Bool m_vpsVuiPresentFlag; |
---|
573 | TComVPSVUI* m_vpsVUI; |
---|
574 | Int m_directDependencyType [MAX_NUM_LAYERS] [MAX_NUM_LAYERS]; |
---|
575 | |
---|
576 | // VPS EXTENSION SEMANTICS VARIABLES |
---|
577 | Int m_layerIdInVps [MAX_NUM_LAYERS ]; |
---|
578 | |
---|
579 | Int m_numDirectRefLayers [MAX_NUM_LAYERS]; |
---|
580 | Int m_refLayerId [MAX_NUM_LAYERS][MAX_NUM_LAYERS]; |
---|
581 | |
---|
582 | Int m_numSamplePredRefLayers [MAX_NUM_LAYERS]; |
---|
583 | Bool m_samplePredEnabledFlag [MAX_NUM_LAYERS][MAX_NUM_LAYERS]; |
---|
584 | Int m_samplePredRefLayerId [MAX_NUM_LAYERS][MAX_NUM_LAYERS]; |
---|
585 | |
---|
586 | Int m_numMotionPredRefLayers [MAX_NUM_LAYERS]; |
---|
587 | Bool m_motionPredEnabledFlag [MAX_NUM_LAYERS][MAX_NUM_LAYERS]; |
---|
588 | Int m_motionPredRefLayerId [MAX_NUM_LAYERS][MAX_NUM_LAYERS]; |
---|
589 | Int m_viewIndex [MAX_NUM_LAYERS ]; |
---|
590 | Int xGetDimBitOffset( Int j ); |
---|
591 | |
---|
592 | // VPS EXTENSION 2 SYNTAX ELEMENTS |
---|
593 | #if H_3D_ARP |
---|
594 | UInt m_uiUseAdvResPred [MAX_NUM_LAYERS ]; |
---|
595 | UInt m_uiARPStepNum [MAX_NUM_LAYERS ]; |
---|
596 | #endif |
---|
597 | #if H_3D_IV_MERGE |
---|
598 | Bool m_ivMvPredFlag [ MAX_NUM_LAYERS ]; |
---|
599 | #if MTK_SPIVMP_F0110 |
---|
600 | Int m_iSubPULog2Size [MAX_NUM_LAYERS ]; |
---|
601 | #endif |
---|
602 | #endif |
---|
603 | #if H_3D_VSP |
---|
604 | Bool m_viewSynthesisPredFlag [ MAX_NUM_LAYERS ]; |
---|
605 | #endif |
---|
606 | #if H_3D_NBDV_REF |
---|
607 | Bool m_depthRefinementFlag [ MAX_NUM_LAYERS ]; |
---|
608 | #endif |
---|
609 | Bool m_vpsDepthModesFlag [MAX_NUM_LAYERS ]; |
---|
610 | #if H_3D_DIM_DLT |
---|
611 | Bool m_bUseDLTFlag [MAX_NUM_LAYERS ]; |
---|
612 | |
---|
613 | Int m_iBitsPerDepthValue [MAX_NUM_LAYERS ]; |
---|
614 | Int m_iNumDepthmapValues [MAX_NUM_LAYERS ]; |
---|
615 | Int* m_iDepthValue2Idx [MAX_NUM_LAYERS ]; |
---|
616 | Int* m_iIdx2DepthValue [MAX_NUM_LAYERS ]; |
---|
617 | #endif |
---|
618 | #if H_3D |
---|
619 | Bool m_ivMvScalingFlag; |
---|
620 | #endif |
---|
621 | #if H_3D_INTER_SDC |
---|
622 | Bool m_bInterSDCFlag[MAX_NUM_LAYERS ]; |
---|
623 | #endif |
---|
624 | #if SEC_MPI_ENABLING_MERGE_F0150 |
---|
625 | Bool m_bMPIFlag[MAX_NUM_LAYERS ]; |
---|
626 | #endif |
---|
627 | |
---|
628 | #endif |
---|
629 | public: |
---|
630 | TComVPS(); |
---|
631 | virtual ~TComVPS(); |
---|
632 | |
---|
633 | Void createHrdParamBuffer() |
---|
634 | { |
---|
635 | m_hrdParameters = new TComHRD[ getNumHrdParameters() ]; |
---|
636 | m_hrdOpSetIdx = new UInt [ getNumHrdParameters() ]; |
---|
637 | m_cprmsPresentFlag = new Bool [ getNumHrdParameters() ]; |
---|
638 | } |
---|
639 | |
---|
640 | TComHRD* getHrdParameters ( UInt i ) { return &m_hrdParameters[ i ]; } |
---|
641 | UInt getHrdOpSetIdx ( UInt i ) { return m_hrdOpSetIdx[ i ]; } |
---|
642 | Void setHrdOpSetIdx ( UInt val, UInt i ) { m_hrdOpSetIdx[ i ] = val; } |
---|
643 | Bool getCprmsPresentFlag ( UInt i ) { return m_cprmsPresentFlag[ i ]; } |
---|
644 | Void setCprmsPresentFlag ( Bool val, UInt i ) { m_cprmsPresentFlag[ i ] = val; } |
---|
645 | |
---|
646 | Int getVPSId () { return m_VPSId; } |
---|
647 | Void setVPSId (Int i) { m_VPSId = i; } |
---|
648 | |
---|
649 | UInt getMaxTLayers () { return m_uiMaxTLayers; } |
---|
650 | Void setMaxTLayers (UInt t) { m_uiMaxTLayers = t; } |
---|
651 | |
---|
652 | #if H_MV |
---|
653 | UInt getMaxLayersMinus1() { return m_uiMaxLayersMinus1; }; |
---|
654 | Void setMaxLayersMinus1(UInt l) { m_uiMaxLayersMinus1 = l; } |
---|
655 | #else |
---|
656 | UInt getMaxLayers () { return m_uiMaxLayers; } |
---|
657 | Void setMaxLayers (UInt l) { m_uiMaxLayers = l; } |
---|
658 | #endif |
---|
659 | |
---|
660 | Bool getTemporalNestingFlag () { return m_bTemporalIdNestingFlag; } |
---|
661 | Void setTemporalNestingFlag (Bool t) { m_bTemporalIdNestingFlag = t; } |
---|
662 | |
---|
663 | Void setNumReorderPics(UInt v, UInt tLayer) { m_numReorderPics[tLayer] = v; } |
---|
664 | UInt getNumReorderPics(UInt tLayer) { return m_numReorderPics[tLayer]; } |
---|
665 | |
---|
666 | Void setMaxDecPicBuffering(UInt v, UInt tLayer) { m_uiMaxDecPicBuffering[tLayer] = v; } |
---|
667 | UInt getMaxDecPicBuffering(UInt tLayer) { return m_uiMaxDecPicBuffering[tLayer]; } |
---|
668 | |
---|
669 | Void setMaxLatencyIncrease(UInt v, UInt tLayer) { m_uiMaxLatencyIncrease[tLayer] = v; } |
---|
670 | UInt getMaxLatencyIncrease(UInt tLayer) { return m_uiMaxLatencyIncrease[tLayer]; } |
---|
671 | |
---|
672 | UInt getNumHrdParameters() { return m_numHrdParameters; } |
---|
673 | Void setNumHrdParameters(UInt v) { m_numHrdParameters = v; } |
---|
674 | |
---|
675 | #if H_MV |
---|
676 | UInt getVpsMaxLayerId() { return m_maxLayerId; } |
---|
677 | Void setVpsMaxLayerId(UInt v) { m_maxLayerId = v; } |
---|
678 | |
---|
679 | UInt getVpsNumLayerSetsMinus1() { return m_vpsNumLayerSetsMinus1; } |
---|
680 | Void setVpsNumLayerSetsMinus1(UInt v) { m_vpsNumLayerSetsMinus1 = v; } |
---|
681 | #else |
---|
682 | UInt getMaxNuhReservedZeroLayerId() { return m_maxNuhReservedZeroLayerId; } |
---|
683 | Void setMaxNuhReservedZeroLayerId(UInt v) { m_maxNuhReservedZeroLayerId = v; } |
---|
684 | |
---|
685 | UInt getMaxOpSets() { return m_numOpSets; } |
---|
686 | Void setMaxOpSets(UInt v) { m_numOpSets = v; } |
---|
687 | #endif |
---|
688 | Bool getLayerIdIncludedFlag(UInt opsIdx, UInt id) { return m_layerIdIncludedFlag[opsIdx][id]; } |
---|
689 | Void setLayerIdIncludedFlag(Bool v, UInt opsIdx, UInt id) { m_layerIdIncludedFlag[opsIdx][id] = v; } |
---|
690 | |
---|
691 | #if H_MV |
---|
692 | TComPTL* getPTL( Int layerSet = 0 ) { return &m_pcPTL[layerSet]; } |
---|
693 | #else |
---|
694 | TComPTL* getPTL() { return &m_pcPTL; } |
---|
695 | #endif |
---|
696 | TimingInfo* getTimingInfo() { return &m_timingInfo; } |
---|
697 | #if H_MV |
---|
698 | Void setAvcBaseLayerFlag( Bool val ) { m_avcBaseLayerFlag = val; } |
---|
699 | Bool getAvcBaseLayerFlag() { return m_avcBaseLayerFlag; } |
---|
700 | |
---|
701 | Void setVpsVuiOffset( Int val ) { m_vpsVuiOffset = val; } |
---|
702 | Int getVpsVuiOffset( ) { return m_vpsVuiOffset; } |
---|
703 | |
---|
704 | Void setSplittingFlag( Bool val ) { m_splittingFlag = val; } |
---|
705 | Bool getSplittingFlag() { return m_splittingFlag; } |
---|
706 | |
---|
707 | Void setScalabilityMaskFlag( UInt val ); |
---|
708 | Void setScalabilityMaskFlag( Int scalType, Bool val ) { m_scalabilityMaskFlag[scalType] = val; } |
---|
709 | Bool getScalabilityMaskFlag( Int scalType ) { return m_scalabilityMaskFlag[scalType]; } |
---|
710 | Int getNumScalabilityTypes( ); |
---|
711 | |
---|
712 | Void setDimensionIdLen( Int sIdx, Int val ) { m_dimensionIdLen[sIdx] = val; } |
---|
713 | Int getDimensionIdLen( Int sIdx ) { assert( m_dimensionIdLen[sIdx] > 0) ; return m_dimensionIdLen[sIdx]; } |
---|
714 | |
---|
715 | Void setVpsNuhLayerIdPresentFlag( Bool val ) { m_vpsNuhLayerIdPresentFlag = val; } |
---|
716 | Bool getVpsNuhLayerIdPresentFlag() { return m_vpsNuhLayerIdPresentFlag; } |
---|
717 | |
---|
718 | Void setLayerIdInNuh( Int layerIdInVps, Int val ) { m_layerIdInNuh[layerIdInVps] = val; } |
---|
719 | Int getLayerIdInNuh( Int layerIdInVps ) { assert( m_layerIdInNuh[layerIdInVps] >= 0 ); return m_layerIdInNuh[layerIdInVps]; } |
---|
720 | |
---|
721 | Bool nuhLayerIdIncluded( Int layerIdinNuh ) { return ( m_layerIdInVps[ layerIdinNuh ] > 0 ); } |
---|
722 | |
---|
723 | Void setDimensionId( Int layerIdInVps, Int scalIdx, Int val ) { m_dimensionId[layerIdInVps][scalIdx] = val; } |
---|
724 | Int getDimensionId( Int layerIdInVps, Int scalIdx ) { return m_dimensionId[layerIdInVps][scalIdx]; } |
---|
725 | |
---|
726 | Void setViewIdLenMinus1( Int val ) { m_viewIdLenMinus1 = val; } |
---|
727 | Int getViewIdLenMinus1( ) { return m_viewIdLenMinus1; } |
---|
728 | |
---|
729 | Void setViewIdVal( Int viewOrderIndex, Int val ) { m_viewIdVal[viewOrderIndex] = val; } |
---|
730 | Int getViewIdVal( Int viewOrderIndex ) { return m_viewIdVal[viewOrderIndex]; } |
---|
731 | Void setDirectDependencyFlag( Int depLayeridInVps, Int refLayeridInVps, Bool val ) { m_directDependencyFlag[depLayeridInVps][refLayeridInVps] = val; } |
---|
732 | Bool getDirectDependencyFlag( Int depLayeridInVps, Int refLayeridInVps ) { return m_directDependencyFlag[depLayeridInVps][refLayeridInVps]; } |
---|
733 | |
---|
734 | Void setMaxTidRefPresentFlag( Bool flag ) { m_maxTidRefPresentFlag = flag; } |
---|
735 | Bool getMaxTidRefPresentFlag( ) { return m_maxTidRefPresentFlag; } |
---|
736 | Void setMaxTidIlRefPicPlus1( Int layerIdInVps, Int val ) { m_maxTidIlRefPicPlus1[ layerIdInVps ] = val; } |
---|
737 | Int getMaxTidIlRefPicPlus1( Int layerIdInVps ) { return m_maxTidIlRefPicPlus1[ layerIdInVps ]; } |
---|
738 | Void setAllRefLayersActiveFlag( Bool flag ) { m_allRefLayersActiveFlag = flag; } |
---|
739 | Bool getAllRefLayersActiveFlag( ) { return m_allRefLayersActiveFlag; } |
---|
740 | Void setVpsNumberLayerSetsMinus1( Int val ) { m_vpsNumberLayerSetsMinus1 = val; } |
---|
741 | Int getVpsNumberLayerSetsMinus1( ) { return m_vpsNumberLayerSetsMinus1; } |
---|
742 | |
---|
743 | Void setVpsNumProfileTierLevelMinus1( Int val ) { m_vpsNumProfileTierLevelMinus1 = val; } |
---|
744 | Int getVpsNumProfileTierLevelMinus1( ) { return m_vpsNumProfileTierLevelMinus1; } |
---|
745 | |
---|
746 | Void setVpsProfilePresentFlag( Int idx, Bool val ) { m_vpsProfilePresentFlag[idx] = val; } |
---|
747 | Bool getVpsProfilePresentFlag( Int idx ) { return m_vpsProfilePresentFlag[idx]; } |
---|
748 | |
---|
749 | Void setProfileRefMinus1( Int profileTierLevelIdx, Int val ) { m_profileRefMinus1[ profileTierLevelIdx ] = val; } |
---|
750 | Int getProfileRefMinus1( Int profileTierLevelIdx ) { return m_profileRefMinus1[ profileTierLevelIdx ]; } |
---|
751 | |
---|
752 | Void setMoreOutputLayerSetsThanDefaultFlag( Bool flag ) { m_moreOutputLayerSetsThanDefaultFlag = flag; } |
---|
753 | Bool getMoreOutputLayerSetsThanDefaultFlag() { return m_moreOutputLayerSetsThanDefaultFlag; } |
---|
754 | |
---|
755 | Void setNumAddOutputLayerSetsMinus1( Int val ) { m_numAddOutputLayerSetsMinus1 = val; } |
---|
756 | Int getNumAddOutputLayerSetsMinus1( ) { return m_numAddOutputLayerSetsMinus1; } |
---|
757 | |
---|
758 | Void setDefaultOneTargetOutputLayerFlag( Bool flag ) { m_defaultOneTargetOutputLayerFlag = flag; } |
---|
759 | Bool getDefaultOneTargetOutputLayerFlag( ) { return m_defaultOneTargetOutputLayerFlag; } |
---|
760 | |
---|
761 | Void setOutputLayerSetIdxMinus1( Int outLayerSetIdx, Int val ) { m_outputLayerSetIdxMinus1[ outLayerSetIdx ] = val; } |
---|
762 | Int getOutputLayerSetIdxMinus1( Int outLayerSetIdx ) { return m_outputLayerSetIdxMinus1[ outLayerSetIdx ]; } |
---|
763 | |
---|
764 | Void setOutputLayerFlag( Int outLayerSetIdx, Int i, Bool flag ) { m_outputLayerFlag[ outLayerSetIdx ][ i ] = flag; } |
---|
765 | Bool getOutputLayerFlag( Int outLayerSetIdx, Int i ) { return m_outputLayerFlag[ outLayerSetIdx ][ i ]; } |
---|
766 | |
---|
767 | Void setProfileLevelTierIdx( Int outLayerSetIdx, Int val ) { m_profileLevelTierIdx[ outLayerSetIdx = val ]; } |
---|
768 | Int getProfileLevelTierIdx( Int outLayerSetIdx ) { return m_profileLevelTierIdx[ outLayerSetIdx ]; } |
---|
769 | |
---|
770 | Void setRepFormatIdxPresentFlag( Bool flag ) { m_repFormatIdxPresentFlag = flag; } |
---|
771 | Bool getRepFormatIdxPresentFlag( ) { return m_repFormatIdxPresentFlag; } |
---|
772 | |
---|
773 | Void setVpsNumRepFormatsMinus1( Int val ) { m_vpsNumRepFormatsMinus1 = val; } |
---|
774 | Int getVpsNumRepFormatsMinus1( ) { return m_vpsNumRepFormatsMinus1; } |
---|
775 | |
---|
776 | Void setVpsRepFormatIdx( Int i, Int val ) { m_vpsRepFormatIdx[i] = val; } |
---|
777 | Int getVpsRepFormatIdx( Int i ) { return m_vpsRepFormatIdx[i]; } |
---|
778 | |
---|
779 | Void setRepFormat( Int i, TComRepFormat* val ) { m_repFormat[i] = val; } |
---|
780 | TComRepFormat* getRepFormat( Int i ) { return m_repFormat[i]; } |
---|
781 | Void setMaxOneActiveRefLayerFlag( Bool flag) { m_maxOneActiveRefLayerFlag = flag; } |
---|
782 | Bool getMaxOneActiveRefLayerFlag( ) { return m_maxOneActiveRefLayerFlag; } |
---|
783 | Void setCrossLayerIrapAlignedFlag( Bool flag ) { m_crossLayerIrapAlignedFlag = flag; } |
---|
784 | Bool getCrossLayerIrapAlignedFlag( ) { return m_crossLayerIrapAlignedFlag; } |
---|
785 | Void setDirectDepTypeLenMinus2( Int val) { m_directDepTypeLenMinus2 = val; } |
---|
786 | Int getDirectDepTypeLenMinus2( ) { return m_directDepTypeLenMinus2; } |
---|
787 | |
---|
788 | Void setDirectDependencyType( Int depLayeridInVps, Int refLayeridInVps, Int val) { m_directDependencyType[ depLayeridInVps ][ refLayeridInVps ] = val; } |
---|
789 | Int getDirectDependencyType( Int depLayeridInVps, Int refLayeridInVps) { return m_directDependencyType[ depLayeridInVps ][ refLayeridInVps ]; } |
---|
790 | Void setVpsVuiPresentFlag( Bool flag ) { m_vpsVuiPresentFlag = flag; } |
---|
791 | Bool getVpsVuiPresentFlag( ) { return m_vpsVuiPresentFlag; } |
---|
792 | |
---|
793 | TComVPSVUI* getVPSVUI( ) { return m_vpsVUI; } |
---|
794 | // VPS EXTENSION SEMANTICS VARIABLES |
---|
795 | Void setLayerIdInVps( Int layerIdInNuh, Int val ) { m_layerIdInVps[layerIdInNuh] = val; } |
---|
796 | Int getLayerIdInVps( Int layerIdInNuh ) { assert( m_layerIdInVps[layerIdInNuh] >= 0 ); return m_layerIdInVps[layerIdInNuh]; } |
---|
797 | |
---|
798 | Int getScalabilityId ( Int layerIdInVps, ScalabilityType scalType ); |
---|
799 | Int getViewId ( Int layerIdInNuh ) { return m_viewIdVal[ getViewIndex( getLayerIdInVps( layerIdInNuh) )]; } |
---|
800 | Void setRefLayers(); |
---|
801 | |
---|
802 | Int getViewIndex ( Int layerIdInNuh ) { return getScalabilityId( getLayerIdInVps(layerIdInNuh), VIEW_ORDER_INDEX ); } |
---|
803 | Int getNumViews(); |
---|
804 | |
---|
805 | Int getNumDirectRefLayers( Int layerIdInNuh ) { return m_numDirectRefLayers[ layerIdInNuh ]; }; |
---|
806 | Int getRefLayerId ( Int layerIdInNuh, Int idx );; |
---|
807 | Bool checkVPSExtensionSyntax(); |
---|
808 | Int scalTypeToScalIdx ( ScalabilityType scalType ); |
---|
809 | |
---|
810 | Int getProfileLevelTierIdxLen() { return gCeilLog2( getVpsNumProfileTierLevelMinus1() + 1 ); }; |
---|
811 | |
---|
812 | Int getNumLayersInIdList ( Int lsIdx );; |
---|
813 | |
---|
814 | // inference |
---|
815 | Int inferDimensionId ( Int i, Int j ); |
---|
816 | Int inferLastDimsionIdLenMinus1(); |
---|
817 | |
---|
818 | // helpers |
---|
819 | Bool getInDirectDependencyFlag( Int depLayeridInVps, Int refLayeridInVps, Int depth = 0 ); |
---|
820 | /// VPS EXTENSION 2 SYNTAX ELEMENTS |
---|
821 | #if H_3D |
---|
822 | Int getDepthId ( Int layerIdInNuh) { return getScalabilityId( getLayerIdInVps(layerIdInNuh), DEPTH_ID ); } |
---|
823 | Int getLayerIdInNuh( Int viewIndex, Bool depthFlag ); |
---|
824 | |
---|
825 | #if H_3D_ARP |
---|
826 | UInt getUseAdvRP ( Int layerIdInVps ) { return m_uiUseAdvResPred[layerIdInVps]; } |
---|
827 | UInt getARPStepNum( Int layerIdInVps ) { return m_uiARPStepNum[layerIdInVps]; } |
---|
828 | Void setUseAdvRP ( Int layerIdInVps, UInt val ) { m_uiUseAdvResPred[layerIdInVps] = val; } |
---|
829 | Void setARPStepNum( Int layerIdInVps, UInt val ) { m_uiARPStepNum[layerIdInVps] = val; } |
---|
830 | #endif |
---|
831 | #if H_3D_IV_MERGE |
---|
832 | Void setIvMvPredFlag ( Int layerIdInVps, Bool val ) { m_ivMvPredFlag[ layerIdInVps ] = val; } |
---|
833 | Bool getIvMvPredFlag ( Int layerIdInVps ) { return m_ivMvPredFlag[ layerIdInVps ]; }; |
---|
834 | #if MTK_SPIVMP_F0110 |
---|
835 | Int getSubPULog2Size(Int layerIdInVps) { return m_iSubPULog2Size[layerIdInVps]; } |
---|
836 | Void setSubPULog2Size(Int layerIdInVps, Int u) { m_iSubPULog2Size[layerIdInVps] = u;} |
---|
837 | #endif |
---|
838 | #endif |
---|
839 | #if H_3D_VSP |
---|
840 | Void setViewSynthesisPredFlag ( Int layerIdInVps, Bool val ) { m_viewSynthesisPredFlag[ layerIdInVps ] = val; } |
---|
841 | Bool getViewSynthesisPredFlag ( Int layerIdInVps ) { return m_viewSynthesisPredFlag[ layerIdInVps ]; }; |
---|
842 | #endif |
---|
843 | #if H_3D_NBDV_REF |
---|
844 | Void setDepthRefinementFlag ( Int layerIdInVps, Bool val ) { m_depthRefinementFlag[ layerIdInVps ] = val; } |
---|
845 | Bool getDepthRefinementFlag ( Int layerIdInVps ) { return m_depthRefinementFlag[ layerIdInVps ]; }; |
---|
846 | #endif |
---|
847 | Void setVpsDepthModesFlag( Int layerIdInVps, Bool val ) { m_vpsDepthModesFlag[ layerIdInVps ] = val; } |
---|
848 | Bool getVpsDepthModesFlag( Int layerIdInVps ) { return m_vpsDepthModesFlag[ layerIdInVps ]; } |
---|
849 | #if H_3D_DIM_DLT |
---|
850 | Bool getUseDLTFlag ( Int layerIdInVps ) { return m_bUseDLTFlag[ layerIdInVps ]; } |
---|
851 | Void setUseDLTFlag ( Int layerIdInVps, Bool b ) { m_bUseDLTFlag[ layerIdInVps ] = b; } |
---|
852 | |
---|
853 | Int getBitsPerDepthValue( Int layerIdInVps ) { return getUseDLTFlag(layerIdInVps)?m_iBitsPerDepthValue[layerIdInVps]:g_bitDepthY; } |
---|
854 | Int getNumDepthValues( Int layerIdInVps ) { return getUseDLTFlag(layerIdInVps)?m_iNumDepthmapValues[layerIdInVps]:((1 << g_bitDepthY)-1); } |
---|
855 | Int depthValue2idx( Int layerIdInVps, Pel value ) { return getUseDLTFlag(layerIdInVps)?m_iDepthValue2Idx[layerIdInVps][value]:value; } |
---|
856 | Pel idx2DepthValue( Int layerIdInVps, UInt uiIdx ) { return getUseDLTFlag(layerIdInVps)?m_iIdx2DepthValue[layerIdInVps][uiIdx]:uiIdx; } |
---|
857 | Void setDepthLUTs( Int layerIdInVps, Int* idx2DepthValue = NULL, Int iNumDepthValues = 0 ); |
---|
858 | #endif |
---|
859 | |
---|
860 | Bool getIvMvScalingFlag ( ) { return m_ivMvScalingFlag; } |
---|
861 | Void setIvMvScalingFlag ( Bool b ) { m_ivMvScalingFlag = b; } |
---|
862 | #if H_3D_INTER_SDC |
---|
863 | Bool getInterSDCFlag ( Int layerIdInVps ) { return m_bInterSDCFlag[layerIdInVps]; } |
---|
864 | Void setInterSDCFlag ( Int layerIdInVps, Bool bval ){ m_bInterSDCFlag[layerIdInVps] = bval; } |
---|
865 | #endif |
---|
866 | #if SEC_MPI_ENABLING_MERGE_F0150 |
---|
867 | Bool getMPIFlag ( Int layerIdInVps ) { return m_bMPIFlag[layerIdInVps]; } |
---|
868 | Void setMPIFlag ( Int layerIdInVps, Bool bval ){ m_bMPIFlag[layerIdInVps] = bval; } |
---|
869 | #endif |
---|
870 | #endif |
---|
871 | #endif |
---|
872 | }; |
---|
873 | |
---|
874 | class Window |
---|
875 | { |
---|
876 | private: |
---|
877 | Bool m_enabledFlag; |
---|
878 | Int m_winLeftOffset; |
---|
879 | Int m_winRightOffset; |
---|
880 | Int m_winTopOffset; |
---|
881 | Int m_winBottomOffset; |
---|
882 | #if H_MV |
---|
883 | Bool m_scaledFlag; |
---|
884 | #endif |
---|
885 | public: |
---|
886 | Window() |
---|
887 | : m_enabledFlag (false) |
---|
888 | , m_winLeftOffset (0) |
---|
889 | , m_winRightOffset (0) |
---|
890 | , m_winTopOffset (0) |
---|
891 | , m_winBottomOffset (0) |
---|
892 | #if H_MV |
---|
893 | , m_scaledFlag(true) |
---|
894 | #endif |
---|
895 | { } |
---|
896 | |
---|
897 | Bool getWindowEnabledFlag() const { return m_enabledFlag; } |
---|
898 | Void resetWindow() { m_enabledFlag = false; m_winLeftOffset = m_winRightOffset = m_winTopOffset = m_winBottomOffset = 0; } |
---|
899 | Int getWindowLeftOffset() const { return m_enabledFlag ? m_winLeftOffset : 0; } |
---|
900 | Void setWindowLeftOffset(Int val) { m_winLeftOffset = val; m_enabledFlag = true; } |
---|
901 | Int getWindowRightOffset() const { return m_enabledFlag ? m_winRightOffset : 0; } |
---|
902 | Void setWindowRightOffset(Int val) { m_winRightOffset = val; m_enabledFlag = true; } |
---|
903 | Int getWindowTopOffset() const { return m_enabledFlag ? m_winTopOffset : 0; } |
---|
904 | Void setWindowTopOffset(Int val) { m_winTopOffset = val; m_enabledFlag = true; } |
---|
905 | Int getWindowBottomOffset() const { return m_enabledFlag ? m_winBottomOffset: 0; } |
---|
906 | Void setWindowBottomOffset(Int val) { m_winBottomOffset = val; m_enabledFlag = true; } |
---|
907 | |
---|
908 | #if H_MV |
---|
909 | Void setScaledFlag(Bool flag) { m_scaledFlag = flag; } |
---|
910 | Bool getScaledFlag() const { return m_scaledFlag; } |
---|
911 | Void scaleOffsets( Int scal ) |
---|
912 | { |
---|
913 | if (! m_scaledFlag ) |
---|
914 | { |
---|
915 | m_scaledFlag = true; |
---|
916 | m_winLeftOffset *= scal; |
---|
917 | m_winRightOffset *= scal; |
---|
918 | m_winTopOffset *= scal; |
---|
919 | m_winBottomOffset *= scal; |
---|
920 | } |
---|
921 | } |
---|
922 | #endif |
---|
923 | Void setWindow(Int offsetLeft, Int offsetLRight, Int offsetLTop, Int offsetLBottom) |
---|
924 | { |
---|
925 | m_enabledFlag = true; |
---|
926 | m_winLeftOffset = offsetLeft; |
---|
927 | m_winRightOffset = offsetLRight; |
---|
928 | m_winTopOffset = offsetLTop; |
---|
929 | m_winBottomOffset = offsetLBottom; |
---|
930 | } |
---|
931 | }; |
---|
932 | |
---|
933 | |
---|
934 | class TComVUI |
---|
935 | { |
---|
936 | private: |
---|
937 | Bool m_aspectRatioInfoPresentFlag; |
---|
938 | Int m_aspectRatioIdc; |
---|
939 | Int m_sarWidth; |
---|
940 | Int m_sarHeight; |
---|
941 | Bool m_overscanInfoPresentFlag; |
---|
942 | Bool m_overscanAppropriateFlag; |
---|
943 | Bool m_videoSignalTypePresentFlag; |
---|
944 | Int m_videoFormat; |
---|
945 | Bool m_videoFullRangeFlag; |
---|
946 | Bool m_colourDescriptionPresentFlag; |
---|
947 | Int m_colourPrimaries; |
---|
948 | Int m_transferCharacteristics; |
---|
949 | Int m_matrixCoefficients; |
---|
950 | Bool m_chromaLocInfoPresentFlag; |
---|
951 | Int m_chromaSampleLocTypeTopField; |
---|
952 | Int m_chromaSampleLocTypeBottomField; |
---|
953 | Bool m_neutralChromaIndicationFlag; |
---|
954 | Bool m_fieldSeqFlag; |
---|
955 | |
---|
956 | Window m_defaultDisplayWindow; |
---|
957 | Bool m_frameFieldInfoPresentFlag; |
---|
958 | Bool m_hrdParametersPresentFlag; |
---|
959 | Bool m_bitstreamRestrictionFlag; |
---|
960 | Bool m_tilesFixedStructureFlag; |
---|
961 | Bool m_motionVectorsOverPicBoundariesFlag; |
---|
962 | Bool m_restrictedRefPicListsFlag; |
---|
963 | Int m_minSpatialSegmentationIdc; |
---|
964 | Int m_maxBytesPerPicDenom; |
---|
965 | Int m_maxBitsPerMinCuDenom; |
---|
966 | Int m_log2MaxMvLengthHorizontal; |
---|
967 | Int m_log2MaxMvLengthVertical; |
---|
968 | TComHRD m_hrdParameters; |
---|
969 | TimingInfo m_timingInfo; |
---|
970 | |
---|
971 | public: |
---|
972 | TComVUI() |
---|
973 | :m_aspectRatioInfoPresentFlag(false) |
---|
974 | ,m_aspectRatioIdc(0) |
---|
975 | ,m_sarWidth(0) |
---|
976 | ,m_sarHeight(0) |
---|
977 | ,m_overscanInfoPresentFlag(false) |
---|
978 | ,m_overscanAppropriateFlag(false) |
---|
979 | ,m_videoSignalTypePresentFlag(false) |
---|
980 | ,m_videoFormat(5) |
---|
981 | ,m_videoFullRangeFlag(false) |
---|
982 | ,m_colourDescriptionPresentFlag(false) |
---|
983 | ,m_colourPrimaries(2) |
---|
984 | ,m_transferCharacteristics(2) |
---|
985 | ,m_matrixCoefficients(2) |
---|
986 | ,m_chromaLocInfoPresentFlag(false) |
---|
987 | ,m_chromaSampleLocTypeTopField(0) |
---|
988 | ,m_chromaSampleLocTypeBottomField(0) |
---|
989 | ,m_neutralChromaIndicationFlag(false) |
---|
990 | ,m_fieldSeqFlag(false) |
---|
991 | ,m_frameFieldInfoPresentFlag(false) |
---|
992 | ,m_hrdParametersPresentFlag(false) |
---|
993 | ,m_bitstreamRestrictionFlag(false) |
---|
994 | ,m_tilesFixedStructureFlag(false) |
---|
995 | ,m_motionVectorsOverPicBoundariesFlag(true) |
---|
996 | ,m_restrictedRefPicListsFlag(1) |
---|
997 | ,m_minSpatialSegmentationIdc(0) |
---|
998 | ,m_maxBytesPerPicDenom(2) |
---|
999 | ,m_maxBitsPerMinCuDenom(1) |
---|
1000 | ,m_log2MaxMvLengthHorizontal(15) |
---|
1001 | ,m_log2MaxMvLengthVertical(15) |
---|
1002 | {} |
---|
1003 | |
---|
1004 | virtual ~TComVUI() {} |
---|
1005 | |
---|
1006 | Bool getAspectRatioInfoPresentFlag() { return m_aspectRatioInfoPresentFlag; } |
---|
1007 | Void setAspectRatioInfoPresentFlag(Bool i) { m_aspectRatioInfoPresentFlag = i; } |
---|
1008 | |
---|
1009 | Int getAspectRatioIdc() { return m_aspectRatioIdc; } |
---|
1010 | Void setAspectRatioIdc(Int i) { m_aspectRatioIdc = i; } |
---|
1011 | |
---|
1012 | Int getSarWidth() { return m_sarWidth; } |
---|
1013 | Void setSarWidth(Int i) { m_sarWidth = i; } |
---|
1014 | |
---|
1015 | Int getSarHeight() { return m_sarHeight; } |
---|
1016 | Void setSarHeight(Int i) { m_sarHeight = i; } |
---|
1017 | |
---|
1018 | Bool getOverscanInfoPresentFlag() { return m_overscanInfoPresentFlag; } |
---|
1019 | Void setOverscanInfoPresentFlag(Bool i) { m_overscanInfoPresentFlag = i; } |
---|
1020 | |
---|
1021 | Bool getOverscanAppropriateFlag() { return m_overscanAppropriateFlag; } |
---|
1022 | Void setOverscanAppropriateFlag(Bool i) { m_overscanAppropriateFlag = i; } |
---|
1023 | |
---|
1024 | Bool getVideoSignalTypePresentFlag() { return m_videoSignalTypePresentFlag; } |
---|
1025 | Void setVideoSignalTypePresentFlag(Bool i) { m_videoSignalTypePresentFlag = i; } |
---|
1026 | |
---|
1027 | Int getVideoFormat() { return m_videoFormat; } |
---|
1028 | Void setVideoFormat(Int i) { m_videoFormat = i; } |
---|
1029 | |
---|
1030 | Bool getVideoFullRangeFlag() { return m_videoFullRangeFlag; } |
---|
1031 | Void setVideoFullRangeFlag(Bool i) { m_videoFullRangeFlag = i; } |
---|
1032 | |
---|
1033 | Bool getColourDescriptionPresentFlag() { return m_colourDescriptionPresentFlag; } |
---|
1034 | Void setColourDescriptionPresentFlag(Bool i) { m_colourDescriptionPresentFlag = i; } |
---|
1035 | |
---|
1036 | Int getColourPrimaries() { return m_colourPrimaries; } |
---|
1037 | Void setColourPrimaries(Int i) { m_colourPrimaries = i; } |
---|
1038 | |
---|
1039 | Int getTransferCharacteristics() { return m_transferCharacteristics; } |
---|
1040 | Void setTransferCharacteristics(Int i) { m_transferCharacteristics = i; } |
---|
1041 | |
---|
1042 | Int getMatrixCoefficients() { return m_matrixCoefficients; } |
---|
1043 | Void setMatrixCoefficients(Int i) { m_matrixCoefficients = i; } |
---|
1044 | |
---|
1045 | Bool getChromaLocInfoPresentFlag() { return m_chromaLocInfoPresentFlag; } |
---|
1046 | Void setChromaLocInfoPresentFlag(Bool i) { m_chromaLocInfoPresentFlag = i; } |
---|
1047 | |
---|
1048 | Int getChromaSampleLocTypeTopField() { return m_chromaSampleLocTypeTopField; } |
---|
1049 | Void setChromaSampleLocTypeTopField(Int i) { m_chromaSampleLocTypeTopField = i; } |
---|
1050 | |
---|
1051 | Int getChromaSampleLocTypeBottomField() { return m_chromaSampleLocTypeBottomField; } |
---|
1052 | Void setChromaSampleLocTypeBottomField(Int i) { m_chromaSampleLocTypeBottomField = i; } |
---|
1053 | |
---|
1054 | Bool getNeutralChromaIndicationFlag() { return m_neutralChromaIndicationFlag; } |
---|
1055 | Void setNeutralChromaIndicationFlag(Bool i) { m_neutralChromaIndicationFlag = i; } |
---|
1056 | |
---|
1057 | Bool getFieldSeqFlag() { return m_fieldSeqFlag; } |
---|
1058 | Void setFieldSeqFlag(Bool i) { m_fieldSeqFlag = i; } |
---|
1059 | |
---|
1060 | Bool getFrameFieldInfoPresentFlag() { return m_frameFieldInfoPresentFlag; } |
---|
1061 | Void setFrameFieldInfoPresentFlag(Bool i) { m_frameFieldInfoPresentFlag = i; } |
---|
1062 | |
---|
1063 | Window& getDefaultDisplayWindow() { return m_defaultDisplayWindow; } |
---|
1064 | Void setDefaultDisplayWindow(Window& defaultDisplayWindow ) { m_defaultDisplayWindow = defaultDisplayWindow; } |
---|
1065 | |
---|
1066 | Bool getHrdParametersPresentFlag() { return m_hrdParametersPresentFlag; } |
---|
1067 | Void setHrdParametersPresentFlag(Bool i) { m_hrdParametersPresentFlag = i; } |
---|
1068 | |
---|
1069 | Bool getBitstreamRestrictionFlag() { return m_bitstreamRestrictionFlag; } |
---|
1070 | Void setBitstreamRestrictionFlag(Bool i) { m_bitstreamRestrictionFlag = i; } |
---|
1071 | |
---|
1072 | Bool getTilesFixedStructureFlag() { return m_tilesFixedStructureFlag; } |
---|
1073 | Void setTilesFixedStructureFlag(Bool i) { m_tilesFixedStructureFlag = i; } |
---|
1074 | |
---|
1075 | Bool getMotionVectorsOverPicBoundariesFlag() { return m_motionVectorsOverPicBoundariesFlag; } |
---|
1076 | Void setMotionVectorsOverPicBoundariesFlag(Bool i) { m_motionVectorsOverPicBoundariesFlag = i; } |
---|
1077 | |
---|
1078 | Bool getRestrictedRefPicListsFlag() { return m_restrictedRefPicListsFlag; } |
---|
1079 | Void setRestrictedRefPicListsFlag(Bool b) { m_restrictedRefPicListsFlag = b; } |
---|
1080 | |
---|
1081 | Int getMinSpatialSegmentationIdc() { return m_minSpatialSegmentationIdc; } |
---|
1082 | Void setMinSpatialSegmentationIdc(Int i) { m_minSpatialSegmentationIdc = i; } |
---|
1083 | Int getMaxBytesPerPicDenom() { return m_maxBytesPerPicDenom; } |
---|
1084 | Void setMaxBytesPerPicDenom(Int i) { m_maxBytesPerPicDenom = i; } |
---|
1085 | |
---|
1086 | Int getMaxBitsPerMinCuDenom() { return m_maxBitsPerMinCuDenom; } |
---|
1087 | Void setMaxBitsPerMinCuDenom(Int i) { m_maxBitsPerMinCuDenom = i; } |
---|
1088 | |
---|
1089 | Int getLog2MaxMvLengthHorizontal() { return m_log2MaxMvLengthHorizontal; } |
---|
1090 | Void setLog2MaxMvLengthHorizontal(Int i) { m_log2MaxMvLengthHorizontal = i; } |
---|
1091 | |
---|
1092 | Int getLog2MaxMvLengthVertical() { return m_log2MaxMvLengthVertical; } |
---|
1093 | Void setLog2MaxMvLengthVertical(Int i) { m_log2MaxMvLengthVertical = i; } |
---|
1094 | |
---|
1095 | TComHRD* getHrdParameters () { return &m_hrdParameters; } |
---|
1096 | TimingInfo* getTimingInfo() { return &m_timingInfo; } |
---|
1097 | |
---|
1098 | }; |
---|
1099 | |
---|
1100 | /// SPS class |
---|
1101 | class TComSPS |
---|
1102 | { |
---|
1103 | private: |
---|
1104 | Int m_SPSId; |
---|
1105 | Int m_VPSId; |
---|
1106 | Int m_chromaFormatIdc; |
---|
1107 | |
---|
1108 | UInt m_uiMaxTLayers; // maximum number of temporal layers |
---|
1109 | |
---|
1110 | // Structure |
---|
1111 | UInt m_picWidthInLumaSamples; |
---|
1112 | UInt m_picHeightInLumaSamples; |
---|
1113 | |
---|
1114 | Int m_log2MinCodingBlockSize; |
---|
1115 | Int m_log2DiffMaxMinCodingBlockSize; |
---|
1116 | UInt m_uiMaxCUWidth; |
---|
1117 | UInt m_uiMaxCUHeight; |
---|
1118 | UInt m_uiMaxCUDepth; |
---|
1119 | |
---|
1120 | Window m_conformanceWindow; |
---|
1121 | |
---|
1122 | TComRPSList m_RPSList; |
---|
1123 | Bool m_bLongTermRefsPresent; |
---|
1124 | Bool m_TMVPFlagsPresent; |
---|
1125 | Int m_numReorderPics[MAX_TLAYER]; |
---|
1126 | |
---|
1127 | // Tool list |
---|
1128 | UInt m_uiQuadtreeTULog2MaxSize; |
---|
1129 | UInt m_uiQuadtreeTULog2MinSize; |
---|
1130 | UInt m_uiQuadtreeTUMaxDepthInter; |
---|
1131 | UInt m_uiQuadtreeTUMaxDepthIntra; |
---|
1132 | Bool m_usePCM; |
---|
1133 | UInt m_pcmLog2MaxSize; |
---|
1134 | UInt m_uiPCMLog2MinSize; |
---|
1135 | Bool m_useAMP; |
---|
1136 | |
---|
1137 | #if H_3D_QTLPC |
---|
1138 | Bool m_bUseQTL; |
---|
1139 | Bool m_bUsePC; |
---|
1140 | #endif |
---|
1141 | // Parameter |
---|
1142 | Int m_bitDepthY; |
---|
1143 | Int m_bitDepthC; |
---|
1144 | Int m_qpBDOffsetY; |
---|
1145 | Int m_qpBDOffsetC; |
---|
1146 | |
---|
1147 | Bool m_useLossless; |
---|
1148 | |
---|
1149 | UInt m_uiPCMBitDepthLuma; |
---|
1150 | UInt m_uiPCMBitDepthChroma; |
---|
1151 | Bool m_bPCMFilterDisableFlag; |
---|
1152 | |
---|
1153 | UInt m_uiBitsForPOC; |
---|
1154 | UInt m_numLongTermRefPicSPS; |
---|
1155 | UInt m_ltRefPicPocLsbSps[33]; |
---|
1156 | Bool m_usedByCurrPicLtSPSFlag[33]; |
---|
1157 | // Max physical transform size |
---|
1158 | UInt m_uiMaxTrSize; |
---|
1159 | |
---|
1160 | Int m_iAMPAcc[MAX_CU_DEPTH]; |
---|
1161 | Bool m_bUseSAO; |
---|
1162 | |
---|
1163 | Bool m_bTemporalIdNestingFlag; // temporal_id_nesting_flag |
---|
1164 | |
---|
1165 | Bool m_scalingListEnabledFlag; |
---|
1166 | Bool m_scalingListPresentFlag; |
---|
1167 | TComScalingList* m_scalingList; //!< ScalingList class pointer |
---|
1168 | UInt m_uiMaxDecPicBuffering[MAX_TLAYER]; |
---|
1169 | UInt m_uiMaxLatencyIncrease[MAX_TLAYER]; // Really max latency increase plus 1 (value 0 expresses no limit) |
---|
1170 | |
---|
1171 | Bool m_useDF; |
---|
1172 | Bool m_useStrongIntraSmoothing; |
---|
1173 | |
---|
1174 | Bool m_vuiParametersPresentFlag; |
---|
1175 | TComVUI m_vuiParameters; |
---|
1176 | |
---|
1177 | static const Int m_winUnitX[MAX_CHROMA_FORMAT_IDC+1]; |
---|
1178 | static const Int m_winUnitY[MAX_CHROMA_FORMAT_IDC+1]; |
---|
1179 | TComPTL m_pcPTL; |
---|
1180 | #if H_MV |
---|
1181 | TComVPS* m_pcVPS; |
---|
1182 | // SPS |
---|
1183 | Bool m_spsInferScalingListFlag; |
---|
1184 | Int m_spsScalingListRefLayerId; |
---|
1185 | Bool m_updateRepFormatFlag; |
---|
1186 | // SPS Extension |
---|
1187 | Bool m_interViewMvVertConstraintFlag; |
---|
1188 | #endif |
---|
1189 | #if H_3D |
---|
1190 | UInt m_uiCamParPrecision; |
---|
1191 | Bool m_bCamParInSliceHeader; |
---|
1192 | Int m_aaiCodedScale [2][MAX_NUM_LAYERS]; |
---|
1193 | Int m_aaiCodedOffset[2][MAX_NUM_LAYERS]; |
---|
1194 | #endif |
---|
1195 | #if H_MV |
---|
1196 | Int m_layerId; |
---|
1197 | #endif |
---|
1198 | public: |
---|
1199 | TComSPS(); |
---|
1200 | virtual ~TComSPS(); |
---|
1201 | |
---|
1202 | Int getVPSId () { return m_VPSId; } |
---|
1203 | Void setVPSId (Int i) { m_VPSId = i; } |
---|
1204 | Int getSPSId () { return m_SPSId; } |
---|
1205 | Void setSPSId (Int i) { m_SPSId = i; } |
---|
1206 | Int getChromaFormatIdc () { return m_chromaFormatIdc; } |
---|
1207 | Void setChromaFormatIdc (Int i) { m_chromaFormatIdc = i; } |
---|
1208 | |
---|
1209 | static Int getWinUnitX (Int chromaFormatIdc) { assert (chromaFormatIdc > 0 && chromaFormatIdc <= MAX_CHROMA_FORMAT_IDC); return m_winUnitX[chromaFormatIdc]; } |
---|
1210 | static Int getWinUnitY (Int chromaFormatIdc) { assert (chromaFormatIdc > 0 && chromaFormatIdc <= MAX_CHROMA_FORMAT_IDC); return m_winUnitY[chromaFormatIdc]; } |
---|
1211 | |
---|
1212 | // structure |
---|
1213 | Void setPicWidthInLumaSamples ( UInt u ) { m_picWidthInLumaSamples = u; } |
---|
1214 | UInt getPicWidthInLumaSamples () { return m_picWidthInLumaSamples; } |
---|
1215 | Void setPicHeightInLumaSamples ( UInt u ) { m_picHeightInLumaSamples = u; } |
---|
1216 | UInt getPicHeightInLumaSamples () { return m_picHeightInLumaSamples; } |
---|
1217 | |
---|
1218 | Window& getConformanceWindow() { return m_conformanceWindow; } |
---|
1219 | Void setConformanceWindow(Window& conformanceWindow ) { m_conformanceWindow = conformanceWindow; } |
---|
1220 | |
---|
1221 | UInt getNumLongTermRefPicSPS() { return m_numLongTermRefPicSPS; } |
---|
1222 | Void setNumLongTermRefPicSPS(UInt val) { m_numLongTermRefPicSPS = val; } |
---|
1223 | |
---|
1224 | UInt getLtRefPicPocLsbSps(UInt index) { return m_ltRefPicPocLsbSps[index]; } |
---|
1225 | Void setLtRefPicPocLsbSps(UInt index, UInt val) { m_ltRefPicPocLsbSps[index] = val; } |
---|
1226 | |
---|
1227 | Bool getUsedByCurrPicLtSPSFlag(Int i) {return m_usedByCurrPicLtSPSFlag[i];} |
---|
1228 | Void setUsedByCurrPicLtSPSFlag(Int i, Bool x) { m_usedByCurrPicLtSPSFlag[i] = x;} |
---|
1229 | |
---|
1230 | Int getLog2MinCodingBlockSize() const { return m_log2MinCodingBlockSize; } |
---|
1231 | Void setLog2MinCodingBlockSize(Int val) { m_log2MinCodingBlockSize = val; } |
---|
1232 | Int getLog2DiffMaxMinCodingBlockSize() const { return m_log2DiffMaxMinCodingBlockSize; } |
---|
1233 | Void setLog2DiffMaxMinCodingBlockSize(Int val) { m_log2DiffMaxMinCodingBlockSize = val; } |
---|
1234 | |
---|
1235 | Void setMaxCUWidth ( UInt u ) { m_uiMaxCUWidth = u; } |
---|
1236 | UInt getMaxCUWidth () { return m_uiMaxCUWidth; } |
---|
1237 | Void setMaxCUHeight ( UInt u ) { m_uiMaxCUHeight = u; } |
---|
1238 | UInt getMaxCUHeight () { return m_uiMaxCUHeight; } |
---|
1239 | Void setMaxCUDepth ( UInt u ) { m_uiMaxCUDepth = u; } |
---|
1240 | UInt getMaxCUDepth () { return m_uiMaxCUDepth; } |
---|
1241 | Void setUsePCM ( Bool b ) { m_usePCM = b; } |
---|
1242 | Bool getUsePCM () { return m_usePCM; } |
---|
1243 | Void setPCMLog2MaxSize ( UInt u ) { m_pcmLog2MaxSize = u; } |
---|
1244 | UInt getPCMLog2MaxSize () { return m_pcmLog2MaxSize; } |
---|
1245 | Void setPCMLog2MinSize ( UInt u ) { m_uiPCMLog2MinSize = u; } |
---|
1246 | UInt getPCMLog2MinSize () { return m_uiPCMLog2MinSize; } |
---|
1247 | Void setBitsForPOC ( UInt u ) { m_uiBitsForPOC = u; } |
---|
1248 | UInt getBitsForPOC () { return m_uiBitsForPOC; } |
---|
1249 | Bool getUseAMP() { return m_useAMP; } |
---|
1250 | Void setUseAMP( Bool b ) { m_useAMP = b; } |
---|
1251 | Void setQuadtreeTULog2MaxSize( UInt u ) { m_uiQuadtreeTULog2MaxSize = u; } |
---|
1252 | UInt getQuadtreeTULog2MaxSize() { return m_uiQuadtreeTULog2MaxSize; } |
---|
1253 | Void setQuadtreeTULog2MinSize( UInt u ) { m_uiQuadtreeTULog2MinSize = u; } |
---|
1254 | UInt getQuadtreeTULog2MinSize() { return m_uiQuadtreeTULog2MinSize; } |
---|
1255 | Void setQuadtreeTUMaxDepthInter( UInt u ) { m_uiQuadtreeTUMaxDepthInter = u; } |
---|
1256 | Void setQuadtreeTUMaxDepthIntra( UInt u ) { m_uiQuadtreeTUMaxDepthIntra = u; } |
---|
1257 | UInt getQuadtreeTUMaxDepthInter() { return m_uiQuadtreeTUMaxDepthInter; } |
---|
1258 | UInt getQuadtreeTUMaxDepthIntra() { return m_uiQuadtreeTUMaxDepthIntra; } |
---|
1259 | Void setNumReorderPics(Int i, UInt tlayer) { m_numReorderPics[tlayer] = i; } |
---|
1260 | Int getNumReorderPics(UInt tlayer) { return m_numReorderPics[tlayer]; } |
---|
1261 | Void createRPSList( Int numRPS ); |
---|
1262 | TComRPSList* getRPSList() { return &m_RPSList; } |
---|
1263 | Bool getLongTermRefsPresent() { return m_bLongTermRefsPresent; } |
---|
1264 | Void setLongTermRefsPresent(Bool b) { m_bLongTermRefsPresent=b; } |
---|
1265 | Bool getTMVPFlagsPresent() { return m_TMVPFlagsPresent; } |
---|
1266 | Void setTMVPFlagsPresent(Bool b) { m_TMVPFlagsPresent=b; } |
---|
1267 | // physical transform |
---|
1268 | Void setMaxTrSize ( UInt u ) { m_uiMaxTrSize = u; } |
---|
1269 | UInt getMaxTrSize () { return m_uiMaxTrSize; } |
---|
1270 | |
---|
1271 | // Tool list |
---|
1272 | Bool getUseLossless () { return m_useLossless; } |
---|
1273 | Void setUseLossless ( Bool b ) { m_useLossless = b; } |
---|
1274 | |
---|
1275 | // AMP accuracy |
---|
1276 | Int getAMPAcc ( UInt uiDepth ) { return m_iAMPAcc[uiDepth]; } |
---|
1277 | Void setAMPAcc ( UInt uiDepth, Int iAccu ) { assert( uiDepth < g_uiMaxCUDepth); m_iAMPAcc[uiDepth] = iAccu; } |
---|
1278 | |
---|
1279 | // Bit-depth |
---|
1280 | Int getBitDepthY() { return m_bitDepthY; } |
---|
1281 | Void setBitDepthY(Int u) { m_bitDepthY = u; } |
---|
1282 | Int getBitDepthC() { return m_bitDepthC; } |
---|
1283 | Void setBitDepthC(Int u) { m_bitDepthC = u; } |
---|
1284 | Int getQpBDOffsetY () { return m_qpBDOffsetY; } |
---|
1285 | Void setQpBDOffsetY ( Int value ) { m_qpBDOffsetY = value; } |
---|
1286 | Int getQpBDOffsetC () { return m_qpBDOffsetC; } |
---|
1287 | Void setQpBDOffsetC ( Int value ) { m_qpBDOffsetC = value; } |
---|
1288 | Void setUseSAO (Bool bVal) {m_bUseSAO = bVal;} |
---|
1289 | Bool getUseSAO () {return m_bUseSAO;} |
---|
1290 | |
---|
1291 | UInt getMaxTLayers() { return m_uiMaxTLayers; } |
---|
1292 | Void setMaxTLayers( UInt uiMaxTLayers ) { assert( uiMaxTLayers <= MAX_TLAYER ); m_uiMaxTLayers = uiMaxTLayers; } |
---|
1293 | |
---|
1294 | Bool getTemporalIdNestingFlag() { return m_bTemporalIdNestingFlag; } |
---|
1295 | Void setTemporalIdNestingFlag( Bool bValue ) { m_bTemporalIdNestingFlag = bValue; } |
---|
1296 | UInt getPCMBitDepthLuma () { return m_uiPCMBitDepthLuma; } |
---|
1297 | Void setPCMBitDepthLuma ( UInt u ) { m_uiPCMBitDepthLuma = u; } |
---|
1298 | UInt getPCMBitDepthChroma () { return m_uiPCMBitDepthChroma; } |
---|
1299 | Void setPCMBitDepthChroma ( UInt u ) { m_uiPCMBitDepthChroma = u; } |
---|
1300 | Void setPCMFilterDisableFlag ( Bool bValue ) { m_bPCMFilterDisableFlag = bValue; } |
---|
1301 | Bool getPCMFilterDisableFlag () { return m_bPCMFilterDisableFlag; } |
---|
1302 | |
---|
1303 | Bool getScalingListFlag () { return m_scalingListEnabledFlag; } |
---|
1304 | Void setScalingListFlag ( Bool b ) { m_scalingListEnabledFlag = b; } |
---|
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 SPS |
---|
1309 | UInt getMaxDecPicBuffering (UInt tlayer) { return m_uiMaxDecPicBuffering[tlayer]; } |
---|
1310 | Void setMaxDecPicBuffering ( UInt ui, UInt tlayer ) { m_uiMaxDecPicBuffering[tlayer] = ui; } |
---|
1311 | UInt getMaxLatencyIncrease (UInt tlayer) { return m_uiMaxLatencyIncrease[tlayer]; } |
---|
1312 | Void setMaxLatencyIncrease ( UInt ui , UInt tlayer) { m_uiMaxLatencyIncrease[tlayer] = ui; } |
---|
1313 | |
---|
1314 | Void setUseStrongIntraSmoothing (Bool bVal) {m_useStrongIntraSmoothing = bVal;} |
---|
1315 | Bool getUseStrongIntraSmoothing () {return m_useStrongIntraSmoothing;} |
---|
1316 | |
---|
1317 | Bool getVuiParametersPresentFlag() { return m_vuiParametersPresentFlag; } |
---|
1318 | Void setVuiParametersPresentFlag(Bool b) { m_vuiParametersPresentFlag = b; } |
---|
1319 | TComVUI* getVuiParameters() { return &m_vuiParameters; } |
---|
1320 | Void setHrdParameters( UInt frameRate, UInt numDU, UInt bitRate, Bool randomAccess ); |
---|
1321 | |
---|
1322 | TComPTL* getPTL() { return &m_pcPTL; } |
---|
1323 | #if H_MV |
---|
1324 | Void setVPS ( TComVPS* pcVPS ) { m_pcVPS = pcVPS; } |
---|
1325 | TComVPS* getVPS () { return m_pcVPS; } |
---|
1326 | |
---|
1327 | Void setSpsInferScalingListFlag( Bool flag ) { m_spsInferScalingListFlag = flag; } |
---|
1328 | Bool getSpsInferScalingListFlag( ) { return m_spsInferScalingListFlag; } |
---|
1329 | |
---|
1330 | Void setSpsScalingListRefLayerId( Int val ) { m_spsScalingListRefLayerId = val; } |
---|
1331 | Int getSpsScalingListRefLayerId( ) { return m_spsScalingListRefLayerId; } |
---|
1332 | |
---|
1333 | Void setUpdateRepFormatFlag( Bool flag ) { m_updateRepFormatFlag = flag; } |
---|
1334 | Bool getUpdateRepFormatFlag( ) { return m_updateRepFormatFlag; } |
---|
1335 | // SPS Extension |
---|
1336 | Void setInterViewMvVertConstraintFlag(Bool val) { m_interViewMvVertConstraintFlag = val; } |
---|
1337 | Bool getInterViewMvVertConstraintFlag() { return m_interViewMvVertConstraintFlag;} |
---|
1338 | // Inference |
---|
1339 | Void inferRepFormat( TComVPS* vps, Int layerIdCurr ); |
---|
1340 | |
---|
1341 | Void inferScalingList( TComSPS* spsSrc ); |
---|
1342 | #endif |
---|
1343 | #if H_3D_QTLPC |
---|
1344 | Void setUseQTL( Bool b ) { m_bUseQTL = b; } |
---|
1345 | Bool getUseQTL() { return m_bUseQTL; } |
---|
1346 | Void setUsePC ( Bool b ) { m_bUsePC = b; } |
---|
1347 | Bool getUsePC () { return m_bUsePC; } |
---|
1348 | #endif |
---|
1349 | #if H_3D |
---|
1350 | Void initCamParaSPS ( UInt uiViewIndex, UInt uiCamParPrecision = 0, Bool bCamParSlice = false, Int** aaiScale = 0, Int** aaiOffset = 0 ); |
---|
1351 | UInt getCamParPrecision () { return m_uiCamParPrecision; } |
---|
1352 | Bool hasCamParInSliceHeader() { return m_bCamParInSliceHeader; } |
---|
1353 | #if QC_DEPTH_IV_MRG_F0125 |
---|
1354 | Void setHasCamParInSliceHeader( Bool b ) { m_bCamParInSliceHeader = b; } |
---|
1355 | #endif |
---|
1356 | Int* getCodedScale () { return m_aaiCodedScale [0]; } |
---|
1357 | Int* getCodedOffset () { return m_aaiCodedOffset[0]; } |
---|
1358 | Int* getInvCodedScale () { return m_aaiCodedScale [1]; } |
---|
1359 | Int* getInvCodedOffset () { return m_aaiCodedOffset[1]; } |
---|
1360 | #endif |
---|
1361 | #if H_MV |
---|
1362 | Int getLayerId () { return m_layerId; } |
---|
1363 | Void setLayerId ( Int val ) { m_layerId = val; } |
---|
1364 | #endif |
---|
1365 | |
---|
1366 | }; |
---|
1367 | |
---|
1368 | /// Reference Picture Lists class |
---|
1369 | class TComRefPicListModification |
---|
1370 | { |
---|
1371 | private: |
---|
1372 | UInt m_bRefPicListModificationFlagL0; |
---|
1373 | UInt m_bRefPicListModificationFlagL1; |
---|
1374 | UInt m_RefPicSetIdxL0[32]; |
---|
1375 | UInt m_RefPicSetIdxL1[32]; |
---|
1376 | |
---|
1377 | public: |
---|
1378 | TComRefPicListModification(); |
---|
1379 | virtual ~TComRefPicListModification(); |
---|
1380 | |
---|
1381 | Void create (); |
---|
1382 | Void destroy (); |
---|
1383 | |
---|
1384 | Bool getRefPicListModificationFlagL0() { return m_bRefPicListModificationFlagL0; } |
---|
1385 | Void setRefPicListModificationFlagL0(Bool flag) { m_bRefPicListModificationFlagL0 = flag; } |
---|
1386 | Bool getRefPicListModificationFlagL1() { return m_bRefPicListModificationFlagL1; } |
---|
1387 | Void setRefPicListModificationFlagL1(Bool flag) { m_bRefPicListModificationFlagL1 = flag; } |
---|
1388 | Void setRefPicSetIdxL0(UInt idx, UInt refPicSetIdx) { m_RefPicSetIdxL0[idx] = refPicSetIdx; } |
---|
1389 | UInt getRefPicSetIdxL0(UInt idx) { return m_RefPicSetIdxL0[idx]; } |
---|
1390 | Void setRefPicSetIdxL1(UInt idx, UInt refPicSetIdx) { m_RefPicSetIdxL1[idx] = refPicSetIdx; } |
---|
1391 | UInt getRefPicSetIdxL1(UInt idx) { return m_RefPicSetIdxL1[idx]; } |
---|
1392 | #if H_MV |
---|
1393 | // Why not an listIdx for all members, would avoid code duplication?? |
---|
1394 | Void setRefPicSetIdxL(UInt li, UInt idx, UInt refPicSetIdx) {( li==0 ? m_RefPicSetIdxL0[idx] : m_RefPicSetIdxL1[idx] ) = refPicSetIdx; } |
---|
1395 | UInt getRefPicSetIdxL(UInt li, UInt idx ) { return ( li == 0 ) ? m_RefPicSetIdxL0[idx] : m_RefPicSetIdxL1[idx] ; } |
---|
1396 | Void setRefPicListModificationFlagL(UInt li, Bool flag) { ( li==0 ? m_bRefPicListModificationFlagL0 : m_bRefPicListModificationFlagL1 ) = flag; } |
---|
1397 | Bool getRefPicListModificationFlagL(UInt li ) { return ( li== 0) ? m_bRefPicListModificationFlagL0 : m_bRefPicListModificationFlagL1; } |
---|
1398 | #endif |
---|
1399 | }; |
---|
1400 | |
---|
1401 | /// PPS class |
---|
1402 | class TComPPS |
---|
1403 | { |
---|
1404 | private: |
---|
1405 | Int m_PPSId; // pic_parameter_set_id |
---|
1406 | Int m_SPSId; // seq_parameter_set_id |
---|
1407 | Int m_picInitQPMinus26; |
---|
1408 | Bool m_useDQP; |
---|
1409 | Bool m_bConstrainedIntraPred; // constrained_intra_pred_flag |
---|
1410 | Bool m_bSliceChromaQpFlag; // slicelevel_chroma_qp_flag |
---|
1411 | |
---|
1412 | // access channel |
---|
1413 | TComSPS* m_pcSPS; |
---|
1414 | UInt m_uiMaxCuDQPDepth; |
---|
1415 | UInt m_uiMinCuDQPSize; |
---|
1416 | |
---|
1417 | Int m_chromaCbQpOffset; |
---|
1418 | Int m_chromaCrQpOffset; |
---|
1419 | |
---|
1420 | UInt m_numRefIdxL0DefaultActive; |
---|
1421 | UInt m_numRefIdxL1DefaultActive; |
---|
1422 | |
---|
1423 | Bool m_bUseWeightPred; // Use of Weighting Prediction (P_SLICE) |
---|
1424 | Bool m_useWeightedBiPred; // Use of Weighting Bi-Prediction (B_SLICE) |
---|
1425 | Bool m_OutputFlagPresentFlag; // Indicates the presence of output_flag in slice header |
---|
1426 | |
---|
1427 | Bool m_TransquantBypassEnableFlag; // Indicates presence of cu_transquant_bypass_flag in CUs. |
---|
1428 | Bool m_useTransformSkip; |
---|
1429 | Bool m_dependentSliceSegmentsEnabledFlag; //!< Indicates the presence of dependent slices |
---|
1430 | Bool m_tilesEnabledFlag; //!< Indicates the presence of tiles |
---|
1431 | Bool m_entropyCodingSyncEnabledFlag; //!< Indicates the presence of wavefronts |
---|
1432 | |
---|
1433 | Bool m_loopFilterAcrossTilesEnabledFlag; |
---|
1434 | Int m_uniformSpacingFlag; |
---|
1435 | Int m_iNumColumnsMinus1; |
---|
1436 | UInt* m_puiColumnWidth; |
---|
1437 | Int m_iNumRowsMinus1; |
---|
1438 | UInt* m_puiRowHeight; |
---|
1439 | |
---|
1440 | Int m_iNumSubstreams; |
---|
1441 | |
---|
1442 | Int m_signHideFlag; |
---|
1443 | |
---|
1444 | Bool m_cabacInitPresentFlag; |
---|
1445 | UInt m_encCABACTableIdx; // Used to transmit table selection across slices |
---|
1446 | |
---|
1447 | Bool m_sliceHeaderExtensionPresentFlag; |
---|
1448 | Bool m_loopFilterAcrossSlicesEnabledFlag; |
---|
1449 | Bool m_deblockingFilterControlPresentFlag; |
---|
1450 | Bool m_deblockingFilterOverrideEnabledFlag; |
---|
1451 | Bool m_picDisableDeblockingFilterFlag; |
---|
1452 | Int m_deblockingFilterBetaOffsetDiv2; //< beta offset for deblocking filter |
---|
1453 | Int m_deblockingFilterTcOffsetDiv2; //< tc offset for deblocking filter |
---|
1454 | Bool m_scalingListPresentFlag; |
---|
1455 | TComScalingList* m_scalingList; //!< ScalingList class pointer |
---|
1456 | Bool m_listsModificationPresentFlag; |
---|
1457 | UInt m_log2ParallelMergeLevelMinus2; |
---|
1458 | Int m_numExtraSliceHeaderBits; |
---|
1459 | |
---|
1460 | #if H_MV |
---|
1461 | Int m_layerId; |
---|
1462 | Bool m_ppsInferScalingListFlag; |
---|
1463 | Int m_ppsScalingListRefLayerId; |
---|
1464 | #endif |
---|
1465 | public: |
---|
1466 | TComPPS(); |
---|
1467 | virtual ~TComPPS(); |
---|
1468 | |
---|
1469 | Int getPPSId () { return m_PPSId; } |
---|
1470 | Void setPPSId (Int i) { m_PPSId = i; } |
---|
1471 | Int getSPSId () { return m_SPSId; } |
---|
1472 | Void setSPSId (Int i) { m_SPSId = i; } |
---|
1473 | |
---|
1474 | Int getPicInitQPMinus26 () { return m_picInitQPMinus26; } |
---|
1475 | Void setPicInitQPMinus26 ( Int i ) { m_picInitQPMinus26 = i; } |
---|
1476 | Bool getUseDQP () { return m_useDQP; } |
---|
1477 | Void setUseDQP ( Bool b ) { m_useDQP = b; } |
---|
1478 | Bool getConstrainedIntraPred () { return m_bConstrainedIntraPred; } |
---|
1479 | Void setConstrainedIntraPred ( Bool b ) { m_bConstrainedIntraPred = b; } |
---|
1480 | Bool getSliceChromaQpFlag () { return m_bSliceChromaQpFlag; } |
---|
1481 | Void setSliceChromaQpFlag ( Bool b ) { m_bSliceChromaQpFlag = b; } |
---|
1482 | |
---|
1483 | Void setSPS ( TComSPS* pcSPS ) { m_pcSPS = pcSPS; } |
---|
1484 | TComSPS* getSPS () { return m_pcSPS; } |
---|
1485 | Void setMaxCuDQPDepth ( UInt u ) { m_uiMaxCuDQPDepth = u; } |
---|
1486 | UInt getMaxCuDQPDepth () { return m_uiMaxCuDQPDepth;} |
---|
1487 | Void setMinCuDQPSize ( UInt u ) { m_uiMinCuDQPSize = u; } |
---|
1488 | UInt getMinCuDQPSize () { return m_uiMinCuDQPSize; } |
---|
1489 | |
---|
1490 | Void setChromaCbQpOffset( Int i ) { m_chromaCbQpOffset = i; } |
---|
1491 | Int getChromaCbQpOffset() { return m_chromaCbQpOffset; } |
---|
1492 | Void setChromaCrQpOffset( Int i ) { m_chromaCrQpOffset = i; } |
---|
1493 | Int getChromaCrQpOffset() { return m_chromaCrQpOffset; } |
---|
1494 | |
---|
1495 | Void setNumRefIdxL0DefaultActive(UInt ui) { m_numRefIdxL0DefaultActive=ui; } |
---|
1496 | UInt getNumRefIdxL0DefaultActive() { return m_numRefIdxL0DefaultActive; } |
---|
1497 | Void setNumRefIdxL1DefaultActive(UInt ui) { m_numRefIdxL1DefaultActive=ui; } |
---|
1498 | UInt getNumRefIdxL1DefaultActive() { return m_numRefIdxL1DefaultActive; } |
---|
1499 | |
---|
1500 | Bool getUseWP () { return m_bUseWeightPred; } |
---|
1501 | Bool getWPBiPred () { return m_useWeightedBiPred; } |
---|
1502 | Void setUseWP ( Bool b ) { m_bUseWeightPred = b; } |
---|
1503 | Void setWPBiPred ( Bool b ) { m_useWeightedBiPred = b; } |
---|
1504 | Void setOutputFlagPresentFlag( Bool b ) { m_OutputFlagPresentFlag = b; } |
---|
1505 | Bool getOutputFlagPresentFlag() { return m_OutputFlagPresentFlag; } |
---|
1506 | Void setTransquantBypassEnableFlag( Bool b ) { m_TransquantBypassEnableFlag = b; } |
---|
1507 | Bool getTransquantBypassEnableFlag() { return m_TransquantBypassEnableFlag; } |
---|
1508 | |
---|
1509 | Bool getUseTransformSkip () { return m_useTransformSkip; } |
---|
1510 | Void setUseTransformSkip ( Bool b ) { m_useTransformSkip = b; } |
---|
1511 | |
---|
1512 | Void setLoopFilterAcrossTilesEnabledFlag (Bool b) { m_loopFilterAcrossTilesEnabledFlag = b; } |
---|
1513 | Bool getLoopFilterAcrossTilesEnabledFlag () { return m_loopFilterAcrossTilesEnabledFlag; } |
---|
1514 | Bool getDependentSliceSegmentsEnabledFlag() const { return m_dependentSliceSegmentsEnabledFlag; } |
---|
1515 | Void setDependentSliceSegmentsEnabledFlag(Bool val) { m_dependentSliceSegmentsEnabledFlag = val; } |
---|
1516 | Bool getTilesEnabledFlag() const { return m_tilesEnabledFlag; } |
---|
1517 | Void setTilesEnabledFlag(Bool val) { m_tilesEnabledFlag = val; } |
---|
1518 | Bool getEntropyCodingSyncEnabledFlag() const { return m_entropyCodingSyncEnabledFlag; } |
---|
1519 | Void setEntropyCodingSyncEnabledFlag(Bool val) { m_entropyCodingSyncEnabledFlag = val; } |
---|
1520 | Void setUniformSpacingFlag ( Bool b ) { m_uniformSpacingFlag = b; } |
---|
1521 | Bool getUniformSpacingFlag () { return m_uniformSpacingFlag; } |
---|
1522 | Void setNumColumnsMinus1 ( Int i ) { m_iNumColumnsMinus1 = i; } |
---|
1523 | Int getNumColumnsMinus1 () { return m_iNumColumnsMinus1; } |
---|
1524 | Void setColumnWidth ( UInt* columnWidth ) |
---|
1525 | { |
---|
1526 | if( m_uniformSpacingFlag == 0 && m_iNumColumnsMinus1 > 0 ) |
---|
1527 | { |
---|
1528 | m_puiColumnWidth = new UInt[ m_iNumColumnsMinus1 ]; |
---|
1529 | |
---|
1530 | for(Int i=0; i<m_iNumColumnsMinus1; i++) |
---|
1531 | { |
---|
1532 | m_puiColumnWidth[i] = columnWidth[i]; |
---|
1533 | } |
---|
1534 | } |
---|
1535 | } |
---|
1536 | UInt getColumnWidth (UInt columnIdx) { return *( m_puiColumnWidth + columnIdx ); } |
---|
1537 | Void setNumRowsMinus1( Int i ) { m_iNumRowsMinus1 = i; } |
---|
1538 | Int getNumRowsMinus1() { return m_iNumRowsMinus1; } |
---|
1539 | Void setRowHeight ( UInt* rowHeight ) |
---|
1540 | { |
---|
1541 | if( m_uniformSpacingFlag == 0 && m_iNumRowsMinus1 > 0 ) |
---|
1542 | { |
---|
1543 | m_puiRowHeight = new UInt[ m_iNumRowsMinus1 ]; |
---|
1544 | |
---|
1545 | for(Int i=0; i<m_iNumRowsMinus1; i++) |
---|
1546 | { |
---|
1547 | m_puiRowHeight[i] = rowHeight[i]; |
---|
1548 | } |
---|
1549 | } |
---|
1550 | } |
---|
1551 | UInt getRowHeight (UInt rowIdx) { return *( m_puiRowHeight + rowIdx ); } |
---|
1552 | Void setNumSubstreams(Int iNumSubstreams) { m_iNumSubstreams = iNumSubstreams; } |
---|
1553 | Int getNumSubstreams() { return m_iNumSubstreams; } |
---|
1554 | |
---|
1555 | Void setSignHideFlag( Int signHideFlag ) { m_signHideFlag = signHideFlag; } |
---|
1556 | Int getSignHideFlag() { return m_signHideFlag; } |
---|
1557 | |
---|
1558 | Void setCabacInitPresentFlag( Bool flag ) { m_cabacInitPresentFlag = flag; } |
---|
1559 | Void setEncCABACTableIdx( Int idx ) { m_encCABACTableIdx = idx; } |
---|
1560 | Bool getCabacInitPresentFlag() { return m_cabacInitPresentFlag; } |
---|
1561 | UInt getEncCABACTableIdx() { return m_encCABACTableIdx; } |
---|
1562 | Void setDeblockingFilterControlPresentFlag( Bool val ) { m_deblockingFilterControlPresentFlag = val; } |
---|
1563 | Bool getDeblockingFilterControlPresentFlag() { return m_deblockingFilterControlPresentFlag; } |
---|
1564 | Void setDeblockingFilterOverrideEnabledFlag( Bool val ) { m_deblockingFilterOverrideEnabledFlag = val; } |
---|
1565 | Bool getDeblockingFilterOverrideEnabledFlag() { return m_deblockingFilterOverrideEnabledFlag; } |
---|
1566 | Void setPicDisableDeblockingFilterFlag(Bool val) { m_picDisableDeblockingFilterFlag = val; } //!< set offset for deblocking filter disabled |
---|
1567 | Bool getPicDisableDeblockingFilterFlag() { return m_picDisableDeblockingFilterFlag; } //!< get offset for deblocking filter disabled |
---|
1568 | Void setDeblockingFilterBetaOffsetDiv2(Int val) { m_deblockingFilterBetaOffsetDiv2 = val; } //!< set beta offset for deblocking filter |
---|
1569 | Int getDeblockingFilterBetaOffsetDiv2() { return m_deblockingFilterBetaOffsetDiv2; } //!< get beta offset for deblocking filter |
---|
1570 | Void setDeblockingFilterTcOffsetDiv2(Int val) { m_deblockingFilterTcOffsetDiv2 = val; } //!< set tc offset for deblocking filter |
---|
1571 | Int getDeblockingFilterTcOffsetDiv2() { return m_deblockingFilterTcOffsetDiv2; } //!< get tc offset for deblocking filter |
---|
1572 | Bool getScalingListPresentFlag() { return m_scalingListPresentFlag; } |
---|
1573 | Void setScalingListPresentFlag( Bool b ) { m_scalingListPresentFlag = b; } |
---|
1574 | Void setScalingList ( TComScalingList *scalingList); |
---|
1575 | TComScalingList* getScalingList () { return m_scalingList; } //!< get ScalingList class pointer in PPS |
---|
1576 | Bool getListsModificationPresentFlag () { return m_listsModificationPresentFlag; } |
---|
1577 | Void setListsModificationPresentFlag ( Bool b ) { m_listsModificationPresentFlag = b; } |
---|
1578 | UInt getLog2ParallelMergeLevelMinus2 () { return m_log2ParallelMergeLevelMinus2; } |
---|
1579 | Void setLog2ParallelMergeLevelMinus2 (UInt mrgLevel) { m_log2ParallelMergeLevelMinus2 = mrgLevel; } |
---|
1580 | Int getNumExtraSliceHeaderBits() { return m_numExtraSliceHeaderBits; } |
---|
1581 | Void setNumExtraSliceHeaderBits(Int i) { m_numExtraSliceHeaderBits = i; } |
---|
1582 | Void setLoopFilterAcrossSlicesEnabledFlag ( Bool bValue ) { m_loopFilterAcrossSlicesEnabledFlag = bValue; } |
---|
1583 | Bool getLoopFilterAcrossSlicesEnabledFlag () { return m_loopFilterAcrossSlicesEnabledFlag; } |
---|
1584 | Bool getSliceHeaderExtensionPresentFlag () { return m_sliceHeaderExtensionPresentFlag; } |
---|
1585 | Void setSliceHeaderExtensionPresentFlag (Bool val) { m_sliceHeaderExtensionPresentFlag = val; } |
---|
1586 | #if H_MV |
---|
1587 | Void setLayerId( Int val ) { m_layerId = val; } |
---|
1588 | Int getLayerId( ) { return m_layerId; } |
---|
1589 | |
---|
1590 | Void setPpsInferScalingListFlag( Bool flag ) { m_ppsInferScalingListFlag = flag; } |
---|
1591 | Bool getPpsInferScalingListFlag( ) { return m_ppsInferScalingListFlag; } |
---|
1592 | |
---|
1593 | Void setPpsScalingListRefLayerId( Int val ) { m_ppsScalingListRefLayerId = val; } |
---|
1594 | Int getPpsScalingListRefLayerId( ) { return m_ppsScalingListRefLayerId; } |
---|
1595 | #endif |
---|
1596 | }; |
---|
1597 | |
---|
1598 | typedef struct |
---|
1599 | { |
---|
1600 | // Explicit weighted prediction parameters parsed in slice header, |
---|
1601 | // or Implicit weighted prediction parameters (8 bits depth values). |
---|
1602 | Bool bPresentFlag; |
---|
1603 | UInt uiLog2WeightDenom; |
---|
1604 | Int iWeight; |
---|
1605 | Int iOffset; |
---|
1606 | |
---|
1607 | // Weighted prediction scaling values built from above parameters (bitdepth scaled): |
---|
1608 | Int w, o, offset, shift, round; |
---|
1609 | } wpScalingParam; |
---|
1610 | |
---|
1611 | typedef struct |
---|
1612 | { |
---|
1613 | Int64 iAC; |
---|
1614 | Int64 iDC; |
---|
1615 | } wpACDCParam; |
---|
1616 | |
---|
1617 | /// slice header class |
---|
1618 | class TComSlice |
---|
1619 | { |
---|
1620 | |
---|
1621 | private: |
---|
1622 | // Bitstream writing |
---|
1623 | Bool m_saoEnabledFlag; |
---|
1624 | Bool m_saoEnabledFlagChroma; ///< SAO Cb&Cr enabled flag |
---|
1625 | Int m_iPPSId; ///< picture parameter set ID |
---|
1626 | Bool m_PicOutputFlag; ///< pic_output_flag |
---|
1627 | Int m_iPOC; |
---|
1628 | #if H_MV |
---|
1629 | Int m_iPOCBeforeReset; |
---|
1630 | #endif |
---|
1631 | Int m_iLastIDR; |
---|
1632 | Int m_iAssociatedIRAP; |
---|
1633 | NalUnitType m_iAssociatedIRAPType; |
---|
1634 | static Int m_prevTid0POC; |
---|
1635 | TComReferencePictureSet *m_pcRPS; |
---|
1636 | TComReferencePictureSet m_LocalRPS; |
---|
1637 | Int m_iBDidx; |
---|
1638 | TComRefPicListModification m_RefPicListModification; |
---|
1639 | NalUnitType m_eNalUnitType; ///< Nal unit type for the slice |
---|
1640 | SliceType m_eSliceType; |
---|
1641 | Int m_iSliceQp; |
---|
1642 | Bool m_dependentSliceSegmentFlag; |
---|
1643 | #if ADAPTIVE_QP_SELECTION |
---|
1644 | Int m_iSliceQpBase; |
---|
1645 | #endif |
---|
1646 | Bool m_deblockingFilterDisable; |
---|
1647 | Bool m_deblockingFilterOverrideFlag; //< offsets for deblocking filter inherit from PPS |
---|
1648 | Int m_deblockingFilterBetaOffsetDiv2; //< beta offset for deblocking filter |
---|
1649 | Int m_deblockingFilterTcOffsetDiv2; //< tc offset for deblocking filter |
---|
1650 | Int m_list1IdxToList0Idx[MAX_NUM_REF]; |
---|
1651 | Int m_aiNumRefIdx [2]; // for multiple reference of current slice |
---|
1652 | |
---|
1653 | Bool m_bCheckLDC; |
---|
1654 | |
---|
1655 | // Data |
---|
1656 | Int m_iSliceQpDelta; |
---|
1657 | Int m_iSliceQpDeltaCb; |
---|
1658 | Int m_iSliceQpDeltaCr; |
---|
1659 | TComPic* m_apcRefPicList [2][MAX_NUM_REF+1]; |
---|
1660 | Int m_aiRefPOCList [2][MAX_NUM_REF+1]; |
---|
1661 | #if H_MV |
---|
1662 | Int m_aiRefLayerIdList[2][MAX_NUM_REF+1]; |
---|
1663 | #endif |
---|
1664 | Bool m_bIsUsedAsLongTerm[2][MAX_NUM_REF+1]; |
---|
1665 | Int m_iDepth; |
---|
1666 | |
---|
1667 | // referenced slice? |
---|
1668 | Bool m_bRefenced; |
---|
1669 | |
---|
1670 | // access channel |
---|
1671 | TComVPS* m_pcVPS; |
---|
1672 | TComSPS* m_pcSPS; |
---|
1673 | TComPPS* m_pcPPS; |
---|
1674 | TComPic* m_pcPic; |
---|
1675 | #if ADAPTIVE_QP_SELECTION |
---|
1676 | TComTrQuant* m_pcTrQuant; |
---|
1677 | #endif |
---|
1678 | UInt m_colFromL0Flag; // collocated picture from List0 flag |
---|
1679 | |
---|
1680 | UInt m_colRefIdx; |
---|
1681 | UInt m_maxNumMergeCand; |
---|
1682 | |
---|
1683 | |
---|
1684 | #if SAO_CHROMA_LAMBDA |
---|
1685 | Double m_dLambdaLuma; |
---|
1686 | Double m_dLambdaChroma; |
---|
1687 | #else |
---|
1688 | Double m_dLambda; |
---|
1689 | #endif |
---|
1690 | |
---|
1691 | Bool m_abEqualRef [2][MAX_NUM_REF][MAX_NUM_REF]; |
---|
1692 | UInt m_uiTLayer; |
---|
1693 | Bool m_bTLayerSwitchingFlag; |
---|
1694 | |
---|
1695 | UInt m_sliceMode; |
---|
1696 | UInt m_sliceArgument; |
---|
1697 | UInt m_sliceCurStartCUAddr; |
---|
1698 | UInt m_sliceCurEndCUAddr; |
---|
1699 | UInt m_sliceIdx; |
---|
1700 | UInt m_sliceSegmentMode; |
---|
1701 | UInt m_sliceSegmentArgument; |
---|
1702 | UInt m_sliceSegmentCurStartCUAddr; |
---|
1703 | UInt m_sliceSegmentCurEndCUAddr; |
---|
1704 | Bool m_nextSlice; |
---|
1705 | Bool m_nextSliceSegment; |
---|
1706 | UInt m_sliceBits; |
---|
1707 | UInt m_sliceSegmentBits; |
---|
1708 | Bool m_bFinalized; |
---|
1709 | |
---|
1710 | wpScalingParam m_weightPredTable[2][MAX_NUM_REF][3]; // [REF_PIC_LIST_0 or REF_PIC_LIST_1][refIdx][0:Y, 1:U, 2:V] |
---|
1711 | wpACDCParam m_weightACDCParam[3]; // [0:Y, 1:U, 2:V] |
---|
1712 | |
---|
1713 | std::vector<UInt> m_tileByteLocation; |
---|
1714 | UInt m_uiTileOffstForMultES; |
---|
1715 | |
---|
1716 | UInt* m_puiSubstreamSizes; |
---|
1717 | TComScalingList* m_scalingList; //!< pointer of quantization matrix |
---|
1718 | Bool m_cabacInitFlag; |
---|
1719 | |
---|
1720 | Bool m_bLMvdL1Zero; |
---|
1721 | Int m_numEntryPointOffsets; |
---|
1722 | Bool m_temporalLayerNonReferenceFlag; |
---|
1723 | Bool m_LFCrossSliceBoundaryFlag; |
---|
1724 | |
---|
1725 | Bool m_enableTMVPFlag; |
---|
1726 | #if H_MV |
---|
1727 | std::vector<TComPic*>* m_refPicSetInterLayer0; |
---|
1728 | std::vector<TComPic*>* m_refPicSetInterLayer1; |
---|
1729 | Int m_layerId; |
---|
1730 | Int m_viewId; |
---|
1731 | Int m_viewIndex; |
---|
1732 | #if H_3D |
---|
1733 | Bool m_isDepth; |
---|
1734 | #endif |
---|
1735 | |
---|
1736 | // Additional slice header syntax elements |
---|
1737 | Bool m_pocResetFlag; |
---|
1738 | Bool m_discardableFlag; |
---|
1739 | Bool m_interLayerPredEnabledFlag; |
---|
1740 | Int m_numInterLayerRefPicsMinus1; |
---|
1741 | Int m_interLayerPredLayerIdc [MAX_NUM_LAYERS]; |
---|
1742 | Int m_aaiCodedScale [2][MAX_NUM_LAYERS]; |
---|
1743 | Int m_aaiCodedOffset[2][MAX_NUM_LAYERS]; |
---|
1744 | #if H_3D_TMVP |
---|
1745 | Int m_aiAlterRefIdx [2]; |
---|
1746 | #endif |
---|
1747 | #if H_3D_ARP |
---|
1748 | #if SHARP_ARP_REF_CHECK_F0105 |
---|
1749 | Bool m_arpRefPicAvailable[2][MAX_NUM_LAYERS]; |
---|
1750 | #endif |
---|
1751 | TComList<TComPic*> * m_pBaseViewRefPicList[MAX_NUM_LAYERS]; |
---|
1752 | UInt m_nARPStepNum; |
---|
1753 | #if QC_MTK_INTERVIEW_ARP_F0123_F0108 |
---|
1754 | Int m_aiFirstTRefIdx [2]; |
---|
1755 | #endif |
---|
1756 | #endif |
---|
1757 | #if H_3D_IC |
---|
1758 | Bool m_bApplyIC; |
---|
1759 | Bool m_icSkipParseFlag; |
---|
1760 | #endif |
---|
1761 | #if H_3D |
---|
1762 | TComPic* m_ivPicsCurrPoc [2][MAX_NUM_LAYERS]; |
---|
1763 | Int** m_depthToDisparityB; |
---|
1764 | Int** m_depthToDisparityF; |
---|
1765 | #endif |
---|
1766 | #endif |
---|
1767 | public: |
---|
1768 | TComSlice(); |
---|
1769 | virtual ~TComSlice(); |
---|
1770 | Void initSlice (); |
---|
1771 | |
---|
1772 | Void setVPS ( TComVPS* pcVPS ) { m_pcVPS = pcVPS; } |
---|
1773 | TComVPS* getVPS () { return m_pcVPS; } |
---|
1774 | Void setSPS ( TComSPS* pcSPS ) { m_pcSPS = pcSPS; } |
---|
1775 | TComSPS* getSPS () { return m_pcSPS; } |
---|
1776 | |
---|
1777 | Void setPPS ( TComPPS* pcPPS ) { assert(pcPPS!=NULL); m_pcPPS = pcPPS; m_iPPSId = pcPPS->getPPSId(); } |
---|
1778 | TComPPS* getPPS () { return m_pcPPS; } |
---|
1779 | |
---|
1780 | #if ADAPTIVE_QP_SELECTION |
---|
1781 | Void setTrQuant ( TComTrQuant* pcTrQuant ) { m_pcTrQuant = pcTrQuant; } |
---|
1782 | TComTrQuant* getTrQuant () { return m_pcTrQuant; } |
---|
1783 | #endif |
---|
1784 | |
---|
1785 | Void setPPSId ( Int PPSId ) { m_iPPSId = PPSId; } |
---|
1786 | Int getPPSId () { return m_iPPSId; } |
---|
1787 | Void setPicOutputFlag( Bool b ) { m_PicOutputFlag = b; } |
---|
1788 | Bool getPicOutputFlag() { return m_PicOutputFlag; } |
---|
1789 | Void setSaoEnabledFlag(Bool s) {m_saoEnabledFlag =s; } |
---|
1790 | Bool getSaoEnabledFlag() { return m_saoEnabledFlag; } |
---|
1791 | Void setSaoEnabledFlagChroma(Bool s) {m_saoEnabledFlagChroma =s; } //!< set SAO Cb&Cr enabled flag |
---|
1792 | Bool getSaoEnabledFlagChroma() { return m_saoEnabledFlagChroma; } //!< get SAO Cb&Cr enabled flag |
---|
1793 | Void setRPS ( TComReferencePictureSet *pcRPS ) { m_pcRPS = pcRPS; } |
---|
1794 | TComReferencePictureSet* getRPS () { return m_pcRPS; } |
---|
1795 | TComReferencePictureSet* getLocalRPS () { return &m_LocalRPS; } |
---|
1796 | |
---|
1797 | Void setRPSidx ( Int iBDidx ) { m_iBDidx = iBDidx; } |
---|
1798 | Int getRPSidx () { return m_iBDidx; } |
---|
1799 | Int getPrevTid0POC () { return m_prevTid0POC; } |
---|
1800 | TComRefPicListModification* getRefPicListModification() { return &m_RefPicListModification; } |
---|
1801 | Void setLastIDR(Int iIDRPOC) { m_iLastIDR = iIDRPOC; } |
---|
1802 | Int getLastIDR() { return m_iLastIDR; } |
---|
1803 | Void setAssociatedIRAPPOC(Int iAssociatedIRAPPOC) { m_iAssociatedIRAP = iAssociatedIRAPPOC; } |
---|
1804 | Int getAssociatedIRAPPOC() { return m_iAssociatedIRAP; } |
---|
1805 | Void setAssociatedIRAPType(NalUnitType associatedIRAPType) { m_iAssociatedIRAPType = associatedIRAPType; } |
---|
1806 | NalUnitType getAssociatedIRAPType() { return m_iAssociatedIRAPType; } |
---|
1807 | SliceType getSliceType () { return m_eSliceType; } |
---|
1808 | Int getPOC () { return m_iPOC; } |
---|
1809 | Int getSliceQp () { return m_iSliceQp; } |
---|
1810 | Bool getDependentSliceSegmentFlag() const { return m_dependentSliceSegmentFlag; } |
---|
1811 | void setDependentSliceSegmentFlag(Bool val) { m_dependentSliceSegmentFlag = val; } |
---|
1812 | #if ADAPTIVE_QP_SELECTION |
---|
1813 | Int getSliceQpBase () { return m_iSliceQpBase; } |
---|
1814 | #endif |
---|
1815 | Int getSliceQpDelta () { return m_iSliceQpDelta; } |
---|
1816 | Int getSliceQpDeltaCb () { return m_iSliceQpDeltaCb; } |
---|
1817 | Int getSliceQpDeltaCr () { return m_iSliceQpDeltaCr; } |
---|
1818 | Bool getDeblockingFilterDisable() { return m_deblockingFilterDisable; } |
---|
1819 | Bool getDeblockingFilterOverrideFlag() { return m_deblockingFilterOverrideFlag; } |
---|
1820 | Int getDeblockingFilterBetaOffsetDiv2() { return m_deblockingFilterBetaOffsetDiv2; } |
---|
1821 | Int getDeblockingFilterTcOffsetDiv2() { return m_deblockingFilterTcOffsetDiv2; } |
---|
1822 | |
---|
1823 | Int getNumRefIdx ( RefPicList e ) { return m_aiNumRefIdx[e]; } |
---|
1824 | TComPic* getPic () { return m_pcPic; } |
---|
1825 | TComPic* getRefPic ( RefPicList e, Int iRefIdx) { return m_apcRefPicList[e][iRefIdx]; } |
---|
1826 | Int getRefPOC ( RefPicList e, Int iRefIdx) { return m_aiRefPOCList[e][iRefIdx]; } |
---|
1827 | #if H_3D |
---|
1828 | TComPic* getIvPic ( Bool depthFlag, Int viewIndex){ return m_ivPicsCurrPoc[ depthFlag ? 1 : 0 ][ viewIndex ]; } |
---|
1829 | #endif |
---|
1830 | #if H_3D |
---|
1831 | TComPic* getTexturePic () { return m_ivPicsCurrPoc[0][ m_viewIndex ]; } |
---|
1832 | #endif |
---|
1833 | #if H_3D_IC |
---|
1834 | Void setApplyIC( Bool b ) { m_bApplyIC = b; } |
---|
1835 | Bool getApplyIC() { return m_bApplyIC; } |
---|
1836 | Void xSetApplyIC(); |
---|
1837 | Void setIcSkipParseFlag( Bool b ) { m_icSkipParseFlag = b; } |
---|
1838 | Bool getIcSkipParseFlag() { return m_icSkipParseFlag; } |
---|
1839 | #endif |
---|
1840 | #if H_3D_ARP |
---|
1841 | Void setBaseViewRefPicList( TComList<TComPic*> *pListPic, Int iViewIdx ) { m_pBaseViewRefPicList[iViewIdx] = pListPic; } |
---|
1842 | #if SHARP_ARP_REF_CHECK_F0105 |
---|
1843 | Void setARPStepNum( TComPicLists*ivPicLists ); |
---|
1844 | #else |
---|
1845 | Void setARPStepNum(); |
---|
1846 | #endif |
---|
1847 | TComPic* getBaseViewRefPic ( UInt uiPOC , Int iViewIdx ) { return xGetRefPic( *m_pBaseViewRefPicList[iViewIdx], uiPOC ); } |
---|
1848 | UInt getARPStepNum( ) { return m_nARPStepNum; } |
---|
1849 | #endif |
---|
1850 | Int getDepth () { return m_iDepth; } |
---|
1851 | UInt getColFromL0Flag () { return m_colFromL0Flag; } |
---|
1852 | UInt getColRefIdx () { return m_colRefIdx; } |
---|
1853 | Void checkColRefIdx (UInt curSliceIdx, TComPic* pic); |
---|
1854 | Bool getIsUsedAsLongTerm (Int i, Int j) { return m_bIsUsedAsLongTerm[i][j]; } |
---|
1855 | Void setIsUsedAsLongTerm (Int i, Int j, Bool value) { m_bIsUsedAsLongTerm[i][j] = value; } |
---|
1856 | Bool getCheckLDC () { return m_bCheckLDC; } |
---|
1857 | Bool getMvdL1ZeroFlag () { return m_bLMvdL1Zero; } |
---|
1858 | Int getNumRpsCurrTempList(); |
---|
1859 | Int getList1IdxToList0Idx ( Int list1Idx ) { return m_list1IdxToList0Idx[list1Idx]; } |
---|
1860 | Void setReferenced(Bool b) { m_bRefenced = b; } |
---|
1861 | Bool isReferenced() { return m_bRefenced; } |
---|
1862 | Bool isReferenceNalu() { return ((getNalUnitType() <= NAL_UNIT_RESERVED_VCL_R15) && (getNalUnitType()%2 != 0)) || ((getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP) && (getNalUnitType() <= NAL_UNIT_RESERVED_IRAP_VCL23) ); } |
---|
1863 | Void setPOC ( Int i ) { m_iPOC = i; if ((getTLayer()==0) && (isReferenceNalu() && (getNalUnitType()!=NAL_UNIT_CODED_SLICE_RASL_R)&& (getNalUnitType()!=NAL_UNIT_CODED_SLICE_RADL_R))) {m_prevTid0POC=i;} } |
---|
1864 | Void setNalUnitType ( NalUnitType e ) { m_eNalUnitType = e; } |
---|
1865 | NalUnitType getNalUnitType () const { return m_eNalUnitType; } |
---|
1866 | Bool getRapPicFlag (); |
---|
1867 | Bool getIdrPicFlag () { return getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP; } |
---|
1868 | Bool isIRAP () const { return (getNalUnitType() >= 16) && (getNalUnitType() <= 23); } |
---|
1869 | Void checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, NalUnitType& associatedIRAPType, TComList<TComPic *>& rcListPic); |
---|
1870 | Void decodingRefreshMarking(Int& pocCRA, Bool& bRefreshPending, TComList<TComPic*>& rcListPic); |
---|
1871 | Void setSliceType ( SliceType e ) { m_eSliceType = e; } |
---|
1872 | Void setSliceQp ( Int i ) { m_iSliceQp = i; } |
---|
1873 | #if ADAPTIVE_QP_SELECTION |
---|
1874 | Void setSliceQpBase ( Int i ) { m_iSliceQpBase = i; } |
---|
1875 | #endif |
---|
1876 | Void setSliceQpDelta ( Int i ) { m_iSliceQpDelta = i; } |
---|
1877 | Void setSliceQpDeltaCb ( Int i ) { m_iSliceQpDeltaCb = i; } |
---|
1878 | Void setSliceQpDeltaCr ( Int i ) { m_iSliceQpDeltaCr = i; } |
---|
1879 | Void setDeblockingFilterDisable( Bool b ) { m_deblockingFilterDisable= b; } |
---|
1880 | Void setDeblockingFilterOverrideFlag( Bool b ) { m_deblockingFilterOverrideFlag = b; } |
---|
1881 | Void setDeblockingFilterBetaOffsetDiv2( Int i ) { m_deblockingFilterBetaOffsetDiv2 = i; } |
---|
1882 | Void setDeblockingFilterTcOffsetDiv2( Int i ) { m_deblockingFilterTcOffsetDiv2 = i; } |
---|
1883 | |
---|
1884 | Void setRefPic ( TComPic* p, RefPicList e, Int iRefIdx ) { m_apcRefPicList[e][iRefIdx] = p; } |
---|
1885 | Void setRefPOC ( Int i, RefPicList e, Int iRefIdx ) { m_aiRefPOCList[e][iRefIdx] = i; } |
---|
1886 | Void setNumRefIdx ( RefPicList e, Int i ) { m_aiNumRefIdx[e] = i; } |
---|
1887 | Void setPic ( TComPic* p ) { m_pcPic = p; } |
---|
1888 | Void setDepth ( Int iDepth ) { m_iDepth = iDepth; } |
---|
1889 | |
---|
1890 | #if H_MV |
---|
1891 | Void setPocBeforeReset ( Int i ) { m_iPOCBeforeReset = i; } |
---|
1892 | Int getPocBeforeReset ( ) { return m_iPOCBeforeReset; } |
---|
1893 | Int getRefLayerId ( RefPicList e, Int iRefIdx) { return m_aiRefLayerIdList[e][iRefIdx]; } |
---|
1894 | Void setRefLayerId ( Int i, RefPicList e, Int iRefIdx ) { m_aiRefLayerIdList[e][iRefIdx] = i; } |
---|
1895 | Void getTempRefPicLists ( TComList<TComPic*>& rcListPic, std::vector<TComPic*>& refPicSetInterLayer0, std::vector<TComPic*>& refPicSetInterLayer1, |
---|
1896 | std::vector<TComPic*> rpsCurrList[2], std::vector<Bool> usedAsLongTerm[2], Int& numPocTotalCurr, Bool checkNumPocTotalCurr = false ); |
---|
1897 | |
---|
1898 | Void setRefPicList ( std::vector<TComPic*> rpsCurrList[2], std::vector<Bool> usedAsLongTerm[2], Int numPocTotalCurr, Bool checkNumPocTotalCurr = false ); |
---|
1899 | #else |
---|
1900 | #if FIX1071 |
---|
1901 | Void setRefPicList ( TComList<TComPic*>& rcListPic, Bool checkNumPocTotalCurr = false ); |
---|
1902 | #else |
---|
1903 | Void setRefPicList ( TComList<TComPic*>& rcListPic ); |
---|
1904 | #endif |
---|
1905 | #endif |
---|
1906 | Void setRefPOCList (); |
---|
1907 | Void setColFromL0Flag ( UInt colFromL0 ) { m_colFromL0Flag = colFromL0; } |
---|
1908 | Void setColRefIdx ( UInt refIdx) { m_colRefIdx = refIdx; } |
---|
1909 | Void setCheckLDC ( Bool b ) { m_bCheckLDC = b; } |
---|
1910 | Void setMvdL1ZeroFlag ( Bool b) { m_bLMvdL1Zero = b; } |
---|
1911 | |
---|
1912 | Bool isIntra () { return m_eSliceType == I_SLICE; } |
---|
1913 | Bool isInterB () { return m_eSliceType == B_SLICE; } |
---|
1914 | Bool isInterP () { return m_eSliceType == P_SLICE; } |
---|
1915 | |
---|
1916 | #if SAO_CHROMA_LAMBDA |
---|
1917 | Void setLambda( Double d, Double e ) { m_dLambdaLuma = d; m_dLambdaChroma = e;} |
---|
1918 | Double getLambdaLuma() { return m_dLambdaLuma; } |
---|
1919 | Double getLambdaChroma() { return m_dLambdaChroma; } |
---|
1920 | #else |
---|
1921 | Void setLambda( Double d ) { m_dLambda = d; } |
---|
1922 | Double getLambda() { return m_dLambda; } |
---|
1923 | #endif |
---|
1924 | |
---|
1925 | Void initEqualRef(); |
---|
1926 | Bool isEqualRef ( RefPicList e, Int iRefIdx1, Int iRefIdx2 ) |
---|
1927 | { |
---|
1928 | if (iRefIdx1 < 0 || iRefIdx2 < 0) return false; |
---|
1929 | return m_abEqualRef[e][iRefIdx1][iRefIdx2]; |
---|
1930 | } |
---|
1931 | |
---|
1932 | Void setEqualRef( RefPicList e, Int iRefIdx1, Int iRefIdx2, Bool b) |
---|
1933 | { |
---|
1934 | m_abEqualRef[e][iRefIdx1][iRefIdx2] = m_abEqualRef[e][iRefIdx2][iRefIdx1] = b; |
---|
1935 | } |
---|
1936 | |
---|
1937 | static Void sortPicList ( TComList<TComPic*>& rcListPic ); |
---|
1938 | Void setList1IdxToList0Idx(); |
---|
1939 | |
---|
1940 | UInt getTLayer () { return m_uiTLayer; } |
---|
1941 | Void setTLayer ( UInt uiTLayer ) { m_uiTLayer = uiTLayer; } |
---|
1942 | |
---|
1943 | Void setTLayerInfo( UInt uiTLayer ); |
---|
1944 | Void decodingMarking( TComList<TComPic*>& rcListPic, Int iGOPSIze, Int& iMaxRefPicNum ); |
---|
1945 | Void checkLeadingPictureRestrictions( TComList<TComPic*>& rcListPic ); |
---|
1946 | Void applyReferencePictureSet( TComList<TComPic*>& rcListPic, TComReferencePictureSet *RPSList); |
---|
1947 | #if H_MV |
---|
1948 | Void createInterLayerReferencePictureSet( TComPicLists* ivPicLists, std::vector<TComPic*>& refPicSetInterLayer0, std::vector<TComPic*>& refPicSetInterLayer1 ); |
---|
1949 | static Void markIvRefPicsAsShortTerm ( std::vector<TComPic*> refPicSetInterLayer0, std::vector<TComPic*> refPicSetInterLayer1 ); |
---|
1950 | static Void markCurrPic ( TComPic* currPic );; |
---|
1951 | static Void markIvRefPicsAsUnused ( TComPicLists* ivPicLists, std::vector<Int> targetDecLayerIdSet, TComVPS* vps, Int curLayerId, Int curPoc ); |
---|
1952 | Void printRefPicList(); |
---|
1953 | #endif |
---|
1954 | Bool isTemporalLayerSwitchingPoint( TComList<TComPic*>& rcListPic ); |
---|
1955 | Bool isStepwiseTemporalLayerSwitchingPointCandidate( TComList<TComPic*>& rcListPic ); |
---|
1956 | Int checkThatAllRefPicsAreAvailable( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool printErrors, Int pocRandomAccess = 0); |
---|
1957 | #if FIX1071 |
---|
1958 | Void createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool isRAP); |
---|
1959 | #else |
---|
1960 | Void createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet); |
---|
1961 | #endif |
---|
1962 | |
---|
1963 | Void setMaxNumMergeCand (UInt val ) { m_maxNumMergeCand = val; } |
---|
1964 | UInt getMaxNumMergeCand () { return m_maxNumMergeCand; } |
---|
1965 | |
---|
1966 | Void setSliceMode ( UInt uiMode ) { m_sliceMode = uiMode; } |
---|
1967 | UInt getSliceMode () { return m_sliceMode; } |
---|
1968 | Void setSliceArgument ( UInt uiArgument ) { m_sliceArgument = uiArgument; } |
---|
1969 | UInt getSliceArgument () { return m_sliceArgument; } |
---|
1970 | Void setSliceCurStartCUAddr ( UInt uiAddr ) { m_sliceCurStartCUAddr = uiAddr; } |
---|
1971 | UInt getSliceCurStartCUAddr () { return m_sliceCurStartCUAddr; } |
---|
1972 | Void setSliceCurEndCUAddr ( UInt uiAddr ) { m_sliceCurEndCUAddr = uiAddr; } |
---|
1973 | UInt getSliceCurEndCUAddr () { return m_sliceCurEndCUAddr; } |
---|
1974 | Void setSliceIdx ( UInt i) { m_sliceIdx = i; } |
---|
1975 | UInt getSliceIdx () { return m_sliceIdx; } |
---|
1976 | Void copySliceInfo (TComSlice *pcSliceSrc); |
---|
1977 | Void setSliceSegmentMode ( UInt uiMode ) { m_sliceSegmentMode = uiMode; } |
---|
1978 | UInt getSliceSegmentMode () { return m_sliceSegmentMode; } |
---|
1979 | Void setSliceSegmentArgument ( UInt uiArgument ) { m_sliceSegmentArgument = uiArgument; } |
---|
1980 | UInt getSliceSegmentArgument () { return m_sliceSegmentArgument; } |
---|
1981 | Void setSliceSegmentCurStartCUAddr ( UInt uiAddr ) { m_sliceSegmentCurStartCUAddr = uiAddr; } |
---|
1982 | UInt getSliceSegmentCurStartCUAddr () { return m_sliceSegmentCurStartCUAddr; } |
---|
1983 | Void setSliceSegmentCurEndCUAddr ( UInt uiAddr ) { m_sliceSegmentCurEndCUAddr = uiAddr; } |
---|
1984 | UInt getSliceSegmentCurEndCUAddr () { return m_sliceSegmentCurEndCUAddr; } |
---|
1985 | Void setNextSlice ( Bool b ) { m_nextSlice = b; } |
---|
1986 | Bool isNextSlice () { return m_nextSlice; } |
---|
1987 | Void setNextSliceSegment ( Bool b ) { m_nextSliceSegment = b; } |
---|
1988 | Bool isNextSliceSegment () { return m_nextSliceSegment; } |
---|
1989 | Void setSliceBits ( UInt uiVal ) { m_sliceBits = uiVal; } |
---|
1990 | UInt getSliceBits () { return m_sliceBits; } |
---|
1991 | Void setSliceSegmentBits ( UInt uiVal ) { m_sliceSegmentBits = uiVal; } |
---|
1992 | UInt getSliceSegmentBits () { return m_sliceSegmentBits; } |
---|
1993 | Void setFinalized ( Bool uiVal ) { m_bFinalized = uiVal; } |
---|
1994 | Bool getFinalized () { return m_bFinalized; } |
---|
1995 | Void setWpScaling ( wpScalingParam wp[2][MAX_NUM_REF][3] ) { memcpy(m_weightPredTable, wp, sizeof(wpScalingParam)*2*MAX_NUM_REF*3); } |
---|
1996 | Void getWpScaling ( RefPicList e, Int iRefIdx, wpScalingParam *&wp); |
---|
1997 | |
---|
1998 | Void resetWpScaling (); |
---|
1999 | Void initWpScaling (); |
---|
2000 | inline Bool applyWP () { return( (m_eSliceType==P_SLICE && m_pcPPS->getUseWP()) || (m_eSliceType==B_SLICE && m_pcPPS->getWPBiPred()) ); } |
---|
2001 | |
---|
2002 | Void setWpAcDcParam ( wpACDCParam wp[3] ) { memcpy(m_weightACDCParam, wp, sizeof(wpACDCParam)*3); } |
---|
2003 | Void getWpAcDcParam ( wpACDCParam *&wp ); |
---|
2004 | Void initWpAcDcParam (); |
---|
2005 | |
---|
2006 | Void setTileLocationCount ( UInt cnt ) { return m_tileByteLocation.resize(cnt); } |
---|
2007 | UInt getTileLocationCount () { return (UInt) m_tileByteLocation.size(); } |
---|
2008 | Void setTileLocation ( Int idx, UInt location ) { assert (idx<m_tileByteLocation.size()); |
---|
2009 | m_tileByteLocation[idx] = location; } |
---|
2010 | Void addTileLocation ( UInt location ) { m_tileByteLocation.push_back(location); } |
---|
2011 | UInt getTileLocation ( Int idx ) { return m_tileByteLocation[idx]; } |
---|
2012 | |
---|
2013 | Void setTileOffstForMultES (UInt uiOffset ) { m_uiTileOffstForMultES = uiOffset; } |
---|
2014 | UInt getTileOffstForMultES () { return m_uiTileOffstForMultES; } |
---|
2015 | Void allocSubstreamSizes ( UInt uiNumSubstreams ); |
---|
2016 | UInt* getSubstreamSizes () { return m_puiSubstreamSizes; } |
---|
2017 | Void setScalingList ( TComScalingList* scalingList ) { m_scalingList = scalingList; } |
---|
2018 | TComScalingList* getScalingList () { return m_scalingList; } |
---|
2019 | Void setDefaultScalingList (); |
---|
2020 | Bool checkDefaultScalingList (); |
---|
2021 | Void setCabacInitFlag ( Bool val ) { m_cabacInitFlag = val; } //!< set CABAC initial flag |
---|
2022 | Bool getCabacInitFlag () { return m_cabacInitFlag; } //!< get CABAC initial flag |
---|
2023 | Void setNumEntryPointOffsets(Int val) { m_numEntryPointOffsets = val; } |
---|
2024 | Int getNumEntryPointOffsets() { return m_numEntryPointOffsets; } |
---|
2025 | Bool getTemporalLayerNonReferenceFlag() { return m_temporalLayerNonReferenceFlag;} |
---|
2026 | Void setTemporalLayerNonReferenceFlag(Bool x) { m_temporalLayerNonReferenceFlag = x;} |
---|
2027 | Void setLFCrossSliceBoundaryFlag ( Bool val ) { m_LFCrossSliceBoundaryFlag = val; } |
---|
2028 | Bool getLFCrossSliceBoundaryFlag () { return m_LFCrossSliceBoundaryFlag;} |
---|
2029 | |
---|
2030 | Void setEnableTMVPFlag ( Bool b ) { m_enableTMVPFlag = b; } |
---|
2031 | Bool getEnableTMVPFlag () { return m_enableTMVPFlag;} |
---|
2032 | |
---|
2033 | #if H_MV |
---|
2034 | Void setLayerId ( Int layerId ) { m_layerId = layerId; } |
---|
2035 | Int getLayerId () { return m_layerId; } |
---|
2036 | Int getLayerIdInVps () { return getVPS()->getLayerIdInVps( m_layerId ); }; |
---|
2037 | Void setViewId ( Int viewId ) { m_viewId = viewId; } |
---|
2038 | Int getViewId () { return m_viewId; } |
---|
2039 | Void setViewIndex ( Int viewIndex ) { m_viewIndex = viewIndex; } |
---|
2040 | Int getViewIndex () { return m_viewIndex; } |
---|
2041 | #if H_3D |
---|
2042 | #if H_3D_TMVP |
---|
2043 | Void generateAlterRefforTMVP (); |
---|
2044 | Void setAlterRefIdx ( RefPicList e, Int i ) { m_aiAlterRefIdx[e] = i; } |
---|
2045 | Int getAlterRefIdx ( RefPicList e ) { return m_aiAlterRefIdx[e]; } |
---|
2046 | #endif |
---|
2047 | #if QC_MTK_INTERVIEW_ARP_F0123_F0108 |
---|
2048 | Int getFirstTRefIdx ( RefPicList e ) { return m_aiFirstTRefIdx[e]; } |
---|
2049 | Void setFirstTRefIdx ( RefPicList e, Int i ) { m_aiFirstTRefIdx[e] = i; } |
---|
2050 | #endif |
---|
2051 | #if SHARP_ARP_REF_CHECK_F0105 |
---|
2052 | Bool getArpRefPicAvailable( RefPicList e, Int viewIdx) {return m_arpRefPicAvailable[e][getVPS()->getLayerIdInNuh(viewIdx, 0)]; } |
---|
2053 | #endif |
---|
2054 | Void setIsDepth ( Bool isDepth ) { m_isDepth = isDepth; } |
---|
2055 | Bool getIsDepth () { return m_isDepth; } |
---|
2056 | Void setCamparaSlice ( Int** aaiScale = 0, Int** aaiOffset = 0 ); |
---|
2057 | Int* getCodedScale () { return m_aaiCodedScale [0]; } |
---|
2058 | Int* getCodedOffset () { return m_aaiCodedOffset[0]; } |
---|
2059 | Int* getInvCodedScale () { return m_aaiCodedScale [1]; } |
---|
2060 | Int* getInvCodedOffset () { return m_aaiCodedOffset[1]; } |
---|
2061 | #endif |
---|
2062 | #endif |
---|
2063 | #if H_3D |
---|
2064 | Void setIvPicLists( TComPicLists* m_ivPicLists ); |
---|
2065 | Void setDepthToDisparityLUTs(); |
---|
2066 | |
---|
2067 | Int* getDepthToDisparityB( Int refViewIdx ) { return m_depthToDisparityB[ refViewIdx ]; }; |
---|
2068 | Int* getDepthToDisparityF( Int refViewIdx ) { return m_depthToDisparityF[ refViewIdx ]; }; |
---|
2069 | Bool getVpsDepthModesFlag () { return getVPS()->getVpsDepthModesFlag( getVPS()->getLayerIdInVps( m_layerId ) ); } |
---|
2070 | |
---|
2071 | #endif |
---|
2072 | #if H_MV |
---|
2073 | // Additional slice header syntax elements |
---|
2074 | |
---|
2075 | Void setPocResetFlag( Bool flag ) { m_pocResetFlag = flag; } |
---|
2076 | Bool getPocResetFlag( ) { return m_pocResetFlag; } |
---|
2077 | |
---|
2078 | Void setDiscardableFlag( Bool flag ) { m_discardableFlag = flag; } |
---|
2079 | Bool getDiscardableFlag( ) { return m_discardableFlag; } |
---|
2080 | |
---|
2081 | Void setInterLayerPredEnabledFlag( Bool flag ) { m_interLayerPredEnabledFlag = flag; } |
---|
2082 | Bool getInterLayerPredEnabledFlag( ) { return m_interLayerPredEnabledFlag; } |
---|
2083 | |
---|
2084 | Void setNumInterLayerRefPicsMinus1( Int val ) { m_numInterLayerRefPicsMinus1 = val; } |
---|
2085 | Int getNumInterLayerRefPicsMinus1( ) { return m_numInterLayerRefPicsMinus1; } |
---|
2086 | |
---|
2087 | Void setInterLayerPredLayerIdc( Int i, Int val ) { m_interLayerPredLayerIdc[i] = val; } |
---|
2088 | Int getInterLayerPredLayerIdc( Int i ) { return m_interLayerPredLayerIdc[i]; } |
---|
2089 | |
---|
2090 | // Additional variables derived in slice header semantics |
---|
2091 | Int getNumInterLayerRefPicsMinus1Len( ) { return gCeilLog2( getVPS()->getNumDirectRefLayers( getLayerId() )); } |
---|
2092 | Int getInterLayerPredLayerIdcLen ( ) { return gCeilLog2( getVPS()->getNumDirectRefLayers( getLayerId() )); } |
---|
2093 | |
---|
2094 | Int getNumActiveRefLayerPics( ); |
---|
2095 | |
---|
2096 | Int getNumActiveRefLayerPics0( ) { return (Int) m_refPicSetInterLayer0->size(); }; |
---|
2097 | Int getNumActiveRefLayerPics1( ) { return (Int) m_refPicSetInterLayer1->size(); }; |
---|
2098 | |
---|
2099 | Int getRefPicLayerId ( Int i ); |
---|
2100 | |
---|
2101 | Void setRefPicSetInterLayer ( std::vector<TComPic*>* refPicSetInterLayer0, std::vector<TComPic*>* refPicSetInterLayer1); |
---|
2102 | TComPic* getPicFromRefPicSetInterLayer( Int setIdc, Int layerId ); |
---|
2103 | #endif |
---|
2104 | protected: |
---|
2105 | TComPic* xGetRefPic (TComList<TComPic*>& rcListPic, |
---|
2106 | Int poc); |
---|
2107 | TComPic* xGetLongTermRefPic(TComList<TComPic*>& rcListPic, Int poc, Bool pocHasMsb); |
---|
2108 | #if H_MV |
---|
2109 | TComPic* xGetInterLayerRefPic( std::vector<TComPic*>& rcListIlPic, Int layerId ); |
---|
2110 | #endif |
---|
2111 | };// END CLASS DEFINITION TComSlice |
---|
2112 | |
---|
2113 | |
---|
2114 | template <class T> class ParameterSetMap |
---|
2115 | { |
---|
2116 | public: |
---|
2117 | ParameterSetMap(Int maxId) |
---|
2118 | :m_maxId (maxId) |
---|
2119 | {} |
---|
2120 | |
---|
2121 | ~ParameterSetMap() |
---|
2122 | { |
---|
2123 | for (typename std::map<Int,T *>::iterator i = m_paramsetMap.begin(); i!= m_paramsetMap.end(); i++) |
---|
2124 | { |
---|
2125 | delete (*i).second; |
---|
2126 | } |
---|
2127 | } |
---|
2128 | |
---|
2129 | Void storePS(Int psId, T *ps) |
---|
2130 | { |
---|
2131 | assert ( psId < m_maxId ); |
---|
2132 | if ( m_paramsetMap.find(psId) != m_paramsetMap.end() ) |
---|
2133 | { |
---|
2134 | delete m_paramsetMap[psId]; |
---|
2135 | } |
---|
2136 | m_paramsetMap[psId] = ps; |
---|
2137 | } |
---|
2138 | |
---|
2139 | Void mergePSList(ParameterSetMap<T> &rPsList) |
---|
2140 | { |
---|
2141 | for (typename std::map<Int,T *>::iterator i = rPsList.m_paramsetMap.begin(); i!= rPsList.m_paramsetMap.end(); i++) |
---|
2142 | { |
---|
2143 | storePS(i->first, i->second); |
---|
2144 | } |
---|
2145 | rPsList.m_paramsetMap.clear(); |
---|
2146 | } |
---|
2147 | |
---|
2148 | |
---|
2149 | T* getPS(Int psId) |
---|
2150 | { |
---|
2151 | return ( m_paramsetMap.find(psId) == m_paramsetMap.end() ) ? NULL : m_paramsetMap[psId]; |
---|
2152 | } |
---|
2153 | |
---|
2154 | T* getFirstPS() |
---|
2155 | { |
---|
2156 | return (m_paramsetMap.begin() == m_paramsetMap.end() ) ? NULL : m_paramsetMap.begin()->second; |
---|
2157 | } |
---|
2158 | |
---|
2159 | private: |
---|
2160 | std::map<Int,T *> m_paramsetMap; |
---|
2161 | Int m_maxId; |
---|
2162 | }; |
---|
2163 | |
---|
2164 | class ParameterSetManager |
---|
2165 | { |
---|
2166 | public: |
---|
2167 | ParameterSetManager(); |
---|
2168 | virtual ~ParameterSetManager(); |
---|
2169 | |
---|
2170 | //! store sequence parameter set and take ownership of it |
---|
2171 | Void storeVPS(TComVPS *vps) { m_vpsMap.storePS( vps->getVPSId(), vps); }; |
---|
2172 | //! get pointer to existing video parameter set |
---|
2173 | TComVPS* getVPS(Int vpsId) { return m_vpsMap.getPS(vpsId); }; |
---|
2174 | TComVPS* getFirstVPS() { return m_vpsMap.getFirstPS(); }; |
---|
2175 | |
---|
2176 | //! store sequence parameter set and take ownership of it |
---|
2177 | Void storeSPS(TComSPS *sps) { m_spsMap.storePS( sps->getSPSId(), sps); }; |
---|
2178 | //! get pointer to existing sequence parameter set |
---|
2179 | TComSPS* getSPS(Int spsId) { return m_spsMap.getPS(spsId); }; |
---|
2180 | TComSPS* getFirstSPS() { return m_spsMap.getFirstPS(); }; |
---|
2181 | |
---|
2182 | //! store picture parameter set and take ownership of it |
---|
2183 | Void storePPS(TComPPS *pps) { m_ppsMap.storePS( pps->getPPSId(), pps); }; |
---|
2184 | //! get pointer to existing picture parameter set |
---|
2185 | TComPPS* getPPS(Int ppsId) { return m_ppsMap.getPS(ppsId); }; |
---|
2186 | TComPPS* getFirstPPS() { return m_ppsMap.getFirstPS(); }; |
---|
2187 | |
---|
2188 | //! activate a SPS from a active parameter sets SEI message |
---|
2189 | //! \returns true, if activation is successful |
---|
2190 | #if H_MV |
---|
2191 | Bool activateSPSWithSEI(Int SPSId, Int layerId ); |
---|
2192 | #else |
---|
2193 | Bool activateSPSWithSEI(Int SPSId); |
---|
2194 | #endif |
---|
2195 | |
---|
2196 | //! activate a PPS and depending on isIDR parameter also SPS and VPS |
---|
2197 | //! \returns true, if activation is successful |
---|
2198 | #if H_MV |
---|
2199 | Bool activatePPS(Int ppsId, Bool isIRAP, Int layerId ); |
---|
2200 | #else |
---|
2201 | Bool activatePPS(Int ppsId, Bool isIRAP); |
---|
2202 | #endif |
---|
2203 | |
---|
2204 | TComVPS* getActiveVPS(){ return m_vpsMap.getPS(m_activeVPSId); }; |
---|
2205 | #if H_MV |
---|
2206 | TComSPS* getActiveSPS( Int layerId ){ return m_spsMap.getPS( m_activeSPSId[ layerId ] ); }; |
---|
2207 | TComPPS* getActivePPS( Int layerId ){ return m_ppsMap.getPS( m_activePPSId[ layerId ] ); }; |
---|
2208 | #else |
---|
2209 | TComSPS* getActiveSPS(){ return m_spsMap.getPS(m_activeSPSId); }; |
---|
2210 | TComPPS* getActivePPS(){ return m_ppsMap.getPS(m_activePPSId); }; |
---|
2211 | #endif |
---|
2212 | protected: |
---|
2213 | |
---|
2214 | ParameterSetMap<TComVPS> m_vpsMap; |
---|
2215 | ParameterSetMap<TComSPS> m_spsMap; |
---|
2216 | ParameterSetMap<TComPPS> m_ppsMap; |
---|
2217 | |
---|
2218 | Int m_activeVPSId; |
---|
2219 | #if H_MV |
---|
2220 | Int m_activeSPSId[ MAX_NUM_LAYERS ]; |
---|
2221 | Int m_activePPSId[ MAX_NUM_LAYERS ]; |
---|
2222 | #else |
---|
2223 | Int m_activeSPSId; |
---|
2224 | Int m_activePPSId; |
---|
2225 | #endif |
---|
2226 | |
---|
2227 | }; |
---|
2228 | |
---|
2229 | //! \} |
---|
2230 | |
---|
2231 | #endif // __TCOMSLICE__ |
---|