source: 3DVCSoftware/branches/0.2-poznan-univ/source/Lib/TLibCommon/TComPic.h @ 11

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

Poznan disocclusion coding - CU Skip

  • Property svn:eol-style set to native
File size: 11.4 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     TComPic.h
37    \brief    picture class (header)
38*/
39
40#ifndef __TCOMPIC__
41#define __TCOMPIC__
42
43// Include files
44#include "CommonDef.h"
45#include "TComPicSym.h"
46#include "TComPicYuv.h"
47#include "TComBitStream.h"
48#include "TComMVDRefData.h"
49
50class SEImessages;
51
52// ====================================================================================================================
53// Class definition
54// ====================================================================================================================
55
56/// picture class (symbol + YUV buffers)
57class TComPic
58{
59private:
60  TComPicSym*           m_apcPicSym;              //  Symbol
61
62  TComPicYuv*           m_apcPicYuv[2];           //  Texture,  0:org / 1:rec
63
64#if POZNAN_AVAIL_MAP
65  TComPicYuv*           m_apcPicYuvAvail;         //  Availability Map - Does the given pixel can be synthesised in receiver
66#endif
67
68#if POZNAN_SYNTH_VIEW
69  TComPicYuv*           m_apcPicYuvSynth;         //  Sythesied image
70#endif
71
72#if DEPTH_MAP_GENERATION
73  TComPicYuv*           m_pcPredDepthMap;         //  estimated depth map
74#endif
75#if HHI_INTER_VIEW_MOTION_PRED
76  TComPicYuv*           m_pcOrgDepthMap;          //  original depth map
77#endif
78#if HHI_INTER_VIEW_RESIDUAL_PRED
79  TComPicYuv*           m_pcResidual;             //  residual buffer (coded or inter-view predicted residual)
80#endif
81
82  TComPicYuv*           m_pcPicYuvPred;           //  Prediction
83  TComPicYuv*           m_pcPicYuvResi;           //  Residual
84#if PARALLEL_MERGED_DEBLK
85  TComPicYuv*           m_pcPicYuvDeblkBuf;
86#endif
87  Bool                  m_bReconstructed;
88  UInt                  m_uiCurrSliceIdx;         // Index of current slice
89
90  SEImessages* m_SEIs; ///< Any SEI messages that have been received.  If !NULL we own the object.
91
92  SliceType             m_eSliceType;
93  double                m_dQP;
94  Bool                  m_bReferenced;
95  UInt                  m_uiColDir;
96  Int                   m_aiRefPOCList[2][MAX_NUM_REF];
97  Int                   m_aiRefViewIdxList[2][MAX_NUM_REF];
98  Int                   m_aiNumRefIdx[2];    //  for multiple reference of current slice
99
100  Int                   m_iViewIdx;
101  Int**                 m_aaiCodedScale;
102  Int**                 m_aaiCodedOffset;
103
104#if HHI_VSO 
105  TComMVDRefData        m_cReferenceInfo;
106#endif
107#if HHI_INTERVIEW_SKIP
108  TComPicYuv*           m_pcUsedPelsMap;
109#endif
110
111
112public:
113  TComPic();
114  virtual ~TComPic();
115
116
117  Void          create( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth );
118  Void          destroy();
119
120  TComPicSym*   getPicSym()           { return  m_apcPicSym;    }
121  TComSlice*    getSlice(Int i)       { return  m_apcPicSym->getSlice(i);  }
122  TComSlice*    getCurrSlice()        { return  m_apcPicSym->getSlice(m_uiCurrSliceIdx);  }
123  TComSPS*      getSPS()              { return  m_apcPicSym->getSlice(m_uiCurrSliceIdx)->getSPS();  }
124  Int           getPOC()              { return  m_apcPicSym->getSlice(m_uiCurrSliceIdx)->getPOC();  }
125#if 0
126  Bool          getDRBFlag()          { return  m_apcPicSym->getSlice(m_uiCurrSliceIdx)->getDRBFlag();  }
127  Int           getERBIndex()         { return  m_apcPicSym->getSlice(m_uiCurrSliceIdx)->getERBIndex();  }
128#endif
129  TComDataCU*&  getCU( UInt uiCUAddr )  { return  m_apcPicSym->getCU( uiCUAddr ); }
130
131  SliceType     getSliceType()        { return m_eSliceType ;}
132  double        getQP()               { return m_dQP ;}
133  Bool          getReferenced()       { return m_bReferenced ;}
134
135  TComPicYuv*   getPicYuvOrg()        { return  m_apcPicYuv[0]; }
136  TComPicYuv*   getPicYuvRec()        { return  m_apcPicYuv[1]; }
137
138#if POZNAN_AVAIL_MAP
139  TComPicYuv*   getPicYuvAvail()      { return  m_apcPicYuvAvail; } //Owieczka - returns available map from other pic image
140#endif
141
142#if POZNAN_SYNTH_VIEW
143  TComPicYuv*   getPicYuvSynth()      { return  m_apcPicYuvSynth; } //Owieczka - returns synth form other pic in image
144#endif
145
146#if DEPTH_MAP_GENERATION
147  TComPicYuv*   getPredDepthMap()     { return  m_pcPredDepthMap; }
148#endif
149#if HHI_INTER_VIEW_MOTION_PRED
150  TComPicYuv*   getOrgDepthMap()      { return  m_pcOrgDepthMap; }
151#endif
152#if HHI_INTER_VIEW_RESIDUAL_PRED
153  TComPicYuv*   getResidual()         { return  m_pcResidual; }
154#endif
155
156#if HHI_INTERVIEW_SKIP
157  TComPicYuv*   getUsedPelsMap()      { return  m_pcUsedPelsMap; }
158#endif
159
160
161  TComPicYuv*   getPicYuvPred()       { return  m_pcPicYuvPred; }
162  TComPicYuv*   getPicYuvResi()       { return  m_pcPicYuvResi; }
163  Void          setPicYuvPred( TComPicYuv* pcPicYuv )       { m_pcPicYuvPred = pcPicYuv; }
164  Void          setPicYuvResi( TComPicYuv* pcPicYuv )       { m_pcPicYuvResi = pcPicYuv; }
165  Void          setQP( double dQP )   { m_dQP = dQP; }
166  Void          setSliceType( SliceType eSliceType ) { m_eSliceType = eSliceType; }
167  Void          setReferenced( Bool bReferenced )    { m_bReferenced = bReferenced; }
168  Void          setColDir( UInt uiColDir )           { m_uiColDir = uiColDir; }
169  UInt          getColDir()                          { return m_uiColDir; }
170  Void          setRefPOC( Int i, RefPicList e, Int iRefIdx ) { m_aiRefPOCList[e][iRefIdx] = i; }
171  Int           getRefPOC( RefPicList e, Int iRefIdx )        { return m_aiRefPOCList[e][iRefIdx]; }
172  Void          setRefViewIdx( Int i, RefPicList e, Int iRefIdx ) { m_aiRefViewIdxList[e][iRefIdx] = i; }
173  Int           getRefViewIdx( RefPicList e, Int iRefIdx )        { return m_aiRefViewIdxList[e][iRefIdx]; }
174  Int           getNumRefs( RefPicList e )                    { return m_aiNumRefIdx[e]; }
175  Void          setNumRefs( Int i, RefPicList e )             { m_aiNumRefIdx[e] = i; }
176  Void          setViewIdx( Int i )                           { m_iViewIdx = i; }
177  Int           getViewIdx()                                  { return m_iViewIdx; }
178
179  Void          setScaleOffset( Int** pS, Int** pO )  { m_aaiCodedScale = pS; m_aaiCodedOffset = pO; }
180  Int**         getCodedScale ()                      { return m_aaiCodedScale;  }
181  Int**         getCodedOffset()                      { return m_aaiCodedOffset; }
182
183#if HHI_VSO
184  TComMVDRefData* getMVDReferenceInfo() { return &m_cReferenceInfo; }
185#endif
186
187  UInt          getNumCUsInFrame()      { return m_apcPicSym->getNumberOfCUsInFrame(); }
188  UInt          getNumPartInWidth()     { return m_apcPicSym->getNumPartInWidth();     }
189  UInt          getNumPartInHeight()    { return m_apcPicSym->getNumPartInHeight();    }
190  UInt          getNumPartInCU()        { return m_apcPicSym->getNumPartition();       }
191  UInt          getFrameWidthInCU()     { return m_apcPicSym->getFrameWidthInCU();     }
192  UInt          getFrameHeightInCU()    { return m_apcPicSym->getFrameHeightInCU();    }
193  UInt          getMinCUWidth()         { return m_apcPicSym->getMinCUWidth();         }
194  UInt          getMinCUHeight()        { return m_apcPicSym->getMinCUHeight();        }
195
196  UInt          getParPelX(UChar uhPartIdx) { return getParPelX(uhPartIdx); }
197  UInt          getParPelY(UChar uhPartIdx) { return getParPelX(uhPartIdx); }
198
199  Int           getStride()           { return m_apcPicYuv[1]->getStride(); }
200  Int           getCStride()          { return m_apcPicYuv[1]->getCStride(); }
201
202  Void          setReconMark (Bool b) { m_bReconstructed = b;     }
203  Bool          getReconMark ()       { return m_bReconstructed;  }
204
205#if AMVP_BUFFERCOMPRESS
206  Void          compressMotion();
207#endif
208  UInt          getCurrSliceIdx()            { return m_uiCurrSliceIdx;                }
209  Void          setCurrSliceIdx(UInt i)      { m_uiCurrSliceIdx = i;                   }
210  UInt          getNumAllocatedSlice()       {return m_apcPicSym->getNumAllocatedSlice();}
211  Void          allocateNewSlice()           {m_apcPicSym->allocateNewSlice();         }
212  Void          clearSliceBuffer()           {m_apcPicSym->clearSliceBuffer();         }
213
214  Void          addOriginalBuffer       ();
215#if POZNAN_AVAIL_MAP
216  Void          addAvailabilityBuffer   ();
217#endif
218#if POZNAN_SYNTH_VIEW
219  Void          addSynthesisBuffer      ();
220#endif
221#if PARALLEL_MERGED_DEBLK
222  Void          addDeblockBuffer        ();
223#endif
224#if DEPTH_MAP_GENERATION
225  Void          addPrdDepthMapBuffer    ();
226#endif
227#if HHI_INTER_VIEW_MOTION_PRED
228  Void          addOrgDepthMapBuffer    ();
229#endif
230#if HHI_INTER_VIEW_RESIDUAL_PRED
231  Void          addResidualBuffer       ();
232#endif
233
234#if HHI_INTERVIEW_SKIP
235  Void          addUsedPelsMapBuffer    ();
236#endif
237
238  Void          removeOriginalBuffer    ();
239#if POZNAN_SYNTH_VIEW
240  Void          removeSynthesisBuffer   ();
241#endif
242#if POZNAN_AVAIL_MAP
243  Void          removeAvailabilityBuffer();
244#endif
245#if PARALLEL_MERGED_DEBLK
246  Void          removeDeblockBuffer     ();
247#endif
248#if DEPTH_MAP_GENERATION
249  Void          removePrdDepthMapBuffer ();
250#endif
251#if HHI_INTER_VIEW_MOTION_PRED
252  Void          removeOrgDepthMapBuffer ();
253#endif
254#if HHI_INTER_VIEW_RESIDUAL_PRED
255  Void          removeResidualBuffer    ();
256#endif
257#if HHI_INTERVIEW_SKIP
258  Void          removeUsedPelsMapBuffer ();
259#endif
260
261#if POZNAN_AVAIL_MAP
262  Void          checkSynthesisAvailability(  TComDataCU*& rpcBestCU, UInt iCuAddr, UInt uiAbsZorderIdx, UInt uiPartDepth, Bool *&rpbCUSynthesied);
263#endif
264
265#if PARALLEL_MERGED_DEBLK
266  TComPicYuv*   getPicYuvDeblkBuf()      { return  m_pcPicYuvDeblkBuf; }
267#endif
268
269  /** transfer ownership of @seis to @this picture */
270  void setSEIs(SEImessages* seis) { m_SEIs = seis; }
271
272  /**
273   * return the current list of SEI messages associated with this picture.
274   * Pointer is valid until @this->destroy() is called */
275  SEImessages* getSEIs() { return m_SEIs; }
276
277  /**
278   * return the current list of SEI messages associated with this picture.
279   * Pointer is valid until @this->destroy() is called */
280  const SEImessages* getSEIs() const { return m_SEIs; }
281
282};// END CLASS DEFINITION TComPic
283
284
285#endif // __TCOMPIC__
286
Note: See TracBrowser for help on using the repository browser.