HEVC Test Model (HM)  HM-16.3
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-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 __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 
70  Void setTileWidthInCtus ( UInt i ) { m_tileWidthInCtus = i; }
72  Void setTileHeightInCtus ( UInt i ) { m_tileHeightInCtus = i; }
74  Void setRightEdgePosInCtus ( UInt i ) { m_rightEdgePosInCtus = i; }
76  Void setBottomEdgePosInCtus ( UInt i ) { m_bottomEdgePosInCtus = i; }
78  Void setFirstCtuRsAddr ( UInt i ) { m_firstCtuRsAddr = i; }
80 };
81 
84 {
85 private:
88 
93 
99 
100  std::deque<TComSlice*> m_apSlices;
102 
105  std::vector<TComTile> m_tileParameters;
109 
113 
114  Void xInitTiles( );
116  Void setNumTileColumnsMinus1( Int i ) { m_numTileColumnsMinus1 = i; }
117  Void setNumTileRowsMinus1( Int i ) { m_numTileRowsMinus1 = i; }
118  Void setCtuTsToRsAddrMap( Int ctuTsAddr, Int ctuRsAddr ) { *(m_ctuTsToRsAddrMap + ctuTsAddr) = ctuRsAddr; }
119  Void setCtuRsToTsAddrMap( Int ctuRsAddr, Int ctuTsOrder ) { *(m_ctuRsToTsAddrMap + ctuRsAddr) = ctuTsOrder; }
120 
121 public:
122  Void create ( const TComSPS &sps, const TComPPS &pps, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth );
123  Void destroy ();
124 
125  TComPicSym ();
126  TComSlice* getSlice(UInt i) { return m_apSlices[i]; }
127  const TComSlice* getSlice(UInt i) const { return m_apSlices[i]; }
130  UInt getMinCUWidth() const { return m_uiMinCUWidth; }
131  UInt getMinCUHeight() const { return m_uiMinCUHeight; }
133  TComDataCU* getCtu( UInt ctuRsAddr ) { return m_pictureCtuArray[ctuRsAddr]; }
134  const TComDataCU* getCtu( UInt ctuRsAddr ) const { return m_pictureCtuArray[ctuRsAddr]; }
135  const TComSPS& getSPS() const { return m_sps; }
136  const TComPPS& getPPS() const { return m_pps; }
137 
138  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; }
139  UInt getNumAllocatedSlice() const { return UInt(m_apSlices.size()); }
147  Int getNumTiles() const { return (m_numTileRowsMinus1+1)*(m_numTileColumnsMinus1+1); }
148  TComTile* getTComTile ( UInt tileIdx ) { return &(m_tileParameters[tileIdx]); }
149  const TComTile* getTComTile ( UInt tileIdx ) const { return &(m_tileParameters[tileIdx]); }
150  UInt getCtuTsToRsAddrMap( Int ctuTsAddr ) const { return *(m_ctuTsToRsAddrMap + (ctuTsAddr>=m_numCtusInFrame ? m_numCtusInFrame : ctuTsAddr)); }
151  UInt getTileIdxMap( Int ctuRsAddr ) const { return *(m_puiTileIdxMap + ctuRsAddr); }
152  UInt getCtuRsToTsAddrMap( Int ctuRsAddr ) const { return *(m_ctuRsToTsAddrMap + (ctuRsAddr>=m_numCtusInFrame ? m_numCtusInFrame : ctuRsAddr)); }
154  const SAOBlkParam* getSAOBlkParam() const { return m_saoBlkParams;}
156  Bool& isLeftAvail, Bool& isRightAvail, Bool& isAboveAvail, Bool& isBelowAvail,
157  Bool& isAboveLeftAvail, Bool& isAboveRightAvail, Bool& isBelowLeftAvail, Bool& isBelowRightAvail);
158 protected:
159  UInt xCalculateNextCtuRSAddr( UInt uiCurrCtuRSAddr );
160 
161 };// END CLASS DEFINITION TComPicSym
162 
164 
165 #endif // __TCOMPICSYM__
166 
UInt m_tileWidthInCtus
Definition: TComPicSym.h:60
UInt getFirstCtuRsAddr() const
Definition: TComPicSym.h:79
UInt getCtuTsToRsAddrMap(Int ctuTsAddr) const
Definition: TComPicSym.h:150
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:108
CU data structure class.
Definition: TComDataCU.h:64
UInt m_bottomEdgePosInCtus
Definition: TComPicSym.h:63
TComPPS m_pps
Definition: TComPicSym.h:112
UInt getNumPartInCtuHeight() const
Definition: TComPicSym.h:144
Defines constants, macros and tool parameters.
void Void
Definition: TypeDef.h:285
const TComPPS & getPPS() const
Definition: TComPicSym.h:136
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:107
Void setNumTileRowsMinus1(Int i)
Definition: TComPicSym.h:117
Int getNumTileColumnsMinus1() const
Definition: TComPicSym.h:145
UInt m_rightEdgePosInCtus
Definition: TComPicSym.h:62
slice header and SPS class (header)
const TComTile * getTComTile(UInt tileIdx) const
Definition: TComPicSym.h:149
Void setNumTileColumnsMinus1(Int i)
Definition: TComPicSym.h:116
TComSlice * getSlice(UInt i)
Definition: TComPicSym.h:126
unsigned int UInt
Definition: TypeDef.h:297
Void allocateNewSlice()
Definition: TComPicSym.cpp:159
UInt getMinCUHeight() const
Definition: TComPicSym.h:131
const TComSlice * getSlice(UInt i) const
Definition: TComPicSym.h:127
Void setPPS(const TComPPS *pcPPS)
Definition: TComSlice.h:1308
std::deque< TComSlice * > m_apSlices
Definition: TComPicSym.h:100
UInt getNumAllocatedSlice() const
Definition: TComPicSym.h:139
UInt m_numCtusInFrame
Definition: TComPicSym.h:98
UInt getCtuRsToTsAddrMap(Int ctuRsAddr) const
Definition: TComPicSym.h:152
UInt getFrameWidthInCtus() const
Definition: TComPicSym.h:128
Int getNumTileRowsMinus1() const
Definition: TComPicSym.h:146
Void setTileHeightInCtus(UInt i)
Definition: TComPicSym.h:72
UInt getMinCUWidth() const
Definition: TComPicSym.h:130
UInt getTileWidthInCtus() const
Definition: TComPicSym.h:71
UInt getTileIdxMap(Int ctuRsAddr) const
Definition: TComPicSym.h:151
UInt m_uiMaxCUHeight
Definition: TComPicSym.h:90
bool Bool
Definition: TypeDef.h:286
UInt m_frameWidthInCtus
Definition: TComPicSym.h:86
TComDataCU ** m_pictureCtuArray
array of CU data.
Definition: TComPicSym.h:101
Int getNumTiles() const
Definition: TComPicSym.h:147
PPS class.
Definition: TComSlice.h:977
Void setFirstCtuRsAddr(UInt i)
Definition: TComPicSym.h:78
Void xInitCtuTsRsAddrMaps()
Definition: TComPicSym.cpp:180
UInt m_uiMinCUWidth
Definition: TComPicSym.h:91
const SAOBlkParam * getSAOBlkParam() const
Definition: TComPicSym.h:154
UInt m_tileHeightInCtus
Definition: TComPicSym.h:61
const TComDataCU * getCtu(UInt ctuRsAddr) const
Definition: TComPicSym.h:134
Void destroy()
Definition: TComPicSym.cpp:131
unsigned char UChar
Definition: TypeDef.h:293
UInt getNumPartInCtuWidth() const
Definition: TComPicSym.h:143
Void create(const TComSPS &sps, const TComPPS &pps, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth)
Definition: TComPicSym.cpp:72
UInt getFrameHeightInCtus() const
Definition: TComPicSym.h:129
UInt getTileHeightInCtus() const
Definition: TComPicSym.h:73
const TComSPS & getSPS() const
Definition: TComPicSym.h:135
Int m_numTileRowsMinus1
Definition: TComPicSym.h:104
std::vector< TComTile > m_tileParameters
Definition: TComPicSym.h:105
UInt m_firstCtuRsAddr
Definition: TComPicSym.h:64
TComDataCU * getCtu(UInt ctuRsAddr)
Definition: TComPicSym.h:133
UChar m_uhTotalDepth
max. depth
Definition: TComPicSym.h:94
Void setCtuTsToRsAddrMap(Int ctuTsAddr, Int ctuRsAddr)
Definition: TComPicSym.h:118
TComSPS m_sps
Definition: TComPicSym.h:111
UInt m_numPartitionsInCtu
Definition: TComPicSym.h:95
Int m_numTileColumnsMinus1
Definition: TComPicSym.h:103
Void setBottomEdgePosInCtus(UInt i)
Definition: TComPicSym.h:76
UInt m_frameHeightInCtus
Definition: TComPicSym.h:87
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:106
Void deriveLoopFilterBoundaryAvailibility(Int ctuRsAddr, Bool &isLeftAvail, Bool &isRightAvail, Bool &isAboveAvail, Bool &isBelowAvail, Bool &isAboveLeftAvail, Bool &isAboveRightAvail, Bool &isBelowLeftAvail, Bool &isBelowRightAvail)
Definition: TComPicSym.cpp:357
TComTile * getTComTile(UInt tileIdx)
Definition: TComPicSym.h:148
SAOBlkParam * m_saoBlkParams
Definition: TComPicSym.h:110
UInt getNumberOfCtusInFrame() const
Definition: TComPicSym.h:132
int Int
Definition: TypeDef.h:296
UInt xCalculateNextCtuRSAddr(UInt uiCurrCtuRSAddr)
Definition: TComPicSym.cpp:322
virtual ~TComTile()
Definition: TComPicSym.cpp:474
Void clearSliceBuffer()
Definition: TComPicSym.cpp:171
Void setCtuRsToTsAddrMap(Int ctuRsAddr, Int ctuTsOrder)
Definition: TComPicSym.h:119
UInt m_numPartInCtuHeight
Definition: TComPicSym.h:97
UInt getRightEdgePosInCtus() const
Definition: TComPicSym.h:75
UInt getNumPartitionsInCtu() const
Definition: TComPicSym.h:142
Void setTileWidthInCtus(UInt i)
Definition: TComPicSym.h:70
UInt m_uiMinCUHeight
Definition: TComPicSym.h:92
CU data structure (header)
slice header class
Definition: TComSlice.h:1198
Void xInitTiles()
Definition: TComPicSym.cpp:192
UInt getBottomEdgePosInCtus() const
Definition: TComPicSym.h:77
TComSlice * swapSliceObject(TComSlice *p, UInt i)
Definition: TComPicSym.h:138
Void setSPS(const TComSPS *pcSPS)
Definition: TComSlice.h:1305
UInt m_numPartInCtuWidth
Definition: TComPicSym.h:96
UInt m_uiMaxCUWidth
Definition: TComPicSym.h:89
picture symbol class
Definition: TComPicSym.h:83
SPS class.
Definition: TComSlice.h:722
SAOBlkParam * getSAOBlkParam()
Definition: TComPicSym.h:153