1 | |
---|
2 | |
---|
3 | /** \file TComSlice.h |
---|
4 | \brief slice header and SPS class (header) |
---|
5 | */ |
---|
6 | |
---|
7 | #ifndef __TCOMSLICE__ |
---|
8 | #define __TCOMSLICE__ |
---|
9 | |
---|
10 | |
---|
11 | #include "CommonDef.h" |
---|
12 | #ifdef WEIGHT_PRED |
---|
13 | #include <string.h> // To avoid compilation failure with some g++ linux compilators... |
---|
14 | #endif |
---|
15 | #include "TComList.h" |
---|
16 | #include <math.h> |
---|
17 | |
---|
18 | class TComPic; |
---|
19 | class TComDepthMapGenerator; |
---|
20 | class TComResidualGenerator; |
---|
21 | |
---|
22 | // ==================================================================================================================== |
---|
23 | // Class definition |
---|
24 | // ==================================================================================================================== |
---|
25 | |
---|
26 | /// SPS class |
---|
27 | class TComSPS |
---|
28 | { |
---|
29 | private: |
---|
30 | // Structure |
---|
31 | UInt m_uiSPSId; |
---|
32 | UInt m_uiWidth; |
---|
33 | UInt m_uiHeight; |
---|
34 | Int m_aiPad[2]; |
---|
35 | UInt m_uiMaxCUWidth; |
---|
36 | UInt m_uiMaxCUHeight; |
---|
37 | UInt m_uiMaxCUDepth; |
---|
38 | UInt m_uiMinTrDepth; |
---|
39 | UInt m_uiMaxTrDepth; |
---|
40 | |
---|
41 | UInt m_uiViewId; |
---|
42 | Int m_iViewOrderIdx; |
---|
43 | Bool m_bDepth; |
---|
44 | UInt m_uiCamParPrecision; |
---|
45 | Bool m_bCamParInSliceHeader; |
---|
46 | Int m_aaiCodedScale [2][MAX_NUMBER_VIEWS]; |
---|
47 | Int m_aaiCodedOffset[2][MAX_NUMBER_VIEWS]; |
---|
48 | |
---|
49 | // Tool list |
---|
50 | UInt m_uiQuadtreeTULog2MaxSize; |
---|
51 | UInt m_uiQuadtreeTULog2MinSize; |
---|
52 | UInt m_uiQuadtreeTUMaxDepthInter; |
---|
53 | UInt m_uiQuadtreeTUMaxDepthIntra; |
---|
54 | Bool m_bUseALF; |
---|
55 | Bool m_bUseDQP; |
---|
56 | #if !SB_NO_LowDelayCoding |
---|
57 | Bool m_bUseLDC; |
---|
58 | #endif |
---|
59 | Bool m_bUsePAD; |
---|
60 | Bool m_bUseMRG; // SOPH: |
---|
61 | |
---|
62 | #if LM_CHROMA |
---|
63 | Bool m_bUseLMChroma; // JL: |
---|
64 | #endif |
---|
65 | |
---|
66 | #if DCM_COMB_LIST |
---|
67 | Bool m_bUseLComb; |
---|
68 | Bool m_bLCMod; |
---|
69 | #endif |
---|
70 | |
---|
71 | #if HHI_RMP_SWITCH |
---|
72 | Bool m_bUseRMP; |
---|
73 | #endif |
---|
74 | // Parameter |
---|
75 | AMVP_MODE m_aeAMVPMode[MAX_CU_DEPTH]; |
---|
76 | UInt m_uiBitDepth; |
---|
77 | UInt m_uiBitIncrement; |
---|
78 | |
---|
79 | // Max physical transform size |
---|
80 | UInt m_uiMaxTrSize; |
---|
81 | |
---|
82 | Int m_iAMPAcc[MAX_CU_DEPTH]; |
---|
83 | |
---|
84 | #if MTK_NONCROSS_INLOOP_FILTER |
---|
85 | Bool m_bLFCrossSliceBoundaryFlag; |
---|
86 | #endif |
---|
87 | #if MTK_SAO |
---|
88 | Bool m_bUseSAO; |
---|
89 | #endif |
---|
90 | Bool m_bUseMVI; |
---|
91 | |
---|
92 | UInt m_uiCodedPictureBufferSize ; |
---|
93 | |
---|
94 | #if HHI_DMM_INTRA |
---|
95 | Bool m_bUseDepthModelModes; |
---|
96 | #endif |
---|
97 | |
---|
98 | UInt m_uiPredDepthMapGeneration; |
---|
99 | UInt m_uiMultiviewMvPredMode; |
---|
100 | UInt m_uiPdmPrecision; |
---|
101 | Int m_aiPdmScaleNomDelta[MAX_NUMBER_VIEWS]; |
---|
102 | Int m_aiPdmOffset [MAX_NUMBER_VIEWS]; |
---|
103 | UInt m_uiMultiviewResPredMode; |
---|
104 | |
---|
105 | TComDepthMapGenerator* m_pcDepthMapGenerator; |
---|
106 | TComResidualGenerator* m_pcResidualGenerator; |
---|
107 | |
---|
108 | public: |
---|
109 | TComSPS(); |
---|
110 | virtual ~TComSPS(); |
---|
111 | |
---|
112 | // structure |
---|
113 | Void setSPSId ( UInt u ) { m_uiSPSId = u; } |
---|
114 | UInt getSPSId () { return m_uiSPSId; } |
---|
115 | Void setWidth ( UInt u ) { m_uiWidth = u; } |
---|
116 | UInt getWidth () { return m_uiWidth; } |
---|
117 | Void setHeight ( UInt u ) { m_uiHeight = u; } |
---|
118 | UInt getHeight () { return m_uiHeight; } |
---|
119 | Void setMaxCUWidth ( UInt u ) { m_uiMaxCUWidth = u; } |
---|
120 | UInt getMaxCUWidth () { return m_uiMaxCUWidth; } |
---|
121 | Void setMaxCUHeight ( UInt u ) { m_uiMaxCUHeight = u; } |
---|
122 | UInt getMaxCUHeight () { return m_uiMaxCUHeight; } |
---|
123 | Void setMaxCUDepth ( UInt u ) { m_uiMaxCUDepth = u; } |
---|
124 | UInt getMaxCUDepth () { return m_uiMaxCUDepth; } |
---|
125 | Void setMinTrDepth ( UInt u ) { m_uiMinTrDepth = u; } |
---|
126 | UInt getMinTrDepth () { return m_uiMinTrDepth; } |
---|
127 | Void setMaxTrDepth ( UInt u ) { m_uiMaxTrDepth = u; } |
---|
128 | UInt getMaxTrDepth () { return m_uiMaxTrDepth; } |
---|
129 | Void setQuadtreeTULog2MaxSize( UInt u ) { m_uiQuadtreeTULog2MaxSize = u; } |
---|
130 | UInt getQuadtreeTULog2MaxSize() { return m_uiQuadtreeTULog2MaxSize; } |
---|
131 | Void setQuadtreeTULog2MinSize( UInt u ) { m_uiQuadtreeTULog2MinSize = u; } |
---|
132 | UInt getQuadtreeTULog2MinSize() { return m_uiQuadtreeTULog2MinSize; } |
---|
133 | Void setQuadtreeTUMaxDepthInter( UInt u ) { m_uiQuadtreeTUMaxDepthInter = u; } |
---|
134 | Void setQuadtreeTUMaxDepthIntra( UInt u ) { m_uiQuadtreeTUMaxDepthIntra = u; } |
---|
135 | UInt getQuadtreeTUMaxDepthInter() { return m_uiQuadtreeTUMaxDepthInter; } |
---|
136 | UInt getQuadtreeTUMaxDepthIntra() { return m_uiQuadtreeTUMaxDepthIntra; } |
---|
137 | Void setPad (Int iPad[2]) { m_aiPad[0] = iPad[0]; m_aiPad[1] = iPad[1]; } |
---|
138 | Void setPadX ( Int u ) { m_aiPad[0] = u; } |
---|
139 | Void setPadY ( Int u ) { m_aiPad[1] = u; } |
---|
140 | Int getPad ( Int u ) { assert(u < 2); return m_aiPad[u];} |
---|
141 | Int* getPad ( ) { return m_aiPad; } |
---|
142 | |
---|
143 | Void initMultiviewSPS ( UInt uiViewId, Int iViewOrderIdx = 0, UInt uiCamParPrecision = 0, Bool bCamParSlice = false, Int** aaiScale = 0, Int** aaiOffset = 0 ); |
---|
144 | Void initMultiviewSPSDepth ( UInt uiViewId, Int iViewOrderIdx ); |
---|
145 | |
---|
146 | UInt getViewId () { return m_uiViewId; } |
---|
147 | Int getViewOrderIdx () { return m_iViewOrderIdx; } |
---|
148 | Bool isDepth () { return m_bDepth; } |
---|
149 | UInt getCamParPrecision () { return m_uiCamParPrecision; } |
---|
150 | Bool hasCamParInSliceHeader() { return m_bCamParInSliceHeader; } |
---|
151 | Int* getCodedScale () { return m_aaiCodedScale [0]; } |
---|
152 | Int* getCodedOffset () { return m_aaiCodedOffset[0]; } |
---|
153 | Int* getInvCodedScale () { return m_aaiCodedScale [1]; } |
---|
154 | Int* getInvCodedOffset () { return m_aaiCodedOffset[1]; } |
---|
155 | |
---|
156 | // physical transform |
---|
157 | Void setMaxTrSize ( UInt u ) { m_uiMaxTrSize = u; } |
---|
158 | UInt getMaxTrSize () { return m_uiMaxTrSize; } |
---|
159 | |
---|
160 | // Tool list |
---|
161 | Bool getUseALF () { return m_bUseALF; } |
---|
162 | Bool getUseDQP () { return m_bUseDQP; } |
---|
163 | |
---|
164 | #if !SB_NO_LowDelayCoding |
---|
165 | Bool getUseLDC () { return m_bUseLDC; } |
---|
166 | #endif |
---|
167 | Bool getUsePAD () { return m_bUsePAD; } |
---|
168 | Bool getUseMRG () { return m_bUseMRG; } // SOPH: |
---|
169 | |
---|
170 | Void setUseALF ( Bool b ) { m_bUseALF = b; } |
---|
171 | Void setUseDQP ( Bool b ) { m_bUseDQP = b; } |
---|
172 | |
---|
173 | #if !SB_NO_LowDelayCoding |
---|
174 | Void setUseLDC ( Bool b ) { m_bUseLDC = b; } |
---|
175 | #endif |
---|
176 | Void setUsePAD ( Bool b ) { m_bUsePAD = b; } |
---|
177 | Void setUseMRG ( Bool b ) { m_bUseMRG = b; } // SOPH: |
---|
178 | |
---|
179 | #if HHI_DMM_INTRA |
---|
180 | Bool getUseDepthModelModes() { return m_bUseDepthModelModes; } |
---|
181 | Void setUseDepthModelModes( Bool b ) { m_bUseDepthModelModes = b; } |
---|
182 | #endif |
---|
183 | |
---|
184 | |
---|
185 | #if DCM_COMB_LIST |
---|
186 | Void setUseLComb (Bool b) { m_bUseLComb = b; } |
---|
187 | Bool getUseLComb () { return m_bUseLComb; } |
---|
188 | Void setLCMod (Bool b) { m_bLCMod = b; } |
---|
189 | Bool getLCMod () { return m_bLCMod; } |
---|
190 | #endif |
---|
191 | |
---|
192 | #if HHI_RMP_SWITCH |
---|
193 | Bool getUseRMP () { return m_bUseRMP; } |
---|
194 | Void setUseRMP ( Bool b ) { m_bUseRMP = b; } |
---|
195 | #endif |
---|
196 | |
---|
197 | #if LM_CHROMA |
---|
198 | Bool getUseLMChroma () { return m_bUseLMChroma; } |
---|
199 | Void setUseLMChroma ( Bool b ) { m_bUseLMChroma = b; } |
---|
200 | #endif |
---|
201 | |
---|
202 | // AMVP mode (for each depth) |
---|
203 | AMVP_MODE getAMVPMode ( UInt uiDepth ) { assert(uiDepth < g_uiMaxCUDepth); return m_aeAMVPMode[uiDepth]; } |
---|
204 | Void setAMVPMode ( UInt uiDepth, AMVP_MODE eMode) { assert(uiDepth < g_uiMaxCUDepth); m_aeAMVPMode[uiDepth] = eMode; } |
---|
205 | |
---|
206 | // Bit-depth |
---|
207 | UInt getBitDepth () { return m_uiBitDepth; } |
---|
208 | Void setBitDepth ( UInt u ) { m_uiBitDepth = u; } |
---|
209 | UInt getBitIncrement () { return m_uiBitIncrement; } |
---|
210 | Void setBitIncrement ( UInt u ) { m_uiBitIncrement = u; } |
---|
211 | |
---|
212 | #if MTK_NONCROSS_INLOOP_FILTER |
---|
213 | Void setLFCrossSliceBoundaryFlag ( Bool bValue ) { m_bLFCrossSliceBoundaryFlag = bValue; } |
---|
214 | Bool getLFCrossSliceBoundaryFlag () { return m_bLFCrossSliceBoundaryFlag; } |
---|
215 | #endif |
---|
216 | |
---|
217 | #if MTK_SAO |
---|
218 | Void setUseSAO (Bool bVal) {m_bUseSAO = bVal;} |
---|
219 | Bool getUseSAO () {return m_bUseSAO;} |
---|
220 | #endif |
---|
221 | |
---|
222 | Void setUseMVI (Bool bVal) {m_bUseMVI = bVal;} |
---|
223 | Bool getUseMVI () {return m_bUseMVI;} |
---|
224 | |
---|
225 | Void setCodedPictureBufferSize( UInt u ) { m_uiCodedPictureBufferSize = u ;} |
---|
226 | UInt getCodedPictureBufferSize( ) { return m_uiCodedPictureBufferSize ;} |
---|
227 | |
---|
228 | Void setPredDepthMapGeneration( UInt uiViewId, Bool bIsDepth, UInt uiPdmGenMode = 0, UInt uiPdmMvPredMode = 0, UInt uiPdmPrec = 0, Int** aaiPdmScaleNomDelta = 0, Int** aaiPdmOffset = 0 ); |
---|
229 | Void setMultiviewResPredMode ( UInt uiResPrdMode ) { m_uiMultiviewResPredMode = uiResPrdMode; } |
---|
230 | |
---|
231 | UInt getPredDepthMapGeneration() { return m_uiPredDepthMapGeneration; } |
---|
232 | UInt getMultiviewMvPredMode () { return m_uiMultiviewMvPredMode; } |
---|
233 | UInt getPdmPrecision () { return m_uiPdmPrecision; } |
---|
234 | Int* getPdmScaleNomDelta () { return m_aiPdmScaleNomDelta; } |
---|
235 | Int* getPdmOffset () { return m_aiPdmOffset; } |
---|
236 | UInt getMultiviewResPredMode () { return m_uiMultiviewResPredMode; } |
---|
237 | |
---|
238 | Void setDepthMapGenerator( TComDepthMapGenerator* pcDepthMapGenerator ) { m_pcDepthMapGenerator = pcDepthMapGenerator; } |
---|
239 | TComDepthMapGenerator* getDepthMapGenerator() { return m_pcDepthMapGenerator; } |
---|
240 | |
---|
241 | Void setResidualGenerator( TComResidualGenerator* pcResidualGenerator ) { m_pcResidualGenerator = pcResidualGenerator; } |
---|
242 | TComResidualGenerator* getResidualGenerator() { return m_pcResidualGenerator; } |
---|
243 | }; |
---|
244 | |
---|
245 | /// PPS class |
---|
246 | class TComPPS |
---|
247 | { |
---|
248 | private: |
---|
249 | #if CONSTRAINED_INTRA_PRED |
---|
250 | Bool m_bConstrainedIntraPred; // constrained_intra_pred_flag |
---|
251 | #endif |
---|
252 | #ifdef WEIGHT_PRED |
---|
253 | Bool m_bUseWeightPred; // Use of Weighting Prediction (P_SLICE) |
---|
254 | UInt m_uiBiPredIdc; // Use of Weighting Bi-Prediction (B_SLICE) |
---|
255 | #endif |
---|
256 | UInt m_uiPPSId; |
---|
257 | UInt m_uiSPSId; |
---|
258 | |
---|
259 | public: |
---|
260 | TComPPS(); |
---|
261 | virtual ~TComPPS(); |
---|
262 | |
---|
263 | Void setPPSId ( UInt u ) { m_uiPPSId = u; } |
---|
264 | UInt getPPSId () { return m_uiPPSId; } |
---|
265 | Void setSPSId ( UInt u ) { m_uiSPSId = u; } |
---|
266 | UInt getSPSId () { return m_uiSPSId; } |
---|
267 | #if CONSTRAINED_INTRA_PRED |
---|
268 | Bool getConstrainedIntraPred () { return m_bConstrainedIntraPred; } |
---|
269 | Void setConstrainedIntraPred ( Bool b ) { m_bConstrainedIntraPred = b; } |
---|
270 | #endif |
---|
271 | |
---|
272 | #ifdef WEIGHT_PRED |
---|
273 | Bool getUseWP () { return m_bUseWeightPred; } |
---|
274 | UInt getWPBiPredIdc () { return m_uiBiPredIdc; } |
---|
275 | |
---|
276 | Void setUseWP ( Bool b ) { m_bUseWeightPred = b; } |
---|
277 | Void setWPBiPredIdc ( UInt u ) { m_uiBiPredIdc = u; } |
---|
278 | #endif |
---|
279 | }; |
---|
280 | |
---|
281 | #ifdef WEIGHT_PRED |
---|
282 | typedef struct { |
---|
283 | // Explicit weighted prediction parameters parsed in slice header, |
---|
284 | // or Implicit weighted prediction parameters (8 bits depth values). |
---|
285 | Bool bPresentFlag; |
---|
286 | UInt uiLog2WeightDenom; |
---|
287 | Int iWeight; |
---|
288 | Int iOffset; |
---|
289 | |
---|
290 | // Weighted prediction scaling values built from above parameters (bitdepth scaled): |
---|
291 | Int w, o, offset, shift, round; |
---|
292 | } wpScalingParam; |
---|
293 | |
---|
294 | typedef struct { |
---|
295 | Int64 iAC; |
---|
296 | Int64 iDC; |
---|
297 | } wpACDCParam; |
---|
298 | #endif |
---|
299 | |
---|
300 | /// slice header class |
---|
301 | class TComSlice |
---|
302 | { |
---|
303 | |
---|
304 | private: |
---|
305 | // Bitstream writing |
---|
306 | UInt m_uiPPSId; |
---|
307 | Int m_iPOC; |
---|
308 | #if DCM_DECODING_REFRESH |
---|
309 | NalUnitType m_eNalUnitType; ///< Nal unit type for the slice |
---|
310 | #endif |
---|
311 | SliceType m_eSliceType; |
---|
312 | Int m_iSliceQp; |
---|
313 | Int m_iSymbolMode; |
---|
314 | Bool m_bLoopFilterDisable; |
---|
315 | |
---|
316 | #if DCM_COMB_LIST |
---|
317 | Int m_aiNumRefIdx [3]; // for multiple reference of current slice |
---|
318 | |
---|
319 | Int m_iRefIdxOfLC[2][MAX_NUM_REF_LC]; |
---|
320 | Int m_eListIdFromIdxOfLC[MAX_NUM_REF_LC]; |
---|
321 | Int m_iRefIdxFromIdxOfLC[MAX_NUM_REF_LC]; |
---|
322 | Int m_iRefIdxOfL1FromRefIdxOfL0[MAX_NUM_REF_LC]; |
---|
323 | Int m_iRefIdxOfL0FromRefIdxOfL1[MAX_NUM_REF_LC]; |
---|
324 | Bool m_bRefPicListModificationFlagLC; |
---|
325 | Bool m_bRefPicListCombinationFlag; |
---|
326 | #else |
---|
327 | Int m_aiNumRefIdx [2]; // for multiple reference of current slice |
---|
328 | #endif |
---|
329 | |
---|
330 | // Data |
---|
331 | Int m_iSliceQpDelta; |
---|
332 | TComPic* m_apcRefPicList [2][MAX_NUM_REF]; |
---|
333 | Int m_aiRefPOCList [2][MAX_NUM_REF]; |
---|
334 | Int m_iDepth; |
---|
335 | TComPic* m_pcTexturePic; |
---|
336 | |
---|
337 | // referenced slice? |
---|
338 | Bool m_bRefenced; |
---|
339 | #ifdef ROUNDING_CONTROL_BIPRED |
---|
340 | Bool m_bRounding; |
---|
341 | #endif |
---|
342 | |
---|
343 | // access channel |
---|
344 | TComSPS* m_pcSPS; |
---|
345 | TComPPS* m_pcPPS; |
---|
346 | TComPic* m_pcPic; |
---|
347 | |
---|
348 | UInt m_uiColDir; // direction to get colocated CUs |
---|
349 | |
---|
350 | Double m_dLambda; |
---|
351 | |
---|
352 | Bool m_abEqualRef [2][MAX_NUM_REF][MAX_NUM_REF]; |
---|
353 | |
---|
354 | // SB |
---|
355 | Int m_iViewIdx; |
---|
356 | Int m_aiRefViewList[2][MAX_INPUT_VIEW_NUM]; |
---|
357 | |
---|
358 | Bool m_bNoBackPredFlag; |
---|
359 | #if MS_LCEC_LOOKUP_TABLE_EXCEPTION |
---|
360 | Bool m_bRefIdxCombineCoding; |
---|
361 | #endif |
---|
362 | |
---|
363 | Int m_aaiCodedScale [2][MAX_NUMBER_VIEWS]; |
---|
364 | Int m_aaiCodedOffset[2][MAX_NUMBER_VIEWS]; |
---|
365 | |
---|
366 | UInt m_uiSliceMode; |
---|
367 | UInt m_uiSliceArgument; |
---|
368 | UInt m_uiSliceCurStartCUAddr; |
---|
369 | UInt m_uiSliceCurEndCUAddr; |
---|
370 | UInt m_uiSliceIdx; |
---|
371 | UInt m_uiEntropySliceMode; |
---|
372 | UInt m_uiEntropySliceArgument; |
---|
373 | UInt m_uiEntropySliceCurStartCUAddr; |
---|
374 | UInt m_uiEntropySliceCurEndCUAddr; |
---|
375 | Bool m_bNextSlice; |
---|
376 | Bool m_bNextEntropySlice; |
---|
377 | UInt m_uiSliceBits; |
---|
378 | |
---|
379 | #ifdef WEIGHT_PRED |
---|
380 | wpScalingParam m_weightPredTable[2][MAX_NUM_REF][3]; // [REF_PIC_LIST_0 or REF_PIC_LIST_1][refIdx][0:Y, 1:U, 2:V] |
---|
381 | wpACDCParam m_weightACDCParam[3]; // [0:Y, 1:U, 2:V] |
---|
382 | #endif |
---|
383 | |
---|
384 | public: |
---|
385 | TComSlice(); |
---|
386 | virtual ~TComSlice(); |
---|
387 | |
---|
388 | Void initSlice (); |
---|
389 | |
---|
390 | Void setSPS ( TComSPS* pcSPS ) { m_pcSPS = pcSPS; } |
---|
391 | TComSPS* getSPS () { return m_pcSPS; } |
---|
392 | |
---|
393 | Void setPPS ( TComPPS* pcPPS ) { m_pcPPS = pcPPS; } |
---|
394 | TComPPS* getPPS () { return m_pcPPS; } |
---|
395 | |
---|
396 | UInt getPPSId () { return m_uiPPSId; } |
---|
397 | SliceType getSliceType () { return m_eSliceType; } |
---|
398 | Int getPOC () { return m_iPOC; } |
---|
399 | Int getSliceQp () { return m_iSliceQp; } |
---|
400 | Int getSliceQpDelta () { return m_iSliceQpDelta; } |
---|
401 | Int getSymbolMode () { return m_iSymbolMode; } |
---|
402 | Bool getLoopFilterDisable() { return m_bLoopFilterDisable; } |
---|
403 | Int getNumRefIdx ( RefPicList e ) { return m_aiNumRefIdx[e]; } |
---|
404 | TComPic* getPic () { return m_pcPic; } |
---|
405 | TComPic* getRefPic ( RefPicList e, Int iRefIdx) { return m_apcRefPicList[e][iRefIdx]; } |
---|
406 | Int getRefPOC ( RefPicList e, Int iRefIdx) { return m_aiRefPOCList[e][iRefIdx]; } |
---|
407 | Int getDepth () { return m_iDepth; } |
---|
408 | UInt getColDir () { return m_uiColDir; } |
---|
409 | |
---|
410 | #if DCM_COMB_LIST |
---|
411 | Int getRefIdxOfLC (RefPicList e, Int iRefIdx) { return m_iRefIdxOfLC[e][iRefIdx]; } |
---|
412 | Int getListIdFromIdxOfLC(Int iRefIdx) { return m_eListIdFromIdxOfLC[iRefIdx]; } |
---|
413 | Int getRefIdxFromIdxOfLC(Int iRefIdx) { return m_iRefIdxFromIdxOfLC[iRefIdx]; } |
---|
414 | Int getRefIdxOfL0FromRefIdxOfL1(Int iRefIdx) { return m_iRefIdxOfL0FromRefIdxOfL1[iRefIdx];} |
---|
415 | Int getRefIdxOfL1FromRefIdxOfL0(Int iRefIdx) { return m_iRefIdxOfL1FromRefIdxOfL0[iRefIdx];} |
---|
416 | Bool getRefPicListModificationFlagLC() {return m_bRefPicListModificationFlagLC;} |
---|
417 | Void setRefPicListModificationFlagLC(Bool bflag) {m_bRefPicListModificationFlagLC=bflag;} |
---|
418 | Bool getRefPicListCombinationFlag() {return m_bRefPicListCombinationFlag;} |
---|
419 | Void setRefPicListCombinationFlag(Bool bflag) {m_bRefPicListCombinationFlag=bflag;} |
---|
420 | Void setListIdFromIdxOfLC(Int iRefIdx, UInt uiVal) { m_eListIdFromIdxOfLC[iRefIdx]=uiVal; } |
---|
421 | Void setRefIdxFromIdxOfLC(Int iRefIdx, UInt uiVal) { m_iRefIdxFromIdxOfLC[iRefIdx]=uiVal; } |
---|
422 | Void setRefIdxOfLC (RefPicList e, Int iRefIdx, Int RefIdxLC) { m_iRefIdxOfLC[e][iRefIdx]=RefIdxLC;} |
---|
423 | #endif |
---|
424 | |
---|
425 | Void setReferenced(Bool b) { m_bRefenced = b; } |
---|
426 | Bool isReferenced() { return m_bRefenced; } |
---|
427 | #ifdef ROUNDING_CONTROL_BIPRED |
---|
428 | Void setRounding(Bool bRound) { m_bRounding = bRound; } |
---|
429 | Bool isRounding() { return m_bRounding; } |
---|
430 | #endif |
---|
431 | |
---|
432 | Void setPPSId ( UInt u ) { m_uiPPSId = u; } |
---|
433 | Void setPOC ( Int i ) { m_iPOC = i; } |
---|
434 | #if DCM_DECODING_REFRESH |
---|
435 | Void setNalUnitType ( NalUnitType e ) { m_eNalUnitType = e; } |
---|
436 | NalUnitType getNalUnitType () { return m_eNalUnitType; } |
---|
437 | Void decodingRefreshMarking(UInt& uiPOCCDR, Bool& bRefreshPending, TComList<TComPic*>& rcListPic); |
---|
438 | #endif |
---|
439 | Void setSliceType ( SliceType e ) { m_eSliceType = e; } |
---|
440 | Void setSliceQp ( Int i ) { m_iSliceQp = i; } |
---|
441 | Void setSliceQpDelta ( Int i ) { m_iSliceQpDelta = i; } |
---|
442 | Void setSymbolMode ( Int b ) { m_iSymbolMode = b; } |
---|
443 | Void setLoopFilterDisable( Bool b ) { m_bLoopFilterDisable= b; } |
---|
444 | |
---|
445 | Void setRefPic ( TComPic* p, RefPicList e, Int iRefIdx ) { m_apcRefPicList[e][iRefIdx] = p; } |
---|
446 | Void setRefPOC ( Int i, RefPicList e, Int iRefIdx ) { m_aiRefPOCList[e][iRefIdx] = i; } |
---|
447 | Void setNumRefIdx ( RefPicList e, Int i ) { m_aiNumRefIdx[e] = i; } |
---|
448 | Void setPic ( TComPic* p ) { m_pcPic = p; } |
---|
449 | Void setDepth ( Int iDepth ) { m_iDepth = iDepth; } |
---|
450 | |
---|
451 | Void setRefPicList ( TComList<TComPic*>& rcListPic ); |
---|
452 | Void setRefPOCList (); |
---|
453 | Void setColDir ( UInt uiDir ) { m_uiColDir = uiDir; } |
---|
454 | |
---|
455 | Void setRefPicListFromGOPSTring( TComList<TComPic*>& rcListPic, std::vector<TComPic*>& rapcSpatRefPics ); |
---|
456 | Void setRefPicListExplicitlyDecoderSided( TComList<TComPic*>& rcListPic, std::vector<TComPic*>& rapcSpatRefPics ); |
---|
457 | |
---|
458 | Bool isIntra () { return m_eSliceType == I_SLICE; } |
---|
459 | Bool isInterB () { return m_eSliceType == B_SLICE; } |
---|
460 | Bool isInterP () { return m_eSliceType == P_SLICE; } |
---|
461 | |
---|
462 | Void setLambda( Double d ) { m_dLambda = d; } |
---|
463 | Double getLambda() { return m_dLambda; } |
---|
464 | |
---|
465 | //SB |
---|
466 | Void setViewIdx(Int i) { m_iViewIdx = i; } |
---|
467 | Int getViewIdx() { return m_iViewIdx; } |
---|
468 | |
---|
469 | Void setRefViewIdx ( Int i, RefPicList e, Int iRefIdx ) { m_aiRefViewList[e][iRefIdx] = i; } |
---|
470 | Int getRefViewIdx ( RefPicList e, Int iRefIdx) { return m_aiRefViewList[e][iRefIdx]; } |
---|
471 | |
---|
472 | Void initEqualRef(); |
---|
473 | Bool isEqualRef ( RefPicList e, Int iRefIdx1, Int iRefIdx2 ) |
---|
474 | { |
---|
475 | if (iRefIdx1 < 0 || iRefIdx2 < 0) return false; |
---|
476 | return m_abEqualRef[e][iRefIdx1][iRefIdx2]; |
---|
477 | } |
---|
478 | |
---|
479 | Void setEqualRef( RefPicList e, Int iRefIdx1, Int iRefIdx2, Bool b) |
---|
480 | { |
---|
481 | m_abEqualRef[e][iRefIdx1][iRefIdx2] = m_abEqualRef[e][iRefIdx2][iRefIdx1] = b; |
---|
482 | } |
---|
483 | |
---|
484 | static Void sortPicList ( TComList<TComPic*>& rcListPic ); |
---|
485 | |
---|
486 | Bool getNoBackPredFlag() { return m_bNoBackPredFlag; } |
---|
487 | Void setNoBackPredFlag( Bool b ) { m_bNoBackPredFlag = b; } |
---|
488 | #if MS_LCEC_LOOKUP_TABLE_EXCEPTION |
---|
489 | Bool getRefIdxCombineCoding() { return m_bRefIdxCombineCoding; } |
---|
490 | Void setRefIdxCombineCoding( Bool b ) { m_bRefIdxCombineCoding = b; } |
---|
491 | #endif |
---|
492 | #if DCM_COMB_LIST |
---|
493 | Void generateCombinedList (); |
---|
494 | #endif |
---|
495 | Void setSliceMode ( UInt uiMode ) { m_uiSliceMode = uiMode; } |
---|
496 | UInt getSliceMode () { return m_uiSliceMode; } |
---|
497 | Void setSliceArgument ( UInt uiArgument ) { m_uiSliceArgument = uiArgument; } |
---|
498 | UInt getSliceArgument () { return m_uiSliceArgument; } |
---|
499 | Void setSliceCurStartCUAddr ( UInt uiAddr ) { m_uiSliceCurStartCUAddr = uiAddr; } |
---|
500 | UInt getSliceCurStartCUAddr () { return m_uiSliceCurStartCUAddr; } |
---|
501 | Void setSliceCurEndCUAddr ( UInt uiAddr ) { m_uiSliceCurEndCUAddr = uiAddr; } |
---|
502 | UInt getSliceCurEndCUAddr () { return m_uiSliceCurEndCUAddr; } |
---|
503 | Void setSliceIdx ( UInt i) { m_uiSliceIdx = i; } |
---|
504 | UInt getSliceIdx () { return m_uiSliceIdx; } |
---|
505 | Void copySliceInfo (TComSlice *pcSliceSrc); |
---|
506 | Void setEntropySliceMode ( UInt uiMode ) { m_uiEntropySliceMode = uiMode; } |
---|
507 | UInt getEntropySliceMode () { return m_uiEntropySliceMode; } |
---|
508 | Void setEntropySliceArgument ( UInt uiArgument ) { m_uiEntropySliceArgument = uiArgument; } |
---|
509 | UInt getEntropySliceArgument () { return m_uiEntropySliceArgument; } |
---|
510 | Void setEntropySliceCurStartCUAddr ( UInt uiAddr ) { m_uiEntropySliceCurStartCUAddr = uiAddr; } |
---|
511 | UInt getEntropySliceCurStartCUAddr () { return m_uiEntropySliceCurStartCUAddr; } |
---|
512 | Void setEntropySliceCurEndCUAddr ( UInt uiAddr ) { m_uiEntropySliceCurEndCUAddr = uiAddr; } |
---|
513 | UInt getEntropySliceCurEndCUAddr () { return m_uiEntropySliceCurEndCUAddr; } |
---|
514 | Void setNextSlice ( Bool b ) { m_bNextSlice = b; } |
---|
515 | Bool isNextSlice () { return m_bNextSlice; } |
---|
516 | Void setNextEntropySlice ( Bool b ) { m_bNextEntropySlice = b; } |
---|
517 | Bool isNextEntropySlice () { return m_bNextEntropySlice; } |
---|
518 | Void setSliceBits ( UInt uiVal ) { m_uiSliceBits = uiVal; } |
---|
519 | UInt getSliceBits () { return m_uiSliceBits; } |
---|
520 | |
---|
521 | Void initMultiviewSlice ( Int** aaiScale = 0, Int** aaiOffset = 0 ); |
---|
522 | |
---|
523 | Int* getCodedScale () { return m_aaiCodedScale [0]; } |
---|
524 | Int* getCodedOffset () { return m_aaiCodedOffset[0]; } |
---|
525 | Int* getInvCodedScale () { return m_aaiCodedScale [1]; } |
---|
526 | Int* getInvCodedOffset () { return m_aaiCodedOffset[1]; } |
---|
527 | |
---|
528 | Void setTexturePic( TComPic *pcTexturePic ) { m_pcTexturePic = pcTexturePic; } |
---|
529 | TComPic *getTexturePic() const { return m_pcTexturePic; } |
---|
530 | |
---|
531 | #ifdef WEIGHT_PRED |
---|
532 | Void setWpScaling( wpScalingParam wp[2][MAX_NUM_REF][3] ) { memcpy(m_weightPredTable, wp, sizeof(wpScalingParam)*2*MAX_NUM_REF*3); } |
---|
533 | Void getWpScaling( RefPicList e, Int iRefIdx, wpScalingParam *&wp); |
---|
534 | Void displayWpScaling(); |
---|
535 | Void resetWpScaling(wpScalingParam wp[2][MAX_NUM_REF][3]); |
---|
536 | Void initWpScaling(wpScalingParam wp[2][MAX_NUM_REF][3]); |
---|
537 | Void initWpScaling(); |
---|
538 | inline Bool applyWP() { return( (m_eSliceType==P_SLICE && m_pcPPS->getUseWP()) || (m_eSliceType==B_SLICE && m_pcPPS->getWPBiPredIdc()) ); } |
---|
539 | |
---|
540 | Void setWpAcDcParam ( wpACDCParam wp[3] ) { memcpy(m_weightACDCParam, wp, sizeof(wpACDCParam)*3); } |
---|
541 | Void getWpAcDcParam ( wpACDCParam *&wp ); |
---|
542 | Void initWpAcDcParam(); |
---|
543 | #endif |
---|
544 | |
---|
545 | protected: |
---|
546 | #if 0 |
---|
547 | TComPic* xGetRefPic (TComList<TComPic*>& rcListPic, |
---|
548 | Bool bDRBFlag, |
---|
549 | ERBIndex eERBIndex, |
---|
550 | UInt uiPOCCurr, |
---|
551 | RefPicList eRefPicList, |
---|
552 | UInt uiNthRefPic ); |
---|
553 | #endif |
---|
554 | |
---|
555 | };// END CLASS DEFINITION TComSlice |
---|
556 | |
---|
557 | |
---|
558 | #endif // __TCOMSLICE__ |
---|
559 | |
---|