HEVC Test Model (HM)  HM-16.3
TComPic.h
Go to the documentation of this file.
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-2015, ITU/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 ITU/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 
38 #ifndef __TCOMPIC__
39 #define __TCOMPIC__
40 
41 // Include files
42 #include "CommonDef.h"
43 #include "TComPicSym.h"
44 #include "TComPicYuv.h"
45 #include "TComBitStream.h"
46 
49 
50 // ====================================================================================================================
51 // Class definition
52 // ====================================================================================================================
53 
55 
56 class TComPic
57 {
58 public:
60  // TRUE_ORG is the input file without any pre-encoder colour space conversion (but with possible bit depth increment)
62 
63 private:
64  UInt m_uiTLayer; // Temporal layer
65  Bool m_bUsedByCurr; // Used by current picture
66  Bool m_bIsLongTerm; // IS long term picture
67  TComPicSym m_picSym; // Symbol
69 
70  TComPicYuv* m_pcPicYuvPred; // Prediction
71  TComPicYuv* m_pcPicYuvResi; // Residual
74  UInt m_uiCurrSliceIdx; // Index of current slice
76 
79 
80  std::vector<std::vector<TComDataCU*> > m_vSliceCUDataLink;
81 
83 
84 public:
85  TComPic();
86  virtual ~TComPic();
87 
88  Void create( const TComSPS &sps, const TComPPS &pps, const UInt uiMaxWidth, const UInt uiMaxHeight, const UInt uiMaxDepth, const Bool bIsVirtual /*= false*/ );
89 
90  virtual Void destroy();
91 
92  UInt getTLayer() const { return m_uiTLayer; }
93  Void setTLayer( UInt uiTLayer ) { m_uiTLayer = uiTLayer; }
94 
95  Bool getUsedByCurr() const { return m_bUsedByCurr; }
96  Void setUsedByCurr( Bool bUsed ) { m_bUsedByCurr = bUsed; }
97  Bool getIsLongTerm() const { return m_bIsLongTerm; }
98  Void setIsLongTerm( Bool lt ) { m_bIsLongTerm = lt; }
99  Void setCheckLTMSBPresent (Bool b ) {m_bCheckLTMSB=b;}
101 
102  TComPicSym* getPicSym() { return &m_picSym; }
103  TComSlice* getSlice(Int i) { return m_picSym.getSlice(i); }
104  Int getPOC() const { return m_picSym.getSlice(m_uiCurrSliceIdx)->getPOC(); }
105  TComDataCU* getCtu( UInt ctuRsAddr ) { return m_picSym.getCtu( ctuRsAddr ); }
106  const TComDataCU* getCtu( UInt ctuRsAddr ) const { return m_picSym.getCtu( ctuRsAddr ); }
107 
108  TComPicYuv* getPicYuvOrg() { return m_apcPicYuv[PIC_YUV_ORG]; }
109  TComPicYuv* getPicYuvRec() { return m_apcPicYuv[PIC_YUV_REC]; }
110 
113  Void setPicYuvPred( TComPicYuv* pcPicYuv ) { m_pcPicYuvPred = pcPicYuv; }
114  Void setPicYuvResi( TComPicYuv* pcPicYuv ) { m_pcPicYuvResi = pcPicYuv; }
115 
116  UInt getNumberOfCtusInFrame() const { return m_picSym.getNumberOfCtusInFrame(); }
117  UInt getNumPartInCtuWidth() const { return m_picSym.getNumPartInCtuWidth(); }
118  UInt getNumPartInCtuHeight() const { return m_picSym.getNumPartInCtuHeight(); }
119  UInt getNumPartitionsInCtu() const { return m_picSym.getNumPartitionsInCtu(); }
120  UInt getFrameWidthInCtus() const { return m_picSym.getFrameWidthInCtus(); }
121  UInt getFrameHeightInCtus() const { return m_picSym.getFrameHeightInCtus(); }
122  UInt getMinCUWidth() const { return m_picSym.getMinCUWidth(); }
123  UInt getMinCUHeight() const { return m_picSym.getMinCUHeight(); }
124 
125  Int getStride(const ComponentID id) const { return m_apcPicYuv[PIC_YUV_REC]->getStride(id); }
126  Int getComponentScaleX(const ComponentID id) const { return m_apcPicYuv[PIC_YUV_REC]->getComponentScaleX(id); }
127  Int getComponentScaleY(const ComponentID id) const { return m_apcPicYuv[PIC_YUV_REC]->getComponentScaleY(id); }
128  ChromaFormat getChromaFormat() const { return m_apcPicYuv[PIC_YUV_REC]->getChromaFormat(); }
130 
131  Void setReconMark (Bool b) { m_bReconstructed = b; }
132  Bool getReconMark () const { return m_bReconstructed; }
133  Void setOutputMark (Bool b) { m_bNeededForOutput = b; }
134  Bool getOutputMark () const { return m_bNeededForOutput; }
135 
138  Void setCurrSliceIdx(UInt i) { m_uiCurrSliceIdx = i; }
139  UInt getNumAllocatedSlice() const {return m_picSym.getNumAllocatedSlice();}
142 
143  const Window& getConformanceWindow() const { return m_picSym.getSPS().getConformanceWindow(); }
145 
146  Bool getSAOMergeAvailability(Int currAddr, Int mergeAddr);
147 
148  UInt getSubstreamForCtuAddr(const UInt ctuAddr, const Bool bAddressInRaster, TComSlice *pcSlice);
149 
150  /* field coding parameters*/
151 
152  Void setTopField(Bool b) {m_isTop = b;}
153  Bool isTopField() {return m_isTop;}
154  Void setField(Bool b) {m_isField = b;}
155  Bool isField() {return m_isField;}
156 
158  Void setSEIs(SEIMessages& seis) { m_SEIs = seis; }
159 
163  SEIMessages& getSEIs() { return m_SEIs; }
164 
168  const SEIMessages& getSEIs() const { return m_SEIs; }
169 };// END CLASS DEFINITION TComPic
170 
172 
173 #endif // __TCOMPIC__
virtual Void destroy()
Definition: TComPic.cpp:91
virtual ~TComPic()
Definition: TComPic.cpp:65
Void setSEIs(SEIMessages &seis)
Definition: TComPic.h:158
picture YUV buffer class
Definition: TComPicYuv.h:55
Bool isTopField()
Definition: TComPic.h:153
CU data structure class.
Definition: TComDataCU.h:64
UInt getNumPartInCtuHeight() const
Definition: TComPicSym.h:144
Void setPicYuvResi(TComPicYuv *pcPicYuv)
Definition: TComPic.h:114
Bool m_bIsLongTerm
Definition: TComPic.h:66
UInt getNumberOfCtusInFrame() const
Definition: TComPic.h:116
picture class (symbol + YUV buffers)
Definition: TComPic.h:56
Defines constants, macros and tool parameters.
void Void
Definition: TypeDef.h:285
Int getStride(const ComponentID id) const
Definition: TComPicYuv.h:113
TComPicYuv * getPicYuvTrueOrg()
Definition: TComPic.h:61
const TComDataCU * getCtu(UInt ctuRsAddr) const
Definition: TComPic.h:106
TComSlice * getSlice(Int i)
Definition: TComPic.h:103
Void setPicYuvPred(TComPicYuv *pcPicYuv)
Definition: TComPic.h:113
TComSlice * getSlice(UInt i)
Definition: TComPicSym.h:126
unsigned int UInt
Definition: TypeDef.h:297
UInt getNumPartitionsInCtu() const
Definition: TComPic.h:119
Void allocateNewSlice()
Definition: TComPicSym.cpp:159
Bool getIsLongTerm() const
Definition: TComPic.h:97
UInt getMinCUHeight() const
Definition: TComPicSym.h:131
UInt getNumAllocatedSlice() const
Definition: TComPicSym.h:139
Bool m_isTop
Definition: TComPic.h:77
Int getNumberValidComponents() const
Definition: TComPic.h:129
Window & getDefaultDisplayWindow()
Definition: TComSlice.h:680
Void setField(Bool b)
Definition: TComPic.h:154
Void setTLayer(UInt uiTLayer)
Definition: TComPic.h:93
UInt getMinCUWidth() const
Definition: TComPic.h:122
TComPicSym m_picSym
Definition: TComPic.h:67
TComVUI * getVuiParameters()
Definition: TComSlice.h:939
UInt getFrameWidthInCtus() const
Definition: TComPicSym.h:128
SEIMessages m_SEIs
Any SEI messages that have been received. If !NULL we own the object.
Definition: TComPic.h:82
const Window & getConformanceWindow() const
Definition: TComPic.h:143
UInt getNumPartInCtuHeight() const
Definition: TComPic.h:118
TComPicYuv * getPicYuvRec()
Definition: TComPic.h:109
UInt getMinCUWidth() const
Definition: TComPicSym.h:130
TComPicYuv * getPicYuvResi()
Definition: TComPic.h:112
Bool m_isField
Definition: TComPic.h:78
UInt getNumPartInCtuWidth() const
Definition: TComPic.h:117
picture symbol class (header)
Bool m_bUsedByCurr
Definition: TComPic.h:65
Window getDefDisplayWindow() const
Definition: TComPic.h:144
TComPicYuv * m_pcPicYuvPred
Definition: TComPic.h:70
Int getStride(const ComponentID id) const
Definition: TComPic.h:125
UInt m_uiTLayer
Definition: TComPic.h:64
UInt getComponentScaleY(const ComponentID id) const
Definition: TComPicYuv.h:139
UInt getComponentScaleX(const ComponentID id) const
Definition: TComPicYuv.h:138
Bool getUsedByCurr() const
Definition: TComPic.h:95
Bool getSAOMergeAvailability(Int currAddr, Int mergeAddr)
Definition: TComPic.cpp:118
bool Bool
Definition: TypeDef.h:286
UInt getSubstreamForCtuAddr(const UInt ctuAddr, const Bool bAddressInRaster, TComSlice *pcSlice)
Definition: TComPic.cpp:125
UInt getMinCUHeight() const
Definition: TComPic.h:123
PPS class.
Definition: TComSlice.h:977
Void clearSliceBuffer()
Definition: TComPic.h:141
TComPicYuv * getPicYuvOrg()
Definition: TComPic.h:108
Void setUsedByCurr(Bool bUsed)
Definition: TComPic.h:96
Bool getCheckLTMSBPresent()
Definition: TComPic.h:100
Int getComponentScaleX(const ComponentID id) const
Definition: TComPic.h:126
TComPicSym * getPicSym()
Definition: TComPic.h:102
ChromaFormat
chroma formats (according to semantics of chroma_format_idc)
Definition: TypeDef.h:352
PIC_YUV_T
Definition: TComPic.h:59
UInt m_uiCurrSliceIdx
Definition: TComPic.h:74
class for handling bitstream (header)
UInt getNumPartInCtuWidth() const
Definition: TComPicSym.h:143
UInt getFrameHeightInCtus() const
Definition: TComPicSym.h:129
ChromaFormat getChromaFormat() const
Definition: TComPic.h:128
picture YUV buffer class (header)
UInt getNumberValidComponents() const
Definition: TComPicYuv.h:111
Bool m_bReconstructed
Definition: TComPic.h:72
UInt getCurrSliceIdx() const
Definition: TComPic.h:137
Int getPOC() const
Definition: TComSlice.h:1338
const TComSPS & getSPS() const
Definition: TComPicSym.h:135
Int getPOC() const
Definition: TComPic.h:104
Void setOutputMark(Bool b)
Definition: TComPic.h:133
TComDataCU * getCtu(UInt ctuRsAddr)
Definition: TComPicSym.h:133
TComPicYuv * getPicYuvPred()
Definition: TComPic.h:111
TComDataCU * getCtu(UInt ctuRsAddr)
Definition: TComPic.h:105
Void compressMotion()
Definition: TComPic.cpp:108
Void setIsLongTerm(Bool lt)
Definition: TComPic.h:98
Void setReconMark(Bool b)
Definition: TComPic.h:131
UInt getTLayer() const
Definition: TComPic.h:92
Bool m_bCheckLTMSB
Definition: TComPic.h:75
const SEIMessages & getSEIs() const
Definition: TComPic.h:168
std::list< SEI * > SEIMessages
Definition: SEI.h:479
UInt getNumberOfCtusInFrame() const
Definition: TComPicSym.h:132
int Int
Definition: TypeDef.h:296
Window & getConformanceWindow()
Definition: TComSlice.h:826
Void setCheckLTMSBPresent(Bool b)
Definition: TComPic.h:99
UInt getFrameHeightInCtus() const
Definition: TComPic.h:121
Int getComponentScaleY(const ComponentID id) const
Definition: TComPic.h:127
TComPicYuv * m_pcPicYuvResi
Definition: TComPic.h:71
ComponentID
Definition: TypeDef.h:368
TComPic()
Definition: TComPic.cpp:48
UInt getNumAllocatedSlice() const
Definition: TComPic.h:139
Void setTopField(Bool b)
Definition: TComPic.h:152
Void clearSliceBuffer()
Definition: TComPicSym.cpp:171
Void create(const TComSPS &sps, const TComPPS &pps, const UInt uiMaxWidth, const UInt uiMaxHeight, const UInt uiMaxDepth, const Bool bIsVirtual)
Definition: TComPic.cpp:69
Bool getReconMark() const
Definition: TComPic.h:132
Bool m_bNeededForOutput
Definition: TComPic.h:73
UInt getNumPartitionsInCtu() const
Definition: TComPicSym.h:142
SEIMessages & getSEIs()
Definition: TComPic.h:163
TComPicYuv * m_apcPicYuv[NUM_PIC_YUV]
Definition: TComPic.h:68
slice header class
Definition: TComSlice.h:1198
Bool getOutputMark() const
Definition: TComPic.h:134
Bool isField()
Definition: TComPic.h:155
UInt getFrameWidthInCtus() const
Definition: TComPic.h:120
std::vector< std::vector< TComDataCU * > > m_vSliceCUDataLink
Definition: TComPic.h:80
Bool getVuiParametersPresentFlag() const
Definition: TComSlice.h:937
picture symbol class
Definition: TComPicSym.h:83
Void setCurrSliceIdx(UInt i)
Definition: TComPic.h:138
SPS class.
Definition: TComSlice.h:722
ChromaFormat getChromaFormat() const
Definition: TComPicYuv.h:110
Void allocateNewSlice()
Definition: TComPic.h:140