source: 3DVCSoftware/branches/HTM-13.1-dev1-RWTH/source/Lib/TLibCommon/TComPicSym.h @ 1151

Last change on this file since 1151 was 1084, checked in by tech, 10 years ago

Merged branches/HTM-12.1-dev0@1083.

  • Property svn:eol-style set to native
File size: 7.3 KB
Line 
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-2014, 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
34/** \file     TComPicSym.h
35    \brief    picture symbol class (header)
36*/
37
38#ifndef __TCOMPICSYM__
39#define __TCOMPICSYM__
40
41
42// Include files
43#include "CommonDef.h"
44#include "TComSlice.h"
45#include "TComDataCU.h"
46class TComSampleAdaptiveOffset;
47class TComPPS;
48
49//! \ingroup TLibCommon
50//! \{
51
52// ====================================================================================================================
53// Class definition
54// ====================================================================================================================
55
56class TComTile
57{
58private:
59  UInt      m_uiTileWidth;
60  UInt      m_uiTileHeight;
61  UInt      m_uiRightEdgePosInCU;
62  UInt      m_uiBottomEdgePosInCU;
63  UInt      m_uiFirstCUAddr;
64
65public: 
66  TComTile();
67  virtual ~TComTile();
68
69  Void      setTileWidth         ( UInt i )            { m_uiTileWidth = i; }
70  UInt      getTileWidth         ()                    { return m_uiTileWidth; }
71  Void      setTileHeight        ( UInt i )            { m_uiTileHeight = i; }
72  UInt      getTileHeight        ()                    { return m_uiTileHeight; }
73  Void      setRightEdgePosInCU  ( UInt i )            { m_uiRightEdgePosInCU = i; }
74  UInt      getRightEdgePosInCU  ()                    { return m_uiRightEdgePosInCU; }
75  Void      setBottomEdgePosInCU ( UInt i )            { m_uiBottomEdgePosInCU = i; }
76  UInt      getBottomEdgePosInCU ()                    { return m_uiBottomEdgePosInCU; }
77  Void      setFirstCUAddr       ( UInt i )            { m_uiFirstCUAddr = i; }
78  UInt      getFirstCUAddr       ()                    { return m_uiFirstCUAddr; }
79};
80
81/// picture symbol class
82class TComPicSym
83{
84private:
85  UInt          m_uiWidthInCU;
86  UInt          m_uiHeightInCU;
87 
88  UInt          m_uiMaxCUWidth;
89  UInt          m_uiMaxCUHeight;
90  UInt          m_uiMinCUWidth;
91  UInt          m_uiMinCUHeight;
92 
93  UChar         m_uhTotalDepth;       ///< max. depth
94  UInt          m_uiNumPartitions;
95  UInt          m_uiNumPartInWidth;
96  UInt          m_uiNumPartInHeight;
97  UInt          m_uiNumCUsInFrame;
98 
99  TComSlice**   m_apcTComSlice;
100  UInt          m_uiNumAllocatedSlice;
101  TComDataCU**  m_apcTComDataCU;        ///< array of CU data
102   
103  Int           m_iNumColumnsMinus1; 
104  Int           m_iNumRowsMinus1;
105  std::vector<TComTile> m_tileParameters;
106  UInt*         m_puiCUOrderMap;       //the map of LCU raster scan address relative to LCU encoding order
107  UInt*         m_puiTileIdxMap;       //the map of the tile index relative to LCU raster scan address
108  UInt*         m_puiInverseCUOrderMap;
109
110  SAOBlkParam *m_saoBlkParams;
111public:
112  Void        create  ( Int iPicWidth, Int iPicHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth );
113  Void        destroy ();
114
115  TComPicSym  ();
116  TComSlice*  getSlice(UInt i)          { return  m_apcTComSlice[i];            }
117  UInt        getFrameWidthInCU()       { return m_uiWidthInCU;                 }
118  UInt        getFrameHeightInCU()      { return m_uiHeightInCU;                }
119  UInt        getMinCUWidth()           { return m_uiMinCUWidth;                }
120  UInt        getMinCUHeight()          { return m_uiMinCUHeight;               }
121  UInt        getNumberOfCUsInFrame()   { return m_uiNumCUsInFrame;  }
122  TComDataCU*&  getCU( UInt uiCUAddr )  { return m_apcTComDataCU[uiCUAddr];     }
123 
124  Void        setSlice(TComSlice* p, UInt i) { m_apcTComSlice[i] = p;           }
125  UInt        getNumAllocatedSlice()    { return m_uiNumAllocatedSlice;         }
126  Void        allocateNewSlice();
127  Void        clearSliceBuffer();
128  UInt        getNumPartition()         { return m_uiNumPartitions;             }
129  UInt        getNumPartInWidth()       { return m_uiNumPartInWidth;            }
130  UInt        getNumPartInHeight()      { return m_uiNumPartInHeight;           }
131  Void         setNumColumnsMinus1( Int i )                          { m_iNumColumnsMinus1 = i; }
132  Int          getNumColumnsMinus1()                                 { return m_iNumColumnsMinus1; } 
133  Void         setNumRowsMinus1( Int i )                             { m_iNumRowsMinus1 = i; }
134  Int          getNumRowsMinus1()                                    { return m_iNumRowsMinus1; }
135  Int          getNumTiles()                                         { return (m_iNumRowsMinus1+1)*(m_iNumColumnsMinus1+1); }
136  TComTile*    getTComTile  ( UInt tileIdx )                         { return &(m_tileParameters[tileIdx]); }
137  Void         setCUOrderMap( Int encCUOrder, Int cuAddr )           { *(m_puiCUOrderMap + encCUOrder) = cuAddr; }
138  UInt         getCUOrderMap( Int encCUOrder )                       { return *(m_puiCUOrderMap + (encCUOrder>=m_uiNumCUsInFrame ? m_uiNumCUsInFrame : encCUOrder)); }
139  UInt         getTileIdxMap( Int i )                                { return *(m_puiTileIdxMap + i); }
140  Void         setInverseCUOrderMap( Int cuAddr, Int encCUOrder )    { *(m_puiInverseCUOrderMap + cuAddr) = encCUOrder; }
141  UInt         getInverseCUOrderMap( Int cuAddr )                    { return *(m_puiInverseCUOrderMap + (cuAddr>=m_uiNumCUsInFrame ? m_uiNumCUsInFrame : cuAddr)); }
142  UInt         getPicSCUEncOrder( UInt SCUAddr );
143  UInt         getPicSCUAddr( UInt SCUEncOrder );
144  Void         initTiles(TComPPS *pps);
145  UInt         xCalculateNxtCUAddr( UInt uiCurrCUAddr );
146  SAOBlkParam* getSAOBlkParam() { return m_saoBlkParams;}
147  Void deriveLoopFilterBoundaryAvailibility(Int ctu, Bool& isLeftAvail,Bool& isRightAvail,Bool& isAboveAvail,Bool& isBelowAvail,Bool& isAboveLeftAvail,Bool& isAboveRightAvail,Bool& isBelowLeftAvail,Bool& isBelowRightAvail);
148
149
150};// END CLASS DEFINITION TComPicSym
151
152//! \}
153
154#endif // __TCOMPICSYM__
155
Note: See TracBrowser for help on using the repository browser.