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

Last change on this file since 5 was 5, checked in by hhi, 13 years ago

Clean version with cfg-files

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