[313] | 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 |
---|
[1029] | 4 | * granted under this license. |
---|
[313] | 5 | * |
---|
[595] | 6 | * Copyright (c) 2010-2014, ITU/ISO/IEC |
---|
[313] | 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 TAppEncCfg.h |
---|
| 35 | \brief Handle encoder configuration parameters (header) |
---|
| 36 | */ |
---|
| 37 | |
---|
| 38 | #ifndef __TAPPENCCFG__ |
---|
| 39 | #define __TAPPENCCFG__ |
---|
| 40 | |
---|
| 41 | #include "TLibCommon/CommonDef.h" |
---|
| 42 | |
---|
| 43 | #include "TLibEncoder/TEncCfg.h" |
---|
| 44 | #if SVC_EXTENSION |
---|
| 45 | #include "TAppEncLayerCfg.h" |
---|
| 46 | #endif |
---|
| 47 | #include <sstream> |
---|
[823] | 48 | #include <vector> |
---|
[313] | 49 | //! \ingroup TAppEncoder |
---|
| 50 | //! \{ |
---|
| 51 | |
---|
| 52 | // ==================================================================================================================== |
---|
| 53 | // Class definition |
---|
| 54 | // ==================================================================================================================== |
---|
| 55 | |
---|
| 56 | /// encoder configuration class |
---|
| 57 | class TAppEncCfg |
---|
| 58 | { |
---|
| 59 | protected: |
---|
| 60 | // file I/O |
---|
| 61 | #if SVC_EXTENSION |
---|
[442] | 62 | TAppEncLayerCfg m_acLayerCfg [MAX_LAYERS]; |
---|
[1057] | 63 | Int m_layerId; |
---|
[313] | 64 | Int m_numLayers; ///< number of layers |
---|
| 65 | Int m_scalabilityMask[MAX_VPS_NUM_SCALABILITY_TYPES]; ///< scalability_mask |
---|
| 66 | Char* m_pBitstreamFile; ///< output bitstream file |
---|
| 67 | Double m_adLambdaModifier[ MAX_TLAYER ]; ///< Lambda modifier array for each temporal layer |
---|
| 68 | // source specification |
---|
| 69 | UInt m_FrameSkip; ///< number of skipped frames from the beginning |
---|
| 70 | Int m_framesToBeEncoded; ///< number of encoded frames |
---|
| 71 | #if AVC_BASE |
---|
[874] | 72 | #if VPS_AVC_BL_FLAG_REMOVAL |
---|
| 73 | Int m_nonHEVCBaseLayerFlag; ///< non HEVC BL |
---|
| 74 | #else |
---|
[442] | 75 | Int m_avcBaseLayerFlag; ///< avc_baselayer_flag |
---|
[313] | 76 | #endif |
---|
[874] | 77 | #endif |
---|
[442] | 78 | Bool m_maxTidRefPresentFlag; |
---|
[815] | 79 | #if Q0078_ADD_LAYER_SETS |
---|
| 80 | Int m_numLayerSets; |
---|
| 81 | Int m_numLayerInIdList[MAX_VPS_LAYER_SETS_PLUS1]; |
---|
[1045] | 82 | Int m_layerSetLayerIdList[MAX_VPS_LAYER_SETS_PLUS1][MAX_VPS_LAYER_IDX_PLUS1]; |
---|
[815] | 83 | Int m_numAddLayerSets; |
---|
| 84 | Int m_numHighestLayerIdx[MAX_VPS_LAYER_SETS_PLUS1]; |
---|
[1045] | 85 | Int m_highestLayerIdx[MAX_VPS_LAYER_SETS_PLUS1][MAX_VPS_LAYER_IDX_PLUS1]; |
---|
[815] | 86 | #endif |
---|
[861] | 87 | #if OUTPUT_LAYER_SETS_CONFIG |
---|
| 88 | std::vector<Int> m_outputLayerSetIdx; |
---|
| 89 | Int m_defaultTargetOutputLayerIdc; |
---|
| 90 | Int m_numOutputLayerSets; |
---|
[950] | 91 | std::vector<Int> m_numOutputLayersInOutputLayerSet; |
---|
[861] | 92 | std::vector< std::vector<Int> > m_listOfOutputLayers; |
---|
| 93 | #endif |
---|
[1029] | 94 | Bool m_isField; ///< enable field coding |
---|
| 95 | Bool m_isTopFieldFirst; |
---|
[313] | 96 | #else |
---|
| 97 | Char* m_pchInputFile; ///< source file name |
---|
| 98 | Char* m_pchBitstreamFile; ///< output bitstream file |
---|
| 99 | Char* m_pchReconFile; ///< output reconstruction file |
---|
| 100 | Double m_adLambdaModifier[ MAX_TLAYER ]; ///< Lambda modifier array for each temporal layer |
---|
| 101 | // source specification |
---|
| 102 | Int m_iFrameRate; ///< source frame-rates (Hz) |
---|
[1029] | 103 | UInt m_FrameSkip; ///< number of skipped frames from the beginning |
---|
[313] | 104 | Int m_iSourceWidth; ///< source width in pixel |
---|
[442] | 105 | Int m_iSourceHeight; ///< source height in pixel (when interlaced = field height) |
---|
[1029] | 106 | |
---|
[442] | 107 | Int m_iSourceHeightOrg; ///< original source height in pixel (when interlaced = frame height) |
---|
[1029] | 108 | |
---|
| 109 | Bool m_isField; ///< enable field coding |
---|
| 110 | Bool m_isTopFieldFirst; |
---|
| 111 | |
---|
[823] | 112 | Int m_conformanceWindowMode; |
---|
| 113 | Int m_confWinLeft; |
---|
| 114 | Int m_confWinRight; |
---|
| 115 | Int m_confWinTop; |
---|
| 116 | Int m_confWinBottom; |
---|
[313] | 117 | Int m_framesToBeEncoded; ///< number of encoded frames |
---|
| 118 | Int m_aiPad[2]; ///< number of padded pixels for width and height |
---|
| 119 | #endif |
---|
[1029] | 120 | InputColourSpaceConversion m_inputColourSpaceConvert; ///< colour space conversion to apply to input video |
---|
| 121 | Bool m_snrInternalColourSpace; ///< if true, then no colour space conversion is applied for snr calculation, otherwise inverse of input is applied. |
---|
| 122 | Bool m_outputInternalColourSpace; ///< if true, then no colour space conversion is applied for reconstructed video, otherwise inverse of input is applied. |
---|
| 123 | #if !SVC_EXTENSION |
---|
[494] | 124 | ChromaFormat m_InputChromaFormatIDC; |
---|
| 125 | #endif |
---|
[442] | 126 | |
---|
[1029] | 127 | Bool m_printMSEBasedSequencePSNR; |
---|
| 128 | Bool m_printFrameMSE; |
---|
| 129 | Bool m_printSequenceMSE; |
---|
| 130 | Bool m_cabacZeroWordPaddingEnabled; |
---|
| 131 | |
---|
| 132 | #if MULTIPLE_PTL_SUPPORT |
---|
[941] | 133 | Int m_numPTLInfo; |
---|
[951] | 134 | Profile::Name m_profileList[MAX_NUM_LAYER_IDS + 1]; |
---|
| 135 | Level::Tier m_levelTierList[MAX_NUM_LAYER_IDS + 1]; |
---|
| 136 | Level::Name m_levelList[MAX_NUM_LAYER_IDS + 1]; |
---|
| 137 | Profile::Name m_profileCompatibility[MAX_NUM_LAYER_IDS + 1]; |
---|
| 138 | Bool m_progressiveSourceFlagList[MAX_NUM_LAYER_IDS + 1]; |
---|
| 139 | Bool m_interlacedSourceFlagList[MAX_NUM_LAYER_IDS + 1]; |
---|
| 140 | Bool m_nonPackedConstraintFlagList[MAX_NUM_LAYER_IDS + 1]; |
---|
| 141 | Bool m_frameOnlyConstraintFlagList[MAX_NUM_LAYER_IDS + 1]; |
---|
[941] | 142 | |
---|
| 143 | std::vector< std::vector<Int> > m_listOfLayerPTLofOlss; |
---|
[942] | 144 | #else |
---|
[1029] | 145 | // profile/level |
---|
[942] | 146 | Profile::Name m_profile; |
---|
| 147 | Level::Tier m_levelTier; |
---|
| 148 | Level::Name m_level; |
---|
[1029] | 149 | UInt m_bitDepthConstraint; |
---|
| 150 | ChromaFormat m_chromaFormatConstraint; |
---|
| 151 | Bool m_intraConstraintFlag; |
---|
| 152 | Bool m_lowerBitRateConstraintFlag; |
---|
[942] | 153 | Bool m_progressiveSourceFlag; |
---|
| 154 | Bool m_interlacedSourceFlag; |
---|
| 155 | Bool m_nonPackedConstraintFlag; |
---|
| 156 | Bool m_frameOnlyConstraintFlag; |
---|
[941] | 157 | #endif |
---|
[942] | 158 | |
---|
[313] | 159 | // coding structure |
---|
| 160 | #if !SVC_EXTENSION |
---|
| 161 | Int m_iIntraPeriod; ///< period of I-slice (random access period) |
---|
| 162 | #endif |
---|
| 163 | Int m_iDecodingRefreshType; ///< random access type |
---|
| 164 | Int m_iGOPSize; ///< GOP size of hierarchical structure |
---|
[815] | 165 | |
---|
| 166 | #if !Q0108_TSA_STSA |
---|
[313] | 167 | Int m_extraRPSs; ///< extra RPSs added to handle CRA |
---|
[815] | 168 | #else |
---|
| 169 | Int m_extraRPSs[MAX_LAYERS]; ///< extra RPSs added to handle CRA |
---|
| 170 | #endif |
---|
| 171 | |
---|
[313] | 172 | GOPEntry m_GOPList[MAX_GOP]; ///< the coding structure entries from the config file |
---|
[815] | 173 | #if Q0108_TSA_STSA |
---|
| 174 | GOPEntry m_EhGOPList[MAX_LAYERS][MAX_GOP]; ///< the enhancement layer coding structure entries from the config file |
---|
| 175 | Int m_inheritCodingStruct[MAX_LAYERS]; |
---|
| 176 | #endif |
---|
| 177 | |
---|
[313] | 178 | Int m_numReorderPics[MAX_TLAYER]; ///< total number of reorder pictures |
---|
| 179 | Int m_maxDecPicBuffering[MAX_TLAYER]; ///< total number of pictures in the decoded picture buffer |
---|
[1029] | 180 | Bool m_useCrossComponentPrediction; ///< flag enabling the use of cross-component prediction |
---|
| 181 | Bool m_reconBasedCrossCPredictionEstimate; ///< causes the alpha calculation in encoder search to be based on the decoded residual rather than the pre-transform encoder-side residual |
---|
| 182 | UInt m_saoOffsetBitShift[MAX_NUM_CHANNEL_TYPE]; ///< number of bits for the upward bit shift operation on the decoded SAO offsets |
---|
[313] | 183 | Bool m_useTransformSkip; ///< flag for enabling intra transform skipping |
---|
| 184 | Bool m_useTransformSkipFast; ///< flag for enabling fast intra transform skipping |
---|
[1029] | 185 | UInt m_transformSkipLog2MaxSize; ///< transform-skip maximum size (minimum of 2) |
---|
| 186 | Bool m_useResidualRotation; ///< control flag for transform-skip/transquant-bypass residual rotation |
---|
| 187 | Bool m_useSingleSignificanceMapContext; ///< control flag for transform-skip/transquant-bypass single significance map context |
---|
| 188 | Bool m_useResidualDPCM[NUMBER_OF_RDPCM_SIGNALLING_MODES];///< control flags for residual DPCM |
---|
[313] | 189 | Bool m_enableAMP; |
---|
[1029] | 190 | Bool m_useGolombRiceParameterAdaptation; ///< control flag for Golomb-Rice parameter adaptation over each slice |
---|
| 191 | Bool m_alignCABACBeforeBypass; |
---|
| 192 | |
---|
[313] | 193 | // coding quality |
---|
| 194 | #if !SVC_EXTENSION |
---|
| 195 | Double m_fQP; ///< QP value of key-picture (floating point) |
---|
| 196 | Int m_iQP; ///< QP value of key-picture (integer) |
---|
| 197 | Char* m_pchdQPFile; ///< QP offset for each slice (initialized from external file) |
---|
| 198 | Int* m_aidQP; ///< array of slice QP values |
---|
| 199 | #endif |
---|
| 200 | Int m_iMaxDeltaQP; ///< max. |delta QP| |
---|
| 201 | UInt m_uiDeltaQpRD; ///< dQP range for multi-pass slice QP optimization |
---|
| 202 | Int m_iMaxCuDQPDepth; ///< Max. depth for a minimum CuDQPSize (0:default) |
---|
[1029] | 203 | Int m_maxCUChromaQpAdjustmentDepth; |
---|
[313] | 204 | |
---|
[1029] | 205 | Int m_cbQpOffset; ///< Chroma Cb QP Offset (0:default) |
---|
[313] | 206 | Int m_crQpOffset; ///< Chroma Cr QP Offset (0:default) |
---|
| 207 | |
---|
| 208 | #if ADAPTIVE_QP_SELECTION |
---|
| 209 | Bool m_bUseAdaptQpSelect; |
---|
| 210 | #endif |
---|
[1029] | 211 | TComSEIMasteringDisplay m_masteringDisplay; |
---|
[313] | 212 | |
---|
| 213 | Bool m_bUseAdaptiveQP; ///< Flag for enabling QP adaptation based on a psycho-visual model |
---|
| 214 | Int m_iQPAdaptationRange; ///< dQP range by QP adaptation |
---|
[1029] | 215 | |
---|
[313] | 216 | Int m_maxTempLayer; ///< Max temporal layer |
---|
[815] | 217 | #if Q0108_TSA_STSA |
---|
| 218 | Int m_EhMaxTempLayer[MAX_LAYERS]; ///< Max temporal layer |
---|
| 219 | #endif |
---|
[313] | 220 | |
---|
[494] | 221 | #if !LAYER_CTB |
---|
[313] | 222 | // coding unit (CU) definition |
---|
[1029] | 223 | // TODO: Remove MaxCUWidth/MaxCUHeight and replace with MaxCUSize. |
---|
[313] | 224 | UInt m_uiMaxCUWidth; ///< max. CU width in pixel |
---|
| 225 | UInt m_uiMaxCUHeight; ///< max. CU height in pixel |
---|
| 226 | UInt m_uiMaxCUDepth; ///< max. CU depth |
---|
[1029] | 227 | |
---|
[313] | 228 | // transfom unit (TU) definition |
---|
| 229 | UInt m_uiQuadtreeTULog2MaxSize; |
---|
| 230 | UInt m_uiQuadtreeTULog2MinSize; |
---|
[1029] | 231 | |
---|
[313] | 232 | UInt m_uiQuadtreeTUMaxDepthInter; |
---|
| 233 | UInt m_uiQuadtreeTUMaxDepthIntra; |
---|
[494] | 234 | #endif |
---|
[313] | 235 | |
---|
| 236 | // coding tools (bit-depth) |
---|
[494] | 237 | #if !O0194_DIFFERENT_BITDEPTH_EL_BL |
---|
[1029] | 238 | Int m_inputBitDepth [MAX_NUM_CHANNEL_TYPE]; ///< bit-depth of input file |
---|
| 239 | Int m_outputBitDepth [MAX_NUM_CHANNEL_TYPE]; ///< bit-depth of output file |
---|
| 240 | Int m_MSBExtendedBitDepth[MAX_NUM_CHANNEL_TYPE]; ///< bit-depth of input samples after MSB extension |
---|
| 241 | Int m_internalBitDepth[MAX_NUM_CHANNEL_TYPE]; ///< bit-depth codec operates at (input/output files will be converted) |
---|
| 242 | Bool m_useExtendedPrecision; |
---|
| 243 | Bool m_useHighPrecisionPredictionWeighting; |
---|
[494] | 244 | #endif |
---|
[1029] | 245 | //coding tools (chroma format) |
---|
| 246 | #if !SVC_EXTENSION |
---|
[494] | 247 | ChromaFormat m_chromaFormatIDC; |
---|
| 248 | #endif |
---|
[313] | 249 | |
---|
| 250 | // coding tools (PCM bit-depth) |
---|
| 251 | Bool m_bPCMInputBitDepthFlag; ///< 0: PCM bit-depth is internal bit-depth. 1: PCM bit-depth is input bit-depth. |
---|
| 252 | |
---|
[595] | 253 | // coding tool (SAO) |
---|
[1029] | 254 | Bool m_bUseSAO; |
---|
[313] | 255 | Int m_maxNumOffsetsPerPic; ///< SAO maximun number of offset per picture |
---|
[1029] | 256 | Bool m_saoCtuBoundary; ///< SAO parameter estimation using non-deblocked pixels for CTU bottom and right boundary areas |
---|
[313] | 257 | // coding tools (loop filter) |
---|
| 258 | Bool m_bLoopFilterDisable; ///< flag for using deblocking filter |
---|
| 259 | Bool m_loopFilterOffsetInPPS; ///< offset for deblocking filter in 0 = slice header, 1 = PPS |
---|
| 260 | Int m_loopFilterBetaOffsetDiv2; ///< beta offset for deblocking filter |
---|
| 261 | Int m_loopFilterTcOffsetDiv2; ///< tc offset for deblocking filter |
---|
| 262 | Bool m_DeblockingFilterControlPresent; ///< deblocking filter control present flag in PPS |
---|
| 263 | Bool m_DeblockingFilterMetric; ///< blockiness metric in encoder |
---|
[1029] | 264 | |
---|
[313] | 265 | // coding tools (PCM) |
---|
| 266 | Bool m_usePCM; ///< flag for using IPCM |
---|
| 267 | UInt m_pcmLog2MaxSize; ///< log2 of maximum PCM block size |
---|
| 268 | UInt m_uiPCMLog2MinSize; ///< log2 of minimum PCM block size |
---|
| 269 | Bool m_bPCMFilterDisableFlag; ///< PCM filter disable flag |
---|
[1029] | 270 | Bool m_enableIntraReferenceSmoothing; ///< flag for enabling(default)/disabling intra reference smoothing/filtering |
---|
[313] | 271 | |
---|
| 272 | // coding tools (encoder-only parameters) |
---|
| 273 | Bool m_bUseASR; ///< flag for using adaptive motion search range |
---|
| 274 | Bool m_bUseHADME; ///< flag for using HAD in sub-pel ME |
---|
| 275 | Bool m_useRDOQ; ///< flag for using RD optimized quantization |
---|
| 276 | Bool m_useRDOQTS; ///< flag for using RD optimized quantization for transform skip |
---|
[1029] | 277 | Int m_rdPenalty; ///< RD-penalty for 32x32 TU for intra in non-intra slices (0: no RD-penalty, 1: RD-penalty, 2: maximum RD-penalty) |
---|
[313] | 278 | Int m_iFastSearch; ///< ME mode, 0 = full, 1 = diamond, 2 = PMVFAST |
---|
| 279 | Int m_iSearchRange; ///< ME search range |
---|
| 280 | Int m_bipredSearchRange; ///< ME search range for bipred refinement |
---|
| 281 | Bool m_bUseFastEnc; ///< flag for using fast encoder setting |
---|
| 282 | Bool m_bUseEarlyCU; ///< flag for using Early CU setting |
---|
[1029] | 283 | Bool m_useFastDecisionForMerge; ///< flag for using Fast Decision Merge RD-Cost |
---|
[313] | 284 | Bool m_bUseCbfFastMode; ///< flag for using Cbf Fast PU Mode Decision |
---|
| 285 | Bool m_useEarlySkipDetection; ///< flag for using Early SKIP Detection |
---|
[1029] | 286 | Int m_sliceMode; ///< 0: no slice limits, 1 : max number of CTBs per slice, 2: max number of bytes per slice, |
---|
[313] | 287 | ///< 3: max number of tiles per slice |
---|
| 288 | Int m_sliceArgument; ///< argument according to selected slice mode |
---|
[1029] | 289 | Int m_sliceSegmentMode; ///< 0: no slice segment limits, 1 : max number of CTBs per slice segment, 2: max number of bytes per slice segment, |
---|
[313] | 290 | ///< 3: max number of tiles per slice segment |
---|
| 291 | Int m_sliceSegmentArgument; ///< argument according to selected slice segment mode |
---|
| 292 | |
---|
| 293 | Bool m_bLFCrossSliceBoundaryFlag; ///< 1: filter across slice boundaries 0: do not filter across slice boundaries |
---|
| 294 | Bool m_bLFCrossTileBoundaryFlag; ///< 1: filter across tile boundaries 0: do not filter across tile boundaries |
---|
[823] | 295 | Bool m_tileUniformSpacingFlag; |
---|
| 296 | Int m_numTileColumnsMinus1; |
---|
| 297 | Int m_numTileRowsMinus1; |
---|
| 298 | std::vector<Int> m_tileColumnWidth; |
---|
| 299 | std::vector<Int> m_tileRowHeight; |
---|
[875] | 300 | #if !SVC_EXTENSION |
---|
[313] | 301 | Int m_iWaveFrontSynchro; //< 0: no WPP. >= 1: WPP is enabled, the "Top right" from which inheritance occurs is this LCU offset in the line above the current. |
---|
[1029] | 302 | Int m_iWaveFrontFlush; //< enable(1)/disable(0) the CABAC flush at the end of each line of LCUs. |
---|
[313] | 303 | Int m_iWaveFrontSubstreams; //< If iWaveFrontSynchro, this is the number of substreams per frame (dependent tiles) or per tile (independent tiles). |
---|
| 304 | #endif |
---|
| 305 | Bool m_bUseConstrainedIntraPred; ///< flag for using constrained intra prediction |
---|
[1029] | 306 | |
---|
[313] | 307 | Int m_decodedPictureHashSEIEnabled; ///< Checksum(3)/CRC(2)/MD5(1)/disable(0) acting on decoded picture hash SEI message |
---|
| 308 | Int m_recoveryPointSEIEnabled; |
---|
| 309 | Int m_bufferingPeriodSEIEnabled; |
---|
| 310 | Int m_pictureTimingSEIEnabled; |
---|
| 311 | Bool m_toneMappingInfoSEIEnabled; |
---|
[1029] | 312 | Bool m_chromaSamplingFilterSEIenabled; |
---|
| 313 | Int m_chromaSamplingHorFilterIdc; |
---|
| 314 | Int m_chromaSamplingVerFilterIdc; |
---|
[313] | 315 | Int m_toneMapId; |
---|
| 316 | Bool m_toneMapCancelFlag; |
---|
| 317 | Bool m_toneMapPersistenceFlag; |
---|
| 318 | Int m_toneMapCodedDataBitDepth; |
---|
| 319 | Int m_toneMapTargetBitDepth; |
---|
[1029] | 320 | Int m_toneMapModelId; |
---|
[313] | 321 | Int m_toneMapMinValue; |
---|
| 322 | Int m_toneMapMaxValue; |
---|
| 323 | Int m_sigmoidMidpoint; |
---|
| 324 | Int m_sigmoidWidth; |
---|
| 325 | Int m_numPivots; |
---|
| 326 | Int m_cameraIsoSpeedIdc; |
---|
| 327 | Int m_cameraIsoSpeedValue; |
---|
[713] | 328 | Int m_exposureIndexIdc; |
---|
| 329 | Int m_exposureIndexValue; |
---|
[313] | 330 | Int m_exposureCompensationValueSignFlag; |
---|
| 331 | Int m_exposureCompensationValueNumerator; |
---|
| 332 | Int m_exposureCompensationValueDenomIdc; |
---|
| 333 | Int m_refScreenLuminanceWhite; |
---|
| 334 | Int m_extendedRangeWhiteLevel; |
---|
| 335 | Int m_nominalBlackLevelLumaCodeValue; |
---|
| 336 | Int m_nominalWhiteLevelLumaCodeValue; |
---|
| 337 | Int m_extendedWhiteLevelLumaCodeValue; |
---|
| 338 | Int* m_startOfCodedInterval; |
---|
| 339 | Int* m_codedPivotValue; |
---|
| 340 | Int* m_targetPivotValue; |
---|
| 341 | Int m_framePackingSEIEnabled; |
---|
| 342 | Int m_framePackingSEIType; |
---|
| 343 | Int m_framePackingSEIId; |
---|
| 344 | Int m_framePackingSEIQuincunx; |
---|
| 345 | Int m_framePackingSEIInterpretation; |
---|
[1029] | 346 | Int m_segmentedRectFramePackingSEIEnabled; |
---|
| 347 | Bool m_segmentedRectFramePackingSEICancel; |
---|
| 348 | Int m_segmentedRectFramePackingSEIType; |
---|
| 349 | Bool m_segmentedRectFramePackingSEIPersistence; |
---|
[313] | 350 | Int m_displayOrientationSEIAngle; |
---|
| 351 | Int m_temporalLevel0IndexSEIEnabled; |
---|
| 352 | Int m_gradualDecodingRefreshInfoEnabled; |
---|
[1029] | 353 | Int m_noDisplaySEITLayer; |
---|
[313] | 354 | Int m_decodingUnitInfoSEIEnabled; |
---|
| 355 | Int m_SOPDescriptionSEIEnabled; |
---|
| 356 | Int m_scalableNestingSEIEnabled; |
---|
[1029] | 357 | Bool m_tmctsSEIEnabled; |
---|
| 358 | Bool m_timeCodeSEIEnabled; |
---|
| 359 | Int m_timeCodeSEINumTs; |
---|
| 360 | TComSEITimeSet m_timeSetArray[MAX_TIMECODE_SEI_SETS]; |
---|
| 361 | Bool m_kneeSEIEnabled; |
---|
| 362 | Int m_kneeSEIId; |
---|
| 363 | Bool m_kneeSEICancelFlag; |
---|
| 364 | Bool m_kneeSEIPersistenceFlag; |
---|
| 365 | Int m_kneeSEIInputDrange; |
---|
| 366 | Int m_kneeSEIInputDispLuminance; |
---|
| 367 | Int m_kneeSEIOutputDrange; |
---|
| 368 | Int m_kneeSEIOutputDispLuminance; |
---|
| 369 | Int m_kneeSEINumKneePointsMinus1; |
---|
| 370 | Int* m_kneeSEIInputKneePoint; |
---|
| 371 | Int* m_kneeSEIOutputKneePoint; |
---|
[313] | 372 | // weighted prediction |
---|
| 373 | Bool m_useWeightedPred; ///< Use of weighted prediction in P slices |
---|
| 374 | Bool m_useWeightedBiPred; ///< Use of bi-directional weighted prediction in B slices |
---|
[1029] | 375 | |
---|
[313] | 376 | UInt m_log2ParallelMergeLevel; ///< Parallel merge estimation region |
---|
| 377 | UInt m_maxNumMergeCand; ///< Max number of merge candidates |
---|
| 378 | |
---|
| 379 | Int m_TMVPModeId; |
---|
| 380 | Int m_signHideFlag; |
---|
| 381 | #if !RC_SHVC_HARMONIZATION |
---|
| 382 | Bool m_RCEnableRateControl; ///< enable rate control or not |
---|
| 383 | Int m_RCTargetBitrate; ///< target bitrate when rate control is enabled |
---|
| 384 | Int m_RCKeepHierarchicalBit; ///< 0: equal bit allocation; 1: fixed ratio bit allocation; 2: adaptive ratio bit allocation |
---|
[1029] | 385 | Bool m_RCLCULevelRC; ///< true: LCU level rate control; false: picture level rate control NOTE: code-tidy - rename to m_RCCtuLevelRC |
---|
| 386 | Bool m_RCUseLCUSeparateModel; ///< use separate R-lambda model at LCU level NOTE: code-tidy - rename to m_RCUseCtuSeparateModel |
---|
[313] | 387 | Int m_RCInitialQP; ///< inital QP for rate control |
---|
| 388 | Bool m_RCForceIntraQP; ///< force all intra picture to use initial QP or not |
---|
| 389 | #endif |
---|
[1029] | 390 | ScalingListMode m_useScalingListId; ///< using quantization matrix |
---|
[313] | 391 | Char* m_scalingListFile; ///< quantization matrix file name |
---|
| 392 | |
---|
| 393 | Bool m_TransquantBypassEnableFlag; ///< transquant_bypass_enable_flag setting in PPS. |
---|
[595] | 394 | Bool m_CUTransquantBypassFlagForce; ///< if transquant_bypass_enable_flag, then, if true, all CU transquant bypass flags will be set to true. |
---|
[1029] | 395 | CostMode m_costMode; ///< Cost mode to use |
---|
[313] | 396 | |
---|
| 397 | Bool m_recalculateQPAccordingToLambda; ///< recalculate QP value according to the lambda value |
---|
| 398 | Bool m_useStrongIntraSmoothing; ///< enable strong intra smoothing for 32x32 blocks where the reference samples are flat |
---|
| 399 | Int m_activeParameterSetsSEIEnabled; |
---|
| 400 | |
---|
| 401 | Bool m_vuiParametersPresentFlag; ///< enable generation of VUI parameters |
---|
| 402 | Bool m_aspectRatioInfoPresentFlag; ///< Signals whether aspect_ratio_idc is present |
---|
| 403 | Int m_aspectRatioIdc; ///< aspect_ratio_idc |
---|
| 404 | Int m_sarWidth; ///< horizontal size of the sample aspect ratio |
---|
| 405 | Int m_sarHeight; ///< vertical size of the sample aspect ratio |
---|
| 406 | Bool m_overscanInfoPresentFlag; ///< Signals whether overscan_appropriate_flag is present |
---|
| 407 | Bool m_overscanAppropriateFlag; ///< Indicates whether conformant decoded pictures are suitable for display using overscan |
---|
| 408 | Bool m_videoSignalTypePresentFlag; ///< Signals whether video_format, video_full_range_flag, and colour_description_present_flag are present |
---|
| 409 | Int m_videoFormat; ///< Indicates representation of pictures |
---|
| 410 | Bool m_videoFullRangeFlag; ///< Indicates the black level and range of luma and chroma signals |
---|
| 411 | Bool m_colourDescriptionPresentFlag; ///< Signals whether colour_primaries, transfer_characteristics and matrix_coefficients are present |
---|
| 412 | Int m_colourPrimaries; ///< Indicates chromaticity coordinates of the source primaries |
---|
| 413 | Int m_transferCharacteristics; ///< Indicates the opto-electronic transfer characteristics of the source |
---|
| 414 | Int m_matrixCoefficients; ///< Describes the matrix coefficients used in deriving luma and chroma from RGB primaries |
---|
| 415 | Bool m_chromaLocInfoPresentFlag; ///< Signals whether chroma_sample_loc_type_top_field and chroma_sample_loc_type_bottom_field are present |
---|
| 416 | Int m_chromaSampleLocTypeTopField; ///< Specifies the location of chroma samples for top field |
---|
| 417 | Int m_chromaSampleLocTypeBottomField; ///< Specifies the location of chroma samples for bottom field |
---|
| 418 | Bool m_neutralChromaIndicationFlag; ///< Indicates that the value of all decoded chroma samples is equal to 1<<(BitDepthCr-1) |
---|
| 419 | Bool m_defaultDisplayWindowFlag; ///< Indicates the presence of the default window parameters |
---|
| 420 | Int m_defDispWinLeftOffset; ///< Specifies the left offset from the conformance window of the default window |
---|
| 421 | Int m_defDispWinRightOffset; ///< Specifies the right offset from the conformance window of the default window |
---|
| 422 | Int m_defDispWinTopOffset; ///< Specifies the top offset from the conformance window of the default window |
---|
| 423 | Int m_defDispWinBottomOffset; ///< Specifies the bottom offset from the conformance window of the default window |
---|
| 424 | Bool m_frameFieldInfoPresentFlag; ///< Indicates that pic_struct values are present in picture timing SEI messages |
---|
| 425 | Bool m_pocProportionalToTimingFlag; ///< Indicates that the POC value is proportional to the output time w.r.t. first picture in CVS |
---|
| 426 | Int m_numTicksPocDiffOneMinus1; ///< Number of ticks minus 1 that for a POC difference of one |
---|
| 427 | Bool m_bitstreamRestrictionFlag; ///< Signals whether bitstream restriction parameters are present |
---|
| 428 | Bool m_tilesFixedStructureFlag; ///< Indicates that each active picture parameter set has the same values of the syntax elements related to tiles |
---|
| 429 | Bool m_motionVectorsOverPicBoundariesFlag; ///< Indicates that no samples outside the picture boundaries are used for inter prediction |
---|
| 430 | Int m_minSpatialSegmentationIdc; ///< Indicates the maximum size of the spatial segments in the pictures in the coded video sequence |
---|
| 431 | Int m_maxBytesPerPicDenom; ///< Indicates a number of bytes not exceeded by the sum of the sizes of the VCL NAL units associated with any coded picture |
---|
| 432 | Int m_maxBitsPerMinCuDenom; ///< Indicates an upper bound for the number of bits of coding_unit() data |
---|
| 433 | Int m_log2MaxMvLengthHorizontal; ///< Indicate the maximum absolute value of a decoded horizontal MV component in quarter-pel luma units |
---|
| 434 | Int m_log2MaxMvLengthVertical; ///< Indicate the maximum absolute value of a decoded vertical MV component in quarter-pel luma units |
---|
[1029] | 435 | |
---|
| 436 | #if LAYERS_NOT_PRESENT_SEI |
---|
| 437 | Int m_layersNotPresentSEIEnabled; |
---|
| 438 | #endif |
---|
[1037] | 439 | #if P0123_ALPHA_CHANNEL_SEI |
---|
| 440 | Bool m_alphaSEIEnabled; |
---|
| 441 | Bool m_alphaCancelFlag; |
---|
| 442 | Int m_alphaUseIdc; |
---|
| 443 | Int m_alphaBitDepthMinus8; |
---|
| 444 | Int m_alphaTransparentValue; |
---|
| 445 | Int m_alphaOpaqueValue; |
---|
| 446 | Bool m_alphaIncrementFlag; |
---|
| 447 | Bool m_alphaClipFlag; |
---|
| 448 | Bool m_alphaClipTypeFlag; |
---|
| 449 | #endif |
---|
[1029] | 450 | #if SVC_EXTENSION |
---|
| 451 | #if FAST_INTRA_SHVC |
---|
| 452 | Bool m_useFastIntraScalable; ///< flag for using Fast Intra Decision for Scalable HEVC |
---|
| 453 | #endif |
---|
| 454 | #if Q0189_TMVP_CONSTRAINTS |
---|
| 455 | Int m_TMVPConstraintsSEIEnabled; |
---|
| 456 | #endif |
---|
[540] | 457 | #if O0153_ALT_OUTPUT_LAYER_FLAG |
---|
| 458 | Bool m_altOutputLayerFlag; ///< Specifies the value of alt_output_laye_flag in VPS extension |
---|
| 459 | #endif |
---|
[313] | 460 | Int m_elRapSliceBEnabled; |
---|
| 461 | #endif |
---|
[856] | 462 | #if Q0074_COLOUR_REMAPPING_SEI |
---|
| 463 | #if !SVC_EXTENSION |
---|
[1089] | 464 | string m_colourRemapSEIFileRoot; |
---|
[856] | 465 | #endif |
---|
| 466 | #endif |
---|
[313] | 467 | // internal member functions |
---|
[494] | 468 | #if LAYER_CTB |
---|
| 469 | Void xSetGlobal (UInt layerId); ///< set global variables |
---|
| 470 | #else |
---|
[313] | 471 | Void xSetGlobal (); ///< set global variables |
---|
[494] | 472 | #endif |
---|
[1029] | 473 | #if SVC_EXTENSION |
---|
[1045] | 474 | Void xCheckParameter (UInt layerIdx); ///< check validity of configuration values per layer |
---|
[1029] | 475 | #else |
---|
[313] | 476 | Void xCheckParameter (); ///< check validity of configuration values |
---|
[1029] | 477 | #endif |
---|
[313] | 478 | Void xPrintParameter (); ///< print configuration values |
---|
| 479 | Void xPrintUsage (); ///< print usage |
---|
[815] | 480 | #if SVC_EXTENSION |
---|
[313] | 481 | #if M0040_ADAPTIVE_RESOLUTION_CHANGE |
---|
| 482 | Int m_adaptiveResolutionChange; ///< Indicate adaptive resolution change frame |
---|
| 483 | #endif |
---|
[540] | 484 | #if HIGHER_LAYER_IRAP_SKIP_FLAG |
---|
| 485 | Bool m_skipPictureAtArcSwitch; ///< Indicates that when ARC up-switching is performed the higher layer picture is a skip picture |
---|
| 486 | #endif |
---|
[442] | 487 | #if REPN_FORMAT_IN_VPS |
---|
| 488 | RepFormatCfg m_repFormatCfg[16]; ///< Rep_format structures |
---|
| 489 | #endif |
---|
| 490 | #if N0383_IL_CONSTRAINED_TILE_SETS_SEI |
---|
| 491 | Bool m_interLayerConstrainedTileSetsSEIEnabled; |
---|
| 492 | UInt m_ilNumSetsInMessage; |
---|
| 493 | Bool m_skippedTileSetPresentFlag; |
---|
| 494 | UInt m_topLeftTileIndex[1024]; |
---|
| 495 | UInt m_bottomRightTileIndex[1024]; |
---|
| 496 | UInt m_ilcIdc[1024]; |
---|
| 497 | #endif |
---|
[494] | 498 | #if O0215_PHASE_ALIGNMENT |
---|
[588] | 499 | Bool m_phaseAlignFlag; |
---|
[494] | 500 | #endif |
---|
[540] | 501 | #if O0223_PICTURE_TYPES_ALIGN_FLAG |
---|
[588] | 502 | Bool m_crossLayerPictureTypeAlignFlag; |
---|
[540] | 503 | #endif |
---|
[588] | 504 | Bool m_crossLayerIrapAlignFlag; |
---|
[912] | 505 | #if Q0096_OVERLAY_SEI |
---|
| 506 | Bool m_overlaySEIEnabled; |
---|
| 507 | Bool m_overlayInfoCancelFlag; |
---|
| 508 | UInt m_overlayContentAuxIdMinus128; |
---|
| 509 | UInt m_overlayLabelAuxIdMinus128; |
---|
| 510 | UInt m_overlayAlphaAuxIdMinus128; |
---|
| 511 | UInt m_overlayElementLabelValueLengthMinus8; |
---|
| 512 | UInt m_numOverlaysMinus1; |
---|
| 513 | std::vector<UInt> m_overlayIdx; |
---|
| 514 | std::vector<Bool> m_overlayLanguagePresentFlag; |
---|
| 515 | std::vector<UInt> m_overlayContentLayerId; |
---|
| 516 | std::vector<Bool> m_overlayLabelPresentFlag; |
---|
| 517 | std::vector<UInt> m_overlayLabelLayerId; |
---|
| 518 | std::vector<Bool> m_overlayAlphaPresentFlag; |
---|
| 519 | std::vector<UInt> m_overlayAlphaLayerId; |
---|
| 520 | std::vector<UInt> m_numOverlayElementsMinus1; |
---|
| 521 | std::vector< std::vector<UInt> > m_overlayElementLabelMin; |
---|
| 522 | std::vector< std::vector<UInt> > m_overlayElementLabelMax; |
---|
| 523 | std::vector<string> m_overlayLanguage; |
---|
| 524 | std::vector<string> m_overlayName; |
---|
| 525 | std::vector< std::vector<string> > m_overlayElementName; |
---|
| 526 | Bool m_overlayInfoPersistenceFlag; |
---|
| 527 | #endif |
---|
[644] | 528 | #if P0068_CROSS_LAYER_ALIGNED_IDR_ONLY_FOR_IRAP_FLAG |
---|
| 529 | Bool m_crossLayerAlignedIdrOnlyFlag; |
---|
| 530 | #endif |
---|
[540] | 531 | #if O0149_CROSS_LAYER_BLA_FLAG |
---|
[588] | 532 | Bool m_crossLayerBLAFlag; |
---|
[540] | 533 | #endif |
---|
[588] | 534 | #if O0194_WEIGHTED_PREDICTION_CGS |
---|
| 535 | Bool m_useInterLayerWeightedPred; |
---|
| 536 | #endif |
---|
[713] | 537 | #if Q0048_CGS_3D_ASYMLUT |
---|
| 538 | Int m_nCGSFlag; |
---|
| 539 | Int m_nCGSMaxOctantDepth; |
---|
| 540 | Int m_nCGSMaxYPartNumLog2; |
---|
| 541 | Int m_nCGSLUTBit; |
---|
[825] | 542 | #if R0151_CGS_3D_ASYMLUT_IMPROVE |
---|
| 543 | Int m_nCGSAdaptiveChroma; |
---|
[713] | 544 | #endif |
---|
[877] | 545 | #if R0179_ENC_OPT_3DLUT_SIZE |
---|
| 546 | Int m_nCGSLutSizeRDO; |
---|
| 547 | #endif |
---|
[825] | 548 | #endif |
---|
[815] | 549 | #endif //SVC_EXTENSION |
---|
[313] | 550 | public: |
---|
| 551 | TAppEncCfg(); |
---|
| 552 | virtual ~TAppEncCfg(); |
---|
[1029] | 553 | |
---|
[313] | 554 | public: |
---|
| 555 | Void create (); ///< create option handling class |
---|
| 556 | Void destroy (); ///< destroy option handling class |
---|
| 557 | Bool parseCfg ( Int argc, Char* argv[] ); ///< parse configuration file to fill member variables |
---|
| 558 | |
---|
| 559 | #if SVC_EXTENSION |
---|
| 560 | Int getNumFrameToBeEncoded() {return m_framesToBeEncoded; } |
---|
[1057] | 561 | Int getNumLayer() {return m_numLayers; } |
---|
[313] | 562 | Int getGOPSize() {return m_iGOPSize; } |
---|
[494] | 563 | #if O0194_DIFFERENT_BITDEPTH_EL_BL |
---|
[1029] | 564 | UInt getInternalBitDepth(Int iLayer, ChannelType type) {return m_acLayerCfg[iLayer].m_internalBitDepth[type]; } |
---|
[494] | 565 | Bool getPCMInputBitDepthFlag() {return m_bPCMInputBitDepthFlag; } |
---|
| 566 | #else |
---|
[1029] | 567 | UInt getInternalBitDepth( ChannelType type ) {return m_internalBitDepth[type]; } |
---|
[494] | 568 | #endif |
---|
| 569 | #if !LAYER_CTB |
---|
[313] | 570 | UInt getMaxCUWidth() {return m_uiMaxCUWidth; } |
---|
| 571 | UInt getMaxCUHeight() {return m_uiMaxCUHeight; } |
---|
| 572 | UInt getMaxCUDepth() {return m_uiMaxCUDepth; } |
---|
[494] | 573 | #endif |
---|
[313] | 574 | Int getDecodingRefreshType() {return m_iDecodingRefreshType; } |
---|
[1045] | 575 | Int getWaveFrontSynchro(Int layerIdx) { return m_acLayerCfg[layerIdx].m_waveFrontSynchro; } |
---|
[313] | 576 | Void getDirFilename(string& filename, string& dir, const string path); |
---|
[861] | 577 | #if OUTPUT_LAYER_SETS_CONFIG |
---|
| 578 | Bool scanStringToArray(string const cfgString, Int const numEntries, const char* logString, Int * const returnArray); |
---|
| 579 | Bool scanStringToArray(string const cfgString, Int const numEntries, const char* logString, std::vector<Int> & returnVector); |
---|
| 580 | Void cfgStringToArray(Int **arr, string const cfgString, Int const numEntries, const char* logString); |
---|
[1005] | 581 | #if R0235_SMALLEST_LAYER_ID |
---|
| 582 | Bool scanStringToArrayNumEntries(string const cfgString, Int &numEntries, const char* logString, Int * const returnArray); |
---|
| 583 | Bool scanStringToArrayNumEntries(string const cfgString, Int &numEntries, const char* logString, std::vector<Int> & returnVector); |
---|
| 584 | Void cfgStringToArrayNumEntries(Int **arr, string const cfgString, Int &numEntries, const char* logString); |
---|
| 585 | #endif |
---|
[861] | 586 | #else |
---|
[313] | 587 | Void cfgStringToArray(Int **arr, string cfgString, Int numEntries, const char* logString); |
---|
[861] | 588 | #endif |
---|
[442] | 589 | #if REPN_FORMAT_IN_VPS |
---|
| 590 | RepFormatCfg* getRepFormatCfg(Int i) { return &m_repFormatCfg[i]; } |
---|
[313] | 591 | #endif |
---|
[494] | 592 | #if LAYER_CTB |
---|
| 593 | Bool getUsePCM() { return m_usePCM; } |
---|
| 594 | UInt getPCMLog2MinSize () { return m_uiPCMLog2MinSize; } |
---|
[442] | 595 | #endif |
---|
[494] | 596 | #endif |
---|
[313] | 597 | };// END CLASS DEFINITION TAppEncCfg |
---|
| 598 | |
---|
| 599 | //! \} |
---|
| 600 | |
---|
| 601 | #endif // __TAPPENCCFG__ |
---|
| 602 | |
---|