source: 3DVCSoftware/trunk/source/Lib/TLibCommon/TComPic.h @ 49

Last change on this file since 49 was 21, checked in by hschwarz, 13 years ago

updated with HHI branch (0.2-HHI)

  • Property svn:eol-style set to native
File size: 10.7 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#if DEPTH_MAP_GENERATION
64  TComPicYuv*           m_pcPredDepthMap;         //  estimated depth map
65#endif
66#if HHI_INTER_VIEW_MOTION_PRED
67  TComPicYuv*           m_pcOrgDepthMap;          //  original depth map
68#endif
69#if HHI_INTER_VIEW_RESIDUAL_PRED
70  TComPicYuv*           m_pcResidual;             //  residual buffer (coded or inter-view predicted residual)
71#endif
72
73  TComPicYuv*           m_pcPicYuvPred;           //  Prediction
74  TComPicYuv*           m_pcPicYuvResi;           //  Residual
75#if PARALLEL_MERGED_DEBLK
76  TComPicYuv*           m_pcPicYuvDeblkBuf;
77#endif
78  Bool                  m_bReconstructed;
79  UInt                  m_uiCurrSliceIdx;         // Index of current slice
80
81  SEImessages* m_SEIs; ///< Any SEI messages that have been received.  If !NULL we own the object.
82
83  SliceType             m_eSliceType;
84  double                m_dQP;
85  Bool                  m_bReferenced;
86  UInt                  m_uiColDir;
87  Int                   m_aiRefPOCList[2][MAX_NUM_REF];
88  Int                   m_aiRefViewIdxList[2][MAX_NUM_REF];
89  Int                   m_aiNumRefIdx[2];    //  for multiple reference of current slice
90
91  Int                   m_iViewIdx;
92#if SONY_COLPIC_AVAILABILITY
93  Int                   m_iViewOrderIdx;
94#endif
95  Int**                 m_aaiCodedScale;
96  Int**                 m_aaiCodedOffset;
97
98#if HHI_VSO 
99  TComMVDRefData        m_cReferenceInfo;
100#endif
101#if HHI_INTERVIEW_SKIP
102  TComPicYuv*           m_pcUsedPelsMap;
103#endif
104
105
106public:
107  TComPic();
108  virtual ~TComPic();
109
110
111  Void          create( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth );
112  Void          destroy();
113
114  TComPicSym*   getPicSym()           { return  m_apcPicSym;    }
115  TComSlice*    getSlice(Int i)       { return  m_apcPicSym->getSlice(i);  }
116  TComSlice*    getCurrSlice()        { return  m_apcPicSym->getSlice(m_uiCurrSliceIdx);  }
117  TComSPS*      getSPS()              { return  m_apcPicSym->getSlice(m_uiCurrSliceIdx)->getSPS();  }
118  Int           getPOC()              { return  m_apcPicSym->getSlice(m_uiCurrSliceIdx)->getPOC();  }
119#if 0
120  Bool          getDRBFlag()          { return  m_apcPicSym->getSlice(m_uiCurrSliceIdx)->getDRBFlag();  }
121  Int           getERBIndex()         { return  m_apcPicSym->getSlice(m_uiCurrSliceIdx)->getERBIndex();  }
122#endif
123  TComDataCU*&  getCU( UInt uiCUAddr )  { return  m_apcPicSym->getCU( uiCUAddr ); }
124
125  SliceType     getSliceType()        { return m_eSliceType ;}
126  double        getQP()               { return m_dQP ;}
127  Bool          getReferenced()       { return m_bReferenced ;}
128
129  TComPicYuv*   getPicYuvOrg()        { return  m_apcPicYuv[0]; }
130  TComPicYuv*   getPicYuvRec()        { return  m_apcPicYuv[1]; }
131
132#if DEPTH_MAP_GENERATION
133  TComPicYuv*   getPredDepthMap()     { return  m_pcPredDepthMap; }
134#endif
135#if HHI_INTER_VIEW_MOTION_PRED
136  TComPicYuv*   getOrgDepthMap()      { return  m_pcOrgDepthMap; }
137#endif
138#if HHI_INTER_VIEW_RESIDUAL_PRED
139  TComPicYuv*   getResidual()         { return  m_pcResidual; }
140#endif
141
142#if HHI_INTERVIEW_SKIP
143  TComPicYuv*   getUsedPelsMap()      { return  m_pcUsedPelsMap; }
144#endif
145
146
147  TComPicYuv*   getPicYuvPred()       { return  m_pcPicYuvPred; }
148  TComPicYuv*   getPicYuvResi()       { return  m_pcPicYuvResi; }
149  Void          setPicYuvPred( TComPicYuv* pcPicYuv )       { m_pcPicYuvPred = pcPicYuv; }
150  Void          setPicYuvResi( TComPicYuv* pcPicYuv )       { m_pcPicYuvResi = pcPicYuv; }
151  Void          setQP( double dQP )   { m_dQP = dQP; }
152  Void          setSliceType( SliceType eSliceType ) { m_eSliceType = eSliceType; }
153  Void          setReferenced( Bool bReferenced )    { m_bReferenced = bReferenced; }
154  Void          setColDir( UInt uiColDir )           { m_uiColDir = uiColDir; }
155  UInt          getColDir()                          { return m_uiColDir; }
156  Void          setRefPOC( Int i, RefPicList e, Int iRefIdx ) { m_aiRefPOCList[e][iRefIdx] = i; }
157  Int           getRefPOC( RefPicList e, Int iRefIdx )        { return m_aiRefPOCList[e][iRefIdx]; }
158  Void          setRefViewIdx( Int i, RefPicList e, Int iRefIdx ) { m_aiRefViewIdxList[e][iRefIdx] = i; }
159  Int           getRefViewIdx( RefPicList e, Int iRefIdx )        { return m_aiRefViewIdxList[e][iRefIdx]; }
160  Int           getNumRefs( RefPicList e )                    { return m_aiNumRefIdx[e]; }
161  Void          setNumRefs( Int i, RefPicList e )             { m_aiNumRefIdx[e] = i; }
162  Void          setViewIdx( Int i )                           { m_iViewIdx = i; }
163  Int           getViewIdx()                                  { return m_iViewIdx; }
164#if SONY_COLPIC_AVAILABILITY
165  Void          setViewOrderIdx(Int i)                        { m_iViewOrderIdx = i; }
166  Int           getViewOrderIdx()                             { return m_iViewOrderIdx; }
167#endif
168
169  Void          setScaleOffset( Int** pS, Int** pO )  { m_aaiCodedScale = pS; m_aaiCodedOffset = pO; }
170  Int**         getCodedScale ()                      { return m_aaiCodedScale;  }
171  Int**         getCodedOffset()                      { return m_aaiCodedOffset; }
172
173#if HHI_VSO
174  TComMVDRefData* getMVDReferenceInfo() { return &m_cReferenceInfo; }
175#endif
176
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();        }
185
186  UInt          getParPelX(UChar uhPartIdx) { return getParPelX(uhPartIdx); }
187  UInt          getParPelY(UChar uhPartIdx) { return getParPelX(uhPartIdx); }
188
189  Int           getStride()           { return m_apcPicYuv[1]->getStride(); }
190  Int           getCStride()          { return m_apcPicYuv[1]->getCStride(); }
191
192  Void          setReconMark (Bool b) { m_bReconstructed = b;     }
193  Bool          getReconMark ()       { return m_bReconstructed;  }
194
195#if AMVP_BUFFERCOMPRESS
196  Void          compressMotion();
197#endif
198  UInt          getCurrSliceIdx()            { return m_uiCurrSliceIdx;                }
199  Void          setCurrSliceIdx(UInt i)      { m_uiCurrSliceIdx = i;                   }
200  UInt          getNumAllocatedSlice()       {return m_apcPicSym->getNumAllocatedSlice();}
201  Void          allocateNewSlice()           {m_apcPicSym->allocateNewSlice();         }
202  Void          clearSliceBuffer()           {m_apcPicSym->clearSliceBuffer();         }
203
204  Void          addOriginalBuffer       ();
205#if PARALLEL_MERGED_DEBLK
206  Void          addDeblockBuffer        ();
207#endif
208#if DEPTH_MAP_GENERATION
209  Void          addPrdDepthMapBuffer    ( UInt uiSubSampExpX, UInt uiSubSampExpY );
210#endif
211#if HHI_INTER_VIEW_MOTION_PRED
212  Void          addOrgDepthMapBuffer    ();
213#endif
214#if HHI_INTER_VIEW_RESIDUAL_PRED
215  Void          addResidualBuffer       ();
216#endif
217
218#if HHI_INTERVIEW_SKIP
219  Void          addUsedPelsMapBuffer    ();
220#endif
221
222  Void          removeOriginalBuffer    ();
223#if PARALLEL_MERGED_DEBLK
224  Void          removeDeblockBuffer     ();
225#endif
226#if DEPTH_MAP_GENERATION
227  Void          removePrdDepthMapBuffer ();
228#endif
229#if HHI_INTER_VIEW_MOTION_PRED
230  Void          removeOrgDepthMapBuffer ();
231#endif
232#if HHI_INTER_VIEW_RESIDUAL_PRED
233  Void          removeResidualBuffer    ();
234#endif
235#if HHI_INTERVIEW_SKIP
236  Void          removeUsedPelsMapBuffer ();
237#endif
238
239#if PARALLEL_MERGED_DEBLK
240  TComPicYuv*   getPicYuvDeblkBuf()      { return  m_pcPicYuvDeblkBuf; }
241#endif
242
243  /** transfer ownership of @seis to @this picture */
244  void setSEIs(SEImessages* seis) { m_SEIs = seis; }
245
246  /**
247   * return the current list of SEI messages associated with this picture.
248   * Pointer is valid until @this->destroy() is called */
249  SEImessages* getSEIs() { return m_SEIs; }
250
251  /**
252   * return the current list of SEI messages associated with this picture.
253   * Pointer is valid until @this->destroy() is called */
254  const SEImessages* getSEIs() const { return m_SEIs; }
255
256};// END CLASS DEFINITION TComPic
257
258
259#endif // __TCOMPIC__
260
Note: See TracBrowser for help on using the repository browser.