HEVC Test Model (HM)  HM-16.18
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TEncTop.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 __TENCTOP__
39 #define __TENCTOP__
40 
41 // Include files
42 #include "TLibCommon/TComList.h"
44 #include "TLibCommon/TComTrQuant.h"
46 #include "TLibCommon/AccessUnit.h"
47 
49 
50 #include "TEncCfg.h"
51 #include "TEncGOP.h"
52 #include "TEncSlice.h"
53 #include "TEncEntropy.h"
54 #include "TEncCavlc.h"
55 #include "TEncSbac.h"
56 #include "TEncSearch.h"
58 #include "TEncPreanalyzer.h"
59 #include "TEncRateCtrl.h"
62 
63 // ====================================================================================================================
64 // Class definition
65 // ====================================================================================================================
66 
68 class TEncTop : public TEncCfg
69 {
70 private:
71  // picture
76 
77  // encoder search
79  //TEncEntropy* m_pcEntropyCoder; ///< entropy encoder
81  // coding tool
89 
90  // processing unit
94  // SPS
97  // RD cost computation
101 #if FAST_BIT_EST
104 #else
107 #endif
108 
109  // quality control
111 
113 
114 protected:
115  Void xGetNewPicBuffer ( TComPic*& rpcPic, Int ppsId );
116  Void xInitVPS (TComVPS &vps, const TComSPS &sps);
117  Void xInitSPS (TComSPS &sps);
118  Void xInitPPS (TComPPS &pps, const TComSPS &sps);
119  Void xInitScalingLists (TComSPS &sps, TComPPS &pps);
121 
123  Void xInitRPS (TComSPS &sps, Bool isFieldCoding);
124 
125 public:
126  TEncTop();
127  virtual ~TEncTop();
128 
129  Void create ();
130  Void destroy ();
131  Void init (Bool isFieldCoding);
133 
134  // -------------------------------------------------------------------------------------------------------------------
135  // member access functions
136  // -------------------------------------------------------------------------------------------------------------------
137 
140 
151 
152  TComRdCost* getRdCost () { return &m_cRdCost; }
156  Void selectReferencePictureSet(TComSlice* slice, Int POCCurr, Int GOPid );
157  Int getReferencePictureSetIdxForSOP(Int POCCurr, Int GOPid );
158 
159 #if JCTVC_Y0038_PARAMS
160  Void setParamSetChanged(Int spsId, Int ppsId);
161 #endif
162  Bool PPSNeedsWriting(Int ppsId);
163  Bool SPSNeedsWriting(Int spsId);
164 
165  // -------------------------------------------------------------------------------------------------------------------
166  // encoder function
167  // -------------------------------------------------------------------------------------------------------------------
168 
170  Void encode( Bool bEos,
171  TComPicYuv* pcPicYuvOrg,
172  TComPicYuv* pcPicYuvTrueOrg, const InputColourSpaceConversion snrCSC, // used for SNR calculations. Picture in original colour space.
173  TComList<TComPicYuv*>& rcListPicYuvRecOut,
174  std::list<AccessUnit>& accessUnitsOut, Int& iNumEncoded );
175 
177  Void encode( Bool bEos, TComPicYuv* pcPicYuvOrg,
178  TComPicYuv* pcPicYuvTrueOrg, const InputColourSpaceConversion snrCSC, // used for SNR calculations. Picture in original colour space.
179  TComList<TComPicYuv*>& rcListPicYuvRecOut,
180  std::list<AccessUnit>& accessUnitsOut, Int& iNumEncoded, Bool isTff);
181 
182 #if JVET_F0064_MSSSIM
184 #else
186 #endif
187 
188 };
189 
191 
192 #endif // __TENCTOP__
193 
TEncBinCABAC m_cBinCoderCABAC
bin coder CABAC
Definition: TEncTop.h:88
entropy encoder class (header)
Void xInitSPS(TComSPS &sps)
initialize SPS from encoder options
Definition: TEncTop.cpp:598
TEncSbac *** getRDSbacCoder()
Definition: TEncTop.h:153
picture YUV buffer class
Definition: TComPicYuv.h:55
deblocking filter (header)
TEncRateCtrl * getRateCtrl()
Definition: TEncTop.h:155
GOP encoder class (header)
prediction class (header)
Void setParamSetChanged(Int spsId, Int ppsId)
Definition: TEncTop.cpp:1379
picture class (symbol + YUV buffers)
Definition: TComPic.h:56
void Void
Definition: TypeDef.h:203
TEncEntropy m_cEntropyCoder
entropy encoder
Definition: TEncTop.h:85
TEncGOP * getGOPEncoder()
Definition: TEncTop.h:144
TEncSlice m_cSliceEncoder
slice encoder
Definition: TEncTop.h:92
Void printSummary(Bool isField)
Definition: TEncTop.h:183
Bool m_printMSEBasedSequencePSNR
Definition: TEncCfg.h:146
TEncSbac m_cRDGoOnSbacCoder
going on SBAC model for RD stage
Definition: TEncTop.h:100
estimation part of sample adaptive offset class (header)
Bool m_printSequenceMSE
Definition: TEncCfg.h:148
TEncPreanalyzer m_cPreanalyzer
image characteristics analyzer for TM5-step3-like adaptive QP
Definition: TEncTop.h:110
CAVLC encoder class.
Definition: TEncCavlc.h:70
unsigned int UInt
Definition: TypeDef.h:212
UInt m_uiNumAllPicCoded
number of coded pictures
Definition: TEncTop.h:74
deblocking filter class
encoder search class
Definition: TEncSearch.h:68
TEncEntropy * getEntropyCoder()
Definition: TEncTop.h:147
TComTrQuant m_cTrQuant
transform &amp; quantization class
Definition: TEncTop.h:82
TEncGOP m_cGOPEncoder
GOP encoder.
Definition: TEncTop.h:91
Source picture analyzer class.
Void xInitScalingLists(TComSPS &sps, TComPPS &pps)
initialize scaling lists
Definition: TEncTop.cpp:236
ParameterSetMap< TComPPS > m_ppsMap
PPS. This is the base value. This is copied to TComPicSym.
Definition: TEncTop.h:96
TEncSbac *** m_pppcRDSbacCoder
temporal storage for RD computation
Definition: TEncTop.h:99
TEncSbac * getRDGoOnSbacCoder()
Definition: TEncTop.h:154
YUV file I/O class (header)
slice encoder class
Definition: TEncSlice.h:61
encoder configuration class (header)
Void create()
Definition: TEncTop.cpp:89
Void deletePicBuffer()
Definition: TEncTop.cpp:301
TEncSbac * getSbacCoder()
Definition: TEncTop.h:149
TComList< TComPic * > * getListPic()
Definition: TEncTop.h:138
Int getReferencePictureSetIdxForSOP(Int POCCurr, Int GOPid)
Definition: TEncTop.cpp:1271
general list class (header)
TComRdCost m_cRdCost
RD cost computation class.
Definition: TEncTop.h:98
TComLoopFilter * getLoopFilter()
Definition: TEncTop.h:142
TEncSampleAdaptiveOffset m_cEncSAO
sample adaptive offset class
Definition: TEncTop.h:84
bool Bool
Definition: TypeDef.h:204
TEncCavlc m_cCavlcCoder
CAVLC encoder.
Definition: TEncTop.h:86
PPS class.
Definition: TComSlice.h:1034
Bool PPSNeedsWriting(Int ppsId)
Definition: TEncTop.cpp:1386
RD cost computation class.
Definition: TComRdCost.h:111
TComTrQuant * getTrQuant()
Definition: TEncTop.h:141
entropy encoder class
Definition: TEncEntropy.h:116
Bool SPSNeedsWriting(Int spsId)
Definition: TEncTop.cpp:1393
slice encoder class (header)
ParameterSetMap< TComSPS > m_spsMap
SPS. This is the base value. This is copied to TComPicSym.
Definition: TEncTop.h:95
Bool m_printMSSSIM
Definition: TEncCfg.h:150
TEncCavlc * getCavlcCoder()
Definition: TEncTop.h:148
const BitDepths & getBitDepths() const
Definition: TComSlice.h:900
encoder search class (header)
Void encode(Bool bEos, TComPicYuv *pcPicYuvOrg, TComPicYuv *pcPicYuvTrueOrg, const InputColourSpaceConversion snrCSC, TComList< TComPicYuv * > &rcListPicYuvRecOut, std::list< AccessUnit > &accessUnitsOut, Int &iNumEncoded)
encode several number of pictures until end-of-sequence
Definition: TEncTop.cpp:329
TEncRateCtrl m_cRateCtrl
Rate control class.
Definition: TEncTop.h:112
Access Unit class (header)
TEncSlice * getSliceEncoder()
Definition: TEncTop.h:145
TEncBinCABACCounter m_cRDGoOnBinCoderCABAC
going on bin coder CABAC for RD stage
Definition: TEncTop.h:103
Int m_iPOCLast
time index (POC)
Definition: TEncTop.h:72
TEncSearch m_cSearch
encoder search class
Definition: TEncTop.h:78
TEncTop()
Definition: TEncTop.cpp:53
Void init(Bool isFieldCoding)
Definition: TEncTop.cpp:183
InputColourSpaceConversion
Definition: TypeDef.h:316
Context-adaptive entropy encoder class (header)
TComRdCost * getRdCost()
Definition: TEncTop.h:152
TEncBinCABACCounter *** m_pppcBinCoderCABAC
temporal CABAC state storage for RD computation
Definition: TEncTop.h:102
Void xInitVPS(TComVPS &vps, const TComSPS &sps)
initialize VPS from encoder options
Definition: TEncTop.cpp:580
transform and quantization class
Definition: TComTrQuant.h:98
TEncCavlc * m_pcCavlcCoder
CAVLC encoder.
Definition: TEncTop.h:80
TComLoopFilter m_cLoopFilter
deblocking filter class
Definition: TEncTop.h:83
int Int
Definition: TypeDef.h:211
encoder class
Definition: TEncTop.h:68
Void xInitPPS(TComPPS &pps, const TComSPS &sps)
initialize PPS from encoder options
Definition: TEncTop.cpp:916
Rate control manager class.
Void xInitHrdParameters(TComSPS &sps)
initialize HRD parameters
Definition: TEncTop.cpp:774
transform and quantization class (header)
CU encoder class.
Definition: TEncCu.h:65
Void xGetNewPicBuffer(TComPic *&rpcPic, Int ppsId)
get picture buffer which will be processed. If ppsId&lt;0, then the ppsMap will be queried for the first...
Definition: TEncTop.cpp:496
TEncSearch * getPredSearch()
Definition: TEncTop.h:139
source picture analyzer class (header)
CAVLC encoder class (header)
Void selectReferencePictureSet(TComSlice *slice, Int POCCurr, Int GOPid)
Definition: TEncTop.cpp:1235
TEncCu * getCuEncoder()
Definition: TEncTop.h:146
Void destroy()
Definition: TEncTop.cpp:147
encoder configuration class
Definition: TEncCfg.h:111
SBAC encoder class.
Definition: TEncSbac.h:66
TComList< TComPic * > m_cListPic
dynamic list of pictures
Definition: TEncTop.h:75
Int m_iNumPicRcvd
number of received pictures
Definition: TEncTop.h:73
virtual ~TEncTop()
Definition: TEncTop.cpp:79
slice header class
Definition: TComSlice.h:1225
TEncBinCABAC * getBinCABAC()
Definition: TEncTop.h:150
Void xInitRPS(TComSPS &sps, Bool isFieldCoding)
initialize PPS from encoder options
Definition: TEncTop.cpp:1084
Void xInitPPSforTiles(TComPPS &pps)
Definition: TEncTop.cpp:1301
TEncSbac m_cSbacCoder
SBAC encoder.
Definition: TEncTop.h:87
TEncSampleAdaptiveOffset * getSAO()
Definition: TEncTop.h:143
TEncCu m_cCuEncoder
CU encoder.
Definition: TEncTop.h:93
Void printOutSummary(UInt uiNumAllPicCoded, Bool isField, const Bool printMSEBasedSNR, const Bool printSequenceMSE, const Bool printMSSSIM, const BitDepths &bitDepths)
Definition: TEncGOP.cpp:1970
SPS class.
Definition: TComSlice.h:740