[313] | 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-2013, 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" |
---|
| 46 | class TComSampleAdaptiveOffset; |
---|
| 47 | |
---|
| 48 | //! \ingroup TLibCommon |
---|
| 49 | //! \{ |
---|
| 50 | |
---|
| 51 | // ==================================================================================================================== |
---|
| 52 | // Class definition |
---|
| 53 | // ==================================================================================================================== |
---|
| 54 | |
---|
| 55 | class TComTile |
---|
| 56 | { |
---|
| 57 | private: |
---|
| 58 | UInt m_uiTileWidth; |
---|
| 59 | UInt m_uiTileHeight; |
---|
| 60 | UInt m_uiRightEdgePosInCU; |
---|
| 61 | UInt m_uiBottomEdgePosInCU; |
---|
| 62 | UInt m_uiFirstCUAddr; |
---|
| 63 | |
---|
| 64 | public: |
---|
| 65 | TComTile(); |
---|
| 66 | virtual ~TComTile(); |
---|
| 67 | |
---|
| 68 | Void setTileWidth ( UInt i ) { m_uiTileWidth = i; } |
---|
| 69 | UInt getTileWidth () { return m_uiTileWidth; } |
---|
| 70 | Void setTileHeight ( UInt i ) { m_uiTileHeight = i; } |
---|
| 71 | UInt getTileHeight () { return m_uiTileHeight; } |
---|
| 72 | Void setRightEdgePosInCU ( UInt i ) { m_uiRightEdgePosInCU = i; } |
---|
| 73 | UInt getRightEdgePosInCU () { return m_uiRightEdgePosInCU; } |
---|
| 74 | Void setBottomEdgePosInCU ( UInt i ) { m_uiBottomEdgePosInCU = i; } |
---|
| 75 | UInt getBottomEdgePosInCU () { return m_uiBottomEdgePosInCU; } |
---|
| 76 | Void setFirstCUAddr ( UInt i ) { m_uiFirstCUAddr = i; } |
---|
| 77 | UInt getFirstCUAddr () { return m_uiFirstCUAddr; } |
---|
| 78 | }; |
---|
| 79 | |
---|
| 80 | /// picture symbol class |
---|
| 81 | class TComPicSym |
---|
| 82 | { |
---|
| 83 | private: |
---|
| 84 | UInt m_uiWidthInCU; |
---|
| 85 | UInt m_uiHeightInCU; |
---|
| 86 | |
---|
| 87 | UInt m_uiMaxCUWidth; |
---|
| 88 | UInt m_uiMaxCUHeight; |
---|
| 89 | UInt m_uiMinCUWidth; |
---|
| 90 | UInt m_uiMinCUHeight; |
---|
| 91 | |
---|
| 92 | UChar m_uhTotalDepth; ///< max. depth |
---|
| 93 | UInt m_uiNumPartitions; |
---|
| 94 | UInt m_uiNumPartInWidth; |
---|
| 95 | UInt m_uiNumPartInHeight; |
---|
| 96 | UInt m_uiNumCUsInFrame; |
---|
| 97 | |
---|
| 98 | TComSlice** m_apcTComSlice; |
---|
| 99 | UInt m_uiNumAllocatedSlice; |
---|
| 100 | TComDataCU** m_apcTComDataCU; ///< array of CU data |
---|
| 101 | |
---|
| 102 | Int m_iNumColumnsMinus1; |
---|
| 103 | Int m_iNumRowsMinus1; |
---|
| 104 | TComTile** m_apcTComTile; |
---|
| 105 | UInt* m_puiCUOrderMap; //the map of LCU raster scan address relative to LCU encoding order |
---|
| 106 | UInt* m_puiTileIdxMap; //the map of the tile index relative to LCU raster scan address |
---|
[442] | 107 | #if N0383_IL_CONSTRAINED_TILE_SETS_SEI |
---|
| 108 | Int* m_piTileSetIdxMap; //the map of the tile set index relative to LCU raster scan address |
---|
| 109 | UChar* m_pucTileSetType; |
---|
| 110 | Bool* m_pbSkippedTileSetFlag; |
---|
| 111 | #endif |
---|
[313] | 112 | UInt* m_puiInverseCUOrderMap; |
---|
| 113 | |
---|
| 114 | SAOParam *m_saoParam; |
---|
| 115 | public: |
---|
| 116 | Void create ( Int iPicWidth, Int iPicHeight, UInt uiMaxWidth, UInt uiMaxHeight, UInt uiMaxDepth ); |
---|
| 117 | Void destroy (); |
---|
| 118 | |
---|
| 119 | TComPicSym (); |
---|
| 120 | TComSlice* getSlice(UInt i) { return m_apcTComSlice[i]; } |
---|
| 121 | UInt getFrameWidthInCU() { return m_uiWidthInCU; } |
---|
| 122 | UInt getFrameHeightInCU() { return m_uiHeightInCU; } |
---|
| 123 | UInt getMinCUWidth() { return m_uiMinCUWidth; } |
---|
| 124 | UInt getMinCUHeight() { return m_uiMinCUHeight; } |
---|
| 125 | UInt getNumberOfCUsInFrame() { return m_uiNumCUsInFrame; } |
---|
| 126 | TComDataCU*& getCU( UInt uiCUAddr ) { return m_apcTComDataCU[uiCUAddr]; } |
---|
| 127 | |
---|
[467] | 128 | #if LAYER_CTB |
---|
| 129 | UInt getMaxCUWidth() { return m_uiMaxCUWidth; } |
---|
| 130 | UInt getMaxCUHeight() { return m_uiMaxCUHeight; } |
---|
| 131 | #endif |
---|
| 132 | |
---|
[313] | 133 | #if AVC_SYNTAX |
---|
| 134 | UInt getMaxCUWidth() { return m_uiMaxCUWidth; } |
---|
| 135 | UInt getMaxCUHeight() { return m_uiMaxCUHeight; } |
---|
| 136 | UInt getMaxDepth() { return m_uhTotalDepth; } |
---|
| 137 | #endif |
---|
| 138 | |
---|
| 139 | Void setSlice(TComSlice* p, UInt i) { m_apcTComSlice[i] = p; } |
---|
| 140 | UInt getNumAllocatedSlice() { return m_uiNumAllocatedSlice; } |
---|
| 141 | Void allocateNewSlice(); |
---|
| 142 | Void clearSliceBuffer(); |
---|
| 143 | UInt getNumPartition() { return m_uiNumPartitions; } |
---|
| 144 | UInt getNumPartInWidth() { return m_uiNumPartInWidth; } |
---|
| 145 | UInt getNumPartInHeight() { return m_uiNumPartInHeight; } |
---|
| 146 | Void setNumColumnsMinus1( Int i ) { m_iNumColumnsMinus1 = i; } |
---|
| 147 | Int getNumColumnsMinus1() { return m_iNumColumnsMinus1; } |
---|
| 148 | Void setNumRowsMinus1( Int i ) { m_iNumRowsMinus1 = i; } |
---|
| 149 | Int getNumRowsMinus1() { return m_iNumRowsMinus1; } |
---|
| 150 | Int getNumTiles() { return (m_iNumRowsMinus1+1)*(m_iNumColumnsMinus1+1); } |
---|
| 151 | TComTile* getTComTile ( UInt tileIdx ) { return *(m_apcTComTile + tileIdx); } |
---|
| 152 | Void setCUOrderMap( Int encCUOrder, Int cuAddr ) { *(m_puiCUOrderMap + encCUOrder) = cuAddr; } |
---|
| 153 | UInt getCUOrderMap( Int encCUOrder ) { return *(m_puiCUOrderMap + (encCUOrder>=m_uiNumCUsInFrame ? m_uiNumCUsInFrame : encCUOrder)); } |
---|
| 154 | UInt getTileIdxMap( Int i ) { return *(m_puiTileIdxMap + i); } |
---|
[442] | 155 | #if N0383_IL_CONSTRAINED_TILE_SETS_SEI |
---|
| 156 | Void setTileSetIdxMap( Int i, Int tileSetIdx, UChar setType, Bool skipFlag ) |
---|
| 157 | { |
---|
| 158 | m_piTileSetIdxMap[i] = tileSetIdx; |
---|
| 159 | m_pucTileSetType[i] = setType; |
---|
| 160 | m_pbSkippedTileSetFlag[i] = skipFlag; |
---|
| 161 | } |
---|
| 162 | Int getTileSetIdxMap( Int i ) { return *(m_piTileSetIdxMap + i); } |
---|
| 163 | UChar getTileSetType( Int i ) { return *(m_pucTileSetType + i); } |
---|
| 164 | Bool getSkippedTileSetFlag( Int i ) { return *(m_pbSkippedTileSetFlag + i); } |
---|
| 165 | #endif |
---|
[313] | 166 | Void setInverseCUOrderMap( Int cuAddr, Int encCUOrder ) { *(m_puiInverseCUOrderMap + cuAddr) = encCUOrder; } |
---|
| 167 | UInt getInverseCUOrderMap( Int cuAddr ) { return *(m_puiInverseCUOrderMap + (cuAddr>=m_uiNumCUsInFrame ? m_uiNumCUsInFrame : cuAddr)); } |
---|
| 168 | UInt getPicSCUEncOrder( UInt SCUAddr ); |
---|
| 169 | UInt getPicSCUAddr( UInt SCUEncOrder ); |
---|
| 170 | Void xCreateTComTileArray(); |
---|
| 171 | Void xInitTiles(); |
---|
| 172 | UInt xCalculateNxtCUAddr( UInt uiCurrCUAddr ); |
---|
| 173 | Void allocSaoParam(TComSampleAdaptiveOffset *sao); |
---|
| 174 | SAOParam *getSaoParam() { return m_saoParam; } |
---|
| 175 | };// END CLASS DEFINITION TComPicSym |
---|
| 176 | |
---|
| 177 | //! \} |
---|
| 178 | |
---|
| 179 | #endif // __TCOMPICSYM__ |
---|
| 180 | |
---|