[5] | 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 |
---|
[56] | 4 | * granted under this license. |
---|
[5] | 5 | * |
---|
[872] | 6 | * Copyright (c) 2010-2014, ITU/ISO/IEC |
---|
[5] | 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. |
---|
[56] | 17 | * * Neither the name of the ITU/ISO/IEC nor the names of its contributors may |
---|
[5] | 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 | */ |
---|
[2] | 33 | |
---|
| 34 | /** \file TComSlice.h |
---|
| 35 | \brief slice header and SPS class (header) |
---|
| 36 | */ |
---|
| 37 | |
---|
| 38 | #ifndef __TCOMSLICE__ |
---|
| 39 | #define __TCOMSLICE__ |
---|
| 40 | |
---|
[56] | 41 | #include <cstring> |
---|
| 42 | #include <map> |
---|
| 43 | #include <vector> |
---|
[2] | 44 | #include "CommonDef.h" |
---|
[56] | 45 | #include "TComRom.h" |
---|
[2] | 46 | #include "TComList.h" |
---|
| 47 | |
---|
[56] | 48 | //! \ingroup TLibCommon |
---|
| 49 | //! \{ |
---|
| 50 | |
---|
[2] | 51 | class TComPic; |
---|
[56] | 52 | class TComTrQuant; |
---|
[608] | 53 | #if H_MV |
---|
| 54 | class TComPicLists; |
---|
[773] | 55 | class TComVPS; |
---|
[964] | 56 | class TComSPS; |
---|
[5] | 57 | #endif |
---|
[56] | 58 | // ==================================================================================================================== |
---|
| 59 | // Constants |
---|
| 60 | // ==================================================================================================================== |
---|
[2] | 61 | |
---|
| 62 | // ==================================================================================================================== |
---|
| 63 | // Class definition |
---|
| 64 | // ==================================================================================================================== |
---|
| 65 | |
---|
[56] | 66 | /// Reference Picture Set class |
---|
| 67 | class TComReferencePictureSet |
---|
| 68 | { |
---|
| 69 | private: |
---|
| 70 | Int m_numberOfPictures; |
---|
| 71 | Int m_numberOfNegativePictures; |
---|
| 72 | Int m_numberOfPositivePictures; |
---|
| 73 | Int m_numberOfLongtermPictures; |
---|
| 74 | Int m_deltaPOC[MAX_NUM_REF_PICS]; |
---|
| 75 | Int m_POC[MAX_NUM_REF_PICS]; |
---|
| 76 | Bool m_used[MAX_NUM_REF_PICS]; |
---|
| 77 | Bool m_interRPSPrediction; |
---|
| 78 | Int m_deltaRIdxMinus1; |
---|
| 79 | Int m_deltaRPS; |
---|
| 80 | Int m_numRefIdc; |
---|
| 81 | Int m_refIdc[MAX_NUM_REF_PICS+1]; |
---|
[608] | 82 | Bool m_bCheckLTMSB[MAX_NUM_REF_PICS]; |
---|
| 83 | Int m_pocLSBLT[MAX_NUM_REF_PICS]; |
---|
| 84 | Int m_deltaPOCMSBCycleLT[MAX_NUM_REF_PICS]; |
---|
| 85 | Bool m_deltaPocMSBPresentFlag[MAX_NUM_REF_PICS]; |
---|
[56] | 86 | |
---|
| 87 | public: |
---|
| 88 | TComReferencePictureSet(); |
---|
| 89 | virtual ~TComReferencePictureSet(); |
---|
[608] | 90 | Int getPocLSBLT(Int i) { return m_pocLSBLT[i]; } |
---|
| 91 | Void setPocLSBLT(Int i, Int x) { m_pocLSBLT[i] = x; } |
---|
| 92 | Int getDeltaPocMSBCycleLT(Int i) { return m_deltaPOCMSBCycleLT[i]; } |
---|
| 93 | Void setDeltaPocMSBCycleLT(Int i, Int x) { m_deltaPOCMSBCycleLT[i] = x; } |
---|
| 94 | Bool getDeltaPocMSBPresentFlag(Int i) { return m_deltaPocMSBPresentFlag[i]; } |
---|
| 95 | Void setDeltaPocMSBPresentFlag(Int i, Bool x) { m_deltaPocMSBPresentFlag[i] = x; } |
---|
| 96 | Void setUsed(Int bufferNum, Bool used); |
---|
| 97 | Void setDeltaPOC(Int bufferNum, Int deltaPOC); |
---|
| 98 | Void setPOC(Int bufferNum, Int deltaPOC); |
---|
| 99 | Void setNumberOfPictures(Int numberOfPictures); |
---|
| 100 | Void setCheckLTMSBPresent(Int bufferNum, Bool b ); |
---|
| 101 | Bool getCheckLTMSBPresent(Int bufferNum); |
---|
[56] | 102 | |
---|
[608] | 103 | Int getUsed(Int bufferNum); |
---|
| 104 | Int getDeltaPOC(Int bufferNum); |
---|
| 105 | Int getPOC(Int bufferNum); |
---|
[56] | 106 | Int getNumberOfPictures(); |
---|
[608] | 107 | |
---|
[56] | 108 | Void setNumberOfNegativePictures(Int number) { m_numberOfNegativePictures = number; } |
---|
| 109 | Int getNumberOfNegativePictures() { return m_numberOfNegativePictures; } |
---|
| 110 | Void setNumberOfPositivePictures(Int number) { m_numberOfPositivePictures = number; } |
---|
| 111 | Int getNumberOfPositivePictures() { return m_numberOfPositivePictures; } |
---|
| 112 | Void setNumberOfLongtermPictures(Int number) { m_numberOfLongtermPictures = number; } |
---|
| 113 | Int getNumberOfLongtermPictures() { return m_numberOfLongtermPictures; } |
---|
| 114 | |
---|
| 115 | Void setInterRPSPrediction(Bool flag) { m_interRPSPrediction = flag; } |
---|
| 116 | Bool getInterRPSPrediction() { return m_interRPSPrediction; } |
---|
| 117 | Void setDeltaRIdxMinus1(Int x) { m_deltaRIdxMinus1 = x; } |
---|
| 118 | Int getDeltaRIdxMinus1() { return m_deltaRIdxMinus1; } |
---|
| 119 | Void setDeltaRPS(Int x) { m_deltaRPS = x; } |
---|
| 120 | Int getDeltaRPS() { return m_deltaRPS; } |
---|
| 121 | Void setNumRefIdc(Int x) { m_numRefIdc = x; } |
---|
| 122 | Int getNumRefIdc() { return m_numRefIdc; } |
---|
| 123 | |
---|
| 124 | Void setRefIdc(Int bufferNum, Int refIdc); |
---|
| 125 | Int getRefIdc(Int bufferNum); |
---|
| 126 | |
---|
| 127 | Void sortDeltaPOC(); |
---|
| 128 | Void printDeltaPOC(); |
---|
[964] | 129 | |
---|
[976] | 130 | #if H_MV |
---|
| 131 | Void checkMaxNumPics( Bool vpsExtensionFlag, Int maxNumPics, Int nuhLayerId, Int spsMaxDecPicBufferingMinus1 ); |
---|
[964] | 132 | #endif |
---|
[56] | 133 | }; |
---|
| 134 | |
---|
| 135 | /// Reference Picture Set set class |
---|
| 136 | class TComRPSList |
---|
| 137 | { |
---|
| 138 | private: |
---|
| 139 | Int m_numberOfReferencePictureSets; |
---|
| 140 | TComReferencePictureSet* m_referencePictureSets; |
---|
| 141 | |
---|
| 142 | public: |
---|
| 143 | TComRPSList(); |
---|
| 144 | virtual ~TComRPSList(); |
---|
| 145 | |
---|
| 146 | Void create (Int numberOfEntries); |
---|
| 147 | Void destroy (); |
---|
| 148 | |
---|
| 149 | |
---|
| 150 | TComReferencePictureSet* getReferencePictureSet(Int referencePictureSetNum); |
---|
| 151 | Int getNumberOfReferencePictureSets(); |
---|
| 152 | Void setNumberOfReferencePictureSets(Int numberOfReferencePictureSets); |
---|
| 153 | }; |
---|
| 154 | |
---|
[608] | 155 | /// SCALING_LIST class |
---|
| 156 | class TComScalingList |
---|
| 157 | { |
---|
| 158 | public: |
---|
| 159 | TComScalingList(); |
---|
| 160 | virtual ~TComScalingList(); |
---|
| 161 | Void setScalingListPresentFlag (Bool b) { m_scalingListPresentFlag = b; } |
---|
| 162 | Bool getScalingListPresentFlag () { return m_scalingListPresentFlag; } |
---|
| 163 | Int* getScalingListAddress (UInt sizeId, UInt listId) { return m_scalingListCoef[sizeId][listId]; } //!< get matrix coefficient |
---|
| 164 | Bool checkPredMode (UInt sizeId, UInt listId); |
---|
| 165 | Void setRefMatrixId (UInt sizeId, UInt listId, UInt u) { m_refMatrixId[sizeId][listId] = u; } //!< set reference matrix ID |
---|
| 166 | UInt getRefMatrixId (UInt sizeId, UInt listId) { return m_refMatrixId[sizeId][listId]; } //!< get reference matrix ID |
---|
| 167 | Int* getScalingListDefaultAddress (UInt sizeId, UInt listId); //!< get default matrix coefficient |
---|
[872] | 168 | Void processDefaultMatrix (UInt sizeId, UInt listId); |
---|
[608] | 169 | Void setScalingListDC (UInt sizeId, UInt listId, UInt u) { m_scalingListDC[sizeId][listId] = u; } //!< set DC value |
---|
| 170 | |
---|
| 171 | Int getScalingListDC (UInt sizeId, UInt listId) { return m_scalingListDC[sizeId][listId]; } //!< get DC value |
---|
| 172 | Void checkDcOfMatrix (); |
---|
| 173 | Void processRefMatrix (UInt sizeId, UInt listId , UInt refListId ); |
---|
| 174 | Bool xParseScalingList (Char* pchFile); |
---|
[622] | 175 | #if H_MV |
---|
| 176 | Void inferFrom ( TComScalingList* srcScLi ); |
---|
| 177 | #endif |
---|
[608] | 178 | |
---|
| 179 | private: |
---|
| 180 | Void init (); |
---|
| 181 | Void destroy (); |
---|
| 182 | Int m_scalingListDC [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< the DC value of the matrix coefficient for 16x16 |
---|
| 183 | Bool m_useDefaultScalingMatrixFlag [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< UseDefaultScalingMatrixFlag |
---|
| 184 | UInt m_refMatrixId [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< RefMatrixID |
---|
| 185 | Bool m_scalingListPresentFlag; //!< flag for using default matrix |
---|
| 186 | UInt m_predMatrixId [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< reference list index |
---|
| 187 | Int *m_scalingListCoef [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< quantization matrix |
---|
| 188 | }; |
---|
| 189 | |
---|
| 190 | class ProfileTierLevel |
---|
| 191 | { |
---|
| 192 | Int m_profileSpace; |
---|
| 193 | Bool m_tierFlag; |
---|
| 194 | Int m_profileIdc; |
---|
| 195 | Bool m_profileCompatibilityFlag[32]; |
---|
| 196 | Int m_levelIdc; |
---|
| 197 | |
---|
| 198 | Bool m_progressiveSourceFlag; |
---|
| 199 | Bool m_interlacedSourceFlag; |
---|
| 200 | Bool m_nonPackedConstraintFlag; |
---|
| 201 | Bool m_frameOnlyConstraintFlag; |
---|
| 202 | |
---|
| 203 | public: |
---|
| 204 | ProfileTierLevel(); |
---|
| 205 | |
---|
| 206 | Int getProfileSpace() const { return m_profileSpace; } |
---|
| 207 | Void setProfileSpace(Int x) { m_profileSpace = x; } |
---|
| 208 | |
---|
| 209 | Bool getTierFlag() const { return m_tierFlag; } |
---|
| 210 | Void setTierFlag(Bool x) { m_tierFlag = x; } |
---|
| 211 | |
---|
| 212 | Int getProfileIdc() const { return m_profileIdc; } |
---|
| 213 | Void setProfileIdc(Int x) { m_profileIdc = x; } |
---|
| 214 | |
---|
| 215 | Bool getProfileCompatibilityFlag(Int i) const { return m_profileCompatibilityFlag[i]; } |
---|
| 216 | Void setProfileCompatibilityFlag(Int i, Bool x) { m_profileCompatibilityFlag[i] = x; } |
---|
| 217 | |
---|
| 218 | Int getLevelIdc() const { return m_levelIdc; } |
---|
| 219 | Void setLevelIdc(Int x) { m_levelIdc = x; } |
---|
| 220 | |
---|
| 221 | Bool getProgressiveSourceFlag() const { return m_progressiveSourceFlag; } |
---|
| 222 | Void setProgressiveSourceFlag(Bool b) { m_progressiveSourceFlag = b; } |
---|
| 223 | |
---|
| 224 | Bool getInterlacedSourceFlag() const { return m_interlacedSourceFlag; } |
---|
| 225 | Void setInterlacedSourceFlag(Bool b) { m_interlacedSourceFlag = b; } |
---|
| 226 | |
---|
| 227 | Bool getNonPackedConstraintFlag() const { return m_nonPackedConstraintFlag; } |
---|
| 228 | Void setNonPackedConstraintFlag(Bool b) { m_nonPackedConstraintFlag = b; } |
---|
| 229 | |
---|
| 230 | Bool getFrameOnlyConstraintFlag() const { return m_frameOnlyConstraintFlag; } |
---|
| 231 | Void setFrameOnlyConstraintFlag(Bool b) { m_frameOnlyConstraintFlag = b; } |
---|
| 232 | }; |
---|
| 233 | |
---|
| 234 | |
---|
| 235 | class TComPTL |
---|
| 236 | { |
---|
| 237 | ProfileTierLevel m_generalPTL; |
---|
[964] | 238 | ProfileTierLevel m_subLayerPTL [MAX_TLAYER-1]; // max. value of max_sub_layers_minus1 is MAX_TLAYER-1 (= 6) |
---|
| 239 | Bool m_subLayerProfilePresentFlag [MAX_TLAYER-1]; |
---|
| 240 | Bool m_subLayerLevelPresentFlag [MAX_TLAYER-1]; |
---|
[608] | 241 | |
---|
| 242 | public: |
---|
| 243 | TComPTL(); |
---|
| 244 | Bool getSubLayerProfilePresentFlag(Int i) const { return m_subLayerProfilePresentFlag[i]; } |
---|
| 245 | Void setSubLayerProfilePresentFlag(Int i, Bool x) { m_subLayerProfilePresentFlag[i] = x; } |
---|
| 246 | |
---|
| 247 | Bool getSubLayerLevelPresentFlag(Int i) const { return m_subLayerLevelPresentFlag[i]; } |
---|
| 248 | Void setSubLayerLevelPresentFlag(Int i, Bool x) { m_subLayerLevelPresentFlag[i] = x; } |
---|
| 249 | |
---|
| 250 | ProfileTierLevel* getGeneralPTL() { return &m_generalPTL; } |
---|
| 251 | ProfileTierLevel* getSubLayerPTL(Int i) { return &m_subLayerPTL[i]; } |
---|
| 252 | #if H_MV |
---|
| 253 | Void copyLevelFrom( TComPTL* source ); |
---|
| 254 | #endif |
---|
| 255 | }; |
---|
[77] | 256 | /// VPS class |
---|
| 257 | |
---|
[608] | 258 | struct HrdSubLayerInfo |
---|
| 259 | { |
---|
| 260 | Bool fixedPicRateFlag; |
---|
| 261 | Bool fixedPicRateWithinCvsFlag; |
---|
| 262 | UInt picDurationInTcMinus1; |
---|
| 263 | Bool lowDelayHrdFlag; |
---|
| 264 | UInt cpbCntMinus1; |
---|
| 265 | UInt bitRateValueMinus1[MAX_CPB_CNT][2]; |
---|
| 266 | UInt cpbSizeValue [MAX_CPB_CNT][2]; |
---|
| 267 | UInt ducpbSizeValue [MAX_CPB_CNT][2]; |
---|
| 268 | UInt cbrFlag [MAX_CPB_CNT][2]; |
---|
| 269 | UInt duBitRateValue [MAX_CPB_CNT][2]; |
---|
| 270 | }; |
---|
| 271 | |
---|
| 272 | class TComHRD |
---|
| 273 | { |
---|
| 274 | private: |
---|
| 275 | Bool m_nalHrdParametersPresentFlag; |
---|
| 276 | Bool m_vclHrdParametersPresentFlag; |
---|
| 277 | Bool m_subPicCpbParamsPresentFlag; |
---|
| 278 | UInt m_tickDivisorMinus2; |
---|
| 279 | UInt m_duCpbRemovalDelayLengthMinus1; |
---|
| 280 | Bool m_subPicCpbParamsInPicTimingSEIFlag; |
---|
| 281 | UInt m_dpbOutputDelayDuLengthMinus1; |
---|
| 282 | UInt m_bitRateScale; |
---|
| 283 | UInt m_cpbSizeScale; |
---|
| 284 | UInt m_ducpbSizeScale; |
---|
| 285 | UInt m_initialCpbRemovalDelayLengthMinus1; |
---|
| 286 | UInt m_cpbRemovalDelayLengthMinus1; |
---|
| 287 | UInt m_dpbOutputDelayLengthMinus1; |
---|
| 288 | UInt m_numDU; |
---|
| 289 | HrdSubLayerInfo m_HRD[MAX_TLAYER]; |
---|
| 290 | |
---|
| 291 | public: |
---|
| 292 | TComHRD() |
---|
| 293 | :m_nalHrdParametersPresentFlag(0) |
---|
| 294 | ,m_vclHrdParametersPresentFlag(0) |
---|
| 295 | ,m_subPicCpbParamsPresentFlag(false) |
---|
| 296 | ,m_tickDivisorMinus2(0) |
---|
| 297 | ,m_duCpbRemovalDelayLengthMinus1(0) |
---|
| 298 | ,m_subPicCpbParamsInPicTimingSEIFlag(false) |
---|
| 299 | ,m_dpbOutputDelayDuLengthMinus1(0) |
---|
| 300 | ,m_bitRateScale(0) |
---|
| 301 | ,m_cpbSizeScale(0) |
---|
| 302 | ,m_initialCpbRemovalDelayLengthMinus1(0) |
---|
| 303 | ,m_cpbRemovalDelayLengthMinus1(0) |
---|
| 304 | ,m_dpbOutputDelayLengthMinus1(0) |
---|
| 305 | {} |
---|
| 306 | |
---|
| 307 | virtual ~TComHRD() {} |
---|
| 308 | |
---|
| 309 | Void setNalHrdParametersPresentFlag ( Bool flag ) { m_nalHrdParametersPresentFlag = flag; } |
---|
| 310 | Bool getNalHrdParametersPresentFlag ( ) { return m_nalHrdParametersPresentFlag; } |
---|
| 311 | |
---|
| 312 | Void setVclHrdParametersPresentFlag ( Bool flag ) { m_vclHrdParametersPresentFlag = flag; } |
---|
| 313 | Bool getVclHrdParametersPresentFlag ( ) { return m_vclHrdParametersPresentFlag; } |
---|
| 314 | |
---|
| 315 | Void setSubPicCpbParamsPresentFlag ( Bool flag ) { m_subPicCpbParamsPresentFlag = flag; } |
---|
| 316 | Bool getSubPicCpbParamsPresentFlag ( ) { return m_subPicCpbParamsPresentFlag; } |
---|
| 317 | |
---|
| 318 | Void setTickDivisorMinus2 ( UInt value ) { m_tickDivisorMinus2 = value; } |
---|
| 319 | UInt getTickDivisorMinus2 ( ) { return m_tickDivisorMinus2; } |
---|
| 320 | |
---|
| 321 | Void setDuCpbRemovalDelayLengthMinus1 ( UInt value ) { m_duCpbRemovalDelayLengthMinus1 = value; } |
---|
| 322 | UInt getDuCpbRemovalDelayLengthMinus1 ( ) { return m_duCpbRemovalDelayLengthMinus1; } |
---|
| 323 | |
---|
| 324 | Void setSubPicCpbParamsInPicTimingSEIFlag ( Bool flag) { m_subPicCpbParamsInPicTimingSEIFlag = flag; } |
---|
| 325 | Bool getSubPicCpbParamsInPicTimingSEIFlag () { return m_subPicCpbParamsInPicTimingSEIFlag; } |
---|
| 326 | |
---|
| 327 | Void setDpbOutputDelayDuLengthMinus1 (UInt value ) { m_dpbOutputDelayDuLengthMinus1 = value; } |
---|
| 328 | UInt getDpbOutputDelayDuLengthMinus1 () { return m_dpbOutputDelayDuLengthMinus1; } |
---|
| 329 | |
---|
| 330 | Void setBitRateScale ( UInt value ) { m_bitRateScale = value; } |
---|
| 331 | UInt getBitRateScale ( ) { return m_bitRateScale; } |
---|
| 332 | |
---|
| 333 | Void setCpbSizeScale ( UInt value ) { m_cpbSizeScale = value; } |
---|
| 334 | UInt getCpbSizeScale ( ) { return m_cpbSizeScale; } |
---|
| 335 | Void setDuCpbSizeScale ( UInt value ) { m_ducpbSizeScale = value; } |
---|
| 336 | UInt getDuCpbSizeScale ( ) { return m_ducpbSizeScale; } |
---|
| 337 | |
---|
| 338 | Void setInitialCpbRemovalDelayLengthMinus1( UInt value ) { m_initialCpbRemovalDelayLengthMinus1 = value; } |
---|
| 339 | UInt getInitialCpbRemovalDelayLengthMinus1( ) { return m_initialCpbRemovalDelayLengthMinus1; } |
---|
| 340 | |
---|
| 341 | Void setCpbRemovalDelayLengthMinus1 ( UInt value ) { m_cpbRemovalDelayLengthMinus1 = value; } |
---|
| 342 | UInt getCpbRemovalDelayLengthMinus1 ( ) { return m_cpbRemovalDelayLengthMinus1; } |
---|
| 343 | |
---|
| 344 | Void setDpbOutputDelayLengthMinus1 ( UInt value ) { m_dpbOutputDelayLengthMinus1 = value; } |
---|
| 345 | UInt getDpbOutputDelayLengthMinus1 ( ) { return m_dpbOutputDelayLengthMinus1; } |
---|
| 346 | |
---|
| 347 | Void setFixedPicRateFlag ( Int layer, Bool flag ) { m_HRD[layer].fixedPicRateFlag = flag; } |
---|
| 348 | Bool getFixedPicRateFlag ( Int layer ) { return m_HRD[layer].fixedPicRateFlag; } |
---|
| 349 | |
---|
| 350 | Void setFixedPicRateWithinCvsFlag ( Int layer, Bool flag ) { m_HRD[layer].fixedPicRateWithinCvsFlag = flag; } |
---|
| 351 | Bool getFixedPicRateWithinCvsFlag ( Int layer ) { return m_HRD[layer].fixedPicRateWithinCvsFlag; } |
---|
| 352 | |
---|
| 353 | Void setPicDurationInTcMinus1 ( Int layer, UInt value ) { m_HRD[layer].picDurationInTcMinus1 = value; } |
---|
| 354 | UInt getPicDurationInTcMinus1 ( Int layer ) { return m_HRD[layer].picDurationInTcMinus1; } |
---|
| 355 | |
---|
| 356 | Void setLowDelayHrdFlag ( Int layer, Bool flag ) { m_HRD[layer].lowDelayHrdFlag = flag; } |
---|
| 357 | Bool getLowDelayHrdFlag ( Int layer ) { return m_HRD[layer].lowDelayHrdFlag; } |
---|
| 358 | |
---|
| 359 | Void setCpbCntMinus1 ( Int layer, UInt value ) { m_HRD[layer].cpbCntMinus1 = value; } |
---|
| 360 | UInt getCpbCntMinus1 ( Int layer ) { return m_HRD[layer].cpbCntMinus1; } |
---|
| 361 | |
---|
| 362 | Void setBitRateValueMinus1 ( Int layer, Int cpbcnt, Int nalOrVcl, UInt value ) { m_HRD[layer].bitRateValueMinus1[cpbcnt][nalOrVcl] = value; } |
---|
| 363 | UInt getBitRateValueMinus1 ( Int layer, Int cpbcnt, Int nalOrVcl ) { return m_HRD[layer].bitRateValueMinus1[cpbcnt][nalOrVcl]; } |
---|
| 364 | |
---|
| 365 | Void setCpbSizeValueMinus1 ( Int layer, Int cpbcnt, Int nalOrVcl, UInt value ) { m_HRD[layer].cpbSizeValue[cpbcnt][nalOrVcl] = value; } |
---|
| 366 | UInt getCpbSizeValueMinus1 ( Int layer, Int cpbcnt, Int nalOrVcl ) { return m_HRD[layer].cpbSizeValue[cpbcnt][nalOrVcl]; } |
---|
| 367 | Void setDuCpbSizeValueMinus1 ( Int layer, Int cpbcnt, Int nalOrVcl, UInt value ) { m_HRD[layer].ducpbSizeValue[cpbcnt][nalOrVcl] = value; } |
---|
| 368 | UInt getDuCpbSizeValueMinus1 ( Int layer, Int cpbcnt, Int nalOrVcl ) { return m_HRD[layer].ducpbSizeValue[cpbcnt][nalOrVcl]; } |
---|
| 369 | Void setDuBitRateValueMinus1 ( Int layer, Int cpbcnt, Int nalOrVcl, UInt value ) { m_HRD[layer].duBitRateValue[cpbcnt][nalOrVcl] = value; } |
---|
| 370 | UInt getDuBitRateValueMinus1 (Int layer, Int cpbcnt, Int nalOrVcl ) { return m_HRD[layer].duBitRateValue[cpbcnt][nalOrVcl]; } |
---|
| 371 | Void setCbrFlag ( Int layer, Int cpbcnt, Int nalOrVcl, UInt value ) { m_HRD[layer].cbrFlag[cpbcnt][nalOrVcl] = value; } |
---|
| 372 | Bool getCbrFlag ( Int layer, Int cpbcnt, Int nalOrVcl ) { return m_HRD[layer].cbrFlag[cpbcnt][nalOrVcl]; } |
---|
| 373 | |
---|
| 374 | Void setNumDU ( UInt value ) { m_numDU = value; } |
---|
| 375 | UInt getNumDU ( ) { return m_numDU; } |
---|
| 376 | Bool getCpbDpbDelaysPresentFlag() { return getNalHrdParametersPresentFlag() || getVclHrdParametersPresentFlag(); } |
---|
| 377 | }; |
---|
| 378 | |
---|
| 379 | class TimingInfo |
---|
| 380 | { |
---|
| 381 | Bool m_timingInfoPresentFlag; |
---|
| 382 | UInt m_numUnitsInTick; |
---|
| 383 | UInt m_timeScale; |
---|
| 384 | Bool m_pocProportionalToTimingFlag; |
---|
| 385 | Int m_numTicksPocDiffOneMinus1; |
---|
| 386 | public: |
---|
| 387 | TimingInfo() |
---|
| 388 | : m_timingInfoPresentFlag(false) |
---|
| 389 | , m_numUnitsInTick(1001) |
---|
| 390 | , m_timeScale(60000) |
---|
| 391 | , m_pocProportionalToTimingFlag(false) |
---|
| 392 | , m_numTicksPocDiffOneMinus1(0) {} |
---|
| 393 | |
---|
| 394 | Void setTimingInfoPresentFlag ( Bool flag ) { m_timingInfoPresentFlag = flag; } |
---|
| 395 | Bool getTimingInfoPresentFlag ( ) { return m_timingInfoPresentFlag; } |
---|
| 396 | |
---|
| 397 | Void setNumUnitsInTick ( UInt value ) { m_numUnitsInTick = value; } |
---|
| 398 | UInt getNumUnitsInTick ( ) { return m_numUnitsInTick; } |
---|
| 399 | |
---|
| 400 | Void setTimeScale ( UInt value ) { m_timeScale = value; } |
---|
| 401 | UInt getTimeScale ( ) { return m_timeScale; } |
---|
| 402 | |
---|
| 403 | Bool getPocProportionalToTimingFlag ( ) { return m_pocProportionalToTimingFlag; } |
---|
| 404 | Void setPocProportionalToTimingFlag (Bool x ) { m_pocProportionalToTimingFlag = x; } |
---|
| 405 | |
---|
| 406 | Int getNumTicksPocDiffOneMinus1 ( ) { return m_numTicksPocDiffOneMinus1; } |
---|
| 407 | Void setNumTicksPocDiffOneMinus1 (Int x ) { m_numTicksPocDiffOneMinus1 = x; } |
---|
| 408 | }; |
---|
| 409 | |
---|
[622] | 410 | #if H_MV |
---|
[738] | 411 | |
---|
| 412 | class TComVideoSignalInfo |
---|
| 413 | { |
---|
| 414 | private: |
---|
| 415 | Int m_videoVpsFormat; |
---|
| 416 | Bool m_videoFullRangeVpsFlag; |
---|
| 417 | Int m_colourPrimariesVps; |
---|
| 418 | Int m_transferCharacteristicsVps; |
---|
| 419 | Int m_matrixCoeffsVps; |
---|
| 420 | public: |
---|
| 421 | Void setVideoVpsFormat( Int val ) { m_videoVpsFormat = val; } |
---|
| 422 | Int getVideoVpsFormat( ) { return m_videoVpsFormat; } |
---|
| 423 | |
---|
| 424 | Void setVideoFullRangeVpsFlag( Bool flag ) { m_videoFullRangeVpsFlag = flag; } |
---|
| 425 | Bool getVideoFullRangeVpsFlag( ) { return m_videoFullRangeVpsFlag; } |
---|
| 426 | |
---|
| 427 | Void setColourPrimariesVps( Int val ) { m_colourPrimariesVps = val; } |
---|
| 428 | Int getColourPrimariesVps( ) { return m_colourPrimariesVps; } |
---|
| 429 | |
---|
| 430 | Void setTransferCharacteristicsVps( Int val ) { m_transferCharacteristicsVps = val; } |
---|
| 431 | Int getTransferCharacteristicsVps( ) { return m_transferCharacteristicsVps; } |
---|
| 432 | |
---|
| 433 | Void setMatrixCoeffsVps( Int val ) { m_matrixCoeffsVps = val; } |
---|
| 434 | Int getMatrixCoeffsVps( ) { return m_matrixCoeffsVps; } |
---|
| 435 | }; |
---|
| 436 | class TComVpsVuiBspHrdParameters |
---|
| 437 | { |
---|
| 438 | private: |
---|
| 439 | Int m_vpsNumBspHrdParametersMinus1; |
---|
| 440 | Bool m_bspCprmsPresentFlag[MAX_NUM_BSP_HRD_PARAMETERS]; |
---|
| 441 | Int m_numBitstreamPartitions[MAX_VPS_OP_SETS_PLUS1]; |
---|
| 442 | Bool m_layerInBspFlag[MAX_VPS_OP_SETS_PLUS1][MAX_NUM_BSP_HRD_PARAMETERS][MAX_NUM_LAYERS]; |
---|
[964] | 443 | Int m_numBspSchedCombinationsMinus1[MAX_VPS_OP_SETS_PLUS1]; |
---|
[738] | 444 | Int m_bspCombHrdIdx[MAX_VPS_OP_SETS_PLUS1][MAX_NUM_BSP_HRD_PARAMETERS][MAX_NUM_BSP_SCHED_COMBINATION]; |
---|
| 445 | Int m_bspCombSchedIdx[MAX_VPS_OP_SETS_PLUS1][MAX_NUM_BSP_HRD_PARAMETERS][MAX_NUM_BSP_SCHED_COMBINATION]; |
---|
| 446 | TComHRD* m_hrdParameters[MAX_NUM_BSP_HRD_PARAMETERS]; |
---|
| 447 | public: |
---|
| 448 | |
---|
| 449 | Void setVpsNumBspHrdParametersMinus1( Int val ) { m_vpsNumBspHrdParametersMinus1 = val; } |
---|
| 450 | Int getVpsNumBspHrdParametersMinus1( ) { return m_vpsNumBspHrdParametersMinus1; } |
---|
| 451 | |
---|
| 452 | Void setBspCprmsPresentFlag( Int i, Bool flag ) { m_bspCprmsPresentFlag[i] = flag; } |
---|
| 453 | Bool getBspCprmsPresentFlag( Int i ) { return m_bspCprmsPresentFlag[i]; } |
---|
| 454 | |
---|
| 455 | Void setNumBitstreamPartitions( Int h, Int val ) { m_numBitstreamPartitions[h] = val; } |
---|
| 456 | Int getNumBitstreamPartitions( Int h ) { return m_numBitstreamPartitions[h]; } |
---|
| 457 | |
---|
| 458 | Void setLayerInBspFlag( Int h, Int i, Int j, Bool flag ) { m_layerInBspFlag[h][i][j] = flag; } |
---|
| 459 | Bool getLayerInBspFlag( Int h, Int i, Int j ) { return m_layerInBspFlag[h][i][j]; } |
---|
| 460 | Void checkLayerInBspFlag ( TComVPS* vps, Int h ); |
---|
| 461 | |
---|
[964] | 462 | Void setNumBspSchedCombinationsMinus1( Int h, Int val ) { m_numBspSchedCombinationsMinus1[h] = val; } |
---|
| 463 | Int getNumBspSchedCombinationsMinus1( Int h ) { return m_numBspSchedCombinationsMinus1[h]; } |
---|
[738] | 464 | |
---|
| 465 | Void setBspCombHrdIdx( Int h, Int i, Int j, Int val ) { m_bspCombHrdIdx[h][i][j] = val; } |
---|
| 466 | Int getBspCombHrdIdx( Int h, Int i, Int j ) { return m_bspCombHrdIdx[h][i][j]; } |
---|
[964] | 467 | Int getBspCombHrdIdxLen() { return gCeilLog2( getVpsNumBspHrdParametersMinus1() + 1); }; |
---|
[738] | 468 | |
---|
[964] | 469 | |
---|
[738] | 470 | Void setBspCombSchedIdx( Int h, Int i, Int j, Int val ) { m_bspCombSchedIdx[h][i][j] = val; } |
---|
| 471 | Int getBspCombSchedIdx( Int h, Int i, Int j ) { return m_bspCombSchedIdx[h][i][j]; } |
---|
| 472 | |
---|
[976] | 473 | Void checkBspCombHrdAndShedIdx( TComVPS* vps, Int h, Int i, Int j ); |
---|
| 474 | |
---|
[738] | 475 | Void setHrdParametermeters( Int k, TComHRD* val ) { m_hrdParameters[k] = val; }; |
---|
| 476 | TComHRD* getHrdParametermeters( Int k ) { return m_hrdParameters[k]; }; |
---|
| 477 | }; |
---|
| 478 | |
---|
[622] | 479 | class TComVPSVUI |
---|
| 480 | { |
---|
| 481 | private: |
---|
[738] | 482 | Bool m_crossLayerPicTypeAlignedFlag; |
---|
| 483 | Bool m_crossLayerIrapAlignedFlag; |
---|
[872] | 484 | Bool m_allLayersIdrAlignedFlag; |
---|
[622] | 485 | Bool m_bitRatePresentVpsFlag; |
---|
| 486 | Bool m_picRatePresentVpsFlag; |
---|
| 487 | Bool m_bitRatePresentFlag [MAX_VPS_OP_SETS_PLUS1][MAX_TLAYER]; |
---|
| 488 | Bool m_picRatePresentFlag [MAX_VPS_OP_SETS_PLUS1][MAX_TLAYER]; |
---|
| 489 | Int m_avgBitRate [MAX_VPS_OP_SETS_PLUS1][MAX_TLAYER]; |
---|
| 490 | Int m_maxBitRate [MAX_VPS_OP_SETS_PLUS1][MAX_TLAYER]; |
---|
| 491 | Int m_constantPicRateIdc [MAX_VPS_OP_SETS_PLUS1][MAX_TLAYER]; |
---|
| 492 | Int m_avgPicRate [MAX_VPS_OP_SETS_PLUS1][MAX_TLAYER]; |
---|
[872] | 493 | Bool m_videoSignalInfoIdxPresentFlag; |
---|
| 494 | Int m_vpsNumVideoSignalInfoMinus1; |
---|
| 495 | TComVideoSignalInfo* m_videoSignalInfo[MAX_NUM_VIDEO_SIGNAL_INFO]; |
---|
| 496 | Int m_vpsVideoSignalInfoIdx [MAX_NUM_VIDEO_SIGNAL_INFO]; |
---|
[738] | 497 | Bool m_tilesNotInUseFlag; |
---|
| 498 | Bool m_tilesInUseFlag [MAX_NUM_LAYERS]; |
---|
| 499 | Bool m_loopFilterNotAcrossTilesFlag[MAX_NUM_LAYERS]; |
---|
[622] | 500 | Bool m_tileBoundariesAlignedFlag [MAX_NUM_LAYERS][MAX_NUM_LAYERS]; |
---|
[738] | 501 | Bool m_wppNotInUseFlag; |
---|
| 502 | Bool m_wppInUseFlag [MAX_NUM_LAYERS]; |
---|
[622] | 503 | Bool m_ilpRestrictedRefLayersFlag; |
---|
| 504 | Int m_minSpatialSegmentOffsetPlus1[MAX_NUM_LAYERS][MAX_NUM_LAYERS]; |
---|
| 505 | Bool m_ctuBasedOffsetEnabledFlag [MAX_NUM_LAYERS][MAX_NUM_LAYERS]; |
---|
| 506 | Int m_minHorizontalCtuOffsetPlus1 [MAX_NUM_LAYERS][MAX_NUM_LAYERS]; |
---|
[738] | 507 | Bool m_vpsVuiBspHrdPresentFlag; |
---|
| 508 | TComVpsVuiBspHrdParameters* m_vpsVuiBspHrdParameters; |
---|
[872] | 509 | Bool m_baseLayerParameterSetCompatibilityFlag[MAX_NUM_LAYERS]; |
---|
[622] | 510 | |
---|
| 511 | public: |
---|
[738] | 512 | TComVPSVUI(); |
---|
| 513 | ~TComVPSVUI(); |
---|
| 514 | Void setCrossLayerPicTypeAlignedFlag( Bool flag ) { m_crossLayerPicTypeAlignedFlag = flag; } |
---|
| 515 | Bool getCrossLayerPicTypeAlignedFlag( ) { return m_crossLayerPicTypeAlignedFlag; } |
---|
[622] | 516 | |
---|
[738] | 517 | Void setCrossLayerIrapAlignedFlag( Bool flag ) { m_crossLayerIrapAlignedFlag = flag; } |
---|
| 518 | Bool getCrossLayerIrapAlignedFlag( ) { return m_crossLayerIrapAlignedFlag; } |
---|
| 519 | |
---|
[872] | 520 | Void setAllLayersIdrAlignedFlag( Bool flag ) { m_allLayersIdrAlignedFlag = flag; } |
---|
| 521 | Bool getAllLayersIdrAlignedFlag( ) { return m_allLayersIdrAlignedFlag; } |
---|
| 522 | |
---|
[622] | 523 | Void setBitRatePresentVpsFlag( Bool flag ) { m_bitRatePresentVpsFlag = flag; } |
---|
| 524 | Bool getBitRatePresentVpsFlag( ) { return m_bitRatePresentVpsFlag; } |
---|
| 525 | |
---|
| 526 | Void setPicRatePresentVpsFlag( Bool flag ) { m_picRatePresentVpsFlag = flag; } |
---|
| 527 | Bool getPicRatePresentVpsFlag( ) { return m_picRatePresentVpsFlag; } |
---|
| 528 | |
---|
| 529 | Void setBitRatePresentFlag( Int i, Int j, Bool flag ) { m_bitRatePresentFlag[i][j] = flag; } |
---|
| 530 | Bool getBitRatePresentFlag( Int i, Int j ) { return m_bitRatePresentFlag[i][j]; } |
---|
| 531 | |
---|
| 532 | Void setPicRatePresentFlag( Int i, Int j, Bool flag ) { m_picRatePresentFlag[i][j] = flag; } |
---|
| 533 | Bool getPicRatePresentFlag( Int i, Int j ) { return m_picRatePresentFlag[i][j]; } |
---|
| 534 | |
---|
| 535 | Void setAvgBitRate( Int i, Int j, Int val ) { m_avgBitRate[i][j] = val; } |
---|
| 536 | Int getAvgBitRate( Int i, Int j ) { return m_avgBitRate[i][j]; } |
---|
| 537 | |
---|
| 538 | Void setMaxBitRate( Int i, Int j, Int val ) { m_maxBitRate[i][j] = val; } |
---|
| 539 | Int getMaxBitRate( Int i, Int j ) { return m_maxBitRate[i][j]; } |
---|
| 540 | |
---|
| 541 | Void setConstantPicRateIdc( Int i, Int j, Int val ) { m_constantPicRateIdc[i][j] = val; } |
---|
| 542 | Int getConstantPicRateIdc( Int i, Int j ) { return m_constantPicRateIdc[i][j]; } |
---|
| 543 | |
---|
| 544 | Void setAvgPicRate( Int i, Int j, Int val ) { m_avgPicRate[i][j] = val; } |
---|
| 545 | Int getAvgPicRate( Int i, Int j ) { return m_avgPicRate[i][j]; } |
---|
| 546 | |
---|
[872] | 547 | Void setVideoSignalInfoIdxPresentFlag( Bool flag ) { m_videoSignalInfoIdxPresentFlag = flag; } |
---|
| 548 | Bool getVideoSignalInfoIdxPresentFlag( ) { return m_videoSignalInfoIdxPresentFlag; } |
---|
| 549 | |
---|
| 550 | Void setVideoSignalInfo( Int i, TComVideoSignalInfo* val ) { m_videoSignalInfo[i] = val; } |
---|
| 551 | TComVideoSignalInfo* getVideoSignalInfo( Int i ) { return m_videoSignalInfo[i]; } |
---|
| 552 | |
---|
| 553 | Void setVpsNumVideoSignalInfoMinus1( Int val ) { m_vpsNumVideoSignalInfoMinus1 = val; } |
---|
| 554 | Int getVpsNumVideoSignalInfoMinus1( ) { return m_vpsNumVideoSignalInfoMinus1; } |
---|
| 555 | |
---|
| 556 | Void setVpsVideoSignalInfoIdx( Int i, Int val ) { m_vpsVideoSignalInfoIdx[i] = val; } |
---|
| 557 | Int getVpsVideoSignalInfoIdx( Int i ) { return m_vpsVideoSignalInfoIdx[i]; } |
---|
| 558 | |
---|
[738] | 559 | Void setTilesNotInUseFlag( Bool flag ) { m_tilesNotInUseFlag = flag; } |
---|
| 560 | Bool getTilesNotInUseFlag( ) { return m_tilesNotInUseFlag; } |
---|
| 561 | |
---|
| 562 | Void setTilesInUseFlag( Int i, Bool flag ) { m_tilesInUseFlag[i] = flag; } |
---|
| 563 | Bool getTilesInUseFlag( Int i ) { return m_tilesInUseFlag[i]; } |
---|
| 564 | |
---|
| 565 | Void setLoopFilterNotAcrossTilesFlag( Int i, Int val ) { m_loopFilterNotAcrossTilesFlag[i] = val; } |
---|
| 566 | Bool getLoopFilterNotAcrossTilesFlag( Int i ) { return m_loopFilterNotAcrossTilesFlag[i]; } |
---|
| 567 | |
---|
[622] | 568 | Void setTileBoundariesAlignedFlag( Int i, Int j, Bool flag ) { m_tileBoundariesAlignedFlag[i][j] = flag; } |
---|
| 569 | Bool getTileBoundariesAlignedFlag( Int i, Int j ) { return m_tileBoundariesAlignedFlag[i][j]; } |
---|
| 570 | |
---|
[738] | 571 | Void setWppNotInUseFlag( Bool flag ) { m_wppNotInUseFlag = flag; } |
---|
| 572 | Bool getWppNotInUseFlag( ) { return m_wppNotInUseFlag; } |
---|
| 573 | |
---|
| 574 | Void setWppInUseFlag( Int i, Bool flag ) { m_wppInUseFlag[i] = flag; } |
---|
| 575 | Bool getWppInUseFlag( Int i ) { return m_wppInUseFlag[i]; } |
---|
| 576 | |
---|
[622] | 577 | Void setIlpRestrictedRefLayersFlag( Bool flag ) { m_ilpRestrictedRefLayersFlag = flag; } |
---|
| 578 | Bool getIlpRestrictedRefLayersFlag( ) { return m_ilpRestrictedRefLayersFlag; } |
---|
| 579 | |
---|
| 580 | Void setMinSpatialSegmentOffsetPlus1( Int i, Int j, Int val ) { m_minSpatialSegmentOffsetPlus1[i][j] = val; } |
---|
| 581 | Int getMinSpatialSegmentOffsetPlus1( Int i, Int j ) { return m_minSpatialSegmentOffsetPlus1[i][j]; } |
---|
| 582 | |
---|
| 583 | Void setCtuBasedOffsetEnabledFlag( Int i, Int j, Bool flag ) { m_ctuBasedOffsetEnabledFlag[i][j] = flag; } |
---|
| 584 | Bool getCtuBasedOffsetEnabledFlag( Int i, Int j ) { return m_ctuBasedOffsetEnabledFlag[i][j]; } |
---|
| 585 | |
---|
| 586 | Void setMinHorizontalCtuOffsetPlus1( Int i, Int j, Int val ) { m_minHorizontalCtuOffsetPlus1[i][j] = val; } |
---|
| 587 | Int getMinHorizontalCtuOffsetPlus1( Int i, Int j ) { return m_minHorizontalCtuOffsetPlus1[i][j]; } |
---|
[738] | 588 | |
---|
| 589 | Void setVpsVuiBspHrdPresentFlag( Bool flag ) { m_vpsVuiBspHrdPresentFlag = flag; } |
---|
| 590 | Bool getVpsVuiBspHrdPresentFlag( ) { return m_vpsVuiBspHrdPresentFlag; } |
---|
| 591 | |
---|
| 592 | Void setVpsVuiBspHrdParameters( TComVpsVuiBspHrdParameters* val) { m_vpsVuiBspHrdParameters = val; } |
---|
| 593 | TComVpsVuiBspHrdParameters* getVpsVuiBspHrdParameters( ) { return m_vpsVuiBspHrdParameters; } |
---|
[872] | 594 | |
---|
| 595 | Void setBaseLayerParameterSetCompatibilityFlag( Int i, Bool flag ) { m_baseLayerParameterSetCompatibilityFlag[i] = flag; } |
---|
| 596 | Bool getBaseLayerParameterSetCompatibilityFlag( Int i ) { return m_baseLayerParameterSetCompatibilityFlag[i]; } |
---|
| 597 | |
---|
[884] | 598 | Void inferVpsVui( Bool encoderFlag ); |
---|
[622] | 599 | }; |
---|
| 600 | |
---|
| 601 | class TComRepFormat |
---|
| 602 | { |
---|
| 603 | private: |
---|
[738] | 604 | Bool m_chromaAndBitDepthVpsPresentFlag; |
---|
[622] | 605 | Int m_chromaFormatVpsIdc; |
---|
| 606 | Bool m_separateColourPlaneVpsFlag; |
---|
| 607 | Int m_picWidthVpsInLumaSamples; |
---|
| 608 | Int m_picHeightVpsInLumaSamples; |
---|
| 609 | Int m_bitDepthVpsLumaMinus8; |
---|
| 610 | Int m_bitDepthVpsChromaMinus8; |
---|
| 611 | |
---|
| 612 | public: |
---|
| 613 | TComRepFormat() { }; |
---|
| 614 | |
---|
[738] | 615 | Void setChromaAndBitDepthVpsPresentFlag( Bool flag ) { m_chromaAndBitDepthVpsPresentFlag = flag; } |
---|
| 616 | Bool getChromaAndBitDepthVpsPresentFlag( ) { return m_chromaAndBitDepthVpsPresentFlag; } |
---|
| 617 | Void checkChromaAndBitDepthVpsPresentFlag( Int i ) { assert( i != 0 || m_chromaAndBitDepthVpsPresentFlag ); } // The value of chroma_and_bit_depth_vps_present_flag of the first rep_format( ) syntax structure in the VPS shall be equal to 1. |
---|
| 618 | Void inferChromaAndBitDepth( TComRepFormat* prevRepFormat, Bool encoderFlag ); |
---|
| 619 | |
---|
[622] | 620 | Void setChromaFormatVpsIdc( Int val ) { m_chromaFormatVpsIdc = val; } |
---|
| 621 | Int getChromaFormatVpsIdc( ) { return m_chromaFormatVpsIdc; } |
---|
| 622 | |
---|
| 623 | Void setSeparateColourPlaneVpsFlag( Bool flag ) { m_separateColourPlaneVpsFlag = flag; } |
---|
| 624 | Bool getSeparateColourPlaneVpsFlag( ) { return m_separateColourPlaneVpsFlag; } |
---|
| 625 | |
---|
| 626 | Void setPicWidthVpsInLumaSamples( Int val ) { m_picWidthVpsInLumaSamples = val; } |
---|
| 627 | Int getPicWidthVpsInLumaSamples( ) { return m_picWidthVpsInLumaSamples; } |
---|
| 628 | |
---|
| 629 | Void setPicHeightVpsInLumaSamples( Int val ) { m_picHeightVpsInLumaSamples = val; } |
---|
| 630 | Int getPicHeightVpsInLumaSamples( ) { return m_picHeightVpsInLumaSamples; } |
---|
| 631 | |
---|
| 632 | Void setBitDepthVpsLumaMinus8( Int val ) { m_bitDepthVpsLumaMinus8 = val; } |
---|
| 633 | Int getBitDepthVpsLumaMinus8( ) { return m_bitDepthVpsLumaMinus8; } |
---|
| 634 | |
---|
| 635 | Void setBitDepthVpsChromaMinus8( Int val ) { m_bitDepthVpsChromaMinus8 = val; } |
---|
| 636 | Int getBitDepthVpsChromaMinus8( ) { return m_bitDepthVpsChromaMinus8; } |
---|
| 637 | }; |
---|
| 638 | |
---|
[773] | 639 | |
---|
[738] | 640 | class TComDpbSize |
---|
| 641 | { |
---|
| 642 | private: |
---|
| 643 | Bool m_subLayerFlagInfoPresentFlag[MAX_VPS_OUTPUTLAYER_SETS]; |
---|
| 644 | Bool m_subLayerDpbInfoPresentFlag [MAX_VPS_OUTPUTLAYER_SETS][MAX_TLAYER]; |
---|
| 645 | Int m_maxVpsDecPicBufferingMinus1[MAX_VPS_OUTPUTLAYER_SETS][MAX_NUM_LAYER_IDS][MAX_TLAYER];; |
---|
| 646 | Int m_maxVpsNumReorderPics [MAX_VPS_OUTPUTLAYER_SETS][MAX_TLAYER]; |
---|
| 647 | Int m_maxVpsLatencyIncreasePlus1 [MAX_VPS_OUTPUTLAYER_SETS][MAX_TLAYER]; |
---|
| 648 | |
---|
| 649 | public: |
---|
[884] | 650 | TComDpbSize( ); |
---|
[738] | 651 | |
---|
| 652 | Void setSubLayerFlagInfoPresentFlag( Int i, Bool flag ) { m_subLayerFlagInfoPresentFlag[i] = flag; } |
---|
| 653 | Bool getSubLayerFlagInfoPresentFlag( Int i ) { return m_subLayerFlagInfoPresentFlag[i]; } |
---|
| 654 | |
---|
| 655 | Void setSubLayerDpbInfoPresentFlag( Int i, Int j, Bool flag ) { m_subLayerDpbInfoPresentFlag[i][j] = flag; } |
---|
| 656 | Bool getSubLayerDpbInfoPresentFlag( Int i, Int j ) { return m_subLayerDpbInfoPresentFlag[i][j]; } |
---|
| 657 | |
---|
| 658 | Void setMaxVpsDecPicBufferingMinus1( Int i, Int k, Int j, Int val ) { m_maxVpsDecPicBufferingMinus1[i][k][j] = val; } |
---|
| 659 | Int getMaxVpsDecPicBufferingMinus1( Int i, Int k, Int j ) { return m_maxVpsDecPicBufferingMinus1[i][k][j]; } |
---|
| 660 | |
---|
| 661 | Void setMaxVpsNumReorderPics( Int i, Int j, Int val ) { m_maxVpsNumReorderPics[i][j] = val; } |
---|
| 662 | Int getMaxVpsNumReorderPics( Int i, Int j ) { return m_maxVpsNumReorderPics[i][j]; } |
---|
[964] | 663 | |
---|
[738] | 664 | Void setMaxVpsLatencyIncreasePlus1( Int i, Int j, Int val ) { m_maxVpsLatencyIncreasePlus1[i][j] = val; } |
---|
| 665 | Int getMaxVpsLatencyIncreasePlus1( Int i, Int j ) { return m_maxVpsLatencyIncreasePlus1[i][j]; } |
---|
| 666 | }; |
---|
| 667 | #endif |
---|
[77] | 668 | class TComVPS |
---|
| 669 | { |
---|
| 670 | private: |
---|
| 671 | Int m_VPSId; |
---|
[976] | 672 | #if H_MV |
---|
[964] | 673 | Bool m_vpsBaseLayerInternalFlag; |
---|
| 674 | #endif |
---|
| 675 | |
---|
[100] | 676 | UInt m_uiMaxTLayers; |
---|
[622] | 677 | |
---|
| 678 | #if H_MV |
---|
| 679 | UInt m_uiMaxLayersMinus1; |
---|
| 680 | #else |
---|
[100] | 681 | UInt m_uiMaxLayers; |
---|
[622] | 682 | #endif |
---|
[100] | 683 | Bool m_bTemporalIdNestingFlag; |
---|
[608] | 684 | |
---|
| 685 | UInt m_numReorderPics[MAX_TLAYER]; |
---|
| 686 | UInt m_uiMaxDecPicBuffering[MAX_TLAYER]; |
---|
| 687 | UInt m_uiMaxLatencyIncrease[MAX_TLAYER]; // Really max latency increase plus 1 (value 0 expresses no limit) |
---|
[77] | 688 | |
---|
[608] | 689 | UInt m_numHrdParameters; |
---|
| 690 | #if H_MV |
---|
| 691 | UInt m_maxLayerId; |
---|
[210] | 692 | #else |
---|
[608] | 693 | UInt m_maxNuhReservedZeroLayerId; |
---|
[210] | 694 | #endif |
---|
[608] | 695 | TComHRD* m_hrdParameters; |
---|
| 696 | UInt* m_hrdOpSetIdx; |
---|
| 697 | Bool* m_cprmsPresentFlag; |
---|
| 698 | #if H_MV |
---|
| 699 | UInt m_vpsNumLayerSetsMinus1; |
---|
| 700 | Bool m_layerIdIncludedFlag[MAX_VPS_OP_SETS_PLUS1][MAX_VPS_NUH_LAYER_ID_PLUS1]; |
---|
| 701 | #else |
---|
| 702 | UInt m_numOpSets; |
---|
| 703 | Bool m_layerIdIncludedFlag[MAX_VPS_OP_SETS_PLUS1][MAX_VPS_NUH_RESERVED_ZERO_LAYER_ID_PLUS1]; |
---|
[210] | 704 | #endif |
---|
[608] | 705 | |
---|
| 706 | #if H_MV |
---|
| 707 | TComPTL m_pcPTL[MAX_VPS_OP_SETS_PLUS1]; |
---|
| 708 | #else |
---|
| 709 | TComPTL m_pcPTL; |
---|
[210] | 710 | #endif |
---|
[608] | 711 | TimingInfo m_timingInfo; |
---|
| 712 | #if H_MV |
---|
[964] | 713 | Bool m_vpsExtensionFlag; |
---|
[976] | 714 | |
---|
[608] | 715 | /// VPS EXTENSION SYNTAX ELEMENTS |
---|
[872] | 716 | Int m_vpsNonVuiExtensionLength; |
---|
[608] | 717 | Bool m_splittingFlag; |
---|
[622] | 718 | Bool m_scalabilityMaskFlag [MAX_NUM_SCALABILITY_TYPES]; |
---|
[608] | 719 | Int m_dimensionIdLen [MAX_NUM_SCALABILITY_TYPES]; |
---|
| 720 | Bool m_vpsNuhLayerIdPresentFlag; |
---|
| 721 | Int m_layerIdInNuh [MAX_NUM_LAYER_IDS]; |
---|
| 722 | Int m_dimensionId [MAX_NUM_LAYER_IDS][MAX_NUM_SCALABILITY_TYPES]; |
---|
[738] | 723 | |
---|
| 724 | Int m_viewIdLen; |
---|
[622] | 725 | Int m_viewIdVal [MAX_NUM_LAYERS]; |
---|
[608] | 726 | Bool m_directDependencyFlag [MAX_NUM_LAYER_IDS][MAX_NUM_LAYER_IDS]; |
---|
[738] | 727 | Bool m_vpsSubLayersMaxMinus1PresentFlag; |
---|
| 728 | Int m_subLayersVpsMaxMinus1 [MAX_NUM_LAYERS]; |
---|
[622] | 729 | Bool m_maxTidRefPresentFlag; |
---|
[738] | 730 | Int m_maxTidIlRefPicsPlus1 [MAX_NUM_LAYERS][MAX_NUM_LAYERS]; |
---|
[622] | 731 | Bool m_allRefLayersActiveFlag; |
---|
[608] | 732 | Int m_vpsNumProfileTierLevelMinus1; |
---|
| 733 | Bool m_vpsProfilePresentFlag [MAX_VPS_OP_SETS_PLUS1]; |
---|
[872] | 734 | |
---|
[964] | 735 | Int m_numAddLayerSets; |
---|
| 736 | Int m_highestLayerIdxPlus1 [MAX_VPS_ADD_OUTPUT_LAYER_SETS][MAX_NUM_LAYERS]; |
---|
| 737 | Int m_numAddOlss; |
---|
[976] | 738 | |
---|
[964] | 739 | Int m_defaultOutputLayerIdc; |
---|
[872] | 740 | |
---|
[964] | 741 | Int m_layerSetIdxForOlsMinus1 [MAX_VPS_OUTPUTLAYER_SETS]; |
---|
[608] | 742 | Bool m_outputLayerFlag [MAX_VPS_OUTPUTLAYER_SETS][MAX_VPS_NUH_LAYER_ID_PLUS1]; |
---|
| 743 | Int m_profileLevelTierIdx [MAX_VPS_OUTPUTLAYER_SETS ]; |
---|
[872] | 744 | Bool m_altOutputLayerFlag [MAX_VPS_OUTPUTLAYER_SETS]; |
---|
[622] | 745 | Bool m_repFormatIdxPresentFlag; |
---|
[964] | 746 | |
---|
[622] | 747 | Int m_vpsNumRepFormatsMinus1; |
---|
| 748 | Int m_vpsRepFormatIdx [MAX_NUM_LAYERS]; |
---|
| 749 | TComRepFormat* m_repFormat [MAX_NUM_LAYERS]; |
---|
[608] | 750 | Bool m_maxOneActiveRefLayerFlag; |
---|
[872] | 751 | #if H_MV_HLS7_GEN |
---|
| 752 | Bool m_vpsPocLsbAlignedFlag; |
---|
| 753 | #endif |
---|
[738] | 754 | Bool m_pocLsbNotPresentFlag [MAX_NUM_LAYERS]; |
---|
| 755 | |
---|
| 756 | TComDpbSize* m_dpbSize; |
---|
[608] | 757 | Int m_directDepTypeLenMinus2; |
---|
[738] | 758 | Bool m_defaultDirectDependencyFlag; |
---|
| 759 | Int m_defaultDirectDependencyType; |
---|
[872] | 760 | |
---|
| 761 | #if H_MV_HLS7_GEN |
---|
| 762 | Int m_directDependencyType [MAX_NUM_LAYERS] [MAX_NUM_LAYERS]; |
---|
| 763 | #endif |
---|
[622] | 764 | Bool m_vpsVuiPresentFlag; |
---|
| 765 | TComVPSVUI* m_vpsVUI; |
---|
[872] | 766 | #if !H_MV_HLS7_GEN |
---|
[608] | 767 | Int m_directDependencyType [MAX_NUM_LAYERS] [MAX_NUM_LAYERS]; |
---|
[872] | 768 | #endif |
---|
[77] | 769 | |
---|
[608] | 770 | // VPS EXTENSION SEMANTICS VARIABLES |
---|
| 771 | Int m_layerIdInVps [MAX_NUM_LAYERS ]; |
---|
| 772 | |
---|
| 773 | Int m_numDirectRefLayers [MAX_NUM_LAYERS]; |
---|
| 774 | Int m_refLayerId [MAX_NUM_LAYERS][MAX_NUM_LAYERS]; |
---|
| 775 | |
---|
[964] | 776 | Int m_numRefLayers [MAX_NUM_LAYER_IDS]; |
---|
| 777 | Int m_numPredictedLayers [MAX_NUM_LAYERS]; |
---|
| 778 | Int m_predictedLayerId [MAX_NUM_LAYERS][MAX_NUM_LAYER_IDS]; |
---|
| 779 | Int m_numIndependentLayers; |
---|
| 780 | Int m_numLayersInTreePartition [MAX_NUM_LAYER_IDS]; |
---|
| 781 | Int m_treePartitionLayerIdList [MAX_NUM_LAYERS][MAX_NUM_LAYER_IDS]; |
---|
| 782 | Bool m_recursiveRefLayerFlag [MAX_NUM_LAYER_IDS][MAX_NUM_LAYER_IDS]; |
---|
| 783 | |
---|
[622] | 784 | Int m_viewIndex [MAX_NUM_LAYERS ]; |
---|
[738] | 785 | |
---|
| 786 | std::vector< std::vector< Int> > m_targetDecLayerIdLists; //[TargetOptLayerSetIdx][i] |
---|
| 787 | std::vector< std::vector< Int> > m_targetOptLayerIdLists; |
---|
| 788 | std::vector< std::vector< Int> > m_layerSetLayerIdList; |
---|
| 789 | |
---|
| 790 | |
---|
[608] | 791 | Int xGetDimBitOffset( Int j ); |
---|
[976] | 792 | Void xSetRefLayerFlags( Int currLayerId ); |
---|
[622] | 793 | // VPS EXTENSION 2 SYNTAX ELEMENTS |
---|
[608] | 794 | #if H_3D_ARP |
---|
| 795 | UInt m_uiUseAdvResPred [MAX_NUM_LAYERS ]; |
---|
| 796 | UInt m_uiARPStepNum [MAX_NUM_LAYERS ]; |
---|
[443] | 797 | #endif |
---|
[608] | 798 | #if H_3D_IV_MERGE |
---|
| 799 | Bool m_ivMvPredFlag [ MAX_NUM_LAYERS ]; |
---|
[773] | 800 | #if H_3D_SPIVMP |
---|
[724] | 801 | Int m_iSubPULog2Size [MAX_NUM_LAYERS ]; |
---|
[884] | 802 | Int m_iSubPUMPILog2Size; |
---|
[443] | 803 | #endif |
---|
[724] | 804 | #endif |
---|
[608] | 805 | #if H_3D_VSP |
---|
| 806 | Bool m_viewSynthesisPredFlag [ MAX_NUM_LAYERS ]; |
---|
| 807 | #endif |
---|
| 808 | #if H_3D_NBDV_REF |
---|
| 809 | Bool m_depthRefinementFlag [ MAX_NUM_LAYERS ]; |
---|
| 810 | #endif |
---|
| 811 | Bool m_vpsDepthModesFlag [MAX_NUM_LAYERS ]; |
---|
[758] | 812 | |
---|
[622] | 813 | #if H_3D |
---|
[758] | 814 | UInt m_uiCamParPrecision; |
---|
| 815 | Bool* m_bCamParInSliceHeader; |
---|
| 816 | Bool* m_bCamParPresent; |
---|
| 817 | Int ***m_aaaiCodedScale ; |
---|
| 818 | Int ***m_aaaiCodedOffset; |
---|
[608] | 819 | Bool m_ivMvScalingFlag; |
---|
| 820 | #endif |
---|
[655] | 821 | #if H_3D_INTER_SDC |
---|
[608] | 822 | Bool m_bInterSDCFlag[MAX_NUM_LAYERS ]; |
---|
| 823 | #endif |
---|
[833] | 824 | #if H_3D_DBBP |
---|
| 825 | Bool m_dbbpFlag[MAX_NUM_LAYERS]; |
---|
| 826 | #endif |
---|
[773] | 827 | #if H_3D_IV_MERGE |
---|
[724] | 828 | Bool m_bMPIFlag[MAX_NUM_LAYERS ]; |
---|
| 829 | #endif |
---|
[443] | 830 | |
---|
[608] | 831 | #endif |
---|
[77] | 832 | public: |
---|
| 833 | TComVPS(); |
---|
| 834 | virtual ~TComVPS(); |
---|
[608] | 835 | |
---|
| 836 | Void createHrdParamBuffer() |
---|
| 837 | { |
---|
| 838 | m_hrdParameters = new TComHRD[ getNumHrdParameters() ]; |
---|
| 839 | m_hrdOpSetIdx = new UInt [ getNumHrdParameters() ]; |
---|
| 840 | m_cprmsPresentFlag = new Bool [ getNumHrdParameters() ]; |
---|
| 841 | } |
---|
| 842 | |
---|
| 843 | TComHRD* getHrdParameters ( UInt i ) { return &m_hrdParameters[ i ]; } |
---|
| 844 | UInt getHrdOpSetIdx ( UInt i ) { return m_hrdOpSetIdx[ i ]; } |
---|
| 845 | Void setHrdOpSetIdx ( UInt val, UInt i ) { m_hrdOpSetIdx[ i ] = val; } |
---|
| 846 | Bool getCprmsPresentFlag ( UInt i ) { return m_cprmsPresentFlag[ i ]; } |
---|
| 847 | Void setCprmsPresentFlag ( Bool val, UInt i ) { m_cprmsPresentFlag[ i ] = val; } |
---|
| 848 | |
---|
[77] | 849 | Int getVPSId () { return m_VPSId; } |
---|
| 850 | Void setVPSId (Int i) { m_VPSId = i; } |
---|
[608] | 851 | |
---|
[976] | 852 | #if H_MV |
---|
[964] | 853 | Void setVpsBaseLayerInternalFlag( Bool flag ) { m_vpsBaseLayerInternalFlag = flag; } |
---|
| 854 | Bool getVpsBaseLayerInternalFlag( ) { return m_vpsBaseLayerInternalFlag; } |
---|
| 855 | #endif |
---|
| 856 | |
---|
[77] | 857 | UInt getMaxTLayers () { return m_uiMaxTLayers; } |
---|
| 858 | Void setMaxTLayers (UInt t) { m_uiMaxTLayers = t; } |
---|
[773] | 859 | |
---|
| 860 | #if H_MV |
---|
[738] | 861 | UInt getMaxSubLayersMinus1() { return m_uiMaxTLayers - 1; } // For consistency with draft spec |
---|
[622] | 862 | UInt getMaxLayersMinus1() { return m_uiMaxLayersMinus1; }; |
---|
| 863 | Void setMaxLayersMinus1(UInt l) { m_uiMaxLayersMinus1 = l; } |
---|
| 864 | #else |
---|
[77] | 865 | UInt getMaxLayers () { return m_uiMaxLayers; } |
---|
[100] | 866 | Void setMaxLayers (UInt l) { m_uiMaxLayers = l; } |
---|
[622] | 867 | #endif |
---|
[608] | 868 | |
---|
| 869 | Bool getTemporalNestingFlag () { return m_bTemporalIdNestingFlag; } |
---|
| 870 | Void setTemporalNestingFlag (Bool t) { m_bTemporalIdNestingFlag = t; } |
---|
[100] | 871 | |
---|
[608] | 872 | Void setNumReorderPics(UInt v, UInt tLayer) { m_numReorderPics[tLayer] = v; } |
---|
| 873 | UInt getNumReorderPics(UInt tLayer) { return m_numReorderPics[tLayer]; } |
---|
[77] | 874 | |
---|
[872] | 875 | Void setMaxDecPicBuffering(UInt v, UInt tLayer) { assert(tLayer < MAX_TLAYER); m_uiMaxDecPicBuffering[tLayer] = v; } |
---|
[608] | 876 | UInt getMaxDecPicBuffering(UInt tLayer) { return m_uiMaxDecPicBuffering[tLayer]; } |
---|
| 877 | |
---|
| 878 | Void setMaxLatencyIncrease(UInt v, UInt tLayer) { m_uiMaxLatencyIncrease[tLayer] = v; } |
---|
| 879 | UInt getMaxLatencyIncrease(UInt tLayer) { return m_uiMaxLatencyIncrease[tLayer]; } |
---|
| 880 | |
---|
| 881 | UInt getNumHrdParameters() { return m_numHrdParameters; } |
---|
| 882 | Void setNumHrdParameters(UInt v) { m_numHrdParameters = v; } |
---|
| 883 | |
---|
| 884 | #if H_MV |
---|
| 885 | UInt getVpsMaxLayerId() { return m_maxLayerId; } |
---|
| 886 | Void setVpsMaxLayerId(UInt v) { m_maxLayerId = v; } |
---|
| 887 | |
---|
| 888 | UInt getVpsNumLayerSetsMinus1() { return m_vpsNumLayerSetsMinus1; } |
---|
| 889 | Void setVpsNumLayerSetsMinus1(UInt v) { m_vpsNumLayerSetsMinus1 = v; } |
---|
| 890 | #else |
---|
| 891 | UInt getMaxNuhReservedZeroLayerId() { return m_maxNuhReservedZeroLayerId; } |
---|
| 892 | Void setMaxNuhReservedZeroLayerId(UInt v) { m_maxNuhReservedZeroLayerId = v; } |
---|
| 893 | |
---|
| 894 | UInt getMaxOpSets() { return m_numOpSets; } |
---|
| 895 | Void setMaxOpSets(UInt v) { m_numOpSets = v; } |
---|
[210] | 896 | #endif |
---|
[608] | 897 | Bool getLayerIdIncludedFlag(UInt opsIdx, UInt id) { return m_layerIdIncludedFlag[opsIdx][id]; } |
---|
| 898 | Void setLayerIdIncludedFlag(Bool v, UInt opsIdx, UInt id) { m_layerIdIncludedFlag[opsIdx][id] = v; } |
---|
| 899 | |
---|
| 900 | #if H_MV |
---|
| 901 | TComPTL* getPTL( Int layerSet = 0 ) { return &m_pcPTL[layerSet]; } |
---|
| 902 | #else |
---|
| 903 | TComPTL* getPTL() { return &m_pcPTL; } |
---|
[210] | 904 | #endif |
---|
[608] | 905 | TimingInfo* getTimingInfo() { return &m_timingInfo; } |
---|
| 906 | #if H_MV |
---|
[964] | 907 | Void setVpsExtensionFlag( Bool flag ) { m_vpsExtensionFlag = flag; } |
---|
| 908 | Bool getVpsExtensionFlag( ) { return m_vpsExtensionFlag; } |
---|
[976] | 909 | |
---|
[872] | 910 | Void setVpsNonVuiExtensionLength( Int val ) { m_vpsNonVuiExtensionLength = val; } |
---|
| 911 | Int getVpsNonVuiExtensionLength( ) { return m_vpsNonVuiExtensionLength; } |
---|
[622] | 912 | |
---|
[608] | 913 | Void setSplittingFlag( Bool val ) { m_splittingFlag = val; } |
---|
| 914 | Bool getSplittingFlag() { return m_splittingFlag; } |
---|
| 915 | |
---|
[622] | 916 | Void setScalabilityMaskFlag( UInt val ); |
---|
| 917 | Void setScalabilityMaskFlag( Int scalType, Bool val ) { m_scalabilityMaskFlag[scalType] = val; } |
---|
| 918 | Bool getScalabilityMaskFlag( Int scalType ) { return m_scalabilityMaskFlag[scalType]; } |
---|
[884] | 919 | |
---|
[608] | 920 | Int getNumScalabilityTypes( ); |
---|
| 921 | |
---|
| 922 | Void setDimensionIdLen( Int sIdx, Int val ) { m_dimensionIdLen[sIdx] = val; } |
---|
| 923 | Int getDimensionIdLen( Int sIdx ) { assert( m_dimensionIdLen[sIdx] > 0) ; return m_dimensionIdLen[sIdx]; } |
---|
| 924 | |
---|
| 925 | Void setVpsNuhLayerIdPresentFlag( Bool val ) { m_vpsNuhLayerIdPresentFlag = val; } |
---|
| 926 | Bool getVpsNuhLayerIdPresentFlag() { return m_vpsNuhLayerIdPresentFlag; } |
---|
| 927 | |
---|
| 928 | Void setLayerIdInNuh( Int layerIdInVps, Int val ) { m_layerIdInNuh[layerIdInVps] = val; } |
---|
| 929 | Int getLayerIdInNuh( Int layerIdInVps ) { assert( m_layerIdInNuh[layerIdInVps] >= 0 ); return m_layerIdInNuh[layerIdInVps]; } |
---|
| 930 | |
---|
| 931 | Bool nuhLayerIdIncluded( Int layerIdinNuh ) { return ( m_layerIdInVps[ layerIdinNuh ] > 0 ); } |
---|
| 932 | |
---|
| 933 | Void setDimensionId( Int layerIdInVps, Int scalIdx, Int val ) { m_dimensionId[layerIdInVps][scalIdx] = val; } |
---|
| 934 | Int getDimensionId( Int layerIdInVps, Int scalIdx ) { return m_dimensionId[layerIdInVps][scalIdx]; } |
---|
| 935 | |
---|
[738] | 936 | Void setViewIdLen( Int val ) { m_viewIdLen = val; } |
---|
| 937 | Int getViewIdLen( ) { return m_viewIdLen; } |
---|
[622] | 938 | |
---|
| 939 | Void setViewIdVal( Int viewOrderIndex, Int val ) { m_viewIdVal[viewOrderIndex] = val; } |
---|
| 940 | Int getViewIdVal( Int viewOrderIndex ) { return m_viewIdVal[viewOrderIndex]; } |
---|
[884] | 941 | |
---|
[608] | 942 | Void setDirectDependencyFlag( Int depLayeridInVps, Int refLayeridInVps, Bool val ) { m_directDependencyFlag[depLayeridInVps][refLayeridInVps] = val; } |
---|
| 943 | Bool getDirectDependencyFlag( Int depLayeridInVps, Int refLayeridInVps ) { return m_directDependencyFlag[depLayeridInVps][refLayeridInVps]; } |
---|
[884] | 944 | |
---|
[738] | 945 | Void setVpsSubLayersMaxMinus1PresentFlag( Bool flag ) { m_vpsSubLayersMaxMinus1PresentFlag = flag; } |
---|
| 946 | Bool getVpsSubLayersMaxMinus1PresentFlag( ) { return m_vpsSubLayersMaxMinus1PresentFlag; } |
---|
[884] | 947 | |
---|
[738] | 948 | Void setSubLayersVpsMaxMinus1( Int i, Int val ) { m_subLayersVpsMaxMinus1[i] = val; } |
---|
| 949 | Int getSubLayersVpsMaxMinus1( Int i ) { return m_subLayersVpsMaxMinus1[i]; } |
---|
| 950 | Void checkSubLayersVpsMaxMinus1( Int i ) { assert( m_subLayersVpsMaxMinus1[i] >= 0 && m_subLayersVpsMaxMinus1[i] <= m_uiMaxTLayers - 1 ); } |
---|
[884] | 951 | |
---|
[622] | 952 | Void setMaxTidRefPresentFlag( Bool flag ) { m_maxTidRefPresentFlag = flag; } |
---|
| 953 | Bool getMaxTidRefPresentFlag( ) { return m_maxTidRefPresentFlag; } |
---|
[884] | 954 | |
---|
[738] | 955 | Void setMaxTidIlRefPicsPlus1( Int i, Int j, Int val ) { m_maxTidIlRefPicsPlus1[i][j] = val; } |
---|
| 956 | Int getMaxTidIlRefPicsPlus1( Int i, Int j ) { return m_maxTidIlRefPicsPlus1[i][j]; } |
---|
[884] | 957 | |
---|
[622] | 958 | Void setAllRefLayersActiveFlag( Bool flag ) { m_allRefLayersActiveFlag = flag; } |
---|
| 959 | Bool getAllRefLayersActiveFlag( ) { return m_allRefLayersActiveFlag; } |
---|
[872] | 960 | |
---|
[608] | 961 | Void setVpsNumProfileTierLevelMinus1( Int val ) { m_vpsNumProfileTierLevelMinus1 = val; } |
---|
| 962 | Int getVpsNumProfileTierLevelMinus1( ) { return m_vpsNumProfileTierLevelMinus1; } |
---|
| 963 | |
---|
| 964 | Void setVpsProfilePresentFlag( Int idx, Bool val ) { m_vpsProfilePresentFlag[idx] = val; } |
---|
| 965 | Bool getVpsProfilePresentFlag( Int idx ) { return m_vpsProfilePresentFlag[idx]; } |
---|
[210] | 966 | |
---|
[964] | 967 | Void setNumAddLayerSets( Int val ) { m_numAddLayerSets = val; } |
---|
| 968 | Int getNumAddLayerSets( ) { return m_numAddLayerSets; } |
---|
[608] | 969 | |
---|
[964] | 970 | Void setHighestLayerIdxPlus1( Int i, Int j, Int val ) { m_highestLayerIdxPlus1[i][j] = val; } |
---|
| 971 | Int getHighestLayerIdxPlus1( Int i, Int j ) { return m_highestLayerIdxPlus1[i][j]; } |
---|
| 972 | |
---|
| 973 | Void setNumAddOlss( Int val ) { m_numAddOlss = val; } |
---|
| 974 | Int getNumAddOlss( ) { return m_numAddOlss; } |
---|
| 975 | |
---|
| 976 | Void setDefaultOutputLayerIdc( Int val ) { m_defaultOutputLayerIdc = val; } |
---|
| 977 | Int getDefaultOutputLayerIdc( ) { return m_defaultOutputLayerIdc; } |
---|
[608] | 978 | |
---|
[964] | 979 | Void setLayerSetIdxForOlsMinus1( Int outLayerSetIdx, Int val ) { m_layerSetIdxForOlsMinus1[ outLayerSetIdx ] = val; } |
---|
| 980 | Int getLayerSetIdxForOlsMinus1( Int outLayerSetIdx ) { return m_layerSetIdxForOlsMinus1[ outLayerSetIdx ]; } |
---|
[443] | 981 | |
---|
[608] | 982 | Void setOutputLayerFlag( Int outLayerSetIdx, Int i, Bool flag ) { m_outputLayerFlag[ outLayerSetIdx ][ i ] = flag; } |
---|
| 983 | Bool getOutputLayerFlag( Int outLayerSetIdx, Int i ) { return m_outputLayerFlag[ outLayerSetIdx ][ i ]; } |
---|
| 984 | |
---|
[884] | 985 | Bool inferOutputLayerFlag( Int i, Int j ); |
---|
| 986 | |
---|
[833] | 987 | Void setProfileLevelTierIdx( Int outLayerSetIdx, Int val ) { m_profileLevelTierIdx[ outLayerSetIdx ] = val; } |
---|
[608] | 988 | Int getProfileLevelTierIdx( Int outLayerSetIdx ) { return m_profileLevelTierIdx[ outLayerSetIdx ]; } |
---|
[872] | 989 | |
---|
| 990 | Void setAltOutputLayerFlag( Int i, Bool flag ) { m_altOutputLayerFlag[i] = flag; } |
---|
| 991 | Bool getAltOutputLayerFlag( Int i ) { return m_altOutputLayerFlag[i]; } |
---|
[608] | 992 | |
---|
[622] | 993 | Void setRepFormatIdxPresentFlag( Bool flag ) { m_repFormatIdxPresentFlag = flag; } |
---|
| 994 | Bool getRepFormatIdxPresentFlag( ) { return m_repFormatIdxPresentFlag; } |
---|
| 995 | |
---|
| 996 | Void setVpsNumRepFormatsMinus1( Int val ) { m_vpsNumRepFormatsMinus1 = val; } |
---|
| 997 | Int getVpsNumRepFormatsMinus1( ) { return m_vpsNumRepFormatsMinus1; } |
---|
| 998 | |
---|
| 999 | Void setVpsRepFormatIdx( Int i, Int val ) { m_vpsRepFormatIdx[i] = val; } |
---|
| 1000 | Int getVpsRepFormatIdx( Int i ) { return m_vpsRepFormatIdx[i]; } |
---|
| 1001 | |
---|
[964] | 1002 | Int inferVpsRepFormatIdx( Int i ) { return std::min( i, getVpsNumRepFormatsMinus1() ); } |
---|
| 1003 | |
---|
[622] | 1004 | Void setRepFormat( Int i, TComRepFormat* val ) { m_repFormat[i] = val; } |
---|
| 1005 | TComRepFormat* getRepFormat( Int i ) { return m_repFormat[i]; } |
---|
[884] | 1006 | |
---|
[608] | 1007 | Void setMaxOneActiveRefLayerFlag( Bool flag) { m_maxOneActiveRefLayerFlag = flag; } |
---|
| 1008 | Bool getMaxOneActiveRefLayerFlag( ) { return m_maxOneActiveRefLayerFlag; } |
---|
[738] | 1009 | |
---|
[872] | 1010 | #if H_MV_HLS7_GEN |
---|
| 1011 | Void setVpsPocLsbAlignedFlag( Bool flag ) { m_vpsPocLsbAlignedFlag = flag; } |
---|
| 1012 | Bool getVpsPocLsbAlignedFlag( ) { return m_vpsPocLsbAlignedFlag; } |
---|
| 1013 | #endif |
---|
| 1014 | |
---|
[738] | 1015 | Void setDpbSize( TComDpbSize* val ) { assert( m_dpbSize != 0 ); m_dpbSize = val; } |
---|
| 1016 | TComDpbSize* getDpbSize( ) { return m_dpbSize;} |
---|
[976] | 1017 | |
---|
[964] | 1018 | Void inferDbpSizeLayerSetZero( TComSPS* sps, Bool encoder ); |
---|
[976] | 1019 | |
---|
[738] | 1020 | Void setPocLsbNotPresentFlag( Int i, Bool flag ) { m_pocLsbNotPresentFlag[i] = flag; } |
---|
| 1021 | Bool getPocLsbNotPresentFlag( Int i ) { return m_pocLsbNotPresentFlag[i]; } |
---|
[884] | 1022 | |
---|
[608] | 1023 | Void setDirectDepTypeLenMinus2( Int val) { m_directDepTypeLenMinus2 = val; } |
---|
| 1024 | Int getDirectDepTypeLenMinus2( ) { return m_directDepTypeLenMinus2; } |
---|
| 1025 | |
---|
[738] | 1026 | Void setDefaultDirectDependencyFlag( Bool flag ) { m_defaultDirectDependencyFlag = flag; } |
---|
| 1027 | Bool getDefaultDirectDependencyFlag( ) { return m_defaultDirectDependencyFlag; } |
---|
| 1028 | |
---|
| 1029 | Void setDefaultDirectDependencyType( Int val ) { m_defaultDirectDependencyType = val; } |
---|
| 1030 | Int getDefaultDirectDependencyType( ) { return m_defaultDirectDependencyType; } |
---|
[884] | 1031 | |
---|
[608] | 1032 | Void setDirectDependencyType( Int depLayeridInVps, Int refLayeridInVps, Int val) { m_directDependencyType[ depLayeridInVps ][ refLayeridInVps ] = val; } |
---|
| 1033 | Int getDirectDependencyType( Int depLayeridInVps, Int refLayeridInVps) { return m_directDependencyType[ depLayeridInVps ][ refLayeridInVps ]; } |
---|
[872] | 1034 | |
---|
[622] | 1035 | Void setVpsVuiPresentFlag( Bool flag ) { m_vpsVuiPresentFlag = flag; } |
---|
| 1036 | Bool getVpsVuiPresentFlag( ) { return m_vpsVuiPresentFlag; } |
---|
[608] | 1037 | |
---|
[622] | 1038 | TComVPSVUI* getVPSVUI( ) { return m_vpsVUI; } |
---|
[773] | 1039 | |
---|
| 1040 | // VPS EXTENSION SEMANTICS VARIABLES |
---|
[608] | 1041 | Void setLayerIdInVps( Int layerIdInNuh, Int val ) { m_layerIdInVps[layerIdInNuh] = val; } |
---|
| 1042 | Int getLayerIdInVps( Int layerIdInNuh ) { assert( m_layerIdInVps[layerIdInNuh] >= 0 ); return m_layerIdInVps[layerIdInNuh]; } |
---|
| 1043 | |
---|
| 1044 | Int getScalabilityId ( Int layerIdInVps, ScalabilityType scalType ); |
---|
[738] | 1045 | Int getViewId ( Int layerIdInNuh ) { return m_viewIdVal[ getViewIndex( layerIdInNuh )]; } |
---|
[608] | 1046 | Void setRefLayers(); |
---|
| 1047 | |
---|
[622] | 1048 | Int getViewIndex ( Int layerIdInNuh ) { return getScalabilityId( getLayerIdInVps(layerIdInNuh), VIEW_ORDER_INDEX ); } |
---|
| 1049 | Int getNumViews(); |
---|
| 1050 | |
---|
| 1051 | Int getNumDirectRefLayers( Int layerIdInNuh ) { return m_numDirectRefLayers[ layerIdInNuh ]; }; |
---|
| 1052 | Int getRefLayerId ( Int layerIdInNuh, Int idx );; |
---|
[964] | 1053 | |
---|
| 1054 | Int getNumRefLayers ( Int i ) { return m_numRefLayers[i]; } |
---|
| 1055 | Int getNumPredictedLayers ( Int i ) { return m_numPredictedLayers[i]; } |
---|
| 1056 | Int getPredictedLayerId ( Int i, Int j ) { return m_predictedLayerId[i][j]; } |
---|
| 1057 | Int getNumIndependentLayers ( ) { return m_numIndependentLayers; } |
---|
| 1058 | Int getNumLayersInTreePartition( Int i ) { return m_numLayersInTreePartition[i]; } |
---|
| 1059 | Int getTreePartitionLayerIdList( Int i, Int j ) { return m_treePartitionLayerIdList[i][j]; } |
---|
| 1060 | Bool getRecursiveRefLayerFlag ( Int i, Int j ) { return m_recursiveRefLayerFlag[i][j]; } |
---|
| 1061 | Int getNumLayerSets( ) { return getVpsNumLayerSetsMinus1() + 1 + getNumAddLayerSets(); }; |
---|
[976] | 1062 | |
---|
[608] | 1063 | Bool checkVPSExtensionSyntax(); |
---|
| 1064 | Int scalTypeToScalIdx ( ScalabilityType scalType ); |
---|
| 1065 | |
---|
[872] | 1066 | Int getProfileLevelTierIdxLen() { return gCeilLog2( getVpsNumProfileTierLevelMinus1() + 1 ); }; |
---|
[884] | 1067 | Int getVpsRepFormatIdxLen() { return gCeilLog2( getVpsNumRepFormatsMinus1() + 1 ); }; |
---|
[622] | 1068 | |
---|
[738] | 1069 | Int getNumLayersInIdList ( Int lsIdx ); |
---|
[964] | 1070 | Int getLayerSetLayerIdList(Int lsIdx, Int j ) { return m_layerSetLayerIdList[ lsIdx ][ j ]; }; |
---|
[608] | 1071 | |
---|
[738] | 1072 | Int getNumOutputLayerSets() ; |
---|
[976] | 1073 | |
---|
[738] | 1074 | Bool isOutputLayer( Int outLayerSetIdx, Int layerIdInNuh ); |
---|
| 1075 | Void deriveLayerSetLayerIdList(); |
---|
[872] | 1076 | |
---|
[964] | 1077 | Int olsIdxToLsIdx( Int i ) { return ( i <= getVpsNumLayerSetsMinus1() ) ? i : getLayerSetIdxForOlsMinus1( i ) + 1 ; }; |
---|
[872] | 1078 | |
---|
| 1079 | Void initTargetLayerIdLists ( ); |
---|
| 1080 | Void deriveTargetLayerIdList ( Int i ); |
---|
| 1081 | |
---|
| 1082 | std::vector<Int> getTargetDecLayerIdList( Int targetDecLayerSetIdx ) { return m_targetDecLayerIdLists[targetDecLayerSetIdx]; }; |
---|
| 1083 | std::vector<Int> getTargetOptLayerIdList( Int targetOptLayerSetIdx ) { return m_targetOptLayerIdLists[targetOptLayerSetIdx]; }; |
---|
| 1084 | |
---|
| 1085 | Int getNumOutputLayersInOutputLayerSet( Int i ) { return (Int) getTargetOptLayerIdList( i ).size(); }; |
---|
| 1086 | Int getOlsHighestOutputLayerId( Int i ) { return getTargetOptLayerIdList( i ).back(); }; |
---|
[738] | 1087 | |
---|
[884] | 1088 | Int getMaxSubLayersInLayerSetMinus1( Int i ); |
---|
[964] | 1089 | Int getHighestLayerIdxPlus1Len( Int j ) { return gCeilLog2( getNumLayersInTreePartition( j ) + 1 ); }; |
---|
| 1090 | |
---|
[976] | 1091 | Bool getAltOutputLayerFlagVar( Int i );; |
---|
[964] | 1092 | |
---|
[608] | 1093 | // inference |
---|
| 1094 | Int inferDimensionId ( Int i, Int j ); |
---|
| 1095 | Int inferLastDimsionIdLenMinus1(); |
---|
| 1096 | |
---|
[622] | 1097 | // helpers |
---|
| 1098 | Bool getInDirectDependencyFlag( Int depLayeridInVps, Int refLayeridInVps, Int depth = 0 ); |
---|
[976] | 1099 | Int getMaxNumPics( Int layerId ); |
---|
[964] | 1100 | |
---|
[622] | 1101 | /// VPS EXTENSION 2 SYNTAX ELEMENTS |
---|
[608] | 1102 | #if H_3D |
---|
[622] | 1103 | Int getDepthId ( Int layerIdInNuh) { return getScalabilityId( getLayerIdInVps(layerIdInNuh), DEPTH_ID ); } |
---|
[608] | 1104 | Int getLayerIdInNuh( Int viewIndex, Bool depthFlag ); |
---|
| 1105 | |
---|
| 1106 | #if H_3D_ARP |
---|
| 1107 | UInt getUseAdvRP ( Int layerIdInVps ) { return m_uiUseAdvResPred[layerIdInVps]; } |
---|
| 1108 | UInt getARPStepNum( Int layerIdInVps ) { return m_uiARPStepNum[layerIdInVps]; } |
---|
| 1109 | Void setUseAdvRP ( Int layerIdInVps, UInt val ) { m_uiUseAdvResPred[layerIdInVps] = val; } |
---|
| 1110 | Void setARPStepNum( Int layerIdInVps, UInt val ) { m_uiARPStepNum[layerIdInVps] = val; } |
---|
[443] | 1111 | #endif |
---|
[773] | 1112 | |
---|
[758] | 1113 | Void createCamPars(Int iNumViews); |
---|
| 1114 | Void deleteCamPars(); |
---|
| 1115 | Void initCamParaVPS ( UInt uiViewIndex, Bool bCamParPresent = false, UInt uiCamParPrecision = 0, Bool bCamParSlice = false, Int** aaiScale = 0, Int** aaiOffset = 0 ); |
---|
| 1116 | UInt getCamParPrecision () { return m_uiCamParPrecision; } |
---|
| 1117 | Bool getCamParPresent ( Int viewIndex ) { return m_bCamParPresent[viewIndex]; } |
---|
[872] | 1118 | Void setCamParPresent ( Int viewIndex, Bool val ) { m_bCamParPresent[viewIndex] = val; } |
---|
[758] | 1119 | Bool hasCamParInSliceHeader( Int viewIndex ) { return m_bCamParInSliceHeader[viewIndex]; } |
---|
| 1120 | Void setHasCamParInSliceHeader( Int viewIndex, Bool b ) { m_bCamParInSliceHeader[viewIndex] = b; } |
---|
| 1121 | Int* getCodedScale ( Int viewIndex ) { return m_aaaiCodedScale [viewIndex][0]; } |
---|
| 1122 | Int* getCodedOffset ( Int viewIndex ) { return m_aaaiCodedOffset[viewIndex][0]; } |
---|
| 1123 | Int* getInvCodedScale ( Int viewIndex ) { return m_aaaiCodedScale [viewIndex][1]; } |
---|
| 1124 | Int* getInvCodedOffset ( Int viewIndex ) { return m_aaaiCodedOffset[viewIndex][1]; } |
---|
| 1125 | |
---|
[608] | 1126 | #if H_3D_IV_MERGE |
---|
| 1127 | Void setIvMvPredFlag ( Int layerIdInVps, Bool val ) { m_ivMvPredFlag[ layerIdInVps ] = val; } |
---|
| 1128 | Bool getIvMvPredFlag ( Int layerIdInVps ) { return m_ivMvPredFlag[ layerIdInVps ]; }; |
---|
[773] | 1129 | #if H_3D_SPIVMP |
---|
[724] | 1130 | Int getSubPULog2Size(Int layerIdInVps) { return m_iSubPULog2Size[layerIdInVps]; } |
---|
| 1131 | Void setSubPULog2Size(Int layerIdInVps, Int u) { m_iSubPULog2Size[layerIdInVps] = u;} |
---|
[833] | 1132 | Int getSubPUMPILog2Size( ) { return m_iSubPUMPILog2Size; } |
---|
| 1133 | Void setSubPUMPILog2Size( Int u ) { m_iSubPUMPILog2Size = u; } |
---|
| 1134 | #endif |
---|
[884] | 1135 | #endif |
---|
[608] | 1136 | #if H_3D_VSP |
---|
| 1137 | Void setViewSynthesisPredFlag ( Int layerIdInVps, Bool val ) { m_viewSynthesisPredFlag[ layerIdInVps ] = val; } |
---|
| 1138 | Bool getViewSynthesisPredFlag ( Int layerIdInVps ) { return m_viewSynthesisPredFlag[ layerIdInVps ]; }; |
---|
| 1139 | #endif |
---|
| 1140 | #if H_3D_NBDV_REF |
---|
| 1141 | Void setDepthRefinementFlag ( Int layerIdInVps, Bool val ) { m_depthRefinementFlag[ layerIdInVps ] = val; } |
---|
| 1142 | Bool getDepthRefinementFlag ( Int layerIdInVps ) { return m_depthRefinementFlag[ layerIdInVps ]; }; |
---|
| 1143 | #endif |
---|
| 1144 | Void setVpsDepthModesFlag( Int layerIdInVps, Bool val ) { m_vpsDepthModesFlag[ layerIdInVps ] = val; } |
---|
| 1145 | Bool getVpsDepthModesFlag( Int layerIdInVps ) { return m_vpsDepthModesFlag[ layerIdInVps ]; } |
---|
[758] | 1146 | |
---|
[608] | 1147 | Bool getIvMvScalingFlag ( ) { return m_ivMvScalingFlag; } |
---|
| 1148 | Void setIvMvScalingFlag ( Bool b ) { m_ivMvScalingFlag = b; } |
---|
[655] | 1149 | #if H_3D_INTER_SDC |
---|
[608] | 1150 | Bool getInterSDCFlag ( Int layerIdInVps ) { return m_bInterSDCFlag[layerIdInVps]; } |
---|
| 1151 | Void setInterSDCFlag ( Int layerIdInVps, Bool bval ){ m_bInterSDCFlag[layerIdInVps] = bval; } |
---|
| 1152 | #endif |
---|
[833] | 1153 | #if H_3D_DBBP |
---|
| 1154 | Bool getUseDBBP ( Int layerIdInVps ) { return m_dbbpFlag[layerIdInVps]; } |
---|
| 1155 | Void setUseDBBP ( Int layerIdInVps, Bool bval ){ m_dbbpFlag[layerIdInVps] = bval; } |
---|
| 1156 | #endif |
---|
[773] | 1157 | #if H_3D_IV_MERGE |
---|
[724] | 1158 | Bool getMPIFlag ( Int layerIdInVps ) { return m_bMPIFlag[layerIdInVps]; } |
---|
| 1159 | Void setMPIFlag ( Int layerIdInVps, Bool bval ){ m_bMPIFlag[layerIdInVps] = bval; } |
---|
| 1160 | #endif |
---|
[608] | 1161 | #endif |
---|
| 1162 | #endif |
---|
[77] | 1163 | }; |
---|
| 1164 | |
---|
[773] | 1165 | #if H_3D |
---|
[758] | 1166 | class TComDLT |
---|
| 1167 | { |
---|
| 1168 | private: |
---|
| 1169 | Bool m_bDltPresentFlag; |
---|
| 1170 | Bool m_bUseDLTFlag [ MAX_NUM_LAYERS ]; |
---|
| 1171 | Bool m_bInterViewDltPredEnableFlag[ MAX_NUM_LAYERS ]; |
---|
| 1172 | |
---|
| 1173 | Int m_iBitsPerDepthValue [ MAX_NUM_LAYERS ]; |
---|
| 1174 | Int m_iNumDepthmapValues [ MAX_NUM_LAYERS ]; |
---|
| 1175 | Int* m_iDepthValue2Idx [ MAX_NUM_LAYERS ]; |
---|
| 1176 | Int* m_iIdx2DepthValue [ MAX_NUM_LAYERS ]; |
---|
| 1177 | |
---|
| 1178 | Int m_iNumDepthViews; |
---|
| 1179 | UInt m_uiDepthViewBitDepth; |
---|
| 1180 | |
---|
| 1181 | public: |
---|
| 1182 | TComDLT(); |
---|
| 1183 | ~TComDLT(); |
---|
| 1184 | |
---|
| 1185 | Bool getDltPresentFlag () { return m_bDltPresentFlag; } |
---|
| 1186 | Void setDltPresentFlag ( Bool b ) { m_bDltPresentFlag = b; } |
---|
| 1187 | |
---|
| 1188 | Bool getUseDLTFlag ( Int layerIdInVps ) { return m_bUseDLTFlag[ layerIdInVps ]; } |
---|
| 1189 | Void setUseDLTFlag ( Int layerIdInVps, Bool b ) { m_bUseDLTFlag[ layerIdInVps ] = b; } |
---|
| 1190 | |
---|
| 1191 | Bool getInterViewDltPredEnableFlag( Int layerIdInVps ) { return m_bInterViewDltPredEnableFlag[ layerIdInVps ]; } |
---|
| 1192 | Void setInterViewDltPredEnableFlag( Int layerIdInVps, Bool b ) { m_bInterViewDltPredEnableFlag[ layerIdInVps ] = b; } |
---|
| 1193 | |
---|
| 1194 | Void setNumDepthViews ( Int n ) { m_iNumDepthViews = n; } |
---|
| 1195 | Int getNumDepthViews () { return m_iNumDepthViews; } |
---|
| 1196 | |
---|
| 1197 | Void setDepthViewBitDepth( UInt n ) { m_uiDepthViewBitDepth = n; } |
---|
| 1198 | UInt getDepthViewBitDepth() { return m_uiDepthViewBitDepth; } |
---|
| 1199 | |
---|
| 1200 | Int getBitsPerDepthValue( Int layerIdInVps ) { return getUseDLTFlag(layerIdInVps)?m_iBitsPerDepthValue[layerIdInVps]:g_bitDepthY; } |
---|
| 1201 | Int getNumDepthValues( Int layerIdInVps ) { return getUseDLTFlag(layerIdInVps)?m_iNumDepthmapValues[layerIdInVps]:((1 << g_bitDepthY)-1); } |
---|
| 1202 | Int depthValue2idx( Int layerIdInVps, Pel value ) { return getUseDLTFlag(layerIdInVps)?m_iDepthValue2Idx[layerIdInVps][value]:value; } |
---|
| 1203 | Pel idx2DepthValue( Int layerIdInVps, UInt uiIdx ) { return getUseDLTFlag(layerIdInVps)?m_iIdx2DepthValue[layerIdInVps][uiIdx]:uiIdx; } |
---|
| 1204 | Void setDepthLUTs( Int layerIdInVps, Int* idx2DepthValue = NULL, Int iNumDepthValues = 0 ); |
---|
| 1205 | #if H_3D_DELTA_DLT |
---|
| 1206 | Int* idx2DepthValue( Int layerIdInVps ) { return m_iIdx2DepthValue[layerIdInVps]; } |
---|
| 1207 | Void getDeltaDLT( Int layerIdInVps, Int* piDLTInRef, UInt uiDLTInRefNum, Int* piDeltaDLTOut, UInt *puiDeltaDLTOutNum ); |
---|
| 1208 | Void setDeltaDLT( Int layerIdInVps, Int* piDLTInRef, UInt uiDLTInRefNum, Int* piDeltaDLTIn, UInt uiDeltaDLTInNum ); |
---|
| 1209 | #endif |
---|
| 1210 | }; |
---|
| 1211 | #endif |
---|
| 1212 | |
---|
[608] | 1213 | class Window |
---|
| 1214 | { |
---|
| 1215 | private: |
---|
| 1216 | Bool m_enabledFlag; |
---|
| 1217 | Int m_winLeftOffset; |
---|
| 1218 | Int m_winRightOffset; |
---|
| 1219 | Int m_winTopOffset; |
---|
| 1220 | Int m_winBottomOffset; |
---|
[622] | 1221 | #if H_MV |
---|
| 1222 | Bool m_scaledFlag; |
---|
| 1223 | #endif |
---|
[608] | 1224 | public: |
---|
| 1225 | Window() |
---|
| 1226 | : m_enabledFlag (false) |
---|
| 1227 | , m_winLeftOffset (0) |
---|
| 1228 | , m_winRightOffset (0) |
---|
| 1229 | , m_winTopOffset (0) |
---|
| 1230 | , m_winBottomOffset (0) |
---|
[622] | 1231 | #if H_MV |
---|
| 1232 | , m_scaledFlag(true) |
---|
| 1233 | #endif |
---|
[608] | 1234 | { } |
---|
| 1235 | |
---|
| 1236 | Bool getWindowEnabledFlag() const { return m_enabledFlag; } |
---|
| 1237 | Void resetWindow() { m_enabledFlag = false; m_winLeftOffset = m_winRightOffset = m_winTopOffset = m_winBottomOffset = 0; } |
---|
| 1238 | Int getWindowLeftOffset() const { return m_enabledFlag ? m_winLeftOffset : 0; } |
---|
| 1239 | Void setWindowLeftOffset(Int val) { m_winLeftOffset = val; m_enabledFlag = true; } |
---|
| 1240 | Int getWindowRightOffset() const { return m_enabledFlag ? m_winRightOffset : 0; } |
---|
| 1241 | Void setWindowRightOffset(Int val) { m_winRightOffset = val; m_enabledFlag = true; } |
---|
| 1242 | Int getWindowTopOffset() const { return m_enabledFlag ? m_winTopOffset : 0; } |
---|
| 1243 | Void setWindowTopOffset(Int val) { m_winTopOffset = val; m_enabledFlag = true; } |
---|
| 1244 | Int getWindowBottomOffset() const { return m_enabledFlag ? m_winBottomOffset: 0; } |
---|
| 1245 | Void setWindowBottomOffset(Int val) { m_winBottomOffset = val; m_enabledFlag = true; } |
---|
| 1246 | |
---|
[622] | 1247 | #if H_MV |
---|
| 1248 | Void setScaledFlag(Bool flag) { m_scaledFlag = flag; } |
---|
| 1249 | Bool getScaledFlag() const { return m_scaledFlag; } |
---|
[976] | 1250 | Void scaleOffsets( Int scal ); |
---|
[622] | 1251 | #endif |
---|
[608] | 1252 | Void setWindow(Int offsetLeft, Int offsetLRight, Int offsetLTop, Int offsetLBottom) |
---|
| 1253 | { |
---|
| 1254 | m_enabledFlag = true; |
---|
| 1255 | m_winLeftOffset = offsetLeft; |
---|
| 1256 | m_winRightOffset = offsetLRight; |
---|
| 1257 | m_winTopOffset = offsetLTop; |
---|
| 1258 | m_winBottomOffset = offsetLBottom; |
---|
| 1259 | } |
---|
| 1260 | }; |
---|
| 1261 | |
---|
| 1262 | |
---|
| 1263 | class TComVUI |
---|
| 1264 | { |
---|
| 1265 | private: |
---|
| 1266 | Bool m_aspectRatioInfoPresentFlag; |
---|
| 1267 | Int m_aspectRatioIdc; |
---|
| 1268 | Int m_sarWidth; |
---|
| 1269 | Int m_sarHeight; |
---|
| 1270 | Bool m_overscanInfoPresentFlag; |
---|
| 1271 | Bool m_overscanAppropriateFlag; |
---|
| 1272 | Bool m_videoSignalTypePresentFlag; |
---|
| 1273 | Int m_videoFormat; |
---|
| 1274 | Bool m_videoFullRangeFlag; |
---|
| 1275 | Bool m_colourDescriptionPresentFlag; |
---|
| 1276 | Int m_colourPrimaries; |
---|
| 1277 | Int m_transferCharacteristics; |
---|
| 1278 | Int m_matrixCoefficients; |
---|
| 1279 | Bool m_chromaLocInfoPresentFlag; |
---|
| 1280 | Int m_chromaSampleLocTypeTopField; |
---|
| 1281 | Int m_chromaSampleLocTypeBottomField; |
---|
| 1282 | Bool m_neutralChromaIndicationFlag; |
---|
| 1283 | Bool m_fieldSeqFlag; |
---|
| 1284 | |
---|
| 1285 | Window m_defaultDisplayWindow; |
---|
| 1286 | Bool m_frameFieldInfoPresentFlag; |
---|
| 1287 | Bool m_hrdParametersPresentFlag; |
---|
| 1288 | Bool m_bitstreamRestrictionFlag; |
---|
| 1289 | Bool m_tilesFixedStructureFlag; |
---|
| 1290 | Bool m_motionVectorsOverPicBoundariesFlag; |
---|
| 1291 | Bool m_restrictedRefPicListsFlag; |
---|
| 1292 | Int m_minSpatialSegmentationIdc; |
---|
| 1293 | Int m_maxBytesPerPicDenom; |
---|
| 1294 | Int m_maxBitsPerMinCuDenom; |
---|
| 1295 | Int m_log2MaxMvLengthHorizontal; |
---|
| 1296 | Int m_log2MaxMvLengthVertical; |
---|
| 1297 | TComHRD m_hrdParameters; |
---|
| 1298 | TimingInfo m_timingInfo; |
---|
[77] | 1299 | |
---|
[608] | 1300 | public: |
---|
| 1301 | TComVUI() |
---|
| 1302 | :m_aspectRatioInfoPresentFlag(false) |
---|
| 1303 | ,m_aspectRatioIdc(0) |
---|
| 1304 | ,m_sarWidth(0) |
---|
| 1305 | ,m_sarHeight(0) |
---|
| 1306 | ,m_overscanInfoPresentFlag(false) |
---|
| 1307 | ,m_overscanAppropriateFlag(false) |
---|
| 1308 | ,m_videoSignalTypePresentFlag(false) |
---|
| 1309 | ,m_videoFormat(5) |
---|
| 1310 | ,m_videoFullRangeFlag(false) |
---|
| 1311 | ,m_colourDescriptionPresentFlag(false) |
---|
| 1312 | ,m_colourPrimaries(2) |
---|
| 1313 | ,m_transferCharacteristics(2) |
---|
| 1314 | ,m_matrixCoefficients(2) |
---|
| 1315 | ,m_chromaLocInfoPresentFlag(false) |
---|
| 1316 | ,m_chromaSampleLocTypeTopField(0) |
---|
| 1317 | ,m_chromaSampleLocTypeBottomField(0) |
---|
| 1318 | ,m_neutralChromaIndicationFlag(false) |
---|
| 1319 | ,m_fieldSeqFlag(false) |
---|
| 1320 | ,m_frameFieldInfoPresentFlag(false) |
---|
| 1321 | ,m_hrdParametersPresentFlag(false) |
---|
| 1322 | ,m_bitstreamRestrictionFlag(false) |
---|
| 1323 | ,m_tilesFixedStructureFlag(false) |
---|
| 1324 | ,m_motionVectorsOverPicBoundariesFlag(true) |
---|
| 1325 | ,m_restrictedRefPicListsFlag(1) |
---|
| 1326 | ,m_minSpatialSegmentationIdc(0) |
---|
| 1327 | ,m_maxBytesPerPicDenom(2) |
---|
| 1328 | ,m_maxBitsPerMinCuDenom(1) |
---|
| 1329 | ,m_log2MaxMvLengthHorizontal(15) |
---|
| 1330 | ,m_log2MaxMvLengthVertical(15) |
---|
| 1331 | {} |
---|
| 1332 | |
---|
| 1333 | virtual ~TComVUI() {} |
---|
| 1334 | |
---|
| 1335 | Bool getAspectRatioInfoPresentFlag() { return m_aspectRatioInfoPresentFlag; } |
---|
| 1336 | Void setAspectRatioInfoPresentFlag(Bool i) { m_aspectRatioInfoPresentFlag = i; } |
---|
| 1337 | |
---|
| 1338 | Int getAspectRatioIdc() { return m_aspectRatioIdc; } |
---|
| 1339 | Void setAspectRatioIdc(Int i) { m_aspectRatioIdc = i; } |
---|
| 1340 | |
---|
| 1341 | Int getSarWidth() { return m_sarWidth; } |
---|
| 1342 | Void setSarWidth(Int i) { m_sarWidth = i; } |
---|
| 1343 | |
---|
| 1344 | Int getSarHeight() { return m_sarHeight; } |
---|
| 1345 | Void setSarHeight(Int i) { m_sarHeight = i; } |
---|
| 1346 | |
---|
| 1347 | Bool getOverscanInfoPresentFlag() { return m_overscanInfoPresentFlag; } |
---|
| 1348 | Void setOverscanInfoPresentFlag(Bool i) { m_overscanInfoPresentFlag = i; } |
---|
| 1349 | |
---|
| 1350 | Bool getOverscanAppropriateFlag() { return m_overscanAppropriateFlag; } |
---|
| 1351 | Void setOverscanAppropriateFlag(Bool i) { m_overscanAppropriateFlag = i; } |
---|
| 1352 | |
---|
| 1353 | Bool getVideoSignalTypePresentFlag() { return m_videoSignalTypePresentFlag; } |
---|
| 1354 | Void setVideoSignalTypePresentFlag(Bool i) { m_videoSignalTypePresentFlag = i; } |
---|
| 1355 | |
---|
| 1356 | Int getVideoFormat() { return m_videoFormat; } |
---|
| 1357 | Void setVideoFormat(Int i) { m_videoFormat = i; } |
---|
| 1358 | |
---|
| 1359 | Bool getVideoFullRangeFlag() { return m_videoFullRangeFlag; } |
---|
| 1360 | Void setVideoFullRangeFlag(Bool i) { m_videoFullRangeFlag = i; } |
---|
| 1361 | |
---|
| 1362 | Bool getColourDescriptionPresentFlag() { return m_colourDescriptionPresentFlag; } |
---|
| 1363 | Void setColourDescriptionPresentFlag(Bool i) { m_colourDescriptionPresentFlag = i; } |
---|
| 1364 | |
---|
| 1365 | Int getColourPrimaries() { return m_colourPrimaries; } |
---|
| 1366 | Void setColourPrimaries(Int i) { m_colourPrimaries = i; } |
---|
| 1367 | |
---|
| 1368 | Int getTransferCharacteristics() { return m_transferCharacteristics; } |
---|
| 1369 | Void setTransferCharacteristics(Int i) { m_transferCharacteristics = i; } |
---|
| 1370 | |
---|
| 1371 | Int getMatrixCoefficients() { return m_matrixCoefficients; } |
---|
| 1372 | Void setMatrixCoefficients(Int i) { m_matrixCoefficients = i; } |
---|
| 1373 | |
---|
| 1374 | Bool getChromaLocInfoPresentFlag() { return m_chromaLocInfoPresentFlag; } |
---|
| 1375 | Void setChromaLocInfoPresentFlag(Bool i) { m_chromaLocInfoPresentFlag = i; } |
---|
| 1376 | |
---|
| 1377 | Int getChromaSampleLocTypeTopField() { return m_chromaSampleLocTypeTopField; } |
---|
| 1378 | Void setChromaSampleLocTypeTopField(Int i) { m_chromaSampleLocTypeTopField = i; } |
---|
| 1379 | |
---|
| 1380 | Int getChromaSampleLocTypeBottomField() { return m_chromaSampleLocTypeBottomField; } |
---|
| 1381 | Void setChromaSampleLocTypeBottomField(Int i) { m_chromaSampleLocTypeBottomField = i; } |
---|
| 1382 | |
---|
| 1383 | Bool getNeutralChromaIndicationFlag() { return m_neutralChromaIndicationFlag; } |
---|
| 1384 | Void setNeutralChromaIndicationFlag(Bool i) { m_neutralChromaIndicationFlag = i; } |
---|
| 1385 | |
---|
| 1386 | Bool getFieldSeqFlag() { return m_fieldSeqFlag; } |
---|
| 1387 | Void setFieldSeqFlag(Bool i) { m_fieldSeqFlag = i; } |
---|
| 1388 | |
---|
| 1389 | Bool getFrameFieldInfoPresentFlag() { return m_frameFieldInfoPresentFlag; } |
---|
| 1390 | Void setFrameFieldInfoPresentFlag(Bool i) { m_frameFieldInfoPresentFlag = i; } |
---|
| 1391 | |
---|
| 1392 | Window& getDefaultDisplayWindow() { return m_defaultDisplayWindow; } |
---|
| 1393 | Void setDefaultDisplayWindow(Window& defaultDisplayWindow ) { m_defaultDisplayWindow = defaultDisplayWindow; } |
---|
| 1394 | |
---|
| 1395 | Bool getHrdParametersPresentFlag() { return m_hrdParametersPresentFlag; } |
---|
| 1396 | Void setHrdParametersPresentFlag(Bool i) { m_hrdParametersPresentFlag = i; } |
---|
| 1397 | |
---|
| 1398 | Bool getBitstreamRestrictionFlag() { return m_bitstreamRestrictionFlag; } |
---|
| 1399 | Void setBitstreamRestrictionFlag(Bool i) { m_bitstreamRestrictionFlag = i; } |
---|
| 1400 | |
---|
| 1401 | Bool getTilesFixedStructureFlag() { return m_tilesFixedStructureFlag; } |
---|
| 1402 | Void setTilesFixedStructureFlag(Bool i) { m_tilesFixedStructureFlag = i; } |
---|
| 1403 | |
---|
| 1404 | Bool getMotionVectorsOverPicBoundariesFlag() { return m_motionVectorsOverPicBoundariesFlag; } |
---|
| 1405 | Void setMotionVectorsOverPicBoundariesFlag(Bool i) { m_motionVectorsOverPicBoundariesFlag = i; } |
---|
| 1406 | |
---|
| 1407 | Bool getRestrictedRefPicListsFlag() { return m_restrictedRefPicListsFlag; } |
---|
| 1408 | Void setRestrictedRefPicListsFlag(Bool b) { m_restrictedRefPicListsFlag = b; } |
---|
| 1409 | |
---|
| 1410 | Int getMinSpatialSegmentationIdc() { return m_minSpatialSegmentationIdc; } |
---|
| 1411 | Void setMinSpatialSegmentationIdc(Int i) { m_minSpatialSegmentationIdc = i; } |
---|
| 1412 | Int getMaxBytesPerPicDenom() { return m_maxBytesPerPicDenom; } |
---|
| 1413 | Void setMaxBytesPerPicDenom(Int i) { m_maxBytesPerPicDenom = i; } |
---|
| 1414 | |
---|
| 1415 | Int getMaxBitsPerMinCuDenom() { return m_maxBitsPerMinCuDenom; } |
---|
| 1416 | Void setMaxBitsPerMinCuDenom(Int i) { m_maxBitsPerMinCuDenom = i; } |
---|
| 1417 | |
---|
| 1418 | Int getLog2MaxMvLengthHorizontal() { return m_log2MaxMvLengthHorizontal; } |
---|
| 1419 | Void setLog2MaxMvLengthHorizontal(Int i) { m_log2MaxMvLengthHorizontal = i; } |
---|
| 1420 | |
---|
| 1421 | Int getLog2MaxMvLengthVertical() { return m_log2MaxMvLengthVertical; } |
---|
| 1422 | Void setLog2MaxMvLengthVertical(Int i) { m_log2MaxMvLengthVertical = i; } |
---|
| 1423 | |
---|
| 1424 | TComHRD* getHrdParameters () { return &m_hrdParameters; } |
---|
| 1425 | TimingInfo* getTimingInfo() { return &m_timingInfo; } |
---|
[773] | 1426 | #if H_MV |
---|
| 1427 | Void inferVideoSignalInfo( TComVPS* vps, Int layerIdCurr ); |
---|
[738] | 1428 | #endif |
---|
[608] | 1429 | }; |
---|
| 1430 | |
---|
[2] | 1431 | /// SPS class |
---|
| 1432 | class TComSPS |
---|
| 1433 | { |
---|
| 1434 | private: |
---|
[56] | 1435 | Int m_SPSId; |
---|
[608] | 1436 | Int m_VPSId; |
---|
[56] | 1437 | Int m_chromaFormatIdc; |
---|
| 1438 | |
---|
| 1439 | UInt m_uiMaxTLayers; // maximum number of temporal layers |
---|
| 1440 | |
---|
[2] | 1441 | // Structure |
---|
[56] | 1442 | UInt m_picWidthInLumaSamples; |
---|
| 1443 | UInt m_picHeightInLumaSamples; |
---|
[608] | 1444 | |
---|
| 1445 | Int m_log2MinCodingBlockSize; |
---|
| 1446 | Int m_log2DiffMaxMinCodingBlockSize; |
---|
[2] | 1447 | UInt m_uiMaxCUWidth; |
---|
| 1448 | UInt m_uiMaxCUHeight; |
---|
| 1449 | UInt m_uiMaxCUDepth; |
---|
[608] | 1450 | |
---|
| 1451 | Window m_conformanceWindow; |
---|
| 1452 | |
---|
| 1453 | TComRPSList m_RPSList; |
---|
[56] | 1454 | Bool m_bLongTermRefsPresent; |
---|
[608] | 1455 | Bool m_TMVPFlagsPresent; |
---|
[56] | 1456 | Int m_numReorderPics[MAX_TLAYER]; |
---|
| 1457 | |
---|
[2] | 1458 | // Tool list |
---|
| 1459 | UInt m_uiQuadtreeTULog2MaxSize; |
---|
| 1460 | UInt m_uiQuadtreeTULog2MinSize; |
---|
| 1461 | UInt m_uiQuadtreeTUMaxDepthInter; |
---|
| 1462 | UInt m_uiQuadtreeTUMaxDepthIntra; |
---|
[56] | 1463 | Bool m_usePCM; |
---|
| 1464 | UInt m_pcmLog2MaxSize; |
---|
| 1465 | UInt m_uiPCMLog2MinSize; |
---|
| 1466 | Bool m_useAMP; |
---|
[2] | 1467 | |
---|
[608] | 1468 | #if H_3D_QTLPC |
---|
| 1469 | Bool m_bUseQTL; |
---|
| 1470 | Bool m_bUsePC; |
---|
| 1471 | #endif |
---|
[2] | 1472 | // Parameter |
---|
[608] | 1473 | Int m_bitDepthY; |
---|
| 1474 | Int m_bitDepthC; |
---|
[56] | 1475 | Int m_qpBDOffsetY; |
---|
| 1476 | Int m_qpBDOffsetC; |
---|
[5] | 1477 | |
---|
[56] | 1478 | UInt m_uiPCMBitDepthLuma; |
---|
| 1479 | UInt m_uiPCMBitDepthChroma; |
---|
| 1480 | Bool m_bPCMFilterDisableFlag; |
---|
| 1481 | |
---|
| 1482 | UInt m_uiBitsForPOC; |
---|
[964] | 1483 | |
---|
[608] | 1484 | UInt m_numLongTermRefPicSPS; |
---|
| 1485 | UInt m_ltRefPicPocLsbSps[33]; |
---|
| 1486 | Bool m_usedByCurrPicLtSPSFlag[33]; |
---|
[2] | 1487 | // Max physical transform size |
---|
| 1488 | UInt m_uiMaxTrSize; |
---|
[56] | 1489 | |
---|
[2] | 1490 | Int m_iAMPAcc[MAX_CU_DEPTH]; |
---|
[56] | 1491 | Bool m_bUseSAO; |
---|
[2] | 1492 | |
---|
[56] | 1493 | Bool m_bTemporalIdNestingFlag; // temporal_id_nesting_flag |
---|
[2] | 1494 | |
---|
[56] | 1495 | Bool m_scalingListEnabledFlag; |
---|
[608] | 1496 | Bool m_scalingListPresentFlag; |
---|
| 1497 | TComScalingList* m_scalingList; //!< ScalingList class pointer |
---|
[56] | 1498 | UInt m_uiMaxDecPicBuffering[MAX_TLAYER]; |
---|
[608] | 1499 | UInt m_uiMaxLatencyIncrease[MAX_TLAYER]; // Really max latency increase plus 1 (value 0 expresses no limit) |
---|
[56] | 1500 | |
---|
| 1501 | Bool m_useDF; |
---|
[608] | 1502 | Bool m_useStrongIntraSmoothing; |
---|
[56] | 1503 | |
---|
[608] | 1504 | Bool m_vuiParametersPresentFlag; |
---|
| 1505 | TComVUI m_vuiParameters; |
---|
[56] | 1506 | |
---|
[608] | 1507 | static const Int m_winUnitX[MAX_CHROMA_FORMAT_IDC+1]; |
---|
| 1508 | static const Int m_winUnitY[MAX_CHROMA_FORMAT_IDC+1]; |
---|
| 1509 | TComPTL m_pcPTL; |
---|
| 1510 | #if H_MV |
---|
[622] | 1511 | TComVPS* m_pcVPS; |
---|
| 1512 | // SPS |
---|
[964] | 1513 | Bool m_spsExtensionPresentFlag; |
---|
[976] | 1514 | |
---|
[964] | 1515 | Bool m_spsRangeExtensionsFlag; |
---|
| 1516 | Bool m_spsMultilayerExtensionFlag; |
---|
| 1517 | #if H_3D |
---|
| 1518 | Bool m_sps3dExtensionFlag; |
---|
| 1519 | Int m_spsExtension5bits; |
---|
| 1520 | #else |
---|
| 1521 | Int m_spsExtension6bits; |
---|
| 1522 | #endif |
---|
[976] | 1523 | |
---|
[622] | 1524 | Bool m_spsInferScalingListFlag; |
---|
| 1525 | Int m_spsScalingListRefLayerId; |
---|
| 1526 | Bool m_updateRepFormatFlag; |
---|
[738] | 1527 | Int m_spsRepFormatIdx; |
---|
[622] | 1528 | // SPS Extension |
---|
[608] | 1529 | Bool m_interViewMvVertConstraintFlag; |
---|
[738] | 1530 | Int m_numScaledRefLayerOffsets; |
---|
| 1531 | Int m_scaledRefLayerId [MAX_NUM_SCALED_REF_LAYERS]; |
---|
| 1532 | Int m_scaledRefLayerLeftOffset [MAX_NUM_LAYERS]; |
---|
| 1533 | Int m_scaledRefLayerTopOffset [MAX_NUM_LAYERS]; |
---|
| 1534 | Int m_scaledRefLayerRightOffset [MAX_NUM_LAYERS]; |
---|
| 1535 | Int m_scaledRefLayerBottomOffset[MAX_NUM_LAYERS]; |
---|
[2] | 1536 | #endif |
---|
[608] | 1537 | #if H_3D |
---|
| 1538 | UInt m_uiCamParPrecision; |
---|
| 1539 | Bool m_bCamParInSliceHeader; |
---|
| 1540 | Int m_aaiCodedScale [2][MAX_NUM_LAYERS]; |
---|
| 1541 | Int m_aaiCodedOffset[2][MAX_NUM_LAYERS]; |
---|
[210] | 1542 | #endif |
---|
[608] | 1543 | #if H_MV |
---|
| 1544 | Int m_layerId; |
---|
[115] | 1545 | #endif |
---|
[2] | 1546 | public: |
---|
| 1547 | TComSPS(); |
---|
| 1548 | virtual ~TComSPS(); |
---|
[608] | 1549 | |
---|
[100] | 1550 | Int getVPSId () { return m_VPSId; } |
---|
[77] | 1551 | Void setVPSId (Int i) { m_VPSId = i; } |
---|
[56] | 1552 | Int getSPSId () { return m_SPSId; } |
---|
| 1553 | Void setSPSId (Int i) { m_SPSId = i; } |
---|
| 1554 | Int getChromaFormatIdc () { return m_chromaFormatIdc; } |
---|
| 1555 | Void setChromaFormatIdc (Int i) { m_chromaFormatIdc = i; } |
---|
[608] | 1556 | |
---|
| 1557 | static Int getWinUnitX (Int chromaFormatIdc) { assert (chromaFormatIdc > 0 && chromaFormatIdc <= MAX_CHROMA_FORMAT_IDC); return m_winUnitX[chromaFormatIdc]; } |
---|
| 1558 | static Int getWinUnitY (Int chromaFormatIdc) { assert (chromaFormatIdc > 0 && chromaFormatIdc <= MAX_CHROMA_FORMAT_IDC); return m_winUnitY[chromaFormatIdc]; } |
---|
[56] | 1559 | |
---|
[2] | 1560 | // structure |
---|
[56] | 1561 | Void setPicWidthInLumaSamples ( UInt u ) { m_picWidthInLumaSamples = u; } |
---|
| 1562 | UInt getPicWidthInLumaSamples () { return m_picWidthInLumaSamples; } |
---|
| 1563 | Void setPicHeightInLumaSamples ( UInt u ) { m_picHeightInLumaSamples = u; } |
---|
| 1564 | UInt getPicHeightInLumaSamples () { return m_picHeightInLumaSamples; } |
---|
| 1565 | |
---|
[608] | 1566 | Window& getConformanceWindow() { return m_conformanceWindow; } |
---|
| 1567 | Void setConformanceWindow(Window& conformanceWindow ) { m_conformanceWindow = conformanceWindow; } |
---|
[56] | 1568 | |
---|
[608] | 1569 | UInt getNumLongTermRefPicSPS() { return m_numLongTermRefPicSPS; } |
---|
| 1570 | Void setNumLongTermRefPicSPS(UInt val) { m_numLongTermRefPicSPS = val; } |
---|
| 1571 | |
---|
| 1572 | UInt getLtRefPicPocLsbSps(UInt index) { return m_ltRefPicPocLsbSps[index]; } |
---|
| 1573 | Void setLtRefPicPocLsbSps(UInt index, UInt val) { m_ltRefPicPocLsbSps[index] = val; } |
---|
| 1574 | |
---|
| 1575 | Bool getUsedByCurrPicLtSPSFlag(Int i) {return m_usedByCurrPicLtSPSFlag[i];} |
---|
| 1576 | Void setUsedByCurrPicLtSPSFlag(Int i, Bool x) { m_usedByCurrPicLtSPSFlag[i] = x;} |
---|
| 1577 | |
---|
| 1578 | Int getLog2MinCodingBlockSize() const { return m_log2MinCodingBlockSize; } |
---|
| 1579 | Void setLog2MinCodingBlockSize(Int val) { m_log2MinCodingBlockSize = val; } |
---|
| 1580 | Int getLog2DiffMaxMinCodingBlockSize() const { return m_log2DiffMaxMinCodingBlockSize; } |
---|
| 1581 | Void setLog2DiffMaxMinCodingBlockSize(Int val) { m_log2DiffMaxMinCodingBlockSize = val; } |
---|
| 1582 | |
---|
[2] | 1583 | Void setMaxCUWidth ( UInt u ) { m_uiMaxCUWidth = u; } |
---|
| 1584 | UInt getMaxCUWidth () { return m_uiMaxCUWidth; } |
---|
| 1585 | Void setMaxCUHeight ( UInt u ) { m_uiMaxCUHeight = u; } |
---|
| 1586 | UInt getMaxCUHeight () { return m_uiMaxCUHeight; } |
---|
| 1587 | Void setMaxCUDepth ( UInt u ) { m_uiMaxCUDepth = u; } |
---|
| 1588 | UInt getMaxCUDepth () { return m_uiMaxCUDepth; } |
---|
[56] | 1589 | Void setUsePCM ( Bool b ) { m_usePCM = b; } |
---|
| 1590 | Bool getUsePCM () { return m_usePCM; } |
---|
| 1591 | Void setPCMLog2MaxSize ( UInt u ) { m_pcmLog2MaxSize = u; } |
---|
| 1592 | UInt getPCMLog2MaxSize () { return m_pcmLog2MaxSize; } |
---|
| 1593 | Void setPCMLog2MinSize ( UInt u ) { m_uiPCMLog2MinSize = u; } |
---|
| 1594 | UInt getPCMLog2MinSize () { return m_uiPCMLog2MinSize; } |
---|
| 1595 | Void setBitsForPOC ( UInt u ) { m_uiBitsForPOC = u; } |
---|
| 1596 | UInt getBitsForPOC () { return m_uiBitsForPOC; } |
---|
| 1597 | Bool getUseAMP() { return m_useAMP; } |
---|
| 1598 | Void setUseAMP( Bool b ) { m_useAMP = b; } |
---|
[2] | 1599 | Void setQuadtreeTULog2MaxSize( UInt u ) { m_uiQuadtreeTULog2MaxSize = u; } |
---|
| 1600 | UInt getQuadtreeTULog2MaxSize() { return m_uiQuadtreeTULog2MaxSize; } |
---|
| 1601 | Void setQuadtreeTULog2MinSize( UInt u ) { m_uiQuadtreeTULog2MinSize = u; } |
---|
| 1602 | UInt getQuadtreeTULog2MinSize() { return m_uiQuadtreeTULog2MinSize; } |
---|
| 1603 | Void setQuadtreeTUMaxDepthInter( UInt u ) { m_uiQuadtreeTUMaxDepthInter = u; } |
---|
| 1604 | Void setQuadtreeTUMaxDepthIntra( UInt u ) { m_uiQuadtreeTUMaxDepthIntra = u; } |
---|
| 1605 | UInt getQuadtreeTUMaxDepthInter() { return m_uiQuadtreeTUMaxDepthInter; } |
---|
| 1606 | UInt getQuadtreeTUMaxDepthIntra() { return m_uiQuadtreeTUMaxDepthIntra; } |
---|
[56] | 1607 | Void setNumReorderPics(Int i, UInt tlayer) { m_numReorderPics[tlayer] = i; } |
---|
| 1608 | Int getNumReorderPics(UInt tlayer) { return m_numReorderPics[tlayer]; } |
---|
[608] | 1609 | Void createRPSList( Int numRPS ); |
---|
| 1610 | TComRPSList* getRPSList() { return &m_RPSList; } |
---|
[56] | 1611 | Bool getLongTermRefsPresent() { return m_bLongTermRefsPresent; } |
---|
| 1612 | Void setLongTermRefsPresent(Bool b) { m_bLongTermRefsPresent=b; } |
---|
[608] | 1613 | Bool getTMVPFlagsPresent() { return m_TMVPFlagsPresent; } |
---|
| 1614 | Void setTMVPFlagsPresent(Bool b) { m_TMVPFlagsPresent=b; } |
---|
[2] | 1615 | // physical transform |
---|
| 1616 | Void setMaxTrSize ( UInt u ) { m_uiMaxTrSize = u; } |
---|
| 1617 | UInt getMaxTrSize () { return m_uiMaxTrSize; } |
---|
[56] | 1618 | |
---|
| 1619 | // AMP accuracy |
---|
| 1620 | Int getAMPAcc ( UInt uiDepth ) { return m_iAMPAcc[uiDepth]; } |
---|
| 1621 | Void setAMPAcc ( UInt uiDepth, Int iAccu ) { assert( uiDepth < g_uiMaxCUDepth); m_iAMPAcc[uiDepth] = iAccu; } |
---|
[5] | 1622 | |
---|
[2] | 1623 | // Bit-depth |
---|
[608] | 1624 | Int getBitDepthY() { return m_bitDepthY; } |
---|
| 1625 | Void setBitDepthY(Int u) { m_bitDepthY = u; } |
---|
| 1626 | Int getBitDepthC() { return m_bitDepthC; } |
---|
| 1627 | Void setBitDepthC(Int u) { m_bitDepthC = u; } |
---|
[56] | 1628 | Int getQpBDOffsetY () { return m_qpBDOffsetY; } |
---|
| 1629 | Void setQpBDOffsetY ( Int value ) { m_qpBDOffsetY = value; } |
---|
| 1630 | Int getQpBDOffsetC () { return m_qpBDOffsetC; } |
---|
| 1631 | Void setQpBDOffsetC ( Int value ) { m_qpBDOffsetC = value; } |
---|
[2] | 1632 | Void setUseSAO (Bool bVal) {m_bUseSAO = bVal;} |
---|
| 1633 | Bool getUseSAO () {return m_bUseSAO;} |
---|
| 1634 | |
---|
[56] | 1635 | UInt getMaxTLayers() { return m_uiMaxTLayers; } |
---|
| 1636 | Void setMaxTLayers( UInt uiMaxTLayers ) { assert( uiMaxTLayers <= MAX_TLAYER ); m_uiMaxTLayers = uiMaxTLayers; } |
---|
[976] | 1637 | #if H_MV |
---|
[964] | 1638 | UInt getSpsMaxSubLayersMinus1() { return ( m_uiMaxTLayers - 1); } |
---|
| 1639 | #endif |
---|
[2] | 1640 | |
---|
[56] | 1641 | Bool getTemporalIdNestingFlag() { return m_bTemporalIdNestingFlag; } |
---|
| 1642 | Void setTemporalIdNestingFlag( Bool bValue ) { m_bTemporalIdNestingFlag = bValue; } |
---|
| 1643 | UInt getPCMBitDepthLuma () { return m_uiPCMBitDepthLuma; } |
---|
| 1644 | Void setPCMBitDepthLuma ( UInt u ) { m_uiPCMBitDepthLuma = u; } |
---|
| 1645 | UInt getPCMBitDepthChroma () { return m_uiPCMBitDepthChroma; } |
---|
| 1646 | Void setPCMBitDepthChroma ( UInt u ) { m_uiPCMBitDepthChroma = u; } |
---|
| 1647 | Void setPCMFilterDisableFlag ( Bool bValue ) { m_bPCMFilterDisableFlag = bValue; } |
---|
| 1648 | Bool getPCMFilterDisableFlag () { return m_bPCMFilterDisableFlag; } |
---|
| 1649 | |
---|
| 1650 | Bool getScalingListFlag () { return m_scalingListEnabledFlag; } |
---|
| 1651 | Void setScalingListFlag ( Bool b ) { m_scalingListEnabledFlag = b; } |
---|
[608] | 1652 | Bool getScalingListPresentFlag() { return m_scalingListPresentFlag; } |
---|
| 1653 | Void setScalingListPresentFlag( Bool b ) { m_scalingListPresentFlag = b; } |
---|
| 1654 | Void setScalingList ( TComScalingList *scalingList); |
---|
| 1655 | TComScalingList* getScalingList () { return m_scalingList; } //!< get ScalingList class pointer in SPS |
---|
[56] | 1656 | UInt getMaxDecPicBuffering (UInt tlayer) { return m_uiMaxDecPicBuffering[tlayer]; } |
---|
[872] | 1657 | Void setMaxDecPicBuffering ( UInt ui, UInt tlayer ) { assert(tlayer < MAX_TLAYER); m_uiMaxDecPicBuffering[tlayer] = ui; } |
---|
[56] | 1658 | UInt getMaxLatencyIncrease (UInt tlayer) { return m_uiMaxLatencyIncrease[tlayer]; } |
---|
| 1659 | Void setMaxLatencyIncrease ( UInt ui , UInt tlayer) { m_uiMaxLatencyIncrease[tlayer] = ui; } |
---|
| 1660 | |
---|
[608] | 1661 | Void setUseStrongIntraSmoothing (Bool bVal) {m_useStrongIntraSmoothing = bVal;} |
---|
| 1662 | Bool getUseStrongIntraSmoothing () {return m_useStrongIntraSmoothing;} |
---|
[56] | 1663 | |
---|
[608] | 1664 | Bool getVuiParametersPresentFlag() { return m_vuiParametersPresentFlag; } |
---|
| 1665 | Void setVuiParametersPresentFlag(Bool b) { m_vuiParametersPresentFlag = b; } |
---|
| 1666 | TComVUI* getVuiParameters() { return &m_vuiParameters; } |
---|
| 1667 | Void setHrdParameters( UInt frameRate, UInt numDU, UInt bitRate, Bool randomAccess ); |
---|
[210] | 1668 | |
---|
[608] | 1669 | TComPTL* getPTL() { return &m_pcPTL; } |
---|
| 1670 | #if H_MV |
---|
[976] | 1671 | Void inferSpsMaxDecPicBufferingMinus1( TComVPS* vps, Int targetOptLayerSetIdx, Int currLayerId, Bool encoder ); |
---|
[738] | 1672 | |
---|
[964] | 1673 | Void setSpsExtensionPresentFlag( Bool flag ) { m_spsExtensionPresentFlag = flag; } |
---|
| 1674 | Bool getSpsExtensionPresentFlag( ) { return m_spsExtensionPresentFlag; } |
---|
| 1675 | |
---|
| 1676 | Void setSpsRangeExtensionsFlag( Bool flag ) { m_spsRangeExtensionsFlag = flag; } |
---|
| 1677 | Bool getSpsRangeExtensionsFlag( ) { return m_spsRangeExtensionsFlag; } |
---|
| 1678 | |
---|
| 1679 | Void setSpsMultilayerExtensionFlag( Bool flag ) { m_spsMultilayerExtensionFlag = flag; } |
---|
| 1680 | Bool getSpsMultilayerExtensionFlag( ) { return m_spsMultilayerExtensionFlag; } |
---|
| 1681 | #if H_3D |
---|
| 1682 | Void setSps3dExtensionFlag( Bool flag ) { m_sps3dExtensionFlag = flag; } |
---|
| 1683 | Bool getSps3dExtensionFlag( ) { return m_sps3dExtensionFlag; } |
---|
| 1684 | |
---|
| 1685 | Void setSpsExtension5bits( Int val ) { m_spsExtension5bits = val; } |
---|
| 1686 | Int getSpsExtension5bits( ) { return m_spsExtension5bits; } |
---|
| 1687 | #else |
---|
| 1688 | Void setSpsExtension6bits( Int val ) { m_spsExtension6bits = val; } |
---|
| 1689 | Int getSpsExtension6bits( ) { return m_spsExtension6bits; } |
---|
| 1690 | #endif |
---|
| 1691 | |
---|
[622] | 1692 | Void setVPS ( TComVPS* pcVPS ) { m_pcVPS = pcVPS; } |
---|
| 1693 | TComVPS* getVPS () { return m_pcVPS; } |
---|
| 1694 | |
---|
| 1695 | Void setSpsInferScalingListFlag( Bool flag ) { m_spsInferScalingListFlag = flag; } |
---|
| 1696 | Bool getSpsInferScalingListFlag( ) { return m_spsInferScalingListFlag; } |
---|
| 1697 | |
---|
| 1698 | Void setSpsScalingListRefLayerId( Int val ) { m_spsScalingListRefLayerId = val; } |
---|
| 1699 | Int getSpsScalingListRefLayerId( ) { return m_spsScalingListRefLayerId; } |
---|
| 1700 | |
---|
| 1701 | Void setUpdateRepFormatFlag( Bool flag ) { m_updateRepFormatFlag = flag; } |
---|
| 1702 | Bool getUpdateRepFormatFlag( ) { return m_updateRepFormatFlag; } |
---|
[738] | 1703 | Void setSpsRepFormatIdx( Int val ) { m_spsRepFormatIdx = val; } |
---|
| 1704 | Int getSpsRepFormatIdx( ) { return m_spsRepFormatIdx; } |
---|
[622] | 1705 | // SPS Extension |
---|
[608] | 1706 | Void setInterViewMvVertConstraintFlag(Bool val) { m_interViewMvVertConstraintFlag = val; } |
---|
| 1707 | Bool getInterViewMvVertConstraintFlag() { return m_interViewMvVertConstraintFlag;} |
---|
[738] | 1708 | |
---|
| 1709 | Void setNumScaledRefLayerOffsets( Int val ) { m_numScaledRefLayerOffsets = val; } |
---|
| 1710 | Int getNumScaledRefLayerOffsets( ) { return m_numScaledRefLayerOffsets; } |
---|
| 1711 | |
---|
| 1712 | Void setScaledRefLayerId( Int i, Int val ) { m_scaledRefLayerId[i] = val; } |
---|
| 1713 | Int getScaledRefLayerId( Int i ) { return m_scaledRefLayerId[i]; } |
---|
| 1714 | |
---|
| 1715 | Void setScaledRefLayerLeftOffset( Int j, Int val ) { m_scaledRefLayerLeftOffset[j] = val; } |
---|
| 1716 | Int getScaledRefLayerLeftOffset( Int j ) { return m_scaledRefLayerLeftOffset[j]; } |
---|
| 1717 | |
---|
| 1718 | Void setScaledRefLayerTopOffset( Int j, Int val ) { m_scaledRefLayerTopOffset[j] = val; } |
---|
| 1719 | Int getScaledRefLayerTopOffset( Int j ) { return m_scaledRefLayerTopOffset[j]; } |
---|
| 1720 | |
---|
| 1721 | Void setScaledRefLayerRightOffset( Int j, Int val ) { m_scaledRefLayerRightOffset[j] = val; } |
---|
| 1722 | Int getScaledRefLayerRightOffset( Int j ) { return m_scaledRefLayerRightOffset[j]; } |
---|
| 1723 | |
---|
| 1724 | Void setScaledRefLayerBottomOffset( Int j, Int val ) { m_scaledRefLayerBottomOffset[j] = val; } |
---|
| 1725 | Int getScaledRefLayerBottomOffset( Int j ) { return m_scaledRefLayerBottomOffset[j]; } |
---|
[622] | 1726 | // Inference |
---|
| 1727 | Void inferRepFormat( TComVPS* vps, Int layerIdCurr ); |
---|
| 1728 | Void inferScalingList( TComSPS* spsSrc ); |
---|
[964] | 1729 | |
---|
| 1730 | // others |
---|
[976] | 1731 | Void checkRpsMaxNumPics( TComVPS* vps, Int currLayerId ); |
---|
[964] | 1732 | |
---|
[313] | 1733 | #endif |
---|
[608] | 1734 | #if H_3D_QTLPC |
---|
| 1735 | Void setUseQTL( Bool b ) { m_bUseQTL = b; } |
---|
| 1736 | Bool getUseQTL() { return m_bUseQTL; } |
---|
| 1737 | Void setUsePC ( Bool b ) { m_bUsePC = b; } |
---|
| 1738 | Bool getUsePC () { return m_bUsePC; } |
---|
| 1739 | #endif |
---|
| 1740 | #if H_MV |
---|
| 1741 | Int getLayerId () { return m_layerId; } |
---|
| 1742 | Void setLayerId ( Int val ) { m_layerId = val; } |
---|
[5] | 1743 | #endif |
---|
| 1744 | |
---|
[56] | 1745 | }; |
---|
[42] | 1746 | |
---|
[56] | 1747 | /// Reference Picture Lists class |
---|
| 1748 | class TComRefPicListModification |
---|
| 1749 | { |
---|
| 1750 | private: |
---|
| 1751 | UInt m_bRefPicListModificationFlagL0; |
---|
| 1752 | UInt m_bRefPicListModificationFlagL1; |
---|
| 1753 | UInt m_RefPicSetIdxL0[32]; |
---|
| 1754 | UInt m_RefPicSetIdxL1[32]; |
---|
| 1755 | |
---|
| 1756 | public: |
---|
| 1757 | TComRefPicListModification(); |
---|
| 1758 | virtual ~TComRefPicListModification(); |
---|
| 1759 | |
---|
| 1760 | Void create (); |
---|
| 1761 | Void destroy (); |
---|
| 1762 | |
---|
| 1763 | Bool getRefPicListModificationFlagL0() { return m_bRefPicListModificationFlagL0; } |
---|
| 1764 | Void setRefPicListModificationFlagL0(Bool flag) { m_bRefPicListModificationFlagL0 = flag; } |
---|
| 1765 | Bool getRefPicListModificationFlagL1() { return m_bRefPicListModificationFlagL1; } |
---|
| 1766 | Void setRefPicListModificationFlagL1(Bool flag) { m_bRefPicListModificationFlagL1 = flag; } |
---|
| 1767 | Void setRefPicSetIdxL0(UInt idx, UInt refPicSetIdx) { m_RefPicSetIdxL0[idx] = refPicSetIdx; } |
---|
| 1768 | UInt getRefPicSetIdxL0(UInt idx) { return m_RefPicSetIdxL0[idx]; } |
---|
| 1769 | Void setRefPicSetIdxL1(UInt idx, UInt refPicSetIdx) { m_RefPicSetIdxL1[idx] = refPicSetIdx; } |
---|
| 1770 | UInt getRefPicSetIdxL1(UInt idx) { return m_RefPicSetIdxL1[idx]; } |
---|
[608] | 1771 | #if H_MV |
---|
| 1772 | // Why not an listIdx for all members, would avoid code duplication?? |
---|
| 1773 | Void setRefPicSetIdxL(UInt li, UInt idx, UInt refPicSetIdx) {( li==0 ? m_RefPicSetIdxL0[idx] : m_RefPicSetIdxL1[idx] ) = refPicSetIdx; } |
---|
| 1774 | UInt getRefPicSetIdxL(UInt li, UInt idx ) { return ( li == 0 ) ? m_RefPicSetIdxL0[idx] : m_RefPicSetIdxL1[idx] ; } |
---|
| 1775 | Void setRefPicListModificationFlagL(UInt li, Bool flag) { ( li==0 ? m_bRefPicListModificationFlagL0 : m_bRefPicListModificationFlagL1 ) = flag; } |
---|
| 1776 | Bool getRefPicListModificationFlagL(UInt li ) { return ( li== 0) ? m_bRefPicListModificationFlagL0 : m_bRefPicListModificationFlagL1; } |
---|
| 1777 | #endif |
---|
[2] | 1778 | }; |
---|
| 1779 | |
---|
| 1780 | /// PPS class |
---|
| 1781 | class TComPPS |
---|
| 1782 | { |
---|
| 1783 | private: |
---|
[56] | 1784 | Int m_PPSId; // pic_parameter_set_id |
---|
| 1785 | Int m_SPSId; // seq_parameter_set_id |
---|
| 1786 | Int m_picInitQPMinus26; |
---|
| 1787 | Bool m_useDQP; |
---|
| 1788 | Bool m_bConstrainedIntraPred; // constrained_intra_pred_flag |
---|
[608] | 1789 | Bool m_bSliceChromaQpFlag; // slicelevel_chroma_qp_flag |
---|
| 1790 | |
---|
[56] | 1791 | // access channel |
---|
| 1792 | TComSPS* m_pcSPS; |
---|
| 1793 | UInt m_uiMaxCuDQPDepth; |
---|
| 1794 | UInt m_uiMinCuDQPSize; |
---|
| 1795 | |
---|
[608] | 1796 | Int m_chromaCbQpOffset; |
---|
| 1797 | Int m_chromaCrQpOffset; |
---|
[56] | 1798 | |
---|
[608] | 1799 | UInt m_numRefIdxL0DefaultActive; |
---|
| 1800 | UInt m_numRefIdxL1DefaultActive; |
---|
[56] | 1801 | |
---|
[2] | 1802 | Bool m_bUseWeightPred; // Use of Weighting Prediction (P_SLICE) |
---|
[608] | 1803 | Bool m_useWeightedBiPred; // Use of Weighting Bi-Prediction (B_SLICE) |
---|
[56] | 1804 | Bool m_OutputFlagPresentFlag; // Indicates the presence of output_flag in slice header |
---|
| 1805 | |
---|
[608] | 1806 | Bool m_TransquantBypassEnableFlag; // Indicates presence of cu_transquant_bypass_flag in CUs. |
---|
| 1807 | Bool m_useTransformSkip; |
---|
| 1808 | Bool m_dependentSliceSegmentsEnabledFlag; //!< Indicates the presence of dependent slices |
---|
| 1809 | Bool m_tilesEnabledFlag; //!< Indicates the presence of tiles |
---|
| 1810 | Bool m_entropyCodingSyncEnabledFlag; //!< Indicates the presence of wavefronts |
---|
| 1811 | |
---|
| 1812 | Bool m_loopFilterAcrossTilesEnabledFlag; |
---|
| 1813 | Int m_uniformSpacingFlag; |
---|
[56] | 1814 | Int m_iNumColumnsMinus1; |
---|
| 1815 | UInt* m_puiColumnWidth; |
---|
| 1816 | Int m_iNumRowsMinus1; |
---|
| 1817 | UInt* m_puiRowHeight; |
---|
[608] | 1818 | |
---|
[56] | 1819 | Int m_iNumSubstreams; |
---|
[5] | 1820 | |
---|
[56] | 1821 | Int m_signHideFlag; |
---|
| 1822 | |
---|
| 1823 | Bool m_cabacInitPresentFlag; |
---|
| 1824 | UInt m_encCABACTableIdx; // Used to transmit table selection across slices |
---|
[608] | 1825 | |
---|
| 1826 | Bool m_sliceHeaderExtensionPresentFlag; |
---|
| 1827 | Bool m_loopFilterAcrossSlicesEnabledFlag; |
---|
| 1828 | Bool m_deblockingFilterControlPresentFlag; |
---|
| 1829 | Bool m_deblockingFilterOverrideEnabledFlag; |
---|
| 1830 | Bool m_picDisableDeblockingFilterFlag; |
---|
| 1831 | Int m_deblockingFilterBetaOffsetDiv2; //< beta offset for deblocking filter |
---|
| 1832 | Int m_deblockingFilterTcOffsetDiv2; //< tc offset for deblocking filter |
---|
| 1833 | Bool m_scalingListPresentFlag; |
---|
| 1834 | TComScalingList* m_scalingList; //!< ScalingList class pointer |
---|
| 1835 | Bool m_listsModificationPresentFlag; |
---|
[56] | 1836 | UInt m_log2ParallelMergeLevelMinus2; |
---|
[608] | 1837 | Int m_numExtraSliceHeaderBits; |
---|
| 1838 | |
---|
[622] | 1839 | #if H_MV |
---|
| 1840 | Int m_layerId; |
---|
| 1841 | Bool m_ppsInferScalingListFlag; |
---|
| 1842 | Int m_ppsScalingListRefLayerId; |
---|
[872] | 1843 | |
---|
[964] | 1844 | Bool m_ppsRangeExtensionsFlag; |
---|
| 1845 | Bool m_ppsMultilayerExtensionFlag; |
---|
| 1846 | #if !H_3D |
---|
| 1847 | Int m_ppsExtension6bits; |
---|
| 1848 | #else |
---|
| 1849 | Bool m_pps3dExtensionFlag; |
---|
| 1850 | Int m_ppsExtension5bits; |
---|
| 1851 | #endif |
---|
| 1852 | |
---|
[872] | 1853 | Bool m_pocResetInfoPresentFlag; |
---|
| 1854 | #endif |
---|
[758] | 1855 | |
---|
[773] | 1856 | #if H_3D |
---|
[758] | 1857 | TComDLT* m_pcDLT; |
---|
| 1858 | #endif |
---|
| 1859 | |
---|
[2] | 1860 | public: |
---|
| 1861 | TComPPS(); |
---|
| 1862 | virtual ~TComPPS(); |
---|
[56] | 1863 | |
---|
| 1864 | Int getPPSId () { return m_PPSId; } |
---|
| 1865 | Void setPPSId (Int i) { m_PPSId = i; } |
---|
| 1866 | Int getSPSId () { return m_SPSId; } |
---|
| 1867 | Void setSPSId (Int i) { m_SPSId = i; } |
---|
| 1868 | |
---|
| 1869 | Int getPicInitQPMinus26 () { return m_picInitQPMinus26; } |
---|
| 1870 | Void setPicInitQPMinus26 ( Int i ) { m_picInitQPMinus26 = i; } |
---|
| 1871 | Bool getUseDQP () { return m_useDQP; } |
---|
| 1872 | Void setUseDQP ( Bool b ) { m_useDQP = b; } |
---|
[2] | 1873 | Bool getConstrainedIntraPred () { return m_bConstrainedIntraPred; } |
---|
| 1874 | Void setConstrainedIntraPred ( Bool b ) { m_bConstrainedIntraPred = b; } |
---|
[608] | 1875 | Bool getSliceChromaQpFlag () { return m_bSliceChromaQpFlag; } |
---|
| 1876 | Void setSliceChromaQpFlag ( Bool b ) { m_bSliceChromaQpFlag = b; } |
---|
[56] | 1877 | |
---|
| 1878 | Void setSPS ( TComSPS* pcSPS ) { m_pcSPS = pcSPS; } |
---|
| 1879 | TComSPS* getSPS () { return m_pcSPS; } |
---|
| 1880 | Void setMaxCuDQPDepth ( UInt u ) { m_uiMaxCuDQPDepth = u; } |
---|
| 1881 | UInt getMaxCuDQPDepth () { return m_uiMaxCuDQPDepth;} |
---|
| 1882 | Void setMinCuDQPSize ( UInt u ) { m_uiMinCuDQPSize = u; } |
---|
| 1883 | UInt getMinCuDQPSize () { return m_uiMinCuDQPSize; } |
---|
[2] | 1884 | |
---|
[773] | 1885 | #if H_3D |
---|
[758] | 1886 | Void setDLT ( TComDLT* pcDLT ) { m_pcDLT = pcDLT; } |
---|
| 1887 | TComDLT* getDLT () { return m_pcDLT; } |
---|
| 1888 | #endif |
---|
| 1889 | |
---|
[608] | 1890 | Void setChromaCbQpOffset( Int i ) { m_chromaCbQpOffset = i; } |
---|
| 1891 | Int getChromaCbQpOffset() { return m_chromaCbQpOffset; } |
---|
| 1892 | Void setChromaCrQpOffset( Int i ) { m_chromaCrQpOffset = i; } |
---|
| 1893 | Int getChromaCrQpOffset() { return m_chromaCrQpOffset; } |
---|
[56] | 1894 | |
---|
[608] | 1895 | Void setNumRefIdxL0DefaultActive(UInt ui) { m_numRefIdxL0DefaultActive=ui; } |
---|
| 1896 | UInt getNumRefIdxL0DefaultActive() { return m_numRefIdxL0DefaultActive; } |
---|
| 1897 | Void setNumRefIdxL1DefaultActive(UInt ui) { m_numRefIdxL1DefaultActive=ui; } |
---|
| 1898 | UInt getNumRefIdxL1DefaultActive() { return m_numRefIdxL1DefaultActive; } |
---|
| 1899 | |
---|
[56] | 1900 | Bool getUseWP () { return m_bUseWeightPred; } |
---|
[608] | 1901 | Bool getWPBiPred () { return m_useWeightedBiPred; } |
---|
[56] | 1902 | Void setUseWP ( Bool b ) { m_bUseWeightPred = b; } |
---|
[608] | 1903 | Void setWPBiPred ( Bool b ) { m_useWeightedBiPred = b; } |
---|
[56] | 1904 | Void setOutputFlagPresentFlag( Bool b ) { m_OutputFlagPresentFlag = b; } |
---|
| 1905 | Bool getOutputFlagPresentFlag() { return m_OutputFlagPresentFlag; } |
---|
[608] | 1906 | Void setTransquantBypassEnableFlag( Bool b ) { m_TransquantBypassEnableFlag = b; } |
---|
| 1907 | Bool getTransquantBypassEnableFlag() { return m_TransquantBypassEnableFlag; } |
---|
[56] | 1908 | |
---|
[608] | 1909 | Bool getUseTransformSkip () { return m_useTransformSkip; } |
---|
| 1910 | Void setUseTransformSkip ( Bool b ) { m_useTransformSkip = b; } |
---|
| 1911 | |
---|
| 1912 | Void setLoopFilterAcrossTilesEnabledFlag (Bool b) { m_loopFilterAcrossTilesEnabledFlag = b; } |
---|
| 1913 | Bool getLoopFilterAcrossTilesEnabledFlag () { return m_loopFilterAcrossTilesEnabledFlag; } |
---|
| 1914 | Bool getDependentSliceSegmentsEnabledFlag() const { return m_dependentSliceSegmentsEnabledFlag; } |
---|
| 1915 | Void setDependentSliceSegmentsEnabledFlag(Bool val) { m_dependentSliceSegmentsEnabledFlag = val; } |
---|
| 1916 | Bool getTilesEnabledFlag() const { return m_tilesEnabledFlag; } |
---|
| 1917 | Void setTilesEnabledFlag(Bool val) { m_tilesEnabledFlag = val; } |
---|
| 1918 | Bool getEntropyCodingSyncEnabledFlag() const { return m_entropyCodingSyncEnabledFlag; } |
---|
| 1919 | Void setEntropyCodingSyncEnabledFlag(Bool val) { m_entropyCodingSyncEnabledFlag = val; } |
---|
| 1920 | Void setUniformSpacingFlag ( Bool b ) { m_uniformSpacingFlag = b; } |
---|
| 1921 | Bool getUniformSpacingFlag () { return m_uniformSpacingFlag; } |
---|
[56] | 1922 | Void setNumColumnsMinus1 ( Int i ) { m_iNumColumnsMinus1 = i; } |
---|
| 1923 | Int getNumColumnsMinus1 () { return m_iNumColumnsMinus1; } |
---|
| 1924 | Void setColumnWidth ( UInt* columnWidth ) |
---|
| 1925 | { |
---|
[608] | 1926 | if( m_uniformSpacingFlag == 0 && m_iNumColumnsMinus1 > 0 ) |
---|
[56] | 1927 | { |
---|
| 1928 | m_puiColumnWidth = new UInt[ m_iNumColumnsMinus1 ]; |
---|
[42] | 1929 | |
---|
[56] | 1930 | for(Int i=0; i<m_iNumColumnsMinus1; i++) |
---|
| 1931 | { |
---|
| 1932 | m_puiColumnWidth[i] = columnWidth[i]; |
---|
| 1933 | } |
---|
| 1934 | } |
---|
| 1935 | } |
---|
| 1936 | UInt getColumnWidth (UInt columnIdx) { return *( m_puiColumnWidth + columnIdx ); } |
---|
| 1937 | Void setNumRowsMinus1( Int i ) { m_iNumRowsMinus1 = i; } |
---|
| 1938 | Int getNumRowsMinus1() { return m_iNumRowsMinus1; } |
---|
| 1939 | Void setRowHeight ( UInt* rowHeight ) |
---|
| 1940 | { |
---|
[608] | 1941 | if( m_uniformSpacingFlag == 0 && m_iNumRowsMinus1 > 0 ) |
---|
[56] | 1942 | { |
---|
| 1943 | m_puiRowHeight = new UInt[ m_iNumRowsMinus1 ]; |
---|
| 1944 | |
---|
| 1945 | for(Int i=0; i<m_iNumRowsMinus1; i++) |
---|
| 1946 | { |
---|
| 1947 | m_puiRowHeight[i] = rowHeight[i]; |
---|
| 1948 | } |
---|
| 1949 | } |
---|
| 1950 | } |
---|
| 1951 | UInt getRowHeight (UInt rowIdx) { return *( m_puiRowHeight + rowIdx ); } |
---|
| 1952 | Void setNumSubstreams(Int iNumSubstreams) { m_iNumSubstreams = iNumSubstreams; } |
---|
| 1953 | Int getNumSubstreams() { return m_iNumSubstreams; } |
---|
| 1954 | |
---|
| 1955 | Void setSignHideFlag( Int signHideFlag ) { m_signHideFlag = signHideFlag; } |
---|
| 1956 | Int getSignHideFlag() { return m_signHideFlag; } |
---|
| 1957 | |
---|
| 1958 | Void setCabacInitPresentFlag( Bool flag ) { m_cabacInitPresentFlag = flag; } |
---|
| 1959 | Void setEncCABACTableIdx( Int idx ) { m_encCABACTableIdx = idx; } |
---|
| 1960 | Bool getCabacInitPresentFlag() { return m_cabacInitPresentFlag; } |
---|
| 1961 | UInt getEncCABACTableIdx() { return m_encCABACTableIdx; } |
---|
[608] | 1962 | Void setDeblockingFilterControlPresentFlag( Bool val ) { m_deblockingFilterControlPresentFlag = val; } |
---|
| 1963 | Bool getDeblockingFilterControlPresentFlag() { return m_deblockingFilterControlPresentFlag; } |
---|
| 1964 | Void setDeblockingFilterOverrideEnabledFlag( Bool val ) { m_deblockingFilterOverrideEnabledFlag = val; } |
---|
| 1965 | Bool getDeblockingFilterOverrideEnabledFlag() { return m_deblockingFilterOverrideEnabledFlag; } |
---|
| 1966 | Void setPicDisableDeblockingFilterFlag(Bool val) { m_picDisableDeblockingFilterFlag = val; } //!< set offset for deblocking filter disabled |
---|
| 1967 | Bool getPicDisableDeblockingFilterFlag() { return m_picDisableDeblockingFilterFlag; } //!< get offset for deblocking filter disabled |
---|
| 1968 | Void setDeblockingFilterBetaOffsetDiv2(Int val) { m_deblockingFilterBetaOffsetDiv2 = val; } //!< set beta offset for deblocking filter |
---|
| 1969 | Int getDeblockingFilterBetaOffsetDiv2() { return m_deblockingFilterBetaOffsetDiv2; } //!< get beta offset for deblocking filter |
---|
| 1970 | Void setDeblockingFilterTcOffsetDiv2(Int val) { m_deblockingFilterTcOffsetDiv2 = val; } //!< set tc offset for deblocking filter |
---|
| 1971 | Int getDeblockingFilterTcOffsetDiv2() { return m_deblockingFilterTcOffsetDiv2; } //!< get tc offset for deblocking filter |
---|
| 1972 | Bool getScalingListPresentFlag() { return m_scalingListPresentFlag; } |
---|
| 1973 | Void setScalingListPresentFlag( Bool b ) { m_scalingListPresentFlag = b; } |
---|
| 1974 | Void setScalingList ( TComScalingList *scalingList); |
---|
| 1975 | TComScalingList* getScalingList () { return m_scalingList; } //!< get ScalingList class pointer in PPS |
---|
| 1976 | Bool getListsModificationPresentFlag () { return m_listsModificationPresentFlag; } |
---|
| 1977 | Void setListsModificationPresentFlag ( Bool b ) { m_listsModificationPresentFlag = b; } |
---|
[56] | 1978 | UInt getLog2ParallelMergeLevelMinus2 () { return m_log2ParallelMergeLevelMinus2; } |
---|
| 1979 | Void setLog2ParallelMergeLevelMinus2 (UInt mrgLevel) { m_log2ParallelMergeLevelMinus2 = mrgLevel; } |
---|
[608] | 1980 | Int getNumExtraSliceHeaderBits() { return m_numExtraSliceHeaderBits; } |
---|
| 1981 | Void setNumExtraSliceHeaderBits(Int i) { m_numExtraSliceHeaderBits = i; } |
---|
| 1982 | Void setLoopFilterAcrossSlicesEnabledFlag ( Bool bValue ) { m_loopFilterAcrossSlicesEnabledFlag = bValue; } |
---|
| 1983 | Bool getLoopFilterAcrossSlicesEnabledFlag () { return m_loopFilterAcrossSlicesEnabledFlag; } |
---|
| 1984 | Bool getSliceHeaderExtensionPresentFlag () { return m_sliceHeaderExtensionPresentFlag; } |
---|
| 1985 | Void setSliceHeaderExtensionPresentFlag (Bool val) { m_sliceHeaderExtensionPresentFlag = val; } |
---|
[622] | 1986 | #if H_MV |
---|
| 1987 | Void setLayerId( Int val ) { m_layerId = val; } |
---|
| 1988 | Int getLayerId( ) { return m_layerId; } |
---|
| 1989 | |
---|
| 1990 | Void setPpsInferScalingListFlag( Bool flag ) { m_ppsInferScalingListFlag = flag; } |
---|
| 1991 | Bool getPpsInferScalingListFlag( ) { return m_ppsInferScalingListFlag; } |
---|
| 1992 | |
---|
| 1993 | Void setPpsScalingListRefLayerId( Int val ) { m_ppsScalingListRefLayerId = val; } |
---|
| 1994 | Int getPpsScalingListRefLayerId( ) { return m_ppsScalingListRefLayerId; } |
---|
[872] | 1995 | |
---|
[964] | 1996 | Void setPpsRangeExtensionsFlag( Bool flag ) { m_ppsRangeExtensionsFlag = flag; } |
---|
| 1997 | Bool getPpsRangeExtensionsFlag( ) { return m_ppsRangeExtensionsFlag; } |
---|
| 1998 | |
---|
| 1999 | Void setPpsMultilayerExtensionFlag( Bool flag ) { m_ppsMultilayerExtensionFlag = flag; } |
---|
| 2000 | Bool getPpsMultilayerExtensionFlag( ) { return m_ppsMultilayerExtensionFlag; } |
---|
| 2001 | |
---|
| 2002 | #if !H_3D |
---|
| 2003 | Void setPpsExtension6bits( Int val ) { m_ppsExtension6bits = val; } |
---|
| 2004 | Int getPpsExtension6bits( ) { return m_ppsExtension6bits; } |
---|
| 2005 | #else |
---|
| 2006 | Void setPps3dExtensionFlag( Bool flag ) { m_pps3dExtensionFlag = flag; } |
---|
| 2007 | Bool getPps3dExtensionFlag( ) { return m_pps3dExtensionFlag; } |
---|
| 2008 | |
---|
| 2009 | Void setPpsExtension5bits( Int val ) { m_ppsExtension5bits = val; } |
---|
| 2010 | Int getPpsExtension5bits( ) { return m_ppsExtension5bits; } |
---|
| 2011 | #endif |
---|
[872] | 2012 | |
---|
| 2013 | Void setPocResetInfoPresentFlag( Bool flag ) { m_pocResetInfoPresentFlag = flag; } |
---|
| 2014 | Bool getPocResetInfoPresentFlag( ) { return m_pocResetInfoPresentFlag; } |
---|
| 2015 | #endif |
---|
[2] | 2016 | }; |
---|
| 2017 | |
---|
[608] | 2018 | typedef struct |
---|
[56] | 2019 | { |
---|
[2] | 2020 | // Explicit weighted prediction parameters parsed in slice header, |
---|
| 2021 | // or Implicit weighted prediction parameters (8 bits depth values). |
---|
| 2022 | Bool bPresentFlag; |
---|
| 2023 | UInt uiLog2WeightDenom; |
---|
| 2024 | Int iWeight; |
---|
| 2025 | Int iOffset; |
---|
| 2026 | |
---|
| 2027 | // Weighted prediction scaling values built from above parameters (bitdepth scaled): |
---|
| 2028 | Int w, o, offset, shift, round; |
---|
| 2029 | } wpScalingParam; |
---|
| 2030 | |
---|
[608] | 2031 | typedef struct |
---|
| 2032 | { |
---|
[2] | 2033 | Int64 iAC; |
---|
| 2034 | Int64 iDC; |
---|
| 2035 | } wpACDCParam; |
---|
| 2036 | |
---|
| 2037 | /// slice header class |
---|
| 2038 | class TComSlice |
---|
| 2039 | { |
---|
[56] | 2040 | |
---|
[2] | 2041 | private: |
---|
| 2042 | // Bitstream writing |
---|
[608] | 2043 | Bool m_saoEnabledFlag; |
---|
| 2044 | Bool m_saoEnabledFlagChroma; ///< SAO Cb&Cr enabled flag |
---|
[56] | 2045 | Int m_iPPSId; ///< picture parameter set ID |
---|
| 2046 | Bool m_PicOutputFlag; ///< pic_output_flag |
---|
[976] | 2047 | #if H_MV |
---|
[964] | 2048 | Int m_slicePicOrderCntLsb; |
---|
| 2049 | #endif |
---|
[56] | 2050 | Int m_iPOC; |
---|
[622] | 2051 | #if H_MV |
---|
| 2052 | Int m_iPOCBeforeReset; |
---|
| 2053 | #endif |
---|
[56] | 2054 | Int m_iLastIDR; |
---|
[655] | 2055 | Int m_iAssociatedIRAP; |
---|
| 2056 | NalUnitType m_iAssociatedIRAPType; |
---|
| 2057 | static Int m_prevTid0POC; |
---|
[56] | 2058 | TComReferencePictureSet *m_pcRPS; |
---|
| 2059 | TComReferencePictureSet m_LocalRPS; |
---|
| 2060 | Int m_iBDidx; |
---|
| 2061 | TComRefPicListModification m_RefPicListModification; |
---|
[608] | 2062 | NalUnitType m_eNalUnitType; ///< Nal unit type for the slice |
---|
[2] | 2063 | SliceType m_eSliceType; |
---|
| 2064 | Int m_iSliceQp; |
---|
[608] | 2065 | Bool m_dependentSliceSegmentFlag; |
---|
[56] | 2066 | #if ADAPTIVE_QP_SELECTION |
---|
| 2067 | Int m_iSliceQpBase; |
---|
| 2068 | #endif |
---|
[608] | 2069 | Bool m_deblockingFilterDisable; |
---|
| 2070 | Bool m_deblockingFilterOverrideFlag; //< offsets for deblocking filter inherit from PPS |
---|
| 2071 | Int m_deblockingFilterBetaOffsetDiv2; //< beta offset for deblocking filter |
---|
| 2072 | Int m_deblockingFilterTcOffsetDiv2; //< tc offset for deblocking filter |
---|
| 2073 | Int m_list1IdxToList0Idx[MAX_NUM_REF]; |
---|
| 2074 | Int m_aiNumRefIdx [2]; // for multiple reference of current slice |
---|
[2] | 2075 | |
---|
[56] | 2076 | Bool m_bCheckLDC; |
---|
| 2077 | |
---|
[2] | 2078 | // Data |
---|
| 2079 | Int m_iSliceQpDelta; |
---|
[608] | 2080 | Int m_iSliceQpDeltaCb; |
---|
| 2081 | Int m_iSliceQpDeltaCr; |
---|
| 2082 | TComPic* m_apcRefPicList [2][MAX_NUM_REF+1]; |
---|
| 2083 | Int m_aiRefPOCList [2][MAX_NUM_REF+1]; |
---|
| 2084 | #if H_MV |
---|
| 2085 | Int m_aiRefLayerIdList[2][MAX_NUM_REF+1]; |
---|
| 2086 | #endif |
---|
| 2087 | Bool m_bIsUsedAsLongTerm[2][MAX_NUM_REF+1]; |
---|
[2] | 2088 | Int m_iDepth; |
---|
[56] | 2089 | |
---|
[2] | 2090 | // referenced slice? |
---|
| 2091 | Bool m_bRefenced; |
---|
[56] | 2092 | |
---|
[2] | 2093 | // access channel |
---|
[77] | 2094 | TComVPS* m_pcVPS; |
---|
[2] | 2095 | TComSPS* m_pcSPS; |
---|
| 2096 | TComPPS* m_pcPPS; |
---|
| 2097 | TComPic* m_pcPic; |
---|
[56] | 2098 | #if ADAPTIVE_QP_SELECTION |
---|
| 2099 | TComTrQuant* m_pcTrQuant; |
---|
| 2100 | #endif |
---|
[608] | 2101 | UInt m_colFromL0Flag; // collocated picture from List0 flag |
---|
[56] | 2102 | |
---|
[964] | 2103 | #if SETTING_NO_OUT_PIC_PRIOR |
---|
| 2104 | Bool m_noOutputPriorPicsFlag; |
---|
| 2105 | Bool m_noRaslOutputFlag; |
---|
| 2106 | Bool m_handleCraAsBlaFlag; |
---|
| 2107 | #endif |
---|
| 2108 | |
---|
[56] | 2109 | UInt m_colRefIdx; |
---|
[608] | 2110 | UInt m_maxNumMergeCand; |
---|
[5] | 2111 | |
---|
[872] | 2112 | Double m_lambdas[3]; |
---|
[608] | 2113 | |
---|
[2] | 2114 | Bool m_abEqualRef [2][MAX_NUM_REF][MAX_NUM_REF]; |
---|
[56] | 2115 | UInt m_uiTLayer; |
---|
| 2116 | Bool m_bTLayerSwitchingFlag; |
---|
[2] | 2117 | |
---|
[608] | 2118 | UInt m_sliceMode; |
---|
| 2119 | UInt m_sliceArgument; |
---|
| 2120 | UInt m_sliceCurStartCUAddr; |
---|
| 2121 | UInt m_sliceCurEndCUAddr; |
---|
| 2122 | UInt m_sliceIdx; |
---|
| 2123 | UInt m_sliceSegmentMode; |
---|
| 2124 | UInt m_sliceSegmentArgument; |
---|
| 2125 | UInt m_sliceSegmentCurStartCUAddr; |
---|
| 2126 | UInt m_sliceSegmentCurEndCUAddr; |
---|
| 2127 | Bool m_nextSlice; |
---|
| 2128 | Bool m_nextSliceSegment; |
---|
| 2129 | UInt m_sliceBits; |
---|
| 2130 | UInt m_sliceSegmentBits; |
---|
[56] | 2131 | Bool m_bFinalized; |
---|
[2] | 2132 | |
---|
| 2133 | wpScalingParam m_weightPredTable[2][MAX_NUM_REF][3]; // [REF_PIC_LIST_0 or REF_PIC_LIST_1][refIdx][0:Y, 1:U, 2:V] |
---|
[56] | 2134 | wpACDCParam m_weightACDCParam[3]; // [0:Y, 1:U, 2:V] |
---|
| 2135 | |
---|
[608] | 2136 | std::vector<UInt> m_tileByteLocation; |
---|
[56] | 2137 | UInt m_uiTileOffstForMultES; |
---|
| 2138 | |
---|
| 2139 | UInt* m_puiSubstreamSizes; |
---|
| 2140 | TComScalingList* m_scalingList; //!< pointer of quantization matrix |
---|
| 2141 | Bool m_cabacInitFlag; |
---|
[5] | 2142 | |
---|
[56] | 2143 | Bool m_bLMvdL1Zero; |
---|
| 2144 | Int m_numEntryPointOffsets; |
---|
[608] | 2145 | Bool m_temporalLayerNonReferenceFlag; |
---|
| 2146 | Bool m_LFCrossSliceBoundaryFlag; |
---|
[56] | 2147 | |
---|
[608] | 2148 | Bool m_enableTMVPFlag; |
---|
| 2149 | #if H_MV |
---|
[622] | 2150 | std::vector<TComPic*>* m_refPicSetInterLayer0; |
---|
| 2151 | std::vector<TComPic*>* m_refPicSetInterLayer1; |
---|
| 2152 | Int m_layerId; |
---|
| 2153 | Int m_viewId; |
---|
| 2154 | Int m_viewIndex; |
---|
| 2155 | #if H_3D |
---|
| 2156 | Bool m_isDepth; |
---|
| 2157 | #endif |
---|
[56] | 2158 | |
---|
[608] | 2159 | // Additional slice header syntax elements |
---|
[872] | 2160 | #if !H_MV_HLS7_GEN |
---|
[622] | 2161 | Bool m_pocResetFlag; |
---|
[872] | 2162 | #endif |
---|
[738] | 2163 | Bool m_crossLayerBlaFlag; |
---|
[608] | 2164 | Bool m_discardableFlag; |
---|
| 2165 | Bool m_interLayerPredEnabledFlag; |
---|
| 2166 | Int m_numInterLayerRefPicsMinus1; |
---|
| 2167 | Int m_interLayerPredLayerIdc [MAX_NUM_LAYERS]; |
---|
[872] | 2168 | |
---|
| 2169 | Int m_sliceSegmentHeaderExtensionLength; |
---|
| 2170 | Int m_pocResetIdc; |
---|
| 2171 | Int m_pocResetPeriodId; |
---|
| 2172 | Bool m_fullPocResetFlag; |
---|
| 2173 | Int m_pocLsbVal; |
---|
| 2174 | Bool m_pocMsbValPresentFlag; |
---|
| 2175 | Int m_pocMsbVal; |
---|
| 2176 | Bool m_pocMsbValRequiredFlag; |
---|
| 2177 | |
---|
| 2178 | #if H_3D |
---|
[608] | 2179 | Int m_aaiCodedScale [2][MAX_NUM_LAYERS]; |
---|
| 2180 | Int m_aaiCodedOffset[2][MAX_NUM_LAYERS]; |
---|
[872] | 2181 | #endif |
---|
[608] | 2182 | #if H_3D_TMVP |
---|
| 2183 | Int m_aiAlterRefIdx [2]; |
---|
[189] | 2184 | #endif |
---|
[608] | 2185 | #if H_3D_ARP |
---|
[724] | 2186 | Bool m_arpRefPicAvailable[2][MAX_NUM_LAYERS]; |
---|
[608] | 2187 | TComList<TComPic*> * m_pBaseViewRefPicList[MAX_NUM_LAYERS]; |
---|
[443] | 2188 | UInt m_nARPStepNum; |
---|
[724] | 2189 | Int m_aiFirstTRefIdx [2]; |
---|
[443] | 2190 | #endif |
---|
[608] | 2191 | #if H_3D_IC |
---|
| 2192 | Bool m_bApplyIC; |
---|
| 2193 | Bool m_icSkipParseFlag; |
---|
[296] | 2194 | #endif |
---|
[608] | 2195 | #if H_3D |
---|
| 2196 | TComPic* m_ivPicsCurrPoc [2][MAX_NUM_LAYERS]; |
---|
| 2197 | Int** m_depthToDisparityB; |
---|
| 2198 | Int** m_depthToDisparityF; |
---|
[443] | 2199 | #endif |
---|
[296] | 2200 | #endif |
---|
[833] | 2201 | |
---|
[884] | 2202 | #if H_3D_DDD |
---|
[833] | 2203 | Int m_aiDDDInvScale [MAX_NUM_LAYERS]; |
---|
| 2204 | Int m_aiDDDInvOffset[MAX_NUM_LAYERS]; |
---|
| 2205 | UInt m_aiDDDShift [MAX_NUM_LAYERS]; |
---|
| 2206 | #endif |
---|
[983] | 2207 | #if MTK_SINGLE_DEPTH_MODE_I0095 |
---|
| 2208 | Bool m_bApplySingleDepthMode; |
---|
| 2209 | #endif |
---|
[2] | 2210 | public: |
---|
| 2211 | TComSlice(); |
---|
[608] | 2212 | virtual ~TComSlice(); |
---|
[2] | 2213 | Void initSlice (); |
---|
[5] | 2214 | |
---|
[77] | 2215 | Void setVPS ( TComVPS* pcVPS ) { m_pcVPS = pcVPS; } |
---|
| 2216 | TComVPS* getVPS () { return m_pcVPS; } |
---|
[2] | 2217 | Void setSPS ( TComSPS* pcSPS ) { m_pcSPS = pcSPS; } |
---|
| 2218 | TComSPS* getSPS () { return m_pcSPS; } |
---|
[56] | 2219 | |
---|
| 2220 | Void setPPS ( TComPPS* pcPPS ) { assert(pcPPS!=NULL); m_pcPPS = pcPPS; m_iPPSId = pcPPS->getPPSId(); } |
---|
[2] | 2221 | TComPPS* getPPS () { return m_pcPPS; } |
---|
[5] | 2222 | |
---|
[56] | 2223 | #if ADAPTIVE_QP_SELECTION |
---|
| 2224 | Void setTrQuant ( TComTrQuant* pcTrQuant ) { m_pcTrQuant = pcTrQuant; } |
---|
| 2225 | TComTrQuant* getTrQuant () { return m_pcTrQuant; } |
---|
| 2226 | #endif |
---|
| 2227 | |
---|
| 2228 | Void setPPSId ( Int PPSId ) { m_iPPSId = PPSId; } |
---|
| 2229 | Int getPPSId () { return m_iPPSId; } |
---|
| 2230 | Void setPicOutputFlag( Bool b ) { m_PicOutputFlag = b; } |
---|
| 2231 | Bool getPicOutputFlag() { return m_PicOutputFlag; } |
---|
[976] | 2232 | #if H_MV |
---|
[964] | 2233 | Void setSlicePicOrderCntLsb( Int i ) { m_slicePicOrderCntLsb = i; }; |
---|
| 2234 | Int getSlicePicOrderCntLsb( ) { return m_slicePicOrderCntLsb; }; |
---|
| 2235 | #endif |
---|
[56] | 2236 | Void setSaoEnabledFlag(Bool s) {m_saoEnabledFlag =s; } |
---|
| 2237 | Bool getSaoEnabledFlag() { return m_saoEnabledFlag; } |
---|
[443] | 2238 | Void setSaoEnabledFlagChroma(Bool s) {m_saoEnabledFlagChroma =s; } //!< set SAO Cb&Cr enabled flag |
---|
| 2239 | Bool getSaoEnabledFlagChroma() { return m_saoEnabledFlagChroma; } //!< get SAO Cb&Cr enabled flag |
---|
[56] | 2240 | Void setRPS ( TComReferencePictureSet *pcRPS ) { m_pcRPS = pcRPS; } |
---|
| 2241 | TComReferencePictureSet* getRPS () { return m_pcRPS; } |
---|
| 2242 | TComReferencePictureSet* getLocalRPS () { return &m_LocalRPS; } |
---|
| 2243 | |
---|
| 2244 | Void setRPSidx ( Int iBDidx ) { m_iBDidx = iBDidx; } |
---|
| 2245 | Int getRPSidx () { return m_iBDidx; } |
---|
[655] | 2246 | Int getPrevTid0POC () { return m_prevTid0POC; } |
---|
[56] | 2247 | TComRefPicListModification* getRefPicListModification() { return &m_RefPicListModification; } |
---|
| 2248 | Void setLastIDR(Int iIDRPOC) { m_iLastIDR = iIDRPOC; } |
---|
| 2249 | Int getLastIDR() { return m_iLastIDR; } |
---|
[655] | 2250 | Void setAssociatedIRAPPOC(Int iAssociatedIRAPPOC) { m_iAssociatedIRAP = iAssociatedIRAPPOC; } |
---|
| 2251 | Int getAssociatedIRAPPOC() { return m_iAssociatedIRAP; } |
---|
| 2252 | Void setAssociatedIRAPType(NalUnitType associatedIRAPType) { m_iAssociatedIRAPType = associatedIRAPType; } |
---|
| 2253 | NalUnitType getAssociatedIRAPType() { return m_iAssociatedIRAPType; } |
---|
[2] | 2254 | SliceType getSliceType () { return m_eSliceType; } |
---|
| 2255 | Int getPOC () { return m_iPOC; } |
---|
[56] | 2256 | Int getSliceQp () { return m_iSliceQp; } |
---|
[608] | 2257 | Bool getDependentSliceSegmentFlag() const { return m_dependentSliceSegmentFlag; } |
---|
| 2258 | void setDependentSliceSegmentFlag(Bool val) { m_dependentSliceSegmentFlag = val; } |
---|
[56] | 2259 | #if ADAPTIVE_QP_SELECTION |
---|
| 2260 | Int getSliceQpBase () { return m_iSliceQpBase; } |
---|
[21] | 2261 | #endif |
---|
[2] | 2262 | Int getSliceQpDelta () { return m_iSliceQpDelta; } |
---|
[608] | 2263 | Int getSliceQpDeltaCb () { return m_iSliceQpDeltaCb; } |
---|
| 2264 | Int getSliceQpDeltaCr () { return m_iSliceQpDeltaCr; } |
---|
| 2265 | Bool getDeblockingFilterDisable() { return m_deblockingFilterDisable; } |
---|
| 2266 | Bool getDeblockingFilterOverrideFlag() { return m_deblockingFilterOverrideFlag; } |
---|
| 2267 | Int getDeblockingFilterBetaOffsetDiv2() { return m_deblockingFilterBetaOffsetDiv2; } |
---|
| 2268 | Int getDeblockingFilterTcOffsetDiv2() { return m_deblockingFilterTcOffsetDiv2; } |
---|
[56] | 2269 | |
---|
[2] | 2270 | Int getNumRefIdx ( RefPicList e ) { return m_aiNumRefIdx[e]; } |
---|
| 2271 | TComPic* getPic () { return m_pcPic; } |
---|
| 2272 | TComPic* getRefPic ( RefPicList e, Int iRefIdx) { return m_apcRefPicList[e][iRefIdx]; } |
---|
| 2273 | Int getRefPOC ( RefPicList e, Int iRefIdx) { return m_aiRefPOCList[e][iRefIdx]; } |
---|
[608] | 2274 | #if H_3D |
---|
| 2275 | TComPic* getIvPic ( Bool depthFlag, Int viewIndex){ return m_ivPicsCurrPoc[ depthFlag ? 1 : 0 ][ viewIndex ]; } |
---|
| 2276 | #endif |
---|
[622] | 2277 | #if H_3D |
---|
[608] | 2278 | TComPic* getTexturePic () { return m_ivPicsCurrPoc[0][ m_viewIndex ]; } |
---|
| 2279 | #endif |
---|
[983] | 2280 | #if MTK_SINGLE_DEPTH_MODE_I0095 |
---|
| 2281 | Void setApplySingleDepthMode( Bool b ) { m_bApplySingleDepthMode = b; } |
---|
| 2282 | Bool getApplySingleDepthMode() { return m_bApplySingleDepthMode; } |
---|
| 2283 | #endif |
---|
[608] | 2284 | #if H_3D_IC |
---|
| 2285 | Void setApplyIC( Bool b ) { m_bApplyIC = b; } |
---|
| 2286 | Bool getApplyIC() { return m_bApplyIC; } |
---|
| 2287 | Void xSetApplyIC(); |
---|
[950] | 2288 | Void xSetApplyIC(Bool bUseLowLatencyICEnc); |
---|
[608] | 2289 | Void setIcSkipParseFlag( Bool b ) { m_icSkipParseFlag = b; } |
---|
| 2290 | Bool getIcSkipParseFlag() { return m_icSkipParseFlag; } |
---|
| 2291 | #endif |
---|
| 2292 | #if H_3D_ARP |
---|
| 2293 | Void setBaseViewRefPicList( TComList<TComPic*> *pListPic, Int iViewIdx ) { m_pBaseViewRefPicList[iViewIdx] = pListPic; } |
---|
[724] | 2294 | Void setARPStepNum( TComPicLists*ivPicLists ); |
---|
[608] | 2295 | TComPic* getBaseViewRefPic ( UInt uiPOC , Int iViewIdx ) { return xGetRefPic( *m_pBaseViewRefPicList[iViewIdx], uiPOC ); } |
---|
| 2296 | UInt getARPStepNum( ) { return m_nARPStepNum; } |
---|
| 2297 | #endif |
---|
[2] | 2298 | Int getDepth () { return m_iDepth; } |
---|
[608] | 2299 | UInt getColFromL0Flag () { return m_colFromL0Flag; } |
---|
| 2300 | UInt getColRefIdx () { return m_colRefIdx; } |
---|
[56] | 2301 | Void checkColRefIdx (UInt curSliceIdx, TComPic* pic); |
---|
[608] | 2302 | Bool getIsUsedAsLongTerm (Int i, Int j) { return m_bIsUsedAsLongTerm[i][j]; } |
---|
[655] | 2303 | Void setIsUsedAsLongTerm (Int i, Int j, Bool value) { m_bIsUsedAsLongTerm[i][j] = value; } |
---|
[56] | 2304 | Bool getCheckLDC () { return m_bCheckLDC; } |
---|
| 2305 | Bool getMvdL1ZeroFlag () { return m_bLMvdL1Zero; } |
---|
[608] | 2306 | Int getNumRpsCurrTempList(); |
---|
| 2307 | Int getList1IdxToList0Idx ( Int list1Idx ) { return m_list1IdxToList0Idx[list1Idx]; } |
---|
[2] | 2308 | Void setReferenced(Bool b) { m_bRefenced = b; } |
---|
| 2309 | Bool isReferenced() { return m_bRefenced; } |
---|
[655] | 2310 | 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) ); } |
---|
| 2311 | 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;} } |
---|
[2] | 2312 | Void setNalUnitType ( NalUnitType e ) { m_eNalUnitType = e; } |
---|
[608] | 2313 | NalUnitType getNalUnitType () const { return m_eNalUnitType; } |
---|
| 2314 | Bool getRapPicFlag (); |
---|
| 2315 | Bool getIdrPicFlag () { return getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP; } |
---|
| 2316 | Bool isIRAP () const { return (getNalUnitType() >= 16) && (getNalUnitType() <= 23); } |
---|
[655] | 2317 | Void checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, NalUnitType& associatedIRAPType, TComList<TComPic *>& rcListPic); |
---|
[56] | 2318 | Void decodingRefreshMarking(Int& pocCRA, Bool& bRefreshPending, TComList<TComPic*>& rcListPic); |
---|
[2] | 2319 | Void setSliceType ( SliceType e ) { m_eSliceType = e; } |
---|
| 2320 | Void setSliceQp ( Int i ) { m_iSliceQp = i; } |
---|
[56] | 2321 | #if ADAPTIVE_QP_SELECTION |
---|
| 2322 | Void setSliceQpBase ( Int i ) { m_iSliceQpBase = i; } |
---|
| 2323 | #endif |
---|
[2] | 2324 | Void setSliceQpDelta ( Int i ) { m_iSliceQpDelta = i; } |
---|
[608] | 2325 | Void setSliceQpDeltaCb ( Int i ) { m_iSliceQpDeltaCb = i; } |
---|
| 2326 | Void setSliceQpDeltaCr ( Int i ) { m_iSliceQpDeltaCr = i; } |
---|
| 2327 | Void setDeblockingFilterDisable( Bool b ) { m_deblockingFilterDisable= b; } |
---|
| 2328 | Void setDeblockingFilterOverrideFlag( Bool b ) { m_deblockingFilterOverrideFlag = b; } |
---|
| 2329 | Void setDeblockingFilterBetaOffsetDiv2( Int i ) { m_deblockingFilterBetaOffsetDiv2 = i; } |
---|
| 2330 | Void setDeblockingFilterTcOffsetDiv2( Int i ) { m_deblockingFilterTcOffsetDiv2 = i; } |
---|
[56] | 2331 | |
---|
[2] | 2332 | Void setRefPic ( TComPic* p, RefPicList e, Int iRefIdx ) { m_apcRefPicList[e][iRefIdx] = p; } |
---|
| 2333 | Void setRefPOC ( Int i, RefPicList e, Int iRefIdx ) { m_aiRefPOCList[e][iRefIdx] = i; } |
---|
| 2334 | Void setNumRefIdx ( RefPicList e, Int i ) { m_aiNumRefIdx[e] = i; } |
---|
| 2335 | Void setPic ( TComPic* p ) { m_pcPic = p; } |
---|
| 2336 | Void setDepth ( Int iDepth ) { m_iDepth = iDepth; } |
---|
[56] | 2337 | |
---|
[608] | 2338 | #if H_MV |
---|
[622] | 2339 | Void setPocBeforeReset ( Int i ) { m_iPOCBeforeReset = i; } |
---|
| 2340 | Int getPocBeforeReset ( ) { return m_iPOCBeforeReset; } |
---|
[608] | 2341 | Int getRefLayerId ( RefPicList e, Int iRefIdx) { return m_aiRefLayerIdList[e][iRefIdx]; } |
---|
| 2342 | Void setRefLayerId ( Int i, RefPicList e, Int iRefIdx ) { m_aiRefLayerIdList[e][iRefIdx] = i; } |
---|
[622] | 2343 | Void getTempRefPicLists ( TComList<TComPic*>& rcListPic, std::vector<TComPic*>& refPicSetInterLayer0, std::vector<TComPic*>& refPicSetInterLayer1, |
---|
| 2344 | std::vector<TComPic*> rpsCurrList[2], std::vector<Bool> usedAsLongTerm[2], Int& numPocTotalCurr, Bool checkNumPocTotalCurr = false ); |
---|
| 2345 | |
---|
| 2346 | Void setRefPicList ( std::vector<TComPic*> rpsCurrList[2], std::vector<Bool> usedAsLongTerm[2], Int numPocTotalCurr, Bool checkNumPocTotalCurr = false ); |
---|
| 2347 | #else |
---|
[608] | 2348 | Void setRefPicList ( TComList<TComPic*>& rcListPic, Bool checkNumPocTotalCurr = false ); |
---|
| 2349 | #endif |
---|
| 2350 | Void setRefPOCList (); |
---|
| 2351 | Void setColFromL0Flag ( UInt colFromL0 ) { m_colFromL0Flag = colFromL0; } |
---|
[56] | 2352 | Void setColRefIdx ( UInt refIdx) { m_colRefIdx = refIdx; } |
---|
| 2353 | Void setCheckLDC ( Bool b ) { m_bCheckLDC = b; } |
---|
| 2354 | Void setMvdL1ZeroFlag ( Bool b) { m_bLMvdL1Zero = b; } |
---|
[5] | 2355 | |
---|
[2] | 2356 | Bool isIntra () { return m_eSliceType == I_SLICE; } |
---|
| 2357 | Bool isInterB () { return m_eSliceType == B_SLICE; } |
---|
| 2358 | Bool isInterP () { return m_eSliceType == P_SLICE; } |
---|
[56] | 2359 | |
---|
[872] | 2360 | Void setLambdas ( const Double lambdas[3] ) { for (Int component = 0; component < 3; component++) m_lambdas[component] = lambdas[component]; } |
---|
| 2361 | const Double* getLambdas() const { return m_lambdas; } |
---|
[56] | 2362 | |
---|
[2] | 2363 | Void initEqualRef(); |
---|
| 2364 | Bool isEqualRef ( RefPicList e, Int iRefIdx1, Int iRefIdx2 ) |
---|
| 2365 | { |
---|
| 2366 | if (iRefIdx1 < 0 || iRefIdx2 < 0) return false; |
---|
| 2367 | return m_abEqualRef[e][iRefIdx1][iRefIdx2]; |
---|
| 2368 | } |
---|
[56] | 2369 | |
---|
[2] | 2370 | Void setEqualRef( RefPicList e, Int iRefIdx1, Int iRefIdx2, Bool b) |
---|
| 2371 | { |
---|
| 2372 | m_abEqualRef[e][iRefIdx1][iRefIdx2] = m_abEqualRef[e][iRefIdx2][iRefIdx1] = b; |
---|
| 2373 | } |
---|
[56] | 2374 | |
---|
[2] | 2375 | static Void sortPicList ( TComList<TComPic*>& rcListPic ); |
---|
[608] | 2376 | Void setList1IdxToList0Idx(); |
---|
[56] | 2377 | |
---|
| 2378 | UInt getTLayer () { return m_uiTLayer; } |
---|
| 2379 | Void setTLayer ( UInt uiTLayer ) { m_uiTLayer = uiTLayer; } |
---|
| 2380 | |
---|
| 2381 | Void setTLayerInfo( UInt uiTLayer ); |
---|
| 2382 | Void decodingMarking( TComList<TComPic*>& rcListPic, Int iGOPSIze, Int& iMaxRefPicNum ); |
---|
[655] | 2383 | Void checkLeadingPictureRestrictions( TComList<TComPic*>& rcListPic ); |
---|
[56] | 2384 | Void applyReferencePictureSet( TComList<TComPic*>& rcListPic, TComReferencePictureSet *RPSList); |
---|
[608] | 2385 | #if H_MV |
---|
[622] | 2386 | Void createInterLayerReferencePictureSet( TComPicLists* ivPicLists, std::vector<TComPic*>& refPicSetInterLayer0, std::vector<TComPic*>& refPicSetInterLayer1 ); |
---|
| 2387 | static Void markIvRefPicsAsShortTerm ( std::vector<TComPic*> refPicSetInterLayer0, std::vector<TComPic*> refPicSetInterLayer1 ); |
---|
[964] | 2388 | static Void markCurrPic ( TComPic* currPic ); |
---|
[622] | 2389 | Void printRefPicList(); |
---|
[2] | 2390 | #endif |
---|
[608] | 2391 | Bool isTemporalLayerSwitchingPoint( TComList<TComPic*>& rcListPic ); |
---|
| 2392 | Bool isStepwiseTemporalLayerSwitchingPointCandidate( TComList<TComPic*>& rcListPic ); |
---|
[964] | 2393 | #if ALLOW_RECOVERY_POINT_AS_RAP |
---|
| 2394 | Int checkThatAllRefPicsAreAvailable( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool printErrors, Int pocRandomAccess = 0, Bool bUseRecoveryPoint = false); |
---|
| 2395 | Void createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool isRAP, Int pocRandomAccess = 0, Bool bUseRecoveryPoint = false); |
---|
| 2396 | #else |
---|
[608] | 2397 | Int checkThatAllRefPicsAreAvailable( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool printErrors, Int pocRandomAccess = 0); |
---|
| 2398 | Void createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool isRAP); |
---|
[964] | 2399 | #endif |
---|
[56] | 2400 | |
---|
[608] | 2401 | Void setMaxNumMergeCand (UInt val ) { m_maxNumMergeCand = val; } |
---|
| 2402 | UInt getMaxNumMergeCand () { return m_maxNumMergeCand; } |
---|
[56] | 2403 | |
---|
[964] | 2404 | #if SETTING_NO_OUT_PIC_PRIOR |
---|
| 2405 | Void setNoOutputPriorPicsFlag ( Bool val ) { m_noOutputPriorPicsFlag = val; } |
---|
| 2406 | Bool getNoOutputPriorPicsFlag () { return m_noOutputPriorPicsFlag; } |
---|
| 2407 | |
---|
| 2408 | Void setNoRaslOutputFlag ( Bool val ) { m_noRaslOutputFlag = val; } |
---|
| 2409 | Bool getNoRaslOutputFlag () { return m_noRaslOutputFlag; } |
---|
| 2410 | |
---|
| 2411 | Void setHandleCraAsBlaFlag ( Bool val ) { m_handleCraAsBlaFlag = val; } |
---|
| 2412 | Bool getHandleCraAsBlaFlag () { return m_handleCraAsBlaFlag; } |
---|
| 2413 | #endif |
---|
| 2414 | |
---|
[608] | 2415 | Void setSliceMode ( UInt uiMode ) { m_sliceMode = uiMode; } |
---|
| 2416 | UInt getSliceMode () { return m_sliceMode; } |
---|
| 2417 | Void setSliceArgument ( UInt uiArgument ) { m_sliceArgument = uiArgument; } |
---|
| 2418 | UInt getSliceArgument () { return m_sliceArgument; } |
---|
| 2419 | Void setSliceCurStartCUAddr ( UInt uiAddr ) { m_sliceCurStartCUAddr = uiAddr; } |
---|
| 2420 | UInt getSliceCurStartCUAddr () { return m_sliceCurStartCUAddr; } |
---|
| 2421 | Void setSliceCurEndCUAddr ( UInt uiAddr ) { m_sliceCurEndCUAddr = uiAddr; } |
---|
| 2422 | UInt getSliceCurEndCUAddr () { return m_sliceCurEndCUAddr; } |
---|
| 2423 | Void setSliceIdx ( UInt i) { m_sliceIdx = i; } |
---|
| 2424 | UInt getSliceIdx () { return m_sliceIdx; } |
---|
[2] | 2425 | Void copySliceInfo (TComSlice *pcSliceSrc); |
---|
[608] | 2426 | Void setSliceSegmentMode ( UInt uiMode ) { m_sliceSegmentMode = uiMode; } |
---|
| 2427 | UInt getSliceSegmentMode () { return m_sliceSegmentMode; } |
---|
| 2428 | Void setSliceSegmentArgument ( UInt uiArgument ) { m_sliceSegmentArgument = uiArgument; } |
---|
| 2429 | UInt getSliceSegmentArgument () { return m_sliceSegmentArgument; } |
---|
| 2430 | Void setSliceSegmentCurStartCUAddr ( UInt uiAddr ) { m_sliceSegmentCurStartCUAddr = uiAddr; } |
---|
| 2431 | UInt getSliceSegmentCurStartCUAddr () { return m_sliceSegmentCurStartCUAddr; } |
---|
| 2432 | Void setSliceSegmentCurEndCUAddr ( UInt uiAddr ) { m_sliceSegmentCurEndCUAddr = uiAddr; } |
---|
| 2433 | UInt getSliceSegmentCurEndCUAddr () { return m_sliceSegmentCurEndCUAddr; } |
---|
| 2434 | Void setNextSlice ( Bool b ) { m_nextSlice = b; } |
---|
| 2435 | Bool isNextSlice () { return m_nextSlice; } |
---|
| 2436 | Void setNextSliceSegment ( Bool b ) { m_nextSliceSegment = b; } |
---|
| 2437 | Bool isNextSliceSegment () { return m_nextSliceSegment; } |
---|
| 2438 | Void setSliceBits ( UInt uiVal ) { m_sliceBits = uiVal; } |
---|
| 2439 | UInt getSliceBits () { return m_sliceBits; } |
---|
| 2440 | Void setSliceSegmentBits ( UInt uiVal ) { m_sliceSegmentBits = uiVal; } |
---|
| 2441 | UInt getSliceSegmentBits () { return m_sliceSegmentBits; } |
---|
[56] | 2442 | Void setFinalized ( Bool uiVal ) { m_bFinalized = uiVal; } |
---|
| 2443 | Bool getFinalized () { return m_bFinalized; } |
---|
| 2444 | Void setWpScaling ( wpScalingParam wp[2][MAX_NUM_REF][3] ) { memcpy(m_weightPredTable, wp, sizeof(wpScalingParam)*2*MAX_NUM_REF*3); } |
---|
| 2445 | Void getWpScaling ( RefPicList e, Int iRefIdx, wpScalingParam *&wp); |
---|
[5] | 2446 | |
---|
[608] | 2447 | Void resetWpScaling (); |
---|
[56] | 2448 | Void initWpScaling (); |
---|
[608] | 2449 | inline Bool applyWP () { return( (m_eSliceType==P_SLICE && m_pcPPS->getUseWP()) || (m_eSliceType==B_SLICE && m_pcPPS->getWPBiPred()) ); } |
---|
| 2450 | |
---|
[56] | 2451 | Void setWpAcDcParam ( wpACDCParam wp[3] ) { memcpy(m_weightACDCParam, wp, sizeof(wpACDCParam)*3); } |
---|
| 2452 | Void getWpAcDcParam ( wpACDCParam *&wp ); |
---|
| 2453 | Void initWpAcDcParam (); |
---|
[608] | 2454 | |
---|
| 2455 | Void setTileLocationCount ( UInt cnt ) { return m_tileByteLocation.resize(cnt); } |
---|
| 2456 | UInt getTileLocationCount () { return (UInt) m_tileByteLocation.size(); } |
---|
| 2457 | Void setTileLocation ( Int idx, UInt location ) { assert (idx<m_tileByteLocation.size()); |
---|
| 2458 | m_tileByteLocation[idx] = location; } |
---|
| 2459 | Void addTileLocation ( UInt location ) { m_tileByteLocation.push_back(location); } |
---|
| 2460 | UInt getTileLocation ( Int idx ) { return m_tileByteLocation[idx]; } |
---|
| 2461 | |
---|
[56] | 2462 | Void setTileOffstForMultES (UInt uiOffset ) { m_uiTileOffstForMultES = uiOffset; } |
---|
| 2463 | UInt getTileOffstForMultES () { return m_uiTileOffstForMultES; } |
---|
| 2464 | Void allocSubstreamSizes ( UInt uiNumSubstreams ); |
---|
| 2465 | UInt* getSubstreamSizes () { return m_puiSubstreamSizes; } |
---|
| 2466 | Void setScalingList ( TComScalingList* scalingList ) { m_scalingList = scalingList; } |
---|
| 2467 | TComScalingList* getScalingList () { return m_scalingList; } |
---|
| 2468 | Void setDefaultScalingList (); |
---|
| 2469 | Bool checkDefaultScalingList (); |
---|
| 2470 | Void setCabacInitFlag ( Bool val ) { m_cabacInitFlag = val; } //!< set CABAC initial flag |
---|
| 2471 | Bool getCabacInitFlag () { return m_cabacInitFlag; } //!< get CABAC initial flag |
---|
| 2472 | Void setNumEntryPointOffsets(Int val) { m_numEntryPointOffsets = val; } |
---|
| 2473 | Int getNumEntryPointOffsets() { return m_numEntryPointOffsets; } |
---|
[608] | 2474 | Bool getTemporalLayerNonReferenceFlag() { return m_temporalLayerNonReferenceFlag;} |
---|
| 2475 | Void setTemporalLayerNonReferenceFlag(Bool x) { m_temporalLayerNonReferenceFlag = x;} |
---|
| 2476 | Void setLFCrossSliceBoundaryFlag ( Bool val ) { m_LFCrossSliceBoundaryFlag = val; } |
---|
| 2477 | Bool getLFCrossSliceBoundaryFlag () { return m_LFCrossSliceBoundaryFlag;} |
---|
[56] | 2478 | |
---|
[608] | 2479 | Void setEnableTMVPFlag ( Bool b ) { m_enableTMVPFlag = b; } |
---|
| 2480 | Bool getEnableTMVPFlag () { return m_enableTMVPFlag;} |
---|
| 2481 | |
---|
| 2482 | #if H_MV |
---|
| 2483 | Void setLayerId ( Int layerId ) { m_layerId = layerId; } |
---|
| 2484 | Int getLayerId () { return m_layerId; } |
---|
| 2485 | Int getLayerIdInVps () { return getVPS()->getLayerIdInVps( m_layerId ); }; |
---|
| 2486 | Void setViewId ( Int viewId ) { m_viewId = viewId; } |
---|
| 2487 | Int getViewId () { return m_viewId; } |
---|
[622] | 2488 | Void setViewIndex ( Int viewIndex ) { m_viewIndex = viewIndex; } |
---|
| 2489 | Int getViewIndex () { return m_viewIndex; } |
---|
[608] | 2490 | #if H_3D |
---|
| 2491 | #if H_3D_TMVP |
---|
| 2492 | Void generateAlterRefforTMVP (); |
---|
| 2493 | Void setAlterRefIdx ( RefPicList e, Int i ) { m_aiAlterRefIdx[e] = i; } |
---|
| 2494 | Int getAlterRefIdx ( RefPicList e ) { return m_aiAlterRefIdx[e]; } |
---|
[210] | 2495 | #endif |
---|
[773] | 2496 | #if H_3D_ARP |
---|
[724] | 2497 | Int getFirstTRefIdx ( RefPicList e ) { return m_aiFirstTRefIdx[e]; } |
---|
| 2498 | Void setFirstTRefIdx ( RefPicList e, Int i ) { m_aiFirstTRefIdx[e] = i; } |
---|
| 2499 | Bool getArpRefPicAvailable( RefPicList e, Int viewIdx) {return m_arpRefPicAvailable[e][getVPS()->getLayerIdInNuh(viewIdx, 0)]; } |
---|
| 2500 | #endif |
---|
[608] | 2501 | Void setIsDepth ( Bool isDepth ) { m_isDepth = isDepth; } |
---|
| 2502 | Bool getIsDepth () { return m_isDepth; } |
---|
| 2503 | Void setCamparaSlice ( Int** aaiScale = 0, Int** aaiOffset = 0 ); |
---|
[2] | 2504 | Int* getCodedScale () { return m_aaiCodedScale [0]; } |
---|
| 2505 | Int* getCodedOffset () { return m_aaiCodedOffset[0]; } |
---|
| 2506 | Int* getInvCodedScale () { return m_aaiCodedScale [1]; } |
---|
| 2507 | Int* getInvCodedOffset () { return m_aaiCodedOffset[1]; } |
---|
[189] | 2508 | #endif |
---|
[443] | 2509 | #endif |
---|
[608] | 2510 | #if H_3D |
---|
| 2511 | Void setIvPicLists( TComPicLists* m_ivPicLists ); |
---|
| 2512 | Void setDepthToDisparityLUTs(); |
---|
[189] | 2513 | |
---|
[608] | 2514 | Int* getDepthToDisparityB( Int refViewIdx ) { return m_depthToDisparityB[ refViewIdx ]; }; |
---|
| 2515 | Int* getDepthToDisparityF( Int refViewIdx ) { return m_depthToDisparityF[ refViewIdx ]; }; |
---|
| 2516 | Bool getVpsDepthModesFlag () { return getVPS()->getVpsDepthModesFlag( getVPS()->getLayerIdInVps( m_layerId ) ); } |
---|
| 2517 | |
---|
[296] | 2518 | #endif |
---|
[608] | 2519 | #if H_MV |
---|
| 2520 | // Additional slice header syntax elements |
---|
[622] | 2521 | |
---|
[738] | 2522 | Void setCrossLayerBlaFlag( Bool flag ) { m_crossLayerBlaFlag = flag; } |
---|
| 2523 | Bool getCrossLayerBlaFlag( ) { return m_crossLayerBlaFlag; } |
---|
[976] | 2524 | Void checkCrossLayerBlaFlag ( ); |
---|
[738] | 2525 | |
---|
[872] | 2526 | #if !H_MV_HLS7_GEN |
---|
[622] | 2527 | Void setPocResetFlag( Bool flag ) { m_pocResetFlag = flag; } |
---|
| 2528 | Bool getPocResetFlag( ) { return m_pocResetFlag; } |
---|
[872] | 2529 | #endif |
---|
[622] | 2530 | |
---|
[773] | 2531 | Void setDiscardableFlag( Bool flag ) { m_discardableFlag = flag; } |
---|
| 2532 | Bool getDiscardableFlag( ) { return m_discardableFlag; } |
---|
[296] | 2533 | |
---|
[773] | 2534 | Void setInterLayerPredEnabledFlag( Bool flag ) { m_interLayerPredEnabledFlag = flag; } |
---|
| 2535 | Bool getInterLayerPredEnabledFlag( ) { return m_interLayerPredEnabledFlag; } |
---|
[608] | 2536 | |
---|
[773] | 2537 | Void setNumInterLayerRefPicsMinus1( Int val ) { m_numInterLayerRefPicsMinus1 = val; } |
---|
| 2538 | Int getNumInterLayerRefPicsMinus1( ) { return m_numInterLayerRefPicsMinus1; } |
---|
[608] | 2539 | |
---|
[773] | 2540 | Void setInterLayerPredLayerIdc( Int i, Int val ) { m_interLayerPredLayerIdc[i] = val; } |
---|
| 2541 | Int getInterLayerPredLayerIdc( Int i ) { return m_interLayerPredLayerIdc[i]; } |
---|
[608] | 2542 | |
---|
[872] | 2543 | Void setSliceSegmentHeaderExtensionLength( Int val ) { m_sliceSegmentHeaderExtensionLength = val; } |
---|
| 2544 | Int getSliceSegmentHeaderExtensionLength( ) { return m_sliceSegmentHeaderExtensionLength; } |
---|
| 2545 | |
---|
| 2546 | Void setPocResetIdc( Int val ) { m_pocResetIdc = val; } |
---|
| 2547 | Int getPocResetIdc( ) { return m_pocResetIdc; } |
---|
[964] | 2548 | Void checkPocResetIdc( ) { assert( !(getVPS()->getPocLsbNotPresentFlag( getLayerIdInVps() ) ) || !(getSlicePicOrderCntLsb() > 0 ) || !( getPocResetIdc() == 2) ); } |
---|
[976] | 2549 | |
---|
[872] | 2550 | Void setPocResetPeriodId( Int val ) { m_pocResetPeriodId = val; } |
---|
| 2551 | Int getPocResetPeriodId( ) { return m_pocResetPeriodId; } |
---|
| 2552 | |
---|
| 2553 | Void setFullPocResetFlag( Bool flag ) { m_fullPocResetFlag = flag; } |
---|
| 2554 | Bool getFullPocResetFlag( ) { return m_fullPocResetFlag; } |
---|
| 2555 | |
---|
| 2556 | Void setPocLsbVal( Int val ) { m_pocLsbVal = val; } |
---|
| 2557 | Int getPocLsbVal( ) { return m_pocLsbVal; } |
---|
[964] | 2558 | Void checkPocLsbVal( ) { assert( !(getVPS()->getPocLsbNotPresentFlag( getLayerIdInVps() ) ) || !getFullPocResetFlag() || ( getPocLsbVal() == 0 ) ); } |
---|
[872] | 2559 | |
---|
| 2560 | Void setPocMsbValPresentFlag( Bool flag ) { m_pocMsbValPresentFlag = flag; } |
---|
| 2561 | Bool getPocMsbValPresentFlag( ) { return m_pocMsbValPresentFlag; } |
---|
| 2562 | |
---|
| 2563 | Void setPocMsbVal( Int val ) { m_pocMsbVal = val; } |
---|
| 2564 | Int getPocMsbVal( ) { return m_pocMsbVal; } |
---|
| 2565 | |
---|
| 2566 | Bool getPocMsbValRequiredFlag() { return m_pocMsbValRequiredFlag; } |
---|
| 2567 | Void setPocMsbValRequiredFlag(Bool x) { m_pocMsbValRequiredFlag = x; } |
---|
| 2568 | |
---|
| 2569 | UInt getPocLsbValLen() { return getSPS()->getBitsForPOC(); }; //log2_max_pic_order_cnt_lsb_minus4 + 4 |
---|
| 2570 | |
---|
| 2571 | Bool getBlaPicFlag () |
---|
| 2572 | { |
---|
| 2573 | return getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP |
---|
| 2574 | || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL |
---|
| 2575 | || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP; |
---|
| 2576 | } |
---|
| 2577 | Bool getCraPicFlag () |
---|
| 2578 | { |
---|
| 2579 | return getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA; |
---|
| 2580 | } |
---|
| 2581 | |
---|
[622] | 2582 | // Additional variables derived in slice header semantics |
---|
[964] | 2583 | |
---|
[622] | 2584 | Int getNumInterLayerRefPicsMinus1Len( ) { return gCeilLog2( getVPS()->getNumDirectRefLayers( getLayerId() )); } |
---|
| 2585 | Int getInterLayerPredLayerIdcLen ( ) { return gCeilLog2( getVPS()->getNumDirectRefLayers( getLayerId() )); } |
---|
| 2586 | |
---|
[738] | 2587 | Int getRefLayerPicFlag( Int i ); |
---|
| 2588 | Int getRefLayerPicIdc ( Int j ); |
---|
| 2589 | Int getNumRefLayerPics( ); |
---|
| 2590 | |
---|
[622] | 2591 | Int getNumActiveRefLayerPics( ); |
---|
| 2592 | |
---|
| 2593 | Int getNumActiveRefLayerPics0( ) { return (Int) m_refPicSetInterLayer0->size(); }; |
---|
| 2594 | Int getNumActiveRefLayerPics1( ) { return (Int) m_refPicSetInterLayer1->size(); }; |
---|
| 2595 | |
---|
| 2596 | Int getRefPicLayerId ( Int i ); |
---|
| 2597 | |
---|
| 2598 | Void setRefPicSetInterLayer ( std::vector<TComPic*>* refPicSetInterLayer0, std::vector<TComPic*>* refPicSetInterLayer1); |
---|
| 2599 | TComPic* getPicFromRefPicSetInterLayer( Int setIdc, Int layerId ); |
---|
[872] | 2600 | |
---|
[976] | 2601 | // Inference |
---|
| 2602 | Bool inferPocMsbValPresentFlag(); |
---|
[443] | 2603 | #endif |
---|
[884] | 2604 | #if H_3D_DDD |
---|
[976] | 2605 | Void initializeDDDPara( UInt uiCamParsCodedPrecision, Int iCodedScale,Int iCodedOffset, Int iBaseViewIdx ); |
---|
| 2606 | Int getDepthFromDV( Int iDV, Int iBaseViewIdx ); |
---|
[833] | 2607 | #endif |
---|
| 2608 | |
---|
[56] | 2609 | protected: |
---|
[608] | 2610 | TComPic* xGetRefPic (TComList<TComPic*>& rcListPic, |
---|
| 2611 | Int poc); |
---|
| 2612 | TComPic* xGetLongTermRefPic(TComList<TComPic*>& rcListPic, Int poc, Bool pocHasMsb); |
---|
| 2613 | #if H_MV |
---|
| 2614 | TComPic* xGetInterLayerRefPic( std::vector<TComPic*>& rcListIlPic, Int layerId ); |
---|
| 2615 | #endif |
---|
[56] | 2616 | };// END CLASS DEFINITION TComSlice |
---|
[2] | 2617 | |
---|
[5] | 2618 | |
---|
[56] | 2619 | template <class T> class ParameterSetMap |
---|
| 2620 | { |
---|
| 2621 | public: |
---|
| 2622 | ParameterSetMap(Int maxId) |
---|
| 2623 | :m_maxId (maxId) |
---|
| 2624 | {} |
---|
[2] | 2625 | |
---|
[56] | 2626 | ~ParameterSetMap() |
---|
| 2627 | { |
---|
| 2628 | for (typename std::map<Int,T *>::iterator i = m_paramsetMap.begin(); i!= m_paramsetMap.end(); i++) |
---|
| 2629 | { |
---|
| 2630 | delete (*i).second; |
---|
| 2631 | } |
---|
| 2632 | } |
---|
| 2633 | |
---|
| 2634 | Void storePS(Int psId, T *ps) |
---|
| 2635 | { |
---|
| 2636 | assert ( psId < m_maxId ); |
---|
| 2637 | if ( m_paramsetMap.find(psId) != m_paramsetMap.end() ) |
---|
| 2638 | { |
---|
| 2639 | delete m_paramsetMap[psId]; |
---|
| 2640 | } |
---|
| 2641 | m_paramsetMap[psId] = ps; |
---|
| 2642 | } |
---|
| 2643 | |
---|
| 2644 | Void mergePSList(ParameterSetMap<T> &rPsList) |
---|
| 2645 | { |
---|
| 2646 | for (typename std::map<Int,T *>::iterator i = rPsList.m_paramsetMap.begin(); i!= rPsList.m_paramsetMap.end(); i++) |
---|
| 2647 | { |
---|
| 2648 | storePS(i->first, i->second); |
---|
| 2649 | } |
---|
| 2650 | rPsList.m_paramsetMap.clear(); |
---|
| 2651 | } |
---|
| 2652 | |
---|
| 2653 | |
---|
| 2654 | T* getPS(Int psId) |
---|
| 2655 | { |
---|
| 2656 | return ( m_paramsetMap.find(psId) == m_paramsetMap.end() ) ? NULL : m_paramsetMap[psId]; |
---|
| 2657 | } |
---|
| 2658 | |
---|
| 2659 | T* getFirstPS() |
---|
| 2660 | { |
---|
| 2661 | return (m_paramsetMap.begin() == m_paramsetMap.end() ) ? NULL : m_paramsetMap.begin()->second; |
---|
| 2662 | } |
---|
| 2663 | |
---|
| 2664 | private: |
---|
| 2665 | std::map<Int,T *> m_paramsetMap; |
---|
| 2666 | Int m_maxId; |
---|
| 2667 | }; |
---|
| 2668 | |
---|
| 2669 | class ParameterSetManager |
---|
| 2670 | { |
---|
| 2671 | public: |
---|
| 2672 | ParameterSetManager(); |
---|
| 2673 | virtual ~ParameterSetManager(); |
---|
[608] | 2674 | |
---|
| 2675 | //! store sequence parameter set and take ownership of it |
---|
[77] | 2676 | Void storeVPS(TComVPS *vps) { m_vpsMap.storePS( vps->getVPSId(), vps); }; |
---|
| 2677 | //! get pointer to existing video parameter set |
---|
| 2678 | TComVPS* getVPS(Int vpsId) { return m_vpsMap.getPS(vpsId); }; |
---|
| 2679 | TComVPS* getFirstVPS() { return m_vpsMap.getFirstPS(); }; |
---|
[608] | 2680 | |
---|
[56] | 2681 | //! store sequence parameter set and take ownership of it |
---|
| 2682 | Void storeSPS(TComSPS *sps) { m_spsMap.storePS( sps->getSPSId(), sps); }; |
---|
| 2683 | //! get pointer to existing sequence parameter set |
---|
| 2684 | TComSPS* getSPS(Int spsId) { return m_spsMap.getPS(spsId); }; |
---|
| 2685 | TComSPS* getFirstSPS() { return m_spsMap.getFirstPS(); }; |
---|
| 2686 | |
---|
| 2687 | //! store picture parameter set and take ownership of it |
---|
| 2688 | Void storePPS(TComPPS *pps) { m_ppsMap.storePS( pps->getPPSId(), pps); }; |
---|
| 2689 | //! get pointer to existing picture parameter set |
---|
| 2690 | TComPPS* getPPS(Int ppsId) { return m_ppsMap.getPS(ppsId); }; |
---|
| 2691 | TComPPS* getFirstPPS() { return m_ppsMap.getFirstPS(); }; |
---|
| 2692 | |
---|
[608] | 2693 | //! activate a SPS from a active parameter sets SEI message |
---|
| 2694 | //! \returns true, if activation is successful |
---|
[622] | 2695 | #if H_MV |
---|
| 2696 | Bool activateSPSWithSEI(Int SPSId, Int layerId ); |
---|
| 2697 | #else |
---|
| 2698 | Bool activateSPSWithSEI(Int SPSId); |
---|
| 2699 | #endif |
---|
| 2700 | |
---|
| 2701 | //! activate a PPS and depending on isIDR parameter also SPS and VPS |
---|
| 2702 | //! \returns true, if activation is successful |
---|
| 2703 | #if H_MV |
---|
| 2704 | Bool activatePPS(Int ppsId, Bool isIRAP, Int layerId ); |
---|
| 2705 | #else |
---|
| 2706 | Bool activatePPS(Int ppsId, Bool isIRAP); |
---|
| 2707 | #endif |
---|
| 2708 | |
---|
| 2709 | TComVPS* getActiveVPS(){ return m_vpsMap.getPS(m_activeVPSId); }; |
---|
| 2710 | #if H_MV |
---|
| 2711 | TComSPS* getActiveSPS( Int layerId ){ return m_spsMap.getPS( m_activeSPSId[ layerId ] ); }; |
---|
| 2712 | TComPPS* getActivePPS( Int layerId ){ return m_ppsMap.getPS( m_activePPSId[ layerId ] ); }; |
---|
| 2713 | #else |
---|
| 2714 | TComSPS* getActiveSPS(){ return m_spsMap.getPS(m_activeSPSId); }; |
---|
| 2715 | TComPPS* getActivePPS(){ return m_ppsMap.getPS(m_activePPSId); }; |
---|
| 2716 | #endif |
---|
| 2717 | protected: |
---|
| 2718 | |
---|
| 2719 | ParameterSetMap<TComVPS> m_vpsMap; |
---|
| 2720 | ParameterSetMap<TComSPS> m_spsMap; |
---|
| 2721 | ParameterSetMap<TComPPS> m_ppsMap; |
---|
| 2722 | |
---|
| 2723 | Int m_activeVPSId; |
---|
| 2724 | #if H_MV |
---|
| 2725 | Int m_activeSPSId[ MAX_NUM_LAYERS ]; |
---|
| 2726 | Int m_activePPSId[ MAX_NUM_LAYERS ]; |
---|
| 2727 | #else |
---|
| 2728 | Int m_activeSPSId; |
---|
| 2729 | Int m_activePPSId; |
---|
| 2730 | #endif |
---|
| 2731 | |
---|
[56] | 2732 | }; |
---|
[5] | 2733 | |
---|
[56] | 2734 | //! \} |
---|
[2] | 2735 | |
---|
| 2736 | #endif // __TCOMSLICE__ |
---|