HEVC Test Model (HM)  HM-16.3
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-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 __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 );
116  Void xInitVPS ();
117  Void xInitSPS ();
118  Void xInitPPS ();
120 
122  Void xInitRPS (Bool isFieldCoding);
123 
124 public:
125  TEncTop();
126  virtual ~TEncTop();
127 
128  Void create ();
129  Void destroy ();
130  Void init (Bool isFieldCoding);
132 
133  // -------------------------------------------------------------------------------------------------------------------
134  // member access functions
135  // -------------------------------------------------------------------------------------------------------------------
136 
139 
150 
151  TComRdCost* getRdCost () { return &m_cRdCost; }
155  Void selectReferencePictureSet(TComSlice* slice, Int POCCurr, Int GOPid );
156  Int getReferencePictureSetIdxForSOP(TComSlice* slice, Int POCCurr, Int GOPid );
157  // -------------------------------------------------------------------------------------------------------------------
158  // encoder function
159  // -------------------------------------------------------------------------------------------------------------------
160 
162  Void encode( Bool bEos,
163  TComPicYuv* pcPicYuvOrg,
164  TComPicYuv* pcPicYuvTrueOrg, const InputColourSpaceConversion snrCSC, // used for SNR calculations. Picture in original colour space.
165  TComList<TComPicYuv*>& rcListPicYuvRecOut,
166  std::list<AccessUnit>& accessUnitsOut, Int& iNumEncoded );
167 
169  Void encode( Bool bEos, TComPicYuv* pcPicYuvOrg,
170  TComPicYuv* pcPicYuvTrueOrg, const InputColourSpaceConversion snrCSC, // used for SNR calculations. Picture in original colour space.
171  TComList<TComPicYuv*>& rcListPicYuvRecOut,
172  std::list<AccessUnit>& accessUnitsOut, Int& iNumEncoded, Bool isTff);
173 
174  Void printSummary(Bool isField) { m_cGOPEncoder.printOutSummary (m_uiNumAllPicCoded, isField, m_printMSEBasedSequencePSNR, m_printSequenceMSE); }
175 
176 };
177 
179 
180 #endif // __TENCTOP__
181 
TEncBinCABAC m_cBinCoderCABAC
bin coder CABAC
Definition: TEncTop.h:88
entropy encoder class (header)
TEncSbac *** getRDSbacCoder()
Definition: TEncTop.h:152
picture YUV buffer class
Definition: TComPicYuv.h:55
TComPPS m_cPPS
PPS. This is the base value. This is copied to TComPicSym.
Definition: TEncTop.h:96
deblocking filter (header)
TEncRateCtrl * getRateCtrl()
Definition: TEncTop.h:154
GOP encoder class (header)
prediction class (header)
picture class (symbol + YUV buffers)
Definition: TComPic.h:56
void Void
Definition: TypeDef.h:285
TEncEntropy m_cEntropyCoder
entropy encoder
Definition: TEncTop.h:85
TEncGOP * getGOPEncoder()
Definition: TEncTop.h:143
TEncSlice m_cSliceEncoder
slice encoder
Definition: TEncTop.h:92
Void printSummary(Bool isField)
Definition: TEncTop.h:174
Bool m_printMSEBasedSequencePSNR
Definition: TEncCfg.h:111
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:113
TEncPreanalyzer m_cPreanalyzer
image characteristics analyzer for TM5-step3-like adaptive QP
Definition: TEncTop.h:110
Void xInitVPS()
initialize VPS from encoder options
Definition: TEncTop.cpp:508
CAVLC encoder class.
Definition: TEncCavlc.h:61
unsigned int UInt
Definition: TypeDef.h:297
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:146
TComTrQuant m_cTrQuant
transform & quantization class
Definition: TEncTop.h:82
TEncGOP m_cGOPEncoder
GOP encoder.
Definition: TEncTop.h:91
Source picture analyzer class.
TEncSbac *** m_pppcRDSbacCoder
temporal storage for RD computation
Definition: TEncTop.h:99
TEncSbac * getRDGoOnSbacCoder()
Definition: TEncTop.h:153
YUV file I/O class (header)
slice encoder class
Definition: TEncSlice.h:61
encoder configuration class (header)
Void create()
Definition: TEncTop.cpp:87
Void deletePicBuffer()
Definition: TEncTop.cpp:282
TEncSbac * getSbacCoder()
Definition: TEncTop.h:148
TComList< TComPic * > * getListPic()
Definition: TEncTop.h:137
general list class (header)
TComRdCost m_cRdCost
RD cost computation class.
Definition: TEncTop.h:98
TComLoopFilter * getLoopFilter()
Definition: TEncTop.h:141
TEncSampleAdaptiveOffset m_cEncSAO
sample adaptive offset class
Definition: TEncTop.h:84
bool Bool
Definition: TypeDef.h:286
TEncCavlc m_cCavlcCoder
CAVLC encoder.
Definition: TEncTop.h:86
Void printOutSummary(UInt uiNumAllPicCoded, Bool isField, const Bool printMSEBasedSNR, const Bool printSequenceMSE)
Definition: TEncGOP.cpp:2002
Void xInitPPSforTiles()
Definition: TEncTop.cpp:1034
PPS class.
Definition: TComSlice.h:977
RD cost computation class.
Definition: TComRdCost.h:104
TComTrQuant * getTrQuant()
Definition: TEncTop.h:140
entropy encoder class
Definition: TEncEntropy.h:121
slice encoder class (header)
Void xInitScalingLists()
initialize scaling lists
Definition: TEncTop.cpp:224
Void xInitSPS()
initialize SPS from encoder options
Definition: TEncTop.cpp:526
TEncCavlc * getCavlcCoder()
Definition: TEncTop.h:147
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:310
TComSPS m_cSPS
SPS. This is the base value. This is copied to TComPicSym.
Definition: TEncTop.h:95
TEncRateCtrl m_cRateCtrl
Rate control class.
Definition: TEncTop.h:112
Access Unit class (header)
TEncSlice * getSliceEncoder()
Definition: TEncTop.h:144
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
Void xInitRPS(Bool isFieldCoding)
initialize PPS from encoder options
Definition: TEncTop.cpp:813
TEncTop()
Definition: TEncTop.cpp:53
Void init(Bool isFieldCoding)
Definition: TEncTop.cpp:184
Void xGetNewPicBuffer(TComPic *&rpcPic)
get picture buffer which will be processed
Definition: TEncTop.cpp:462
InputColourSpaceConversion
Definition: TypeDef.h:376
Context-adaptive entropy encoder class (header)
TComRdCost * getRdCost()
Definition: TEncTop.h:151
TEncBinCABACCounter *** m_pppcBinCoderCABAC
temporal CABAC state storage for RD computation
Definition: TEncTop.h:102
Int getReferencePictureSetIdxForSOP(TComSlice *slice, Int POCCurr, Int GOPid)
Definition: TEncTop.cpp:1004
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:296
encoder class
Definition: TEncTop.h:68
Rate control manager class.
transform and quantization class (header)
CU encoder class.
Definition: TEncCu.h:65
TEncSearch * getPredSearch()
Definition: TEncTop.h:138
source picture analyzer class (header)
CAVLC encoder class (header)
Void selectReferencePictureSet(TComSlice *slice, Int POCCurr, Int GOPid)
Definition: TEncTop.cpp:966
TEncCu * getCuEncoder()
Definition: TEncTop.h:145
Void destroy()
Definition: TEncTop.cpp:149
encoder configuration class
Definition: TEncCfg.h:99
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:77
slice header class
Definition: TComSlice.h:1198
TEncBinCABAC * getBinCABAC()
Definition: TEncTop.h:149
TEncSbac m_cSbacCoder
SBAC encoder.
Definition: TEncTop.h:87
TEncSampleAdaptiveOffset * getSAO()
Definition: TEncTop.h:142
TEncCu m_cCuEncoder
CU encoder.
Definition: TEncTop.h:93
Void xInitPPS()
initialize PPS from encoder options
Definition: TEncTop.cpp:693
SPS class.
Definition: TComSlice.h:722