[2] | 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-2012, 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 TComSlice.h |
---|
| 35 | \brief slice header and SPS class (header) |
---|
| 36 | */ |
---|
| 37 | |
---|
| 38 | #ifndef __TCOMSLICE__ |
---|
| 39 | #define __TCOMSLICE__ |
---|
| 40 | |
---|
| 41 | #include <cstring> |
---|
| 42 | #include <map> |
---|
| 43 | #include <vector> |
---|
| 44 | #include "CommonDef.h" |
---|
| 45 | #include "TComRom.h" |
---|
| 46 | #include "TComList.h" |
---|
| 47 | |
---|
| 48 | //! \ingroup TLibCommon |
---|
| 49 | //! \{ |
---|
| 50 | |
---|
| 51 | class TComPic; |
---|
| 52 | class TComTrQuant; |
---|
| 53 | |
---|
| 54 | #if SVC_EXTENSION |
---|
| 55 | class TComPicYuv; |
---|
| 56 | #endif |
---|
| 57 | // ==================================================================================================================== |
---|
| 58 | // Constants |
---|
| 59 | // ==================================================================================================================== |
---|
| 60 | |
---|
| 61 | /// max number of supported APS in software |
---|
| 62 | #define MAX_NUM_SUPPORTED_APS 1 |
---|
| 63 | |
---|
| 64 | // ==================================================================================================================== |
---|
| 65 | // Class definition |
---|
| 66 | // ==================================================================================================================== |
---|
| 67 | |
---|
| 68 | /// Reference Picture Set class |
---|
| 69 | class TComReferencePictureSet |
---|
| 70 | { |
---|
| 71 | private: |
---|
| 72 | Int m_numberOfPictures; |
---|
| 73 | Int m_numberOfNegativePictures; |
---|
| 74 | Int m_numberOfPositivePictures; |
---|
| 75 | Int m_numberOfLongtermPictures; |
---|
| 76 | Int m_deltaPOC[MAX_NUM_REF_PICS]; |
---|
| 77 | Int m_POC[MAX_NUM_REF_PICS]; |
---|
| 78 | Bool m_used[MAX_NUM_REF_PICS]; |
---|
| 79 | Bool m_interRPSPrediction; |
---|
| 80 | Int m_deltaRIdxMinus1; |
---|
| 81 | Int m_deltaRPS; |
---|
| 82 | Int m_numRefIdc; |
---|
| 83 | Int m_refIdc[MAX_NUM_REF_PICS+1]; |
---|
| 84 | Bool m_bCheckLTMSB[MAX_NUM_REF_PICS]; |
---|
| 85 | Int m_pocLSBLT[MAX_NUM_REF_PICS]; |
---|
| 86 | Int m_deltaPOCMSBCycleLT[MAX_NUM_REF_PICS]; |
---|
| 87 | Bool m_deltaPocMSBPresentFlag[MAX_NUM_REF_PICS]; |
---|
| 88 | |
---|
| 89 | public: |
---|
| 90 | TComReferencePictureSet(); |
---|
| 91 | virtual ~TComReferencePictureSet(); |
---|
| 92 | Int getPocLSBLT(Int i) { return m_pocLSBLT[i]; } |
---|
| 93 | Void setPocLSBLT(Int i, Int x) { m_pocLSBLT[i] = x; } |
---|
| 94 | Int getDeltaPocMSBCycleLT(Int i) { return m_deltaPOCMSBCycleLT[i]; } |
---|
| 95 | Void setDeltaPocMSBCycleLT(Int i, Int x) { m_deltaPOCMSBCycleLT[i] = x; } |
---|
| 96 | Bool getDeltaPocMSBPresentFlag(Int i) { return m_deltaPocMSBPresentFlag[i]; } |
---|
| 97 | Void setDeltaPocMSBPresentFlag(Int i, Bool x) { m_deltaPocMSBPresentFlag[i] = x; } |
---|
| 98 | Void setUsed(Int bufferNum, Bool used); |
---|
| 99 | Void setDeltaPOC(Int bufferNum, Int deltaPOC); |
---|
| 100 | Void setPOC(Int bufferNum, Int deltaPOC); |
---|
| 101 | Void setNumberOfPictures(Int numberOfPictures); |
---|
| 102 | Void setCheckLTMSBPresent(Int bufferNum, Bool b ); |
---|
| 103 | Bool getCheckLTMSBPresent(Int bufferNum); |
---|
| 104 | |
---|
| 105 | Int getUsed(Int bufferNum); |
---|
| 106 | Int getDeltaPOC(Int bufferNum); |
---|
| 107 | Int getPOC(Int bufferNum); |
---|
| 108 | Int getNumberOfPictures(); |
---|
| 109 | |
---|
| 110 | Void setNumberOfNegativePictures(Int number) { m_numberOfNegativePictures = number; } |
---|
| 111 | Int getNumberOfNegativePictures() { return m_numberOfNegativePictures; } |
---|
| 112 | Void setNumberOfPositivePictures(Int number) { m_numberOfPositivePictures = number; } |
---|
| 113 | Int getNumberOfPositivePictures() { return m_numberOfPositivePictures; } |
---|
| 114 | Void setNumberOfLongtermPictures(Int number) { m_numberOfLongtermPictures = number; } |
---|
| 115 | Int getNumberOfLongtermPictures() { return m_numberOfLongtermPictures; } |
---|
| 116 | |
---|
| 117 | Void setInterRPSPrediction(Bool flag) { m_interRPSPrediction = flag; } |
---|
| 118 | Bool getInterRPSPrediction() { return m_interRPSPrediction; } |
---|
| 119 | Void setDeltaRIdxMinus1(Int x) { m_deltaRIdxMinus1 = x; } |
---|
| 120 | Int getDeltaRIdxMinus1() { return m_deltaRIdxMinus1; } |
---|
| 121 | Void setDeltaRPS(Int x) { m_deltaRPS = x; } |
---|
| 122 | Int getDeltaRPS() { return m_deltaRPS; } |
---|
| 123 | Void setNumRefIdc(Int x) { m_numRefIdc = x; } |
---|
| 124 | Int getNumRefIdc() { return m_numRefIdc; } |
---|
| 125 | |
---|
| 126 | Void setRefIdc(Int bufferNum, Int refIdc); |
---|
| 127 | Int getRefIdc(Int bufferNum); |
---|
| 128 | |
---|
| 129 | Void sortDeltaPOC(); |
---|
| 130 | Void printDeltaPOC(); |
---|
| 131 | }; |
---|
| 132 | |
---|
| 133 | /// Reference Picture Set set class |
---|
| 134 | class TComRPSList |
---|
| 135 | { |
---|
| 136 | private: |
---|
| 137 | Int m_numberOfReferencePictureSets; |
---|
| 138 | TComReferencePictureSet* m_referencePictureSets; |
---|
| 139 | |
---|
| 140 | public: |
---|
| 141 | TComRPSList(); |
---|
| 142 | virtual ~TComRPSList(); |
---|
| 143 | |
---|
| 144 | Void create (Int numberOfEntries); |
---|
| 145 | Void destroy (); |
---|
| 146 | |
---|
| 147 | |
---|
| 148 | TComReferencePictureSet* getReferencePictureSet(Int referencePictureSetNum); |
---|
| 149 | Int getNumberOfReferencePictureSets(); |
---|
| 150 | Void setNumberOfReferencePictureSets(Int numberOfReferencePictureSets); |
---|
| 151 | }; |
---|
| 152 | |
---|
| 153 | /// SCALING_LIST class |
---|
| 154 | class TComScalingList |
---|
| 155 | { |
---|
| 156 | public: |
---|
| 157 | TComScalingList(); |
---|
| 158 | virtual ~TComScalingList(); |
---|
| 159 | Void setScalingListPresentFlag (Bool b) { m_scalingListPresentFlag = b; } |
---|
| 160 | Bool getScalingListPresentFlag () { return m_scalingListPresentFlag; } |
---|
| 161 | #if TS_FLAT_QUANTIZATION_MATRIX |
---|
| 162 | Bool getUseTransformSkip () { return m_useTransformSkip; } |
---|
| 163 | Void setUseTransformSkip (Bool b) { m_useTransformSkip = b; } |
---|
| 164 | #endif |
---|
| 165 | Int* getScalingListAddress (UInt sizeId, UInt listId) { return m_scalingListCoef[sizeId][listId]; } //!< get matrix coefficient |
---|
| 166 | Bool checkPredMode (UInt sizeId, UInt listId); |
---|
| 167 | Void setRefMatrixId (UInt sizeId, UInt listId, UInt u) { m_refMatrixId[sizeId][listId] = u; } //!< set reference matrix ID |
---|
| 168 | UInt getRefMatrixId (UInt sizeId, UInt listId) { return m_refMatrixId[sizeId][listId]; } //!< get reference matrix ID |
---|
| 169 | Int* getScalingListDefaultAddress (UInt sizeId, UInt listId); //!< get default matrix coefficient |
---|
| 170 | Void processDefaultMarix (UInt sizeId, UInt listId); |
---|
| 171 | Void setScalingListDC (UInt sizeId, UInt listId, UInt u) { m_scalingListDC[sizeId][listId] = u; } //!< set DC value |
---|
| 172 | |
---|
| 173 | Int getScalingListDC (UInt sizeId, UInt listId) { return m_scalingListDC[sizeId][listId]; } //!< get DC value |
---|
| 174 | Void checkDcOfMatrix (); |
---|
| 175 | Void processRefMatrix (UInt sizeId, UInt listId , UInt refListId ); |
---|
| 176 | Bool xParseScalingList (char* pchFile); |
---|
| 177 | |
---|
| 178 | private: |
---|
| 179 | Void init (); |
---|
| 180 | Void destroy (); |
---|
| 181 | Int m_scalingListDC [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< the DC value of the matrix coefficient for 16x16 |
---|
| 182 | Bool m_useDefaultScalingMatrixFlag [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< UseDefaultScalingMatrixFlag |
---|
| 183 | UInt m_refMatrixId [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< RefMatrixID |
---|
| 184 | Bool m_scalingListPresentFlag; //!< flag for using default matrix |
---|
| 185 | UInt m_predMatrixId [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< reference list index |
---|
| 186 | Int *m_scalingListCoef [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< quantization matrix |
---|
| 187 | #if TS_FLAT_QUANTIZATION_MATRIX |
---|
| 188 | Bool m_useTransformSkip; //!< transform skipping flag for setting default scaling matrix for 4x4 |
---|
| 189 | #endif |
---|
| 190 | }; |
---|
| 191 | |
---|
| 192 | #if PROFILE_TIER_LEVEL_SYNTAX |
---|
| 193 | class ProfileTierLevel{ |
---|
| 194 | Int m_profileSpace; |
---|
| 195 | Bool m_tierFlag; |
---|
| 196 | Int m_profileIdc; |
---|
| 197 | Bool m_profileCompatibilityFlag[32]; |
---|
| 198 | Int m_levelIdc; |
---|
| 199 | |
---|
| 200 | public: |
---|
| 201 | ProfileTierLevel(); |
---|
| 202 | |
---|
| 203 | Int getProfileSpace() const { return m_profileSpace; } |
---|
| 204 | Void setProfileSpace(Int x) { m_profileSpace = x; } |
---|
| 205 | |
---|
| 206 | Bool getTierFlag() const { return m_tierFlag; } |
---|
| 207 | Void setTierFlag(Bool x) { m_tierFlag = x; } |
---|
| 208 | |
---|
| 209 | Int getProfileIdc() const { return m_profileIdc; } |
---|
| 210 | Void setProfileIdc(Int x) { m_profileIdc = x; } |
---|
| 211 | |
---|
| 212 | Bool getProfileCompatibilityFlag(Int i) const { return m_profileCompatibilityFlag[i]; } |
---|
| 213 | Void setProfileCompatibilityFlag(Int i, Bool x) { m_profileCompatibilityFlag[i] = x; } |
---|
| 214 | |
---|
| 215 | Int getLevelIdc() const { return m_levelIdc; } |
---|
| 216 | Void setLevelIdc(Int x) { m_levelIdc = x; } |
---|
| 217 | }; |
---|
| 218 | |
---|
| 219 | |
---|
| 220 | class TComPTL{ |
---|
| 221 | ProfileTierLevel m_generalPTL; |
---|
| 222 | ProfileTierLevel m_subLayerPTL[6]; // max. value of max_sub_layers_minus1 is 6 |
---|
| 223 | Bool m_subLayerProfilePresentFlag[6]; |
---|
| 224 | Bool m_subLayerLevelPresentFlag[6]; |
---|
| 225 | |
---|
| 226 | public: |
---|
| 227 | TComPTL(); |
---|
| 228 | Bool getSubLayerProfilePresentFlag(Int i) const { return m_subLayerProfilePresentFlag[i]; } |
---|
| 229 | Void setSubLayerProfilePresentFlag(Int i, Bool x) { m_subLayerProfilePresentFlag[i] = x; } |
---|
| 230 | |
---|
| 231 | Bool getSubLayerLevelPresentFlag(Int i) const { return m_subLayerLevelPresentFlag[i]; } |
---|
| 232 | Void setSubLayerLevelPresentFlag(Int i, Bool x) { m_subLayerLevelPresentFlag[i] = x; } |
---|
| 233 | |
---|
| 234 | ProfileTierLevel* getGeneralPTL() { return &m_generalPTL; } |
---|
| 235 | ProfileTierLevel* getSubLayerPTL(Int i) { return &m_subLayerPTL[i]; } |
---|
| 236 | }; |
---|
| 237 | #endif |
---|
| 238 | /// VPS class |
---|
| 239 | |
---|
| 240 | class TComVPS |
---|
| 241 | { |
---|
| 242 | private: |
---|
| 243 | Int m_VPSId; |
---|
| 244 | UInt m_uiMaxTLayers; |
---|
| 245 | UInt m_uiMaxLayers; |
---|
| 246 | Bool m_bTemporalIdNestingFlag; |
---|
| 247 | |
---|
| 248 | UInt m_numReorderPics[MAX_TLAYER]; |
---|
| 249 | UInt m_uiMaxDecPicBuffering[MAX_TLAYER]; |
---|
| 250 | UInt m_uiMaxLatencyIncrease[MAX_TLAYER]; |
---|
| 251 | #if VPS_SYNTAX_CHANGES |
---|
| 252 | TComPTL m_pcPTL; |
---|
| 253 | #endif |
---|
| 254 | public: |
---|
| 255 | TComVPS(); |
---|
| 256 | virtual ~TComVPS(); |
---|
| 257 | |
---|
| 258 | Int getVPSId () { return m_VPSId; } |
---|
| 259 | Void setVPSId (Int i) { m_VPSId = i; } |
---|
| 260 | |
---|
| 261 | UInt getMaxTLayers () { return m_uiMaxTLayers; } |
---|
| 262 | Void setMaxTLayers (UInt t) { m_uiMaxTLayers = t; } |
---|
| 263 | |
---|
| 264 | UInt getMaxLayers () { return m_uiMaxLayers; } |
---|
| 265 | Void setMaxLayers (UInt l) { m_uiMaxLayers = l; } |
---|
| 266 | |
---|
| 267 | Bool getTemporalNestingFlag () { return m_bTemporalIdNestingFlag; } |
---|
| 268 | Void setTemporalNestingFlag (Bool t) { m_bTemporalIdNestingFlag = t; } |
---|
| 269 | |
---|
| 270 | Void setNumReorderPics(UInt v, UInt tLayer) { m_numReorderPics[tLayer] = v; } |
---|
| 271 | UInt getNumReorderPics(UInt tLayer) { return m_numReorderPics[tLayer]; } |
---|
| 272 | |
---|
| 273 | Void setMaxDecPicBuffering(UInt v, UInt tLayer) { m_uiMaxDecPicBuffering[tLayer] = v; } |
---|
| 274 | UInt getMaxDecPicBuffering(UInt tLayer) { return m_uiMaxDecPicBuffering[tLayer]; } |
---|
| 275 | |
---|
| 276 | Void setMaxLatencyIncrease(UInt v, UInt tLayer) { m_uiMaxLatencyIncrease[tLayer] = v; } |
---|
| 277 | UInt getMaxLatencyIncrease(UInt tLayer) { return m_uiMaxLatencyIncrease[tLayer]; } |
---|
| 278 | #if VPS_SYNTAX_CHANGES |
---|
| 279 | TComPTL* getPTL() { return &m_pcPTL; } |
---|
| 280 | #endif |
---|
| 281 | }; |
---|
| 282 | |
---|
| 283 | #if BUFFERING_PERIOD_AND_TIMING_SEI |
---|
| 284 | struct HrdSubLayerInfo |
---|
| 285 | { |
---|
| 286 | Bool fixedPicRateFlag; |
---|
| 287 | UInt picDurationInTcMinus1; |
---|
| 288 | Bool lowDelayHrdFlag; |
---|
| 289 | UInt cpbCntMinus1; |
---|
| 290 | UInt bitRateValueMinus1[MAX_CPB_CNT][2]; |
---|
| 291 | UInt cpbSizeValue [MAX_CPB_CNT][2]; |
---|
| 292 | UInt cbrFlag [MAX_CPB_CNT][2]; |
---|
| 293 | }; |
---|
| 294 | #endif |
---|
| 295 | #if SUPPORT_FOR_VUI |
---|
| 296 | class TComVUI |
---|
| 297 | { |
---|
| 298 | private: |
---|
| 299 | Bool m_aspectRatioInfoPresentFlag; |
---|
| 300 | Int m_aspectRatioIdc; |
---|
| 301 | Int m_sarWidth; |
---|
| 302 | Int m_sarHeight; |
---|
| 303 | Bool m_overscanInfoPresentFlag; |
---|
| 304 | Bool m_overscanAppropriateFlag; |
---|
| 305 | Bool m_videoSignalTypePresentFlag; |
---|
| 306 | Int m_videoFormat; |
---|
| 307 | Bool m_videoFullRangeFlag; |
---|
| 308 | Bool m_colourDescriptionPresentFlag; |
---|
| 309 | Int m_colourPrimaries; |
---|
| 310 | Int m_transferCharacteristics; |
---|
| 311 | Int m_matrixCoefficients; |
---|
| 312 | Bool m_chromaLocInfoPresentFlag; |
---|
| 313 | Int m_chromaSampleLocTypeTopField; |
---|
| 314 | Int m_chromaSampleLocTypeBottomField; |
---|
| 315 | Bool m_neutralChromaIndicationFlag; |
---|
| 316 | Bool m_fieldSeqFlag; |
---|
| 317 | Bool m_hrdParametersPresentFlag; |
---|
| 318 | Bool m_bitstreamRestrictionFlag; |
---|
| 319 | Bool m_tilesFixedStructureFlag; |
---|
| 320 | Bool m_motionVectorsOverPicBoundariesFlag; |
---|
| 321 | Int m_maxBytesPerPicDenom; |
---|
| 322 | Int m_maxBitsPerMinCuDenom; |
---|
| 323 | Int m_log2MaxMvLengthHorizontal; |
---|
| 324 | Int m_log2MaxMvLengthVertical; |
---|
| 325 | #if BUFFERING_PERIOD_AND_TIMING_SEI |
---|
| 326 | Bool m_timingInfoPresentFlag; |
---|
| 327 | UInt m_numUnitsInTick; |
---|
| 328 | UInt m_timeScale; |
---|
| 329 | Bool m_nalHrdParametersPresentFlag; |
---|
| 330 | Bool m_vclHrdParametersPresentFlag; |
---|
| 331 | Bool m_subPicCpbParamsPresentFlag; |
---|
| 332 | UInt m_tickDivisorMinus2; |
---|
| 333 | UInt m_duCpbRemovalDelayLengthMinus1; |
---|
| 334 | UInt m_bitRateScale; |
---|
| 335 | UInt m_cpbSizeScale; |
---|
| 336 | UInt m_initialCpbRemovalDelayLengthMinus1; |
---|
| 337 | UInt m_cpbRemovalDelayLengthMinus1; |
---|
| 338 | UInt m_dpbOutputDelayLengthMinus1; |
---|
| 339 | UInt m_numDU; |
---|
| 340 | HrdSubLayerInfo m_HRD[MAX_TLAYER]; |
---|
| 341 | #endif |
---|
| 342 | public: |
---|
| 343 | TComVUI() |
---|
| 344 | :m_aspectRatioInfoPresentFlag(false) |
---|
| 345 | ,m_aspectRatioIdc(0) |
---|
| 346 | ,m_sarWidth(0) |
---|
| 347 | ,m_sarHeight(0) |
---|
| 348 | ,m_overscanInfoPresentFlag(false) |
---|
| 349 | ,m_overscanAppropriateFlag(false) |
---|
| 350 | ,m_videoSignalTypePresentFlag(false) |
---|
| 351 | ,m_videoFormat(5) |
---|
| 352 | ,m_videoFullRangeFlag(false) |
---|
| 353 | ,m_colourDescriptionPresentFlag(false) |
---|
| 354 | ,m_colourPrimaries(2) |
---|
| 355 | ,m_transferCharacteristics(2) |
---|
| 356 | ,m_matrixCoefficients(2) |
---|
| 357 | ,m_chromaLocInfoPresentFlag(false) |
---|
| 358 | ,m_chromaSampleLocTypeTopField(0) |
---|
| 359 | ,m_chromaSampleLocTypeBottomField(0) |
---|
| 360 | ,m_neutralChromaIndicationFlag(false) |
---|
| 361 | ,m_fieldSeqFlag(false) |
---|
| 362 | ,m_hrdParametersPresentFlag(false) |
---|
| 363 | ,m_bitstreamRestrictionFlag(false) |
---|
| 364 | ,m_tilesFixedStructureFlag(false) |
---|
| 365 | ,m_motionVectorsOverPicBoundariesFlag(true) |
---|
| 366 | ,m_maxBytesPerPicDenom(2) |
---|
| 367 | ,m_maxBitsPerMinCuDenom(1) |
---|
| 368 | ,m_log2MaxMvLengthHorizontal(15) |
---|
| 369 | ,m_log2MaxMvLengthVertical(15) |
---|
| 370 | #if BUFFERING_PERIOD_AND_TIMING_SEI |
---|
| 371 | ,m_timingInfoPresentFlag(false) |
---|
| 372 | ,m_numUnitsInTick(1001) |
---|
| 373 | ,m_timeScale(60000) |
---|
| 374 | ,m_nalHrdParametersPresentFlag(0) |
---|
| 375 | ,m_vclHrdParametersPresentFlag(0) |
---|
| 376 | ,m_subPicCpbParamsPresentFlag(false) |
---|
| 377 | ,m_tickDivisorMinus2(0) |
---|
| 378 | ,m_duCpbRemovalDelayLengthMinus1(0) |
---|
| 379 | ,m_bitRateScale(0) |
---|
| 380 | ,m_cpbSizeScale(0) |
---|
| 381 | ,m_initialCpbRemovalDelayLengthMinus1(0) |
---|
| 382 | ,m_cpbRemovalDelayLengthMinus1(0) |
---|
| 383 | ,m_dpbOutputDelayLengthMinus1(0) |
---|
| 384 | #endif |
---|
| 385 | {} |
---|
| 386 | |
---|
| 387 | virtual ~TComVUI() {} |
---|
| 388 | |
---|
| 389 | Bool getAspectRatioInfoPresentFlag() { return m_aspectRatioInfoPresentFlag; } |
---|
| 390 | Void setAspectRatioInfoPresentFlag(Bool i) { m_aspectRatioInfoPresentFlag = i; } |
---|
| 391 | |
---|
| 392 | Int getAspectRatioIdc() { return m_aspectRatioIdc; } |
---|
| 393 | Void setAspectRatioIdc(Int i) { m_aspectRatioIdc = i; } |
---|
| 394 | |
---|
| 395 | Int getSarWidth() { return m_sarWidth; } |
---|
| 396 | Void setSarWidth(Int i) { m_sarWidth = i; } |
---|
| 397 | |
---|
| 398 | Int getSarHeight() { return m_sarHeight; } |
---|
| 399 | Void setSarHeight(Int i) { m_sarHeight = i; } |
---|
| 400 | |
---|
| 401 | Bool getOverscanInfoPresentFlag() { return m_overscanInfoPresentFlag; } |
---|
| 402 | Void setOverscanInfoPresentFlag(Bool i) { m_overscanInfoPresentFlag = i; } |
---|
| 403 | |
---|
| 404 | Bool getOverscanAppropriateFlag() { return m_overscanAppropriateFlag; } |
---|
| 405 | Void setOverscanAppropriateFlag(Bool i) { m_overscanAppropriateFlag = i; } |
---|
| 406 | |
---|
| 407 | Bool getVideoSignalTypePresentFlag() { return m_videoSignalTypePresentFlag; } |
---|
| 408 | Void setVideoSignalTypePresentFlag(Bool i) { m_videoSignalTypePresentFlag = i; } |
---|
| 409 | |
---|
| 410 | Int getVideoFormat() { return m_videoFormat; } |
---|
| 411 | Void setVideoFormat(Int i) { m_videoFormat = i; } |
---|
| 412 | |
---|
| 413 | Bool getVideoFullRangeFlag() { return m_videoFullRangeFlag; } |
---|
| 414 | Void setVideoFullRangeFlag(Bool i) { m_videoFullRangeFlag = i; } |
---|
| 415 | |
---|
| 416 | Bool getColourDescriptionPresentFlag() { return m_colourDescriptionPresentFlag; } |
---|
| 417 | Void setColourDescriptionPresentFlag(Bool i) { m_colourDescriptionPresentFlag = i; } |
---|
| 418 | |
---|
| 419 | Int getColourPrimaries() { return m_colourPrimaries; } |
---|
| 420 | Void setColourPrimaries(Int i) { m_colourPrimaries = i; } |
---|
| 421 | |
---|
| 422 | Int getTransferCharacteristics() { return m_transferCharacteristics; } |
---|
| 423 | Void setTransferCharacteristics(Int i) { m_transferCharacteristics = i; } |
---|
| 424 | |
---|
| 425 | Int getMatrixCoefficients() { return m_matrixCoefficients; } |
---|
| 426 | Void setMatrixCoefficients(Int i) { m_matrixCoefficients = i; } |
---|
| 427 | |
---|
| 428 | Bool getChromaLocInfoPresentFlag() { return m_chromaLocInfoPresentFlag; } |
---|
| 429 | Void setChromaLocInfoPresentFlag(Bool i) { m_chromaLocInfoPresentFlag = i; } |
---|
| 430 | |
---|
| 431 | Int getChromaSampleLocTypeTopField() { return m_chromaSampleLocTypeTopField; } |
---|
| 432 | Void setChromaSampleLocTypeTopField(Int i) { m_chromaSampleLocTypeTopField = i; } |
---|
| 433 | |
---|
| 434 | Int getChromaSampleLocTypeBottomField() { return m_chromaSampleLocTypeBottomField; } |
---|
| 435 | Void setChromaSampleLocTypeBottomField(Int i) { m_chromaSampleLocTypeBottomField = i; } |
---|
| 436 | |
---|
| 437 | Bool getNeutralChromaIndicationFlag() { return m_neutralChromaIndicationFlag; } |
---|
| 438 | Void setNeutralChromaIndicationFlag(Bool i) { m_neutralChromaIndicationFlag = i; } |
---|
| 439 | |
---|
| 440 | Bool getFieldSeqFlag() { return m_fieldSeqFlag; } |
---|
| 441 | Void setFieldSeqFlag(Bool i) { m_fieldSeqFlag = i; } |
---|
| 442 | |
---|
| 443 | Bool getHrdParametersPresentFlag() { return m_hrdParametersPresentFlag; } |
---|
| 444 | Void setHrdParametersPresentFlag(Bool i) { m_hrdParametersPresentFlag = i; } |
---|
| 445 | |
---|
| 446 | Bool getBitstreamRestrictionFlag() { return m_bitstreamRestrictionFlag; } |
---|
| 447 | Void setBitstreamRestrictionFlag(Bool i) { m_bitstreamRestrictionFlag = i; } |
---|
| 448 | |
---|
| 449 | Bool getTilesFixedStructureFlag() { return m_tilesFixedStructureFlag; } |
---|
| 450 | Void setTilesFixedStructureFlag(Bool i) { m_tilesFixedStructureFlag = i; } |
---|
| 451 | |
---|
| 452 | Bool getMotionVectorsOverPicBoundariesFlag() { return m_motionVectorsOverPicBoundariesFlag; } |
---|
| 453 | Void setMotionVectorsOverPicBoundariesFlag(Bool i) { m_motionVectorsOverPicBoundariesFlag = i; } |
---|
| 454 | |
---|
| 455 | Int getMaxBytesPerPicDenom() { return m_maxBytesPerPicDenom; } |
---|
| 456 | Void setMaxBytesPerPicDenom(Int i) { m_maxBytesPerPicDenom = i; } |
---|
| 457 | |
---|
| 458 | Int getMaxBitsPerMinCuDenom() { return m_maxBitsPerMinCuDenom; } |
---|
| 459 | Void setMaxBitsPerMinCuDenom(Int i) { m_maxBitsPerMinCuDenom = i; } |
---|
| 460 | |
---|
| 461 | Int getLog2MaxMvLengthHorizontal() { return m_log2MaxMvLengthHorizontal; } |
---|
| 462 | Void setLog2MaxMvLengthHorizontal(Int i) { m_log2MaxMvLengthHorizontal = i; } |
---|
| 463 | |
---|
| 464 | Int getLog2MaxMvLengthVertical() { return m_log2MaxMvLengthVertical; } |
---|
| 465 | Void setLog2MaxMvLengthVertical(Int i) { m_log2MaxMvLengthVertical = i; } |
---|
| 466 | |
---|
| 467 | #if BUFFERING_PERIOD_AND_TIMING_SEI |
---|
| 468 | Void setTimingInfoPresentFlag ( Bool flag ) { m_timingInfoPresentFlag = flag; } |
---|
| 469 | Bool getTimingInfoPresentFlag ( ) { return m_timingInfoPresentFlag; } |
---|
| 470 | |
---|
| 471 | Void setNumUnitsInTick ( UInt value ) { m_numUnitsInTick = value; } |
---|
| 472 | UInt getNumUnitsInTick ( ) { return m_numUnitsInTick; } |
---|
| 473 | |
---|
| 474 | Void setTimeScale ( UInt value ) { m_timeScale = value; } |
---|
| 475 | UInt getTimeScale ( ) { return m_timeScale; } |
---|
| 476 | |
---|
| 477 | Void setNalHrdParametersPresentFlag ( Bool flag ) { m_nalHrdParametersPresentFlag = flag; } |
---|
| 478 | Bool getNalHrdParametersPresentFlag ( ) { return m_nalHrdParametersPresentFlag; } |
---|
| 479 | |
---|
| 480 | Void setVclHrdParametersPresentFlag ( Bool flag ) { m_vclHrdParametersPresentFlag = flag; } |
---|
| 481 | Bool getVclHrdParametersPresentFlag ( ) { return m_vclHrdParametersPresentFlag; } |
---|
| 482 | |
---|
| 483 | Void setSubPicCpbParamsPresentFlag ( Bool flag ) { m_subPicCpbParamsPresentFlag = flag; } |
---|
| 484 | Bool getSubPicCpbParamsPresentFlag ( ) { return m_subPicCpbParamsPresentFlag; } |
---|
| 485 | |
---|
| 486 | Void setTickDivisorMinus2 ( UInt value ) { m_tickDivisorMinus2 = value; } |
---|
| 487 | UInt getTickDivisorMinus2 ( ) { return m_tickDivisorMinus2; } |
---|
| 488 | |
---|
| 489 | Void setDuCpbRemovalDelayLengthMinus1 ( UInt value ) { m_duCpbRemovalDelayLengthMinus1 = value; } |
---|
| 490 | UInt getDuCpbRemovalDelayLengthMinus1 ( ) { return m_duCpbRemovalDelayLengthMinus1; } |
---|
| 491 | |
---|
| 492 | Void setBitRateScale ( UInt value ) { m_bitRateScale = value; } |
---|
| 493 | UInt getBitRateScale ( ) { return m_bitRateScale; } |
---|
| 494 | |
---|
| 495 | Void setCpbSizeScale ( UInt value ) { m_cpbSizeScale = value; } |
---|
| 496 | UInt getCpbSizeScale ( ) { return m_cpbSizeScale; } |
---|
| 497 | |
---|
| 498 | Void setInitialCpbRemovalDelayLengthMinus1( UInt value ) { m_initialCpbRemovalDelayLengthMinus1 = value; } |
---|
| 499 | UInt getInitialCpbRemovalDelayLengthMinus1( ) { return m_initialCpbRemovalDelayLengthMinus1; } |
---|
| 500 | |
---|
| 501 | Void setCpbRemovalDelayLengthMinus1 ( UInt value ) { m_cpbRemovalDelayLengthMinus1 = value; } |
---|
| 502 | UInt getCpbRemovalDelayLengthMinus1 ( ) { return m_cpbRemovalDelayLengthMinus1; } |
---|
| 503 | |
---|
| 504 | Void setDpbOutputDelayLengthMinus1 ( UInt value ) { m_dpbOutputDelayLengthMinus1 = value; } |
---|
| 505 | UInt getDpbOutputDelayLengthMinus1 ( ) { return m_dpbOutputDelayLengthMinus1; } |
---|
| 506 | |
---|
| 507 | Void setFixedPicRateFlag ( Int layer, Bool flag ) { m_HRD[layer].fixedPicRateFlag = flag; } |
---|
| 508 | Bool getFixedPicRateFlag ( Int layer ) { return m_HRD[layer].fixedPicRateFlag; } |
---|
| 509 | |
---|
| 510 | Void setPicDurationInTcMinus1 ( Int layer, UInt value ) { m_HRD[layer].picDurationInTcMinus1 = value; } |
---|
| 511 | UInt getPicDurationInTcMinus1 ( Int layer ) { return m_HRD[layer].picDurationInTcMinus1; } |
---|
| 512 | |
---|
| 513 | Void setLowDelayHrdFlag ( Int layer, Bool flag ) { m_HRD[layer].lowDelayHrdFlag = flag; } |
---|
| 514 | Bool getLowDelayHrdFlag ( Int layer ) { return m_HRD[layer].lowDelayHrdFlag; } |
---|
| 515 | |
---|
| 516 | Void setCpbCntMinus1 ( Int layer, UInt value ) { m_HRD[layer].cpbCntMinus1 = value; } |
---|
| 517 | UInt getCpbCntMinus1 ( Int layer ) { return m_HRD[layer].cpbCntMinus1; } |
---|
| 518 | |
---|
| 519 | Void setBitRateValueMinus1 ( Int layer, Int cpbcnt, Int nalOrVcl, UInt value ) { m_HRD[layer].bitRateValueMinus1[cpbcnt][nalOrVcl] = value; } |
---|
| 520 | UInt getBitRateValueMinus1 ( Int layer, Int cpbcnt, Int nalOrVcl ) { return m_HRD[layer].bitRateValueMinus1[cpbcnt][nalOrVcl]; } |
---|
| 521 | |
---|
| 522 | Void setCpbSizeValueMinus1 ( Int layer, Int cpbcnt, Int nalOrVcl, UInt value ) { m_HRD[layer].cpbSizeValue[cpbcnt][nalOrVcl] = value; } |
---|
| 523 | UInt getCpbSizeValueMinus1 ( Int layer, Int cpbcnt, Int nalOrVcl ) { return m_HRD[layer].cpbSizeValue[cpbcnt][nalOrVcl]; } |
---|
| 524 | |
---|
| 525 | Void setCbrFlag ( Int layer, Int cpbcnt, Int nalOrVcl, UInt value ) { m_HRD[layer].cbrFlag[cpbcnt][nalOrVcl] = value; } |
---|
| 526 | Bool getCbrFlag ( Int layer, Int cpbcnt, Int nalOrVcl ) { return m_HRD[layer].cbrFlag[cpbcnt][nalOrVcl]; } |
---|
| 527 | |
---|
| 528 | Void setNumDU ( UInt value ) { m_numDU = value; } |
---|
| 529 | UInt getNumDU ( ) { return m_numDU; } |
---|
| 530 | #endif |
---|
| 531 | }; |
---|
| 532 | #endif |
---|
| 533 | |
---|
| 534 | /// SPS class |
---|
| 535 | class TComSPS |
---|
| 536 | { |
---|
| 537 | private: |
---|
| 538 | Int m_SPSId; |
---|
| 539 | #if !SPS_SYNTAX_CHANGES |
---|
| 540 | Int m_ProfileSpace; |
---|
| 541 | Int m_ProfileIdc; |
---|
| 542 | Int m_ReservedIndicatorFlags; |
---|
| 543 | Int m_LevelIdc; |
---|
| 544 | UInt m_ProfileCompatibility; |
---|
| 545 | #endif |
---|
| 546 | Int m_VPSId; |
---|
| 547 | Int m_chromaFormatIdc; |
---|
| 548 | |
---|
| 549 | UInt m_uiMaxTLayers; // maximum number of temporal layers |
---|
| 550 | |
---|
| 551 | // Structure |
---|
| 552 | UInt m_picWidthInLumaSamples; |
---|
| 553 | UInt m_picHeightInLumaSamples; |
---|
| 554 | Bool m_picCroppingFlag; |
---|
| 555 | Int m_picCropLeftOffset; |
---|
| 556 | Int m_picCropRightOffset; |
---|
| 557 | Int m_picCropTopOffset; |
---|
| 558 | Int m_picCropBottomOffset; |
---|
| 559 | UInt m_uiMaxCUWidth; |
---|
| 560 | UInt m_uiMaxCUHeight; |
---|
| 561 | UInt m_uiMaxCUDepth; |
---|
| 562 | UInt m_uiMinTrDepth; |
---|
| 563 | UInt m_uiMaxTrDepth; |
---|
| 564 | TComRPSList m_RPSList; |
---|
| 565 | Bool m_bLongTermRefsPresent; |
---|
| 566 | Bool m_TMVPFlagsPresent; |
---|
| 567 | Int m_numReorderPics[MAX_TLAYER]; |
---|
| 568 | |
---|
| 569 | // Tool list |
---|
| 570 | UInt m_uiQuadtreeTULog2MaxSize; |
---|
| 571 | UInt m_uiQuadtreeTULog2MinSize; |
---|
| 572 | UInt m_uiQuadtreeTUMaxDepthInter; |
---|
| 573 | UInt m_uiQuadtreeTUMaxDepthIntra; |
---|
| 574 | Bool m_usePCM; |
---|
| 575 | UInt m_pcmLog2MaxSize; |
---|
| 576 | UInt m_uiPCMLog2MinSize; |
---|
| 577 | Bool m_useAMP; |
---|
| 578 | #if !REMOVE_ALF |
---|
| 579 | Bool m_bUseALF; |
---|
| 580 | #endif |
---|
| 581 | #if !REMOVE_LMCHROMA |
---|
| 582 | Bool m_bUseLMChroma; // JL: |
---|
| 583 | #endif |
---|
| 584 | |
---|
| 585 | #if !PPS_TS_FLAG |
---|
| 586 | Bool m_useTransformSkip; |
---|
| 587 | Bool m_useTransformSkipFast; |
---|
| 588 | #endif |
---|
| 589 | |
---|
| 590 | Bool m_bUseLComb; |
---|
| 591 | #if !REMOVE_NSQT |
---|
| 592 | Bool m_useNSQT; |
---|
| 593 | #endif |
---|
| 594 | |
---|
| 595 | Bool m_restrictedRefPicListsFlag; |
---|
| 596 | Bool m_listsModificationPresentFlag; |
---|
| 597 | |
---|
| 598 | // Parameter |
---|
| 599 | #if !SPS_AMVP_CLEANUP |
---|
| 600 | AMVP_MODE m_aeAMVPMode[MAX_CU_DEPTH]; |
---|
| 601 | #endif |
---|
| 602 | UInt m_uiBitDepth; |
---|
| 603 | UInt m_uiBitIncrement; |
---|
| 604 | Int m_qpBDOffsetY; |
---|
| 605 | Int m_qpBDOffsetC; |
---|
| 606 | |
---|
| 607 | Bool m_useLossless; |
---|
| 608 | |
---|
| 609 | UInt m_uiPCMBitDepthLuma; |
---|
| 610 | UInt m_uiPCMBitDepthChroma; |
---|
| 611 | Bool m_bPCMFilterDisableFlag; |
---|
| 612 | |
---|
| 613 | UInt m_uiBitsForPOC; |
---|
| 614 | #if LTRP_IN_SPS |
---|
| 615 | UInt m_numLongTermRefPicSPS; |
---|
| 616 | UInt m_ltRefPicPocLsbSps[33]; |
---|
| 617 | Bool m_usedByCurrPicLtSPSFlag[33]; |
---|
| 618 | #endif |
---|
| 619 | // Max physical transform size |
---|
| 620 | UInt m_uiMaxTrSize; |
---|
| 621 | |
---|
| 622 | Int m_iAMPAcc[MAX_CU_DEPTH]; |
---|
| 623 | #if !MOVE_LOOP_FILTER_SLICES_FLAG |
---|
| 624 | Bool m_bLFCrossSliceBoundaryFlag; |
---|
| 625 | #endif |
---|
| 626 | Bool m_bUseSAO; |
---|
| 627 | |
---|
| 628 | Bool m_bTemporalIdNestingFlag; // temporal_id_nesting_flag |
---|
| 629 | |
---|
| 630 | Bool m_scalingListEnabledFlag; |
---|
| 631 | Bool m_scalingListPresentFlag; |
---|
| 632 | TComScalingList* m_scalingList; //!< ScalingList class pointer |
---|
| 633 | UInt m_uiMaxDecPicBuffering[MAX_TLAYER]; |
---|
| 634 | UInt m_uiMaxLatencyIncrease[MAX_TLAYER]; |
---|
| 635 | |
---|
| 636 | Bool m_useDF; |
---|
| 637 | |
---|
| 638 | #if SUPPORT_FOR_VUI |
---|
| 639 | Bool m_vuiParametersPresentFlag; |
---|
| 640 | TComVUI m_vuiParameters; |
---|
| 641 | #endif |
---|
| 642 | |
---|
| 643 | static const Int m_cropUnitX[MAX_CHROMA_FORMAT_IDC+1]; |
---|
| 644 | static const Int m_cropUnitY[MAX_CHROMA_FORMAT_IDC+1]; |
---|
| 645 | #if SPS_SYNTAX_CHANGES |
---|
| 646 | TComPTL m_pcPTL; |
---|
| 647 | #endif |
---|
| 648 | #if SVC_EXTENSION |
---|
| 649 | UInt m_layerId; |
---|
| 650 | #endif |
---|
[25] | 651 | #if REF_IDX_MFM |
---|
| 652 | Bool m_bMFMEnabledFlag; |
---|
| 653 | #endif |
---|
[2] | 654 | public: |
---|
| 655 | TComSPS(); |
---|
| 656 | virtual ~TComSPS(); |
---|
| 657 | |
---|
| 658 | Int getVPSId () { return m_VPSId; } |
---|
| 659 | Void setVPSId (Int i) { m_VPSId = i; } |
---|
| 660 | Int getSPSId () { return m_SPSId; } |
---|
| 661 | Void setSPSId (Int i) { m_SPSId = i; } |
---|
| 662 | #if !SPS_SYNTAX_CHANGES |
---|
| 663 | Int getProfileSpace () { return m_ProfileSpace; } |
---|
| 664 | Void setProfileSpace (Int i) { m_ProfileSpace = i; } |
---|
| 665 | Int getProfileIdc () { return m_ProfileIdc; } |
---|
| 666 | Void setProfileIdc (Int i) { m_ProfileIdc = i; if (m_ProfileSpace == 0) m_ProfileCompatibility |= (1 << (i - 1)); } |
---|
| 667 | Int getRsvdIndFlags () { return m_ReservedIndicatorFlags; } |
---|
| 668 | Void setRsvdIndFlags (Int i) { m_ReservedIndicatorFlags = i; } |
---|
| 669 | Int getLevelIdc () { return m_LevelIdc; } |
---|
| 670 | Void setLevelIdc (Int i) { m_LevelIdc = i; } |
---|
| 671 | UInt getProfileCompat () { return m_ProfileCompatibility; } |
---|
| 672 | Void setProfileCompat (UInt i) { m_ProfileCompatibility = i; if (m_ProfileIdc != 0 && m_ProfileSpace == 0) m_ProfileCompatibility |= (1 << (m_ProfileIdc - 1)); } |
---|
| 673 | #endif |
---|
| 674 | Int getChromaFormatIdc () { return m_chromaFormatIdc; } |
---|
| 675 | Void setChromaFormatIdc (Int i) { m_chromaFormatIdc = i; } |
---|
| 676 | |
---|
| 677 | static Int getCropUnitX (Int chromaFormatIdc) { assert (chromaFormatIdc > 0 && chromaFormatIdc <= MAX_CHROMA_FORMAT_IDC); return m_cropUnitX[chromaFormatIdc]; } |
---|
| 678 | static Int getCropUnitY (Int chromaFormatIdc) { assert (chromaFormatIdc > 0 && chromaFormatIdc <= MAX_CHROMA_FORMAT_IDC); return m_cropUnitY[chromaFormatIdc]; } |
---|
| 679 | |
---|
| 680 | // structure |
---|
| 681 | Void setPicWidthInLumaSamples ( UInt u ) { m_picWidthInLumaSamples = u; } |
---|
| 682 | UInt getPicWidthInLumaSamples () { return m_picWidthInLumaSamples; } |
---|
| 683 | Void setPicHeightInLumaSamples ( UInt u ) { m_picHeightInLumaSamples = u; } |
---|
| 684 | UInt getPicHeightInLumaSamples () { return m_picHeightInLumaSamples; } |
---|
| 685 | |
---|
| 686 | Bool getPicCroppingFlag() const { return m_picCroppingFlag; } |
---|
| 687 | Void setPicCroppingFlag(Bool val) { m_picCroppingFlag = val; } |
---|
| 688 | Int getPicCropLeftOffset() const { return m_picCropLeftOffset; } |
---|
| 689 | Void setPicCropLeftOffset(Int val) { m_picCropLeftOffset = val; } |
---|
| 690 | Int getPicCropRightOffset() const { return m_picCropRightOffset; } |
---|
| 691 | Void setPicCropRightOffset(Int val) { m_picCropRightOffset = val; } |
---|
| 692 | Int getPicCropTopOffset() const { return m_picCropTopOffset; } |
---|
| 693 | Void setPicCropTopOffset(Int val) { m_picCropTopOffset = val; } |
---|
| 694 | Int getPicCropBottomOffset() const { return m_picCropBottomOffset; } |
---|
| 695 | Void setPicCropBottomOffset(Int val) { m_picCropBottomOffset = val; } |
---|
| 696 | #if LTRP_IN_SPS |
---|
| 697 | UInt getNumLongTermRefPicSPS() { return m_numLongTermRefPicSPS; } |
---|
| 698 | Void setNumLongTermRefPicSPS(UInt val) { m_numLongTermRefPicSPS = val; } |
---|
| 699 | |
---|
| 700 | UInt getLtRefPicPocLsbSps(UInt index) { return m_ltRefPicPocLsbSps[index]; } |
---|
| 701 | Void setLtRefPicPocLsbSps(UInt index, UInt val) { m_ltRefPicPocLsbSps[index] = val; } |
---|
| 702 | |
---|
| 703 | Bool getUsedByCurrPicLtSPSFlag(Int i) {return m_usedByCurrPicLtSPSFlag[i];} |
---|
| 704 | Void setUsedByCurrPicLtSPSFlag(Int i, Bool x) { m_usedByCurrPicLtSPSFlag[i] = x;} |
---|
| 705 | #endif |
---|
| 706 | Void setMaxCUWidth ( UInt u ) { m_uiMaxCUWidth = u; } |
---|
| 707 | UInt getMaxCUWidth () { return m_uiMaxCUWidth; } |
---|
| 708 | Void setMaxCUHeight ( UInt u ) { m_uiMaxCUHeight = u; } |
---|
| 709 | UInt getMaxCUHeight () { return m_uiMaxCUHeight; } |
---|
| 710 | Void setMaxCUDepth ( UInt u ) { m_uiMaxCUDepth = u; } |
---|
| 711 | UInt getMaxCUDepth () { return m_uiMaxCUDepth; } |
---|
| 712 | Void setUsePCM ( Bool b ) { m_usePCM = b; } |
---|
| 713 | Bool getUsePCM () { return m_usePCM; } |
---|
| 714 | Void setPCMLog2MaxSize ( UInt u ) { m_pcmLog2MaxSize = u; } |
---|
| 715 | UInt getPCMLog2MaxSize () { return m_pcmLog2MaxSize; } |
---|
| 716 | Void setPCMLog2MinSize ( UInt u ) { m_uiPCMLog2MinSize = u; } |
---|
| 717 | UInt getPCMLog2MinSize () { return m_uiPCMLog2MinSize; } |
---|
| 718 | Void setBitsForPOC ( UInt u ) { m_uiBitsForPOC = u; } |
---|
| 719 | UInt getBitsForPOC () { return m_uiBitsForPOC; } |
---|
| 720 | Bool getUseAMP() { return m_useAMP; } |
---|
| 721 | Void setUseAMP( Bool b ) { m_useAMP = b; } |
---|
| 722 | Void setMinTrDepth ( UInt u ) { m_uiMinTrDepth = u; } |
---|
| 723 | UInt getMinTrDepth () { return m_uiMinTrDepth; } |
---|
| 724 | Void setMaxTrDepth ( UInt u ) { m_uiMaxTrDepth = u; } |
---|
| 725 | UInt getMaxTrDepth () { return m_uiMaxTrDepth; } |
---|
| 726 | Void setQuadtreeTULog2MaxSize( UInt u ) { m_uiQuadtreeTULog2MaxSize = u; } |
---|
| 727 | UInt getQuadtreeTULog2MaxSize() { return m_uiQuadtreeTULog2MaxSize; } |
---|
| 728 | Void setQuadtreeTULog2MinSize( UInt u ) { m_uiQuadtreeTULog2MinSize = u; } |
---|
| 729 | UInt getQuadtreeTULog2MinSize() { return m_uiQuadtreeTULog2MinSize; } |
---|
| 730 | Void setQuadtreeTUMaxDepthInter( UInt u ) { m_uiQuadtreeTUMaxDepthInter = u; } |
---|
| 731 | Void setQuadtreeTUMaxDepthIntra( UInt u ) { m_uiQuadtreeTUMaxDepthIntra = u; } |
---|
| 732 | UInt getQuadtreeTUMaxDepthInter() { return m_uiQuadtreeTUMaxDepthInter; } |
---|
| 733 | UInt getQuadtreeTUMaxDepthIntra() { return m_uiQuadtreeTUMaxDepthIntra; } |
---|
| 734 | Void setNumReorderPics(Int i, UInt tlayer) { m_numReorderPics[tlayer] = i; } |
---|
| 735 | Int getNumReorderPics(UInt tlayer) { return m_numReorderPics[tlayer]; } |
---|
| 736 | Void createRPSList( Int numRPS ); |
---|
| 737 | TComRPSList* getRPSList() { return &m_RPSList; } |
---|
| 738 | Bool getLongTermRefsPresent() { return m_bLongTermRefsPresent; } |
---|
| 739 | Void setLongTermRefsPresent(Bool b) { m_bLongTermRefsPresent=b; } |
---|
| 740 | Bool getTMVPFlagsPresent() { return m_TMVPFlagsPresent; } |
---|
| 741 | Void setTMVPFlagsPresent(Bool b) { m_TMVPFlagsPresent=b; } |
---|
| 742 | // physical transform |
---|
| 743 | Void setMaxTrSize ( UInt u ) { m_uiMaxTrSize = u; } |
---|
| 744 | UInt getMaxTrSize () { return m_uiMaxTrSize; } |
---|
| 745 | |
---|
| 746 | // Tool list |
---|
| 747 | #if !REMOVE_ALF |
---|
| 748 | Bool getUseALF () { return m_bUseALF; } |
---|
| 749 | Void setUseALF ( Bool b ) { m_bUseALF = b; } |
---|
| 750 | #endif |
---|
| 751 | Void setUseLComb (Bool b) { m_bUseLComb = b; } |
---|
| 752 | Bool getUseLComb () { return m_bUseLComb; } |
---|
| 753 | #if !REMOVE_LMCHROMA |
---|
| 754 | Bool getUseLMChroma () { return m_bUseLMChroma; } |
---|
| 755 | Void setUseLMChroma ( Bool b ) { m_bUseLMChroma = b; } |
---|
| 756 | #endif |
---|
| 757 | |
---|
| 758 | #if !PPS_TS_FLAG |
---|
| 759 | Bool getUseTransformSkip () { return m_useTransformSkip; } |
---|
| 760 | Void setUseTransformSkip ( Bool b ) { m_useTransformSkip = b; } |
---|
| 761 | Bool getUseTransformSkipFast () { return m_useTransformSkipFast; } |
---|
| 762 | Void setUseTransformSkipFast ( Bool b ) { m_useTransformSkipFast = b; } |
---|
| 763 | #endif |
---|
| 764 | |
---|
| 765 | Bool getUseLossless () { return m_useLossless; } |
---|
| 766 | Void setUseLossless ( Bool b ) { m_useLossless = b; } |
---|
| 767 | #if !REMOVE_NSQT |
---|
| 768 | Bool getUseNSQT() { return m_useNSQT; } |
---|
| 769 | Void setUseNSQT( Bool b ) { m_useNSQT = b; } |
---|
| 770 | #endif |
---|
| 771 | |
---|
| 772 | Bool getRestrictedRefPicListsFlag () { return m_restrictedRefPicListsFlag; } |
---|
| 773 | Void setRestrictedRefPicListsFlag ( Bool b ) { m_restrictedRefPicListsFlag = b; } |
---|
| 774 | Bool getListsModificationPresentFlag () { return m_listsModificationPresentFlag; } |
---|
| 775 | Void setListsModificationPresentFlag ( Bool b ) { m_listsModificationPresentFlag = b; } |
---|
| 776 | |
---|
| 777 | #if !SPS_AMVP_CLEANUP |
---|
| 778 | // AMVP mode (for each depth) |
---|
| 779 | AMVP_MODE getAMVPMode ( UInt uiDepth ) { assert(uiDepth < g_uiMaxCUDepth); return m_aeAMVPMode[uiDepth]; } |
---|
| 780 | Void setAMVPMode ( UInt uiDepth, AMVP_MODE eMode) { assert(uiDepth < g_uiMaxCUDepth); m_aeAMVPMode[uiDepth] = eMode; } |
---|
| 781 | #endif |
---|
| 782 | |
---|
| 783 | // AMP accuracy |
---|
| 784 | Int getAMPAcc ( UInt uiDepth ) { return m_iAMPAcc[uiDepth]; } |
---|
| 785 | Void setAMPAcc ( UInt uiDepth, Int iAccu ) { assert( uiDepth < g_uiMaxCUDepth); m_iAMPAcc[uiDepth] = iAccu; } |
---|
| 786 | |
---|
| 787 | // Bit-depth |
---|
| 788 | UInt getBitDepth () { return m_uiBitDepth; } |
---|
| 789 | Void setBitDepth ( UInt u ) { m_uiBitDepth = u; } |
---|
| 790 | UInt getBitIncrement () { return m_uiBitIncrement; } |
---|
| 791 | Void setBitIncrement ( UInt u ) { m_uiBitIncrement = u; } |
---|
| 792 | Int getQpBDOffsetY () { return m_qpBDOffsetY; } |
---|
| 793 | Void setQpBDOffsetY ( Int value ) { m_qpBDOffsetY = value; } |
---|
| 794 | Int getQpBDOffsetC () { return m_qpBDOffsetC; } |
---|
| 795 | Void setQpBDOffsetC ( Int value ) { m_qpBDOffsetC = value; } |
---|
| 796 | #if !MOVE_LOOP_FILTER_SLICES_FLAG |
---|
| 797 | Void setLFCrossSliceBoundaryFlag ( Bool bValue ) { m_bLFCrossSliceBoundaryFlag = bValue; } |
---|
| 798 | Bool getLFCrossSliceBoundaryFlag () { return m_bLFCrossSliceBoundaryFlag; } |
---|
| 799 | #endif |
---|
| 800 | Void setUseSAO (Bool bVal) {m_bUseSAO = bVal;} |
---|
| 801 | Bool getUseSAO () {return m_bUseSAO;} |
---|
| 802 | |
---|
| 803 | UInt getMaxTLayers() { return m_uiMaxTLayers; } |
---|
| 804 | Void setMaxTLayers( UInt uiMaxTLayers ) { assert( uiMaxTLayers <= MAX_TLAYER ); m_uiMaxTLayers = uiMaxTLayers; } |
---|
| 805 | |
---|
| 806 | Bool getTemporalIdNestingFlag() { return m_bTemporalIdNestingFlag; } |
---|
| 807 | Void setTemporalIdNestingFlag( Bool bValue ) { m_bTemporalIdNestingFlag = bValue; } |
---|
| 808 | UInt getPCMBitDepthLuma () { return m_uiPCMBitDepthLuma; } |
---|
| 809 | Void setPCMBitDepthLuma ( UInt u ) { m_uiPCMBitDepthLuma = u; } |
---|
| 810 | UInt getPCMBitDepthChroma () { return m_uiPCMBitDepthChroma; } |
---|
| 811 | Void setPCMBitDepthChroma ( UInt u ) { m_uiPCMBitDepthChroma = u; } |
---|
| 812 | Void setPCMFilterDisableFlag ( Bool bValue ) { m_bPCMFilterDisableFlag = bValue; } |
---|
| 813 | Bool getPCMFilterDisableFlag () { return m_bPCMFilterDisableFlag; } |
---|
| 814 | |
---|
| 815 | Bool getScalingListFlag () { return m_scalingListEnabledFlag; } |
---|
| 816 | Void setScalingListFlag ( Bool b ) { m_scalingListEnabledFlag = b; } |
---|
| 817 | Bool getScalingListPresentFlag() { return m_scalingListPresentFlag; } |
---|
| 818 | Void setScalingListPresentFlag( Bool b ) { m_scalingListPresentFlag = b; } |
---|
| 819 | Void setScalingList ( TComScalingList *scalingList); |
---|
| 820 | TComScalingList* getScalingList () { return m_scalingList; } //!< get ScalingList class pointer in SPS |
---|
| 821 | UInt getMaxDecPicBuffering (UInt tlayer) { return m_uiMaxDecPicBuffering[tlayer]; } |
---|
| 822 | Void setMaxDecPicBuffering ( UInt ui, UInt tlayer ) { m_uiMaxDecPicBuffering[tlayer] = ui; } |
---|
| 823 | UInt getMaxLatencyIncrease (UInt tlayer) { return m_uiMaxLatencyIncrease[tlayer]; } |
---|
| 824 | Void setMaxLatencyIncrease ( UInt ui , UInt tlayer) { m_uiMaxLatencyIncrease[tlayer] = ui; } |
---|
| 825 | |
---|
| 826 | #if SUPPORT_FOR_VUI |
---|
| 827 | Bool getVuiParametersPresentFlag() { return m_vuiParametersPresentFlag; } |
---|
| 828 | Void setVuiParametersPresentFlag(Bool b) { m_vuiParametersPresentFlag = b; } |
---|
| 829 | TComVUI* getVuiParameters() { return &m_vuiParameters; } |
---|
| 830 | #if BUFFERING_PERIOD_AND_TIMING_SEI |
---|
| 831 | Void setHrdParameters( UInt frameRate, UInt numDU, UInt bitRate, Bool randomAccess ); |
---|
| 832 | #endif |
---|
| 833 | #endif |
---|
| 834 | |
---|
| 835 | #if SPS_SYNTAX_CHANGES |
---|
| 836 | TComPTL* getPTL() { return &m_pcPTL; } |
---|
| 837 | #endif |
---|
| 838 | #if SVC_EXTENSION |
---|
| 839 | Void setLayerId(UInt layerId) { m_layerId = layerId; } |
---|
| 840 | UInt getLayerId() { return m_layerId; } |
---|
| 841 | #endif |
---|
[25] | 842 | #if REF_IDX_MFM |
---|
| 843 | Void setMFMEnabledFlag(Bool flag) {m_bMFMEnabledFlag = flag;} |
---|
| 844 | Bool getMFMEnabledFlag() {return m_bMFMEnabledFlag;} |
---|
| 845 | #endif |
---|
[2] | 846 | }; |
---|
| 847 | |
---|
| 848 | /// Reference Picture Lists class |
---|
| 849 | class TComRefPicListModification |
---|
| 850 | { |
---|
| 851 | private: |
---|
| 852 | UInt m_bRefPicListModificationFlagL0; |
---|
| 853 | UInt m_bRefPicListModificationFlagL1; |
---|
| 854 | UInt m_RefPicSetIdxL0[32]; |
---|
| 855 | UInt m_RefPicSetIdxL1[32]; |
---|
| 856 | |
---|
| 857 | public: |
---|
| 858 | TComRefPicListModification(); |
---|
| 859 | virtual ~TComRefPicListModification(); |
---|
| 860 | |
---|
| 861 | Void create (); |
---|
| 862 | Void destroy (); |
---|
| 863 | |
---|
| 864 | Bool getRefPicListModificationFlagL0() { return m_bRefPicListModificationFlagL0; } |
---|
| 865 | Void setRefPicListModificationFlagL0(Bool flag) { m_bRefPicListModificationFlagL0 = flag; } |
---|
| 866 | Bool getRefPicListModificationFlagL1() { return m_bRefPicListModificationFlagL1; } |
---|
| 867 | Void setRefPicListModificationFlagL1(Bool flag) { m_bRefPicListModificationFlagL1 = flag; } |
---|
| 868 | Void setRefPicSetIdxL0(UInt idx, UInt refPicSetIdx) { m_RefPicSetIdxL0[idx] = refPicSetIdx; } |
---|
| 869 | UInt getRefPicSetIdxL0(UInt idx) { return m_RefPicSetIdxL0[idx]; } |
---|
| 870 | Void setRefPicSetIdxL1(UInt idx, UInt refPicSetIdx) { m_RefPicSetIdxL1[idx] = refPicSetIdx; } |
---|
| 871 | UInt getRefPicSetIdxL1(UInt idx) { return m_RefPicSetIdxL1[idx]; } |
---|
| 872 | }; |
---|
| 873 | |
---|
| 874 | /// PPS class |
---|
| 875 | class TComPPS |
---|
| 876 | { |
---|
| 877 | private: |
---|
| 878 | Int m_PPSId; // pic_parameter_set_id |
---|
| 879 | Int m_SPSId; // seq_parameter_set_id |
---|
| 880 | Int m_picInitQPMinus26; |
---|
| 881 | Bool m_useDQP; |
---|
| 882 | Bool m_bConstrainedIntraPred; // constrained_intra_pred_flag |
---|
| 883 | #if CHROMA_QP_EXTENSION |
---|
| 884 | Bool m_bSliceChromaQpFlag; // slicelevel_chroma_qp_flag |
---|
| 885 | #endif |
---|
| 886 | |
---|
| 887 | // access channel |
---|
| 888 | TComSPS* m_pcSPS; |
---|
| 889 | UInt m_uiMaxCuDQPDepth; |
---|
| 890 | UInt m_uiMinCuDQPSize; |
---|
| 891 | |
---|
| 892 | Int m_chromaCbQpOffset; |
---|
| 893 | Int m_chromaCrQpOffset; |
---|
| 894 | |
---|
| 895 | UInt m_numRefIdxL0DefaultActive; |
---|
| 896 | UInt m_numRefIdxL1DefaultActive; |
---|
| 897 | |
---|
| 898 | #if !REMOVE_FGS |
---|
| 899 | Int m_iSliceGranularity; |
---|
| 900 | #endif |
---|
| 901 | |
---|
| 902 | Bool m_bUseWeightPred; // Use of Weighting Prediction (P_SLICE) |
---|
| 903 | Bool m_useWeightedBiPred; // Use of Weighting Bi-Prediction (B_SLICE) |
---|
| 904 | Bool m_OutputFlagPresentFlag; // Indicates the presence of output_flag in slice header |
---|
| 905 | |
---|
| 906 | Bool m_TransquantBypassEnableFlag; // Indicates presence of cu_transquant_bypass_flag in CUs. |
---|
| 907 | #if PPS_TS_FLAG |
---|
| 908 | Bool m_useTransformSkip; |
---|
| 909 | #endif |
---|
| 910 | #if !TILES_WPP_ENTROPYSLICES_FLAGS |
---|
| 911 | #if DEPENDENT_SLICES |
---|
| 912 | Bool m_bDependentSliceEnabledFlag; // Indicates the presence of dependent_slices_flag in slice header |
---|
| 913 | Bool m_bCabacIndependentFlag; // Indicates the presence of dependent_slices_flag in slice header |
---|
| 914 | #endif |
---|
| 915 | UInt m_tilesOrEntropyCodingSyncIdc; |
---|
| 916 | #else |
---|
| 917 | Bool m_dependentSliceEnabledFlag; //!< Indicates the presence of dependent slices |
---|
| 918 | Bool m_tilesEnabledFlag; //!< Indicates the presence of tiles |
---|
| 919 | Bool m_entropyCodingSyncEnabledFlag; //!< Indicates the presence of wavefronts |
---|
| 920 | Bool m_entropySliceEnabledFlag; //!< Indicates the presence of entropy slices |
---|
| 921 | #endif |
---|
| 922 | |
---|
| 923 | Bool m_loopFilterAcrossTilesEnabledFlag; |
---|
| 924 | Int m_uniformSpacingFlag; |
---|
| 925 | Int m_iNumColumnsMinus1; |
---|
| 926 | UInt* m_puiColumnWidth; |
---|
| 927 | Int m_iNumRowsMinus1; |
---|
| 928 | UInt* m_puiRowHeight; |
---|
| 929 | |
---|
| 930 | Int m_iNumSubstreams; |
---|
| 931 | |
---|
| 932 | Int m_signHideFlag; |
---|
| 933 | |
---|
| 934 | Bool m_cabacInitPresentFlag; |
---|
| 935 | UInt m_encCABACTableIdx; // Used to transmit table selection across slices |
---|
| 936 | |
---|
| 937 | #if SLICE_HEADER_EXTENSION |
---|
| 938 | Bool m_sliceHeaderExtensionPresentFlag; |
---|
| 939 | #endif |
---|
| 940 | #if MOVE_LOOP_FILTER_SLICES_FLAG |
---|
| 941 | Bool m_loopFilterAcrossSlicesEnabledFlag; |
---|
| 942 | #endif |
---|
| 943 | Bool m_deblockingFilterControlPresentFlag; |
---|
| 944 | Bool m_deblockingFilterOverrideEnabledFlag; |
---|
| 945 | Bool m_picDisableDeblockingFilterFlag; |
---|
| 946 | Int m_deblockingFilterBetaOffsetDiv2; //< beta offset for deblocking filter |
---|
| 947 | Int m_deblockingFilterTcOffsetDiv2; //< tc offset for deblocking filter |
---|
| 948 | Bool m_scalingListPresentFlag; |
---|
| 949 | TComScalingList* m_scalingList; //!< ScalingList class pointer |
---|
| 950 | UInt m_log2ParallelMergeLevelMinus2; |
---|
| 951 | public: |
---|
| 952 | TComPPS(); |
---|
| 953 | virtual ~TComPPS(); |
---|
| 954 | |
---|
| 955 | Int getPPSId () { return m_PPSId; } |
---|
| 956 | Void setPPSId (Int i) { m_PPSId = i; } |
---|
| 957 | Int getSPSId () { return m_SPSId; } |
---|
| 958 | Void setSPSId (Int i) { m_SPSId = i; } |
---|
| 959 | |
---|
| 960 | #if !REMOVE_FGS |
---|
| 961 | Int getSliceGranularity() { return m_iSliceGranularity; } |
---|
| 962 | Void setSliceGranularity( Int i ) { m_iSliceGranularity = i; } |
---|
| 963 | #endif |
---|
| 964 | Int getPicInitQPMinus26 () { return m_picInitQPMinus26; } |
---|
| 965 | Void setPicInitQPMinus26 ( Int i ) { m_picInitQPMinus26 = i; } |
---|
| 966 | Bool getUseDQP () { return m_useDQP; } |
---|
| 967 | Void setUseDQP ( Bool b ) { m_useDQP = b; } |
---|
| 968 | Bool getConstrainedIntraPred () { return m_bConstrainedIntraPred; } |
---|
| 969 | Void setConstrainedIntraPred ( Bool b ) { m_bConstrainedIntraPred = b; } |
---|
| 970 | #if CHROMA_QP_EXTENSION |
---|
| 971 | Bool getSliceChromaQpFlag () { return m_bSliceChromaQpFlag; } |
---|
| 972 | Void setSliceChromaQpFlag ( Bool b ) { m_bSliceChromaQpFlag = b; } |
---|
| 973 | #endif |
---|
| 974 | |
---|
| 975 | Void setSPS ( TComSPS* pcSPS ) { m_pcSPS = pcSPS; } |
---|
| 976 | TComSPS* getSPS () { return m_pcSPS; } |
---|
| 977 | Void setMaxCuDQPDepth ( UInt u ) { m_uiMaxCuDQPDepth = u; } |
---|
| 978 | UInt getMaxCuDQPDepth () { return m_uiMaxCuDQPDepth;} |
---|
| 979 | Void setMinCuDQPSize ( UInt u ) { m_uiMinCuDQPSize = u; } |
---|
| 980 | UInt getMinCuDQPSize () { return m_uiMinCuDQPSize; } |
---|
| 981 | |
---|
| 982 | Void setChromaCbQpOffset( Int i ) { m_chromaCbQpOffset = i; } |
---|
| 983 | Int getChromaCbQpOffset() { return m_chromaCbQpOffset; } |
---|
| 984 | Void setChromaCrQpOffset( Int i ) { m_chromaCrQpOffset = i; } |
---|
| 985 | Int getChromaCrQpOffset() { return m_chromaCrQpOffset; } |
---|
| 986 | |
---|
| 987 | Void setNumRefIdxL0DefaultActive(UInt ui) { m_numRefIdxL0DefaultActive=ui; } |
---|
| 988 | UInt getNumRefIdxL0DefaultActive() { return m_numRefIdxL0DefaultActive; } |
---|
| 989 | Void setNumRefIdxL1DefaultActive(UInt ui) { m_numRefIdxL1DefaultActive=ui; } |
---|
| 990 | UInt getNumRefIdxL1DefaultActive() { return m_numRefIdxL1DefaultActive; } |
---|
| 991 | |
---|
| 992 | Bool getUseWP () { return m_bUseWeightPred; } |
---|
| 993 | Bool getWPBiPred () { return m_useWeightedBiPred; } |
---|
| 994 | Void setUseWP ( Bool b ) { m_bUseWeightPred = b; } |
---|
| 995 | Void setWPBiPred ( Bool b ) { m_useWeightedBiPred = b; } |
---|
| 996 | Void setOutputFlagPresentFlag( Bool b ) { m_OutputFlagPresentFlag = b; } |
---|
| 997 | Bool getOutputFlagPresentFlag() { return m_OutputFlagPresentFlag; } |
---|
| 998 | #if !TILES_WPP_ENTROPYSLICES_FLAGS |
---|
| 999 | #if DEPENDENT_SLICES |
---|
| 1000 | Void setDependentSliceEnabledFlag( Bool b ) { m_bDependentSliceEnabledFlag = b; } |
---|
| 1001 | Bool getDependentSliceEnabledFlag() { return m_bDependentSliceEnabledFlag; } |
---|
| 1002 | Void setCabacIndependentFlag( Bool b ) { m_bCabacIndependentFlag = b; } |
---|
| 1003 | Bool getCabacIndependentFlag() { return m_bCabacIndependentFlag; } |
---|
| 1004 | #endif |
---|
| 1005 | #endif |
---|
| 1006 | Void setTransquantBypassEnableFlag( Bool b ) { m_TransquantBypassEnableFlag = b; } |
---|
| 1007 | Bool getTransquantBypassEnableFlag() { return m_TransquantBypassEnableFlag; } |
---|
| 1008 | |
---|
| 1009 | #if PPS_TS_FLAG |
---|
| 1010 | Bool getUseTransformSkip () { return m_useTransformSkip; } |
---|
| 1011 | Void setUseTransformSkip ( Bool b ) { m_useTransformSkip = b; } |
---|
| 1012 | #endif |
---|
| 1013 | |
---|
| 1014 | Void setLoopFilterAcrossTilesEnabledFlag (Bool b) { m_loopFilterAcrossTilesEnabledFlag = b; } |
---|
| 1015 | Bool getLoopFilterAcrossTilesEnabledFlag () { return m_loopFilterAcrossTilesEnabledFlag; } |
---|
| 1016 | #if TILES_WPP_ENTROPYSLICES_FLAGS |
---|
| 1017 | Bool getDependentSliceEnabledFlag() const { return m_dependentSliceEnabledFlag; } |
---|
| 1018 | Void setDependentSliceEnabledFlag(Bool val) { m_dependentSliceEnabledFlag = val; } |
---|
| 1019 | Bool getTilesEnabledFlag() const { return m_tilesEnabledFlag; } |
---|
| 1020 | Void setTilesEnabledFlag(Bool val) { m_tilesEnabledFlag = val; } |
---|
| 1021 | Bool getEntropyCodingSyncEnabledFlag() const { return m_entropyCodingSyncEnabledFlag; } |
---|
| 1022 | Void setEntropyCodingSyncEnabledFlag(Bool val) { m_entropyCodingSyncEnabledFlag = val; } |
---|
| 1023 | Bool getEntropySliceEnabledFlag() const { return m_entropySliceEnabledFlag; } |
---|
| 1024 | Void setEntropySliceEnabledFlag(Bool val) { m_entropySliceEnabledFlag = val; } |
---|
| 1025 | #else |
---|
| 1026 | UInt getTilesOrEntropyCodingSyncIdc () { return m_tilesOrEntropyCodingSyncIdc; } |
---|
| 1027 | Void setTilesOrEntropyCodingSyncIdc ( UInt val ) { m_tilesOrEntropyCodingSyncIdc = val; } |
---|
| 1028 | #endif |
---|
| 1029 | Void setUniformSpacingFlag ( Bool b ) { m_uniformSpacingFlag = b; } |
---|
| 1030 | Bool getUniformSpacingFlag () { return m_uniformSpacingFlag; } |
---|
| 1031 | Void setNumColumnsMinus1 ( Int i ) { m_iNumColumnsMinus1 = i; } |
---|
| 1032 | Int getNumColumnsMinus1 () { return m_iNumColumnsMinus1; } |
---|
| 1033 | Void setColumnWidth ( UInt* columnWidth ) |
---|
| 1034 | { |
---|
| 1035 | if( m_uniformSpacingFlag == 0 && m_iNumColumnsMinus1 > 0 ) |
---|
| 1036 | { |
---|
| 1037 | m_puiColumnWidth = new UInt[ m_iNumColumnsMinus1 ]; |
---|
| 1038 | |
---|
| 1039 | for(Int i=0; i<m_iNumColumnsMinus1; i++) |
---|
| 1040 | { |
---|
| 1041 | m_puiColumnWidth[i] = columnWidth[i]; |
---|
| 1042 | } |
---|
| 1043 | } |
---|
| 1044 | } |
---|
| 1045 | UInt getColumnWidth (UInt columnIdx) { return *( m_puiColumnWidth + columnIdx ); } |
---|
| 1046 | Void setNumRowsMinus1( Int i ) { m_iNumRowsMinus1 = i; } |
---|
| 1047 | Int getNumRowsMinus1() { return m_iNumRowsMinus1; } |
---|
| 1048 | Void setRowHeight ( UInt* rowHeight ) |
---|
| 1049 | { |
---|
| 1050 | if( m_uniformSpacingFlag == 0 && m_iNumRowsMinus1 > 0 ) |
---|
| 1051 | { |
---|
| 1052 | m_puiRowHeight = new UInt[ m_iNumRowsMinus1 ]; |
---|
| 1053 | |
---|
| 1054 | for(Int i=0; i<m_iNumRowsMinus1; i++) |
---|
| 1055 | { |
---|
| 1056 | m_puiRowHeight[i] = rowHeight[i]; |
---|
| 1057 | } |
---|
| 1058 | } |
---|
| 1059 | } |
---|
| 1060 | UInt getRowHeight (UInt rowIdx) { return *( m_puiRowHeight + rowIdx ); } |
---|
| 1061 | Void setNumSubstreams(Int iNumSubstreams) { m_iNumSubstreams = iNumSubstreams; } |
---|
| 1062 | Int getNumSubstreams() { return m_iNumSubstreams; } |
---|
| 1063 | |
---|
| 1064 | Void setSignHideFlag( Int signHideFlag ) { m_signHideFlag = signHideFlag; } |
---|
| 1065 | Int getSignHideFlag() { return m_signHideFlag; } |
---|
| 1066 | |
---|
| 1067 | Void setCabacInitPresentFlag( Bool flag ) { m_cabacInitPresentFlag = flag; } |
---|
| 1068 | Void setEncCABACTableIdx( Int idx ) { m_encCABACTableIdx = idx; } |
---|
| 1069 | Bool getCabacInitPresentFlag() { return m_cabacInitPresentFlag; } |
---|
| 1070 | UInt getEncCABACTableIdx() { return m_encCABACTableIdx; } |
---|
| 1071 | Void setDeblockingFilterControlPresentFlag( Bool val ) { m_deblockingFilterControlPresentFlag = val; } |
---|
| 1072 | Bool getDeblockingFilterControlPresentFlag() { return m_deblockingFilterControlPresentFlag; } |
---|
| 1073 | Void setDeblockingFilterOverrideEnabledFlag( Bool val ) { m_deblockingFilterOverrideEnabledFlag = val; } |
---|
| 1074 | Bool getDeblockingFilterOverrideEnabledFlag() { return m_deblockingFilterOverrideEnabledFlag; } |
---|
| 1075 | Void setPicDisableDeblockingFilterFlag(Bool val) { m_picDisableDeblockingFilterFlag = val; } //!< set offset for deblocking filter disabled |
---|
| 1076 | Bool getPicDisableDeblockingFilterFlag() { return m_picDisableDeblockingFilterFlag; } //!< get offset for deblocking filter disabled |
---|
| 1077 | Void setDeblockingFilterBetaOffsetDiv2(Int val) { m_deblockingFilterBetaOffsetDiv2 = val; } //!< set beta offset for deblocking filter |
---|
| 1078 | Int getDeblockingFilterBetaOffsetDiv2() { return m_deblockingFilterBetaOffsetDiv2; } //!< get beta offset for deblocking filter |
---|
| 1079 | Void setDeblockingFilterTcOffsetDiv2(Int val) { m_deblockingFilterTcOffsetDiv2 = val; } //!< set tc offset for deblocking filter |
---|
| 1080 | Int getDeblockingFilterTcOffsetDiv2() { return m_deblockingFilterTcOffsetDiv2; } //!< get tc offset for deblocking filter |
---|
| 1081 | Bool getScalingListPresentFlag() { return m_scalingListPresentFlag; } |
---|
| 1082 | Void setScalingListPresentFlag( Bool b ) { m_scalingListPresentFlag = b; } |
---|
| 1083 | Void setScalingList ( TComScalingList *scalingList); |
---|
| 1084 | TComScalingList* getScalingList () { return m_scalingList; } //!< get ScalingList class pointer in PPS |
---|
| 1085 | UInt getLog2ParallelMergeLevelMinus2 () { return m_log2ParallelMergeLevelMinus2; } |
---|
| 1086 | Void setLog2ParallelMergeLevelMinus2 (UInt mrgLevel) { m_log2ParallelMergeLevelMinus2 = mrgLevel; } |
---|
| 1087 | #if MOVE_LOOP_FILTER_SLICES_FLAG |
---|
| 1088 | Void setLoopFilterAcrossSlicesEnabledFlag ( Bool bValue ) { m_loopFilterAcrossSlicesEnabledFlag = bValue; } |
---|
| 1089 | Bool getLoopFilterAcrossSlicesEnabledFlag () { return m_loopFilterAcrossSlicesEnabledFlag; } |
---|
| 1090 | #endif |
---|
| 1091 | #if SLICE_HEADER_EXTENSION |
---|
| 1092 | Bool getSliceHeaderExtensionPresentFlag () { return m_sliceHeaderExtensionPresentFlag; } |
---|
| 1093 | Void setSliceHeaderExtensionPresentFlag (Bool val) { m_sliceHeaderExtensionPresentFlag = val; } |
---|
| 1094 | #endif |
---|
| 1095 | }; |
---|
| 1096 | |
---|
| 1097 | #if !REMOVE_APS |
---|
| 1098 | /// APS class |
---|
| 1099 | class TComAPS |
---|
| 1100 | { |
---|
| 1101 | public: |
---|
| 1102 | TComAPS(); |
---|
| 1103 | virtual ~TComAPS(); |
---|
| 1104 | |
---|
| 1105 | Void setAPSID (Int iID) {m_apsID = iID; } //!< set APS ID |
---|
| 1106 | Int getAPSID () {return m_apsID; } //!< get APS ID |
---|
| 1107 | #if !REMOVE_ALF |
---|
| 1108 | ALFParam** getAlfParam () { return m_alfParam;} |
---|
| 1109 | Bool getAlfEnabled(Int compIdx) { return (m_alfParam[compIdx] == NULL)?(false):(m_alfParam[compIdx]->alf_flag ==1);} |
---|
| 1110 | Void setAlfEnabled(Bool bVal, Int compIdx) { m_alfParam[compIdx]->alf_flag= (bVal?1:0); } //!< set ALF enabled/disabled in APS |
---|
| 1111 | #endif |
---|
| 1112 | SAOParam* getSaoParam () {return m_pSaoParam; } //!< get SAO parameters in APS |
---|
| 1113 | |
---|
| 1114 | Void createSaoParam(); //!< create SAO parameter object |
---|
| 1115 | Void destroySaoParam(); //!< destroy SAO parameter object |
---|
| 1116 | |
---|
| 1117 | #if !REMOVE_ALF |
---|
| 1118 | Void createAlfParam(); //!< create ALF parameter object |
---|
| 1119 | Void destroyAlfParam(); //!< destroy ALF parameter object |
---|
| 1120 | #endif |
---|
| 1121 | private: |
---|
| 1122 | Int m_apsID; //!< APS ID |
---|
| 1123 | SAOParam* m_pSaoParam; //!< SAO parameter object pointer |
---|
| 1124 | #if !REMOVE_ALF |
---|
| 1125 | ALFParam* m_alfParam[3]; |
---|
| 1126 | #endif |
---|
| 1127 | public: |
---|
| 1128 | TComAPS& operator= (const TComAPS& src); //!< "=" operator for APS object |
---|
| 1129 | }; |
---|
| 1130 | #endif |
---|
| 1131 | |
---|
| 1132 | typedef struct { |
---|
| 1133 | // Explicit weighted prediction parameters parsed in slice header, |
---|
| 1134 | // or Implicit weighted prediction parameters (8 bits depth values). |
---|
| 1135 | Bool bPresentFlag; |
---|
| 1136 | UInt uiLog2WeightDenom; |
---|
| 1137 | Int iWeight; |
---|
| 1138 | Int iOffset; |
---|
| 1139 | |
---|
| 1140 | // Weighted prediction scaling values built from above parameters (bitdepth scaled): |
---|
| 1141 | Int w, o, offset, shift, round; |
---|
| 1142 | } wpScalingParam; |
---|
| 1143 | |
---|
| 1144 | typedef struct { |
---|
| 1145 | Int64 iAC; |
---|
| 1146 | Int64 iDC; |
---|
| 1147 | } wpACDCParam; |
---|
| 1148 | |
---|
| 1149 | /// slice header class |
---|
| 1150 | class TComSlice |
---|
| 1151 | { |
---|
| 1152 | |
---|
| 1153 | private: |
---|
| 1154 | // Bitstream writing |
---|
| 1155 | #if !REMOVE_APS |
---|
| 1156 | Int m_iAPSId; //!< APS ID in slice header |
---|
| 1157 | #endif |
---|
| 1158 | #if !REMOVE_ALF |
---|
| 1159 | Bool m_alfEnabledFlag[3]; |
---|
| 1160 | #endif |
---|
| 1161 | bool m_saoEnabledFlag; |
---|
| 1162 | #if SAO_TYPE_SHARING |
---|
| 1163 | bool m_saoEnabledFlagChroma; ///< SAO Cb&Cr enabled flag |
---|
| 1164 | #else |
---|
| 1165 | bool m_saoEnabledFlagCb; ///< SAO Cb enabled flag |
---|
| 1166 | bool m_saoEnabledFlagCr; ///< SAO Cr enabled flag |
---|
| 1167 | #endif |
---|
| 1168 | Int m_iPPSId; ///< picture parameter set ID |
---|
| 1169 | Bool m_PicOutputFlag; ///< pic_output_flag |
---|
| 1170 | Int m_iPOC; |
---|
| 1171 | Int m_iLastIDR; |
---|
| 1172 | #if PREVREFPIC_DEFN |
---|
| 1173 | static Int m_prevPOC[MAX_TLAYER]; |
---|
| 1174 | #else |
---|
| 1175 | static Int m_prevPOC; |
---|
| 1176 | #endif |
---|
| 1177 | TComReferencePictureSet *m_pcRPS; |
---|
| 1178 | TComReferencePictureSet m_LocalRPS; |
---|
| 1179 | Int m_iBDidx; |
---|
| 1180 | Int m_iCombinationBDidx; |
---|
| 1181 | Bool m_bCombineWithReferenceFlag; |
---|
| 1182 | TComRefPicListModification m_RefPicListModification; |
---|
| 1183 | NalUnitType m_eNalUnitType; ///< Nal unit type for the slice |
---|
| 1184 | SliceType m_eSliceType; |
---|
| 1185 | Int m_iSliceQp; |
---|
| 1186 | #if SLICEHEADER_SYNTAX_FIX |
---|
| 1187 | Bool m_dependentSliceFlag; |
---|
| 1188 | #endif |
---|
| 1189 | #if ADAPTIVE_QP_SELECTION |
---|
| 1190 | Int m_iSliceQpBase; |
---|
| 1191 | #endif |
---|
| 1192 | Bool m_deblockingFilterDisable; |
---|
| 1193 | Bool m_deblockingFilterOverrideFlag; //< offsets for deblocking filter inherit from PPS |
---|
| 1194 | Int m_deblockingFilterBetaOffsetDiv2; //< beta offset for deblocking filter |
---|
| 1195 | Int m_deblockingFilterTcOffsetDiv2; //< tc offset for deblocking filter |
---|
| 1196 | |
---|
| 1197 | Int m_aiNumRefIdx [3]; // for multiple reference of current slice |
---|
| 1198 | |
---|
| 1199 | Int m_iRefIdxOfLC[2][MAX_NUM_REF_LC]; |
---|
| 1200 | Int m_eListIdFromIdxOfLC[MAX_NUM_REF_LC]; |
---|
| 1201 | Int m_iRefIdxFromIdxOfLC[MAX_NUM_REF_LC]; |
---|
| 1202 | Int m_iRefIdxOfL1FromRefIdxOfL0[MAX_NUM_REF_LC]; |
---|
| 1203 | Int m_iRefIdxOfL0FromRefIdxOfL1[MAX_NUM_REF_LC]; |
---|
| 1204 | Bool m_bRefPicListModificationFlagLC; |
---|
| 1205 | Bool m_bRefPicListCombinationFlag; |
---|
| 1206 | |
---|
| 1207 | Bool m_bCheckLDC; |
---|
| 1208 | |
---|
| 1209 | // Data |
---|
| 1210 | Int m_iSliceQpDelta; |
---|
| 1211 | #if CHROMA_QP_EXTENSION |
---|
| 1212 | Int m_iSliceQpDeltaCb; |
---|
| 1213 | Int m_iSliceQpDeltaCr; |
---|
| 1214 | #endif |
---|
| 1215 | TComPic* m_apcRefPicList [2][MAX_NUM_REF+1]; |
---|
| 1216 | Int m_aiRefPOCList [2][MAX_NUM_REF+1]; |
---|
| 1217 | Int m_iDepth; |
---|
| 1218 | |
---|
| 1219 | // referenced slice? |
---|
| 1220 | Bool m_bRefenced; |
---|
| 1221 | |
---|
| 1222 | // access channel |
---|
| 1223 | TComVPS* m_pcVPS; |
---|
| 1224 | TComSPS* m_pcSPS; |
---|
| 1225 | TComPPS* m_pcPPS; |
---|
| 1226 | TComPic* m_pcPic; |
---|
| 1227 | #if ADAPTIVE_QP_SELECTION |
---|
| 1228 | TComTrQuant* m_pcTrQuant; |
---|
| 1229 | #endif |
---|
| 1230 | #if !REMOVE_APS |
---|
| 1231 | TComAPS* m_pcAPS; //!< pointer to APS parameter object |
---|
| 1232 | #endif |
---|
| 1233 | UInt m_colFromL0Flag; // collocated picture from List0 flag |
---|
| 1234 | |
---|
| 1235 | UInt m_colRefIdx; |
---|
| 1236 | UInt m_maxNumMergeCand; |
---|
| 1237 | |
---|
| 1238 | |
---|
| 1239 | #if ALF_CHROMA_LAMBDA || SAO_CHROMA_LAMBDA |
---|
| 1240 | Double m_dLambdaLuma; |
---|
| 1241 | Double m_dLambdaChroma; |
---|
| 1242 | #else |
---|
| 1243 | Double m_dLambda; |
---|
| 1244 | #endif |
---|
| 1245 | |
---|
| 1246 | Bool m_abEqualRef [2][MAX_NUM_REF][MAX_NUM_REF]; |
---|
| 1247 | |
---|
| 1248 | Bool m_bNoBackPredFlag; |
---|
| 1249 | UInt m_uiTLayer; |
---|
| 1250 | #if SVC_EXTENSION |
---|
| 1251 | UInt m_layerId; |
---|
| 1252 | TComPic* m_pcBaseColPic; |
---|
| 1253 | TComPicYuv* m_pcFullPelBaseRec; |
---|
| 1254 | #endif |
---|
| 1255 | Bool m_bTLayerSwitchingFlag; |
---|
| 1256 | |
---|
| 1257 | UInt m_uiSliceMode; |
---|
| 1258 | UInt m_uiSliceArgument; |
---|
| 1259 | UInt m_uiSliceCurStartCUAddr; |
---|
| 1260 | UInt m_uiSliceCurEndCUAddr; |
---|
| 1261 | UInt m_uiSliceIdx; |
---|
| 1262 | UInt m_uiDependentSliceMode; |
---|
| 1263 | UInt m_uiDependentSliceArgument; |
---|
| 1264 | UInt m_uiDependentSliceCurStartCUAddr; |
---|
| 1265 | UInt m_uiDependentSliceCurEndCUAddr; |
---|
| 1266 | Bool m_bNextSlice; |
---|
| 1267 | Bool m_bNextDependentSlice; |
---|
| 1268 | UInt m_uiSliceBits; |
---|
| 1269 | UInt m_uiDependentSliceCounter; |
---|
| 1270 | Bool m_bFinalized; |
---|
| 1271 | |
---|
| 1272 | wpScalingParam m_weightPredTable[2][MAX_NUM_REF][3]; // [REF_PIC_LIST_0 or REF_PIC_LIST_1][refIdx][0:Y, 1:U, 2:V] |
---|
| 1273 | wpACDCParam m_weightACDCParam[3]; // [0:Y, 1:U, 2:V] |
---|
| 1274 | wpScalingParam m_weightPredTableLC[2*MAX_NUM_REF][3]; // [refIdxLC][0:Y, 1:U, 2:V] |
---|
| 1275 | |
---|
| 1276 | std::vector<UInt> m_tileByteLocation; |
---|
| 1277 | UInt m_uiTileOffstForMultES; |
---|
| 1278 | |
---|
| 1279 | UInt* m_puiSubstreamSizes; |
---|
| 1280 | TComScalingList* m_scalingList; //!< pointer of quantization matrix |
---|
| 1281 | Bool m_cabacInitFlag; |
---|
| 1282 | |
---|
| 1283 | Bool m_bLMvdL1Zero; |
---|
| 1284 | Int m_numEntryPointOffsets; |
---|
| 1285 | #if TEMPORAL_LAYER_NON_REFERENCE |
---|
| 1286 | Bool m_temporalLayerNonReferenceFlag; |
---|
| 1287 | #endif |
---|
| 1288 | #if !REMOVE_NAL_REF_FLAG |
---|
| 1289 | Bool m_nalRefFlag; |
---|
| 1290 | #endif |
---|
| 1291 | Bool m_LFCrossSliceBoundaryFlag; |
---|
| 1292 | |
---|
| 1293 | Bool m_enableTMVPFlag; |
---|
| 1294 | |
---|
| 1295 | public: |
---|
| 1296 | TComSlice(); |
---|
| 1297 | virtual ~TComSlice(); |
---|
[11] | 1298 | #if SET_SLICE_LAYER_ID |
---|
| 1299 | Void initSlice ( UInt layerId ); |
---|
| 1300 | #else |
---|
[2] | 1301 | Void initSlice (); |
---|
[11] | 1302 | #endif |
---|
[2] | 1303 | |
---|
| 1304 | Void setVPS ( TComVPS* pcVPS ) { m_pcVPS = pcVPS; } |
---|
| 1305 | TComVPS* getVPS () { return m_pcVPS; } |
---|
| 1306 | Void setSPS ( TComSPS* pcSPS ) { m_pcSPS = pcSPS; } |
---|
| 1307 | TComSPS* getSPS () { return m_pcSPS; } |
---|
| 1308 | |
---|
| 1309 | Void setPPS ( TComPPS* pcPPS ) { assert(pcPPS!=NULL); m_pcPPS = pcPPS; m_iPPSId = pcPPS->getPPSId(); } |
---|
| 1310 | TComPPS* getPPS () { return m_pcPPS; } |
---|
| 1311 | |
---|
| 1312 | #if ADAPTIVE_QP_SELECTION |
---|
| 1313 | Void setTrQuant ( TComTrQuant* pcTrQuant ) { m_pcTrQuant = pcTrQuant; } |
---|
| 1314 | TComTrQuant* getTrQuant () { return m_pcTrQuant; } |
---|
| 1315 | #endif |
---|
| 1316 | |
---|
| 1317 | Void setPPSId ( Int PPSId ) { m_iPPSId = PPSId; } |
---|
| 1318 | Int getPPSId () { return m_iPPSId; } |
---|
| 1319 | #if !REMOVE_APS |
---|
| 1320 | Void setAPS ( TComAPS* pcAPS ) { m_pcAPS = pcAPS; } //!< set APS pointer |
---|
| 1321 | TComAPS* getAPS () { return m_pcAPS; } //!< get APS pointer |
---|
| 1322 | Void setAPSId ( Int Id) { m_iAPSId =Id; } //!< set APS ID |
---|
| 1323 | Int getAPSId () { return m_iAPSId; } //!< get APS ID |
---|
| 1324 | #endif |
---|
| 1325 | Void setPicOutputFlag( Bool b ) { m_PicOutputFlag = b; } |
---|
| 1326 | Bool getPicOutputFlag() { return m_PicOutputFlag; } |
---|
| 1327 | #if !REMOVE_ALF |
---|
| 1328 | Void setAlfEnabledFlag(Bool b, Int compIdx) { m_alfEnabledFlag[compIdx] = b; } |
---|
| 1329 | Bool getAlfEnabledFlag(Int compIdx) { return m_alfEnabledFlag[compIdx]; } |
---|
| 1330 | #endif |
---|
| 1331 | Void setSaoEnabledFlag(Bool s) {m_saoEnabledFlag =s; } |
---|
| 1332 | Bool getSaoEnabledFlag() { return m_saoEnabledFlag; } |
---|
| 1333 | #if SAO_TYPE_SHARING |
---|
| 1334 | Void setSaoEnabledFlagChroma(Bool s) {m_saoEnabledFlagChroma =s; } //!< set SAO Cb&Cr enabled flag |
---|
| 1335 | Bool getSaoEnabledFlagChroma() { return m_saoEnabledFlagChroma; } //!< get SAO Cb&Cr enabled flag |
---|
| 1336 | #else |
---|
| 1337 | Void setSaoEnabledFlagCb(Bool s) {m_saoEnabledFlagCb =s; } //!< set SAO Cb enabled flag |
---|
| 1338 | Bool getSaoEnabledFlagCb() { return m_saoEnabledFlagCb; } //!< get SAO Cb enabled flag |
---|
| 1339 | Void setSaoEnabledFlagCr(Bool s) {m_saoEnabledFlagCr =s; } //!< set SAO Cr enabled flag |
---|
| 1340 | Bool getSaoEnabledFlagCr() { return m_saoEnabledFlagCr; } //!< get SAO Cr enabled flag |
---|
| 1341 | #endif |
---|
| 1342 | Void setRPS ( TComReferencePictureSet *pcRPS ) { m_pcRPS = pcRPS; } |
---|
| 1343 | TComReferencePictureSet* getRPS () { return m_pcRPS; } |
---|
| 1344 | TComReferencePictureSet* getLocalRPS () { return &m_LocalRPS; } |
---|
| 1345 | |
---|
| 1346 | Void setRPSidx ( Int iBDidx ) { m_iBDidx = iBDidx; } |
---|
| 1347 | Int getRPSidx () { return m_iBDidx; } |
---|
| 1348 | Void setCombinationBDidx ( Int iCombinationBDidx ) { m_iCombinationBDidx = iCombinationBDidx; } |
---|
| 1349 | Int getCombinationBDidx () { return m_iCombinationBDidx; } |
---|
| 1350 | Void setCombineWithReferenceFlag ( Bool bCombineWithReferenceFlag ) { m_bCombineWithReferenceFlag = bCombineWithReferenceFlag; } |
---|
| 1351 | Bool getCombineWithReferenceFlag () { return m_bCombineWithReferenceFlag; } |
---|
| 1352 | #if PREVREFPIC_DEFN |
---|
| 1353 | Int getPrevPOC () { return m_prevPOC[getTLayer()]; } |
---|
| 1354 | #else |
---|
| 1355 | Int getPrevPOC () { return m_prevPOC; } |
---|
| 1356 | #endif |
---|
| 1357 | TComRefPicListModification* getRefPicListModification() { return &m_RefPicListModification; } |
---|
| 1358 | Void setLastIDR(Int iIDRPOC) { m_iLastIDR = iIDRPOC; } |
---|
| 1359 | Int getLastIDR() { return m_iLastIDR; } |
---|
| 1360 | SliceType getSliceType () { return m_eSliceType; } |
---|
| 1361 | Int getPOC () { return m_iPOC; } |
---|
| 1362 | Int getSliceQp () { return m_iSliceQp; } |
---|
| 1363 | #if SLICEHEADER_SYNTAX_FIX |
---|
| 1364 | Bool getDependentSliceFlag() const { return m_dependentSliceFlag; } |
---|
| 1365 | void setDependentSliceFlag(Bool val) { m_dependentSliceFlag = val; } |
---|
| 1366 | #endif |
---|
| 1367 | #if ADAPTIVE_QP_SELECTION |
---|
| 1368 | Int getSliceQpBase () { return m_iSliceQpBase; } |
---|
| 1369 | #endif |
---|
| 1370 | Int getSliceQpDelta () { return m_iSliceQpDelta; } |
---|
| 1371 | #if CHROMA_QP_EXTENSION |
---|
| 1372 | Int getSliceQpDeltaCb () { return m_iSliceQpDeltaCb; } |
---|
| 1373 | Int getSliceQpDeltaCr () { return m_iSliceQpDeltaCr; } |
---|
| 1374 | #endif |
---|
| 1375 | Bool getDeblockingFilterDisable() { return m_deblockingFilterDisable; } |
---|
| 1376 | Bool getDeblockingFilterOverrideFlag() { return m_deblockingFilterOverrideFlag; } |
---|
| 1377 | Int getDeblockingFilterBetaOffsetDiv2() { return m_deblockingFilterBetaOffsetDiv2; } |
---|
| 1378 | Int getDeblockingFilterTcOffsetDiv2() { return m_deblockingFilterTcOffsetDiv2; } |
---|
| 1379 | |
---|
| 1380 | Int getNumRefIdx ( RefPicList e ) { return m_aiNumRefIdx[e]; } |
---|
| 1381 | TComPic* getPic () { return m_pcPic; } |
---|
| 1382 | TComPic* getRefPic ( RefPicList e, Int iRefIdx) { return m_apcRefPicList[e][iRefIdx]; } |
---|
| 1383 | Int getRefPOC ( RefPicList e, Int iRefIdx) { return m_aiRefPOCList[e][iRefIdx]; } |
---|
| 1384 | Int getDepth () { return m_iDepth; } |
---|
| 1385 | UInt getColFromL0Flag () { return m_colFromL0Flag; } |
---|
| 1386 | UInt getColRefIdx () { return m_colRefIdx; } |
---|
| 1387 | Void checkColRefIdx (UInt curSliceIdx, TComPic* pic); |
---|
| 1388 | Bool getCheckLDC () { return m_bCheckLDC; } |
---|
| 1389 | Bool getMvdL1ZeroFlag () { return m_bLMvdL1Zero; } |
---|
| 1390 | Int getNumRpsCurrTempList(); |
---|
| 1391 | Int getRefIdxOfLC (RefPicList e, Int iRefIdx) { return m_iRefIdxOfLC[e][iRefIdx]; } |
---|
| 1392 | Int getListIdFromIdxOfLC(Int iRefIdx) { return m_eListIdFromIdxOfLC[iRefIdx]; } |
---|
| 1393 | Int getRefIdxFromIdxOfLC(Int iRefIdx) { return m_iRefIdxFromIdxOfLC[iRefIdx]; } |
---|
| 1394 | Int getRefIdxOfL0FromRefIdxOfL1(Int iRefIdx) { return m_iRefIdxOfL0FromRefIdxOfL1[iRefIdx];} |
---|
| 1395 | Int getRefIdxOfL1FromRefIdxOfL0(Int iRefIdx) { return m_iRefIdxOfL1FromRefIdxOfL0[iRefIdx];} |
---|
| 1396 | Bool getRefPicListModificationFlagLC() {return m_bRefPicListModificationFlagLC;} |
---|
| 1397 | Void setRefPicListModificationFlagLC(Bool bflag) {m_bRefPicListModificationFlagLC=bflag;} |
---|
| 1398 | Bool getRefPicListCombinationFlag() {return m_bRefPicListCombinationFlag;} |
---|
| 1399 | Void setRefPicListCombinationFlag(Bool bflag) {m_bRefPicListCombinationFlag=bflag;} |
---|
| 1400 | Void setReferenced(Bool b) { m_bRefenced = b; } |
---|
| 1401 | Bool isReferenced() { return m_bRefenced; } |
---|
| 1402 | #if PREVREFPIC_DEFN |
---|
| 1403 | Void setPOC ( Int i ) |
---|
| 1404 | { |
---|
| 1405 | m_iPOC = i; |
---|
| 1406 | if (isReferenced()) |
---|
| 1407 | { |
---|
| 1408 | for (Int j = getTLayer(); j < (getSPS()->getMaxTLayers()); j++) |
---|
| 1409 | { |
---|
| 1410 | m_prevPOC[j] = i; |
---|
| 1411 | } |
---|
| 1412 | } |
---|
| 1413 | } |
---|
| 1414 | #else |
---|
| 1415 | Void setPOC ( Int i ) { m_iPOC = i; if(getTLayer()==0) m_prevPOC=i; } |
---|
| 1416 | #endif |
---|
| 1417 | Void setNalUnitType ( NalUnitType e ) { m_eNalUnitType = e; } |
---|
| 1418 | NalUnitType getNalUnitType () { return m_eNalUnitType; } |
---|
| 1419 | Bool getRapPicFlag (); |
---|
| 1420 | #if SUPPORT_FOR_RAP_N_LP |
---|
| 1421 | Bool getIdrPicFlag () { return getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP; } |
---|
| 1422 | #endif |
---|
| 1423 | Void checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, Bool& prevRAPisBLA, TComList<TComPic*>& rcListPic); |
---|
| 1424 | Void decodingRefreshMarking(Int& pocCRA, Bool& bRefreshPending, TComList<TComPic*>& rcListPic); |
---|
| 1425 | Void setSliceType ( SliceType e ) { m_eSliceType = e; } |
---|
| 1426 | Void setSliceQp ( Int i ) { m_iSliceQp = i; } |
---|
| 1427 | #if ADAPTIVE_QP_SELECTION |
---|
| 1428 | Void setSliceQpBase ( Int i ) { m_iSliceQpBase = i; } |
---|
| 1429 | #endif |
---|
| 1430 | Void setSliceQpDelta ( Int i ) { m_iSliceQpDelta = i; } |
---|
| 1431 | #if CHROMA_QP_EXTENSION |
---|
| 1432 | Void setSliceQpDeltaCb ( Int i ) { m_iSliceQpDeltaCb = i; } |
---|
| 1433 | Void setSliceQpDeltaCr ( Int i ) { m_iSliceQpDeltaCr = i; } |
---|
| 1434 | #endif |
---|
| 1435 | Void setDeblockingFilterDisable( Bool b ) { m_deblockingFilterDisable= b; } |
---|
| 1436 | Void setDeblockingFilterOverrideFlag( Bool b ) { m_deblockingFilterOverrideFlag = b; } |
---|
| 1437 | Void setDeblockingFilterBetaOffsetDiv2( Int i ) { m_deblockingFilterBetaOffsetDiv2 = i; } |
---|
| 1438 | Void setDeblockingFilterTcOffsetDiv2( Int i ) { m_deblockingFilterTcOffsetDiv2 = i; } |
---|
| 1439 | |
---|
| 1440 | Void setRefPic ( TComPic* p, RefPicList e, Int iRefIdx ) { m_apcRefPicList[e][iRefIdx] = p; } |
---|
| 1441 | Void setRefPOC ( Int i, RefPicList e, Int iRefIdx ) { m_aiRefPOCList[e][iRefIdx] = i; } |
---|
| 1442 | Void setNumRefIdx ( RefPicList e, Int i ) { m_aiNumRefIdx[e] = i; } |
---|
| 1443 | Void setPic ( TComPic* p ) { m_pcPic = p; } |
---|
| 1444 | Void setDepth ( Int iDepth ) { m_iDepth = iDepth; } |
---|
| 1445 | |
---|
| 1446 | #if SVC_EXTENSION |
---|
| 1447 | Void setBaseColPic ( TComPic* p) { m_pcBaseColPic = p; } |
---|
| 1448 | Void setBaseColPic ( TComList<TComPic*>& rcListPic , UInt layerID ); |
---|
| 1449 | TComPic* getBaseColPic () { return m_pcBaseColPic; } |
---|
| 1450 | |
---|
| 1451 | Void setLayerId (UInt layerId) { m_layerId = layerId; } |
---|
| 1452 | UInt getLayerId () { return m_layerId; } |
---|
| 1453 | |
---|
| 1454 | Void setFullPelBaseRec ( TComPicYuv* p) { m_pcFullPelBaseRec = p; } |
---|
| 1455 | TComPicYuv* getFullPelBaseRec () { return m_pcFullPelBaseRec; } |
---|
| 1456 | #endif |
---|
[25] | 1457 | |
---|
| 1458 | #if REF_IDX_MFM |
---|
| 1459 | Void setRefPOCListILP(TComPic** ilpPic, TComPic *pcRefPicBL); |
---|
| 1460 | #endif |
---|
| 1461 | |
---|
[2] | 1462 | Void setRefPicList ( TComList<TComPic*>& rcListPic ); |
---|
| 1463 | Void setRefPOCList (); |
---|
| 1464 | Void setColFromL0Flag ( UInt colFromL0 ) { m_colFromL0Flag = colFromL0; } |
---|
| 1465 | Void setColRefIdx ( UInt refIdx) { m_colRefIdx = refIdx; } |
---|
| 1466 | Void setCheckLDC ( Bool b ) { m_bCheckLDC = b; } |
---|
| 1467 | Void setMvdL1ZeroFlag ( Bool b) { m_bLMvdL1Zero = b; } |
---|
| 1468 | |
---|
| 1469 | Bool isIntra () { return m_eSliceType == I_SLICE; } |
---|
| 1470 | Bool isInterB () { return m_eSliceType == B_SLICE; } |
---|
| 1471 | Bool isInterP () { return m_eSliceType == P_SLICE; } |
---|
| 1472 | |
---|
| 1473 | #if ALF_CHROMA_LAMBDA || SAO_CHROMA_LAMBDA |
---|
| 1474 | Void setLambda( Double d, Double e ) { m_dLambdaLuma = d; m_dLambdaChroma = e;} |
---|
| 1475 | Double getLambdaLuma() { return m_dLambdaLuma; } |
---|
| 1476 | Double getLambdaChroma() { return m_dLambdaChroma; } |
---|
| 1477 | #else |
---|
| 1478 | Void setLambda( Double d ) { m_dLambda = d; } |
---|
| 1479 | Double getLambda() { return m_dLambda; } |
---|
| 1480 | #endif |
---|
| 1481 | |
---|
| 1482 | Void initEqualRef(); |
---|
| 1483 | Bool isEqualRef ( RefPicList e, Int iRefIdx1, Int iRefIdx2 ) |
---|
| 1484 | { |
---|
| 1485 | if (iRefIdx1 < 0 || iRefIdx2 < 0) return false; |
---|
| 1486 | return m_abEqualRef[e][iRefIdx1][iRefIdx2]; |
---|
| 1487 | } |
---|
| 1488 | |
---|
| 1489 | Void setEqualRef( RefPicList e, Int iRefIdx1, Int iRefIdx2, Bool b) |
---|
| 1490 | { |
---|
| 1491 | m_abEqualRef[e][iRefIdx1][iRefIdx2] = m_abEqualRef[e][iRefIdx2][iRefIdx1] = b; |
---|
| 1492 | } |
---|
| 1493 | |
---|
| 1494 | static Void sortPicList ( TComList<TComPic*>& rcListPic ); |
---|
| 1495 | |
---|
| 1496 | Bool getNoBackPredFlag() { return m_bNoBackPredFlag; } |
---|
| 1497 | Void setNoBackPredFlag( Bool b ) { m_bNoBackPredFlag = b; } |
---|
| 1498 | Void generateCombinedList (); |
---|
| 1499 | |
---|
| 1500 | UInt getTLayer () { return m_uiTLayer; } |
---|
| 1501 | Void setTLayer ( UInt uiTLayer ) { m_uiTLayer = uiTLayer; } |
---|
| 1502 | |
---|
| 1503 | Void setTLayerInfo( UInt uiTLayer ); |
---|
| 1504 | Void decodingMarking( TComList<TComPic*>& rcListPic, Int iGOPSIze, Int& iMaxRefPicNum ); |
---|
| 1505 | Void applyReferencePictureSet( TComList<TComPic*>& rcListPic, TComReferencePictureSet *RPSList); |
---|
| 1506 | Bool isTemporalLayerSwitchingPoint( TComList<TComPic*>& rcListPic, TComReferencePictureSet *RPSList); |
---|
| 1507 | #if STSA |
---|
| 1508 | Bool isStepwiseTemporalLayerSwitchingPointCandidate( TComList<TComPic*>& rcListPic, TComReferencePictureSet *RPSList); |
---|
| 1509 | #endif |
---|
| 1510 | Int checkThatAllRefPicsAreAvailable( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool printErrors, Int pocRandomAccess = 0); |
---|
| 1511 | Void createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet); |
---|
| 1512 | |
---|
| 1513 | Void setMaxNumMergeCand (UInt val ) { m_maxNumMergeCand = val; } |
---|
| 1514 | UInt getMaxNumMergeCand () { return m_maxNumMergeCand; } |
---|
| 1515 | |
---|
| 1516 | Void setSliceMode ( UInt uiMode ) { m_uiSliceMode = uiMode; } |
---|
| 1517 | UInt getSliceMode () { return m_uiSliceMode; } |
---|
| 1518 | Void setSliceArgument ( UInt uiArgument ) { m_uiSliceArgument = uiArgument; } |
---|
| 1519 | UInt getSliceArgument () { return m_uiSliceArgument; } |
---|
| 1520 | Void setSliceCurStartCUAddr ( UInt uiAddr ) { m_uiSliceCurStartCUAddr = uiAddr; } |
---|
| 1521 | UInt getSliceCurStartCUAddr () { return m_uiSliceCurStartCUAddr; } |
---|
| 1522 | Void setSliceCurEndCUAddr ( UInt uiAddr ) { m_uiSliceCurEndCUAddr = uiAddr; } |
---|
| 1523 | UInt getSliceCurEndCUAddr () { return m_uiSliceCurEndCUAddr; } |
---|
| 1524 | Void setSliceIdx ( UInt i) { m_uiSliceIdx = i; } |
---|
| 1525 | UInt getSliceIdx () { return m_uiSliceIdx; } |
---|
| 1526 | Void copySliceInfo (TComSlice *pcSliceSrc); |
---|
| 1527 | Void setDependentSliceMode ( UInt uiMode ) { m_uiDependentSliceMode = uiMode; } |
---|
| 1528 | UInt getDependentSliceMode () { return m_uiDependentSliceMode; } |
---|
| 1529 | Void setDependentSliceArgument ( UInt uiArgument ) { m_uiDependentSliceArgument = uiArgument; } |
---|
| 1530 | UInt getDependentSliceArgument () { return m_uiDependentSliceArgument; } |
---|
| 1531 | Void setDependentSliceCurStartCUAddr ( UInt uiAddr ) { m_uiDependentSliceCurStartCUAddr = uiAddr; } |
---|
| 1532 | UInt getDependentSliceCurStartCUAddr () { return m_uiDependentSliceCurStartCUAddr; } |
---|
| 1533 | Void setDependentSliceCurEndCUAddr ( UInt uiAddr ) { m_uiDependentSliceCurEndCUAddr = uiAddr; } |
---|
| 1534 | UInt getDependentSliceCurEndCUAddr () { return m_uiDependentSliceCurEndCUAddr; } |
---|
| 1535 | Void setNextSlice ( Bool b ) { m_bNextSlice = b; } |
---|
| 1536 | Bool isNextSlice () { return m_bNextSlice; } |
---|
| 1537 | Void setNextDependentSlice ( Bool b ) { m_bNextDependentSlice = b; } |
---|
| 1538 | Bool isNextDependentSlice () { return m_bNextDependentSlice; } |
---|
| 1539 | Void setSliceBits ( UInt uiVal ) { m_uiSliceBits = uiVal; } |
---|
| 1540 | UInt getSliceBits () { return m_uiSliceBits; } |
---|
| 1541 | Void setDependentSliceCounter ( UInt uiVal ) { m_uiDependentSliceCounter = uiVal; } |
---|
| 1542 | UInt getDependentSliceCounter () { return m_uiDependentSliceCounter; } |
---|
| 1543 | Void setFinalized ( Bool uiVal ) { m_bFinalized = uiVal; } |
---|
| 1544 | Bool getFinalized () { return m_bFinalized; } |
---|
| 1545 | Void setWpScaling ( wpScalingParam wp[2][MAX_NUM_REF][3] ) { memcpy(m_weightPredTable, wp, sizeof(wpScalingParam)*2*MAX_NUM_REF*3); } |
---|
| 1546 | Void getWpScaling ( RefPicList e, Int iRefIdx, wpScalingParam *&wp); |
---|
| 1547 | |
---|
| 1548 | Void resetWpScaling (wpScalingParam wp[2][MAX_NUM_REF][3]); |
---|
| 1549 | Void initWpScaling (wpScalingParam wp[2][MAX_NUM_REF][3]); |
---|
| 1550 | Void initWpScaling (); |
---|
| 1551 | inline Bool applyWP () { return( (m_eSliceType==P_SLICE && m_pcPPS->getUseWP()) || (m_eSliceType==B_SLICE && m_pcPPS->getWPBiPred()) ); } |
---|
| 1552 | |
---|
| 1553 | Void setWpAcDcParam ( wpACDCParam wp[3] ) { memcpy(m_weightACDCParam, wp, sizeof(wpACDCParam)*3); } |
---|
| 1554 | Void getWpAcDcParam ( wpACDCParam *&wp ); |
---|
| 1555 | Void initWpAcDcParam (); |
---|
| 1556 | |
---|
| 1557 | Void setTileLocationCount ( UInt cnt ) { return m_tileByteLocation.resize(cnt); } |
---|
| 1558 | UInt getTileLocationCount () { return (UInt) m_tileByteLocation.size(); } |
---|
| 1559 | Void setTileLocation ( Int idx, UInt location ) { assert (idx<m_tileByteLocation.size()); |
---|
| 1560 | m_tileByteLocation[idx] = location; } |
---|
| 1561 | Void addTileLocation ( UInt location ) { m_tileByteLocation.push_back(location); } |
---|
| 1562 | UInt getTileLocation ( Int idx ) { return m_tileByteLocation[idx]; } |
---|
| 1563 | |
---|
| 1564 | Void setTileOffstForMultES (UInt uiOffset ) { m_uiTileOffstForMultES = uiOffset; } |
---|
| 1565 | UInt getTileOffstForMultES () { return m_uiTileOffstForMultES; } |
---|
| 1566 | Void allocSubstreamSizes ( UInt uiNumSubstreams ); |
---|
| 1567 | UInt* getSubstreamSizes () { return m_puiSubstreamSizes; } |
---|
| 1568 | Void setScalingList ( TComScalingList* scalingList ) { m_scalingList = scalingList; } |
---|
| 1569 | TComScalingList* getScalingList () { return m_scalingList; } |
---|
| 1570 | Void setDefaultScalingList (); |
---|
| 1571 | Bool checkDefaultScalingList (); |
---|
| 1572 | Void setCabacInitFlag ( Bool val ) { m_cabacInitFlag = val; } //!< set CABAC initial flag |
---|
| 1573 | Bool getCabacInitFlag () { return m_cabacInitFlag; } //!< get CABAC initial flag |
---|
| 1574 | Void setNumEntryPointOffsets(Int val) { m_numEntryPointOffsets = val; } |
---|
| 1575 | Int getNumEntryPointOffsets() { return m_numEntryPointOffsets; } |
---|
| 1576 | #if TEMPORAL_LAYER_NON_REFERENCE |
---|
| 1577 | Bool getTemporalLayerNonReferenceFlag() { return m_temporalLayerNonReferenceFlag;} |
---|
| 1578 | Void setTemporalLayerNonReferenceFlag(Bool x) { m_temporalLayerNonReferenceFlag = x;} |
---|
| 1579 | #endif |
---|
| 1580 | #if !REMOVE_NAL_REF_FLAG |
---|
| 1581 | Bool getNalRefFlag() { return m_nalRefFlag;} |
---|
| 1582 | Void setNalRefFlag(Bool x) { m_nalRefFlag = x;} |
---|
| 1583 | #endif |
---|
| 1584 | Void setLFCrossSliceBoundaryFlag ( Bool val ) { m_LFCrossSliceBoundaryFlag = val; } |
---|
| 1585 | Bool getLFCrossSliceBoundaryFlag () { return m_LFCrossSliceBoundaryFlag;} |
---|
| 1586 | |
---|
| 1587 | Void setEnableTMVPFlag ( Bool b ) { m_enableTMVPFlag = b; } |
---|
| 1588 | Bool getEnableTMVPFlag () { return m_enableTMVPFlag;} |
---|
| 1589 | #if REF_IDX_FRAMEWORK |
---|
| 1590 | Void addRefPicList( TComPic **pIlpPicList, Int iRefPicNum, Int iInsertOffset=0 ); |
---|
| 1591 | #endif |
---|
| 1592 | protected: |
---|
| 1593 | TComPic* xGetRefPic (TComList<TComPic*>& rcListPic, |
---|
| 1594 | UInt uiPOC); |
---|
| 1595 | TComPic* xGetLongTermRefPic (TComList<TComPic*>& rcListPic, |
---|
| 1596 | UInt uiPOC); |
---|
| 1597 | };// END CLASS DEFINITION TComSlice |
---|
| 1598 | |
---|
| 1599 | |
---|
| 1600 | template <class T> class ParameterSetMap |
---|
| 1601 | { |
---|
| 1602 | public: |
---|
| 1603 | ParameterSetMap(Int maxId) |
---|
| 1604 | :m_maxId (maxId) |
---|
| 1605 | {} |
---|
| 1606 | |
---|
| 1607 | ~ParameterSetMap() |
---|
| 1608 | { |
---|
| 1609 | for (typename std::map<Int,T *>::iterator i = m_paramsetMap.begin(); i!= m_paramsetMap.end(); i++) |
---|
| 1610 | { |
---|
| 1611 | delete (*i).second; |
---|
| 1612 | } |
---|
| 1613 | } |
---|
| 1614 | |
---|
| 1615 | Void storePS(Int psId, T *ps) |
---|
| 1616 | { |
---|
| 1617 | assert ( psId < m_maxId ); |
---|
| 1618 | if ( m_paramsetMap.find(psId) != m_paramsetMap.end() ) |
---|
| 1619 | { |
---|
| 1620 | delete m_paramsetMap[psId]; |
---|
| 1621 | } |
---|
| 1622 | m_paramsetMap[psId] = ps; |
---|
| 1623 | } |
---|
| 1624 | |
---|
| 1625 | Void mergePSList(ParameterSetMap<T> &rPsList) |
---|
| 1626 | { |
---|
| 1627 | for (typename std::map<Int,T *>::iterator i = rPsList.m_paramsetMap.begin(); i!= rPsList.m_paramsetMap.end(); i++) |
---|
| 1628 | { |
---|
| 1629 | storePS(i->first, i->second); |
---|
| 1630 | } |
---|
| 1631 | rPsList.m_paramsetMap.clear(); |
---|
| 1632 | } |
---|
| 1633 | |
---|
| 1634 | |
---|
| 1635 | T* getPS(Int psId) |
---|
| 1636 | { |
---|
| 1637 | return ( m_paramsetMap.find(psId) == m_paramsetMap.end() ) ? NULL : m_paramsetMap[psId]; |
---|
| 1638 | } |
---|
| 1639 | |
---|
| 1640 | T* getFirstPS() |
---|
| 1641 | { |
---|
| 1642 | return (m_paramsetMap.begin() == m_paramsetMap.end() ) ? NULL : m_paramsetMap.begin()->second; |
---|
| 1643 | } |
---|
| 1644 | |
---|
| 1645 | private: |
---|
| 1646 | std::map<Int,T *> m_paramsetMap; |
---|
| 1647 | Int m_maxId; |
---|
| 1648 | }; |
---|
| 1649 | |
---|
| 1650 | class ParameterSetManager |
---|
| 1651 | { |
---|
| 1652 | public: |
---|
| 1653 | ParameterSetManager(); |
---|
| 1654 | virtual ~ParameterSetManager(); |
---|
| 1655 | |
---|
| 1656 | //! store sequence parameter set and take ownership of it |
---|
| 1657 | Void storeVPS(TComVPS *vps) { m_vpsMap.storePS( vps->getVPSId(), vps); }; |
---|
| 1658 | //! get pointer to existing video parameter set |
---|
| 1659 | TComVPS* getVPS(Int vpsId) { return m_vpsMap.getPS(vpsId); }; |
---|
| 1660 | TComVPS* getFirstVPS() { return m_vpsMap.getFirstPS(); }; |
---|
| 1661 | |
---|
| 1662 | //! store sequence parameter set and take ownership of it |
---|
| 1663 | Void storeSPS(TComSPS *sps) { m_spsMap.storePS( sps->getSPSId(), sps); }; |
---|
| 1664 | //! get pointer to existing sequence parameter set |
---|
| 1665 | TComSPS* getSPS(Int spsId) { return m_spsMap.getPS(spsId); }; |
---|
| 1666 | TComSPS* getFirstSPS() { return m_spsMap.getFirstPS(); }; |
---|
| 1667 | |
---|
| 1668 | //! store picture parameter set and take ownership of it |
---|
| 1669 | Void storePPS(TComPPS *pps) { m_ppsMap.storePS( pps->getPPSId(), pps); }; |
---|
| 1670 | //! get pointer to existing picture parameter set |
---|
| 1671 | TComPPS* getPPS(Int ppsId) { return m_ppsMap.getPS(ppsId); }; |
---|
| 1672 | TComPPS* getFirstPPS() { return m_ppsMap.getFirstPS(); }; |
---|
| 1673 | |
---|
| 1674 | #if !REMOVE_APS |
---|
| 1675 | //! store adaptation parameter set and take ownership of it |
---|
| 1676 | Void storeAPS(TComAPS *aps) { m_apsMap.storePS( aps->getAPSID(), aps); }; |
---|
| 1677 | //! getPointer to existing adaptation parameter set |
---|
| 1678 | TComAPS* getAPS(Int apsId) { return m_apsMap.getPS(apsId); }; |
---|
| 1679 | #endif |
---|
| 1680 | protected: |
---|
| 1681 | |
---|
| 1682 | ParameterSetMap<TComVPS> m_vpsMap; |
---|
| 1683 | ParameterSetMap<TComSPS> m_spsMap; |
---|
| 1684 | ParameterSetMap<TComPPS> m_ppsMap; |
---|
| 1685 | #if !REMOVE_APS |
---|
| 1686 | ParameterSetMap<TComAPS> m_apsMap; |
---|
| 1687 | #endif |
---|
| 1688 | }; |
---|
| 1689 | |
---|
| 1690 | //! \} |
---|
| 1691 | |
---|
| 1692 | #endif // __TCOMSLICE__ |
---|