source: 3DVCSoftware/branches/HTM-3.1-Qualcomm/source/Lib/TLibCommon/TComPic.h @ 141

Last change on this file since 141 was 93, checked in by qualcomm, 12 years ago
  • Property svn:eol-style set to native
File size: 11.8 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
[93]69#if PDM_REMOVE_DEPENDENCE
70  TComPicYuv*           m_pcPredDepthMap_temp;         //  estimated depth map
71  Bool                  m_bPDMV2;                       
[5]72#endif
[93]73#endif
[56]74
[5]75#if HHI_INTER_VIEW_MOTION_PRED
[2]76  TComPicYuv*           m_pcOrgDepthMap;          //  original depth map
[91]77#if QC_MULTI_DIS_CAN
78  Bool                                  m_checked;
[5]79#endif
[91]80#endif
[5]81#if HHI_INTER_VIEW_RESIDUAL_PRED
[2]82  TComPicYuv*           m_pcResidual;             //  residual buffer (coded or inter-view predicted residual)
[5]83#endif
84
[2]85  TComPicYuv*           m_pcPicYuvPred;           //  Prediction
86  TComPicYuv*           m_pcPicYuvResi;           //  Residual
87  Bool                  m_bReconstructed;
[56]88  Bool                  m_bNeededForOutput;
[2]89  UInt                  m_uiCurrSliceIdx;         // Index of current slice
[5]90
[56]91  Bool                  m_usedForTMVP;
92 
93  Int*                  m_pSliceSUMap;
94  Bool*                 m_pbValidSlice;
95  Int                   m_sliceGranularityForNDBFilter;
96  Bool                  m_bIndependentSliceBoundaryForNDBFilter;
97  Bool                  m_bIndependentTileBoundaryForNDBFilter;
98  TComPicYuv*           m_pNDBFilterYuvTmp;    //!< temporary picture buffer when non-cross slice/tile boundary in-loop filtering is enabled
99  std::vector<std::vector<TComDataCU*> > m_vSliceCUDataLink;
100
[2]101  SEImessages* m_SEIs; ///< Any SEI messages that have been received.  If !NULL we own the object.
[56]102#if HHI_INTERVIEW_SKIP
103  TComPicYuv*           m_pcUsedPelsMap;
104#endif
[21]105#if SONY_COLPIC_AVAILABILITY
106  Int                   m_iViewOrderIdx;
107#endif
[2]108  Int**                 m_aaiCodedScale;
109  Int**                 m_aaiCodedOffset;
110
111public:
112  TComPic();
113  virtual ~TComPic();
[56]114 
115  Void          create( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, Bool bIsVirtual = false );
116  virtual Void  destroy();
117 
118  UInt          getTLayer()                { return m_uiTLayer;   }
119  Void          setTLayer( UInt uiTLayer ) { m_uiTLayer = uiTLayer; }
[2]120
[56]121  Bool          getUsedByCurr()             { return m_bUsedByCurr; }
122  Void          setUsedByCurr( Bool bUsed ) { m_bUsedByCurr = bUsed; }
123  Bool          getIsLongTerm()             { return m_bIsLongTerm; }
124  Void          setIsLongTerm( Bool lt ) { m_bIsLongTerm = lt; }
[5]125
[2]126  TComPicSym*   getPicSym()           { return  m_apcPicSym;    }
127  TComSlice*    getSlice(Int i)       { return  m_apcPicSym->getSlice(i);  }
128  TComSlice*    getCurrSlice()        { return  m_apcPicSym->getSlice(m_uiCurrSliceIdx);  }
[77]129#if VIDYO_VPS_INTEGRATION
130  TComVPS*      getVPS()              { return  m_apcPicSym->getSlice(m_uiCurrSliceIdx)->getVPS();  }
131#endif
[2]132  TComSPS*      getSPS()              { return  m_apcPicSym->getSlice(m_uiCurrSliceIdx)->getSPS();  }
133  Int           getPOC()              { return  m_apcPicSym->getSlice(m_uiCurrSliceIdx)->getPOC();  }
[56]134  Int           getViewId()           { return  m_apcPicSym->getSlice(m_uiCurrSliceIdx)->getViewId(); }
[2]135  TComDataCU*&  getCU( UInt uiCUAddr )  { return  m_apcPicSym->getCU( uiCUAddr ); }
[56]136 
[2]137  TComPicYuv*   getPicYuvOrg()        { return  m_apcPicYuv[0]; }
138  TComPicYuv*   getPicYuvRec()        { return  m_apcPicYuv[1]; }
[56]139#if HHI_INTERVIEW_SKIP
140  TComPicYuv*   getUsedPelsMap()      { return  m_pcUsedPelsMap; }
141#endif
142 
[5]143#if DEPTH_MAP_GENERATION
[2]144  TComPicYuv*   getPredDepthMap()     { return  m_pcPredDepthMap; }
[93]145#if PDM_REMOVE_DEPENDENCE
146  TComPicYuv*   getPredDepthMapTemp()         { return  m_pcPredDepthMap_temp; }
147  Void          setStoredPDMforV2(Bool flag)  { m_bPDMV2 = flag;}
148  Bool          getStoredPDMforV2()           { return m_bPDMV2;}
[5]149#endif
[56]150
[93]151#endif
[5]152#if HHI_INTER_VIEW_MOTION_PRED
[2]153  TComPicYuv*   getOrgDepthMap()      { return  m_pcOrgDepthMap; }
[91]154#if QC_MULTI_DIS_CAN
155  Void                  setCandPicCheckedFlag (Bool bchecked)           { m_checked = bchecked; }
156  Bool          getCandPicCheckedFlag ()                                        { return m_checked;}
[5]157#endif
[91]158#endif
[56]159
[5]160#if HHI_INTER_VIEW_RESIDUAL_PRED
[2]161  TComPicYuv*   getResidual()         { return  m_pcResidual; }
[5]162#endif
163
[21]164#if SONY_COLPIC_AVAILABILITY
165  Void          setViewOrderIdx(Int i)                        { m_iViewOrderIdx = i; }
166  Int           getViewOrderIdx()                             { return m_iViewOrderIdx; }
167#endif
[2]168  Void          setScaleOffset( Int** pS, Int** pO )  { m_aaiCodedScale = pS; m_aaiCodedOffset = pO; }
169  Int**         getCodedScale ()                      { return m_aaiCodedScale;  }
170  Int**         getCodedOffset()                      { return m_aaiCodedOffset; }
171
[56]172  TComPicYuv*   getPicYuvPred()       { return  m_pcPicYuvPred; }
173  TComPicYuv*   getPicYuvResi()       { return  m_pcPicYuvResi; }
174  Void          setPicYuvPred( TComPicYuv* pcPicYuv )       { m_pcPicYuvPred = pcPicYuv; }
175  Void          setPicYuvResi( TComPicYuv* pcPicYuv )       { m_pcPicYuvResi = pcPicYuv; }
176 
[2]177  UInt          getNumCUsInFrame()      { return m_apcPicSym->getNumberOfCUsInFrame(); }
178  UInt          getNumPartInWidth()     { return m_apcPicSym->getNumPartInWidth();     }
179  UInt          getNumPartInHeight()    { return m_apcPicSym->getNumPartInHeight();    }
180  UInt          getNumPartInCU()        { return m_apcPicSym->getNumPartition();       }
181  UInt          getFrameWidthInCU()     { return m_apcPicSym->getFrameWidthInCU();     }
182  UInt          getFrameHeightInCU()    { return m_apcPicSym->getFrameHeightInCU();    }
183  UInt          getMinCUWidth()         { return m_apcPicSym->getMinCUWidth();         }
184  UInt          getMinCUHeight()        { return m_apcPicSym->getMinCUHeight();        }
[56]185 
[2]186  UInt          getParPelX(UChar uhPartIdx) { return getParPelX(uhPartIdx); }
187  UInt          getParPelY(UChar uhPartIdx) { return getParPelX(uhPartIdx); }
[56]188 
[2]189  Int           getStride()           { return m_apcPicYuv[1]->getStride(); }
190  Int           getCStride()          { return m_apcPicYuv[1]->getCStride(); }
[56]191 
[2]192  Void          setReconMark (Bool b) { m_bReconstructed = b;     }
193  Bool          getReconMark ()       { return m_bReconstructed;  }
[5]194
[56]195  Void          setUsedForTMVP( Bool b ) { m_usedForTMVP = b;    }
196  Bool          getUsedForTMVP()         { return m_usedForTMVP; }
197
198  Void          setOutputMark (Bool b) { m_bNeededForOutput = b;     }
199  Bool          getOutputMark ()       { return m_bNeededForOutput;  }
200 
201  Void          compressMotion(); 
[2]202  UInt          getCurrSliceIdx()            { return m_uiCurrSliceIdx;                }
203  Void          setCurrSliceIdx(UInt i)      { m_uiCurrSliceIdx = i;                   }
204  UInt          getNumAllocatedSlice()       {return m_apcPicSym->getNumAllocatedSlice();}
205  Void          allocateNewSlice()           {m_apcPicSym->allocateNewSlice();         }
206  Void          clearSliceBuffer()           {m_apcPicSym->clearSliceBuffer();         }
[56]207#if HHI_INTERVIEW_SKIP
208  Void          addUsedPelsMapBuffer    ();
209  Void          removeUsedPelsMapBuffer ();
210#endif
211 
212  Void          createNonDBFilterInfo   (UInt* pSliceStartAddress = NULL, Int numSlices = 1, Int sliceGranularityDepth= 0
213                                        ,Bool bNDBFilterCrossSliceBoundary = true
214                                        ,Int  numTiles = 1
215                                        ,Bool bNDBFilterCrossTileBoundary = true);
216  Void          createNonDBFilterInfoLCU(Int tileID, Int sliceID, TComDataCU* pcCU, UInt startSU, UInt endSU, Int sliceGranularyDepth, UInt picWidth, UInt picHeight);
217  Void          destroyNonDBFilterInfo();
[2]218
[5]219#if DEPTH_MAP_GENERATION
[21]220  Void          addPrdDepthMapBuffer    ( UInt uiSubSampExpX, UInt uiSubSampExpY );
[5]221#endif
222#if HHI_INTER_VIEW_MOTION_PRED
[2]223  Void          addOrgDepthMapBuffer    ();
[5]224#endif
225#if HHI_INTER_VIEW_RESIDUAL_PRED
[2]226  Void          addResidualBuffer       ();
[5]227#endif
228#if DEPTH_MAP_GENERATION
[2]229  Void          removePrdDepthMapBuffer ();
[5]230#endif
231#if HHI_INTER_VIEW_MOTION_PRED
[2]232  Void          removeOrgDepthMapBuffer ();
[5]233#endif
234#if HHI_INTER_VIEW_RESIDUAL_PRED
[2]235  Void          removeResidualBuffer    ();
[5]236#endif
[56]237  Bool          getValidSlice                                  (Int sliceID)  {return m_pbValidSlice[sliceID];}
238  Int           getSliceGranularityForNDBFilter                ()             {return m_sliceGranularityForNDBFilter;}
239  Bool          getIndependentSliceBoundaryForNDBFilter        ()             {return m_bIndependentSliceBoundaryForNDBFilter;}
240  Bool          getIndependentTileBoundaryForNDBFilter         ()             {return m_bIndependentTileBoundaryForNDBFilter; }
241  TComPicYuv*   getYuvPicBufferForIndependentBoundaryProcessing()             {return m_pNDBFilterYuvTmp;}
242  std::vector<TComDataCU*>& getOneSliceCUDataForNDBFilter      (Int sliceID) { return m_vSliceCUDataLink[sliceID];}
[5]243
[56]244  /** transfer ownership of seis to this picture */
[2]245  void setSEIs(SEImessages* seis) { m_SEIs = seis; }
246
247  /**
248   * return the current list of SEI messages associated with this picture.
[56]249   * Pointer is valid until this->destroy() is called */
[2]250  SEImessages* getSEIs() { return m_SEIs; }
251
252  /**
253   * return the current list of SEI messages associated with this picture.
[56]254   * Pointer is valid until this->destroy() is called */
[2]255  const SEImessages* getSEIs() const { return m_SEIs; }
256
257};// END CLASS DEFINITION TComPic
258
[56]259//! \}
[2]260
261#endif // __TCOMPIC__
Note: See TracBrowser for help on using the repository browser.