| 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-2012, 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; |
|---|
| 53 | #if DEPTH_MAP_GENERATION |
|---|
| 54 | class TComDepthMapGenerator; |
|---|
| 55 | #endif |
|---|
| 56 | #if HHI_INTER_VIEW_RESIDUAL_PRED |
|---|
| 57 | class TComResidualGenerator; |
|---|
| 58 | #endif |
|---|
| 59 | // ==================================================================================================================== |
|---|
| 60 | // Constants |
|---|
| 61 | // ==================================================================================================================== |
|---|
| 62 | |
|---|
| 63 | /// max number of supported APS in software |
|---|
| 64 | #define MAX_NUM_SUPPORTED_APS 1 |
|---|
| 65 | |
|---|
| 66 | // ==================================================================================================================== |
|---|
| 67 | // Class definition |
|---|
| 68 | // ==================================================================================================================== |
|---|
| 69 | |
|---|
| 70 | #if RPS_IN_SPS |
|---|
| 71 | /// Reference Picture Set class |
|---|
| 72 | class TComReferencePictureSet |
|---|
| 73 | { |
|---|
| 74 | private: |
|---|
| 75 | Int m_numberOfPictures; |
|---|
| 76 | Int m_numberOfNegativePictures; |
|---|
| 77 | Int m_numberOfPositivePictures; |
|---|
| 78 | Int m_numberOfLongtermPictures; |
|---|
| 79 | Int m_deltaPOC[MAX_NUM_REF_PICS]; |
|---|
| 80 | Int m_POC[MAX_NUM_REF_PICS]; |
|---|
| 81 | Bool m_used[MAX_NUM_REF_PICS]; |
|---|
| 82 | Bool m_interRPSPrediction; |
|---|
| 83 | Int m_deltaRIdxMinus1; |
|---|
| 84 | Int m_deltaRPS; |
|---|
| 85 | Int m_numRefIdc; |
|---|
| 86 | Int m_refIdc[MAX_NUM_REF_PICS+1]; |
|---|
| 87 | |
|---|
| 88 | public: |
|---|
| 89 | TComReferencePictureSet(); |
|---|
| 90 | virtual ~TComReferencePictureSet(); |
|---|
| 91 | |
|---|
| 92 | Void setNumberOfPictures(Int numberOfPictures); |
|---|
| 93 | Int getNumberOfPictures(); |
|---|
| 94 | Void setNumberOfNegativePictures(Int number) { m_numberOfNegativePictures = number; } |
|---|
| 95 | Int getNumberOfNegativePictures() { return m_numberOfNegativePictures; } |
|---|
| 96 | Void setNumberOfPositivePictures(Int number) { m_numberOfPositivePictures = number; } |
|---|
| 97 | Int getNumberOfPositivePictures() { return m_numberOfPositivePictures; } |
|---|
| 98 | Void setNumberOfLongtermPictures(Int number) { m_numberOfLongtermPictures = number; } |
|---|
| 99 | Int getNumberOfLongtermPictures() { return m_numberOfLongtermPictures; } |
|---|
| 100 | |
|---|
| 101 | Void setDeltaPOC(Int bufferNum, Int deltaPOC); |
|---|
| 102 | Int getDeltaPOC(Int bufferNum); |
|---|
| 103 | Void setPOC(Int bufferNum, Int deltaPOC); |
|---|
| 104 | Int getPOC(Int bufferNum); |
|---|
| 105 | |
|---|
| 106 | Void setUsed(Int bufferNum, Bool used); |
|---|
| 107 | Int getUsed(Int bufferNum); |
|---|
| 108 | |
|---|
| 109 | Void setInterRPSPrediction(Bool flag) { m_interRPSPrediction = flag; } |
|---|
| 110 | Bool getInterRPSPrediction() { return m_interRPSPrediction; } |
|---|
| 111 | Void setDeltaRIdxMinus1(Int x) { m_deltaRIdxMinus1 = x; } |
|---|
| 112 | Int getDeltaRIdxMinus1() { return m_deltaRIdxMinus1; } |
|---|
| 113 | Void setDeltaRPS(Int x) { m_deltaRPS = x; } |
|---|
| 114 | Int getDeltaRPS() { return m_deltaRPS; } |
|---|
| 115 | Void setNumRefIdc(Int x) { m_numRefIdc = x; } |
|---|
| 116 | Int getNumRefIdc() { return m_numRefIdc; } |
|---|
| 117 | |
|---|
| 118 | Void setRefIdc(Int bufferNum, Int refIdc); |
|---|
| 119 | Int getRefIdc(Int bufferNum); |
|---|
| 120 | |
|---|
| 121 | Void sortDeltaPOC(); |
|---|
| 122 | Void printDeltaPOC(); |
|---|
| 123 | }; |
|---|
| 124 | |
|---|
| 125 | /// Reference Picture Set set class |
|---|
| 126 | class TComRPSList |
|---|
| 127 | { |
|---|
| 128 | private: |
|---|
| 129 | Int m_numberOfReferencePictureSets; |
|---|
| 130 | TComReferencePictureSet* m_referencePictureSets; |
|---|
| 131 | |
|---|
| 132 | public: |
|---|
| 133 | TComRPSList(); |
|---|
| 134 | virtual ~TComRPSList(); |
|---|
| 135 | |
|---|
| 136 | Void create (Int numberOfEntries); |
|---|
| 137 | Void destroy (); |
|---|
| 138 | |
|---|
| 139 | |
|---|
| 140 | TComReferencePictureSet* getReferencePictureSet(Int referencePictureSetNum); |
|---|
| 141 | Int getNumberOfReferencePictureSets(); |
|---|
| 142 | Void setNumberOfReferencePictureSets(Int numberOfReferencePictureSets); |
|---|
| 143 | }; |
|---|
| 144 | #endif |
|---|
| 145 | |
|---|
| 146 | /// SPS class |
|---|
| 147 | class TComSPS |
|---|
| 148 | { |
|---|
| 149 | private: |
|---|
| 150 | Int m_SPSId; |
|---|
| 151 | Int m_ProfileIdc; |
|---|
| 152 | Int m_LevelIdc; |
|---|
| 153 | Int m_chromaFormatIdc; |
|---|
| 154 | |
|---|
| 155 | UInt m_uiMaxTLayers; // maximum number of temporal layers |
|---|
| 156 | |
|---|
| 157 | UInt m_uiViewId; |
|---|
| 158 | Int m_iViewOrderIdx; |
|---|
| 159 | Bool m_bDepth; |
|---|
| 160 | UInt m_uiCamParPrecision; |
|---|
| 161 | Bool m_bCamParInSliceHeader; |
|---|
| 162 | Int m_aaiCodedScale [2][MAX_VIEW_NUM]; |
|---|
| 163 | Int m_aaiCodedOffset[2][MAX_VIEW_NUM]; |
|---|
| 164 | |
|---|
| 165 | // Structure |
|---|
| 166 | UInt m_picWidthInLumaSamples; |
|---|
| 167 | UInt m_picHeightInLumaSamples; |
|---|
| 168 | #if PIC_CROPPING |
|---|
| 169 | Bool m_picCroppingFlag; |
|---|
| 170 | Int m_picCropLeftOffset; |
|---|
| 171 | Int m_picCropRightOffset; |
|---|
| 172 | Int m_picCropTopOffset; |
|---|
| 173 | Int m_picCropBottomOffset; |
|---|
| 174 | #else |
|---|
| 175 | Int m_aiPad[2]; |
|---|
| 176 | #endif |
|---|
| 177 | UInt m_uiMaxCUWidth; |
|---|
| 178 | UInt m_uiMaxCUHeight; |
|---|
| 179 | UInt m_uiMaxCUDepth; |
|---|
| 180 | UInt m_uiMinTrDepth; |
|---|
| 181 | UInt m_uiMaxTrDepth; |
|---|
| 182 | #if RPS_IN_SPS |
|---|
| 183 | TComRPSList* m_RPSList; |
|---|
| 184 | Bool m_bLongTermRefsPresent; |
|---|
| 185 | #endif |
|---|
| 186 | #if H0567_DPB_PARAMETERS_PER_TEMPORAL_LAYER |
|---|
| 187 | Int m_numReorderPics[MAX_TLAYER]; |
|---|
| 188 | #else |
|---|
| 189 | Int m_maxNumberOfReferencePictures; |
|---|
| 190 | Int m_numReorderFrames; |
|---|
| 191 | #endif |
|---|
| 192 | |
|---|
| 193 | Int m_iNumberOfUsableInterViewRefs; |
|---|
| 194 | Int m_aiUsableInterViewRefs[MAX_VIEW_NUM]; |
|---|
| 195 | |
|---|
| 196 | // Tool list |
|---|
| 197 | UInt m_uiQuadtreeTULog2MaxSize; |
|---|
| 198 | UInt m_uiQuadtreeTULog2MinSize; |
|---|
| 199 | UInt m_uiQuadtreeTUMaxDepthInter; |
|---|
| 200 | UInt m_uiQuadtreeTUMaxDepthIntra; |
|---|
| 201 | Bool m_usePCM; |
|---|
| 202 | UInt m_pcmLog2MaxSize; |
|---|
| 203 | UInt m_uiPCMLog2MinSize; |
|---|
| 204 | Bool m_bDisInter4x4; |
|---|
| 205 | Bool m_useAMP; |
|---|
| 206 | Bool m_bUseALF; |
|---|
| 207 | #if LCU_SYNTAX_ALF |
|---|
| 208 | Bool m_bALFCoefInSlice; |
|---|
| 209 | #endif |
|---|
| 210 | #if !PIC_CROPPING |
|---|
| 211 | Bool m_bUsePAD; |
|---|
| 212 | #endif |
|---|
| 213 | Bool m_bUseLMChroma; // JL: |
|---|
| 214 | |
|---|
| 215 | Bool m_bUseLComb; |
|---|
| 216 | Bool m_bLCMod; |
|---|
| 217 | Bool m_useNSQT; |
|---|
| 218 | |
|---|
| 219 | #if H0412_REF_PIC_LIST_RESTRICTION |
|---|
| 220 | Bool m_restrictedRefPicListsFlag; |
|---|
| 221 | Bool m_listsModificationPresentFlag; |
|---|
| 222 | #endif |
|---|
| 223 | |
|---|
| 224 | // Parameter |
|---|
| 225 | AMVP_MODE m_aeAMVPMode[MAX_CU_DEPTH]; |
|---|
| 226 | UInt m_uiBitDepth; |
|---|
| 227 | UInt m_uiBitIncrement; |
|---|
| 228 | #if H0736_AVC_STYLE_QP_RANGE |
|---|
| 229 | Int m_qpBDOffsetY; |
|---|
| 230 | Int m_qpBDOffsetC; |
|---|
| 231 | #endif |
|---|
| 232 | |
|---|
| 233 | #if LOSSLESS_CODING |
|---|
| 234 | Bool m_useLossless; |
|---|
| 235 | #endif |
|---|
| 236 | |
|---|
| 237 | UInt m_uiPCMBitDepthLuma; |
|---|
| 238 | UInt m_uiPCMBitDepthChroma; |
|---|
| 239 | Bool m_bPCMFilterDisableFlag; |
|---|
| 240 | |
|---|
| 241 | UInt m_uiBitsForPOC; |
|---|
| 242 | // Max physical transform size |
|---|
| 243 | UInt m_uiMaxTrSize; |
|---|
| 244 | |
|---|
| 245 | Int m_iAMPAcc[MAX_CU_DEPTH]; |
|---|
| 246 | |
|---|
| 247 | Bool m_bLFCrossSliceBoundaryFlag; |
|---|
| 248 | Bool m_bUseSAO; |
|---|
| 249 | #if HHI_MPI |
|---|
| 250 | Bool m_bUseMVI; |
|---|
| 251 | #endif |
|---|
| 252 | |
|---|
| 253 | Bool m_bLFCrossTileBoundaryFlag; |
|---|
| 254 | Int m_iUniformSpacingIdr; |
|---|
| 255 | Int m_iTileBoundaryIndependenceIdr; |
|---|
| 256 | Int m_iNumColumnsMinus1; |
|---|
| 257 | UInt* m_puiColumnWidth; |
|---|
| 258 | Int m_iNumRowsMinus1; |
|---|
| 259 | UInt* m_puiRowHeight; |
|---|
| 260 | |
|---|
| 261 | Bool m_bTemporalIdNestingFlag; // temporal_id_nesting_flag |
|---|
| 262 | |
|---|
| 263 | Bool m_scalingListEnabledFlag; |
|---|
| 264 | #if H0567_DPB_PARAMETERS_PER_TEMPORAL_LAYER |
|---|
| 265 | UInt m_uiMaxDecPicBuffering[MAX_TLAYER]; |
|---|
| 266 | UInt m_uiMaxLatencyIncrease[MAX_TLAYER]; |
|---|
| 267 | #else |
|---|
| 268 | UInt m_uiMaxDecFrameBuffering; |
|---|
| 269 | UInt m_uiMaxLatencyIncrease; |
|---|
| 270 | #endif |
|---|
| 271 | |
|---|
| 272 | Bool m_useDF; |
|---|
| 273 | |
|---|
| 274 | #if TILES_WPP_ENTRY_POINT_SIGNALLING |
|---|
| 275 | UInt m_tilesOrEntropyCodingSyncIdc; |
|---|
| 276 | Int m_numSubstreams; |
|---|
| 277 | #endif |
|---|
| 278 | |
|---|
| 279 | #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX |
|---|
| 280 | Bool m_bUseDMM; |
|---|
| 281 | #endif |
|---|
| 282 | |
|---|
| 283 | #if DEPTH_MAP_GENERATION |
|---|
| 284 | UInt m_uiPredDepthMapGeneration; |
|---|
| 285 | UInt m_uiPdmPrecision; |
|---|
| 286 | Int m_aiPdmScaleNomDelta[MAX_VIEW_NUM]; |
|---|
| 287 | Int m_aiPdmOffset [MAX_VIEW_NUM]; |
|---|
| 288 | #endif |
|---|
| 289 | |
|---|
| 290 | #if HHI_INTER_VIEW_MOTION_PRED |
|---|
| 291 | UInt m_uiMultiviewMvPredMode; |
|---|
| 292 | #endif |
|---|
| 293 | #if HHI_INTER_VIEW_RESIDUAL_PRED |
|---|
| 294 | UInt m_uiMultiviewResPredMode; |
|---|
| 295 | #endif |
|---|
| 296 | |
|---|
| 297 | #if DEPTH_MAP_GENERATION |
|---|
| 298 | TComDepthMapGenerator* m_pcDepthMapGenerator; |
|---|
| 299 | #endif |
|---|
| 300 | #if HHI_INTER_VIEW_RESIDUAL_PRED |
|---|
| 301 | TComResidualGenerator* m_pcResidualGenerator; |
|---|
| 302 | #endif |
|---|
| 303 | |
|---|
| 304 | public: |
|---|
| 305 | TComSPS(); |
|---|
| 306 | virtual ~TComSPS(); |
|---|
| 307 | |
|---|
| 308 | Int getSPSId () { return m_SPSId; } |
|---|
| 309 | Void setSPSId (Int i) { m_SPSId = i; } |
|---|
| 310 | Int getProfileIdc () { return m_ProfileIdc; } |
|---|
| 311 | Void setProfileIdc (Int i) { m_ProfileIdc = i; } |
|---|
| 312 | Int getLevelIdc () { return m_LevelIdc; } |
|---|
| 313 | Void setLevelIdc (Int i) { m_LevelIdc = i; } |
|---|
| 314 | |
|---|
| 315 | Int getChromaFormatIdc () { return m_chromaFormatIdc; } |
|---|
| 316 | Void setChromaFormatIdc (Int i) { m_chromaFormatIdc = i; } |
|---|
| 317 | |
|---|
| 318 | // structure |
|---|
| 319 | Void setPicWidthInLumaSamples ( UInt u ) { m_picWidthInLumaSamples = u; } |
|---|
| 320 | UInt getPicWidthInLumaSamples () { return m_picWidthInLumaSamples; } |
|---|
| 321 | Void setPicHeightInLumaSamples ( UInt u ) { m_picHeightInLumaSamples = u; } |
|---|
| 322 | UInt getPicHeightInLumaSamples () { return m_picHeightInLumaSamples; } |
|---|
| 323 | |
|---|
| 324 | #if PIC_CROPPING |
|---|
| 325 | Bool getPicCroppingFlag() const { return m_picCroppingFlag; } |
|---|
| 326 | Void setPicCroppingFlag(Bool val) { m_picCroppingFlag = val; } |
|---|
| 327 | Int getPicCropLeftOffset() const { return m_picCropLeftOffset; } |
|---|
| 328 | Void setPicCropLeftOffset(Int val) { m_picCropLeftOffset = val; } |
|---|
| 329 | Int getPicCropRightOffset() const { return m_picCropRightOffset; } |
|---|
| 330 | Void setPicCropRightOffset(Int val) { m_picCropRightOffset = val; } |
|---|
| 331 | Int getPicCropTopOffset() const { return m_picCropTopOffset; } |
|---|
| 332 | Void setPicCropTopOffset(Int val) { m_picCropTopOffset = val; } |
|---|
| 333 | Int getPicCropBottomOffset() const { return m_picCropBottomOffset; } |
|---|
| 334 | Void setPicCropBottomOffset(Int val) { m_picCropBottomOffset = val; } |
|---|
| 335 | #endif |
|---|
| 336 | |
|---|
| 337 | Void setMaxCUWidth ( UInt u ) { m_uiMaxCUWidth = u; } |
|---|
| 338 | UInt getMaxCUWidth () { return m_uiMaxCUWidth; } |
|---|
| 339 | Void setMaxCUHeight ( UInt u ) { m_uiMaxCUHeight = u; } |
|---|
| 340 | UInt getMaxCUHeight () { return m_uiMaxCUHeight; } |
|---|
| 341 | Void setMaxCUDepth ( UInt u ) { m_uiMaxCUDepth = u; } |
|---|
| 342 | UInt getMaxCUDepth () { return m_uiMaxCUDepth; } |
|---|
| 343 | Void setUsePCM ( Bool b ) { m_usePCM = b; } |
|---|
| 344 | Bool getUsePCM () { return m_usePCM; } |
|---|
| 345 | Void setPCMLog2MaxSize ( UInt u ) { m_pcmLog2MaxSize = u; } |
|---|
| 346 | UInt getPCMLog2MaxSize () { return m_pcmLog2MaxSize; } |
|---|
| 347 | Void setPCMLog2MinSize ( UInt u ) { m_uiPCMLog2MinSize = u; } |
|---|
| 348 | UInt getPCMLog2MinSize () { return m_uiPCMLog2MinSize; } |
|---|
| 349 | Void setBitsForPOC ( UInt u ) { m_uiBitsForPOC = u; } |
|---|
| 350 | UInt getBitsForPOC () { return m_uiBitsForPOC; } |
|---|
| 351 | Bool getDisInter4x4() { return m_bDisInter4x4; } |
|---|
| 352 | Void setDisInter4x4 ( Bool b ) { m_bDisInter4x4 = b; } |
|---|
| 353 | Bool getUseAMP() { return m_useAMP; } |
|---|
| 354 | Void setUseAMP( Bool b ) { m_useAMP = b; } |
|---|
| 355 | Void setMinTrDepth ( UInt u ) { m_uiMinTrDepth = u; } |
|---|
| 356 | UInt getMinTrDepth () { return m_uiMinTrDepth; } |
|---|
| 357 | Void setMaxTrDepth ( UInt u ) { m_uiMaxTrDepth = u; } |
|---|
| 358 | UInt getMaxTrDepth () { return m_uiMaxTrDepth; } |
|---|
| 359 | Void setQuadtreeTULog2MaxSize( UInt u ) { m_uiQuadtreeTULog2MaxSize = u; } |
|---|
| 360 | UInt getQuadtreeTULog2MaxSize() { return m_uiQuadtreeTULog2MaxSize; } |
|---|
| 361 | Void setQuadtreeTULog2MinSize( UInt u ) { m_uiQuadtreeTULog2MinSize = u; } |
|---|
| 362 | UInt getQuadtreeTULog2MinSize() { return m_uiQuadtreeTULog2MinSize; } |
|---|
| 363 | Void setQuadtreeTUMaxDepthInter( UInt u ) { m_uiQuadtreeTUMaxDepthInter = u; } |
|---|
| 364 | Void setQuadtreeTUMaxDepthIntra( UInt u ) { m_uiQuadtreeTUMaxDepthIntra = u; } |
|---|
| 365 | UInt getQuadtreeTUMaxDepthInter() { return m_uiQuadtreeTUMaxDepthInter; } |
|---|
| 366 | UInt getQuadtreeTUMaxDepthIntra() { return m_uiQuadtreeTUMaxDepthIntra; } |
|---|
| 367 | #if !PIC_CROPPING |
|---|
| 368 | Void setPad (Int iPad[2]) { m_aiPad[0] = iPad[0]; m_aiPad[1] = iPad[1]; } |
|---|
| 369 | #endif |
|---|
| 370 | #if H0567_DPB_PARAMETERS_PER_TEMPORAL_LAYER |
|---|
| 371 | Void setNumReorderPics(Int i, UInt tlayer) { m_numReorderPics[tlayer] = i; } |
|---|
| 372 | Int getNumReorderPics(UInt tlayer) { return m_numReorderPics[tlayer]; } |
|---|
| 373 | #else |
|---|
| 374 | Void setMaxNumberOfReferencePictures( Int u ) { m_maxNumberOfReferencePictures = u; } |
|---|
| 375 | Int getMaxNumberOfReferencePictures() { return m_maxNumberOfReferencePictures; } |
|---|
| 376 | Void setNumReorderFrames( Int i ) { m_numReorderFrames = i; } |
|---|
| 377 | Int getNumReorderFrames() { return m_numReorderFrames; } |
|---|
| 378 | #endif |
|---|
| 379 | #if RPS_IN_SPS |
|---|
| 380 | Void setRPSList( TComRPSList* RPSList ) { m_RPSList = RPSList; } |
|---|
| 381 | TComRPSList* getRPSList() { return m_RPSList; } |
|---|
| 382 | Bool getLongTermRefsPresent() { return m_bLongTermRefsPresent; } |
|---|
| 383 | Void setLongTermRefsPresent(Bool b) { m_bLongTermRefsPresent=b; } |
|---|
| 384 | #endif |
|---|
| 385 | |
|---|
| 386 | Void setNumberOfUsableInterViewRefs( Int number ) { m_iNumberOfUsableInterViewRefs = number; } |
|---|
| 387 | Int getNumberOfUsableInterViewRefs() { return m_iNumberOfUsableInterViewRefs; } |
|---|
| 388 | Void setUsableInterViewRef( Int pos, Int deltaViewId ) { m_aiUsableInterViewRefs[pos] = deltaViewId; } |
|---|
| 389 | Int getUsableInterViewRef( Int pos ) { return m_aiUsableInterViewRefs[pos]; } |
|---|
| 390 | |
|---|
| 391 | #if !PIC_CROPPING |
|---|
| 392 | Void setPadX ( Int u ) { m_aiPad[0] = u; } |
|---|
| 393 | Void setPadY ( Int u ) { m_aiPad[1] = u; } |
|---|
| 394 | Int getPad ( Int u ) { assert(u < 2); return m_aiPad[u];} |
|---|
| 395 | Int* getPad ( ) { return m_aiPad; } |
|---|
| 396 | #endif |
|---|
| 397 | |
|---|
| 398 | // physical transform |
|---|
| 399 | Void setMaxTrSize ( UInt u ) { m_uiMaxTrSize = u; } |
|---|
| 400 | UInt getMaxTrSize () { return m_uiMaxTrSize; } |
|---|
| 401 | |
|---|
| 402 | // Tool list |
|---|
| 403 | Bool getUseALF () { return m_bUseALF; } |
|---|
| 404 | #if LCU_SYNTAX_ALF |
|---|
| 405 | Void setUseALFCoefInSlice(Bool b) {m_bALFCoefInSlice = b;} |
|---|
| 406 | Bool getUseALFCoefInSlice() {return m_bALFCoefInSlice;} |
|---|
| 407 | #endif |
|---|
| 408 | |
|---|
| 409 | #if !PIC_CROPPING |
|---|
| 410 | Bool getUsePAD () { return m_bUsePAD; } |
|---|
| 411 | Void setUsePAD ( Bool b ) { m_bUsePAD = b; } |
|---|
| 412 | #endif |
|---|
| 413 | Void setUseALF ( Bool b ) { m_bUseALF = b; } |
|---|
| 414 | Void setUseLComb (Bool b) { m_bUseLComb = b; } |
|---|
| 415 | Bool getUseLComb () { return m_bUseLComb; } |
|---|
| 416 | Void setLCMod (Bool b) { m_bLCMod = b; } |
|---|
| 417 | Bool getLCMod () { return m_bLCMod; } |
|---|
| 418 | |
|---|
| 419 | Bool getUseLMChroma () { return m_bUseLMChroma; } |
|---|
| 420 | Void setUseLMChroma ( Bool b ) { m_bUseLMChroma = b; } |
|---|
| 421 | |
|---|
| 422 | #if LOSSLESS_CODING |
|---|
| 423 | Bool getUseLossless () { return m_useLossless; } |
|---|
| 424 | Void setUseLossless ( Bool b ) { m_useLossless = b; } |
|---|
| 425 | #endif |
|---|
| 426 | Bool getUseNSQT() { return m_useNSQT; } |
|---|
| 427 | Void setUseNSQT( Bool b ) { m_useNSQT = b; } |
|---|
| 428 | |
|---|
| 429 | #if H0412_REF_PIC_LIST_RESTRICTION |
|---|
| 430 | Bool getRestrictedRefPicListsFlag () { return m_restrictedRefPicListsFlag; } |
|---|
| 431 | Void setRestrictedRefPicListsFlag ( Bool b ) { m_restrictedRefPicListsFlag = b; } |
|---|
| 432 | Bool getListsModificationPresentFlag () { return m_listsModificationPresentFlag; } |
|---|
| 433 | Void setListsModificationPresentFlag ( Bool b ) { m_listsModificationPresentFlag = b; } |
|---|
| 434 | #endif |
|---|
| 435 | |
|---|
| 436 | // AMVP mode (for each depth) |
|---|
| 437 | AMVP_MODE getAMVPMode ( UInt uiDepth ) { assert(uiDepth < g_uiMaxCUDepth); return m_aeAMVPMode[uiDepth]; } |
|---|
| 438 | Void setAMVPMode ( UInt uiDepth, AMVP_MODE eMode) { assert(uiDepth < g_uiMaxCUDepth); m_aeAMVPMode[uiDepth] = eMode; } |
|---|
| 439 | |
|---|
| 440 | // AMP accuracy |
|---|
| 441 | Int getAMPAcc ( UInt uiDepth ) { return m_iAMPAcc[uiDepth]; } |
|---|
| 442 | Void setAMPAcc ( UInt uiDepth, Int iAccu ) { assert( uiDepth < g_uiMaxCUDepth); m_iAMPAcc[uiDepth] = iAccu; } |
|---|
| 443 | |
|---|
| 444 | // Bit-depth |
|---|
| 445 | UInt getBitDepth () { return m_uiBitDepth; } |
|---|
| 446 | Void setBitDepth ( UInt u ) { m_uiBitDepth = u; } |
|---|
| 447 | UInt getBitIncrement () { return m_uiBitIncrement; } |
|---|
| 448 | Void setBitIncrement ( UInt u ) { m_uiBitIncrement = u; } |
|---|
| 449 | #if H0736_AVC_STYLE_QP_RANGE |
|---|
| 450 | Int getQpBDOffsetY () { return m_qpBDOffsetY; } |
|---|
| 451 | Void setQpBDOffsetY ( Int value ) { m_qpBDOffsetY = value; } |
|---|
| 452 | Int getQpBDOffsetC () { return m_qpBDOffsetC; } |
|---|
| 453 | Void setQpBDOffsetC ( Int value ) { m_qpBDOffsetC = value; } |
|---|
| 454 | #endif |
|---|
| 455 | |
|---|
| 456 | Void setLFCrossSliceBoundaryFlag ( Bool bValue ) { m_bLFCrossSliceBoundaryFlag = bValue; } |
|---|
| 457 | Bool getLFCrossSliceBoundaryFlag () { return m_bLFCrossSliceBoundaryFlag; } |
|---|
| 458 | |
|---|
| 459 | Void setUseDF ( Bool b ) { m_useDF = b; } |
|---|
| 460 | Bool getUseDF () { return m_useDF; } |
|---|
| 461 | |
|---|
| 462 | Void setUseSAO (Bool bVal) {m_bUseSAO = bVal;} |
|---|
| 463 | Bool getUseSAO () {return m_bUseSAO;} |
|---|
| 464 | |
|---|
| 465 | #if HHI_MPI |
|---|
| 466 | Void setUseMVI (Bool bVal) {m_bUseMVI = bVal;} |
|---|
| 467 | Bool getUseMVI () {return m_bUseMVI;} |
|---|
| 468 | #endif |
|---|
| 469 | |
|---|
| 470 | UInt getMaxTLayers() { return m_uiMaxTLayers; } |
|---|
| 471 | Void setMaxTLayers( UInt uiMaxTLayers ) { assert( uiMaxTLayers <= MAX_TLAYER ); m_uiMaxTLayers = uiMaxTLayers; } |
|---|
| 472 | |
|---|
| 473 | Bool getTemporalIdNestingFlag() { return m_bTemporalIdNestingFlag; } |
|---|
| 474 | Void setTemporalIdNestingFlag( Bool bValue ) { m_bTemporalIdNestingFlag = bValue; } |
|---|
| 475 | UInt getPCMBitDepthLuma () { return m_uiPCMBitDepthLuma; } |
|---|
| 476 | Void setPCMBitDepthLuma ( UInt u ) { m_uiPCMBitDepthLuma = u; } |
|---|
| 477 | UInt getPCMBitDepthChroma () { return m_uiPCMBitDepthChroma; } |
|---|
| 478 | Void setPCMBitDepthChroma ( UInt u ) { m_uiPCMBitDepthChroma = u; } |
|---|
| 479 | Void setPCMFilterDisableFlag ( Bool bValue ) { m_bPCMFilterDisableFlag = bValue; } |
|---|
| 480 | Bool getPCMFilterDisableFlag () { return m_bPCMFilterDisableFlag; } |
|---|
| 481 | |
|---|
| 482 | Void setLFCrossTileBoundaryFlag ( Bool bValue ) { m_bLFCrossTileBoundaryFlag = bValue; } |
|---|
| 483 | Bool getLFCrossTileBoundaryFlag () { return m_bLFCrossTileBoundaryFlag; } |
|---|
| 484 | Void setUniformSpacingIdr ( Int i ) { m_iUniformSpacingIdr = i; } |
|---|
| 485 | Int getUniformSpacingIdr () { return m_iUniformSpacingIdr; } |
|---|
| 486 | #if !REMOVE_TILE_DEPENDENCE |
|---|
| 487 | Void setTileBoundaryIndependenceIdr ( Int i ) { m_iTileBoundaryIndependenceIdr = i; } |
|---|
| 488 | Int getTileBoundaryIndependenceIdr () { return m_iTileBoundaryIndependenceIdr; } |
|---|
| 489 | #endif |
|---|
| 490 | Void setNumColumnsMinus1 ( Int i ) { m_iNumColumnsMinus1 = i; } |
|---|
| 491 | Int getNumColumnsMinus1 () { return m_iNumColumnsMinus1; } |
|---|
| 492 | Void setColumnWidth ( UInt* columnWidth ) |
|---|
| 493 | { |
|---|
| 494 | if( m_iUniformSpacingIdr == 0 && m_iNumColumnsMinus1 > 0 ) |
|---|
| 495 | { |
|---|
| 496 | m_puiColumnWidth = new UInt[ m_iNumColumnsMinus1 ]; |
|---|
| 497 | |
|---|
| 498 | for(Int i=0; i<m_iNumColumnsMinus1; i++) |
|---|
| 499 | { |
|---|
| 500 | m_puiColumnWidth[i] = columnWidth[i]; |
|---|
| 501 | } |
|---|
| 502 | } |
|---|
| 503 | } |
|---|
| 504 | UInt getColumnWidth (UInt columnIdx) { return *( m_puiColumnWidth + columnIdx ); } |
|---|
| 505 | Void setNumRowsMinus1( Int i ) { m_iNumRowsMinus1 = i; } |
|---|
| 506 | Int getNumRowsMinus1() { return m_iNumRowsMinus1; } |
|---|
| 507 | Void setRowHeight ( UInt* rowHeight ) |
|---|
| 508 | { |
|---|
| 509 | if( m_iUniformSpacingIdr == 0 && m_iNumRowsMinus1 > 0 ) |
|---|
| 510 | { |
|---|
| 511 | m_puiRowHeight = new UInt[ m_iNumRowsMinus1 ]; |
|---|
| 512 | |
|---|
| 513 | for(Int i=0; i<m_iNumRowsMinus1; i++) |
|---|
| 514 | { |
|---|
| 515 | m_puiRowHeight[i] = rowHeight[i]; |
|---|
| 516 | } |
|---|
| 517 | } |
|---|
| 518 | } |
|---|
| 519 | UInt getRowHeight (UInt rowIdx) { return *( m_puiRowHeight + rowIdx ); } |
|---|
| 520 | Bool getScalingListFlag () { return m_scalingListEnabledFlag; } |
|---|
| 521 | Void setScalingListFlag ( Bool b ) { m_scalingListEnabledFlag = b; } |
|---|
| 522 | #if H0567_DPB_PARAMETERS_PER_TEMPORAL_LAYER |
|---|
| 523 | UInt getMaxDecPicBuffering (UInt tlayer) { return m_uiMaxDecPicBuffering[tlayer]; } |
|---|
| 524 | Void setMaxDecPicBuffering ( UInt ui, UInt tlayer ) { m_uiMaxDecPicBuffering[tlayer] = ui; } |
|---|
| 525 | UInt getMaxLatencyIncrease (UInt tlayer) { return m_uiMaxLatencyIncrease[tlayer]; } |
|---|
| 526 | Void setMaxLatencyIncrease ( UInt ui , UInt tlayer) { m_uiMaxLatencyIncrease[tlayer] = ui; } |
|---|
| 527 | #else |
|---|
| 528 | UInt getMaxDecFrameBuffering () { return m_uiMaxDecFrameBuffering; } |
|---|
| 529 | Void setMaxDecFrameBuffering ( UInt ui ) { m_uiMaxDecFrameBuffering = ui; } |
|---|
| 530 | UInt getMaxLatencyIncrease () { return m_uiMaxLatencyIncrease; } |
|---|
| 531 | Void setMaxLatencyIncrease ( UInt ui ) { m_uiMaxLatencyIncrease= ui; } |
|---|
| 532 | #endif |
|---|
| 533 | #if TILES_WPP_ENTRY_POINT_SIGNALLING |
|---|
| 534 | UInt getTilesOrEntropyCodingSyncIdc () { return m_tilesOrEntropyCodingSyncIdc; } |
|---|
| 535 | Void setTilesOrEntropyCodingSyncIdc ( UInt val ) { m_tilesOrEntropyCodingSyncIdc = val; } |
|---|
| 536 | Int getNumSubstreams () { return m_numSubstreams; } |
|---|
| 537 | Void setNumSubstreams ( Int numSubstreams ) { m_numSubstreams = numSubstreams; } |
|---|
| 538 | #endif |
|---|
| 539 | |
|---|
| 540 | #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX |
|---|
| 541 | Bool getUseDMM() { return m_bUseDMM; } |
|---|
| 542 | Void setUseDMM( Bool b ) { m_bUseDMM = b; } |
|---|
| 543 | #endif |
|---|
| 544 | |
|---|
| 545 | Void initMultiviewSPS ( UInt uiViewId, Int iViewOrderIdx = 0, UInt uiCamParPrecision = 0, Bool bCamParSlice = false, Int** aaiScale = 0, Int** aaiOffset = 0 ); |
|---|
| 546 | Void initMultiviewSPSDepth ( UInt uiViewId, Int iViewOrderIdx ); |
|---|
| 547 | |
|---|
| 548 | UInt getViewId () { return m_uiViewId; } |
|---|
| 549 | Int getViewOrderIdx () { return m_iViewOrderIdx; } |
|---|
| 550 | Bool isDepth () { return m_bDepth; } |
|---|
| 551 | UInt getCamParPrecision () { return m_uiCamParPrecision; } |
|---|
| 552 | Bool hasCamParInSliceHeader() { return m_bCamParInSliceHeader; } |
|---|
| 553 | Int* getCodedScale () { return m_aaiCodedScale [0]; } |
|---|
| 554 | Int* getCodedOffset () { return m_aaiCodedOffset[0]; } |
|---|
| 555 | Int* getInvCodedScale () { return m_aaiCodedScale [1]; } |
|---|
| 556 | Int* getInvCodedOffset () { return m_aaiCodedOffset[1]; } |
|---|
| 557 | |
|---|
| 558 | |
|---|
| 559 | #if DEPTH_MAP_GENERATION |
|---|
| 560 | Void setPredDepthMapGeneration( UInt uiViewId, Bool bIsDepth, UInt uiPdmGenMode = 0, UInt uiPdmMvPredMode = 0, UInt uiPdmPrec = 0, Int** aaiPdmScaleNomDelta = 0, Int** aaiPdmOffset = 0 ); |
|---|
| 561 | #endif |
|---|
| 562 | #if HHI_INTER_VIEW_RESIDUAL_PRED |
|---|
| 563 | Void setMultiviewResPredMode ( UInt uiResPrdMode ) { m_uiMultiviewResPredMode = uiResPrdMode; } |
|---|
| 564 | #endif |
|---|
| 565 | |
|---|
| 566 | #if DEPTH_MAP_GENERATION |
|---|
| 567 | UInt getPredDepthMapGeneration() { return m_uiPredDepthMapGeneration; } |
|---|
| 568 | UInt getPdmPrecision () { return m_uiPdmPrecision; } |
|---|
| 569 | Int* getPdmScaleNomDelta () { return m_aiPdmScaleNomDelta; } |
|---|
| 570 | Int* getPdmOffset () { return m_aiPdmOffset; } |
|---|
| 571 | #endif |
|---|
| 572 | |
|---|
| 573 | #if HHI_INTER_VIEW_MOTION_PRED |
|---|
| 574 | UInt getMultiviewMvPredMode () { return m_uiMultiviewMvPredMode; } |
|---|
| 575 | #endif |
|---|
| 576 | #if HHI_INTER_VIEW_RESIDUAL_PRED |
|---|
| 577 | UInt getMultiviewResPredMode () { return m_uiMultiviewResPredMode; } |
|---|
| 578 | #endif |
|---|
| 579 | |
|---|
| 580 | #if DEPTH_MAP_GENERATION |
|---|
| 581 | Void setDepthMapGenerator( TComDepthMapGenerator* pcDepthMapGenerator ) { m_pcDepthMapGenerator = pcDepthMapGenerator; } |
|---|
| 582 | TComDepthMapGenerator* getDepthMapGenerator() { return m_pcDepthMapGenerator; } |
|---|
| 583 | #endif |
|---|
| 584 | #if HHI_INTER_VIEW_RESIDUAL_PRED |
|---|
| 585 | Void setResidualGenerator( TComResidualGenerator* pcResidualGenerator ) { m_pcResidualGenerator = pcResidualGenerator; } |
|---|
| 586 | TComResidualGenerator* getResidualGenerator() { return m_pcResidualGenerator; } |
|---|
| 587 | #endif |
|---|
| 588 | }; |
|---|
| 589 | |
|---|
| 590 | #if !RPS_IN_SPS |
|---|
| 591 | /// Reference Picture Set class |
|---|
| 592 | class TComReferencePictureSet |
|---|
| 593 | { |
|---|
| 594 | private: |
|---|
| 595 | Int m_numberOfPictures; |
|---|
| 596 | Int m_numberOfNegativePictures; |
|---|
| 597 | Int m_numberOfPositivePictures; |
|---|
| 598 | Int m_numberOfLongtermPictures; |
|---|
| 599 | Int m_deltaPOC[MAX_NUM_REF_PICS]; |
|---|
| 600 | Int m_POC[MAX_NUM_REF_PICS]; |
|---|
| 601 | Bool m_used[MAX_NUM_REF_PICS]; |
|---|
| 602 | Bool m_interRPSPrediction; |
|---|
| 603 | Int m_deltaRIdxMinus1; |
|---|
| 604 | Int m_deltaRPS; |
|---|
| 605 | Int m_numRefIdc; |
|---|
| 606 | Int m_refIdc[MAX_NUM_REF_PICS+1]; |
|---|
| 607 | |
|---|
| 608 | public: |
|---|
| 609 | TComReferencePictureSet(); |
|---|
| 610 | virtual ~TComReferencePictureSet(); |
|---|
| 611 | |
|---|
| 612 | Void setUsed(Int bufferNum, Bool used); |
|---|
| 613 | Void setDeltaPOC(Int bufferNum, Int deltaPOC); |
|---|
| 614 | Void setPOC(Int bufferNum, Int deltaPOC); |
|---|
| 615 | Void setNumberOfPictures(Int numberOfPictures); |
|---|
| 616 | |
|---|
| 617 | Int getUsed(Int bufferNum); |
|---|
| 618 | Int getDeltaPOC(Int bufferNum); |
|---|
| 619 | Int getPOC(Int bufferNum); |
|---|
| 620 | Int getNumberOfPictures(); |
|---|
| 621 | |
|---|
| 622 | Void setNumberOfNegativePictures(Int number) { m_numberOfNegativePictures = number; } |
|---|
| 623 | Int getNumberOfNegativePictures() { return m_numberOfNegativePictures; } |
|---|
| 624 | Void setNumberOfPositivePictures(Int number) { m_numberOfPositivePictures = number; } |
|---|
| 625 | Int getNumberOfPositivePictures() { return m_numberOfPositivePictures; } |
|---|
| 626 | Void setNumberOfLongtermPictures(Int number) { m_numberOfLongtermPictures = number; } |
|---|
| 627 | Int getNumberOfLongtermPictures() { return m_numberOfLongtermPictures; } |
|---|
| 628 | |
|---|
| 629 | Void setInterRPSPrediction(Bool flag) { m_interRPSPrediction = flag; } |
|---|
| 630 | Bool getInterRPSPrediction() { return m_interRPSPrediction; } |
|---|
| 631 | Void setDeltaRIdxMinus1(Int x) { m_deltaRIdxMinus1 = x; } |
|---|
| 632 | Int getDeltaRIdxMinus1() { return m_deltaRIdxMinus1; } |
|---|
| 633 | Void setDeltaRPS(Int x) { m_deltaRPS = x; } |
|---|
| 634 | Int getDeltaRPS() { return m_deltaRPS; } |
|---|
| 635 | Void setNumRefIdc(Int x) { m_numRefIdc = x; } |
|---|
| 636 | Int getNumRefIdc() { return m_numRefIdc; } |
|---|
| 637 | |
|---|
| 638 | Void setRefIdc(Int bufferNum, Int refIdc); |
|---|
| 639 | Int getRefIdc(Int bufferNum); |
|---|
| 640 | |
|---|
| 641 | Void sortDeltaPOC(); |
|---|
| 642 | Void printDeltaPOC(); |
|---|
| 643 | }; |
|---|
| 644 | |
|---|
| 645 | /// Reference Picture Set set class |
|---|
| 646 | class TComRPSList |
|---|
| 647 | { |
|---|
| 648 | private: |
|---|
| 649 | Int m_numberOfReferencePictureSets; |
|---|
| 650 | TComReferencePictureSet* m_referencePictureSets; |
|---|
| 651 | |
|---|
| 652 | public: |
|---|
| 653 | TComRPSList(); |
|---|
| 654 | virtual ~TComRPSList(); |
|---|
| 655 | |
|---|
| 656 | Void create (Int numberOfEntries); |
|---|
| 657 | Void destroy (); |
|---|
| 658 | |
|---|
| 659 | |
|---|
| 660 | TComReferencePictureSet* getReferencePictureSet(Int referencePictureSetNum); |
|---|
| 661 | Int getNumberOfReferencePictureSets(); |
|---|
| 662 | Void setNumberOfReferencePictureSets(Int numberOfReferencePictureSets); |
|---|
| 663 | }; |
|---|
| 664 | #endif |
|---|
| 665 | |
|---|
| 666 | /// Reference Picture Lists class |
|---|
| 667 | class TComRefPicListModification |
|---|
| 668 | { |
|---|
| 669 | private: |
|---|
| 670 | UInt m_bRefPicListModificationFlagL0; |
|---|
| 671 | UInt m_bRefPicListModificationFlagL1; |
|---|
| 672 | #if !H0137_0138_LIST_MODIFICATION |
|---|
| 673 | UInt m_uiNumberOfRefPicListModificationsL0; |
|---|
| 674 | UInt m_uiNumberOfRefPicListModificationsL1; |
|---|
| 675 | UInt m_ListIdcL0[32]; |
|---|
| 676 | #endif |
|---|
| 677 | UInt m_RefPicSetIdxL0[32]; |
|---|
| 678 | #if !H0137_0138_LIST_MODIFICATION |
|---|
| 679 | UInt m_ListIdcL1[32]; |
|---|
| 680 | #endif |
|---|
| 681 | UInt m_RefPicSetIdxL1[32]; |
|---|
| 682 | |
|---|
| 683 | public: |
|---|
| 684 | TComRefPicListModification(); |
|---|
| 685 | virtual ~TComRefPicListModification(); |
|---|
| 686 | |
|---|
| 687 | Void create (); |
|---|
| 688 | Void destroy (); |
|---|
| 689 | |
|---|
| 690 | Bool getRefPicListModificationFlagL0() { return m_bRefPicListModificationFlagL0; } |
|---|
| 691 | Void setRefPicListModificationFlagL0(Bool flag) { m_bRefPicListModificationFlagL0 = flag; } |
|---|
| 692 | Bool getRefPicListModificationFlagL1() { return m_bRefPicListModificationFlagL1; } |
|---|
| 693 | Void setRefPicListModificationFlagL1(Bool flag) { m_bRefPicListModificationFlagL1 = flag; } |
|---|
| 694 | #if !H0137_0138_LIST_MODIFICATION |
|---|
| 695 | UInt getNumberOfRefPicListModificationsL0() { return m_uiNumberOfRefPicListModificationsL0; } |
|---|
| 696 | Void setNumberOfRefPicListModificationsL0(UInt nr) { m_uiNumberOfRefPicListModificationsL0 = nr; } |
|---|
| 697 | UInt getNumberOfRefPicListModificationsL1() { return m_uiNumberOfRefPicListModificationsL1; } |
|---|
| 698 | Void setNumberOfRefPicListModificationsL1(UInt nr) { m_uiNumberOfRefPicListModificationsL1 = nr; } |
|---|
| 699 | Void setListIdcL0(UInt idx, UInt idc) { m_ListIdcL0[idx] = idc; } |
|---|
| 700 | UInt getListIdcL0(UInt idx) { return m_ListIdcL0[idx]; } |
|---|
| 701 | #endif |
|---|
| 702 | Void setRefPicSetIdxL0(UInt idx, UInt refPicSetIdx) { m_RefPicSetIdxL0[idx] = refPicSetIdx; } |
|---|
| 703 | UInt getRefPicSetIdxL0(UInt idx) { return m_RefPicSetIdxL0[idx]; } |
|---|
| 704 | #if !H0137_0138_LIST_MODIFICATION |
|---|
| 705 | Void setListIdcL1(UInt idx, UInt idc) { m_ListIdcL1[idx] = idc; } |
|---|
| 706 | UInt getListIdcL1(UInt idx) { return m_ListIdcL1[idx]; } |
|---|
| 707 | #endif |
|---|
| 708 | Void setRefPicSetIdxL1(UInt idx, UInt refPicSetIdx) { m_RefPicSetIdxL1[idx] = refPicSetIdx; } |
|---|
| 709 | UInt getRefPicSetIdxL1(UInt idx) { return m_RefPicSetIdxL1[idx]; } |
|---|
| 710 | }; |
|---|
| 711 | |
|---|
| 712 | /// PPS class |
|---|
| 713 | class TComPPS |
|---|
| 714 | { |
|---|
| 715 | private: |
|---|
| 716 | Int m_PPSId; // pic_parameter_set_id |
|---|
| 717 | Int m_SPSId; // seq_parameter_set_id |
|---|
| 718 | Int m_picInitQPMinus26; |
|---|
| 719 | Bool m_useDQP; |
|---|
| 720 | Bool m_bConstrainedIntraPred; // constrained_intra_pred_flag |
|---|
| 721 | |
|---|
| 722 | // access channel |
|---|
| 723 | TComSPS* m_pcSPS; |
|---|
| 724 | #if !RPS_IN_SPS |
|---|
| 725 | TComRPSList* m_RPSList; |
|---|
| 726 | #endif |
|---|
| 727 | UInt m_uiMaxCuDQPDepth; |
|---|
| 728 | UInt m_uiMinCuDQPSize; |
|---|
| 729 | |
|---|
| 730 | Int m_iChromaQpOffset; |
|---|
| 731 | Int m_iChromaQpOffset2nd; |
|---|
| 732 | |
|---|
| 733 | #if !RPS_IN_SPS |
|---|
| 734 | Bool m_bLongTermRefsPresent; |
|---|
| 735 | #endif |
|---|
| 736 | |
|---|
| 737 | #if !H0566_TLA |
|---|
| 738 | UInt m_uiNumTlayerSwitchingFlags; // num_temporal_layer_switching_point_flags |
|---|
| 739 | Bool m_abTLayerSwitchingFlag[ MAX_TLAYER ]; // temporal_layer_switching_point_flag |
|---|
| 740 | #endif |
|---|
| 741 | |
|---|
| 742 | Int m_iSliceGranularity; |
|---|
| 743 | |
|---|
| 744 | Bool m_bUseWeightPred; // Use of Weighting Prediction (P_SLICE) |
|---|
| 745 | UInt m_uiBiPredIdc; // Use of Weighting Bi-Prediction (B_SLICE) |
|---|
| 746 | |
|---|
| 747 | #if H0388 |
|---|
| 748 | Bool m_OutputFlagPresentFlag; // Indicates the presence of output_flag in slice header |
|---|
| 749 | #endif |
|---|
| 750 | |
|---|
| 751 | Int m_iTileBehaviorControlPresentFlag; |
|---|
| 752 | Bool m_bLFCrossTileBoundaryFlag; |
|---|
| 753 | Int m_iColumnRowInfoPresent; |
|---|
| 754 | Int m_iUniformSpacingIdr; |
|---|
| 755 | #if !REMOVE_TILE_DEPENDENCE |
|---|
| 756 | Int m_iTileBoundaryIndependenceIdr; |
|---|
| 757 | #endif |
|---|
| 758 | Int m_iNumColumnsMinus1; |
|---|
| 759 | UInt* m_puiColumnWidth; |
|---|
| 760 | Int m_iNumRowsMinus1; |
|---|
| 761 | UInt* m_puiRowHeight; |
|---|
| 762 | |
|---|
| 763 | Int m_iEntropyCodingMode; // !!! in PPS now, but also remains in slice header! |
|---|
| 764 | #if !WPP_SIMPLIFICATION |
|---|
| 765 | Int m_iEntropyCodingSynchro; |
|---|
| 766 | Bool m_bCabacIstateReset; |
|---|
| 767 | #endif |
|---|
| 768 | Int m_iNumSubstreams; |
|---|
| 769 | |
|---|
| 770 | Bool m_enableTMVPFlag; |
|---|
| 771 | |
|---|
| 772 | #if MULTIBITS_DATA_HIDING |
|---|
| 773 | Int m_signHideFlag; |
|---|
| 774 | Int m_signHidingThreshold; |
|---|
| 775 | #endif |
|---|
| 776 | |
|---|
| 777 | #if CABAC_INIT_FLAG |
|---|
| 778 | Bool m_cabacInitPresentFlag; |
|---|
| 779 | UInt m_encCABACTableIdx; // Used to transmit table selection across slices |
|---|
| 780 | #endif |
|---|
| 781 | #if DBL_CONTROL |
|---|
| 782 | Bool m_DeblockingFilterControlPresent; |
|---|
| 783 | #endif |
|---|
| 784 | #if PARALLEL_MERGE |
|---|
| 785 | UInt m_log2ParallelMergeLevelMinus2; |
|---|
| 786 | #endif |
|---|
| 787 | public: |
|---|
| 788 | TComPPS(); |
|---|
| 789 | virtual ~TComPPS(); |
|---|
| 790 | |
|---|
| 791 | Int getPPSId () { return m_PPSId; } |
|---|
| 792 | Void setPPSId (Int i) { m_PPSId = i; } |
|---|
| 793 | Int getSPSId () { return m_SPSId; } |
|---|
| 794 | Void setSPSId (Int i) { m_SPSId = i; } |
|---|
| 795 | |
|---|
| 796 | Int getSliceGranularity() { return m_iSliceGranularity; } |
|---|
| 797 | Void setSliceGranularity( Int i ) { m_iSliceGranularity = i; } |
|---|
| 798 | Int getPicInitQPMinus26 () { return m_picInitQPMinus26; } |
|---|
| 799 | Void setPicInitQPMinus26 ( Int i ) { m_picInitQPMinus26 = i; } |
|---|
| 800 | Bool getUseDQP () { return m_useDQP; } |
|---|
| 801 | Void setUseDQP ( Bool b ) { m_useDQP = b; } |
|---|
| 802 | Bool getConstrainedIntraPred () { return m_bConstrainedIntraPred; } |
|---|
| 803 | Void setConstrainedIntraPred ( Bool b ) { m_bConstrainedIntraPred = b; } |
|---|
| 804 | |
|---|
| 805 | #if !H0566_TLA |
|---|
| 806 | UInt getNumTLayerSwitchingFlags() { return m_uiNumTlayerSwitchingFlags; } |
|---|
| 807 | Void setNumTLayerSwitchingFlags( UInt uiNumTlayerSwitchingFlags ) { assert( uiNumTlayerSwitchingFlags < MAX_TLAYER ); m_uiNumTlayerSwitchingFlags = uiNumTlayerSwitchingFlags; } |
|---|
| 808 | |
|---|
| 809 | Bool getTLayerSwitchingFlag( UInt uiTLayer ) { assert( uiTLayer < MAX_TLAYER ); return m_abTLayerSwitchingFlag[ uiTLayer ]; } |
|---|
| 810 | Void setTLayerSwitchingFlag( UInt uiTLayer, Bool bValue ) { m_abTLayerSwitchingFlag[ uiTLayer ] = bValue; } |
|---|
| 811 | #endif |
|---|
| 812 | |
|---|
| 813 | #if !RPS_IN_SPS |
|---|
| 814 | Bool getLongTermRefsPresent() { return m_bLongTermRefsPresent; } |
|---|
| 815 | Void setLongTermRefsPresent(Bool b) { m_bLongTermRefsPresent=b; } |
|---|
| 816 | #endif |
|---|
| 817 | Void setSPS ( TComSPS* pcSPS ) { m_pcSPS = pcSPS; } |
|---|
| 818 | TComSPS* getSPS () { return m_pcSPS; } |
|---|
| 819 | #if !RPS_IN_SPS |
|---|
| 820 | Void setRPSList ( TComRPSList* RPSList ) { m_RPSList = RPSList; } |
|---|
| 821 | TComRPSList* getRPSList () { return m_RPSList; } |
|---|
| 822 | #endif |
|---|
| 823 | Void setMaxCuDQPDepth ( UInt u ) { m_uiMaxCuDQPDepth = u; } |
|---|
| 824 | UInt getMaxCuDQPDepth () { return m_uiMaxCuDQPDepth;} |
|---|
| 825 | Void setMinCuDQPSize ( UInt u ) { m_uiMinCuDQPSize = u; } |
|---|
| 826 | UInt getMinCuDQPSize () { return m_uiMinCuDQPSize; } |
|---|
| 827 | |
|---|
| 828 | Void setChromaQpOffset ( Int i ) { m_iChromaQpOffset = i; } |
|---|
| 829 | Int getChromaQpOffset () { return m_iChromaQpOffset;} |
|---|
| 830 | Void setChromaQpOffset2nd( Int i ) { m_iChromaQpOffset2nd = i; } |
|---|
| 831 | Int getChromaQpOffset2nd() { return m_iChromaQpOffset2nd;} |
|---|
| 832 | |
|---|
| 833 | Bool getUseWP () { return m_bUseWeightPred; } |
|---|
| 834 | UInt getWPBiPredIdc () { return m_uiBiPredIdc; } |
|---|
| 835 | |
|---|
| 836 | Void setUseWP ( Bool b ) { m_bUseWeightPred = b; } |
|---|
| 837 | Void setWPBiPredIdc ( UInt u ) { m_uiBiPredIdc = u; } |
|---|
| 838 | |
|---|
| 839 | #if H0388 |
|---|
| 840 | Void setOutputFlagPresentFlag( Bool b ) { m_OutputFlagPresentFlag = b; } |
|---|
| 841 | Bool getOutputFlagPresentFlag() { return m_OutputFlagPresentFlag; } |
|---|
| 842 | #endif |
|---|
| 843 | |
|---|
| 844 | Void setTileBehaviorControlPresentFlag ( Int i ) { m_iTileBehaviorControlPresentFlag = i; } |
|---|
| 845 | Int getTileBehaviorControlPresentFlag () { return m_iTileBehaviorControlPresentFlag; } |
|---|
| 846 | Void setLFCrossTileBoundaryFlag ( Bool bValue ) { m_bLFCrossTileBoundaryFlag = bValue; } |
|---|
| 847 | Bool getLFCrossTileBoundaryFlag () { return m_bLFCrossTileBoundaryFlag; } |
|---|
| 848 | Void setColumnRowInfoPresent ( Int i ) { m_iColumnRowInfoPresent = i; } |
|---|
| 849 | Int getColumnRowInfoPresent () { return m_iColumnRowInfoPresent; } |
|---|
| 850 | Void setUniformSpacingIdr ( Int i ) { m_iUniformSpacingIdr = i; } |
|---|
| 851 | Int getUniformSpacingIdr () { return m_iUniformSpacingIdr; } |
|---|
| 852 | #if !REMOVE_TILE_DEPENDENCE |
|---|
| 853 | Void setTileBoundaryIndependenceIdr ( Int i ) { m_iTileBoundaryIndependenceIdr = i; } |
|---|
| 854 | Int getTileBoundaryIndependenceIdr () { return m_iTileBoundaryIndependenceIdr; } |
|---|
| 855 | #endif |
|---|
| 856 | Void setNumColumnsMinus1 ( Int i ) { m_iNumColumnsMinus1 = i; } |
|---|
| 857 | Int getNumColumnsMinus1 () { return m_iNumColumnsMinus1; } |
|---|
| 858 | Void setColumnWidth ( UInt* columnWidth ) |
|---|
| 859 | { |
|---|
| 860 | if( m_iUniformSpacingIdr == 0 && m_iNumColumnsMinus1 > 0 ) |
|---|
| 861 | { |
|---|
| 862 | m_puiColumnWidth = new UInt[ m_iNumColumnsMinus1 ]; |
|---|
| 863 | |
|---|
| 864 | for(Int i=0; i<m_iNumColumnsMinus1; i++) |
|---|
| 865 | { |
|---|
| 866 | m_puiColumnWidth[i] = columnWidth[i]; |
|---|
| 867 | } |
|---|
| 868 | } |
|---|
| 869 | } |
|---|
| 870 | UInt getColumnWidth (UInt columnIdx) { return *( m_puiColumnWidth + columnIdx ); } |
|---|
| 871 | Void setNumRowsMinus1( Int i ) { m_iNumRowsMinus1 = i; } |
|---|
| 872 | Int getNumRowsMinus1() { return m_iNumRowsMinus1; } |
|---|
| 873 | Void setRowHeight ( UInt* rowHeight ) |
|---|
| 874 | { |
|---|
| 875 | if( m_iUniformSpacingIdr == 0 && m_iNumRowsMinus1 > 0 ) |
|---|
| 876 | { |
|---|
| 877 | m_puiRowHeight = new UInt[ m_iNumRowsMinus1 ]; |
|---|
| 878 | |
|---|
| 879 | for(Int i=0; i<m_iNumRowsMinus1; i++) |
|---|
| 880 | { |
|---|
| 881 | m_puiRowHeight[i] = rowHeight[i]; |
|---|
| 882 | } |
|---|
| 883 | } |
|---|
| 884 | } |
|---|
| 885 | UInt getRowHeight (UInt rowIdx) { return *( m_puiRowHeight + rowIdx ); } |
|---|
| 886 | Void setEntropyCodingMode(Int iEntropyCodingMode) { m_iEntropyCodingMode = iEntropyCodingMode; } |
|---|
| 887 | Int getEntropyCodingMode() { return m_iEntropyCodingMode; } |
|---|
| 888 | #if !WPP_SIMPLIFICATION |
|---|
| 889 | Void setEntropyCodingSynchro(Int iEntropyCodingSynchro) { m_iEntropyCodingSynchro = iEntropyCodingSynchro; } |
|---|
| 890 | Int getEntropyCodingSynchro() { return m_iEntropyCodingSynchro; } |
|---|
| 891 | Void setCabacIstateReset(Bool bCabacIstateReset) { m_bCabacIstateReset = bCabacIstateReset; } |
|---|
| 892 | Bool getCabacIstateReset() { return m_bCabacIstateReset; } |
|---|
| 893 | #endif |
|---|
| 894 | Void setNumSubstreams(Int iNumSubstreams) { m_iNumSubstreams = iNumSubstreams; } |
|---|
| 895 | Int getNumSubstreams() { return m_iNumSubstreams; } |
|---|
| 896 | |
|---|
| 897 | #if MULTIBITS_DATA_HIDING |
|---|
| 898 | Void setSignHideFlag( Int signHideFlag ) { m_signHideFlag = signHideFlag; } |
|---|
| 899 | Void setTSIG( Int tsig ) { m_signHidingThreshold = tsig; } |
|---|
| 900 | Int getSignHideFlag() { return m_signHideFlag; } |
|---|
| 901 | Int getTSIG() { return m_signHidingThreshold; } |
|---|
| 902 | #endif |
|---|
| 903 | |
|---|
| 904 | Void setEnableTMVPFlag( Bool b ) { m_enableTMVPFlag = b; } |
|---|
| 905 | Bool getEnableTMVPFlag() { return m_enableTMVPFlag; } |
|---|
| 906 | |
|---|
| 907 | #if CABAC_INIT_FLAG |
|---|
| 908 | Void setCabacInitPresentFlag( Bool flag ) { m_cabacInitPresentFlag = flag; } |
|---|
| 909 | Void setEncCABACTableIdx( Int idx ) { m_encCABACTableIdx = idx; } |
|---|
| 910 | Bool getCabacInitPresentFlag() { return m_cabacInitPresentFlag; } |
|---|
| 911 | UInt getEncCABACTableIdx() { return m_encCABACTableIdx; } |
|---|
| 912 | #endif |
|---|
| 913 | #if DBL_CONTROL |
|---|
| 914 | Void setDeblockingFilterControlPresent ( Bool bValue ) { m_DeblockingFilterControlPresent = bValue; } |
|---|
| 915 | Bool getDeblockingFilterControlPresent () { return m_DeblockingFilterControlPresent; } |
|---|
| 916 | #endif |
|---|
| 917 | #if PARALLEL_MERGE |
|---|
| 918 | UInt getLog2ParallelMergeLevelMinus2 () { return m_log2ParallelMergeLevelMinus2; } |
|---|
| 919 | Void setLog2ParallelMergeLevelMinus2 (UInt mrgLevel) { m_log2ParallelMergeLevelMinus2 = mrgLevel; } |
|---|
| 920 | #endif |
|---|
| 921 | }; |
|---|
| 922 | |
|---|
| 923 | /// SCALING_LIST class |
|---|
| 924 | class TComScalingList |
|---|
| 925 | { |
|---|
| 926 | public: |
|---|
| 927 | TComScalingList(); |
|---|
| 928 | virtual ~TComScalingList(); |
|---|
| 929 | Void setScalingListPresentFlag (Bool b) { m_scalingListPresentFlag = b; } |
|---|
| 930 | Bool getScalingListPresentFlag () { return m_scalingListPresentFlag; } |
|---|
| 931 | Int* getScalingListAddress (UInt sizeId, UInt listId) { return m_scalingListCoef[sizeId][listId]; } //!< get matrix coefficient |
|---|
| 932 | Bool checkPredMode (UInt sizeId, UInt listId); |
|---|
| 933 | Void setRefMatrixId (UInt sizeId, UInt listId, UInt u) { m_refMatrixId[sizeId][listId] = u; } //!< set reference matrix ID |
|---|
| 934 | UInt getRefMatrixId (UInt sizeId, UInt listId) { return m_refMatrixId[sizeId][listId]; } //!< get reference matrix ID |
|---|
| 935 | Int* getScalingListDefaultAddress (UInt sizeId, UInt listId); //!< get default matrix coefficient |
|---|
| 936 | Void processDefaultMarix (UInt sizeId, UInt listId); |
|---|
| 937 | #if SCALING_LIST |
|---|
| 938 | Void setScalingListDC (UInt sizeId, UInt listId, UInt u) { m_scalingListDC[sizeId][listId] = u; } //!< set DC value |
|---|
| 939 | Int getScalingListDC (UInt sizeId, UInt listId) { return m_scalingListDC[sizeId][listId]; } //!< get DC value |
|---|
| 940 | Void checkDcOfMatrix (); |
|---|
| 941 | Void setUseDefaultScalingMatrixFlag (UInt sizeId, UInt listId, Bool b) { m_useDefaultScalingMatrixFlag[sizeId][listId] = b; } //!< set default matrix enabled/disabled in each matrix |
|---|
| 942 | Bool getUseDefaultScalingMatrixFlag (UInt sizeId, UInt listId) { return m_useDefaultScalingMatrixFlag[sizeId][listId]; } //!< get default matrix enabled/disabled in each matrix |
|---|
| 943 | #endif |
|---|
| 944 | Void processRefMatrix (UInt sizeId, UInt listId , UInt refListId ); |
|---|
| 945 | Bool xParseScalingList (char* pchFile); |
|---|
| 946 | |
|---|
| 947 | private: |
|---|
| 948 | Void init (); |
|---|
| 949 | Void destroy (); |
|---|
| 950 | #if SCALING_LIST |
|---|
| 951 | Int m_scalingListDC [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< the DC value of the matrix coefficient for 16x16 |
|---|
| 952 | Bool m_useDefaultScalingMatrixFlag [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< UseDefaultScalingMatrixFlag |
|---|
| 953 | #endif |
|---|
| 954 | UInt m_refMatrixId [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< RefMatrixID |
|---|
| 955 | Bool m_scalingListPresentFlag; //!< flag for using default matrix |
|---|
| 956 | UInt m_predMatrixId [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< reference list index |
|---|
| 957 | Int *m_scalingListCoef [SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; //!< quantization matrix |
|---|
| 958 | }; |
|---|
| 959 | |
|---|
| 960 | /// APS class |
|---|
| 961 | class TComAPS |
|---|
| 962 | { |
|---|
| 963 | public: |
|---|
| 964 | TComAPS(); |
|---|
| 965 | virtual ~TComAPS(); |
|---|
| 966 | |
|---|
| 967 | Void setAPSID (Int iID) {m_apsID = iID; } //!< set APS ID |
|---|
| 968 | Int getAPSID () {return m_apsID; } //!< get APS ID |
|---|
| 969 | Void setSaoEnabled (Bool bVal) {m_bSaoEnabled = bVal; } //!< set SAO enabled/disabled in APS |
|---|
| 970 | Bool getSaoEnabled () {return m_bSaoEnabled; } //!< get SAO enabled/disabled in APS |
|---|
| 971 | Void setAlfEnabled (Bool bVal) {m_bAlfEnabled = bVal; } //!< set ALF enabled/disabled in APS |
|---|
| 972 | Bool getAlfEnabled () {return m_bAlfEnabled; } //!< get ALF enabled/disabled in APS |
|---|
| 973 | |
|---|
| 974 | #if LCU_SYNTAX_ALF |
|---|
| 975 | AlfParamSet* getAlfParam () {return m_alfParamSet;} |
|---|
| 976 | #else |
|---|
| 977 | ALFParam* getAlfParam () {return m_pAlfParam; } //!< get ALF parameters in APS |
|---|
| 978 | #endif |
|---|
| 979 | SAOParam* getSaoParam () {return m_pSaoParam; } //!< get SAO parameters in APS |
|---|
| 980 | |
|---|
| 981 | Void createSaoParam(); //!< create SAO parameter object |
|---|
| 982 | Void destroySaoParam(); //!< destroy SAO parameter object |
|---|
| 983 | |
|---|
| 984 | Void createAlfParam(); //!< create ALF parameter object |
|---|
| 985 | Void destroyAlfParam(); //!< destroy ALF parameter object |
|---|
| 986 | |
|---|
| 987 | Void setLoopFilterOffsetInAPS(Bool val) {m_loopFilterOffsetInAPS = val; } //!< set offset for deblocking filter enabled/disabled in APS |
|---|
| 988 | Bool getLoopFilterOffsetInAPS() {return m_loopFilterOffsetInAPS; } //!< get offset for deblocking filter enabled/disabled in APS |
|---|
| 989 | Void setLoopFilterDisable(Bool val) {m_loopFilterDisable = val; } //!< set offset for deblocking filter disabled |
|---|
| 990 | Bool getLoopFilterDisable() {return m_loopFilterDisable; } //!< get offset for deblocking filter disabled |
|---|
| 991 | Void setLoopFilterBetaOffset(Int val) {m_loopFilterBetaOffsetDiv2 = val; } //!< set beta offset for deblocking filter |
|---|
| 992 | Int getLoopFilterBetaOffset() {return m_loopFilterBetaOffsetDiv2; } //!< get beta offset for deblocking filter |
|---|
| 993 | Void setLoopFilterTcOffset(Int val) {m_loopFilterTcOffsetDiv2 = val; } //!< set tc offset for deblocking filter |
|---|
| 994 | Int getLoopFilterTcOffset() {return m_loopFilterTcOffsetDiv2; } //!< get tc offset for deblocking filter |
|---|
| 995 | |
|---|
| 996 | Void createScalingList(); |
|---|
| 997 | Void destroyScalingList(); |
|---|
| 998 | Void setScalingListEnabled (Bool bVal) { m_scalingListEnabled = bVal; } //!< set ScalingList enabled/disabled in APS |
|---|
| 999 | Bool getScalingListEnabled () { return m_scalingListEnabled; } //!< get ScalingList enabled/disabled in APS |
|---|
| 1000 | TComScalingList* getScalingList () { return m_scalingList; } //!< get ScalingList class pointer in APS |
|---|
| 1001 | #if SAO_UNIT_INTERLEAVING |
|---|
| 1002 | Bool getSaoInterleavingFlag() {return m_saoInterleavingFlag;} //!< get SAO interleaving flag in APS |
|---|
| 1003 | Void setSaoInterleavingFlag(Bool bVal) {m_saoInterleavingFlag = bVal;} //!< set SAO interleaving flag in APS |
|---|
| 1004 | #endif |
|---|
| 1005 | |
|---|
| 1006 | private: |
|---|
| 1007 | Int m_apsID; //!< APS ID |
|---|
| 1008 | Bool m_bSaoEnabled; //!< SAO enabled/disabled in APS (true for enabled) |
|---|
| 1009 | Bool m_bAlfEnabled; //!< ALF enabled/disabled in APS (true for enabled) |
|---|
| 1010 | SAOParam* m_pSaoParam; //!< SAO parameter object pointer |
|---|
| 1011 | #if LCU_SYNTAX_ALF |
|---|
| 1012 | AlfParamSet* m_alfParamSet; |
|---|
| 1013 | #else |
|---|
| 1014 | ALFParam* m_pAlfParam; //!< ALF parameter object pointer |
|---|
| 1015 | #endif |
|---|
| 1016 | Bool m_loopFilterOffsetInAPS; //< offset for deblocking filter in 0 = slice header, 1 = APS |
|---|
| 1017 | Bool m_loopFilterDisable; //< Deblocking filter enabled/disabled in APS |
|---|
| 1018 | Int m_loopFilterBetaOffsetDiv2; //< beta offset for deblocking filter |
|---|
| 1019 | Int m_loopFilterTcOffsetDiv2; //< tc offset for deblocking filter |
|---|
| 1020 | Bool m_scalingListEnabled; //!< ScalingList enabled/disabled in APS (true for enabled) |
|---|
| 1021 | TComScalingList* m_scalingList; //!< ScalingList class pointer |
|---|
| 1022 | #if SAO_UNIT_INTERLEAVING |
|---|
| 1023 | Bool m_saoInterleavingFlag; //!< SAO interleaving flag |
|---|
| 1024 | #endif |
|---|
| 1025 | |
|---|
| 1026 | public: |
|---|
| 1027 | TComAPS& operator= (const TComAPS& src); //!< "=" operator for APS object |
|---|
| 1028 | }; |
|---|
| 1029 | |
|---|
| 1030 | typedef struct { |
|---|
| 1031 | // Explicit weighted prediction parameters parsed in slice header, |
|---|
| 1032 | // or Implicit weighted prediction parameters (8 bits depth values). |
|---|
| 1033 | Bool bPresentFlag; |
|---|
| 1034 | UInt uiLog2WeightDenom; |
|---|
| 1035 | Int iWeight; |
|---|
| 1036 | Int iOffset; |
|---|
| 1037 | |
|---|
| 1038 | // Weighted prediction scaling values built from above parameters (bitdepth scaled): |
|---|
| 1039 | Int w, o, offset, shift, round; |
|---|
| 1040 | } wpScalingParam; |
|---|
| 1041 | |
|---|
| 1042 | typedef struct { |
|---|
| 1043 | Int64 iAC; |
|---|
| 1044 | Int64 iDC; |
|---|
| 1045 | } wpACDCParam; |
|---|
| 1046 | |
|---|
| 1047 | /// slice header class |
|---|
| 1048 | class TComSlice |
|---|
| 1049 | { |
|---|
| 1050 | |
|---|
| 1051 | private: |
|---|
| 1052 | // Bitstream writing |
|---|
| 1053 | Int m_iAPSId; //!< APS ID in slice header |
|---|
| 1054 | bool m_alfEnabledFlag; |
|---|
| 1055 | bool m_saoEnabledFlag; |
|---|
| 1056 | #if SAO_UNIT_INTERLEAVING |
|---|
| 1057 | bool m_saoInterleavingFlag; ///< SAO interleaving flag |
|---|
| 1058 | bool m_saoEnabledFlagCb; ///< SAO Cb enabled flag |
|---|
| 1059 | bool m_saoEnabledFlagCr; ///< SAO Cr enabled flag |
|---|
| 1060 | #endif |
|---|
| 1061 | Int m_iPPSId; ///< picture parameter set ID |
|---|
| 1062 | #if H0388 |
|---|
| 1063 | Bool m_PicOutputFlag; ///< pic_output_flag |
|---|
| 1064 | #endif |
|---|
| 1065 | Int m_iPOC; |
|---|
| 1066 | Int m_iLastIDR; |
|---|
| 1067 | static Int m_prevPOC; |
|---|
| 1068 | TComReferencePictureSet *m_pcRPS; |
|---|
| 1069 | TComReferencePictureSet m_LocalRPS; |
|---|
| 1070 | Int m_iBDidx; |
|---|
| 1071 | Int m_iCombinationBDidx; |
|---|
| 1072 | Bool m_bCombineWithReferenceFlag; |
|---|
| 1073 | TComRefPicListModification m_RefPicListModification; |
|---|
| 1074 | NalUnitType m_eNalUnitType; ///< Nal unit type for the slice |
|---|
| 1075 | NalUnitType m_eNalUnitTypeBaseViewMvc; ///< Nal unit type of the base view slice for multiview coding |
|---|
| 1076 | SliceType m_eSliceType; |
|---|
| 1077 | Int m_iSliceQp; |
|---|
| 1078 | #if ADAPTIVE_QP_SELECTION |
|---|
| 1079 | Int m_iSliceQpBase; |
|---|
| 1080 | #endif |
|---|
| 1081 | Bool m_bLoopFilterDisable; |
|---|
| 1082 | Bool m_loopFilterOffsetInAPS; |
|---|
| 1083 | Bool m_inheritDblParamFromAPS; //< offsets for deblocking filter inherit from APS |
|---|
| 1084 | Int m_loopFilterBetaOffsetDiv2; //< beta offset for deblocking filter |
|---|
| 1085 | Int m_loopFilterTcOffsetDiv2; //< tc offset for deblocking filter |
|---|
| 1086 | |
|---|
| 1087 | Int m_aiNumRefIdx [3]; // for multiple reference of current slice |
|---|
| 1088 | |
|---|
| 1089 | Int m_iRefIdxOfLC[2][MAX_NUM_REF_LC]; |
|---|
| 1090 | Int m_eListIdFromIdxOfLC[MAX_NUM_REF_LC]; |
|---|
| 1091 | Int m_iRefIdxFromIdxOfLC[MAX_NUM_REF_LC]; |
|---|
| 1092 | Int m_iRefIdxOfL1FromRefIdxOfL0[MAX_NUM_REF_LC]; |
|---|
| 1093 | Int m_iRefIdxOfL0FromRefIdxOfL1[MAX_NUM_REF_LC]; |
|---|
| 1094 | Bool m_bRefPicListModificationFlagLC; |
|---|
| 1095 | Bool m_bRefPicListCombinationFlag; |
|---|
| 1096 | |
|---|
| 1097 | Bool m_bCheckLDC; |
|---|
| 1098 | |
|---|
| 1099 | // Data |
|---|
| 1100 | Int m_iSliceQpDelta; |
|---|
| 1101 | TComPic* m_apcRefPicList [2][MAX_NUM_REF+1]; |
|---|
| 1102 | Int m_aiRefPOCList [2][MAX_NUM_REF+1]; |
|---|
| 1103 | Int m_aiRefViewIdList[2][MAX_NUM_REF+1]; |
|---|
| 1104 | TComPic* m_pcTexturePic; |
|---|
| 1105 | Int m_iDepth; |
|---|
| 1106 | |
|---|
| 1107 | // referenced slice? |
|---|
| 1108 | Bool m_bRefenced; |
|---|
| 1109 | |
|---|
| 1110 | // access channel |
|---|
| 1111 | TComSPS* m_pcSPS; |
|---|
| 1112 | TComPPS* m_pcPPS; |
|---|
| 1113 | TComPic* m_pcPic; |
|---|
| 1114 | #if ADAPTIVE_QP_SELECTION |
|---|
| 1115 | TComTrQuant* m_pcTrQuant; |
|---|
| 1116 | #endif |
|---|
| 1117 | TComAPS* m_pcAPS; //!< pointer to APS parameter object |
|---|
| 1118 | |
|---|
| 1119 | UInt m_uiColDir; // direction to get colocated CUs |
|---|
| 1120 | |
|---|
| 1121 | #if COLLOCATED_REF_IDX |
|---|
| 1122 | UInt m_colRefIdx; |
|---|
| 1123 | #endif |
|---|
| 1124 | |
|---|
| 1125 | #if ALF_CHROMA_LAMBDA || SAO_CHROMA_LAMBDA |
|---|
| 1126 | Double m_dLambdaLuma; |
|---|
| 1127 | Double m_dLambdaChroma; |
|---|
| 1128 | #else |
|---|
| 1129 | Double m_dLambda; |
|---|
| 1130 | #endif |
|---|
| 1131 | |
|---|
| 1132 | Bool m_abEqualRef [2][MAX_NUM_REF][MAX_NUM_REF]; |
|---|
| 1133 | |
|---|
| 1134 | Bool m_bNoBackPredFlag; |
|---|
| 1135 | Bool m_bRefIdxCombineCoding; |
|---|
| 1136 | |
|---|
| 1137 | UInt m_uiTLayer; |
|---|
| 1138 | Bool m_bTLayerSwitchingFlag; |
|---|
| 1139 | |
|---|
| 1140 | UInt m_uiSliceMode; |
|---|
| 1141 | UInt m_uiSliceArgument; |
|---|
| 1142 | UInt m_uiSliceCurStartCUAddr; |
|---|
| 1143 | UInt m_uiSliceCurEndCUAddr; |
|---|
| 1144 | UInt m_uiSliceIdx; |
|---|
| 1145 | UInt m_uiEntropySliceMode; |
|---|
| 1146 | UInt m_uiEntropySliceArgument; |
|---|
| 1147 | UInt m_uiEntropySliceCurStartCUAddr; |
|---|
| 1148 | UInt m_uiEntropySliceCurEndCUAddr; |
|---|
| 1149 | Bool m_bNextSlice; |
|---|
| 1150 | Bool m_bNextEntropySlice; |
|---|
| 1151 | UInt m_uiSliceBits; |
|---|
| 1152 | UInt m_uiEntropySliceCounter; |
|---|
| 1153 | Bool m_bFinalized; |
|---|
| 1154 | |
|---|
| 1155 | wpScalingParam m_weightPredTable[2][MAX_NUM_REF][3]; // [REF_PIC_LIST_0 or REF_PIC_LIST_1][refIdx][0:Y, 1:U, 2:V] |
|---|
| 1156 | wpACDCParam m_weightACDCParam[3]; // [0:Y, 1:U, 2:V] |
|---|
| 1157 | wpScalingParam m_weightPredTableLC[2*MAX_NUM_REF][3]; // [refIdxLC][0:Y, 1:U, 2:V] |
|---|
| 1158 | |
|---|
| 1159 | UInt *m_uiTileByteLocation; |
|---|
| 1160 | UInt m_uiTileCount; |
|---|
| 1161 | Int m_iTileMarkerFlag; |
|---|
| 1162 | UInt m_uiTileOffstForMultES; |
|---|
| 1163 | |
|---|
| 1164 | UInt* m_puiSubstreamSizes; |
|---|
| 1165 | TComScalingList* m_scalingList; //!< pointer of quantization matrix |
|---|
| 1166 | #if CABAC_INIT_FLAG |
|---|
| 1167 | Bool m_cabacInitFlag; |
|---|
| 1168 | #else |
|---|
| 1169 | Int m_cabacInitIdc; |
|---|
| 1170 | #endif |
|---|
| 1171 | |
|---|
| 1172 | #if H0111_MVD_L1_ZERO |
|---|
| 1173 | Bool m_bLMvdL1Zero; |
|---|
| 1174 | #endif |
|---|
| 1175 | #if TILES_WPP_ENTRY_POINT_SIGNALLING |
|---|
| 1176 | Int m_numEntryPointOffsets; |
|---|
| 1177 | #endif |
|---|
| 1178 | |
|---|
| 1179 | Int m_viewId; |
|---|
| 1180 | Bool m_isDepth; |
|---|
| 1181 | Int m_aaiCodedScale [2][MAX_VIEW_NUM]; |
|---|
| 1182 | Int m_aaiCodedOffset[2][MAX_VIEW_NUM]; |
|---|
| 1183 | |
|---|
| 1184 | #if SONY_COLPIC_AVAILABILITY |
|---|
| 1185 | Int m_iViewOrderIdx; |
|---|
| 1186 | #endif |
|---|
| 1187 | |
|---|
| 1188 | public: |
|---|
| 1189 | TComSlice(); |
|---|
| 1190 | virtual ~TComSlice(); |
|---|
| 1191 | |
|---|
| 1192 | Void initSlice (); |
|---|
| 1193 | Void initTiles(); |
|---|
| 1194 | |
|---|
| 1195 | |
|---|
| 1196 | Void setSPS ( TComSPS* pcSPS ) { m_pcSPS = pcSPS; } |
|---|
| 1197 | TComSPS* getSPS () { return m_pcSPS; } |
|---|
| 1198 | |
|---|
| 1199 | Void setPPS ( TComPPS* pcPPS ) { assert(pcPPS!=NULL); m_pcPPS = pcPPS; m_iPPSId = pcPPS->getPPSId(); } |
|---|
| 1200 | TComPPS* getPPS () { return m_pcPPS; } |
|---|
| 1201 | |
|---|
| 1202 | #if ADAPTIVE_QP_SELECTION |
|---|
| 1203 | Void setTrQuant ( TComTrQuant* pcTrQuant ) { m_pcTrQuant = pcTrQuant; } |
|---|
| 1204 | TComTrQuant* getTrQuant () { return m_pcTrQuant; } |
|---|
| 1205 | #endif |
|---|
| 1206 | |
|---|
| 1207 | Void setPPSId ( Int PPSId ) { m_iPPSId = PPSId; } |
|---|
| 1208 | Int getPPSId () { return m_iPPSId; } |
|---|
| 1209 | Void setAPS ( TComAPS* pcAPS ) { m_pcAPS = pcAPS; } //!< set APS pointer |
|---|
| 1210 | TComAPS* getAPS () { return m_pcAPS; } //!< get APS pointer |
|---|
| 1211 | Void setAPSId ( Int Id) { m_iAPSId =Id; } //!< set APS ID |
|---|
| 1212 | Int getAPSId () { return m_iAPSId; } //!< get APS ID |
|---|
| 1213 | #if H0388 |
|---|
| 1214 | Void setPicOutputFlag( Bool b ) { m_PicOutputFlag = b; } |
|---|
| 1215 | Bool getPicOutputFlag() { return m_PicOutputFlag; } |
|---|
| 1216 | #endif |
|---|
| 1217 | Void setAlfEnabledFlag(Bool s) {m_alfEnabledFlag =s; } |
|---|
| 1218 | Bool getAlfEnabledFlag() { return m_alfEnabledFlag; } |
|---|
| 1219 | Void setSaoEnabledFlag(Bool s) {m_saoEnabledFlag =s; } |
|---|
| 1220 | Bool getSaoEnabledFlag() { return m_saoEnabledFlag; } |
|---|
| 1221 | #if SAO_UNIT_INTERLEAVING |
|---|
| 1222 | Void setSaoInterleavingFlag(Bool s) {m_saoInterleavingFlag =s; } //!< set SAO interleaving flag |
|---|
| 1223 | Bool getSaoInterleavingFlag() { return m_saoInterleavingFlag; } //!< get SAO interleaving flag |
|---|
| 1224 | Void setSaoEnabledFlagCb(Bool s) {m_saoEnabledFlagCb =s; } //!< set SAO Cb enabled flag |
|---|
| 1225 | Bool getSaoEnabledFlagCb() { return m_saoEnabledFlagCb; } //!< get SAO Cb enabled flag |
|---|
| 1226 | Void setSaoEnabledFlagCr(Bool s) {m_saoEnabledFlagCr =s; } //!< set SAO Cr enabled flag |
|---|
| 1227 | Bool getSaoEnabledFlagCr() { return m_saoEnabledFlagCr; } //!< get SAO Cr enabled flag |
|---|
| 1228 | #endif |
|---|
| 1229 | Void setRPS ( TComReferencePictureSet *pcRPS ) { m_pcRPS = pcRPS; } |
|---|
| 1230 | TComReferencePictureSet* getRPS () { return m_pcRPS; } |
|---|
| 1231 | TComReferencePictureSet* getLocalRPS () { return &m_LocalRPS; } |
|---|
| 1232 | |
|---|
| 1233 | Void setRPSidx ( Int iBDidx ) { m_iBDidx = iBDidx; } |
|---|
| 1234 | Int getRPSidx () { return m_iBDidx; } |
|---|
| 1235 | Void setCombinationBDidx ( Int iCombinationBDidx ) { m_iCombinationBDidx = iCombinationBDidx; } |
|---|
| 1236 | Int getCombinationBDidx () { return m_iCombinationBDidx; } |
|---|
| 1237 | Void setCombineWithReferenceFlag ( Bool bCombineWithReferenceFlag ) { m_bCombineWithReferenceFlag = bCombineWithReferenceFlag; } |
|---|
| 1238 | Bool getCombineWithReferenceFlag () { return m_bCombineWithReferenceFlag; } |
|---|
| 1239 | Int getPrevPOC () { return m_prevPOC; } |
|---|
| 1240 | |
|---|
| 1241 | TComRefPicListModification* getRefPicListModification() { return &m_RefPicListModification; } |
|---|
| 1242 | Void setLastIDR(Int iIDRPOC) { m_iLastIDR = iIDRPOC; } |
|---|
| 1243 | Int getLastIDR() { return m_iLastIDR; } |
|---|
| 1244 | SliceType getSliceType () { return m_eSliceType; } |
|---|
| 1245 | Int getPOC () { return m_iPOC; } |
|---|
| 1246 | Int getSliceQp () { return m_iSliceQp; } |
|---|
| 1247 | #if ADAPTIVE_QP_SELECTION |
|---|
| 1248 | Int getSliceQpBase () { return m_iSliceQpBase; } |
|---|
| 1249 | #endif |
|---|
| 1250 | Int getSliceQpDelta () { return m_iSliceQpDelta; } |
|---|
| 1251 | Bool getLoopFilterDisable() { return m_bLoopFilterDisable; } |
|---|
| 1252 | Bool getLoopFilterOffsetInAPS() { return m_loopFilterOffsetInAPS;} |
|---|
| 1253 | Bool getInheritDblParamFromAPS() { return m_inheritDblParamFromAPS; } |
|---|
| 1254 | Int getLoopFilterBetaOffset() { return m_loopFilterBetaOffsetDiv2; } |
|---|
| 1255 | Int getLoopFilterTcOffset() { return m_loopFilterTcOffsetDiv2; } |
|---|
| 1256 | |
|---|
| 1257 | Int getNumRefIdx ( RefPicList e ) { return m_aiNumRefIdx[e]; } |
|---|
| 1258 | TComPic* getPic () { return m_pcPic; } |
|---|
| 1259 | TComPic* getRefPic ( RefPicList e, Int iRefIdx) { return m_apcRefPicList[e][iRefIdx]; } |
|---|
| 1260 | Int getRefPOC ( RefPicList e, Int iRefIdx) { return m_aiRefPOCList[e][iRefIdx]; } |
|---|
| 1261 | Int getRefViewId ( RefPicList e, Int iRefIdx) { return m_aiRefViewIdList[e][iRefIdx]; } |
|---|
| 1262 | TComPic* getTexturePic () const { return m_pcTexturePic; } |
|---|
| 1263 | #if SONY_COLPIC_AVAILABILITY |
|---|
| 1264 | Int getViewOrderIdx () { return m_iViewOrderIdx; } |
|---|
| 1265 | #endif |
|---|
| 1266 | Int getDepth () { return m_iDepth; } |
|---|
| 1267 | UInt getColDir () { return m_uiColDir; } |
|---|
| 1268 | #if COLLOCATED_REF_IDX |
|---|
| 1269 | Bool getColRefIdx () { return m_colRefIdx; } |
|---|
| 1270 | Void checkColRefIdx (UInt curSliceIdx, TComPic* pic); |
|---|
| 1271 | #endif |
|---|
| 1272 | Bool getCheckLDC () { return m_bCheckLDC; } |
|---|
| 1273 | #if H0111_MVD_L1_ZERO |
|---|
| 1274 | Bool getMvdL1ZeroFlag () { return m_bLMvdL1Zero; } |
|---|
| 1275 | #endif |
|---|
| 1276 | Int getRefIdxOfLC (RefPicList e, Int iRefIdx) { return m_iRefIdxOfLC[e][iRefIdx]; } |
|---|
| 1277 | Int getListIdFromIdxOfLC(Int iRefIdx) { return m_eListIdFromIdxOfLC[iRefIdx]; } |
|---|
| 1278 | Int getRefIdxFromIdxOfLC(Int iRefIdx) { return m_iRefIdxFromIdxOfLC[iRefIdx]; } |
|---|
| 1279 | Int getRefIdxOfL0FromRefIdxOfL1(Int iRefIdx) { return m_iRefIdxOfL0FromRefIdxOfL1[iRefIdx];} |
|---|
| 1280 | Int getRefIdxOfL1FromRefIdxOfL0(Int iRefIdx) { return m_iRefIdxOfL1FromRefIdxOfL0[iRefIdx];} |
|---|
| 1281 | Bool getRefPicListModificationFlagLC() {return m_bRefPicListModificationFlagLC;} |
|---|
| 1282 | Void setRefPicListModificationFlagLC(Bool bflag) {m_bRefPicListModificationFlagLC=bflag;} |
|---|
| 1283 | Bool getRefPicListCombinationFlag() {return m_bRefPicListCombinationFlag;} |
|---|
| 1284 | Void setRefPicListCombinationFlag(Bool bflag) {m_bRefPicListCombinationFlag=bflag;} |
|---|
| 1285 | Void setListIdFromIdxOfLC(Int iRefIdx, UInt uiVal) { m_eListIdFromIdxOfLC[iRefIdx]=uiVal; } |
|---|
| 1286 | Void setRefIdxFromIdxOfLC(Int iRefIdx, UInt uiVal) { m_iRefIdxFromIdxOfLC[iRefIdx]=uiVal; } |
|---|
| 1287 | Void setRefIdxOfLC (RefPicList e, Int iRefIdx, Int RefIdxLC) { m_iRefIdxOfLC[e][iRefIdx]=RefIdxLC;} |
|---|
| 1288 | |
|---|
| 1289 | Void setReferenced(Bool b) { m_bRefenced = b; } |
|---|
| 1290 | Bool isReferenced() { return m_bRefenced; } |
|---|
| 1291 | |
|---|
| 1292 | Void setPOC ( Int i ) { m_iPOC = i; if(getTLayer()==0) m_prevPOC=i; } |
|---|
| 1293 | Void setNalUnitType ( NalUnitType e ) { m_eNalUnitType = e; } |
|---|
| 1294 | NalUnitType getNalUnitType () { return m_eNalUnitType; } |
|---|
| 1295 | Void setNalUnitTypeBaseViewMvc ( NalUnitType e ) { m_eNalUnitTypeBaseViewMvc = e; } |
|---|
| 1296 | NalUnitType getNalUnitTypeBaseViewMvc() { return m_eNalUnitTypeBaseViewMvc; } |
|---|
| 1297 | Void checkCRA(TComReferencePictureSet *pReferencePictureSet, Int& pocCRA, TComList<TComPic*>& rcListPic); |
|---|
| 1298 | Void decodingRefreshMarking(Int& pocCRA, Bool& bRefreshPending, TComList<TComPic*>& rcListPic); |
|---|
| 1299 | Void setSliceType ( SliceType e ) { m_eSliceType = e; } |
|---|
| 1300 | Void setSliceQp ( Int i ) { m_iSliceQp = i; } |
|---|
| 1301 | #if ADAPTIVE_QP_SELECTION |
|---|
| 1302 | Void setSliceQpBase ( Int i ) { m_iSliceQpBase = i; } |
|---|
| 1303 | #endif |
|---|
| 1304 | Void setSliceQpDelta ( Int i ) { m_iSliceQpDelta = i; } |
|---|
| 1305 | Void setLoopFilterDisable( Bool b ) { m_bLoopFilterDisable= b; } |
|---|
| 1306 | Void setLoopFilterOffsetInAPS( Bool b ) { m_loopFilterOffsetInAPS = b;} |
|---|
| 1307 | Void setInheritDblParamFromAPS( Bool b ) { m_inheritDblParamFromAPS = b; } |
|---|
| 1308 | Void setLoopFilterBetaOffset( Int i ) { m_loopFilterBetaOffsetDiv2 = i; } |
|---|
| 1309 | Void setLoopFilterTcOffset( Int i ) { m_loopFilterTcOffsetDiv2 = i; } |
|---|
| 1310 | |
|---|
| 1311 | Void setRefPic ( TComPic* p, RefPicList e, Int iRefIdx ) { m_apcRefPicList[e][iRefIdx] = p; } |
|---|
| 1312 | Void setRefPOC ( Int i, RefPicList e, Int iRefIdx ) { m_aiRefPOCList[e][iRefIdx] = i; } |
|---|
| 1313 | Void setRefViewId ( Int i, RefPicList e, Int iRefIdx ) { m_aiRefViewIdList[e][iRefIdx] = i; } |
|---|
| 1314 | Void setTexturePic ( TComPic *pcTexturePic ) { m_pcTexturePic = pcTexturePic; } |
|---|
| 1315 | #if SONY_COLPIC_AVAILABILITY |
|---|
| 1316 | Void setViewOrderIdx ( Int i ) { m_iViewOrderIdx = i; } |
|---|
| 1317 | #endif |
|---|
| 1318 | Void setNumRefIdx ( RefPicList e, Int i ) { m_aiNumRefIdx[e] = i; } |
|---|
| 1319 | Void setPic ( TComPic* p ) { m_pcPic = p; } |
|---|
| 1320 | Void setDepth ( Int iDepth ) { m_iDepth = iDepth; } |
|---|
| 1321 | |
|---|
| 1322 | Int getNumPocTotalCurr(); |
|---|
| 1323 | Int getNumPocTotalCurrMvc(); |
|---|
| 1324 | Void setRefPicListMvc ( TComList<TComPic*>& rcListPic, std::vector<TComPic*>& rapcInterViewRefPics ); |
|---|
| 1325 | Void setRefPOCnViewListsMvc(); |
|---|
| 1326 | |
|---|
| 1327 | Void setColDir ( UInt uiDir ) { m_uiColDir = uiDir; } |
|---|
| 1328 | #if COLLOCATED_REF_IDX |
|---|
| 1329 | Void setColRefIdx ( UInt refIdx) { m_colRefIdx = refIdx; } |
|---|
| 1330 | #endif |
|---|
| 1331 | Void setCheckLDC ( Bool b ) { m_bCheckLDC = b; } |
|---|
| 1332 | #if H0111_MVD_L1_ZERO |
|---|
| 1333 | Void setMvdL1ZeroFlag ( Bool b) { m_bLMvdL1Zero = b; } |
|---|
| 1334 | #endif |
|---|
| 1335 | |
|---|
| 1336 | Bool isIntra () { return m_eSliceType == I_SLICE; } |
|---|
| 1337 | Bool isInterB () { return m_eSliceType == B_SLICE; } |
|---|
| 1338 | Bool isInterP () { return m_eSliceType == P_SLICE; } |
|---|
| 1339 | |
|---|
| 1340 | #if ALF_CHROMA_LAMBDA || SAO_CHROMA_LAMBDA |
|---|
| 1341 | Void setLambda( Double d, Double e ) { m_dLambdaLuma = d; m_dLambdaChroma = e;} |
|---|
| 1342 | Double getLambdaLuma() { return m_dLambdaLuma; } |
|---|
| 1343 | Double getLambdaChroma() { return m_dLambdaChroma; } |
|---|
| 1344 | #else |
|---|
| 1345 | Void setLambda( Double d ) { m_dLambda = d; } |
|---|
| 1346 | Double getLambda() { return m_dLambda; } |
|---|
| 1347 | #endif |
|---|
| 1348 | |
|---|
| 1349 | Void initEqualRef(); |
|---|
| 1350 | Bool isEqualRef ( RefPicList e, Int iRefIdx1, Int iRefIdx2 ) |
|---|
| 1351 | { |
|---|
| 1352 | if (iRefIdx1 < 0 || iRefIdx2 < 0) return false; |
|---|
| 1353 | return m_abEqualRef[e][iRefIdx1][iRefIdx2]; |
|---|
| 1354 | } |
|---|
| 1355 | |
|---|
| 1356 | Void setEqualRef( RefPicList e, Int iRefIdx1, Int iRefIdx2, Bool b) |
|---|
| 1357 | { |
|---|
| 1358 | m_abEqualRef[e][iRefIdx1][iRefIdx2] = m_abEqualRef[e][iRefIdx2][iRefIdx1] = b; |
|---|
| 1359 | } |
|---|
| 1360 | |
|---|
| 1361 | static Void sortPicList ( TComList<TComPic*>& rcListPic ); |
|---|
| 1362 | |
|---|
| 1363 | Bool getNoBackPredFlag() { return m_bNoBackPredFlag; } |
|---|
| 1364 | Void setNoBackPredFlag( Bool b ) { m_bNoBackPredFlag = b; } |
|---|
| 1365 | Bool getRefIdxCombineCoding() { return m_bRefIdxCombineCoding; } |
|---|
| 1366 | Void setRefIdxCombineCoding( Bool b ) { m_bRefIdxCombineCoding = b; } |
|---|
| 1367 | Void generateCombinedList (); |
|---|
| 1368 | |
|---|
| 1369 | UInt getTLayer () { return m_uiTLayer; } |
|---|
| 1370 | Void setTLayer ( UInt uiTLayer ) { m_uiTLayer = uiTLayer; } |
|---|
| 1371 | |
|---|
| 1372 | #if !H0566_TLA |
|---|
| 1373 | Bool getTLayerSwitchingFlag() { return m_bTLayerSwitchingFlag; } |
|---|
| 1374 | Void setTLayerSwitchingFlag( Bool bValue ) { m_bTLayerSwitchingFlag = bValue; } |
|---|
| 1375 | #endif |
|---|
| 1376 | |
|---|
| 1377 | Void setTLayerInfo( UInt uiTLayer ); |
|---|
| 1378 | Void decodingMarking( TComList<TComPic*>& rcListPic, Int iGOPSIze, Int& iMaxRefPicNum ); |
|---|
| 1379 | Void applyReferencePictureSet( TComList<TComPic*>& rcListPic, TComReferencePictureSet *RPSList); |
|---|
| 1380 | #if H0566_TLA && H0566_TLA_SET_FOR_SWITCHING_POINTS |
|---|
| 1381 | Bool isTemporalLayerSwitchingPoint( TComList<TComPic*>& rcListPic, TComReferencePictureSet *RPSList); |
|---|
| 1382 | #endif |
|---|
| 1383 | #if START_DECODING_AT_CRA |
|---|
| 1384 | Int checkThatAllRefPicsAreAvailable( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool outputFlag, Int pocRandomAccess = 0); |
|---|
| 1385 | #else |
|---|
| 1386 | Int checkThatAllRefPicsAreAvailable( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet, Bool outputFlag); |
|---|
| 1387 | #endif |
|---|
| 1388 | Void createExplicitReferencePictureSetFromReference( TComList<TComPic*>& rcListPic, TComReferencePictureSet *pReferencePictureSet); |
|---|
| 1389 | |
|---|
| 1390 | Void decodingMarkingForNoTMVP( TComList<TComPic*>& rcListPic, Int currentPOC ); |
|---|
| 1391 | |
|---|
| 1392 | UInt m_uiMaxNumMergeCand; |
|---|
| 1393 | Void setMaxNumMergeCand (UInt maxNumMergeCand ) { m_uiMaxNumMergeCand = maxNumMergeCand; } |
|---|
| 1394 | UInt getMaxNumMergeCand () {return m_uiMaxNumMergeCand; } |
|---|
| 1395 | |
|---|
| 1396 | Void setSliceMode ( UInt uiMode ) { m_uiSliceMode = uiMode; } |
|---|
| 1397 | UInt getSliceMode () { return m_uiSliceMode; } |
|---|
| 1398 | Void setSliceArgument ( UInt uiArgument ) { m_uiSliceArgument = uiArgument; } |
|---|
| 1399 | UInt getSliceArgument () { return m_uiSliceArgument; } |
|---|
| 1400 | Void setSliceCurStartCUAddr ( UInt uiAddr ) { m_uiSliceCurStartCUAddr = uiAddr; } |
|---|
| 1401 | UInt getSliceCurStartCUAddr () { return m_uiSliceCurStartCUAddr; } |
|---|
| 1402 | Void setSliceCurEndCUAddr ( UInt uiAddr ) { m_uiSliceCurEndCUAddr = uiAddr; } |
|---|
| 1403 | UInt getSliceCurEndCUAddr () { return m_uiSliceCurEndCUAddr; } |
|---|
| 1404 | Void setSliceIdx ( UInt i) { m_uiSliceIdx = i; } |
|---|
| 1405 | UInt getSliceIdx () { return m_uiSliceIdx; } |
|---|
| 1406 | Void copySliceInfo (TComSlice *pcSliceSrc); |
|---|
| 1407 | Void setEntropySliceMode ( UInt uiMode ) { m_uiEntropySliceMode = uiMode; } |
|---|
| 1408 | UInt getEntropySliceMode () { return m_uiEntropySliceMode; } |
|---|
| 1409 | Void setEntropySliceArgument ( UInt uiArgument ) { m_uiEntropySliceArgument = uiArgument; } |
|---|
| 1410 | UInt getEntropySliceArgument () { return m_uiEntropySliceArgument; } |
|---|
| 1411 | Void setEntropySliceCurStartCUAddr ( UInt uiAddr ) { m_uiEntropySliceCurStartCUAddr = uiAddr; } |
|---|
| 1412 | UInt getEntropySliceCurStartCUAddr () { return m_uiEntropySliceCurStartCUAddr; } |
|---|
| 1413 | Void setEntropySliceCurEndCUAddr ( UInt uiAddr ) { m_uiEntropySliceCurEndCUAddr = uiAddr; } |
|---|
| 1414 | UInt getEntropySliceCurEndCUAddr () { return m_uiEntropySliceCurEndCUAddr; } |
|---|
| 1415 | Void setNextSlice ( Bool b ) { m_bNextSlice = b; } |
|---|
| 1416 | Bool isNextSlice () { return m_bNextSlice; } |
|---|
| 1417 | Void setNextEntropySlice ( Bool b ) { m_bNextEntropySlice = b; } |
|---|
| 1418 | Bool isNextEntropySlice () { return m_bNextEntropySlice; } |
|---|
| 1419 | Void setSliceBits ( UInt uiVal ) { m_uiSliceBits = uiVal; } |
|---|
| 1420 | UInt getSliceBits () { return m_uiSliceBits; } |
|---|
| 1421 | Void setEntropySliceCounter ( UInt uiVal ) { m_uiEntropySliceCounter = uiVal; } |
|---|
| 1422 | UInt getEntropySliceCounter () { return m_uiEntropySliceCounter; } |
|---|
| 1423 | Void setFinalized ( Bool uiVal ) { m_bFinalized = uiVal; } |
|---|
| 1424 | Bool getFinalized () { return m_bFinalized; } |
|---|
| 1425 | Void setWpScaling ( wpScalingParam wp[2][MAX_NUM_REF][3] ) { memcpy(m_weightPredTable, wp, sizeof(wpScalingParam)*2*MAX_NUM_REF*3); } |
|---|
| 1426 | Void getWpScaling ( RefPicList e, Int iRefIdx, wpScalingParam *&wp); |
|---|
| 1427 | |
|---|
| 1428 | Void resetWpScaling (wpScalingParam wp[2][MAX_NUM_REF][3]); |
|---|
| 1429 | Void initWpScaling (wpScalingParam wp[2][MAX_NUM_REF][3]); |
|---|
| 1430 | Void initWpScaling (); |
|---|
| 1431 | inline Bool applyWP () { return( (m_eSliceType==P_SLICE && m_pcPPS->getUseWP()) || (m_eSliceType==B_SLICE && m_pcPPS->getWPBiPredIdc()) ); } |
|---|
| 1432 | |
|---|
| 1433 | Void setWpAcDcParam ( wpACDCParam wp[3] ) { memcpy(m_weightACDCParam, wp, sizeof(wpACDCParam)*3); } |
|---|
| 1434 | Void getWpAcDcParam ( wpACDCParam *&wp ); |
|---|
| 1435 | Void initWpAcDcParam (); |
|---|
| 1436 | Void copyWPtable (wpScalingParam *&wp_src, wpScalingParam *&wp_dst); |
|---|
| 1437 | Void getWpScalingLC ( Int iRefIdx, wpScalingParam *&wp); |
|---|
| 1438 | Void resetWpScalingLC(wpScalingParam wp[2*MAX_NUM_REF][3]); |
|---|
| 1439 | Void setWpParamforLC(); |
|---|
| 1440 | Void setTileLocationCount ( UInt uiCount ) { m_uiTileCount = uiCount; } |
|---|
| 1441 | UInt getTileLocationCount () { return m_uiTileCount; } |
|---|
| 1442 | Void setTileLocation ( Int i, UInt uiLOC ) { m_uiTileByteLocation[i] = uiLOC; } |
|---|
| 1443 | UInt getTileLocation ( Int i ) { return m_uiTileByteLocation[i]; } |
|---|
| 1444 | Void setTileMarkerFlag ( Int iFlag ) { m_iTileMarkerFlag = iFlag; } |
|---|
| 1445 | Int getTileMarkerFlag () { return m_iTileMarkerFlag; } |
|---|
| 1446 | Void setTileOffstForMultES (UInt uiOffset ) { m_uiTileOffstForMultES = uiOffset; } |
|---|
| 1447 | UInt getTileOffstForMultES () { return m_uiTileOffstForMultES; } |
|---|
| 1448 | Void allocSubstreamSizes ( UInt uiNumSubstreams ); |
|---|
| 1449 | UInt* getSubstreamSizes () { return m_puiSubstreamSizes; } |
|---|
| 1450 | Void setScalingList ( TComScalingList* scalingList ) { m_scalingList = scalingList; } |
|---|
| 1451 | TComScalingList* getScalingList () { return m_scalingList; } |
|---|
| 1452 | Void setDefaultScalingList (); |
|---|
| 1453 | Bool checkDefaultScalingList (); |
|---|
| 1454 | #if CABAC_INIT_FLAG |
|---|
| 1455 | Void setCabacInitFlag ( Bool val ) { m_cabacInitFlag = val; } //!< set CABAC initial flag |
|---|
| 1456 | Bool getCabacInitFlag () { return m_cabacInitFlag; } //!< get CABAC initial flag |
|---|
| 1457 | #else |
|---|
| 1458 | Void setCABACinitIDC(Int iVal) {m_cabacInitIdc = iVal; } //!< set CABAC initial IDC number |
|---|
| 1459 | Int getCABACinitIDC() {return m_cabacInitIdc; } //!< get CABAC initial IDC number |
|---|
| 1460 | #endif |
|---|
| 1461 | #if TILES_WPP_ENTRY_POINT_SIGNALLING |
|---|
| 1462 | Void setNumEntryPointOffsets(Int val) { m_numEntryPointOffsets = val; } |
|---|
| 1463 | Int getNumEntryPointOffsets() { return m_numEntryPointOffsets; } |
|---|
| 1464 | #endif |
|---|
| 1465 | |
|---|
| 1466 | Void setViewId( Int viewId ) { m_viewId = viewId; } |
|---|
| 1467 | Int getViewId() { return m_viewId; } |
|---|
| 1468 | Void setIsDepth( Bool isDepth ) { m_isDepth = isDepth; } |
|---|
| 1469 | Bool getIsDepth() { return m_isDepth; } |
|---|
| 1470 | |
|---|
| 1471 | Void initMultiviewSlice ( Int** aaiScale = 0, Int** aaiOffset = 0 ); |
|---|
| 1472 | |
|---|
| 1473 | Int* getCodedScale () { return m_aaiCodedScale [0]; } |
|---|
| 1474 | Int* getCodedOffset () { return m_aaiCodedOffset[0]; } |
|---|
| 1475 | Int* getInvCodedScale () { return m_aaiCodedScale [1]; } |
|---|
| 1476 | Int* getInvCodedOffset () { return m_aaiCodedOffset[1]; } |
|---|
| 1477 | |
|---|
| 1478 | protected: |
|---|
| 1479 | TComPic* xGetRefPic (TComList<TComPic*>& rcListPic, UInt uiPOC); |
|---|
| 1480 | TComPic* xGetLongTermRefPic(TComList<TComPic*>& rcListPic, UInt uiPOC); |
|---|
| 1481 | TComPic* xGetInterViewRefPic( std::vector<TComPic*>& rcListIvPic, UInt uiViewId ); |
|---|
| 1482 | };// END CLASS DEFINITION TComSlice |
|---|
| 1483 | |
|---|
| 1484 | |
|---|
| 1485 | template <class T> class ParameterSetMap |
|---|
| 1486 | { |
|---|
| 1487 | public: |
|---|
| 1488 | ParameterSetMap(Int maxId) |
|---|
| 1489 | :m_maxId (maxId) |
|---|
| 1490 | {} |
|---|
| 1491 | |
|---|
| 1492 | ~ParameterSetMap() |
|---|
| 1493 | { |
|---|
| 1494 | for (typename std::map<Int,T *>::iterator i = m_paramsetMap.begin(); i!= m_paramsetMap.end(); i++) |
|---|
| 1495 | { |
|---|
| 1496 | delete (*i).second; |
|---|
| 1497 | } |
|---|
| 1498 | } |
|---|
| 1499 | |
|---|
| 1500 | Void storePS(Int psId, T *ps) |
|---|
| 1501 | { |
|---|
| 1502 | assert ( psId < m_maxId ); |
|---|
| 1503 | if ( m_paramsetMap.find(psId) != m_paramsetMap.end() ) |
|---|
| 1504 | { |
|---|
| 1505 | delete m_paramsetMap[psId]; |
|---|
| 1506 | } |
|---|
| 1507 | m_paramsetMap[psId] = ps; |
|---|
| 1508 | } |
|---|
| 1509 | |
|---|
| 1510 | Void mergePSList(ParameterSetMap<T> &rPsList) |
|---|
| 1511 | { |
|---|
| 1512 | for (typename std::map<Int,T *>::iterator i = rPsList.m_paramsetMap.begin(); i!= rPsList.m_paramsetMap.end(); i++) |
|---|
| 1513 | { |
|---|
| 1514 | storePS(i->first, i->second); |
|---|
| 1515 | } |
|---|
| 1516 | rPsList.m_paramsetMap.clear(); |
|---|
| 1517 | } |
|---|
| 1518 | |
|---|
| 1519 | |
|---|
| 1520 | T* getPS(Int psId) |
|---|
| 1521 | { |
|---|
| 1522 | return ( m_paramsetMap.find(psId) == m_paramsetMap.end() ) ? NULL : m_paramsetMap[psId]; |
|---|
| 1523 | } |
|---|
| 1524 | |
|---|
| 1525 | T* getFirstPS() |
|---|
| 1526 | { |
|---|
| 1527 | return (m_paramsetMap.begin() == m_paramsetMap.end() ) ? NULL : m_paramsetMap.begin()->second; |
|---|
| 1528 | } |
|---|
| 1529 | |
|---|
| 1530 | private: |
|---|
| 1531 | std::map<Int,T *> m_paramsetMap; |
|---|
| 1532 | Int m_maxId; |
|---|
| 1533 | }; |
|---|
| 1534 | |
|---|
| 1535 | class ParameterSetManager |
|---|
| 1536 | { |
|---|
| 1537 | public: |
|---|
| 1538 | ParameterSetManager(); |
|---|
| 1539 | virtual ~ParameterSetManager(); |
|---|
| 1540 | |
|---|
| 1541 | //! store sequence parameter set and take ownership of it |
|---|
| 1542 | Void storeSPS(TComSPS *sps) { m_spsMap.storePS( sps->getSPSId(), sps); }; |
|---|
| 1543 | //! get pointer to existing sequence parameter set |
|---|
| 1544 | TComSPS* getSPS(Int spsId) { return m_spsMap.getPS(spsId); }; |
|---|
| 1545 | TComSPS* getFirstSPS() { return m_spsMap.getFirstPS(); }; |
|---|
| 1546 | |
|---|
| 1547 | //! store picture parameter set and take ownership of it |
|---|
| 1548 | Void storePPS(TComPPS *pps) { m_ppsMap.storePS( pps->getPPSId(), pps); }; |
|---|
| 1549 | //! get pointer to existing picture parameter set |
|---|
| 1550 | TComPPS* getPPS(Int ppsId) { return m_ppsMap.getPS(ppsId); }; |
|---|
| 1551 | TComPPS* getFirstPPS() { return m_ppsMap.getFirstPS(); }; |
|---|
| 1552 | |
|---|
| 1553 | //! store adaptation parameter set and take ownership of it |
|---|
| 1554 | Void storeAPS(TComAPS *aps) { m_apsMap.storePS( aps->getAPSID(), aps); }; |
|---|
| 1555 | //! getPointer to existing adaptation parameter set |
|---|
| 1556 | TComAPS* getAPS(Int apsId) { return m_apsMap.getPS(apsId); }; |
|---|
| 1557 | |
|---|
| 1558 | protected: |
|---|
| 1559 | ParameterSetMap<TComSPS> m_spsMap; |
|---|
| 1560 | ParameterSetMap<TComPPS> m_ppsMap; |
|---|
| 1561 | ParameterSetMap<TComAPS> m_apsMap; |
|---|
| 1562 | }; |
|---|
| 1563 | |
|---|
| 1564 | //! \} |
|---|
| 1565 | |
|---|
| 1566 | #endif // __TCOMSLICE__ |
|---|