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