source: 3DVCSoftware/branches/HTM-14.0-MV-draft-3/source/Lib/TLibCommon/TComPic.h @ 1417

Last change on this file since 1417 was 1191, checked in by tech, 10 years ago

Removed 3D-HEVC.

  • Property svn:eol-style set to native
File size: 9.3 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
[56]4 * granted under this license. 
[5]5 *
[1179]6* Copyright (c) 2010-2015, ITU/ISO/IEC
[5]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.
[56]17 *  * Neither the name of the ITU/ISO/IEC nor the names of its contributors may
[5]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/** \file     TComPic.h
35    \brief    picture class (header)
36*/
37
[608]38
[2]39#ifndef __TCOMPIC__
40#define __TCOMPIC__
41
42// Include files
43#include "CommonDef.h"
44#include "TComPicSym.h"
45#include "TComPicYuv.h"
46#include "TComBitStream.h"
[608]47#include "SEI.h"
[2]48
[56]49//! \ingroup TLibCommon
50//! \{
51
[2]52// ====================================================================================================================
53// Class definition
54// ====================================================================================================================
55
56/// picture class (symbol + YUV buffers)
57class TComPic
58{
59private:
[56]60  UInt                  m_uiTLayer;               //  Temporal layer
61  Bool                  m_bUsedByCurr;            //  Used by current picture
62  Bool                  m_bIsLongTerm;            //  IS long term picture
[2]63  TComPicSym*           m_apcPicSym;              //  Symbol
[56]64 
[2]65  TComPicYuv*           m_apcPicYuv[2];           //  Texture,  0:org / 1:rec
[56]66 
[2]67  TComPicYuv*           m_pcPicYuvPred;           //  Prediction
68  TComPicYuv*           m_pcPicYuvResi;           //  Residual
69  Bool                  m_bReconstructed;
[56]70  Bool                  m_bNeededForOutput;
[976]71#if H_MV
[964]72  Bool                  m_bPicOutputFlag;         // Semantics variable
73#endif
[2]74  UInt                  m_uiCurrSliceIdx;         // Index of current slice
[608]75  Bool                  m_bCheckLTMSB;
76 
77  Int                   m_numReorderPics[MAX_TLAYER];
78  Window                m_conformanceWindow;
79  Window                m_defaultDisplayWindow;
80
[655]81  bool                  m_isTop;
82  bool                  m_isField;
83 
[56]84  std::vector<std::vector<TComDataCU*> > m_vSliceCUDataLink;
85
[608]86  SEIMessages  m_SEIs; ///< Any SEI messages that have been received.  If !NULL we own the object.
87
88#if H_MV
89  Int                   m_layerId;
90  Int                   m_viewId;
[56]91#endif
[2]92public:
93  TComPic();
94  virtual ~TComPic();
[56]95 
[608]96  Void          create( Int iWidth, Int iHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth, Window &conformanceWindow, Window &defaultDisplayWindow, 
97                        Int *numReorderPics, Bool bIsVirtual = false );
98                       
[56]99  virtual Void  destroy();
100 
101  UInt          getTLayer()                { return m_uiTLayer;   }
102  Void          setTLayer( UInt uiTLayer ) { m_uiTLayer = uiTLayer; }
[2]103
[608]104#if H_MV
105  Void          setLayerId            ( Int layerId )    { m_layerId      = layerId; }
106  Int           getLayerId            ()                 { return m_layerId;    }
107  Void          setViewId             ( Int viewId )     { m_viewId = viewId;   }
108  Int           getViewId             ()                 { return m_viewId;     }
109#endif
[56]110  Bool          getUsedByCurr()             { return m_bUsedByCurr; }
111  Void          setUsedByCurr( Bool bUsed ) { m_bUsedByCurr = bUsed; }
112  Bool          getIsLongTerm()             { return m_bIsLongTerm; }
113  Void          setIsLongTerm( Bool lt ) { m_bIsLongTerm = lt; }
[608]114  Void          setCheckLTMSBPresent     (Bool b ) {m_bCheckLTMSB=b;}
115  Bool          getCheckLTMSBPresent     () { return m_bCheckLTMSB;}
[5]116
[2]117  TComPicSym*   getPicSym()           { return  m_apcPicSym;    }
118  TComSlice*    getSlice(Int i)       { return  m_apcPicSym->getSlice(i);  }
119  Int           getPOC()              { return  m_apcPicSym->getSlice(m_uiCurrSliceIdx)->getPOC();  }
[608]120  TComDataCU*&  getCU( UInt uiCUAddr )  { return  m_apcPicSym->getCU( uiCUAddr ); }
[56]121 
[2]122  TComPicYuv*   getPicYuvOrg()        { return  m_apcPicYuv[0]; }
123  TComPicYuv*   getPicYuvRec()        { return  m_apcPicYuv[1]; }
[56]124 
125  TComPicYuv*   getPicYuvPred()       { return  m_pcPicYuvPred; }
126  TComPicYuv*   getPicYuvResi()       { return  m_pcPicYuvResi; }
127  Void          setPicYuvPred( TComPicYuv* pcPicYuv )       { m_pcPicYuvPred = pcPicYuv; }
128  Void          setPicYuvResi( TComPicYuv* pcPicYuv )       { m_pcPicYuvResi = pcPicYuv; }
129 
[2]130  UInt          getNumCUsInFrame()      { return m_apcPicSym->getNumberOfCUsInFrame(); }
131  UInt          getNumPartInWidth()     { return m_apcPicSym->getNumPartInWidth();     }
132  UInt          getNumPartInHeight()    { return m_apcPicSym->getNumPartInHeight();    }
133  UInt          getNumPartInCU()        { return m_apcPicSym->getNumPartition();       }
134  UInt          getFrameWidthInCU()     { return m_apcPicSym->getFrameWidthInCU();     }
135  UInt          getFrameHeightInCU()    { return m_apcPicSym->getFrameHeightInCU();    }
136  UInt          getMinCUWidth()         { return m_apcPicSym->getMinCUWidth();         }
137  UInt          getMinCUHeight()        { return m_apcPicSym->getMinCUHeight();        }
[56]138 
[2]139  UInt          getParPelX(UChar uhPartIdx) { return getParPelX(uhPartIdx); }
140  UInt          getParPelY(UChar uhPartIdx) { return getParPelX(uhPartIdx); }
[56]141 
[2]142  Int           getStride()           { return m_apcPicYuv[1]->getStride(); }
143  Int           getCStride()          { return m_apcPicYuv[1]->getCStride(); }
[56]144 
[2]145  Void          setReconMark (Bool b) { m_bReconstructed = b;     }
146  Bool          getReconMark ()       { return m_bReconstructed;  }
[56]147  Void          setOutputMark (Bool b) { m_bNeededForOutput = b;     }
148  Bool          getOutputMark ()       { return m_bNeededForOutput;  }
[976]149 #if H_MV
[964]150  Void          setPicOutputFlag(Bool b) { m_bPicOutputFlag = b;      }
151  Bool          getPicOutputFlag()       { return m_bPicOutputFlag ;  }
152#endif
153
[608]154  Void          setNumReorderPics(Int i, UInt tlayer) { m_numReorderPics[tlayer] = i;    }
155  Int           getNumReorderPics(UInt tlayer)        { return m_numReorderPics[tlayer]; }
[56]156  Void          compressMotion(); 
[2]157  UInt          getCurrSliceIdx()            { return m_uiCurrSliceIdx;                }
158  Void          setCurrSliceIdx(UInt i)      { m_uiCurrSliceIdx = i;                   }
159  UInt          getNumAllocatedSlice()       {return m_apcPicSym->getNumAllocatedSlice();}
160  Void          allocateNewSlice()           {m_apcPicSym->allocateNewSlice();         }
161  Void          clearSliceBuffer()           {m_apcPicSym->clearSliceBuffer();         }
[608]162
163  Window&       getConformanceWindow()  { return m_conformanceWindow; }
164  Window&       getDefDisplayWindow()   { return m_defaultDisplayWindow; }
165
[872]166  Bool          getSAOMergeAvailability(Int currAddr, Int mergeAddr);
[2]167
[655]168  /* field coding parameters*/
169
170   Void              setTopField(bool b)                  {m_isTop = b;}
171   bool              isTopField()                         {return m_isTop;}
172   Void              setField(bool b)                     {m_isField = b;}
173   bool              isField()                            {return m_isField;}
174
[608]175#if H_MV
176  Void          print( Bool legend );
177#endif
[56]178  /** transfer ownership of seis to this picture */
[608]179  void setSEIs(SEIMessages& seis) { m_SEIs = seis; }
[2]180
181  /**
182   * return the current list of SEI messages associated with this picture.
[56]183   * Pointer is valid until this->destroy() is called */
[608]184  SEIMessages& getSEIs() { return m_SEIs; }
[2]185
186  /**
187   * return the current list of SEI messages associated with this picture.
[56]188   * Pointer is valid until this->destroy() is called */
[608]189  const SEIMessages& getSEIs() const { return m_SEIs; }
[2]190
191};// END CLASS DEFINITION TComPic
192
[608]193#if H_MV
194class TComPicLists
195{
196private: 
197  TComList<TComList<TComPic*>*> m_lists; 
198public: 
199  Void        push_back( TComList<TComPic*>* list ) { m_lists.push_back( list );   }
200  Int         size     ()                           { return (Int) m_lists.size(); } 
201  TComPic*    getPic   ( Int layerIdInNuh,              Int poc );   
202  TComPicYuv* getPicYuv( Int layerIdInNuh,              Int poc, Bool recon ); 
203
204  Void print( ); 
205
206}; // END CLASS DEFINITION TComPicLists
207
208#endif
[56]209//! \}
[2]210
211#endif // __TCOMPIC__
Note: See TracBrowser for help on using the repository browser.