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

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

Poznan Tools

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