[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 |
---|
[1029] | 4 | * granted under this license. |
---|
[313] | 5 | * |
---|
[1259] | 6 | * Copyright (c) 2010-2015, ITU/ISO/IEC |
---|
[313] | 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" |
---|
[1029] | 47 | #include "TComChromaFormat.h" |
---|
[313] | 48 | |
---|
| 49 | //! \ingroup TLibCommon |
---|
| 50 | //! \{ |
---|
| 51 | |
---|
| 52 | class TComPic; |
---|
| 53 | class TComTrQuant; |
---|
| 54 | |
---|
| 55 | #if SVC_EXTENSION |
---|
| 56 | class TComPicYuv; |
---|
[1235] | 57 | class TComSPS; |
---|
[313] | 58 | #endif |
---|
| 59 | // ==================================================================================================================== |
---|
| 60 | // Constants |
---|
| 61 | // ==================================================================================================================== |
---|
| 62 | |
---|
[1029] | 63 | static const UInt REF_PIC_LIST_NUM_IDX=32; |
---|
| 64 | |
---|
[313] | 65 | // ==================================================================================================================== |
---|
| 66 | // Class definition |
---|
| 67 | // ==================================================================================================================== |
---|
| 68 | |
---|
| 69 | /// Reference Picture Set class |
---|
| 70 | class TComReferencePictureSet |
---|
| 71 | { |
---|
| 72 | private: |
---|
| 73 | Int m_numberOfPictures; |
---|
| 74 | Int m_numberOfNegativePictures; |
---|
| 75 | Int m_numberOfPositivePictures; |
---|
| 76 | Int m_numberOfLongtermPictures; |
---|
| 77 | Int m_deltaPOC[MAX_NUM_REF_PICS]; |
---|
| 78 | Int m_POC[MAX_NUM_REF_PICS]; |
---|
| 79 | Bool m_used[MAX_NUM_REF_PICS]; |
---|
| 80 | Bool m_interRPSPrediction; |
---|
[1029] | 81 | Int m_deltaRIdxMinus1; |
---|
| 82 | Int m_deltaRPS; |
---|
| 83 | Int m_numRefIdc; |
---|
[313] | 84 | Int m_refIdc[MAX_NUM_REF_PICS+1]; |
---|
| 85 | Bool m_bCheckLTMSB[MAX_NUM_REF_PICS]; |
---|
| 86 | Int m_pocLSBLT[MAX_NUM_REF_PICS]; |
---|
| 87 | Int m_deltaPOCMSBCycleLT[MAX_NUM_REF_PICS]; |
---|
| 88 | Bool m_deltaPocMSBPresentFlag[MAX_NUM_REF_PICS]; |
---|
| 89 | |
---|
| 90 | public: |
---|
[1235] | 91 | TComReferencePictureSet(); |
---|
[313] | 92 | virtual ~TComReferencePictureSet(); |
---|
[1235] | 93 | Int getPocLSBLT(Int i) const { return m_pocLSBLT[i]; } |
---|
| 94 | Void setPocLSBLT(Int i, Int x) { m_pocLSBLT[i] = x; } |
---|
| 95 | Int getDeltaPocMSBCycleLT(Int i) const { return m_deltaPOCMSBCycleLT[i]; } |
---|
| 96 | Void setDeltaPocMSBCycleLT(Int i, Int x) { m_deltaPOCMSBCycleLT[i] = x; } |
---|
| 97 | Bool getDeltaPocMSBPresentFlag(Int i) const { return m_deltaPocMSBPresentFlag[i]; } |
---|
| 98 | Void setDeltaPocMSBPresentFlag(Int i, Bool x) { m_deltaPocMSBPresentFlag[i] = x; } |
---|
| 99 | Void setUsed(Int bufferNum, Bool used); |
---|
| 100 | Void setDeltaPOC(Int bufferNum, Int deltaPOC); |
---|
| 101 | Void setPOC(Int bufferNum, Int deltaPOC); |
---|
| 102 | Void setNumberOfPictures(Int numberOfPictures); |
---|
| 103 | Void setCheckLTMSBPresent(Int bufferNum, Bool b ); |
---|
| 104 | Bool getCheckLTMSBPresent(Int bufferNum) const; |
---|
[313] | 105 | |
---|
[1235] | 106 | Int getUsed(Int bufferNum) const; |
---|
| 107 | Int getDeltaPOC(Int bufferNum) const; |
---|
| 108 | Int getPOC(Int bufferNum) const; |
---|
| 109 | Int getNumberOfPictures() const; |
---|
[313] | 110 | |
---|
[1235] | 111 | Void setNumberOfNegativePictures(Int number) { m_numberOfNegativePictures = number; } |
---|
| 112 | Int getNumberOfNegativePictures() const { return m_numberOfNegativePictures; } |
---|
| 113 | Void setNumberOfPositivePictures(Int number) { m_numberOfPositivePictures = number; } |
---|
| 114 | Int getNumberOfPositivePictures() const { return m_numberOfPositivePictures; } |
---|
| 115 | Void setNumberOfLongtermPictures(Int number) { m_numberOfLongtermPictures = number; } |
---|
| 116 | Int getNumberOfLongtermPictures() const { return m_numberOfLongtermPictures; } |
---|
[313] | 117 | |
---|
[1235] | 118 | Void setInterRPSPrediction(Bool flag) { m_interRPSPrediction = flag; } |
---|
| 119 | Bool getInterRPSPrediction() const { return m_interRPSPrediction; } |
---|
| 120 | Void setDeltaRIdxMinus1(Int x) { m_deltaRIdxMinus1 = x; } |
---|
| 121 | Int getDeltaRIdxMinus1() const { return m_deltaRIdxMinus1; } |
---|
| 122 | Void setDeltaRPS(Int x) { m_deltaRPS = x; } |
---|
| 123 | Int getDeltaRPS() const { return m_deltaRPS; } |
---|
| 124 | Void setNumRefIdc(Int x) { m_numRefIdc = x; } |
---|
| 125 | Int getNumRefIdc() const { return m_numRefIdc; } |
---|
[313] | 126 | |
---|
[1235] | 127 | Void setRefIdc(Int bufferNum, Int refIdc); |
---|
| 128 | Int getRefIdc(Int bufferNum) const ; |
---|
[313] | 129 | |
---|
[1235] | 130 | Void sortDeltaPOC(); |
---|
| 131 | Void printDeltaPOC() const; |
---|
[313] | 132 | }; |
---|
| 133 | |
---|
| 134 | /// Reference Picture Set set class |
---|
| 135 | class TComRPSList |
---|
| 136 | { |
---|
| 137 | private: |
---|
[1235] | 138 | std::vector<TComReferencePictureSet> m_referencePictureSets; |
---|
[1029] | 139 | |
---|
[313] | 140 | public: |
---|
[1235] | 141 | TComRPSList() { } |
---|
| 142 | virtual ~TComRPSList() { } |
---|
[1029] | 143 | |
---|
[1235] | 144 | Void create (Int numberOfEntries) { m_referencePictureSets.resize(numberOfEntries); } |
---|
| 145 | Void destroy () { } |
---|
[313] | 146 | |
---|
| 147 | |
---|
[1235] | 148 | TComReferencePictureSet* getReferencePictureSet(Int referencePictureSetNum) { return &m_referencePictureSets[referencePictureSetNum]; } |
---|
| 149 | const TComReferencePictureSet* getReferencePictureSet(Int referencePictureSetNum) const { return &m_referencePictureSets[referencePictureSetNum]; } |
---|
| 150 | |
---|
| 151 | Int getNumberOfReferencePictureSets() const { return Int(m_referencePictureSets.size()); } |
---|
[313] | 152 | }; |
---|
| 153 | |
---|
| 154 | /// SCALING_LIST class |
---|
| 155 | class TComScalingList |
---|
| 156 | { |
---|
| 157 | public: |
---|
[1235] | 158 | TComScalingList(); |
---|
| 159 | virtual ~TComScalingList() { } |
---|
| 160 | Int* getScalingListAddress(UInt sizeId, UInt listId) { return &(m_scalingListCoef[sizeId][listId][0]); } //!< get matrix coefficient |
---|
| 161 | const Int* getScalingListAddress(UInt sizeId, UInt listId) const { return &(m_scalingListCoef[sizeId][listId][0]); } //!< get matrix coefficient |
---|
| 162 | Void checkPredMode(UInt sizeId, UInt listId); |
---|
[313] | 163 | |
---|
[1235] | 164 | Void setRefMatrixId(UInt sizeId, UInt listId, UInt u) { m_refMatrixId[sizeId][listId] = u; } //!< set reference matrix ID |
---|
| 165 | UInt getRefMatrixId(UInt sizeId, UInt listId) const { return m_refMatrixId[sizeId][listId]; } //!< get reference matrix ID |
---|
[313] | 166 | |
---|
[1292] | 167 | const Int* getScalingListDefaultAddress(UInt sizeId, UInt listId); //!< get default matrix coefficient |
---|
[1235] | 168 | Void processDefaultMatrix(UInt sizeId, UInt listId); |
---|
| 169 | |
---|
| 170 | Void setScalingListDC(UInt sizeId, UInt listId, UInt u) { m_scalingListDC[sizeId][listId] = u; } //!< set DC value |
---|
| 171 | Int getScalingListDC(UInt sizeId, UInt listId) const { return m_scalingListDC[sizeId][listId]; } //!< get DC value |
---|
| 172 | |
---|
| 173 | Void setScalingListPredModeFlag(UInt sizeId, UInt listId, Bool bIsDPCM) { m_scalingListPredModeFlagIsDPCM[sizeId][listId] = bIsDPCM; } |
---|
| 174 | Bool getScalingListPredModeFlag(UInt sizeId, UInt listId) const { return m_scalingListPredModeFlagIsDPCM[sizeId][listId]; } |
---|
| 175 | |
---|
| 176 | Void checkDcOfMatrix(); |
---|
| 177 | Void processRefMatrix(UInt sizeId, UInt listId , UInt refListId ); |
---|
[1442] | 178 | Bool xParseScalingList(const std::string &fileName); |
---|
[1235] | 179 | Void setDefaultScalingList(); |
---|
| 180 | Bool checkDefaultScalingList(); |
---|
| 181 | |
---|
[313] | 182 | private: |
---|
[1235] | 183 | Void outputScalingLists(std::ostream &os) const; |
---|
| 184 | Bool m_scalingListPredModeFlagIsDPCM [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< reference list index |
---|
| 185 | Int m_scalingListDC [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< the DC value of the matrix coefficient for 16x16 |
---|
| 186 | UInt m_refMatrixId [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< RefMatrixID |
---|
| 187 | std::vector<Int> m_scalingListCoef [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< quantization matrix |
---|
[313] | 188 | }; |
---|
| 189 | |
---|
| 190 | class ProfileTierLevel |
---|
| 191 | { |
---|
[1029] | 192 | Int m_profileSpace; |
---|
| 193 | Level::Tier m_tierFlag; |
---|
| 194 | Profile::Name m_profileIdc; |
---|
| 195 | Bool m_profileCompatibilityFlag[32]; |
---|
| 196 | Level::Name m_levelIdc; |
---|
[313] | 197 | |
---|
[1029] | 198 | Bool m_progressiveSourceFlag; |
---|
| 199 | Bool m_interlacedSourceFlag; |
---|
| 200 | Bool m_nonPackedConstraintFlag; |
---|
| 201 | Bool m_frameOnlyConstraintFlag; |
---|
| 202 | UInt m_bitDepthConstraintValue; |
---|
| 203 | ChromaFormat m_chromaFormatConstraintValue; |
---|
| 204 | Bool m_intraConstraintFlag; |
---|
[1356] | 205 | Bool m_onePictureOnlyConstraintFlag; |
---|
[1029] | 206 | Bool m_lowerBitRateConstraintFlag; |
---|
| 207 | |
---|
[313] | 208 | public: |
---|
[1235] | 209 | ProfileTierLevel(); |
---|
[313] | 210 | |
---|
[1235] | 211 | Int getProfileSpace() const { return m_profileSpace; } |
---|
| 212 | Void setProfileSpace(Int x) { m_profileSpace = x; } |
---|
[313] | 213 | |
---|
[1235] | 214 | Level::Tier getTierFlag() const { return m_tierFlag; } |
---|
| 215 | Void setTierFlag(Level::Tier x) { m_tierFlag = x; } |
---|
[313] | 216 | |
---|
[1235] | 217 | Profile::Name getProfileIdc() const { return m_profileIdc; } |
---|
| 218 | Void setProfileIdc(Profile::Name x) { m_profileIdc = x; } |
---|
[313] | 219 | |
---|
[1235] | 220 | Bool getProfileCompatibilityFlag(Int i) const { return m_profileCompatibilityFlag[i]; } |
---|
| 221 | Void setProfileCompatibilityFlag(Int i, Bool x) { m_profileCompatibilityFlag[i] = x; } |
---|
[313] | 222 | |
---|
[1235] | 223 | Level::Name getLevelIdc() const { return m_levelIdc; } |
---|
| 224 | Void setLevelIdc(Level::Name x) { m_levelIdc = x; } |
---|
[1029] | 225 | |
---|
[1235] | 226 | Bool getProgressiveSourceFlag() const { return m_progressiveSourceFlag; } |
---|
| 227 | Void setProgressiveSourceFlag(Bool b) { m_progressiveSourceFlag = b; } |
---|
[1029] | 228 | |
---|
[1235] | 229 | Bool getInterlacedSourceFlag() const { return m_interlacedSourceFlag; } |
---|
| 230 | Void setInterlacedSourceFlag(Bool b) { m_interlacedSourceFlag = b; } |
---|
[1029] | 231 | |
---|
[1235] | 232 | Bool getNonPackedConstraintFlag() const { return m_nonPackedConstraintFlag; } |
---|
| 233 | Void setNonPackedConstraintFlag(Bool b) { m_nonPackedConstraintFlag = b; } |
---|
[1029] | 234 | |
---|
[1235] | 235 | Bool getFrameOnlyConstraintFlag() const { return m_frameOnlyConstraintFlag; } |
---|
| 236 | Void setFrameOnlyConstraintFlag(Bool b) { m_frameOnlyConstraintFlag = b; } |
---|
[1029] | 237 | |
---|
[1235] | 238 | UInt getBitDepthConstraint() const { return m_bitDepthConstraintValue; } |
---|
| 239 | Void setBitDepthConstraint(UInt bitDepth) { m_bitDepthConstraintValue=bitDepth; } |
---|
[1029] | 240 | |
---|
[1235] | 241 | ChromaFormat getChromaFormatConstraint() const { return m_chromaFormatConstraintValue; } |
---|
| 242 | Void setChromaFormatConstraint(ChromaFormat fmt) { m_chromaFormatConstraintValue=fmt; } |
---|
[1029] | 243 | |
---|
[1235] | 244 | Bool getIntraConstraintFlag() const { return m_intraConstraintFlag; } |
---|
| 245 | Void setIntraConstraintFlag(Bool b) { m_intraConstraintFlag = b; } |
---|
[1029] | 246 | |
---|
[1356] | 247 | Bool getOnePictureOnlyConstraintFlag() const { return m_onePictureOnlyConstraintFlag;} |
---|
| 248 | Void setOnePictureOnlyConstraintFlag(Bool b) { m_onePictureOnlyConstraintFlag = b; } |
---|
| 249 | |
---|
[1235] | 250 | Bool getLowerBitRateConstraintFlag() const { return m_lowerBitRateConstraintFlag; } |
---|
| 251 | Void setLowerBitRateConstraintFlag(Bool b) { m_lowerBitRateConstraintFlag = b; } |
---|
[1029] | 252 | |
---|
[1170] | 253 | #if SVC_EXTENSION |
---|
[1235] | 254 | Void copyProfileInfo(ProfileTierLevel *ptl); |
---|
[313] | 255 | #endif |
---|
| 256 | }; |
---|
| 257 | |
---|
| 258 | |
---|
| 259 | class TComPTL |
---|
| 260 | { |
---|
| 261 | ProfileTierLevel m_generalPTL; |
---|
[713] | 262 | ProfileTierLevel m_subLayerPTL [MAX_TLAYER-1]; // max. value of max_sub_layers_minus1 is MAX_TLAYER-1 (= 6) |
---|
[644] | 263 | Bool m_subLayerProfilePresentFlag [MAX_TLAYER-1]; |
---|
| 264 | Bool m_subLayerLevelPresentFlag [MAX_TLAYER-1]; |
---|
[313] | 265 | |
---|
| 266 | public: |
---|
[1235] | 267 | TComPTL(); |
---|
| 268 | Bool getSubLayerProfilePresentFlag(Int i) const { return m_subLayerProfilePresentFlag[i]; } |
---|
| 269 | Void setSubLayerProfilePresentFlag(Int i, Bool x) { m_subLayerProfilePresentFlag[i] = x; } |
---|
[1029] | 270 | |
---|
[1235] | 271 | Bool getSubLayerLevelPresentFlag(Int i) const { return m_subLayerLevelPresentFlag[i]; } |
---|
| 272 | Void setSubLayerLevelPresentFlag(Int i, Bool x) { m_subLayerLevelPresentFlag[i] = x; } |
---|
[313] | 273 | |
---|
[1235] | 274 | ProfileTierLevel* getGeneralPTL() { return &m_generalPTL; } |
---|
| 275 | const ProfileTierLevel* getGeneralPTL() const { return &m_generalPTL; } |
---|
| 276 | ProfileTierLevel* getSubLayerPTL(Int i) { return &m_subLayerPTL[i]; } |
---|
| 277 | const ProfileTierLevel* getSubLayerPTL(Int i) const { return &m_subLayerPTL[i]; } |
---|
[1029] | 278 | |
---|
[1170] | 279 | #if SVC_EXTENSION |
---|
[1235] | 280 | Void copyProfileInfo(TComPTL *ptl); |
---|
[313] | 281 | #endif |
---|
| 282 | }; |
---|
[1029] | 283 | |
---|
[313] | 284 | /// VPS class |
---|
| 285 | |
---|
| 286 | struct HrdSubLayerInfo |
---|
| 287 | { |
---|
| 288 | Bool fixedPicRateFlag; |
---|
| 289 | Bool fixedPicRateWithinCvsFlag; |
---|
| 290 | UInt picDurationInTcMinus1; |
---|
| 291 | Bool lowDelayHrdFlag; |
---|
| 292 | UInt cpbCntMinus1; |
---|
| 293 | UInt bitRateValueMinus1[MAX_CPB_CNT][2]; |
---|
| 294 | UInt cpbSizeValue [MAX_CPB_CNT][2]; |
---|
| 295 | UInt ducpbSizeValue [MAX_CPB_CNT][2]; |
---|
[1230] | 296 | Bool cbrFlag [MAX_CPB_CNT][2]; |
---|
[313] | 297 | UInt duBitRateValue [MAX_CPB_CNT][2]; |
---|
| 298 | }; |
---|
| 299 | |
---|
| 300 | class TComHRD |
---|
| 301 | { |
---|
| 302 | private: |
---|
| 303 | Bool m_nalHrdParametersPresentFlag; |
---|
| 304 | Bool m_vclHrdParametersPresentFlag; |
---|
| 305 | Bool m_subPicCpbParamsPresentFlag; |
---|
| 306 | UInt m_tickDivisorMinus2; |
---|
| 307 | UInt m_duCpbRemovalDelayLengthMinus1; |
---|
| 308 | Bool m_subPicCpbParamsInPicTimingSEIFlag; |
---|
| 309 | UInt m_dpbOutputDelayDuLengthMinus1; |
---|
| 310 | UInt m_bitRateScale; |
---|
| 311 | UInt m_cpbSizeScale; |
---|
| 312 | UInt m_ducpbSizeScale; |
---|
| 313 | UInt m_initialCpbRemovalDelayLengthMinus1; |
---|
| 314 | UInt m_cpbRemovalDelayLengthMinus1; |
---|
| 315 | UInt m_dpbOutputDelayLengthMinus1; |
---|
| 316 | HrdSubLayerInfo m_HRD[MAX_TLAYER]; |
---|
| 317 | |
---|
| 318 | public: |
---|
| 319 | TComHRD() |
---|
[1235] | 320 | :m_nalHrdParametersPresentFlag (0) |
---|
| 321 | ,m_vclHrdParametersPresentFlag (0) |
---|
| 322 | ,m_subPicCpbParamsPresentFlag (false) |
---|
| 323 | ,m_tickDivisorMinus2 (0) |
---|
| 324 | ,m_duCpbRemovalDelayLengthMinus1 (0) |
---|
| 325 | ,m_subPicCpbParamsInPicTimingSEIFlag (false) |
---|
| 326 | ,m_dpbOutputDelayDuLengthMinus1 (0) |
---|
| 327 | ,m_bitRateScale (0) |
---|
| 328 | ,m_cpbSizeScale (0) |
---|
[1029] | 329 | ,m_initialCpbRemovalDelayLengthMinus1(23) |
---|
[1235] | 330 | ,m_cpbRemovalDelayLengthMinus1 (23) |
---|
| 331 | ,m_dpbOutputDelayLengthMinus1 (23) |
---|
[313] | 332 | {} |
---|
| 333 | |
---|
| 334 | virtual ~TComHRD() {} |
---|
| 335 | |
---|
[1235] | 336 | Void setNalHrdParametersPresentFlag( Bool flag ) { m_nalHrdParametersPresentFlag = flag; } |
---|
| 337 | Bool getNalHrdParametersPresentFlag( ) const { return m_nalHrdParametersPresentFlag; } |
---|
[313] | 338 | |
---|
[1235] | 339 | Void setVclHrdParametersPresentFlag( Bool flag ) { m_vclHrdParametersPresentFlag = flag; } |
---|
| 340 | Bool getVclHrdParametersPresentFlag( ) const { return m_vclHrdParametersPresentFlag; } |
---|
[313] | 341 | |
---|
[1235] | 342 | Void setSubPicCpbParamsPresentFlag( Bool flag ) { m_subPicCpbParamsPresentFlag = flag; } |
---|
| 343 | Bool getSubPicCpbParamsPresentFlag( ) const { return m_subPicCpbParamsPresentFlag; } |
---|
[1029] | 344 | |
---|
[1235] | 345 | Void setTickDivisorMinus2( UInt value ) { m_tickDivisorMinus2 = value; } |
---|
| 346 | UInt getTickDivisorMinus2( ) const { return m_tickDivisorMinus2; } |
---|
[313] | 347 | |
---|
[1235] | 348 | Void setDuCpbRemovalDelayLengthMinus1( UInt value ) { m_duCpbRemovalDelayLengthMinus1 = value; } |
---|
| 349 | UInt getDuCpbRemovalDelayLengthMinus1( ) const { return m_duCpbRemovalDelayLengthMinus1; } |
---|
[313] | 350 | |
---|
[1235] | 351 | Void setSubPicCpbParamsInPicTimingSEIFlag( Bool flag) { m_subPicCpbParamsInPicTimingSEIFlag = flag; } |
---|
| 352 | Bool getSubPicCpbParamsInPicTimingSEIFlag( ) const { return m_subPicCpbParamsInPicTimingSEIFlag; } |
---|
[313] | 353 | |
---|
[1235] | 354 | Void setDpbOutputDelayDuLengthMinus1(UInt value ) { m_dpbOutputDelayDuLengthMinus1 = value; } |
---|
| 355 | UInt getDpbOutputDelayDuLengthMinus1( ) const { return m_dpbOutputDelayDuLengthMinus1; } |
---|
[313] | 356 | |
---|
[1235] | 357 | Void setBitRateScale( UInt value ) { m_bitRateScale = value; } |
---|
| 358 | UInt getBitRateScale( ) const { return m_bitRateScale; } |
---|
[313] | 359 | |
---|
[1235] | 360 | Void setCpbSizeScale( UInt value ) { m_cpbSizeScale = value; } |
---|
| 361 | UInt getCpbSizeScale( ) const { return m_cpbSizeScale; } |
---|
| 362 | Void setDuCpbSizeScale( UInt value ) { m_ducpbSizeScale = value; } |
---|
| 363 | UInt getDuCpbSizeScale( ) const { return m_ducpbSizeScale; } |
---|
[313] | 364 | |
---|
[1235] | 365 | Void setInitialCpbRemovalDelayLengthMinus1( UInt value ) { m_initialCpbRemovalDelayLengthMinus1 = value; } |
---|
| 366 | UInt getInitialCpbRemovalDelayLengthMinus1( ) const { return m_initialCpbRemovalDelayLengthMinus1; } |
---|
[313] | 367 | |
---|
[1235] | 368 | Void setCpbRemovalDelayLengthMinus1( UInt value ) { m_cpbRemovalDelayLengthMinus1 = value; } |
---|
| 369 | UInt getCpbRemovalDelayLengthMinus1( ) const { return m_cpbRemovalDelayLengthMinus1; } |
---|
[313] | 370 | |
---|
[1235] | 371 | Void setDpbOutputDelayLengthMinus1( UInt value ) { m_dpbOutputDelayLengthMinus1 = value; } |
---|
| 372 | UInt getDpbOutputDelayLengthMinus1( ) const { return m_dpbOutputDelayLengthMinus1; } |
---|
[313] | 373 | |
---|
[1235] | 374 | Void setFixedPicRateFlag( Int layer, Bool flag ) { m_HRD[layer].fixedPicRateFlag = flag; } |
---|
| 375 | Bool getFixedPicRateFlag( Int layer ) const { return m_HRD[layer].fixedPicRateFlag; } |
---|
[313] | 376 | |
---|
[1235] | 377 | Void setFixedPicRateWithinCvsFlag( Int layer, Bool flag ) { m_HRD[layer].fixedPicRateWithinCvsFlag = flag; } |
---|
| 378 | Bool getFixedPicRateWithinCvsFlag( Int layer ) const { return m_HRD[layer].fixedPicRateWithinCvsFlag; } |
---|
[313] | 379 | |
---|
[1235] | 380 | Void setPicDurationInTcMinus1( Int layer, UInt value ) { m_HRD[layer].picDurationInTcMinus1 = value; } |
---|
| 381 | UInt getPicDurationInTcMinus1( Int layer ) const { return m_HRD[layer].picDurationInTcMinus1; } |
---|
[313] | 382 | |
---|
[1235] | 383 | Void setLowDelayHrdFlag( Int layer, Bool flag ) { m_HRD[layer].lowDelayHrdFlag = flag; } |
---|
| 384 | Bool getLowDelayHrdFlag( Int layer ) const { return m_HRD[layer].lowDelayHrdFlag; } |
---|
[313] | 385 | |
---|
[1235] | 386 | Void setCpbCntMinus1( Int layer, UInt value ) { m_HRD[layer].cpbCntMinus1 = value; } |
---|
| 387 | UInt getCpbCntMinus1( Int layer ) const { return m_HRD[layer].cpbCntMinus1; } |
---|
[313] | 388 | |
---|
[1235] | 389 | Void setBitRateValueMinus1( Int layer, Int cpbcnt, Int nalOrVcl, UInt value ) { m_HRD[layer].bitRateValueMinus1[cpbcnt][nalOrVcl] = value; } |
---|
| 390 | UInt getBitRateValueMinus1( Int layer, Int cpbcnt, Int nalOrVcl ) const { return m_HRD[layer].bitRateValueMinus1[cpbcnt][nalOrVcl]; } |
---|
[313] | 391 | |
---|
[1235] | 392 | Void setCpbSizeValueMinus1( Int layer, Int cpbcnt, Int nalOrVcl, UInt value ) { m_HRD[layer].cpbSizeValue[cpbcnt][nalOrVcl] = value; } |
---|
| 393 | UInt getCpbSizeValueMinus1( Int layer, Int cpbcnt, Int nalOrVcl ) const { return m_HRD[layer].cpbSizeValue[cpbcnt][nalOrVcl]; } |
---|
| 394 | Void setDuCpbSizeValueMinus1( Int layer, Int cpbcnt, Int nalOrVcl, UInt value ) { m_HRD[layer].ducpbSizeValue[cpbcnt][nalOrVcl] = value; } |
---|
| 395 | UInt getDuCpbSizeValueMinus1( Int layer, Int cpbcnt, Int nalOrVcl ) const { return m_HRD[layer].ducpbSizeValue[cpbcnt][nalOrVcl]; } |
---|
| 396 | Void setDuBitRateValueMinus1( Int layer, Int cpbcnt, Int nalOrVcl, UInt value ) { m_HRD[layer].duBitRateValue[cpbcnt][nalOrVcl] = value; } |
---|
| 397 | UInt getDuBitRateValueMinus1(Int layer, Int cpbcnt, Int nalOrVcl ) const { return m_HRD[layer].duBitRateValue[cpbcnt][nalOrVcl]; } |
---|
| 398 | Void setCbrFlag( Int layer, Int cpbcnt, Int nalOrVcl, Bool value ) { m_HRD[layer].cbrFlag[cpbcnt][nalOrVcl] = value; } |
---|
| 399 | Bool getCbrFlag( Int layer, Int cpbcnt, Int nalOrVcl ) const { return m_HRD[layer].cbrFlag[cpbcnt][nalOrVcl]; } |
---|
[313] | 400 | |
---|
[1235] | 401 | Bool getCpbDpbDelaysPresentFlag( ) const { return getNalHrdParametersPresentFlag() || getVclHrdParametersPresentFlag(); } |
---|
[894] | 402 | |
---|
[1185] | 403 | #if SVC_EXTENSION |
---|
[894] | 404 | Void copyCommonInformation( TComHRD *refHrd ) |
---|
| 405 | { |
---|
| 406 | m_nalHrdParametersPresentFlag = refHrd->getNalHrdParametersPresentFlag(); |
---|
| 407 | m_vclHrdParametersPresentFlag = refHrd->getVclHrdParametersPresentFlag(); |
---|
| 408 | m_subPicCpbParamsPresentFlag = refHrd->getSubPicCpbParamsPresentFlag(); |
---|
| 409 | m_tickDivisorMinus2 = refHrd->getTickDivisorMinus2(); |
---|
| 410 | m_duCpbRemovalDelayLengthMinus1 = refHrd->getDuCpbRemovalDelayLengthMinus1(); |
---|
| 411 | m_subPicCpbParamsInPicTimingSEIFlag = refHrd->getSubPicCpbParamsInPicTimingSEIFlag(); |
---|
| 412 | m_dpbOutputDelayDuLengthMinus1 = refHrd->getDpbOutputDelayDuLengthMinus1(); |
---|
| 413 | m_bitRateScale = refHrd->getBitRateScale(); |
---|
| 414 | m_cpbSizeScale = refHrd->getCpbSizeScale(); |
---|
| 415 | m_ducpbSizeScale = refHrd->getDuCpbSizeScale(); |
---|
| 416 | m_initialCpbRemovalDelayLengthMinus1 = refHrd->getInitialCpbRemovalDelayLengthMinus1(); |
---|
| 417 | m_cpbRemovalDelayLengthMinus1 = refHrd->getCpbRemovalDelayLengthMinus1(); |
---|
| 418 | m_dpbOutputDelayLengthMinus1 = refHrd->getDpbOutputDelayLengthMinus1(); |
---|
| 419 | } |
---|
| 420 | #endif |
---|
[313] | 421 | }; |
---|
| 422 | |
---|
| 423 | class TimingInfo |
---|
| 424 | { |
---|
| 425 | Bool m_timingInfoPresentFlag; |
---|
| 426 | UInt m_numUnitsInTick; |
---|
| 427 | UInt m_timeScale; |
---|
| 428 | Bool m_pocProportionalToTimingFlag; |
---|
| 429 | Int m_numTicksPocDiffOneMinus1; |
---|
| 430 | public: |
---|
| 431 | TimingInfo() |
---|
[1235] | 432 | : m_timingInfoPresentFlag (false) |
---|
| 433 | , m_numUnitsInTick (1001) |
---|
| 434 | , m_timeScale (60000) |
---|
[313] | 435 | , m_pocProportionalToTimingFlag(false) |
---|
[1235] | 436 | , m_numTicksPocDiffOneMinus1 (0) |
---|
| 437 | {} |
---|
[313] | 438 | |
---|
[1235] | 439 | Void setTimingInfoPresentFlag( Bool flag ) { m_timingInfoPresentFlag = flag; } |
---|
| 440 | Bool getTimingInfoPresentFlag( ) const { return m_timingInfoPresentFlag; } |
---|
[313] | 441 | |
---|
[1235] | 442 | Void setNumUnitsInTick( UInt value ) { m_numUnitsInTick = value; } |
---|
| 443 | UInt getNumUnitsInTick( ) const { return m_numUnitsInTick; } |
---|
[313] | 444 | |
---|
[1235] | 445 | Void setTimeScale( UInt value ) { m_timeScale = value; } |
---|
| 446 | UInt getTimeScale( ) const { return m_timeScale; } |
---|
[1029] | 447 | |
---|
[1235] | 448 | Void setPocProportionalToTimingFlag(Bool x) { m_pocProportionalToTimingFlag = x; } |
---|
| 449 | Bool getPocProportionalToTimingFlag( ) const { return m_pocProportionalToTimingFlag; } |
---|
[1029] | 450 | |
---|
[1235] | 451 | Void setNumTicksPocDiffOneMinus1(Int x) { m_numTicksPocDiffOneMinus1 = x; } |
---|
| 452 | Int getNumTicksPocDiffOneMinus1( ) const { return m_numTicksPocDiffOneMinus1; } |
---|
[313] | 453 | }; |
---|
| 454 | |
---|
[1029] | 455 | struct ChromaQpAdj |
---|
| 456 | { |
---|
| 457 | union |
---|
| 458 | { |
---|
| 459 | struct { |
---|
| 460 | Int CbOffset; |
---|
| 461 | Int CrOffset; |
---|
| 462 | } comp; |
---|
| 463 | Int offset[2]; /* two chroma components */ |
---|
| 464 | } u; |
---|
| 465 | }; |
---|
| 466 | |
---|
[869] | 467 | class Window |
---|
| 468 | { |
---|
| 469 | private: |
---|
[1235] | 470 | Bool m_enabledFlag; |
---|
| 471 | Int m_winLeftOffset; |
---|
| 472 | Int m_winRightOffset; |
---|
| 473 | Int m_winTopOffset; |
---|
| 474 | Int m_winBottomOffset; |
---|
[869] | 475 | public: |
---|
| 476 | Window() |
---|
[1235] | 477 | : m_enabledFlag (false) |
---|
| 478 | , m_winLeftOffset (0) |
---|
| 479 | , m_winRightOffset (0) |
---|
| 480 | , m_winTopOffset (0) |
---|
| 481 | , m_winBottomOffset(0) |
---|
[869] | 482 | { } |
---|
| 483 | |
---|
[1235] | 484 | Bool getWindowEnabledFlag() const { return m_enabledFlag; } |
---|
| 485 | Int getWindowLeftOffset() const { return m_enabledFlag ? m_winLeftOffset : 0; } |
---|
| 486 | Void setWindowLeftOffset(Int val) { m_winLeftOffset = val; m_enabledFlag = true; } |
---|
| 487 | Int getWindowRightOffset() const { return m_enabledFlag ? m_winRightOffset : 0; } |
---|
| 488 | Void setWindowRightOffset(Int val) { m_winRightOffset = val; m_enabledFlag = true; } |
---|
| 489 | Int getWindowTopOffset() const { return m_enabledFlag ? m_winTopOffset : 0; } |
---|
| 490 | Void setWindowTopOffset(Int val) { m_winTopOffset = val; m_enabledFlag = true; } |
---|
| 491 | Int getWindowBottomOffset() const { return m_enabledFlag ? m_winBottomOffset: 0; } |
---|
| 492 | Void setWindowBottomOffset(Int val) { m_winBottomOffset = val; m_enabledFlag = true; } |
---|
[1029] | 493 | |
---|
[1325] | 494 | Void setWindow(Int offsetLeft, Int offsetLRight, Int offsetLTop, Int offsetLBottom) |
---|
| 495 | { |
---|
| 496 | m_enabledFlag = true; |
---|
| 497 | m_winLeftOffset = offsetLeft; |
---|
| 498 | m_winRightOffset = offsetLRight; |
---|
| 499 | m_winTopOffset = offsetLTop; |
---|
| 500 | m_winBottomOffset = offsetLBottom; |
---|
| 501 | } |
---|
| 502 | |
---|
[1090] | 503 | #if SVC_EXTENSION |
---|
[1235] | 504 | Bool hasEqualOffset(const Window& ref) const |
---|
[873] | 505 | { |
---|
| 506 | return ( this->getWindowLeftOffset() == ref.getWindowLeftOffset() |
---|
| 507 | && this->getWindowTopOffset() == ref.getWindowTopOffset() |
---|
| 508 | && this->getWindowRightOffset() == ref.getWindowRightOffset() |
---|
| 509 | && this->getWindowBottomOffset() == ref.getWindowBottomOffset() ); |
---|
| 510 | } |
---|
| 511 | #endif |
---|
[869] | 512 | |
---|
| 513 | }; |
---|
| 514 | |
---|
[1325] | 515 | |
---|
| 516 | |
---|
[1203] | 517 | #if SVC_EXTENSION |
---|
[1235] | 518 | struct ResamplingPhase |
---|
| 519 | { |
---|
| 520 | Bool phasePresentFlag; |
---|
| 521 | Int phaseHorLuma; |
---|
| 522 | Int phaseVerLuma; |
---|
| 523 | Int phaseHorChroma; |
---|
| 524 | Int phaseVerChroma; |
---|
| 525 | |
---|
| 526 | ResamplingPhase() |
---|
| 527 | : phasePresentFlag (false) |
---|
| 528 | , phaseHorLuma (0) |
---|
| 529 | , phaseVerLuma (0) |
---|
| 530 | , phaseHorChroma (0) |
---|
| 531 | , phaseVerChroma (0) |
---|
| 532 | { |
---|
| 533 | } |
---|
| 534 | }; |
---|
| 535 | |
---|
[442] | 536 | class RepFormat |
---|
| 537 | { |
---|
[540] | 538 | Bool m_chromaAndBitDepthVpsPresentFlag; |
---|
[494] | 539 | ChromaFormat m_chromaFormatVpsIdc; |
---|
[442] | 540 | Bool m_separateColourPlaneVpsFlag; |
---|
| 541 | Int m_picWidthVpsInLumaSamples; |
---|
| 542 | Int m_picHeightVpsInLumaSamples; |
---|
| 543 | Int m_bitDepthVpsLuma; // coded as minus8 |
---|
| 544 | Int m_bitDepthVpsChroma; // coded as minus8 |
---|
| 545 | |
---|
[869] | 546 | Window m_conformanceWindowVps; |
---|
| 547 | |
---|
[442] | 548 | public: |
---|
| 549 | RepFormat(); |
---|
[1235] | 550 | Bool getChromaAndBitDepthVpsPresentFlag() const { return m_chromaAndBitDepthVpsPresentFlag; } |
---|
| 551 | void setChromaAndBitDepthVpsPresentFlag(Bool x) { m_chromaAndBitDepthVpsPresentFlag = x; } |
---|
[540] | 552 | |
---|
[1235] | 553 | ChromaFormat getChromaFormatVpsIdc() const { return m_chromaFormatVpsIdc; } |
---|
| 554 | Void setChromaFormatVpsIdc(ChromaFormat x) { m_chromaFormatVpsIdc = x; } |
---|
[442] | 555 | |
---|
[1235] | 556 | Bool getSeparateColourPlaneVpsFlag() const { return m_separateColourPlaneVpsFlag; } |
---|
| 557 | Void setSeparateColourPlaneVpsFlag(Bool x) { m_separateColourPlaneVpsFlag = x; } |
---|
[442] | 558 | |
---|
[1235] | 559 | Int getPicWidthVpsInLumaSamples() const { return m_picWidthVpsInLumaSamples; } |
---|
| 560 | Void setPicWidthVpsInLumaSamples(Int x) { m_picWidthVpsInLumaSamples = x; } |
---|
[442] | 561 | |
---|
[1235] | 562 | Int getPicHeightVpsInLumaSamples() const { return m_picHeightVpsInLumaSamples; } |
---|
| 563 | Void setPicHeightVpsInLumaSamples(Int x) { m_picHeightVpsInLumaSamples = x; } |
---|
[442] | 564 | |
---|
[1235] | 565 | Int getBitDepthVpsLuma() const { return m_bitDepthVpsLuma; } |
---|
| 566 | Void setBitDepthVpsLuma(Int x) { m_bitDepthVpsLuma = x; } |
---|
[1029] | 567 | |
---|
[1235] | 568 | Int getBitDepthVpsChroma() const { return m_bitDepthVpsChroma; } |
---|
| 569 | Void setBitDepthVpsChroma(Int x) { m_bitDepthVpsChroma = x; } |
---|
[869] | 570 | |
---|
[1287] | 571 | Int getBitDepthVps(ChannelType type) const { return isLuma(type) ? m_bitDepthVpsLuma : m_bitDepthVpsChroma; } |
---|
[1029] | 572 | |
---|
[1235] | 573 | Window& getConformanceWindowVps() { return m_conformanceWindowVps; } |
---|
| 574 | const Window& getConformanceWindowVps() const { return m_conformanceWindowVps; } |
---|
| 575 | Void setConformanceWindowVps(Window& conformanceWindow ) { m_conformanceWindowVps = conformanceWindow; } |
---|
[442] | 576 | }; |
---|
[1203] | 577 | #endif |
---|
[1029] | 578 | |
---|
[313] | 579 | class TComVPS |
---|
| 580 | { |
---|
| 581 | private: |
---|
[1235] | 582 | Int m_VPSId; |
---|
| 583 | UInt m_uiMaxTLayers; |
---|
| 584 | UInt m_uiMaxLayers; |
---|
| 585 | Bool m_bTemporalIdNestingFlag; |
---|
[1029] | 586 | |
---|
[1235] | 587 | UInt m_numReorderPics[MAX_TLAYER]; |
---|
| 588 | UInt m_uiMaxDecPicBuffering[MAX_TLAYER]; |
---|
| 589 | UInt m_uiMaxLatencyIncrease[MAX_TLAYER]; // Really max latency increase plus 1 (value 0 expresses no limit) |
---|
[313] | 590 | |
---|
[1235] | 591 | UInt m_numHrdParameters; |
---|
[815] | 592 | #if !SVC_EXTENSION |
---|
[1235] | 593 | UInt m_maxNuhReservedZeroLayerId; |
---|
[313] | 594 | #endif |
---|
[1235] | 595 | std::vector<TComHRD> m_hrdParameters; |
---|
| 596 | std::vector<UInt> m_hrdOpSetIdx; |
---|
| 597 | std::vector<Bool> m_cprmsPresentFlag; |
---|
[494] | 598 | #if !SVC_EXTENSION |
---|
[1235] | 599 | UInt m_numOpSets; |
---|
| 600 | Bool m_layerIdIncludedFlag[MAX_VPS_OP_SETS_PLUS1][MAX_VPS_NUH_RESERVED_ZERO_LAYER_ID_PLUS1]; |
---|
| 601 | |
---|
| 602 | TComPTL m_pcPTL; |
---|
[941] | 603 | #endif |
---|
[1235] | 604 | TimingInfo m_timingInfo; |
---|
[494] | 605 | |
---|
| 606 | #if SVC_EXTENSION |
---|
[1235] | 607 | Bool m_baseLayerInternalFlag; |
---|
| 608 | Bool m_baseLayerAvailableFlag; |
---|
| 609 | TComPTL m_pcPTLList[MAX_NUM_LAYER_IDS + 1]; |
---|
[1172] | 610 | |
---|
[865] | 611 | std::vector< std::vector<Int> > m_layerSetLayerIdList; |
---|
[1057] | 612 | std::vector<Int> m_numLayerInIdList; |
---|
[1172] | 613 | |
---|
[1235] | 614 | UInt m_maxLayerId; |
---|
| 615 | UInt m_numLayerSets; |
---|
[1172] | 616 | |
---|
[1235] | 617 | UInt m_vpsNumLayerSetsMinus1; |
---|
| 618 | Bool m_layerIdIncludedFlag[MAX_VPS_LAYER_SETS_PLUS1 + MAX_NUM_ADD_LAYER_SETS][MAX_NUM_LAYER_IDS]; |
---|
[313] | 619 | |
---|
| 620 | // ------------------------------------------ |
---|
| 621 | // Variables related to VPS extensions |
---|
| 622 | // ------------------------------------------ |
---|
[1235] | 623 | Bool m_nonHEVCBaseLayerFlag; |
---|
| 624 | Bool m_splittingFlag; |
---|
| 625 | Bool m_scalabilityMask[MAX_VPS_NUM_SCALABILITY_TYPES]; |
---|
[1497] | 626 | UChar m_dimensionIdLen[MAX_VPS_NUM_SCALABILITY_TYPES]; |
---|
[1235] | 627 | Bool m_nuhLayerIdPresentFlag; |
---|
[1497] | 628 | UChar m_layerIdInNuh[MAX_VPS_LAYER_IDX_PLUS1]; // Maps layer ID in the VPS with layer_id_in_nuh |
---|
| 629 | UChar m_dimensionId[MAX_VPS_LAYER_IDX_PLUS1][MAX_VPS_NUM_SCALABILITY_TYPES]; |
---|
[313] | 630 | |
---|
| 631 | // Below are derived variables |
---|
[1497] | 632 | UChar m_numScalabilityTypes; |
---|
| 633 | UChar m_layerIdxInVps[MAX_NUM_LAYER_IDS]; // Maps layer_id_in_nuh with the layer ID in the VPS |
---|
| 634 | UChar m_maxSLInLayerSetMinus1[MAX_VPS_LAYER_SETS_PLUS1 + MAX_NUM_ADD_LAYER_SETS]; |
---|
[1235] | 635 | Bool m_ilpSshSignalingEnabledFlag; |
---|
[1170] | 636 | |
---|
[313] | 637 | // Profile-tier-level signalling related |
---|
[1235] | 638 | Bool m_profilePresentFlag[MAX_VPS_LAYER_SETS_PLUS1]; // The value with index 0 will not be used. |
---|
[1171] | 639 | |
---|
[313] | 640 | // Target output layer signalling related |
---|
[1235] | 641 | UInt m_numOutputLayerSets; |
---|
| 642 | UInt m_outputLayerSetIdx[MAX_VPS_LAYER_SETS_PLUS1 + 2*MAX_NUM_ADD_LAYER_SETS]; |
---|
| 643 | Bool m_outputLayerFlag[MAX_VPS_LAYER_SETS_PLUS1 + 2*MAX_NUM_ADD_LAYER_SETS][MAX_VPS_LAYER_IDX_PLUS1]; |
---|
| 644 | Bool m_directDependencyFlag[MAX_VPS_LAYER_IDX_PLUS1][MAX_VPS_LAYER_IDX_PLUS1]; |
---|
[1497] | 645 | UChar m_numDirectRefLayers[MAX_VPS_LAYER_IDX_PLUS1]; |
---|
| 646 | UChar m_refLayerId[MAX_VPS_LAYER_IDX_PLUS1][MAX_VPS_LAYER_IDX_PLUS1]; |
---|
[1235] | 647 | UInt m_directDepTypeLen; |
---|
| 648 | Bool m_defaultDirectDependencyTypeFlag; |
---|
| 649 | UInt m_defaultDirectDependencyType; |
---|
| 650 | UInt m_directDependencyType[MAX_VPS_LAYER_IDX_PLUS1][MAX_VPS_LAYER_IDX_PLUS1]; |
---|
[1148] | 651 | |
---|
[1235] | 652 | UInt m_numProfileTierLevel; |
---|
| 653 | Int m_numAddOutputLayerSets; |
---|
| 654 | UInt m_defaultTargetOutputLayerIdc; |
---|
[866] | 655 | std::vector< std::vector<Int> > m_profileLevelTierIdx; |
---|
[1235] | 656 | Bool m_maxOneActiveRefLayerFlag; |
---|
| 657 | Bool m_pocLsbNotPresentFlag[MAX_VPS_LAYER_IDX_PLUS1]; |
---|
| 658 | Bool m_crossLayerPictureTypeAlignFlag; |
---|
| 659 | Bool m_crossLayerIrapAlignFlag; |
---|
| 660 | Bool m_crossLayerAlignedIdrOnlyFlag; |
---|
[1497] | 661 | UChar m_maxTidIlRefPicsPlus1[MAX_VPS_LAYER_IDX_PLUS1 - 1][MAX_VPS_LAYER_IDX_PLUS1]; |
---|
[1235] | 662 | Bool m_maxTidRefPresentFlag; |
---|
| 663 | Bool m_maxTSLayersPresentFlag; |
---|
[1497] | 664 | UChar m_maxTSLayerMinus1[MAX_LAYERS]; |
---|
[1235] | 665 | Bool m_singleLayerForNonIrapFlag; |
---|
| 666 | Bool m_higherLayerIrapSkipFlag; |
---|
| 667 | Bool m_tilesNotInUseFlag; |
---|
| 668 | Bool m_tilesInUseFlag[MAX_VPS_LAYER_IDX_PLUS1]; |
---|
| 669 | Bool m_loopFilterNotAcrossTilesFlag[MAX_VPS_LAYER_IDX_PLUS1]; |
---|
| 670 | Bool m_tileBoundariesAlignedFlag[MAX_VPS_LAYER_IDX_PLUS1][MAX_VPS_LAYER_IDX_PLUS1]; |
---|
| 671 | Bool m_wppNotInUseFlag; |
---|
| 672 | Bool m_wppInUseFlag[MAX_VPS_LAYER_IDX_PLUS1]; |
---|
[1168] | 673 | |
---|
[1235] | 674 | Bool m_ilpRestrictedRefLayersFlag; |
---|
| 675 | Int m_minSpatialSegmentOffsetPlus1[MAX_VPS_LAYER_IDX_PLUS1][MAX_VPS_LAYER_IDX_PLUS1]; |
---|
| 676 | Bool m_ctuBasedOffsetEnabledFlag [MAX_VPS_LAYER_IDX_PLUS1][MAX_VPS_LAYER_IDX_PLUS1]; |
---|
| 677 | Int m_minHorizontalCtuOffsetPlus1 [MAX_VPS_LAYER_IDX_PLUS1][MAX_VPS_LAYER_IDX_PLUS1]; |
---|
[1167] | 678 | |
---|
[1235] | 679 | Bool m_vidSigPresentVpsFlag; |
---|
[1497] | 680 | UChar m_vpsVidSigInfo; |
---|
| 681 | UChar m_vpsVidSigIdx[MAX_VPS_LAYER_IDX_PLUS1]; |
---|
| 682 | UChar m_vpsVidFormat[16]; |
---|
[1235] | 683 | Bool m_vpsFullRangeFlag[16]; |
---|
[1497] | 684 | UChar m_vpsColorPrimaries[16]; |
---|
| 685 | UChar m_vpsTransChar[16]; |
---|
| 686 | UChar m_vpsMatCoeff[16]; |
---|
[815] | 687 | |
---|
[1235] | 688 | Bool m_bitRatePresentVpsFlag; |
---|
| 689 | Bool m_picRatePresentVpsFlag; |
---|
| 690 | Bool m_bitRatePresentFlag [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER]; |
---|
| 691 | Bool m_picRatePresentFlag [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER]; |
---|
| 692 | Int m_avgBitRate [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER]; |
---|
| 693 | Int m_maxBitRate [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER]; |
---|
| 694 | Int m_constPicRateIdc [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER]; |
---|
| 695 | Int m_avgPicRate [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER]; |
---|
[644] | 696 | |
---|
[1235] | 697 | Bool m_altOutputLayerFlag[MAX_VPS_LAYER_SETS_PLUS1 + 2*MAX_NUM_ADD_LAYER_SETS]; |
---|
[1124] | 698 | |
---|
[1235] | 699 | Bool m_repFormatIdxPresentFlag; |
---|
| 700 | Int m_vpsNumRepFormats; // coded as minus1 |
---|
| 701 | RepFormat m_vpsRepFormat[16]; |
---|
[1497] | 702 | UChar m_vpsRepFormatIdx[16]; |
---|
[1203] | 703 | |
---|
[1497] | 704 | UChar m_viewIdLen; |
---|
| 705 | UChar m_viewIdVal[MAX_LAYERS]; |
---|
[494] | 706 | |
---|
[1497] | 707 | UChar m_numberRefLayers[MAX_NUM_LAYER_IDS]; // number of direct and indirect reference layers of a coding layer |
---|
[1235] | 708 | Bool m_recursiveRefLayerFlag[MAX_NUM_LAYER_IDS][MAX_NUM_LAYER_IDS]; // flag to indicate if j-th layer is a direct or indirect reference layer of i-th layer |
---|
[1173] | 709 | |
---|
[1235] | 710 | Int m_numAddLayerSets; |
---|
[1497] | 711 | UChar m_highestLayerIdxPlus1[MAX_NUM_ADD_LAYER_SETS][MAX_NUM_LAYER_IDS]; |
---|
| 712 | UChar m_predictedLayerId[MAX_NUM_LAYER_IDS][MAX_NUM_LAYER_IDS]; |
---|
| 713 | UChar m_numPredictedLayers[MAX_NUM_LAYER_IDS]; |
---|
| 714 | UChar m_numIndependentLayers; |
---|
| 715 | UChar m_numLayersInTreePartition[MAX_LAYERS]; |
---|
| 716 | UChar m_treePartitionLayerIdList[MAX_LAYERS][MAX_LAYERS]; |
---|
[1172] | 717 | |
---|
[1235] | 718 | Bool m_subLayerFlagInfoPresentFlag [MAX_VPS_OP_LAYER_SETS_PLUS1]; |
---|
| 719 | Bool m_subLayerDpbInfoPresentFlag [MAX_VPS_OP_LAYER_SETS_PLUS1][MAX_LAYERS]; |
---|
| 720 | Int m_maxVpsDecPicBufferingMinus1 [MAX_VPS_OP_LAYER_SETS_PLUS1][MAX_LAYERS][MAX_TLAYER]; |
---|
| 721 | Int m_maxVpsNumReorderPics [MAX_VPS_OP_LAYER_SETS_PLUS1][MAX_LAYERS]; |
---|
| 722 | Int m_maxVpsLatencyIncreasePlus1 [MAX_VPS_OP_LAYER_SETS_PLUS1][MAX_LAYERS]; |
---|
| 723 | Int m_numSubDpbs [MAX_VPS_LAYER_SETS_PLUS1 + 2*MAX_NUM_ADD_LAYER_SETS]; |
---|
[547] | 724 | |
---|
[1235] | 725 | Bool m_vpsVuiPresentFlag; |
---|
| 726 | Bool m_vpsExtensionFlag; |
---|
[547] | 727 | |
---|
[644] | 728 | #if O0164_MULTI_LAYER_HRD |
---|
[1235] | 729 | Bool m_vpsVuiBspHrdPresentFlag; |
---|
| 730 | Int m_vpsNumAddHrdParams; |
---|
| 731 | std::vector<Bool> m_cprmsAddPresentFlag; |
---|
[1497] | 732 | std::vector<UChar> m_numSubLayerHrdMinus1; |
---|
[1235] | 733 | std::vector<TComHRD> m_bspHrd; |
---|
[1497] | 734 | UChar m_numSignalledPartitioningSchemes[MAX_VPS_OUTPUT_LAYER_SETS_PLUS1]; |
---|
| 735 | UChar m_numPartitionsInSchemeMinus1 [MAX_VPS_OUTPUT_LAYER_SETS_PLUS1][16]; |
---|
| 736 | Bool m_layerIncludedInPartitionFlag [MAX_VPS_OUTPUT_LAYER_SETS_PLUS1][16][MAX_LAYERS][MAX_LAYERS]; |
---|
| 737 | UChar m_numBspSchedulesMinus1 [MAX_VPS_OUTPUT_LAYER_SETS_PLUS1][16][MAX_TLAYER]; |
---|
| 738 | UShort m_bspHrdIdx [MAX_VPS_OUTPUT_LAYER_SETS_PLUS1][16][MAX_TLAYER][31][MAX_LAYERS]; |
---|
| 739 | UChar m_bspSchedIdx [MAX_VPS_OUTPUT_LAYER_SETS_PLUS1][16][MAX_TLAYER][31][MAX_LAYERS]; |
---|
[644] | 740 | #endif |
---|
[1497] | 741 | Bool m_baseLayerPSCompatibilityFlag[MAX_LAYERS]; |
---|
[1235] | 742 | Int m_vpsNonVuiExtLength; |
---|
| 743 | Bool m_vpsPocLsbAlignedFlag; |
---|
[865] | 744 | std::vector< std::vector<Bool> > m_necessaryLayerFlag; |
---|
[1497] | 745 | std::vector<UChar> m_numNecessaryLayers; |
---|
[588] | 746 | #endif //SVC_EXTENSION |
---|
[1126] | 747 | |
---|
[313] | 748 | public: |
---|
[1235] | 749 | TComVPS(); |
---|
[313] | 750 | |
---|
[1235] | 751 | virtual ~TComVPS(); |
---|
| 752 | |
---|
| 753 | Void createHrdParamBuffer() |
---|
[313] | 754 | { |
---|
[1235] | 755 | m_hrdParameters.resize(getNumHrdParameters()); |
---|
| 756 | m_hrdOpSetIdx.resize(getNumHrdParameters()); |
---|
| 757 | m_cprmsPresentFlag.resize(getNumHrdParameters()); |
---|
[313] | 758 | } |
---|
| 759 | |
---|
[1235] | 760 | TComHRD* getHrdParameters( UInt i ) { return &m_hrdParameters[ i ]; } |
---|
| 761 | const TComHRD* getHrdParameters( UInt i ) const { return &m_hrdParameters[ i ]; } |
---|
| 762 | UInt getHrdOpSetIdx( UInt i ) const { return m_hrdOpSetIdx[ i ]; } |
---|
| 763 | Void setHrdOpSetIdx( UInt val, UInt i ) { m_hrdOpSetIdx[ i ] = val; } |
---|
| 764 | Bool getCprmsPresentFlag( UInt i ) const { return m_cprmsPresentFlag[ i ]; } |
---|
| 765 | Void setCprmsPresentFlag( Bool val, UInt i ) { m_cprmsPresentFlag[ i ] = val; } |
---|
[313] | 766 | |
---|
[1235] | 767 | Int getVPSId() const { return m_VPSId; } |
---|
| 768 | Void setVPSId(Int i) { m_VPSId = i; } |
---|
[313] | 769 | |
---|
[1235] | 770 | UInt getMaxTLayers() const { return m_uiMaxTLayers; } |
---|
| 771 | Void setMaxTLayers(UInt t) { m_uiMaxTLayers = t; } |
---|
[1029] | 772 | |
---|
[1235] | 773 | UInt getMaxLayers() const { return m_uiMaxLayers; } |
---|
| 774 | Void setMaxLayers(UInt l) { m_uiMaxLayers = l; } |
---|
[313] | 775 | |
---|
[1235] | 776 | Bool getTemporalNestingFlag() const { return m_bTemporalIdNestingFlag; } |
---|
| 777 | Void setTemporalNestingFlag(Bool t) { m_bTemporalIdNestingFlag = t; } |
---|
[1029] | 778 | |
---|
[1235] | 779 | Void setNumReorderPics(UInt v, UInt tLayer) { m_numReorderPics[tLayer] = v; } |
---|
| 780 | UInt getNumReorderPics(UInt tLayer) const { return m_numReorderPics[tLayer]; } |
---|
[1029] | 781 | |
---|
[1235] | 782 | Void setMaxDecPicBuffering(UInt v, UInt tLayer) { assert(tLayer < MAX_TLAYER); m_uiMaxDecPicBuffering[tLayer] = v; } |
---|
| 783 | UInt getMaxDecPicBuffering(UInt tLayer) const { return m_uiMaxDecPicBuffering[tLayer]; } |
---|
[1029] | 784 | |
---|
[1235] | 785 | Void setMaxLatencyIncrease(UInt v, UInt tLayer) { m_uiMaxLatencyIncrease[tLayer] = v; } |
---|
| 786 | UInt getMaxLatencyIncrease(UInt tLayer) const { return m_uiMaxLatencyIncrease[tLayer]; } |
---|
[313] | 787 | |
---|
[1235] | 788 | UInt getNumHrdParameters() const { return m_numHrdParameters; } |
---|
| 789 | Void setNumHrdParameters(UInt v) { m_numHrdParameters = v; } |
---|
[1442] | 790 | |
---|
[494] | 791 | #if !SVC_EXTENSION |
---|
[1235] | 792 | UInt getMaxNuhReservedZeroLayerId() const { return m_maxNuhReservedZeroLayerId; } |
---|
| 793 | Void setMaxNuhReservedZeroLayerId(UInt v) { m_maxNuhReservedZeroLayerId = v; } |
---|
[313] | 794 | |
---|
[1235] | 795 | UInt getMaxOpSets() const { return m_numOpSets; } |
---|
| 796 | Void setMaxOpSets(UInt v) { m_numOpSets = v; } |
---|
[313] | 797 | #endif |
---|
[1235] | 798 | Bool getLayerIdIncludedFlag(UInt opsIdx, UInt id) const { return m_layerIdIncludedFlag[opsIdx][id]; } |
---|
| 799 | Void setLayerIdIncludedFlag(Bool v, UInt opsIdx, UInt id) { m_layerIdIncludedFlag[opsIdx][id] = v; } |
---|
[494] | 800 | |
---|
[1182] | 801 | #if !SVC_EXTENSION |
---|
[1235] | 802 | TComPTL* getPTL() { return &m_pcPTL; } |
---|
| 803 | const TComPTL* getPTL() const { return &m_pcPTL; } |
---|
[941] | 804 | #endif |
---|
[942] | 805 | |
---|
[1235] | 806 | TimingInfo* getTimingInfo() { return &m_timingInfo; } |
---|
| 807 | const TimingInfo* getTimingInfo() const { return &m_timingInfo; } |
---|
[494] | 808 | |
---|
| 809 | #if SVC_EXTENSION |
---|
[1235] | 810 | Void setBaseLayerInternalFlag(Bool x) { m_baseLayerInternalFlag = x; } |
---|
| 811 | Bool getBaseLayerInternalFlag() const { return m_baseLayerInternalFlag; } |
---|
| 812 | Void setBaseLayerAvailableFlag(Bool x) { m_baseLayerAvailableFlag = x; } |
---|
| 813 | Bool getBaseLayerAvailableFlag() const { return m_baseLayerAvailableFlag; } |
---|
[1180] | 814 | |
---|
| 815 | #if O0164_MULTI_LAYER_HRD |
---|
[1235] | 816 | Void createBspHrdParamBuffer(UInt numHrds) |
---|
[1180] | 817 | { |
---|
| 818 | m_bspHrd.resize( numHrds ); |
---|
| 819 | m_cprmsAddPresentFlag.resize( numHrds ); |
---|
| 820 | m_numSubLayerHrdMinus1.resize( numHrds ); |
---|
| 821 | } |
---|
| 822 | #endif |
---|
[1186] | 823 | |
---|
[1235] | 824 | Int getBspHrdParamBufferCpbCntMinus1(UInt i, UInt sl) { return m_bspHrd[i].getCpbCntMinus1(sl); } |
---|
[1186] | 825 | |
---|
[1235] | 826 | TComPTL* getPTL() { return &m_pcPTLList[0]; } |
---|
| 827 | const TComPTL* getPTL() const { return &m_pcPTLList[0]; } |
---|
| 828 | TComPTL* getPTL(UInt idx) { return &m_pcPTLList[idx]; } |
---|
| 829 | const TComPTL* getPTL(UInt idx) const { return &m_pcPTLList[idx]; } |
---|
[1182] | 830 | |
---|
[1235] | 831 | Int getLayerSetLayerIdList(Int set, Int layerId) const { return m_layerSetLayerIdList[set][layerId]; } |
---|
| 832 | Void setLayerSetLayerIdList(Int set, Int layerId, Int x) { m_layerSetLayerIdList[set][layerId] = x; } |
---|
[313] | 833 | |
---|
[1235] | 834 | Int getNumLayersInIdList(Int set) const { return m_numLayerInIdList[set]; } |
---|
| 835 | Void setNumLayersInIdList(Int set, Int x) { m_numLayerInIdList[set] = x; } |
---|
[313] | 836 | |
---|
[1235] | 837 | Void deriveLayerIdListVariables(); |
---|
| 838 | Void deriveNumberOfSubDpbs(); |
---|
[442] | 839 | |
---|
[1235] | 840 | Void setRefLayersFlags(Int currLayerId); |
---|
| 841 | Bool getRecursiveRefLayerFlag(Int currLayerId, Int refLayerId) const { return m_recursiveRefLayerFlag[currLayerId][refLayerId];} |
---|
| 842 | Void setRecursiveRefLayerFlag(Int currLayerId, Int refLayerId, Bool x) { m_recursiveRefLayerFlag[currLayerId][refLayerId] = x; } |
---|
[1497] | 843 | UChar getNumRefLayers(Int currLayerId) const { return m_numberRefLayers[currLayerId]; } |
---|
[1235] | 844 | Void setNumRefLayers(); |
---|
[1172] | 845 | |
---|
[1235] | 846 | Void deriveLayerIdListVariablesForAddLayerSets(); |
---|
| 847 | UInt getVpsNumLayerSetsMinus1() const { return m_vpsNumLayerSetsMinus1; } |
---|
| 848 | Void setVpsNumLayerSetsMinus1(UInt x) { m_vpsNumLayerSetsMinus1 = x; } |
---|
| 849 | UInt getNumAddLayerSets() const { return m_numAddLayerSets; } |
---|
| 850 | Void setNumAddLayerSets(UInt x) { m_numAddLayerSets = x; } |
---|
[1497] | 851 | UChar getHighestLayerIdxPlus1(UInt set, UInt idx) const { return m_highestLayerIdxPlus1[set][idx]; } |
---|
| 852 | Void setHighestLayerIdxPlus1(UInt set, UInt idx, UChar layerIdx) { m_highestLayerIdxPlus1[set][idx] = layerIdx; } |
---|
[1235] | 853 | Void setPredictedLayerIds(); |
---|
[1497] | 854 | UChar getPredictedLayerId(UInt layerId, UInt predIdx) const { return m_predictedLayerId[layerId][predIdx]; } |
---|
| 855 | Void setPredictedLayerId(UInt layerId, UInt predIdx, UChar x) { m_predictedLayerId[layerId][predIdx] = x; } |
---|
| 856 | UChar getNumPredictedLayers(UInt layerId) const { return m_numPredictedLayers[layerId]; } |
---|
| 857 | Void setNumPredictedLayers(UInt layerId, UChar x) { m_numPredictedLayers[layerId] = x; } |
---|
[1235] | 858 | Void setTreePartitionLayerIdList(); |
---|
[1497] | 859 | UChar getNumIndependentLayers() const { return m_numIndependentLayers; } |
---|
| 860 | Void setNumIndependentLayers(UChar x) { m_numIndependentLayers = x; } |
---|
| 861 | UChar getNumLayersInTreePartition(Int idx) const { return m_numLayersInTreePartition[idx]; } |
---|
| 862 | Void setNumLayersInTreePartition(Int idx, UChar x) { m_numLayersInTreePartition[idx] = x; } |
---|
| 863 | UChar getTreePartitionLayerId(Int idx, Int layerIdx) const { return m_treePartitionLayerIdList[idx][layerIdx]; } |
---|
| 864 | Void setTreePartitionLayerId(Int idx, Int layerIdx, UChar layerId) { m_treePartitionLayerIdList[idx][layerIdx] = layerId; } |
---|
[1172] | 865 | |
---|
[1235] | 866 | UInt getMaxLayerId() const { return m_maxLayerId; } |
---|
| 867 | Void setMaxLayerId(UInt v) { m_maxLayerId = v; } |
---|
| 868 | UInt getNumLayerSets() const { return m_numLayerSets; } |
---|
| 869 | Void setNumLayerSets(UInt v) { m_numLayerSets = v; } |
---|
[1161] | 870 | |
---|
[1235] | 871 | Bool getNonHEVCBaseLayerFlag() const { return m_nonHEVCBaseLayerFlag; } |
---|
| 872 | Void setNonHEVCBaseLayerFlag(Bool x) { m_nonHEVCBaseLayerFlag = x; } |
---|
[313] | 873 | |
---|
[1235] | 874 | Bool getSplittingFlag() const { return m_splittingFlag; } |
---|
| 875 | Void setSplittingFlag(Bool x) { m_splittingFlag = x; } |
---|
[313] | 876 | |
---|
[1235] | 877 | Bool getScalabilityMask(Int id) const { return m_scalabilityMask[id]; } |
---|
| 878 | Void setScalabilityMask(Int id, Bool x) { m_scalabilityMask[id] = x; } |
---|
[313] | 879 | |
---|
[1497] | 880 | UChar getDimensionIdLen(Int id) const { return m_dimensionIdLen[id]; } |
---|
| 881 | Void setDimensionIdLen(Int id, UChar x) { m_dimensionIdLen[id] = x; } |
---|
[313] | 882 | |
---|
[1235] | 883 | Bool getNuhLayerIdPresentFlag() const { return m_nuhLayerIdPresentFlag; } |
---|
| 884 | Void setNuhLayerIdPresentFlag(Bool x) { m_nuhLayerIdPresentFlag = x; } |
---|
[313] | 885 | |
---|
[1497] | 886 | UChar getLayerIdInNuh(Int layerIdx) const { return m_layerIdInNuh[layerIdx]; } |
---|
| 887 | Void setLayerIdInNuh(Int layerIdx, UChar layerId) { m_layerIdInNuh[layerIdx] = layerId; } |
---|
[313] | 888 | |
---|
[1497] | 889 | UChar getDimensionId(Int layerIdx, Int id) const { return m_dimensionId[layerIdx][id]; } |
---|
| 890 | Void setDimensionId(Int layerIdx, Int id, UChar x) { m_dimensionId[layerIdx][id] = x; } |
---|
[313] | 891 | |
---|
[1497] | 892 | UChar getNumScalabilityTypes() const { return m_numScalabilityTypes; } |
---|
| 893 | Void setNumScalabilityTypes(UChar x) { m_numScalabilityTypes = x; } |
---|
[313] | 894 | |
---|
[1497] | 895 | UChar getLayerIdxInVps(Int layerId) const { return m_layerIdxInVps[layerId]; } |
---|
| 896 | Void setLayerIdxInVps(Int layerId, UChar layerIdx) { m_layerIdxInVps[layerId] = layerIdx; } |
---|
[1161] | 897 | |
---|
[1497] | 898 | UChar getMaxSLayersInLayerSetMinus1(Int ls) const { return m_maxSLInLayerSetMinus1[ls]; } |
---|
| 899 | Void setMaxSLayersInLayerSetMinus1(Int ls, UChar x) { m_maxSLInLayerSetMinus1[ls] = x; } |
---|
[1235] | 900 | Bool getIlpSshSignalingEnabledFlag() const { return m_ilpSshSignalingEnabledFlag; } |
---|
| 901 | Void setIlpSshSignalingEnabledFlag(Bool x) { m_ilpSshSignalingEnabledFlag = x; } |
---|
[1170] | 902 | |
---|
[1235] | 903 | Bool getProfilePresentFlag(Int id) const { return m_profilePresentFlag[id]; } |
---|
| 904 | Void setProfilePresentFlag(Int id, Bool x) { m_profilePresentFlag[id] = x; } |
---|
[313] | 905 | |
---|
| 906 | // Target output layer signalling related |
---|
[1235] | 907 | UInt getNumOutputLayerSets() const { return m_numOutputLayerSets; } |
---|
| 908 | Void setNumOutputLayerSets(Int x) { m_numOutputLayerSets = x; } |
---|
[313] | 909 | |
---|
[1235] | 910 | UInt getOutputLayerSetIdx(Int idx) const { return m_outputLayerSetIdx[idx]; } |
---|
| 911 | Void setOutputLayerSetIdx(Int idx, UInt x) { m_outputLayerSetIdx[idx] = x; } |
---|
[313] | 912 | |
---|
[1235] | 913 | Bool getOutputLayerFlag(Int layerSet, Int layerIdx) const { return m_outputLayerFlag[layerSet][layerIdx]; } |
---|
| 914 | Void setOutputLayerFlag(Int layerSet, Int layerIdx, Bool x) { m_outputLayerFlag[layerSet][layerIdx] = x; } |
---|
[1148] | 915 | |
---|
[313] | 916 | // Direct dependency of layers |
---|
[1235] | 917 | Bool getDirectDependencyFlag(Int currLayerIdx, Int refLayerIdx) const { return m_directDependencyFlag[currLayerIdx][refLayerIdx]; } |
---|
| 918 | Void setDirectDependencyFlag(Int currLayerIdx, Int refLayerIdx, Bool x) { m_directDependencyFlag[currLayerIdx][refLayerIdx] = x; } |
---|
[313] | 919 | |
---|
[1497] | 920 | UChar getNumDirectRefLayers(Int layerId) const { return m_numDirectRefLayers[layerId]; } |
---|
| 921 | Void setNumDirectRefLayers(Int layerId, UChar refLayerNum) { m_numDirectRefLayers[layerId] = refLayerNum; } |
---|
[313] | 922 | |
---|
[1497] | 923 | UChar getRefLayerId(Int layerId, Int refLayerIdc) const { return m_refLayerId[layerId][refLayerIdc]; } |
---|
| 924 | Void setRefLayerId(Int layerId, Int refLayerIdc, UChar refLayerId) { m_refLayerId[layerId][refLayerIdc] = refLayerId; } |
---|
[313] | 925 | |
---|
[1235] | 926 | UInt getDirectDepTypeLen() const { return m_directDepTypeLen; } |
---|
| 927 | Void setDirectDepTypeLen(UInt x) { m_directDepTypeLen = x; } |
---|
| 928 | Bool getDefaultDirectDependencyTypeFlag() const { return m_defaultDirectDependencyTypeFlag; } |
---|
| 929 | Void setDefaultDirectDependecyTypeFlag(Bool x) { m_defaultDirectDependencyTypeFlag = x; } |
---|
| 930 | UInt getDefaultDirectDependencyType() const { return m_defaultDirectDependencyType; } |
---|
| 931 | Void setDefaultDirectDependecyType(UInt x) { m_defaultDirectDependencyType = x; } |
---|
| 932 | UInt getDirectDependencyType(Int currLayerIdx, Int refLayerIdx) const { return m_directDependencyType[currLayerIdx][refLayerIdx]; } |
---|
| 933 | Void setDirectDependencyType(Int currLayerIdx, Int refLayerIdx, UInt x) { m_directDependencyType[currLayerIdx][refLayerIdx] = x; } |
---|
| 934 | Bool isSamplePredictionType(Int currLayerIdx, Int refLayerIdx) const { assert(currLayerIdx != refLayerIdx); return ( ( m_directDependencyType[currLayerIdx][refLayerIdx] + 1 ) & 1 ) ? true : false; } |
---|
| 935 | Bool isMotionPredictionType(Int currLayerIdx, Int refLayerIdx) const { assert(currLayerIdx != refLayerIdx); return ( ( ( m_directDependencyType[currLayerIdx][refLayerIdx] + 1 ) & 2 ) >> 1 ) ? true : false; } |
---|
[1148] | 936 | |
---|
[1235] | 937 | UInt getNumProfileTierLevel() const { return m_numProfileTierLevel; } |
---|
| 938 | Void setNumProfileTierLevel(Int x) { m_numProfileTierLevel = x; } |
---|
| 939 | Int getNumAddOutputLayerSets() const { return m_numAddOutputLayerSets; } |
---|
| 940 | Void setNumAddOutputLayerSets(Int x) { m_numAddOutputLayerSets = x; } |
---|
[313] | 941 | |
---|
[1235] | 942 | UInt getDefaultTargetOutputLayerIdc() const { return m_defaultTargetOutputLayerIdc; } |
---|
| 943 | Void setDefaultTargetOutputLayerIdc(UInt x) { m_defaultTargetOutputLayerIdc = x; } |
---|
[1153] | 944 | |
---|
[1235] | 945 | Bool getNecessaryLayerFlag(Int const i, Int const j) const { return m_necessaryLayerFlag[i][j]; } |
---|
| 946 | std::vector< std::vector<Int> >* getProfileLevelTierIdx() { return &m_profileLevelTierIdx; } |
---|
| 947 | std::vector<Int>* getProfileLevelTierIdx(Int const olsIdx) { return &m_profileLevelTierIdx[olsIdx]; } |
---|
| 948 | Int getProfileLevelTierIdx(const Int olsIdx, const Int layerIdx) const { return m_profileLevelTierIdx[olsIdx][layerIdx]; } |
---|
| 949 | Void setProfileLevelTierIdx(const Int olsIdx, const Int layerIdx, const Int ptlIdx) { m_profileLevelTierIdx[olsIdx][layerIdx] = ptlIdx; } |
---|
| 950 | Void addProfileLevelTierIdx(const Int olsIdx, const Int ptlIdx) { m_profileLevelTierIdx[olsIdx].push_back(ptlIdx); } |
---|
| 951 | Int calculateLenOfSyntaxElement( const Int numVal ) const; |
---|
[1153] | 952 | |
---|
[1235] | 953 | Bool getMaxOneActiveRefLayerFlag() const { return m_maxOneActiveRefLayerFlag; } |
---|
| 954 | Void setMaxOneActiveRefLayerFlag(Bool x) { m_maxOneActiveRefLayerFlag = x; } |
---|
| 955 | UInt getPocLsbNotPresentFlag(Int i) const { return m_pocLsbNotPresentFlag[i]; } |
---|
| 956 | Void setPocLsbNotPresentFlag(Int i, Bool x) { m_pocLsbNotPresentFlag[i] = x; } |
---|
| 957 | Bool getVpsPocLsbAlignedFlag() const { return m_vpsPocLsbAlignedFlag; } |
---|
| 958 | Void setVpsPocLsbAlignedFlag(Bool x) { m_vpsPocLsbAlignedFlag = x; } |
---|
| 959 | Bool getCrossLayerPictureTypeAlignFlag() const { return m_crossLayerPictureTypeAlignFlag; } |
---|
| 960 | Void setCrossLayerPictureTypeAlignFlag(Bool x) { m_crossLayerPictureTypeAlignFlag = x; } |
---|
| 961 | Bool getCrossLayerAlignedIdrOnlyFlag() const { return m_crossLayerAlignedIdrOnlyFlag; } |
---|
| 962 | Void setCrossLayerAlignedIdrOnlyFlag(Bool x) { m_crossLayerAlignedIdrOnlyFlag = x; } |
---|
| 963 | Bool getCrossLayerIrapAlignFlag() const { return m_crossLayerIrapAlignFlag; } |
---|
| 964 | Void setCrossLayerIrapAlignFlag(Bool x) { m_crossLayerIrapAlignFlag = x; } |
---|
[1497] | 965 | UChar getMaxTidIlRefPicsPlus1(Int refLayerIdx, Int layerIdx) const { return m_maxTidIlRefPicsPlus1[refLayerIdx][layerIdx]; } |
---|
| 966 | Void setMaxTidIlRefPicsPlus1(Int refLayerIdx, Int layerIdx, UChar maxSublayer) { m_maxTidIlRefPicsPlus1[refLayerIdx][layerIdx] = maxSublayer; } |
---|
[1235] | 967 | Bool getMaxTidRefPresentFlag() const { return m_maxTidRefPresentFlag; } |
---|
| 968 | Void setMaxTidRefPresentFlag(Bool x) { m_maxTidRefPresentFlag = x; } |
---|
| 969 | Bool getMaxTSLayersPresentFlag() const { return m_maxTSLayersPresentFlag; } |
---|
| 970 | Void setMaxTSLayersPresentFlag(Bool x) { m_maxTSLayersPresentFlag = x; } |
---|
[1497] | 971 | UChar getMaxTSLayersMinus1(Int layerIdx) const { return m_maxTSLayerMinus1[layerIdx]; } |
---|
| 972 | Void setMaxTSLayersMinus1(Int layerIdx, UChar maxTSublayer) { m_maxTSLayerMinus1[layerIdx] = maxTSublayer; } |
---|
[1235] | 973 | Bool getSingleLayerForNonIrapFlag() const { return m_singleLayerForNonIrapFlag; } |
---|
| 974 | Void setSingleLayerForNonIrapFlag(Bool x) { m_singleLayerForNonIrapFlag = x; } |
---|
| 975 | Bool getHigherLayerIrapSkipFlag() const { return m_higherLayerIrapSkipFlag; } |
---|
| 976 | Void setHigherLayerIrapSkipFlag(Bool x) { m_higherLayerIrapSkipFlag = x; } |
---|
[1176] | 977 | |
---|
[1235] | 978 | Bool getTilesNotInUseFlag() const { return m_tilesNotInUseFlag; } |
---|
| 979 | Void setTilesNotInUseFlag(Bool x); |
---|
| 980 | Bool getTilesInUseFlag(Int currLayerId) const { return m_tilesInUseFlag[currLayerId]; } |
---|
| 981 | Void setTilesInUseFlag(Int currLayerId, Bool x) { m_tilesInUseFlag[currLayerId] = x; } |
---|
| 982 | Bool getLoopFilterNotAcrossTilesFlag(Int currLayerId) const { return m_loopFilterNotAcrossTilesFlag[currLayerId];} |
---|
| 983 | Void setLoopFilterNotAcrossTilesFlag(Int currLayerId, Bool x) { m_loopFilterNotAcrossTilesFlag[currLayerId] = x; } |
---|
| 984 | Bool getTileBoundariesAlignedFlag(Int currLayerId, Int refLayerId) const { return m_tileBoundariesAlignedFlag[currLayerId][refLayerId]; } |
---|
| 985 | Void setTileBoundariesAlignedFlag(Int currLayerId, Int refLayerId, Bool x) { m_tileBoundariesAlignedFlag[currLayerId][refLayerId] = x; } |
---|
| 986 | Bool getWppNotInUseFlag() const { return m_wppNotInUseFlag; } |
---|
| 987 | Void setWppNotInUseFlag(Bool x); |
---|
| 988 | Bool getWppInUseFlag(Int currLayerId) const { return m_wppInUseFlag[currLayerId]; } |
---|
| 989 | Void setWppInUseFlag(Int currLayerId, Bool x) { m_wppInUseFlag[currLayerId] = x; } |
---|
[1168] | 990 | |
---|
[1235] | 991 | Bool getIlpRestrictedRefLayersFlag ( ) const { return m_ilpRestrictedRefLayersFlag;} |
---|
| 992 | Void setIlpRestrictedRefLayersFlag ( Int val ) { m_ilpRestrictedRefLayersFlag = val; } |
---|
| 993 | Int getMinSpatialSegmentOffsetPlus1( Int currLayerId, Int refLayerId ) const { return m_minSpatialSegmentOffsetPlus1[currLayerId][refLayerId];} |
---|
| 994 | Void setMinSpatialSegmentOffsetPlus1( Int currLayerId, Int refLayerId, Int val ) { m_minSpatialSegmentOffsetPlus1[currLayerId][refLayerId] = val; } |
---|
| 995 | Bool getCtuBasedOffsetEnabledFlag ( Int currLayerId, Int refLayerId ) const { return m_ctuBasedOffsetEnabledFlag[currLayerId][refLayerId];} |
---|
| 996 | Void setCtuBasedOffsetEnabledFlag ( Int currLayerId, Int refLayerId, Bool flag ) { m_ctuBasedOffsetEnabledFlag[currLayerId][refLayerId] = flag;} |
---|
| 997 | Int getMinHorizontalCtuOffsetPlus1 ( Int currLayerId, Int refLayerId ) const { return m_minHorizontalCtuOffsetPlus1[currLayerId][refLayerId];} |
---|
| 998 | Void setMinHorizontalCtuOffsetPlus1 ( Int currLayerId, Int refLayerId, Int val ) { m_minHorizontalCtuOffsetPlus1[currLayerId][refLayerId] = val; } |
---|
[1167] | 999 | |
---|
[1235] | 1000 | Bool getVideoSigPresentVpsFlag() const { return m_vidSigPresentVpsFlag; } |
---|
| 1001 | Void setVideoSigPresentVpsFlag(Bool x) { m_vidSigPresentVpsFlag = x; } |
---|
[1497] | 1002 | UChar getNumVideoSignalInfo() const { return m_vpsVidSigInfo; } |
---|
| 1003 | Void setNumVideoSignalInfo(UChar x) { m_vpsVidSigInfo = x; } |
---|
| 1004 | UChar getVideoSignalInfoIdx(Int idx) const { return m_vpsVidSigIdx[idx]; } |
---|
| 1005 | Void setVideoSignalInfoIdx(Int idx, UChar x) { m_vpsVidSigIdx[idx] = x; } |
---|
| 1006 | UChar getVideoVPSFormat(Int idx) const { return m_vpsVidFormat[idx]; } |
---|
| 1007 | Void setVideoVPSFormat(Int idx, UChar x) { m_vpsVidFormat[idx] = x; } |
---|
[1235] | 1008 | Bool getVideoFullRangeVpsFlag(Int idx) const { return m_vpsFullRangeFlag[idx]; } |
---|
| 1009 | Void setVideoFullRangeVpsFlag(Int idx, Bool x) { m_vpsFullRangeFlag[idx] = x; } |
---|
[1497] | 1010 | UChar getColorPrimaries(Int idx) const { return m_vpsColorPrimaries[idx]; } |
---|
| 1011 | Void setColorPrimaries(Int idx, UChar x) { m_vpsColorPrimaries[idx] = x; } |
---|
| 1012 | UChar getTransCharacter(Int idx) const { return m_vpsTransChar[idx]; } |
---|
| 1013 | Void setTransCharacter(Int idx, UChar x) { m_vpsTransChar[idx] = x; } |
---|
| 1014 | UChar getMaxtrixCoeff(Int idx) const { return m_vpsMatCoeff[idx]; } |
---|
| 1015 | Void setMaxtrixCoeff(Int idx, UChar x) { m_vpsMatCoeff[idx] = x; } |
---|
[1167] | 1016 | |
---|
[1235] | 1017 | Bool getBitRatePresentVpsFlag() const { return m_bitRatePresentVpsFlag; } |
---|
| 1018 | Void setBitRatePresentVpsFlag(Bool x) { m_bitRatePresentVpsFlag = x; } |
---|
| 1019 | Bool getPicRatePresentVpsFlag() const { return m_picRatePresentVpsFlag; } |
---|
| 1020 | Void setPicRatePresentVpsFlag(Bool x) { m_picRatePresentVpsFlag = x; } |
---|
[644] | 1021 | |
---|
[1235] | 1022 | Bool getBitRatePresentFlag(Int i, Int j) const { return m_bitRatePresentFlag[i][j]; } |
---|
| 1023 | Void setBitRatePresentFlag(Int i, Int j, Bool x) { m_bitRatePresentFlag[i][j] = x; } |
---|
| 1024 | Bool getPicRatePresentFlag(Int i, Int j) const { return m_picRatePresentFlag[i][j]; } |
---|
| 1025 | Void setPicRatePresentFlag(Int i, Int j, Bool x) { m_picRatePresentFlag[i][j] = x; } |
---|
[644] | 1026 | |
---|
[1235] | 1027 | Int getAvgBitRate(Int i, Int j) const { return m_avgBitRate[i][j]; } |
---|
| 1028 | Void setAvgBitRate(Int i, Int j, Int x) { m_avgBitRate[i][j] = x; } |
---|
| 1029 | Int getMaxBitRate(Int i, Int j) const { return m_maxBitRate[i][j]; } |
---|
| 1030 | Void setMaxBitRate(Int i, Int j, Int x) { m_maxBitRate[i][j] = x; } |
---|
[644] | 1031 | |
---|
[1235] | 1032 | Int getConstPicRateIdc(Int i, Int j) const { return m_constPicRateIdc[i][j]; } |
---|
| 1033 | Void setConstPicRateIdc(Int i, Int j, Int x) { m_constPicRateIdc[i][j] = x; } |
---|
| 1034 | Int getAvgPicRate(Int i, Int j) const { return m_avgPicRate[i][j]; } |
---|
| 1035 | Void setAvgPicRate(Int i, Int j, Int x) { m_avgPicRate[i][j] = x; } |
---|
[644] | 1036 | #if O0164_MULTI_LAYER_HRD |
---|
[1235] | 1037 | Bool getVpsVuiBspHrdPresentFlag() const { return m_vpsVuiBspHrdPresentFlag; } |
---|
| 1038 | Void setVpsVuiBspHrdPresentFlag(Bool x) { m_vpsVuiBspHrdPresentFlag = x; } |
---|
| 1039 | Int getVpsNumAddHrdParams() const { return m_vpsNumAddHrdParams; } |
---|
| 1040 | Void setVpsNumAddHrdParams(Int i) { m_vpsNumAddHrdParams = i; } |
---|
[894] | 1041 | |
---|
[1235] | 1042 | Bool getCprmsAddPresentFlag(Int i) const { return m_cprmsAddPresentFlag[i]; } |
---|
| 1043 | Void setCprmsAddPresentFlag(Int i, Bool val) { m_cprmsAddPresentFlag[i] = val; } |
---|
[894] | 1044 | |
---|
[1497] | 1045 | UChar getNumSubLayerHrdMinus1(Int i) const { return m_numSubLayerHrdMinus1[i]; } |
---|
| 1046 | Void setNumSubLayerHrdMinus1(Int i, UChar val) { m_numSubLayerHrdMinus1[i] = val; } |
---|
[894] | 1047 | |
---|
[1235] | 1048 | TComHRD* getBspHrd(Int i) { return &m_bspHrd[i]; } |
---|
| 1049 | const TComHRD* getBspHrd(Int i) const { return &m_bspHrd[i]; } |
---|
[894] | 1050 | |
---|
[1497] | 1051 | UChar getNumSignalledPartitioningSchemes(Int i) const { return m_numSignalledPartitioningSchemes[i]; } |
---|
| 1052 | Void setNumSignalledPartitioningSchemes(Int i, UChar val) { m_numSignalledPartitioningSchemes[i] = val; } |
---|
[894] | 1053 | |
---|
[1497] | 1054 | UChar getNumPartitionsInSchemeMinus1(Int i, Int j) const { return m_numPartitionsInSchemeMinus1[i][j]; } |
---|
| 1055 | Void setNumPartitionsInSchemeMinus1(Int i, Int j, UChar val) { m_numPartitionsInSchemeMinus1[i][j] = val; } |
---|
[894] | 1056 | |
---|
[1497] | 1057 | Bool getLayerIncludedInPartitionFlag(Int i, Int j, Int k, Int l) const { return m_layerIncludedInPartitionFlag[i][j][k][l];} |
---|
| 1058 | Void setLayerIncludedInPartitionFlag(Int i, Int j, Int k, Int l, Bool val) { m_layerIncludedInPartitionFlag[i][j][k][l] = val; } |
---|
[894] | 1059 | |
---|
[1497] | 1060 | UChar getNumBspSchedulesMinus1(Int i, Int j, Int k) const { return m_numBspSchedulesMinus1[i][j][k]; } |
---|
| 1061 | Void setNumBspSchedulesMinus1(Int i, Int j, Int k, UChar val) { m_numBspSchedulesMinus1[i][j][k] = val; } |
---|
[894] | 1062 | |
---|
[1497] | 1063 | UChar getBspSchedIdx(Int i, Int j, Int k, Int l, Int m) const { return m_bspSchedIdx[i][j][k][l][m]; } |
---|
| 1064 | Void setBspSchedIdx(Int i, Int j, Int k, Int l, Int m, UChar val) { m_bspSchedIdx[i][j][k][l][m] = val; } |
---|
[894] | 1065 | |
---|
[1497] | 1066 | UShort getBspHrdIdx(Int i, Int j, Int k, Int l, Int m) const { return m_bspHrdIdx[i][j][k][l][m]; } |
---|
| 1067 | Void setBspHrdIdx(Int i, Int j, Int k, Int l, Int m, UShort val) { m_bspHrdIdx[i][j][k][l][m] = val; } |
---|
[644] | 1068 | #endif |
---|
[1497] | 1069 | Void setBaseLayerPSCompatibilityFlag (Int layer, Bool val) { m_baseLayerPSCompatibilityFlag[layer] = val; } |
---|
| 1070 | Bool getBaseLayerPSCompatibilityFlag (Int layer) const { return m_baseLayerPSCompatibilityFlag[layer]; } |
---|
[1235] | 1071 | Bool getAltOuputLayerFlag(Int idx) const { return m_altOutputLayerFlag[idx]; } |
---|
| 1072 | Void setAltOuputLayerFlag(Int idx, Bool x) { m_altOutputLayerFlag[idx] = x; } |
---|
[442] | 1073 | |
---|
[1235] | 1074 | Bool getRepFormatIdxPresentFlag() const { return m_repFormatIdxPresentFlag; } |
---|
| 1075 | Void setRepFormatIdxPresentFlag(Bool x) { m_repFormatIdxPresentFlag = x; } |
---|
[442] | 1076 | |
---|
[1235] | 1077 | Int getVpsNumRepFormats() const { return m_vpsNumRepFormats; } |
---|
| 1078 | Void setVpsNumRepFormats(Int x) { m_vpsNumRepFormats = x; } |
---|
[442] | 1079 | |
---|
[1235] | 1080 | RepFormat* getVpsRepFormat(Int idx) { return &m_vpsRepFormat[idx]; } |
---|
| 1081 | const RepFormat* getVpsRepFormat(Int idx) const { return &m_vpsRepFormat[idx]; } |
---|
[442] | 1082 | |
---|
[1497] | 1083 | UChar getVpsRepFormatIdx(Int idx) const { return m_vpsRepFormatIdx[idx]; } |
---|
| 1084 | Void setVpsRepFormatIdx(Int idx, UChar x) { m_vpsRepFormatIdx[idx] = x; } |
---|
[1190] | 1085 | |
---|
[1497] | 1086 | Void setViewIdLen( UChar val ) { m_viewIdLen = val; } |
---|
| 1087 | UChar getViewIdLen() const { return m_viewIdLen; } |
---|
[442] | 1088 | |
---|
[1497] | 1089 | Void setViewIdVal( Int viewOrderIndex, UChar val ) { m_viewIdVal[viewOrderIndex] = val; } |
---|
| 1090 | UChar getViewIdVal( Int viewOrderIndex ) const { return m_viewIdVal[viewOrderIndex]; } |
---|
[1235] | 1091 | Int getScalabilityId(Int, ScalabilityType scalType ) const; |
---|
[442] | 1092 | |
---|
[1235] | 1093 | Int getViewIndex( Int layerIdInNuh ) const { return getScalabilityId( getLayerIdxInVps(layerIdInNuh), VIEW_ORDER_INDEX ); } |
---|
[442] | 1094 | |
---|
[1235] | 1095 | Int getNumViews() const; |
---|
| 1096 | Int scalTypeToScalIdx( ScalabilityType scalType ) const; |
---|
[1190] | 1097 | |
---|
[1235] | 1098 | Bool getSubLayerFlagInfoPresentFlag(Int olsIdx) const { return m_subLayerFlagInfoPresentFlag[olsIdx]; } |
---|
| 1099 | Void setSubLayerFlagInfoPresentFlag(Int olsIdx, Bool x) { m_subLayerFlagInfoPresentFlag[olsIdx] = x; } |
---|
[540] | 1100 | |
---|
[1235] | 1101 | Bool getSubLayerDpbInfoPresentFlag(Int olsIdx, Int subLayerIdx) const { return m_subLayerDpbInfoPresentFlag[olsIdx][subLayerIdx]; } |
---|
| 1102 | Void setSubLayerDpbInfoPresentFlag(Int olsIdx, Int subLayerIdx, Bool x) { m_subLayerDpbInfoPresentFlag[olsIdx][subLayerIdx] = x; } |
---|
[540] | 1103 | |
---|
| 1104 | // For the 0-th output layer set, use the date from the active SPS for base layer. |
---|
[1235] | 1105 | Int getMaxVpsDecPicBufferingMinus1(Int olsIdx, Int subDpbIdx, Int subLayerIdx) const { assert(olsIdx != 0); return m_maxVpsDecPicBufferingMinus1[olsIdx][subDpbIdx][subLayerIdx]; } |
---|
| 1106 | Void setMaxVpsDecPicBufferingMinus1(Int olsIdx, Int subDpbIdx, Int subLayerIdx, Int x) { m_maxVpsDecPicBufferingMinus1[olsIdx][subDpbIdx][subLayerIdx] = x; } |
---|
| 1107 | Int getLayerIdcForOls( Int olsIdx, Int layerId ) const; |
---|
[540] | 1108 | |
---|
[1235] | 1109 | Int getMaxVpsNumReorderPics(Int olsIdx, Int subLayerIdx) const { assert(olsIdx != 0); return m_maxVpsNumReorderPics[olsIdx][subLayerIdx]; } |
---|
| 1110 | Void setMaxVpsNumReorderPics(Int olsIdx, Int subLayerIdx, Int x) { m_maxVpsNumReorderPics[olsIdx][subLayerIdx] = x; } |
---|
[540] | 1111 | |
---|
[1235] | 1112 | Int getMaxVpsLatencyIncreasePlus1(Int olsIdx, Int subLayerIdx) const { assert(olsIdx != 0); return m_maxVpsLatencyIncreasePlus1[olsIdx][subLayerIdx]; } |
---|
| 1113 | Void setMaxVpsLatencyIncreasePlus1(Int olsIdx, Int subLayerIdx, Int x) { m_maxVpsLatencyIncreasePlus1[olsIdx][subLayerIdx] = x; } |
---|
[540] | 1114 | |
---|
[1235] | 1115 | Int getNumSubDpbs(Int olsIdx) const { return m_numSubDpbs[olsIdx]; } |
---|
| 1116 | Void setNumSubDpbs(Int olsIdx, Int x) { m_numSubDpbs[olsIdx] = x; } |
---|
| 1117 | Void determineSubDpbInfoFlags(); |
---|
[547] | 1118 | |
---|
[1235] | 1119 | Bool getVpsVuiPresentFlag() const { return m_vpsVuiPresentFlag; } |
---|
| 1120 | Void setVpsVuiPresentFlag(Bool x) { m_vpsVuiPresentFlag = x; } |
---|
| 1121 | Bool getVpsExtensionFlag() const { return m_vpsExtensionFlag; } |
---|
| 1122 | Void setVpsExtensionFlag(Bool x) { m_vpsExtensionFlag = x; } |
---|
| 1123 | Int getVpsNonVuiExtLength() const { return m_vpsNonVuiExtLength; } |
---|
| 1124 | Void setVpsNonVuiExtLength(Int x) { m_vpsNonVuiExtLength = x; } |
---|
[644] | 1125 | #if O0164_MULTI_LAYER_HRD |
---|
[1235] | 1126 | Void setBspHrdParameters( UInt hrdIdx, UInt frameRate, UInt numDU, UInt bitRate, Bool randomAccess ); |
---|
[644] | 1127 | #endif |
---|
[1235] | 1128 | Void deriveNecessaryLayerFlag(); |
---|
| 1129 | Void deriveNecessaryLayerFlag(Int const olsIdx); |
---|
| 1130 | Void checkNecessaryLayerFlagCondition(); |
---|
| 1131 | Void calculateMaxSLInLayerSets(); |
---|
[494] | 1132 | #endif //SVC_EXTENSION |
---|
[313] | 1133 | }; |
---|
| 1134 | |
---|
[1442] | 1135 | |
---|
[313] | 1136 | class TComVUI |
---|
| 1137 | { |
---|
| 1138 | private: |
---|
[1235] | 1139 | Bool m_aspectRatioInfoPresentFlag; |
---|
| 1140 | Int m_aspectRatioIdc; |
---|
| 1141 | Int m_sarWidth; |
---|
| 1142 | Int m_sarHeight; |
---|
| 1143 | Bool m_overscanInfoPresentFlag; |
---|
| 1144 | Bool m_overscanAppropriateFlag; |
---|
| 1145 | Bool m_videoSignalTypePresentFlag; |
---|
| 1146 | Int m_videoFormat; |
---|
| 1147 | Bool m_videoFullRangeFlag; |
---|
| 1148 | Bool m_colourDescriptionPresentFlag; |
---|
| 1149 | Int m_colourPrimaries; |
---|
| 1150 | Int m_transferCharacteristics; |
---|
| 1151 | Int m_matrixCoefficients; |
---|
| 1152 | Bool m_chromaLocInfoPresentFlag; |
---|
| 1153 | Int m_chromaSampleLocTypeTopField; |
---|
| 1154 | Int m_chromaSampleLocTypeBottomField; |
---|
| 1155 | Bool m_neutralChromaIndicationFlag; |
---|
| 1156 | Bool m_fieldSeqFlag; |
---|
| 1157 | Window m_defaultDisplayWindow; |
---|
| 1158 | Bool m_frameFieldInfoPresentFlag; |
---|
| 1159 | Bool m_hrdParametersPresentFlag; |
---|
| 1160 | Bool m_bitstreamRestrictionFlag; |
---|
| 1161 | Bool m_tilesFixedStructureFlag; |
---|
| 1162 | Bool m_motionVectorsOverPicBoundariesFlag; |
---|
| 1163 | Bool m_restrictedRefPicListsFlag; |
---|
| 1164 | Int m_minSpatialSegmentationIdc; |
---|
| 1165 | Int m_maxBytesPerPicDenom; |
---|
| 1166 | Int m_maxBitsPerMinCuDenom; |
---|
| 1167 | Int m_log2MaxMvLengthHorizontal; |
---|
| 1168 | Int m_log2MaxMvLengthVertical; |
---|
| 1169 | TComHRD m_hrdParameters; |
---|
[313] | 1170 | TimingInfo m_timingInfo; |
---|
| 1171 | |
---|
| 1172 | public: |
---|
| 1173 | TComVUI() |
---|
[1235] | 1174 | : m_aspectRatioInfoPresentFlag (false) //TODO: This initialiser list contains magic numbers |
---|
| 1175 | , m_aspectRatioIdc (0) |
---|
| 1176 | , m_sarWidth (0) |
---|
| 1177 | , m_sarHeight (0) |
---|
| 1178 | , m_overscanInfoPresentFlag (false) |
---|
| 1179 | , m_overscanAppropriateFlag (false) |
---|
| 1180 | , m_videoSignalTypePresentFlag (false) |
---|
| 1181 | , m_videoFormat (5) |
---|
| 1182 | , m_videoFullRangeFlag (false) |
---|
| 1183 | , m_colourDescriptionPresentFlag (false) |
---|
| 1184 | , m_colourPrimaries (2) |
---|
| 1185 | , m_transferCharacteristics (2) |
---|
| 1186 | , m_matrixCoefficients (2) |
---|
| 1187 | , m_chromaLocInfoPresentFlag (false) |
---|
| 1188 | , m_chromaSampleLocTypeTopField (0) |
---|
| 1189 | , m_chromaSampleLocTypeBottomField (0) |
---|
| 1190 | , m_neutralChromaIndicationFlag (false) |
---|
| 1191 | , m_fieldSeqFlag (false) |
---|
| 1192 | , m_frameFieldInfoPresentFlag (false) |
---|
| 1193 | , m_hrdParametersPresentFlag (false) |
---|
| 1194 | , m_bitstreamRestrictionFlag (false) |
---|
| 1195 | , m_tilesFixedStructureFlag (false) |
---|
| 1196 | , m_motionVectorsOverPicBoundariesFlag(true) |
---|
| 1197 | , m_restrictedRefPicListsFlag (1) |
---|
| 1198 | , m_minSpatialSegmentationIdc (0) |
---|
| 1199 | , m_maxBytesPerPicDenom (2) |
---|
| 1200 | , m_maxBitsPerMinCuDenom (1) |
---|
| 1201 | , m_log2MaxMvLengthHorizontal (15) |
---|
| 1202 | , m_log2MaxMvLengthVertical (15) |
---|
[1273] | 1203 | {} |
---|
[313] | 1204 | |
---|
[1235] | 1205 | virtual ~TComVUI() {} |
---|
[313] | 1206 | |
---|
[1235] | 1207 | Bool getAspectRatioInfoPresentFlag() const { return m_aspectRatioInfoPresentFlag; } |
---|
| 1208 | Void setAspectRatioInfoPresentFlag(Bool i) { m_aspectRatioInfoPresentFlag = i; } |
---|
[313] | 1209 | |
---|
[1235] | 1210 | Int getAspectRatioIdc() const { return m_aspectRatioIdc; } |
---|
| 1211 | Void setAspectRatioIdc(Int i) { m_aspectRatioIdc = i; } |
---|
[313] | 1212 | |
---|
[1235] | 1213 | Int getSarWidth() const { return m_sarWidth; } |
---|
| 1214 | Void setSarWidth(Int i) { m_sarWidth = i; } |
---|
[313] | 1215 | |
---|
[1235] | 1216 | Int getSarHeight() const { return m_sarHeight; } |
---|
| 1217 | Void setSarHeight(Int i) { m_sarHeight = i; } |
---|
[313] | 1218 | |
---|
[1235] | 1219 | Bool getOverscanInfoPresentFlag() const { return m_overscanInfoPresentFlag; } |
---|
| 1220 | Void setOverscanInfoPresentFlag(Bool i) { m_overscanInfoPresentFlag = i; } |
---|
[313] | 1221 | |
---|
[1235] | 1222 | Bool getOverscanAppropriateFlag() const { return m_overscanAppropriateFlag; } |
---|
| 1223 | Void setOverscanAppropriateFlag(Bool i) { m_overscanAppropriateFlag = i; } |
---|
[313] | 1224 | |
---|
[1235] | 1225 | Bool getVideoSignalTypePresentFlag() const { return m_videoSignalTypePresentFlag; } |
---|
| 1226 | Void setVideoSignalTypePresentFlag(Bool i) { m_videoSignalTypePresentFlag = i; } |
---|
[313] | 1227 | |
---|
[1235] | 1228 | Int getVideoFormat() const { return m_videoFormat; } |
---|
| 1229 | Void setVideoFormat(Int i) { m_videoFormat = i; } |
---|
[313] | 1230 | |
---|
[1235] | 1231 | Bool getVideoFullRangeFlag() const { return m_videoFullRangeFlag; } |
---|
| 1232 | Void setVideoFullRangeFlag(Bool i) { m_videoFullRangeFlag = i; } |
---|
[313] | 1233 | |
---|
[1235] | 1234 | Bool getColourDescriptionPresentFlag() const { return m_colourDescriptionPresentFlag; } |
---|
| 1235 | Void setColourDescriptionPresentFlag(Bool i) { m_colourDescriptionPresentFlag = i; } |
---|
[313] | 1236 | |
---|
[1235] | 1237 | Int getColourPrimaries() const { return m_colourPrimaries; } |
---|
| 1238 | Void setColourPrimaries(Int i) { m_colourPrimaries = i; } |
---|
[313] | 1239 | |
---|
[1235] | 1240 | Int getTransferCharacteristics() const { return m_transferCharacteristics; } |
---|
| 1241 | Void setTransferCharacteristics(Int i) { m_transferCharacteristics = i; } |
---|
[313] | 1242 | |
---|
[1235] | 1243 | Int getMatrixCoefficients() const { return m_matrixCoefficients; } |
---|
| 1244 | Void setMatrixCoefficients(Int i) { m_matrixCoefficients = i; } |
---|
[313] | 1245 | |
---|
[1235] | 1246 | Bool getChromaLocInfoPresentFlag() const { return m_chromaLocInfoPresentFlag; } |
---|
| 1247 | Void setChromaLocInfoPresentFlag(Bool i) { m_chromaLocInfoPresentFlag = i; } |
---|
[313] | 1248 | |
---|
[1235] | 1249 | Int getChromaSampleLocTypeTopField() const { return m_chromaSampleLocTypeTopField; } |
---|
| 1250 | Void setChromaSampleLocTypeTopField(Int i) { m_chromaSampleLocTypeTopField = i; } |
---|
[313] | 1251 | |
---|
[1235] | 1252 | Int getChromaSampleLocTypeBottomField() const { return m_chromaSampleLocTypeBottomField; } |
---|
| 1253 | Void setChromaSampleLocTypeBottomField(Int i) { m_chromaSampleLocTypeBottomField = i; } |
---|
[313] | 1254 | |
---|
[1235] | 1255 | Bool getNeutralChromaIndicationFlag() const { return m_neutralChromaIndicationFlag; } |
---|
| 1256 | Void setNeutralChromaIndicationFlag(Bool i) { m_neutralChromaIndicationFlag = i; } |
---|
[313] | 1257 | |
---|
[1235] | 1258 | Bool getFieldSeqFlag() const { return m_fieldSeqFlag; } |
---|
| 1259 | Void setFieldSeqFlag(Bool i) { m_fieldSeqFlag = i; } |
---|
[313] | 1260 | |
---|
[1235] | 1261 | Bool getFrameFieldInfoPresentFlag() const { return m_frameFieldInfoPresentFlag; } |
---|
| 1262 | Void setFrameFieldInfoPresentFlag(Bool i) { m_frameFieldInfoPresentFlag = i; } |
---|
[313] | 1263 | |
---|
[1235] | 1264 | Window& getDefaultDisplayWindow() { return m_defaultDisplayWindow; } |
---|
| 1265 | const Window& getDefaultDisplayWindow() const { return m_defaultDisplayWindow; } |
---|
| 1266 | Void setDefaultDisplayWindow(Window& defaultDisplayWindow ) { m_defaultDisplayWindow = defaultDisplayWindow; } |
---|
[313] | 1267 | |
---|
[1235] | 1268 | Bool getHrdParametersPresentFlag() const { return m_hrdParametersPresentFlag; } |
---|
| 1269 | Void setHrdParametersPresentFlag(Bool i) { m_hrdParametersPresentFlag = i; } |
---|
[313] | 1270 | |
---|
[1235] | 1271 | Bool getBitstreamRestrictionFlag() const { return m_bitstreamRestrictionFlag; } |
---|
| 1272 | Void setBitstreamRestrictionFlag(Bool i) { m_bitstreamRestrictionFlag = i; } |
---|
[313] | 1273 | |
---|
[1235] | 1274 | Bool getTilesFixedStructureFlag() const { return m_tilesFixedStructureFlag; } |
---|
| 1275 | Void setTilesFixedStructureFlag(Bool i) { m_tilesFixedStructureFlag = i; } |
---|
[313] | 1276 | |
---|
[1235] | 1277 | Bool getMotionVectorsOverPicBoundariesFlag() const { return m_motionVectorsOverPicBoundariesFlag; } |
---|
| 1278 | Void setMotionVectorsOverPicBoundariesFlag(Bool i) { m_motionVectorsOverPicBoundariesFlag = i; } |
---|
[313] | 1279 | |
---|
[1235] | 1280 | Bool getRestrictedRefPicListsFlag() const { return m_restrictedRefPicListsFlag; } |
---|
| 1281 | Void setRestrictedRefPicListsFlag(Bool b) { m_restrictedRefPicListsFlag = b; } |
---|
[313] | 1282 | |
---|
[1235] | 1283 | Int getMinSpatialSegmentationIdc() const { return m_minSpatialSegmentationIdc; } |
---|
| 1284 | Void setMinSpatialSegmentationIdc(Int i) { m_minSpatialSegmentationIdc = i; } |
---|
[1029] | 1285 | |
---|
[1235] | 1286 | Int getMaxBytesPerPicDenom() const { return m_maxBytesPerPicDenom; } |
---|
| 1287 | Void setMaxBytesPerPicDenom(Int i) { m_maxBytesPerPicDenom = i; } |
---|
[313] | 1288 | |
---|
[1235] | 1289 | Int getMaxBitsPerMinCuDenom() const { return m_maxBitsPerMinCuDenom; } |
---|
| 1290 | Void setMaxBitsPerMinCuDenom(Int i) { m_maxBitsPerMinCuDenom = i; } |
---|
[313] | 1291 | |
---|
[1235] | 1292 | Int getLog2MaxMvLengthHorizontal() const { return m_log2MaxMvLengthHorizontal; } |
---|
| 1293 | Void setLog2MaxMvLengthHorizontal(Int i) { m_log2MaxMvLengthHorizontal = i; } |
---|
[313] | 1294 | |
---|
[1235] | 1295 | Int getLog2MaxMvLengthVertical() const { return m_log2MaxMvLengthVertical; } |
---|
| 1296 | Void setLog2MaxMvLengthVertical(Int i) { m_log2MaxMvLengthVertical = i; } |
---|
[313] | 1297 | |
---|
[1235] | 1298 | TComHRD* getHrdParameters() { return &m_hrdParameters; } |
---|
| 1299 | const TComHRD* getHrdParameters() const { return &m_hrdParameters; } |
---|
[1029] | 1300 | |
---|
[1235] | 1301 | TimingInfo* getTimingInfo() { return &m_timingInfo; } |
---|
| 1302 | const TimingInfo* getTimingInfo() const { return &m_timingInfo; } |
---|
[313] | 1303 | }; |
---|
| 1304 | |
---|
[1316] | 1305 | /// SPS RExt class |
---|
| 1306 | class TComSPSRExt // Names aligned to text specification |
---|
| 1307 | { |
---|
| 1308 | private: |
---|
| 1309 | Bool m_transformSkipRotationEnabledFlag; |
---|
| 1310 | Bool m_transformSkipContextEnabledFlag; |
---|
| 1311 | Bool m_rdpcmEnabledFlag[NUMBER_OF_RDPCM_SIGNALLING_MODES]; |
---|
| 1312 | Bool m_extendedPrecisionProcessingFlag; |
---|
| 1313 | Bool m_intraSmoothingDisabledFlag; |
---|
| 1314 | Bool m_highPrecisionOffsetsEnabledFlag; |
---|
| 1315 | Bool m_persistentRiceAdaptationEnabledFlag; |
---|
| 1316 | Bool m_cabacBypassAlignmentEnabledFlag; |
---|
[1287] | 1317 | |
---|
[1316] | 1318 | public: |
---|
| 1319 | TComSPSRExt(); |
---|
| 1320 | |
---|
| 1321 | Bool settingsDifferFromDefaults() const |
---|
| 1322 | { |
---|
| 1323 | return getTransformSkipRotationEnabledFlag() |
---|
| 1324 | || getTransformSkipContextEnabledFlag() |
---|
| 1325 | || getRdpcmEnabledFlag(RDPCM_SIGNAL_IMPLICIT) |
---|
| 1326 | || getRdpcmEnabledFlag(RDPCM_SIGNAL_EXPLICIT) |
---|
| 1327 | || getExtendedPrecisionProcessingFlag() |
---|
| 1328 | || getIntraSmoothingDisabledFlag() |
---|
| 1329 | || getHighPrecisionOffsetsEnabledFlag() |
---|
| 1330 | || getPersistentRiceAdaptationEnabledFlag() |
---|
| 1331 | || getCabacBypassAlignmentEnabledFlag(); |
---|
| 1332 | } |
---|
| 1333 | |
---|
| 1334 | |
---|
| 1335 | Bool getTransformSkipRotationEnabledFlag() const { return m_transformSkipRotationEnabledFlag; } |
---|
| 1336 | Void setTransformSkipRotationEnabledFlag(const Bool value) { m_transformSkipRotationEnabledFlag = value; } |
---|
| 1337 | |
---|
| 1338 | Bool getTransformSkipContextEnabledFlag() const { return m_transformSkipContextEnabledFlag; } |
---|
| 1339 | Void setTransformSkipContextEnabledFlag(const Bool value) { m_transformSkipContextEnabledFlag = value; } |
---|
| 1340 | |
---|
| 1341 | Bool getRdpcmEnabledFlag(const RDPCMSignallingMode signallingMode) const { return m_rdpcmEnabledFlag[signallingMode]; } |
---|
| 1342 | Void setRdpcmEnabledFlag(const RDPCMSignallingMode signallingMode, const Bool value) { m_rdpcmEnabledFlag[signallingMode] = value; } |
---|
| 1343 | |
---|
| 1344 | Bool getExtendedPrecisionProcessingFlag() const { return m_extendedPrecisionProcessingFlag; } |
---|
| 1345 | Void setExtendedPrecisionProcessingFlag(Bool value) { m_extendedPrecisionProcessingFlag = value; } |
---|
| 1346 | |
---|
| 1347 | Bool getIntraSmoothingDisabledFlag() const { return m_intraSmoothingDisabledFlag; } |
---|
| 1348 | Void setIntraSmoothingDisabledFlag(Bool bValue) { m_intraSmoothingDisabledFlag=bValue; } |
---|
| 1349 | |
---|
| 1350 | Bool getHighPrecisionOffsetsEnabledFlag() const { return m_highPrecisionOffsetsEnabledFlag; } |
---|
| 1351 | Void setHighPrecisionOffsetsEnabledFlag(Bool value) { m_highPrecisionOffsetsEnabledFlag = value; } |
---|
| 1352 | |
---|
| 1353 | Bool getPersistentRiceAdaptationEnabledFlag() const { return m_persistentRiceAdaptationEnabledFlag; } |
---|
| 1354 | Void setPersistentRiceAdaptationEnabledFlag(const Bool value) { m_persistentRiceAdaptationEnabledFlag = value; } |
---|
| 1355 | |
---|
| 1356 | Bool getCabacBypassAlignmentEnabledFlag() const { return m_cabacBypassAlignmentEnabledFlag; } |
---|
| 1357 | Void setCabacBypassAlignmentEnabledFlag(const Bool value) { m_cabacBypassAlignmentEnabledFlag = value; } |
---|
| 1358 | }; |
---|
| 1359 | |
---|
[313] | 1360 | /// SPS class |
---|
| 1361 | class TComSPS |
---|
| 1362 | { |
---|
| 1363 | private: |
---|
[1235] | 1364 | Int m_SPSId; |
---|
| 1365 | Int m_VPSId; |
---|
| 1366 | ChromaFormat m_chromaFormatIdc; |
---|
[313] | 1367 | |
---|
[1235] | 1368 | UInt m_uiMaxTLayers; // maximum number of temporal layers |
---|
[313] | 1369 | |
---|
| 1370 | // Structure |
---|
[1235] | 1371 | UInt m_picWidthInLumaSamples; |
---|
| 1372 | UInt m_picHeightInLumaSamples; |
---|
[1029] | 1373 | |
---|
[1235] | 1374 | Int m_log2MinCodingBlockSize; |
---|
| 1375 | Int m_log2DiffMaxMinCodingBlockSize; |
---|
| 1376 | UInt m_uiMaxCUWidth; |
---|
| 1377 | UInt m_uiMaxCUHeight; |
---|
[1290] | 1378 | UInt m_uiMaxTotalCUDepth; ///< Total CU depth, relative to the smallest possible transform block size. |
---|
[313] | 1379 | |
---|
[1235] | 1380 | Window m_conformanceWindow; |
---|
[313] | 1381 | |
---|
[1235] | 1382 | TComRPSList m_RPSList; |
---|
| 1383 | Bool m_bLongTermRefsPresent; |
---|
| 1384 | Bool m_TMVPFlagsPresent; |
---|
| 1385 | Int m_numReorderPics[MAX_TLAYER]; |
---|
[1029] | 1386 | |
---|
[313] | 1387 | // Tool list |
---|
[1235] | 1388 | UInt m_uiQuadtreeTULog2MaxSize; |
---|
| 1389 | UInt m_uiQuadtreeTULog2MinSize; |
---|
| 1390 | UInt m_uiQuadtreeTUMaxDepthInter; |
---|
| 1391 | UInt m_uiQuadtreeTUMaxDepthIntra; |
---|
| 1392 | Bool m_usePCM; |
---|
| 1393 | UInt m_pcmLog2MaxSize; |
---|
| 1394 | UInt m_uiPCMLog2MinSize; |
---|
| 1395 | Bool m_useAMP; |
---|
[313] | 1396 | |
---|
| 1397 | // Parameter |
---|
[1287] | 1398 | BitDepths m_bitDepths; |
---|
[1235] | 1399 | Int m_qpBDOffset[MAX_NUM_CHANNEL_TYPE]; |
---|
[1287] | 1400 | Int m_pcmBitDepths[MAX_NUM_CHANNEL_TYPE]; |
---|
[1235] | 1401 | Bool m_bPCMFilterDisableFlag; |
---|
[313] | 1402 | |
---|
[1235] | 1403 | UInt m_uiBitsForPOC; |
---|
| 1404 | UInt m_numLongTermRefPicSPS; |
---|
| 1405 | UInt m_ltRefPicPocLsbSps[MAX_NUM_LONG_TERM_REF_PICS]; |
---|
| 1406 | Bool m_usedByCurrPicLtSPSFlag[MAX_NUM_LONG_TERM_REF_PICS]; |
---|
[313] | 1407 | // Max physical transform size |
---|
[1235] | 1408 | UInt m_uiMaxTrSize; |
---|
[1029] | 1409 | |
---|
[1235] | 1410 | Bool m_bUseSAO; |
---|
[313] | 1411 | |
---|
[1235] | 1412 | Bool m_bTemporalIdNestingFlag; // temporal_id_nesting_flag |
---|
[313] | 1413 | |
---|
[1235] | 1414 | Bool m_scalingListEnabledFlag; |
---|
| 1415 | Bool m_scalingListPresentFlag; |
---|
| 1416 | TComScalingList m_scalingList; |
---|
| 1417 | UInt m_uiMaxDecPicBuffering[MAX_TLAYER]; |
---|
[1464] | 1418 | UInt m_uiMaxLatencyIncreasePlus1[MAX_TLAYER]; |
---|
[313] | 1419 | |
---|
[1235] | 1420 | Bool m_useStrongIntraSmoothing; |
---|
[313] | 1421 | |
---|
[1235] | 1422 | Bool m_vuiParametersPresentFlag; |
---|
| 1423 | TComVUI m_vuiParameters; |
---|
[313] | 1424 | |
---|
[1316] | 1425 | TComSPSRExt m_spsRangeExtension; |
---|
| 1426 | |
---|
[1335] | 1427 | static const Int m_winUnitX[NUM_CHROMA_FORMAT]; |
---|
| 1428 | static const Int m_winUnitY[NUM_CHROMA_FORMAT]; |
---|
[1235] | 1429 | TComPTL m_pcPTL; |
---|
[313] | 1430 | |
---|
[1029] | 1431 | #if O0043_BEST_EFFORT_DECODING |
---|
[1235] | 1432 | UInt m_forceDecodeBitDepth; // 0 = do not force the decoder's bit depth, other = force the decoder's bit depth to this value (best effort decoding) |
---|
[1029] | 1433 | #endif |
---|
| 1434 | |
---|
[494] | 1435 | #if SVC_EXTENSION |
---|
[1235] | 1436 | UInt m_layerId; |
---|
| 1437 | Bool m_extensionFlag; |
---|
| 1438 | Bool m_bV1CompatibleSPSFlag; |
---|
| 1439 | Bool m_multiLayerExtSpsFlag; |
---|
| 1440 | Int m_NumDirectRefLayers; |
---|
| 1441 | Bool m_updateRepFormatFlag; |
---|
| 1442 | UInt m_updateRepFormatIndex; |
---|
| 1443 | Bool m_inferScalingListFlag; |
---|
| 1444 | UInt m_scalingListRefLayerId; |
---|
[1534] | 1445 | #if VIEW_SCALABILITY |
---|
| 1446 | Bool m_interViewMvVertConstraintFlag; |
---|
| 1447 | #endif |
---|
[494] | 1448 | #endif //SVC_EXTENSION |
---|
[849] | 1449 | |
---|
[313] | 1450 | public: |
---|
[1235] | 1451 | TComSPS(); |
---|
| 1452 | virtual ~TComSPS(); |
---|
[1029] | 1453 | #if O0043_BEST_EFFORT_DECODING |
---|
[1235] | 1454 | Void setForceDecodeBitDepth(UInt bitDepth) { m_forceDecodeBitDepth = bitDepth; } |
---|
| 1455 | UInt getForceDecodeBitDepth() const { return m_forceDecodeBitDepth; } |
---|
[1029] | 1456 | #endif |
---|
[313] | 1457 | |
---|
[1235] | 1458 | Int getVPSId() const { return m_VPSId; } |
---|
| 1459 | Void setVPSId(Int i) { m_VPSId = i; } |
---|
| 1460 | Int getSPSId() const { return m_SPSId; } |
---|
| 1461 | Void setSPSId(Int i) { m_SPSId = i; } |
---|
| 1462 | ChromaFormat getChromaFormatIdc () const { return m_chromaFormatIdc; } |
---|
| 1463 | Void setChromaFormatIdc (ChromaFormat i) { m_chromaFormatIdc = i; } |
---|
[494] | 1464 | |
---|
[1335] | 1465 | static Int getWinUnitX (Int chromaFormatIdc) { assert (chromaFormatIdc >= 0 && chromaFormatIdc < NUM_CHROMA_FORMAT); return m_winUnitX[chromaFormatIdc]; } |
---|
| 1466 | static Int getWinUnitY (Int chromaFormatIdc) { assert (chromaFormatIdc >= 0 && chromaFormatIdc < NUM_CHROMA_FORMAT); return m_winUnitY[chromaFormatIdc]; } |
---|
[313] | 1467 | |
---|
| 1468 | // structure |
---|
[1235] | 1469 | Void setPicWidthInLumaSamples( UInt u ) { m_picWidthInLumaSamples = u; } |
---|
| 1470 | UInt getPicWidthInLumaSamples() const { return m_picWidthInLumaSamples; } |
---|
| 1471 | Void setPicHeightInLumaSamples( UInt u ) { m_picHeightInLumaSamples = u; } |
---|
| 1472 | UInt getPicHeightInLumaSamples() const { return m_picHeightInLumaSamples; } |
---|
[313] | 1473 | |
---|
[1235] | 1474 | Window& getConformanceWindow() { return m_conformanceWindow; } |
---|
| 1475 | const Window& getConformanceWindow() const { return m_conformanceWindow; } |
---|
| 1476 | Void setConformanceWindow(Window& conformanceWindow ) { m_conformanceWindow = conformanceWindow; } |
---|
[313] | 1477 | |
---|
[1235] | 1478 | UInt getNumLongTermRefPicSPS() const { return m_numLongTermRefPicSPS; } |
---|
| 1479 | Void setNumLongTermRefPicSPS(UInt val) { m_numLongTermRefPicSPS = val; } |
---|
[313] | 1480 | |
---|
[1235] | 1481 | UInt getLtRefPicPocLsbSps(UInt index) const { assert( index < MAX_NUM_LONG_TERM_REF_PICS ); return m_ltRefPicPocLsbSps[index]; } |
---|
| 1482 | Void setLtRefPicPocLsbSps(UInt index, UInt val) { assert( index < MAX_NUM_LONG_TERM_REF_PICS ); m_ltRefPicPocLsbSps[index] = val; } |
---|
[313] | 1483 | |
---|
[1235] | 1484 | Bool getUsedByCurrPicLtSPSFlag(Int i) const { assert( i < MAX_NUM_LONG_TERM_REF_PICS ); return m_usedByCurrPicLtSPSFlag[i]; } |
---|
| 1485 | Void setUsedByCurrPicLtSPSFlag(Int i, Bool x) { assert( i < MAX_NUM_LONG_TERM_REF_PICS ); m_usedByCurrPicLtSPSFlag[i] = x; } |
---|
[313] | 1486 | |
---|
[1235] | 1487 | Int getLog2MinCodingBlockSize() const { return m_log2MinCodingBlockSize; } |
---|
| 1488 | Void setLog2MinCodingBlockSize(Int val) { m_log2MinCodingBlockSize = val; } |
---|
| 1489 | Int getLog2DiffMaxMinCodingBlockSize() const { return m_log2DiffMaxMinCodingBlockSize; } |
---|
| 1490 | Void setLog2DiffMaxMinCodingBlockSize(Int val) { m_log2DiffMaxMinCodingBlockSize = val; } |
---|
[313] | 1491 | |
---|
[1235] | 1492 | Void setMaxCUWidth( UInt u ) { m_uiMaxCUWidth = u; } |
---|
| 1493 | UInt getMaxCUWidth() const { return m_uiMaxCUWidth; } |
---|
| 1494 | Void setMaxCUHeight( UInt u ) { m_uiMaxCUHeight = u; } |
---|
| 1495 | UInt getMaxCUHeight() const { return m_uiMaxCUHeight; } |
---|
[1290] | 1496 | Void setMaxTotalCUDepth( UInt u ) { m_uiMaxTotalCUDepth = u; } |
---|
| 1497 | UInt getMaxTotalCUDepth() const { return m_uiMaxTotalCUDepth; } |
---|
[1235] | 1498 | Void setUsePCM( Bool b ) { m_usePCM = b; } |
---|
| 1499 | Bool getUsePCM() const { return m_usePCM; } |
---|
| 1500 | Void setPCMLog2MaxSize( UInt u ) { m_pcmLog2MaxSize = u; } |
---|
| 1501 | UInt getPCMLog2MaxSize() const { return m_pcmLog2MaxSize; } |
---|
| 1502 | Void setPCMLog2MinSize( UInt u ) { m_uiPCMLog2MinSize = u; } |
---|
| 1503 | UInt getPCMLog2MinSize() const { return m_uiPCMLog2MinSize; } |
---|
| 1504 | Void setBitsForPOC( UInt u ) { m_uiBitsForPOC = u; } |
---|
| 1505 | UInt getBitsForPOC() const { return m_uiBitsForPOC; } |
---|
| 1506 | Bool getUseAMP() const { return m_useAMP; } |
---|
| 1507 | Void setUseAMP( Bool b ) { m_useAMP = b; } |
---|
| 1508 | Void setQuadtreeTULog2MaxSize( UInt u ) { m_uiQuadtreeTULog2MaxSize = u; } |
---|
| 1509 | UInt getQuadtreeTULog2MaxSize() const { return m_uiQuadtreeTULog2MaxSize; } |
---|
| 1510 | Void setQuadtreeTULog2MinSize( UInt u ) { m_uiQuadtreeTULog2MinSize = u; } |
---|
| 1511 | UInt getQuadtreeTULog2MinSize() const { return m_uiQuadtreeTULog2MinSize; } |
---|
| 1512 | Void setQuadtreeTUMaxDepthInter( UInt u ) { m_uiQuadtreeTUMaxDepthInter = u; } |
---|
| 1513 | Void setQuadtreeTUMaxDepthIntra( UInt u ) { m_uiQuadtreeTUMaxDepthIntra = u; } |
---|
| 1514 | UInt getQuadtreeTUMaxDepthInter() const { return m_uiQuadtreeTUMaxDepthInter; } |
---|
| 1515 | UInt getQuadtreeTUMaxDepthIntra() const { return m_uiQuadtreeTUMaxDepthIntra; } |
---|
| 1516 | Void setNumReorderPics(Int i, UInt tlayer) { m_numReorderPics[tlayer] = i; } |
---|
| 1517 | Int getNumReorderPics(UInt tlayer) const { return m_numReorderPics[tlayer]; } |
---|
| 1518 | Void createRPSList( Int numRPS ); |
---|
| 1519 | const TComRPSList* getRPSList() const { return &m_RPSList; } |
---|
| 1520 | TComRPSList* getRPSList() { return &m_RPSList; } |
---|
| 1521 | Bool getLongTermRefsPresent() const { return m_bLongTermRefsPresent; } |
---|
| 1522 | Void setLongTermRefsPresent(Bool b) { m_bLongTermRefsPresent=b; } |
---|
| 1523 | Bool getTMVPFlagsPresent() const { return m_TMVPFlagsPresent; } |
---|
| 1524 | Void setTMVPFlagsPresent(Bool b) { m_TMVPFlagsPresent=b; } |
---|
[313] | 1525 | // physical transform |
---|
[1235] | 1526 | Void setMaxTrSize( UInt u ) { m_uiMaxTrSize = u; } |
---|
| 1527 | UInt getMaxTrSize() const { return m_uiMaxTrSize; } |
---|
[1029] | 1528 | |
---|
[313] | 1529 | // Bit-depth |
---|
[1287] | 1530 | Int getBitDepth(ChannelType type) const { return m_bitDepths.recon[type]; } |
---|
| 1531 | Void setBitDepth(ChannelType type, Int u ) { m_bitDepths.recon[type] = u; } |
---|
| 1532 | #if O0043_BEST_EFFORT_DECODING |
---|
| 1533 | Int getStreamBitDepth(ChannelType type) const { return m_bitDepths.stream[type]; } |
---|
| 1534 | Void setStreamBitDepth(ChannelType type, Int u ) { m_bitDepths.stream[type] = u; } |
---|
| 1535 | #endif |
---|
| 1536 | const BitDepths& getBitDepths() const { return m_bitDepths; } |
---|
[1316] | 1537 | Int getMaxLog2TrDynamicRange(ChannelType channelType) const { return getSpsRangeExtension().getExtendedPrecisionProcessingFlag() ? std::max<Int>(15, Int(m_bitDepths.recon[channelType] + 6)) : 15; } |
---|
[1285] | 1538 | |
---|
[1287] | 1539 | Int getDifferentialLumaChromaBitDepth() const { return Int(m_bitDepths.recon[CHANNEL_TYPE_LUMA]) - Int(m_bitDepths.recon[CHANNEL_TYPE_CHROMA]); } |
---|
[1235] | 1540 | Int getQpBDOffset(ChannelType type) const { return m_qpBDOffset[type]; } |
---|
| 1541 | Void setQpBDOffset(ChannelType type, Int i) { m_qpBDOffset[type] = i; } |
---|
[313] | 1542 | |
---|
[1235] | 1543 | Void setUseSAO(Bool bVal) { m_bUseSAO = bVal; } |
---|
| 1544 | Bool getUseSAO() const { return m_bUseSAO; } |
---|
[1029] | 1545 | |
---|
[1235] | 1546 | UInt getMaxTLayers() const { return m_uiMaxTLayers; } |
---|
| 1547 | Void setMaxTLayers( UInt uiMaxTLayers ) { assert( uiMaxTLayers <= MAX_TLAYER ); m_uiMaxTLayers = uiMaxTLayers; } |
---|
[313] | 1548 | |
---|
[1235] | 1549 | Bool getTemporalIdNestingFlag() const { return m_bTemporalIdNestingFlag; } |
---|
| 1550 | Void setTemporalIdNestingFlag( Bool bValue ) { m_bTemporalIdNestingFlag = bValue; } |
---|
[1287] | 1551 | UInt getPCMBitDepth(ChannelType type) const { return m_pcmBitDepths[type]; } |
---|
| 1552 | Void setPCMBitDepth(ChannelType type, UInt u) { m_pcmBitDepths[type] = u; } |
---|
[1235] | 1553 | Void setPCMFilterDisableFlag( Bool bValue ) { m_bPCMFilterDisableFlag = bValue; } |
---|
| 1554 | Bool getPCMFilterDisableFlag() const { return m_bPCMFilterDisableFlag; } |
---|
[313] | 1555 | |
---|
[1235] | 1556 | Bool getScalingListFlag() const { return m_scalingListEnabledFlag; } |
---|
| 1557 | Void setScalingListFlag( Bool b ) { m_scalingListEnabledFlag = b; } |
---|
| 1558 | Bool getScalingListPresentFlag() const { return m_scalingListPresentFlag; } |
---|
| 1559 | Void setScalingListPresentFlag( Bool b ) { m_scalingListPresentFlag = b; } |
---|
| 1560 | TComScalingList& getScalingList() { return m_scalingList; } |
---|
| 1561 | const TComScalingList& getScalingList() const { return m_scalingList; } |
---|
| 1562 | UInt getMaxDecPicBuffering(UInt tlayer) const { return m_uiMaxDecPicBuffering[tlayer]; } |
---|
| 1563 | Void setMaxDecPicBuffering( UInt ui, UInt tlayer ) { assert(tlayer < MAX_TLAYER); m_uiMaxDecPicBuffering[tlayer] = ui; } |
---|
[1464] | 1564 | UInt getMaxLatencyIncreasePlus1(UInt tlayer) const { return m_uiMaxLatencyIncreasePlus1[tlayer]; } |
---|
| 1565 | Void setMaxLatencyIncreasePlus1( UInt ui , UInt tlayer) { m_uiMaxLatencyIncreasePlus1[tlayer] = ui; } |
---|
[313] | 1566 | |
---|
[1235] | 1567 | Void setUseStrongIntraSmoothing(Bool bVal) { m_useStrongIntraSmoothing = bVal; } |
---|
| 1568 | Bool getUseStrongIntraSmoothing() const { return m_useStrongIntraSmoothing; } |
---|
[313] | 1569 | |
---|
[1235] | 1570 | Bool getVuiParametersPresentFlag() const { return m_vuiParametersPresentFlag; } |
---|
| 1571 | Void setVuiParametersPresentFlag(Bool b) { m_vuiParametersPresentFlag = b; } |
---|
| 1572 | TComVUI* getVuiParameters() { return &m_vuiParameters; } |
---|
| 1573 | const TComVUI* getVuiParameters() const { return &m_vuiParameters; } |
---|
| 1574 | const TComPTL* getPTL() const { return &m_pcPTL; } |
---|
| 1575 | TComPTL* getPTL() { return &m_pcPTL; } |
---|
[313] | 1576 | |
---|
[1316] | 1577 | const TComSPSRExt& getSpsRangeExtension() const { return m_spsRangeExtension; } |
---|
| 1578 | TComSPSRExt& getSpsRangeExtension() { return m_spsRangeExtension; } |
---|
| 1579 | |
---|
[313] | 1580 | #if SVC_EXTENSION |
---|
[1235] | 1581 | Void setLayerId(UInt layerId) { m_layerId = layerId; } |
---|
| 1582 | UInt getLayerId() const { return m_layerId; } |
---|
| 1583 | Int getExtensionFlag() const { return m_extensionFlag; } |
---|
| 1584 | Void setExtensionFlag(Int n) { m_extensionFlag = n; } |
---|
| 1585 | Bool getMultiLayerExtSpsFlag() const { return m_multiLayerExtSpsFlag; } |
---|
| 1586 | Void setMultiLayerExtSpsFlag(Bool flag) { m_multiLayerExtSpsFlag = flag; } |
---|
[1120] | 1587 | |
---|
| 1588 | //These two functions shall be used / called when the syntax element sps_ext_or_max_sub_layers_minus1 and V1CompatibleSPSFlag are implemented |
---|
[1235] | 1589 | Bool getV1CompatibleSPSFlag() const { return m_bV1CompatibleSPSFlag; } |
---|
| 1590 | Void setV1CompatibleSPSFlag(Bool x) { m_bV1CompatibleSPSFlag = x; } |
---|
[1120] | 1591 | |
---|
[1235] | 1592 | Int getNumDirectRefLayers() const { return m_NumDirectRefLayers; } |
---|
| 1593 | Void setNumDirectRefLayers(Int n) { m_NumDirectRefLayers = n; } |
---|
| 1594 | Bool getUpdateRepFormatFlag() const { return m_updateRepFormatFlag; } |
---|
| 1595 | Void setUpdateRepFormatFlag(Bool x) { m_updateRepFormatFlag = x; } |
---|
| 1596 | Int getUpdateRepFormatIndex() const { return m_updateRepFormatIndex; } |
---|
| 1597 | Void setUpdateRepFormatIndex(UInt index) { m_updateRepFormatIndex = index; } |
---|
| 1598 | Bool getInferScalingListFlag() const { return m_inferScalingListFlag; } |
---|
| 1599 | UInt getScalingListRefLayerId() const { return m_scalingListRefLayerId; } |
---|
| 1600 | Void setInferScalingListFlag( Bool flag ) { m_inferScalingListFlag = flag; } |
---|
| 1601 | Void setScalingListRefLayerId( UInt layerId ) { m_scalingListRefLayerId = layerId; } |
---|
[1502] | 1602 | |
---|
| 1603 | Void inferSPS( const UInt layerId, TComVPS* vps ); |
---|
[1534] | 1604 | |
---|
| 1605 | #if VIEW_SCALABILITY |
---|
| 1606 | Void setInterViewMvVertConstraintFlag( Bool val ) { m_interViewMvVertConstraintFlag = val; } |
---|
| 1607 | Bool getInterViewMvVertConstraintFlag() const { return m_interViewMvVertConstraintFlag; } |
---|
| 1608 | #endif |
---|
[494] | 1609 | #endif //SVC_EXTENSION |
---|
[313] | 1610 | }; |
---|
| 1611 | |
---|
[1273] | 1612 | |
---|
[313] | 1613 | /// Reference Picture Lists class |
---|
[1029] | 1614 | |
---|
[313] | 1615 | class TComRefPicListModification |
---|
| 1616 | { |
---|
| 1617 | private: |
---|
[1235] | 1618 | Bool m_refPicListModificationFlagL0; |
---|
| 1619 | Bool m_refPicListModificationFlagL1; |
---|
| 1620 | UInt m_RefPicSetIdxL0[REF_PIC_LIST_NUM_IDX]; |
---|
| 1621 | UInt m_RefPicSetIdxL1[REF_PIC_LIST_NUM_IDX]; |
---|
[1029] | 1622 | |
---|
[313] | 1623 | public: |
---|
[1235] | 1624 | TComRefPicListModification(); |
---|
[313] | 1625 | virtual ~TComRefPicListModification(); |
---|
[1029] | 1626 | |
---|
[1235] | 1627 | Bool getRefPicListModificationFlagL0() const { return m_refPicListModificationFlagL0; } |
---|
| 1628 | Void setRefPicListModificationFlagL0(Bool flag) { m_refPicListModificationFlagL0 = flag; } |
---|
| 1629 | Bool getRefPicListModificationFlagL1() const { return m_refPicListModificationFlagL1; } |
---|
| 1630 | Void setRefPicListModificationFlagL1(Bool flag) { m_refPicListModificationFlagL1 = flag; } |
---|
| 1631 | UInt getRefPicSetIdxL0(UInt idx) const { assert(idx<REF_PIC_LIST_NUM_IDX); return m_RefPicSetIdxL0[idx]; } |
---|
| 1632 | Void setRefPicSetIdxL0(UInt idx, UInt refPicSetIdx) { assert(idx<REF_PIC_LIST_NUM_IDX); m_RefPicSetIdxL0[idx] = refPicSetIdx; } |
---|
| 1633 | UInt getRefPicSetIdxL1(UInt idx) const { assert(idx<REF_PIC_LIST_NUM_IDX); return m_RefPicSetIdxL1[idx]; } |
---|
| 1634 | Void setRefPicSetIdxL1(UInt idx, UInt refPicSetIdx) { assert(idx<REF_PIC_LIST_NUM_IDX); m_RefPicSetIdxL1[idx] = refPicSetIdx; } |
---|
[313] | 1635 | }; |
---|
| 1636 | |
---|
[1316] | 1637 | |
---|
| 1638 | |
---|
| 1639 | /// PPS RExt class |
---|
| 1640 | class TComPPSRExt // Names aligned to text specification |
---|
| 1641 | { |
---|
| 1642 | private: |
---|
| 1643 | Int m_log2MaxTransformSkipBlockSize; |
---|
| 1644 | Bool m_crossComponentPredictionEnabledFlag; |
---|
| 1645 | |
---|
| 1646 | // Chroma QP Adjustments |
---|
| 1647 | Int m_diffCuChromaQpOffsetDepth; |
---|
| 1648 | Int m_chromaQpOffsetListLen; // size (excludes the null entry used in the following array). |
---|
| 1649 | ChromaQpAdj m_ChromaQpAdjTableIncludingNullEntry[1+MAX_QP_OFFSET_LIST_SIZE]; //!< Array includes entry [0] for the null offset used when cu_chroma_qp_offset_flag=0, and entries [cu_chroma_qp_offset_idx+1...] otherwise |
---|
| 1650 | |
---|
| 1651 | UInt m_log2SaoOffsetScale[MAX_NUM_CHANNEL_TYPE]; |
---|
| 1652 | |
---|
| 1653 | public: |
---|
| 1654 | TComPPSRExt(); |
---|
| 1655 | |
---|
| 1656 | Bool settingsDifferFromDefaults(const bool bTransformSkipEnabledFlag) const |
---|
| 1657 | { |
---|
| 1658 | return (bTransformSkipEnabledFlag && (getLog2MaxTransformSkipBlockSize() !=2)) |
---|
| 1659 | || (getCrossComponentPredictionEnabledFlag() ) |
---|
| 1660 | || (getChromaQpOffsetListEnabledFlag() ) |
---|
| 1661 | || (getLog2SaoOffsetScale(CHANNEL_TYPE_LUMA) !=0 ) |
---|
| 1662 | || (getLog2SaoOffsetScale(CHANNEL_TYPE_CHROMA) !=0 ); |
---|
| 1663 | } |
---|
| 1664 | |
---|
| 1665 | UInt getLog2MaxTransformSkipBlockSize() const { return m_log2MaxTransformSkipBlockSize; } |
---|
| 1666 | Void setLog2MaxTransformSkipBlockSize( UInt u ) { m_log2MaxTransformSkipBlockSize = u; } |
---|
| 1667 | |
---|
| 1668 | Bool getCrossComponentPredictionEnabledFlag() const { return m_crossComponentPredictionEnabledFlag; } |
---|
| 1669 | Void setCrossComponentPredictionEnabledFlag(Bool value) { m_crossComponentPredictionEnabledFlag = value; } |
---|
| 1670 | |
---|
| 1671 | Void clearChromaQpOffsetList() { m_chromaQpOffsetListLen = 0; } |
---|
| 1672 | |
---|
| 1673 | UInt getDiffCuChromaQpOffsetDepth () const { return m_diffCuChromaQpOffsetDepth; } |
---|
| 1674 | Void setDiffCuChromaQpOffsetDepth ( UInt u ) { m_diffCuChromaQpOffsetDepth = u; } |
---|
| 1675 | |
---|
| 1676 | Bool getChromaQpOffsetListEnabledFlag() const { return getChromaQpOffsetListLen()>0; } |
---|
| 1677 | Int getChromaQpOffsetListLen() const { return m_chromaQpOffsetListLen; } |
---|
| 1678 | |
---|
| 1679 | const ChromaQpAdj& getChromaQpOffsetListEntry( Int cuChromaQpOffsetIdxPlus1 ) const |
---|
| 1680 | { |
---|
| 1681 | assert(cuChromaQpOffsetIdxPlus1 < m_chromaQpOffsetListLen+1); |
---|
| 1682 | return m_ChromaQpAdjTableIncludingNullEntry[cuChromaQpOffsetIdxPlus1]; // Array includes entry [0] for the null offset used when cu_chroma_qp_offset_flag=0, and entries [cu_chroma_qp_offset_idx+1...] otherwise |
---|
| 1683 | } |
---|
| 1684 | |
---|
| 1685 | Void setChromaQpOffsetListEntry( Int cuChromaQpOffsetIdxPlus1, Int cbOffset, Int crOffset ) |
---|
| 1686 | { |
---|
| 1687 | assert (cuChromaQpOffsetIdxPlus1 != 0 && cuChromaQpOffsetIdxPlus1 <= MAX_QP_OFFSET_LIST_SIZE); |
---|
| 1688 | m_ChromaQpAdjTableIncludingNullEntry[cuChromaQpOffsetIdxPlus1].u.comp.CbOffset = cbOffset; // Array includes entry [0] for the null offset used when cu_chroma_qp_offset_flag=0, and entries [cu_chroma_qp_offset_idx+1...] otherwise |
---|
| 1689 | m_ChromaQpAdjTableIncludingNullEntry[cuChromaQpOffsetIdxPlus1].u.comp.CrOffset = crOffset; |
---|
| 1690 | m_chromaQpOffsetListLen = max(m_chromaQpOffsetListLen, cuChromaQpOffsetIdxPlus1); |
---|
| 1691 | } |
---|
| 1692 | |
---|
| 1693 | // Now: getPpsRangeExtension().getLog2SaoOffsetScale and getPpsRangeExtension().setLog2SaoOffsetScale |
---|
| 1694 | UInt getLog2SaoOffsetScale(ChannelType type) const { return m_log2SaoOffsetScale[type]; } |
---|
| 1695 | Void setLog2SaoOffsetScale(ChannelType type, UInt uiBitShift) { m_log2SaoOffsetScale[type] = uiBitShift; } |
---|
| 1696 | |
---|
| 1697 | }; |
---|
| 1698 | |
---|
| 1699 | |
---|
[313] | 1700 | /// PPS class |
---|
| 1701 | class TComPPS |
---|
| 1702 | { |
---|
| 1703 | private: |
---|
[1235] | 1704 | Int m_PPSId; // pic_parameter_set_id |
---|
| 1705 | Int m_SPSId; // seq_parameter_set_id |
---|
| 1706 | Int m_picInitQPMinus26; |
---|
| 1707 | Bool m_useDQP; |
---|
| 1708 | Bool m_bConstrainedIntraPred; // constrained_intra_pred_flag |
---|
| 1709 | Bool m_bSliceChromaQpFlag; // slicelevel_chroma_qp_flag |
---|
[313] | 1710 | |
---|
| 1711 | // access channel |
---|
[1235] | 1712 | UInt m_uiMaxCuDQPDepth; |
---|
[313] | 1713 | |
---|
[1235] | 1714 | Int m_chromaCbQpOffset; |
---|
| 1715 | Int m_chromaCrQpOffset; |
---|
[313] | 1716 | |
---|
[1235] | 1717 | UInt m_numRefIdxL0DefaultActive; |
---|
| 1718 | UInt m_numRefIdxL1DefaultActive; |
---|
[313] | 1719 | |
---|
[1235] | 1720 | Bool m_bUseWeightPred; //!< Use of Weighting Prediction (P_SLICE) |
---|
| 1721 | Bool m_useWeightedBiPred; //!< Use of Weighting Bi-Prediction (B_SLICE) |
---|
| 1722 | Bool m_OutputFlagPresentFlag; //!< Indicates the presence of output_flag in slice header |
---|
| 1723 | Bool m_TransquantBypassEnableFlag; //!< Indicates presence of cu_transquant_bypass_flag in CUs. |
---|
| 1724 | Bool m_useTransformSkip; |
---|
| 1725 | Bool m_dependentSliceSegmentsEnabledFlag; //!< Indicates the presence of dependent slices |
---|
| 1726 | Bool m_tilesEnabledFlag; //!< Indicates the presence of tiles |
---|
| 1727 | Bool m_entropyCodingSyncEnabledFlag; //!< Indicates the presence of wavefronts |
---|
[1029] | 1728 | |
---|
| 1729 | Bool m_loopFilterAcrossTilesEnabledFlag; |
---|
[823] | 1730 | Bool m_uniformSpacingFlag; |
---|
| 1731 | Int m_numTileColumnsMinus1; |
---|
| 1732 | Int m_numTileRowsMinus1; |
---|
| 1733 | std::vector<Int> m_tileColumnWidth; |
---|
| 1734 | std::vector<Int> m_tileRowHeight; |
---|
[313] | 1735 | |
---|
[1235] | 1736 | Bool m_signHideFlag; |
---|
[313] | 1737 | |
---|
[1235] | 1738 | Bool m_cabacInitPresentFlag; |
---|
[313] | 1739 | |
---|
[1235] | 1740 | Bool m_sliceHeaderExtensionPresentFlag; |
---|
| 1741 | Bool m_loopFilterAcrossSlicesEnabledFlag; |
---|
| 1742 | Bool m_deblockingFilterControlPresentFlag; |
---|
| 1743 | Bool m_deblockingFilterOverrideEnabledFlag; |
---|
| 1744 | Bool m_picDisableDeblockingFilterFlag; |
---|
| 1745 | Int m_deblockingFilterBetaOffsetDiv2; //< beta offset for deblocking filter |
---|
| 1746 | Int m_deblockingFilterTcOffsetDiv2; //< tc offset for deblocking filter |
---|
| 1747 | Bool m_scalingListPresentFlag; |
---|
| 1748 | TComScalingList m_scalingList; //!< ScalingList class |
---|
| 1749 | Bool m_listsModificationPresentFlag; |
---|
| 1750 | UInt m_log2ParallelMergeLevelMinus2; |
---|
| 1751 | Int m_numExtraSliceHeaderBits; |
---|
[313] | 1752 | |
---|
[1316] | 1753 | TComPPSRExt m_ppsRangeExtension; |
---|
| 1754 | |
---|
[442] | 1755 | #if SVC_EXTENSION |
---|
[1235] | 1756 | Bool m_extensionFlag; |
---|
| 1757 | UInt m_layerId; |
---|
| 1758 | Bool m_inferScalingListFlag; |
---|
| 1759 | UInt m_scalingListRefLayerId; |
---|
| 1760 | Bool m_pocResetInfoPresentFlag; |
---|
| 1761 | UInt m_numRefLayerLocationOffsets; |
---|
| 1762 | UInt m_refLocationOffsetLayerId[MAX_LAYERS]; |
---|
| 1763 | Window m_scaledRefLayerWindow[MAX_LAYERS]; |
---|
| 1764 | Window m_refLayerWindow[MAX_LAYERS]; |
---|
| 1765 | Bool m_scaledRefLayerOffsetPresentFlag[MAX_LAYERS]; |
---|
| 1766 | Bool m_refRegionOffsetPresentFlag[MAX_LAYERS]; |
---|
| 1767 | ResamplingPhase m_resamplingPhase[MAX_LAYERS]; |
---|
[1212] | 1768 | #if CGS_3D_ASYMLUT |
---|
[1235] | 1769 | Int m_nCGSFlag; |
---|
| 1770 | Int m_nCGSOutputBitDepthY; // not for syntax |
---|
| 1771 | Int m_nCGSOutputBitDepthC; // not for syntax |
---|
[644] | 1772 | #endif |
---|
[713] | 1773 | #endif |
---|
[442] | 1774 | |
---|
[313] | 1775 | public: |
---|
[1235] | 1776 | TComPPS(); |
---|
| 1777 | virtual ~TComPPS(); |
---|
[1029] | 1778 | |
---|
[1235] | 1779 | Int getPPSId() const { return m_PPSId; } |
---|
| 1780 | Void setPPSId(Int i) { m_PPSId = i; } |
---|
| 1781 | Int getSPSId() const { return m_SPSId; } |
---|
| 1782 | Void setSPSId(Int i) { m_SPSId = i; } |
---|
[1029] | 1783 | |
---|
[1235] | 1784 | Int getPicInitQPMinus26() const { return m_picInitQPMinus26; } |
---|
| 1785 | Void setPicInitQPMinus26( Int i ) { m_picInitQPMinus26 = i; } |
---|
| 1786 | Bool getUseDQP() const { return m_useDQP; } |
---|
| 1787 | Void setUseDQP( Bool b ) { m_useDQP = b; } |
---|
| 1788 | Bool getConstrainedIntraPred() const { return m_bConstrainedIntraPred; } |
---|
| 1789 | Void setConstrainedIntraPred( Bool b ) { m_bConstrainedIntraPred = b; } |
---|
| 1790 | Bool getSliceChromaQpFlag() const { return m_bSliceChromaQpFlag; } |
---|
| 1791 | Void setSliceChromaQpFlag( Bool b ) { m_bSliceChromaQpFlag = b; } |
---|
[313] | 1792 | |
---|
[1235] | 1793 | Void setMaxCuDQPDepth( UInt u ) { m_uiMaxCuDQPDepth = u; } |
---|
| 1794 | UInt getMaxCuDQPDepth() const { return m_uiMaxCuDQPDepth; } |
---|
[313] | 1795 | |
---|
[1235] | 1796 | Void setQpOffset(ComponentID compID, Int i ) |
---|
| 1797 | { |
---|
| 1798 | if (compID==COMPONENT_Cb) |
---|
| 1799 | { |
---|
| 1800 | m_chromaCbQpOffset = i; |
---|
| 1801 | } |
---|
| 1802 | else if (compID==COMPONENT_Cr) |
---|
| 1803 | { |
---|
| 1804 | m_chromaCrQpOffset = i; |
---|
| 1805 | } |
---|
| 1806 | else |
---|
| 1807 | { |
---|
| 1808 | assert(0); |
---|
| 1809 | } |
---|
| 1810 | } |
---|
| 1811 | Int getQpOffset(ComponentID compID) const |
---|
| 1812 | { |
---|
| 1813 | return (compID==COMPONENT_Y) ? 0 : (compID==COMPONENT_Cb ? m_chromaCbQpOffset : m_chromaCrQpOffset ); |
---|
| 1814 | } |
---|
[313] | 1815 | |
---|
[1235] | 1816 | Void setNumRefIdxL0DefaultActive(UInt ui) { m_numRefIdxL0DefaultActive=ui; } |
---|
| 1817 | UInt getNumRefIdxL0DefaultActive() const { return m_numRefIdxL0DefaultActive; } |
---|
| 1818 | Void setNumRefIdxL1DefaultActive(UInt ui) { m_numRefIdxL1DefaultActive=ui; } |
---|
| 1819 | UInt getNumRefIdxL1DefaultActive() const { return m_numRefIdxL1DefaultActive; } |
---|
[313] | 1820 | |
---|
[1235] | 1821 | Bool getUseWP() const { return m_bUseWeightPred; } |
---|
| 1822 | Bool getWPBiPred() const { return m_useWeightedBiPred; } |
---|
| 1823 | Void setUseWP( Bool b ) { m_bUseWeightPred = b; } |
---|
| 1824 | Void setWPBiPred( Bool b ) { m_useWeightedBiPred = b; } |
---|
[1029] | 1825 | |
---|
[1235] | 1826 | Void setOutputFlagPresentFlag( Bool b ) { m_OutputFlagPresentFlag = b; } |
---|
| 1827 | Bool getOutputFlagPresentFlag() const { return m_OutputFlagPresentFlag; } |
---|
| 1828 | Void setTransquantBypassEnableFlag( Bool b ) { m_TransquantBypassEnableFlag = b; } |
---|
| 1829 | Bool getTransquantBypassEnableFlag() const { return m_TransquantBypassEnableFlag; } |
---|
[313] | 1830 | |
---|
[1235] | 1831 | Bool getUseTransformSkip() const { return m_useTransformSkip; } |
---|
| 1832 | Void setUseTransformSkip( Bool b ) { m_useTransformSkip = b; } |
---|
[313] | 1833 | |
---|
[1235] | 1834 | Void setLoopFilterAcrossTilesEnabledFlag(Bool b) { m_loopFilterAcrossTilesEnabledFlag = b; } |
---|
| 1835 | Bool getLoopFilterAcrossTilesEnabledFlag() const { return m_loopFilterAcrossTilesEnabledFlag; } |
---|
| 1836 | Bool getDependentSliceSegmentsEnabledFlag() const { return m_dependentSliceSegmentsEnabledFlag; } |
---|
| 1837 | Void setDependentSliceSegmentsEnabledFlag(Bool val) { m_dependentSliceSegmentsEnabledFlag = val; } |
---|
| 1838 | Bool getEntropyCodingSyncEnabledFlag() const { return m_entropyCodingSyncEnabledFlag; } |
---|
| 1839 | Void setEntropyCodingSyncEnabledFlag(Bool val) { m_entropyCodingSyncEnabledFlag = val; } |
---|
[313] | 1840 | |
---|
[1235] | 1841 | Void setTilesEnabledFlag(Bool val) { m_tilesEnabledFlag = val; } |
---|
| 1842 | Bool getTilesEnabledFlag() const { return m_tilesEnabledFlag; } |
---|
| 1843 | Void setTileUniformSpacingFlag(Bool b) { m_uniformSpacingFlag = b; } |
---|
| 1844 | Bool getTileUniformSpacingFlag() const { return m_uniformSpacingFlag; } |
---|
| 1845 | Void setNumTileColumnsMinus1(Int i) { m_numTileColumnsMinus1 = i; } |
---|
| 1846 | Int getNumTileColumnsMinus1() const { return m_numTileColumnsMinus1; } |
---|
| 1847 | Void setTileColumnWidth(const std::vector<Int>& columnWidth ) { m_tileColumnWidth = columnWidth; } |
---|
| 1848 | UInt getTileColumnWidth(UInt columnIdx) const { return m_tileColumnWidth[columnIdx]; } |
---|
| 1849 | Void setNumTileRowsMinus1(Int i) { m_numTileRowsMinus1 = i; } |
---|
| 1850 | Int getNumTileRowsMinus1() const { return m_numTileRowsMinus1; } |
---|
| 1851 | Void setTileRowHeight(const std::vector<Int>& rowHeight) { m_tileRowHeight = rowHeight; } |
---|
| 1852 | UInt getTileRowHeight(UInt rowIdx) const { return m_tileRowHeight[rowIdx]; } |
---|
[313] | 1853 | |
---|
[1235] | 1854 | Void setSignHideFlag( Bool signHideFlag ) { m_signHideFlag = signHideFlag; } |
---|
| 1855 | Bool getSignHideFlag() const { return m_signHideFlag; } |
---|
[313] | 1856 | |
---|
[1235] | 1857 | Void setCabacInitPresentFlag( Bool flag ) { m_cabacInitPresentFlag = flag; } |
---|
| 1858 | Bool getCabacInitPresentFlag() const { return m_cabacInitPresentFlag; } |
---|
| 1859 | Void setDeblockingFilterControlPresentFlag( Bool val ) { m_deblockingFilterControlPresentFlag = val; } |
---|
| 1860 | Bool getDeblockingFilterControlPresentFlag() const { return m_deblockingFilterControlPresentFlag; } |
---|
| 1861 | Void setDeblockingFilterOverrideEnabledFlag( Bool val ) { m_deblockingFilterOverrideEnabledFlag = val; } |
---|
| 1862 | Bool getDeblockingFilterOverrideEnabledFlag() const { return m_deblockingFilterOverrideEnabledFlag; } |
---|
| 1863 | Void setPicDisableDeblockingFilterFlag(Bool val) { m_picDisableDeblockingFilterFlag = val; } //!< set offset for deblocking filter disabled |
---|
| 1864 | Bool getPicDisableDeblockingFilterFlag() const { return m_picDisableDeblockingFilterFlag; } //!< get offset for deblocking filter disabled |
---|
| 1865 | Void setDeblockingFilterBetaOffsetDiv2(Int val) { m_deblockingFilterBetaOffsetDiv2 = val; } //!< set beta offset for deblocking filter |
---|
| 1866 | Int getDeblockingFilterBetaOffsetDiv2() const { return m_deblockingFilterBetaOffsetDiv2; } //!< get beta offset for deblocking filter |
---|
| 1867 | Void setDeblockingFilterTcOffsetDiv2(Int val) { m_deblockingFilterTcOffsetDiv2 = val; } //!< set tc offset for deblocking filter |
---|
| 1868 | Int getDeblockingFilterTcOffsetDiv2() const { return m_deblockingFilterTcOffsetDiv2; } //!< get tc offset for deblocking filter |
---|
| 1869 | Bool getScalingListPresentFlag() const { return m_scalingListPresentFlag; } |
---|
| 1870 | Void setScalingListPresentFlag( Bool b ) { m_scalingListPresentFlag = b; } |
---|
| 1871 | TComScalingList& getScalingList() { return m_scalingList; } |
---|
| 1872 | const TComScalingList& getScalingList() const { return m_scalingList; } |
---|
| 1873 | Bool getListsModificationPresentFlag() const { return m_listsModificationPresentFlag; } |
---|
| 1874 | Void setListsModificationPresentFlag( Bool b ) { m_listsModificationPresentFlag = b; } |
---|
| 1875 | UInt getLog2ParallelMergeLevelMinus2() const { return m_log2ParallelMergeLevelMinus2; } |
---|
| 1876 | Void setLog2ParallelMergeLevelMinus2(UInt mrgLevel) { m_log2ParallelMergeLevelMinus2 = mrgLevel; } |
---|
| 1877 | Int getNumExtraSliceHeaderBits() const { return m_numExtraSliceHeaderBits; } |
---|
| 1878 | Void setNumExtraSliceHeaderBits(Int i) { m_numExtraSliceHeaderBits = i; } |
---|
| 1879 | Void setLoopFilterAcrossSlicesEnabledFlag( Bool bValue ) { m_loopFilterAcrossSlicesEnabledFlag = bValue; } |
---|
| 1880 | Bool getLoopFilterAcrossSlicesEnabledFlag() const { return m_loopFilterAcrossSlicesEnabledFlag; } |
---|
| 1881 | Bool getSliceHeaderExtensionPresentFlag() const { return m_sliceHeaderExtensionPresentFlag; } |
---|
| 1882 | Void setSliceHeaderExtensionPresentFlag(Bool val) { m_sliceHeaderExtensionPresentFlag = val; } |
---|
[1316] | 1883 | |
---|
| 1884 | const TComPPSRExt& getPpsRangeExtension() const { return m_ppsRangeExtension; } |
---|
| 1885 | TComPPSRExt& getPpsRangeExtension() { return m_ppsRangeExtension; } |
---|
| 1886 | |
---|
[1223] | 1887 | #if SVC_EXTENSION |
---|
[1235] | 1888 | Int getExtensionFlag() const { return m_extensionFlag; } |
---|
| 1889 | Void setExtensionFlag(Int n) { m_extensionFlag = n; } |
---|
| 1890 | UInt getLayerId() const { return m_layerId; } |
---|
| 1891 | Void setLayerId( UInt layerId ) { m_layerId = layerId; } |
---|
| 1892 | Bool getInferScalingListFlag() const { return m_inferScalingListFlag; } |
---|
| 1893 | UInt getScalingListRefLayerId() const { return m_scalingListRefLayerId; } |
---|
| 1894 | Void setInferScalingListFlag( Bool flag ) { m_inferScalingListFlag = flag; } |
---|
| 1895 | Void setScalingListRefLayerId( UInt layerId ) { m_scalingListRefLayerId = layerId; } |
---|
| 1896 | Bool getPocResetInfoPresentFlag() const { return m_pocResetInfoPresentFlag; } |
---|
| 1897 | Void setPocResetInfoPresentFlag(const Bool val) { m_pocResetInfoPresentFlag = val; } |
---|
| 1898 | UInt getNumRefLayerLocationOffsets() const { return m_numRefLayerLocationOffsets; } |
---|
| 1899 | Void setNumRefLayerLocationOffsets(Int x) { m_numRefLayerLocationOffsets = x; } |
---|
[1147] | 1900 | |
---|
[1235] | 1901 | UInt getRefLocationOffsetLayerId(Int x) const { return m_refLocationOffsetLayerId[x]; } |
---|
| 1902 | Void setRefLocationOffsetLayerId(Int x, UInt id) { m_refLocationOffsetLayerId[x] = id; } |
---|
| 1903 | const Window& getScaledRefLayerWindowForLayer( Int layerId ) const; |
---|
[1147] | 1904 | |
---|
[1235] | 1905 | Window& getScaledRefLayerWindow( Int x ) { return m_scaledRefLayerWindow[x]; } |
---|
| 1906 | const Window& getScaledRefLayerWindow( Int x ) const { return m_scaledRefLayerWindow[x]; } |
---|
| 1907 | const Window& getRefLayerWindowForLayer( Int layerId ) const; |
---|
| 1908 | Window& getRefLayerWindow( Int x ) { return m_refLayerWindow[x]; } |
---|
| 1909 | const Window& getRefLayerWindow( Int x ) const { return m_refLayerWindow[x]; } |
---|
| 1910 | Bool getScaledRefLayerOffsetPresentFlag(Int x) const { return m_scaledRefLayerOffsetPresentFlag[x]; } |
---|
| 1911 | Void setScaledRefLayerOffsetPresentFlag(Int x, Bool b) { m_scaledRefLayerOffsetPresentFlag[x] = b; } |
---|
| 1912 | Bool getRefRegionOffsetPresentFlag(Int x) const { return m_refRegionOffsetPresentFlag[x]; } |
---|
| 1913 | Void setRefRegionOffsetPresentFlag(Int x, Bool b) { m_refRegionOffsetPresentFlag[x] = b; } |
---|
| 1914 | |
---|
| 1915 | Int getPhaseHorLuma(Int x) const { return m_resamplingPhase[x].phaseHorLuma; } |
---|
| 1916 | Int getPhaseVerLuma(Int x) const { return m_resamplingPhase[x].phaseVerLuma; } |
---|
| 1917 | Int getPhaseHorChroma(Int x) const { return m_resamplingPhase[x].phaseHorChroma; } |
---|
| 1918 | Int getPhaseVerChroma(Int x) const { return m_resamplingPhase[x].phaseVerChroma; } |
---|
| 1919 | Void setPhaseHorLuma(Int x, Int val) { m_resamplingPhase[x].phaseHorLuma = val; } |
---|
| 1920 | Void setPhaseVerLuma(Int x, Int val) { m_resamplingPhase[x].phaseVerLuma = val; } |
---|
| 1921 | Void setPhaseHorChroma(Int x, Int val) { m_resamplingPhase[x].phaseHorChroma = val; } |
---|
| 1922 | Void setPhaseVerChroma(Int x, Int val) { m_resamplingPhase[x].phaseVerChroma = val; } |
---|
| 1923 | Bool getResamplePhaseSetPresentFlag(Int x) const { return m_resamplingPhase[x].phasePresentFlag; } |
---|
| 1924 | Void setResamplePhaseSetPresentFlag(Int x, Bool b) { m_resamplingPhase[x].phasePresentFlag = b; } |
---|
| 1925 | |
---|
| 1926 | Bool hasZeroResamplingPhase(Int refLayerId) const; |
---|
| 1927 | const ResamplingPhase& getResamplingPhase(Int refLayerId) const; |
---|
[1212] | 1928 | #if CGS_3D_ASYMLUT |
---|
[1235] | 1929 | Int getCGSFlag() const { return m_nCGSFlag; } |
---|
| 1930 | Void setCGSFlag(Int n) { m_nCGSFlag = n; } |
---|
| 1931 | Int getCGSOutputBitDepthY() const { return m_nCGSOutputBitDepthY; } |
---|
| 1932 | Void setCGSOutputBitDepthY(Int n) { m_nCGSOutputBitDepthY = n; } |
---|
| 1933 | Int getCGSOutputBitDepthC() const { return m_nCGSOutputBitDepthC; } |
---|
| 1934 | Void setCGSOutputBitDepthC(Int n) { m_nCGSOutputBitDepthC = n; } |
---|
[713] | 1935 | #endif |
---|
[815] | 1936 | #endif //SVC_EXTENSION |
---|
[313] | 1937 | }; |
---|
| 1938 | |
---|
[1029] | 1939 | struct WPScalingParam |
---|
[313] | 1940 | { |
---|
| 1941 | // Explicit weighted prediction parameters parsed in slice header, |
---|
| 1942 | // or Implicit weighted prediction parameters (8 bits depth values). |
---|
[1029] | 1943 | Bool bPresentFlag; |
---|
| 1944 | UInt uiLog2WeightDenom; |
---|
| 1945 | Int iWeight; |
---|
| 1946 | Int iOffset; |
---|
[313] | 1947 | |
---|
| 1948 | // Weighted prediction scaling values built from above parameters (bitdepth scaled): |
---|
[1029] | 1949 | Int w; |
---|
| 1950 | Int o; |
---|
| 1951 | Int offset; |
---|
| 1952 | Int shift; |
---|
| 1953 | Int round; |
---|
| 1954 | }; |
---|
[313] | 1955 | |
---|
[1029] | 1956 | struct WPACDCParam |
---|
[313] | 1957 | { |
---|
| 1958 | Int64 iAC; |
---|
| 1959 | Int64 iDC; |
---|
[1201] | 1960 | #if SVC_EXTENSION |
---|
[1400] | 1961 | Int numSamples; |
---|
[494] | 1962 | #endif |
---|
[1029] | 1963 | }; |
---|
[313] | 1964 | |
---|
| 1965 | /// slice header class |
---|
| 1966 | class TComSlice |
---|
| 1967 | { |
---|
[1235] | 1968 | |
---|
[313] | 1969 | private: |
---|
| 1970 | // Bitstream writing |
---|
[1235] | 1971 | Bool m_saoEnabledFlag[MAX_NUM_CHANNEL_TYPE]; |
---|
| 1972 | Int m_iPPSId; ///< picture parameter set ID |
---|
| 1973 | Bool m_PicOutputFlag; ///< pic_output_flag |
---|
| 1974 | Int m_iPOC; |
---|
| 1975 | Int m_iLastIDR; |
---|
| 1976 | Int m_iAssociatedIRAP; |
---|
| 1977 | NalUnitType m_iAssociatedIRAPType; |
---|
[1367] | 1978 | const TComReferencePictureSet* m_pRPS; //< pointer to RPS, either in the SPS or the local RPS in the same slice header |
---|
| 1979 | TComReferencePictureSet m_localRPS; //< RPS when present in slice header |
---|
| 1980 | Int m_rpsIdx; //< index of used RPS in the SPS or -1 for local RPS in the slice header |
---|
[313] | 1981 | TComRefPicListModification m_RefPicListModification; |
---|
[1235] | 1982 | NalUnitType m_eNalUnitType; ///< Nal unit type for the slice |
---|
| 1983 | SliceType m_eSliceType; |
---|
| 1984 | Int m_iSliceQp; |
---|
| 1985 | Bool m_dependentSliceSegmentFlag; |
---|
[313] | 1986 | #if ADAPTIVE_QP_SELECTION |
---|
[1235] | 1987 | Int m_iSliceQpBase; |
---|
[313] | 1988 | #endif |
---|
[1235] | 1989 | Bool m_ChromaQpAdjEnabled; |
---|
| 1990 | Bool m_deblockingFilterDisable; |
---|
| 1991 | Bool m_deblockingFilterOverrideFlag; //< offsets for deblocking filter inherit from PPS |
---|
| 1992 | Int m_deblockingFilterBetaOffsetDiv2; //< beta offset for deblocking filter |
---|
| 1993 | Int m_deblockingFilterTcOffsetDiv2; //< tc offset for deblocking filter |
---|
| 1994 | Int m_list1IdxToList0Idx[MAX_NUM_REF]; |
---|
| 1995 | Int m_aiNumRefIdx [NUM_REF_PIC_LIST_01]; // for multiple reference of current slice |
---|
[313] | 1996 | |
---|
[1235] | 1997 | Bool m_bCheckLDC; |
---|
[313] | 1998 | |
---|
| 1999 | // Data |
---|
[1235] | 2000 | Int m_iSliceQpDelta; |
---|
| 2001 | Int m_iSliceChromaQpDelta[MAX_NUM_COMPONENT]; |
---|
| 2002 | TComPic* m_apcRefPicList [NUM_REF_PIC_LIST_01][MAX_NUM_REF+1]; |
---|
| 2003 | Int m_aiRefPOCList [NUM_REF_PIC_LIST_01][MAX_NUM_REF+1]; |
---|
| 2004 | Bool m_bIsUsedAsLongTerm[NUM_REF_PIC_LIST_01][MAX_NUM_REF+1]; |
---|
| 2005 | Int m_iDepth; |
---|
[1029] | 2006 | |
---|
[313] | 2007 | // referenced slice? |
---|
[1235] | 2008 | Bool m_bRefenced; |
---|
[494] | 2009 | |
---|
[313] | 2010 | // access channel |
---|
[1235] | 2011 | const TComVPS* m_pcVPS; |
---|
| 2012 | const TComSPS* m_pcSPS; |
---|
| 2013 | const TComPPS* m_pcPPS; |
---|
| 2014 | TComPic* m_pcPic; |
---|
[313] | 2015 | #if ADAPTIVE_QP_SELECTION |
---|
[1235] | 2016 | TComTrQuant* m_pcTrQuant; |
---|
[1029] | 2017 | #endif |
---|
[1235] | 2018 | Bool m_colFromL0Flag; // collocated picture from List0 flag |
---|
[1092] | 2019 | |
---|
[1235] | 2020 | Bool m_noOutputPriorPicsFlag; |
---|
| 2021 | Bool m_noRaslOutputFlag; |
---|
| 2022 | Bool m_handleCraAsBlaFlag; |
---|
[313] | 2023 | |
---|
[1235] | 2024 | UInt m_colRefIdx; |
---|
| 2025 | UInt m_maxNumMergeCand; |
---|
[313] | 2026 | |
---|
[1235] | 2027 | Double m_lambdas[MAX_NUM_COMPONENT]; |
---|
[313] | 2028 | |
---|
[1235] | 2029 | Bool m_abEqualRef [NUM_REF_PIC_LIST_01][MAX_NUM_REF][MAX_NUM_REF]; |
---|
| 2030 | UInt m_uiTLayer; |
---|
| 2031 | Bool m_bTLayerSwitchingFlag; |
---|
[313] | 2032 | |
---|
[1235] | 2033 | SliceConstraint m_sliceMode; |
---|
| 2034 | UInt m_sliceArgument; |
---|
| 2035 | UInt m_sliceCurStartCtuTsAddr; |
---|
| 2036 | UInt m_sliceCurEndCtuTsAddr; |
---|
| 2037 | UInt m_sliceIdx; |
---|
| 2038 | SliceConstraint m_sliceSegmentMode; |
---|
| 2039 | UInt m_sliceSegmentArgument; |
---|
| 2040 | UInt m_sliceSegmentCurStartCtuTsAddr; |
---|
| 2041 | UInt m_sliceSegmentCurEndCtuTsAddr; |
---|
| 2042 | Bool m_nextSlice; |
---|
| 2043 | Bool m_nextSliceSegment; |
---|
| 2044 | UInt m_sliceBits; |
---|
| 2045 | UInt m_sliceSegmentBits; |
---|
| 2046 | Bool m_bFinalized; |
---|
[313] | 2047 | |
---|
[1235] | 2048 | Bool m_bTestWeightPred; |
---|
| 2049 | Bool m_bTestWeightBiPred; |
---|
| 2050 | WPScalingParam m_weightPredTable[NUM_REF_PIC_LIST_01][MAX_NUM_REF][MAX_NUM_COMPONENT]; // [REF_PIC_LIST_0 or REF_PIC_LIST_1][refIdx][0:Y, 1:U, 2:V] |
---|
| 2051 | WPACDCParam m_weightACDCParam[MAX_NUM_COMPONENT]; |
---|
[313] | 2052 | |
---|
[1235] | 2053 | std::vector<UInt> m_substreamSizes; |
---|
[313] | 2054 | |
---|
[1235] | 2055 | Bool m_cabacInitFlag; |
---|
[313] | 2056 | |
---|
[1235] | 2057 | Bool m_bLMvdL1Zero; |
---|
| 2058 | Bool m_temporalLayerNonReferenceFlag; |
---|
| 2059 | Bool m_LFCrossSliceBoundaryFlag; |
---|
[1029] | 2060 | |
---|
[1235] | 2061 | Bool m_enableTMVPFlag; |
---|
| 2062 | |
---|
| 2063 | SliceType m_encCABACTableIdx; // Used to transmit table selection across slices. |
---|
| 2064 | |
---|
[1029] | 2065 | #if SVC_EXTENSION |
---|
[1235] | 2066 | Int m_associatedIrapPocBeforeReset; |
---|
| 2067 | Bool m_firstSliceInPic; |
---|
| 2068 | Bool m_availableForTMVPRefFlag; |
---|
| 2069 | UInt m_layerId; |
---|
| 2070 | TComPic* m_pcBaseColPic[MAX_LAYERS]; |
---|
| 2071 | TComPicYuv* m_pcFullPelBaseRec[MAX_LAYERS]; |
---|
| 2072 | Int m_numMotionPredRefLayers; |
---|
| 2073 | Bool m_bMFMEnabledFlag; |
---|
| 2074 | Int m_colRefLayerIdx; |
---|
| 2075 | Bool m_altColIndicationFlag; |
---|
| 2076 | TComPic* m_pcIlpPic; |
---|
[494] | 2077 | |
---|
[1235] | 2078 | Bool m_interLayerPredEnabledFlag; |
---|
| 2079 | Int m_activeNumILRRefIdx; //< Active inter-layer reference pictures |
---|
| 2080 | Int m_interLayerPredLayerIdc [MAX_VPS_LAYER_IDX_PLUS1]; |
---|
| 2081 | Bool m_bDiscardableFlag; |
---|
| 2082 | Bool m_bCrossLayerBLAFlag; |
---|
| 2083 | Int m_pocResetIdc; |
---|
| 2084 | Int m_pocResetPeriodId; |
---|
| 2085 | Bool m_fullPocResetFlag; |
---|
| 2086 | Int m_pocLsbVal; |
---|
| 2087 | Int m_pocMsbVal; |
---|
| 2088 | Bool m_pocMsbValRequiredFlag; |
---|
| 2089 | Bool m_pocMsbValPresentFlag; |
---|
| 2090 | Bool m_pocMsbValNeeded; |
---|
| 2091 | Int m_pocResetDeltaPoc; |
---|
| 2092 | Int m_pocValueBeforeReset; |
---|
| 2093 | Int m_picOrderCntLsb; |
---|
[1212] | 2094 | #if CGS_3D_ASYMLUT |
---|
[1235] | 2095 | Int m_nCGSOverWritePPS; // for optimization, not output to bitstream |
---|
[713] | 2096 | #endif |
---|
[494] | 2097 | #endif //SVC_EXTENSION |
---|
| 2098 | |
---|
[313] | 2099 | public: |
---|
[1235] | 2100 | TComSlice(); |
---|
| 2101 | virtual ~TComSlice(); |
---|
[313] | 2102 | #if SVC_EXTENSION |
---|
[1235] | 2103 | Void initSlice( UInt layerId ); |
---|
| 2104 | Void setVPS( const TComVPS* pcVPS ) { m_pcVPS = pcVPS; } |
---|
[313] | 2105 | #else |
---|
[1235] | 2106 | Void initSlice(); |
---|
[313] | 2107 | |
---|
[1235] | 2108 | Void setVPS( TComVPS* pcVPS ) { m_pcVPS = pcVPS; } |
---|
[1494] | 2109 | #endif |
---|
[1235] | 2110 | const TComVPS* getVPS() const { return m_pcVPS; } |
---|
| 2111 | Void setSPS( const TComSPS* pcSPS ) { m_pcSPS = pcSPS; } |
---|
| 2112 | const TComSPS* getSPS() const { return m_pcSPS; } |
---|
[1029] | 2113 | |
---|
[1235] | 2114 | Void setPPS( const TComPPS* pcPPS ) { m_pcPPS = pcPPS; m_iPPSId = (pcPPS) ? pcPPS->getPPSId() : -1; } |
---|
| 2115 | const TComPPS* getPPS() const { return m_pcPPS; } |
---|
[313] | 2116 | |
---|
[1235] | 2117 | Void setPPSId( Int PPSId ) { m_iPPSId = PPSId; } |
---|
| 2118 | Int getPPSId() const { return m_iPPSId; } |
---|
| 2119 | Void setPicOutputFlag( Bool b ) { m_PicOutputFlag = b; } |
---|
| 2120 | Bool getPicOutputFlag() const { return m_PicOutputFlag; } |
---|
| 2121 | Void setSaoEnabledFlag(ChannelType chType, Bool s) {m_saoEnabledFlag[chType] =s; } |
---|
| 2122 | Bool getSaoEnabledFlag(ChannelType chType) const { return m_saoEnabledFlag[chType]; } |
---|
[1367] | 2123 | Void setRPS( const TComReferencePictureSet *pcRPS ) { m_pRPS = pcRPS; } |
---|
| 2124 | const TComReferencePictureSet* getRPS() { return m_pRPS; } |
---|
| 2125 | TComReferencePictureSet* getLocalRPS() { return &m_localRPS; } |
---|
[313] | 2126 | |
---|
[1367] | 2127 | Void setRPSidx( Int rpsIdx ) { m_rpsIdx = rpsIdx; } |
---|
| 2128 | Int getRPSidx() const { return m_rpsIdx; } |
---|
[1235] | 2129 | TComRefPicListModification* getRefPicListModification() { return &m_RefPicListModification; } |
---|
| 2130 | Void setLastIDR(Int iIDRPOC) { m_iLastIDR = iIDRPOC; } |
---|
| 2131 | Int getLastIDR() const { return m_iLastIDR; } |
---|
| 2132 | Void setAssociatedIRAPPOC(Int iAssociatedIRAPPOC) { m_iAssociatedIRAP = iAssociatedIRAPPOC; } |
---|
| 2133 | Int getAssociatedIRAPPOC() const { return m_iAssociatedIRAP; } |
---|
| 2134 | Void setAssociatedIRAPType(NalUnitType associatedIRAPType) { m_iAssociatedIRAPType = associatedIRAPType; } |
---|
| 2135 | NalUnitType getAssociatedIRAPType() const { return m_iAssociatedIRAPType; } |
---|
| 2136 | SliceType getSliceType() const { return m_eSliceType; } |
---|
| 2137 | Int getPOC() const { return m_iPOC; } |
---|
| 2138 | Int getSliceQp() const { return m_iSliceQp; } |
---|
[1400] | 2139 | Bool getUseWeightedPrediction() const { return( (m_eSliceType==P_SLICE && testWeightPred()) || (m_eSliceType==B_SLICE && testWeightBiPred()) ); } |
---|
[1235] | 2140 | Bool getDependentSliceSegmentFlag() const { return m_dependentSliceSegmentFlag; } |
---|
| 2141 | Void setDependentSliceSegmentFlag(Bool val) { m_dependentSliceSegmentFlag = val; } |
---|
[313] | 2142 | #if ADAPTIVE_QP_SELECTION |
---|
[1235] | 2143 | Int getSliceQpBase() const { return m_iSliceQpBase; } |
---|
[313] | 2144 | #endif |
---|
[1235] | 2145 | Int getSliceQpDelta() const { return m_iSliceQpDelta; } |
---|
| 2146 | Int getSliceChromaQpDelta(ComponentID compID) const { return isLuma(compID) ? 0 : m_iSliceChromaQpDelta[compID]; } |
---|
| 2147 | Bool getUseChromaQpAdj() const { return m_ChromaQpAdjEnabled; } |
---|
| 2148 | Bool getDeblockingFilterDisable() const { return m_deblockingFilterDisable; } |
---|
| 2149 | Bool getDeblockingFilterOverrideFlag() const { return m_deblockingFilterOverrideFlag; } |
---|
| 2150 | Int getDeblockingFilterBetaOffsetDiv2()const { return m_deblockingFilterBetaOffsetDiv2; } |
---|
| 2151 | Int getDeblockingFilterTcOffsetDiv2() const { return m_deblockingFilterTcOffsetDiv2; } |
---|
[313] | 2152 | |
---|
[1235] | 2153 | Int getNumRefIdx( RefPicList e ) const { return m_aiNumRefIdx[e]; } |
---|
| 2154 | TComPic* getPic() { return m_pcPic; } |
---|
| 2155 | TComPic* getRefPic( RefPicList e, Int iRefIdx) { return m_apcRefPicList[e][iRefIdx]; } |
---|
[1465] | 2156 | const TComPic* getRefPic( RefPicList e, Int iRefIdx) const { return m_apcRefPicList[e][iRefIdx]; } |
---|
| 2157 | Int getRefPOC( RefPicList e, Int iRefIdx) const { return m_aiRefPOCList[e][iRefIdx]; } |
---|
[1235] | 2158 | Int getDepth() const { return m_iDepth; } |
---|
| 2159 | Bool getColFromL0Flag() const { return m_colFromL0Flag; } |
---|
| 2160 | UInt getColRefIdx() const { return m_colRefIdx; } |
---|
| 2161 | Void checkColRefIdx(UInt curSliceIdx, TComPic* pic); |
---|
| 2162 | Bool getIsUsedAsLongTerm(Int i, Int j) const { return m_bIsUsedAsLongTerm[i][j]; } |
---|
| 2163 | Void setIsUsedAsLongTerm(Int i, Int j, Bool value) { m_bIsUsedAsLongTerm[i][j] = value; } |
---|
| 2164 | Bool getCheckLDC() const { return m_bCheckLDC; } |
---|
| 2165 | Bool getMvdL1ZeroFlag() const { return m_bLMvdL1Zero; } |
---|
| 2166 | Int getNumRpsCurrTempList() const; |
---|
| 2167 | Int getList1IdxToList0Idx( Int list1Idx ) const { return m_list1IdxToList0Idx[list1Idx]; } |
---|
| 2168 | Void setReferenced(Bool b) { m_bRefenced = b; } |
---|
| 2169 | Bool isReferenced() const { return m_bRefenced; } |
---|
| 2170 | Bool isReferenceNalu() const { return ((getNalUnitType() <= NAL_UNIT_RESERVED_VCL_R15) && (getNalUnitType()%2 != 0)) || ((getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP) && (getNalUnitType() <= NAL_UNIT_RESERVED_IRAP_VCL23) ); } |
---|
[1295] | 2171 | Void setPOC( Int i ) { m_iPOC = i; } |
---|
[1235] | 2172 | Void setNalUnitType( NalUnitType e ) { m_eNalUnitType = e; } |
---|
| 2173 | NalUnitType getNalUnitType() const { return m_eNalUnitType; } |
---|
| 2174 | Bool getRapPicFlag() const; |
---|
| 2175 | Bool getIdrPicFlag() const { return getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP; } |
---|
| 2176 | Bool isIRAP() const { return (getNalUnitType() >= 16) && (getNalUnitType() <= 23); } |
---|
| 2177 | Void checkCRA(const TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, NalUnitType& associatedIRAPType, TComList<TComPic *>& rcListPic); |
---|
[540] | 2178 | #if NO_CLRAS_OUTPUT_FLAG |
---|
[1235] | 2179 | Void decodingRefreshMarking( TComList<TComPic*>& rcListPic, Bool noClrasOutputFlag, UInt smallestLayerId = 0 ); |
---|
[1325] | 2180 | Void decodingRefreshMarking(Int& pocCRA, Bool& bRefreshPending, TComList<TComPic*>& rcListPic, const bool bEfficientFieldIRAPEnabled, Bool noClrasOutputFlag); |
---|
[540] | 2181 | #else |
---|
[1325] | 2182 | Void decodingRefreshMarking(Int& pocCRA, Bool& bRefreshPending, TComList<TComPic*>& rcListPic, const bool bEfficientFieldIRAPEnabled); |
---|
[540] | 2183 | #endif |
---|
[1235] | 2184 | Void setSliceType( SliceType e ) { m_eSliceType = e; } |
---|
| 2185 | Void setSliceQp( Int i ) { m_iSliceQp = i; } |
---|
[313] | 2186 | #if ADAPTIVE_QP_SELECTION |
---|
[1235] | 2187 | Void setSliceQpBase( Int i ) { m_iSliceQpBase = i; } |
---|
[313] | 2188 | #endif |
---|
[1235] | 2189 | Void setSliceQpDelta( Int i ) { m_iSliceQpDelta = i; } |
---|
| 2190 | Void setSliceChromaQpDelta( ComponentID compID, Int i ) { m_iSliceChromaQpDelta[compID] = isLuma(compID) ? 0 : i; } |
---|
| 2191 | Void setUseChromaQpAdj( Bool b ) { m_ChromaQpAdjEnabled = b; } |
---|
| 2192 | Void setDeblockingFilterDisable( Bool b ) { m_deblockingFilterDisable= b; } |
---|
| 2193 | Void setDeblockingFilterOverrideFlag( Bool b ) { m_deblockingFilterOverrideFlag = b; } |
---|
| 2194 | Void setDeblockingFilterBetaOffsetDiv2( Int i ) { m_deblockingFilterBetaOffsetDiv2 = i; } |
---|
| 2195 | Void setDeblockingFilterTcOffsetDiv2( Int i ) { m_deblockingFilterTcOffsetDiv2 = i; } |
---|
[1029] | 2196 | |
---|
[1235] | 2197 | Void setRefPic( TComPic* p, RefPicList e, Int iRefIdx ) { m_apcRefPicList[e][iRefIdx] = p; } |
---|
| 2198 | Void setRefPOC( Int i, RefPicList e, Int iRefIdx ) { m_aiRefPOCList[e][iRefIdx] = i; } |
---|
| 2199 | Void setNumRefIdx( RefPicList e, Int i ) { m_aiNumRefIdx[e] = i; } |
---|
| 2200 | Void setPic( TComPic* p ) { m_pcPic = p; } |
---|
| 2201 | Void setDepth( Int iDepth ) { m_iDepth = iDepth; } |
---|
[313] | 2202 | |
---|
| 2203 | #if SVC_EXTENSION |
---|
[1235] | 2204 | Void setAssociatedIrapPocBeforeReset(Int x) { m_associatedIrapPocBeforeReset = x; } |
---|
| 2205 | Int getAssociatedIrapPocBeforeReset( ) { return m_associatedIrapPocBeforeReset; } |
---|
[1029] | 2206 | |
---|
[1235] | 2207 | Void setRefPicList( TComList<TComPic*>& rcListPic, Bool checkNumPocTotalCurr = false, TComPic** ilpPic = NULL ); |
---|
[1212] | 2208 | #if CGS_3D_ASYMLUT |
---|
[1235] | 2209 | Int getCGSOverWritePPS() { return m_nCGSOverWritePPS; } |
---|
| 2210 | Void setCGSOverWritePPS(Int n) { m_nCGSOverWritePPS = n; } |
---|
[713] | 2211 | #endif |
---|
[313] | 2212 | #else |
---|
[1235] | 2213 | Void setRefPicList( TComList<TComPic*>& rcListPic, Bool checkNumPocTotalCurr = false ); |
---|
[313] | 2214 | #endif |
---|
[1235] | 2215 | Void setRefPOCList(); |
---|
| 2216 | Void setColFromL0Flag( Bool colFromL0 ) { m_colFromL0Flag = colFromL0; } |
---|
| 2217 | Void setColRefIdx( UInt refIdx) { m_colRefIdx = refIdx; } |
---|
| 2218 | Void setCheckLDC( Bool b ) { m_bCheckLDC = b; } |
---|
| 2219 | Void setMvdL1ZeroFlag( Bool b) { m_bLMvdL1Zero = b; } |
---|
[313] | 2220 | |
---|
[1235] | 2221 | Bool isIntra() const { return m_eSliceType == I_SLICE; } |
---|
| 2222 | Bool isInterB() const { return m_eSliceType == B_SLICE; } |
---|
| 2223 | Bool isInterP() const { return m_eSliceType == P_SLICE; } |
---|
[1029] | 2224 | |
---|
[1235] | 2225 | Void setLambdas( const Double lambdas[MAX_NUM_COMPONENT] ) { for (Int component = 0; component < MAX_NUM_COMPONENT; component++) m_lambdas[component] = lambdas[component]; } |
---|
| 2226 | const Double* getLambdas() const { return m_lambdas; } |
---|
[1029] | 2227 | |
---|
[1235] | 2228 | Void initEqualRef(); |
---|
| 2229 | Bool isEqualRef( RefPicList e, Int iRefIdx1, Int iRefIdx2 ) |
---|
[313] | 2230 | { |
---|
[1029] | 2231 | assert(e<NUM_REF_PIC_LIST_01); |
---|
[1235] | 2232 | if (iRefIdx1 < 0 || iRefIdx2 < 0) |
---|
| 2233 | { |
---|
| 2234 | return false; |
---|
| 2235 | } |
---|
| 2236 | else |
---|
| 2237 | { |
---|
| 2238 | return m_abEqualRef[e][iRefIdx1][iRefIdx2]; |
---|
| 2239 | } |
---|
[313] | 2240 | } |
---|
[1029] | 2241 | |
---|
[1235] | 2242 | Void setEqualRef( RefPicList e, Int iRefIdx1, Int iRefIdx2, Bool b) |
---|
[313] | 2243 | { |
---|
[1029] | 2244 | assert(e<NUM_REF_PIC_LIST_01); |
---|
[313] | 2245 | m_abEqualRef[e][iRefIdx1][iRefIdx2] = m_abEqualRef[e][iRefIdx2][iRefIdx1] = b; |
---|
| 2246 | } |
---|
[1029] | 2247 | |
---|
[1235] | 2248 | static Void sortPicList( TComList<TComPic*>& rcListPic ); |
---|
| 2249 | Void setList1IdxToList0Idx(); |
---|
[313] | 2250 | |
---|
[1235] | 2251 | UInt getTLayer() const { return m_uiTLayer; } |
---|
| 2252 | Void setTLayer( UInt uiTLayer ) { m_uiTLayer = uiTLayer; } |
---|
[313] | 2253 | |
---|
[1235] | 2254 | Void setTLayerInfo( UInt uiTLayer ); |
---|
| 2255 | Void decodingMarking( TComList<TComPic*>& rcListPic, Int iGOPSIze, Int& iMaxRefPicNum ); |
---|
| 2256 | |
---|
[1209] | 2257 | #if SVC_POC |
---|
[1235] | 2258 | Void checkLeadingPictureRestrictions(TComList<TComPic*>& rcListPic, Bool usePocBeforeReset = false); |
---|
[815] | 2259 | #else |
---|
[1235] | 2260 | Void checkLeadingPictureRestrictions( TComList<TComPic*>& rcListPic ); |
---|
[815] | 2261 | #endif |
---|
[1235] | 2262 | Void applyReferencePictureSet( TComList<TComPic*>& rcListPic, const TComReferencePictureSet *RPSList); |
---|
| 2263 | Bool isTemporalLayerSwitchingPoint( TComList<TComPic*>& rcListPic ); |
---|
| 2264 | Bool isStepwiseTemporalLayerSwitchingPointCandidate( TComList<TComPic*>& rcListPic ); |
---|
| 2265 | Int checkThatAllRefPicsAreAvailable( TComList<TComPic*>& rcListPic, const TComReferencePictureSet *pReferencePictureSet, Bool printErrors, Int pocRandomAccess = 0, Bool bUseRecoveryPoint = false); |
---|
[1325] | 2266 | Void createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, const TComReferencePictureSet *pReferencePictureSet, Bool isRAP, Int pocRandomAccess, Bool bUseRecoveryPoint, const Bool bEfficientFieldIRAPEnabled); |
---|
[1235] | 2267 | Void setMaxNumMergeCand(UInt val ) { m_maxNumMergeCand = val; } |
---|
| 2268 | UInt getMaxNumMergeCand() const { return m_maxNumMergeCand; } |
---|
[313] | 2269 | |
---|
[1235] | 2270 | Void setNoOutputPriorPicsFlag( Bool val ) { m_noOutputPriorPicsFlag = val; } |
---|
| 2271 | Bool getNoOutputPriorPicsFlag() const { return m_noOutputPriorPicsFlag; } |
---|
[313] | 2272 | |
---|
[1235] | 2273 | Void setNoRaslOutputFlag( Bool val ) { m_noRaslOutputFlag = val; } |
---|
| 2274 | Bool getNoRaslOutputFlag() const { return m_noRaslOutputFlag; } |
---|
[713] | 2275 | |
---|
[1235] | 2276 | Void setHandleCraAsBlaFlag( Bool val ) { m_handleCraAsBlaFlag = val; } |
---|
| 2277 | Bool getHandleCraAsBlaFlag() const { return m_handleCraAsBlaFlag; } |
---|
[713] | 2278 | |
---|
[1235] | 2279 | Void setSliceMode( SliceConstraint mode ) { m_sliceMode = mode; } |
---|
| 2280 | SliceConstraint getSliceMode() const { return m_sliceMode; } |
---|
| 2281 | Void setSliceArgument( UInt uiArgument ) { m_sliceArgument = uiArgument; } |
---|
| 2282 | UInt getSliceArgument() const { return m_sliceArgument; } |
---|
| 2283 | Void setSliceCurStartCtuTsAddr( UInt ctuTsAddr ) { m_sliceCurStartCtuTsAddr = ctuTsAddr; } // CTU Tile-scan address (as opposed to raster-scan) |
---|
| 2284 | UInt getSliceCurStartCtuTsAddr() const { return m_sliceCurStartCtuTsAddr; } // CTU Tile-scan address (as opposed to raster-scan) |
---|
| 2285 | Void setSliceCurEndCtuTsAddr( UInt ctuTsAddr ) { m_sliceCurEndCtuTsAddr = ctuTsAddr; } // CTU Tile-scan address (as opposed to raster-scan) |
---|
| 2286 | UInt getSliceCurEndCtuTsAddr() const { return m_sliceCurEndCtuTsAddr; } // CTU Tile-scan address (as opposed to raster-scan) |
---|
| 2287 | Void setSliceIdx( UInt i) { m_sliceIdx = i; } |
---|
| 2288 | UInt getSliceIdx() const { return m_sliceIdx; } |
---|
| 2289 | Void copySliceInfo(TComSlice *pcSliceSrc); |
---|
| 2290 | Void setSliceSegmentMode( SliceConstraint mode ) { m_sliceSegmentMode = mode; } |
---|
| 2291 | SliceConstraint getSliceSegmentMode() const { return m_sliceSegmentMode; } |
---|
| 2292 | Void setSliceSegmentArgument( UInt uiArgument ) { m_sliceSegmentArgument = uiArgument; } |
---|
| 2293 | UInt getSliceSegmentArgument() const { return m_sliceSegmentArgument; } |
---|
| 2294 | Void setSliceSegmentCurStartCtuTsAddr( UInt ctuTsAddr ) { m_sliceSegmentCurStartCtuTsAddr = ctuTsAddr; } // CTU Tile-scan address (as opposed to raster-scan) |
---|
| 2295 | UInt getSliceSegmentCurStartCtuTsAddr() const { return m_sliceSegmentCurStartCtuTsAddr; } // CTU Tile-scan address (as opposed to raster-scan) |
---|
| 2296 | Void setSliceSegmentCurEndCtuTsAddr( UInt ctuTsAddr ) { m_sliceSegmentCurEndCtuTsAddr = ctuTsAddr; } // CTU Tile-scan address (as opposed to raster-scan) |
---|
| 2297 | UInt getSliceSegmentCurEndCtuTsAddr() const { return m_sliceSegmentCurEndCtuTsAddr; } // CTU Tile-scan address (as opposed to raster-scan) |
---|
| 2298 | Void setSliceBits( UInt uiVal ) { m_sliceBits = uiVal; } |
---|
| 2299 | UInt getSliceBits() const { return m_sliceBits; } |
---|
| 2300 | Void setSliceSegmentBits( UInt uiVal ) { m_sliceSegmentBits = uiVal; } |
---|
| 2301 | UInt getSliceSegmentBits() const { return m_sliceSegmentBits; } |
---|
| 2302 | Void setFinalized( Bool uiVal ) { m_bFinalized = uiVal; } |
---|
| 2303 | Bool getFinalized() const { return m_bFinalized; } |
---|
| 2304 | Bool testWeightPred( ) const { return m_bTestWeightPred; } |
---|
| 2305 | Void setTestWeightPred( Bool bValue ) { m_bTestWeightPred = bValue; } |
---|
| 2306 | Bool testWeightBiPred( ) const { return m_bTestWeightBiPred; } |
---|
| 2307 | Void setTestWeightBiPred( Bool bValue ) { m_bTestWeightBiPred = bValue; } |
---|
| 2308 | Void setWpScaling( WPScalingParam wp[NUM_REF_PIC_LIST_01][MAX_NUM_REF][MAX_NUM_COMPONENT] ) |
---|
| 2309 | { |
---|
| 2310 | memcpy(m_weightPredTable, wp, sizeof(WPScalingParam)*NUM_REF_PIC_LIST_01*MAX_NUM_REF*MAX_NUM_COMPONENT); |
---|
| 2311 | } |
---|
[313] | 2312 | |
---|
[1235] | 2313 | Void getWpScaling( RefPicList e, Int iRefIdx, WPScalingParam *&wp); |
---|
[313] | 2314 | |
---|
[1235] | 2315 | Void resetWpScaling(); |
---|
| 2316 | Void initWpScaling(const TComSPS *sps); |
---|
[313] | 2317 | |
---|
[1235] | 2318 | Void setWpAcDcParam( WPACDCParam wp[MAX_NUM_COMPONENT] ) |
---|
| 2319 | { |
---|
| 2320 | memcpy(m_weightACDCParam, wp, sizeof(WPACDCParam)*MAX_NUM_COMPONENT); |
---|
| 2321 | } |
---|
[1029] | 2322 | |
---|
[1316] | 2323 | Void getWpAcDcParam( WPACDCParam *&wp ); |
---|
[1235] | 2324 | Void initWpAcDcParam(); |
---|
[313] | 2325 | |
---|
[1235] | 2326 | Void clearSubstreamSizes( ) { return m_substreamSizes.clear(); } |
---|
| 2327 | UInt getNumberOfSubstreamSizes( ) { return (UInt) m_substreamSizes.size(); } |
---|
| 2328 | Void addSubstreamSize( UInt size ) { m_substreamSizes.push_back(size); } |
---|
| 2329 | UInt getSubstreamSize( Int idx ) { assert(idx<getNumberOfSubstreamSizes()); return m_substreamSizes[idx]; } |
---|
[313] | 2330 | |
---|
[1235] | 2331 | Void setCabacInitFlag( Bool val ) { m_cabacInitFlag = val; } //!< set CABAC initial flag |
---|
| 2332 | Bool getCabacInitFlag() { return m_cabacInitFlag; } //!< get CABAC initial flag |
---|
| 2333 | Bool getTemporalLayerNonReferenceFlag() { return m_temporalLayerNonReferenceFlag; } |
---|
| 2334 | Void setTemporalLayerNonReferenceFlag(Bool x) { m_temporalLayerNonReferenceFlag = x; } |
---|
| 2335 | Void setLFCrossSliceBoundaryFlag( Bool val ) { m_LFCrossSliceBoundaryFlag = val; } |
---|
| 2336 | Bool getLFCrossSliceBoundaryFlag() { return m_LFCrossSliceBoundaryFlag; } |
---|
[313] | 2337 | |
---|
[1235] | 2338 | Void setEnableTMVPFlag( Bool b ) { m_enableTMVPFlag = b; } |
---|
[1465] | 2339 | Bool getEnableTMVPFlag() const { return m_enableTMVPFlag; } |
---|
[313] | 2340 | |
---|
[1235] | 2341 | Void setEncCABACTableIdx( SliceType idx ) { m_encCABACTableIdx = idx; } |
---|
| 2342 | SliceType getEncCABACTableIdx() const { return m_encCABACTableIdx; } |
---|
[313] | 2343 | |
---|
[1235] | 2344 | #if SVC_EXTENSION |
---|
| 2345 | Void setFirstSliceInPic( Bool val ) { m_firstSliceInPic = val; } |
---|
| 2346 | Bool getFirstSliceInPic() { return m_firstSliceInPic; } |
---|
| 2347 | Void setAvailableForTMVPRefFlag( Bool b ) { m_availableForTMVPRefFlag = b; } |
---|
| 2348 | Bool getAvailableForTMVPRefFlag() { return m_availableForTMVPRefFlag; } |
---|
| 2349 | Bool setBaseColPic( TComList<TComPic*>& rcListPic , UInt refLayerIdc ); |
---|
| 2350 | Void setBaseColPic(UInt refLayerIdc, TComPic* p) { m_pcBaseColPic[refLayerIdc] = p; } |
---|
| 2351 | TComPic* getBaseColPic(UInt refLayerIdc) { return m_pcBaseColPic[refLayerIdc]; } |
---|
| 2352 | TComPic** getBaseColPic() { return &m_pcBaseColPic[0]; } |
---|
| 2353 | TComPic* getBaseColPic( TComList<TComPic*>& rcListPic ); |
---|
[313] | 2354 | |
---|
[1235] | 2355 | Void setLayerId(UInt layerId) { m_layerId = layerId; } |
---|
[1287] | 2356 | UInt getLayerId() const { return m_layerId; } |
---|
[1235] | 2357 | UInt getLayerIdx() { return m_pcVPS->getLayerIdxInVps(m_layerId); } |
---|
[313] | 2358 | |
---|
[1235] | 2359 | Void setFullPelBaseRec( UInt refLayerIdc, TComPicYuv* p) { m_pcFullPelBaseRec[refLayerIdc] = p; } |
---|
| 2360 | TComPicYuv* getFullPelBaseRec( UInt refLayerIdc) { return m_pcFullPelBaseRec[refLayerIdc]; } |
---|
[1534] | 2361 | #if VIEW_SCALABILITY |
---|
| 2362 | Int getNumRpsInterLayerX( Int li, TComPic** ilpPic ); |
---|
| 2363 | Void setRefPicListModificationSvc( TComPic** ilpPic ); |
---|
| 2364 | Int getNumfPositiveRpsCurrTempList(); |
---|
| 2365 | #else |
---|
[1235] | 2366 | Void setRefPicListModificationSvc(); |
---|
[1534] | 2367 | #endif |
---|
[1235] | 2368 | Int getNumILRRefIdx() { return m_pcVPS->getNumDirectRefLayers( m_layerId ); } |
---|
[313] | 2369 | |
---|
[1235] | 2370 | Int getActiveNumILRRefIdx() { return m_activeNumILRRefIdx; } |
---|
| 2371 | Void setActiveNumILRRefIdx( Int i ) { m_activeNumILRRefIdx = i; } |
---|
| 2372 | |
---|
| 2373 | Int getInterLayerPredLayerIdc(UInt layerIdc) { return m_interLayerPredLayerIdc[layerIdc]; } |
---|
| 2374 | Void setInterLayerPredLayerIdc(UInt refLayerIdc, UInt layerIdc) { m_interLayerPredLayerIdc[layerIdc] = refLayerIdc; } |
---|
[1226] | 2375 | |
---|
[1235] | 2376 | Void setInterLayerPredEnabledFlag( Bool val ) { m_interLayerPredEnabledFlag = val; } |
---|
| 2377 | Bool getInterLayerPredEnabledFlag() { return m_interLayerPredEnabledFlag; } |
---|
[313] | 2378 | |
---|
[1235] | 2379 | Void setNumMotionPredRefLayers(Int i) { m_numMotionPredRefLayers = i; } |
---|
| 2380 | Int getNumMotionPredRefLayers() { return m_numMotionPredRefLayers; } |
---|
[313] | 2381 | |
---|
[1235] | 2382 | Void setMFMEnabledFlag(Bool flag) { m_bMFMEnabledFlag = flag; } |
---|
| 2383 | Bool getMFMEnabledFlag() { return m_bMFMEnabledFlag; } |
---|
[313] | 2384 | |
---|
[1235] | 2385 | TComPic* getRefPic(TComList<TComPic*>& rcListPic, Int poc) { return xGetRefPic( rcListPic, poc ); } |
---|
[1204] | 2386 | |
---|
[1235] | 2387 | Bool isRADL() { return (m_eNalUnitType == NAL_UNIT_CODED_SLICE_RADL_N || m_eNalUnitType == NAL_UNIT_CODED_SLICE_RADL_R); } |
---|
| 2388 | Bool isRASL() { return (m_eNalUnitType == NAL_UNIT_CODED_SLICE_RASL_N || m_eNalUnitType == NAL_UNIT_CODED_SLICE_RASL_R); } |
---|
[494] | 2389 | |
---|
[1235] | 2390 | Bool isIDR() { return (m_eNalUnitType == NAL_UNIT_CODED_SLICE_IDR_W_RADL || m_eNalUnitType == NAL_UNIT_CODED_SLICE_IDR_N_LP); } |
---|
| 2391 | Bool isCRA() { return m_eNalUnitType == NAL_UNIT_CODED_SLICE_CRA; } |
---|
| 2392 | Bool isBLA() { return (m_eNalUnitType == NAL_UNIT_CODED_SLICE_BLA_W_LP || m_eNalUnitType == NAL_UNIT_CODED_SLICE_BLA_W_RADL || m_eNalUnitType == NAL_UNIT_CODED_SLICE_BLA_N_LP ); } |
---|
| 2393 | Bool isSLNR() |
---|
| 2394 | { |
---|
| 2395 | return (m_eNalUnitType == NAL_UNIT_CODED_SLICE_TRAIL_N |
---|
| 2396 | || m_eNalUnitType == NAL_UNIT_CODED_SLICE_TSA_N |
---|
| 2397 | || m_eNalUnitType == NAL_UNIT_CODED_SLICE_STSA_N |
---|
| 2398 | || m_eNalUnitType == NAL_UNIT_CODED_SLICE_RADL_N |
---|
| 2399 | || m_eNalUnitType == NAL_UNIT_CODED_SLICE_RASL_N |
---|
| 2400 | || m_eNalUnitType == NAL_UNIT_RESERVED_VCL_N10 |
---|
| 2401 | || m_eNalUnitType == NAL_UNIT_RESERVED_VCL_N12 |
---|
| 2402 | || m_eNalUnitType == NAL_UNIT_RESERVED_VCL_N14 ); |
---|
| 2403 | } |
---|
[494] | 2404 | |
---|
[1235] | 2405 | Bool getDiscardableFlag () { return m_bDiscardableFlag; } |
---|
| 2406 | Void setDiscardableFlag (Bool b) { m_bDiscardableFlag = b; } |
---|
| 2407 | Bool getCrossLayerBLAFlag () { return m_bCrossLayerBLAFlag; } |
---|
| 2408 | Void setCrossLayerBLAFlag (Bool b) { m_bCrossLayerBLAFlag = b; } |
---|
| 2409 | Int getNumNegativeRpsCurrTempList(); |
---|
| 2410 | Void setILRPic(TComPic **pcIlpPic); |
---|
| 2411 | Int getPocResetIdc() { return m_pocResetIdc; } |
---|
| 2412 | Void setPocResetIdc(Int b) { m_pocResetIdc = b; } |
---|
| 2413 | Int getPocResetPeriodId() { return m_pocResetPeriodId; } |
---|
| 2414 | Void setPocResetPeriodId(Int b) { m_pocResetPeriodId = b; } |
---|
| 2415 | Bool getFullPocResetFlag() { return m_fullPocResetFlag; } |
---|
| 2416 | Void setFullPocResetFlag(Bool b) { m_fullPocResetFlag = b; } |
---|
| 2417 | Int getPocLsbVal() { return m_pocLsbVal; } |
---|
| 2418 | Void setPocLsbVal(Int b) { m_pocLsbVal = b; } |
---|
| 2419 | Void setPocMsbNeeded(Bool x) { m_pocMsbValNeeded = x; } |
---|
| 2420 | Bool getPocMsbNeeded() { return m_pocMsbValNeeded; } |
---|
| 2421 | Int getPocResetDeltaPoc() { return m_pocResetDeltaPoc; } |
---|
| 2422 | Void setPocResetDeltaPoc(Int x) { m_pocResetDeltaPoc = x; } |
---|
| 2423 | Int getPocMsbVal() { return m_pocMsbVal; } |
---|
| 2424 | Void setPocMsbVal(Int b) { m_pocMsbVal = b; } |
---|
| 2425 | Bool getPocMsbValPresentFlag() { return m_pocMsbValPresentFlag; } |
---|
| 2426 | Void setPocMsbValPresentFlag(Bool x) { m_pocMsbValPresentFlag = x; } |
---|
| 2427 | Bool getPocMsbValRequiredFlag() { return m_pocMsbValRequiredFlag; } |
---|
| 2428 | Void setPocMsbValRequiredFlag(Bool x) { m_pocMsbValRequiredFlag = x; } |
---|
[1209] | 2429 | |
---|
[1235] | 2430 | Bool getBlaPicFlag(); |
---|
| 2431 | Bool getCraPicFlag(); |
---|
| 2432 | Bool getRaslPicFlag(); |
---|
| 2433 | Bool getRadlPicFlag(); |
---|
| 2434 | Int getPicOrderCntLsb() { return m_picOrderCntLsb; } |
---|
| 2435 | Void setPicOrderCntLsb(Int x) { m_picOrderCntLsb = x; } |
---|
[815] | 2436 | |
---|
[1235] | 2437 | Int getPocValueBeforeReset() { return m_pocValueBeforeReset; } |
---|
| 2438 | Void setPocValueBeforeReset(Int x) { m_pocValueBeforeReset = x ; } |
---|
| 2439 | Void decrementRefPocValues(Int const decrementValue); |
---|
| 2440 | Int getCurrMsb( Int currLsb, Int prevLsb, Int prevMsb, Int maxLsbVal ); |
---|
| 2441 | |
---|
| 2442 | Int getReferenceLayerIdc( UInt refLayerId ); |
---|
[494] | 2443 | #endif //SVC_EXTENSION |
---|
[1139] | 2444 | |
---|
[313] | 2445 | protected: |
---|
[1235] | 2446 | TComPic* xGetRefPic (TComList<TComPic*>& rcListPic, Int poc); |
---|
| 2447 | TComPic* xGetLongTermRefPic(TComList<TComPic*>& rcListPic, Int poc, Bool pocHasMsb); |
---|
[313] | 2448 | };// END CLASS DEFINITION TComSlice |
---|
| 2449 | |
---|
[1273] | 2450 | |
---|
[1319] | 2451 | Void calculateParameterSetChangedFlag(Bool &bChanged, const std::vector<UChar> *pOldData, const std::vector<UChar> &newData); |
---|
[313] | 2452 | |
---|
| 2453 | template <class T> class ParameterSetMap |
---|
| 2454 | { |
---|
| 2455 | public: |
---|
[1235] | 2456 | template <class Tm> |
---|
| 2457 | struct MapData |
---|
| 2458 | { |
---|
| 2459 | Bool bChanged; |
---|
| 2460 | std::vector<UChar> *pNaluData; // Can be null |
---|
| 2461 | Tm* parameterSet; |
---|
| 2462 | }; |
---|
| 2463 | |
---|
[313] | 2464 | ParameterSetMap(Int maxId) |
---|
| 2465 | :m_maxId (maxId) |
---|
| 2466 | {} |
---|
| 2467 | |
---|
| 2468 | ~ParameterSetMap() |
---|
| 2469 | { |
---|
[1235] | 2470 | for (typename std::map<Int,MapData<T> >::iterator i = m_paramsetMap.begin(); i!= m_paramsetMap.end(); i++) |
---|
[313] | 2471 | { |
---|
[1235] | 2472 | delete (*i).second.pNaluData; |
---|
| 2473 | delete (*i).second.parameterSet; |
---|
[313] | 2474 | } |
---|
| 2475 | } |
---|
| 2476 | |
---|
[1319] | 2477 | Void storePS(Int psId, T *ps, const std::vector<UChar> &naluData) |
---|
[313] | 2478 | { |
---|
| 2479 | assert ( psId < m_maxId ); |
---|
| 2480 | if ( m_paramsetMap.find(psId) != m_paramsetMap.end() ) |
---|
| 2481 | { |
---|
[1235] | 2482 | MapData<T> &mapData=m_paramsetMap[psId]; |
---|
| 2483 | |
---|
| 2484 | // work out changed flag |
---|
[1319] | 2485 | calculateParameterSetChangedFlag(mapData.bChanged, mapData.pNaluData, naluData); |
---|
[1235] | 2486 | delete m_paramsetMap[psId].pNaluData; |
---|
| 2487 | delete m_paramsetMap[psId].parameterSet; |
---|
| 2488 | |
---|
| 2489 | m_paramsetMap[psId].parameterSet = ps; |
---|
[313] | 2490 | } |
---|
[1235] | 2491 | else |
---|
| 2492 | { |
---|
| 2493 | m_paramsetMap[psId].parameterSet = ps; |
---|
| 2494 | m_paramsetMap[psId].bChanged = false; |
---|
| 2495 | } |
---|
[1319] | 2496 | m_paramsetMap[psId].pNaluData=new std::vector<UChar>; |
---|
| 2497 | *(m_paramsetMap[psId].pNaluData) = naluData; |
---|
[313] | 2498 | } |
---|
| 2499 | |
---|
[1235] | 2500 | Void clearChangedFlag(Int psId) |
---|
[313] | 2501 | { |
---|
[1235] | 2502 | if ( m_paramsetMap.find(psId) != m_paramsetMap.end() ) |
---|
[313] | 2503 | { |
---|
[1235] | 2504 | m_paramsetMap[psId].bChanged=false; |
---|
[313] | 2505 | } |
---|
| 2506 | } |
---|
| 2507 | |
---|
[1235] | 2508 | Bool getChangedFlag(Int psId) const |
---|
| 2509 | { |
---|
| 2510 | const typename std::map<Int,MapData<T> >::const_iterator constit=m_paramsetMap.find(psId); |
---|
| 2511 | if ( constit != m_paramsetMap.end() ) |
---|
| 2512 | { |
---|
| 2513 | return constit->second.bChanged; |
---|
| 2514 | } |
---|
| 2515 | return false; |
---|
| 2516 | } |
---|
[313] | 2517 | |
---|
| 2518 | T* getPS(Int psId) |
---|
| 2519 | { |
---|
[1319] | 2520 | typename std::map<Int,MapData<T> >::iterator it=m_paramsetMap.find(psId); |
---|
| 2521 | return ( it == m_paramsetMap.end() ) ? NULL : (it)->second.parameterSet; |
---|
[313] | 2522 | } |
---|
| 2523 | |
---|
[1319] | 2524 | const T* getPS(Int psId) const |
---|
| 2525 | { |
---|
| 2526 | typename std::map<Int,MapData<T> >::const_iterator it=m_paramsetMap.find(psId); |
---|
| 2527 | return ( it == m_paramsetMap.end() ) ? NULL : (it)->second.parameterSet; |
---|
| 2528 | } |
---|
| 2529 | |
---|
[313] | 2530 | T* getFirstPS() |
---|
| 2531 | { |
---|
[1235] | 2532 | return (m_paramsetMap.begin() == m_paramsetMap.end() ) ? NULL : m_paramsetMap.begin()->second.parameterSet; |
---|
[313] | 2533 | } |
---|
| 2534 | |
---|
| 2535 | private: |
---|
[1235] | 2536 | std::map<Int,MapData<T> > m_paramsetMap; |
---|
| 2537 | Int m_maxId; |
---|
[313] | 2538 | }; |
---|
| 2539 | |
---|
| 2540 | class ParameterSetManager |
---|
| 2541 | { |
---|
| 2542 | public: |
---|
[1235] | 2543 | ParameterSetManager(); |
---|
| 2544 | virtual ~ParameterSetManager(); |
---|
[313] | 2545 | |
---|
[1029] | 2546 | //! store sequence parameter set and take ownership of it |
---|
[1319] | 2547 | Void storeVPS(TComVPS *vps, const std::vector<UChar> &naluData) { m_vpsMap.storePS( vps->getVPSId(), vps, naluData); }; |
---|
[1029] | 2548 | //! get pointer to existing video parameter set |
---|
[1235] | 2549 | TComVPS* getVPS(Int vpsId) { return m_vpsMap.getPS(vpsId); }; |
---|
| 2550 | Bool getVPSChangedFlag(Int vpsId) const { return m_vpsMap.getChangedFlag(vpsId); } |
---|
| 2551 | Void clearVPSChangedFlag(Int vpsId) { m_vpsMap.clearChangedFlag(vpsId); } |
---|
| 2552 | TComVPS* getFirstVPS() { return m_vpsMap.getFirstPS(); }; |
---|
[1029] | 2553 | |
---|
| 2554 | //! store sequence parameter set and take ownership of it |
---|
[1319] | 2555 | Void storeSPS(TComSPS *sps, const std::vector<UChar> &naluData) { m_spsMap.storePS( sps->getSPSId(), sps, naluData); }; |
---|
[1029] | 2556 | //! get pointer to existing sequence parameter set |
---|
[1235] | 2557 | TComSPS* getSPS(Int spsId) { return m_spsMap.getPS(spsId); }; |
---|
| 2558 | Bool getSPSChangedFlag(Int spsId) const { return m_spsMap.getChangedFlag(spsId); } |
---|
| 2559 | Void clearSPSChangedFlag(Int spsId) { m_spsMap.clearChangedFlag(spsId); } |
---|
| 2560 | TComSPS* getFirstSPS() { return m_spsMap.getFirstPS(); }; |
---|
[313] | 2561 | |
---|
[1029] | 2562 | //! store picture parameter set and take ownership of it |
---|
[1319] | 2563 | Void storePPS(TComPPS *pps, const std::vector<UChar> &naluData) { m_ppsMap.storePS( pps->getPPSId(), pps, naluData); }; |
---|
[1029] | 2564 | //! get pointer to existing picture parameter set |
---|
[1235] | 2565 | TComPPS* getPPS(Int ppsId) { return m_ppsMap.getPS(ppsId); }; |
---|
| 2566 | Bool getPPSChangedFlag(Int ppsId) const { return m_ppsMap.getChangedFlag(ppsId); } |
---|
| 2567 | Void clearPPSChangedFlag(Int ppsId) { m_ppsMap.clearChangedFlag(ppsId); } |
---|
| 2568 | TComPPS* getFirstPPS() { return m_ppsMap.getFirstPS(); }; |
---|
[313] | 2569 | |
---|
| 2570 | //! activate a SPS from a active parameter sets SEI message |
---|
| 2571 | //! \returns true, if activation is successful |
---|
[1319] | 2572 | // Bool activateSPSWithSEI(Int SPSId); |
---|
[313] | 2573 | |
---|
| 2574 | //! activate a PPS and depending on isIDR parameter also SPS and VPS |
---|
| 2575 | //! \returns true, if activation is successful |
---|
[1235] | 2576 | Bool activatePPS(Int ppsId, Bool isIRAP); |
---|
[313] | 2577 | |
---|
[1319] | 2578 | const TComVPS* getActiveVPS()const { return m_vpsMap.getPS(m_activeVPSId); }; |
---|
| 2579 | const TComSPS* getActiveSPS()const { return m_spsMap.getPS(m_activeSPSId); }; |
---|
[313] | 2580 | |
---|
[1235] | 2581 | #if SVC_EXTENSION |
---|
[1319] | 2582 | const TComPPS* getActivePPS()const { return m_ppsMap.getPS(m_activePPSId); }; |
---|
[1235] | 2583 | #endif |
---|
| 2584 | |
---|
[313] | 2585 | protected: |
---|
| 2586 | |
---|
| 2587 | #if SVC_EXTENSION |
---|
| 2588 | static ParameterSetMap<TComVPS> m_vpsMap; |
---|
[834] | 2589 | static ParameterSetMap<TComSPS> m_spsMap; |
---|
| 2590 | static ParameterSetMap<TComPPS> m_ppsMap; |
---|
[1235] | 2591 | |
---|
[1319] | 2592 | Int m_activePPSId; |
---|
| 2593 | static Int m_activeVPSId; // -1 for nothing active; |
---|
[313] | 2594 | #else |
---|
| 2595 | ParameterSetMap<TComVPS> m_vpsMap; |
---|
[1029] | 2596 | ParameterSetMap<TComSPS> m_spsMap; |
---|
[313] | 2597 | ParameterSetMap<TComPPS> m_ppsMap; |
---|
[1235] | 2598 | |
---|
[1319] | 2599 | Int m_activeVPSId; // -1 for nothing active |
---|
[834] | 2600 | #endif |
---|
[313] | 2601 | |
---|
[1319] | 2602 | Int m_activeSPSId; // -1 for nothing active |
---|
[313] | 2603 | }; |
---|
| 2604 | |
---|
| 2605 | //! \} |
---|
| 2606 | |
---|
| 2607 | #endif // __TCOMSLICE__ |
---|