[324] | 1 | /* The copyright in this software is being made available under the BSD |
---|
| 2 | * License, included below. This software may be subject to other third party |
---|
| 3 | * and contributor rights, including patent rights, and no such rights are |
---|
| 4 | * granted under this license. |
---|
| 5 | * |
---|
| 6 | * Copyright (c) 2010-2013, ITU/ISO/IEC |
---|
| 7 | * All rights reserved. |
---|
| 8 | * |
---|
| 9 | * Redistribution and use in source and binary forms, with or without |
---|
| 10 | * modification, are permitted provided that the following conditions are met: |
---|
| 11 | * |
---|
| 12 | * * Redistributions of source code must retain the above copyright notice, |
---|
| 13 | * this list of conditions and the following disclaimer. |
---|
| 14 | * * Redistributions in binary form must reproduce the above copyright notice, |
---|
| 15 | * this list of conditions and the following disclaimer in the documentation |
---|
| 16 | * and/or other materials provided with the distribution. |
---|
| 17 | * * Neither the name of the ITU/ISO/IEC nor the names of its contributors may |
---|
| 18 | * be used to endorse or promote products derived from this software without |
---|
| 19 | * specific prior written permission. |
---|
| 20 | * |
---|
| 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
---|
| 22 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
---|
| 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
---|
| 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS |
---|
| 25 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
---|
| 26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
---|
| 27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
---|
| 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
---|
| 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
---|
| 30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF |
---|
| 31 | * THE POSSIBILITY OF SUCH DAMAGE. |
---|
| 32 | */ |
---|
| 33 | |
---|
| 34 | /** \file TComSlice.h |
---|
| 35 | \brief slice header and SPS class (header) |
---|
| 36 | */ |
---|
| 37 | |
---|
| 38 | #ifndef __TCOMSLICE__ |
---|
| 39 | #define __TCOMSLICE__ |
---|
| 40 | |
---|
| 41 | #include <cstring> |
---|
| 42 | #include <map> |
---|
| 43 | #include <vector> |
---|
| 44 | #include "CommonDef.h" |
---|
| 45 | #include "TComRom.h" |
---|
| 46 | #include "TComList.h" |
---|
| 47 | |
---|
| 48 | //! \ingroup TLibCommon |
---|
| 49 | //! \{ |
---|
| 50 | |
---|
| 51 | class TComPic; |
---|
| 52 | class TComTrQuant; |
---|
[368] | 53 | #if H_MV |
---|
| 54 | class TComPicLists; |
---|
| 55 | #endif |
---|
[324] | 56 | // ==================================================================================================================== |
---|
| 57 | // Constants |
---|
| 58 | // ==================================================================================================================== |
---|
| 59 | |
---|
| 60 | // ==================================================================================================================== |
---|
| 61 | // Class definition |
---|
| 62 | // ==================================================================================================================== |
---|
| 63 | |
---|
| 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]; |
---|
| 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]; |
---|
| 84 | |
---|
| 85 | public: |
---|
| 86 | TComReferencePictureSet(); |
---|
| 87 | virtual ~TComReferencePictureSet(); |
---|
| 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); |
---|
| 100 | |
---|
| 101 | Int getUsed(Int bufferNum); |
---|
| 102 | Int getDeltaPOC(Int bufferNum); |
---|
| 103 | Int getPOC(Int bufferNum); |
---|
| 104 | Int getNumberOfPictures(); |
---|
| 105 | |
---|
| 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 | |
---|
| 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 | Bool getUseTransformSkip () { return m_useTransformSkip; } |
---|
| 158 | Void setUseTransformSkip (Bool b) { m_useTransformSkip = b; } |
---|
| 159 | Int* getScalingListAddress (UInt sizeId, UInt listId) { return m_scalingListCoef[sizeId][listId]; } //!< get matrix coefficient |
---|
| 160 | Bool checkPredMode (UInt sizeId, UInt listId); |
---|
| 161 | Void setRefMatrixId (UInt sizeId, UInt listId, UInt u) { m_refMatrixId[sizeId][listId] = u; } //!< set reference matrix ID |
---|
| 162 | UInt getRefMatrixId (UInt sizeId, UInt listId) { return m_refMatrixId[sizeId][listId]; } //!< get reference matrix ID |
---|
| 163 | Int* getScalingListDefaultAddress (UInt sizeId, UInt listId); //!< get default matrix coefficient |
---|
| 164 | Void processDefaultMarix (UInt sizeId, UInt listId); |
---|
| 165 | Void setScalingListDC (UInt sizeId, UInt listId, UInt u) { m_scalingListDC[sizeId][listId] = u; } //!< set DC value |
---|
| 166 | |
---|
| 167 | Int getScalingListDC (UInt sizeId, UInt listId) { return m_scalingListDC[sizeId][listId]; } //!< get DC value |
---|
| 168 | Void checkDcOfMatrix (); |
---|
| 169 | Void processRefMatrix (UInt sizeId, UInt listId , UInt refListId ); |
---|
| 170 | Bool xParseScalingList (Char* pchFile); |
---|
| 171 | |
---|
| 172 | private: |
---|
| 173 | Void init (); |
---|
| 174 | Void destroy (); |
---|
| 175 | Int m_scalingListDC [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< the DC value of the matrix coefficient for 16x16 |
---|
| 176 | Bool m_useDefaultScalingMatrixFlag [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< UseDefaultScalingMatrixFlag |
---|
| 177 | UInt m_refMatrixId [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< RefMatrixID |
---|
| 178 | Bool m_scalingListPresentFlag; //!< flag for using default matrix |
---|
| 179 | UInt m_predMatrixId [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< reference list index |
---|
| 180 | Int *m_scalingListCoef [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< quantization matrix |
---|
| 181 | Bool m_useTransformSkip; //!< transform skipping flag for setting default scaling matrix for 4x4 |
---|
| 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]; } |
---|
[368] | 246 | #if H_MV |
---|
| 247 | Void copyLevelFrom( TComPTL* source ); |
---|
| 248 | #endif |
---|
[324] | 249 | }; |
---|
| 250 | /// VPS class |
---|
| 251 | |
---|
| 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 | |
---|
| 404 | class TComVPS |
---|
| 405 | { |
---|
| 406 | private: |
---|
| 407 | Int m_VPSId; |
---|
| 408 | UInt m_uiMaxTLayers; |
---|
| 409 | UInt m_uiMaxLayers; |
---|
| 410 | Bool m_bTemporalIdNestingFlag; |
---|
| 411 | |
---|
| 412 | UInt m_numReorderPics[MAX_TLAYER]; |
---|
| 413 | UInt m_uiMaxDecPicBuffering[MAX_TLAYER]; |
---|
[537] | 414 | UInt m_uiMaxLatencyIncrease[MAX_TLAYER]; // Really max latency increase plus 1 (value 0 expresses no limit) |
---|
[324] | 415 | |
---|
| 416 | UInt m_numHrdParameters; |
---|
[368] | 417 | #if H_MV |
---|
[534] | 418 | UInt m_maxLayerId; |
---|
[368] | 419 | #else |
---|
[324] | 420 | UInt m_maxNuhReservedZeroLayerId; |
---|
[368] | 421 | #endif |
---|
[324] | 422 | TComHRD* m_hrdParameters; |
---|
| 423 | UInt* m_hrdOpSetIdx; |
---|
| 424 | Bool* m_cprmsPresentFlag; |
---|
[368] | 425 | #if H_MV |
---|
[534] | 426 | UInt m_vpsNumLayerSetsMinus1; |
---|
[368] | 427 | Bool m_layerIdIncludedFlag[MAX_VPS_OP_SETS_PLUS1][MAX_VPS_NUH_LAYER_ID_PLUS1]; |
---|
| 428 | #else |
---|
[534] | 429 | UInt m_numOpSets; |
---|
[324] | 430 | Bool m_layerIdIncludedFlag[MAX_VPS_OP_SETS_PLUS1][MAX_VPS_NUH_RESERVED_ZERO_LAYER_ID_PLUS1]; |
---|
[368] | 431 | #endif |
---|
[324] | 432 | |
---|
[368] | 433 | #if H_MV |
---|
| 434 | TComPTL m_pcPTL[MAX_VPS_OP_SETS_PLUS1]; |
---|
| 435 | #else |
---|
[324] | 436 | TComPTL m_pcPTL; |
---|
[368] | 437 | #endif |
---|
[324] | 438 | TimingInfo m_timingInfo; |
---|
[368] | 439 | #if H_MV |
---|
[534] | 440 | /// VPS EXTENSION SYNTAX ELEMENTS |
---|
[368] | 441 | Bool m_avcBaseLayerFlag; |
---|
| 442 | Bool m_splittingFlag; |
---|
| 443 | Bool m_scalabilityMask [MAX_NUM_SCALABILITY_TYPES]; |
---|
| 444 | Int m_dimensionIdLen [MAX_NUM_SCALABILITY_TYPES]; |
---|
| 445 | Bool m_vpsNuhLayerIdPresentFlag; |
---|
| 446 | Int m_layerIdInNuh [MAX_NUM_LAYER_IDS]; |
---|
[534] | 447 | Int m_dimensionId [MAX_NUM_LAYER_IDS][MAX_NUM_SCALABILITY_TYPES]; |
---|
| 448 | Bool m_directDependencyFlag [MAX_NUM_LAYER_IDS][MAX_NUM_LAYER_IDS]; |
---|
| 449 | Int m_maxTidIlRefPicPlus1 [MAX_NUM_LAYERS]; |
---|
| 450 | Int m_vpsNumberLayerSetsMinus1; |
---|
| 451 | Int m_vpsNumProfileTierLevelMinus1; |
---|
| 452 | Bool m_vpsProfilePresentFlag [MAX_VPS_OP_SETS_PLUS1]; |
---|
| 453 | Int m_profileRefMinus1 [MAX_VPS_PROFILE_TIER_LEVEL]; |
---|
| 454 | Bool m_moreOutputLayerSetsThanDefaultFlag; |
---|
| 455 | Int m_numAddOutputLayerSetsMinus1; |
---|
| 456 | Bool m_defaultOneTargetOutputLayerFlag; |
---|
| 457 | Int m_outputLayerSetIdxMinus1 [MAX_VPS_OUTPUTLAYER_SETS]; |
---|
| 458 | Bool m_outputLayerFlag [MAX_VPS_OUTPUTLAYER_SETS][MAX_VPS_NUH_LAYER_ID_PLUS1]; |
---|
| 459 | Int m_profileLevelTierIdx [MAX_VPS_OUTPUTLAYER_SETS ]; |
---|
| 460 | Bool m_maxOneActiveRefLayerFlag; |
---|
| 461 | Int m_directDepTypeLenMinus2; |
---|
| 462 | Int m_directDependencyType [MAX_NUM_LAYERS] [MAX_NUM_LAYERS]; |
---|
| 463 | |
---|
| 464 | // VPS EXTENSION SEMANTICS VARIABLES |
---|
[368] | 465 | Int m_layerIdInVps [MAX_NUM_LAYERS ]; |
---|
[534] | 466 | |
---|
| 467 | Int m_numDirectRefLayers [MAX_NUM_LAYERS]; |
---|
| 468 | Int m_refLayerId [MAX_NUM_LAYERS][MAX_NUM_LAYERS]; |
---|
| 469 | |
---|
| 470 | Int m_numSamplePredRefLayers [MAX_NUM_LAYERS]; |
---|
| 471 | Bool m_samplePredEnabledFlag [MAX_NUM_LAYERS][MAX_NUM_LAYERS]; |
---|
| 472 | Int m_samplePredRefLayerId [MAX_NUM_LAYERS][MAX_NUM_LAYERS]; |
---|
| 473 | |
---|
| 474 | Int m_numMotionPredRefLayers [MAX_NUM_LAYERS]; |
---|
| 475 | Bool m_motionPredEnabledFlag [MAX_NUM_LAYERS][MAX_NUM_LAYERS]; |
---|
| 476 | Int m_motionPredRefLayerId [MAX_NUM_LAYERS][MAX_NUM_LAYERS]; |
---|
[446] | 477 | #if H_3D |
---|
| 478 | Int m_viewIndex [MAX_NUM_LAYERS ]; |
---|
[534] | 479 | #endif |
---|
| 480 | |
---|
| 481 | Int xCeilLog2 ( Int val ); |
---|
| 482 | Int xGetDimBitOffset( Int j ); |
---|
| 483 | |
---|
[504] | 484 | #if H_3D_ARP |
---|
| 485 | UInt m_uiUseAdvResPred [MAX_NUM_LAYERS ]; |
---|
| 486 | UInt m_uiARPStepNum [MAX_NUM_LAYERS ]; |
---|
[446] | 487 | #endif |
---|
[504] | 488 | #if H_3D_IV_MERGE |
---|
| 489 | Bool m_ivMvPredFlag [ MAX_NUM_LAYERS ]; |
---|
| 490 | #endif |
---|
| 491 | #if H_3D_VSP |
---|
[510] | 492 | Bool m_viewSynthesisPredFlag [ MAX_NUM_LAYERS ]; |
---|
[504] | 493 | #endif |
---|
| 494 | #if H_3D_NBDV_REF |
---|
| 495 | Bool m_depthRefinementFlag [ MAX_NUM_LAYERS ]; |
---|
| 496 | #endif |
---|
[531] | 497 | Bool m_vpsDepthModesFlag [MAX_NUM_LAYERS ]; |
---|
| 498 | #if H_3D_DIM_DLT |
---|
| 499 | Bool m_bUseDLTFlag [MAX_NUM_LAYERS ]; |
---|
| 500 | |
---|
| 501 | Int m_iBitsPerDepthValue [MAX_NUM_LAYERS ]; |
---|
| 502 | Int m_iNumDepthmapValues [MAX_NUM_LAYERS ]; |
---|
| 503 | Int* m_iDepthValue2Idx [MAX_NUM_LAYERS ]; |
---|
| 504 | Int* m_iIdx2DepthValue [MAX_NUM_LAYERS ]; |
---|
[504] | 505 | #endif |
---|
[532] | 506 | #if H_3D_TMVP |
---|
| 507 | Bool m_ivMvScalingFlag; |
---|
| 508 | #endif |
---|
[368] | 509 | |
---|
[531] | 510 | #endif |
---|
[324] | 511 | public: |
---|
| 512 | TComVPS(); |
---|
| 513 | virtual ~TComVPS(); |
---|
| 514 | |
---|
| 515 | Void createHrdParamBuffer() |
---|
| 516 | { |
---|
| 517 | m_hrdParameters = new TComHRD[ getNumHrdParameters() ]; |
---|
| 518 | m_hrdOpSetIdx = new UInt [ getNumHrdParameters() ]; |
---|
| 519 | m_cprmsPresentFlag = new Bool [ getNumHrdParameters() ]; |
---|
| 520 | } |
---|
| 521 | |
---|
| 522 | TComHRD* getHrdParameters ( UInt i ) { return &m_hrdParameters[ i ]; } |
---|
| 523 | UInt getHrdOpSetIdx ( UInt i ) { return m_hrdOpSetIdx[ i ]; } |
---|
| 524 | Void setHrdOpSetIdx ( UInt val, UInt i ) { m_hrdOpSetIdx[ i ] = val; } |
---|
| 525 | Bool getCprmsPresentFlag ( UInt i ) { return m_cprmsPresentFlag[ i ]; } |
---|
| 526 | Void setCprmsPresentFlag ( Bool val, UInt i ) { m_cprmsPresentFlag[ i ] = val; } |
---|
| 527 | |
---|
| 528 | Int getVPSId () { return m_VPSId; } |
---|
| 529 | Void setVPSId (Int i) { m_VPSId = i; } |
---|
| 530 | |
---|
| 531 | UInt getMaxTLayers () { return m_uiMaxTLayers; } |
---|
| 532 | Void setMaxTLayers (UInt t) { m_uiMaxTLayers = t; } |
---|
| 533 | |
---|
| 534 | UInt getMaxLayers () { return m_uiMaxLayers; } |
---|
| 535 | Void setMaxLayers (UInt l) { m_uiMaxLayers = l; } |
---|
| 536 | |
---|
| 537 | Bool getTemporalNestingFlag () { return m_bTemporalIdNestingFlag; } |
---|
| 538 | Void setTemporalNestingFlag (Bool t) { m_bTemporalIdNestingFlag = t; } |
---|
| 539 | |
---|
| 540 | Void setNumReorderPics(UInt v, UInt tLayer) { m_numReorderPics[tLayer] = v; } |
---|
| 541 | UInt getNumReorderPics(UInt tLayer) { return m_numReorderPics[tLayer]; } |
---|
| 542 | |
---|
| 543 | Void setMaxDecPicBuffering(UInt v, UInt tLayer) { m_uiMaxDecPicBuffering[tLayer] = v; } |
---|
| 544 | UInt getMaxDecPicBuffering(UInt tLayer) { return m_uiMaxDecPicBuffering[tLayer]; } |
---|
| 545 | |
---|
| 546 | Void setMaxLatencyIncrease(UInt v, UInt tLayer) { m_uiMaxLatencyIncrease[tLayer] = v; } |
---|
| 547 | UInt getMaxLatencyIncrease(UInt tLayer) { return m_uiMaxLatencyIncrease[tLayer]; } |
---|
| 548 | |
---|
| 549 | UInt getNumHrdParameters() { return m_numHrdParameters; } |
---|
| 550 | Void setNumHrdParameters(UInt v) { m_numHrdParameters = v; } |
---|
| 551 | |
---|
[368] | 552 | #if H_MV |
---|
[534] | 553 | UInt getVpsMaxLayerId() { return m_maxLayerId; } |
---|
| 554 | Void setVpsMaxLayerId(UInt v) { m_maxLayerId = v; } |
---|
| 555 | |
---|
| 556 | UInt getVpsNumLayerSetsMinus1() { return m_vpsNumLayerSetsMinus1; } |
---|
| 557 | Void setVpsNumLayerSetsMinus1(UInt v) { m_vpsNumLayerSetsMinus1 = v; } |
---|
[368] | 558 | #else |
---|
[324] | 559 | UInt getMaxNuhReservedZeroLayerId() { return m_maxNuhReservedZeroLayerId; } |
---|
| 560 | Void setMaxNuhReservedZeroLayerId(UInt v) { m_maxNuhReservedZeroLayerId = v; } |
---|
| 561 | |
---|
| 562 | UInt getMaxOpSets() { return m_numOpSets; } |
---|
| 563 | Void setMaxOpSets(UInt v) { m_numOpSets = v; } |
---|
[534] | 564 | #endif |
---|
[324] | 565 | Bool getLayerIdIncludedFlag(UInt opsIdx, UInt id) { return m_layerIdIncludedFlag[opsIdx][id]; } |
---|
| 566 | Void setLayerIdIncludedFlag(Bool v, UInt opsIdx, UInt id) { m_layerIdIncludedFlag[opsIdx][id] = v; } |
---|
| 567 | |
---|
[368] | 568 | #if H_MV |
---|
| 569 | TComPTL* getPTL( Int layerSet = 0 ) { return &m_pcPTL[layerSet]; } |
---|
| 570 | #else |
---|
[324] | 571 | TComPTL* getPTL() { return &m_pcPTL; } |
---|
[368] | 572 | #endif |
---|
[324] | 573 | TimingInfo* getTimingInfo() { return &m_timingInfo; } |
---|
[368] | 574 | #if H_MV |
---|
| 575 | Void setAvcBaseLayerFlag( Bool val ) { m_avcBaseLayerFlag = val; } |
---|
| 576 | Bool getAvcBaseLayerFlag() { return m_avcBaseLayerFlag; } |
---|
| 577 | |
---|
| 578 | Void setSplittingFlag( Bool val ) { m_splittingFlag = val; } |
---|
| 579 | Bool getSplittingFlag() { return m_splittingFlag; } |
---|
| 580 | |
---|
| 581 | Void setScalabilityMask( UInt val ); |
---|
| 582 | |
---|
| 583 | Void setScalabilityMask( Int scalType, Bool val ) { m_scalabilityMask[scalType] = val; } |
---|
| 584 | Bool getScalabilityMask( Int scalType ) { return m_scalabilityMask[scalType]; } |
---|
| 585 | |
---|
| 586 | Int getNumScalabilityTypes( ); |
---|
| 587 | |
---|
| 588 | Void setDimensionIdLen( Int sIdx, Int val ) { m_dimensionIdLen[sIdx] = val; } |
---|
| 589 | Int getDimensionIdLen( Int sIdx ) { assert( m_dimensionIdLen[sIdx] > 0) ; return m_dimensionIdLen[sIdx]; } |
---|
| 590 | |
---|
| 591 | Void setVpsNuhLayerIdPresentFlag( Bool val ) { m_vpsNuhLayerIdPresentFlag = val; } |
---|
| 592 | Bool getVpsNuhLayerIdPresentFlag() { return m_vpsNuhLayerIdPresentFlag; } |
---|
| 593 | |
---|
| 594 | Void setLayerIdInNuh( Int layerIdInVps, Int val ) { m_layerIdInNuh[layerIdInVps] = val; } |
---|
| 595 | Int getLayerIdInNuh( Int layerIdInVps ) { assert( m_layerIdInNuh[layerIdInVps] >= 0 ); return m_layerIdInNuh[layerIdInVps]; } |
---|
| 596 | |
---|
| 597 | Bool nuhLayerIdIncluded( Int layerIdinNuh ) { return ( m_layerIdInVps[ layerIdinNuh ] > 0 ); } |
---|
| 598 | |
---|
| 599 | Void setDimensionId( Int layerIdInVps, Int scalIdx, Int val ) { m_dimensionId[layerIdInVps][scalIdx] = val; } |
---|
| 600 | Int getDimensionId( Int layerIdInVps, Int scalIdx ) { return m_dimensionId[layerIdInVps][scalIdx]; } |
---|
| 601 | |
---|
[534] | 602 | Void setDirectDependencyFlag( Int depLayeridInVps, Int refLayeridInVps, Bool val ) { m_directDependencyFlag[depLayeridInVps][refLayeridInVps] = val; } |
---|
| 603 | Bool getDirectDependencyFlag( Int depLayeridInVps, Int refLayeridInVps ) { return m_directDependencyFlag[depLayeridInVps][refLayeridInVps]; } |
---|
| 604 | |
---|
| 605 | Void setMaxTidIlRefPicPlus1( Int layerIdInVps, Int val ) { m_maxTidIlRefPicPlus1[ layerIdInVps ] = val; } |
---|
| 606 | Int getMaxTidIlRefPicPlus1( Int layerIdInVps ) { return m_maxTidIlRefPicPlus1[ layerIdInVps ]; } |
---|
| 607 | |
---|
| 608 | Void setVpsNumberLayerSetsMinus1( Int val ) { m_vpsNumberLayerSetsMinus1 = val; } |
---|
| 609 | Int getVpsNumberLayerSetsMinus1( ) { return m_vpsNumberLayerSetsMinus1; } |
---|
| 610 | |
---|
| 611 | Void setVpsNumProfileTierLevelMinus1( Int val ) { m_vpsNumProfileTierLevelMinus1 = val; } |
---|
| 612 | Int getVpsNumProfileTierLevelMinus1( ) { return m_vpsNumProfileTierLevelMinus1; } |
---|
| 613 | |
---|
| 614 | Void setVpsProfilePresentFlag( Int idx, Bool val ) { m_vpsProfilePresentFlag[idx] = val; } |
---|
| 615 | Bool getVpsProfilePresentFlag( Int idx ) { return m_vpsProfilePresentFlag[idx]; } |
---|
| 616 | |
---|
| 617 | Void setProfileRefMinus1( Int profileTierLevelIdx, Int val ) { m_profileRefMinus1[ profileTierLevelIdx ] = val; } |
---|
| 618 | Int getProfileRefMinus1( Int profileTierLevelIdx ) { return m_profileRefMinus1[ profileTierLevelIdx ]; } |
---|
| 619 | |
---|
| 620 | Void setMoreOutputLayerSetsThanDefaultFlag( Bool flag ) { m_moreOutputLayerSetsThanDefaultFlag = flag; } |
---|
| 621 | Bool getMoreOutputLayerSetsThanDefaultFlag() { return m_moreOutputLayerSetsThanDefaultFlag; } |
---|
| 622 | |
---|
| 623 | Void setNumAddOutputLayerSetsMinus1( Int val ) { m_numAddOutputLayerSetsMinus1 = val; } |
---|
| 624 | Int getNumAddOutputLayerSetsMinus1( ) { return m_numAddOutputLayerSetsMinus1; } |
---|
| 625 | |
---|
| 626 | Void setDefaultOneTargetOutputLayerFlag( Bool flag ) { m_defaultOneTargetOutputLayerFlag = flag; } |
---|
| 627 | Bool getDefaultOneTargetOutputLayerFlag( ) { return m_defaultOneTargetOutputLayerFlag; } |
---|
| 628 | |
---|
| 629 | Void setOutputLayerSetIdxMinus1( Int outLayerSetIdx, Int val ) { m_outputLayerSetIdxMinus1[ outLayerSetIdx ] = val; } |
---|
| 630 | Int getOutputLayerSetIdxMinus1( Int outLayerSetIdx ) { return m_outputLayerSetIdxMinus1[ outLayerSetIdx ]; } |
---|
| 631 | |
---|
| 632 | Void setOutputLayerFlag( Int outLayerSetIdx, Int i, Bool flag ) { m_outputLayerFlag[ outLayerSetIdx ][ i ] = flag; } |
---|
| 633 | Bool getOutputLayerFlag( Int outLayerSetIdx, Int i ) { return m_outputLayerFlag[ outLayerSetIdx ][ i ]; } |
---|
| 634 | |
---|
| 635 | Void setProfileLevelTierIdx( Int outLayerSetIdx, Int val ) { m_profileLevelTierIdx[ outLayerSetIdx = val ]; } |
---|
| 636 | Int getProfileLevelTierIdx( Int outLayerSetIdx ) { return m_profileLevelTierIdx[ outLayerSetIdx ]; } |
---|
| 637 | |
---|
| 638 | Void setMaxOneActiveRefLayerFlag( Bool flag) { m_maxOneActiveRefLayerFlag = flag; } |
---|
| 639 | Bool getMaxOneActiveRefLayerFlag( ) { return m_maxOneActiveRefLayerFlag; } |
---|
| 640 | |
---|
| 641 | Void setDirectDepTypeLenMinus2( Int val) { m_directDepTypeLenMinus2 = val; } |
---|
| 642 | Int getDirectDepTypeLenMinus2( ) { return m_directDepTypeLenMinus2; } |
---|
| 643 | |
---|
| 644 | Void setDirectDependencyType( Int depLayeridInVps, Int refLayeridInVps, Int val) { m_directDependencyType[ depLayeridInVps ][ refLayeridInVps ] = val; } |
---|
| 645 | Int getDirectDependencyType( Int depLayeridInVps, Int refLayeridInVps) { return m_directDependencyType[ depLayeridInVps ][ refLayeridInVps ]; } |
---|
| 646 | |
---|
| 647 | |
---|
| 648 | // VPS EXTENSION SEMANTICS VARIABLES |
---|
| 649 | Void setLayerIdInVps( Int layerIdInNuh, Int val ) { m_layerIdInVps[layerIdInNuh] = val; } |
---|
| 650 | Int getLayerIdInVps( Int layerIdInNuh ) { assert( m_layerIdInVps[layerIdInNuh] >= 0 ); return m_layerIdInVps[layerIdInNuh]; } |
---|
| 651 | |
---|
[368] | 652 | Int getScalabilityId ( Int layerIdInVps, ScalabilityType scalType ); |
---|
[534] | 653 | Int getViewId ( Int layerIdInVps ) { return getScalabilityId( layerIdInVps, VIEW_ID ); } |
---|
[368] | 654 | |
---|
[534] | 655 | Void setRefLayers(); |
---|
| 656 | |
---|
| 657 | Int getNumDirectRefLayers( Int layerIdInVps ) { return m_numDirectRefLayers[ layerIdInVps ]; }; |
---|
| 658 | Int getRefLayerId ( Int layerIdInVps, Int idx );; |
---|
| 659 | |
---|
| 660 | Int getNumSamplePredRefLayers( Int layerIdInVps ) { return m_numSamplePredRefLayers[layerIdInVps]; } |
---|
| 661 | Bool getSamplePredEnabledFlag ( Int layerIdInVps, Int idx ) { return m_samplePredEnabledFlag [layerIdInVps][idx]; } |
---|
| 662 | Int getSamplePredRefLayerId ( Int layerIdInVps, Int idx ) { return m_samplePredRefLayerId [layerIdInVps][idx]; } |
---|
| 663 | |
---|
| 664 | Int getNumMotionPredRefLayers( Int layerIdInVps ) { return m_numMotionPredRefLayers[layerIdInVps]; } |
---|
| 665 | Bool getMotionPredEnabledFlag ( Int layerIdInVps, Int idx ) { return m_motionPredEnabledFlag [layerIdInVps][idx]; } |
---|
| 666 | Int getMotionPredRefLayerId ( Int layerIdInVps, Int idx ) { return m_motionPredRefLayerId [layerIdInVps][idx]; } |
---|
| 667 | |
---|
| 668 | Bool checkVPSExtensionSyntax(); |
---|
| 669 | Int scalTypeToScalIdx ( ScalabilityType scalType ); |
---|
| 670 | |
---|
| 671 | Int getProfileLevelTierIdxLen() { return xCeilLog2( getVpsNumProfileTierLevelMinus1() + 1 ); }; |
---|
| 672 | Int getNumLayersInIdList ( Int lsIdx );; |
---|
| 673 | |
---|
| 674 | // inference |
---|
| 675 | Int inferDimensionId ( Int i, Int j ); |
---|
| 676 | Int inferLastDimsionIdLenMinus1(); |
---|
| 677 | |
---|
[368] | 678 | #if H_3D |
---|
[446] | 679 | Void initViewIndex(); |
---|
| 680 | Int getViewIndex ( Int layerIdInVps ) { return m_viewIndex[ layerIdInVps ]; } |
---|
| 681 | Int getDepthId ( Int layerIdInVps ) { return getScalabilityId( layerIdInVps, DEPTH_ID ); } |
---|
[534] | 682 | Int getLayerIdInNuh( Int viewIndex, Bool depthFlag ); |
---|
| 683 | |
---|
[504] | 684 | #if H_3D_ARP |
---|
| 685 | UInt getUseAdvRP ( Int layerIdInVps ) { return m_uiUseAdvResPred[layerIdInVps]; } |
---|
| 686 | UInt getARPStepNum( Int layerIdInVps ) { return m_uiARPStepNum[layerIdInVps]; } |
---|
| 687 | Void setUseAdvRP ( Int layerIdInVps, UInt val ) { m_uiUseAdvResPred[layerIdInVps] = val; } |
---|
| 688 | Void setARPStepNum( Int layerIdInVps, UInt val ) { m_uiARPStepNum[layerIdInVps] = val; } |
---|
[368] | 689 | #endif |
---|
[504] | 690 | #if H_3D_IV_MERGE |
---|
| 691 | Void setIvMvPredFlag ( Int layerIdInVps, Bool val ) { m_ivMvPredFlag[ layerIdInVps ] = val; } |
---|
| 692 | Bool getIvMvPredFlag ( Int layerIdInVps ) { return m_ivMvPredFlag[ layerIdInVps ]; }; |
---|
| 693 | #endif |
---|
| 694 | #if H_3D_VSP |
---|
| 695 | Void setViewSynthesisPredFlag ( Int layerIdInVps, Bool val ) { m_viewSynthesisPredFlag[ layerIdInVps ] = val; } |
---|
| 696 | Bool getViewSynthesisPredFlag ( Int layerIdInVps ) { return m_viewSynthesisPredFlag[ layerIdInVps ]; }; |
---|
| 697 | #endif |
---|
| 698 | #if H_3D_NBDV_REF |
---|
| 699 | Void setDepthRefinementFlag ( Int layerIdInVps, Bool val ) { m_depthRefinementFlag[ layerIdInVps ] = val; } |
---|
| 700 | Bool getDepthRefinementFlag ( Int layerIdInVps ) { return m_depthRefinementFlag[ layerIdInVps ]; }; |
---|
| 701 | #endif |
---|
[531] | 702 | Void setVpsDepthModesFlag( Int layerIdInVps, Bool val ) { m_vpsDepthModesFlag[ layerIdInVps ] = val; } |
---|
| 703 | Bool getVpsDepthModesFlag( Int layerIdInVps ) { return m_vpsDepthModesFlag[ layerIdInVps ]; } |
---|
| 704 | #if H_3D_DIM_DLT |
---|
| 705 | Bool getUseDLTFlag ( Int layerIdInVps ) { return m_bUseDLTFlag[ layerIdInVps ]; } |
---|
| 706 | Void setUseDLTFlag ( Int layerIdInVps, Bool b ) { m_bUseDLTFlag[ layerIdInVps ] = b; } |
---|
| 707 | |
---|
| 708 | Int getBitsPerDepthValue( Int layerIdInVps ) { return getUseDLTFlag(layerIdInVps)?m_iBitsPerDepthValue[layerIdInVps]:g_bitDepthY; } |
---|
| 709 | Int getNumDepthValues( Int layerIdInVps ) { return getUseDLTFlag(layerIdInVps)?m_iNumDepthmapValues[layerIdInVps]:((1 << g_bitDepthY)-1); } |
---|
| 710 | Int depthValue2idx( Int layerIdInVps, Pel value ) { return getUseDLTFlag(layerIdInVps)?m_iDepthValue2Idx[layerIdInVps][value]:value; } |
---|
| 711 | Pel idx2DepthValue( Int layerIdInVps, UInt uiIdx ) { return getUseDLTFlag(layerIdInVps)?m_iIdx2DepthValue[layerIdInVps][uiIdx]:uiIdx; } |
---|
| 712 | Void setDepthLUTs( Int layerIdInVps, Int* idx2DepthValue = NULL, Int iNumDepthValues = 0 ); |
---|
[504] | 713 | #endif |
---|
[368] | 714 | |
---|
[532] | 715 | #if H_3D_TMVP |
---|
| 716 | Bool getIvMvScalingFlag ( ) { return m_ivMvScalingFlag; } |
---|
| 717 | Void setIvMvScalingFlag ( Bool b ) { m_ivMvScalingFlag = b; } |
---|
[531] | 718 | #endif |
---|
[368] | 719 | |
---|
[534] | 720 | #endif |
---|
[368] | 721 | #endif |
---|
[324] | 722 | }; |
---|
| 723 | |
---|
| 724 | class Window |
---|
| 725 | { |
---|
| 726 | private: |
---|
| 727 | Bool m_enabledFlag; |
---|
| 728 | Int m_winLeftOffset; |
---|
| 729 | Int m_winRightOffset; |
---|
| 730 | Int m_winTopOffset; |
---|
| 731 | Int m_winBottomOffset; |
---|
| 732 | public: |
---|
| 733 | Window() |
---|
| 734 | : m_enabledFlag (false) |
---|
| 735 | , m_winLeftOffset (0) |
---|
| 736 | , m_winRightOffset (0) |
---|
| 737 | , m_winTopOffset (0) |
---|
| 738 | , m_winBottomOffset (0) |
---|
| 739 | { } |
---|
| 740 | |
---|
| 741 | Bool getWindowEnabledFlag() const { return m_enabledFlag; } |
---|
| 742 | Void resetWindow() { m_enabledFlag = false; m_winLeftOffset = m_winRightOffset = m_winTopOffset = m_winBottomOffset = 0; } |
---|
| 743 | Int getWindowLeftOffset() const { return m_enabledFlag ? m_winLeftOffset : 0; } |
---|
| 744 | Void setWindowLeftOffset(Int val) { m_winLeftOffset = val; m_enabledFlag = true; } |
---|
| 745 | Int getWindowRightOffset() const { return m_enabledFlag ? m_winRightOffset : 0; } |
---|
| 746 | Void setWindowRightOffset(Int val) { m_winRightOffset = val; m_enabledFlag = true; } |
---|
| 747 | Int getWindowTopOffset() const { return m_enabledFlag ? m_winTopOffset : 0; } |
---|
| 748 | Void setWindowTopOffset(Int val) { m_winTopOffset = val; m_enabledFlag = true; } |
---|
| 749 | Int getWindowBottomOffset() const { return m_enabledFlag ? m_winBottomOffset: 0; } |
---|
| 750 | Void setWindowBottomOffset(Int val) { m_winBottomOffset = val; m_enabledFlag = true; } |
---|
| 751 | |
---|
| 752 | Void setWindow(Int offsetLeft, Int offsetLRight, Int offsetLTop, Int offsetLBottom) |
---|
| 753 | { |
---|
| 754 | m_enabledFlag = true; |
---|
| 755 | m_winLeftOffset = offsetLeft; |
---|
| 756 | m_winRightOffset = offsetLRight; |
---|
| 757 | m_winTopOffset = offsetLTop; |
---|
| 758 | m_winBottomOffset = offsetLBottom; |
---|
| 759 | } |
---|
| 760 | }; |
---|
| 761 | |
---|
| 762 | |
---|
| 763 | class TComVUI |
---|
| 764 | { |
---|
| 765 | private: |
---|
| 766 | Bool m_aspectRatioInfoPresentFlag; |
---|
| 767 | Int m_aspectRatioIdc; |
---|
| 768 | Int m_sarWidth; |
---|
| 769 | Int m_sarHeight; |
---|
| 770 | Bool m_overscanInfoPresentFlag; |
---|
| 771 | Bool m_overscanAppropriateFlag; |
---|
| 772 | Bool m_videoSignalTypePresentFlag; |
---|
| 773 | Int m_videoFormat; |
---|
| 774 | Bool m_videoFullRangeFlag; |
---|
| 775 | Bool m_colourDescriptionPresentFlag; |
---|
| 776 | Int m_colourPrimaries; |
---|
| 777 | Int m_transferCharacteristics; |
---|
| 778 | Int m_matrixCoefficients; |
---|
| 779 | Bool m_chromaLocInfoPresentFlag; |
---|
| 780 | Int m_chromaSampleLocTypeTopField; |
---|
| 781 | Int m_chromaSampleLocTypeBottomField; |
---|
| 782 | Bool m_neutralChromaIndicationFlag; |
---|
| 783 | Bool m_fieldSeqFlag; |
---|
| 784 | |
---|
| 785 | Window m_defaultDisplayWindow; |
---|
| 786 | Bool m_frameFieldInfoPresentFlag; |
---|
| 787 | Bool m_hrdParametersPresentFlag; |
---|
| 788 | Bool m_bitstreamRestrictionFlag; |
---|
| 789 | Bool m_tilesFixedStructureFlag; |
---|
| 790 | Bool m_motionVectorsOverPicBoundariesFlag; |
---|
| 791 | Bool m_restrictedRefPicListsFlag; |
---|
| 792 | Int m_minSpatialSegmentationIdc; |
---|
| 793 | Int m_maxBytesPerPicDenom; |
---|
| 794 | Int m_maxBitsPerMinCuDenom; |
---|
| 795 | Int m_log2MaxMvLengthHorizontal; |
---|
| 796 | Int m_log2MaxMvLengthVertical; |
---|
| 797 | TComHRD m_hrdParameters; |
---|
| 798 | TimingInfo m_timingInfo; |
---|
[534] | 799 | #if H_MV |
---|
| 800 | Bool m_tileBoundariesAlignedFlag; |
---|
| 801 | #endif |
---|
[537] | 802 | |
---|
[324] | 803 | public: |
---|
| 804 | TComVUI() |
---|
| 805 | :m_aspectRatioInfoPresentFlag(false) |
---|
| 806 | ,m_aspectRatioIdc(0) |
---|
| 807 | ,m_sarWidth(0) |
---|
| 808 | ,m_sarHeight(0) |
---|
| 809 | ,m_overscanInfoPresentFlag(false) |
---|
| 810 | ,m_overscanAppropriateFlag(false) |
---|
| 811 | ,m_videoSignalTypePresentFlag(false) |
---|
| 812 | ,m_videoFormat(5) |
---|
| 813 | ,m_videoFullRangeFlag(false) |
---|
| 814 | ,m_colourDescriptionPresentFlag(false) |
---|
| 815 | ,m_colourPrimaries(2) |
---|
| 816 | ,m_transferCharacteristics(2) |
---|
| 817 | ,m_matrixCoefficients(2) |
---|
| 818 | ,m_chromaLocInfoPresentFlag(false) |
---|
| 819 | ,m_chromaSampleLocTypeTopField(0) |
---|
| 820 | ,m_chromaSampleLocTypeBottomField(0) |
---|
| 821 | ,m_neutralChromaIndicationFlag(false) |
---|
| 822 | ,m_fieldSeqFlag(false) |
---|
| 823 | ,m_frameFieldInfoPresentFlag(false) |
---|
| 824 | ,m_hrdParametersPresentFlag(false) |
---|
| 825 | ,m_bitstreamRestrictionFlag(false) |
---|
| 826 | ,m_tilesFixedStructureFlag(false) |
---|
| 827 | ,m_motionVectorsOverPicBoundariesFlag(true) |
---|
| 828 | ,m_restrictedRefPicListsFlag(1) |
---|
| 829 | ,m_minSpatialSegmentationIdc(0) |
---|
| 830 | ,m_maxBytesPerPicDenom(2) |
---|
| 831 | ,m_maxBitsPerMinCuDenom(1) |
---|
| 832 | ,m_log2MaxMvLengthHorizontal(15) |
---|
| 833 | ,m_log2MaxMvLengthVertical(15) |
---|
[534] | 834 | #if H_MV |
---|
| 835 | ,m_tileBoundariesAlignedFlag(true) |
---|
| 836 | #endif |
---|
[324] | 837 | {} |
---|
| 838 | |
---|
| 839 | virtual ~TComVUI() {} |
---|
| 840 | |
---|
| 841 | Bool getAspectRatioInfoPresentFlag() { return m_aspectRatioInfoPresentFlag; } |
---|
| 842 | Void setAspectRatioInfoPresentFlag(Bool i) { m_aspectRatioInfoPresentFlag = i; } |
---|
| 843 | |
---|
| 844 | Int getAspectRatioIdc() { return m_aspectRatioIdc; } |
---|
| 845 | Void setAspectRatioIdc(Int i) { m_aspectRatioIdc = i; } |
---|
| 846 | |
---|
| 847 | Int getSarWidth() { return m_sarWidth; } |
---|
| 848 | Void setSarWidth(Int i) { m_sarWidth = i; } |
---|
| 849 | |
---|
| 850 | Int getSarHeight() { return m_sarHeight; } |
---|
| 851 | Void setSarHeight(Int i) { m_sarHeight = i; } |
---|
| 852 | |
---|
| 853 | Bool getOverscanInfoPresentFlag() { return m_overscanInfoPresentFlag; } |
---|
| 854 | Void setOverscanInfoPresentFlag(Bool i) { m_overscanInfoPresentFlag = i; } |
---|
| 855 | |
---|
| 856 | Bool getOverscanAppropriateFlag() { return m_overscanAppropriateFlag; } |
---|
| 857 | Void setOverscanAppropriateFlag(Bool i) { m_overscanAppropriateFlag = i; } |
---|
| 858 | |
---|
| 859 | Bool getVideoSignalTypePresentFlag() { return m_videoSignalTypePresentFlag; } |
---|
| 860 | Void setVideoSignalTypePresentFlag(Bool i) { m_videoSignalTypePresentFlag = i; } |
---|
| 861 | |
---|
| 862 | Int getVideoFormat() { return m_videoFormat; } |
---|
| 863 | Void setVideoFormat(Int i) { m_videoFormat = i; } |
---|
| 864 | |
---|
| 865 | Bool getVideoFullRangeFlag() { return m_videoFullRangeFlag; } |
---|
| 866 | Void setVideoFullRangeFlag(Bool i) { m_videoFullRangeFlag = i; } |
---|
| 867 | |
---|
| 868 | Bool getColourDescriptionPresentFlag() { return m_colourDescriptionPresentFlag; } |
---|
| 869 | Void setColourDescriptionPresentFlag(Bool i) { m_colourDescriptionPresentFlag = i; } |
---|
| 870 | |
---|
| 871 | Int getColourPrimaries() { return m_colourPrimaries; } |
---|
| 872 | Void setColourPrimaries(Int i) { m_colourPrimaries = i; } |
---|
| 873 | |
---|
| 874 | Int getTransferCharacteristics() { return m_transferCharacteristics; } |
---|
| 875 | Void setTransferCharacteristics(Int i) { m_transferCharacteristics = i; } |
---|
| 876 | |
---|
| 877 | Int getMatrixCoefficients() { return m_matrixCoefficients; } |
---|
| 878 | Void setMatrixCoefficients(Int i) { m_matrixCoefficients = i; } |
---|
| 879 | |
---|
| 880 | Bool getChromaLocInfoPresentFlag() { return m_chromaLocInfoPresentFlag; } |
---|
| 881 | Void setChromaLocInfoPresentFlag(Bool i) { m_chromaLocInfoPresentFlag = i; } |
---|
| 882 | |
---|
| 883 | Int getChromaSampleLocTypeTopField() { return m_chromaSampleLocTypeTopField; } |
---|
| 884 | Void setChromaSampleLocTypeTopField(Int i) { m_chromaSampleLocTypeTopField = i; } |
---|
| 885 | |
---|
| 886 | Int getChromaSampleLocTypeBottomField() { return m_chromaSampleLocTypeBottomField; } |
---|
| 887 | Void setChromaSampleLocTypeBottomField(Int i) { m_chromaSampleLocTypeBottomField = i; } |
---|
| 888 | |
---|
| 889 | Bool getNeutralChromaIndicationFlag() { return m_neutralChromaIndicationFlag; } |
---|
| 890 | Void setNeutralChromaIndicationFlag(Bool i) { m_neutralChromaIndicationFlag = i; } |
---|
| 891 | |
---|
| 892 | Bool getFieldSeqFlag() { return m_fieldSeqFlag; } |
---|
| 893 | Void setFieldSeqFlag(Bool i) { m_fieldSeqFlag = i; } |
---|
| 894 | |
---|
| 895 | Bool getFrameFieldInfoPresentFlag() { return m_frameFieldInfoPresentFlag; } |
---|
| 896 | Void setFrameFieldInfoPresentFlag(Bool i) { m_frameFieldInfoPresentFlag = i; } |
---|
| 897 | |
---|
| 898 | Window& getDefaultDisplayWindow() { return m_defaultDisplayWindow; } |
---|
| 899 | Void setDefaultDisplayWindow(Window& defaultDisplayWindow ) { m_defaultDisplayWindow = defaultDisplayWindow; } |
---|
| 900 | |
---|
| 901 | Bool getHrdParametersPresentFlag() { return m_hrdParametersPresentFlag; } |
---|
| 902 | Void setHrdParametersPresentFlag(Bool i) { m_hrdParametersPresentFlag = i; } |
---|
| 903 | |
---|
| 904 | Bool getBitstreamRestrictionFlag() { return m_bitstreamRestrictionFlag; } |
---|
| 905 | Void setBitstreamRestrictionFlag(Bool i) { m_bitstreamRestrictionFlag = i; } |
---|
| 906 | |
---|
| 907 | Bool getTilesFixedStructureFlag() { return m_tilesFixedStructureFlag; } |
---|
| 908 | Void setTilesFixedStructureFlag(Bool i) { m_tilesFixedStructureFlag = i; } |
---|
| 909 | |
---|
| 910 | Bool getMotionVectorsOverPicBoundariesFlag() { return m_motionVectorsOverPicBoundariesFlag; } |
---|
| 911 | Void setMotionVectorsOverPicBoundariesFlag(Bool i) { m_motionVectorsOverPicBoundariesFlag = i; } |
---|
| 912 | |
---|
| 913 | Bool getRestrictedRefPicListsFlag() { return m_restrictedRefPicListsFlag; } |
---|
| 914 | Void setRestrictedRefPicListsFlag(Bool b) { m_restrictedRefPicListsFlag = b; } |
---|
| 915 | |
---|
| 916 | Int getMinSpatialSegmentationIdc() { return m_minSpatialSegmentationIdc; } |
---|
| 917 | Void setMinSpatialSegmentationIdc(Int i) { m_minSpatialSegmentationIdc = i; } |
---|
| 918 | Int getMaxBytesPerPicDenom() { return m_maxBytesPerPicDenom; } |
---|
| 919 | Void setMaxBytesPerPicDenom(Int i) { m_maxBytesPerPicDenom = i; } |
---|
| 920 | |
---|
| 921 | Int getMaxBitsPerMinCuDenom() { return m_maxBitsPerMinCuDenom; } |
---|
| 922 | Void setMaxBitsPerMinCuDenom(Int i) { m_maxBitsPerMinCuDenom = i; } |
---|
| 923 | |
---|
| 924 | Int getLog2MaxMvLengthHorizontal() { return m_log2MaxMvLengthHorizontal; } |
---|
| 925 | Void setLog2MaxMvLengthHorizontal(Int i) { m_log2MaxMvLengthHorizontal = i; } |
---|
| 926 | |
---|
| 927 | Int getLog2MaxMvLengthVertical() { return m_log2MaxMvLengthVertical; } |
---|
| 928 | Void setLog2MaxMvLengthVertical(Int i) { m_log2MaxMvLengthVertical = i; } |
---|
| 929 | |
---|
| 930 | TComHRD* getHrdParameters () { return &m_hrdParameters; } |
---|
| 931 | TimingInfo* getTimingInfo() { return &m_timingInfo; } |
---|
[534] | 932 | #if H_MV |
---|
[537] | 933 | Bool getTileBoundariesAlignedFlag( ) { return m_tileBoundariesAlignedFlag; } |
---|
[534] | 934 | Void setTileBoundariesAlignedFlag( Bool flag ) { m_tileBoundariesAlignedFlag = flag; } |
---|
| 935 | #endif |
---|
[324] | 936 | }; |
---|
| 937 | |
---|
| 938 | /// SPS class |
---|
| 939 | class TComSPS |
---|
| 940 | { |
---|
| 941 | private: |
---|
| 942 | Int m_SPSId; |
---|
| 943 | Int m_VPSId; |
---|
| 944 | Int m_chromaFormatIdc; |
---|
| 945 | |
---|
| 946 | UInt m_uiMaxTLayers; // maximum number of temporal layers |
---|
| 947 | |
---|
| 948 | // Structure |
---|
| 949 | UInt m_picWidthInLumaSamples; |
---|
| 950 | UInt m_picHeightInLumaSamples; |
---|
| 951 | |
---|
[446] | 952 | Int m_log2MinCodingBlockSize; |
---|
| 953 | Int m_log2DiffMaxMinCodingBlockSize; |
---|
[324] | 954 | UInt m_uiMaxCUWidth; |
---|
| 955 | UInt m_uiMaxCUHeight; |
---|
| 956 | UInt m_uiMaxCUDepth; |
---|
[446] | 957 | |
---|
| 958 | Window m_conformanceWindow; |
---|
| 959 | |
---|
[324] | 960 | TComRPSList m_RPSList; |
---|
| 961 | Bool m_bLongTermRefsPresent; |
---|
| 962 | Bool m_TMVPFlagsPresent; |
---|
| 963 | Int m_numReorderPics[MAX_TLAYER]; |
---|
| 964 | |
---|
| 965 | // Tool list |
---|
| 966 | UInt m_uiQuadtreeTULog2MaxSize; |
---|
| 967 | UInt m_uiQuadtreeTULog2MinSize; |
---|
| 968 | UInt m_uiQuadtreeTUMaxDepthInter; |
---|
| 969 | UInt m_uiQuadtreeTUMaxDepthIntra; |
---|
| 970 | Bool m_usePCM; |
---|
| 971 | UInt m_pcmLog2MaxSize; |
---|
| 972 | UInt m_uiPCMLog2MinSize; |
---|
| 973 | Bool m_useAMP; |
---|
| 974 | |
---|
[539] | 975 | #if H_3D_QTLPC |
---|
| 976 | Bool m_bUseQTL; |
---|
| 977 | Bool m_bUsePC; |
---|
| 978 | #endif |
---|
[324] | 979 | // Parameter |
---|
| 980 | Int m_bitDepthY; |
---|
| 981 | Int m_bitDepthC; |
---|
| 982 | Int m_qpBDOffsetY; |
---|
| 983 | Int m_qpBDOffsetC; |
---|
| 984 | |
---|
| 985 | Bool m_useLossless; |
---|
| 986 | |
---|
| 987 | UInt m_uiPCMBitDepthLuma; |
---|
| 988 | UInt m_uiPCMBitDepthChroma; |
---|
| 989 | Bool m_bPCMFilterDisableFlag; |
---|
| 990 | |
---|
| 991 | UInt m_uiBitsForPOC; |
---|
| 992 | UInt m_numLongTermRefPicSPS; |
---|
| 993 | UInt m_ltRefPicPocLsbSps[33]; |
---|
| 994 | Bool m_usedByCurrPicLtSPSFlag[33]; |
---|
| 995 | // Max physical transform size |
---|
| 996 | UInt m_uiMaxTrSize; |
---|
| 997 | |
---|
| 998 | Int m_iAMPAcc[MAX_CU_DEPTH]; |
---|
| 999 | Bool m_bUseSAO; |
---|
| 1000 | |
---|
| 1001 | Bool m_bTemporalIdNestingFlag; // temporal_id_nesting_flag |
---|
| 1002 | |
---|
| 1003 | Bool m_scalingListEnabledFlag; |
---|
| 1004 | Bool m_scalingListPresentFlag; |
---|
| 1005 | TComScalingList* m_scalingList; //!< ScalingList class pointer |
---|
| 1006 | UInt m_uiMaxDecPicBuffering[MAX_TLAYER]; |
---|
[537] | 1007 | UInt m_uiMaxLatencyIncrease[MAX_TLAYER]; // Really max latency increase plus 1 (value 0 expresses no limit) |
---|
[324] | 1008 | |
---|
| 1009 | Bool m_useDF; |
---|
| 1010 | Bool m_useStrongIntraSmoothing; |
---|
| 1011 | |
---|
| 1012 | Bool m_vuiParametersPresentFlag; |
---|
| 1013 | TComVUI m_vuiParameters; |
---|
| 1014 | |
---|
| 1015 | static const Int m_winUnitX[MAX_CHROMA_FORMAT_IDC+1]; |
---|
| 1016 | static const Int m_winUnitY[MAX_CHROMA_FORMAT_IDC+1]; |
---|
| 1017 | TComPTL m_pcPTL; |
---|
[446] | 1018 | #if H_MV |
---|
| 1019 | Bool m_interViewMvVertConstraintFlag; |
---|
[534] | 1020 | Int m_numIlpRestrictedRefLayers ; |
---|
| 1021 | Int m_minSpatialSegmentOffsetPlus1[MAX_NUM_LAYERS]; |
---|
| 1022 | Bool m_ctuBasedOffsetEnabledFlag [MAX_NUM_LAYERS]; |
---|
| 1023 | Int m_minHorizontalCtuOffsetPlus1 [MAX_NUM_LAYERS]; |
---|
[446] | 1024 | #endif |
---|
| 1025 | #if H_3D |
---|
| 1026 | UInt m_uiCamParPrecision; |
---|
| 1027 | Bool m_bCamParInSliceHeader; |
---|
| 1028 | Int m_aaiCodedScale [2][MAX_NUM_LAYERS]; |
---|
| 1029 | Int m_aaiCodedOffset[2][MAX_NUM_LAYERS]; |
---|
| 1030 | #endif |
---|
[534] | 1031 | #if H_MV |
---|
| 1032 | Int m_layerId; |
---|
| 1033 | #endif |
---|
[324] | 1034 | public: |
---|
| 1035 | TComSPS(); |
---|
| 1036 | virtual ~TComSPS(); |
---|
| 1037 | |
---|
| 1038 | Int getVPSId () { return m_VPSId; } |
---|
| 1039 | Void setVPSId (Int i) { m_VPSId = i; } |
---|
| 1040 | Int getSPSId () { return m_SPSId; } |
---|
| 1041 | Void setSPSId (Int i) { m_SPSId = i; } |
---|
| 1042 | Int getChromaFormatIdc () { return m_chromaFormatIdc; } |
---|
| 1043 | Void setChromaFormatIdc (Int i) { m_chromaFormatIdc = i; } |
---|
| 1044 | |
---|
| 1045 | static Int getWinUnitX (Int chromaFormatIdc) { assert (chromaFormatIdc > 0 && chromaFormatIdc <= MAX_CHROMA_FORMAT_IDC); return m_winUnitX[chromaFormatIdc]; } |
---|
| 1046 | static Int getWinUnitY (Int chromaFormatIdc) { assert (chromaFormatIdc > 0 && chromaFormatIdc <= MAX_CHROMA_FORMAT_IDC); return m_winUnitY[chromaFormatIdc]; } |
---|
| 1047 | |
---|
| 1048 | // structure |
---|
| 1049 | Void setPicWidthInLumaSamples ( UInt u ) { m_picWidthInLumaSamples = u; } |
---|
| 1050 | UInt getPicWidthInLumaSamples () { return m_picWidthInLumaSamples; } |
---|
| 1051 | Void setPicHeightInLumaSamples ( UInt u ) { m_picHeightInLumaSamples = u; } |
---|
| 1052 | UInt getPicHeightInLumaSamples () { return m_picHeightInLumaSamples; } |
---|
| 1053 | |
---|
| 1054 | Window& getConformanceWindow() { return m_conformanceWindow; } |
---|
| 1055 | Void setConformanceWindow(Window& conformanceWindow ) { m_conformanceWindow = conformanceWindow; } |
---|
| 1056 | |
---|
| 1057 | UInt getNumLongTermRefPicSPS() { return m_numLongTermRefPicSPS; } |
---|
| 1058 | Void setNumLongTermRefPicSPS(UInt val) { m_numLongTermRefPicSPS = val; } |
---|
| 1059 | |
---|
| 1060 | UInt getLtRefPicPocLsbSps(UInt index) { return m_ltRefPicPocLsbSps[index]; } |
---|
| 1061 | Void setLtRefPicPocLsbSps(UInt index, UInt val) { m_ltRefPicPocLsbSps[index] = val; } |
---|
| 1062 | |
---|
| 1063 | Bool getUsedByCurrPicLtSPSFlag(Int i) {return m_usedByCurrPicLtSPSFlag[i];} |
---|
| 1064 | Void setUsedByCurrPicLtSPSFlag(Int i, Bool x) { m_usedByCurrPicLtSPSFlag[i] = x;} |
---|
[446] | 1065 | |
---|
| 1066 | Int getLog2MinCodingBlockSize() const { return m_log2MinCodingBlockSize; } |
---|
| 1067 | Void setLog2MinCodingBlockSize(Int val) { m_log2MinCodingBlockSize = val; } |
---|
| 1068 | Int getLog2DiffMaxMinCodingBlockSize() const { return m_log2DiffMaxMinCodingBlockSize; } |
---|
| 1069 | Void setLog2DiffMaxMinCodingBlockSize(Int val) { m_log2DiffMaxMinCodingBlockSize = val; } |
---|
| 1070 | |
---|
[324] | 1071 | Void setMaxCUWidth ( UInt u ) { m_uiMaxCUWidth = u; } |
---|
| 1072 | UInt getMaxCUWidth () { return m_uiMaxCUWidth; } |
---|
| 1073 | Void setMaxCUHeight ( UInt u ) { m_uiMaxCUHeight = u; } |
---|
| 1074 | UInt getMaxCUHeight () { return m_uiMaxCUHeight; } |
---|
| 1075 | Void setMaxCUDepth ( UInt u ) { m_uiMaxCUDepth = u; } |
---|
| 1076 | UInt getMaxCUDepth () { return m_uiMaxCUDepth; } |
---|
| 1077 | Void setUsePCM ( Bool b ) { m_usePCM = b; } |
---|
| 1078 | Bool getUsePCM () { return m_usePCM; } |
---|
| 1079 | Void setPCMLog2MaxSize ( UInt u ) { m_pcmLog2MaxSize = u; } |
---|
| 1080 | UInt getPCMLog2MaxSize () { return m_pcmLog2MaxSize; } |
---|
| 1081 | Void setPCMLog2MinSize ( UInt u ) { m_uiPCMLog2MinSize = u; } |
---|
| 1082 | UInt getPCMLog2MinSize () { return m_uiPCMLog2MinSize; } |
---|
| 1083 | Void setBitsForPOC ( UInt u ) { m_uiBitsForPOC = u; } |
---|
| 1084 | UInt getBitsForPOC () { return m_uiBitsForPOC; } |
---|
| 1085 | Bool getUseAMP() { return m_useAMP; } |
---|
| 1086 | Void setUseAMP( Bool b ) { m_useAMP = b; } |
---|
| 1087 | Void setQuadtreeTULog2MaxSize( UInt u ) { m_uiQuadtreeTULog2MaxSize = u; } |
---|
| 1088 | UInt getQuadtreeTULog2MaxSize() { return m_uiQuadtreeTULog2MaxSize; } |
---|
| 1089 | Void setQuadtreeTULog2MinSize( UInt u ) { m_uiQuadtreeTULog2MinSize = u; } |
---|
| 1090 | UInt getQuadtreeTULog2MinSize() { return m_uiQuadtreeTULog2MinSize; } |
---|
| 1091 | Void setQuadtreeTUMaxDepthInter( UInt u ) { m_uiQuadtreeTUMaxDepthInter = u; } |
---|
| 1092 | Void setQuadtreeTUMaxDepthIntra( UInt u ) { m_uiQuadtreeTUMaxDepthIntra = u; } |
---|
| 1093 | UInt getQuadtreeTUMaxDepthInter() { return m_uiQuadtreeTUMaxDepthInter; } |
---|
| 1094 | UInt getQuadtreeTUMaxDepthIntra() { return m_uiQuadtreeTUMaxDepthIntra; } |
---|
| 1095 | Void setNumReorderPics(Int i, UInt tlayer) { m_numReorderPics[tlayer] = i; } |
---|
| 1096 | Int getNumReorderPics(UInt tlayer) { return m_numReorderPics[tlayer]; } |
---|
| 1097 | Void createRPSList( Int numRPS ); |
---|
| 1098 | TComRPSList* getRPSList() { return &m_RPSList; } |
---|
| 1099 | Bool getLongTermRefsPresent() { return m_bLongTermRefsPresent; } |
---|
| 1100 | Void setLongTermRefsPresent(Bool b) { m_bLongTermRefsPresent=b; } |
---|
| 1101 | Bool getTMVPFlagsPresent() { return m_TMVPFlagsPresent; } |
---|
| 1102 | Void setTMVPFlagsPresent(Bool b) { m_TMVPFlagsPresent=b; } |
---|
| 1103 | // physical transform |
---|
| 1104 | Void setMaxTrSize ( UInt u ) { m_uiMaxTrSize = u; } |
---|
| 1105 | UInt getMaxTrSize () { return m_uiMaxTrSize; } |
---|
| 1106 | |
---|
| 1107 | // Tool list |
---|
| 1108 | Bool getUseLossless () { return m_useLossless; } |
---|
| 1109 | Void setUseLossless ( Bool b ) { m_useLossless = b; } |
---|
| 1110 | |
---|
| 1111 | // AMP accuracy |
---|
| 1112 | Int getAMPAcc ( UInt uiDepth ) { return m_iAMPAcc[uiDepth]; } |
---|
| 1113 | Void setAMPAcc ( UInt uiDepth, Int iAccu ) { assert( uiDepth < g_uiMaxCUDepth); m_iAMPAcc[uiDepth] = iAccu; } |
---|
| 1114 | |
---|
| 1115 | // Bit-depth |
---|
| 1116 | Int getBitDepthY() { return m_bitDepthY; } |
---|
| 1117 | Void setBitDepthY(Int u) { m_bitDepthY = u; } |
---|
| 1118 | Int getBitDepthC() { return m_bitDepthC; } |
---|
| 1119 | Void setBitDepthC(Int u) { m_bitDepthC = u; } |
---|
| 1120 | Int getQpBDOffsetY () { return m_qpBDOffsetY; } |
---|
| 1121 | Void setQpBDOffsetY ( Int value ) { m_qpBDOffsetY = value; } |
---|
| 1122 | Int getQpBDOffsetC () { return m_qpBDOffsetC; } |
---|
| 1123 | Void setQpBDOffsetC ( Int value ) { m_qpBDOffsetC = value; } |
---|
| 1124 | Void setUseSAO (Bool bVal) {m_bUseSAO = bVal;} |
---|
| 1125 | Bool getUseSAO () {return m_bUseSAO;} |
---|
| 1126 | |
---|
| 1127 | UInt getMaxTLayers() { return m_uiMaxTLayers; } |
---|
| 1128 | Void setMaxTLayers( UInt uiMaxTLayers ) { assert( uiMaxTLayers <= MAX_TLAYER ); m_uiMaxTLayers = uiMaxTLayers; } |
---|
| 1129 | |
---|
| 1130 | Bool getTemporalIdNestingFlag() { return m_bTemporalIdNestingFlag; } |
---|
| 1131 | Void setTemporalIdNestingFlag( Bool bValue ) { m_bTemporalIdNestingFlag = bValue; } |
---|
| 1132 | UInt getPCMBitDepthLuma () { return m_uiPCMBitDepthLuma; } |
---|
| 1133 | Void setPCMBitDepthLuma ( UInt u ) { m_uiPCMBitDepthLuma = u; } |
---|
| 1134 | UInt getPCMBitDepthChroma () { return m_uiPCMBitDepthChroma; } |
---|
| 1135 | Void setPCMBitDepthChroma ( UInt u ) { m_uiPCMBitDepthChroma = u; } |
---|
| 1136 | Void setPCMFilterDisableFlag ( Bool bValue ) { m_bPCMFilterDisableFlag = bValue; } |
---|
| 1137 | Bool getPCMFilterDisableFlag () { return m_bPCMFilterDisableFlag; } |
---|
| 1138 | |
---|
| 1139 | Bool getScalingListFlag () { return m_scalingListEnabledFlag; } |
---|
| 1140 | Void setScalingListFlag ( Bool b ) { m_scalingListEnabledFlag = b; } |
---|
| 1141 | Bool getScalingListPresentFlag() { return m_scalingListPresentFlag; } |
---|
| 1142 | Void setScalingListPresentFlag( Bool b ) { m_scalingListPresentFlag = b; } |
---|
| 1143 | Void setScalingList ( TComScalingList *scalingList); |
---|
| 1144 | TComScalingList* getScalingList () { return m_scalingList; } //!< get ScalingList class pointer in SPS |
---|
| 1145 | UInt getMaxDecPicBuffering (UInt tlayer) { return m_uiMaxDecPicBuffering[tlayer]; } |
---|
| 1146 | Void setMaxDecPicBuffering ( UInt ui, UInt tlayer ) { m_uiMaxDecPicBuffering[tlayer] = ui; } |
---|
| 1147 | UInt getMaxLatencyIncrease (UInt tlayer) { return m_uiMaxLatencyIncrease[tlayer]; } |
---|
| 1148 | Void setMaxLatencyIncrease ( UInt ui , UInt tlayer) { m_uiMaxLatencyIncrease[tlayer] = ui; } |
---|
| 1149 | |
---|
| 1150 | Void setUseStrongIntraSmoothing (Bool bVal) {m_useStrongIntraSmoothing = bVal;} |
---|
| 1151 | Bool getUseStrongIntraSmoothing () {return m_useStrongIntraSmoothing;} |
---|
| 1152 | |
---|
| 1153 | Bool getVuiParametersPresentFlag() { return m_vuiParametersPresentFlag; } |
---|
| 1154 | Void setVuiParametersPresentFlag(Bool b) { m_vuiParametersPresentFlag = b; } |
---|
| 1155 | TComVUI* getVuiParameters() { return &m_vuiParameters; } |
---|
| 1156 | Void setHrdParameters( UInt frameRate, UInt numDU, UInt bitRate, Bool randomAccess ); |
---|
| 1157 | |
---|
| 1158 | TComPTL* getPTL() { return &m_pcPTL; } |
---|
[446] | 1159 | #if H_MV |
---|
| 1160 | Void setInterViewMvVertConstraintFlag(Bool val) { m_interViewMvVertConstraintFlag = val; } |
---|
| 1161 | Bool getInterViewMvVertConstraintFlag() { return m_interViewMvVertConstraintFlag;} |
---|
[534] | 1162 | |
---|
| 1163 | //// sps_extension_vui_parameters( ) |
---|
| 1164 | Void setNumIlpRestrictedRefLayers ( Int val ) { m_numIlpRestrictedRefLayers = val;} |
---|
| 1165 | Int getNumIlpRestrictedRefLayers ( ) { return m_numIlpRestrictedRefLayers ;} |
---|
| 1166 | |
---|
| 1167 | Void setMinSpatialSegmentOffsetPlus1( Int i, Int val ) { m_minSpatialSegmentOffsetPlus1[ i ] = val;} |
---|
| 1168 | Int getMinSpatialSegmentOffsetPlus1( Int i ) { return m_minSpatialSegmentOffsetPlus1[ i ];} |
---|
| 1169 | |
---|
| 1170 | Void setCtuBasedOffsetEnabledFlag ( Int i, Bool flag ) { m_ctuBasedOffsetEnabledFlag [ i ] = flag;} |
---|
| 1171 | Bool getCtuBasedOffsetEnabledFlag ( Int i ) { return m_ctuBasedOffsetEnabledFlag [ i ];} |
---|
| 1172 | |
---|
| 1173 | Void setMinHorizontalCtuOffsetPlus1 ( Int i, Int val ) { m_minHorizontalCtuOffsetPlus1 [ i ] = val;} |
---|
| 1174 | Int getMinHorizontalCtuOffsetPlus1 ( Int i ) { return m_minHorizontalCtuOffsetPlus1 [ i ];} |
---|
[446] | 1175 | #endif |
---|
[539] | 1176 | #if H_3D_QTLPC |
---|
| 1177 | Void setUseQTL( Bool b ) { m_bUseQTL = b; } |
---|
| 1178 | Bool getUseQTL() { return m_bUseQTL; } |
---|
| 1179 | Void setUsePC ( Bool b ) { m_bUsePC = b; } |
---|
| 1180 | Bool getUsePC () { return m_bUsePC; } |
---|
| 1181 | #endif |
---|
[446] | 1182 | #if H_3D |
---|
| 1183 | Void initCamParaSPS ( UInt uiViewIndex, UInt uiCamParPrecision = 0, Bool bCamParSlice = false, Int** aaiScale = 0, Int** aaiOffset = 0 ); |
---|
| 1184 | UInt getCamParPrecision () { return m_uiCamParPrecision; } |
---|
| 1185 | Bool hasCamParInSliceHeader() { return m_bCamParInSliceHeader; } |
---|
| 1186 | Int* getCodedScale () { return m_aaiCodedScale [0]; } |
---|
| 1187 | Int* getCodedOffset () { return m_aaiCodedOffset[0]; } |
---|
| 1188 | Int* getInvCodedScale () { return m_aaiCodedScale [1]; } |
---|
| 1189 | Int* getInvCodedOffset () { return m_aaiCodedOffset[1]; } |
---|
| 1190 | #endif |
---|
[534] | 1191 | #if H_MV |
---|
| 1192 | Int getLayerId () { return m_layerId; } |
---|
| 1193 | Void setLayerId ( Int val ) { m_layerId = val; } |
---|
| 1194 | #endif |
---|
| 1195 | |
---|
[324] | 1196 | }; |
---|
| 1197 | |
---|
| 1198 | /// Reference Picture Lists class |
---|
| 1199 | class TComRefPicListModification |
---|
| 1200 | { |
---|
| 1201 | private: |
---|
| 1202 | UInt m_bRefPicListModificationFlagL0; |
---|
| 1203 | UInt m_bRefPicListModificationFlagL1; |
---|
| 1204 | UInt m_RefPicSetIdxL0[32]; |
---|
| 1205 | UInt m_RefPicSetIdxL1[32]; |
---|
| 1206 | |
---|
| 1207 | public: |
---|
| 1208 | TComRefPicListModification(); |
---|
| 1209 | virtual ~TComRefPicListModification(); |
---|
| 1210 | |
---|
| 1211 | Void create (); |
---|
| 1212 | Void destroy (); |
---|
| 1213 | |
---|
| 1214 | Bool getRefPicListModificationFlagL0() { return m_bRefPicListModificationFlagL0; } |
---|
| 1215 | Void setRefPicListModificationFlagL0(Bool flag) { m_bRefPicListModificationFlagL0 = flag; } |
---|
| 1216 | Bool getRefPicListModificationFlagL1() { return m_bRefPicListModificationFlagL1; } |
---|
| 1217 | Void setRefPicListModificationFlagL1(Bool flag) { m_bRefPicListModificationFlagL1 = flag; } |
---|
| 1218 | Void setRefPicSetIdxL0(UInt idx, UInt refPicSetIdx) { m_RefPicSetIdxL0[idx] = refPicSetIdx; } |
---|
| 1219 | UInt getRefPicSetIdxL0(UInt idx) { return m_RefPicSetIdxL0[idx]; } |
---|
| 1220 | Void setRefPicSetIdxL1(UInt idx, UInt refPicSetIdx) { m_RefPicSetIdxL1[idx] = refPicSetIdx; } |
---|
| 1221 | UInt getRefPicSetIdxL1(UInt idx) { return m_RefPicSetIdxL1[idx]; } |
---|
[368] | 1222 | #if H_MV |
---|
| 1223 | // Why not an listIdx for all members, would avoid code duplication?? |
---|
[534] | 1224 | Void setRefPicSetIdxL(UInt li, UInt idx, UInt refPicSetIdx) {( li==0 ? m_RefPicSetIdxL0[idx] : m_RefPicSetIdxL1[idx] ) = refPicSetIdx; } |
---|
| 1225 | UInt getRefPicSetIdxL(UInt li, UInt idx ) { return ( li == 0 ) ? m_RefPicSetIdxL0[idx] : m_RefPicSetIdxL1[idx] ; } |
---|
| 1226 | Void setRefPicListModificationFlagL(UInt li, Bool flag) { ( li==0 ? m_bRefPicListModificationFlagL0 : m_bRefPicListModificationFlagL1 ) = flag; } |
---|
| 1227 | Bool getRefPicListModificationFlagL(UInt li ) { return ( li== 0) ? m_bRefPicListModificationFlagL0 : m_bRefPicListModificationFlagL1; } |
---|
[368] | 1228 | #endif |
---|
[324] | 1229 | }; |
---|
| 1230 | |
---|
| 1231 | /// PPS class |
---|
| 1232 | class TComPPS |
---|
| 1233 | { |
---|
| 1234 | private: |
---|
| 1235 | Int m_PPSId; // pic_parameter_set_id |
---|
| 1236 | Int m_SPSId; // seq_parameter_set_id |
---|
| 1237 | Int m_picInitQPMinus26; |
---|
| 1238 | Bool m_useDQP; |
---|
| 1239 | Bool m_bConstrainedIntraPred; // constrained_intra_pred_flag |
---|
| 1240 | Bool m_bSliceChromaQpFlag; // slicelevel_chroma_qp_flag |
---|
| 1241 | |
---|
| 1242 | // access channel |
---|
| 1243 | TComSPS* m_pcSPS; |
---|
| 1244 | UInt m_uiMaxCuDQPDepth; |
---|
| 1245 | UInt m_uiMinCuDQPSize; |
---|
| 1246 | |
---|
| 1247 | Int m_chromaCbQpOffset; |
---|
| 1248 | Int m_chromaCrQpOffset; |
---|
| 1249 | |
---|
| 1250 | UInt m_numRefIdxL0DefaultActive; |
---|
| 1251 | UInt m_numRefIdxL1DefaultActive; |
---|
| 1252 | |
---|
| 1253 | Bool m_bUseWeightPred; // Use of Weighting Prediction (P_SLICE) |
---|
| 1254 | Bool m_useWeightedBiPred; // Use of Weighting Bi-Prediction (B_SLICE) |
---|
| 1255 | Bool m_OutputFlagPresentFlag; // Indicates the presence of output_flag in slice header |
---|
| 1256 | |
---|
| 1257 | Bool m_TransquantBypassEnableFlag; // Indicates presence of cu_transquant_bypass_flag in CUs. |
---|
| 1258 | Bool m_useTransformSkip; |
---|
| 1259 | Bool m_dependentSliceSegmentsEnabledFlag; //!< Indicates the presence of dependent slices |
---|
| 1260 | Bool m_tilesEnabledFlag; //!< Indicates the presence of tiles |
---|
| 1261 | Bool m_entropyCodingSyncEnabledFlag; //!< Indicates the presence of wavefronts |
---|
| 1262 | |
---|
| 1263 | Bool m_loopFilterAcrossTilesEnabledFlag; |
---|
| 1264 | Int m_uniformSpacingFlag; |
---|
| 1265 | Int m_iNumColumnsMinus1; |
---|
| 1266 | UInt* m_puiColumnWidth; |
---|
| 1267 | Int m_iNumRowsMinus1; |
---|
| 1268 | UInt* m_puiRowHeight; |
---|
| 1269 | |
---|
| 1270 | Int m_iNumSubstreams; |
---|
| 1271 | |
---|
| 1272 | Int m_signHideFlag; |
---|
| 1273 | |
---|
| 1274 | Bool m_cabacInitPresentFlag; |
---|
| 1275 | UInt m_encCABACTableIdx; // Used to transmit table selection across slices |
---|
| 1276 | |
---|
| 1277 | Bool m_sliceHeaderExtensionPresentFlag; |
---|
| 1278 | Bool m_loopFilterAcrossSlicesEnabledFlag; |
---|
| 1279 | Bool m_deblockingFilterControlPresentFlag; |
---|
| 1280 | Bool m_deblockingFilterOverrideEnabledFlag; |
---|
| 1281 | Bool m_picDisableDeblockingFilterFlag; |
---|
| 1282 | Int m_deblockingFilterBetaOffsetDiv2; //< beta offset for deblocking filter |
---|
| 1283 | Int m_deblockingFilterTcOffsetDiv2; //< tc offset for deblocking filter |
---|
| 1284 | Bool m_scalingListPresentFlag; |
---|
| 1285 | TComScalingList* m_scalingList; //!< ScalingList class pointer |
---|
| 1286 | Bool m_listsModificationPresentFlag; |
---|
| 1287 | UInt m_log2ParallelMergeLevelMinus2; |
---|
| 1288 | Int m_numExtraSliceHeaderBits; |
---|
| 1289 | |
---|
| 1290 | public: |
---|
| 1291 | TComPPS(); |
---|
| 1292 | virtual ~TComPPS(); |
---|
| 1293 | |
---|
| 1294 | Int getPPSId () { return m_PPSId; } |
---|
| 1295 | Void setPPSId (Int i) { m_PPSId = i; } |
---|
| 1296 | Int getSPSId () { return m_SPSId; } |
---|
| 1297 | Void setSPSId (Int i) { m_SPSId = i; } |
---|
| 1298 | |
---|
| 1299 | Int getPicInitQPMinus26 () { return m_picInitQPMinus26; } |
---|
| 1300 | Void setPicInitQPMinus26 ( Int i ) { m_picInitQPMinus26 = i; } |
---|
| 1301 | Bool getUseDQP () { return m_useDQP; } |
---|
| 1302 | Void setUseDQP ( Bool b ) { m_useDQP = b; } |
---|
| 1303 | Bool getConstrainedIntraPred () { return m_bConstrainedIntraPred; } |
---|
| 1304 | Void setConstrainedIntraPred ( Bool b ) { m_bConstrainedIntraPred = b; } |
---|
| 1305 | Bool getSliceChromaQpFlag () { return m_bSliceChromaQpFlag; } |
---|
| 1306 | Void setSliceChromaQpFlag ( Bool b ) { m_bSliceChromaQpFlag = b; } |
---|
| 1307 | |
---|
| 1308 | Void setSPS ( TComSPS* pcSPS ) { m_pcSPS = pcSPS; } |
---|
| 1309 | TComSPS* getSPS () { return m_pcSPS; } |
---|
| 1310 | Void setMaxCuDQPDepth ( UInt u ) { m_uiMaxCuDQPDepth = u; } |
---|
| 1311 | UInt getMaxCuDQPDepth () { return m_uiMaxCuDQPDepth;} |
---|
| 1312 | Void setMinCuDQPSize ( UInt u ) { m_uiMinCuDQPSize = u; } |
---|
| 1313 | UInt getMinCuDQPSize () { return m_uiMinCuDQPSize; } |
---|
| 1314 | |
---|
| 1315 | Void setChromaCbQpOffset( Int i ) { m_chromaCbQpOffset = i; } |
---|
| 1316 | Int getChromaCbQpOffset() { return m_chromaCbQpOffset; } |
---|
| 1317 | Void setChromaCrQpOffset( Int i ) { m_chromaCrQpOffset = i; } |
---|
| 1318 | Int getChromaCrQpOffset() { return m_chromaCrQpOffset; } |
---|
| 1319 | |
---|
| 1320 | Void setNumRefIdxL0DefaultActive(UInt ui) { m_numRefIdxL0DefaultActive=ui; } |
---|
| 1321 | UInt getNumRefIdxL0DefaultActive() { return m_numRefIdxL0DefaultActive; } |
---|
| 1322 | Void setNumRefIdxL1DefaultActive(UInt ui) { m_numRefIdxL1DefaultActive=ui; } |
---|
| 1323 | UInt getNumRefIdxL1DefaultActive() { return m_numRefIdxL1DefaultActive; } |
---|
| 1324 | |
---|
| 1325 | Bool getUseWP () { return m_bUseWeightPred; } |
---|
| 1326 | Bool getWPBiPred () { return m_useWeightedBiPred; } |
---|
| 1327 | Void setUseWP ( Bool b ) { m_bUseWeightPred = b; } |
---|
| 1328 | Void setWPBiPred ( Bool b ) { m_useWeightedBiPred = b; } |
---|
| 1329 | Void setOutputFlagPresentFlag( Bool b ) { m_OutputFlagPresentFlag = b; } |
---|
| 1330 | Bool getOutputFlagPresentFlag() { return m_OutputFlagPresentFlag; } |
---|
| 1331 | Void setTransquantBypassEnableFlag( Bool b ) { m_TransquantBypassEnableFlag = b; } |
---|
| 1332 | Bool getTransquantBypassEnableFlag() { return m_TransquantBypassEnableFlag; } |
---|
| 1333 | |
---|
| 1334 | Bool getUseTransformSkip () { return m_useTransformSkip; } |
---|
| 1335 | Void setUseTransformSkip ( Bool b ) { m_useTransformSkip = b; } |
---|
| 1336 | |
---|
| 1337 | Void setLoopFilterAcrossTilesEnabledFlag (Bool b) { m_loopFilterAcrossTilesEnabledFlag = b; } |
---|
| 1338 | Bool getLoopFilterAcrossTilesEnabledFlag () { return m_loopFilterAcrossTilesEnabledFlag; } |
---|
| 1339 | Bool getDependentSliceSegmentsEnabledFlag() const { return m_dependentSliceSegmentsEnabledFlag; } |
---|
| 1340 | Void setDependentSliceSegmentsEnabledFlag(Bool val) { m_dependentSliceSegmentsEnabledFlag = val; } |
---|
| 1341 | Bool getTilesEnabledFlag() const { return m_tilesEnabledFlag; } |
---|
| 1342 | Void setTilesEnabledFlag(Bool val) { m_tilesEnabledFlag = val; } |
---|
| 1343 | Bool getEntropyCodingSyncEnabledFlag() const { return m_entropyCodingSyncEnabledFlag; } |
---|
| 1344 | Void setEntropyCodingSyncEnabledFlag(Bool val) { m_entropyCodingSyncEnabledFlag = val; } |
---|
| 1345 | Void setUniformSpacingFlag ( Bool b ) { m_uniformSpacingFlag = b; } |
---|
| 1346 | Bool getUniformSpacingFlag () { return m_uniformSpacingFlag; } |
---|
| 1347 | Void setNumColumnsMinus1 ( Int i ) { m_iNumColumnsMinus1 = i; } |
---|
| 1348 | Int getNumColumnsMinus1 () { return m_iNumColumnsMinus1; } |
---|
| 1349 | Void setColumnWidth ( UInt* columnWidth ) |
---|
| 1350 | { |
---|
| 1351 | if( m_uniformSpacingFlag == 0 && m_iNumColumnsMinus1 > 0 ) |
---|
| 1352 | { |
---|
| 1353 | m_puiColumnWidth = new UInt[ m_iNumColumnsMinus1 ]; |
---|
| 1354 | |
---|
| 1355 | for(Int i=0; i<m_iNumColumnsMinus1; i++) |
---|
| 1356 | { |
---|
| 1357 | m_puiColumnWidth[i] = columnWidth[i]; |
---|
| 1358 | } |
---|
| 1359 | } |
---|
| 1360 | } |
---|
| 1361 | UInt getColumnWidth (UInt columnIdx) { return *( m_puiColumnWidth + columnIdx ); } |
---|
| 1362 | Void setNumRowsMinus1( Int i ) { m_iNumRowsMinus1 = i; } |
---|
| 1363 | Int getNumRowsMinus1() { return m_iNumRowsMinus1; } |
---|
| 1364 | Void setRowHeight ( UInt* rowHeight ) |
---|
| 1365 | { |
---|
| 1366 | if( m_uniformSpacingFlag == 0 && m_iNumRowsMinus1 > 0 ) |
---|
| 1367 | { |
---|
| 1368 | m_puiRowHeight = new UInt[ m_iNumRowsMinus1 ]; |
---|
| 1369 | |
---|
| 1370 | for(Int i=0; i<m_iNumRowsMinus1; i++) |
---|
| 1371 | { |
---|
| 1372 | m_puiRowHeight[i] = rowHeight[i]; |
---|
| 1373 | } |
---|
| 1374 | } |
---|
| 1375 | } |
---|
| 1376 | UInt getRowHeight (UInt rowIdx) { return *( m_puiRowHeight + rowIdx ); } |
---|
| 1377 | Void setNumSubstreams(Int iNumSubstreams) { m_iNumSubstreams = iNumSubstreams; } |
---|
| 1378 | Int getNumSubstreams() { return m_iNumSubstreams; } |
---|
| 1379 | |
---|
| 1380 | Void setSignHideFlag( Int signHideFlag ) { m_signHideFlag = signHideFlag; } |
---|
| 1381 | Int getSignHideFlag() { return m_signHideFlag; } |
---|
| 1382 | |
---|
| 1383 | Void setCabacInitPresentFlag( Bool flag ) { m_cabacInitPresentFlag = flag; } |
---|
| 1384 | Void setEncCABACTableIdx( Int idx ) { m_encCABACTableIdx = idx; } |
---|
| 1385 | Bool getCabacInitPresentFlag() { return m_cabacInitPresentFlag; } |
---|
| 1386 | UInt getEncCABACTableIdx() { return m_encCABACTableIdx; } |
---|
| 1387 | Void setDeblockingFilterControlPresentFlag( Bool val ) { m_deblockingFilterControlPresentFlag = val; } |
---|
| 1388 | Bool getDeblockingFilterControlPresentFlag() { return m_deblockingFilterControlPresentFlag; } |
---|
| 1389 | Void setDeblockingFilterOverrideEnabledFlag( Bool val ) { m_deblockingFilterOverrideEnabledFlag = val; } |
---|
| 1390 | Bool getDeblockingFilterOverrideEnabledFlag() { return m_deblockingFilterOverrideEnabledFlag; } |
---|
| 1391 | Void setPicDisableDeblockingFilterFlag(Bool val) { m_picDisableDeblockingFilterFlag = val; } //!< set offset for deblocking filter disabled |
---|
| 1392 | Bool getPicDisableDeblockingFilterFlag() { return m_picDisableDeblockingFilterFlag; } //!< get offset for deblocking filter disabled |
---|
| 1393 | Void setDeblockingFilterBetaOffsetDiv2(Int val) { m_deblockingFilterBetaOffsetDiv2 = val; } //!< set beta offset for deblocking filter |
---|
| 1394 | Int getDeblockingFilterBetaOffsetDiv2() { return m_deblockingFilterBetaOffsetDiv2; } //!< get beta offset for deblocking filter |
---|
| 1395 | Void setDeblockingFilterTcOffsetDiv2(Int val) { m_deblockingFilterTcOffsetDiv2 = val; } //!< set tc offset for deblocking filter |
---|
| 1396 | Int getDeblockingFilterTcOffsetDiv2() { return m_deblockingFilterTcOffsetDiv2; } //!< get tc offset for deblocking filter |
---|
| 1397 | Bool getScalingListPresentFlag() { return m_scalingListPresentFlag; } |
---|
| 1398 | Void setScalingListPresentFlag( Bool b ) { m_scalingListPresentFlag = b; } |
---|
| 1399 | Void setScalingList ( TComScalingList *scalingList); |
---|
| 1400 | TComScalingList* getScalingList () { return m_scalingList; } //!< get ScalingList class pointer in PPS |
---|
| 1401 | Bool getListsModificationPresentFlag () { return m_listsModificationPresentFlag; } |
---|
| 1402 | Void setListsModificationPresentFlag ( Bool b ) { m_listsModificationPresentFlag = b; } |
---|
| 1403 | UInt getLog2ParallelMergeLevelMinus2 () { return m_log2ParallelMergeLevelMinus2; } |
---|
| 1404 | Void setLog2ParallelMergeLevelMinus2 (UInt mrgLevel) { m_log2ParallelMergeLevelMinus2 = mrgLevel; } |
---|
| 1405 | Int getNumExtraSliceHeaderBits() { return m_numExtraSliceHeaderBits; } |
---|
| 1406 | Void setNumExtraSliceHeaderBits(Int i) { m_numExtraSliceHeaderBits = i; } |
---|
| 1407 | Void setLoopFilterAcrossSlicesEnabledFlag ( Bool bValue ) { m_loopFilterAcrossSlicesEnabledFlag = bValue; } |
---|
| 1408 | Bool getLoopFilterAcrossSlicesEnabledFlag () { return m_loopFilterAcrossSlicesEnabledFlag; } |
---|
| 1409 | Bool getSliceHeaderExtensionPresentFlag () { return m_sliceHeaderExtensionPresentFlag; } |
---|
| 1410 | Void setSliceHeaderExtensionPresentFlag (Bool val) { m_sliceHeaderExtensionPresentFlag = val; } |
---|
| 1411 | }; |
---|
| 1412 | |
---|
| 1413 | typedef struct |
---|
| 1414 | { |
---|
| 1415 | // Explicit weighted prediction parameters parsed in slice header, |
---|
| 1416 | // or Implicit weighted prediction parameters (8 bits depth values). |
---|
| 1417 | Bool bPresentFlag; |
---|
| 1418 | UInt uiLog2WeightDenom; |
---|
| 1419 | Int iWeight; |
---|
| 1420 | Int iOffset; |
---|
| 1421 | |
---|
| 1422 | // Weighted prediction scaling values built from above parameters (bitdepth scaled): |
---|
| 1423 | Int w, o, offset, shift, round; |
---|
| 1424 | } wpScalingParam; |
---|
| 1425 | |
---|
| 1426 | typedef struct |
---|
| 1427 | { |
---|
| 1428 | Int64 iAC; |
---|
| 1429 | Int64 iDC; |
---|
| 1430 | } wpACDCParam; |
---|
| 1431 | |
---|
| 1432 | /// slice header class |
---|
| 1433 | class TComSlice |
---|
| 1434 | { |
---|
| 1435 | |
---|
| 1436 | private: |
---|
| 1437 | // Bitstream writing |
---|
| 1438 | Bool m_saoEnabledFlag; |
---|
| 1439 | Bool m_saoEnabledFlagChroma; ///< SAO Cb&Cr enabled flag |
---|
| 1440 | Int m_iPPSId; ///< picture parameter set ID |
---|
| 1441 | Bool m_PicOutputFlag; ///< pic_output_flag |
---|
| 1442 | Int m_iPOC; |
---|
| 1443 | Int m_iLastIDR; |
---|
| 1444 | static Int m_prevPOC; |
---|
| 1445 | TComReferencePictureSet *m_pcRPS; |
---|
| 1446 | TComReferencePictureSet m_LocalRPS; |
---|
| 1447 | Int m_iBDidx; |
---|
| 1448 | TComRefPicListModification m_RefPicListModification; |
---|
| 1449 | NalUnitType m_eNalUnitType; ///< Nal unit type for the slice |
---|
| 1450 | SliceType m_eSliceType; |
---|
| 1451 | Int m_iSliceQp; |
---|
| 1452 | Bool m_dependentSliceSegmentFlag; |
---|
| 1453 | #if ADAPTIVE_QP_SELECTION |
---|
| 1454 | Int m_iSliceQpBase; |
---|
| 1455 | #endif |
---|
| 1456 | Bool m_deblockingFilterDisable; |
---|
| 1457 | Bool m_deblockingFilterOverrideFlag; //< offsets for deblocking filter inherit from PPS |
---|
| 1458 | Int m_deblockingFilterBetaOffsetDiv2; //< beta offset for deblocking filter |
---|
| 1459 | Int m_deblockingFilterTcOffsetDiv2; //< tc offset for deblocking filter |
---|
[446] | 1460 | Int m_list1IdxToList0Idx[MAX_NUM_REF]; |
---|
| 1461 | Int m_aiNumRefIdx [2]; // for multiple reference of current slice |
---|
[324] | 1462 | |
---|
| 1463 | Bool m_bCheckLDC; |
---|
| 1464 | |
---|
| 1465 | // Data |
---|
| 1466 | Int m_iSliceQpDelta; |
---|
| 1467 | Int m_iSliceQpDeltaCb; |
---|
| 1468 | Int m_iSliceQpDeltaCr; |
---|
| 1469 | TComPic* m_apcRefPicList [2][MAX_NUM_REF+1]; |
---|
| 1470 | Int m_aiRefPOCList [2][MAX_NUM_REF+1]; |
---|
[368] | 1471 | #if H_MV |
---|
| 1472 | Int m_aiRefLayerIdList[2][MAX_NUM_REF+1]; |
---|
| 1473 | #endif |
---|
[324] | 1474 | Bool m_bIsUsedAsLongTerm[2][MAX_NUM_REF+1]; |
---|
| 1475 | Int m_iDepth; |
---|
| 1476 | |
---|
| 1477 | // referenced slice? |
---|
| 1478 | Bool m_bRefenced; |
---|
| 1479 | |
---|
| 1480 | // access channel |
---|
| 1481 | TComVPS* m_pcVPS; |
---|
| 1482 | TComSPS* m_pcSPS; |
---|
| 1483 | TComPPS* m_pcPPS; |
---|
| 1484 | TComPic* m_pcPic; |
---|
| 1485 | #if ADAPTIVE_QP_SELECTION |
---|
| 1486 | TComTrQuant* m_pcTrQuant; |
---|
| 1487 | #endif |
---|
| 1488 | UInt m_colFromL0Flag; // collocated picture from List0 flag |
---|
| 1489 | |
---|
| 1490 | UInt m_colRefIdx; |
---|
| 1491 | UInt m_maxNumMergeCand; |
---|
| 1492 | |
---|
| 1493 | |
---|
| 1494 | #if SAO_CHROMA_LAMBDA |
---|
| 1495 | Double m_dLambdaLuma; |
---|
| 1496 | Double m_dLambdaChroma; |
---|
| 1497 | #else |
---|
| 1498 | Double m_dLambda; |
---|
| 1499 | #endif |
---|
| 1500 | |
---|
| 1501 | Bool m_abEqualRef [2][MAX_NUM_REF][MAX_NUM_REF]; |
---|
| 1502 | UInt m_uiTLayer; |
---|
| 1503 | Bool m_bTLayerSwitchingFlag; |
---|
| 1504 | |
---|
| 1505 | UInt m_sliceMode; |
---|
| 1506 | UInt m_sliceArgument; |
---|
| 1507 | UInt m_sliceCurStartCUAddr; |
---|
| 1508 | UInt m_sliceCurEndCUAddr; |
---|
| 1509 | UInt m_sliceIdx; |
---|
| 1510 | UInt m_sliceSegmentMode; |
---|
| 1511 | UInt m_sliceSegmentArgument; |
---|
| 1512 | UInt m_sliceSegmentCurStartCUAddr; |
---|
| 1513 | UInt m_sliceSegmentCurEndCUAddr; |
---|
| 1514 | Bool m_nextSlice; |
---|
| 1515 | Bool m_nextSliceSegment; |
---|
| 1516 | UInt m_sliceBits; |
---|
| 1517 | UInt m_sliceSegmentBits; |
---|
| 1518 | Bool m_bFinalized; |
---|
| 1519 | |
---|
| 1520 | wpScalingParam m_weightPredTable[2][MAX_NUM_REF][3]; // [REF_PIC_LIST_0 or REF_PIC_LIST_1][refIdx][0:Y, 1:U, 2:V] |
---|
| 1521 | wpACDCParam m_weightACDCParam[3]; // [0:Y, 1:U, 2:V] |
---|
| 1522 | |
---|
| 1523 | std::vector<UInt> m_tileByteLocation; |
---|
| 1524 | UInt m_uiTileOffstForMultES; |
---|
| 1525 | |
---|
| 1526 | UInt* m_puiSubstreamSizes; |
---|
| 1527 | TComScalingList* m_scalingList; //!< pointer of quantization matrix |
---|
| 1528 | Bool m_cabacInitFlag; |
---|
| 1529 | |
---|
| 1530 | Bool m_bLMvdL1Zero; |
---|
| 1531 | Int m_numEntryPointOffsets; |
---|
| 1532 | Bool m_temporalLayerNonReferenceFlag; |
---|
| 1533 | Bool m_LFCrossSliceBoundaryFlag; |
---|
| 1534 | |
---|
| 1535 | Bool m_enableTMVPFlag; |
---|
[368] | 1536 | #if H_MV |
---|
[534] | 1537 | std::vector<TComPic*>* m_refPicSetInterLayer; |
---|
[368] | 1538 | Int m_layerId; |
---|
| 1539 | Int m_viewId; |
---|
| 1540 | #if H_3D |
---|
[446] | 1541 | Int m_viewIndex; |
---|
[368] | 1542 | Bool m_isDepth; |
---|
[535] | 1543 | #endif |
---|
| 1544 | |
---|
| 1545 | // Additional slice header syntax elements |
---|
| 1546 | Bool m_discardableFlag; |
---|
| 1547 | Bool m_interLayerPredEnabledFlag; |
---|
| 1548 | Int m_numInterLayerRefPicsMinus1; |
---|
| 1549 | Int m_interLayerPredLayerIdc [MAX_NUM_LAYERS]; |
---|
| 1550 | Bool m_interLayerSamplePredOnlyFlag; |
---|
| 1551 | Bool m_altCollocatedIndicationFlag; |
---|
| 1552 | Int m_collocatedRefLayerIdx; |
---|
| 1553 | // Additional slice header semantics variables |
---|
| 1554 | Int m_numActiveMotionPredRefLayers; |
---|
| 1555 | Int m_activeMotionPredRefLayerId [ MAX_NUM_LAYER_IDS ]; |
---|
| 1556 | |
---|
[446] | 1557 | Int m_aaiCodedScale [2][MAX_NUM_LAYERS]; |
---|
[499] | 1558 | Int m_aaiCodedOffset[2][MAX_NUM_LAYERS]; |
---|
| 1559 | #if H_3D_TMVP |
---|
| 1560 | Int m_aiAlterRefIdx [2]; |
---|
| 1561 | #endif |
---|
[504] | 1562 | #if H_3D_ARP |
---|
| 1563 | TComList<TComPic*> * m_pBaseViewRefPicList[MAX_NUM_LAYERS]; |
---|
| 1564 | UInt m_nARPStepNum; |
---|
| 1565 | #endif |
---|
| 1566 | #if H_3D_IC |
---|
| 1567 | Bool m_bApplyIC; |
---|
| 1568 | Bool m_icSkipParseFlag; |
---|
| 1569 | #endif |
---|
[542] | 1570 | #if H_3D |
---|
[479] | 1571 | TComPic* m_ivPicsCurrPoc [2][MAX_NUM_LAYERS]; |
---|
[486] | 1572 | Int** m_depthToDisparityB; |
---|
| 1573 | Int** m_depthToDisparityF; |
---|
[368] | 1574 | #endif |
---|
| 1575 | #endif |
---|
[324] | 1576 | public: |
---|
| 1577 | TComSlice(); |
---|
| 1578 | virtual ~TComSlice(); |
---|
| 1579 | Void initSlice (); |
---|
| 1580 | |
---|
| 1581 | Void setVPS ( TComVPS* pcVPS ) { m_pcVPS = pcVPS; } |
---|
| 1582 | TComVPS* getVPS () { return m_pcVPS; } |
---|
| 1583 | Void setSPS ( TComSPS* pcSPS ) { m_pcSPS = pcSPS; } |
---|
| 1584 | TComSPS* getSPS () { return m_pcSPS; } |
---|
| 1585 | |
---|
| 1586 | Void setPPS ( TComPPS* pcPPS ) { assert(pcPPS!=NULL); m_pcPPS = pcPPS; m_iPPSId = pcPPS->getPPSId(); } |
---|
| 1587 | TComPPS* getPPS () { return m_pcPPS; } |
---|
| 1588 | |
---|
| 1589 | #if ADAPTIVE_QP_SELECTION |
---|
| 1590 | Void setTrQuant ( TComTrQuant* pcTrQuant ) { m_pcTrQuant = pcTrQuant; } |
---|
| 1591 | TComTrQuant* getTrQuant () { return m_pcTrQuant; } |
---|
| 1592 | #endif |
---|
| 1593 | |
---|
| 1594 | Void setPPSId ( Int PPSId ) { m_iPPSId = PPSId; } |
---|
| 1595 | Int getPPSId () { return m_iPPSId; } |
---|
| 1596 | Void setPicOutputFlag( Bool b ) { m_PicOutputFlag = b; } |
---|
| 1597 | Bool getPicOutputFlag() { return m_PicOutputFlag; } |
---|
| 1598 | Void setSaoEnabledFlag(Bool s) {m_saoEnabledFlag =s; } |
---|
| 1599 | Bool getSaoEnabledFlag() { return m_saoEnabledFlag; } |
---|
| 1600 | Void setSaoEnabledFlagChroma(Bool s) {m_saoEnabledFlagChroma =s; } //!< set SAO Cb&Cr enabled flag |
---|
| 1601 | Bool getSaoEnabledFlagChroma() { return m_saoEnabledFlagChroma; } //!< get SAO Cb&Cr enabled flag |
---|
| 1602 | Void setRPS ( TComReferencePictureSet *pcRPS ) { m_pcRPS = pcRPS; } |
---|
| 1603 | TComReferencePictureSet* getRPS () { return m_pcRPS; } |
---|
| 1604 | TComReferencePictureSet* getLocalRPS () { return &m_LocalRPS; } |
---|
| 1605 | |
---|
| 1606 | Void setRPSidx ( Int iBDidx ) { m_iBDidx = iBDidx; } |
---|
| 1607 | Int getRPSidx () { return m_iBDidx; } |
---|
| 1608 | Int getPrevPOC () { return m_prevPOC; } |
---|
| 1609 | TComRefPicListModification* getRefPicListModification() { return &m_RefPicListModification; } |
---|
| 1610 | Void setLastIDR(Int iIDRPOC) { m_iLastIDR = iIDRPOC; } |
---|
| 1611 | Int getLastIDR() { return m_iLastIDR; } |
---|
| 1612 | SliceType getSliceType () { return m_eSliceType; } |
---|
| 1613 | Int getPOC () { return m_iPOC; } |
---|
| 1614 | Int getSliceQp () { return m_iSliceQp; } |
---|
| 1615 | Bool getDependentSliceSegmentFlag() const { return m_dependentSliceSegmentFlag; } |
---|
| 1616 | void setDependentSliceSegmentFlag(Bool val) { m_dependentSliceSegmentFlag = val; } |
---|
| 1617 | #if ADAPTIVE_QP_SELECTION |
---|
| 1618 | Int getSliceQpBase () { return m_iSliceQpBase; } |
---|
| 1619 | #endif |
---|
| 1620 | Int getSliceQpDelta () { return m_iSliceQpDelta; } |
---|
| 1621 | Int getSliceQpDeltaCb () { return m_iSliceQpDeltaCb; } |
---|
| 1622 | Int getSliceQpDeltaCr () { return m_iSliceQpDeltaCr; } |
---|
| 1623 | Bool getDeblockingFilterDisable() { return m_deblockingFilterDisable; } |
---|
| 1624 | Bool getDeblockingFilterOverrideFlag() { return m_deblockingFilterOverrideFlag; } |
---|
| 1625 | Int getDeblockingFilterBetaOffsetDiv2() { return m_deblockingFilterBetaOffsetDiv2; } |
---|
| 1626 | Int getDeblockingFilterTcOffsetDiv2() { return m_deblockingFilterTcOffsetDiv2; } |
---|
| 1627 | |
---|
| 1628 | Int getNumRefIdx ( RefPicList e ) { return m_aiNumRefIdx[e]; } |
---|
| 1629 | TComPic* getPic () { return m_pcPic; } |
---|
| 1630 | TComPic* getRefPic ( RefPicList e, Int iRefIdx) { return m_apcRefPicList[e][iRefIdx]; } |
---|
| 1631 | Int getRefPOC ( RefPicList e, Int iRefIdx) { return m_aiRefPOCList[e][iRefIdx]; } |
---|
[542] | 1632 | #if H_3D |
---|
[479] | 1633 | TComPic* getIvPic ( Bool depthFlag, Int viewIndex){ return m_ivPicsCurrPoc[ depthFlag ? 1 : 0 ][ viewIndex ]; } |
---|
| 1634 | #endif |
---|
[476] | 1635 | #if H_3D_IV_MERGE |
---|
[479] | 1636 | TComPic* getTexturePic () { return m_ivPicsCurrPoc[0][ m_viewIndex ]; } |
---|
[476] | 1637 | #endif |
---|
[504] | 1638 | #if H_3D_IC |
---|
| 1639 | Void setApplyIC( Bool b ) { m_bApplyIC = b; } |
---|
| 1640 | Bool getApplyIC() { return m_bApplyIC; } |
---|
| 1641 | Void xSetApplyIC(); |
---|
| 1642 | Void setIcSkipParseFlag( Bool b ) { m_icSkipParseFlag = b; } |
---|
| 1643 | Bool getIcSkipParseFlag() { return m_icSkipParseFlag; } |
---|
| 1644 | #endif |
---|
| 1645 | #if H_3D_ARP |
---|
| 1646 | Void setBaseViewRefPicList( TComList<TComPic*> *pListPic, Int iViewIdx ) { m_pBaseViewRefPicList[iViewIdx] = pListPic; } |
---|
| 1647 | Void setARPStepNum(); |
---|
| 1648 | TComPic* getBaseViewRefPic ( UInt uiPOC , Int iViewIdx ) { return xGetRefPic( *m_pBaseViewRefPicList[iViewIdx], uiPOC ); } |
---|
| 1649 | UInt getARPStepNum( ) { return m_nARPStepNum; } |
---|
| 1650 | #endif |
---|
[324] | 1651 | Int getDepth () { return m_iDepth; } |
---|
| 1652 | UInt getColFromL0Flag () { return m_colFromL0Flag; } |
---|
| 1653 | UInt getColRefIdx () { return m_colRefIdx; } |
---|
| 1654 | Void checkColRefIdx (UInt curSliceIdx, TComPic* pic); |
---|
| 1655 | Bool getIsUsedAsLongTerm (Int i, Int j) { return m_bIsUsedAsLongTerm[i][j]; } |
---|
| 1656 | Bool getCheckLDC () { return m_bCheckLDC; } |
---|
| 1657 | Bool getMvdL1ZeroFlag () { return m_bLMvdL1Zero; } |
---|
| 1658 | Int getNumRpsCurrTempList(); |
---|
[446] | 1659 | Int getList1IdxToList0Idx ( Int list1Idx ) { return m_list1IdxToList0Idx[list1Idx]; } |
---|
[324] | 1660 | Void setReferenced(Bool b) { m_bRefenced = b; } |
---|
| 1661 | Bool isReferenced() { return m_bRefenced; } |
---|
| 1662 | Void setPOC ( Int i ) { m_iPOC = i; if(getTLayer()==0) m_prevPOC=i; } |
---|
| 1663 | Void setNalUnitType ( NalUnitType e ) { m_eNalUnitType = e; } |
---|
[446] | 1664 | NalUnitType getNalUnitType () const { return m_eNalUnitType; } |
---|
[324] | 1665 | Bool getRapPicFlag (); |
---|
[446] | 1666 | Bool getIdrPicFlag () { return getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP; } |
---|
| 1667 | Bool isIRAP () const { return (getNalUnitType() >= 16) && (getNalUnitType() <= 23); } |
---|
| 1668 | Void checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, Bool& prevRAPisBLA, TComList<TComPic *>& rcListPic); |
---|
[324] | 1669 | Void decodingRefreshMarking(Int& pocCRA, Bool& bRefreshPending, TComList<TComPic*>& rcListPic); |
---|
| 1670 | Void setSliceType ( SliceType e ) { m_eSliceType = e; } |
---|
| 1671 | Void setSliceQp ( Int i ) { m_iSliceQp = i; } |
---|
| 1672 | #if ADAPTIVE_QP_SELECTION |
---|
| 1673 | Void setSliceQpBase ( Int i ) { m_iSliceQpBase = i; } |
---|
| 1674 | #endif |
---|
| 1675 | Void setSliceQpDelta ( Int i ) { m_iSliceQpDelta = i; } |
---|
| 1676 | Void setSliceQpDeltaCb ( Int i ) { m_iSliceQpDeltaCb = i; } |
---|
| 1677 | Void setSliceQpDeltaCr ( Int i ) { m_iSliceQpDeltaCr = i; } |
---|
| 1678 | Void setDeblockingFilterDisable( Bool b ) { m_deblockingFilterDisable= b; } |
---|
| 1679 | Void setDeblockingFilterOverrideFlag( Bool b ) { m_deblockingFilterOverrideFlag = b; } |
---|
| 1680 | Void setDeblockingFilterBetaOffsetDiv2( Int i ) { m_deblockingFilterBetaOffsetDiv2 = i; } |
---|
| 1681 | Void setDeblockingFilterTcOffsetDiv2( Int i ) { m_deblockingFilterTcOffsetDiv2 = i; } |
---|
| 1682 | |
---|
| 1683 | Void setRefPic ( TComPic* p, RefPicList e, Int iRefIdx ) { m_apcRefPicList[e][iRefIdx] = p; } |
---|
| 1684 | Void setRefPOC ( Int i, RefPicList e, Int iRefIdx ) { m_aiRefPOCList[e][iRefIdx] = i; } |
---|
| 1685 | Void setNumRefIdx ( RefPicList e, Int i ) { m_aiNumRefIdx[e] = i; } |
---|
| 1686 | Void setPic ( TComPic* p ) { m_pcPic = p; } |
---|
| 1687 | Void setDepth ( Int iDepth ) { m_iDepth = iDepth; } |
---|
| 1688 | |
---|
[368] | 1689 | #if H_MV |
---|
| 1690 | Int getRefLayerId ( RefPicList e, Int iRefIdx) { return m_aiRefLayerIdList[e][iRefIdx]; } |
---|
| 1691 | Void setRefLayerId ( Int i, RefPicList e, Int iRefIdx ) { m_aiRefLayerIdList[e][iRefIdx] = i; } |
---|
| 1692 | #endif |
---|
| 1693 | #if H_MV |
---|
[446] | 1694 | Void setRefPicList ( TComList<TComPic*>& rcListPic, std::vector<TComPic*>& interLayerRefPicSet , Bool checkNumPocTotalCurr = false ); |
---|
[368] | 1695 | #else |
---|
[446] | 1696 | #if FIX1071 |
---|
| 1697 | Void setRefPicList ( TComList<TComPic*>& rcListPic, Bool checkNumPocTotalCurr = false ); |
---|
| 1698 | #else |
---|
[324] | 1699 | Void setRefPicList ( TComList<TComPic*>& rcListPic ); |
---|
| 1700 | #endif |
---|
[446] | 1701 | #endif |
---|
[324] | 1702 | Void setRefPOCList (); |
---|
| 1703 | Void setColFromL0Flag ( UInt colFromL0 ) { m_colFromL0Flag = colFromL0; } |
---|
| 1704 | Void setColRefIdx ( UInt refIdx) { m_colRefIdx = refIdx; } |
---|
| 1705 | Void setCheckLDC ( Bool b ) { m_bCheckLDC = b; } |
---|
| 1706 | Void setMvdL1ZeroFlag ( Bool b) { m_bLMvdL1Zero = b; } |
---|
| 1707 | |
---|
| 1708 | Bool isIntra () { return m_eSliceType == I_SLICE; } |
---|
| 1709 | Bool isInterB () { return m_eSliceType == B_SLICE; } |
---|
| 1710 | Bool isInterP () { return m_eSliceType == P_SLICE; } |
---|
| 1711 | |
---|
| 1712 | #if SAO_CHROMA_LAMBDA |
---|
| 1713 | Void setLambda( Double d, Double e ) { m_dLambdaLuma = d; m_dLambdaChroma = e;} |
---|
| 1714 | Double getLambdaLuma() { return m_dLambdaLuma; } |
---|
| 1715 | Double getLambdaChroma() { return m_dLambdaChroma; } |
---|
| 1716 | #else |
---|
| 1717 | Void setLambda( Double d ) { m_dLambda = d; } |
---|
| 1718 | Double getLambda() { return m_dLambda; } |
---|
| 1719 | #endif |
---|
| 1720 | |
---|
| 1721 | Void initEqualRef(); |
---|
| 1722 | Bool isEqualRef ( RefPicList e, Int iRefIdx1, Int iRefIdx2 ) |
---|
| 1723 | { |
---|
| 1724 | if (iRefIdx1 < 0 || iRefIdx2 < 0) return false; |
---|
| 1725 | return m_abEqualRef[e][iRefIdx1][iRefIdx2]; |
---|
| 1726 | } |
---|
| 1727 | |
---|
| 1728 | Void setEqualRef( RefPicList e, Int iRefIdx1, Int iRefIdx2, Bool b) |
---|
| 1729 | { |
---|
| 1730 | m_abEqualRef[e][iRefIdx1][iRefIdx2] = m_abEqualRef[e][iRefIdx2][iRefIdx1] = b; |
---|
| 1731 | } |
---|
| 1732 | |
---|
| 1733 | static Void sortPicList ( TComList<TComPic*>& rcListPic ); |
---|
[446] | 1734 | Void setList1IdxToList0Idx(); |
---|
[324] | 1735 | |
---|
| 1736 | UInt getTLayer () { return m_uiTLayer; } |
---|
| 1737 | Void setTLayer ( UInt uiTLayer ) { m_uiTLayer = uiTLayer; } |
---|
| 1738 | |
---|
| 1739 | Void setTLayerInfo( UInt uiTLayer ); |
---|
| 1740 | Void decodingMarking( TComList<TComPic*>& rcListPic, Int iGOPSIze, Int& iMaxRefPicNum ); |
---|
| 1741 | Void applyReferencePictureSet( TComList<TComPic*>& rcListPic, TComReferencePictureSet *RPSList); |
---|
[368] | 1742 | #if H_MV |
---|
| 1743 | Void createAndApplyIvReferencePictureSet( TComPicLists* ivPicLists, std::vector<TComPic*>& refPicSetInterLayer ); |
---|
| 1744 | static Void markIvRefPicsAsShortTerm ( std::vector<TComPic*> refPicSetInterLayer ); |
---|
[534] | 1745 | static Void markCurrPic ( TComPic* currPic );; |
---|
[368] | 1746 | static Void markIvRefPicsAsUnused ( TComPicLists* ivPicLists, std::vector<Int> targetDecLayerIdSet, TComVPS* vps, Int curLayerId, Int curPoc ); |
---|
[537] | 1747 | Void xPrintRefPicList(); |
---|
[368] | 1748 | #endif |
---|
[324] | 1749 | Bool isTemporalLayerSwitchingPoint( TComList<TComPic*>& rcListPic ); |
---|
| 1750 | Bool isStepwiseTemporalLayerSwitchingPointCandidate( TComList<TComPic*>& rcListPic ); |
---|
| 1751 | Int checkThatAllRefPicsAreAvailable( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool printErrors, Int pocRandomAccess = 0); |
---|
[537] | 1752 | #if FIX1071 |
---|
[521] | 1753 | Void createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool isRAP); |
---|
| 1754 | #else |
---|
[324] | 1755 | Void createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet); |
---|
[521] | 1756 | #endif |
---|
[324] | 1757 | |
---|
| 1758 | Void setMaxNumMergeCand (UInt val ) { m_maxNumMergeCand = val; } |
---|
| 1759 | UInt getMaxNumMergeCand () { return m_maxNumMergeCand; } |
---|
| 1760 | |
---|
| 1761 | Void setSliceMode ( UInt uiMode ) { m_sliceMode = uiMode; } |
---|
| 1762 | UInt getSliceMode () { return m_sliceMode; } |
---|
| 1763 | Void setSliceArgument ( UInt uiArgument ) { m_sliceArgument = uiArgument; } |
---|
| 1764 | UInt getSliceArgument () { return m_sliceArgument; } |
---|
| 1765 | Void setSliceCurStartCUAddr ( UInt uiAddr ) { m_sliceCurStartCUAddr = uiAddr; } |
---|
| 1766 | UInt getSliceCurStartCUAddr () { return m_sliceCurStartCUAddr; } |
---|
| 1767 | Void setSliceCurEndCUAddr ( UInt uiAddr ) { m_sliceCurEndCUAddr = uiAddr; } |
---|
| 1768 | UInt getSliceCurEndCUAddr () { return m_sliceCurEndCUAddr; } |
---|
| 1769 | Void setSliceIdx ( UInt i) { m_sliceIdx = i; } |
---|
| 1770 | UInt getSliceIdx () { return m_sliceIdx; } |
---|
| 1771 | Void copySliceInfo (TComSlice *pcSliceSrc); |
---|
| 1772 | Void setSliceSegmentMode ( UInt uiMode ) { m_sliceSegmentMode = uiMode; } |
---|
| 1773 | UInt getSliceSegmentMode () { return m_sliceSegmentMode; } |
---|
| 1774 | Void setSliceSegmentArgument ( UInt uiArgument ) { m_sliceSegmentArgument = uiArgument; } |
---|
| 1775 | UInt getSliceSegmentArgument () { return m_sliceSegmentArgument; } |
---|
| 1776 | Void setSliceSegmentCurStartCUAddr ( UInt uiAddr ) { m_sliceSegmentCurStartCUAddr = uiAddr; } |
---|
| 1777 | UInt getSliceSegmentCurStartCUAddr () { return m_sliceSegmentCurStartCUAddr; } |
---|
| 1778 | Void setSliceSegmentCurEndCUAddr ( UInt uiAddr ) { m_sliceSegmentCurEndCUAddr = uiAddr; } |
---|
| 1779 | UInt getSliceSegmentCurEndCUAddr () { return m_sliceSegmentCurEndCUAddr; } |
---|
| 1780 | Void setNextSlice ( Bool b ) { m_nextSlice = b; } |
---|
| 1781 | Bool isNextSlice () { return m_nextSlice; } |
---|
| 1782 | Void setNextSliceSegment ( Bool b ) { m_nextSliceSegment = b; } |
---|
| 1783 | Bool isNextSliceSegment () { return m_nextSliceSegment; } |
---|
| 1784 | Void setSliceBits ( UInt uiVal ) { m_sliceBits = uiVal; } |
---|
| 1785 | UInt getSliceBits () { return m_sliceBits; } |
---|
| 1786 | Void setSliceSegmentBits ( UInt uiVal ) { m_sliceSegmentBits = uiVal; } |
---|
| 1787 | UInt getSliceSegmentBits () { return m_sliceSegmentBits; } |
---|
| 1788 | Void setFinalized ( Bool uiVal ) { m_bFinalized = uiVal; } |
---|
| 1789 | Bool getFinalized () { return m_bFinalized; } |
---|
| 1790 | Void setWpScaling ( wpScalingParam wp[2][MAX_NUM_REF][3] ) { memcpy(m_weightPredTable, wp, sizeof(wpScalingParam)*2*MAX_NUM_REF*3); } |
---|
| 1791 | Void getWpScaling ( RefPicList e, Int iRefIdx, wpScalingParam *&wp); |
---|
| 1792 | |
---|
[446] | 1793 | Void resetWpScaling (); |
---|
[324] | 1794 | Void initWpScaling (); |
---|
| 1795 | inline Bool applyWP () { return( (m_eSliceType==P_SLICE && m_pcPPS->getUseWP()) || (m_eSliceType==B_SLICE && m_pcPPS->getWPBiPred()) ); } |
---|
| 1796 | |
---|
| 1797 | Void setWpAcDcParam ( wpACDCParam wp[3] ) { memcpy(m_weightACDCParam, wp, sizeof(wpACDCParam)*3); } |
---|
| 1798 | Void getWpAcDcParam ( wpACDCParam *&wp ); |
---|
| 1799 | Void initWpAcDcParam (); |
---|
| 1800 | |
---|
| 1801 | Void setTileLocationCount ( UInt cnt ) { return m_tileByteLocation.resize(cnt); } |
---|
| 1802 | UInt getTileLocationCount () { return (UInt) m_tileByteLocation.size(); } |
---|
| 1803 | Void setTileLocation ( Int idx, UInt location ) { assert (idx<m_tileByteLocation.size()); |
---|
| 1804 | m_tileByteLocation[idx] = location; } |
---|
| 1805 | Void addTileLocation ( UInt location ) { m_tileByteLocation.push_back(location); } |
---|
| 1806 | UInt getTileLocation ( Int idx ) { return m_tileByteLocation[idx]; } |
---|
| 1807 | |
---|
| 1808 | Void setTileOffstForMultES (UInt uiOffset ) { m_uiTileOffstForMultES = uiOffset; } |
---|
| 1809 | UInt getTileOffstForMultES () { return m_uiTileOffstForMultES; } |
---|
| 1810 | Void allocSubstreamSizes ( UInt uiNumSubstreams ); |
---|
| 1811 | UInt* getSubstreamSizes () { return m_puiSubstreamSizes; } |
---|
| 1812 | Void setScalingList ( TComScalingList* scalingList ) { m_scalingList = scalingList; } |
---|
| 1813 | TComScalingList* getScalingList () { return m_scalingList; } |
---|
| 1814 | Void setDefaultScalingList (); |
---|
| 1815 | Bool checkDefaultScalingList (); |
---|
| 1816 | Void setCabacInitFlag ( Bool val ) { m_cabacInitFlag = val; } //!< set CABAC initial flag |
---|
| 1817 | Bool getCabacInitFlag () { return m_cabacInitFlag; } //!< get CABAC initial flag |
---|
| 1818 | Void setNumEntryPointOffsets(Int val) { m_numEntryPointOffsets = val; } |
---|
| 1819 | Int getNumEntryPointOffsets() { return m_numEntryPointOffsets; } |
---|
| 1820 | Bool getTemporalLayerNonReferenceFlag() { return m_temporalLayerNonReferenceFlag;} |
---|
| 1821 | Void setTemporalLayerNonReferenceFlag(Bool x) { m_temporalLayerNonReferenceFlag = x;} |
---|
| 1822 | Void setLFCrossSliceBoundaryFlag ( Bool val ) { m_LFCrossSliceBoundaryFlag = val; } |
---|
| 1823 | Bool getLFCrossSliceBoundaryFlag () { return m_LFCrossSliceBoundaryFlag;} |
---|
| 1824 | |
---|
| 1825 | Void setEnableTMVPFlag ( Bool b ) { m_enableTMVPFlag = b; } |
---|
| 1826 | Bool getEnableTMVPFlag () { return m_enableTMVPFlag;} |
---|
| 1827 | |
---|
[368] | 1828 | #if H_MV |
---|
| 1829 | Void setLayerId ( Int layerId ) { m_layerId = layerId; } |
---|
| 1830 | Int getLayerId () { return m_layerId; } |
---|
| 1831 | Int getLayerIdInVps () { return getVPS()->getLayerIdInVps( m_layerId ); }; |
---|
| 1832 | Void setViewId ( Int viewId ) { m_viewId = viewId; } |
---|
| 1833 | Int getViewId () { return m_viewId; } |
---|
| 1834 | #if H_3D |
---|
[499] | 1835 | #if H_3D_TMVP |
---|
| 1836 | Void generateAlterRefforTMVP (); |
---|
| 1837 | Void setAlterRefIdx ( RefPicList e, Int i ) { m_aiAlterRefIdx[e] = i; } |
---|
| 1838 | Int getAlterRefIdx ( RefPicList e ) { return m_aiAlterRefIdx[e]; } |
---|
| 1839 | #endif |
---|
[446] | 1840 | Void setViewIndex ( Int viewIndex ) { m_viewIndex = viewIndex; } |
---|
| 1841 | Int getViewIndex () { return m_viewIndex; } |
---|
[368] | 1842 | Void setIsDepth ( Bool isDepth ) { m_isDepth = isDepth; } |
---|
| 1843 | Bool getIsDepth () { return m_isDepth; } |
---|
[446] | 1844 | Void setCamparaSlice ( Int** aaiScale = 0, Int** aaiOffset = 0 ); |
---|
| 1845 | Int* getCodedScale () { return m_aaiCodedScale [0]; } |
---|
| 1846 | Int* getCodedOffset () { return m_aaiCodedOffset[0]; } |
---|
| 1847 | Int* getInvCodedScale () { return m_aaiCodedScale [1]; } |
---|
| 1848 | Int* getInvCodedOffset () { return m_aaiCodedOffset[1]; } |
---|
[368] | 1849 | #endif |
---|
| 1850 | #endif |
---|
[542] | 1851 | #if H_3D |
---|
[479] | 1852 | Void setIvPicLists( TComPicLists* m_ivPicLists ); |
---|
[486] | 1853 | Void setDepthToDisparityLUTs(); |
---|
| 1854 | |
---|
| 1855 | Int* getDepthToDisparityB( Int refViewIdx ) { return m_depthToDisparityB[ refViewIdx ]; }; |
---|
| 1856 | Int* getDepthToDisparityF( Int refViewIdx ) { return m_depthToDisparityF[ refViewIdx ]; }; |
---|
[531] | 1857 | Bool getVpsDepthModesFlag () { return getVPS()->getVpsDepthModesFlag( getVPS()->getLayerIdInVps( m_layerId ) ); } |
---|
| 1858 | |
---|
[479] | 1859 | #endif |
---|
[534] | 1860 | #if H_MV |
---|
| 1861 | // Additional slice header syntax elements |
---|
| 1862 | Void setDiscardableFlag( Bool flag ) { m_discardableFlag = flag; } |
---|
| 1863 | Bool getDiscardableFlag( ) { return m_discardableFlag; } |
---|
[479] | 1864 | |
---|
[534] | 1865 | Void setInterLayerPredEnabledFlag( Bool flag ) { m_interLayerPredEnabledFlag = flag; } |
---|
| 1866 | Bool getInterLayerPredEnabledFlag( ) { return m_interLayerPredEnabledFlag; } |
---|
| 1867 | |
---|
| 1868 | Void setNumInterLayerRefPicsMinus1( Int val ) { m_numInterLayerRefPicsMinus1 = val; } |
---|
| 1869 | Int getNumInterLayerRefPicsMinus1( ) { return m_numInterLayerRefPicsMinus1; } |
---|
| 1870 | |
---|
| 1871 | Void setInterLayerPredLayerIdc( Int i, Int val ) { m_interLayerPredLayerIdc[i] = val; } |
---|
| 1872 | Int getInterLayerPredLayerIdc( Int i ) { return m_interLayerPredLayerIdc[i]; } |
---|
| 1873 | |
---|
| 1874 | Void setInterLayerSamplePredOnlyFlag( Bool flag ) { m_interLayerSamplePredOnlyFlag = flag; } |
---|
| 1875 | Bool getInterLayerSamplePredOnlyFlag( ) { return m_interLayerSamplePredOnlyFlag; } |
---|
| 1876 | |
---|
| 1877 | Void setAltCollocatedIndicationFlag( Bool flag ) { m_altCollocatedIndicationFlag = flag; } |
---|
| 1878 | Bool getAltCollocatedIndicationFlag( ) { return m_altCollocatedIndicationFlag; } |
---|
| 1879 | |
---|
| 1880 | Void setCollocatedRefLayerIdx( Int val ) { m_collocatedRefLayerIdx = val; } |
---|
| 1881 | Int getCollocatedRefLayerIdx( ) { return m_collocatedRefLayerIdx; } |
---|
| 1882 | |
---|
| 1883 | // Additional variables derived in slice header semantics |
---|
| 1884 | Int getNumInterLayerRefPicsMinus1Len( ) { return xCeilLog2( getVPS()->getNumDirectRefLayers( getLayerIdInVps() )); } |
---|
| 1885 | Int getInterLayerPredLayerIdcLen ( ) { return xCeilLog2( getVPS()->getNumDirectRefLayers( getLayerIdInVps() )); } |
---|
| 1886 | |
---|
| 1887 | Int getNumActiveRefLayerPics( ); |
---|
| 1888 | Int getRefPicLayerId ( Int i ); |
---|
| 1889 | |
---|
| 1890 | Void setActiveMotionPredRefLayers ( ); |
---|
| 1891 | |
---|
| 1892 | Int getNumActiveMotionPredRefLayers( ) { return m_numActiveMotionPredRefLayers; } |
---|
| 1893 | Int getActiveMotionPredRefLayerId ( Int i ) { return m_activeMotionPredRefLayerId[i]; } |
---|
| 1894 | |
---|
| 1895 | Bool getInterRefEnabledInRPLFlag( ); |
---|
| 1896 | |
---|
| 1897 | Void setRefPicSetInterLayer ( std::vector<TComPic*>* m_refPicSetInterLayer ); |
---|
| 1898 | TComPic* getPicFromRefPicSetInterLayer( Int layerId ); |
---|
| 1899 | |
---|
| 1900 | #endif |
---|
[324] | 1901 | protected: |
---|
| 1902 | TComPic* xGetRefPic (TComList<TComPic*>& rcListPic, |
---|
| 1903 | Int poc); |
---|
[446] | 1904 | TComPic* xGetLongTermRefPic(TComList<TComPic*>& rcListPic, Int poc, Bool pocHasMsb); |
---|
[368] | 1905 | #if H_MV |
---|
[534] | 1906 | Int xCeilLog2( Int val ); |
---|
[479] | 1907 | TComPic* xGetInterLayerRefPic( std::vector<TComPic*>& rcListIlPic, Int layerId ); |
---|
[368] | 1908 | #endif |
---|
[324] | 1909 | };// END CLASS DEFINITION TComSlice |
---|
| 1910 | |
---|
| 1911 | |
---|
| 1912 | template <class T> class ParameterSetMap |
---|
| 1913 | { |
---|
| 1914 | public: |
---|
| 1915 | ParameterSetMap(Int maxId) |
---|
| 1916 | :m_maxId (maxId) |
---|
| 1917 | {} |
---|
| 1918 | |
---|
| 1919 | ~ParameterSetMap() |
---|
| 1920 | { |
---|
| 1921 | for (typename std::map<Int,T *>::iterator i = m_paramsetMap.begin(); i!= m_paramsetMap.end(); i++) |
---|
| 1922 | { |
---|
| 1923 | delete (*i).second; |
---|
| 1924 | } |
---|
| 1925 | } |
---|
| 1926 | |
---|
| 1927 | Void storePS(Int psId, T *ps) |
---|
| 1928 | { |
---|
| 1929 | assert ( psId < m_maxId ); |
---|
| 1930 | if ( m_paramsetMap.find(psId) != m_paramsetMap.end() ) |
---|
| 1931 | { |
---|
| 1932 | delete m_paramsetMap[psId]; |
---|
| 1933 | } |
---|
| 1934 | m_paramsetMap[psId] = ps; |
---|
| 1935 | } |
---|
| 1936 | |
---|
| 1937 | Void mergePSList(ParameterSetMap<T> &rPsList) |
---|
| 1938 | { |
---|
| 1939 | for (typename std::map<Int,T *>::iterator i = rPsList.m_paramsetMap.begin(); i!= rPsList.m_paramsetMap.end(); i++) |
---|
| 1940 | { |
---|
| 1941 | storePS(i->first, i->second); |
---|
| 1942 | } |
---|
| 1943 | rPsList.m_paramsetMap.clear(); |
---|
| 1944 | } |
---|
| 1945 | |
---|
| 1946 | |
---|
| 1947 | T* getPS(Int psId) |
---|
| 1948 | { |
---|
| 1949 | return ( m_paramsetMap.find(psId) == m_paramsetMap.end() ) ? NULL : m_paramsetMap[psId]; |
---|
| 1950 | } |
---|
| 1951 | |
---|
| 1952 | T* getFirstPS() |
---|
| 1953 | { |
---|
| 1954 | return (m_paramsetMap.begin() == m_paramsetMap.end() ) ? NULL : m_paramsetMap.begin()->second; |
---|
| 1955 | } |
---|
| 1956 | |
---|
| 1957 | private: |
---|
| 1958 | std::map<Int,T *> m_paramsetMap; |
---|
| 1959 | Int m_maxId; |
---|
| 1960 | }; |
---|
| 1961 | |
---|
| 1962 | class ParameterSetManager |
---|
| 1963 | { |
---|
| 1964 | public: |
---|
| 1965 | ParameterSetManager(); |
---|
| 1966 | virtual ~ParameterSetManager(); |
---|
| 1967 | |
---|
| 1968 | //! store sequence parameter set and take ownership of it |
---|
| 1969 | Void storeVPS(TComVPS *vps) { m_vpsMap.storePS( vps->getVPSId(), vps); }; |
---|
| 1970 | //! get pointer to existing video parameter set |
---|
| 1971 | TComVPS* getVPS(Int vpsId) { return m_vpsMap.getPS(vpsId); }; |
---|
| 1972 | TComVPS* getFirstVPS() { return m_vpsMap.getFirstPS(); }; |
---|
| 1973 | |
---|
| 1974 | //! store sequence parameter set and take ownership of it |
---|
| 1975 | Void storeSPS(TComSPS *sps) { m_spsMap.storePS( sps->getSPSId(), sps); }; |
---|
| 1976 | //! get pointer to existing sequence parameter set |
---|
| 1977 | TComSPS* getSPS(Int spsId) { return m_spsMap.getPS(spsId); }; |
---|
| 1978 | TComSPS* getFirstSPS() { return m_spsMap.getFirstPS(); }; |
---|
| 1979 | |
---|
| 1980 | //! store picture parameter set and take ownership of it |
---|
| 1981 | Void storePPS(TComPPS *pps) { m_ppsMap.storePS( pps->getPPSId(), pps); }; |
---|
| 1982 | //! get pointer to existing picture parameter set |
---|
| 1983 | TComPPS* getPPS(Int ppsId) { return m_ppsMap.getPS(ppsId); }; |
---|
| 1984 | TComPPS* getFirstPPS() { return m_ppsMap.getFirstPS(); }; |
---|
| 1985 | |
---|
| 1986 | //! activate a SPS from a active parameter sets SEI message |
---|
| 1987 | //! \returns true, if activation is successful |
---|
| 1988 | Bool activateSPSWithSEI(Int SPSId); |
---|
| 1989 | |
---|
| 1990 | //! activate a PPS and depending on isIDR parameter also SPS and VPS |
---|
| 1991 | //! \returns true, if activation is successful |
---|
[446] | 1992 | Bool activatePPS(Int ppsId, Bool isIRAP); |
---|
[324] | 1993 | |
---|
| 1994 | TComVPS* getActiveVPS(){ return m_vpsMap.getPS(m_activeVPSId); }; |
---|
| 1995 | TComSPS* getActiveSPS(){ return m_spsMap.getPS(m_activeSPSId); }; |
---|
| 1996 | TComPPS* getActivePPS(){ return m_ppsMap.getPS(m_activePPSId); }; |
---|
| 1997 | |
---|
| 1998 | protected: |
---|
| 1999 | |
---|
| 2000 | ParameterSetMap<TComVPS> m_vpsMap; |
---|
| 2001 | ParameterSetMap<TComSPS> m_spsMap; |
---|
| 2002 | ParameterSetMap<TComPPS> m_ppsMap; |
---|
| 2003 | |
---|
| 2004 | Int m_activeVPSId; |
---|
| 2005 | Int m_activeSPSId; |
---|
| 2006 | Int m_activePPSId; |
---|
| 2007 | }; |
---|
| 2008 | |
---|
| 2009 | //! \} |
---|
| 2010 | |
---|
| 2011 | #endif // __TCOMSLICE__ |
---|