[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 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 | // ==================================================================================================================== |
---|
| 62 | // Class definition |
---|
| 63 | // ==================================================================================================================== |
---|
| 64 | |
---|
| 65 | /// Reference Picture Set class |
---|
| 66 | class TComReferencePictureSet |
---|
| 67 | { |
---|
| 68 | private: |
---|
| 69 | Int m_numberOfPictures; |
---|
| 70 | Int m_numberOfNegativePictures; |
---|
| 71 | Int m_numberOfPositivePictures; |
---|
| 72 | Int m_numberOfLongtermPictures; |
---|
| 73 | Int m_deltaPOC[MAX_NUM_REF_PICS]; |
---|
| 74 | Int m_POC[MAX_NUM_REF_PICS]; |
---|
| 75 | Bool m_used[MAX_NUM_REF_PICS]; |
---|
| 76 | Bool m_interRPSPrediction; |
---|
| 77 | Int m_deltaRIdxMinus1; |
---|
| 78 | Int m_deltaRPS; |
---|
| 79 | Int m_numRefIdc; |
---|
| 80 | Int m_refIdc[MAX_NUM_REF_PICS+1]; |
---|
| 81 | Bool m_bCheckLTMSB[MAX_NUM_REF_PICS]; |
---|
| 82 | Int m_pocLSBLT[MAX_NUM_REF_PICS]; |
---|
| 83 | Int m_deltaPOCMSBCycleLT[MAX_NUM_REF_PICS]; |
---|
| 84 | Bool m_deltaPocMSBPresentFlag[MAX_NUM_REF_PICS]; |
---|
| 85 | |
---|
| 86 | public: |
---|
| 87 | TComReferencePictureSet(); |
---|
| 88 | virtual ~TComReferencePictureSet(); |
---|
| 89 | Int getPocLSBLT(Int i) { return m_pocLSBLT[i]; } |
---|
| 90 | Void setPocLSBLT(Int i, Int x) { m_pocLSBLT[i] = x; } |
---|
| 91 | Int getDeltaPocMSBCycleLT(Int i) { return m_deltaPOCMSBCycleLT[i]; } |
---|
| 92 | Void setDeltaPocMSBCycleLT(Int i, Int x) { m_deltaPOCMSBCycleLT[i] = x; } |
---|
| 93 | Bool getDeltaPocMSBPresentFlag(Int i) { return m_deltaPocMSBPresentFlag[i]; } |
---|
| 94 | Void setDeltaPocMSBPresentFlag(Int i, Bool x) { m_deltaPocMSBPresentFlag[i] = x; } |
---|
| 95 | Void setUsed(Int bufferNum, Bool used); |
---|
| 96 | Void setDeltaPOC(Int bufferNum, Int deltaPOC); |
---|
| 97 | Void setPOC(Int bufferNum, Int deltaPOC); |
---|
| 98 | Void setNumberOfPictures(Int numberOfPictures); |
---|
| 99 | Void setCheckLTMSBPresent(Int bufferNum, Bool b ); |
---|
| 100 | Bool getCheckLTMSBPresent(Int bufferNum); |
---|
| 101 | |
---|
| 102 | Int getUsed(Int bufferNum); |
---|
| 103 | Int getDeltaPOC(Int bufferNum); |
---|
| 104 | Int getPOC(Int bufferNum); |
---|
| 105 | Int getNumberOfPictures(); |
---|
| 106 | |
---|
| 107 | Void setNumberOfNegativePictures(Int number) { m_numberOfNegativePictures = number; } |
---|
| 108 | Int getNumberOfNegativePictures() { return m_numberOfNegativePictures; } |
---|
| 109 | Void setNumberOfPositivePictures(Int number) { m_numberOfPositivePictures = number; } |
---|
| 110 | Int getNumberOfPositivePictures() { return m_numberOfPositivePictures; } |
---|
| 111 | Void setNumberOfLongtermPictures(Int number) { m_numberOfLongtermPictures = number; } |
---|
| 112 | Int getNumberOfLongtermPictures() { return m_numberOfLongtermPictures; } |
---|
| 113 | |
---|
| 114 | Void setInterRPSPrediction(Bool flag) { m_interRPSPrediction = flag; } |
---|
| 115 | Bool getInterRPSPrediction() { return m_interRPSPrediction; } |
---|
| 116 | Void setDeltaRIdxMinus1(Int x) { m_deltaRIdxMinus1 = x; } |
---|
| 117 | Int getDeltaRIdxMinus1() { return m_deltaRIdxMinus1; } |
---|
| 118 | Void setDeltaRPS(Int x) { m_deltaRPS = x; } |
---|
| 119 | Int getDeltaRPS() { return m_deltaRPS; } |
---|
| 120 | Void setNumRefIdc(Int x) { m_numRefIdc = x; } |
---|
| 121 | Int getNumRefIdc() { return m_numRefIdc; } |
---|
| 122 | |
---|
| 123 | Void setRefIdc(Int bufferNum, Int refIdc); |
---|
| 124 | Int getRefIdc(Int bufferNum); |
---|
| 125 | |
---|
| 126 | Void sortDeltaPOC(); |
---|
| 127 | Void printDeltaPOC(); |
---|
| 128 | }; |
---|
| 129 | |
---|
| 130 | /// Reference Picture Set set class |
---|
| 131 | class TComRPSList |
---|
| 132 | { |
---|
| 133 | private: |
---|
| 134 | Int m_numberOfReferencePictureSets; |
---|
| 135 | TComReferencePictureSet* m_referencePictureSets; |
---|
| 136 | |
---|
| 137 | public: |
---|
| 138 | TComRPSList(); |
---|
| 139 | virtual ~TComRPSList(); |
---|
| 140 | |
---|
| 141 | Void create (Int numberOfEntries); |
---|
| 142 | Void destroy (); |
---|
| 143 | |
---|
| 144 | |
---|
| 145 | TComReferencePictureSet* getReferencePictureSet(Int referencePictureSetNum); |
---|
| 146 | Int getNumberOfReferencePictureSets(); |
---|
| 147 | Void setNumberOfReferencePictureSets(Int numberOfReferencePictureSets); |
---|
| 148 | }; |
---|
| 149 | |
---|
| 150 | /// SCALING_LIST class |
---|
| 151 | class TComScalingList |
---|
| 152 | { |
---|
| 153 | public: |
---|
| 154 | TComScalingList(); |
---|
| 155 | virtual ~TComScalingList(); |
---|
| 156 | Void setScalingListPresentFlag (Bool b) { m_scalingListPresentFlag = b; } |
---|
| 157 | Bool getScalingListPresentFlag () { return m_scalingListPresentFlag; } |
---|
| 158 | Bool getUseTransformSkip () { return m_useTransformSkip; } |
---|
| 159 | Void setUseTransformSkip (Bool b) { m_useTransformSkip = b; } |
---|
| 160 | Int* getScalingListAddress (UInt sizeId, UInt listId) { return m_scalingListCoef[sizeId][listId]; } //!< get matrix coefficient |
---|
| 161 | Bool checkPredMode (UInt sizeId, UInt listId); |
---|
| 162 | Void setRefMatrixId (UInt sizeId, UInt listId, UInt u) { m_refMatrixId[sizeId][listId] = u; } //!< set reference matrix ID |
---|
| 163 | UInt getRefMatrixId (UInt sizeId, UInt listId) { return m_refMatrixId[sizeId][listId]; } //!< get reference matrix ID |
---|
| 164 | Int* getScalingListDefaultAddress (UInt sizeId, UInt listId); //!< get default matrix coefficient |
---|
| 165 | Void processDefaultMarix (UInt sizeId, UInt listId); |
---|
| 166 | Void setScalingListDC (UInt sizeId, UInt listId, UInt u) { m_scalingListDC[sizeId][listId] = u; } //!< set DC value |
---|
| 167 | |
---|
| 168 | Int getScalingListDC (UInt sizeId, UInt listId) { return m_scalingListDC[sizeId][listId]; } //!< get DC value |
---|
| 169 | Void checkDcOfMatrix (); |
---|
| 170 | Void processRefMatrix (UInt sizeId, UInt listId , UInt refListId ); |
---|
| 171 | Bool xParseScalingList (Char* pchFile); |
---|
| 172 | |
---|
| 173 | private: |
---|
| 174 | Void init (); |
---|
| 175 | Void destroy (); |
---|
| 176 | Int m_scalingListDC [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< the DC value of the matrix coefficient for 16x16 |
---|
| 177 | Bool m_useDefaultScalingMatrixFlag [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< UseDefaultScalingMatrixFlag |
---|
| 178 | UInt m_refMatrixId [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< RefMatrixID |
---|
| 179 | Bool m_scalingListPresentFlag; //!< flag for using default matrix |
---|
| 180 | UInt m_predMatrixId [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< reference list index |
---|
| 181 | Int *m_scalingListCoef [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< quantization matrix |
---|
| 182 | Bool m_useTransformSkip; //!< transform skipping flag for setting default scaling matrix for 4x4 |
---|
| 183 | }; |
---|
| 184 | |
---|
| 185 | class ProfileTierLevel |
---|
| 186 | { |
---|
| 187 | Int m_profileSpace; |
---|
| 188 | Bool m_tierFlag; |
---|
| 189 | Int m_profileIdc; |
---|
| 190 | Bool m_profileCompatibilityFlag[32]; |
---|
| 191 | Int m_levelIdc; |
---|
| 192 | |
---|
| 193 | Bool m_progressiveSourceFlag; |
---|
| 194 | Bool m_interlacedSourceFlag; |
---|
| 195 | Bool m_nonPackedConstraintFlag; |
---|
| 196 | Bool m_frameOnlyConstraintFlag; |
---|
| 197 | |
---|
| 198 | public: |
---|
| 199 | ProfileTierLevel(); |
---|
| 200 | |
---|
| 201 | Int getProfileSpace() const { return m_profileSpace; } |
---|
| 202 | Void setProfileSpace(Int x) { m_profileSpace = x; } |
---|
| 203 | |
---|
| 204 | Bool getTierFlag() const { return m_tierFlag; } |
---|
| 205 | Void setTierFlag(Bool x) { m_tierFlag = x; } |
---|
| 206 | |
---|
| 207 | Int getProfileIdc() const { return m_profileIdc; } |
---|
| 208 | Void setProfileIdc(Int x) { m_profileIdc = x; } |
---|
| 209 | |
---|
| 210 | Bool getProfileCompatibilityFlag(Int i) const { return m_profileCompatibilityFlag[i]; } |
---|
| 211 | Void setProfileCompatibilityFlag(Int i, Bool x) { m_profileCompatibilityFlag[i] = x; } |
---|
| 212 | |
---|
| 213 | Int getLevelIdc() const { return m_levelIdc; } |
---|
| 214 | Void setLevelIdc(Int x) { m_levelIdc = x; } |
---|
| 215 | |
---|
| 216 | Bool getProgressiveSourceFlag() const { return m_progressiveSourceFlag; } |
---|
| 217 | Void setProgressiveSourceFlag(Bool b) { m_progressiveSourceFlag = b; } |
---|
| 218 | |
---|
| 219 | Bool getInterlacedSourceFlag() const { return m_interlacedSourceFlag; } |
---|
| 220 | Void setInterlacedSourceFlag(Bool b) { m_interlacedSourceFlag = b; } |
---|
| 221 | |
---|
| 222 | Bool getNonPackedConstraintFlag() const { return m_nonPackedConstraintFlag; } |
---|
| 223 | Void setNonPackedConstraintFlag(Bool b) { m_nonPackedConstraintFlag = b; } |
---|
| 224 | |
---|
| 225 | Bool getFrameOnlyConstraintFlag() const { return m_frameOnlyConstraintFlag; } |
---|
| 226 | Void setFrameOnlyConstraintFlag(Bool b) { m_frameOnlyConstraintFlag = b; } |
---|
| 227 | #if VPS_EXTN_PROFILE_INFO |
---|
| 228 | Void copyProfileInfo(ProfileTierLevel *ptl); |
---|
| 229 | #endif |
---|
| 230 | }; |
---|
| 231 | |
---|
| 232 | |
---|
| 233 | class TComPTL |
---|
| 234 | { |
---|
| 235 | ProfileTierLevel m_generalPTL; |
---|
| 236 | ProfileTierLevel m_subLayerPTL[6]; // max. value of max_sub_layers_minus1 is 6 |
---|
| 237 | Bool m_subLayerProfilePresentFlag[6]; |
---|
| 238 | Bool m_subLayerLevelPresentFlag[6]; |
---|
| 239 | |
---|
| 240 | public: |
---|
| 241 | TComPTL(); |
---|
| 242 | Bool getSubLayerProfilePresentFlag(Int i) const { return m_subLayerProfilePresentFlag[i]; } |
---|
| 243 | Void setSubLayerProfilePresentFlag(Int i, Bool x) { m_subLayerProfilePresentFlag[i] = x; } |
---|
| 244 | |
---|
| 245 | Bool getSubLayerLevelPresentFlag(Int i) const { return m_subLayerLevelPresentFlag[i]; } |
---|
| 246 | Void setSubLayerLevelPresentFlag(Int i, Bool x) { m_subLayerLevelPresentFlag[i] = x; } |
---|
| 247 | |
---|
| 248 | ProfileTierLevel* getGeneralPTL() { return &m_generalPTL; } |
---|
| 249 | ProfileTierLevel* getSubLayerPTL(Int i) { return &m_subLayerPTL[i]; } |
---|
| 250 | #if VPS_EXTN_PROFILE_INFO |
---|
| 251 | Void copyProfileInfo(TComPTL *ptl); |
---|
| 252 | #endif |
---|
| 253 | }; |
---|
| 254 | /// VPS class |
---|
| 255 | |
---|
| 256 | struct HrdSubLayerInfo |
---|
| 257 | { |
---|
| 258 | Bool fixedPicRateFlag; |
---|
| 259 | Bool fixedPicRateWithinCvsFlag; |
---|
| 260 | UInt picDurationInTcMinus1; |
---|
| 261 | Bool lowDelayHrdFlag; |
---|
| 262 | UInt cpbCntMinus1; |
---|
| 263 | UInt bitRateValueMinus1[MAX_CPB_CNT][2]; |
---|
| 264 | UInt cpbSizeValue [MAX_CPB_CNT][2]; |
---|
| 265 | UInt ducpbSizeValue [MAX_CPB_CNT][2]; |
---|
| 266 | UInt cbrFlag [MAX_CPB_CNT][2]; |
---|
| 267 | UInt duBitRateValue [MAX_CPB_CNT][2]; |
---|
| 268 | }; |
---|
| 269 | |
---|
| 270 | class TComHRD |
---|
| 271 | { |
---|
| 272 | private: |
---|
| 273 | Bool m_nalHrdParametersPresentFlag; |
---|
| 274 | Bool m_vclHrdParametersPresentFlag; |
---|
| 275 | Bool m_subPicCpbParamsPresentFlag; |
---|
| 276 | UInt m_tickDivisorMinus2; |
---|
| 277 | UInt m_duCpbRemovalDelayLengthMinus1; |
---|
| 278 | Bool m_subPicCpbParamsInPicTimingSEIFlag; |
---|
| 279 | UInt m_dpbOutputDelayDuLengthMinus1; |
---|
| 280 | UInt m_bitRateScale; |
---|
| 281 | UInt m_cpbSizeScale; |
---|
| 282 | UInt m_ducpbSizeScale; |
---|
| 283 | UInt m_initialCpbRemovalDelayLengthMinus1; |
---|
| 284 | UInt m_cpbRemovalDelayLengthMinus1; |
---|
| 285 | UInt m_dpbOutputDelayLengthMinus1; |
---|
| 286 | UInt m_numDU; |
---|
| 287 | HrdSubLayerInfo m_HRD[MAX_TLAYER]; |
---|
| 288 | |
---|
| 289 | public: |
---|
| 290 | TComHRD() |
---|
| 291 | :m_nalHrdParametersPresentFlag(0) |
---|
| 292 | ,m_vclHrdParametersPresentFlag(0) |
---|
| 293 | ,m_subPicCpbParamsPresentFlag(false) |
---|
| 294 | ,m_tickDivisorMinus2(0) |
---|
| 295 | ,m_duCpbRemovalDelayLengthMinus1(0) |
---|
| 296 | ,m_subPicCpbParamsInPicTimingSEIFlag(false) |
---|
| 297 | ,m_dpbOutputDelayDuLengthMinus1(0) |
---|
| 298 | ,m_bitRateScale(0) |
---|
| 299 | ,m_cpbSizeScale(0) |
---|
| 300 | ,m_initialCpbRemovalDelayLengthMinus1(0) |
---|
| 301 | ,m_cpbRemovalDelayLengthMinus1(0) |
---|
| 302 | ,m_dpbOutputDelayLengthMinus1(0) |
---|
| 303 | {} |
---|
| 304 | |
---|
| 305 | virtual ~TComHRD() {} |
---|
| 306 | |
---|
| 307 | Void setNalHrdParametersPresentFlag ( Bool flag ) { m_nalHrdParametersPresentFlag = flag; } |
---|
| 308 | Bool getNalHrdParametersPresentFlag ( ) { return m_nalHrdParametersPresentFlag; } |
---|
| 309 | |
---|
| 310 | Void setVclHrdParametersPresentFlag ( Bool flag ) { m_vclHrdParametersPresentFlag = flag; } |
---|
| 311 | Bool getVclHrdParametersPresentFlag ( ) { return m_vclHrdParametersPresentFlag; } |
---|
| 312 | |
---|
| 313 | Void setSubPicCpbParamsPresentFlag ( Bool flag ) { m_subPicCpbParamsPresentFlag = flag; } |
---|
| 314 | Bool getSubPicCpbParamsPresentFlag ( ) { return m_subPicCpbParamsPresentFlag; } |
---|
| 315 | |
---|
| 316 | Void setTickDivisorMinus2 ( UInt value ) { m_tickDivisorMinus2 = value; } |
---|
| 317 | UInt getTickDivisorMinus2 ( ) { return m_tickDivisorMinus2; } |
---|
| 318 | |
---|
| 319 | Void setDuCpbRemovalDelayLengthMinus1 ( UInt value ) { m_duCpbRemovalDelayLengthMinus1 = value; } |
---|
| 320 | UInt getDuCpbRemovalDelayLengthMinus1 ( ) { return m_duCpbRemovalDelayLengthMinus1; } |
---|
| 321 | |
---|
| 322 | Void setSubPicCpbParamsInPicTimingSEIFlag ( Bool flag) { m_subPicCpbParamsInPicTimingSEIFlag = flag; } |
---|
| 323 | Bool getSubPicCpbParamsInPicTimingSEIFlag () { return m_subPicCpbParamsInPicTimingSEIFlag; } |
---|
| 324 | |
---|
| 325 | Void setDpbOutputDelayDuLengthMinus1 (UInt value ) { m_dpbOutputDelayDuLengthMinus1 = value; } |
---|
| 326 | UInt getDpbOutputDelayDuLengthMinus1 () { return m_dpbOutputDelayDuLengthMinus1; } |
---|
| 327 | |
---|
| 328 | Void setBitRateScale ( UInt value ) { m_bitRateScale = value; } |
---|
| 329 | UInt getBitRateScale ( ) { return m_bitRateScale; } |
---|
| 330 | |
---|
| 331 | Void setCpbSizeScale ( UInt value ) { m_cpbSizeScale = value; } |
---|
| 332 | UInt getCpbSizeScale ( ) { return m_cpbSizeScale; } |
---|
| 333 | Void setDuCpbSizeScale ( UInt value ) { m_ducpbSizeScale = value; } |
---|
| 334 | UInt getDuCpbSizeScale ( ) { return m_ducpbSizeScale; } |
---|
| 335 | |
---|
| 336 | Void setInitialCpbRemovalDelayLengthMinus1( UInt value ) { m_initialCpbRemovalDelayLengthMinus1 = value; } |
---|
| 337 | UInt getInitialCpbRemovalDelayLengthMinus1( ) { return m_initialCpbRemovalDelayLengthMinus1; } |
---|
| 338 | |
---|
| 339 | Void setCpbRemovalDelayLengthMinus1 ( UInt value ) { m_cpbRemovalDelayLengthMinus1 = value; } |
---|
| 340 | UInt getCpbRemovalDelayLengthMinus1 ( ) { return m_cpbRemovalDelayLengthMinus1; } |
---|
| 341 | |
---|
| 342 | Void setDpbOutputDelayLengthMinus1 ( UInt value ) { m_dpbOutputDelayLengthMinus1 = value; } |
---|
| 343 | UInt getDpbOutputDelayLengthMinus1 ( ) { return m_dpbOutputDelayLengthMinus1; } |
---|
| 344 | |
---|
| 345 | Void setFixedPicRateFlag ( Int layer, Bool flag ) { m_HRD[layer].fixedPicRateFlag = flag; } |
---|
| 346 | Bool getFixedPicRateFlag ( Int layer ) { return m_HRD[layer].fixedPicRateFlag; } |
---|
| 347 | |
---|
| 348 | Void setFixedPicRateWithinCvsFlag ( Int layer, Bool flag ) { m_HRD[layer].fixedPicRateWithinCvsFlag = flag; } |
---|
| 349 | Bool getFixedPicRateWithinCvsFlag ( Int layer ) { return m_HRD[layer].fixedPicRateWithinCvsFlag; } |
---|
| 350 | |
---|
| 351 | Void setPicDurationInTcMinus1 ( Int layer, UInt value ) { m_HRD[layer].picDurationInTcMinus1 = value; } |
---|
| 352 | UInt getPicDurationInTcMinus1 ( Int layer ) { return m_HRD[layer].picDurationInTcMinus1; } |
---|
| 353 | |
---|
| 354 | Void setLowDelayHrdFlag ( Int layer, Bool flag ) { m_HRD[layer].lowDelayHrdFlag = flag; } |
---|
| 355 | Bool getLowDelayHrdFlag ( Int layer ) { return m_HRD[layer].lowDelayHrdFlag; } |
---|
| 356 | |
---|
| 357 | Void setCpbCntMinus1 ( Int layer, UInt value ) { m_HRD[layer].cpbCntMinus1 = value; } |
---|
| 358 | UInt getCpbCntMinus1 ( Int layer ) { return m_HRD[layer].cpbCntMinus1; } |
---|
| 359 | |
---|
| 360 | Void setBitRateValueMinus1 ( Int layer, Int cpbcnt, Int nalOrVcl, UInt value ) { m_HRD[layer].bitRateValueMinus1[cpbcnt][nalOrVcl] = value; } |
---|
| 361 | UInt getBitRateValueMinus1 ( Int layer, Int cpbcnt, Int nalOrVcl ) { return m_HRD[layer].bitRateValueMinus1[cpbcnt][nalOrVcl]; } |
---|
| 362 | |
---|
| 363 | Void setCpbSizeValueMinus1 ( Int layer, Int cpbcnt, Int nalOrVcl, UInt value ) { m_HRD[layer].cpbSizeValue[cpbcnt][nalOrVcl] = value; } |
---|
| 364 | UInt getCpbSizeValueMinus1 ( Int layer, Int cpbcnt, Int nalOrVcl ) { return m_HRD[layer].cpbSizeValue[cpbcnt][nalOrVcl]; } |
---|
| 365 | Void setDuCpbSizeValueMinus1 ( Int layer, Int cpbcnt, Int nalOrVcl, UInt value ) { m_HRD[layer].ducpbSizeValue[cpbcnt][nalOrVcl] = value; } |
---|
| 366 | UInt getDuCpbSizeValueMinus1 ( Int layer, Int cpbcnt, Int nalOrVcl ) { return m_HRD[layer].ducpbSizeValue[cpbcnt][nalOrVcl]; } |
---|
| 367 | Void setDuBitRateValueMinus1 ( Int layer, Int cpbcnt, Int nalOrVcl, UInt value ) { m_HRD[layer].duBitRateValue[cpbcnt][nalOrVcl] = value; } |
---|
| 368 | UInt getDuBitRateValueMinus1 (Int layer, Int cpbcnt, Int nalOrVcl ) { return m_HRD[layer].duBitRateValue[cpbcnt][nalOrVcl]; } |
---|
| 369 | Void setCbrFlag ( Int layer, Int cpbcnt, Int nalOrVcl, UInt value ) { m_HRD[layer].cbrFlag[cpbcnt][nalOrVcl] = value; } |
---|
| 370 | Bool getCbrFlag ( Int layer, Int cpbcnt, Int nalOrVcl ) { return m_HRD[layer].cbrFlag[cpbcnt][nalOrVcl]; } |
---|
| 371 | |
---|
| 372 | Void setNumDU ( UInt value ) { m_numDU = value; } |
---|
| 373 | UInt getNumDU ( ) { return m_numDU; } |
---|
| 374 | Bool getCpbDpbDelaysPresentFlag() { return getNalHrdParametersPresentFlag() || getVclHrdParametersPresentFlag(); } |
---|
| 375 | }; |
---|
| 376 | |
---|
| 377 | class TimingInfo |
---|
| 378 | { |
---|
| 379 | Bool m_timingInfoPresentFlag; |
---|
| 380 | UInt m_numUnitsInTick; |
---|
| 381 | UInt m_timeScale; |
---|
| 382 | Bool m_pocProportionalToTimingFlag; |
---|
| 383 | Int m_numTicksPocDiffOneMinus1; |
---|
| 384 | public: |
---|
| 385 | TimingInfo() |
---|
| 386 | : m_timingInfoPresentFlag(false) |
---|
| 387 | , m_numUnitsInTick(1001) |
---|
| 388 | , m_timeScale(60000) |
---|
| 389 | , m_pocProportionalToTimingFlag(false) |
---|
| 390 | , m_numTicksPocDiffOneMinus1(0) {} |
---|
| 391 | |
---|
| 392 | Void setTimingInfoPresentFlag ( Bool flag ) { m_timingInfoPresentFlag = flag; } |
---|
| 393 | Bool getTimingInfoPresentFlag ( ) { return m_timingInfoPresentFlag; } |
---|
| 394 | |
---|
| 395 | Void setNumUnitsInTick ( UInt value ) { m_numUnitsInTick = value; } |
---|
| 396 | UInt getNumUnitsInTick ( ) { return m_numUnitsInTick; } |
---|
| 397 | |
---|
| 398 | Void setTimeScale ( UInt value ) { m_timeScale = value; } |
---|
| 399 | UInt getTimeScale ( ) { return m_timeScale; } |
---|
| 400 | |
---|
| 401 | Bool getPocProportionalToTimingFlag ( ) { return m_pocProportionalToTimingFlag; } |
---|
| 402 | Void setPocProportionalToTimingFlag (Bool x ) { m_pocProportionalToTimingFlag = x; } |
---|
| 403 | |
---|
| 404 | Int getNumTicksPocDiffOneMinus1 ( ) { return m_numTicksPocDiffOneMinus1; } |
---|
| 405 | Void setNumTicksPocDiffOneMinus1 (Int x ) { m_numTicksPocDiffOneMinus1 = x; } |
---|
| 406 | }; |
---|
| 407 | |
---|
| 408 | class TComVPS |
---|
| 409 | { |
---|
| 410 | private: |
---|
| 411 | Int m_VPSId; |
---|
| 412 | UInt m_uiMaxTLayers; |
---|
| 413 | UInt m_uiMaxLayers; |
---|
| 414 | Bool m_bTemporalIdNestingFlag; |
---|
| 415 | |
---|
| 416 | UInt m_numReorderPics[MAX_TLAYER]; |
---|
| 417 | UInt m_uiMaxDecPicBuffering[MAX_TLAYER]; |
---|
| 418 | UInt m_uiMaxLatencyIncrease[MAX_TLAYER]; // Really max latency increase plus 1 (value 0 expresses no limit) |
---|
| 419 | |
---|
| 420 | UInt m_numHrdParameters; |
---|
| 421 | #if !VPS_RENAME |
---|
| 422 | UInt m_maxNuhReservedZeroLayerId; |
---|
| 423 | #endif |
---|
| 424 | TComHRD* m_hrdParameters; |
---|
| 425 | UInt* m_hrdOpSetIdx; |
---|
| 426 | Bool* m_cprmsPresentFlag; |
---|
| 427 | #if VPS_RENAME |
---|
| 428 | UInt m_maxLayerId; |
---|
| 429 | UInt m_numLayerSets; |
---|
| 430 | Bool m_layerIdIncludedFlag[MAX_VPS_LAYER_SETS_PLUS1][MAX_VPS_LAYER_ID_PLUS1]; |
---|
| 431 | #else |
---|
| 432 | UInt m_numOpSets; |
---|
| 433 | Bool m_layerIdIncludedFlag[MAX_VPS_OP_SETS_PLUS1][MAX_VPS_NUH_RESERVED_ZERO_LAYER_ID_PLUS1]; |
---|
| 434 | #endif |
---|
| 435 | #if DERIVE_LAYER_ID_LIST_VARIABLES |
---|
| 436 | Int m_layerSetLayerIdList[MAX_VPS_LAYER_SETS_PLUS1][MAX_VPS_LAYER_ID_PLUS1]; |
---|
| 437 | Int m_numLayerInIdList[MAX_VPS_LAYER_SETS_PLUS1]; |
---|
| 438 | #endif |
---|
| 439 | TComPTL m_pcPTL; |
---|
| 440 | TimingInfo m_timingInfo; |
---|
| 441 | |
---|
| 442 | // ------------------------------------------ |
---|
| 443 | // Variables related to VPS extensions |
---|
| 444 | // ------------------------------------------ |
---|
| 445 | #if VPS_EXTN_MASK_AND_DIM_INFO |
---|
| 446 | Bool m_avcBaseLayerFlag; // For now, always set to true. |
---|
| 447 | Bool m_splittingFlag; |
---|
| 448 | Bool m_scalabilityMask[MAX_VPS_NUM_SCALABILITY_TYPES]; |
---|
| 449 | UInt m_dimensionIdLen[MAX_VPS_NUM_SCALABILITY_TYPES]; |
---|
| 450 | Bool m_nuhLayerIdPresentFlag; |
---|
| 451 | UInt m_layerIdInNuh[MAX_VPS_LAYER_ID_PLUS1]; // Maps layer ID in the VPS with layer_id_in_nuh |
---|
| 452 | UInt m_dimensionId[MAX_VPS_LAYER_ID_PLUS1][MAX_VPS_NUM_SCALABILITY_TYPES]; |
---|
| 453 | |
---|
| 454 | // Below are derived variables |
---|
| 455 | UInt m_numScalabilityTypes; |
---|
| 456 | UInt m_layerIdInVps[MAX_VPS_LAYER_ID_PLUS1]; // Maps layer_id_in_nuh with the layer ID in the VPS |
---|
| 457 | #endif |
---|
[328] | 458 | #if ILP_SSH_SIG |
---|
| 459 | Bool m_ilpSshSignalingEnabledFlag; |
---|
| 460 | #endif |
---|
[313] | 461 | #if VPS_EXTN_PROFILE_INFO |
---|
| 462 | // Profile-tier-level signalling related |
---|
| 463 | Bool m_profilePresentFlag[MAX_VPS_LAYER_SETS_PLUS1]; // The value with index 0 will not be used. |
---|
| 464 | UInt m_profileLayerSetRef[MAX_VPS_LAYER_SETS_PLUS1]; // The value with index 0 will not be used. |
---|
| 465 | std::vector<TComPTL> m_pcPTLForExtn; |
---|
| 466 | #endif |
---|
| 467 | #if VPS_EXTN_OP_LAYER_SETS |
---|
| 468 | // .. More declarations here |
---|
| 469 | // Target output layer signalling related |
---|
| 470 | UInt m_numOutputLayerSets; |
---|
| 471 | UInt m_outputLayerSetIdx[MAX_VPS_LAYER_SETS_PLUS1]; |
---|
| 472 | Bool m_outputLayerFlag[MAX_VPS_LAYER_SETS_PLUS1][MAX_VPS_LAYER_ID_PLUS1]; |
---|
| 473 | #endif |
---|
| 474 | #if VPS_EXTN_DIRECT_REF_LAYERS |
---|
| 475 | Bool m_directDependencyFlag[MAX_VPS_LAYER_ID_PLUS1][MAX_VPS_LAYER_ID_PLUS1]; |
---|
| 476 | UInt m_numDirectRefLayers[MAX_VPS_LAYER_ID_PLUS1]; |
---|
| 477 | UInt m_refLayerId[MAX_VPS_LAYER_ID_PLUS1][MAX_VPS_LAYER_ID_PLUS1]; |
---|
| 478 | #if M0457_PREDICTION_INDICATIONS |
---|
| 479 | UInt m_directDepTypeLen; |
---|
| 480 | UInt m_directDependencyType[MAX_VPS_LAYER_ID_PLUS1][MAX_VPS_LAYER_ID_PLUS1]; |
---|
| 481 | #endif |
---|
| 482 | #endif |
---|
| 483 | #if VPS_PROFILE_OUTPUT_LAYERS |
---|
| 484 | UInt m_numProfileTierLevel; |
---|
| 485 | Bool m_moreOutputLayerSetsThanDefaultFlag; |
---|
| 486 | Int m_numAddOutputLayerSets; |
---|
| 487 | Bool m_defaultOneTargetOutputLayerFlag; |
---|
| 488 | Int m_profileLevelTierIdx[64]; |
---|
| 489 | #endif |
---|
| 490 | #if JCTVC_M0458_INTERLAYER_RPS_SIG |
---|
| 491 | Bool m_maxOneActiveRefLayerFlag; |
---|
| 492 | #endif |
---|
| 493 | #if JCTVC_M0203_INTERLAYER_PRED_IDC |
---|
| 494 | UInt m_maxSublayerForIlpPlus1[MAX_VPS_LAYER_ID_PLUS1 - 1]; |
---|
| 495 | #endif |
---|
[337] | 496 | #if N0120_MAX_TID_REF_PRESENT_FLAG |
---|
| 497 | Bool m_maxTidIlRefPicsPlus1PresentFlag; |
---|
| 498 | #endif |
---|
[313] | 499 | #if M0040_ADAPTIVE_RESOLUTION_CHANGE |
---|
| 500 | Bool m_singleLayerForNonIrapFlag; |
---|
| 501 | #endif |
---|
| 502 | public: |
---|
| 503 | TComVPS(); |
---|
| 504 | virtual ~TComVPS(); |
---|
| 505 | |
---|
| 506 | Void createHrdParamBuffer() |
---|
| 507 | { |
---|
| 508 | m_hrdParameters = new TComHRD[ getNumHrdParameters() ]; |
---|
| 509 | m_hrdOpSetIdx = new UInt [ getNumHrdParameters() ]; |
---|
| 510 | m_cprmsPresentFlag = new Bool [ getNumHrdParameters() ]; |
---|
| 511 | } |
---|
| 512 | |
---|
| 513 | TComHRD* getHrdParameters ( UInt i ) { return &m_hrdParameters[ i ]; } |
---|
| 514 | UInt getHrdOpSetIdx ( UInt i ) { return m_hrdOpSetIdx[ i ]; } |
---|
| 515 | Void setHrdOpSetIdx ( UInt val, UInt i ) { m_hrdOpSetIdx[ i ] = val; } |
---|
| 516 | Bool getCprmsPresentFlag ( UInt i ) { return m_cprmsPresentFlag[ i ]; } |
---|
| 517 | Void setCprmsPresentFlag ( Bool val, UInt i ) { m_cprmsPresentFlag[ i ] = val; } |
---|
| 518 | |
---|
| 519 | Int getVPSId () { return m_VPSId; } |
---|
| 520 | Void setVPSId (Int i) { m_VPSId = i; } |
---|
| 521 | |
---|
| 522 | UInt getMaxTLayers () { return m_uiMaxTLayers; } |
---|
| 523 | Void setMaxTLayers (UInt t) { m_uiMaxTLayers = t; } |
---|
| 524 | |
---|
| 525 | UInt getMaxLayers () { return m_uiMaxLayers; } |
---|
| 526 | Void setMaxLayers (UInt l) { m_uiMaxLayers = l; } |
---|
| 527 | |
---|
| 528 | Bool getTemporalNestingFlag () { return m_bTemporalIdNestingFlag; } |
---|
| 529 | Void setTemporalNestingFlag (Bool t) { m_bTemporalIdNestingFlag = t; } |
---|
| 530 | |
---|
| 531 | Void setNumReorderPics(UInt v, UInt tLayer) { m_numReorderPics[tLayer] = v; } |
---|
| 532 | UInt getNumReorderPics(UInt tLayer) { return m_numReorderPics[tLayer]; } |
---|
| 533 | |
---|
| 534 | Void setMaxDecPicBuffering(UInt v, UInt tLayer) { m_uiMaxDecPicBuffering[tLayer] = v; } |
---|
| 535 | UInt getMaxDecPicBuffering(UInt tLayer) { return m_uiMaxDecPicBuffering[tLayer]; } |
---|
| 536 | |
---|
| 537 | Void setMaxLatencyIncrease(UInt v, UInt tLayer) { m_uiMaxLatencyIncrease[tLayer] = v; } |
---|
| 538 | UInt getMaxLatencyIncrease(UInt tLayer) { return m_uiMaxLatencyIncrease[tLayer]; } |
---|
| 539 | |
---|
| 540 | UInt getNumHrdParameters() { return m_numHrdParameters; } |
---|
| 541 | Void setNumHrdParameters(UInt v) { m_numHrdParameters = v; } |
---|
| 542 | |
---|
| 543 | #if VPS_RENAME |
---|
| 544 | UInt getMaxLayerId() { return m_maxLayerId; } |
---|
| 545 | Void setMaxLayerId(UInt v) { m_maxLayerId = v; } |
---|
| 546 | |
---|
| 547 | UInt getNumLayerSets() { return m_numLayerSets; } |
---|
| 548 | Void setNumLayerSets(UInt v) { m_numLayerSets = v; } |
---|
| 549 | #else |
---|
| 550 | UInt getMaxNuhReservedZeroLayerId() { return m_maxNuhReservedZeroLayerId; } |
---|
| 551 | Void setMaxNuhReservedZeroLayerId(UInt v) { m_maxNuhReservedZeroLayerId = v; } |
---|
| 552 | |
---|
| 553 | UInt getMaxOpSets() { return m_numOpSets; } |
---|
| 554 | Void setMaxOpSets(UInt v) { m_numOpSets = v; } |
---|
| 555 | #endif |
---|
| 556 | Bool getLayerIdIncludedFlag(UInt opsIdx, UInt id) { return m_layerIdIncludedFlag[opsIdx][id]; } |
---|
| 557 | Void setLayerIdIncludedFlag(Bool v, UInt opsIdx, UInt id) { m_layerIdIncludedFlag[opsIdx][id] = v; } |
---|
| 558 | #if DERIVE_LAYER_ID_LIST_VARIABLES |
---|
| 559 | Int getLayerSetLayerIdList(Int set, Int layerId) { return m_layerSetLayerIdList[set][layerId]; } |
---|
| 560 | Void setLayerSetLayerIdList(Int set, Int layerId, Int x) { m_layerSetLayerIdList[set][layerId] = x ; } |
---|
| 561 | |
---|
| 562 | Int getNumLayersInIdList(Int set) { return m_numLayerInIdList[set]; } |
---|
| 563 | Void setNumLayersInIdList(Int set, Int x) { m_numLayerInIdList[set] = x ; } |
---|
| 564 | |
---|
| 565 | Void deriveLayerIdListVariables(); |
---|
| 566 | #endif |
---|
| 567 | TComPTL* getPTL() { return &m_pcPTL; } |
---|
| 568 | TimingInfo* getTimingInfo() { return &m_timingInfo; } |
---|
| 569 | #if VPS_EXTN_MASK_AND_DIM_INFO |
---|
| 570 | Bool getAvcBaseLayerFlag() { return m_avcBaseLayerFlag; } |
---|
| 571 | Void setAvcBaseLayerFlag(Bool x) { m_avcBaseLayerFlag = x; } |
---|
| 572 | |
---|
| 573 | Bool getSplittingFlag() { return m_splittingFlag; } |
---|
| 574 | Void setSplittingFlag(Bool x) { m_splittingFlag = x; } |
---|
| 575 | |
---|
| 576 | Bool getScalabilityMask(Int id) { return m_scalabilityMask[id]; } |
---|
| 577 | Void setScalabilityMask(Int id, Bool x) { m_scalabilityMask[id] = x; } |
---|
| 578 | |
---|
| 579 | UInt getDimensionIdLen(Int id) { return m_dimensionIdLen[id]; } |
---|
| 580 | Void setDimensionIdLen(Int id, UInt x) { m_dimensionIdLen[id] = x; } |
---|
| 581 | |
---|
| 582 | Bool getNuhLayerIdPresentFlag() { return m_nuhLayerIdPresentFlag; } |
---|
| 583 | Void setNuhLayerIdPresentFlag(Bool x) { m_nuhLayerIdPresentFlag = x; } |
---|
| 584 | |
---|
| 585 | UInt getLayerIdInNuh(Int id) { return m_layerIdInNuh[id]; } |
---|
| 586 | Void setLayerIdInNuh(Int id, UInt x) { m_layerIdInNuh[id] = x; } |
---|
| 587 | |
---|
| 588 | UInt getDimensionId(Int lyrId, Int id) { return m_dimensionId[lyrId][id]; } |
---|
| 589 | Void setDimensionId(Int lyrId, Int id, UInt x) { m_dimensionId[lyrId][id] = x; } |
---|
| 590 | |
---|
| 591 | UInt getNumScalabilityTypes() { return m_numScalabilityTypes; } |
---|
| 592 | Void setNumScalabilityTypes(UInt x) { m_numScalabilityTypes = x; } |
---|
| 593 | |
---|
| 594 | UInt getLayerIdInVps(Int id) { return m_layerIdInVps[id]; } |
---|
| 595 | Void setLayerIdInVps(Int id, UInt x) { m_layerIdInVps[id] = x; } |
---|
| 596 | #endif |
---|
[328] | 597 | #if ILP_SSH_SIG |
---|
| 598 | Bool getIlpSshSignalingEnabledFlag() { return m_ilpSshSignalingEnabledFlag;} |
---|
| 599 | Void setIlpSshSignalingEnabledFlag(Bool x) { m_ilpSshSignalingEnabledFlag = x;} |
---|
| 600 | #endif |
---|
[313] | 601 | #if VPS_EXTN_PROFILE_INFO |
---|
| 602 | Bool getProfilePresentFlag(Int id) { return m_profilePresentFlag[id]; } |
---|
| 603 | Void setProfilePresentFlag(Int id, Bool x) { m_profilePresentFlag[id] = x; } |
---|
| 604 | |
---|
| 605 | UInt getProfileLayerSetRef(Int id) { return m_profileLayerSetRef[id]; } |
---|
| 606 | Void setProfileLayerSetRef(Int id, Bool x) { m_profileLayerSetRef[id] = x; } |
---|
| 607 | |
---|
| 608 | std::vector<TComPTL>* getPTLForExtnPtr() { return &m_pcPTLForExtn; } |
---|
| 609 | TComPTL* getPTLForExtn(Int id) { return &m_pcPTLForExtn[id]; } |
---|
| 610 | #endif |
---|
| 611 | #if VPS_EXTN_OP_LAYER_SETS |
---|
| 612 | // Target output layer signalling related |
---|
| 613 | UInt getNumOutputLayerSets() { return m_numOutputLayerSets; } |
---|
| 614 | Void setNumOutputLayerSets(Int x) { m_numOutputLayerSets = x; } |
---|
| 615 | |
---|
| 616 | UInt getOutputLayerSetIdx(Int idx) { return m_outputLayerSetIdx[idx]; } |
---|
| 617 | Void setOutputLayerSetIdx(Int idx, UInt x) { m_outputLayerSetIdx[idx] = x; } |
---|
| 618 | |
---|
| 619 | Bool getOutputLayerFlag(Int layerSet, Int layerId) { return m_outputLayerFlag[layerSet][layerId]; } |
---|
| 620 | Void setOutputLayerFlag(Int layerSet, Int layerId, Bool x) { m_outputLayerFlag[layerSet][layerId] = x; } |
---|
| 621 | #endif |
---|
| 622 | #if VPS_EXTN_DIRECT_REF_LAYERS |
---|
| 623 | // Direct dependency of layers |
---|
| 624 | Bool getDirectDependencyFlag(Int currLayerId, Int refLayerId) { return m_directDependencyFlag[currLayerId][refLayerId]; } |
---|
| 625 | Void setDirectDependencyFlag(Int currLayerId, Int refLayerId, Bool x) { m_directDependencyFlag[currLayerId][refLayerId] = x; } |
---|
| 626 | |
---|
| 627 | UInt getNumDirectRefLayers(Int layerId) { return m_numDirectRefLayers[layerId]; } |
---|
| 628 | Void setNumDirectRefLayers(Int layerId, UInt refLayerNum) { m_numDirectRefLayers[layerId] = refLayerNum; } |
---|
| 629 | |
---|
| 630 | UInt getRefLayerId(Int layerId, Int refLayerIdx) { return m_refLayerId[layerId][refLayerIdx]; } |
---|
| 631 | Void setRefLayerId(Int layerId, Int refLayerIdx, UInt refLayerId) { m_refLayerId[layerId][refLayerIdx] = refLayerId; } |
---|
| 632 | |
---|
| 633 | #if M0457_PREDICTION_INDICATIONS |
---|
| 634 | UInt getDirectDepTypeLen() { return m_directDepTypeLen; } |
---|
| 635 | Void setDirectDepTypeLen(UInt x) { m_directDepTypeLen = x; } |
---|
| 636 | |
---|
| 637 | UInt getDirectDependencyType(Int currLayerId, Int refLayerId) { return m_directDependencyType[currLayerId][refLayerId]; } |
---|
| 638 | Void setDirectDependencyType(Int currLayerId, Int refLayerId, UInt x) { m_directDependencyType[currLayerId][refLayerId] = x; } |
---|
| 639 | #endif |
---|
| 640 | #endif |
---|
| 641 | #if VPS_PROFILE_OUTPUT_LAYERS |
---|
| 642 | UInt getNumProfileTierLevel() { return m_numProfileTierLevel; } |
---|
| 643 | Void setNumProfileTierLevel(Int x) { m_numProfileTierLevel = x; } |
---|
| 644 | |
---|
| 645 | Bool getMoreOutputLayerSetsThanDefaultFlag() { return m_moreOutputLayerSetsThanDefaultFlag;} |
---|
| 646 | Void setMoreOutputLayerSetsThanDefaultFlag(Bool x) { m_moreOutputLayerSetsThanDefaultFlag = x ;} |
---|
| 647 | |
---|
| 648 | Int getNumAddOutputLayerSets() { return m_numAddOutputLayerSets; } |
---|
| 649 | Void setNumAddOutputLayerSets(Int x) { m_numAddOutputLayerSets = x ; } |
---|
| 650 | |
---|
| 651 | Bool getDefaultOneTargetOutputLayerFlag() { return m_defaultOneTargetOutputLayerFlag;} |
---|
| 652 | Void setDefaultOneTargetOutputLayerFlag(Bool x) { m_defaultOneTargetOutputLayerFlag= x ;} |
---|
| 653 | |
---|
| 654 | Int getProfileLevelTierIdx(Int i) { return m_profileLevelTierIdx[i]; } |
---|
| 655 | Void setProfileLevelTierIdx(Int i, Int x) { m_profileLevelTierIdx[i] = x ; } |
---|
| 656 | #endif |
---|
| 657 | #if JCTVC_M0458_INTERLAYER_RPS_SIG |
---|
| 658 | Bool getMaxOneActiveRefLayerFlag() { return m_maxOneActiveRefLayerFlag; } |
---|
| 659 | Void setMaxOneActiveRefLayerFlag(Bool x) { m_maxOneActiveRefLayerFlag = x; } |
---|
| 660 | #endif |
---|
| 661 | #if JCTVC_M0203_INTERLAYER_PRED_IDC |
---|
| 662 | Bool getMaxSublayerForIlpPlus1(Int layerId) { return m_maxSublayerForIlpPlus1[layerId]; } |
---|
| 663 | Void setMaxSublayerForIlpPlus1(Int layerId, UInt maxSublayer) { m_maxSublayerForIlpPlus1[layerId] = maxSublayer; } |
---|
| 664 | #endif |
---|
[337] | 665 | #if N0120_MAX_TID_REF_PRESENT_FLAG |
---|
| 666 | Bool getMaxTidIlRefPicsPlus1PresentFlag() { return m_maxTidIlRefPicsPlus1PresentFlag ;} |
---|
| 667 | Void setMaxTidIlRefPicsPlus1PresentFlag(Bool x) { m_maxTidIlRefPicsPlus1PresentFlag = x;} |
---|
| 668 | #endif |
---|
[313] | 669 | #if M0040_ADAPTIVE_RESOLUTION_CHANGE |
---|
| 670 | Bool getSingleLayerForNonIrapFlag() { return m_singleLayerForNonIrapFlag; } |
---|
| 671 | Void setSingleLayerForNonIrapFlag(Bool x) { m_singleLayerForNonIrapFlag = x; } |
---|
| 672 | #endif |
---|
| 673 | }; |
---|
| 674 | |
---|
| 675 | class Window |
---|
| 676 | { |
---|
| 677 | private: |
---|
| 678 | Bool m_enabledFlag; |
---|
| 679 | Int m_winLeftOffset; |
---|
| 680 | Int m_winRightOffset; |
---|
| 681 | Int m_winTopOffset; |
---|
| 682 | Int m_winBottomOffset; |
---|
| 683 | public: |
---|
| 684 | Window() |
---|
| 685 | : m_enabledFlag (false) |
---|
| 686 | , m_winLeftOffset (0) |
---|
| 687 | , m_winRightOffset (0) |
---|
| 688 | , m_winTopOffset (0) |
---|
| 689 | , m_winBottomOffset (0) |
---|
| 690 | { } |
---|
| 691 | |
---|
| 692 | Bool getWindowEnabledFlag() const { return m_enabledFlag; } |
---|
| 693 | Void resetWindow() { m_enabledFlag = false; m_winLeftOffset = m_winRightOffset = m_winTopOffset = m_winBottomOffset = 0; } |
---|
| 694 | Int getWindowLeftOffset() const { return m_enabledFlag ? m_winLeftOffset : 0; } |
---|
| 695 | Void setWindowLeftOffset(Int val) { m_winLeftOffset = val; m_enabledFlag = true; } |
---|
| 696 | Int getWindowRightOffset() const { return m_enabledFlag ? m_winRightOffset : 0; } |
---|
| 697 | Void setWindowRightOffset(Int val) { m_winRightOffset = val; m_enabledFlag = true; } |
---|
| 698 | Int getWindowTopOffset() const { return m_enabledFlag ? m_winTopOffset : 0; } |
---|
| 699 | Void setWindowTopOffset(Int val) { m_winTopOffset = val; m_enabledFlag = true; } |
---|
| 700 | Int getWindowBottomOffset() const { return m_enabledFlag ? m_winBottomOffset: 0; } |
---|
| 701 | Void setWindowBottomOffset(Int val) { m_winBottomOffset = val; m_enabledFlag = true; } |
---|
| 702 | |
---|
| 703 | Void setWindow(Int offsetLeft, Int offsetLRight, Int offsetLTop, Int offsetLBottom) |
---|
| 704 | { |
---|
| 705 | m_enabledFlag = true; |
---|
| 706 | m_winLeftOffset = offsetLeft; |
---|
| 707 | m_winRightOffset = offsetLRight; |
---|
| 708 | m_winTopOffset = offsetLTop; |
---|
| 709 | m_winBottomOffset = offsetLBottom; |
---|
| 710 | } |
---|
| 711 | }; |
---|
| 712 | |
---|
| 713 | |
---|
| 714 | class TComVUI |
---|
| 715 | { |
---|
| 716 | private: |
---|
| 717 | Bool m_aspectRatioInfoPresentFlag; |
---|
| 718 | Int m_aspectRatioIdc; |
---|
| 719 | Int m_sarWidth; |
---|
| 720 | Int m_sarHeight; |
---|
| 721 | Bool m_overscanInfoPresentFlag; |
---|
| 722 | Bool m_overscanAppropriateFlag; |
---|
| 723 | Bool m_videoSignalTypePresentFlag; |
---|
| 724 | Int m_videoFormat; |
---|
| 725 | Bool m_videoFullRangeFlag; |
---|
| 726 | Bool m_colourDescriptionPresentFlag; |
---|
| 727 | Int m_colourPrimaries; |
---|
| 728 | Int m_transferCharacteristics; |
---|
| 729 | Int m_matrixCoefficients; |
---|
| 730 | Bool m_chromaLocInfoPresentFlag; |
---|
| 731 | Int m_chromaSampleLocTypeTopField; |
---|
| 732 | Int m_chromaSampleLocTypeBottomField; |
---|
| 733 | Bool m_neutralChromaIndicationFlag; |
---|
| 734 | Bool m_fieldSeqFlag; |
---|
| 735 | |
---|
| 736 | Window m_defaultDisplayWindow; |
---|
| 737 | Bool m_frameFieldInfoPresentFlag; |
---|
| 738 | Bool m_hrdParametersPresentFlag; |
---|
| 739 | Bool m_bitstreamRestrictionFlag; |
---|
| 740 | Bool m_tilesFixedStructureFlag; |
---|
| 741 | Bool m_motionVectorsOverPicBoundariesFlag; |
---|
| 742 | Bool m_restrictedRefPicListsFlag; |
---|
| 743 | Int m_minSpatialSegmentationIdc; |
---|
| 744 | Int m_maxBytesPerPicDenom; |
---|
| 745 | Int m_maxBitsPerMinCuDenom; |
---|
| 746 | Int m_log2MaxMvLengthHorizontal; |
---|
| 747 | Int m_log2MaxMvLengthVertical; |
---|
| 748 | TComHRD m_hrdParameters; |
---|
| 749 | TimingInfo m_timingInfo; |
---|
| 750 | #if M0464_TILE_BOUNDARY_ALIGNED_FLAG |
---|
| 751 | Bool m_tileBoundariesAlignedFlag; |
---|
| 752 | #endif |
---|
| 753 | |
---|
| 754 | |
---|
| 755 | public: |
---|
| 756 | TComVUI() |
---|
| 757 | :m_aspectRatioInfoPresentFlag(false) |
---|
| 758 | ,m_aspectRatioIdc(0) |
---|
| 759 | ,m_sarWidth(0) |
---|
| 760 | ,m_sarHeight(0) |
---|
| 761 | ,m_overscanInfoPresentFlag(false) |
---|
| 762 | ,m_overscanAppropriateFlag(false) |
---|
| 763 | ,m_videoSignalTypePresentFlag(false) |
---|
| 764 | ,m_videoFormat(5) |
---|
| 765 | ,m_videoFullRangeFlag(false) |
---|
| 766 | ,m_colourDescriptionPresentFlag(false) |
---|
| 767 | ,m_colourPrimaries(2) |
---|
| 768 | ,m_transferCharacteristics(2) |
---|
| 769 | ,m_matrixCoefficients(2) |
---|
| 770 | ,m_chromaLocInfoPresentFlag(false) |
---|
| 771 | ,m_chromaSampleLocTypeTopField(0) |
---|
| 772 | ,m_chromaSampleLocTypeBottomField(0) |
---|
| 773 | ,m_neutralChromaIndicationFlag(false) |
---|
| 774 | ,m_fieldSeqFlag(false) |
---|
| 775 | ,m_frameFieldInfoPresentFlag(false) |
---|
| 776 | ,m_hrdParametersPresentFlag(false) |
---|
| 777 | ,m_bitstreamRestrictionFlag(false) |
---|
| 778 | ,m_tilesFixedStructureFlag(false) |
---|
| 779 | ,m_motionVectorsOverPicBoundariesFlag(true) |
---|
| 780 | ,m_restrictedRefPicListsFlag(1) |
---|
| 781 | ,m_minSpatialSegmentationIdc(0) |
---|
| 782 | ,m_maxBytesPerPicDenom(2) |
---|
| 783 | ,m_maxBitsPerMinCuDenom(1) |
---|
| 784 | ,m_log2MaxMvLengthHorizontal(15) |
---|
| 785 | ,m_log2MaxMvLengthVertical(15) |
---|
| 786 | #if M0464_TILE_BOUNDARY_ALIGNED_FLAG |
---|
| 787 | ,m_tileBoundariesAlignedFlag(true) |
---|
| 788 | #endif |
---|
| 789 | {} |
---|
| 790 | |
---|
| 791 | virtual ~TComVUI() {} |
---|
| 792 | |
---|
| 793 | Bool getAspectRatioInfoPresentFlag() { return m_aspectRatioInfoPresentFlag; } |
---|
| 794 | Void setAspectRatioInfoPresentFlag(Bool i) { m_aspectRatioInfoPresentFlag = i; } |
---|
| 795 | |
---|
| 796 | Int getAspectRatioIdc() { return m_aspectRatioIdc; } |
---|
| 797 | Void setAspectRatioIdc(Int i) { m_aspectRatioIdc = i; } |
---|
| 798 | |
---|
| 799 | Int getSarWidth() { return m_sarWidth; } |
---|
| 800 | Void setSarWidth(Int i) { m_sarWidth = i; } |
---|
| 801 | |
---|
| 802 | Int getSarHeight() { return m_sarHeight; } |
---|
| 803 | Void setSarHeight(Int i) { m_sarHeight = i; } |
---|
| 804 | |
---|
| 805 | Bool getOverscanInfoPresentFlag() { return m_overscanInfoPresentFlag; } |
---|
| 806 | Void setOverscanInfoPresentFlag(Bool i) { m_overscanInfoPresentFlag = i; } |
---|
| 807 | |
---|
| 808 | Bool getOverscanAppropriateFlag() { return m_overscanAppropriateFlag; } |
---|
| 809 | Void setOverscanAppropriateFlag(Bool i) { m_overscanAppropriateFlag = i; } |
---|
| 810 | |
---|
| 811 | Bool getVideoSignalTypePresentFlag() { return m_videoSignalTypePresentFlag; } |
---|
| 812 | Void setVideoSignalTypePresentFlag(Bool i) { m_videoSignalTypePresentFlag = i; } |
---|
| 813 | |
---|
| 814 | Int getVideoFormat() { return m_videoFormat; } |
---|
| 815 | Void setVideoFormat(Int i) { m_videoFormat = i; } |
---|
| 816 | |
---|
| 817 | Bool getVideoFullRangeFlag() { return m_videoFullRangeFlag; } |
---|
| 818 | Void setVideoFullRangeFlag(Bool i) { m_videoFullRangeFlag = i; } |
---|
| 819 | |
---|
| 820 | Bool getColourDescriptionPresentFlag() { return m_colourDescriptionPresentFlag; } |
---|
| 821 | Void setColourDescriptionPresentFlag(Bool i) { m_colourDescriptionPresentFlag = i; } |
---|
| 822 | |
---|
| 823 | Int getColourPrimaries() { return m_colourPrimaries; } |
---|
| 824 | Void setColourPrimaries(Int i) { m_colourPrimaries = i; } |
---|
| 825 | |
---|
| 826 | Int getTransferCharacteristics() { return m_transferCharacteristics; } |
---|
| 827 | Void setTransferCharacteristics(Int i) { m_transferCharacteristics = i; } |
---|
| 828 | |
---|
| 829 | Int getMatrixCoefficients() { return m_matrixCoefficients; } |
---|
| 830 | Void setMatrixCoefficients(Int i) { m_matrixCoefficients = i; } |
---|
| 831 | |
---|
| 832 | Bool getChromaLocInfoPresentFlag() { return m_chromaLocInfoPresentFlag; } |
---|
| 833 | Void setChromaLocInfoPresentFlag(Bool i) { m_chromaLocInfoPresentFlag = i; } |
---|
| 834 | |
---|
| 835 | Int getChromaSampleLocTypeTopField() { return m_chromaSampleLocTypeTopField; } |
---|
| 836 | Void setChromaSampleLocTypeTopField(Int i) { m_chromaSampleLocTypeTopField = i; } |
---|
| 837 | |
---|
| 838 | Int getChromaSampleLocTypeBottomField() { return m_chromaSampleLocTypeBottomField; } |
---|
| 839 | Void setChromaSampleLocTypeBottomField(Int i) { m_chromaSampleLocTypeBottomField = i; } |
---|
| 840 | |
---|
| 841 | Bool getNeutralChromaIndicationFlag() { return m_neutralChromaIndicationFlag; } |
---|
| 842 | Void setNeutralChromaIndicationFlag(Bool i) { m_neutralChromaIndicationFlag = i; } |
---|
| 843 | |
---|
| 844 | Bool getFieldSeqFlag() { return m_fieldSeqFlag; } |
---|
| 845 | Void setFieldSeqFlag(Bool i) { m_fieldSeqFlag = i; } |
---|
| 846 | |
---|
| 847 | Bool getFrameFieldInfoPresentFlag() { return m_frameFieldInfoPresentFlag; } |
---|
| 848 | Void setFrameFieldInfoPresentFlag(Bool i) { m_frameFieldInfoPresentFlag = i; } |
---|
| 849 | |
---|
| 850 | Window& getDefaultDisplayWindow() { return m_defaultDisplayWindow; } |
---|
| 851 | Void setDefaultDisplayWindow(Window& defaultDisplayWindow ) { m_defaultDisplayWindow = defaultDisplayWindow; } |
---|
| 852 | |
---|
| 853 | Bool getHrdParametersPresentFlag() { return m_hrdParametersPresentFlag; } |
---|
| 854 | Void setHrdParametersPresentFlag(Bool i) { m_hrdParametersPresentFlag = i; } |
---|
| 855 | |
---|
| 856 | Bool getBitstreamRestrictionFlag() { return m_bitstreamRestrictionFlag; } |
---|
| 857 | Void setBitstreamRestrictionFlag(Bool i) { m_bitstreamRestrictionFlag = i; } |
---|
| 858 | |
---|
| 859 | Bool getTilesFixedStructureFlag() { return m_tilesFixedStructureFlag; } |
---|
| 860 | Void setTilesFixedStructureFlag(Bool i) { m_tilesFixedStructureFlag = i; } |
---|
| 861 | |
---|
| 862 | Bool getMotionVectorsOverPicBoundariesFlag() { return m_motionVectorsOverPicBoundariesFlag; } |
---|
| 863 | Void setMotionVectorsOverPicBoundariesFlag(Bool i) { m_motionVectorsOverPicBoundariesFlag = i; } |
---|
| 864 | |
---|
| 865 | Bool getRestrictedRefPicListsFlag() { return m_restrictedRefPicListsFlag; } |
---|
| 866 | Void setRestrictedRefPicListsFlag(Bool b) { m_restrictedRefPicListsFlag = b; } |
---|
| 867 | |
---|
| 868 | Int getMinSpatialSegmentationIdc() { return m_minSpatialSegmentationIdc; } |
---|
| 869 | Void setMinSpatialSegmentationIdc(Int i) { m_minSpatialSegmentationIdc = i; } |
---|
| 870 | Int getMaxBytesPerPicDenom() { return m_maxBytesPerPicDenom; } |
---|
| 871 | Void setMaxBytesPerPicDenom(Int i) { m_maxBytesPerPicDenom = i; } |
---|
| 872 | |
---|
| 873 | Int getMaxBitsPerMinCuDenom() { return m_maxBitsPerMinCuDenom; } |
---|
| 874 | Void setMaxBitsPerMinCuDenom(Int i) { m_maxBitsPerMinCuDenom = i; } |
---|
| 875 | |
---|
| 876 | Int getLog2MaxMvLengthHorizontal() { return m_log2MaxMvLengthHorizontal; } |
---|
| 877 | Void setLog2MaxMvLengthHorizontal(Int i) { m_log2MaxMvLengthHorizontal = i; } |
---|
| 878 | |
---|
| 879 | Int getLog2MaxMvLengthVertical() { return m_log2MaxMvLengthVertical; } |
---|
| 880 | Void setLog2MaxMvLengthVertical(Int i) { m_log2MaxMvLengthVertical = i; } |
---|
| 881 | |
---|
| 882 | TComHRD* getHrdParameters () { return &m_hrdParameters; } |
---|
| 883 | TimingInfo* getTimingInfo() { return &m_timingInfo; } |
---|
| 884 | #if M0464_TILE_BOUNDARY_ALIGNED_FLAG |
---|
| 885 | Bool getTileBoundariesAlignedFlag( ) { return m_tileBoundariesAlignedFlag; } |
---|
| 886 | Void setTileBoundariesAlignedFlag( Bool flag ) { m_tileBoundariesAlignedFlag = flag; } |
---|
| 887 | #endif |
---|
| 888 | }; |
---|
| 889 | |
---|
| 890 | /// SPS class |
---|
| 891 | class TComSPS |
---|
| 892 | { |
---|
| 893 | private: |
---|
| 894 | Int m_SPSId; |
---|
| 895 | Int m_VPSId; |
---|
| 896 | Int m_chromaFormatIdc; |
---|
| 897 | |
---|
| 898 | UInt m_uiMaxTLayers; // maximum number of temporal layers |
---|
| 899 | |
---|
| 900 | // Structure |
---|
| 901 | UInt m_picWidthInLumaSamples; |
---|
| 902 | UInt m_picHeightInLumaSamples; |
---|
| 903 | |
---|
| 904 | Int m_log2MinCodingBlockSize; |
---|
| 905 | Int m_log2DiffMaxMinCodingBlockSize; |
---|
| 906 | UInt m_uiMaxCUWidth; |
---|
| 907 | UInt m_uiMaxCUHeight; |
---|
| 908 | UInt m_uiMaxCUDepth; |
---|
| 909 | |
---|
| 910 | Window m_conformanceWindow; |
---|
| 911 | |
---|
| 912 | TComRPSList m_RPSList; |
---|
| 913 | Bool m_bLongTermRefsPresent; |
---|
| 914 | Bool m_TMVPFlagsPresent; |
---|
| 915 | Int m_numReorderPics[MAX_TLAYER]; |
---|
| 916 | |
---|
| 917 | // Tool list |
---|
| 918 | UInt m_uiQuadtreeTULog2MaxSize; |
---|
| 919 | UInt m_uiQuadtreeTULog2MinSize; |
---|
| 920 | UInt m_uiQuadtreeTUMaxDepthInter; |
---|
| 921 | UInt m_uiQuadtreeTUMaxDepthIntra; |
---|
| 922 | Bool m_usePCM; |
---|
| 923 | UInt m_pcmLog2MaxSize; |
---|
| 924 | UInt m_uiPCMLog2MinSize; |
---|
| 925 | Bool m_useAMP; |
---|
| 926 | |
---|
| 927 | // Parameter |
---|
| 928 | Int m_bitDepthY; |
---|
| 929 | Int m_bitDepthC; |
---|
| 930 | Int m_qpBDOffsetY; |
---|
| 931 | Int m_qpBDOffsetC; |
---|
| 932 | |
---|
| 933 | Bool m_useLossless; |
---|
| 934 | |
---|
| 935 | UInt m_uiPCMBitDepthLuma; |
---|
| 936 | UInt m_uiPCMBitDepthChroma; |
---|
| 937 | Bool m_bPCMFilterDisableFlag; |
---|
| 938 | |
---|
| 939 | UInt m_uiBitsForPOC; |
---|
| 940 | UInt m_numLongTermRefPicSPS; |
---|
| 941 | UInt m_ltRefPicPocLsbSps[33]; |
---|
| 942 | Bool m_usedByCurrPicLtSPSFlag[33]; |
---|
| 943 | // Max physical transform size |
---|
| 944 | UInt m_uiMaxTrSize; |
---|
| 945 | |
---|
| 946 | Int m_iAMPAcc[MAX_CU_DEPTH]; |
---|
| 947 | Bool m_bUseSAO; |
---|
| 948 | |
---|
| 949 | Bool m_bTemporalIdNestingFlag; // temporal_id_nesting_flag |
---|
| 950 | |
---|
| 951 | Bool m_scalingListEnabledFlag; |
---|
| 952 | Bool m_scalingListPresentFlag; |
---|
| 953 | TComScalingList* m_scalingList; //!< ScalingList class pointer |
---|
| 954 | UInt m_uiMaxDecPicBuffering[MAX_TLAYER]; |
---|
| 955 | UInt m_uiMaxLatencyIncrease[MAX_TLAYER]; // Really max latency increase plus 1 (value 0 expresses no limit) |
---|
| 956 | |
---|
| 957 | Bool m_useDF; |
---|
| 958 | Bool m_useStrongIntraSmoothing; |
---|
| 959 | |
---|
| 960 | Bool m_vuiParametersPresentFlag; |
---|
| 961 | TComVUI m_vuiParameters; |
---|
| 962 | |
---|
| 963 | static const Int m_winUnitX[MAX_CHROMA_FORMAT_IDC+1]; |
---|
| 964 | static const Int m_winUnitY[MAX_CHROMA_FORMAT_IDC+1]; |
---|
| 965 | TComPTL m_pcPTL; |
---|
| 966 | |
---|
| 967 | #if M0463_VUI_EXT_ILP_REF |
---|
| 968 | Bool m_interViewMvVertConstraintFlag; |
---|
| 969 | Int m_numIlpRestrictedRefLayers ; |
---|
| 970 | Int m_minSpatialSegmentOffsetPlus1[MAX_LAYERS]; |
---|
| 971 | Bool m_ctuBasedOffsetEnabledFlag [MAX_LAYERS]; |
---|
| 972 | Int m_minHorizontalCtuOffsetPlus1 [MAX_LAYERS]; |
---|
| 973 | #endif |
---|
| 974 | |
---|
| 975 | #if SVC_EXTENSION |
---|
| 976 | UInt m_layerId; |
---|
| 977 | #endif |
---|
| 978 | #if REF_IDX_MFM |
---|
| 979 | #if !M0457_COL_PICTURE_SIGNALING |
---|
| 980 | Bool m_bMFMEnabledFlag; |
---|
| 981 | #endif |
---|
| 982 | #endif |
---|
| 983 | #if SCALED_REF_LAYER_OFFSETS |
---|
| 984 | UInt m_numScaledRefLayerOffsets; |
---|
| 985 | Window m_scaledRefLayerWindow[MAX_LAYERS]; |
---|
| 986 | #endif |
---|
| 987 | public: |
---|
| 988 | TComSPS(); |
---|
| 989 | virtual ~TComSPS(); |
---|
| 990 | |
---|
| 991 | Int getVPSId () { return m_VPSId; } |
---|
| 992 | Void setVPSId (Int i) { m_VPSId = i; } |
---|
| 993 | Int getSPSId () { return m_SPSId; } |
---|
| 994 | Void setSPSId (Int i) { m_SPSId = i; } |
---|
| 995 | Int getChromaFormatIdc () { return m_chromaFormatIdc; } |
---|
| 996 | Void setChromaFormatIdc (Int i) { m_chromaFormatIdc = i; } |
---|
| 997 | |
---|
| 998 | static Int getWinUnitX (Int chromaFormatIdc) { assert (chromaFormatIdc > 0 && chromaFormatIdc <= MAX_CHROMA_FORMAT_IDC); return m_winUnitX[chromaFormatIdc]; } |
---|
| 999 | static Int getWinUnitY (Int chromaFormatIdc) { assert (chromaFormatIdc > 0 && chromaFormatIdc <= MAX_CHROMA_FORMAT_IDC); return m_winUnitY[chromaFormatIdc]; } |
---|
| 1000 | |
---|
| 1001 | // structure |
---|
| 1002 | Void setPicWidthInLumaSamples ( UInt u ) { m_picWidthInLumaSamples = u; } |
---|
| 1003 | UInt getPicWidthInLumaSamples () { return m_picWidthInLumaSamples; } |
---|
| 1004 | Void setPicHeightInLumaSamples ( UInt u ) { m_picHeightInLumaSamples = u; } |
---|
| 1005 | UInt getPicHeightInLumaSamples () { return m_picHeightInLumaSamples; } |
---|
| 1006 | |
---|
| 1007 | Window& getConformanceWindow() { return m_conformanceWindow; } |
---|
| 1008 | Void setConformanceWindow(Window& conformanceWindow ) { m_conformanceWindow = conformanceWindow; } |
---|
| 1009 | |
---|
| 1010 | UInt getNumLongTermRefPicSPS() { return m_numLongTermRefPicSPS; } |
---|
| 1011 | Void setNumLongTermRefPicSPS(UInt val) { m_numLongTermRefPicSPS = val; } |
---|
| 1012 | |
---|
| 1013 | UInt getLtRefPicPocLsbSps(UInt index) { return m_ltRefPicPocLsbSps[index]; } |
---|
| 1014 | Void setLtRefPicPocLsbSps(UInt index, UInt val) { m_ltRefPicPocLsbSps[index] = val; } |
---|
| 1015 | |
---|
| 1016 | Bool getUsedByCurrPicLtSPSFlag(Int i) {return m_usedByCurrPicLtSPSFlag[i];} |
---|
| 1017 | Void setUsedByCurrPicLtSPSFlag(Int i, Bool x) { m_usedByCurrPicLtSPSFlag[i] = x;} |
---|
| 1018 | |
---|
| 1019 | Int getLog2MinCodingBlockSize() const { return m_log2MinCodingBlockSize; } |
---|
| 1020 | Void setLog2MinCodingBlockSize(Int val) { m_log2MinCodingBlockSize = val; } |
---|
| 1021 | Int getLog2DiffMaxMinCodingBlockSize() const { return m_log2DiffMaxMinCodingBlockSize; } |
---|
| 1022 | Void setLog2DiffMaxMinCodingBlockSize(Int val) { m_log2DiffMaxMinCodingBlockSize = val; } |
---|
| 1023 | |
---|
| 1024 | Void setMaxCUWidth ( UInt u ) { m_uiMaxCUWidth = u; } |
---|
| 1025 | UInt getMaxCUWidth () { return m_uiMaxCUWidth; } |
---|
| 1026 | Void setMaxCUHeight ( UInt u ) { m_uiMaxCUHeight = u; } |
---|
| 1027 | UInt getMaxCUHeight () { return m_uiMaxCUHeight; } |
---|
| 1028 | Void setMaxCUDepth ( UInt u ) { m_uiMaxCUDepth = u; } |
---|
| 1029 | UInt getMaxCUDepth () { return m_uiMaxCUDepth; } |
---|
| 1030 | Void setUsePCM ( Bool b ) { m_usePCM = b; } |
---|
| 1031 | Bool getUsePCM () { return m_usePCM; } |
---|
| 1032 | Void setPCMLog2MaxSize ( UInt u ) { m_pcmLog2MaxSize = u; } |
---|
| 1033 | UInt getPCMLog2MaxSize () { return m_pcmLog2MaxSize; } |
---|
| 1034 | Void setPCMLog2MinSize ( UInt u ) { m_uiPCMLog2MinSize = u; } |
---|
| 1035 | UInt getPCMLog2MinSize () { return m_uiPCMLog2MinSize; } |
---|
| 1036 | Void setBitsForPOC ( UInt u ) { m_uiBitsForPOC = u; } |
---|
| 1037 | UInt getBitsForPOC () { return m_uiBitsForPOC; } |
---|
| 1038 | Bool getUseAMP() { return m_useAMP; } |
---|
| 1039 | Void setUseAMP( Bool b ) { m_useAMP = b; } |
---|
| 1040 | Void setQuadtreeTULog2MaxSize( UInt u ) { m_uiQuadtreeTULog2MaxSize = u; } |
---|
| 1041 | UInt getQuadtreeTULog2MaxSize() { return m_uiQuadtreeTULog2MaxSize; } |
---|
| 1042 | Void setQuadtreeTULog2MinSize( UInt u ) { m_uiQuadtreeTULog2MinSize = u; } |
---|
| 1043 | UInt getQuadtreeTULog2MinSize() { return m_uiQuadtreeTULog2MinSize; } |
---|
| 1044 | Void setQuadtreeTUMaxDepthInter( UInt u ) { m_uiQuadtreeTUMaxDepthInter = u; } |
---|
| 1045 | Void setQuadtreeTUMaxDepthIntra( UInt u ) { m_uiQuadtreeTUMaxDepthIntra = u; } |
---|
| 1046 | UInt getQuadtreeTUMaxDepthInter() { return m_uiQuadtreeTUMaxDepthInter; } |
---|
| 1047 | UInt getQuadtreeTUMaxDepthIntra() { return m_uiQuadtreeTUMaxDepthIntra; } |
---|
| 1048 | Void setNumReorderPics(Int i, UInt tlayer) { m_numReorderPics[tlayer] = i; } |
---|
| 1049 | Int getNumReorderPics(UInt tlayer) { return m_numReorderPics[tlayer]; } |
---|
| 1050 | Void createRPSList( Int numRPS ); |
---|
| 1051 | TComRPSList* getRPSList() { return &m_RPSList; } |
---|
| 1052 | Bool getLongTermRefsPresent() { return m_bLongTermRefsPresent; } |
---|
| 1053 | Void setLongTermRefsPresent(Bool b) { m_bLongTermRefsPresent=b; } |
---|
| 1054 | Bool getTMVPFlagsPresent() { return m_TMVPFlagsPresent; } |
---|
| 1055 | Void setTMVPFlagsPresent(Bool b) { m_TMVPFlagsPresent=b; } |
---|
| 1056 | // physical transform |
---|
| 1057 | Void setMaxTrSize ( UInt u ) { m_uiMaxTrSize = u; } |
---|
| 1058 | UInt getMaxTrSize () { return m_uiMaxTrSize; } |
---|
| 1059 | |
---|
| 1060 | // Tool list |
---|
| 1061 | Bool getUseLossless () { return m_useLossless; } |
---|
| 1062 | Void setUseLossless ( Bool b ) { m_useLossless = b; } |
---|
| 1063 | |
---|
| 1064 | // AMP accuracy |
---|
| 1065 | Int getAMPAcc ( UInt uiDepth ) { return m_iAMPAcc[uiDepth]; } |
---|
| 1066 | Void setAMPAcc ( UInt uiDepth, Int iAccu ) { assert( uiDepth < g_uiMaxCUDepth); m_iAMPAcc[uiDepth] = iAccu; } |
---|
| 1067 | |
---|
| 1068 | // Bit-depth |
---|
| 1069 | Int getBitDepthY() { return m_bitDepthY; } |
---|
| 1070 | Void setBitDepthY(Int u) { m_bitDepthY = u; } |
---|
| 1071 | Int getBitDepthC() { return m_bitDepthC; } |
---|
| 1072 | Void setBitDepthC(Int u) { m_bitDepthC = u; } |
---|
| 1073 | Int getQpBDOffsetY () { return m_qpBDOffsetY; } |
---|
| 1074 | Void setQpBDOffsetY ( Int value ) { m_qpBDOffsetY = value; } |
---|
| 1075 | Int getQpBDOffsetC () { return m_qpBDOffsetC; } |
---|
| 1076 | Void setQpBDOffsetC ( Int value ) { m_qpBDOffsetC = value; } |
---|
| 1077 | Void setUseSAO (Bool bVal) {m_bUseSAO = bVal;} |
---|
| 1078 | Bool getUseSAO () {return m_bUseSAO;} |
---|
| 1079 | |
---|
| 1080 | UInt getMaxTLayers() { return m_uiMaxTLayers; } |
---|
| 1081 | Void setMaxTLayers( UInt uiMaxTLayers ) { assert( uiMaxTLayers <= MAX_TLAYER ); m_uiMaxTLayers = uiMaxTLayers; } |
---|
| 1082 | |
---|
| 1083 | Bool getTemporalIdNestingFlag() { return m_bTemporalIdNestingFlag; } |
---|
| 1084 | Void setTemporalIdNestingFlag( Bool bValue ) { m_bTemporalIdNestingFlag = bValue; } |
---|
| 1085 | UInt getPCMBitDepthLuma () { return m_uiPCMBitDepthLuma; } |
---|
| 1086 | Void setPCMBitDepthLuma ( UInt u ) { m_uiPCMBitDepthLuma = u; } |
---|
| 1087 | UInt getPCMBitDepthChroma () { return m_uiPCMBitDepthChroma; } |
---|
| 1088 | Void setPCMBitDepthChroma ( UInt u ) { m_uiPCMBitDepthChroma = u; } |
---|
| 1089 | Void setPCMFilterDisableFlag ( Bool bValue ) { m_bPCMFilterDisableFlag = bValue; } |
---|
| 1090 | Bool getPCMFilterDisableFlag () { return m_bPCMFilterDisableFlag; } |
---|
| 1091 | |
---|
| 1092 | Bool getScalingListFlag () { return m_scalingListEnabledFlag; } |
---|
| 1093 | Void setScalingListFlag ( Bool b ) { m_scalingListEnabledFlag = b; } |
---|
| 1094 | Bool getScalingListPresentFlag() { return m_scalingListPresentFlag; } |
---|
| 1095 | Void setScalingListPresentFlag( Bool b ) { m_scalingListPresentFlag = b; } |
---|
| 1096 | Void setScalingList ( TComScalingList *scalingList); |
---|
| 1097 | TComScalingList* getScalingList () { return m_scalingList; } //!< get ScalingList class pointer in SPS |
---|
| 1098 | UInt getMaxDecPicBuffering (UInt tlayer) { return m_uiMaxDecPicBuffering[tlayer]; } |
---|
| 1099 | Void setMaxDecPicBuffering ( UInt ui, UInt tlayer ) { m_uiMaxDecPicBuffering[tlayer] = ui; } |
---|
| 1100 | UInt getMaxLatencyIncrease (UInt tlayer) { return m_uiMaxLatencyIncrease[tlayer]; } |
---|
| 1101 | Void setMaxLatencyIncrease ( UInt ui , UInt tlayer) { m_uiMaxLatencyIncrease[tlayer] = ui; } |
---|
| 1102 | |
---|
| 1103 | Void setUseStrongIntraSmoothing (Bool bVal) {m_useStrongIntraSmoothing = bVal;} |
---|
| 1104 | Bool getUseStrongIntraSmoothing () {return m_useStrongIntraSmoothing;} |
---|
| 1105 | |
---|
| 1106 | Bool getVuiParametersPresentFlag() { return m_vuiParametersPresentFlag; } |
---|
| 1107 | Void setVuiParametersPresentFlag(Bool b) { m_vuiParametersPresentFlag = b; } |
---|
| 1108 | TComVUI* getVuiParameters() { return &m_vuiParameters; } |
---|
| 1109 | Void setHrdParameters( UInt frameRate, UInt numDU, UInt bitRate, Bool randomAccess ); |
---|
| 1110 | |
---|
| 1111 | TComPTL* getPTL() { return &m_pcPTL; } |
---|
| 1112 | |
---|
| 1113 | #if SVC_EXTENSION |
---|
| 1114 | #if M0463_VUI_EXT_ILP_REF |
---|
| 1115 | Void setInterViewMvVertConstraintFlag(Bool val) { m_interViewMvVertConstraintFlag = val; } |
---|
| 1116 | Bool getInterViewMvVertConstraintFlag() { return m_interViewMvVertConstraintFlag;} |
---|
| 1117 | |
---|
| 1118 | //// sps_extension_vui_parameters( ) |
---|
| 1119 | Void setNumIlpRestrictedRefLayers ( Int val ) { m_numIlpRestrictedRefLayers = val;} |
---|
| 1120 | Int getNumIlpRestrictedRefLayers ( ) { return m_numIlpRestrictedRefLayers ;} |
---|
| 1121 | |
---|
| 1122 | Void setMinSpatialSegmentOffsetPlus1( Int i, Int val ) { m_minSpatialSegmentOffsetPlus1[ i ] = val;} |
---|
| 1123 | Int getMinSpatialSegmentOffsetPlus1( Int i ) { return m_minSpatialSegmentOffsetPlus1[ i ];} |
---|
| 1124 | |
---|
| 1125 | Void setCtuBasedOffsetEnabledFlag ( Int i, Bool flag ) { m_ctuBasedOffsetEnabledFlag [ i ] = flag;} |
---|
| 1126 | Bool getCtuBasedOffsetEnabledFlag ( Int i ) { return m_ctuBasedOffsetEnabledFlag [ i ];} |
---|
| 1127 | |
---|
| 1128 | Void setMinHorizontalCtuOffsetPlus1 ( Int i, Int val ) { m_minHorizontalCtuOffsetPlus1 [ i ] = val;} |
---|
| 1129 | Int getMinHorizontalCtuOffsetPlus1 ( Int i ) { return m_minHorizontalCtuOffsetPlus1 [ i ];} |
---|
| 1130 | #endif |
---|
| 1131 | Void setLayerId(UInt layerId) { m_layerId = layerId; } |
---|
| 1132 | UInt getLayerId() { return m_layerId; } |
---|
| 1133 | #endif |
---|
| 1134 | #if REF_IDX_MFM |
---|
| 1135 | #if !M0457_COL_PICTURE_SIGNALING |
---|
| 1136 | Void setMFMEnabledFlag(Bool flag) {m_bMFMEnabledFlag = flag;} |
---|
| 1137 | Bool getMFMEnabledFlag() {return m_bMFMEnabledFlag;} |
---|
| 1138 | #endif |
---|
| 1139 | #endif |
---|
| 1140 | #if SCALED_REF_LAYER_OFFSETS |
---|
| 1141 | UInt getNumScaledRefLayerOffsets() { return m_numScaledRefLayerOffsets; } |
---|
| 1142 | Void setNumScaledRefLayerOffsets(Int x) { m_numScaledRefLayerOffsets = x; } |
---|
| 1143 | Window& getScaledRefLayerWindow( Int x ) { return m_scaledRefLayerWindow[x]; } |
---|
| 1144 | #endif |
---|
| 1145 | }; |
---|
| 1146 | |
---|
| 1147 | /// Reference Picture Lists class |
---|
| 1148 | class TComRefPicListModification |
---|
| 1149 | { |
---|
| 1150 | private: |
---|
| 1151 | UInt m_bRefPicListModificationFlagL0; |
---|
| 1152 | UInt m_bRefPicListModificationFlagL1; |
---|
| 1153 | UInt m_RefPicSetIdxL0[32]; |
---|
| 1154 | UInt m_RefPicSetIdxL1[32]; |
---|
| 1155 | |
---|
| 1156 | public: |
---|
| 1157 | TComRefPicListModification(); |
---|
| 1158 | virtual ~TComRefPicListModification(); |
---|
| 1159 | |
---|
| 1160 | Void create (); |
---|
| 1161 | Void destroy (); |
---|
| 1162 | |
---|
| 1163 | Bool getRefPicListModificationFlagL0() { return m_bRefPicListModificationFlagL0; } |
---|
| 1164 | Void setRefPicListModificationFlagL0(Bool flag) { m_bRefPicListModificationFlagL0 = flag; } |
---|
| 1165 | Bool getRefPicListModificationFlagL1() { return m_bRefPicListModificationFlagL1; } |
---|
| 1166 | Void setRefPicListModificationFlagL1(Bool flag) { m_bRefPicListModificationFlagL1 = flag; } |
---|
| 1167 | Void setRefPicSetIdxL0(UInt idx, UInt refPicSetIdx) { m_RefPicSetIdxL0[idx] = refPicSetIdx; } |
---|
| 1168 | UInt getRefPicSetIdxL0(UInt idx) { return m_RefPicSetIdxL0[idx]; } |
---|
| 1169 | Void setRefPicSetIdxL1(UInt idx, UInt refPicSetIdx) { m_RefPicSetIdxL1[idx] = refPicSetIdx; } |
---|
| 1170 | UInt getRefPicSetIdxL1(UInt idx) { return m_RefPicSetIdxL1[idx]; } |
---|
| 1171 | }; |
---|
| 1172 | |
---|
| 1173 | /// PPS class |
---|
| 1174 | class TComPPS |
---|
| 1175 | { |
---|
| 1176 | private: |
---|
| 1177 | Int m_PPSId; // pic_parameter_set_id |
---|
| 1178 | Int m_SPSId; // seq_parameter_set_id |
---|
| 1179 | Int m_picInitQPMinus26; |
---|
| 1180 | Bool m_useDQP; |
---|
| 1181 | Bool m_bConstrainedIntraPred; // constrained_intra_pred_flag |
---|
| 1182 | Bool m_bSliceChromaQpFlag; // slicelevel_chroma_qp_flag |
---|
| 1183 | |
---|
| 1184 | // access channel |
---|
| 1185 | TComSPS* m_pcSPS; |
---|
| 1186 | UInt m_uiMaxCuDQPDepth; |
---|
| 1187 | UInt m_uiMinCuDQPSize; |
---|
| 1188 | |
---|
| 1189 | Int m_chromaCbQpOffset; |
---|
| 1190 | Int m_chromaCrQpOffset; |
---|
| 1191 | |
---|
| 1192 | UInt m_numRefIdxL0DefaultActive; |
---|
| 1193 | UInt m_numRefIdxL1DefaultActive; |
---|
| 1194 | |
---|
| 1195 | Bool m_bUseWeightPred; // Use of Weighting Prediction (P_SLICE) |
---|
| 1196 | Bool m_useWeightedBiPred; // Use of Weighting Bi-Prediction (B_SLICE) |
---|
| 1197 | Bool m_OutputFlagPresentFlag; // Indicates the presence of output_flag in slice header |
---|
| 1198 | |
---|
| 1199 | Bool m_TransquantBypassEnableFlag; // Indicates presence of cu_transquant_bypass_flag in CUs. |
---|
| 1200 | Bool m_useTransformSkip; |
---|
| 1201 | Bool m_dependentSliceSegmentsEnabledFlag; //!< Indicates the presence of dependent slices |
---|
| 1202 | Bool m_tilesEnabledFlag; //!< Indicates the presence of tiles |
---|
| 1203 | Bool m_entropyCodingSyncEnabledFlag; //!< Indicates the presence of wavefronts |
---|
| 1204 | |
---|
| 1205 | Bool m_loopFilterAcrossTilesEnabledFlag; |
---|
| 1206 | Int m_uniformSpacingFlag; |
---|
| 1207 | Int m_iNumColumnsMinus1; |
---|
| 1208 | UInt* m_puiColumnWidth; |
---|
| 1209 | Int m_iNumRowsMinus1; |
---|
| 1210 | UInt* m_puiRowHeight; |
---|
| 1211 | |
---|
| 1212 | Int m_iNumSubstreams; |
---|
| 1213 | |
---|
| 1214 | Int m_signHideFlag; |
---|
| 1215 | |
---|
| 1216 | Bool m_cabacInitPresentFlag; |
---|
| 1217 | UInt m_encCABACTableIdx; // Used to transmit table selection across slices |
---|
| 1218 | |
---|
| 1219 | Bool m_sliceHeaderExtensionPresentFlag; |
---|
| 1220 | Bool m_loopFilterAcrossSlicesEnabledFlag; |
---|
| 1221 | Bool m_deblockingFilterControlPresentFlag; |
---|
| 1222 | Bool m_deblockingFilterOverrideEnabledFlag; |
---|
| 1223 | Bool m_picDisableDeblockingFilterFlag; |
---|
| 1224 | Int m_deblockingFilterBetaOffsetDiv2; //< beta offset for deblocking filter |
---|
| 1225 | Int m_deblockingFilterTcOffsetDiv2; //< tc offset for deblocking filter |
---|
| 1226 | Bool m_scalingListPresentFlag; |
---|
| 1227 | TComScalingList* m_scalingList; //!< ScalingList class pointer |
---|
| 1228 | Bool m_listsModificationPresentFlag; |
---|
| 1229 | UInt m_log2ParallelMergeLevelMinus2; |
---|
| 1230 | Int m_numExtraSliceHeaderBits; |
---|
| 1231 | |
---|
| 1232 | public: |
---|
| 1233 | TComPPS(); |
---|
| 1234 | virtual ~TComPPS(); |
---|
| 1235 | |
---|
| 1236 | Int getPPSId () { return m_PPSId; } |
---|
| 1237 | Void setPPSId (Int i) { m_PPSId = i; } |
---|
| 1238 | Int getSPSId () { return m_SPSId; } |
---|
| 1239 | Void setSPSId (Int i) { m_SPSId = i; } |
---|
| 1240 | |
---|
| 1241 | Int getPicInitQPMinus26 () { return m_picInitQPMinus26; } |
---|
| 1242 | Void setPicInitQPMinus26 ( Int i ) { m_picInitQPMinus26 = i; } |
---|
| 1243 | Bool getUseDQP () { return m_useDQP; } |
---|
| 1244 | Void setUseDQP ( Bool b ) { m_useDQP = b; } |
---|
| 1245 | Bool getConstrainedIntraPred () { return m_bConstrainedIntraPred; } |
---|
| 1246 | Void setConstrainedIntraPred ( Bool b ) { m_bConstrainedIntraPred = b; } |
---|
| 1247 | Bool getSliceChromaQpFlag () { return m_bSliceChromaQpFlag; } |
---|
| 1248 | Void setSliceChromaQpFlag ( Bool b ) { m_bSliceChromaQpFlag = b; } |
---|
| 1249 | |
---|
| 1250 | Void setSPS ( TComSPS* pcSPS ) { m_pcSPS = pcSPS; } |
---|
| 1251 | TComSPS* getSPS () { return m_pcSPS; } |
---|
| 1252 | Void setMaxCuDQPDepth ( UInt u ) { m_uiMaxCuDQPDepth = u; } |
---|
| 1253 | UInt getMaxCuDQPDepth () { return m_uiMaxCuDQPDepth;} |
---|
| 1254 | Void setMinCuDQPSize ( UInt u ) { m_uiMinCuDQPSize = u; } |
---|
| 1255 | UInt getMinCuDQPSize () { return m_uiMinCuDQPSize; } |
---|
| 1256 | |
---|
| 1257 | Void setChromaCbQpOffset( Int i ) { m_chromaCbQpOffset = i; } |
---|
| 1258 | Int getChromaCbQpOffset() { return m_chromaCbQpOffset; } |
---|
| 1259 | Void setChromaCrQpOffset( Int i ) { m_chromaCrQpOffset = i; } |
---|
| 1260 | Int getChromaCrQpOffset() { return m_chromaCrQpOffset; } |
---|
| 1261 | |
---|
| 1262 | Void setNumRefIdxL0DefaultActive(UInt ui) { m_numRefIdxL0DefaultActive=ui; } |
---|
| 1263 | UInt getNumRefIdxL0DefaultActive() { return m_numRefIdxL0DefaultActive; } |
---|
| 1264 | Void setNumRefIdxL1DefaultActive(UInt ui) { m_numRefIdxL1DefaultActive=ui; } |
---|
| 1265 | UInt getNumRefIdxL1DefaultActive() { return m_numRefIdxL1DefaultActive; } |
---|
| 1266 | |
---|
| 1267 | Bool getUseWP () { return m_bUseWeightPred; } |
---|
| 1268 | Bool getWPBiPred () { return m_useWeightedBiPred; } |
---|
| 1269 | Void setUseWP ( Bool b ) { m_bUseWeightPred = b; } |
---|
| 1270 | Void setWPBiPred ( Bool b ) { m_useWeightedBiPred = b; } |
---|
| 1271 | Void setOutputFlagPresentFlag( Bool b ) { m_OutputFlagPresentFlag = b; } |
---|
| 1272 | Bool getOutputFlagPresentFlag() { return m_OutputFlagPresentFlag; } |
---|
| 1273 | Void setTransquantBypassEnableFlag( Bool b ) { m_TransquantBypassEnableFlag = b; } |
---|
| 1274 | Bool getTransquantBypassEnableFlag() { return m_TransquantBypassEnableFlag; } |
---|
| 1275 | |
---|
| 1276 | Bool getUseTransformSkip () { return m_useTransformSkip; } |
---|
| 1277 | Void setUseTransformSkip ( Bool b ) { m_useTransformSkip = b; } |
---|
| 1278 | |
---|
| 1279 | Void setLoopFilterAcrossTilesEnabledFlag (Bool b) { m_loopFilterAcrossTilesEnabledFlag = b; } |
---|
| 1280 | Bool getLoopFilterAcrossTilesEnabledFlag () { return m_loopFilterAcrossTilesEnabledFlag; } |
---|
| 1281 | Bool getDependentSliceSegmentsEnabledFlag() const { return m_dependentSliceSegmentsEnabledFlag; } |
---|
| 1282 | Void setDependentSliceSegmentsEnabledFlag(Bool val) { m_dependentSliceSegmentsEnabledFlag = val; } |
---|
| 1283 | Bool getTilesEnabledFlag() const { return m_tilesEnabledFlag; } |
---|
| 1284 | Void setTilesEnabledFlag(Bool val) { m_tilesEnabledFlag = val; } |
---|
| 1285 | Bool getEntropyCodingSyncEnabledFlag() const { return m_entropyCodingSyncEnabledFlag; } |
---|
| 1286 | Void setEntropyCodingSyncEnabledFlag(Bool val) { m_entropyCodingSyncEnabledFlag = val; } |
---|
| 1287 | Void setUniformSpacingFlag ( Bool b ) { m_uniformSpacingFlag = b; } |
---|
| 1288 | Bool getUniformSpacingFlag () { return m_uniformSpacingFlag; } |
---|
| 1289 | Void setNumColumnsMinus1 ( Int i ) { m_iNumColumnsMinus1 = i; } |
---|
| 1290 | Int getNumColumnsMinus1 () { return m_iNumColumnsMinus1; } |
---|
| 1291 | Void setColumnWidth ( UInt* columnWidth ) |
---|
| 1292 | { |
---|
| 1293 | if( m_uniformSpacingFlag == 0 && m_iNumColumnsMinus1 > 0 ) |
---|
| 1294 | { |
---|
| 1295 | m_puiColumnWidth = new UInt[ m_iNumColumnsMinus1 ]; |
---|
| 1296 | |
---|
| 1297 | for(Int i=0; i<m_iNumColumnsMinus1; i++) |
---|
| 1298 | { |
---|
| 1299 | m_puiColumnWidth[i] = columnWidth[i]; |
---|
| 1300 | } |
---|
| 1301 | } |
---|
| 1302 | } |
---|
| 1303 | UInt getColumnWidth (UInt columnIdx) { return *( m_puiColumnWidth + columnIdx ); } |
---|
| 1304 | Void setNumRowsMinus1( Int i ) { m_iNumRowsMinus1 = i; } |
---|
| 1305 | Int getNumRowsMinus1() { return m_iNumRowsMinus1; } |
---|
| 1306 | Void setRowHeight ( UInt* rowHeight ) |
---|
| 1307 | { |
---|
| 1308 | if( m_uniformSpacingFlag == 0 && m_iNumRowsMinus1 > 0 ) |
---|
| 1309 | { |
---|
| 1310 | m_puiRowHeight = new UInt[ m_iNumRowsMinus1 ]; |
---|
| 1311 | |
---|
| 1312 | for(Int i=0; i<m_iNumRowsMinus1; i++) |
---|
| 1313 | { |
---|
| 1314 | m_puiRowHeight[i] = rowHeight[i]; |
---|
| 1315 | } |
---|
| 1316 | } |
---|
| 1317 | } |
---|
| 1318 | UInt getRowHeight (UInt rowIdx) { return *( m_puiRowHeight + rowIdx ); } |
---|
| 1319 | Void setNumSubstreams(Int iNumSubstreams) { m_iNumSubstreams = iNumSubstreams; } |
---|
| 1320 | Int getNumSubstreams() { return m_iNumSubstreams; } |
---|
| 1321 | |
---|
| 1322 | Void setSignHideFlag( Int signHideFlag ) { m_signHideFlag = signHideFlag; } |
---|
| 1323 | Int getSignHideFlag() { return m_signHideFlag; } |
---|
| 1324 | |
---|
| 1325 | Void setCabacInitPresentFlag( Bool flag ) { m_cabacInitPresentFlag = flag; } |
---|
| 1326 | Void setEncCABACTableIdx( Int idx ) { m_encCABACTableIdx = idx; } |
---|
| 1327 | Bool getCabacInitPresentFlag() { return m_cabacInitPresentFlag; } |
---|
| 1328 | UInt getEncCABACTableIdx() { return m_encCABACTableIdx; } |
---|
| 1329 | Void setDeblockingFilterControlPresentFlag( Bool val ) { m_deblockingFilterControlPresentFlag = val; } |
---|
| 1330 | Bool getDeblockingFilterControlPresentFlag() { return m_deblockingFilterControlPresentFlag; } |
---|
| 1331 | Void setDeblockingFilterOverrideEnabledFlag( Bool val ) { m_deblockingFilterOverrideEnabledFlag = val; } |
---|
| 1332 | Bool getDeblockingFilterOverrideEnabledFlag() { return m_deblockingFilterOverrideEnabledFlag; } |
---|
| 1333 | Void setPicDisableDeblockingFilterFlag(Bool val) { m_picDisableDeblockingFilterFlag = val; } //!< set offset for deblocking filter disabled |
---|
| 1334 | Bool getPicDisableDeblockingFilterFlag() { return m_picDisableDeblockingFilterFlag; } //!< get offset for deblocking filter disabled |
---|
| 1335 | Void setDeblockingFilterBetaOffsetDiv2(Int val) { m_deblockingFilterBetaOffsetDiv2 = val; } //!< set beta offset for deblocking filter |
---|
| 1336 | Int getDeblockingFilterBetaOffsetDiv2() { return m_deblockingFilterBetaOffsetDiv2; } //!< get beta offset for deblocking filter |
---|
| 1337 | Void setDeblockingFilterTcOffsetDiv2(Int val) { m_deblockingFilterTcOffsetDiv2 = val; } //!< set tc offset for deblocking filter |
---|
| 1338 | Int getDeblockingFilterTcOffsetDiv2() { return m_deblockingFilterTcOffsetDiv2; } //!< get tc offset for deblocking filter |
---|
| 1339 | Bool getScalingListPresentFlag() { return m_scalingListPresentFlag; } |
---|
| 1340 | Void setScalingListPresentFlag( Bool b ) { m_scalingListPresentFlag = b; } |
---|
| 1341 | Void setScalingList ( TComScalingList *scalingList); |
---|
| 1342 | TComScalingList* getScalingList () { return m_scalingList; } //!< get ScalingList class pointer in PPS |
---|
| 1343 | Bool getListsModificationPresentFlag () { return m_listsModificationPresentFlag; } |
---|
| 1344 | Void setListsModificationPresentFlag ( Bool b ) { m_listsModificationPresentFlag = b; } |
---|
| 1345 | UInt getLog2ParallelMergeLevelMinus2 () { return m_log2ParallelMergeLevelMinus2; } |
---|
| 1346 | Void setLog2ParallelMergeLevelMinus2 (UInt mrgLevel) { m_log2ParallelMergeLevelMinus2 = mrgLevel; } |
---|
| 1347 | Int getNumExtraSliceHeaderBits() { return m_numExtraSliceHeaderBits; } |
---|
| 1348 | Void setNumExtraSliceHeaderBits(Int i) { m_numExtraSliceHeaderBits = i; } |
---|
| 1349 | Void setLoopFilterAcrossSlicesEnabledFlag ( Bool bValue ) { m_loopFilterAcrossSlicesEnabledFlag = bValue; } |
---|
| 1350 | Bool getLoopFilterAcrossSlicesEnabledFlag () { return m_loopFilterAcrossSlicesEnabledFlag; } |
---|
| 1351 | Bool getSliceHeaderExtensionPresentFlag () { return m_sliceHeaderExtensionPresentFlag; } |
---|
| 1352 | Void setSliceHeaderExtensionPresentFlag (Bool val) { m_sliceHeaderExtensionPresentFlag = val; } |
---|
| 1353 | }; |
---|
| 1354 | |
---|
| 1355 | typedef struct |
---|
| 1356 | { |
---|
| 1357 | // Explicit weighted prediction parameters parsed in slice header, |
---|
| 1358 | // or Implicit weighted prediction parameters (8 bits depth values). |
---|
| 1359 | Bool bPresentFlag; |
---|
| 1360 | UInt uiLog2WeightDenom; |
---|
| 1361 | Int iWeight; |
---|
| 1362 | Int iOffset; |
---|
| 1363 | |
---|
| 1364 | // Weighted prediction scaling values built from above parameters (bitdepth scaled): |
---|
| 1365 | Int w, o, offset, shift, round; |
---|
| 1366 | } wpScalingParam; |
---|
| 1367 | |
---|
| 1368 | typedef struct |
---|
| 1369 | { |
---|
| 1370 | Int64 iAC; |
---|
| 1371 | Int64 iDC; |
---|
| 1372 | } wpACDCParam; |
---|
| 1373 | |
---|
| 1374 | /// slice header class |
---|
| 1375 | class TComSlice |
---|
| 1376 | { |
---|
| 1377 | |
---|
| 1378 | private: |
---|
| 1379 | // Bitstream writing |
---|
| 1380 | Bool m_saoEnabledFlag; |
---|
| 1381 | Bool m_saoEnabledFlagChroma; ///< SAO Cb&Cr enabled flag |
---|
| 1382 | Int m_iPPSId; ///< picture parameter set ID |
---|
| 1383 | Bool m_PicOutputFlag; ///< pic_output_flag |
---|
| 1384 | Int m_iPOC; |
---|
| 1385 | Int m_iLastIDR; |
---|
| 1386 | static Int m_prevPOC; |
---|
| 1387 | TComReferencePictureSet *m_pcRPS; |
---|
| 1388 | TComReferencePictureSet m_LocalRPS; |
---|
| 1389 | Int m_iBDidx; |
---|
| 1390 | TComRefPicListModification m_RefPicListModification; |
---|
| 1391 | NalUnitType m_eNalUnitType; ///< Nal unit type for the slice |
---|
| 1392 | SliceType m_eSliceType; |
---|
| 1393 | Int m_iSliceQp; |
---|
| 1394 | Bool m_dependentSliceSegmentFlag; |
---|
| 1395 | #if ADAPTIVE_QP_SELECTION |
---|
| 1396 | Int m_iSliceQpBase; |
---|
| 1397 | #endif |
---|
| 1398 | Bool m_deblockingFilterDisable; |
---|
| 1399 | Bool m_deblockingFilterOverrideFlag; //< offsets for deblocking filter inherit from PPS |
---|
| 1400 | Int m_deblockingFilterBetaOffsetDiv2; //< beta offset for deblocking filter |
---|
| 1401 | Int m_deblockingFilterTcOffsetDiv2; //< tc offset for deblocking filter |
---|
| 1402 | #if JCTVC_M0458_INTERLAYER_RPS_SIG |
---|
| 1403 | Int m_activeNumILRRefIdx; //< Active inter-layer reference pictures |
---|
| 1404 | Int m_interLayerPredLayerIdc [MAX_VPS_LAYER_ID_PLUS1]; |
---|
| 1405 | #else |
---|
| 1406 | #if REF_IDX_FRAMEWORK |
---|
| 1407 | Int m_numILRRefIdx; //< for inter-layer reference picture ser |
---|
| 1408 | #endif |
---|
| 1409 | #endif |
---|
| 1410 | #if M0457_IL_SAMPLE_PRED_ONLY_FLAG |
---|
| 1411 | Int m_numSamplePredRefLayers; |
---|
| 1412 | Bool m_interLayerSamplePredOnlyFlag; |
---|
| 1413 | #endif |
---|
| 1414 | Int m_list1IdxToList0Idx[MAX_NUM_REF]; |
---|
| 1415 | Int m_aiNumRefIdx [2]; // for multiple reference of current slice |
---|
| 1416 | |
---|
| 1417 | Bool m_bCheckLDC; |
---|
| 1418 | |
---|
| 1419 | // Data |
---|
| 1420 | Int m_iSliceQpDelta; |
---|
| 1421 | Int m_iSliceQpDeltaCb; |
---|
| 1422 | Int m_iSliceQpDeltaCr; |
---|
| 1423 | TComPic* m_apcRefPicList [2][MAX_NUM_REF+1]; |
---|
| 1424 | Int m_aiRefPOCList [2][MAX_NUM_REF+1]; |
---|
| 1425 | Bool m_bIsUsedAsLongTerm[2][MAX_NUM_REF+1]; |
---|
| 1426 | Int m_iDepth; |
---|
| 1427 | |
---|
| 1428 | // referenced slice? |
---|
| 1429 | Bool m_bRefenced; |
---|
| 1430 | |
---|
| 1431 | #if SH_DISCARDABLE_FLAG |
---|
| 1432 | Bool m_bDiscardableFlag; |
---|
| 1433 | #endif |
---|
| 1434 | |
---|
| 1435 | // access channel |
---|
| 1436 | TComVPS* m_pcVPS; |
---|
| 1437 | TComSPS* m_pcSPS; |
---|
| 1438 | TComPPS* m_pcPPS; |
---|
| 1439 | TComPic* m_pcPic; |
---|
| 1440 | #if ADAPTIVE_QP_SELECTION |
---|
| 1441 | TComTrQuant* m_pcTrQuant; |
---|
| 1442 | #endif |
---|
| 1443 | UInt m_colFromL0Flag; // collocated picture from List0 flag |
---|
| 1444 | |
---|
| 1445 | UInt m_colRefIdx; |
---|
| 1446 | UInt m_maxNumMergeCand; |
---|
| 1447 | |
---|
| 1448 | |
---|
| 1449 | #if SAO_CHROMA_LAMBDA |
---|
| 1450 | Double m_dLambdaLuma; |
---|
| 1451 | Double m_dLambdaChroma; |
---|
| 1452 | #else |
---|
| 1453 | Double m_dLambda; |
---|
| 1454 | #endif |
---|
| 1455 | |
---|
| 1456 | Bool m_abEqualRef [2][MAX_NUM_REF][MAX_NUM_REF]; |
---|
| 1457 | UInt m_uiTLayer; |
---|
| 1458 | #if SVC_EXTENSION |
---|
| 1459 | UInt m_layerId; |
---|
| 1460 | TComPic* m_pcBaseColPic[MAX_LAYERS]; |
---|
| 1461 | TComPicYuv* m_pcFullPelBaseRec[MAX_LAYERS]; |
---|
| 1462 | #if REF_IDX_FRAMEWORK && M0457_COL_PICTURE_SIGNALING |
---|
| 1463 | Int m_numMotionPredRefLayers; |
---|
| 1464 | #if REF_IDX_MFM |
---|
| 1465 | Bool m_bMFMEnabledFlag; |
---|
| 1466 | Int m_colRefLayerIdx; |
---|
| 1467 | Bool m_altColIndicationFlag; |
---|
| 1468 | TComPic* m_pcIlpPic; |
---|
| 1469 | #endif |
---|
| 1470 | #endif |
---|
| 1471 | #endif |
---|
| 1472 | Bool m_bTLayerSwitchingFlag; |
---|
| 1473 | |
---|
| 1474 | UInt m_sliceMode; |
---|
| 1475 | UInt m_sliceArgument; |
---|
| 1476 | UInt m_sliceCurStartCUAddr; |
---|
| 1477 | UInt m_sliceCurEndCUAddr; |
---|
| 1478 | UInt m_sliceIdx; |
---|
| 1479 | UInt m_sliceSegmentMode; |
---|
| 1480 | UInt m_sliceSegmentArgument; |
---|
| 1481 | UInt m_sliceSegmentCurStartCUAddr; |
---|
| 1482 | UInt m_sliceSegmentCurEndCUAddr; |
---|
| 1483 | Bool m_nextSlice; |
---|
| 1484 | Bool m_nextSliceSegment; |
---|
| 1485 | UInt m_sliceBits; |
---|
| 1486 | UInt m_sliceSegmentBits; |
---|
| 1487 | Bool m_bFinalized; |
---|
| 1488 | |
---|
| 1489 | wpScalingParam m_weightPredTable[2][MAX_NUM_REF][3]; // [REF_PIC_LIST_0 or REF_PIC_LIST_1][refIdx][0:Y, 1:U, 2:V] |
---|
| 1490 | wpACDCParam m_weightACDCParam[3]; // [0:Y, 1:U, 2:V] |
---|
| 1491 | |
---|
| 1492 | std::vector<UInt> m_tileByteLocation; |
---|
| 1493 | UInt m_uiTileOffstForMultES; |
---|
| 1494 | |
---|
| 1495 | UInt* m_puiSubstreamSizes; |
---|
| 1496 | TComScalingList* m_scalingList; //!< pointer of quantization matrix |
---|
| 1497 | Bool m_cabacInitFlag; |
---|
| 1498 | |
---|
| 1499 | Bool m_bLMvdL1Zero; |
---|
| 1500 | Int m_numEntryPointOffsets; |
---|
| 1501 | Bool m_temporalLayerNonReferenceFlag; |
---|
| 1502 | Bool m_LFCrossSliceBoundaryFlag; |
---|
| 1503 | |
---|
| 1504 | Bool m_enableTMVPFlag; |
---|
| 1505 | #if JCTVC_M0458_INTERLAYER_RPS_SIG |
---|
| 1506 | Bool m_interLayerPredEnabledFlag; |
---|
| 1507 | #endif |
---|
| 1508 | public: |
---|
| 1509 | TComSlice(); |
---|
| 1510 | virtual ~TComSlice(); |
---|
| 1511 | #if SVC_EXTENSION |
---|
| 1512 | Void initSlice ( UInt layerId ); |
---|
| 1513 | #else |
---|
| 1514 | Void initSlice (); |
---|
| 1515 | #endif |
---|
| 1516 | |
---|
| 1517 | Void setVPS ( TComVPS* pcVPS ) { m_pcVPS = pcVPS; } |
---|
| 1518 | TComVPS* getVPS () { return m_pcVPS; } |
---|
| 1519 | Void setSPS ( TComSPS* pcSPS ) { m_pcSPS = pcSPS; } |
---|
| 1520 | TComSPS* getSPS () { return m_pcSPS; } |
---|
| 1521 | |
---|
| 1522 | Void setPPS ( TComPPS* pcPPS ) { assert(pcPPS!=NULL); m_pcPPS = pcPPS; m_iPPSId = pcPPS->getPPSId(); } |
---|
| 1523 | TComPPS* getPPS () { return m_pcPPS; } |
---|
| 1524 | |
---|
| 1525 | #if ADAPTIVE_QP_SELECTION |
---|
| 1526 | Void setTrQuant ( TComTrQuant* pcTrQuant ) { m_pcTrQuant = pcTrQuant; } |
---|
| 1527 | TComTrQuant* getTrQuant () { return m_pcTrQuant; } |
---|
| 1528 | #endif |
---|
| 1529 | |
---|
| 1530 | Void setPPSId ( Int PPSId ) { m_iPPSId = PPSId; } |
---|
| 1531 | Int getPPSId () { return m_iPPSId; } |
---|
| 1532 | Void setPicOutputFlag( Bool b ) { m_PicOutputFlag = b; } |
---|
| 1533 | Bool getPicOutputFlag() { return m_PicOutputFlag; } |
---|
| 1534 | Void setSaoEnabledFlag(Bool s) {m_saoEnabledFlag =s; } |
---|
| 1535 | Bool getSaoEnabledFlag() { return m_saoEnabledFlag; } |
---|
| 1536 | Void setSaoEnabledFlagChroma(Bool s) {m_saoEnabledFlagChroma =s; } //!< set SAO Cb&Cr enabled flag |
---|
| 1537 | Bool getSaoEnabledFlagChroma() { return m_saoEnabledFlagChroma; } //!< get SAO Cb&Cr enabled flag |
---|
| 1538 | Void setRPS ( TComReferencePictureSet *pcRPS ) { m_pcRPS = pcRPS; } |
---|
| 1539 | TComReferencePictureSet* getRPS () { return m_pcRPS; } |
---|
| 1540 | TComReferencePictureSet* getLocalRPS () { return &m_LocalRPS; } |
---|
| 1541 | |
---|
| 1542 | Void setRPSidx ( Int iBDidx ) { m_iBDidx = iBDidx; } |
---|
| 1543 | Int getRPSidx () { return m_iBDidx; } |
---|
| 1544 | Int getPrevPOC () { return m_prevPOC; } |
---|
| 1545 | TComRefPicListModification* getRefPicListModification() { return &m_RefPicListModification; } |
---|
| 1546 | Void setLastIDR(Int iIDRPOC) { m_iLastIDR = iIDRPOC; } |
---|
| 1547 | Int getLastIDR() { return m_iLastIDR; } |
---|
| 1548 | SliceType getSliceType () { return m_eSliceType; } |
---|
| 1549 | Int getPOC () { return m_iPOC; } |
---|
| 1550 | Int getSliceQp () { return m_iSliceQp; } |
---|
| 1551 | Bool getDependentSliceSegmentFlag() const { return m_dependentSliceSegmentFlag; } |
---|
| 1552 | void setDependentSliceSegmentFlag(Bool val) { m_dependentSliceSegmentFlag = val; } |
---|
| 1553 | #if ADAPTIVE_QP_SELECTION |
---|
| 1554 | Int getSliceQpBase () { return m_iSliceQpBase; } |
---|
| 1555 | #endif |
---|
| 1556 | Int getSliceQpDelta () { return m_iSliceQpDelta; } |
---|
| 1557 | Int getSliceQpDeltaCb () { return m_iSliceQpDeltaCb; } |
---|
| 1558 | Int getSliceQpDeltaCr () { return m_iSliceQpDeltaCr; } |
---|
| 1559 | Bool getDeblockingFilterDisable() { return m_deblockingFilterDisable; } |
---|
| 1560 | Bool getDeblockingFilterOverrideFlag() { return m_deblockingFilterOverrideFlag; } |
---|
| 1561 | Int getDeblockingFilterBetaOffsetDiv2() { return m_deblockingFilterBetaOffsetDiv2; } |
---|
| 1562 | Int getDeblockingFilterTcOffsetDiv2() { return m_deblockingFilterTcOffsetDiv2; } |
---|
| 1563 | |
---|
| 1564 | Int getNumRefIdx ( RefPicList e ) { return m_aiNumRefIdx[e]; } |
---|
| 1565 | TComPic* getPic () { return m_pcPic; } |
---|
| 1566 | TComPic* getRefPic ( RefPicList e, Int iRefIdx) { return m_apcRefPicList[e][iRefIdx]; } |
---|
| 1567 | Int getRefPOC ( RefPicList e, Int iRefIdx) { return m_aiRefPOCList[e][iRefIdx]; } |
---|
| 1568 | Int getDepth () { return m_iDepth; } |
---|
| 1569 | UInt getColFromL0Flag () { return m_colFromL0Flag; } |
---|
| 1570 | UInt getColRefIdx () { return m_colRefIdx; } |
---|
| 1571 | Void checkColRefIdx (UInt curSliceIdx, TComPic* pic); |
---|
| 1572 | Bool getIsUsedAsLongTerm (Int i, Int j) { return m_bIsUsedAsLongTerm[i][j]; } |
---|
| 1573 | Bool getCheckLDC () { return m_bCheckLDC; } |
---|
| 1574 | Bool getMvdL1ZeroFlag () { return m_bLMvdL1Zero; } |
---|
| 1575 | Int getNumRpsCurrTempList(); |
---|
[334] | 1576 | #if RPL_INIT_N0316_N0082 |
---|
| 1577 | Int getNumNegativeRpsCurrTempList(); |
---|
| 1578 | #endif |
---|
[313] | 1579 | Int getList1IdxToList0Idx ( Int list1Idx ) { return m_list1IdxToList0Idx[list1Idx]; } |
---|
| 1580 | Void setReferenced(Bool b) { m_bRefenced = b; } |
---|
| 1581 | Bool isReferenced() { return m_bRefenced; } |
---|
| 1582 | Void setPOC ( Int i ) { m_iPOC = i; if(getTLayer()==0) m_prevPOC=i; } |
---|
| 1583 | Void setNalUnitType ( NalUnitType e ) { m_eNalUnitType = e; } |
---|
| 1584 | NalUnitType getNalUnitType () const { return m_eNalUnitType; } |
---|
| 1585 | Bool getRapPicFlag (); |
---|
| 1586 | Bool getIdrPicFlag () { return getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP; } |
---|
| 1587 | Bool isIRAP () const { return (getNalUnitType() >= 16) && (getNalUnitType() <= 23); } |
---|
| 1588 | #if RESTR_CHK |
---|
| 1589 | Bool isRADL() { return (m_eNalUnitType == NAL_UNIT_CODED_SLICE_RADL_N || m_eNalUnitType == NAL_UNIT_CODED_SLICE_RADL_R); } |
---|
| 1590 | Bool isRASL() { return (m_eNalUnitType == NAL_UNIT_CODED_SLICE_RASL_N || m_eNalUnitType == NAL_UNIT_CODED_SLICE_RASL_R); } |
---|
| 1591 | #endif |
---|
| 1592 | |
---|
| 1593 | #if SH_DISCARDABLE_FLAG |
---|
| 1594 | Bool getDiscardableFlag () { return m_bDiscardableFlag; } |
---|
| 1595 | Void setDiscardableFlag (Bool b) { m_bDiscardableFlag = b; } |
---|
| 1596 | #endif |
---|
| 1597 | |
---|
| 1598 | Void checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, Bool& prevRAPisBLA, TComList<TComPic *>& rcListPic); |
---|
| 1599 | Void decodingRefreshMarking(Int& pocCRA, Bool& bRefreshPending, TComList<TComPic*>& rcListPic); |
---|
| 1600 | Void setSliceType ( SliceType e ) { m_eSliceType = e; } |
---|
| 1601 | Void setSliceQp ( Int i ) { m_iSliceQp = i; } |
---|
| 1602 | #if ADAPTIVE_QP_SELECTION |
---|
| 1603 | Void setSliceQpBase ( Int i ) { m_iSliceQpBase = i; } |
---|
| 1604 | #endif |
---|
| 1605 | Void setSliceQpDelta ( Int i ) { m_iSliceQpDelta = i; } |
---|
| 1606 | Void setSliceQpDeltaCb ( Int i ) { m_iSliceQpDeltaCb = i; } |
---|
| 1607 | Void setSliceQpDeltaCr ( Int i ) { m_iSliceQpDeltaCr = i; } |
---|
| 1608 | Void setDeblockingFilterDisable( Bool b ) { m_deblockingFilterDisable= b; } |
---|
| 1609 | Void setDeblockingFilterOverrideFlag( Bool b ) { m_deblockingFilterOverrideFlag = b; } |
---|
| 1610 | Void setDeblockingFilterBetaOffsetDiv2( Int i ) { m_deblockingFilterBetaOffsetDiv2 = i; } |
---|
| 1611 | Void setDeblockingFilterTcOffsetDiv2( Int i ) { m_deblockingFilterTcOffsetDiv2 = i; } |
---|
| 1612 | |
---|
| 1613 | Void setRefPic ( TComPic* p, RefPicList e, Int iRefIdx ) { m_apcRefPicList[e][iRefIdx] = p; } |
---|
| 1614 | Void setRefPOC ( Int i, RefPicList e, Int iRefIdx ) { m_aiRefPOCList[e][iRefIdx] = i; } |
---|
| 1615 | Void setNumRefIdx ( RefPicList e, Int i ) { m_aiNumRefIdx[e] = i; } |
---|
| 1616 | Void setPic ( TComPic* p ) { m_pcPic = p; } |
---|
| 1617 | Void setDepth ( Int iDepth ) { m_iDepth = iDepth; } |
---|
| 1618 | |
---|
| 1619 | #if FIX1071 |
---|
| 1620 | #if SVC_EXTENSION |
---|
| 1621 | Void setRefPicList ( TComList<TComPic*>& rcListPic, Bool checkNumPocTotalCurr = false, TComPic** ilpPic = NULL ); |
---|
| 1622 | #else |
---|
| 1623 | Void setRefPicList ( TComList<TComPic*>& rcListPic, Bool checkNumPocTotalCurr = false ); |
---|
| 1624 | #endif |
---|
| 1625 | #else |
---|
| 1626 | Void setRefPicList ( TComList<TComPic*>& rcListPic ); |
---|
| 1627 | #endif |
---|
| 1628 | Void setRefPOCList (); |
---|
| 1629 | Void setColFromL0Flag ( UInt colFromL0 ) { m_colFromL0Flag = colFromL0; } |
---|
| 1630 | Void setColRefIdx ( UInt refIdx) { m_colRefIdx = refIdx; } |
---|
| 1631 | Void setCheckLDC ( Bool b ) { m_bCheckLDC = b; } |
---|
| 1632 | Void setMvdL1ZeroFlag ( Bool b) { m_bLMvdL1Zero = b; } |
---|
| 1633 | |
---|
| 1634 | Bool isIntra () { return m_eSliceType == I_SLICE; } |
---|
| 1635 | Bool isInterB () { return m_eSliceType == B_SLICE; } |
---|
| 1636 | Bool isInterP () { return m_eSliceType == P_SLICE; } |
---|
| 1637 | |
---|
| 1638 | #if SAO_CHROMA_LAMBDA |
---|
| 1639 | Void setLambda( Double d, Double e ) { m_dLambdaLuma = d; m_dLambdaChroma = e;} |
---|
| 1640 | Double getLambdaLuma() { return m_dLambdaLuma; } |
---|
| 1641 | Double getLambdaChroma() { return m_dLambdaChroma; } |
---|
| 1642 | #else |
---|
| 1643 | Void setLambda( Double d ) { m_dLambda = d; } |
---|
| 1644 | Double getLambda() { return m_dLambda; } |
---|
| 1645 | #endif |
---|
| 1646 | |
---|
| 1647 | Void initEqualRef(); |
---|
| 1648 | Bool isEqualRef ( RefPicList e, Int iRefIdx1, Int iRefIdx2 ) |
---|
| 1649 | { |
---|
| 1650 | if (iRefIdx1 < 0 || iRefIdx2 < 0) return false; |
---|
| 1651 | return m_abEqualRef[e][iRefIdx1][iRefIdx2]; |
---|
| 1652 | } |
---|
| 1653 | |
---|
| 1654 | Void setEqualRef( RefPicList e, Int iRefIdx1, Int iRefIdx2, Bool b) |
---|
| 1655 | { |
---|
| 1656 | m_abEqualRef[e][iRefIdx1][iRefIdx2] = m_abEqualRef[e][iRefIdx2][iRefIdx1] = b; |
---|
| 1657 | } |
---|
| 1658 | |
---|
| 1659 | static Void sortPicList ( TComList<TComPic*>& rcListPic ); |
---|
| 1660 | Void setList1IdxToList0Idx(); |
---|
| 1661 | |
---|
| 1662 | UInt getTLayer () { return m_uiTLayer; } |
---|
| 1663 | Void setTLayer ( UInt uiTLayer ) { m_uiTLayer = uiTLayer; } |
---|
| 1664 | |
---|
| 1665 | Void setTLayerInfo( UInt uiTLayer ); |
---|
| 1666 | Void decodingMarking( TComList<TComPic*>& rcListPic, Int iGOPSIze, Int& iMaxRefPicNum ); |
---|
| 1667 | Void applyReferencePictureSet( TComList<TComPic*>& rcListPic, TComReferencePictureSet *RPSList); |
---|
| 1668 | Bool isTemporalLayerSwitchingPoint( TComList<TComPic*>& rcListPic ); |
---|
| 1669 | Bool isStepwiseTemporalLayerSwitchingPointCandidate( TComList<TComPic*>& rcListPic ); |
---|
| 1670 | Int checkThatAllRefPicsAreAvailable( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool printErrors, Int pocRandomAccess = 0); |
---|
| 1671 | #if FIX1071 |
---|
| 1672 | Void createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool isRAP); |
---|
| 1673 | #else |
---|
| 1674 | Void createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet); |
---|
| 1675 | #endif |
---|
| 1676 | |
---|
| 1677 | Void setMaxNumMergeCand (UInt val ) { m_maxNumMergeCand = val; } |
---|
| 1678 | UInt getMaxNumMergeCand () { return m_maxNumMergeCand; } |
---|
| 1679 | |
---|
| 1680 | Void setSliceMode ( UInt uiMode ) { m_sliceMode = uiMode; } |
---|
| 1681 | UInt getSliceMode () { return m_sliceMode; } |
---|
| 1682 | Void setSliceArgument ( UInt uiArgument ) { m_sliceArgument = uiArgument; } |
---|
| 1683 | UInt getSliceArgument () { return m_sliceArgument; } |
---|
| 1684 | Void setSliceCurStartCUAddr ( UInt uiAddr ) { m_sliceCurStartCUAddr = uiAddr; } |
---|
| 1685 | UInt getSliceCurStartCUAddr () { return m_sliceCurStartCUAddr; } |
---|
| 1686 | Void setSliceCurEndCUAddr ( UInt uiAddr ) { m_sliceCurEndCUAddr = uiAddr; } |
---|
| 1687 | UInt getSliceCurEndCUAddr () { return m_sliceCurEndCUAddr; } |
---|
| 1688 | Void setSliceIdx ( UInt i) { m_sliceIdx = i; } |
---|
| 1689 | UInt getSliceIdx () { return m_sliceIdx; } |
---|
| 1690 | Void copySliceInfo (TComSlice *pcSliceSrc); |
---|
| 1691 | Void setSliceSegmentMode ( UInt uiMode ) { m_sliceSegmentMode = uiMode; } |
---|
| 1692 | UInt getSliceSegmentMode () { return m_sliceSegmentMode; } |
---|
| 1693 | Void setSliceSegmentArgument ( UInt uiArgument ) { m_sliceSegmentArgument = uiArgument; } |
---|
| 1694 | UInt getSliceSegmentArgument () { return m_sliceSegmentArgument; } |
---|
| 1695 | Void setSliceSegmentCurStartCUAddr ( UInt uiAddr ) { m_sliceSegmentCurStartCUAddr = uiAddr; } |
---|
| 1696 | UInt getSliceSegmentCurStartCUAddr () { return m_sliceSegmentCurStartCUAddr; } |
---|
| 1697 | Void setSliceSegmentCurEndCUAddr ( UInt uiAddr ) { m_sliceSegmentCurEndCUAddr = uiAddr; } |
---|
| 1698 | UInt getSliceSegmentCurEndCUAddr () { return m_sliceSegmentCurEndCUAddr; } |
---|
| 1699 | Void setNextSlice ( Bool b ) { m_nextSlice = b; } |
---|
| 1700 | Bool isNextSlice () { return m_nextSlice; } |
---|
| 1701 | Void setNextSliceSegment ( Bool b ) { m_nextSliceSegment = b; } |
---|
| 1702 | Bool isNextSliceSegment () { return m_nextSliceSegment; } |
---|
| 1703 | Void setSliceBits ( UInt uiVal ) { m_sliceBits = uiVal; } |
---|
| 1704 | UInt getSliceBits () { return m_sliceBits; } |
---|
| 1705 | Void setSliceSegmentBits ( UInt uiVal ) { m_sliceSegmentBits = uiVal; } |
---|
| 1706 | UInt getSliceSegmentBits () { return m_sliceSegmentBits; } |
---|
| 1707 | Void setFinalized ( Bool uiVal ) { m_bFinalized = uiVal; } |
---|
| 1708 | Bool getFinalized () { return m_bFinalized; } |
---|
| 1709 | Void setWpScaling ( wpScalingParam wp[2][MAX_NUM_REF][3] ) { memcpy(m_weightPredTable, wp, sizeof(wpScalingParam)*2*MAX_NUM_REF*3); } |
---|
| 1710 | Void getWpScaling ( RefPicList e, Int iRefIdx, wpScalingParam *&wp); |
---|
| 1711 | |
---|
| 1712 | Void resetWpScaling (); |
---|
| 1713 | Void initWpScaling (); |
---|
| 1714 | inline Bool applyWP () { return( (m_eSliceType==P_SLICE && m_pcPPS->getUseWP()) || (m_eSliceType==B_SLICE && m_pcPPS->getWPBiPred()) ); } |
---|
| 1715 | |
---|
| 1716 | Void setWpAcDcParam ( wpACDCParam wp[3] ) { memcpy(m_weightACDCParam, wp, sizeof(wpACDCParam)*3); } |
---|
| 1717 | Void getWpAcDcParam ( wpACDCParam *&wp ); |
---|
| 1718 | Void initWpAcDcParam (); |
---|
| 1719 | |
---|
| 1720 | Void setTileLocationCount ( UInt cnt ) { return m_tileByteLocation.resize(cnt); } |
---|
| 1721 | UInt getTileLocationCount () { return (UInt) m_tileByteLocation.size(); } |
---|
| 1722 | Void setTileLocation ( Int idx, UInt location ) { assert (idx<m_tileByteLocation.size()); |
---|
| 1723 | m_tileByteLocation[idx] = location; } |
---|
| 1724 | Void addTileLocation ( UInt location ) { m_tileByteLocation.push_back(location); } |
---|
| 1725 | UInt getTileLocation ( Int idx ) { return m_tileByteLocation[idx]; } |
---|
| 1726 | |
---|
| 1727 | Void setTileOffstForMultES (UInt uiOffset ) { m_uiTileOffstForMultES = uiOffset; } |
---|
| 1728 | UInt getTileOffstForMultES () { return m_uiTileOffstForMultES; } |
---|
| 1729 | Void allocSubstreamSizes ( UInt uiNumSubstreams ); |
---|
| 1730 | UInt* getSubstreamSizes () { return m_puiSubstreamSizes; } |
---|
| 1731 | Void setScalingList ( TComScalingList* scalingList ) { m_scalingList = scalingList; } |
---|
| 1732 | TComScalingList* getScalingList () { return m_scalingList; } |
---|
| 1733 | Void setDefaultScalingList (); |
---|
| 1734 | Bool checkDefaultScalingList (); |
---|
| 1735 | Void setCabacInitFlag ( Bool val ) { m_cabacInitFlag = val; } //!< set CABAC initial flag |
---|
| 1736 | Bool getCabacInitFlag () { return m_cabacInitFlag; } //!< get CABAC initial flag |
---|
| 1737 | Void setNumEntryPointOffsets(Int val) { m_numEntryPointOffsets = val; } |
---|
| 1738 | Int getNumEntryPointOffsets() { return m_numEntryPointOffsets; } |
---|
| 1739 | Bool getTemporalLayerNonReferenceFlag() { return m_temporalLayerNonReferenceFlag;} |
---|
| 1740 | Void setTemporalLayerNonReferenceFlag(Bool x) { m_temporalLayerNonReferenceFlag = x;} |
---|
| 1741 | Void setLFCrossSliceBoundaryFlag ( Bool val ) { m_LFCrossSliceBoundaryFlag = val; } |
---|
| 1742 | Bool getLFCrossSliceBoundaryFlag () { return m_LFCrossSliceBoundaryFlag;} |
---|
| 1743 | |
---|
| 1744 | Void setEnableTMVPFlag ( Bool b ) { m_enableTMVPFlag = b; } |
---|
| 1745 | Bool getEnableTMVPFlag () { return m_enableTMVPFlag;} |
---|
| 1746 | |
---|
| 1747 | #if SVC_EXTENSION |
---|
| 1748 | Void setBaseColPic ( TComList<TComPic*>& rcListPic , UInt refLayerIdc ); |
---|
| 1749 | Void setBaseColPic (UInt refLayerIdc, TComPic* p) { m_pcBaseColPic[refLayerIdc] = p; } |
---|
| 1750 | TComPic* getBaseColPic (UInt refLayerIdc) { return m_pcBaseColPic[refLayerIdc]; } |
---|
| 1751 | TComPic** getBaseColPic () { return &m_pcBaseColPic[0]; } |
---|
| 1752 | |
---|
| 1753 | Void setLayerId (UInt layerId) { m_layerId = layerId; } |
---|
| 1754 | UInt getLayerId () { return m_layerId; } |
---|
| 1755 | |
---|
| 1756 | Void setFullPelBaseRec (UInt refLayerIdc, TComPicYuv* p) { m_pcFullPelBaseRec[refLayerIdc] = p; } |
---|
| 1757 | TComPicYuv* getFullPelBaseRec (UInt refLayerIdc) { return m_pcFullPelBaseRec[refLayerIdc]; } |
---|
| 1758 | |
---|
| 1759 | #if AVC_SYNTAX |
---|
| 1760 | Void initBaseLayerRPL( TComSlice *pcSlice ); |
---|
| 1761 | #endif |
---|
| 1762 | |
---|
| 1763 | #if REF_IDX_FRAMEWORK |
---|
| 1764 | Void setRefPicListModificationSvc(); |
---|
| 1765 | Int getNumILRRefIdx ( ) { return m_pcVPS->getNumDirectRefLayers( m_layerId ); } |
---|
| 1766 | |
---|
| 1767 | #if REF_IDX_MFM |
---|
| 1768 | Void setRefPOCListILP(TComPic** ilpPic, TComPic** pcRefPicRL); |
---|
| 1769 | #endif |
---|
| 1770 | |
---|
| 1771 | #if JCTVC_M0458_INTERLAYER_RPS_SIG |
---|
| 1772 | Int getActiveNumILRRefIdx ( ) { return m_activeNumILRRefIdx; } |
---|
| 1773 | Void setActiveNumILRRefIdx ( Int i ) { m_activeNumILRRefIdx = i; } |
---|
| 1774 | |
---|
| 1775 | Int getInterLayerPredLayerIdc (UInt layerIdx) { return m_interLayerPredLayerIdc[layerIdx];} |
---|
| 1776 | Void setInterLayerPredLayerIdc (UInt refLayerIdc, UInt layerIdx) { m_interLayerPredLayerIdc[layerIdx] = refLayerIdc; } |
---|
| 1777 | |
---|
| 1778 | Void setInterLayerPredEnabledFlag ( Bool val ) { m_interLayerPredEnabledFlag = val; } |
---|
| 1779 | Bool getInterLayerPredEnabledFlag () { return m_interLayerPredEnabledFlag;} |
---|
| 1780 | #else |
---|
| 1781 | Void setNumILRRefIdx ( Int i ) { m_numILRRefIdx = i; } |
---|
| 1782 | #endif |
---|
| 1783 | |
---|
| 1784 | #if M0457_IL_SAMPLE_PRED_ONLY_FLAG |
---|
| 1785 | Int getNumSamplePredRefLayers ( ) { return m_numSamplePredRefLayers; } |
---|
| 1786 | Void setNumSamplePredRefLayers ( Int i ) { m_numSamplePredRefLayers = i; } |
---|
| 1787 | Bool getInterLayerSamplePredOnlyFlag( ) { return m_interLayerSamplePredOnlyFlag; } |
---|
| 1788 | Void setInterLayerSamplePredOnlyFlag( Bool val ) { m_interLayerSamplePredOnlyFlag = val; } |
---|
| 1789 | #endif |
---|
| 1790 | |
---|
| 1791 | #if REF_IDX_FRAMEWORK && M0457_COL_PICTURE_SIGNALING |
---|
| 1792 | Void setNumMotionPredRefLayers(int i) { m_numMotionPredRefLayers = i; } |
---|
| 1793 | Int getNumMotionPredRefLayers() { return m_numMotionPredRefLayers; } |
---|
| 1794 | #if REF_IDX_MFM |
---|
| 1795 | Void setMFMEnabledFlag(Bool flag) { m_bMFMEnabledFlag = flag; } |
---|
| 1796 | Bool getMFMEnabledFlag() { return m_bMFMEnabledFlag; } |
---|
[324] | 1797 | #if !REMOVE_COL_PICTURE_SIGNALING |
---|
[313] | 1798 | Void setColRefLayerIdx(Int i) { m_colRefLayerIdx = i; } |
---|
| 1799 | Int getColRefLayerIdx() { return m_colRefLayerIdx; } |
---|
| 1800 | Void setAltColIndicationFlag(Bool i) { m_altColIndicationFlag = i; } |
---|
| 1801 | Bool getAltColIndicationFlag() { return m_altColIndicationFlag; } |
---|
| 1802 | Void setMotionPredIlp(TComPic *ilpPic) { m_pcIlpPic = ilpPic; } |
---|
| 1803 | TComPic* getMotionPredIlp() { return m_pcIlpPic; } |
---|
| 1804 | #endif |
---|
| 1805 | #endif |
---|
[324] | 1806 | #endif |
---|
[313] | 1807 | |
---|
| 1808 | #else |
---|
| 1809 | // temporal solution for IntraBL. Only one reference layer is supported. |
---|
| 1810 | Int getActiveNumILRRefIdx ( ) { return 1; } |
---|
| 1811 | Int getInterLayerPredLayerIdc (UInt layerIdx) { return m_layerId - 1;} |
---|
| 1812 | Void setActiveNumILRRefIdx ( Int i ) {} |
---|
| 1813 | Void setInterLayerPredEnabledFlag( Bool val ) {} |
---|
| 1814 | #endif |
---|
| 1815 | |
---|
| 1816 | TComPic* getRefPic(TComList<TComPic*>& rcListPic, Int poc) { return xGetRefPic( rcListPic, poc ); } |
---|
| 1817 | |
---|
| 1818 | #endif //SVC_EXTENSION |
---|
| 1819 | |
---|
| 1820 | protected: |
---|
| 1821 | TComPic* xGetRefPic (TComList<TComPic*>& rcListPic, |
---|
| 1822 | Int poc); |
---|
| 1823 | TComPic* xGetLongTermRefPic(TComList<TComPic*>& rcListPic, Int poc, Bool pocHasMsb); |
---|
| 1824 | };// END CLASS DEFINITION TComSlice |
---|
| 1825 | |
---|
| 1826 | |
---|
| 1827 | template <class T> class ParameterSetMap |
---|
| 1828 | { |
---|
| 1829 | public: |
---|
| 1830 | ParameterSetMap(Int maxId) |
---|
| 1831 | :m_maxId (maxId) |
---|
| 1832 | {} |
---|
| 1833 | |
---|
| 1834 | ~ParameterSetMap() |
---|
| 1835 | { |
---|
| 1836 | for (typename std::map<Int,T *>::iterator i = m_paramsetMap.begin(); i!= m_paramsetMap.end(); i++) |
---|
| 1837 | { |
---|
| 1838 | delete (*i).second; |
---|
| 1839 | } |
---|
| 1840 | } |
---|
| 1841 | |
---|
| 1842 | Void storePS(Int psId, T *ps) |
---|
| 1843 | { |
---|
| 1844 | assert ( psId < m_maxId ); |
---|
| 1845 | if ( m_paramsetMap.find(psId) != m_paramsetMap.end() ) |
---|
| 1846 | { |
---|
| 1847 | delete m_paramsetMap[psId]; |
---|
| 1848 | } |
---|
| 1849 | m_paramsetMap[psId] = ps; |
---|
| 1850 | } |
---|
| 1851 | |
---|
| 1852 | Void mergePSList(ParameterSetMap<T> &rPsList) |
---|
| 1853 | { |
---|
| 1854 | for (typename std::map<Int,T *>::iterator i = rPsList.m_paramsetMap.begin(); i!= rPsList.m_paramsetMap.end(); i++) |
---|
| 1855 | { |
---|
| 1856 | storePS(i->first, i->second); |
---|
| 1857 | } |
---|
| 1858 | rPsList.m_paramsetMap.clear(); |
---|
| 1859 | } |
---|
| 1860 | |
---|
| 1861 | |
---|
| 1862 | T* getPS(Int psId) |
---|
| 1863 | { |
---|
| 1864 | return ( m_paramsetMap.find(psId) == m_paramsetMap.end() ) ? NULL : m_paramsetMap[psId]; |
---|
| 1865 | } |
---|
| 1866 | |
---|
| 1867 | T* getFirstPS() |
---|
| 1868 | { |
---|
| 1869 | return (m_paramsetMap.begin() == m_paramsetMap.end() ) ? NULL : m_paramsetMap.begin()->second; |
---|
| 1870 | } |
---|
| 1871 | |
---|
| 1872 | private: |
---|
| 1873 | std::map<Int,T *> m_paramsetMap; |
---|
| 1874 | Int m_maxId; |
---|
| 1875 | }; |
---|
| 1876 | |
---|
| 1877 | class ParameterSetManager |
---|
| 1878 | { |
---|
| 1879 | public: |
---|
| 1880 | ParameterSetManager(); |
---|
| 1881 | virtual ~ParameterSetManager(); |
---|
| 1882 | |
---|
| 1883 | //! store sequence parameter set and take ownership of it |
---|
| 1884 | Void storeVPS(TComVPS *vps) { m_vpsMap.storePS( vps->getVPSId(), vps); }; |
---|
| 1885 | //! get pointer to existing video parameter set |
---|
| 1886 | TComVPS* getVPS(Int vpsId) { return m_vpsMap.getPS(vpsId); }; |
---|
| 1887 | TComVPS* getFirstVPS() { return m_vpsMap.getFirstPS(); }; |
---|
| 1888 | |
---|
| 1889 | //! store sequence parameter set and take ownership of it |
---|
| 1890 | Void storeSPS(TComSPS *sps) { m_spsMap.storePS( sps->getSPSId(), sps); }; |
---|
| 1891 | //! get pointer to existing sequence parameter set |
---|
| 1892 | TComSPS* getSPS(Int spsId) { return m_spsMap.getPS(spsId); }; |
---|
| 1893 | TComSPS* getFirstSPS() { return m_spsMap.getFirstPS(); }; |
---|
| 1894 | |
---|
| 1895 | //! store picture parameter set and take ownership of it |
---|
| 1896 | Void storePPS(TComPPS *pps) { m_ppsMap.storePS( pps->getPPSId(), pps); }; |
---|
| 1897 | //! get pointer to existing picture parameter set |
---|
| 1898 | TComPPS* getPPS(Int ppsId) { return m_ppsMap.getPS(ppsId); }; |
---|
| 1899 | TComPPS* getFirstPPS() { return m_ppsMap.getFirstPS(); }; |
---|
| 1900 | |
---|
| 1901 | //! activate a SPS from a active parameter sets SEI message |
---|
| 1902 | //! \returns true, if activation is successful |
---|
| 1903 | Bool activateSPSWithSEI(Int SPSId); |
---|
| 1904 | |
---|
| 1905 | //! activate a PPS and depending on isIDR parameter also SPS and VPS |
---|
| 1906 | //! \returns true, if activation is successful |
---|
| 1907 | Bool activatePPS(Int ppsId, Bool isIRAP); |
---|
| 1908 | |
---|
| 1909 | TComVPS* getActiveVPS(){ return m_vpsMap.getPS(m_activeVPSId); }; |
---|
| 1910 | TComSPS* getActiveSPS(){ return m_spsMap.getPS(m_activeSPSId); }; |
---|
| 1911 | TComPPS* getActivePPS(){ return m_ppsMap.getPS(m_activePPSId); }; |
---|
| 1912 | |
---|
| 1913 | protected: |
---|
| 1914 | |
---|
| 1915 | #if SVC_EXTENSION |
---|
| 1916 | static ParameterSetMap<TComVPS> m_vpsMap; |
---|
| 1917 | #else |
---|
| 1918 | ParameterSetMap<TComVPS> m_vpsMap; |
---|
| 1919 | #endif |
---|
| 1920 | ParameterSetMap<TComSPS> m_spsMap; |
---|
| 1921 | ParameterSetMap<TComPPS> m_ppsMap; |
---|
| 1922 | |
---|
| 1923 | #if SVC_EXTENSION |
---|
| 1924 | static Int m_activeVPSId; |
---|
| 1925 | #else |
---|
| 1926 | Int m_activeVPSId; |
---|
| 1927 | #endif |
---|
| 1928 | Int m_activeSPSId; |
---|
| 1929 | Int m_activePPSId; |
---|
| 1930 | }; |
---|
| 1931 | |
---|
| 1932 | //! \} |
---|
| 1933 | |
---|
| 1934 | #endif // __TCOMSLICE__ |
---|