[5] | 1 | /* The copyright in this software is being made available under the BSD |
---|
| 2 | * License, included below. This software may be subject to other third party |
---|
| 3 | * and contributor rights, including patent rights, and no such rights are |
---|
[56] | 4 | * granted under this license. |
---|
[5] | 5 | * |
---|
[608] | 6 | * Copyright (c) 2010-2013, ITU/ISO/IEC |
---|
[5] | 7 | * All rights reserved. |
---|
| 8 | * |
---|
| 9 | * Redistribution and use in source and binary forms, with or without |
---|
| 10 | * modification, are permitted provided that the following conditions are met: |
---|
| 11 | * |
---|
| 12 | * * Redistributions of source code must retain the above copyright notice, |
---|
| 13 | * this list of conditions and the following disclaimer. |
---|
| 14 | * * Redistributions in binary form must reproduce the above copyright notice, |
---|
| 15 | * this list of conditions and the following disclaimer in the documentation |
---|
| 16 | * and/or other materials provided with the distribution. |
---|
[56] | 17 | * * Neither the name of the ITU/ISO/IEC nor the names of its contributors may |
---|
[5] | 18 | * be used to endorse or promote products derived from this software without |
---|
| 19 | * specific prior written permission. |
---|
| 20 | * |
---|
| 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
---|
| 22 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
---|
| 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
---|
| 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS |
---|
| 25 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
---|
| 26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
---|
| 27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
---|
| 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
---|
| 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
---|
| 30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF |
---|
| 31 | * THE POSSIBILITY OF SUCH DAMAGE. |
---|
| 32 | */ |
---|
[2] | 33 | |
---|
| 34 | /** \file TComSlice.h |
---|
| 35 | \brief slice header and SPS class (header) |
---|
| 36 | */ |
---|
| 37 | |
---|
| 38 | #ifndef __TCOMSLICE__ |
---|
| 39 | #define __TCOMSLICE__ |
---|
| 40 | |
---|
[56] | 41 | #include <cstring> |
---|
| 42 | #include <map> |
---|
| 43 | #include <vector> |
---|
[2] | 44 | #include "CommonDef.h" |
---|
[56] | 45 | #include "TComRom.h" |
---|
[2] | 46 | #include "TComList.h" |
---|
| 47 | |
---|
[56] | 48 | //! \ingroup TLibCommon |
---|
| 49 | //! \{ |
---|
| 50 | |
---|
[2] | 51 | class TComPic; |
---|
[56] | 52 | class TComTrQuant; |
---|
[608] | 53 | #if H_MV |
---|
| 54 | class TComPicLists; |
---|
[5] | 55 | #endif |
---|
[56] | 56 | // ==================================================================================================================== |
---|
| 57 | // Constants |
---|
| 58 | // ==================================================================================================================== |
---|
[2] | 59 | |
---|
| 60 | // ==================================================================================================================== |
---|
| 61 | // Class definition |
---|
| 62 | // ==================================================================================================================== |
---|
| 63 | |
---|
[56] | 64 | /// Reference Picture Set class |
---|
| 65 | class TComReferencePictureSet |
---|
| 66 | { |
---|
| 67 | private: |
---|
| 68 | Int m_numberOfPictures; |
---|
| 69 | Int m_numberOfNegativePictures; |
---|
| 70 | Int m_numberOfPositivePictures; |
---|
| 71 | Int m_numberOfLongtermPictures; |
---|
| 72 | Int m_deltaPOC[MAX_NUM_REF_PICS]; |
---|
| 73 | Int m_POC[MAX_NUM_REF_PICS]; |
---|
| 74 | Bool m_used[MAX_NUM_REF_PICS]; |
---|
| 75 | Bool m_interRPSPrediction; |
---|
| 76 | Int m_deltaRIdxMinus1; |
---|
| 77 | Int m_deltaRPS; |
---|
| 78 | Int m_numRefIdc; |
---|
| 79 | Int m_refIdc[MAX_NUM_REF_PICS+1]; |
---|
[608] | 80 | Bool m_bCheckLTMSB[MAX_NUM_REF_PICS]; |
---|
| 81 | Int m_pocLSBLT[MAX_NUM_REF_PICS]; |
---|
| 82 | Int m_deltaPOCMSBCycleLT[MAX_NUM_REF_PICS]; |
---|
| 83 | Bool m_deltaPocMSBPresentFlag[MAX_NUM_REF_PICS]; |
---|
[56] | 84 | |
---|
| 85 | public: |
---|
| 86 | TComReferencePictureSet(); |
---|
| 87 | virtual ~TComReferencePictureSet(); |
---|
[608] | 88 | Int getPocLSBLT(Int i) { return m_pocLSBLT[i]; } |
---|
| 89 | Void setPocLSBLT(Int i, Int x) { m_pocLSBLT[i] = x; } |
---|
| 90 | Int getDeltaPocMSBCycleLT(Int i) { return m_deltaPOCMSBCycleLT[i]; } |
---|
| 91 | Void setDeltaPocMSBCycleLT(Int i, Int x) { m_deltaPOCMSBCycleLT[i] = x; } |
---|
| 92 | Bool getDeltaPocMSBPresentFlag(Int i) { return m_deltaPocMSBPresentFlag[i]; } |
---|
| 93 | Void setDeltaPocMSBPresentFlag(Int i, Bool x) { m_deltaPocMSBPresentFlag[i] = x; } |
---|
| 94 | Void setUsed(Int bufferNum, Bool used); |
---|
| 95 | Void setDeltaPOC(Int bufferNum, Int deltaPOC); |
---|
| 96 | Void setPOC(Int bufferNum, Int deltaPOC); |
---|
| 97 | Void setNumberOfPictures(Int numberOfPictures); |
---|
| 98 | Void setCheckLTMSBPresent(Int bufferNum, Bool b ); |
---|
| 99 | Bool getCheckLTMSBPresent(Int bufferNum); |
---|
[56] | 100 | |
---|
[608] | 101 | Int getUsed(Int bufferNum); |
---|
| 102 | Int getDeltaPOC(Int bufferNum); |
---|
| 103 | Int getPOC(Int bufferNum); |
---|
[56] | 104 | Int getNumberOfPictures(); |
---|
[608] | 105 | |
---|
[56] | 106 | Void setNumberOfNegativePictures(Int number) { m_numberOfNegativePictures = number; } |
---|
| 107 | Int getNumberOfNegativePictures() { return m_numberOfNegativePictures; } |
---|
| 108 | Void setNumberOfPositivePictures(Int number) { m_numberOfPositivePictures = number; } |
---|
| 109 | Int getNumberOfPositivePictures() { return m_numberOfPositivePictures; } |
---|
| 110 | Void setNumberOfLongtermPictures(Int number) { m_numberOfLongtermPictures = number; } |
---|
| 111 | Int getNumberOfLongtermPictures() { return m_numberOfLongtermPictures; } |
---|
| 112 | |
---|
| 113 | Void setInterRPSPrediction(Bool flag) { m_interRPSPrediction = flag; } |
---|
| 114 | Bool getInterRPSPrediction() { return m_interRPSPrediction; } |
---|
| 115 | Void setDeltaRIdxMinus1(Int x) { m_deltaRIdxMinus1 = x; } |
---|
| 116 | Int getDeltaRIdxMinus1() { return m_deltaRIdxMinus1; } |
---|
| 117 | Void setDeltaRPS(Int x) { m_deltaRPS = x; } |
---|
| 118 | Int getDeltaRPS() { return m_deltaRPS; } |
---|
| 119 | Void setNumRefIdc(Int x) { m_numRefIdc = x; } |
---|
| 120 | Int getNumRefIdc() { return m_numRefIdc; } |
---|
| 121 | |
---|
| 122 | Void setRefIdc(Int bufferNum, Int refIdc); |
---|
| 123 | Int getRefIdc(Int bufferNum); |
---|
| 124 | |
---|
| 125 | Void sortDeltaPOC(); |
---|
| 126 | Void printDeltaPOC(); |
---|
| 127 | }; |
---|
| 128 | |
---|
| 129 | /// Reference Picture Set set class |
---|
| 130 | class TComRPSList |
---|
| 131 | { |
---|
| 132 | private: |
---|
| 133 | Int m_numberOfReferencePictureSets; |
---|
| 134 | TComReferencePictureSet* m_referencePictureSets; |
---|
| 135 | |
---|
| 136 | public: |
---|
| 137 | TComRPSList(); |
---|
| 138 | virtual ~TComRPSList(); |
---|
| 139 | |
---|
| 140 | Void create (Int numberOfEntries); |
---|
| 141 | Void destroy (); |
---|
| 142 | |
---|
| 143 | |
---|
| 144 | TComReferencePictureSet* getReferencePictureSet(Int referencePictureSetNum); |
---|
| 145 | Int getNumberOfReferencePictureSets(); |
---|
| 146 | Void setNumberOfReferencePictureSets(Int numberOfReferencePictureSets); |
---|
| 147 | }; |
---|
| 148 | |
---|
[608] | 149 | /// SCALING_LIST class |
---|
| 150 | class TComScalingList |
---|
| 151 | { |
---|
| 152 | public: |
---|
| 153 | TComScalingList(); |
---|
| 154 | virtual ~TComScalingList(); |
---|
| 155 | Void setScalingListPresentFlag (Bool b) { m_scalingListPresentFlag = b; } |
---|
| 156 | Bool getScalingListPresentFlag () { return m_scalingListPresentFlag; } |
---|
| 157 | Int* getScalingListAddress (UInt sizeId, UInt listId) { return m_scalingListCoef[sizeId][listId]; } //!< get matrix coefficient |
---|
| 158 | Bool checkPredMode (UInt sizeId, UInt listId); |
---|
| 159 | Void setRefMatrixId (UInt sizeId, UInt listId, UInt u) { m_refMatrixId[sizeId][listId] = u; } //!< set reference matrix ID |
---|
| 160 | UInt getRefMatrixId (UInt sizeId, UInt listId) { return m_refMatrixId[sizeId][listId]; } //!< get reference matrix ID |
---|
| 161 | Int* getScalingListDefaultAddress (UInt sizeId, UInt listId); //!< get default matrix coefficient |
---|
| 162 | Void processDefaultMarix (UInt sizeId, UInt listId); |
---|
| 163 | Void setScalingListDC (UInt sizeId, UInt listId, UInt u) { m_scalingListDC[sizeId][listId] = u; } //!< set DC value |
---|
| 164 | |
---|
| 165 | Int getScalingListDC (UInt sizeId, UInt listId) { return m_scalingListDC[sizeId][listId]; } //!< get DC value |
---|
| 166 | Void checkDcOfMatrix (); |
---|
| 167 | Void processRefMatrix (UInt sizeId, UInt listId , UInt refListId ); |
---|
| 168 | Bool xParseScalingList (Char* pchFile); |
---|
[622] | 169 | #if H_MV |
---|
| 170 | Void inferFrom ( TComScalingList* srcScLi ); |
---|
| 171 | #endif |
---|
[608] | 172 | |
---|
| 173 | private: |
---|
| 174 | Void init (); |
---|
| 175 | Void destroy (); |
---|
| 176 | Int m_scalingListDC [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< the DC value of the matrix coefficient for 16x16 |
---|
| 177 | Bool m_useDefaultScalingMatrixFlag [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< UseDefaultScalingMatrixFlag |
---|
| 178 | UInt m_refMatrixId [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< RefMatrixID |
---|
| 179 | Bool m_scalingListPresentFlag; //!< flag for using default matrix |
---|
| 180 | UInt m_predMatrixId [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< reference list index |
---|
| 181 | Int *m_scalingListCoef [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< quantization matrix |
---|
| 182 | }; |
---|
| 183 | |
---|
| 184 | class ProfileTierLevel |
---|
| 185 | { |
---|
| 186 | Int m_profileSpace; |
---|
| 187 | Bool m_tierFlag; |
---|
| 188 | Int m_profileIdc; |
---|
| 189 | Bool m_profileCompatibilityFlag[32]; |
---|
| 190 | Int m_levelIdc; |
---|
| 191 | |
---|
| 192 | Bool m_progressiveSourceFlag; |
---|
| 193 | Bool m_interlacedSourceFlag; |
---|
| 194 | Bool m_nonPackedConstraintFlag; |
---|
| 195 | Bool m_frameOnlyConstraintFlag; |
---|
| 196 | |
---|
| 197 | public: |
---|
| 198 | ProfileTierLevel(); |
---|
| 199 | |
---|
| 200 | Int getProfileSpace() const { return m_profileSpace; } |
---|
| 201 | Void setProfileSpace(Int x) { m_profileSpace = x; } |
---|
| 202 | |
---|
| 203 | Bool getTierFlag() const { return m_tierFlag; } |
---|
| 204 | Void setTierFlag(Bool x) { m_tierFlag = x; } |
---|
| 205 | |
---|
| 206 | Int getProfileIdc() const { return m_profileIdc; } |
---|
| 207 | Void setProfileIdc(Int x) { m_profileIdc = x; } |
---|
| 208 | |
---|
| 209 | Bool getProfileCompatibilityFlag(Int i) const { return m_profileCompatibilityFlag[i]; } |
---|
| 210 | Void setProfileCompatibilityFlag(Int i, Bool x) { m_profileCompatibilityFlag[i] = x; } |
---|
| 211 | |
---|
| 212 | Int getLevelIdc() const { return m_levelIdc; } |
---|
| 213 | Void setLevelIdc(Int x) { m_levelIdc = x; } |
---|
| 214 | |
---|
| 215 | Bool getProgressiveSourceFlag() const { return m_progressiveSourceFlag; } |
---|
| 216 | Void setProgressiveSourceFlag(Bool b) { m_progressiveSourceFlag = b; } |
---|
| 217 | |
---|
| 218 | Bool getInterlacedSourceFlag() const { return m_interlacedSourceFlag; } |
---|
| 219 | Void setInterlacedSourceFlag(Bool b) { m_interlacedSourceFlag = b; } |
---|
| 220 | |
---|
| 221 | Bool getNonPackedConstraintFlag() const { return m_nonPackedConstraintFlag; } |
---|
| 222 | Void setNonPackedConstraintFlag(Bool b) { m_nonPackedConstraintFlag = b; } |
---|
| 223 | |
---|
| 224 | Bool getFrameOnlyConstraintFlag() const { return m_frameOnlyConstraintFlag; } |
---|
| 225 | Void setFrameOnlyConstraintFlag(Bool b) { m_frameOnlyConstraintFlag = b; } |
---|
| 226 | }; |
---|
| 227 | |
---|
| 228 | |
---|
| 229 | class TComPTL |
---|
| 230 | { |
---|
| 231 | ProfileTierLevel m_generalPTL; |
---|
| 232 | ProfileTierLevel m_subLayerPTL[6]; // max. value of max_sub_layers_minus1 is 6 |
---|
| 233 | Bool m_subLayerProfilePresentFlag[6]; |
---|
| 234 | Bool m_subLayerLevelPresentFlag[6]; |
---|
| 235 | |
---|
| 236 | public: |
---|
| 237 | TComPTL(); |
---|
| 238 | Bool getSubLayerProfilePresentFlag(Int i) const { return m_subLayerProfilePresentFlag[i]; } |
---|
| 239 | Void setSubLayerProfilePresentFlag(Int i, Bool x) { m_subLayerProfilePresentFlag[i] = x; } |
---|
| 240 | |
---|
| 241 | Bool getSubLayerLevelPresentFlag(Int i) const { return m_subLayerLevelPresentFlag[i]; } |
---|
| 242 | Void setSubLayerLevelPresentFlag(Int i, Bool x) { m_subLayerLevelPresentFlag[i] = x; } |
---|
| 243 | |
---|
| 244 | ProfileTierLevel* getGeneralPTL() { return &m_generalPTL; } |
---|
| 245 | ProfileTierLevel* getSubLayerPTL(Int i) { return &m_subLayerPTL[i]; } |
---|
| 246 | #if H_MV |
---|
| 247 | Void copyLevelFrom( TComPTL* source ); |
---|
| 248 | #endif |
---|
| 249 | }; |
---|
[77] | 250 | /// VPS class |
---|
| 251 | |
---|
[608] | 252 | struct HrdSubLayerInfo |
---|
| 253 | { |
---|
| 254 | Bool fixedPicRateFlag; |
---|
| 255 | Bool fixedPicRateWithinCvsFlag; |
---|
| 256 | UInt picDurationInTcMinus1; |
---|
| 257 | Bool lowDelayHrdFlag; |
---|
| 258 | UInt cpbCntMinus1; |
---|
| 259 | UInt bitRateValueMinus1[MAX_CPB_CNT][2]; |
---|
| 260 | UInt cpbSizeValue [MAX_CPB_CNT][2]; |
---|
| 261 | UInt ducpbSizeValue [MAX_CPB_CNT][2]; |
---|
| 262 | UInt cbrFlag [MAX_CPB_CNT][2]; |
---|
| 263 | UInt duBitRateValue [MAX_CPB_CNT][2]; |
---|
| 264 | }; |
---|
| 265 | |
---|
| 266 | class TComHRD |
---|
| 267 | { |
---|
| 268 | private: |
---|
| 269 | Bool m_nalHrdParametersPresentFlag; |
---|
| 270 | Bool m_vclHrdParametersPresentFlag; |
---|
| 271 | Bool m_subPicCpbParamsPresentFlag; |
---|
| 272 | UInt m_tickDivisorMinus2; |
---|
| 273 | UInt m_duCpbRemovalDelayLengthMinus1; |
---|
| 274 | Bool m_subPicCpbParamsInPicTimingSEIFlag; |
---|
| 275 | UInt m_dpbOutputDelayDuLengthMinus1; |
---|
| 276 | UInt m_bitRateScale; |
---|
| 277 | UInt m_cpbSizeScale; |
---|
| 278 | UInt m_ducpbSizeScale; |
---|
| 279 | UInt m_initialCpbRemovalDelayLengthMinus1; |
---|
| 280 | UInt m_cpbRemovalDelayLengthMinus1; |
---|
| 281 | UInt m_dpbOutputDelayLengthMinus1; |
---|
| 282 | UInt m_numDU; |
---|
| 283 | HrdSubLayerInfo m_HRD[MAX_TLAYER]; |
---|
| 284 | |
---|
| 285 | public: |
---|
| 286 | TComHRD() |
---|
| 287 | :m_nalHrdParametersPresentFlag(0) |
---|
| 288 | ,m_vclHrdParametersPresentFlag(0) |
---|
| 289 | ,m_subPicCpbParamsPresentFlag(false) |
---|
| 290 | ,m_tickDivisorMinus2(0) |
---|
| 291 | ,m_duCpbRemovalDelayLengthMinus1(0) |
---|
| 292 | ,m_subPicCpbParamsInPicTimingSEIFlag(false) |
---|
| 293 | ,m_dpbOutputDelayDuLengthMinus1(0) |
---|
| 294 | ,m_bitRateScale(0) |
---|
| 295 | ,m_cpbSizeScale(0) |
---|
| 296 | ,m_initialCpbRemovalDelayLengthMinus1(0) |
---|
| 297 | ,m_cpbRemovalDelayLengthMinus1(0) |
---|
| 298 | ,m_dpbOutputDelayLengthMinus1(0) |
---|
| 299 | {} |
---|
| 300 | |
---|
| 301 | virtual ~TComHRD() {} |
---|
| 302 | |
---|
| 303 | Void setNalHrdParametersPresentFlag ( Bool flag ) { m_nalHrdParametersPresentFlag = flag; } |
---|
| 304 | Bool getNalHrdParametersPresentFlag ( ) { return m_nalHrdParametersPresentFlag; } |
---|
| 305 | |
---|
| 306 | Void setVclHrdParametersPresentFlag ( Bool flag ) { m_vclHrdParametersPresentFlag = flag; } |
---|
| 307 | Bool getVclHrdParametersPresentFlag ( ) { return m_vclHrdParametersPresentFlag; } |
---|
| 308 | |
---|
| 309 | Void setSubPicCpbParamsPresentFlag ( Bool flag ) { m_subPicCpbParamsPresentFlag = flag; } |
---|
| 310 | Bool getSubPicCpbParamsPresentFlag ( ) { return m_subPicCpbParamsPresentFlag; } |
---|
| 311 | |
---|
| 312 | Void setTickDivisorMinus2 ( UInt value ) { m_tickDivisorMinus2 = value; } |
---|
| 313 | UInt getTickDivisorMinus2 ( ) { return m_tickDivisorMinus2; } |
---|
| 314 | |
---|
| 315 | Void setDuCpbRemovalDelayLengthMinus1 ( UInt value ) { m_duCpbRemovalDelayLengthMinus1 = value; } |
---|
| 316 | UInt getDuCpbRemovalDelayLengthMinus1 ( ) { return m_duCpbRemovalDelayLengthMinus1; } |
---|
| 317 | |
---|
| 318 | Void setSubPicCpbParamsInPicTimingSEIFlag ( Bool flag) { m_subPicCpbParamsInPicTimingSEIFlag = flag; } |
---|
| 319 | Bool getSubPicCpbParamsInPicTimingSEIFlag () { return m_subPicCpbParamsInPicTimingSEIFlag; } |
---|
| 320 | |
---|
| 321 | Void setDpbOutputDelayDuLengthMinus1 (UInt value ) { m_dpbOutputDelayDuLengthMinus1 = value; } |
---|
| 322 | UInt getDpbOutputDelayDuLengthMinus1 () { return m_dpbOutputDelayDuLengthMinus1; } |
---|
| 323 | |
---|
| 324 | Void setBitRateScale ( UInt value ) { m_bitRateScale = value; } |
---|
| 325 | UInt getBitRateScale ( ) { return m_bitRateScale; } |
---|
| 326 | |
---|
| 327 | Void setCpbSizeScale ( UInt value ) { m_cpbSizeScale = value; } |
---|
| 328 | UInt getCpbSizeScale ( ) { return m_cpbSizeScale; } |
---|
| 329 | Void setDuCpbSizeScale ( UInt value ) { m_ducpbSizeScale = value; } |
---|
| 330 | UInt getDuCpbSizeScale ( ) { return m_ducpbSizeScale; } |
---|
| 331 | |
---|
| 332 | Void setInitialCpbRemovalDelayLengthMinus1( UInt value ) { m_initialCpbRemovalDelayLengthMinus1 = value; } |
---|
| 333 | UInt getInitialCpbRemovalDelayLengthMinus1( ) { return m_initialCpbRemovalDelayLengthMinus1; } |
---|
| 334 | |
---|
| 335 | Void setCpbRemovalDelayLengthMinus1 ( UInt value ) { m_cpbRemovalDelayLengthMinus1 = value; } |
---|
| 336 | UInt getCpbRemovalDelayLengthMinus1 ( ) { return m_cpbRemovalDelayLengthMinus1; } |
---|
| 337 | |
---|
| 338 | Void setDpbOutputDelayLengthMinus1 ( UInt value ) { m_dpbOutputDelayLengthMinus1 = value; } |
---|
| 339 | UInt getDpbOutputDelayLengthMinus1 ( ) { return m_dpbOutputDelayLengthMinus1; } |
---|
| 340 | |
---|
| 341 | Void setFixedPicRateFlag ( Int layer, Bool flag ) { m_HRD[layer].fixedPicRateFlag = flag; } |
---|
| 342 | Bool getFixedPicRateFlag ( Int layer ) { return m_HRD[layer].fixedPicRateFlag; } |
---|
| 343 | |
---|
| 344 | Void setFixedPicRateWithinCvsFlag ( Int layer, Bool flag ) { m_HRD[layer].fixedPicRateWithinCvsFlag = flag; } |
---|
| 345 | Bool getFixedPicRateWithinCvsFlag ( Int layer ) { return m_HRD[layer].fixedPicRateWithinCvsFlag; } |
---|
| 346 | |
---|
| 347 | Void setPicDurationInTcMinus1 ( Int layer, UInt value ) { m_HRD[layer].picDurationInTcMinus1 = value; } |
---|
| 348 | UInt getPicDurationInTcMinus1 ( Int layer ) { return m_HRD[layer].picDurationInTcMinus1; } |
---|
| 349 | |
---|
| 350 | Void setLowDelayHrdFlag ( Int layer, Bool flag ) { m_HRD[layer].lowDelayHrdFlag = flag; } |
---|
| 351 | Bool getLowDelayHrdFlag ( Int layer ) { return m_HRD[layer].lowDelayHrdFlag; } |
---|
| 352 | |
---|
| 353 | Void setCpbCntMinus1 ( Int layer, UInt value ) { m_HRD[layer].cpbCntMinus1 = value; } |
---|
| 354 | UInt getCpbCntMinus1 ( Int layer ) { return m_HRD[layer].cpbCntMinus1; } |
---|
| 355 | |
---|
| 356 | Void setBitRateValueMinus1 ( Int layer, Int cpbcnt, Int nalOrVcl, UInt value ) { m_HRD[layer].bitRateValueMinus1[cpbcnt][nalOrVcl] = value; } |
---|
| 357 | UInt getBitRateValueMinus1 ( Int layer, Int cpbcnt, Int nalOrVcl ) { return m_HRD[layer].bitRateValueMinus1[cpbcnt][nalOrVcl]; } |
---|
| 358 | |
---|
| 359 | Void setCpbSizeValueMinus1 ( Int layer, Int cpbcnt, Int nalOrVcl, UInt value ) { m_HRD[layer].cpbSizeValue[cpbcnt][nalOrVcl] = value; } |
---|
| 360 | UInt getCpbSizeValueMinus1 ( Int layer, Int cpbcnt, Int nalOrVcl ) { return m_HRD[layer].cpbSizeValue[cpbcnt][nalOrVcl]; } |
---|
| 361 | Void setDuCpbSizeValueMinus1 ( Int layer, Int cpbcnt, Int nalOrVcl, UInt value ) { m_HRD[layer].ducpbSizeValue[cpbcnt][nalOrVcl] = value; } |
---|
| 362 | UInt getDuCpbSizeValueMinus1 ( Int layer, Int cpbcnt, Int nalOrVcl ) { return m_HRD[layer].ducpbSizeValue[cpbcnt][nalOrVcl]; } |
---|
| 363 | Void setDuBitRateValueMinus1 ( Int layer, Int cpbcnt, Int nalOrVcl, UInt value ) { m_HRD[layer].duBitRateValue[cpbcnt][nalOrVcl] = value; } |
---|
| 364 | UInt getDuBitRateValueMinus1 (Int layer, Int cpbcnt, Int nalOrVcl ) { return m_HRD[layer].duBitRateValue[cpbcnt][nalOrVcl]; } |
---|
| 365 | Void setCbrFlag ( Int layer, Int cpbcnt, Int nalOrVcl, UInt value ) { m_HRD[layer].cbrFlag[cpbcnt][nalOrVcl] = value; } |
---|
| 366 | Bool getCbrFlag ( Int layer, Int cpbcnt, Int nalOrVcl ) { return m_HRD[layer].cbrFlag[cpbcnt][nalOrVcl]; } |
---|
| 367 | |
---|
| 368 | Void setNumDU ( UInt value ) { m_numDU = value; } |
---|
| 369 | UInt getNumDU ( ) { return m_numDU; } |
---|
| 370 | Bool getCpbDpbDelaysPresentFlag() { return getNalHrdParametersPresentFlag() || getVclHrdParametersPresentFlag(); } |
---|
| 371 | }; |
---|
| 372 | |
---|
| 373 | class TimingInfo |
---|
| 374 | { |
---|
| 375 | Bool m_timingInfoPresentFlag; |
---|
| 376 | UInt m_numUnitsInTick; |
---|
| 377 | UInt m_timeScale; |
---|
| 378 | Bool m_pocProportionalToTimingFlag; |
---|
| 379 | Int m_numTicksPocDiffOneMinus1; |
---|
| 380 | public: |
---|
| 381 | TimingInfo() |
---|
| 382 | : m_timingInfoPresentFlag(false) |
---|
| 383 | , m_numUnitsInTick(1001) |
---|
| 384 | , m_timeScale(60000) |
---|
| 385 | , m_pocProportionalToTimingFlag(false) |
---|
| 386 | , m_numTicksPocDiffOneMinus1(0) {} |
---|
| 387 | |
---|
| 388 | Void setTimingInfoPresentFlag ( Bool flag ) { m_timingInfoPresentFlag = flag; } |
---|
| 389 | Bool getTimingInfoPresentFlag ( ) { return m_timingInfoPresentFlag; } |
---|
| 390 | |
---|
| 391 | Void setNumUnitsInTick ( UInt value ) { m_numUnitsInTick = value; } |
---|
| 392 | UInt getNumUnitsInTick ( ) { return m_numUnitsInTick; } |
---|
| 393 | |
---|
| 394 | Void setTimeScale ( UInt value ) { m_timeScale = value; } |
---|
| 395 | UInt getTimeScale ( ) { return m_timeScale; } |
---|
| 396 | |
---|
| 397 | Bool getPocProportionalToTimingFlag ( ) { return m_pocProportionalToTimingFlag; } |
---|
| 398 | Void setPocProportionalToTimingFlag (Bool x ) { m_pocProportionalToTimingFlag = x; } |
---|
| 399 | |
---|
| 400 | Int getNumTicksPocDiffOneMinus1 ( ) { return m_numTicksPocDiffOneMinus1; } |
---|
| 401 | Void setNumTicksPocDiffOneMinus1 (Int x ) { m_numTicksPocDiffOneMinus1 = x; } |
---|
| 402 | }; |
---|
| 403 | |
---|
[622] | 404 | #if H_MV |
---|
| 405 | class TComVPSVUI |
---|
| 406 | { |
---|
| 407 | private: |
---|
| 408 | Bool m_bitRatePresentVpsFlag; |
---|
| 409 | Bool m_picRatePresentVpsFlag; |
---|
| 410 | Bool m_bitRatePresentFlag [MAX_VPS_OP_SETS_PLUS1][MAX_TLAYER]; |
---|
| 411 | Bool m_picRatePresentFlag [MAX_VPS_OP_SETS_PLUS1][MAX_TLAYER]; |
---|
| 412 | Int m_avgBitRate [MAX_VPS_OP_SETS_PLUS1][MAX_TLAYER]; |
---|
| 413 | Int m_maxBitRate [MAX_VPS_OP_SETS_PLUS1][MAX_TLAYER]; |
---|
| 414 | Int m_constantPicRateIdc [MAX_VPS_OP_SETS_PLUS1][MAX_TLAYER]; |
---|
| 415 | Int m_avgPicRate [MAX_VPS_OP_SETS_PLUS1][MAX_TLAYER]; |
---|
| 416 | Bool m_tileBoundariesAlignedFlag [MAX_NUM_LAYERS][MAX_NUM_LAYERS]; |
---|
| 417 | Bool m_ilpRestrictedRefLayersFlag; |
---|
| 418 | Int m_minSpatialSegmentOffsetPlus1[MAX_NUM_LAYERS][MAX_NUM_LAYERS]; |
---|
| 419 | Bool m_ctuBasedOffsetEnabledFlag [MAX_NUM_LAYERS][MAX_NUM_LAYERS]; |
---|
| 420 | Int m_minHorizontalCtuOffsetPlus1 [MAX_NUM_LAYERS][MAX_NUM_LAYERS]; |
---|
| 421 | |
---|
| 422 | public: |
---|
| 423 | TComVPSVUI();; |
---|
| 424 | |
---|
| 425 | Void setBitRatePresentVpsFlag( Bool flag ) { m_bitRatePresentVpsFlag = flag; } |
---|
| 426 | Bool getBitRatePresentVpsFlag( ) { return m_bitRatePresentVpsFlag; } |
---|
| 427 | |
---|
| 428 | Void setPicRatePresentVpsFlag( Bool flag ) { m_picRatePresentVpsFlag = flag; } |
---|
| 429 | Bool getPicRatePresentVpsFlag( ) { return m_picRatePresentVpsFlag; } |
---|
| 430 | |
---|
| 431 | Void setBitRatePresentFlag( Int i, Int j, Bool flag ) { m_bitRatePresentFlag[i][j] = flag; } |
---|
| 432 | Bool getBitRatePresentFlag( Int i, Int j ) { return m_bitRatePresentFlag[i][j]; } |
---|
| 433 | |
---|
| 434 | Void setPicRatePresentFlag( Int i, Int j, Bool flag ) { m_picRatePresentFlag[i][j] = flag; } |
---|
| 435 | Bool getPicRatePresentFlag( Int i, Int j ) { return m_picRatePresentFlag[i][j]; } |
---|
| 436 | |
---|
| 437 | Void setAvgBitRate( Int i, Int j, Int val ) { m_avgBitRate[i][j] = val; } |
---|
| 438 | Int getAvgBitRate( Int i, Int j ) { return m_avgBitRate[i][j]; } |
---|
| 439 | |
---|
| 440 | Void setMaxBitRate( Int i, Int j, Int val ) { m_maxBitRate[i][j] = val; } |
---|
| 441 | Int getMaxBitRate( Int i, Int j ) { return m_maxBitRate[i][j]; } |
---|
| 442 | |
---|
| 443 | Void setConstantPicRateIdc( Int i, Int j, Int val ) { m_constantPicRateIdc[i][j] = val; } |
---|
| 444 | Int getConstantPicRateIdc( Int i, Int j ) { return m_constantPicRateIdc[i][j]; } |
---|
| 445 | |
---|
| 446 | Void setAvgPicRate( Int i, Int j, Int val ) { m_avgPicRate[i][j] = val; } |
---|
| 447 | Int getAvgPicRate( Int i, Int j ) { return m_avgPicRate[i][j]; } |
---|
| 448 | |
---|
| 449 | Void setTileBoundariesAlignedFlag( Int i, Int j, Bool flag ) { m_tileBoundariesAlignedFlag[i][j] = flag; } |
---|
| 450 | Bool getTileBoundariesAlignedFlag( Int i, Int j ) { return m_tileBoundariesAlignedFlag[i][j]; } |
---|
| 451 | |
---|
| 452 | Void setIlpRestrictedRefLayersFlag( Bool flag ) { m_ilpRestrictedRefLayersFlag = flag; } |
---|
| 453 | Bool getIlpRestrictedRefLayersFlag( ) { return m_ilpRestrictedRefLayersFlag; } |
---|
| 454 | |
---|
| 455 | Void setMinSpatialSegmentOffsetPlus1( Int i, Int j, Int val ) { m_minSpatialSegmentOffsetPlus1[i][j] = val; } |
---|
| 456 | Int getMinSpatialSegmentOffsetPlus1( Int i, Int j ) { return m_minSpatialSegmentOffsetPlus1[i][j]; } |
---|
| 457 | |
---|
| 458 | Void setCtuBasedOffsetEnabledFlag( Int i, Int j, Bool flag ) { m_ctuBasedOffsetEnabledFlag[i][j] = flag; } |
---|
| 459 | Bool getCtuBasedOffsetEnabledFlag( Int i, Int j ) { return m_ctuBasedOffsetEnabledFlag[i][j]; } |
---|
| 460 | |
---|
| 461 | Void setMinHorizontalCtuOffsetPlus1( Int i, Int j, Int val ) { m_minHorizontalCtuOffsetPlus1[i][j] = val; } |
---|
| 462 | Int getMinHorizontalCtuOffsetPlus1( Int i, Int j ) { return m_minHorizontalCtuOffsetPlus1[i][j]; } |
---|
| 463 | |
---|
| 464 | }; |
---|
| 465 | |
---|
| 466 | class TComRepFormat |
---|
| 467 | { |
---|
| 468 | private: |
---|
| 469 | Int m_chromaFormatVpsIdc; |
---|
| 470 | Bool m_separateColourPlaneVpsFlag; |
---|
| 471 | Int m_picWidthVpsInLumaSamples; |
---|
| 472 | Int m_picHeightVpsInLumaSamples; |
---|
| 473 | Int m_bitDepthVpsLumaMinus8; |
---|
| 474 | Int m_bitDepthVpsChromaMinus8; |
---|
| 475 | |
---|
| 476 | public: |
---|
| 477 | TComRepFormat() { }; |
---|
| 478 | |
---|
| 479 | Void setChromaFormatVpsIdc( Int val ) { m_chromaFormatVpsIdc = val; } |
---|
| 480 | Int getChromaFormatVpsIdc( ) { return m_chromaFormatVpsIdc; } |
---|
| 481 | |
---|
| 482 | Void setSeparateColourPlaneVpsFlag( Bool flag ) { m_separateColourPlaneVpsFlag = flag; } |
---|
| 483 | Bool getSeparateColourPlaneVpsFlag( ) { return m_separateColourPlaneVpsFlag; } |
---|
| 484 | |
---|
| 485 | Void setPicWidthVpsInLumaSamples( Int val ) { m_picWidthVpsInLumaSamples = val; } |
---|
| 486 | Int getPicWidthVpsInLumaSamples( ) { return m_picWidthVpsInLumaSamples; } |
---|
| 487 | |
---|
| 488 | Void setPicHeightVpsInLumaSamples( Int val ) { m_picHeightVpsInLumaSamples = val; } |
---|
| 489 | Int getPicHeightVpsInLumaSamples( ) { return m_picHeightVpsInLumaSamples; } |
---|
| 490 | |
---|
| 491 | Void setBitDepthVpsLumaMinus8( Int val ) { m_bitDepthVpsLumaMinus8 = val; } |
---|
| 492 | Int getBitDepthVpsLumaMinus8( ) { return m_bitDepthVpsLumaMinus8; } |
---|
| 493 | |
---|
| 494 | Void setBitDepthVpsChromaMinus8( Int val ) { m_bitDepthVpsChromaMinus8 = val; } |
---|
| 495 | Int getBitDepthVpsChromaMinus8( ) { return m_bitDepthVpsChromaMinus8; } |
---|
| 496 | }; |
---|
| 497 | #endif |
---|
| 498 | |
---|
[77] | 499 | class TComVPS |
---|
| 500 | { |
---|
| 501 | private: |
---|
| 502 | Int m_VPSId; |
---|
[100] | 503 | UInt m_uiMaxTLayers; |
---|
[622] | 504 | |
---|
| 505 | #if H_MV |
---|
| 506 | UInt m_uiMaxLayersMinus1; |
---|
| 507 | #else |
---|
[100] | 508 | UInt m_uiMaxLayers; |
---|
[622] | 509 | #endif |
---|
[100] | 510 | Bool m_bTemporalIdNestingFlag; |
---|
[608] | 511 | |
---|
| 512 | UInt m_numReorderPics[MAX_TLAYER]; |
---|
| 513 | UInt m_uiMaxDecPicBuffering[MAX_TLAYER]; |
---|
| 514 | UInt m_uiMaxLatencyIncrease[MAX_TLAYER]; // Really max latency increase plus 1 (value 0 expresses no limit) |
---|
[77] | 515 | |
---|
[608] | 516 | UInt m_numHrdParameters; |
---|
| 517 | #if H_MV |
---|
| 518 | UInt m_maxLayerId; |
---|
[210] | 519 | #else |
---|
[608] | 520 | UInt m_maxNuhReservedZeroLayerId; |
---|
[210] | 521 | #endif |
---|
[608] | 522 | TComHRD* m_hrdParameters; |
---|
| 523 | UInt* m_hrdOpSetIdx; |
---|
| 524 | Bool* m_cprmsPresentFlag; |
---|
| 525 | #if H_MV |
---|
| 526 | UInt m_vpsNumLayerSetsMinus1; |
---|
| 527 | Bool m_layerIdIncludedFlag[MAX_VPS_OP_SETS_PLUS1][MAX_VPS_NUH_LAYER_ID_PLUS1]; |
---|
| 528 | #else |
---|
| 529 | UInt m_numOpSets; |
---|
| 530 | Bool m_layerIdIncludedFlag[MAX_VPS_OP_SETS_PLUS1][MAX_VPS_NUH_RESERVED_ZERO_LAYER_ID_PLUS1]; |
---|
[210] | 531 | #endif |
---|
[608] | 532 | |
---|
| 533 | #if H_MV |
---|
| 534 | TComPTL m_pcPTL[MAX_VPS_OP_SETS_PLUS1]; |
---|
| 535 | #else |
---|
| 536 | TComPTL m_pcPTL; |
---|
[210] | 537 | #endif |
---|
[608] | 538 | TimingInfo m_timingInfo; |
---|
| 539 | #if H_MV |
---|
| 540 | /// VPS EXTENSION SYNTAX ELEMENTS |
---|
| 541 | Bool m_avcBaseLayerFlag; |
---|
[622] | 542 | Int m_vpsVuiOffset; |
---|
[608] | 543 | Bool m_splittingFlag; |
---|
[622] | 544 | Bool m_scalabilityMaskFlag [MAX_NUM_SCALABILITY_TYPES]; |
---|
[608] | 545 | Int m_dimensionIdLen [MAX_NUM_SCALABILITY_TYPES]; |
---|
| 546 | Bool m_vpsNuhLayerIdPresentFlag; |
---|
| 547 | Int m_layerIdInNuh [MAX_NUM_LAYER_IDS]; |
---|
| 548 | Int m_dimensionId [MAX_NUM_LAYER_IDS][MAX_NUM_SCALABILITY_TYPES]; |
---|
[622] | 549 | Int m_viewIdLenMinus1; |
---|
| 550 | Int m_viewIdVal [MAX_NUM_LAYERS]; |
---|
[608] | 551 | Bool m_directDependencyFlag [MAX_NUM_LAYER_IDS][MAX_NUM_LAYER_IDS]; |
---|
[622] | 552 | Bool m_maxTidRefPresentFlag; |
---|
[608] | 553 | Int m_maxTidIlRefPicPlus1 [MAX_NUM_LAYERS]; |
---|
[622] | 554 | Bool m_allRefLayersActiveFlag; |
---|
[608] | 555 | Int m_vpsNumberLayerSetsMinus1; |
---|
| 556 | Int m_vpsNumProfileTierLevelMinus1; |
---|
| 557 | Bool m_vpsProfilePresentFlag [MAX_VPS_OP_SETS_PLUS1]; |
---|
| 558 | Int m_profileRefMinus1 [MAX_VPS_PROFILE_TIER_LEVEL]; |
---|
| 559 | Bool m_moreOutputLayerSetsThanDefaultFlag; |
---|
| 560 | Int m_numAddOutputLayerSetsMinus1; |
---|
| 561 | Bool m_defaultOneTargetOutputLayerFlag; |
---|
| 562 | Int m_outputLayerSetIdxMinus1 [MAX_VPS_OUTPUTLAYER_SETS]; |
---|
| 563 | Bool m_outputLayerFlag [MAX_VPS_OUTPUTLAYER_SETS][MAX_VPS_NUH_LAYER_ID_PLUS1]; |
---|
| 564 | Int m_profileLevelTierIdx [MAX_VPS_OUTPUTLAYER_SETS ]; |
---|
[622] | 565 | Bool m_repFormatIdxPresentFlag; |
---|
| 566 | Int m_vpsNumRepFormatsMinus1; |
---|
| 567 | Int m_vpsRepFormatIdx [MAX_NUM_LAYERS]; |
---|
| 568 | TComRepFormat* m_repFormat [MAX_NUM_LAYERS]; |
---|
[608] | 569 | Bool m_maxOneActiveRefLayerFlag; |
---|
[622] | 570 | Bool m_crossLayerIrapAlignedFlag; |
---|
[608] | 571 | Int m_directDepTypeLenMinus2; |
---|
[622] | 572 | Bool m_vpsVuiPresentFlag; |
---|
| 573 | TComVPSVUI* m_vpsVUI; |
---|
[608] | 574 | Int m_directDependencyType [MAX_NUM_LAYERS] [MAX_NUM_LAYERS]; |
---|
[77] | 575 | |
---|
[608] | 576 | // VPS EXTENSION SEMANTICS VARIABLES |
---|
| 577 | Int m_layerIdInVps [MAX_NUM_LAYERS ]; |
---|
| 578 | |
---|
| 579 | Int m_numDirectRefLayers [MAX_NUM_LAYERS]; |
---|
| 580 | Int m_refLayerId [MAX_NUM_LAYERS][MAX_NUM_LAYERS]; |
---|
| 581 | |
---|
| 582 | Int m_numSamplePredRefLayers [MAX_NUM_LAYERS]; |
---|
| 583 | Bool m_samplePredEnabledFlag [MAX_NUM_LAYERS][MAX_NUM_LAYERS]; |
---|
| 584 | Int m_samplePredRefLayerId [MAX_NUM_LAYERS][MAX_NUM_LAYERS]; |
---|
| 585 | |
---|
| 586 | Int m_numMotionPredRefLayers [MAX_NUM_LAYERS]; |
---|
| 587 | Bool m_motionPredEnabledFlag [MAX_NUM_LAYERS][MAX_NUM_LAYERS]; |
---|
| 588 | Int m_motionPredRefLayerId [MAX_NUM_LAYERS][MAX_NUM_LAYERS]; |
---|
[622] | 589 | Int m_viewIndex [MAX_NUM_LAYERS ]; |
---|
[608] | 590 | Int xGetDimBitOffset( Int j ); |
---|
| 591 | |
---|
[622] | 592 | // VPS EXTENSION 2 SYNTAX ELEMENTS |
---|
[608] | 593 | #if H_3D_ARP |
---|
| 594 | UInt m_uiUseAdvResPred [MAX_NUM_LAYERS ]; |
---|
| 595 | UInt m_uiARPStepNum [MAX_NUM_LAYERS ]; |
---|
[443] | 596 | #endif |
---|
[608] | 597 | #if H_3D_IV_MERGE |
---|
| 598 | Bool m_ivMvPredFlag [ MAX_NUM_LAYERS ]; |
---|
[443] | 599 | #endif |
---|
[608] | 600 | #if H_3D_VSP |
---|
| 601 | Bool m_viewSynthesisPredFlag [ MAX_NUM_LAYERS ]; |
---|
| 602 | #endif |
---|
| 603 | #if H_3D_NBDV_REF |
---|
| 604 | Bool m_depthRefinementFlag [ MAX_NUM_LAYERS ]; |
---|
| 605 | #endif |
---|
| 606 | Bool m_vpsDepthModesFlag [MAX_NUM_LAYERS ]; |
---|
| 607 | #if H_3D_DIM_DLT |
---|
| 608 | Bool m_bUseDLTFlag [MAX_NUM_LAYERS ]; |
---|
| 609 | |
---|
| 610 | Int m_iBitsPerDepthValue [MAX_NUM_LAYERS ]; |
---|
| 611 | Int m_iNumDepthmapValues [MAX_NUM_LAYERS ]; |
---|
| 612 | Int* m_iDepthValue2Idx [MAX_NUM_LAYERS ]; |
---|
| 613 | Int* m_iIdx2DepthValue [MAX_NUM_LAYERS ]; |
---|
| 614 | #endif |
---|
[622] | 615 | #if H_3D |
---|
[608] | 616 | Bool m_ivMvScalingFlag; |
---|
| 617 | #endif |
---|
[655] | 618 | #if H_3D_INTER_SDC |
---|
[608] | 619 | Bool m_bInterSDCFlag[MAX_NUM_LAYERS ]; |
---|
| 620 | #endif |
---|
[443] | 621 | |
---|
[608] | 622 | #endif |
---|
[77] | 623 | public: |
---|
| 624 | TComVPS(); |
---|
| 625 | virtual ~TComVPS(); |
---|
[608] | 626 | |
---|
| 627 | Void createHrdParamBuffer() |
---|
| 628 | { |
---|
| 629 | m_hrdParameters = new TComHRD[ getNumHrdParameters() ]; |
---|
| 630 | m_hrdOpSetIdx = new UInt [ getNumHrdParameters() ]; |
---|
| 631 | m_cprmsPresentFlag = new Bool [ getNumHrdParameters() ]; |
---|
| 632 | } |
---|
| 633 | |
---|
| 634 | TComHRD* getHrdParameters ( UInt i ) { return &m_hrdParameters[ i ]; } |
---|
| 635 | UInt getHrdOpSetIdx ( UInt i ) { return m_hrdOpSetIdx[ i ]; } |
---|
| 636 | Void setHrdOpSetIdx ( UInt val, UInt i ) { m_hrdOpSetIdx[ i ] = val; } |
---|
| 637 | Bool getCprmsPresentFlag ( UInt i ) { return m_cprmsPresentFlag[ i ]; } |
---|
| 638 | Void setCprmsPresentFlag ( Bool val, UInt i ) { m_cprmsPresentFlag[ i ] = val; } |
---|
| 639 | |
---|
[77] | 640 | Int getVPSId () { return m_VPSId; } |
---|
| 641 | Void setVPSId (Int i) { m_VPSId = i; } |
---|
[608] | 642 | |
---|
[77] | 643 | UInt getMaxTLayers () { return m_uiMaxTLayers; } |
---|
| 644 | Void setMaxTLayers (UInt t) { m_uiMaxTLayers = t; } |
---|
[608] | 645 | |
---|
[622] | 646 | #if H_MV |
---|
| 647 | UInt getMaxLayersMinus1() { return m_uiMaxLayersMinus1; }; |
---|
| 648 | Void setMaxLayersMinus1(UInt l) { m_uiMaxLayersMinus1 = l; } |
---|
| 649 | #else |
---|
[77] | 650 | UInt getMaxLayers () { return m_uiMaxLayers; } |
---|
[100] | 651 | Void setMaxLayers (UInt l) { m_uiMaxLayers = l; } |
---|
[622] | 652 | #endif |
---|
[608] | 653 | |
---|
| 654 | Bool getTemporalNestingFlag () { return m_bTemporalIdNestingFlag; } |
---|
| 655 | Void setTemporalNestingFlag (Bool t) { m_bTemporalIdNestingFlag = t; } |
---|
[100] | 656 | |
---|
[608] | 657 | Void setNumReorderPics(UInt v, UInt tLayer) { m_numReorderPics[tLayer] = v; } |
---|
| 658 | UInt getNumReorderPics(UInt tLayer) { return m_numReorderPics[tLayer]; } |
---|
[77] | 659 | |
---|
[608] | 660 | Void setMaxDecPicBuffering(UInt v, UInt tLayer) { m_uiMaxDecPicBuffering[tLayer] = v; } |
---|
| 661 | UInt getMaxDecPicBuffering(UInt tLayer) { return m_uiMaxDecPicBuffering[tLayer]; } |
---|
| 662 | |
---|
| 663 | Void setMaxLatencyIncrease(UInt v, UInt tLayer) { m_uiMaxLatencyIncrease[tLayer] = v; } |
---|
| 664 | UInt getMaxLatencyIncrease(UInt tLayer) { return m_uiMaxLatencyIncrease[tLayer]; } |
---|
| 665 | |
---|
| 666 | UInt getNumHrdParameters() { return m_numHrdParameters; } |
---|
| 667 | Void setNumHrdParameters(UInt v) { m_numHrdParameters = v; } |
---|
| 668 | |
---|
| 669 | #if H_MV |
---|
| 670 | UInt getVpsMaxLayerId() { return m_maxLayerId; } |
---|
| 671 | Void setVpsMaxLayerId(UInt v) { m_maxLayerId = v; } |
---|
| 672 | |
---|
| 673 | UInt getVpsNumLayerSetsMinus1() { return m_vpsNumLayerSetsMinus1; } |
---|
| 674 | Void setVpsNumLayerSetsMinus1(UInt v) { m_vpsNumLayerSetsMinus1 = v; } |
---|
| 675 | #else |
---|
| 676 | UInt getMaxNuhReservedZeroLayerId() { return m_maxNuhReservedZeroLayerId; } |
---|
| 677 | Void setMaxNuhReservedZeroLayerId(UInt v) { m_maxNuhReservedZeroLayerId = v; } |
---|
| 678 | |
---|
| 679 | UInt getMaxOpSets() { return m_numOpSets; } |
---|
| 680 | Void setMaxOpSets(UInt v) { m_numOpSets = v; } |
---|
[210] | 681 | #endif |
---|
[608] | 682 | Bool getLayerIdIncludedFlag(UInt opsIdx, UInt id) { return m_layerIdIncludedFlag[opsIdx][id]; } |
---|
| 683 | Void setLayerIdIncludedFlag(Bool v, UInt opsIdx, UInt id) { m_layerIdIncludedFlag[opsIdx][id] = v; } |
---|
| 684 | |
---|
| 685 | #if H_MV |
---|
| 686 | TComPTL* getPTL( Int layerSet = 0 ) { return &m_pcPTL[layerSet]; } |
---|
| 687 | #else |
---|
| 688 | TComPTL* getPTL() { return &m_pcPTL; } |
---|
[210] | 689 | #endif |
---|
[608] | 690 | TimingInfo* getTimingInfo() { return &m_timingInfo; } |
---|
| 691 | #if H_MV |
---|
| 692 | Void setAvcBaseLayerFlag( Bool val ) { m_avcBaseLayerFlag = val; } |
---|
| 693 | Bool getAvcBaseLayerFlag() { return m_avcBaseLayerFlag; } |
---|
| 694 | |
---|
[622] | 695 | Void setVpsVuiOffset( Int val ) { m_vpsVuiOffset = val; } |
---|
| 696 | Int getVpsVuiOffset( ) { return m_vpsVuiOffset; } |
---|
| 697 | |
---|
[608] | 698 | Void setSplittingFlag( Bool val ) { m_splittingFlag = val; } |
---|
| 699 | Bool getSplittingFlag() { return m_splittingFlag; } |
---|
| 700 | |
---|
[622] | 701 | Void setScalabilityMaskFlag( UInt val ); |
---|
| 702 | Void setScalabilityMaskFlag( Int scalType, Bool val ) { m_scalabilityMaskFlag[scalType] = val; } |
---|
| 703 | Bool getScalabilityMaskFlag( Int scalType ) { return m_scalabilityMaskFlag[scalType]; } |
---|
[608] | 704 | Int getNumScalabilityTypes( ); |
---|
| 705 | |
---|
| 706 | Void setDimensionIdLen( Int sIdx, Int val ) { m_dimensionIdLen[sIdx] = val; } |
---|
| 707 | Int getDimensionIdLen( Int sIdx ) { assert( m_dimensionIdLen[sIdx] > 0) ; return m_dimensionIdLen[sIdx]; } |
---|
| 708 | |
---|
| 709 | Void setVpsNuhLayerIdPresentFlag( Bool val ) { m_vpsNuhLayerIdPresentFlag = val; } |
---|
| 710 | Bool getVpsNuhLayerIdPresentFlag() { return m_vpsNuhLayerIdPresentFlag; } |
---|
| 711 | |
---|
| 712 | Void setLayerIdInNuh( Int layerIdInVps, Int val ) { m_layerIdInNuh[layerIdInVps] = val; } |
---|
| 713 | Int getLayerIdInNuh( Int layerIdInVps ) { assert( m_layerIdInNuh[layerIdInVps] >= 0 ); return m_layerIdInNuh[layerIdInVps]; } |
---|
| 714 | |
---|
| 715 | Bool nuhLayerIdIncluded( Int layerIdinNuh ) { return ( m_layerIdInVps[ layerIdinNuh ] > 0 ); } |
---|
| 716 | |
---|
| 717 | Void setDimensionId( Int layerIdInVps, Int scalIdx, Int val ) { m_dimensionId[layerIdInVps][scalIdx] = val; } |
---|
| 718 | Int getDimensionId( Int layerIdInVps, Int scalIdx ) { return m_dimensionId[layerIdInVps][scalIdx]; } |
---|
| 719 | |
---|
[622] | 720 | Void setViewIdLenMinus1( Int val ) { m_viewIdLenMinus1 = val; } |
---|
| 721 | Int getViewIdLenMinus1( ) { return m_viewIdLenMinus1; } |
---|
| 722 | |
---|
| 723 | Void setViewIdVal( Int viewOrderIndex, Int val ) { m_viewIdVal[viewOrderIndex] = val; } |
---|
| 724 | Int getViewIdVal( Int viewOrderIndex ) { return m_viewIdVal[viewOrderIndex]; } |
---|
[608] | 725 | Void setDirectDependencyFlag( Int depLayeridInVps, Int refLayeridInVps, Bool val ) { m_directDependencyFlag[depLayeridInVps][refLayeridInVps] = val; } |
---|
| 726 | Bool getDirectDependencyFlag( Int depLayeridInVps, Int refLayeridInVps ) { return m_directDependencyFlag[depLayeridInVps][refLayeridInVps]; } |
---|
| 727 | |
---|
[622] | 728 | Void setMaxTidRefPresentFlag( Bool flag ) { m_maxTidRefPresentFlag = flag; } |
---|
| 729 | Bool getMaxTidRefPresentFlag( ) { return m_maxTidRefPresentFlag; } |
---|
[608] | 730 | Void setMaxTidIlRefPicPlus1( Int layerIdInVps, Int val ) { m_maxTidIlRefPicPlus1[ layerIdInVps ] = val; } |
---|
| 731 | Int getMaxTidIlRefPicPlus1( Int layerIdInVps ) { return m_maxTidIlRefPicPlus1[ layerIdInVps ]; } |
---|
[622] | 732 | Void setAllRefLayersActiveFlag( Bool flag ) { m_allRefLayersActiveFlag = flag; } |
---|
| 733 | Bool getAllRefLayersActiveFlag( ) { return m_allRefLayersActiveFlag; } |
---|
[608] | 734 | Void setVpsNumberLayerSetsMinus1( Int val ) { m_vpsNumberLayerSetsMinus1 = val; } |
---|
| 735 | Int getVpsNumberLayerSetsMinus1( ) { return m_vpsNumberLayerSetsMinus1; } |
---|
[77] | 736 | |
---|
[608] | 737 | Void setVpsNumProfileTierLevelMinus1( Int val ) { m_vpsNumProfileTierLevelMinus1 = val; } |
---|
| 738 | Int getVpsNumProfileTierLevelMinus1( ) { return m_vpsNumProfileTierLevelMinus1; } |
---|
| 739 | |
---|
| 740 | Void setVpsProfilePresentFlag( Int idx, Bool val ) { m_vpsProfilePresentFlag[idx] = val; } |
---|
| 741 | Bool getVpsProfilePresentFlag( Int idx ) { return m_vpsProfilePresentFlag[idx]; } |
---|
[210] | 742 | |
---|
[608] | 743 | Void setProfileRefMinus1( Int profileTierLevelIdx, Int val ) { m_profileRefMinus1[ profileTierLevelIdx ] = val; } |
---|
| 744 | Int getProfileRefMinus1( Int profileTierLevelIdx ) { return m_profileRefMinus1[ profileTierLevelIdx ]; } |
---|
[210] | 745 | |
---|
[608] | 746 | Void setMoreOutputLayerSetsThanDefaultFlag( Bool flag ) { m_moreOutputLayerSetsThanDefaultFlag = flag; } |
---|
| 747 | Bool getMoreOutputLayerSetsThanDefaultFlag() { return m_moreOutputLayerSetsThanDefaultFlag; } |
---|
[77] | 748 | |
---|
[608] | 749 | Void setNumAddOutputLayerSetsMinus1( Int val ) { m_numAddOutputLayerSetsMinus1 = val; } |
---|
| 750 | Int getNumAddOutputLayerSetsMinus1( ) { return m_numAddOutputLayerSetsMinus1; } |
---|
| 751 | |
---|
| 752 | Void setDefaultOneTargetOutputLayerFlag( Bool flag ) { m_defaultOneTargetOutputLayerFlag = flag; } |
---|
| 753 | Bool getDefaultOneTargetOutputLayerFlag( ) { return m_defaultOneTargetOutputLayerFlag; } |
---|
| 754 | |
---|
| 755 | Void setOutputLayerSetIdxMinus1( Int outLayerSetIdx, Int val ) { m_outputLayerSetIdxMinus1[ outLayerSetIdx ] = val; } |
---|
| 756 | Int getOutputLayerSetIdxMinus1( Int outLayerSetIdx ) { return m_outputLayerSetIdxMinus1[ outLayerSetIdx ]; } |
---|
[443] | 757 | |
---|
[608] | 758 | Void setOutputLayerFlag( Int outLayerSetIdx, Int i, Bool flag ) { m_outputLayerFlag[ outLayerSetIdx ][ i ] = flag; } |
---|
| 759 | Bool getOutputLayerFlag( Int outLayerSetIdx, Int i ) { return m_outputLayerFlag[ outLayerSetIdx ][ i ]; } |
---|
| 760 | |
---|
| 761 | Void setProfileLevelTierIdx( Int outLayerSetIdx, Int val ) { m_profileLevelTierIdx[ outLayerSetIdx = val ]; } |
---|
| 762 | Int getProfileLevelTierIdx( Int outLayerSetIdx ) { return m_profileLevelTierIdx[ outLayerSetIdx ]; } |
---|
| 763 | |
---|
[622] | 764 | Void setRepFormatIdxPresentFlag( Bool flag ) { m_repFormatIdxPresentFlag = flag; } |
---|
| 765 | Bool getRepFormatIdxPresentFlag( ) { return m_repFormatIdxPresentFlag; } |
---|
| 766 | |
---|
| 767 | Void setVpsNumRepFormatsMinus1( Int val ) { m_vpsNumRepFormatsMinus1 = val; } |
---|
| 768 | Int getVpsNumRepFormatsMinus1( ) { return m_vpsNumRepFormatsMinus1; } |
---|
| 769 | |
---|
| 770 | Void setVpsRepFormatIdx( Int i, Int val ) { m_vpsRepFormatIdx[i] = val; } |
---|
| 771 | Int getVpsRepFormatIdx( Int i ) { return m_vpsRepFormatIdx[i]; } |
---|
| 772 | |
---|
| 773 | Void setRepFormat( Int i, TComRepFormat* val ) { m_repFormat[i] = val; } |
---|
| 774 | TComRepFormat* getRepFormat( Int i ) { return m_repFormat[i]; } |
---|
[608] | 775 | Void setMaxOneActiveRefLayerFlag( Bool flag) { m_maxOneActiveRefLayerFlag = flag; } |
---|
| 776 | Bool getMaxOneActiveRefLayerFlag( ) { return m_maxOneActiveRefLayerFlag; } |
---|
[622] | 777 | Void setCrossLayerIrapAlignedFlag( Bool flag ) { m_crossLayerIrapAlignedFlag = flag; } |
---|
| 778 | Bool getCrossLayerIrapAlignedFlag( ) { return m_crossLayerIrapAlignedFlag; } |
---|
[608] | 779 | Void setDirectDepTypeLenMinus2( Int val) { m_directDepTypeLenMinus2 = val; } |
---|
| 780 | Int getDirectDepTypeLenMinus2( ) { return m_directDepTypeLenMinus2; } |
---|
| 781 | |
---|
| 782 | Void setDirectDependencyType( Int depLayeridInVps, Int refLayeridInVps, Int val) { m_directDependencyType[ depLayeridInVps ][ refLayeridInVps ] = val; } |
---|
| 783 | Int getDirectDependencyType( Int depLayeridInVps, Int refLayeridInVps) { return m_directDependencyType[ depLayeridInVps ][ refLayeridInVps ]; } |
---|
[622] | 784 | Void setVpsVuiPresentFlag( Bool flag ) { m_vpsVuiPresentFlag = flag; } |
---|
| 785 | Bool getVpsVuiPresentFlag( ) { return m_vpsVuiPresentFlag; } |
---|
[608] | 786 | |
---|
[622] | 787 | TComVPSVUI* getVPSVUI( ) { return m_vpsVUI; } |
---|
[608] | 788 | // VPS EXTENSION SEMANTICS VARIABLES |
---|
| 789 | Void setLayerIdInVps( Int layerIdInNuh, Int val ) { m_layerIdInVps[layerIdInNuh] = val; } |
---|
| 790 | Int getLayerIdInVps( Int layerIdInNuh ) { assert( m_layerIdInVps[layerIdInNuh] >= 0 ); return m_layerIdInVps[layerIdInNuh]; } |
---|
| 791 | |
---|
| 792 | Int getScalabilityId ( Int layerIdInVps, ScalabilityType scalType ); |
---|
[622] | 793 | Int getViewId ( Int layerIdInNuh ) { return m_viewIdVal[ getViewIndex( getLayerIdInVps( layerIdInNuh) )]; } |
---|
[608] | 794 | Void setRefLayers(); |
---|
| 795 | |
---|
[622] | 796 | Int getViewIndex ( Int layerIdInNuh ) { return getScalabilityId( getLayerIdInVps(layerIdInNuh), VIEW_ORDER_INDEX ); } |
---|
| 797 | Int getNumViews(); |
---|
| 798 | |
---|
| 799 | Int getNumDirectRefLayers( Int layerIdInNuh ) { return m_numDirectRefLayers[ layerIdInNuh ]; }; |
---|
| 800 | Int getRefLayerId ( Int layerIdInNuh, Int idx );; |
---|
[608] | 801 | Bool checkVPSExtensionSyntax(); |
---|
| 802 | Int scalTypeToScalIdx ( ScalabilityType scalType ); |
---|
| 803 | |
---|
[622] | 804 | Int getProfileLevelTierIdxLen() { return gCeilLog2( getVpsNumProfileTierLevelMinus1() + 1 ); }; |
---|
| 805 | |
---|
[608] | 806 | Int getNumLayersInIdList ( Int lsIdx );; |
---|
| 807 | |
---|
| 808 | // inference |
---|
| 809 | Int inferDimensionId ( Int i, Int j ); |
---|
| 810 | Int inferLastDimsionIdLenMinus1(); |
---|
| 811 | |
---|
[622] | 812 | // helpers |
---|
| 813 | Bool getInDirectDependencyFlag( Int depLayeridInVps, Int refLayeridInVps, Int depth = 0 ); |
---|
| 814 | /// VPS EXTENSION 2 SYNTAX ELEMENTS |
---|
[608] | 815 | #if H_3D |
---|
[622] | 816 | Int getDepthId ( Int layerIdInNuh) { return getScalabilityId( getLayerIdInVps(layerIdInNuh), DEPTH_ID ); } |
---|
[608] | 817 | Int getLayerIdInNuh( Int viewIndex, Bool depthFlag ); |
---|
| 818 | |
---|
| 819 | #if H_3D_ARP |
---|
| 820 | UInt getUseAdvRP ( Int layerIdInVps ) { return m_uiUseAdvResPred[layerIdInVps]; } |
---|
| 821 | UInt getARPStepNum( Int layerIdInVps ) { return m_uiARPStepNum[layerIdInVps]; } |
---|
| 822 | Void setUseAdvRP ( Int layerIdInVps, UInt val ) { m_uiUseAdvResPred[layerIdInVps] = val; } |
---|
| 823 | Void setARPStepNum( Int layerIdInVps, UInt val ) { m_uiARPStepNum[layerIdInVps] = val; } |
---|
[443] | 824 | #endif |
---|
[608] | 825 | #if H_3D_IV_MERGE |
---|
| 826 | Void setIvMvPredFlag ( Int layerIdInVps, Bool val ) { m_ivMvPredFlag[ layerIdInVps ] = val; } |
---|
| 827 | Bool getIvMvPredFlag ( Int layerIdInVps ) { return m_ivMvPredFlag[ layerIdInVps ]; }; |
---|
[443] | 828 | #endif |
---|
[608] | 829 | #if H_3D_VSP |
---|
| 830 | Void setViewSynthesisPredFlag ( Int layerIdInVps, Bool val ) { m_viewSynthesisPredFlag[ layerIdInVps ] = val; } |
---|
| 831 | Bool getViewSynthesisPredFlag ( Int layerIdInVps ) { return m_viewSynthesisPredFlag[ layerIdInVps ]; }; |
---|
| 832 | #endif |
---|
| 833 | #if H_3D_NBDV_REF |
---|
| 834 | Void setDepthRefinementFlag ( Int layerIdInVps, Bool val ) { m_depthRefinementFlag[ layerIdInVps ] = val; } |
---|
| 835 | Bool getDepthRefinementFlag ( Int layerIdInVps ) { return m_depthRefinementFlag[ layerIdInVps ]; }; |
---|
| 836 | #endif |
---|
| 837 | Void setVpsDepthModesFlag( Int layerIdInVps, Bool val ) { m_vpsDepthModesFlag[ layerIdInVps ] = val; } |
---|
| 838 | Bool getVpsDepthModesFlag( Int layerIdInVps ) { return m_vpsDepthModesFlag[ layerIdInVps ]; } |
---|
| 839 | #if H_3D_DIM_DLT |
---|
| 840 | Bool getUseDLTFlag ( Int layerIdInVps ) { return m_bUseDLTFlag[ layerIdInVps ]; } |
---|
| 841 | Void setUseDLTFlag ( Int layerIdInVps, Bool b ) { m_bUseDLTFlag[ layerIdInVps ] = b; } |
---|
| 842 | |
---|
| 843 | Int getBitsPerDepthValue( Int layerIdInVps ) { return getUseDLTFlag(layerIdInVps)?m_iBitsPerDepthValue[layerIdInVps]:g_bitDepthY; } |
---|
| 844 | Int getNumDepthValues( Int layerIdInVps ) { return getUseDLTFlag(layerIdInVps)?m_iNumDepthmapValues[layerIdInVps]:((1 << g_bitDepthY)-1); } |
---|
| 845 | Int depthValue2idx( Int layerIdInVps, Pel value ) { return getUseDLTFlag(layerIdInVps)?m_iDepthValue2Idx[layerIdInVps][value]:value; } |
---|
| 846 | Pel idx2DepthValue( Int layerIdInVps, UInt uiIdx ) { return getUseDLTFlag(layerIdInVps)?m_iIdx2DepthValue[layerIdInVps][uiIdx]:uiIdx; } |
---|
| 847 | Void setDepthLUTs( Int layerIdInVps, Int* idx2DepthValue = NULL, Int iNumDepthValues = 0 ); |
---|
| 848 | #endif |
---|
| 849 | |
---|
| 850 | Bool getIvMvScalingFlag ( ) { return m_ivMvScalingFlag; } |
---|
| 851 | Void setIvMvScalingFlag ( Bool b ) { m_ivMvScalingFlag = b; } |
---|
[655] | 852 | #if H_3D_INTER_SDC |
---|
[608] | 853 | Bool getInterSDCFlag ( Int layerIdInVps ) { return m_bInterSDCFlag[layerIdInVps]; } |
---|
| 854 | Void setInterSDCFlag ( Int layerIdInVps, Bool bval ){ m_bInterSDCFlag[layerIdInVps] = bval; } |
---|
| 855 | #endif |
---|
| 856 | |
---|
| 857 | #endif |
---|
| 858 | #endif |
---|
[77] | 859 | }; |
---|
| 860 | |
---|
[608] | 861 | class Window |
---|
| 862 | { |
---|
| 863 | private: |
---|
| 864 | Bool m_enabledFlag; |
---|
| 865 | Int m_winLeftOffset; |
---|
| 866 | Int m_winRightOffset; |
---|
| 867 | Int m_winTopOffset; |
---|
| 868 | Int m_winBottomOffset; |
---|
[622] | 869 | #if H_MV |
---|
| 870 | Bool m_scaledFlag; |
---|
| 871 | #endif |
---|
[608] | 872 | public: |
---|
| 873 | Window() |
---|
| 874 | : m_enabledFlag (false) |
---|
| 875 | , m_winLeftOffset (0) |
---|
| 876 | , m_winRightOffset (0) |
---|
| 877 | , m_winTopOffset (0) |
---|
| 878 | , m_winBottomOffset (0) |
---|
[622] | 879 | #if H_MV |
---|
| 880 | , m_scaledFlag(true) |
---|
| 881 | #endif |
---|
[608] | 882 | { } |
---|
| 883 | |
---|
| 884 | Bool getWindowEnabledFlag() const { return m_enabledFlag; } |
---|
| 885 | Void resetWindow() { m_enabledFlag = false; m_winLeftOffset = m_winRightOffset = m_winTopOffset = m_winBottomOffset = 0; } |
---|
| 886 | Int getWindowLeftOffset() const { return m_enabledFlag ? m_winLeftOffset : 0; } |
---|
| 887 | Void setWindowLeftOffset(Int val) { m_winLeftOffset = val; m_enabledFlag = true; } |
---|
| 888 | Int getWindowRightOffset() const { return m_enabledFlag ? m_winRightOffset : 0; } |
---|
| 889 | Void setWindowRightOffset(Int val) { m_winRightOffset = val; m_enabledFlag = true; } |
---|
| 890 | Int getWindowTopOffset() const { return m_enabledFlag ? m_winTopOffset : 0; } |
---|
| 891 | Void setWindowTopOffset(Int val) { m_winTopOffset = val; m_enabledFlag = true; } |
---|
| 892 | Int getWindowBottomOffset() const { return m_enabledFlag ? m_winBottomOffset: 0; } |
---|
| 893 | Void setWindowBottomOffset(Int val) { m_winBottomOffset = val; m_enabledFlag = true; } |
---|
| 894 | |
---|
[622] | 895 | #if H_MV |
---|
| 896 | Void setScaledFlag(Bool flag) { m_scaledFlag = flag; } |
---|
| 897 | Bool getScaledFlag() const { return m_scaledFlag; } |
---|
| 898 | Void scaleOffsets( Int scal ) |
---|
| 899 | { |
---|
| 900 | if (! m_scaledFlag ) |
---|
| 901 | { |
---|
| 902 | m_scaledFlag = true; |
---|
| 903 | m_winLeftOffset *= scal; |
---|
| 904 | m_winRightOffset *= scal; |
---|
| 905 | m_winTopOffset *= scal; |
---|
| 906 | m_winBottomOffset *= scal; |
---|
| 907 | } |
---|
| 908 | } |
---|
| 909 | #endif |
---|
[608] | 910 | Void setWindow(Int offsetLeft, Int offsetLRight, Int offsetLTop, Int offsetLBottom) |
---|
| 911 | { |
---|
| 912 | m_enabledFlag = true; |
---|
| 913 | m_winLeftOffset = offsetLeft; |
---|
| 914 | m_winRightOffset = offsetLRight; |
---|
| 915 | m_winTopOffset = offsetLTop; |
---|
| 916 | m_winBottomOffset = offsetLBottom; |
---|
| 917 | } |
---|
| 918 | }; |
---|
| 919 | |
---|
| 920 | |
---|
| 921 | class TComVUI |
---|
| 922 | { |
---|
| 923 | private: |
---|
| 924 | Bool m_aspectRatioInfoPresentFlag; |
---|
| 925 | Int m_aspectRatioIdc; |
---|
| 926 | Int m_sarWidth; |
---|
| 927 | Int m_sarHeight; |
---|
| 928 | Bool m_overscanInfoPresentFlag; |
---|
| 929 | Bool m_overscanAppropriateFlag; |
---|
| 930 | Bool m_videoSignalTypePresentFlag; |
---|
| 931 | Int m_videoFormat; |
---|
| 932 | Bool m_videoFullRangeFlag; |
---|
| 933 | Bool m_colourDescriptionPresentFlag; |
---|
| 934 | Int m_colourPrimaries; |
---|
| 935 | Int m_transferCharacteristics; |
---|
| 936 | Int m_matrixCoefficients; |
---|
| 937 | Bool m_chromaLocInfoPresentFlag; |
---|
| 938 | Int m_chromaSampleLocTypeTopField; |
---|
| 939 | Int m_chromaSampleLocTypeBottomField; |
---|
| 940 | Bool m_neutralChromaIndicationFlag; |
---|
| 941 | Bool m_fieldSeqFlag; |
---|
| 942 | |
---|
| 943 | Window m_defaultDisplayWindow; |
---|
| 944 | Bool m_frameFieldInfoPresentFlag; |
---|
| 945 | Bool m_hrdParametersPresentFlag; |
---|
| 946 | Bool m_bitstreamRestrictionFlag; |
---|
| 947 | Bool m_tilesFixedStructureFlag; |
---|
| 948 | Bool m_motionVectorsOverPicBoundariesFlag; |
---|
| 949 | Bool m_restrictedRefPicListsFlag; |
---|
| 950 | Int m_minSpatialSegmentationIdc; |
---|
| 951 | Int m_maxBytesPerPicDenom; |
---|
| 952 | Int m_maxBitsPerMinCuDenom; |
---|
| 953 | Int m_log2MaxMvLengthHorizontal; |
---|
| 954 | Int m_log2MaxMvLengthVertical; |
---|
| 955 | TComHRD m_hrdParameters; |
---|
| 956 | TimingInfo m_timingInfo; |
---|
[77] | 957 | |
---|
[608] | 958 | public: |
---|
| 959 | TComVUI() |
---|
| 960 | :m_aspectRatioInfoPresentFlag(false) |
---|
| 961 | ,m_aspectRatioIdc(0) |
---|
| 962 | ,m_sarWidth(0) |
---|
| 963 | ,m_sarHeight(0) |
---|
| 964 | ,m_overscanInfoPresentFlag(false) |
---|
| 965 | ,m_overscanAppropriateFlag(false) |
---|
| 966 | ,m_videoSignalTypePresentFlag(false) |
---|
| 967 | ,m_videoFormat(5) |
---|
| 968 | ,m_videoFullRangeFlag(false) |
---|
| 969 | ,m_colourDescriptionPresentFlag(false) |
---|
| 970 | ,m_colourPrimaries(2) |
---|
| 971 | ,m_transferCharacteristics(2) |
---|
| 972 | ,m_matrixCoefficients(2) |
---|
| 973 | ,m_chromaLocInfoPresentFlag(false) |
---|
| 974 | ,m_chromaSampleLocTypeTopField(0) |
---|
| 975 | ,m_chromaSampleLocTypeBottomField(0) |
---|
| 976 | ,m_neutralChromaIndicationFlag(false) |
---|
| 977 | ,m_fieldSeqFlag(false) |
---|
| 978 | ,m_frameFieldInfoPresentFlag(false) |
---|
| 979 | ,m_hrdParametersPresentFlag(false) |
---|
| 980 | ,m_bitstreamRestrictionFlag(false) |
---|
| 981 | ,m_tilesFixedStructureFlag(false) |
---|
| 982 | ,m_motionVectorsOverPicBoundariesFlag(true) |
---|
| 983 | ,m_restrictedRefPicListsFlag(1) |
---|
| 984 | ,m_minSpatialSegmentationIdc(0) |
---|
| 985 | ,m_maxBytesPerPicDenom(2) |
---|
| 986 | ,m_maxBitsPerMinCuDenom(1) |
---|
| 987 | ,m_log2MaxMvLengthHorizontal(15) |
---|
| 988 | ,m_log2MaxMvLengthVertical(15) |
---|
| 989 | {} |
---|
| 990 | |
---|
| 991 | virtual ~TComVUI() {} |
---|
| 992 | |
---|
| 993 | Bool getAspectRatioInfoPresentFlag() { return m_aspectRatioInfoPresentFlag; } |
---|
| 994 | Void setAspectRatioInfoPresentFlag(Bool i) { m_aspectRatioInfoPresentFlag = i; } |
---|
| 995 | |
---|
| 996 | Int getAspectRatioIdc() { return m_aspectRatioIdc; } |
---|
| 997 | Void setAspectRatioIdc(Int i) { m_aspectRatioIdc = i; } |
---|
| 998 | |
---|
| 999 | Int getSarWidth() { return m_sarWidth; } |
---|
| 1000 | Void setSarWidth(Int i) { m_sarWidth = i; } |
---|
| 1001 | |
---|
| 1002 | Int getSarHeight() { return m_sarHeight; } |
---|
| 1003 | Void setSarHeight(Int i) { m_sarHeight = i; } |
---|
| 1004 | |
---|
| 1005 | Bool getOverscanInfoPresentFlag() { return m_overscanInfoPresentFlag; } |
---|
| 1006 | Void setOverscanInfoPresentFlag(Bool i) { m_overscanInfoPresentFlag = i; } |
---|
| 1007 | |
---|
| 1008 | Bool getOverscanAppropriateFlag() { return m_overscanAppropriateFlag; } |
---|
| 1009 | Void setOverscanAppropriateFlag(Bool i) { m_overscanAppropriateFlag = i; } |
---|
| 1010 | |
---|
| 1011 | Bool getVideoSignalTypePresentFlag() { return m_videoSignalTypePresentFlag; } |
---|
| 1012 | Void setVideoSignalTypePresentFlag(Bool i) { m_videoSignalTypePresentFlag = i; } |
---|
| 1013 | |
---|
| 1014 | Int getVideoFormat() { return m_videoFormat; } |
---|
| 1015 | Void setVideoFormat(Int i) { m_videoFormat = i; } |
---|
| 1016 | |
---|
| 1017 | Bool getVideoFullRangeFlag() { return m_videoFullRangeFlag; } |
---|
| 1018 | Void setVideoFullRangeFlag(Bool i) { m_videoFullRangeFlag = i; } |
---|
| 1019 | |
---|
| 1020 | Bool getColourDescriptionPresentFlag() { return m_colourDescriptionPresentFlag; } |
---|
| 1021 | Void setColourDescriptionPresentFlag(Bool i) { m_colourDescriptionPresentFlag = i; } |
---|
| 1022 | |
---|
| 1023 | Int getColourPrimaries() { return m_colourPrimaries; } |
---|
| 1024 | Void setColourPrimaries(Int i) { m_colourPrimaries = i; } |
---|
| 1025 | |
---|
| 1026 | Int getTransferCharacteristics() { return m_transferCharacteristics; } |
---|
| 1027 | Void setTransferCharacteristics(Int i) { m_transferCharacteristics = i; } |
---|
| 1028 | |
---|
| 1029 | Int getMatrixCoefficients() { return m_matrixCoefficients; } |
---|
| 1030 | Void setMatrixCoefficients(Int i) { m_matrixCoefficients = i; } |
---|
| 1031 | |
---|
| 1032 | Bool getChromaLocInfoPresentFlag() { return m_chromaLocInfoPresentFlag; } |
---|
| 1033 | Void setChromaLocInfoPresentFlag(Bool i) { m_chromaLocInfoPresentFlag = i; } |
---|
| 1034 | |
---|
| 1035 | Int getChromaSampleLocTypeTopField() { return m_chromaSampleLocTypeTopField; } |
---|
| 1036 | Void setChromaSampleLocTypeTopField(Int i) { m_chromaSampleLocTypeTopField = i; } |
---|
| 1037 | |
---|
| 1038 | Int getChromaSampleLocTypeBottomField() { return m_chromaSampleLocTypeBottomField; } |
---|
| 1039 | Void setChromaSampleLocTypeBottomField(Int i) { m_chromaSampleLocTypeBottomField = i; } |
---|
| 1040 | |
---|
| 1041 | Bool getNeutralChromaIndicationFlag() { return m_neutralChromaIndicationFlag; } |
---|
| 1042 | Void setNeutralChromaIndicationFlag(Bool i) { m_neutralChromaIndicationFlag = i; } |
---|
| 1043 | |
---|
| 1044 | Bool getFieldSeqFlag() { return m_fieldSeqFlag; } |
---|
| 1045 | Void setFieldSeqFlag(Bool i) { m_fieldSeqFlag = i; } |
---|
| 1046 | |
---|
| 1047 | Bool getFrameFieldInfoPresentFlag() { return m_frameFieldInfoPresentFlag; } |
---|
| 1048 | Void setFrameFieldInfoPresentFlag(Bool i) { m_frameFieldInfoPresentFlag = i; } |
---|
| 1049 | |
---|
| 1050 | Window& getDefaultDisplayWindow() { return m_defaultDisplayWindow; } |
---|
| 1051 | Void setDefaultDisplayWindow(Window& defaultDisplayWindow ) { m_defaultDisplayWindow = defaultDisplayWindow; } |
---|
| 1052 | |
---|
| 1053 | Bool getHrdParametersPresentFlag() { return m_hrdParametersPresentFlag; } |
---|
| 1054 | Void setHrdParametersPresentFlag(Bool i) { m_hrdParametersPresentFlag = i; } |
---|
| 1055 | |
---|
| 1056 | Bool getBitstreamRestrictionFlag() { return m_bitstreamRestrictionFlag; } |
---|
| 1057 | Void setBitstreamRestrictionFlag(Bool i) { m_bitstreamRestrictionFlag = i; } |
---|
| 1058 | |
---|
| 1059 | Bool getTilesFixedStructureFlag() { return m_tilesFixedStructureFlag; } |
---|
| 1060 | Void setTilesFixedStructureFlag(Bool i) { m_tilesFixedStructureFlag = i; } |
---|
| 1061 | |
---|
| 1062 | Bool getMotionVectorsOverPicBoundariesFlag() { return m_motionVectorsOverPicBoundariesFlag; } |
---|
| 1063 | Void setMotionVectorsOverPicBoundariesFlag(Bool i) { m_motionVectorsOverPicBoundariesFlag = i; } |
---|
| 1064 | |
---|
| 1065 | Bool getRestrictedRefPicListsFlag() { return m_restrictedRefPicListsFlag; } |
---|
| 1066 | Void setRestrictedRefPicListsFlag(Bool b) { m_restrictedRefPicListsFlag = b; } |
---|
| 1067 | |
---|
| 1068 | Int getMinSpatialSegmentationIdc() { return m_minSpatialSegmentationIdc; } |
---|
| 1069 | Void setMinSpatialSegmentationIdc(Int i) { m_minSpatialSegmentationIdc = i; } |
---|
| 1070 | Int getMaxBytesPerPicDenom() { return m_maxBytesPerPicDenom; } |
---|
| 1071 | Void setMaxBytesPerPicDenom(Int i) { m_maxBytesPerPicDenom = i; } |
---|
| 1072 | |
---|
| 1073 | Int getMaxBitsPerMinCuDenom() { return m_maxBitsPerMinCuDenom; } |
---|
| 1074 | Void setMaxBitsPerMinCuDenom(Int i) { m_maxBitsPerMinCuDenom = i; } |
---|
| 1075 | |
---|
| 1076 | Int getLog2MaxMvLengthHorizontal() { return m_log2MaxMvLengthHorizontal; } |
---|
| 1077 | Void setLog2MaxMvLengthHorizontal(Int i) { m_log2MaxMvLengthHorizontal = i; } |
---|
| 1078 | |
---|
| 1079 | Int getLog2MaxMvLengthVertical() { return m_log2MaxMvLengthVertical; } |
---|
| 1080 | Void setLog2MaxMvLengthVertical(Int i) { m_log2MaxMvLengthVertical = i; } |
---|
| 1081 | |
---|
| 1082 | TComHRD* getHrdParameters () { return &m_hrdParameters; } |
---|
| 1083 | TimingInfo* getTimingInfo() { return &m_timingInfo; } |
---|
[622] | 1084 | |
---|
[608] | 1085 | }; |
---|
| 1086 | |
---|
[2] | 1087 | /// SPS class |
---|
| 1088 | class TComSPS |
---|
| 1089 | { |
---|
| 1090 | private: |
---|
[56] | 1091 | Int m_SPSId; |
---|
[608] | 1092 | Int m_VPSId; |
---|
[56] | 1093 | Int m_chromaFormatIdc; |
---|
| 1094 | |
---|
| 1095 | UInt m_uiMaxTLayers; // maximum number of temporal layers |
---|
| 1096 | |
---|
[2] | 1097 | // Structure |
---|
[56] | 1098 | UInt m_picWidthInLumaSamples; |
---|
| 1099 | UInt m_picHeightInLumaSamples; |
---|
[608] | 1100 | |
---|
| 1101 | Int m_log2MinCodingBlockSize; |
---|
| 1102 | Int m_log2DiffMaxMinCodingBlockSize; |
---|
[2] | 1103 | UInt m_uiMaxCUWidth; |
---|
| 1104 | UInt m_uiMaxCUHeight; |
---|
| 1105 | UInt m_uiMaxCUDepth; |
---|
[608] | 1106 | |
---|
| 1107 | Window m_conformanceWindow; |
---|
| 1108 | |
---|
| 1109 | TComRPSList m_RPSList; |
---|
[56] | 1110 | Bool m_bLongTermRefsPresent; |
---|
[608] | 1111 | Bool m_TMVPFlagsPresent; |
---|
[56] | 1112 | Int m_numReorderPics[MAX_TLAYER]; |
---|
| 1113 | |
---|
[2] | 1114 | // Tool list |
---|
| 1115 | UInt m_uiQuadtreeTULog2MaxSize; |
---|
| 1116 | UInt m_uiQuadtreeTULog2MinSize; |
---|
| 1117 | UInt m_uiQuadtreeTUMaxDepthInter; |
---|
| 1118 | UInt m_uiQuadtreeTUMaxDepthIntra; |
---|
[56] | 1119 | Bool m_usePCM; |
---|
| 1120 | UInt m_pcmLog2MaxSize; |
---|
| 1121 | UInt m_uiPCMLog2MinSize; |
---|
| 1122 | Bool m_useAMP; |
---|
[2] | 1123 | |
---|
[608] | 1124 | #if H_3D_QTLPC |
---|
| 1125 | Bool m_bUseQTL; |
---|
| 1126 | Bool m_bUsePC; |
---|
| 1127 | #endif |
---|
[2] | 1128 | // Parameter |
---|
[608] | 1129 | Int m_bitDepthY; |
---|
| 1130 | Int m_bitDepthC; |
---|
[56] | 1131 | Int m_qpBDOffsetY; |
---|
| 1132 | Int m_qpBDOffsetC; |
---|
[5] | 1133 | |
---|
[56] | 1134 | Bool m_useLossless; |
---|
| 1135 | |
---|
| 1136 | UInt m_uiPCMBitDepthLuma; |
---|
| 1137 | UInt m_uiPCMBitDepthChroma; |
---|
| 1138 | Bool m_bPCMFilterDisableFlag; |
---|
| 1139 | |
---|
| 1140 | UInt m_uiBitsForPOC; |
---|
[608] | 1141 | UInt m_numLongTermRefPicSPS; |
---|
| 1142 | UInt m_ltRefPicPocLsbSps[33]; |
---|
| 1143 | Bool m_usedByCurrPicLtSPSFlag[33]; |
---|
[2] | 1144 | // Max physical transform size |
---|
| 1145 | UInt m_uiMaxTrSize; |
---|
[56] | 1146 | |
---|
[2] | 1147 | Int m_iAMPAcc[MAX_CU_DEPTH]; |
---|
[56] | 1148 | Bool m_bUseSAO; |
---|
[2] | 1149 | |
---|
[56] | 1150 | Bool m_bTemporalIdNestingFlag; // temporal_id_nesting_flag |
---|
[2] | 1151 | |
---|
[56] | 1152 | Bool m_scalingListEnabledFlag; |
---|
[608] | 1153 | Bool m_scalingListPresentFlag; |
---|
| 1154 | TComScalingList* m_scalingList; //!< ScalingList class pointer |
---|
[56] | 1155 | UInt m_uiMaxDecPicBuffering[MAX_TLAYER]; |
---|
[608] | 1156 | UInt m_uiMaxLatencyIncrease[MAX_TLAYER]; // Really max latency increase plus 1 (value 0 expresses no limit) |
---|
[56] | 1157 | |
---|
| 1158 | Bool m_useDF; |
---|
[608] | 1159 | Bool m_useStrongIntraSmoothing; |
---|
[56] | 1160 | |
---|
[608] | 1161 | Bool m_vuiParametersPresentFlag; |
---|
| 1162 | TComVUI m_vuiParameters; |
---|
[56] | 1163 | |
---|
[608] | 1164 | static const Int m_winUnitX[MAX_CHROMA_FORMAT_IDC+1]; |
---|
| 1165 | static const Int m_winUnitY[MAX_CHROMA_FORMAT_IDC+1]; |
---|
| 1166 | TComPTL m_pcPTL; |
---|
| 1167 | #if H_MV |
---|
[622] | 1168 | TComVPS* m_pcVPS; |
---|
| 1169 | // SPS |
---|
| 1170 | Bool m_spsInferScalingListFlag; |
---|
| 1171 | Int m_spsScalingListRefLayerId; |
---|
| 1172 | Bool m_updateRepFormatFlag; |
---|
| 1173 | // SPS Extension |
---|
[608] | 1174 | Bool m_interViewMvVertConstraintFlag; |
---|
[2] | 1175 | #endif |
---|
[608] | 1176 | #if H_3D |
---|
| 1177 | UInt m_uiCamParPrecision; |
---|
| 1178 | Bool m_bCamParInSliceHeader; |
---|
| 1179 | Int m_aaiCodedScale [2][MAX_NUM_LAYERS]; |
---|
| 1180 | Int m_aaiCodedOffset[2][MAX_NUM_LAYERS]; |
---|
[210] | 1181 | #endif |
---|
[608] | 1182 | #if H_MV |
---|
| 1183 | Int m_layerId; |
---|
[115] | 1184 | #endif |
---|
[2] | 1185 | public: |
---|
| 1186 | TComSPS(); |
---|
| 1187 | virtual ~TComSPS(); |
---|
[608] | 1188 | |
---|
[100] | 1189 | Int getVPSId () { return m_VPSId; } |
---|
[77] | 1190 | Void setVPSId (Int i) { m_VPSId = i; } |
---|
[56] | 1191 | Int getSPSId () { return m_SPSId; } |
---|
| 1192 | Void setSPSId (Int i) { m_SPSId = i; } |
---|
| 1193 | Int getChromaFormatIdc () { return m_chromaFormatIdc; } |
---|
| 1194 | Void setChromaFormatIdc (Int i) { m_chromaFormatIdc = i; } |
---|
[608] | 1195 | |
---|
| 1196 | static Int getWinUnitX (Int chromaFormatIdc) { assert (chromaFormatIdc > 0 && chromaFormatIdc <= MAX_CHROMA_FORMAT_IDC); return m_winUnitX[chromaFormatIdc]; } |
---|
| 1197 | static Int getWinUnitY (Int chromaFormatIdc) { assert (chromaFormatIdc > 0 && chromaFormatIdc <= MAX_CHROMA_FORMAT_IDC); return m_winUnitY[chromaFormatIdc]; } |
---|
[56] | 1198 | |
---|
[2] | 1199 | // structure |
---|
[56] | 1200 | Void setPicWidthInLumaSamples ( UInt u ) { m_picWidthInLumaSamples = u; } |
---|
| 1201 | UInt getPicWidthInLumaSamples () { return m_picWidthInLumaSamples; } |
---|
| 1202 | Void setPicHeightInLumaSamples ( UInt u ) { m_picHeightInLumaSamples = u; } |
---|
| 1203 | UInt getPicHeightInLumaSamples () { return m_picHeightInLumaSamples; } |
---|
| 1204 | |
---|
[608] | 1205 | Window& getConformanceWindow() { return m_conformanceWindow; } |
---|
| 1206 | Void setConformanceWindow(Window& conformanceWindow ) { m_conformanceWindow = conformanceWindow; } |
---|
[56] | 1207 | |
---|
[608] | 1208 | UInt getNumLongTermRefPicSPS() { return m_numLongTermRefPicSPS; } |
---|
| 1209 | Void setNumLongTermRefPicSPS(UInt val) { m_numLongTermRefPicSPS = val; } |
---|
| 1210 | |
---|
| 1211 | UInt getLtRefPicPocLsbSps(UInt index) { return m_ltRefPicPocLsbSps[index]; } |
---|
| 1212 | Void setLtRefPicPocLsbSps(UInt index, UInt val) { m_ltRefPicPocLsbSps[index] = val; } |
---|
| 1213 | |
---|
| 1214 | Bool getUsedByCurrPicLtSPSFlag(Int i) {return m_usedByCurrPicLtSPSFlag[i];} |
---|
| 1215 | Void setUsedByCurrPicLtSPSFlag(Int i, Bool x) { m_usedByCurrPicLtSPSFlag[i] = x;} |
---|
| 1216 | |
---|
| 1217 | Int getLog2MinCodingBlockSize() const { return m_log2MinCodingBlockSize; } |
---|
| 1218 | Void setLog2MinCodingBlockSize(Int val) { m_log2MinCodingBlockSize = val; } |
---|
| 1219 | Int getLog2DiffMaxMinCodingBlockSize() const { return m_log2DiffMaxMinCodingBlockSize; } |
---|
| 1220 | Void setLog2DiffMaxMinCodingBlockSize(Int val) { m_log2DiffMaxMinCodingBlockSize = val; } |
---|
| 1221 | |
---|
[2] | 1222 | Void setMaxCUWidth ( UInt u ) { m_uiMaxCUWidth = u; } |
---|
| 1223 | UInt getMaxCUWidth () { return m_uiMaxCUWidth; } |
---|
| 1224 | Void setMaxCUHeight ( UInt u ) { m_uiMaxCUHeight = u; } |
---|
| 1225 | UInt getMaxCUHeight () { return m_uiMaxCUHeight; } |
---|
| 1226 | Void setMaxCUDepth ( UInt u ) { m_uiMaxCUDepth = u; } |
---|
| 1227 | UInt getMaxCUDepth () { return m_uiMaxCUDepth; } |
---|
[56] | 1228 | Void setUsePCM ( Bool b ) { m_usePCM = b; } |
---|
| 1229 | Bool getUsePCM () { return m_usePCM; } |
---|
| 1230 | Void setPCMLog2MaxSize ( UInt u ) { m_pcmLog2MaxSize = u; } |
---|
| 1231 | UInt getPCMLog2MaxSize () { return m_pcmLog2MaxSize; } |
---|
| 1232 | Void setPCMLog2MinSize ( UInt u ) { m_uiPCMLog2MinSize = u; } |
---|
| 1233 | UInt getPCMLog2MinSize () { return m_uiPCMLog2MinSize; } |
---|
| 1234 | Void setBitsForPOC ( UInt u ) { m_uiBitsForPOC = u; } |
---|
| 1235 | UInt getBitsForPOC () { return m_uiBitsForPOC; } |
---|
| 1236 | Bool getUseAMP() { return m_useAMP; } |
---|
| 1237 | Void setUseAMP( Bool b ) { m_useAMP = b; } |
---|
[2] | 1238 | Void setQuadtreeTULog2MaxSize( UInt u ) { m_uiQuadtreeTULog2MaxSize = u; } |
---|
| 1239 | UInt getQuadtreeTULog2MaxSize() { return m_uiQuadtreeTULog2MaxSize; } |
---|
| 1240 | Void setQuadtreeTULog2MinSize( UInt u ) { m_uiQuadtreeTULog2MinSize = u; } |
---|
| 1241 | UInt getQuadtreeTULog2MinSize() { return m_uiQuadtreeTULog2MinSize; } |
---|
| 1242 | Void setQuadtreeTUMaxDepthInter( UInt u ) { m_uiQuadtreeTUMaxDepthInter = u; } |
---|
| 1243 | Void setQuadtreeTUMaxDepthIntra( UInt u ) { m_uiQuadtreeTUMaxDepthIntra = u; } |
---|
| 1244 | UInt getQuadtreeTUMaxDepthInter() { return m_uiQuadtreeTUMaxDepthInter; } |
---|
| 1245 | UInt getQuadtreeTUMaxDepthIntra() { return m_uiQuadtreeTUMaxDepthIntra; } |
---|
[56] | 1246 | Void setNumReorderPics(Int i, UInt tlayer) { m_numReorderPics[tlayer] = i; } |
---|
| 1247 | Int getNumReorderPics(UInt tlayer) { return m_numReorderPics[tlayer]; } |
---|
[608] | 1248 | Void createRPSList( Int numRPS ); |
---|
| 1249 | TComRPSList* getRPSList() { return &m_RPSList; } |
---|
[56] | 1250 | Bool getLongTermRefsPresent() { return m_bLongTermRefsPresent; } |
---|
| 1251 | Void setLongTermRefsPresent(Bool b) { m_bLongTermRefsPresent=b; } |
---|
[608] | 1252 | Bool getTMVPFlagsPresent() { return m_TMVPFlagsPresent; } |
---|
| 1253 | Void setTMVPFlagsPresent(Bool b) { m_TMVPFlagsPresent=b; } |
---|
[2] | 1254 | // physical transform |
---|
| 1255 | Void setMaxTrSize ( UInt u ) { m_uiMaxTrSize = u; } |
---|
| 1256 | UInt getMaxTrSize () { return m_uiMaxTrSize; } |
---|
[56] | 1257 | |
---|
[2] | 1258 | // Tool list |
---|
[56] | 1259 | Bool getUseLossless () { return m_useLossless; } |
---|
| 1260 | Void setUseLossless ( Bool b ) { m_useLossless = b; } |
---|
| 1261 | |
---|
| 1262 | // AMP accuracy |
---|
| 1263 | Int getAMPAcc ( UInt uiDepth ) { return m_iAMPAcc[uiDepth]; } |
---|
| 1264 | Void setAMPAcc ( UInt uiDepth, Int iAccu ) { assert( uiDepth < g_uiMaxCUDepth); m_iAMPAcc[uiDepth] = iAccu; } |
---|
[5] | 1265 | |
---|
[2] | 1266 | // Bit-depth |
---|
[608] | 1267 | Int getBitDepthY() { return m_bitDepthY; } |
---|
| 1268 | Void setBitDepthY(Int u) { m_bitDepthY = u; } |
---|
| 1269 | Int getBitDepthC() { return m_bitDepthC; } |
---|
| 1270 | Void setBitDepthC(Int u) { m_bitDepthC = u; } |
---|
[56] | 1271 | Int getQpBDOffsetY () { return m_qpBDOffsetY; } |
---|
| 1272 | Void setQpBDOffsetY ( Int value ) { m_qpBDOffsetY = value; } |
---|
| 1273 | Int getQpBDOffsetC () { return m_qpBDOffsetC; } |
---|
| 1274 | Void setQpBDOffsetC ( Int value ) { m_qpBDOffsetC = value; } |
---|
[2] | 1275 | Void setUseSAO (Bool bVal) {m_bUseSAO = bVal;} |
---|
| 1276 | Bool getUseSAO () {return m_bUseSAO;} |
---|
| 1277 | |
---|
[56] | 1278 | UInt getMaxTLayers() { return m_uiMaxTLayers; } |
---|
| 1279 | Void setMaxTLayers( UInt uiMaxTLayers ) { assert( uiMaxTLayers <= MAX_TLAYER ); m_uiMaxTLayers = uiMaxTLayers; } |
---|
[2] | 1280 | |
---|
[56] | 1281 | Bool getTemporalIdNestingFlag() { return m_bTemporalIdNestingFlag; } |
---|
| 1282 | Void setTemporalIdNestingFlag( Bool bValue ) { m_bTemporalIdNestingFlag = bValue; } |
---|
| 1283 | UInt getPCMBitDepthLuma () { return m_uiPCMBitDepthLuma; } |
---|
| 1284 | Void setPCMBitDepthLuma ( UInt u ) { m_uiPCMBitDepthLuma = u; } |
---|
| 1285 | UInt getPCMBitDepthChroma () { return m_uiPCMBitDepthChroma; } |
---|
| 1286 | Void setPCMBitDepthChroma ( UInt u ) { m_uiPCMBitDepthChroma = u; } |
---|
| 1287 | Void setPCMFilterDisableFlag ( Bool bValue ) { m_bPCMFilterDisableFlag = bValue; } |
---|
| 1288 | Bool getPCMFilterDisableFlag () { return m_bPCMFilterDisableFlag; } |
---|
| 1289 | |
---|
| 1290 | Bool getScalingListFlag () { return m_scalingListEnabledFlag; } |
---|
| 1291 | Void setScalingListFlag ( Bool b ) { m_scalingListEnabledFlag = b; } |
---|
[608] | 1292 | Bool getScalingListPresentFlag() { return m_scalingListPresentFlag; } |
---|
| 1293 | Void setScalingListPresentFlag( Bool b ) { m_scalingListPresentFlag = b; } |
---|
| 1294 | Void setScalingList ( TComScalingList *scalingList); |
---|
| 1295 | TComScalingList* getScalingList () { return m_scalingList; } //!< get ScalingList class pointer in SPS |
---|
[56] | 1296 | UInt getMaxDecPicBuffering (UInt tlayer) { return m_uiMaxDecPicBuffering[tlayer]; } |
---|
| 1297 | Void setMaxDecPicBuffering ( UInt ui, UInt tlayer ) { m_uiMaxDecPicBuffering[tlayer] = ui; } |
---|
| 1298 | UInt getMaxLatencyIncrease (UInt tlayer) { return m_uiMaxLatencyIncrease[tlayer]; } |
---|
| 1299 | Void setMaxLatencyIncrease ( UInt ui , UInt tlayer) { m_uiMaxLatencyIncrease[tlayer] = ui; } |
---|
| 1300 | |
---|
[608] | 1301 | Void setUseStrongIntraSmoothing (Bool bVal) {m_useStrongIntraSmoothing = bVal;} |
---|
| 1302 | Bool getUseStrongIntraSmoothing () {return m_useStrongIntraSmoothing;} |
---|
[56] | 1303 | |
---|
[608] | 1304 | Bool getVuiParametersPresentFlag() { return m_vuiParametersPresentFlag; } |
---|
| 1305 | Void setVuiParametersPresentFlag(Bool b) { m_vuiParametersPresentFlag = b; } |
---|
| 1306 | TComVUI* getVuiParameters() { return &m_vuiParameters; } |
---|
| 1307 | Void setHrdParameters( UInt frameRate, UInt numDU, UInt bitRate, Bool randomAccess ); |
---|
[210] | 1308 | |
---|
[608] | 1309 | TComPTL* getPTL() { return &m_pcPTL; } |
---|
| 1310 | #if H_MV |
---|
[622] | 1311 | Void setVPS ( TComVPS* pcVPS ) { m_pcVPS = pcVPS; } |
---|
| 1312 | TComVPS* getVPS () { return m_pcVPS; } |
---|
| 1313 | |
---|
| 1314 | Void setSpsInferScalingListFlag( Bool flag ) { m_spsInferScalingListFlag = flag; } |
---|
| 1315 | Bool getSpsInferScalingListFlag( ) { return m_spsInferScalingListFlag; } |
---|
| 1316 | |
---|
| 1317 | Void setSpsScalingListRefLayerId( Int val ) { m_spsScalingListRefLayerId = val; } |
---|
| 1318 | Int getSpsScalingListRefLayerId( ) { return m_spsScalingListRefLayerId; } |
---|
| 1319 | |
---|
| 1320 | Void setUpdateRepFormatFlag( Bool flag ) { m_updateRepFormatFlag = flag; } |
---|
| 1321 | Bool getUpdateRepFormatFlag( ) { return m_updateRepFormatFlag; } |
---|
| 1322 | // SPS Extension |
---|
[608] | 1323 | Void setInterViewMvVertConstraintFlag(Bool val) { m_interViewMvVertConstraintFlag = val; } |
---|
| 1324 | Bool getInterViewMvVertConstraintFlag() { return m_interViewMvVertConstraintFlag;} |
---|
[622] | 1325 | // Inference |
---|
| 1326 | Void inferRepFormat( TComVPS* vps, Int layerIdCurr ); |
---|
[115] | 1327 | |
---|
[622] | 1328 | Void inferScalingList( TComSPS* spsSrc ); |
---|
[313] | 1329 | #endif |
---|
[608] | 1330 | #if H_3D_QTLPC |
---|
| 1331 | Void setUseQTL( Bool b ) { m_bUseQTL = b; } |
---|
| 1332 | Bool getUseQTL() { return m_bUseQTL; } |
---|
| 1333 | Void setUsePC ( Bool b ) { m_bUsePC = b; } |
---|
| 1334 | Bool getUsePC () { return m_bUsePC; } |
---|
| 1335 | #endif |
---|
| 1336 | #if H_3D |
---|
| 1337 | Void initCamParaSPS ( UInt uiViewIndex, UInt uiCamParPrecision = 0, Bool bCamParSlice = false, Int** aaiScale = 0, Int** aaiOffset = 0 ); |
---|
[56] | 1338 | UInt getCamParPrecision () { return m_uiCamParPrecision; } |
---|
| 1339 | Bool hasCamParInSliceHeader() { return m_bCamParInSliceHeader; } |
---|
| 1340 | Int* getCodedScale () { return m_aaiCodedScale [0]; } |
---|
| 1341 | Int* getCodedOffset () { return m_aaiCodedOffset[0]; } |
---|
| 1342 | Int* getInvCodedScale () { return m_aaiCodedScale [1]; } |
---|
| 1343 | Int* getInvCodedOffset () { return m_aaiCodedOffset[1]; } |
---|
[5] | 1344 | #endif |
---|
[608] | 1345 | #if H_MV |
---|
| 1346 | Int getLayerId () { return m_layerId; } |
---|
| 1347 | Void setLayerId ( Int val ) { m_layerId = val; } |
---|
[5] | 1348 | #endif |
---|
| 1349 | |
---|
[56] | 1350 | }; |
---|
[42] | 1351 | |
---|
[56] | 1352 | /// Reference Picture Lists class |
---|
| 1353 | class TComRefPicListModification |
---|
| 1354 | { |
---|
| 1355 | private: |
---|
| 1356 | UInt m_bRefPicListModificationFlagL0; |
---|
| 1357 | UInt m_bRefPicListModificationFlagL1; |
---|
| 1358 | UInt m_RefPicSetIdxL0[32]; |
---|
| 1359 | UInt m_RefPicSetIdxL1[32]; |
---|
| 1360 | |
---|
| 1361 | public: |
---|
| 1362 | TComRefPicListModification(); |
---|
| 1363 | virtual ~TComRefPicListModification(); |
---|
| 1364 | |
---|
| 1365 | Void create (); |
---|
| 1366 | Void destroy (); |
---|
| 1367 | |
---|
| 1368 | Bool getRefPicListModificationFlagL0() { return m_bRefPicListModificationFlagL0; } |
---|
| 1369 | Void setRefPicListModificationFlagL0(Bool flag) { m_bRefPicListModificationFlagL0 = flag; } |
---|
| 1370 | Bool getRefPicListModificationFlagL1() { return m_bRefPicListModificationFlagL1; } |
---|
| 1371 | Void setRefPicListModificationFlagL1(Bool flag) { m_bRefPicListModificationFlagL1 = flag; } |
---|
| 1372 | Void setRefPicSetIdxL0(UInt idx, UInt refPicSetIdx) { m_RefPicSetIdxL0[idx] = refPicSetIdx; } |
---|
| 1373 | UInt getRefPicSetIdxL0(UInt idx) { return m_RefPicSetIdxL0[idx]; } |
---|
| 1374 | Void setRefPicSetIdxL1(UInt idx, UInt refPicSetIdx) { m_RefPicSetIdxL1[idx] = refPicSetIdx; } |
---|
| 1375 | UInt getRefPicSetIdxL1(UInt idx) { return m_RefPicSetIdxL1[idx]; } |
---|
[608] | 1376 | #if H_MV |
---|
| 1377 | // Why not an listIdx for all members, would avoid code duplication?? |
---|
| 1378 | Void setRefPicSetIdxL(UInt li, UInt idx, UInt refPicSetIdx) {( li==0 ? m_RefPicSetIdxL0[idx] : m_RefPicSetIdxL1[idx] ) = refPicSetIdx; } |
---|
| 1379 | UInt getRefPicSetIdxL(UInt li, UInt idx ) { return ( li == 0 ) ? m_RefPicSetIdxL0[idx] : m_RefPicSetIdxL1[idx] ; } |
---|
| 1380 | Void setRefPicListModificationFlagL(UInt li, Bool flag) { ( li==0 ? m_bRefPicListModificationFlagL0 : m_bRefPicListModificationFlagL1 ) = flag; } |
---|
| 1381 | Bool getRefPicListModificationFlagL(UInt li ) { return ( li== 0) ? m_bRefPicListModificationFlagL0 : m_bRefPicListModificationFlagL1; } |
---|
| 1382 | #endif |
---|
[2] | 1383 | }; |
---|
| 1384 | |
---|
| 1385 | /// PPS class |
---|
| 1386 | class TComPPS |
---|
| 1387 | { |
---|
| 1388 | private: |
---|
[56] | 1389 | Int m_PPSId; // pic_parameter_set_id |
---|
| 1390 | Int m_SPSId; // seq_parameter_set_id |
---|
| 1391 | Int m_picInitQPMinus26; |
---|
| 1392 | Bool m_useDQP; |
---|
| 1393 | Bool m_bConstrainedIntraPred; // constrained_intra_pred_flag |
---|
[608] | 1394 | Bool m_bSliceChromaQpFlag; // slicelevel_chroma_qp_flag |
---|
| 1395 | |
---|
[56] | 1396 | // access channel |
---|
| 1397 | TComSPS* m_pcSPS; |
---|
| 1398 | UInt m_uiMaxCuDQPDepth; |
---|
| 1399 | UInt m_uiMinCuDQPSize; |
---|
| 1400 | |
---|
[608] | 1401 | Int m_chromaCbQpOffset; |
---|
| 1402 | Int m_chromaCrQpOffset; |
---|
[56] | 1403 | |
---|
[608] | 1404 | UInt m_numRefIdxL0DefaultActive; |
---|
| 1405 | UInt m_numRefIdxL1DefaultActive; |
---|
[56] | 1406 | |
---|
[2] | 1407 | Bool m_bUseWeightPred; // Use of Weighting Prediction (P_SLICE) |
---|
[608] | 1408 | Bool m_useWeightedBiPred; // Use of Weighting Bi-Prediction (B_SLICE) |
---|
[56] | 1409 | Bool m_OutputFlagPresentFlag; // Indicates the presence of output_flag in slice header |
---|
| 1410 | |
---|
[608] | 1411 | Bool m_TransquantBypassEnableFlag; // Indicates presence of cu_transquant_bypass_flag in CUs. |
---|
| 1412 | Bool m_useTransformSkip; |
---|
| 1413 | Bool m_dependentSliceSegmentsEnabledFlag; //!< Indicates the presence of dependent slices |
---|
| 1414 | Bool m_tilesEnabledFlag; //!< Indicates the presence of tiles |
---|
| 1415 | Bool m_entropyCodingSyncEnabledFlag; //!< Indicates the presence of wavefronts |
---|
| 1416 | |
---|
| 1417 | Bool m_loopFilterAcrossTilesEnabledFlag; |
---|
| 1418 | Int m_uniformSpacingFlag; |
---|
[56] | 1419 | Int m_iNumColumnsMinus1; |
---|
| 1420 | UInt* m_puiColumnWidth; |
---|
| 1421 | Int m_iNumRowsMinus1; |
---|
| 1422 | UInt* m_puiRowHeight; |
---|
[608] | 1423 | |
---|
[56] | 1424 | Int m_iNumSubstreams; |
---|
[5] | 1425 | |
---|
[56] | 1426 | Int m_signHideFlag; |
---|
| 1427 | |
---|
| 1428 | Bool m_cabacInitPresentFlag; |
---|
| 1429 | UInt m_encCABACTableIdx; // Used to transmit table selection across slices |
---|
[608] | 1430 | |
---|
| 1431 | Bool m_sliceHeaderExtensionPresentFlag; |
---|
| 1432 | Bool m_loopFilterAcrossSlicesEnabledFlag; |
---|
| 1433 | Bool m_deblockingFilterControlPresentFlag; |
---|
| 1434 | Bool m_deblockingFilterOverrideEnabledFlag; |
---|
| 1435 | Bool m_picDisableDeblockingFilterFlag; |
---|
| 1436 | Int m_deblockingFilterBetaOffsetDiv2; //< beta offset for deblocking filter |
---|
| 1437 | Int m_deblockingFilterTcOffsetDiv2; //< tc offset for deblocking filter |
---|
| 1438 | Bool m_scalingListPresentFlag; |
---|
| 1439 | TComScalingList* m_scalingList; //!< ScalingList class pointer |
---|
| 1440 | Bool m_listsModificationPresentFlag; |
---|
[56] | 1441 | UInt m_log2ParallelMergeLevelMinus2; |
---|
[608] | 1442 | Int m_numExtraSliceHeaderBits; |
---|
| 1443 | |
---|
[622] | 1444 | #if H_MV |
---|
| 1445 | Int m_layerId; |
---|
| 1446 | Bool m_ppsInferScalingListFlag; |
---|
| 1447 | Int m_ppsScalingListRefLayerId; |
---|
| 1448 | #endif |
---|
[2] | 1449 | public: |
---|
| 1450 | TComPPS(); |
---|
| 1451 | virtual ~TComPPS(); |
---|
[56] | 1452 | |
---|
| 1453 | Int getPPSId () { return m_PPSId; } |
---|
| 1454 | Void setPPSId (Int i) { m_PPSId = i; } |
---|
| 1455 | Int getSPSId () { return m_SPSId; } |
---|
| 1456 | Void setSPSId (Int i) { m_SPSId = i; } |
---|
| 1457 | |
---|
| 1458 | Int getPicInitQPMinus26 () { return m_picInitQPMinus26; } |
---|
| 1459 | Void setPicInitQPMinus26 ( Int i ) { m_picInitQPMinus26 = i; } |
---|
| 1460 | Bool getUseDQP () { return m_useDQP; } |
---|
| 1461 | Void setUseDQP ( Bool b ) { m_useDQP = b; } |
---|
[2] | 1462 | Bool getConstrainedIntraPred () { return m_bConstrainedIntraPred; } |
---|
| 1463 | Void setConstrainedIntraPred ( Bool b ) { m_bConstrainedIntraPred = b; } |
---|
[608] | 1464 | Bool getSliceChromaQpFlag () { return m_bSliceChromaQpFlag; } |
---|
| 1465 | Void setSliceChromaQpFlag ( Bool b ) { m_bSliceChromaQpFlag = b; } |
---|
[56] | 1466 | |
---|
| 1467 | Void setSPS ( TComSPS* pcSPS ) { m_pcSPS = pcSPS; } |
---|
| 1468 | TComSPS* getSPS () { return m_pcSPS; } |
---|
| 1469 | Void setMaxCuDQPDepth ( UInt u ) { m_uiMaxCuDQPDepth = u; } |
---|
| 1470 | UInt getMaxCuDQPDepth () { return m_uiMaxCuDQPDepth;} |
---|
| 1471 | Void setMinCuDQPSize ( UInt u ) { m_uiMinCuDQPSize = u; } |
---|
| 1472 | UInt getMinCuDQPSize () { return m_uiMinCuDQPSize; } |
---|
[2] | 1473 | |
---|
[608] | 1474 | Void setChromaCbQpOffset( Int i ) { m_chromaCbQpOffset = i; } |
---|
| 1475 | Int getChromaCbQpOffset() { return m_chromaCbQpOffset; } |
---|
| 1476 | Void setChromaCrQpOffset( Int i ) { m_chromaCrQpOffset = i; } |
---|
| 1477 | Int getChromaCrQpOffset() { return m_chromaCrQpOffset; } |
---|
[56] | 1478 | |
---|
[608] | 1479 | Void setNumRefIdxL0DefaultActive(UInt ui) { m_numRefIdxL0DefaultActive=ui; } |
---|
| 1480 | UInt getNumRefIdxL0DefaultActive() { return m_numRefIdxL0DefaultActive; } |
---|
| 1481 | Void setNumRefIdxL1DefaultActive(UInt ui) { m_numRefIdxL1DefaultActive=ui; } |
---|
| 1482 | UInt getNumRefIdxL1DefaultActive() { return m_numRefIdxL1DefaultActive; } |
---|
| 1483 | |
---|
[56] | 1484 | Bool getUseWP () { return m_bUseWeightPred; } |
---|
[608] | 1485 | Bool getWPBiPred () { return m_useWeightedBiPred; } |
---|
[56] | 1486 | Void setUseWP ( Bool b ) { m_bUseWeightPred = b; } |
---|
[608] | 1487 | Void setWPBiPred ( Bool b ) { m_useWeightedBiPred = b; } |
---|
[56] | 1488 | Void setOutputFlagPresentFlag( Bool b ) { m_OutputFlagPresentFlag = b; } |
---|
| 1489 | Bool getOutputFlagPresentFlag() { return m_OutputFlagPresentFlag; } |
---|
[608] | 1490 | Void setTransquantBypassEnableFlag( Bool b ) { m_TransquantBypassEnableFlag = b; } |
---|
| 1491 | Bool getTransquantBypassEnableFlag() { return m_TransquantBypassEnableFlag; } |
---|
[56] | 1492 | |
---|
[608] | 1493 | Bool getUseTransformSkip () { return m_useTransformSkip; } |
---|
| 1494 | Void setUseTransformSkip ( Bool b ) { m_useTransformSkip = b; } |
---|
| 1495 | |
---|
| 1496 | Void setLoopFilterAcrossTilesEnabledFlag (Bool b) { m_loopFilterAcrossTilesEnabledFlag = b; } |
---|
| 1497 | Bool getLoopFilterAcrossTilesEnabledFlag () { return m_loopFilterAcrossTilesEnabledFlag; } |
---|
| 1498 | Bool getDependentSliceSegmentsEnabledFlag() const { return m_dependentSliceSegmentsEnabledFlag; } |
---|
| 1499 | Void setDependentSliceSegmentsEnabledFlag(Bool val) { m_dependentSliceSegmentsEnabledFlag = val; } |
---|
| 1500 | Bool getTilesEnabledFlag() const { return m_tilesEnabledFlag; } |
---|
| 1501 | Void setTilesEnabledFlag(Bool val) { m_tilesEnabledFlag = val; } |
---|
| 1502 | Bool getEntropyCodingSyncEnabledFlag() const { return m_entropyCodingSyncEnabledFlag; } |
---|
| 1503 | Void setEntropyCodingSyncEnabledFlag(Bool val) { m_entropyCodingSyncEnabledFlag = val; } |
---|
| 1504 | Void setUniformSpacingFlag ( Bool b ) { m_uniformSpacingFlag = b; } |
---|
| 1505 | Bool getUniformSpacingFlag () { return m_uniformSpacingFlag; } |
---|
[56] | 1506 | Void setNumColumnsMinus1 ( Int i ) { m_iNumColumnsMinus1 = i; } |
---|
| 1507 | Int getNumColumnsMinus1 () { return m_iNumColumnsMinus1; } |
---|
| 1508 | Void setColumnWidth ( UInt* columnWidth ) |
---|
| 1509 | { |
---|
[608] | 1510 | if( m_uniformSpacingFlag == 0 && m_iNumColumnsMinus1 > 0 ) |
---|
[56] | 1511 | { |
---|
| 1512 | m_puiColumnWidth = new UInt[ m_iNumColumnsMinus1 ]; |
---|
[42] | 1513 | |
---|
[56] | 1514 | for(Int i=0; i<m_iNumColumnsMinus1; i++) |
---|
| 1515 | { |
---|
| 1516 | m_puiColumnWidth[i] = columnWidth[i]; |
---|
| 1517 | } |
---|
| 1518 | } |
---|
| 1519 | } |
---|
| 1520 | UInt getColumnWidth (UInt columnIdx) { return *( m_puiColumnWidth + columnIdx ); } |
---|
| 1521 | Void setNumRowsMinus1( Int i ) { m_iNumRowsMinus1 = i; } |
---|
| 1522 | Int getNumRowsMinus1() { return m_iNumRowsMinus1; } |
---|
| 1523 | Void setRowHeight ( UInt* rowHeight ) |
---|
| 1524 | { |
---|
[608] | 1525 | if( m_uniformSpacingFlag == 0 && m_iNumRowsMinus1 > 0 ) |
---|
[56] | 1526 | { |
---|
| 1527 | m_puiRowHeight = new UInt[ m_iNumRowsMinus1 ]; |
---|
| 1528 | |
---|
| 1529 | for(Int i=0; i<m_iNumRowsMinus1; i++) |
---|
| 1530 | { |
---|
| 1531 | m_puiRowHeight[i] = rowHeight[i]; |
---|
| 1532 | } |
---|
| 1533 | } |
---|
| 1534 | } |
---|
| 1535 | UInt getRowHeight (UInt rowIdx) { return *( m_puiRowHeight + rowIdx ); } |
---|
| 1536 | Void setNumSubstreams(Int iNumSubstreams) { m_iNumSubstreams = iNumSubstreams; } |
---|
| 1537 | Int getNumSubstreams() { return m_iNumSubstreams; } |
---|
| 1538 | |
---|
| 1539 | Void setSignHideFlag( Int signHideFlag ) { m_signHideFlag = signHideFlag; } |
---|
| 1540 | Int getSignHideFlag() { return m_signHideFlag; } |
---|
| 1541 | |
---|
| 1542 | Void setCabacInitPresentFlag( Bool flag ) { m_cabacInitPresentFlag = flag; } |
---|
| 1543 | Void setEncCABACTableIdx( Int idx ) { m_encCABACTableIdx = idx; } |
---|
| 1544 | Bool getCabacInitPresentFlag() { return m_cabacInitPresentFlag; } |
---|
| 1545 | UInt getEncCABACTableIdx() { return m_encCABACTableIdx; } |
---|
[608] | 1546 | Void setDeblockingFilterControlPresentFlag( Bool val ) { m_deblockingFilterControlPresentFlag = val; } |
---|
| 1547 | Bool getDeblockingFilterControlPresentFlag() { return m_deblockingFilterControlPresentFlag; } |
---|
| 1548 | Void setDeblockingFilterOverrideEnabledFlag( Bool val ) { m_deblockingFilterOverrideEnabledFlag = val; } |
---|
| 1549 | Bool getDeblockingFilterOverrideEnabledFlag() { return m_deblockingFilterOverrideEnabledFlag; } |
---|
| 1550 | Void setPicDisableDeblockingFilterFlag(Bool val) { m_picDisableDeblockingFilterFlag = val; } //!< set offset for deblocking filter disabled |
---|
| 1551 | Bool getPicDisableDeblockingFilterFlag() { return m_picDisableDeblockingFilterFlag; } //!< get offset for deblocking filter disabled |
---|
| 1552 | Void setDeblockingFilterBetaOffsetDiv2(Int val) { m_deblockingFilterBetaOffsetDiv2 = val; } //!< set beta offset for deblocking filter |
---|
| 1553 | Int getDeblockingFilterBetaOffsetDiv2() { return m_deblockingFilterBetaOffsetDiv2; } //!< get beta offset for deblocking filter |
---|
| 1554 | Void setDeblockingFilterTcOffsetDiv2(Int val) { m_deblockingFilterTcOffsetDiv2 = val; } //!< set tc offset for deblocking filter |
---|
| 1555 | Int getDeblockingFilterTcOffsetDiv2() { return m_deblockingFilterTcOffsetDiv2; } //!< get tc offset for deblocking filter |
---|
| 1556 | Bool getScalingListPresentFlag() { return m_scalingListPresentFlag; } |
---|
| 1557 | Void setScalingListPresentFlag( Bool b ) { m_scalingListPresentFlag = b; } |
---|
| 1558 | Void setScalingList ( TComScalingList *scalingList); |
---|
| 1559 | TComScalingList* getScalingList () { return m_scalingList; } //!< get ScalingList class pointer in PPS |
---|
| 1560 | Bool getListsModificationPresentFlag () { return m_listsModificationPresentFlag; } |
---|
| 1561 | Void setListsModificationPresentFlag ( Bool b ) { m_listsModificationPresentFlag = b; } |
---|
[56] | 1562 | UInt getLog2ParallelMergeLevelMinus2 () { return m_log2ParallelMergeLevelMinus2; } |
---|
| 1563 | Void setLog2ParallelMergeLevelMinus2 (UInt mrgLevel) { m_log2ParallelMergeLevelMinus2 = mrgLevel; } |
---|
[608] | 1564 | Int getNumExtraSliceHeaderBits() { return m_numExtraSliceHeaderBits; } |
---|
| 1565 | Void setNumExtraSliceHeaderBits(Int i) { m_numExtraSliceHeaderBits = i; } |
---|
| 1566 | Void setLoopFilterAcrossSlicesEnabledFlag ( Bool bValue ) { m_loopFilterAcrossSlicesEnabledFlag = bValue; } |
---|
| 1567 | Bool getLoopFilterAcrossSlicesEnabledFlag () { return m_loopFilterAcrossSlicesEnabledFlag; } |
---|
| 1568 | Bool getSliceHeaderExtensionPresentFlag () { return m_sliceHeaderExtensionPresentFlag; } |
---|
| 1569 | Void setSliceHeaderExtensionPresentFlag (Bool val) { m_sliceHeaderExtensionPresentFlag = val; } |
---|
[622] | 1570 | #if H_MV |
---|
| 1571 | Void setLayerId( Int val ) { m_layerId = val; } |
---|
| 1572 | Int getLayerId( ) { return m_layerId; } |
---|
| 1573 | |
---|
| 1574 | Void setPpsInferScalingListFlag( Bool flag ) { m_ppsInferScalingListFlag = flag; } |
---|
| 1575 | Bool getPpsInferScalingListFlag( ) { return m_ppsInferScalingListFlag; } |
---|
| 1576 | |
---|
| 1577 | Void setPpsScalingListRefLayerId( Int val ) { m_ppsScalingListRefLayerId = val; } |
---|
| 1578 | Int getPpsScalingListRefLayerId( ) { return m_ppsScalingListRefLayerId; } |
---|
| 1579 | #endif |
---|
[2] | 1580 | }; |
---|
| 1581 | |
---|
[608] | 1582 | typedef struct |
---|
[56] | 1583 | { |
---|
[2] | 1584 | // Explicit weighted prediction parameters parsed in slice header, |
---|
| 1585 | // or Implicit weighted prediction parameters (8 bits depth values). |
---|
| 1586 | Bool bPresentFlag; |
---|
| 1587 | UInt uiLog2WeightDenom; |
---|
| 1588 | Int iWeight; |
---|
| 1589 | Int iOffset; |
---|
| 1590 | |
---|
| 1591 | // Weighted prediction scaling values built from above parameters (bitdepth scaled): |
---|
| 1592 | Int w, o, offset, shift, round; |
---|
| 1593 | } wpScalingParam; |
---|
| 1594 | |
---|
[608] | 1595 | typedef struct |
---|
| 1596 | { |
---|
[2] | 1597 | Int64 iAC; |
---|
| 1598 | Int64 iDC; |
---|
| 1599 | } wpACDCParam; |
---|
| 1600 | |
---|
| 1601 | /// slice header class |
---|
| 1602 | class TComSlice |
---|
| 1603 | { |
---|
[56] | 1604 | |
---|
[2] | 1605 | private: |
---|
| 1606 | // Bitstream writing |
---|
[608] | 1607 | Bool m_saoEnabledFlag; |
---|
| 1608 | Bool m_saoEnabledFlagChroma; ///< SAO Cb&Cr enabled flag |
---|
[56] | 1609 | Int m_iPPSId; ///< picture parameter set ID |
---|
| 1610 | Bool m_PicOutputFlag; ///< pic_output_flag |
---|
| 1611 | Int m_iPOC; |
---|
[622] | 1612 | #if H_MV |
---|
| 1613 | Int m_iPOCBeforeReset; |
---|
| 1614 | #endif |
---|
[56] | 1615 | Int m_iLastIDR; |
---|
[655] | 1616 | Int m_iAssociatedIRAP; |
---|
| 1617 | NalUnitType m_iAssociatedIRAPType; |
---|
| 1618 | static Int m_prevTid0POC; |
---|
[56] | 1619 | TComReferencePictureSet *m_pcRPS; |
---|
| 1620 | TComReferencePictureSet m_LocalRPS; |
---|
| 1621 | Int m_iBDidx; |
---|
| 1622 | TComRefPicListModification m_RefPicListModification; |
---|
[608] | 1623 | NalUnitType m_eNalUnitType; ///< Nal unit type for the slice |
---|
[2] | 1624 | SliceType m_eSliceType; |
---|
| 1625 | Int m_iSliceQp; |
---|
[608] | 1626 | Bool m_dependentSliceSegmentFlag; |
---|
[56] | 1627 | #if ADAPTIVE_QP_SELECTION |
---|
| 1628 | Int m_iSliceQpBase; |
---|
| 1629 | #endif |
---|
[608] | 1630 | Bool m_deblockingFilterDisable; |
---|
| 1631 | Bool m_deblockingFilterOverrideFlag; //< offsets for deblocking filter inherit from PPS |
---|
| 1632 | Int m_deblockingFilterBetaOffsetDiv2; //< beta offset for deblocking filter |
---|
| 1633 | Int m_deblockingFilterTcOffsetDiv2; //< tc offset for deblocking filter |
---|
| 1634 | Int m_list1IdxToList0Idx[MAX_NUM_REF]; |
---|
| 1635 | Int m_aiNumRefIdx [2]; // for multiple reference of current slice |
---|
[2] | 1636 | |
---|
[56] | 1637 | Bool m_bCheckLDC; |
---|
| 1638 | |
---|
[2] | 1639 | // Data |
---|
| 1640 | Int m_iSliceQpDelta; |
---|
[608] | 1641 | Int m_iSliceQpDeltaCb; |
---|
| 1642 | Int m_iSliceQpDeltaCr; |
---|
| 1643 | TComPic* m_apcRefPicList [2][MAX_NUM_REF+1]; |
---|
| 1644 | Int m_aiRefPOCList [2][MAX_NUM_REF+1]; |
---|
| 1645 | #if H_MV |
---|
| 1646 | Int m_aiRefLayerIdList[2][MAX_NUM_REF+1]; |
---|
| 1647 | #endif |
---|
| 1648 | Bool m_bIsUsedAsLongTerm[2][MAX_NUM_REF+1]; |
---|
[2] | 1649 | Int m_iDepth; |
---|
[56] | 1650 | |
---|
[2] | 1651 | // referenced slice? |
---|
| 1652 | Bool m_bRefenced; |
---|
[56] | 1653 | |
---|
[2] | 1654 | // access channel |
---|
[77] | 1655 | TComVPS* m_pcVPS; |
---|
[2] | 1656 | TComSPS* m_pcSPS; |
---|
| 1657 | TComPPS* m_pcPPS; |
---|
| 1658 | TComPic* m_pcPic; |
---|
[56] | 1659 | #if ADAPTIVE_QP_SELECTION |
---|
| 1660 | TComTrQuant* m_pcTrQuant; |
---|
| 1661 | #endif |
---|
[608] | 1662 | UInt m_colFromL0Flag; // collocated picture from List0 flag |
---|
[56] | 1663 | |
---|
| 1664 | UInt m_colRefIdx; |
---|
[608] | 1665 | UInt m_maxNumMergeCand; |
---|
[5] | 1666 | |
---|
[608] | 1667 | |
---|
| 1668 | #if SAO_CHROMA_LAMBDA |
---|
[56] | 1669 | Double m_dLambdaLuma; |
---|
| 1670 | Double m_dLambdaChroma; |
---|
| 1671 | #else |
---|
[2] | 1672 | Double m_dLambda; |
---|
[56] | 1673 | #endif |
---|
[5] | 1674 | |
---|
[2] | 1675 | Bool m_abEqualRef [2][MAX_NUM_REF][MAX_NUM_REF]; |
---|
[56] | 1676 | UInt m_uiTLayer; |
---|
| 1677 | Bool m_bTLayerSwitchingFlag; |
---|
[2] | 1678 | |
---|
[608] | 1679 | UInt m_sliceMode; |
---|
| 1680 | UInt m_sliceArgument; |
---|
| 1681 | UInt m_sliceCurStartCUAddr; |
---|
| 1682 | UInt m_sliceCurEndCUAddr; |
---|
| 1683 | UInt m_sliceIdx; |
---|
| 1684 | UInt m_sliceSegmentMode; |
---|
| 1685 | UInt m_sliceSegmentArgument; |
---|
| 1686 | UInt m_sliceSegmentCurStartCUAddr; |
---|
| 1687 | UInt m_sliceSegmentCurEndCUAddr; |
---|
| 1688 | Bool m_nextSlice; |
---|
| 1689 | Bool m_nextSliceSegment; |
---|
| 1690 | UInt m_sliceBits; |
---|
| 1691 | UInt m_sliceSegmentBits; |
---|
[56] | 1692 | Bool m_bFinalized; |
---|
[2] | 1693 | |
---|
| 1694 | wpScalingParam m_weightPredTable[2][MAX_NUM_REF][3]; // [REF_PIC_LIST_0 or REF_PIC_LIST_1][refIdx][0:Y, 1:U, 2:V] |
---|
[56] | 1695 | wpACDCParam m_weightACDCParam[3]; // [0:Y, 1:U, 2:V] |
---|
| 1696 | |
---|
[608] | 1697 | std::vector<UInt> m_tileByteLocation; |
---|
[56] | 1698 | UInt m_uiTileOffstForMultES; |
---|
| 1699 | |
---|
| 1700 | UInt* m_puiSubstreamSizes; |
---|
| 1701 | TComScalingList* m_scalingList; //!< pointer of quantization matrix |
---|
| 1702 | Bool m_cabacInitFlag; |
---|
[5] | 1703 | |
---|
[56] | 1704 | Bool m_bLMvdL1Zero; |
---|
| 1705 | Int m_numEntryPointOffsets; |
---|
[608] | 1706 | Bool m_temporalLayerNonReferenceFlag; |
---|
| 1707 | Bool m_LFCrossSliceBoundaryFlag; |
---|
[56] | 1708 | |
---|
[608] | 1709 | Bool m_enableTMVPFlag; |
---|
| 1710 | #if H_MV |
---|
[622] | 1711 | std::vector<TComPic*>* m_refPicSetInterLayer0; |
---|
| 1712 | std::vector<TComPic*>* m_refPicSetInterLayer1; |
---|
| 1713 | Int m_layerId; |
---|
| 1714 | Int m_viewId; |
---|
| 1715 | Int m_viewIndex; |
---|
| 1716 | #if H_3D |
---|
| 1717 | Bool m_isDepth; |
---|
| 1718 | #endif |
---|
[56] | 1719 | |
---|
[608] | 1720 | // Additional slice header syntax elements |
---|
[622] | 1721 | Bool m_pocResetFlag; |
---|
[608] | 1722 | Bool m_discardableFlag; |
---|
| 1723 | Bool m_interLayerPredEnabledFlag; |
---|
| 1724 | Int m_numInterLayerRefPicsMinus1; |
---|
| 1725 | Int m_interLayerPredLayerIdc [MAX_NUM_LAYERS]; |
---|
| 1726 | Int m_aaiCodedScale [2][MAX_NUM_LAYERS]; |
---|
| 1727 | Int m_aaiCodedOffset[2][MAX_NUM_LAYERS]; |
---|
| 1728 | #if H_3D_TMVP |
---|
| 1729 | Int m_aiAlterRefIdx [2]; |
---|
[189] | 1730 | #endif |
---|
[608] | 1731 | #if H_3D_ARP |
---|
[693] | 1732 | #if SHARP_ARP_REF_CHECK_F0105 |
---|
| 1733 | Bool m_arpRefPicAvailable[2][MAX_NUM_LAYERS]; |
---|
| 1734 | #endif |
---|
[608] | 1735 | TComList<TComPic*> * m_pBaseViewRefPicList[MAX_NUM_LAYERS]; |
---|
[443] | 1736 | UInt m_nARPStepNum; |
---|
[666] | 1737 | #if QC_MTK_INTERVIEW_ARP_F0123_F0108 |
---|
| 1738 | Int m_aiFirstTRefIdx [2]; |
---|
[443] | 1739 | #endif |
---|
[666] | 1740 | #endif |
---|
[608] | 1741 | #if H_3D_IC |
---|
| 1742 | Bool m_bApplyIC; |
---|
| 1743 | Bool m_icSkipParseFlag; |
---|
[296] | 1744 | #endif |
---|
[608] | 1745 | #if H_3D |
---|
| 1746 | TComPic* m_ivPicsCurrPoc [2][MAX_NUM_LAYERS]; |
---|
| 1747 | Int** m_depthToDisparityB; |
---|
| 1748 | Int** m_depthToDisparityF; |
---|
[443] | 1749 | #endif |
---|
[296] | 1750 | #endif |
---|
[2] | 1751 | public: |
---|
| 1752 | TComSlice(); |
---|
[608] | 1753 | virtual ~TComSlice(); |
---|
[2] | 1754 | Void initSlice (); |
---|
[5] | 1755 | |
---|
[77] | 1756 | Void setVPS ( TComVPS* pcVPS ) { m_pcVPS = pcVPS; } |
---|
| 1757 | TComVPS* getVPS () { return m_pcVPS; } |
---|
[2] | 1758 | Void setSPS ( TComSPS* pcSPS ) { m_pcSPS = pcSPS; } |
---|
| 1759 | TComSPS* getSPS () { return m_pcSPS; } |
---|
[56] | 1760 | |
---|
| 1761 | Void setPPS ( TComPPS* pcPPS ) { assert(pcPPS!=NULL); m_pcPPS = pcPPS; m_iPPSId = pcPPS->getPPSId(); } |
---|
[2] | 1762 | TComPPS* getPPS () { return m_pcPPS; } |
---|
[5] | 1763 | |
---|
[56] | 1764 | #if ADAPTIVE_QP_SELECTION |
---|
| 1765 | Void setTrQuant ( TComTrQuant* pcTrQuant ) { m_pcTrQuant = pcTrQuant; } |
---|
| 1766 | TComTrQuant* getTrQuant () { return m_pcTrQuant; } |
---|
| 1767 | #endif |
---|
| 1768 | |
---|
| 1769 | Void setPPSId ( Int PPSId ) { m_iPPSId = PPSId; } |
---|
| 1770 | Int getPPSId () { return m_iPPSId; } |
---|
| 1771 | Void setPicOutputFlag( Bool b ) { m_PicOutputFlag = b; } |
---|
| 1772 | Bool getPicOutputFlag() { return m_PicOutputFlag; } |
---|
| 1773 | Void setSaoEnabledFlag(Bool s) {m_saoEnabledFlag =s; } |
---|
| 1774 | Bool getSaoEnabledFlag() { return m_saoEnabledFlag; } |
---|
[443] | 1775 | Void setSaoEnabledFlagChroma(Bool s) {m_saoEnabledFlagChroma =s; } //!< set SAO Cb&Cr enabled flag |
---|
| 1776 | Bool getSaoEnabledFlagChroma() { return m_saoEnabledFlagChroma; } //!< get SAO Cb&Cr enabled flag |
---|
[56] | 1777 | Void setRPS ( TComReferencePictureSet *pcRPS ) { m_pcRPS = pcRPS; } |
---|
| 1778 | TComReferencePictureSet* getRPS () { return m_pcRPS; } |
---|
| 1779 | TComReferencePictureSet* getLocalRPS () { return &m_LocalRPS; } |
---|
| 1780 | |
---|
| 1781 | Void setRPSidx ( Int iBDidx ) { m_iBDidx = iBDidx; } |
---|
| 1782 | Int getRPSidx () { return m_iBDidx; } |
---|
[655] | 1783 | Int getPrevTid0POC () { return m_prevTid0POC; } |
---|
[56] | 1784 | TComRefPicListModification* getRefPicListModification() { return &m_RefPicListModification; } |
---|
| 1785 | Void setLastIDR(Int iIDRPOC) { m_iLastIDR = iIDRPOC; } |
---|
| 1786 | Int getLastIDR() { return m_iLastIDR; } |
---|
[655] | 1787 | Void setAssociatedIRAPPOC(Int iAssociatedIRAPPOC) { m_iAssociatedIRAP = iAssociatedIRAPPOC; } |
---|
| 1788 | Int getAssociatedIRAPPOC() { return m_iAssociatedIRAP; } |
---|
| 1789 | Void setAssociatedIRAPType(NalUnitType associatedIRAPType) { m_iAssociatedIRAPType = associatedIRAPType; } |
---|
| 1790 | NalUnitType getAssociatedIRAPType() { return m_iAssociatedIRAPType; } |
---|
[2] | 1791 | SliceType getSliceType () { return m_eSliceType; } |
---|
| 1792 | Int getPOC () { return m_iPOC; } |
---|
[56] | 1793 | Int getSliceQp () { return m_iSliceQp; } |
---|
[608] | 1794 | Bool getDependentSliceSegmentFlag() const { return m_dependentSliceSegmentFlag; } |
---|
| 1795 | void setDependentSliceSegmentFlag(Bool val) { m_dependentSliceSegmentFlag = val; } |
---|
[56] | 1796 | #if ADAPTIVE_QP_SELECTION |
---|
| 1797 | Int getSliceQpBase () { return m_iSliceQpBase; } |
---|
[21] | 1798 | #endif |
---|
[2] | 1799 | Int getSliceQpDelta () { return m_iSliceQpDelta; } |
---|
[608] | 1800 | Int getSliceQpDeltaCb () { return m_iSliceQpDeltaCb; } |
---|
| 1801 | Int getSliceQpDeltaCr () { return m_iSliceQpDeltaCr; } |
---|
| 1802 | Bool getDeblockingFilterDisable() { return m_deblockingFilterDisable; } |
---|
| 1803 | Bool getDeblockingFilterOverrideFlag() { return m_deblockingFilterOverrideFlag; } |
---|
| 1804 | Int getDeblockingFilterBetaOffsetDiv2() { return m_deblockingFilterBetaOffsetDiv2; } |
---|
| 1805 | Int getDeblockingFilterTcOffsetDiv2() { return m_deblockingFilterTcOffsetDiv2; } |
---|
[56] | 1806 | |
---|
[2] | 1807 | Int getNumRefIdx ( RefPicList e ) { return m_aiNumRefIdx[e]; } |
---|
| 1808 | TComPic* getPic () { return m_pcPic; } |
---|
| 1809 | TComPic* getRefPic ( RefPicList e, Int iRefIdx) { return m_apcRefPicList[e][iRefIdx]; } |
---|
| 1810 | Int getRefPOC ( RefPicList e, Int iRefIdx) { return m_aiRefPOCList[e][iRefIdx]; } |
---|
[608] | 1811 | #if H_3D |
---|
| 1812 | TComPic* getIvPic ( Bool depthFlag, Int viewIndex){ return m_ivPicsCurrPoc[ depthFlag ? 1 : 0 ][ viewIndex ]; } |
---|
| 1813 | #endif |
---|
[622] | 1814 | #if H_3D |
---|
[608] | 1815 | TComPic* getTexturePic () { return m_ivPicsCurrPoc[0][ m_viewIndex ]; } |
---|
| 1816 | #endif |
---|
| 1817 | #if H_3D_IC |
---|
| 1818 | Void setApplyIC( Bool b ) { m_bApplyIC = b; } |
---|
| 1819 | Bool getApplyIC() { return m_bApplyIC; } |
---|
| 1820 | Void xSetApplyIC(); |
---|
| 1821 | Void setIcSkipParseFlag( Bool b ) { m_icSkipParseFlag = b; } |
---|
| 1822 | Bool getIcSkipParseFlag() { return m_icSkipParseFlag; } |
---|
| 1823 | #endif |
---|
| 1824 | #if H_3D_ARP |
---|
| 1825 | Void setBaseViewRefPicList( TComList<TComPic*> *pListPic, Int iViewIdx ) { m_pBaseViewRefPicList[iViewIdx] = pListPic; } |
---|
[693] | 1826 | #if SHARP_ARP_REF_CHECK_F0105 |
---|
| 1827 | Void setARPStepNum( TComPicLists*ivPicLists ); |
---|
| 1828 | #else |
---|
[608] | 1829 | Void setARPStepNum(); |
---|
[693] | 1830 | #endif |
---|
[608] | 1831 | TComPic* getBaseViewRefPic ( UInt uiPOC , Int iViewIdx ) { return xGetRefPic( *m_pBaseViewRefPicList[iViewIdx], uiPOC ); } |
---|
| 1832 | UInt getARPStepNum( ) { return m_nARPStepNum; } |
---|
| 1833 | #endif |
---|
[2] | 1834 | Int getDepth () { return m_iDepth; } |
---|
[608] | 1835 | UInt getColFromL0Flag () { return m_colFromL0Flag; } |
---|
| 1836 | UInt getColRefIdx () { return m_colRefIdx; } |
---|
[56] | 1837 | Void checkColRefIdx (UInt curSliceIdx, TComPic* pic); |
---|
[608] | 1838 | Bool getIsUsedAsLongTerm (Int i, Int j) { return m_bIsUsedAsLongTerm[i][j]; } |
---|
[655] | 1839 | Void setIsUsedAsLongTerm (Int i, Int j, Bool value) { m_bIsUsedAsLongTerm[i][j] = value; } |
---|
[56] | 1840 | Bool getCheckLDC () { return m_bCheckLDC; } |
---|
| 1841 | Bool getMvdL1ZeroFlag () { return m_bLMvdL1Zero; } |
---|
[608] | 1842 | Int getNumRpsCurrTempList(); |
---|
| 1843 | Int getList1IdxToList0Idx ( Int list1Idx ) { return m_list1IdxToList0Idx[list1Idx]; } |
---|
[2] | 1844 | Void setReferenced(Bool b) { m_bRefenced = b; } |
---|
| 1845 | Bool isReferenced() { return m_bRefenced; } |
---|
[655] | 1846 | Bool isReferenceNalu() { return ((getNalUnitType() <= NAL_UNIT_RESERVED_VCL_R15) && (getNalUnitType()%2 != 0)) || ((getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP) && (getNalUnitType() <= NAL_UNIT_RESERVED_IRAP_VCL23) ); } |
---|
| 1847 | Void setPOC ( Int i ) { m_iPOC = i; if ((getTLayer()==0) && (isReferenceNalu() && (getNalUnitType()!=NAL_UNIT_CODED_SLICE_RASL_R)&& (getNalUnitType()!=NAL_UNIT_CODED_SLICE_RADL_R))) {m_prevTid0POC=i;} } |
---|
[2] | 1848 | Void setNalUnitType ( NalUnitType e ) { m_eNalUnitType = e; } |
---|
[608] | 1849 | NalUnitType getNalUnitType () const { return m_eNalUnitType; } |
---|
| 1850 | Bool getRapPicFlag (); |
---|
| 1851 | Bool getIdrPicFlag () { return getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP; } |
---|
| 1852 | Bool isIRAP () const { return (getNalUnitType() >= 16) && (getNalUnitType() <= 23); } |
---|
[655] | 1853 | Void checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, NalUnitType& associatedIRAPType, TComList<TComPic *>& rcListPic); |
---|
[56] | 1854 | Void decodingRefreshMarking(Int& pocCRA, Bool& bRefreshPending, TComList<TComPic*>& rcListPic); |
---|
[2] | 1855 | Void setSliceType ( SliceType e ) { m_eSliceType = e; } |
---|
| 1856 | Void setSliceQp ( Int i ) { m_iSliceQp = i; } |
---|
[56] | 1857 | #if ADAPTIVE_QP_SELECTION |
---|
| 1858 | Void setSliceQpBase ( Int i ) { m_iSliceQpBase = i; } |
---|
| 1859 | #endif |
---|
[2] | 1860 | Void setSliceQpDelta ( Int i ) { m_iSliceQpDelta = i; } |
---|
[608] | 1861 | Void setSliceQpDeltaCb ( Int i ) { m_iSliceQpDeltaCb = i; } |
---|
| 1862 | Void setSliceQpDeltaCr ( Int i ) { m_iSliceQpDeltaCr = i; } |
---|
| 1863 | Void setDeblockingFilterDisable( Bool b ) { m_deblockingFilterDisable= b; } |
---|
| 1864 | Void setDeblockingFilterOverrideFlag( Bool b ) { m_deblockingFilterOverrideFlag = b; } |
---|
| 1865 | Void setDeblockingFilterBetaOffsetDiv2( Int i ) { m_deblockingFilterBetaOffsetDiv2 = i; } |
---|
| 1866 | Void setDeblockingFilterTcOffsetDiv2( Int i ) { m_deblockingFilterTcOffsetDiv2 = i; } |
---|
[56] | 1867 | |
---|
[2] | 1868 | Void setRefPic ( TComPic* p, RefPicList e, Int iRefIdx ) { m_apcRefPicList[e][iRefIdx] = p; } |
---|
| 1869 | Void setRefPOC ( Int i, RefPicList e, Int iRefIdx ) { m_aiRefPOCList[e][iRefIdx] = i; } |
---|
| 1870 | Void setNumRefIdx ( RefPicList e, Int i ) { m_aiNumRefIdx[e] = i; } |
---|
| 1871 | Void setPic ( TComPic* p ) { m_pcPic = p; } |
---|
| 1872 | Void setDepth ( Int iDepth ) { m_iDepth = iDepth; } |
---|
[56] | 1873 | |
---|
[608] | 1874 | #if H_MV |
---|
[622] | 1875 | Void setPocBeforeReset ( Int i ) { m_iPOCBeforeReset = i; } |
---|
| 1876 | Int getPocBeforeReset ( ) { return m_iPOCBeforeReset; } |
---|
[608] | 1877 | Int getRefLayerId ( RefPicList e, Int iRefIdx) { return m_aiRefLayerIdList[e][iRefIdx]; } |
---|
| 1878 | Void setRefLayerId ( Int i, RefPicList e, Int iRefIdx ) { m_aiRefLayerIdList[e][iRefIdx] = i; } |
---|
[622] | 1879 | Void getTempRefPicLists ( TComList<TComPic*>& rcListPic, std::vector<TComPic*>& refPicSetInterLayer0, std::vector<TComPic*>& refPicSetInterLayer1, |
---|
| 1880 | std::vector<TComPic*> rpsCurrList[2], std::vector<Bool> usedAsLongTerm[2], Int& numPocTotalCurr, Bool checkNumPocTotalCurr = false ); |
---|
| 1881 | |
---|
| 1882 | Void setRefPicList ( std::vector<TComPic*> rpsCurrList[2], std::vector<Bool> usedAsLongTerm[2], Int numPocTotalCurr, Bool checkNumPocTotalCurr = false ); |
---|
| 1883 | #else |
---|
[608] | 1884 | #if FIX1071 |
---|
| 1885 | Void setRefPicList ( TComList<TComPic*>& rcListPic, Bool checkNumPocTotalCurr = false ); |
---|
| 1886 | #else |
---|
| 1887 | Void setRefPicList ( TComList<TComPic*>& rcListPic ); |
---|
| 1888 | #endif |
---|
| 1889 | #endif |
---|
| 1890 | Void setRefPOCList (); |
---|
| 1891 | Void setColFromL0Flag ( UInt colFromL0 ) { m_colFromL0Flag = colFromL0; } |
---|
[56] | 1892 | Void setColRefIdx ( UInt refIdx) { m_colRefIdx = refIdx; } |
---|
| 1893 | Void setCheckLDC ( Bool b ) { m_bCheckLDC = b; } |
---|
| 1894 | Void setMvdL1ZeroFlag ( Bool b) { m_bLMvdL1Zero = b; } |
---|
[5] | 1895 | |
---|
[2] | 1896 | Bool isIntra () { return m_eSliceType == I_SLICE; } |
---|
| 1897 | Bool isInterB () { return m_eSliceType == B_SLICE; } |
---|
| 1898 | Bool isInterP () { return m_eSliceType == P_SLICE; } |
---|
[56] | 1899 | |
---|
[608] | 1900 | #if SAO_CHROMA_LAMBDA |
---|
[56] | 1901 | Void setLambda( Double d, Double e ) { m_dLambdaLuma = d; m_dLambdaChroma = e;} |
---|
| 1902 | Double getLambdaLuma() { return m_dLambdaLuma; } |
---|
| 1903 | Double getLambdaChroma() { return m_dLambdaChroma; } |
---|
| 1904 | #else |
---|
[2] | 1905 | Void setLambda( Double d ) { m_dLambda = d; } |
---|
| 1906 | Double getLambda() { return m_dLambda; } |
---|
[42] | 1907 | #endif |
---|
[56] | 1908 | |
---|
[2] | 1909 | Void initEqualRef(); |
---|
| 1910 | Bool isEqualRef ( RefPicList e, Int iRefIdx1, Int iRefIdx2 ) |
---|
| 1911 | { |
---|
| 1912 | if (iRefIdx1 < 0 || iRefIdx2 < 0) return false; |
---|
| 1913 | return m_abEqualRef[e][iRefIdx1][iRefIdx2]; |
---|
| 1914 | } |
---|
[56] | 1915 | |
---|
[2] | 1916 | Void setEqualRef( RefPicList e, Int iRefIdx1, Int iRefIdx2, Bool b) |
---|
| 1917 | { |
---|
| 1918 | m_abEqualRef[e][iRefIdx1][iRefIdx2] = m_abEqualRef[e][iRefIdx2][iRefIdx1] = b; |
---|
| 1919 | } |
---|
[56] | 1920 | |
---|
[2] | 1921 | static Void sortPicList ( TComList<TComPic*>& rcListPic ); |
---|
[608] | 1922 | Void setList1IdxToList0Idx(); |
---|
[56] | 1923 | |
---|
| 1924 | UInt getTLayer () { return m_uiTLayer; } |
---|
| 1925 | Void setTLayer ( UInt uiTLayer ) { m_uiTLayer = uiTLayer; } |
---|
| 1926 | |
---|
| 1927 | Void setTLayerInfo( UInt uiTLayer ); |
---|
| 1928 | Void decodingMarking( TComList<TComPic*>& rcListPic, Int iGOPSIze, Int& iMaxRefPicNum ); |
---|
[655] | 1929 | Void checkLeadingPictureRestrictions( TComList<TComPic*>& rcListPic ); |
---|
[56] | 1930 | Void applyReferencePictureSet( TComList<TComPic*>& rcListPic, TComReferencePictureSet *RPSList); |
---|
[608] | 1931 | #if H_MV |
---|
[622] | 1932 | Void createInterLayerReferencePictureSet( TComPicLists* ivPicLists, std::vector<TComPic*>& refPicSetInterLayer0, std::vector<TComPic*>& refPicSetInterLayer1 ); |
---|
| 1933 | static Void markIvRefPicsAsShortTerm ( std::vector<TComPic*> refPicSetInterLayer0, std::vector<TComPic*> refPicSetInterLayer1 ); |
---|
[608] | 1934 | static Void markCurrPic ( TComPic* currPic );; |
---|
| 1935 | static Void markIvRefPicsAsUnused ( TComPicLists* ivPicLists, std::vector<Int> targetDecLayerIdSet, TComVPS* vps, Int curLayerId, Int curPoc ); |
---|
[622] | 1936 | Void printRefPicList(); |
---|
[2] | 1937 | #endif |
---|
[608] | 1938 | Bool isTemporalLayerSwitchingPoint( TComList<TComPic*>& rcListPic ); |
---|
| 1939 | Bool isStepwiseTemporalLayerSwitchingPointCandidate( TComList<TComPic*>& rcListPic ); |
---|
| 1940 | Int checkThatAllRefPicsAreAvailable( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool printErrors, Int pocRandomAccess = 0); |
---|
| 1941 | #if FIX1071 |
---|
| 1942 | Void createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool isRAP); |
---|
| 1943 | #else |
---|
[56] | 1944 | Void createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet); |
---|
[608] | 1945 | #endif |
---|
[56] | 1946 | |
---|
[608] | 1947 | Void setMaxNumMergeCand (UInt val ) { m_maxNumMergeCand = val; } |
---|
| 1948 | UInt getMaxNumMergeCand () { return m_maxNumMergeCand; } |
---|
[56] | 1949 | |
---|
[608] | 1950 | Void setSliceMode ( UInt uiMode ) { m_sliceMode = uiMode; } |
---|
| 1951 | UInt getSliceMode () { return m_sliceMode; } |
---|
| 1952 | Void setSliceArgument ( UInt uiArgument ) { m_sliceArgument = uiArgument; } |
---|
| 1953 | UInt getSliceArgument () { return m_sliceArgument; } |
---|
| 1954 | Void setSliceCurStartCUAddr ( UInt uiAddr ) { m_sliceCurStartCUAddr = uiAddr; } |
---|
| 1955 | UInt getSliceCurStartCUAddr () { return m_sliceCurStartCUAddr; } |
---|
| 1956 | Void setSliceCurEndCUAddr ( UInt uiAddr ) { m_sliceCurEndCUAddr = uiAddr; } |
---|
| 1957 | UInt getSliceCurEndCUAddr () { return m_sliceCurEndCUAddr; } |
---|
| 1958 | Void setSliceIdx ( UInt i) { m_sliceIdx = i; } |
---|
| 1959 | UInt getSliceIdx () { return m_sliceIdx; } |
---|
[2] | 1960 | Void copySliceInfo (TComSlice *pcSliceSrc); |
---|
[608] | 1961 | Void setSliceSegmentMode ( UInt uiMode ) { m_sliceSegmentMode = uiMode; } |
---|
| 1962 | UInt getSliceSegmentMode () { return m_sliceSegmentMode; } |
---|
| 1963 | Void setSliceSegmentArgument ( UInt uiArgument ) { m_sliceSegmentArgument = uiArgument; } |
---|
| 1964 | UInt getSliceSegmentArgument () { return m_sliceSegmentArgument; } |
---|
| 1965 | Void setSliceSegmentCurStartCUAddr ( UInt uiAddr ) { m_sliceSegmentCurStartCUAddr = uiAddr; } |
---|
| 1966 | UInt getSliceSegmentCurStartCUAddr () { return m_sliceSegmentCurStartCUAddr; } |
---|
| 1967 | Void setSliceSegmentCurEndCUAddr ( UInt uiAddr ) { m_sliceSegmentCurEndCUAddr = uiAddr; } |
---|
| 1968 | UInt getSliceSegmentCurEndCUAddr () { return m_sliceSegmentCurEndCUAddr; } |
---|
| 1969 | Void setNextSlice ( Bool b ) { m_nextSlice = b; } |
---|
| 1970 | Bool isNextSlice () { return m_nextSlice; } |
---|
| 1971 | Void setNextSliceSegment ( Bool b ) { m_nextSliceSegment = b; } |
---|
| 1972 | Bool isNextSliceSegment () { return m_nextSliceSegment; } |
---|
| 1973 | Void setSliceBits ( UInt uiVal ) { m_sliceBits = uiVal; } |
---|
| 1974 | UInt getSliceBits () { return m_sliceBits; } |
---|
| 1975 | Void setSliceSegmentBits ( UInt uiVal ) { m_sliceSegmentBits = uiVal; } |
---|
| 1976 | UInt getSliceSegmentBits () { return m_sliceSegmentBits; } |
---|
[56] | 1977 | Void setFinalized ( Bool uiVal ) { m_bFinalized = uiVal; } |
---|
| 1978 | Bool getFinalized () { return m_bFinalized; } |
---|
| 1979 | Void setWpScaling ( wpScalingParam wp[2][MAX_NUM_REF][3] ) { memcpy(m_weightPredTable, wp, sizeof(wpScalingParam)*2*MAX_NUM_REF*3); } |
---|
| 1980 | Void getWpScaling ( RefPicList e, Int iRefIdx, wpScalingParam *&wp); |
---|
[5] | 1981 | |
---|
[608] | 1982 | Void resetWpScaling (); |
---|
[56] | 1983 | Void initWpScaling (); |
---|
[608] | 1984 | inline Bool applyWP () { return( (m_eSliceType==P_SLICE && m_pcPPS->getUseWP()) || (m_eSliceType==B_SLICE && m_pcPPS->getWPBiPred()) ); } |
---|
| 1985 | |
---|
[56] | 1986 | Void setWpAcDcParam ( wpACDCParam wp[3] ) { memcpy(m_weightACDCParam, wp, sizeof(wpACDCParam)*3); } |
---|
| 1987 | Void getWpAcDcParam ( wpACDCParam *&wp ); |
---|
| 1988 | Void initWpAcDcParam (); |
---|
[608] | 1989 | |
---|
| 1990 | Void setTileLocationCount ( UInt cnt ) { return m_tileByteLocation.resize(cnt); } |
---|
| 1991 | UInt getTileLocationCount () { return (UInt) m_tileByteLocation.size(); } |
---|
| 1992 | Void setTileLocation ( Int idx, UInt location ) { assert (idx<m_tileByteLocation.size()); |
---|
| 1993 | m_tileByteLocation[idx] = location; } |
---|
| 1994 | Void addTileLocation ( UInt location ) { m_tileByteLocation.push_back(location); } |
---|
| 1995 | UInt getTileLocation ( Int idx ) { return m_tileByteLocation[idx]; } |
---|
| 1996 | |
---|
[56] | 1997 | Void setTileOffstForMultES (UInt uiOffset ) { m_uiTileOffstForMultES = uiOffset; } |
---|
| 1998 | UInt getTileOffstForMultES () { return m_uiTileOffstForMultES; } |
---|
| 1999 | Void allocSubstreamSizes ( UInt uiNumSubstreams ); |
---|
| 2000 | UInt* getSubstreamSizes () { return m_puiSubstreamSizes; } |
---|
| 2001 | Void setScalingList ( TComScalingList* scalingList ) { m_scalingList = scalingList; } |
---|
| 2002 | TComScalingList* getScalingList () { return m_scalingList; } |
---|
| 2003 | Void setDefaultScalingList (); |
---|
| 2004 | Bool checkDefaultScalingList (); |
---|
| 2005 | Void setCabacInitFlag ( Bool val ) { m_cabacInitFlag = val; } //!< set CABAC initial flag |
---|
| 2006 | Bool getCabacInitFlag () { return m_cabacInitFlag; } //!< get CABAC initial flag |
---|
| 2007 | Void setNumEntryPointOffsets(Int val) { m_numEntryPointOffsets = val; } |
---|
| 2008 | Int getNumEntryPointOffsets() { return m_numEntryPointOffsets; } |
---|
[608] | 2009 | Bool getTemporalLayerNonReferenceFlag() { return m_temporalLayerNonReferenceFlag;} |
---|
| 2010 | Void setTemporalLayerNonReferenceFlag(Bool x) { m_temporalLayerNonReferenceFlag = x;} |
---|
| 2011 | Void setLFCrossSliceBoundaryFlag ( Bool val ) { m_LFCrossSliceBoundaryFlag = val; } |
---|
| 2012 | Bool getLFCrossSliceBoundaryFlag () { return m_LFCrossSliceBoundaryFlag;} |
---|
[56] | 2013 | |
---|
[608] | 2014 | Void setEnableTMVPFlag ( Bool b ) { m_enableTMVPFlag = b; } |
---|
| 2015 | Bool getEnableTMVPFlag () { return m_enableTMVPFlag;} |
---|
| 2016 | |
---|
| 2017 | #if H_MV |
---|
| 2018 | Void setLayerId ( Int layerId ) { m_layerId = layerId; } |
---|
| 2019 | Int getLayerId () { return m_layerId; } |
---|
| 2020 | Int getLayerIdInVps () { return getVPS()->getLayerIdInVps( m_layerId ); }; |
---|
| 2021 | Void setViewId ( Int viewId ) { m_viewId = viewId; } |
---|
| 2022 | Int getViewId () { return m_viewId; } |
---|
[622] | 2023 | Void setViewIndex ( Int viewIndex ) { m_viewIndex = viewIndex; } |
---|
| 2024 | Int getViewIndex () { return m_viewIndex; } |
---|
[608] | 2025 | #if H_3D |
---|
| 2026 | #if H_3D_TMVP |
---|
| 2027 | Void generateAlterRefforTMVP (); |
---|
| 2028 | Void setAlterRefIdx ( RefPicList e, Int i ) { m_aiAlterRefIdx[e] = i; } |
---|
| 2029 | Int getAlterRefIdx ( RefPicList e ) { return m_aiAlterRefIdx[e]; } |
---|
[210] | 2030 | #endif |
---|
[666] | 2031 | #if QC_MTK_INTERVIEW_ARP_F0123_F0108 |
---|
| 2032 | Int getFirstTRefIdx ( RefPicList e ) { return m_aiFirstTRefIdx[e]; } |
---|
| 2033 | Void setFirstTRefIdx ( RefPicList e, Int i ) { m_aiFirstTRefIdx[e] = i; } |
---|
| 2034 | #endif |
---|
[693] | 2035 | #if SHARP_ARP_REF_CHECK_F0105 |
---|
| 2036 | Bool getArpRefPicAvailable( RefPicList e, Int viewIdx) {return m_arpRefPicAvailable[e][getVPS()->getLayerIdInNuh(viewIdx, 0)]; } |
---|
| 2037 | #endif |
---|
[608] | 2038 | Void setIsDepth ( Bool isDepth ) { m_isDepth = isDepth; } |
---|
| 2039 | Bool getIsDepth () { return m_isDepth; } |
---|
| 2040 | Void setCamparaSlice ( Int** aaiScale = 0, Int** aaiOffset = 0 ); |
---|
[2] | 2041 | Int* getCodedScale () { return m_aaiCodedScale [0]; } |
---|
| 2042 | Int* getCodedOffset () { return m_aaiCodedOffset[0]; } |
---|
| 2043 | Int* getInvCodedScale () { return m_aaiCodedScale [1]; } |
---|
| 2044 | Int* getInvCodedOffset () { return m_aaiCodedOffset[1]; } |
---|
[189] | 2045 | #endif |
---|
[443] | 2046 | #endif |
---|
[608] | 2047 | #if H_3D |
---|
| 2048 | Void setIvPicLists( TComPicLists* m_ivPicLists ); |
---|
| 2049 | Void setDepthToDisparityLUTs(); |
---|
[189] | 2050 | |
---|
[608] | 2051 | Int* getDepthToDisparityB( Int refViewIdx ) { return m_depthToDisparityB[ refViewIdx ]; }; |
---|
| 2052 | Int* getDepthToDisparityF( Int refViewIdx ) { return m_depthToDisparityF[ refViewIdx ]; }; |
---|
| 2053 | Bool getVpsDepthModesFlag () { return getVPS()->getVpsDepthModesFlag( getVPS()->getLayerIdInVps( m_layerId ) ); } |
---|
| 2054 | |
---|
[296] | 2055 | #endif |
---|
[608] | 2056 | #if H_MV |
---|
| 2057 | // Additional slice header syntax elements |
---|
[622] | 2058 | |
---|
| 2059 | Void setPocResetFlag( Bool flag ) { m_pocResetFlag = flag; } |
---|
| 2060 | Bool getPocResetFlag( ) { return m_pocResetFlag; } |
---|
| 2061 | |
---|
[608] | 2062 | Void setDiscardableFlag( Bool flag ) { m_discardableFlag = flag; } |
---|
| 2063 | Bool getDiscardableFlag( ) { return m_discardableFlag; } |
---|
[296] | 2064 | |
---|
[608] | 2065 | Void setInterLayerPredEnabledFlag( Bool flag ) { m_interLayerPredEnabledFlag = flag; } |
---|
| 2066 | Bool getInterLayerPredEnabledFlag( ) { return m_interLayerPredEnabledFlag; } |
---|
| 2067 | |
---|
| 2068 | Void setNumInterLayerRefPicsMinus1( Int val ) { m_numInterLayerRefPicsMinus1 = val; } |
---|
| 2069 | Int getNumInterLayerRefPicsMinus1( ) { return m_numInterLayerRefPicsMinus1; } |
---|
| 2070 | |
---|
| 2071 | Void setInterLayerPredLayerIdc( Int i, Int val ) { m_interLayerPredLayerIdc[i] = val; } |
---|
| 2072 | Int getInterLayerPredLayerIdc( Int i ) { return m_interLayerPredLayerIdc[i]; } |
---|
| 2073 | |
---|
[622] | 2074 | // Additional variables derived in slice header semantics |
---|
| 2075 | Int getNumInterLayerRefPicsMinus1Len( ) { return gCeilLog2( getVPS()->getNumDirectRefLayers( getLayerId() )); } |
---|
| 2076 | Int getInterLayerPredLayerIdcLen ( ) { return gCeilLog2( getVPS()->getNumDirectRefLayers( getLayerId() )); } |
---|
| 2077 | |
---|
| 2078 | Int getNumActiveRefLayerPics( ); |
---|
| 2079 | |
---|
| 2080 | Int getNumActiveRefLayerPics0( ) { return (Int) m_refPicSetInterLayer0->size(); }; |
---|
| 2081 | Int getNumActiveRefLayerPics1( ) { return (Int) m_refPicSetInterLayer1->size(); }; |
---|
| 2082 | |
---|
| 2083 | Int getRefPicLayerId ( Int i ); |
---|
| 2084 | |
---|
| 2085 | Void setRefPicSetInterLayer ( std::vector<TComPic*>* refPicSetInterLayer0, std::vector<TComPic*>* refPicSetInterLayer1); |
---|
| 2086 | TComPic* getPicFromRefPicSetInterLayer( Int setIdc, Int layerId ); |
---|
[443] | 2087 | #endif |
---|
[56] | 2088 | protected: |
---|
[608] | 2089 | TComPic* xGetRefPic (TComList<TComPic*>& rcListPic, |
---|
| 2090 | Int poc); |
---|
| 2091 | TComPic* xGetLongTermRefPic(TComList<TComPic*>& rcListPic, Int poc, Bool pocHasMsb); |
---|
| 2092 | #if H_MV |
---|
| 2093 | TComPic* xGetInterLayerRefPic( std::vector<TComPic*>& rcListIlPic, Int layerId ); |
---|
| 2094 | #endif |
---|
[56] | 2095 | };// END CLASS DEFINITION TComSlice |
---|
[2] | 2096 | |
---|
[5] | 2097 | |
---|
[56] | 2098 | template <class T> class ParameterSetMap |
---|
| 2099 | { |
---|
| 2100 | public: |
---|
| 2101 | ParameterSetMap(Int maxId) |
---|
| 2102 | :m_maxId (maxId) |
---|
| 2103 | {} |
---|
[2] | 2104 | |
---|
[56] | 2105 | ~ParameterSetMap() |
---|
| 2106 | { |
---|
| 2107 | for (typename std::map<Int,T *>::iterator i = m_paramsetMap.begin(); i!= m_paramsetMap.end(); i++) |
---|
| 2108 | { |
---|
| 2109 | delete (*i).second; |
---|
| 2110 | } |
---|
| 2111 | } |
---|
| 2112 | |
---|
| 2113 | Void storePS(Int psId, T *ps) |
---|
| 2114 | { |
---|
| 2115 | assert ( psId < m_maxId ); |
---|
| 2116 | if ( m_paramsetMap.find(psId) != m_paramsetMap.end() ) |
---|
| 2117 | { |
---|
| 2118 | delete m_paramsetMap[psId]; |
---|
| 2119 | } |
---|
| 2120 | m_paramsetMap[psId] = ps; |
---|
| 2121 | } |
---|
| 2122 | |
---|
| 2123 | Void mergePSList(ParameterSetMap<T> &rPsList) |
---|
| 2124 | { |
---|
| 2125 | for (typename std::map<Int,T *>::iterator i = rPsList.m_paramsetMap.begin(); i!= rPsList.m_paramsetMap.end(); i++) |
---|
| 2126 | { |
---|
| 2127 | storePS(i->first, i->second); |
---|
| 2128 | } |
---|
| 2129 | rPsList.m_paramsetMap.clear(); |
---|
| 2130 | } |
---|
| 2131 | |
---|
| 2132 | |
---|
| 2133 | T* getPS(Int psId) |
---|
| 2134 | { |
---|
| 2135 | return ( m_paramsetMap.find(psId) == m_paramsetMap.end() ) ? NULL : m_paramsetMap[psId]; |
---|
| 2136 | } |
---|
| 2137 | |
---|
| 2138 | T* getFirstPS() |
---|
| 2139 | { |
---|
| 2140 | return (m_paramsetMap.begin() == m_paramsetMap.end() ) ? NULL : m_paramsetMap.begin()->second; |
---|
| 2141 | } |
---|
| 2142 | |
---|
| 2143 | private: |
---|
| 2144 | std::map<Int,T *> m_paramsetMap; |
---|
| 2145 | Int m_maxId; |
---|
| 2146 | }; |
---|
| 2147 | |
---|
| 2148 | class ParameterSetManager |
---|
| 2149 | { |
---|
| 2150 | public: |
---|
| 2151 | ParameterSetManager(); |
---|
| 2152 | virtual ~ParameterSetManager(); |
---|
[608] | 2153 | |
---|
| 2154 | //! store sequence parameter set and take ownership of it |
---|
[77] | 2155 | Void storeVPS(TComVPS *vps) { m_vpsMap.storePS( vps->getVPSId(), vps); }; |
---|
| 2156 | //! get pointer to existing video parameter set |
---|
| 2157 | TComVPS* getVPS(Int vpsId) { return m_vpsMap.getPS(vpsId); }; |
---|
| 2158 | TComVPS* getFirstVPS() { return m_vpsMap.getFirstPS(); }; |
---|
[608] | 2159 | |
---|
[56] | 2160 | //! store sequence parameter set and take ownership of it |
---|
| 2161 | Void storeSPS(TComSPS *sps) { m_spsMap.storePS( sps->getSPSId(), sps); }; |
---|
| 2162 | //! get pointer to existing sequence parameter set |
---|
| 2163 | TComSPS* getSPS(Int spsId) { return m_spsMap.getPS(spsId); }; |
---|
| 2164 | TComSPS* getFirstSPS() { return m_spsMap.getFirstPS(); }; |
---|
| 2165 | |
---|
| 2166 | //! store picture parameter set and take ownership of it |
---|
| 2167 | Void storePPS(TComPPS *pps) { m_ppsMap.storePS( pps->getPPSId(), pps); }; |
---|
| 2168 | //! get pointer to existing picture parameter set |
---|
| 2169 | TComPPS* getPPS(Int ppsId) { return m_ppsMap.getPS(ppsId); }; |
---|
| 2170 | TComPPS* getFirstPPS() { return m_ppsMap.getFirstPS(); }; |
---|
| 2171 | |
---|
[608] | 2172 | //! activate a SPS from a active parameter sets SEI message |
---|
| 2173 | //! \returns true, if activation is successful |
---|
[622] | 2174 | #if H_MV |
---|
| 2175 | Bool activateSPSWithSEI(Int SPSId, Int layerId ); |
---|
| 2176 | #else |
---|
| 2177 | Bool activateSPSWithSEI(Int SPSId); |
---|
| 2178 | #endif |
---|
| 2179 | |
---|
| 2180 | //! activate a PPS and depending on isIDR parameter also SPS and VPS |
---|
| 2181 | //! \returns true, if activation is successful |
---|
| 2182 | #if H_MV |
---|
| 2183 | Bool activatePPS(Int ppsId, Bool isIRAP, Int layerId ); |
---|
| 2184 | #else |
---|
| 2185 | Bool activatePPS(Int ppsId, Bool isIRAP); |
---|
| 2186 | #endif |
---|
| 2187 | |
---|
| 2188 | TComVPS* getActiveVPS(){ return m_vpsMap.getPS(m_activeVPSId); }; |
---|
| 2189 | #if H_MV |
---|
| 2190 | TComSPS* getActiveSPS( Int layerId ){ return m_spsMap.getPS( m_activeSPSId[ layerId ] ); }; |
---|
| 2191 | TComPPS* getActivePPS( Int layerId ){ return m_ppsMap.getPS( m_activePPSId[ layerId ] ); }; |
---|
| 2192 | #else |
---|
| 2193 | TComSPS* getActiveSPS(){ return m_spsMap.getPS(m_activeSPSId); }; |
---|
| 2194 | TComPPS* getActivePPS(){ return m_ppsMap.getPS(m_activePPSId); }; |
---|
| 2195 | #endif |
---|
| 2196 | protected: |
---|
| 2197 | |
---|
| 2198 | ParameterSetMap<TComVPS> m_vpsMap; |
---|
| 2199 | ParameterSetMap<TComSPS> m_spsMap; |
---|
| 2200 | ParameterSetMap<TComPPS> m_ppsMap; |
---|
| 2201 | |
---|
| 2202 | Int m_activeVPSId; |
---|
| 2203 | #if H_MV |
---|
| 2204 | Int m_activeSPSId[ MAX_NUM_LAYERS ]; |
---|
| 2205 | Int m_activePPSId[ MAX_NUM_LAYERS ]; |
---|
| 2206 | #else |
---|
| 2207 | Int m_activeSPSId; |
---|
| 2208 | Int m_activePPSId; |
---|
| 2209 | #endif |
---|
| 2210 | |
---|
[56] | 2211 | }; |
---|
[5] | 2212 | |
---|
[56] | 2213 | //! \} |
---|
[2] | 2214 | |
---|
| 2215 | #endif // __TCOMSLICE__ |
---|