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