HEVC Test Model (HM)  HM-16.18
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TComPicSym.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 __TCOMPICSYM__
39 #define __TCOMPICSYM__
40 
41 
42 // Include files
43 #include <deque>
44 #include "CommonDef.h"
45 #include "TComSlice.h"
46 #include "TComDataCU.h"
48 class TComPPS;
49 
52 
53 // ====================================================================================================================
54 // Class definition
55 // ====================================================================================================================
56 
57 class TComTile
58 {
59 private:
65 
66 public:
67  TComTile();
68  virtual ~TComTile();
69 
80 };
81 
84 {
85 private:
88 
91 
97 
98  std::deque<TComSlice*> m_apSlices;
100 
103  std::vector<TComTile> m_tileParameters;
107 
108 #if REDUCED_ENCODER_MEMORY
109 public:
111  {
112  Bool isInter(const UInt absPartAddr) const { return m_pePredMode[absPartAddr] == MODE_INTER; }
113  PartSize getPartitionSize( const UInt absPartAddr ) const { return static_cast<PartSize>( m_pePartSize[absPartAddr] ); }
114  const TComCUMvField* getCUMvField ( RefPicList e ) const { return &m_CUMvField[e]; }
115  const TComSlice* getSlice() const { return m_pSlice; }
116 
121  };
122 
123 private:
125 #endif
127 #if ADAPTIVE_QP_SELECTION
129 #endif
132 
133  Void xInitTiles( );
137  Void setCtuTsToRsAddrMap( Int ctuTsAddr, Int ctuRsAddr ) { *(m_ctuTsToRsAddrMap + ctuTsAddr) = ctuRsAddr; }
138  Void setCtuRsToTsAddrMap( Int ctuRsAddr, Int ctuTsOrder ) { *(m_ctuRsToTsAddrMap + ctuRsAddr) = ctuTsOrder; }
139 
140 public:
141 #if REDUCED_ENCODER_MEMORY
142  Void create ( const TComSPS &sps, const TComPPS &pps, UInt uiMaxDepth, const Bool bAllocateCtuArray );
146 #else
147  Void create ( const TComSPS &sps, const TComPPS &pps, UInt uiMaxDepth );
148 #endif
149  Void destroy ();
150 
151  TComPicSym ();
152  ~TComPicSym();
153 
154  TComSlice* getSlice(UInt i) { return m_apSlices[i]; }
155  const TComSlice* getSlice(UInt i) const { return m_apSlices[i]; }
158  UInt getMinCUWidth() const { return m_uiMinCUWidth; }
159  UInt getMinCUHeight() const { return m_uiMinCUHeight; }
161  TComDataCU* getCtu( UInt ctuRsAddr ) { return m_pictureCtuArray[ctuRsAddr]; }
162  const TComDataCU* getCtu( UInt ctuRsAddr ) const { return m_pictureCtuArray[ctuRsAddr]; }
163  const TComSPS& getSPS() const { return m_sps; }
164  const TComPPS& getPPS() const { return m_pps; }
165 #if REDUCED_ENCODER_MEMORY
166  Bool hasDPBPerCtuData() const { return (m_dpbPerCtuData!=0); };
167  DPBPerCtuData& getDPBPerCtuData(UInt ctuRsAddr) { return m_dpbPerCtuData[ctuRsAddr]; }
168  const DPBPerCtuData& getDPBPerCtuData(UInt ctuRsAddr) const { return m_dpbPerCtuData[ctuRsAddr]; }
169 #endif
170 
171  TComSlice * swapSliceObject(TComSlice* p, UInt i) { p->setSPS(&m_sps); p->setPPS(&m_pps); TComSlice *pTmp=m_apSlices[i];m_apSlices[i] = p; pTmp->setSPS(0); pTmp->setPPS(0); return pTmp; }
172  UInt getNumAllocatedSlice() const { return UInt(m_apSlices.size()); }
181  TComTile* getTComTile ( UInt tileIdx ) { return &(m_tileParameters[tileIdx]); }
182  const TComTile* getTComTile ( UInt tileIdx ) const { return &(m_tileParameters[tileIdx]); }
183  UInt getCtuTsToRsAddrMap( Int ctuTsAddr ) const { return *(m_ctuTsToRsAddrMap + (ctuTsAddr>=m_numCtusInFrame ? m_numCtusInFrame : ctuTsAddr)); }
184  UInt getTileIdxMap( Int ctuRsAddr ) const { return *(m_puiTileIdxMap + ctuRsAddr); }
185  UInt getCtuRsToTsAddrMap( Int ctuRsAddr ) const { return *(m_ctuRsToTsAddrMap + (ctuRsAddr>=m_numCtusInFrame ? m_numCtusInFrame : ctuRsAddr)); }
187  const SAOBlkParam* getSAOBlkParam() const { return m_saoBlkParams;}
189  Bool& isLeftAvail, Bool& isRightAvail, Bool& isAboveAvail, Bool& isBelowAvail,
190  Bool& isAboveLeftAvail, Bool& isAboveRightAvail, Bool& isBelowLeftAvail, Bool& isBelowRightAvail);
191 protected:
192  UInt xCalculateNextCtuRSAddr( UInt uiCurrCtuRSAddr );
193 
194 };// END CLASS DEFINITION TComPicSym
195 
197 
198 #if MCTS_ENC_CHECK
199 Void getTilePosition(const TComDataCU* const pcCU, UInt &tileXPosInCtus, UInt &tileYPosInCtus, UInt &tileWidthtInCtus, UInt &tileHeightInCtus);
200 #endif
201 
202 #endif // __TCOMPICSYM__
203 
UInt m_tileWidthInCtus
Definition: TComPicSym.h:60
UInt getFirstCtuRsAddr() const
Definition: TComPicSym.h:79
UInt getCtuTsToRsAddrMap(Int ctuTsAddr) const
Definition: TComPicSym.h:183
UInt * m_ctuRsToTsAddrMap
for a given RS (Raster-Scan) address, returns the TS (Tile-Scan; coding order) address. cf CtbAddrRsToTs in specification.
Definition: TComPicSym.h:106
CU data structure class.
Definition: TComDataCU.h:64
UInt m_bottomEdgePosInCtus
Definition: TComPicSym.h:63
TComPPS m_pps
Definition: TComPicSym.h:131
UInt getNumPartInCtuHeight() const
Definition: TComPicSym.h:177
Defines version information, constants and small in-line functions.
void Void
Definition: TypeDef.h:203
const TComPPS & getPPS() const
Definition: TComPicSym.h:164
Void setRightEdgePosInCtus(UInt i)
Definition: TComPicSym.h:74
UInt * m_puiTileIdxMap
the map of the tile index relative to CTU raster scan address
Definition: TComPicSym.h:105
Void setNumTileRowsMinus1(Int i)
Definition: TComPicSym.h:136
Int getNumTileColumnsMinus1() const
Definition: TComPicSym.h:178
UInt m_rightEdgePosInCtus
Definition: TComPicSym.h:62
const TComSlice * getSlice() const
Definition: TComPicSym.h:115
slice header and SPS class (header)
const TComTile * getTComTile(UInt tileIdx) const
Definition: TComPicSym.h:182
Void setNumTileColumnsMinus1(Int i)
Definition: TComPicSym.h:135
TComSlice * getSlice(UInt i)
Definition: TComPicSym.h:154
unsigned int UInt
Definition: TypeDef.h:212
Void create(const TComSPS &sps, const TComPPS &pps, UInt uiMaxDepth, const Bool bAllocateCtuArray)
Definition: TComPicSym.cpp:83
Void allocateNewSlice()
Definition: TComPicSym.cpp:285
UInt getMinCUHeight() const
Definition: TComPicSym.h:159
const TComSlice * getSlice(UInt i) const
Definition: TComPicSym.h:155
Void releaseAllReconstructionData()
Definition: TComPicSym.cpp:221
Void setPPS(const TComPPS *pcPPS)
Definition: TComSlice.h:1331
std::deque< TComSlice * > m_apSlices
Definition: TComPicSym.h:98
UInt getNumAllocatedSlice() const
Definition: TComPicSym.h:172
Bool isInter(const UInt absPartAddr) const
Definition: TComPicSym.h:112
DPBPerCtuData * m_dpbPerCtuData
Definition: TComPicSym.h:124
UInt m_numCtusInFrame
Definition: TComPicSym.h:96
UInt getCtuRsToTsAddrMap(Int ctuRsAddr) const
Definition: TComPicSym.h:185
UInt getFrameWidthInCtus() const
Definition: TComPicSym.h:156
Int getNumTileRowsMinus1() const
Definition: TComPicSym.h:179
Void setTileHeightInCtus(UInt i)
Definition: TComPicSym.h:72
UInt getMinCUWidth() const
Definition: TComPicSym.h:158
class for motion information in one CU
PartSize
supported partition shape
Definition: TypeDef.h:348
UInt getTileWidthInCtus() const
Definition: TComPicSym.h:71
PartSize getPartitionSize(const UInt absPartAddr) const
Definition: TComPicSym.h:113
UInt getTileIdxMap(Int ctuRsAddr) const
Definition: TComPicSym.h:184
signed char SChar
Definition: TypeDef.h:207
bool Bool
Definition: TypeDef.h:204
UInt m_frameWidthInCtus
Definition: TComPicSym.h:86
TComDataCU ** m_pictureCtuArray
array of CU data.
Definition: TComPicSym.h:99
Int getNumTiles() const
Definition: TComPicSym.h:180
PPS class.
Definition: TComSlice.h:1034
Void setFirstCtuRsAddr(UInt i)
Definition: TComPicSym.h:78
Void xInitCtuTsRsAddrMaps()
Definition: TComPicSym.cpp:306
UInt m_uiMinCUWidth
Definition: TComPicSym.h:89
const SAOBlkParam * getSAOBlkParam() const
Definition: TComPicSym.h:187
UInt m_tileHeightInCtus
Definition: TComPicSym.h:61
const TComDataCU * getCtu(UInt ctuRsAddr) const
Definition: TComPicSym.h:162
Int TCoeff
transform coefficient
Definition: TypeDef.h:250
RefPicList
reference list index
Definition: TypeDef.h:370
TCoeff * m_pParentARLBuffer
Definition: TComPicSym.h:128
Void destroy()
Definition: TComPicSym.cpp:242
unsigned char UChar
Definition: TypeDef.h:208
Bool hasDPBPerCtuData() const
Definition: TComPicSym.h:166
UInt getNumPartInCtuWidth() const
Definition: TComPicSym.h:176
UInt getFrameHeightInCtus() const
Definition: TComPicSym.h:157
UInt getTileHeightInCtus() const
Definition: TComPicSym.h:73
const TComSPS & getSPS() const
Definition: TComPicSym.h:163
Int m_numTileRowsMinus1
Definition: TComPicSym.h:102
std::vector< TComTile > m_tileParameters
Definition: TComPicSym.h:103
UInt m_firstCtuRsAddr
Definition: TComPicSym.h:64
TComDataCU * getCtu(UInt ctuRsAddr)
Definition: TComPicSym.h:161
UChar m_uhTotalDepth
max. depth
Definition: TComPicSym.h:92
Void setCtuTsToRsAddrMap(Int ctuTsAddr, Int ctuRsAddr)
Definition: TComPicSym.h:137
TComSPS m_sps
Definition: TComPicSym.h:130
const TComCUMvField * getCUMvField(RefPicList e) const
Definition: TComPicSym.h:114
UInt m_numPartitionsInCtu
Definition: TComPicSym.h:93
Int m_numTileColumnsMinus1
Definition: TComPicSym.h:101
Void setBottomEdgePosInCtus(UInt i)
Definition: TComPicSym.h:76
UInt m_frameHeightInCtus
Definition: TComPicSym.h:87
Void prepareForReconstruction()
Definition: TComPicSym.cpp:166
UInt * m_ctuTsToRsAddrMap
for a given TS (Tile-Scan; coding order) address, returns the RS (Raster-Scan) address. cf CtbAddrTsToRs in specification.
Definition: TComPicSym.h:104
Void deriveLoopFilterBoundaryAvailibility(Int ctuRsAddr, Bool &isLeftAvail, Bool &isRightAvail, Bool &isAboveAvail, Bool &isBelowAvail, Bool &isAboveLeftAvail, Bool &isAboveRightAvail, Bool &isBelowLeftAvail, Bool &isBelowRightAvail)
Definition: TComPicSym.cpp:482
TComTile * getTComTile(UInt tileIdx)
Definition: TComPicSym.h:181
SAOBlkParam * m_saoBlkParams
Definition: TComPicSym.h:126
UInt getNumberOfCtusInFrame() const
Definition: TComPicSym.h:160
int Int
Definition: TypeDef.h:211
UInt xCalculateNextCtuRSAddr(UInt uiCurrCtuRSAddr)
Definition: TComPicSym.cpp:447
virtual ~TComTile()
Definition: TComPicSym.cpp:599
const DPBPerCtuData & getDPBPerCtuData(UInt ctuRsAddr) const
Definition: TComPicSym.h:168
Void clearSliceBuffer()
Definition: TComPicSym.cpp:297
Void setCtuRsToTsAddrMap(Int ctuRsAddr, Int ctuTsOrder)
Definition: TComPicSym.h:138
UInt m_numPartInCtuHeight
Definition: TComPicSym.h:95
UInt getRightEdgePosInCtus() const
Definition: TComPicSym.h:75
Void releaseReconstructionIntermediateData()
Definition: TComPicSym.cpp:203
UInt getNumPartitionsInCtu() const
Definition: TComPicSym.h:175
TComCUMvField m_CUMvField[NUM_REF_PIC_LIST_01]
Definition: TComPicSym.h:119
inter-prediction mode
Definition: TypeDef.h:364
Void setTileWidthInCtus(UInt i)
Definition: TComPicSym.h:70
UInt m_uiMinCUHeight
Definition: TComPicSym.h:90
CU data structure (header)
slice header class
Definition: TComSlice.h:1225
Void xInitTiles()
Definition: TComPicSym.cpp:318
UInt getBottomEdgePosInCtus() const
Definition: TComPicSym.h:77
TComSlice * swapSliceObject(TComSlice *p, UInt i)
Definition: TComPicSym.h:171
Void setSPS(const TComSPS *pcSPS)
Definition: TComSlice.h:1328
Void getTilePosition(const TComDataCU *const pcCU, UInt &tileXPosInCtus, UInt &tileYPosInCtus, UInt &tileWidthtInCtus, UInt &tileHeightInCtus)
Definition: TComPicSym.cpp:605
UInt m_numPartInCtuWidth
Definition: TComPicSym.h:94
picture symbol class
Definition: TComPicSym.h:83
SPS class.
Definition: TComSlice.h:740
DPBPerCtuData & getDPBPerCtuData(UInt ctuRsAddr)
Definition: TComPicSym.h:167
SAOBlkParam * getSAOBlkParam()
Definition: TComPicSym.h:186