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