source: 3DVCSoftware/branches/HTM-4.1-dev0/source/Lib/TLibCommon/TComPic.h @ 187

Last change on this file since 187 was 187, checked in by tech, 12 years ago

Added document numbers to macro switches.

  • Property svn:eol-style set to native
File size: 13.1 KB
RevLine 
[5]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
[56]4 * granted under this license. 
[5]5 *
[56]6 * Copyright (c) 2010-2012, ITU/ISO/IEC
[5]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.
[56]17 *  * Neither the name of the ITU/ISO/IEC nor the names of its contributors may
[5]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 */
[2]33
34/** \file     TComPic.h
35    \brief    picture class (header)
36*/
37
38#ifndef __TCOMPIC__
39#define __TCOMPIC__
40
41// Include files
42#include "CommonDef.h"
43#include "TComPicSym.h"
44#include "TComPicYuv.h"
45#include "TComBitStream.h"
46
[56]47//! \ingroup TLibCommon
48//! \{
49
[2]50class SEImessages;
51
52// ====================================================================================================================
53// Class definition
54// ====================================================================================================================
55
56/// picture class (symbol + YUV buffers)
57class TComPic
58{
59private:
[56]60  UInt                  m_uiTLayer;               //  Temporal layer
61  Bool                  m_bUsedByCurr;            //  Used by current picture
62  Bool                  m_bIsLongTerm;            //  IS long term picture
[2]63  TComPicSym*           m_apcPicSym;              //  Symbol
[56]64 
[2]65  TComPicYuv*           m_apcPicYuv[2];           //  Texture,  0:org / 1:rec
[56]66 
[5]67#if DEPTH_MAP_GENERATION
[2]68  TComPicYuv*           m_pcPredDepthMap;         //  estimated depth map
[100]69#if PDM_REMOVE_DEPENDENCE
70  TComPicYuv*           m_pcPredDepthMap_temp;         //  estimated depth map
71  Bool                  m_bPDMV2;                       
[5]72#endif
[100]73#endif
[56]74
[187]75#if LG_ZEROINTRADEPTHRESI_A0087
[100]76  Int                   m_uiIntraPeriod;
77#endif
78
[5]79#if HHI_INTER_VIEW_MOTION_PRED
[2]80  TComPicYuv*           m_pcOrgDepthMap;          //  original depth map
[187]81#if QC_MULTI_DIS_CAN_A0097
[100]82  Bool          m_checked;
[5]83#endif
[185]84#if QC_SIMPLE_NBDV_B0047
85  UInt        m_uiRapRefIdx;
86  RefPicList  m_eRapRefList;
87  Bool        m_bRapCheck;
[100]88#endif
[185]89#endif
[5]90#if HHI_INTER_VIEW_RESIDUAL_PRED
[2]91  TComPicYuv*           m_pcResidual;             //  residual buffer (coded or inter-view predicted residual)
[5]92#endif
93
[2]94  TComPicYuv*           m_pcPicYuvPred;           //  Prediction
95  TComPicYuv*           m_pcPicYuvResi;           //  Residual
96  Bool                  m_bReconstructed;
[56]97  Bool                  m_bNeededForOutput;
[2]98  UInt                  m_uiCurrSliceIdx;         // Index of current slice
[5]99
[56]100  Bool                  m_usedForTMVP;
101 
102  Int*                  m_pSliceSUMap;
103  Bool*                 m_pbValidSlice;
104  Int                   m_sliceGranularityForNDBFilter;
105  Bool                  m_bIndependentSliceBoundaryForNDBFilter;
106  Bool                  m_bIndependentTileBoundaryForNDBFilter;
107  TComPicYuv*           m_pNDBFilterYuvTmp;    //!< temporary picture buffer when non-cross slice/tile boundary in-loop filtering is enabled
108  std::vector<std::vector<TComDataCU*> > m_vSliceCUDataLink;
109
[2]110  SEImessages* m_SEIs; ///< Any SEI messages that have been received.  If !NULL we own the object.
[56]111#if HHI_INTERVIEW_SKIP
112  TComPicYuv*           m_pcUsedPelsMap;
113#endif
[21]114#if SONY_COLPIC_AVAILABILITY
115  Int                   m_iViewOrderIdx;
116#endif
[2]117  Int**                 m_aaiCodedScale;
118  Int**                 m_aaiCodedOffset;
119
[181]120#if OL_QTLIMIT_PREDCODING_B0068
121  Bool                  m_bReduceBitsQTL;
[126]122#endif
123
[2]124public:
125  TComPic();
126  virtual ~TComPic();
[56]127 
128  Void          create( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, Bool bIsVirtual = false );
129  virtual Void  destroy();
130 
131  UInt          getTLayer()                { return m_uiTLayer;   }
132  Void          setTLayer( UInt uiTLayer ) { m_uiTLayer = uiTLayer; }
[2]133
[56]134  Bool          getUsedByCurr()             { return m_bUsedByCurr; }
135  Void          setUsedByCurr( Bool bUsed ) { m_bUsedByCurr = bUsed; }
136  Bool          getIsLongTerm()             { return m_bIsLongTerm; }
137  Void          setIsLongTerm( Bool lt ) { m_bIsLongTerm = lt; }
[5]138
[2]139  TComPicSym*   getPicSym()           { return  m_apcPicSym;    }
140  TComSlice*    getSlice(Int i)       { return  m_apcPicSym->getSlice(i);  }
141  TComSlice*    getCurrSlice()        { return  m_apcPicSym->getSlice(m_uiCurrSliceIdx);  }
[77]142#if VIDYO_VPS_INTEGRATION
143  TComVPS*      getVPS()              { return  m_apcPicSym->getSlice(m_uiCurrSliceIdx)->getVPS();  }
144#endif
[187]145#if LG_ZEROINTRADEPTHRESI_A0087
[100]146  Int           getIntraPeriod()                           { return  m_uiIntraPeriod; }
147  Void          setIntraPeriod(Int uiIntraPeriod)          { m_uiIntraPeriod = uiIntraPeriod; }
148#endif
[2]149  TComSPS*      getSPS()              { return  m_apcPicSym->getSlice(m_uiCurrSliceIdx)->getSPS();  }
150  Int           getPOC()              { return  m_apcPicSym->getSlice(m_uiCurrSliceIdx)->getPOC();  }
[56]151  Int           getViewId()           { return  m_apcPicSym->getSlice(m_uiCurrSliceIdx)->getViewId(); }
[100]152  TComDataCU*&  getCU( UInt uiCUAddr ){ return  m_apcPicSym->getCU( uiCUAddr ); }
[56]153 
[2]154  TComPicYuv*   getPicYuvOrg()        { return  m_apcPicYuv[0]; }
155  TComPicYuv*   getPicYuvRec()        { return  m_apcPicYuv[1]; }
[56]156#if HHI_INTERVIEW_SKIP
157  TComPicYuv*   getUsedPelsMap()      { return  m_pcUsedPelsMap; }
158#endif
159 
[5]160#if DEPTH_MAP_GENERATION
[2]161  TComPicYuv*   getPredDepthMap()     { return  m_pcPredDepthMap; }
[100]162#if PDM_REMOVE_DEPENDENCE
163  TComPicYuv*   getPredDepthMapTemp()           { return  m_pcPredDepthMap_temp; }
164  Void          setStoredPDMforV2  (Bool flag)  { m_bPDMV2 = flag;}
165  Bool          getStoredPDMforV2  ()           { return m_bPDMV2;}
[5]166#endif
[56]167
[100]168#endif
[5]169#if HHI_INTER_VIEW_MOTION_PRED
[2]170  TComPicYuv*   getOrgDepthMap()      { return  m_pcOrgDepthMap; }
[187]171#if QC_MULTI_DIS_CAN_A0097
[100]172  Void          setCandPicCheckedFlag (Bool bchecked)   { m_checked = bchecked; }
173  Bool          getCandPicCheckedFlag ()                { return m_checked;}
[5]174#endif
[100]175#endif
[56]176
[5]177#if HHI_INTER_VIEW_RESIDUAL_PRED
[2]178  TComPicYuv*   getResidual()         { return  m_pcResidual; }
[5]179#endif
[185]180#if QC_SIMPLE_NBDV_B0047
181  UInt          getRapRefIdx()                         {return m_uiRapRefIdx;}
182  RefPicList    getRapRefList()                        {return m_eRapRefList;}
183  Void          setRapRefIdx(UInt uiRapRefIdx)         {m_uiRapRefIdx = uiRapRefIdx;}
184  Void          setRapRefList(RefPicList eRefPicList)  {m_eRapRefList = eRefPicList;}
185  Bool          getRapbCheck()                         {return m_bRapCheck;}
186  Void          setRapbCheck(Bool bCheck)              {m_bRapCheck = bCheck;}
187  Bool          getDisCandRefPictures(Int iColPOC);
188#endif
[5]189
[21]190#if SONY_COLPIC_AVAILABILITY
191  Void          setViewOrderIdx(Int i)                        { m_iViewOrderIdx = i; }
192  Int           getViewOrderIdx()                             { return m_iViewOrderIdx; }
193#endif
[181]194
195#if OL_QTLIMIT_PREDCODING_B0068
196  Bool          getReduceBitsFlag ()             { return m_bReduceBitsQTL;     }
197  Void          setReduceBitsFlag ( Bool bFlag ) { m_bReduceBitsQTL = bFlag;    }
198#endif
199
[2]200  Void          setScaleOffset( Int** pS, Int** pO )  { m_aaiCodedScale = pS; m_aaiCodedOffset = pO; }
201  Int**         getCodedScale ()                      { return m_aaiCodedScale;  }
202  Int**         getCodedOffset()                      { return m_aaiCodedOffset; }
203
[56]204  TComPicYuv*   getPicYuvPred()       { return  m_pcPicYuvPred; }
205  TComPicYuv*   getPicYuvResi()       { return  m_pcPicYuvResi; }
206  Void          setPicYuvPred( TComPicYuv* pcPicYuv )       { m_pcPicYuvPred = pcPicYuv; }
207  Void          setPicYuvResi( TComPicYuv* pcPicYuv )       { m_pcPicYuvResi = pcPicYuv; }
208 
[2]209  UInt          getNumCUsInFrame()      { return m_apcPicSym->getNumberOfCUsInFrame(); }
210  UInt          getNumPartInWidth()     { return m_apcPicSym->getNumPartInWidth();     }
211  UInt          getNumPartInHeight()    { return m_apcPicSym->getNumPartInHeight();    }
212  UInt          getNumPartInCU()        { return m_apcPicSym->getNumPartition();       }
213  UInt          getFrameWidthInCU()     { return m_apcPicSym->getFrameWidthInCU();     }
214  UInt          getFrameHeightInCU()    { return m_apcPicSym->getFrameHeightInCU();    }
215  UInt          getMinCUWidth()         { return m_apcPicSym->getMinCUWidth();         }
216  UInt          getMinCUHeight()        { return m_apcPicSym->getMinCUHeight();        }
[56]217 
[2]218  UInt          getParPelX(UChar uhPartIdx) { return getParPelX(uhPartIdx); }
219  UInt          getParPelY(UChar uhPartIdx) { return getParPelX(uhPartIdx); }
[56]220 
[2]221  Int           getStride()           { return m_apcPicYuv[1]->getStride(); }
222  Int           getCStride()          { return m_apcPicYuv[1]->getCStride(); }
[56]223 
[2]224  Void          setReconMark (Bool b) { m_bReconstructed = b;     }
225  Bool          getReconMark ()       { return m_bReconstructed;  }
[5]226
[56]227  Void          setUsedForTMVP( Bool b ) { m_usedForTMVP = b;    }
228  Bool          getUsedForTMVP()         { return m_usedForTMVP; }
229
230  Void          setOutputMark (Bool b) { m_bNeededForOutput = b;     }
231  Bool          getOutputMark ()       { return m_bNeededForOutput;  }
232 
233  Void          compressMotion(); 
[2]234  UInt          getCurrSliceIdx()            { return m_uiCurrSliceIdx;                }
235  Void          setCurrSliceIdx(UInt i)      { m_uiCurrSliceIdx = i;                   }
236  UInt          getNumAllocatedSlice()       {return m_apcPicSym->getNumAllocatedSlice();}
237  Void          allocateNewSlice()           {m_apcPicSym->allocateNewSlice();         }
238  Void          clearSliceBuffer()           {m_apcPicSym->clearSliceBuffer();         }
[56]239#if HHI_INTERVIEW_SKIP
240  Void          addUsedPelsMapBuffer    ();
241  Void          removeUsedPelsMapBuffer ();
242#endif
243 
244  Void          createNonDBFilterInfo   (UInt* pSliceStartAddress = NULL, Int numSlices = 1, Int sliceGranularityDepth= 0
245                                        ,Bool bNDBFilterCrossSliceBoundary = true
246                                        ,Int  numTiles = 1
247                                        ,Bool bNDBFilterCrossTileBoundary = true);
248  Void          createNonDBFilterInfoLCU(Int tileID, Int sliceID, TComDataCU* pcCU, UInt startSU, UInt endSU, Int sliceGranularyDepth, UInt picWidth, UInt picHeight);
249  Void          destroyNonDBFilterInfo();
[2]250
[5]251#if DEPTH_MAP_GENERATION
[21]252  Void          addPrdDepthMapBuffer    ( UInt uiSubSampExpX, UInt uiSubSampExpY );
[5]253#endif
254#if HHI_INTER_VIEW_MOTION_PRED
[2]255  Void          addOrgDepthMapBuffer    ();
[5]256#endif
257#if HHI_INTER_VIEW_RESIDUAL_PRED
[2]258  Void          addResidualBuffer       ();
[5]259#endif
260#if DEPTH_MAP_GENERATION
[2]261  Void          removePrdDepthMapBuffer ();
[5]262#endif
263#if HHI_INTER_VIEW_MOTION_PRED
[2]264  Void          removeOrgDepthMapBuffer ();
[5]265#endif
266#if HHI_INTER_VIEW_RESIDUAL_PRED
[2]267  Void          removeResidualBuffer    ();
[5]268#endif
[126]269
[56]270  Bool          getValidSlice                                  (Int sliceID)  {return m_pbValidSlice[sliceID];}
271  Int           getSliceGranularityForNDBFilter                ()             {return m_sliceGranularityForNDBFilter;}
272  Bool          getIndependentSliceBoundaryForNDBFilter        ()             {return m_bIndependentSliceBoundaryForNDBFilter;}
273  Bool          getIndependentTileBoundaryForNDBFilter         ()             {return m_bIndependentTileBoundaryForNDBFilter; }
274  TComPicYuv*   getYuvPicBufferForIndependentBoundaryProcessing()             {return m_pNDBFilterYuvTmp;}
275  std::vector<TComDataCU*>& getOneSliceCUDataForNDBFilter      (Int sliceID) { return m_vSliceCUDataLink[sliceID];}
[5]276
[56]277  /** transfer ownership of seis to this picture */
[2]278  void setSEIs(SEImessages* seis) { m_SEIs = seis; }
279
280  /**
281   * return the current list of SEI messages associated with this picture.
[56]282   * Pointer is valid until this->destroy() is called */
[2]283  SEImessages* getSEIs() { return m_SEIs; }
284
285  /**
286   * return the current list of SEI messages associated with this picture.
[56]287   * Pointer is valid until this->destroy() is called */
[2]288  const SEImessages* getSEIs() const { return m_SEIs; }
289
290};// END CLASS DEFINITION TComPic
291
[56]292//! \}
[2]293
294#endif // __TCOMPIC__
Note: See TracBrowser for help on using the repository browser.