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