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