source: 3DVCSoftware/branches/0.3-poznan-univ/source/Lib/TLibCommon/TComSlice.h @ 41

Last change on this file since 41 was 41, checked in by poznan-univ, 13 years ago

Adjustment for FlexCO, and high-level syntax improvement.

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