HEVC Test Model (HM)  HM-16.18
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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-2017, 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 #if REDUCED_ENCODER_MEMORY
89  Void create( const TComSPS &sps, const TComPPS &pps, const Bool bCreateEncoderSourcePicYuv, const Bool bCreateForImmediateReconstruction );
95 #else
96  Void create( const TComSPS &sps, const TComPPS &pps, const Bool bIsVirtual /*= false*/ );
97 #endif
98 
99  virtual Void destroy();
100 
101  UInt getTLayer() const { return m_uiTLayer; }
102  Void setTLayer( UInt uiTLayer ) { m_uiTLayer = uiTLayer; }
103 
104  Bool getUsedByCurr() const { return m_bUsedByCurr; }
105  Void setUsedByCurr( Bool bUsed ) { m_bUsedByCurr = bUsed; }
106  Bool getIsLongTerm() const { return m_bIsLongTerm; }
110 
111  TComPicSym* getPicSym() { return &m_picSym; }
112  const TComPicSym* getPicSym() const { return &m_picSym; }
114  const TComSlice* getSlice(Int i) const { return m_picSym.getSlice(i); }
116  TComDataCU* getCtu( UInt ctuRsAddr ) { return m_picSym.getCtu( ctuRsAddr ); }
117  const TComDataCU* getCtu( UInt ctuRsAddr ) const { return m_picSym.getCtu( ctuRsAddr ); }
118 
121 
124  Void setPicYuvPred( TComPicYuv* pcPicYuv ) { m_pcPicYuvPred = pcPicYuv; }
125  Void setPicYuvResi( TComPicYuv* pcPicYuv ) { m_pcPicYuvResi = pcPicYuv; }
126 
133  UInt getMinCUWidth() const { return m_picSym.getMinCUWidth(); }
135 
136  Int getStride(const ComponentID id) const { return m_apcPicYuv[PIC_YUV_REC]->getStride(id); }
141 
143  Bool getReconMark () const { return m_bReconstructed; }
145  Bool getOutputMark () const { return m_bNeededForOutput; }
146 
153 
156 
157  Bool getSAOMergeAvailability(Int currAddr, Int mergeAddr);
158 
159  UInt getSubstreamForCtuAddr(const UInt ctuAddr, const Bool bAddressInRaster, TComSlice *pcSlice);
160 
161  /* field coding parameters*/
162 
164  Bool isTopField() {return m_isTop;}
166  Bool isField() const {return m_isField;}
167 
169  Void setSEIs(SEIMessages& seis) { m_SEIs = seis; }
170 
174  SEIMessages& getSEIs() { return m_SEIs; }
175 
179  const SEIMessages& getSEIs() const { return m_SEIs; }
180 };// END CLASS DEFINITION TComPic
181 
183 
184 #endif // __TCOMPIC__
Void releaseEncoderSourceImageData()
Definition: TComPic.cpp:161
virtual Void destroy()
Definition: TComPic.cpp:189
virtual ~TComPic()
Definition: TComPic.cpp:65
Bool isField() const
Definition: TComPic.h:166
Void setSEIs(SEIMessages &seis)
Definition: TComPic.h:169
picture YUV buffer class
Definition: TComPicYuv.h:55
Bool isTopField()
Definition: TComPic.h:164
CU data structure class.
Definition: TComDataCU.h:64
UInt getNumPartInCtuHeight() const
Definition: TComPicSym.h:177
Void setPicYuvResi(TComPicYuv *pcPicYuv)
Definition: TComPic.h:125
Bool m_bIsLongTerm
Definition: TComPic.h:66
UInt getNumberOfCtusInFrame() const
Definition: TComPic.h:127
picture class (symbol + YUV buffers)
Definition: TComPic.h:56
Defines version information, constants and small in-line functions.
void Void
Definition: TypeDef.h:203
const TComPicSym * getPicSym() const
Definition: TComPic.h:112
Int getStride(const ComponentID id) const
Definition: TComPicYuv.h:121
TComPicYuv * getPicYuvTrueOrg()
Definition: TComPic.h:61
const TComDataCU * getCtu(UInt ctuRsAddr) const
Definition: TComPic.h:117
TComSlice * getSlice(Int i)
Definition: TComPic.h:113
Void setPicYuvPred(TComPicYuv *pcPicYuv)
Definition: TComPic.h:124
PIC_YUV_T
Definition: TComPic.h:59
TComSlice * getSlice(UInt i)
Definition: TComPicSym.h:154
unsigned int UInt
Definition: TypeDef.h:212
UInt getNumPartitionsInCtu() const
Definition: TComPic.h:130
Void allocateNewSlice()
Definition: TComPicSym.cpp:285
Bool getIsLongTerm() const
Definition: TComPic.h:106
UInt getMinCUHeight() const
Definition: TComPicSym.h:159
const TComSlice * getSlice(Int i) const
Definition: TComPic.h:114
Void create(const TComSPS &sps, const TComPPS &pps, const Bool bCreateEncoderSourcePicYuv, const Bool bCreateForImmediateReconstruction)
Definition: TComPic.cpp:71
UInt getNumAllocatedSlice() const
Definition: TComPicSym.h:172
Bool m_isTop
Definition: TComPic.h:77
Int getNumberValidComponents() const
Definition: TComPic.h:140
Window & getDefaultDisplayWindow()
Definition: TComSlice.h:643
Void setField(Bool b)
Definition: TComPic.h:165
Void setTLayer(UInt uiTLayer)
Definition: TComPic.h:102
UInt getMinCUWidth() const
Definition: TComPic.h:133
TComPicSym m_picSym
Definition: TComPic.h:67
TComVUI * getVuiParameters()
Definition: TComSlice.h:936
UInt getFrameWidthInCtus() const
Definition: TComPicSym.h:156
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:154
UInt getNumPartInCtuHeight() const
Definition: TComPic.h:129
TComPicYuv * getPicYuvRec()
Definition: TComPic.h:120
UInt getMinCUWidth() const
Definition: TComPicSym.h:158
TComPicYuv * getPicYuvResi()
Definition: TComPic.h:123
Bool m_isField
Definition: TComPic.h:78
UInt getNumPartInCtuWidth() const
Definition: TComPic.h:128
picture symbol class (header)
Bool m_bUsedByCurr
Definition: TComPic.h:65
Window getDefDisplayWindow() const
Definition: TComPic.h:155
Void prepareForEncoderSourcePicYuv()
Definition: TComPic.cpp:114
TComPicYuv * m_pcPicYuvPred
Definition: TComPic.h:70
Int getStride(const ComponentID id) const
Definition: TComPic.h:136
UInt m_uiTLayer
Definition: TComPic.h:64
UInt getComponentScaleY(const ComponentID id) const
Definition: TComPicYuv.h:151
UInt getComponentScaleX(const ComponentID id) const
Definition: TComPicYuv.h:150
Bool getUsedByCurr() const
Definition: TComPic.h:104
Bool getSAOMergeAvailability(Int currAddr, Int mergeAddr)
Definition: TComPic.cpp:216
bool Bool
Definition: TypeDef.h:204
UInt getSubstreamForCtuAddr(const UInt ctuAddr, const Bool bAddressInRaster, TComSlice *pcSlice)
Definition: TComPic.cpp:223
Void prepareForReconstruction()
Definition: TComPic.cpp:135
UInt getMinCUHeight() const
Definition: TComPic.h:134
PPS class.
Definition: TComSlice.h:1034
Void clearSliceBuffer()
Definition: TComPic.h:152
Void releaseReconstructionIntermediateData()
Definition: TComPic.cpp:156
TComPicYuv * getPicYuvOrg()
Definition: TComPic.h:119
Void setUsedByCurr(Bool bUsed)
Definition: TComPic.h:105
Bool getCheckLTMSBPresent()
Definition: TComPic.h:109
Int getComponentScaleX(const ComponentID id) const
Definition: TComPic.h:137
TComPicSym * getPicSym()
Definition: TComPic.h:111
ChromaFormat
chroma formats (according to semantics of chroma_format_idc)
Definition: TypeDef.h:292
UInt m_uiCurrSliceIdx
Definition: TComPic.h:74
class for handling bitstream (header)
UInt getNumPartInCtuWidth() const
Definition: TComPicSym.h:176
UInt getFrameHeightInCtus() const
Definition: TComPicSym.h:157
ChromaFormat getChromaFormat() const
Definition: TComPic.h:139
picture YUV buffer class (header)
UInt getNumberValidComponents() const
Definition: TComPicYuv.h:119
Bool m_bReconstructed
Definition: TComPic.h:72
UInt getCurrSliceIdx() const
Definition: TComPic.h:148
Int getPOC() const
Definition: TComSlice.h:1354
const TComSPS & getSPS() const
Definition: TComPicSym.h:163
Int getPOC() const
Definition: TComPic.h:115
Void setOutputMark(Bool b)
Definition: TComPic.h:144
TComDataCU * getCtu(UInt ctuRsAddr)
Definition: TComPicSym.h:161
TComPicYuv * getPicYuvPred()
Definition: TComPic.h:122
Void releaseAllReconstructionData()
Definition: TComPic.cpp:177
TComDataCU * getCtu(UInt ctuRsAddr)
Definition: TComPic.h:116
Void compressMotion()
Definition: TComPic.cpp:206
Void setIsLongTerm(Bool lt)
Definition: TComPic.h:107
Void setReconMark(Bool b)
Definition: TComPic.h:142
UInt getTLayer() const
Definition: TComPic.h:101
Bool m_bCheckLTMSB
Definition: TComPic.h:75
const SEIMessages & getSEIs() const
Definition: TComPic.h:179
std::list< SEI * > SEIMessages
Definition: SEI.h:123
UInt getNumberOfCtusInFrame() const
Definition: TComPicSym.h:160
int Int
Definition: TypeDef.h:211
Window & getConformanceWindow()
Definition: TComSlice.h:838
Void setCheckLTMSBPresent(Bool b)
Definition: TComPic.h:108
UInt getFrameHeightInCtus() const
Definition: TComPic.h:132
Int getComponentScaleY(const ComponentID id) const
Definition: TComPic.h:138
TComPicYuv * m_pcPicYuvResi
Definition: TComPic.h:71
ComponentID
Definition: TypeDef.h:308
TComPic()
Definition: TComPic.cpp:48
UInt getNumAllocatedSlice() const
Definition: TComPic.h:150
Void setTopField(Bool b)
Definition: TComPic.h:163
Void clearSliceBuffer()
Definition: TComPicSym.cpp:297
Bool getReconMark() const
Definition: TComPic.h:143
Bool m_bNeededForOutput
Definition: TComPic.h:73
UInt getNumPartitionsInCtu() const
Definition: TComPicSym.h:175
SEIMessages & getSEIs()
Definition: TComPic.h:174
TComPicYuv * m_apcPicYuv[NUM_PIC_YUV]
Definition: TComPic.h:68
slice header class
Definition: TComSlice.h:1225
Bool getOutputMark() const
Definition: TComPic.h:145
UInt getFrameWidthInCtus() const
Definition: TComPic.h:131
std::vector< std::vector< TComDataCU * > > m_vSliceCUDataLink
Definition: TComPic.h:80
Bool getVuiParametersPresentFlag() const
Definition: TComSlice.h:934
picture symbol class
Definition: TComPicSym.h:83
Void setCurrSliceIdx(UInt i)
Definition: TComPic.h:149
SPS class.
Definition: TComSlice.h:740
ChromaFormat getChromaFormat() const
Definition: TComPicYuv.h:118
Void allocateNewSlice()
Definition: TComPic.h:151