Skip to content
Snippets Groups Projects
EncAppCfg.h 65.3 KiB
Newer Older
  • Learn to ignore specific revisions
  •   bool          m_GMFA;
      
      int      m_greenMetadataType;
      int      m_greenMetadataExtendedRepresentation;
      int      m_greenMetadataGranularityType;
      int      m_greenMetadataPeriodType;
      int      m_greenMetadataPeriodNumSeconds;
      int      m_greenMetadataPeriodNumPictures;
    
      int      m_xsdNumberMetrics;
      bool     m_xsdMetricTypePSNR;
      bool     m_xsdMetricTypeSSIM;
      bool     m_xsdMetricTypeWPSNR;
      bool     m_xsdMetricTypeWSPSNR;
    #endif
    
      std::string m_summaryOutFilename;                           ///< filename to use for producing summary output file.
      std::string m_summaryPicFilenameBase;                       ///< Base filename to use for producing summary picture output files. The actual filenames used will have I.txt, P.txt and B.txt appended.
      uint32_t        m_summaryVerboseness;                           ///< Specifies the level of the verboseness of the text output.
    
      int         m_verbosity;
    
      std::string m_decodeBitstreams[2];                          ///< filename for decode bitstreams.
    
    Tobias Hinz's avatar
    Tobias Hinz committed
      int         m_debugCTU;
    
      int         m_switchPOC;                                    ///< dbg poc.
      int         m_switchDQP;                                    ///< switch DQP.
      int         m_fastForwardToPOC;                             ///< get to encoding the specified POC as soon as possible by skipping temporal layers irrelevant for the specified POC
      bool        m_stopAfterFFtoPOC;
      bool        m_bs2ModPOCAndType;
      bool        m_forceDecodeBitstream1;
    
    
      int         m_maxNumAlfAps{ ALF_CTB_MAX_NUM_APS };
    
      int         m_constantJointCbCrSignFlag;
      bool        m_alf;                                       ///< Adaptive Loop Filter
    
      bool        m_alfAllowPredefinedFilters;
      double      m_ccalfStrength;
    
      double      m_alfStrengthChroma;
      double      m_alfStrengthTargetLuma;
      double      m_alfStrengthTargetChroma;
      double      m_ccalfStrengthTarget;
    
      bool        m_ccalf;
      int         m_ccalfQpThreshold;
    
      double      m_scalingRatioHor;
      double      m_scalingRatioVer;
    
      bool        m_gopBasedRPREnabledFlag;
      int         m_gopBasedRPRQPThreshold;
      double      m_scalingRatioHor2;
      double      m_scalingRatioVer2;
      double      m_scalingRatioHor3;
      double      m_scalingRatioVer3;
      double      m_psnrThresholdRPR;
      double      m_psnrThresholdRPR2;
      double      m_psnrThresholdRPR3;
      int         m_qpOffsetRPR;
      int         m_qpOffsetRPR2;
      int         m_qpOffsetRPR3;
      int         m_qpOffsetChromaRPR;
      int         m_qpOffsetChromaRPR2;
      int         m_qpOffsetChromaRPR3;
    
      int         m_rprSwitchingResolutionOrderList[MAX_RPR_SWITCHING_ORDER_LIST_SIZE];
      int         m_rprSwitchingQPOffsetOrderList[MAX_RPR_SWITCHING_ORDER_LIST_SIZE];
      int         m_rprSwitchingListSize;
    
      bool        m_rprFunctionalityTestingEnabledFlag;
      bool        m_rprPopulatePPSatIntraFlag;
      int         m_rprSwitchingSegmentSize;
      double      m_rprSwitchingTime;
    
      bool        m_resChangeInClvsEnabled;
    
      double      m_fractionOfFrames;                             ///< encode a fraction of the frames as specified in FramesToBeEncoded
    
    Vadim Seregin's avatar
    Vadim Seregin committed
      int         m_upscaledOutput;                               ////< Output upscaled (2), decoded cropped but in full resolution buffer (1) or decoded cropped (0, default) picture for RPR.
    
      int         m_upscaledOutputWidth;
      int         m_upscaledOutputHeight;
    
    Kenneth Andersson's avatar
    Kenneth Andersson committed
      int         m_upscaleFilterForDisplay;
    
      bool        m_craAPSreset;
      bool        m_rprRASLtoolSwitch;
    
      bool        m_avoidIntraInDepLayer;
    
      bool                  m_gopBasedTemporalFilterEnabled;
    
      int                   m_gopBasedTemporalFilterPastRefs;
      int                   m_gopBasedTemporalFilterFutureRefs;
    
      std::map<int, double> m_gopBasedTemporalFilterStrengths;             ///< Filter strength per frame for the GOP-based Temporal Filter
    
      bool                  m_bimEnabled;
    
    Junjie Chen's avatar
    Junjie Chen committed
      bool                  m_dpfEnabled;
      int                   m_dpfKeyLen;
      int                   m_dpfNonkeyLen;
    
    Vadim Seregin's avatar
    Vadim Seregin committed
      int         m_maxLayers;
    
      bool        m_OPIEnabled;                                     ///< enable Operating Point Information (OPI)
    
      int         m_maxTemporalLayer;
    
      int         m_layerId[MAX_VPS_LAYERS];
      int         m_maxSublayers;
    
      bool        m_defaultPtlDpbHrdMaxTidFlag;
    
      bool        m_allIndependentLayersFlag;
    
      std::string m_predDirectionArray;
    
      bool        m_encILOpt;
      double      m_encILOptLambdaModifier;
    
      int         m_numRefLayers[MAX_VPS_LAYERS];
      std::string m_refLayerIdxStr[MAX_VPS_LAYERS];
      bool        m_eachLayerIsAnOlsFlag;
      int         m_olsModeIdc;
      int         m_numOutputLayerSets;
      std::string m_olsOutputLayerStr[MAX_VPS_LAYERS];
    
      std::string m_maxTidILRefPicsPlus1Str[MAX_VPS_LAYERS];
    
    Vadim Seregin's avatar
    Vadim Seregin committed
    
    
      int         m_numPtlsInVps;
    
      int         m_ptPresentInPtl[MAX_NUM_OLSS];
    
      EncCfgParam::CfgVPSParameters m_cfgVPSParameters;
    
      Level::Name m_levelPtl[MAX_NUM_OLSS];
    
      int         m_olsPtlIdx[MAX_NUM_OLSS];
    
      bool                                 m_generativeFaceVideoEnabled;
      uint32_t                             m_generativeFaceVideoSEINumber;
      bool                                 m_generativeFaceVideoSEIBasePicFlag;
      bool                                 m_generativeFaceVideoSEINNPresentFlag;
      uint32_t                             m_generativeFaceVideoSEINNModeIdc;
      std::string                          m_generativeFaceVideoSEINNTagURI;
      std::string                          m_generativeFaceVideoSEINNURI;
      bool                                 m_generativeFaceVideoSEIChromaKeyInfoPresentFlag;
      std::vector<bool>                    m_generativeFaceVideoSEIChromaKeyValuePresentFlag;
      std::vector<uint32_t>                m_generativeFaceVideoSEIChromaKeyValue;
      std::vector<bool>                    m_generativeFaceVideoSEIChromaKeyThrPresentFlag;
      std::vector<uint32_t>                m_generativeFaceVideoSEIChromaKeyThrValue;
      std::vector<bool>                    m_generativeFaceVideoSEIDrivePicFusionFlag;
      std::vector<uint32_t>                m_generativeFaceVideoSEIId;
      std::vector<uint32_t>                m_generativeFaceVideoSEICnt;
      std::vector<bool>                    m_generativeFaceVideoSEILowConfidenceFaceParameterFlag;
      std::vector<bool>                    m_generativeFaceVideoSEICoordinatePresentFlag;
      std::vector<uint32_t>                m_generativeFaceVideoSEICoordinateQuantizationFactor;
      std::vector<bool>                    m_generativeFaceVideoSEICoordinatePredFlag;
      std::vector<bool>                    m_generativeFaceVideoSEI3DCoordinateFlag;
      std::vector<uint32_t>                m_generativeFaceVideoSEICoordinatePointNum;
      std::vector<std::vector<double>>     m_generativeFaceVideoSEICoordinateXTesonr;
      std::vector<std::vector<double>>     m_generativeFaceVideoSEICoordinateYTesonr;
      std::vector<std::vector<uint32_t>>   m_generativeFaceVideoSEIZCoordinateMaxValue;
      std::vector<std::vector<double>>     m_generativeFaceVideoSEICoordinateZTesonr;
      std::vector<bool>                    m_generativeFaceVideoSEIMatrixPresentFlag;
      std::vector<uint32_t>                m_generativeFaceVideoSEIMatrixElementPrecisionFactor;
      std::vector<bool>                    m_generativeFaceVideoSEIMatrixPredFlag;
      std::vector<uint32_t>                m_generativeFaceVideoSEINumMatrixType;
      std::vector<std::vector<uint32_t>>   m_generativeFaceVideoSEIMatrixTypeIdx;
      std::vector<std::vector<uint32_t>>   m_generativeFaceVideoSEINumMatricestoNumKpsFlag;
      std::vector<std::vector<uint32_t>>   m_generativeFaceVideoSEINumMatricesInfo;
      std::vector<std::vector<uint32_t>>   m_generativeFaceVideoSEIMatrix3DSpaceFlag;
      std::vector<std::vector<uint32_t>>   m_generativeFaceVideoSEINumMatrices;
      std::vector<std::vector<uint32_t>>   m_generativeFaceVideoSEIMatrixWidth;
      std::vector<std::vector<uint32_t>>   m_generativeFaceVideoSEIMatrixHeight;
      std::vector < std::vector<std::vector<std::vector<std::vector<double>>>>>   m_generativeFaceVideoSEIMatrixElement;
      std::string                          m_generativeFaceVideoSEIPayloadFilename;
    
    
    #if EXTENSION_360_VIDEO
      TExt360AppEncCfg m_ext360;
      friend class TExt360AppEncCfg;
      friend class TExt360AppEncTop;
    #endif
    
    
    #if JVET_O0756_CONFIG_HDRMETRICS || JVET_O0756_CALCULATE_HDRMETRICS
    
    #if JVET_O0756_CALCULATE_HDRMETRICS
      double      m_whitePointDeltaE[hdrtoolslib::NB_REF_WHITE];
    
    #else
      double      m_whitePointDeltaE[3];
    #endif
    
      double      m_maxSampleValue;
      int         m_sampleRange;
      int         m_colorPrimaries;
      bool        m_enableTFunctionLUT;
      int         m_chromaLocation;
      int         m_chromaUPFilter;
      int         m_cropOffsetLeft;
      int         m_cropOffsetTop;
      int         m_cropOffsetRight;
      int         m_cropOffsetBottom;
      bool        m_calculateHdrMetrics;
    #endif
    
    
      // internal member functions
      bool  xCheckParameter ();                                   ///< check validity of configuration values
      void  xPrintParameter ();                                   ///< print configuration values
      void  xPrintUsage     ();                                   ///< print usage
    
      bool  xHasNonZeroTemporalID();                             ///< check presence of constant temporal ID in GOP structure
      bool  xHasLeadingPicture();                                 ///< check presence of leading pictures in GOP structure
    
      int   xAutoDetermineProfile();                              ///< auto determine the profile to use given the other configuration settings. Returns 1 if erred. Can select profile 'NONE'
    
    public:
      EncAppCfg();
      virtual ~EncAppCfg();
    
    public:
      void  create    ();                                         ///< create option handling class
      void  destroy   ();                                         ///< destroy option handling class
      bool  parseCfg  ( int argc, char* argv[] );                ///< parse configuration file to fill member variables