source: 3DVCSoftware/branches/HTM-4.0.1-VSP-dev0/source/Lib/TLibCommon/TComPic.h @ 193

Last change on this file since 193 was 193, checked in by mitsubishi-htm, 12 years ago

A second release, as planned

  • Migrate to HTM 4.1
  • Move VSP related switches to cfg file instead of #define in the source code
  • A few bug fixes
  • For VC project files, only VC9 file is updated

TODO

  • Migrate to HTM 5.0, to be used as anchor for CE1 toward Geneva meeting
  • Property svn:eol-style set to native
File size: 13.3 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-2012, 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     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
47//! \ingroup TLibCommon
48//! \{
49
50class SEImessages;
51
52// ====================================================================================================================
53// Class definition
54// ====================================================================================================================
55
56/// picture class (symbol + YUV buffers)
57class TComPic
58{
59private:
60  UInt                  m_uiTLayer;               //  Temporal layer
61  Bool                  m_bUsedByCurr;            //  Used by current picture
62  Bool                  m_bIsLongTerm;            //  IS long term picture
63  TComPicSym*           m_apcPicSym;              //  Symbol
64 
65  TComPicYuv*           m_apcPicYuv[2];           //  Texture,  0:org / 1:rec
66 
67#if VSP_N
68  TComPicYuv*           m_apcPicYuvAvail;         //  Availability Map - Does the given pixel can be synthesised in receiver
69  TComPicYuv*           m_apcPicYuvSynth;         //  Sythesied image
70#endif
71
72#if DEPTH_MAP_GENERATION
73  TComPicYuv*           m_pcPredDepthMap;         //  estimated depth map
74#if PDM_REMOVE_DEPENDENCE
75  TComPicYuv*           m_pcPredDepthMap_temp;         //  estimated depth map
76  Bool                  m_bPDMV2;                       
77#endif
78#endif
79
80#if LG_ZEROINTRADEPTHRESI_M26039
81  Int                   m_uiIntraPeriod;
82#endif
83
84#if HHI_INTER_VIEW_MOTION_PRED
85  TComPicYuv*           m_pcOrgDepthMap;          //  original depth map
86#if QC_MULTI_DIS_CAN
87  Bool          m_checked;
88#endif
89#endif
90#if HHI_INTER_VIEW_RESIDUAL_PRED
91  TComPicYuv*           m_pcResidual;             //  residual buffer (coded or inter-view predicted residual)
92#endif
93
94  TComPicYuv*           m_pcPicYuvPred;           //  Prediction
95  TComPicYuv*           m_pcPicYuvResi;           //  Residual
96  Bool                  m_bReconstructed;
97  Bool                  m_bNeededForOutput;
98  UInt                  m_uiCurrSliceIdx;         // Index of current slice
99
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
110  SEImessages* m_SEIs; ///< Any SEI messages that have been received.  If !NULL we own the object.
111#if HHI_INTERVIEW_SKIP
112  TComPicYuv*           m_pcUsedPelsMap;
113#endif
114#if SONY_COLPIC_AVAILABILITY
115  Int                   m_iViewOrderIdx;
116#endif
117  Int**                 m_aaiCodedScale;
118  Int**                 m_aaiCodedOffset;
119
120#if OL_DEPTHLIMIT_A0044
121  UInt*                 m_texPartInfo;
122  UInt                  m_uiTexPartIndex;
123#endif
124
125public:
126  TComPic();
127  virtual ~TComPic();
128 
129  Void          create( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, Bool bIsVirtual = false );
130  virtual Void  destroy();
131 
132  UInt          getTLayer()                { return m_uiTLayer;   }
133  Void          setTLayer( UInt uiTLayer ) { m_uiTLayer = uiTLayer; }
134
135  Bool          getUsedByCurr()             { return m_bUsedByCurr; }
136  Void          setUsedByCurr( Bool bUsed ) { m_bUsedByCurr = bUsed; }
137  Bool          getIsLongTerm()             { return m_bIsLongTerm; }
138  Void          setIsLongTerm( Bool lt ) { m_bIsLongTerm = lt; }
139
140  TComPicSym*   getPicSym()           { return  m_apcPicSym;    }
141  TComSlice*    getSlice(Int i)       { return  m_apcPicSym->getSlice(i);  }
142  TComSlice*    getCurrSlice()        { return  m_apcPicSym->getSlice(m_uiCurrSliceIdx);  }
143#if VIDYO_VPS_INTEGRATION
144  TComVPS*      getVPS()              { return  m_apcPicSym->getSlice(m_uiCurrSliceIdx)->getVPS();  }
145#endif
146#if LG_ZEROINTRADEPTHRESI_M26039
147  Int           getIntraPeriod()                           { return  m_uiIntraPeriod; }
148  Void          setIntraPeriod(Int uiIntraPeriod)          { m_uiIntraPeriod = uiIntraPeriod; }
149#endif
150  TComSPS*      getSPS()              { return  m_apcPicSym->getSlice(m_uiCurrSliceIdx)->getSPS();  }
151  Int           getPOC()              { return  m_apcPicSym->getSlice(m_uiCurrSliceIdx)->getPOC();  }
152  Int           getViewId()           { return  m_apcPicSym->getSlice(m_uiCurrSliceIdx)->getViewId(); }
153  TComDataCU*&  getCU( UInt uiCUAddr ){ return  m_apcPicSym->getCU( uiCUAddr ); }
154 
155  TComPicYuv*   getPicYuvOrg()        { return  m_apcPicYuv[0]; }
156  TComPicYuv*   getPicYuvRec()        { return  m_apcPicYuv[1]; }
157#if VSP_N
158  Void          setPicYuvAvail( TComPicYuv* pc ){ m_apcPicYuvAvail = pc; }
159  Void          setPicYuvSynth( TComPicYuv* pc ){ m_apcPicYuvSynth = pc; }
160  TComPicYuv*   getPicYuvAvail()      { return  m_apcPicYuvAvail; }
161  TComPicYuv*   getPicYuvSynth()      { return  m_apcPicYuvSynth; }
162  Void          checkSynthesisAvailability(  /*TComDataCU*& rpcBestCU, */UInt iCuAddr, UInt uiAbsZorderIdx, UInt uiPartDepth, Bool *&rpbCUSynthesied);
163#endif
164#if HHI_INTERVIEW_SKIP
165  TComPicYuv*   getUsedPelsMap()      { return  m_pcUsedPelsMap; }
166#endif
167 
168#if DEPTH_MAP_GENERATION
169  TComPicYuv*   getPredDepthMap()     { return  m_pcPredDepthMap; }
170#if PDM_REMOVE_DEPENDENCE
171  TComPicYuv*   getPredDepthMapTemp()           { return  m_pcPredDepthMap_temp; }
172  Void          setStoredPDMforV2  (Bool flag)  { m_bPDMV2 = flag;}
173  Bool          getStoredPDMforV2  ()           { return m_bPDMV2;}
174#endif
175
176#endif
177#if HHI_INTER_VIEW_MOTION_PRED
178  TComPicYuv*   getOrgDepthMap()      { return  m_pcOrgDepthMap; }
179#if QC_MULTI_DIS_CAN
180  Void          setCandPicCheckedFlag (Bool bchecked)   { m_checked = bchecked; }
181  Bool          getCandPicCheckedFlag ()                { return m_checked;}
182#endif
183#endif
184
185#if HHI_INTER_VIEW_RESIDUAL_PRED
186  TComPicYuv*   getResidual()         { return  m_pcResidual; }
187#endif
188
189#if SONY_COLPIC_AVAILABILITY
190  Void          setViewOrderIdx(Int i)                        { m_iViewOrderIdx = i; }
191  Int           getViewOrderIdx()                             { return m_iViewOrderIdx; }
192#endif
193  Void          setScaleOffset( Int** pS, Int** pO )  { m_aaiCodedScale = pS; m_aaiCodedOffset = pO; }
194  Int**         getCodedScale ()                      { return m_aaiCodedScale;  }
195  Int**         getCodedOffset()                      { return m_aaiCodedOffset; }
196
197  TComPicYuv*   getPicYuvPred()       { return  m_pcPicYuvPred; }
198  TComPicYuv*   getPicYuvResi()       { return  m_pcPicYuvResi; }
199  Void          setPicYuvPred( TComPicYuv* pcPicYuv )       { m_pcPicYuvPred = pcPicYuv; }
200  Void          setPicYuvResi( TComPicYuv* pcPicYuv )       { m_pcPicYuvResi = pcPicYuv; }
201 
202  UInt          getNumCUsInFrame()      { return m_apcPicSym->getNumberOfCUsInFrame(); }
203  UInt          getNumPartInWidth()     { return m_apcPicSym->getNumPartInWidth();     }
204  UInt          getNumPartInHeight()    { return m_apcPicSym->getNumPartInHeight();    }
205  UInt          getNumPartInCU()        { return m_apcPicSym->getNumPartition();       }
206  UInt          getFrameWidthInCU()     { return m_apcPicSym->getFrameWidthInCU();     }
207  UInt          getFrameHeightInCU()    { return m_apcPicSym->getFrameHeightInCU();    }
208  UInt          getMinCUWidth()         { return m_apcPicSym->getMinCUWidth();         }
209  UInt          getMinCUHeight()        { return m_apcPicSym->getMinCUHeight();        }
210 
211  UInt          getParPelX(UChar uhPartIdx) { return getParPelX(uhPartIdx); }
212  UInt          getParPelY(UChar uhPartIdx) { return getParPelX(uhPartIdx); }
213 
214  Int           getStride()           { return m_apcPicYuv[1]->getStride(); }
215  Int           getCStride()          { return m_apcPicYuv[1]->getCStride(); }
216 
217  Void          setReconMark (Bool b) { m_bReconstructed = b;     }
218  Bool          getReconMark ()       { return m_bReconstructed;  }
219
220  Void          setUsedForTMVP( Bool b ) { m_usedForTMVP = b;    }
221  Bool          getUsedForTMVP()         { return m_usedForTMVP; }
222
223  Void          setOutputMark (Bool b) { m_bNeededForOutput = b;     }
224  Bool          getOutputMark ()       { return m_bNeededForOutput;  }
225 
226  Void          compressMotion(); 
227  UInt          getCurrSliceIdx()            { return m_uiCurrSliceIdx;                }
228  Void          setCurrSliceIdx(UInt i)      { m_uiCurrSliceIdx = i;                   }
229  UInt          getNumAllocatedSlice()       {return m_apcPicSym->getNumAllocatedSlice();}
230  Void          allocateNewSlice()           {m_apcPicSym->allocateNewSlice();         }
231  Void          clearSliceBuffer()           {m_apcPicSym->clearSliceBuffer();         }
232#if HHI_INTERVIEW_SKIP
233  Void          addUsedPelsMapBuffer    ();
234  Void          removeUsedPelsMapBuffer ();
235#endif
236 
237  Void          createNonDBFilterInfo   (UInt* pSliceStartAddress = NULL, Int numSlices = 1, Int sliceGranularityDepth= 0
238                                        ,Bool bNDBFilterCrossSliceBoundary = true
239                                        ,Int  numTiles = 1
240                                        ,Bool bNDBFilterCrossTileBoundary = true);
241  Void          createNonDBFilterInfoLCU(Int tileID, Int sliceID, TComDataCU* pcCU, UInt startSU, UInt endSU, Int sliceGranularyDepth, UInt picWidth, UInt picHeight);
242  Void          destroyNonDBFilterInfo();
243
244#if DEPTH_MAP_GENERATION
245  Void          addPrdDepthMapBuffer    ( UInt uiSubSampExpX, UInt uiSubSampExpY );
246#endif
247#if HHI_INTER_VIEW_MOTION_PRED
248  Void          addOrgDepthMapBuffer    ();
249#endif
250#if HHI_INTER_VIEW_RESIDUAL_PRED
251  Void          addResidualBuffer       ();
252#endif
253#if DEPTH_MAP_GENERATION
254  Void          removePrdDepthMapBuffer ();
255#endif
256#if HHI_INTER_VIEW_MOTION_PRED
257  Void          removeOrgDepthMapBuffer ();
258#endif
259#if HHI_INTER_VIEW_RESIDUAL_PRED
260  Void          removeResidualBuffer    ();
261#endif
262
263#if OL_DEPTHLIMIT_A0044
264  UInt        accessPartInfo        ( UInt count )   { return m_texPartInfo[m_uiTexPartIndex + count]; };
265  Void        incrementTexPartIndex (            )   { m_uiTexPartIndex += 2;    };
266  UInt        getTexPartIndex       ()               { return m_uiTexPartIndex;  };
267  Void        setTexPartIndex       ( UInt idx   )   { m_uiTexPartIndex = idx; };
268  Void        setPartInfo           ( UInt* texPart) { m_texPartInfo    = texPart;  };
269#endif
270
271  Bool          getValidSlice                                  (Int sliceID)  {return m_pbValidSlice[sliceID];}
272  Int           getSliceGranularityForNDBFilter                ()             {return m_sliceGranularityForNDBFilter;}
273  Bool          getIndependentSliceBoundaryForNDBFilter        ()             {return m_bIndependentSliceBoundaryForNDBFilter;}
274  Bool          getIndependentTileBoundaryForNDBFilter         ()             {return m_bIndependentTileBoundaryForNDBFilter; }
275  TComPicYuv*   getYuvPicBufferForIndependentBoundaryProcessing()             {return m_pNDBFilterYuvTmp;}
276  std::vector<TComDataCU*>& getOneSliceCUDataForNDBFilter      (Int sliceID) { return m_vSliceCUDataLink[sliceID];}
277
278  /** transfer ownership of seis to this picture */
279  void setSEIs(SEImessages* seis) { m_SEIs = seis; }
280
281  /**
282   * return the current list of SEI messages associated with this picture.
283   * Pointer is valid until this->destroy() is called */
284  SEImessages* getSEIs() { return m_SEIs; }
285
286  /**
287   * return the current list of SEI messages associated with this picture.
288   * Pointer is valid until this->destroy() is called */
289  const SEImessages* getSEIs() const { return m_SEIs; }
290
291};// END CLASS DEFINITION TComPic
292
293//! \}
294
295#endif // __TCOMPIC__
Note: See TracBrowser for help on using the repository browser.