Newer
Older

Karsten Suehring
committed
/* The copyright in this software is being made available under the BSD
* License, included below. This software may be subject to other third party
* and contributor rights, including patent rights, and no such rights are
* granted under this license.
*

Karsten Suehring
committed
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* * Neither the name of the ITU/ISO/IEC nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
/** \file EncAppCfg.h
\brief Handle encoder configuration parameters (header)
*/
#ifndef __ENCAPPCFG__
#define __ENCAPPCFG__
#include "CommonLib/CommonDef.h"
#include "EncoderLib/EncCfgParam.h"
#include <map>
template <class T1, class T2>
static inline std::istream& operator >> (std::istream &in, std::map<T1, T2> &map);
Rickard Sjöberg
committed
#include "Utilities/program_options_lite.h"

Karsten Suehring
committed
#include "EncoderLib/EncCfg.h"
#if EXTENSION_360_VIDEO
#include "AppEncHelper360/TExt360AppEncCfg.h"
#endif
#if JVET_O0756_CALCULATE_HDRMETRICS
#include "HDRLib/inc/DistortionMetric.H"
#endif
Rickard Sjöberg
committed
namespace po = df::program_options_lite;

Karsten Suehring
committed
#include <sstream>
#include <vector>
//! \ingroup EncoderApp
//! \{
// ====================================================================================================================
// Class definition
// ====================================================================================================================
/// encoder configuration class
class EncAppCfg
{
public:
template <class T>
struct OptionalValue
{
bool bPresent;
T value;
OptionalValue() : bPresent(false), value() { }
};
protected:
// file I/O
std::string m_inputFileName; ///< source file name
std::string m_bitstreamFileName; ///< output bitstream file
std::string m_reconFileName; ///< output reconstruction file
// Lambda modifiers
double m_adLambdaModifier[ MAX_TLAYER ]; ///< Lambda modifier array for each temporal layer
std::vector<double> m_adIntraLambdaModifier; ///< Lambda modifier for Intra pictures, one for each temporal layer. If size>temporalLayer, then use [temporalLayer], else if size>0, use [size()-1], else use m_adLambdaModifier.
double m_dIntraQpFactor; ///< Intra Q Factor. If negative, use a default equation: 0.57*(1.0 - Clip3( 0.0, 0.5, 0.05*(double)(isField ? (GopSize-1)/2 : GopSize-1) ))
// source specification
int m_frameRate; ///< source frame-rates (Hz)
uint32_t m_frameSkip; ///< number of skipped frames from the beginning

Karsten Suehring
committed
uint32_t m_temporalSubsampleRatio; ///< temporal subsample ratio, 2 means code every two frames
int m_sourceWidth; ///< source width in pixel
int m_sourceHeight; ///< source height in pixel (when interlaced = field height)

Karsten Suehring
committed
#if EXTENSION_360_VIDEO
int m_inputFileWidth; ///< width of image in input file (this is equivalent to sourceWidth, if sourceWidth is not subsequently altered due to padding)
int m_inputFileHeight; ///< height of image in input file (this is equivalent to sourceHeight, if sourceHeight is not subsequently altered due to padding)
#endif
int m_iSourceHeightOrg; ///< original source height in pixel (when interlaced = frame height)
bool m_isField; ///< enable field coding
bool m_isTopFieldFirst;
bool m_efficientFieldIRAPEnabled; ///< enable an efficient field IRAP structure.
bool m_harmonizeGopFirstFieldCoupleEnabled;

Karsten Suehring
committed
int m_conformanceWindowMode;
int m_confWinLeft;
int m_confWinRight;
int m_confWinTop;
int m_confWinBottom;
int m_sourcePadding[2]; ///< number of padded pixels for width and height
int m_firstValidFrame;
int m_lastValidFrame;

Karsten Suehring
committed
int m_framesToBeEncoded; ///< number of encoded frames
bool m_AccessUnitDelimiter; ///< add Access Unit Delimiter NAL units
bool m_enablePictureHeaderInSliceHeader; ///< Enable Picture Header in Slice Header

Karsten Suehring
committed
InputColourSpaceConversion m_inputColourSpaceConvert; ///< colour space conversion to apply to input video
bool m_snrInternalColourSpace; ///< if true, then no colour space conversion is applied for snr calculation, otherwise inverse of input is applied.
bool m_outputInternalColourSpace; ///< if true, then no colour space conversion is applied for reconstructed video, otherwise inverse of input is applied.

Karsten Suehring
committed
bool m_printMSEBasedSequencePSNR;
bool m_printHexPsnr;
bool m_printFrameMSE;
bool m_printSequenceMSE;

Karsten Suehring
committed
bool m_cabacZeroWordPaddingEnabled;
bool m_clipInputVideoToRec709Range;
bool m_clipOutputVideoToRec709Range;
bool m_packedYUVMode; ///< If true, output 10-bit and 12-bit YUV data as 5-byte and 3-byte (respectively) packed YUV data

Karsten Suehring
committed
bool m_bIntraOnlyConstraintFlag;
uint32_t m_maxBitDepthConstraintIdc;
bool m_allLayersIndependentConstraintFlag;
bool m_noMrlConstraintFlag;
bool m_noIspConstraintFlag;
bool m_noMipConstraintFlag;
bool m_noLfnstConstraintFlag;
bool m_noMmvdConstraintFlag;
bool m_noSmvdConstraintFlag;
bool m_noProfConstraintFlag;
bool m_noPaletteConstraintFlag;
bool m_noActConstraintFlag;
bool m_noLmcsConstraintFlag;
bool m_noExplicitScaleListConstraintFlag;
bool m_noVirtualBoundaryConstraintFlag;
bool m_noMttConstraintFlag;
bool m_noChromaQpOffsetConstraintFlag;
bool m_noQtbttDualTreeIntraConstraintFlag;
int m_maxLog2CtuSizeConstraintIdc;
bool m_noPartitionConstraintsOverrideConstraintFlag;
bool m_noSaoConstraintFlag;
bool m_noAlfConstraintFlag;
bool m_noWeightedPredictionConstraintFlag;
bool m_noRefWraparoundConstraintFlag;
bool m_noTemporalMvpConstraintFlag;
bool m_noSbtmvpConstraintFlag;
bool m_noAmvrConstraintFlag;
bool m_noBdofConstraintFlag;
bool m_noCclmConstraintFlag;
bool m_noMtsConstraintFlag;
bool m_noAffineMotionConstraintFlag;
bool m_noBcwConstraintFlag;
bool m_noCiipConstraintFlag;
bool m_noLadfConstraintFlag;
bool m_noLumaTransformSize64ConstraintFlag;
bool m_noBDPCMConstraintFlag;
bool m_noJointCbCrConstraintFlag;
Martin Pettersson
committed
bool m_noCuQpDeltaConstraintFlag;
bool m_noDepQuantConstraintFlag;
bool m_noSignDataHidingConstraintFlag;
Martin Pettersson
committed
bool m_noTrailConstraintFlag;
bool m_noStsaConstraintFlag;
bool m_noRaslConstraintFlag;
bool m_noRadlConstraintFlag;
bool m_noIdrConstraintFlag;
bool m_noCraConstraintFlag;
bool m_noGdrConstraintFlag;
bool m_noApsConstraintFlag;
Adrian Browne
committed
bool m_allRapPicturesFlag;
bool m_noExtendedPrecisionProcessingConstraintFlag;
bool m_noTsResidualCodingRiceConstraintFlag;
bool m_noRrcRiceExtensionConstraintFlag;
bool m_noPersistentRiceAdaptationConstraintFlag;
bool m_noReverseLastSigCoeffConstraintFlag;

Karsten Suehring
committed
// profile/level
Loading
Loading full blame...