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
42
43
44
45
46
47
* 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.cpp
\brief Handle encoder configuration parameters
*/
#include "EncAppCfg.h"
#include <stdio.h>
#include <stdlib.h>
#include <cstring>
#include <string>
#include <fstream>
#include <limits>
#include "Utilities/program_options_lite.h"
#include "Utilities/VideoIOYuv.h"

Karsten Suehring
committed
#include "CommonLib/Rom.h"
#include "EncoderLib/RateCtrl.h"
#include "CommonLib/dtrace_next.h"
#include "CommonLib/ProfileTierLevel.h"

Karsten Suehring
committed
#define MACRO_TO_STRING_HELPER(val) #val
#define MACRO_TO_STRING(val) MACRO_TO_STRING_HELPER(val)
namespace po = ProgramOptionsLite;

Karsten Suehring
committed
enum ExtendedProfileName // this is used for determining profile strings, where multiple profiles map to a single
// profile idc with various constraint flag combinations

Karsten Suehring
committed
{
MAIN_10,
MAIN_10_STILL_PICTURE,
MAIN_10_444,
MAIN_10_444_STILL_PICTURE,
MULTILAYER_MAIN_10,
MULTILAYER_MAIN_10_STILL_PICTURE,
MULTILAYER_MAIN_10_444,
MULTILAYER_MAIN_10_444_STILL_PICTURE,
Tomohiro Ikai
committed
MAIN_12,
MAIN_12_444,
MAIN_16_444,
MAIN_12_INTRA,
MAIN_12_444_INTRA,
MAIN_16_444_INTRA,
MAIN_12_STILL_PICTURE,
MAIN_12_444_STILL_PICTURE,
MAIN_16_444_STILL_PICTURE,

Karsten Suehring
committed
};
constexpr int TF_DEFAULT_REFS = 4;

Karsten Suehring
committed
//! \ingroup EncoderApp
//! \{
// ====================================================================================================================
// Constructor / destructor / initialization / destroy
// ====================================================================================================================
EncAppCfg::EncAppCfg()
: m_inputColourSpaceConvert(IPCOLOURSPACE_UNCHANGED)
, m_snrInternalColourSpace(false)
, m_outputInternalColourSpace(false)
, m_packedYUVMode(false)

Karsten Suehring
committed
#if EXTENSION_360_VIDEO
, m_ext360(*this)
#endif
{
}
EncAppCfg::~EncAppCfg()
{
#if ENABLE_TRACING
tracing_uninit(g_trace_ctx);

Karsten Suehring
committed
#endif
}
void EncAppCfg::create()
{
}
void EncAppCfg::destroy()
{
}
std::istringstream &operator>>(std::istringstream &in, GOPEntry &entry) //input
{
in>>entry.m_sliceType;
in>>entry.m_POC;
in>>entry.m_QPOffset;
in>>entry.m_QPOffsetModelOffset;
in>>entry.m_QPOffsetModelScale;
#if W0038_CQP_ADJ
in>>entry.m_CbQPoffset;
in>>entry.m_CrQPoffset;
#endif
in>>entry.m_QPFactor;
in>>entry.m_tcOffsetDiv2;
in>>entry.m_betaOffsetDiv2;
in>>entry.m_CbTcOffsetDiv2;
in>>entry.m_CbBetaOffsetDiv2;
in>>entry.m_CrTcOffsetDiv2;
in>>entry.m_CrBetaOffsetDiv2;

Karsten Suehring
committed
in>>entry.m_temporalId;
in >> entry.m_numRefPicsActive0;
in >> entry.m_numRefPics0;
for (int i = 0; i < entry.m_numRefPics0; i++)
{
in >> entry.m_deltaRefPics0[i];
}
in >> entry.m_numRefPicsActive1;
in >> entry.m_numRefPics1;
for (int i = 0; i < entry.m_numRefPics1; i++)
{
in >> entry.m_deltaRefPics1[i];
}

Karsten Suehring
committed
return in;
}

Karsten Suehring
committed
bool confirmPara(bool bflag, const char* message);
static inline ChromaFormat numberToChromaFormat(const int val)
{
switch (val)
{
case 400:
return ChromaFormat::_400;
break;
case 420:
return ChromaFormat::_420;
break;
case 422:
return ChromaFormat::_422;
break;
case 444:
return ChromaFormat::_444;
break;
default:
return ChromaFormat::UNDEFINED;

Karsten Suehring
committed
}
}
static const struct MapStrToProfile
{
const char* str;
Profile::Name value;
} strToProfile[] = {
{ "none", Profile::NONE },
{ "main_10", Profile::MAIN_10 },
{ "main_10_444", Profile::MAIN_10_444 },
{ "main_10_still_picture", Profile::MAIN_10_STILL_PICTURE },
{ "main_10_444_still_picture", Profile::MAIN_10_444_STILL_PICTURE },
{ "multilayer_main_10", Profile::MULTILAYER_MAIN_10 },
{ "multilayer_main_10_444", Profile::MULTILAYER_MAIN_10_444 },
{ "multilayer_main_10_still_picture", Profile::MULTILAYER_MAIN_10_STILL_PICTURE },
{ "multilayer_main_10_444_still_picture", Profile::MULTILAYER_MAIN_10_444_STILL_PICTURE },
Tomohiro Ikai
committed
{ "main_12", Profile::MAIN_12 },
{ "main_12_444", Profile::MAIN_12_444 },
{ "main_16_444", Profile::MAIN_16_444 },
{ "main_12_intra", Profile::MAIN_12_INTRA },
{ "main_12_444_intra", Profile::MAIN_12_444_INTRA },
{ "main_16_444_intra", Profile::MAIN_16_444_INTRA },
{ "main_12_still_picture", Profile::MAIN_12_STILL_PICTURE },
{ "main_12_444_still_picture", Profile::MAIN_12_444_STILL_PICTURE },
{ "main_16_444_still_picture", Profile::MAIN_16_444_STILL_PICTURE },

Karsten Suehring
committed
};
static const struct MapStrToExtendedProfile
{
const char* str;
ExtendedProfileName value;
} strToExtendedProfile[] = {
{ "none", NONE },
{ "main_10", MAIN_10 },
{ "main_10_444", MAIN_10_444 },
{ "main_10_still_picture", MAIN_10_STILL_PICTURE },
{ "main_10_444_still_picture", MAIN_10_444_STILL_PICTURE },
{ "multilayer_main_10", MULTILAYER_MAIN_10 },
{ "multilayer_main_10_444", MULTILAYER_MAIN_10_444 },
{ "multilayer_main_10_still_picture", MULTILAYER_MAIN_10_STILL_PICTURE },
{ "multilayer_main_10_444_still_picture", MULTILAYER_MAIN_10_444_STILL_PICTURE },
Tomohiro Ikai
committed
{ "main_12", MAIN_12 },
{ "main_12_444", MAIN_12_444 },
{ "main_16_444", MAIN_16_444 },
{ "main_12_intra", MAIN_12_INTRA },
{ "main_12_444_intra", MAIN_12_444_INTRA },
{ "main_16_444_intra", MAIN_16_444_INTRA },
{ "main_12_still_picture", MAIN_12_STILL_PICTURE },
{ "main_12_444_still_picture", MAIN_12_444_STILL_PICTURE },
{ "main_16_444_still_picture", MAIN_16_444_STILL_PICTURE },

Karsten Suehring
committed
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
};
static const struct MapStrToTier
{
const char* str;
Level::Tier value;
}
strToTier[] =
{
{"main", Level::MAIN},
{"high", Level::HIGH},
};
static const struct MapStrToLevel
{
const char* str;
Level::Name value;
}
strToLevel[] =
{
{"none",Level::NONE},
{"1", Level::LEVEL1},
{"2", Level::LEVEL2},
{"2.1", Level::LEVEL2_1},
{"3", Level::LEVEL3},
{"3.1", Level::LEVEL3_1},
{"4", Level::LEVEL4},
{"4.1", Level::LEVEL4_1},
{"5", Level::LEVEL5},
{"5.1", Level::LEVEL5_1},
{"5.2", Level::LEVEL5_2},
{"6", Level::LEVEL6},
{"6.1", Level::LEVEL6_1},
{"6.2", Level::LEVEL6_2},

Karsten Suehring
committed
};
Adrian Browne
committed
uint32_t g_uiMaxCpbSize[2][28] =

Karsten Suehring
committed
{
Adrian Browne
committed
// LEVEL1, LEVEL2, LEVEL2_1, LEVEL3, LEVEL3_1, LEVEL4, LEVEL4_1, LEVEL5, LEVEL5_1, LEVEL5_2, LEVEL6, LEVEL6_1, LEVEL6_2 LEVEL6_3
{ 0, 0, 0, 0, 350000, 0, 0, 0, 1500000, 3000000, 0, 0, 6000000, 10000000, 0, 0, 12000000, 20000000, 0, 0, 25000000, 40000000, 60000000, 0, 80000000, 120000000, 240000000, 240000000 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30000000, 50000000, 0, 0, 100000000, 160000000, 240000000, 0, 240000000, 480000000, 800000000, 1600000000 }

Karsten Suehring
committed
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
};
static const struct MapStrToCostMode
{
const char* str;
CostMode value;
}
strToCostMode[] =
{
{"lossy", COST_STANDARD_LOSSY},
{"sequence_level_lossless", COST_SEQUENCE_LEVEL_LOSSLESS},
{"lossless", COST_LOSSLESS_CODING},
{"mixed_lossless_lossy", COST_MIXED_LOSSLESS_LOSSY_CODING}
};
static const struct MapStrToScalingListMode
{
const char* str;
ScalingListMode value;
}
strToScalingListMode[] =
{
{"0", SCALING_LIST_OFF},
{"1", SCALING_LIST_DEFAULT},
{"2", SCALING_LIST_FILE_READ},
{"off", SCALING_LIST_OFF},
{"default", SCALING_LIST_DEFAULT},
{"file", SCALING_LIST_FILE_READ}
};
template<typename T, typename P>
static std::string enumToString(P map[], uint32_t mapLen, const T val)
{
for (uint32_t i = 0; i < mapLen; i++)
{
if (val == map[i].value)
{
return map[i].str;
}
}
return std::string();
}
template<typename T, typename P> static std::istream &readStrToEnum(P map[], uint32_t mapLen, std::istream &in, T &val)

Karsten Suehring
committed
{

Karsten Suehring
committed
in >> str;
for (uint32_t i = 0; i < mapLen; i++)
{
if (str == map[i].str)
{
val = map[i].value;
goto found;
}
}
/* not found */

Karsten Suehring
committed
found:
return in;
}
//inline to prevent compiler warnings for "unused static function"
static inline std::istream &operator>>(std::istream &in, ExtendedProfileName &profile)

Karsten Suehring
committed
{
return readStrToEnum(strToExtendedProfile, sizeof(strToExtendedProfile)/sizeof(*strToExtendedProfile), in, profile);
}
namespace Level
{
static inline std::istream &operator>>(std::istream &in, Tier &tier)

Karsten Suehring
committed
{
return readStrToEnum(strToTier, sizeof(strToTier)/sizeof(*strToTier), in, tier);
}
static inline std::istream &operator>>(std::istream &in, Name &level)

Karsten Suehring
committed
{
return readStrToEnum(strToLevel, sizeof(strToLevel)/sizeof(*strToLevel), in, level);
}
}
static inline std::istream &operator>>(std::istream &in, CostMode &mode)

Karsten Suehring
committed
{
return readStrToEnum(strToCostMode, sizeof(strToCostMode)/sizeof(*strToCostMode), in, mode);
}
static inline std::istream &operator>>(std::istream &in, ScalingListMode &mode)

Karsten Suehring
committed
{
return readStrToEnum(strToScalingListMode, sizeof(strToScalingListMode)/sizeof(*strToScalingListMode), in, mode);
}
template<class T> static inline std::istream &operator>>(std::istream &in, SMultiValueInput<T> &values)

Karsten Suehring
committed
{
return values.readValues(in);
}
template <class T>
T SMultiValueInput<T>::readValue(const char *&pStr, bool &bSuccess)
{
T val=T();
std::string s(pStr);
std::replace(s.begin(), s.end(), ',', ' '); // make comma separated into space separated
std::istringstream iss(s);
iss>>val;
bSuccess=!iss.fail() // check nothing has gone wrong
&& !(val<minValIncl || val>maxValIncl) // check value is within range
&& (int)iss.tellg() != 0 // check we've actually read something
&& (iss.eof() || iss.peek()==' '); // check next character is a space, or eof
pStr+= (iss.eof() ? s.size() : (std::size_t)iss.tellg());
return val;
}
template<class T> std::istream &SMultiValueInput<T>::readValues(std::istream &in)

Karsten Suehring
committed
{
values.clear();

Karsten Suehring
committed
while (!in.eof())
{
std::string tmp;
in >> tmp;
str += " " + tmp;

Karsten Suehring
committed
}
if (!str.empty())
{
const char *pStr=str.c_str();
// soak up any whitespace
for(;isspace(*pStr);pStr++);
while (*pStr != 0)
{
bool bSuccess=true;
T val=readValue(pStr, bSuccess);
if (!bSuccess)
{

Karsten Suehring
committed
break;
}
if (maxNumValuesIncl != 0 && values.size() >= maxNumValuesIncl)
{

Karsten Suehring
committed
break;
}
values.push_back(val);
// soak up any whitespace and up to 1 comma.
for(;isspace(*pStr);pStr++);
if (*pStr == ',')
{
pStr++;
}
for(;isspace(*pStr);pStr++);
}
}
if (values.size() < minNumValuesIncl)
{

Karsten Suehring
committed
}
return in;
}
template<class T1, class T2> static inline std::istream &operator>>(std::istream &in, std::map<T1, T2> &map)
Rickard Sjöberg
committed
{
T1 key;
T2 value;
try
{
in >> key;
in >> value;
}
catch (...)
{
Rickard Sjöberg
committed
}
map[key] = value;
return in;
}
static uint32_t getMaxTileColsByLevel( Level::Name level )
{
{
case Level::LEVEL1:
case Level::LEVEL2:
case Level::LEVEL2_1:
return 1;
case Level::LEVEL3:
return 2;
case Level::LEVEL3_1:
return 3;
case Level::LEVEL4:
case Level::LEVEL4_1:
return 5;
case Level::LEVEL5:
case Level::LEVEL5_1:
case Level::LEVEL5_2:
return 10;
case Level::LEVEL6:
case Level::LEVEL6_1:
case Level::LEVEL6_2:
return 20;
case Level::LEVEL6_3:
return 30;
default:
return MAX_TILE_COLS;
}
}
static uint32_t getMaxTileRowsByLevel( Level::Name level )
{
{
case Level::LEVEL1:
case Level::LEVEL2:
case Level::LEVEL2_1:
return 1;
case Level::LEVEL3:
return 2;
case Level::LEVEL3_1:
return 3;
case Level::LEVEL4:
case Level::LEVEL4_1:
return 5;
case Level::LEVEL5:
case Level::LEVEL5_1:
case Level::LEVEL5_2:
return 11;
case Level::LEVEL6:
case Level::LEVEL6_1:
case Level::LEVEL6_2:
case Level::LEVEL6_3:
return 33;
default:
return MAX_TILES / MAX_TILE_COLS;
}
}
static uint32_t getMaxSlicesByLevel( Level::Name level )
{
{
case Level::LEVEL1:
case Level::LEVEL2:
return 16;
case Level::LEVEL2_1:
return 20;
case Level::LEVEL3:
return 30;
case Level::LEVEL3_1:
return 40;
case Level::LEVEL4:
case Level::LEVEL4_1:
return 75;
case Level::LEVEL5:
case Level::LEVEL5_1:
case Level::LEVEL5_2:
return 200;
case Level::LEVEL6:
case Level::LEVEL6_1:
case Level::LEVEL6_2:
return 600;
case Level::LEVEL6_3:
return 1000;
default:
return MAX_SLICES;

Karsten Suehring
committed
// ====================================================================================================================
// Public member functions
// ====================================================================================================================
/** \param argc number of arguments
\param argv array of arguments
\retval true when success
*/
// Disable optimizations to avoid long compile times
#pragma optimize( "", off )
#endif

Karsten Suehring
committed
bool EncAppCfg::parseCfg( int argc, char* argv[] )
{
bool do_help = false;
int tmpChromaFormat;
int tmpInputChromaFormat;
int tmpConstraintChromaFormat;
int tmpMaxChromaFormatConstraintIdc;

Karsten Suehring
committed
int tmpWeightedPredictionMethod;
int tmpFastInterSearchMode;
int tmpMotionEstimationSearchMethod;
int tmpDecodedPictureHashSEIMappedType;

Karsten Suehring
committed
int tmpSubpicDecodedPictureHashMappedType;
std::string inputColourSpaceConvert;
std::string inputPathPrefix;

Karsten Suehring
committed
ExtendedProfileName extendedProfile;
// Multi-value input fields: // minval, maxval (incl), min_entries, max_entries (incl) [, default values, number of default values]
SMultiValueInput<uint32_t> cfgTileColumnWidth (0, std::numeric_limits<uint32_t>::max(), 0, std::numeric_limits<uint32_t>::max());
SMultiValueInput<uint32_t> cfgTileRowHeight (0, std::numeric_limits<uint32_t>::max(), 0, std::numeric_limits<uint32_t>::max());
SMultiValueInput<uint32_t> cfgRectSlicePos (0, std::numeric_limits<uint32_t>::max(), 0, std::numeric_limits<uint32_t>::max());
SMultiValueInput<uint32_t> cfgRasterSliceSize (0, std::numeric_limits<uint32_t>::max(), 0, std::numeric_limits<uint32_t>::max());

Karsten Suehring
committed
SMultiValueInput<int> cfg_startOfCodedInterval (std::numeric_limits<int>::min(), std::numeric_limits<int>::max(), 0, 1<<16);
SMultiValueInput<int> cfg_codedPivotValue (std::numeric_limits<int>::min(), std::numeric_limits<int>::max(), 0, 1<<16);
SMultiValueInput<int> cfg_targetPivotValue (std::numeric_limits<int>::min(), std::numeric_limits<int>::max(), 0, 1<<16);

Karsten Suehring
committed
SMultiValueInput<double> cfg_adIntraLambdaModifier (0, std::numeric_limits<double>::max(), 0, MAX_TLAYER); ///< 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.
SMultiValueInput<uint16_t> cfgSliceLosslessArray (0, std::numeric_limits<uint16_t>::max(), 0, MAX_SLICES);

Karsten Suehring
committed
#if SHARP_LUMA_DELTA_QP
const int defaultLumaLevelTodQp_QpChangePoints[] = {-3, -2, -1, 0, 1, 2, 3, 4, 5, 6};
const int defaultLumaLevelTodQp_LumaChangePoints[] = { 0, 301, 367, 434, 501, 567, 634, 701, 767, 834};
SMultiValueInput<int> cfg_lumaLeveltoDQPMappingQP (-MAX_QP, MAX_QP, 0, LUMA_LEVEL_TO_DQP_LUT_MAXSIZE, defaultLumaLevelTodQp_QpChangePoints, sizeof(defaultLumaLevelTodQp_QpChangePoints )/sizeof(int));
SMultiValueInput<int> cfg_lumaLeveltoDQPMappingLuma (0, std::numeric_limits<int>::max(), 0, LUMA_LEVEL_TO_DQP_LUT_MAXSIZE, defaultLumaLevelTodQp_LumaChangePoints, sizeof(defaultLumaLevelTodQp_LumaChangePoints)/sizeof(int));
uint32_t lumaLevelToDeltaQPMode;
#endif
const int qpInVals[] = { 25, 33, 43 }; // qpInVal values used to derive the chroma QP mapping table used in VTM-5.0
const int qpOutVals[] = { 25, 32, 37 }; // qpOutVal values used to derive the chroma QP mapping table used in VTM-5.0
SMultiValueInput<int> cfg_qpInValCb (MIN_QP_VALUE_FOR_16_BIT, MAX_QP, 0, MAX_NUM_QP_VALUES, qpInVals, sizeof(qpInVals)/sizeof(int));
SMultiValueInput<int> cfg_qpOutValCb (MIN_QP_VALUE_FOR_16_BIT, MAX_QP, 0, MAX_NUM_QP_VALUES, qpOutVals, sizeof(qpOutVals) / sizeof(int));
Adarsh Krishnan Ramasubramonian
committed
const int zeroVector[] = { 0 };
SMultiValueInput<int> cfg_qpInValCr (MIN_QP_VALUE_FOR_16_BIT, MAX_QP, 0, MAX_NUM_QP_VALUES, zeroVector, 1);
SMultiValueInput<int> cfg_qpOutValCr (MIN_QP_VALUE_FOR_16_BIT, MAX_QP, 0, MAX_NUM_QP_VALUES, zeroVector, 1);
SMultiValueInput<int> cfg_qpInValCbCr (MIN_QP_VALUE_FOR_16_BIT, MAX_QP, 0, MAX_NUM_QP_VALUES, zeroVector, 1);
SMultiValueInput<int> cfg_qpOutValCbCr (MIN_QP_VALUE_FOR_16_BIT, MAX_QP, 0, MAX_NUM_QP_VALUES, zeroVector, 1);
Philippe de Lagrange
committed
const int cQpOffsets[] = { 6 };
SMultiValueInput<int> cfg_cbQpOffsetList (-12, 12, 0, 6, cQpOffsets, 0);
SMultiValueInput<int> cfg_crQpOffsetList (-12, 12, 0, 6, cQpOffsets, 0);
SMultiValueInput<int> cfg_cbCrQpOffsetList (-12, 12, 0, 6, cQpOffsets, 0);

Karsten Suehring
committed
const uint32_t defaultInputKneeCodes[3] = { 600, 800, 900 };
const uint32_t defaultOutputKneeCodes[3] = { 100, 250, 450 };
SMultiValueInput<uint32_t> cfg_kneeSEIInputKneePointValue (1, 999, 0, 999, defaultInputKneeCodes, sizeof(defaultInputKneeCodes )/sizeof(uint32_t));
SMultiValueInput<uint32_t> cfg_kneeSEIOutputKneePointValue (0, 1000, 0, 999, defaultOutputKneeCodes, sizeof(defaultOutputKneeCodes)/sizeof(uint32_t));
const int defaultPrimaryCodes[6] = { 0,50000, 0,0, 50000,0 };
const int defaultWhitePointCode[2] = { 16667, 16667 };

Karsten Suehring
committed
SMultiValueInput<int> cfg_DisplayPrimariesCode (0, 50000, 6, 6, defaultPrimaryCodes, sizeof(defaultPrimaryCodes )/sizeof(int));
SMultiValueInput<int> cfg_DisplayWhitePointCode (0, 50000, 2, 2, defaultWhitePointCode, sizeof(defaultWhitePointCode)/sizeof(int));
#if RExt__HIGH_BIT_DEPTH_SUPPORT
SMultiValueInput<Pel> cfg_SEICTILut0(0, ((1 << (2 + 16 - 1)) - 1), 0, MAX_CTI_LUT_SIZE + 1);
SMultiValueInput<Pel> cfg_SEICTILut1(0, ((1 << (2 + 16 - 1)) - 1), 0, MAX_CTI_LUT_SIZE + 1);
SMultiValueInput<Pel> cfg_SEICTILut2(0, ((1 << (2 + 16 - 1)) - 1), 0, MAX_CTI_LUT_SIZE + 1);
#else
SMultiValueInput<Pel> cfg_SEICTILut0(0, ((1 << (2 + 12 - 1)) - 1), 0, MAX_CTI_LUT_SIZE + 1);
SMultiValueInput<Pel> cfg_SEICTILut1(0, ((1 << (2 + 12 - 1)) - 1), 0, MAX_CTI_LUT_SIZE + 1);
SMultiValueInput<Pel> cfg_SEICTILut2(0, ((1 << (2 + 12 - 1)) - 1), 0, MAX_CTI_LUT_SIZE + 1);
#endif

Karsten Suehring
committed
SMultiValueInput<bool> cfg_timeCodeSeiTimeStampFlag (0, 1, 0, MAX_TIMECODE_SEI_SETS);
SMultiValueInput<bool> cfg_timeCodeSeiNumUnitFieldBasedFlag(0, 1, 0, MAX_TIMECODE_SEI_SETS);
SMultiValueInput<int> cfg_timeCodeSeiCountingType (0, 6, 0, MAX_TIMECODE_SEI_SETS);
SMultiValueInput<bool> cfg_timeCodeSeiFullTimeStampFlag (0, 1, 0, MAX_TIMECODE_SEI_SETS);
SMultiValueInput<bool> cfg_timeCodeSeiDiscontinuityFlag (0, 1, 0, MAX_TIMECODE_SEI_SETS);
SMultiValueInput<bool> cfg_timeCodeSeiCntDroppedFlag (0, 1, 0, MAX_TIMECODE_SEI_SETS);
SMultiValueInput<int> cfg_timeCodeSeiNumberOfFrames (0,511, 0, MAX_TIMECODE_SEI_SETS);
SMultiValueInput<int> cfg_timeCodeSeiSecondsValue (0, 59, 0, MAX_TIMECODE_SEI_SETS);
SMultiValueInput<int> cfg_timeCodeSeiMinutesValue (0, 59, 0, MAX_TIMECODE_SEI_SETS);
SMultiValueInput<int> cfg_timeCodeSeiHoursValue (0, 23, 0, MAX_TIMECODE_SEI_SETS);
SMultiValueInput<bool> cfg_timeCodeSeiSecondsFlag (0, 1, 0, MAX_TIMECODE_SEI_SETS);
SMultiValueInput<bool> cfg_timeCodeSeiMinutesFlag (0, 1, 0, MAX_TIMECODE_SEI_SETS);
SMultiValueInput<bool> cfg_timeCodeSeiHoursFlag (0, 1, 0, MAX_TIMECODE_SEI_SETS);
SMultiValueInput<int> cfg_timeCodeSeiTimeOffsetLength (0, 31, 0, MAX_TIMECODE_SEI_SETS);
SMultiValueInput<int> cfg_timeCodeSeiTimeOffsetValue (std::numeric_limits<int>::min(), std::numeric_limits<int>::max(), 0, MAX_TIMECODE_SEI_SETS);
SMultiValueInput<int> cfg_omniViewportSEIAzimuthCentre (-11796480, 11796479, 0, 15);
SMultiValueInput<int> cfg_omniViewportSEIElevationCentre ( -5898240, 5898240, 0, 15);
SMultiValueInput<int> cfg_omniViewportSEITiltCentre (-11796480, 11796479, 0, 15);
SMultiValueInput<uint32_t> cfg_omniViewportSEIHorRange ( 1, 23592960, 0, 15);
SMultiValueInput<uint32_t> cfg_omniViewportSEIVerRange ( 1, 11796480, 0, 15);
SMultiValueInput<uint32_t> cfg_rwpSEIRwpTransformType (0, 7, 0, std::numeric_limits<uint8_t>::max());
SMultiValueInput<bool> cfg_rwpSEIRwpGuardBandFlag (0, 1, 0, std::numeric_limits<uint8_t>::max());
SMultiValueInput<uint32_t> cfg_rwpSEIProjRegionWidth (0, std::numeric_limits<uint32_t>::max(), 0, std::numeric_limits<uint8_t>::max());
SMultiValueInput<uint32_t> cfg_rwpSEIProjRegionHeight (0, std::numeric_limits<uint32_t>::max(), 0, std::numeric_limits<uint8_t>::max());
SMultiValueInput<uint32_t> cfg_rwpSEIRwpSEIProjRegionTop (0, std::numeric_limits<uint32_t>::max(), 0, std::numeric_limits<uint8_t>::max());
SMultiValueInput<uint32_t> cfg_rwpSEIProjRegionLeft (0, std::numeric_limits<uint32_t>::max(), 0, std::numeric_limits<uint8_t>::max());
SMultiValueInput<uint32_t> cfg_rwpSEIPackedRegionWidth (0, std::numeric_limits<uint16_t>::max(), 0, std::numeric_limits<uint8_t>::max());
SMultiValueInput<uint32_t> cfg_rwpSEIPackedRegionHeight (0, std::numeric_limits<uint16_t>::max(), 0, std::numeric_limits<uint8_t>::max());
SMultiValueInput<uint32_t> cfg_rwpSEIPackedRegionTop (0, std::numeric_limits<uint16_t>::max(), 0, std::numeric_limits<uint8_t>::max());
SMultiValueInput<uint32_t> cfg_rwpSEIPackedRegionLeft (0, std::numeric_limits<uint16_t>::max(), 0, std::numeric_limits<uint8_t>::max());
SMultiValueInput<uint32_t> cfg_rwpSEIRwpLeftGuardBandWidth (0, std::numeric_limits<uint8_t>::max(), 0, std::numeric_limits<uint8_t>::max());
SMultiValueInput<uint32_t> cfg_rwpSEIRwpRightGuardBandWidth (0, std::numeric_limits<uint8_t>::max(), 0, std::numeric_limits<uint8_t>::max());
SMultiValueInput<uint32_t> cfg_rwpSEIRwpTopGuardBandHeight (0, std::numeric_limits<uint8_t>::max(), 0, std::numeric_limits<uint8_t>::max());
SMultiValueInput<uint32_t> cfg_rwpSEIRwpBottomGuardBandHeight (0, std::numeric_limits<uint8_t>::max(), 0, std::numeric_limits<uint8_t>::max());
SMultiValueInput<bool> cfg_rwpSEIRwpGuardBandNotUsedForPredFlag (0, 1, 0, std::numeric_limits<uint8_t>::max());
SMultiValueInput<uint32_t> cfg_rwpSEIRwpGuardBandType (0, 7, 0, 4*std::numeric_limits<uint8_t>::max());
SMultiValueInput<uint32_t> cfg_gcmpSEIFaceIndex (0, 5, 5, 6);
SMultiValueInput<uint32_t> cfg_gcmpSEIFaceRotation (0, 3, 5, 6);
SMultiValueInput<double> cfg_gcmpSEIFunctionCoeffU (0.0, 1.0, 5, 6);
SMultiValueInput<uint32_t> cfg_gcmpSEIFunctionUAffectedByVFlag (0, 1, 5, 6);
SMultiValueInput<double> cfg_gcmpSEIFunctionCoeffV (0.0, 1.0, 5, 6);
SMultiValueInput<uint32_t> cfg_gcmpSEIFunctionVAffectedByUFlag (0, 1, 5, 6);
SMultiValueInput<uint32_t> cfg_sdiSEILayerId (0, 63, 0, 63);
SMultiValueInput<uint32_t> cfg_sdiSEIViewIdVal (0, 63, 0, std::numeric_limits<uint32_t>::max());
SMultiValueInput<uint32_t> cfg_sdiSEIAuxId (0, 255, 0, 63);
SMultiValueInput<uint32_t> cfg_sdiSEINumAssociatedPrimaryLayersMinus1 (0, 63, 0, 63);
SMultiValueInput<bool> cfg_maiSEISignFocalLengthX (0, 1, 0, std::numeric_limits<uint32_t>::max());
SMultiValueInput<uint32_t> cfg_maiSEIExponentFocalLengthX (0, 63, 0, std::numeric_limits<uint32_t>::max());
SMultiValueInput<uint32_t> cfg_maiSEIMantissaFocalLengthX (0, std::numeric_limits<uint32_t>::max(), 0, std::numeric_limits<uint32_t>::max());
SMultiValueInput<bool> cfg_maiSEISignFocalLengthY (0, 1, 0, std::numeric_limits<uint32_t>::max());
SMultiValueInput<uint32_t> cfg_maiSEIExponentFocalLengthY (0, 63, 0, std::numeric_limits<uint32_t>::max());
SMultiValueInput<uint32_t> cfg_maiSEIMantissaFocalLengthY (0, std::numeric_limits<uint32_t>::max(), 0, std::numeric_limits<uint32_t>::max());
SMultiValueInput<bool> cfg_maiSEISignPrincipalPointX (0, 1, 0, std::numeric_limits<uint32_t>::max());
SMultiValueInput<uint32_t> cfg_maiSEIExponentPrincipalPointX (0, 63, 0, std::numeric_limits<uint32_t>::max());
SMultiValueInput<uint32_t> cfg_maiSEIMantissaPrincipalPointX (0, std::numeric_limits<uint32_t>::max(), 0, std::numeric_limits<uint32_t>::max());
SMultiValueInput<bool> cfg_maiSEISignPrincipalPointY (0, 1, 0, std::numeric_limits<uint32_t>::max());
SMultiValueInput<uint32_t> cfg_maiSEIExponentPrincipalPointY (0, 63, 0, std::numeric_limits<uint32_t>::max());
SMultiValueInput<uint32_t> cfg_maiSEIMantissaPrincipalPointY (0, std::numeric_limits<uint32_t>::max(), 0, std::numeric_limits<uint32_t>::max());
SMultiValueInput<bool> cfg_maiSEISignSkewFactor (0, 1, 0, std::numeric_limits<uint32_t>::max());
SMultiValueInput<uint32_t> cfg_maiSEIExponentSkewFactor (0, 63, 0, std::numeric_limits<uint32_t>::max());
SMultiValueInput<uint32_t> cfg_maiSEIMantissaSkewFactor (0, std::numeric_limits<uint32_t>::max(), 0, std::numeric_limits<uint32_t>::max());
SMultiValueInput<uint32_t> cfg_mvpSEIViewPosition (0, 63, 0, std::numeric_limits<uint32_t>::max());
SMultiValueInput<uint32_t> cfg_driSEINonlinearModel (0, 31, 0, std::numeric_limits<uint32_t>::max());
Shunsuke Iwamura
committed
const int defaultLadfQpOffset[3] = { 1, 0, 1 };
const int defaultLadfIntervalLowerBound[2] = { 350, 833 };
SMultiValueInput<int> cfg_ladfQpOffset(-MAX_QP, MAX_QP, 2, MAX_LADF_INTERVALS, defaultLadfQpOffset, 3);
SMultiValueInput<int> cfg_ladfIntervalLowerBound(0, std::numeric_limits<int>::max(), 1, MAX_LADF_INTERVALS - 1,
defaultLadfIntervalLowerBound, 2);
Sheng-Yen Lin
committed
SMultiValueInput<unsigned> cfg_virtualBoundariesPosX (0, std::numeric_limits<uint32_t>::max(), 0, 3);
SMultiValueInput<unsigned> cfg_virtualBoundariesPosY (0, std::numeric_limits<uint32_t>::max(), 0, 3);
const int defaultRprSwitchingResolutionOrderList[12] = { 1, 0, 2, 0, 3, 0, 1, 0, 2, 0, 3, 0 };
const int defaultRprSwitchingQPOffsetOrderList[12] = { -2, 0, -4, 0, -6, 0, -2, 0, -4, 0, -6, 0 };
SMultiValueInput<int> cfg_rprSwitchingResolutionOrderList(0, 3, 0, MAX_RPR_SWITCHING_ORDER_LIST_SIZE, defaultRprSwitchingResolutionOrderList, 12);
SMultiValueInput<int> cfg_rprSwitchingQPOffsetOrderList(-MAX_QP, MAX_QP, 0, MAX_RPR_SWITCHING_ORDER_LIST_SIZE, defaultRprSwitchingQPOffsetOrderList, 12);
Frank Bossen
committed
SMultiValueInput<uint32_t> cfg_SubProfile(0, std::numeric_limits<uint8_t>::max(), 0,
std::numeric_limits<uint8_t>::max());
SMultiValueInput<uint32_t> cfg_subPicCtuTopLeftX(0, std::numeric_limits<uint32_t>::max(), 0, MAX_NUM_SUB_PICS);
SMultiValueInput<uint32_t> cfg_subPicCtuTopLeftY(0, std::numeric_limits<uint32_t>::max(), 0, MAX_NUM_SUB_PICS);
SMultiValueInput<uint32_t> cfg_subPicWidth(1, std::numeric_limits<uint32_t>::max(), 0, MAX_NUM_SUB_PICS);
SMultiValueInput<uint32_t> cfg_subPicHeight(1, std::numeric_limits<uint32_t>::max(), 0, MAX_NUM_SUB_PICS);
SMultiValueInput<bool> cfg_subPicTreatedAsPicFlag(0, 1, 0, MAX_NUM_SUB_PICS);
SMultiValueInput<bool> cfg_loopFilterAcrossSubpicEnabledFlag(0, 1, 0, MAX_NUM_SUB_PICS);
SMultiValueInput<uint32_t> cfg_subPicId(0, std::numeric_limits<uint16_t>::max(), 0, MAX_NUM_SUB_PICS);
SMultiValueInput<int> cfg_sliFractions(0, 255, 0, std::numeric_limits<int>::max());
SMultiValueInput<int> cfg_sliNonSubpicLayersFractions(0, 255, 0, std::numeric_limits<int>::max());
SMultiValueInput<Level::Name> cfg_sliRefLevels(Level::NONE, Level::LEVEL15_5, 0, 8 * MAX_VPS_SUBLAYERS);

Karsten Suehring
committed
int warnUnknowParameter = 0;
SMultiValueInput<uint32_t> cfg_FgcSEIIntensityIntervalLowerBoundComp0 (0, 255, 0, 256);
SMultiValueInput<uint32_t> cfg_FgcSEIIntensityIntervalLowerBoundComp1 (0, 255, 0, 256);
SMultiValueInput<uint32_t> cfg_FgcSEIIntensityIntervalLowerBoundComp2 (0, 255, 0, 256);
SMultiValueInput<uint32_t> cfg_FgcSEIIntensityIntervalUpperBoundComp0 (0, 255, 0, 256);
SMultiValueInput<uint32_t> cfg_FgcSEIIntensityIntervalUpperBoundComp1 (0, 255, 0, 256);
SMultiValueInput<uint32_t> cfg_FgcSEIIntensityIntervalUpperBoundComp2 (0, 255, 0, 256);
SMultiValueInput<uint32_t> cfg_FgcSEICompModelValueComp0 (0, 65535, 0, 256 * 6);
SMultiValueInput<uint32_t> cfg_FgcSEICompModelValueComp1 (0, 65535, 0, 256 * 6);
SMultiValueInput<uint32_t> cfg_FgcSEICompModelValueComp2 (0, 65535, 0, 256 * 6);
Jeeva Raj A
committed
SMultiValueInput<unsigned> cfg_siiSEIInputNumUnitsInSI(0, std::numeric_limits<uint32_t>::max(), 0, 7);
SMultiValueInput<bool> cfg_poSEIWrappingFlag(false, true, 0, 256);
SMultiValueInput<bool> cfg_poSEIImportanceFlag(false, true, 0, 256);
SMultiValueInput<bool> cfg_poSEIPrefixFlag(false, true, 0, 256);
SMultiValueInput<uint16_t> cfg_poSEIPayloadType(0, 32768, 0, 256 * 2);
SMultiValueInput<uint16_t> cfg_poSEIProcessingOrder(0, 65535, 0, 65536);
SMultiValueInput<uint16_t> cfg_poSEINumofPrefixByte(0, 255, 0, 256);
SMultiValueInput<uint16_t> cfg_poSEIPrefixByte (0, 255, 0, 256);
SMultiValueInput<int32_t> cfg_postFilterHintSEIValues(INT32_MIN + 1, INT32_MAX, 1 * 1 * 1, 15 * 15 * 3);
Philip Cowan
committed
std::vector<SMultiValueInput<uint32_t>> cfg_nnPostFilterSEICharacteristicsInterpolatedPicturesList;
std::vector<SMultiValueInput<bool>> cfg_nnPostFilterSEICharacteristicsInputPicOutputFlagList;
Philip Cowan
committed
for (int i = 0; i < MAX_NUM_NN_POST_FILTERS; i++)
{
cfg_nnPostFilterSEICharacteristicsInterpolatedPicturesList.push_back(SMultiValueInput<uint32_t>(0, std::numeric_limits<uint32_t>::max(), 1, 0));
cfg_nnPostFilterSEICharacteristicsInputPicOutputFlagList.push_back(SMultiValueInput<bool>(0, 1, 1, 0));
Philip Cowan
committed
}
Antti Hallapuro
committed
SMultiValueInput<bool> cfg_nnPostFilterSEIActivationOutputFlagList(0, 1, 1, 0);
Philip Cowan
committed

Karsten Suehring
committed
#if ENABLE_TRACING
std::string sTracingRule;
std::string sTracingFile;

Karsten Suehring
committed
bool bTracingChannelsList = false;
#endif
#if ENABLE_SIMD_OPT
std::string ignore;
#endif
std::string frameRate;

Karsten Suehring
committed
bool sdr = false;
int chromaSampleLocType;
int chromaSampleLocTypeTopField;
int chromaSampleLocTypeBottomField;

Karsten Suehring
committed
po::Options opts;
opts.addOptions()
("help", do_help, false, "this help text")
("c", po::parseConfigFile, "configuration file name")
("WarnUnknowParameter,w", warnUnknowParameter, 0, "warn for unknown configuration parameters instead of failing")
("isSDR", sdr, false, "compatibility")
#if ENABLE_SIMD_OPT
("SIMD", ignore, std::string(""), "SIMD extension to use (SCALAR, SSE41, SSE42, AVX, AVX2, AVX512), default: the highest supported extension\n")

Karsten Suehring
committed
#endif
// File, I/O and source parameters
("InputFile,i", m_inputFileName, std::string(""), "Original YUV input file name")
("InputPathPrefix,-ipp", inputPathPrefix, std::string(""), "pathname to prepend to input filename")
("BitstreamFile,b", m_bitstreamFileName, std::string(""), "Bitstream output file name")
("ReconFile,o", m_reconFileName, std::string(""), "Reconstructed YUV output file name")
("SEIShutterIntervalPreFilename,-sii", m_shutterIntervalPreFileName, std::string(""), "File name of Pre-Filtering video. If empty, not output video\n")
("SourceWidth,-wdt", m_sourceWidth, 0, "Source picture width")
("SourceHeight,-hgt", m_sourceHeight, 0, "Source picture height")
("SourceScalingRatioHor", m_sourceScalingRatioHor, 1.0, "Source picture horizontal scaling ratio")
("SourceScalingRatioVer", m_sourceScalingRatioVer, 1.0, "Source picture vertical scaling ratio")
("InputBitDepth", m_inputBitDepth[ChannelType::LUMA], 8, "Bit-depth of input file")
("OutputBitDepth", m_outputBitDepth[ChannelType::LUMA], 0, "Bit-depth of output file (default:InternalBitDepth)")
("MSBExtendedBitDepth", m_msbExtendedBitDepth[ChannelType::LUMA], 0, "bit depth of luma component after addition of MSBs of value 0 (used for synthesising High Dynamic Range source material). (default:InputBitDepth)")
("InternalBitDepth", m_internalBitDepth[ChannelType::LUMA], 0, "Bit-depth the codec operates at. (default: MSBExtendedBitDepth). If different to MSBExtendedBitDepth, source data will be converted")
("InputBitDepthC", m_inputBitDepth[ChannelType::CHROMA], 0, "As per InputBitDepth but for chroma component. (default:InputBitDepth)")
("OutputBitDepthC", m_outputBitDepth[ChannelType::CHROMA], 0, "As per OutputBitDepth but for chroma component. (default: use luma output bit-depth)")
("MSBExtendedBitDepthC", m_msbExtendedBitDepth[ChannelType::CHROMA], 0, "As per MSBExtendedBitDepth but for chroma component. (default:MSBExtendedBitDepth)")

Karsten Suehring
committed
("ExtendedPrecision", m_extendedPrecisionProcessingFlag, false, "Increased internal accuracies to support high bit depths (not valid in V1 profiles)")
Hong-Jheng Jhu
committed
("TSRCRicePresent", m_tsrcRicePresentFlag, false, "Indicate that TSRC Rice information is present in slice header (not valid in V1 profiles)")
("ReverseLastSigCoeff", m_reverseLastSigCoeffEnabledFlag, false, "enable reverse last significant coefficient postion in RRC (not valid in V1 profiles)")

Karsten Suehring
committed
("HighPrecisionPredictionWeighting", m_highPrecisionOffsetsEnabledFlag, false, "Use high precision option for weighted prediction (not valid in V1 profiles)")
("InputColourSpaceConvert", inputColourSpaceConvert, std::string(""), "Colour space conversion to apply to input video. Permitted values are (empty string=UNCHANGED) " + getListOfColourSpaceConverts(true))

Karsten Suehring
committed
("SNRInternalColourSpace", m_snrInternalColourSpace, false, "If true, then no colour space conversion is applied prior to SNR, otherwise inverse of input is applied.")
("OutputInternalColourSpace", m_outputInternalColourSpace, false, "If true, then no colour space conversion is applied for reconstructed video, otherwise inverse of input is applied.")
("InputChromaFormat", tmpInputChromaFormat, 420, "InputChromaFormatIDC")
("MSEBasedSequencePSNR", m_printMSEBasedSequencePSNR, false, "0 (default) emit sequence PSNR only as a linear average of the frame PSNRs, 1 = also emit a sequence PSNR based on an average of the frame MSEs")
("PrintHexPSNR", m_printHexPsnr, false, "0 (default) don't emit hexadecimal PSNR for each frame, 1 = also emit hexadecimal PSNR values")
("PrintFrameMSE", m_printFrameMSE, false, "0 (default) emit only bit count and PSNRs for each frame, 1 = also emit MSE values")
("PrintSequenceMSE", m_printSequenceMSE, false, "0 (default) emit only bit rate and PSNRs for the whole sequence, 1 = also emit MSE values")
("PrintMSSSIM", m_printMSSSIM, false, "0 (default) do not print MS-SSIM scores, 1 = print MS-SSIM scores for each frame and for the whole sequence")
("PrintWPSNR", m_printWPSNR, false, "0 (default) do not print HDR-PQ based wPSNR, 1 = print HDR-PQ based wPSNR")
("PrintHighPrecEncTime", m_printHighPrecEncTime, false, "0 (default): print integer value of encoding time in seconds, 1: print floating-point value of encoding time")

Karsten Suehring
committed
("CabacZeroWordPaddingEnabled", m_cabacZeroWordPaddingEnabled, true, "0 do not add conforming cabac-zero-words to bit streams, 1 (default) = add cabac-zero-words as required")
("ChromaFormatIDC,-cf", tmpChromaFormat, 0, "ChromaFormatIDC (400|420|422|444 or set 0 (default) for same as InputChromaFormat)")
("ConformanceWindowMode", m_conformanceWindowMode, 1, "Window conformance mode (0: no window, 1:automatic padding (default), 2:padding parameters specified, 3:conformance window parameters specified")
("HorizontalPadding,-pdx", m_sourcePadding[0], 0, "Horizontal source padding for conformance window mode 2")
("VerticalPadding,-pdy", m_sourcePadding[1], 0, "Vertical source padding for conformance window mode 2")

Karsten Suehring
committed
("ConfWinLeft", m_confWinLeft, 0, "Left offset for window conformance mode 3")
("ConfWinRight", m_confWinRight, 0, "Right offset for window conformance mode 3")
("ConfWinTop", m_confWinTop, 0, "Top offset for window conformance mode 3")
("ConfWinBottom", m_confWinBottom, 0, "Bottom offset for window conformance mode 3")
("ScalingWindow", m_explicitScalingWindowEnabled, false, "Enable scaling window")
("ScalWinLeft,-swl", m_scalWinLeft, 0, "Left offset for scaling window")
("ScalWinRight,-swr", m_scalWinRight, 0, "Right offset for scaling window")
("ScalWinTop,-swt", m_scalWinTop, 0, "Top offset for scaling window")
("ScalWinBottom,-swb", m_scalWinBottom, 0, "Bottom offset for scaling window")
("AccessUnitDelimiter", m_AccessUnitDelimiter, false, "Enable Access Unit Delimiter NALUs")
("EnablePictureHeaderInSliceHeader", m_enablePictureHeaderInSliceHeader, true, "Enable Picture Header in Slice Header")
("FrameRate,-fr", frameRate, std::to_string(0), "Frame rate")
("FrameSkip,-fs", m_frameSkip, 0u, "Number of frames to skip at start of input YUV")

Karsten Suehring
committed
("TemporalSubsampleRatio,-ts", m_temporalSubsampleRatio, 1u, "Temporal sub-sample ratio when reading input YUV")
("FramesToBeEncoded,f", m_framesToBeEncoded, 0, "Number of frames to be encoded (default=all)")
("ClipInputVideoToRec709Range", m_clipInputVideoToRec709Range, false, "If true then clip input video to the Rec. 709 Range on loading when InternalBitDepth is less than MSBExtendedBitDepth")
("ClipOutputVideoToRec709Range", m_clipOutputVideoToRec709Range, false, "If true then clip output video to the Rec. 709 Range on saving when OutputBitDepth is less than InternalBitDepth")
("PYUV", m_packedYUVMode, false, "If true then output 10-bit and 12-bit YUV data as 5-byte and 3-byte (respectively) packed YUV data. Ignored for interlaced output.")
("SummaryOutFilename", m_summaryOutFilename, std::string(), "Filename to use for producing summary output file. If empty, do not produce a file.")
("SummaryPicFilenameBase", m_summaryPicFilenameBase, std::string(), "Base filename to use for producing summary picture output files. The actual filenames used will have I.txt, P.txt and B.txt appended. If empty, do not produce a file.")

Karsten Suehring
committed
("SummaryVerboseness", m_summaryVerboseness, 0u, "Specifies the level of the verboseness of the text output")
("Verbosity,v", m_verbosity, (int)VERBOSE, "Specifies the level of the verboseness")
#if JVET_O0756_CONFIG_HDRMETRICS || JVET_O0756_CALCULATE_HDRMETRICS
( "WhitePointDeltaE1", m_whitePointDeltaE[0], 100.0, "1st reference white point value")
( "WhitePointDeltaE2", m_whitePointDeltaE[1], 1000.0, "2nd reference white point value")
( "WhitePointDeltaE3", m_whitePointDeltaE[2], 5000.0, "3rd reference white point value")
( "MaxSampleValue", m_maxSampleValue, 10000.0, "Maximum sample value for floats")
( "InputSampleRange", m_sampleRange, 0, "Sample Range")
( "InputColorPrimaries", m_colorPrimaries, 1, "Input Color Primaries")
( "EnableTFunctionLUT", m_enableTFunctionLUT, false, "Input Color Primaries")
( "ChromaLocation", m_chromaLocation, 2, "Location of Chroma Samples")
( "ChromaUpsampleFilter", m_chromaUPFilter, 1, "420 to 444 conversion filters")
( "CropOffsetLeft", m_cropOffsetLeft, 0, "Crop Offset Left position")
( "CropOffsetTop", m_cropOffsetTop, 0, "Crop Offset Top position")
( "CropOffsetRight", m_cropOffsetRight, 0, "Crop Offset Right position")
( "CropOffsetBottom", m_cropOffsetBottom, 0, "Crop Offset Bottom position")
( "CalculateHdrMetrics", m_calculateHdrMetrics, false, "Enable HDR metric calculation")
#if GREEN_METADATA_SEI_ENABLED
("SEIGreenMetadataType", m_greenMetadataType, -1, "Value for the green_metadata_type specifies the type of metadata that is present in the SEI message. -1: Green metadata disabled (default); 0: Decoder complexity metrics; 1: quality recovery after low-power encoding")
("SEIGreenMetadataGranularityType", m_greenMetadataGranularityType, -1, "Specifies the type of granularity for which the metadata are applicable. Only implemented for picture granularity. ")
("SEIGreenMetadataPeriodType", m_greenMetadataPeriodType, 0, "Value for the Period Type incidacting over which amount of time the metadata have been calculated")
("SEIGreenMetadataPeriodTypeSeconds", m_greenMetadataPeriodNumSeconds, 1, "indicates the number of seconds over which the metadata are applicable when SEIGreenMetadataPeriodType is 2.")
("SEIGreenMetadataPeriodTypePictures", m_greenMetadataPeriodNumPictures, 1, "specifies the number of pictures, counted in decoding order, over which the metadata are applicable when SEIGreenMetadataPeriodType is 3.")
("SEIXSDMetricNumber", m_xsdNumberMetrics, 1, "Number of quality metrics.")
("SEIXSDMetricTypePSNR", m_xsdMetricTypePSNR, false, "Set to 'true' if PSNR shall be signalled. ")
("SEIXSDMetricTypeSSIM", m_xsdMetricTypeSSIM, false, "Set to 'true' if SSIM shall be signalled. ")
("SEIXSDMetricTypeWPSNR", m_xsdMetricTypeWPSNR, false, "Set to 'true' if WPSNR shall be signalled. ")
("SEIXSDMetricTypeWSPSNR", m_xsdMetricTypeWSPSNR, false, "Set to 'true' if WSSPSNR shall be signalled. ")
("SEIGreenMetadataExtendedRepresentation", m_greenMetadataExtendedRepresentation, 0, "Specifies whether reduced or extended set of complexity metrics is signelled. ")
("GMFA", m_GMFA, false, "Write output file for the Green-Metadata analyzer for decoder complexity metrics (JVET-P0085)\n")
("GMFAFile", m_GMFAFile, std::string(""), "File for the Green Metadata Bit Stream Feature Analyzer output (JVET-P0085)\n")

Karsten Suehring
committed
//Field coding parameters
("FieldCoding", m_isField, false, "Signals if it's a field based coding")
("TopFieldFirst, Tff", m_isTopFieldFirst, false, "In case of field based coding, signals whether if it's a top field first or not")
("EfficientFieldIRAPEnabled", m_efficientFieldIRAPEnabled, true, "Enable to code fields in a specific, potentially more efficient, order.")
("HarmonizeGopFirstFieldCoupleEnabled", m_harmonizeGopFirstFieldCoupleEnabled, true, "Enables harmonization of Gop first field couple")

Karsten Suehring
committed
// Profile and level
("Profile", extendedProfile, ExtendedProfileName::NONE, "Profile name to use for encoding. Use [multilayer_]main_10[_444][_still_picture], auto, or none")

Karsten Suehring
committed
("Level", m_level, Level::NONE, "Level limit to be used, eg 5.1, or none")
("Tier", m_levelTier, Level::MAIN, "Tier to use for interpretation of --Level (main or high only)")
("FrameOnlyConstraintFlag", m_frameOnlyConstraintFlag, true, "Bitstream contains only frames")
("MultiLayerEnabledFlag", m_multiLayerEnabledFlag, false, "Bitstream might contain more than one layer")
("SubProfile", cfg_SubProfile, cfg_SubProfile, "Sub-profile idc")
("EnableDecodingCapabilityInformation", m_DCIEnabled, false, "Enables writing of Decoding Capability Information")
("MaxBitDepthConstraint", m_bitDepthConstraint, 0u, "Bit depth to use for profile-constraint for RExt profiles. 0=automatically choose based upon other parameters")
("MaxChromaFormatConstraint", tmpConstraintChromaFormat, 0, "Chroma-format to use for the profile-constraint for RExt profiles. 0=automatically choose based upon other parameters")
("GciPresentFlag", m_gciPresentFlag, false, "GCI field present")
("IntraOnlyConstraintFlag", m_intraOnlyConstraintFlag, false, "Value of intra_only_constraint_flag")
("AllLayersIndependentConstraintFlag", m_allLayersIndependentConstraintFlag, false, "Indicate that all layers are independent")
("OnePictureOnlyConstraintFlag", m_onePictureOnlyConstraintFlag, false, "Value of general_intra_constraint_flag. Can only be used for single frame encodings. Will be set to true for still picture profiles")
("MaxBitDepthConstraintIdc", m_maxBitDepthConstraintIdc, 16u, "Indicate that sps_bitdepth_minus8 plus 8 shall be in the range of 0 to m_maxBitDepthConstraintIdc")
("MaxChromaFormatConstraintIdc", tmpMaxChromaFormatConstraintIdc, 3, "Indicate that sps_chroma_format_idc shall be in the range of 0 to m_maxChromaFormatConstraintIdc")
Zhipin Deng
committed
("NoTrailConstraintFlag", m_noTrailConstraintFlag, false, "Indicate that TRAIL is deactivated")
("NoStsaConstraintFlag", m_noStsaConstraintFlag, false, "Indicate that STSA is deactivated")
("NoRaslConstraintFlag", m_noRaslConstraintFlag, false, "Indicate that RSAL is deactivated")
("NoRadlConstraintFlag", m_noRadlConstraintFlag, false, "Indicate that RADL is deactivated")
("NoIdrConstraintFlag", m_noIdrConstraintFlag, false, "Indicate that IDR is deactivated")
("NoCraConstraintFlag", m_noCraConstraintFlag, false, "Indicate that CRA is deactivated")
("NoGdrConstraintFlag", m_noGdrConstraintFlag, false, "Indicate that GDR is deactivated")
("NoApsConstraintFlag", m_noApsConstraintFlag, false, "Indicate that APS is deactivated")
("OneTilePerPicConstraintFlag", m_oneTilePerPicConstraintFlag, false, "Indicate that each picture shall contain only one tile")
("PicHeaderInSliceHeaderConstraintFlag", m_picHeaderInSliceHeaderConstraintFlag, false, "Indicate that picture header is present in slice header")
("OneSlicePerPicConstraintFlag", m_oneSlicePerPicConstraintFlag, false, "Indicate that each picture shall contain only one slice")
("NoIdrRplConstraintFlag", m_noIdrRplConstraintFlag, false, "Indicate that RPL is not present in SH of IDR slices")
("NoRectSliceConstraintFlag", m_noRectSliceConstraintFlag, false, "Indicate that rectagular slice is deactivated")
("OneSlicePerSubpicConstraintFlag", m_oneSlicePerSubpicConstraintFlag, false, "Indicate that each subpicture shall contain only one slice")
("NoSubpicInfoConstraintFlag", m_noSubpicInfoConstraintFlag, false, "Indicate that subpicture information is not present")
("MaxLog2CtuSizeConstraintIdc", m_maxLog2CtuSizeConstraintIdc, 8, "Indicate that Log2CtuSize shall be in the range of 0 to m_maxLog2CtuSizeConstraintIdc")
Zhipin Deng
committed
("NoPartitionConstraintsOverrideConstraintFlag", m_noPartitionConstraintsOverrideConstraintFlag, false, "Indicate that Partition Override is deactivated")
("MttConstraintFlag", m_noMttConstraintFlag, false, "Indicate that Mtt is deactivated")
("NoQtbttDualTreeIntraConstraintFlag", m_noQtbttDualTreeIntraConstraintFlag, false, "Indicate that Qtbtt DualTree Intra is deactivated")
Zhipin Deng
committed
("NoPaletteConstraintFlag", m_noPaletteConstraintFlag, false, "Indicate that PLT is deactivated")
("NoIbcConstraintFlag", m_noIbcConstraintFlag, false, "Indicate that IBC is deactivated")
("NoIspConstraintFlag", m_noIspConstraintFlag, false, "Indicate that ISP is deactivated")
("NoMrlConstraintFlag", m_noMrlConstraintFlag, false, "Indicate that MRL is deactivated")
("NoMipConstraintFlag", m_noMipConstraintFlag, false, "Indicate that MIP is deactivated")
("NoCclmConstraintFlag", m_noCclmConstraintFlag, false, "Indicate that CCLM is deactivated")
Zhipin Deng
committed
("NoRprConstraintFlag", m_noRprConstraintFlag, false, "Indicate that reference picture resampling is deactivated")
("NoResChangeInClvsConstraintFlag", m_noResChangeInClvsConstraintFlag, false, "Indicate that the picture spatial resolution does not change within any CLVS referring to the SPS")
("WeightedPredictionConstraintFlag", m_noWeightedPredictionConstraintFlag, false, "Indicate that Weighted Prediction is deactivated")
("NoRefWraparoundConstraintFlag", m_noRefWraparoundConstraintFlag, false, "Indicate that Reference Wraparound is deactivated")
("NoTemporalMvpConstraintFlag", m_noTemporalMvpConstraintFlag, false, "Indicate that temporal MVP is deactivated")
("NoSbtmvpConstraintFlag", m_noSbtmvpConstraintFlag, false, "Indicate that SbTMVP is deactivated")
("NoAmvrConstraintFlag", m_noAmvrConstraintFlag, false, "Indicate that AMVR is deactivated")
Zhipin Deng
committed
("NoSmvdConstraintFlag", m_noSmvdConstraintFlag, false, "Indicate that SMVD is deactivated")
("NoBdofConstraintFlag", m_noBdofConstraintFlag, false, "Indicate that BIO is deactivated")
Zhipin Deng
committed
("NoDmvrConstraintFlag", m_noDmvrConstraintFlag, false, "Indicate that DMVR is deactivated")
("NoMmvdConstraintFlag", m_noMmvdConstraintFlag, false, "Indicate that MMVD is deactivated")
("NoAffineMotionConstraintFlag", m_noAffineMotionConstraintFlag, false, "Indicate that Affine is deactivated")
Zhipin Deng
committed
("NoProfConstraintFlag", m_noProfConstraintFlag, false, "Indicate that PROF is deactivated")
("NoBcwConstraintFlag", m_noBcwConstraintFlag, false, "Indicate that BCW is deactivated")
("NoCiipConstraintFlag", m_noCiipConstraintFlag, false, "Indicate that CIIP is deactivated")
Zhipin Deng
committed
("NoGpmConstraintFlag", m_noGeoConstraintFlag, false, "Indicate that GPM is deactivated")
("NoTransformSkipConstraintFlag", m_noTransformSkipConstraintFlag, false, "Indicate that Transform Skip is deactivated")
("NoLumaTransformSize64ConstraintFlag", m_noLumaTransformSize64ConstraintFlag, false, "Indicate that Luma Transform Size 64 is deactivated")
("NoBDPCMConstraintFlag", m_noBDPCMConstraintFlag, false, "Indicate that BDPCM is deactivated")
("NoMtsConstraintFlag", m_noMtsConstraintFlag, false, "Indicate that MTS is deactivated")
Zhipin Deng
committed
("NoLfnstConstraintFlag", m_noLfnstConstraintFlag, false, "Indicate that LFNST is deactivated")
("NoJointCbCrConstraintFlag", m_noJointCbCrConstraintFlag, false, "Indicate that JCCR is deactivated")
("NoSbtConstraintFlag", m_noSbtConstraintFlag, false, "Indicate that SBT is deactivated")
("NoActConstraintFlag", m_noActConstraintFlag, false, "Indicate that ACT is deactivated")
("NoExplicitScaleListConstraintFlag", m_noExplicitScaleListConstraintFlag, false, "Indicate that explicit scaling list is deactivated")
("NoChromaQpOffsetConstraintFlag", m_noChromaQpOffsetConstraintFlag, false, "Indicate that chroma qp offset is zero")
("NoDepQuantConstraintFlag", m_noDepQuantConstraintFlag, false, "Indicate that DQ is deactivated")
("NoSignDataHidingConstraintFlag", m_noSignDataHidingConstraintFlag, false, "Indicate that SDH is deactivated")
Martin Pettersson
committed
("NoCuQpDeltaConstraintFlag", m_noCuQpDeltaConstraintFlag, false, "Indicate that CU QP delta is deactivated")
("NoSaoConstraintFlag", m_noSaoConstraintFlag, false, "Indicate that SAO is deactivated")
("NoAlfConstraintFlag", m_noAlfConstraintFlag, false, "Indicate that ALF is deactivated")
Zhipin Deng
committed
("NoCCAlfConstraintFlag", m_noCCAlfConstraintFlag, false, "Indicate that CCALF is deactivated")
("NoLmcsConstraintFlag", m_noLmcsConstraintFlag, false, "Indicate that LMCS is deactivated")
("NoLadfConstraintFlag", m_noLadfConstraintFlag, false, "Indicate that LADF is deactivated")
Zhipin Deng
committed
("NoVirtualBoundaryConstraintFlag", m_noVirtualBoundaryConstraintFlag, false, "Indicate that virtual boundary is deactivated")
Adrian Browne
committed
("AllRapPicturesFlag", m_allRapPicturesFlag, false, "Indicate that all pictures in OlsInScope are IRAP pictures or GDR pictures with ph_recovery_poc_cnt equal to 0")
("NoExtendedPrecisionProcessingConstraintFlag", m_noExtendedPrecisionProcessingConstraintFlag, false, "Indicate that ExtendedPrecision is deactivated")
("NoTsResidualCodingRiceConstraintFlag", m_noTsResidualCodingRiceConstraintFlag, false, "Indicate that TSRCRicePresent is deactivated")
("NoRrcRiceExtensionConstraintFlag", m_noRrcRiceExtensionConstraintFlag, false, "Indicate that ExtendedRiceRRC is deactivated")
("NoPersistentRiceAdaptationConstraintFlag", m_noPersistentRiceAdaptationConstraintFlag, false, "Indicate that GolombRiceParameterAdaptation is deactivated")
("NoReverseLastSigCoeffConstraintFlag", m_noReverseLastSigCoeffConstraintFlag, false, "Indicate that ReverseLastSigCoeff is deactivated")
("CTUSize", m_ctuSize, 128u, "CTUSize (specifies the CTU size if QTBT is on) [default: 128]")
("Log2MinCuSize", m_log2MinCuSize, 2u, "Log2 min CU size")
Kui Fan
committed
("SubPicInfoPresentFlag", m_subPicInfoPresentFlag, false, "equal to 1 specifies that subpicture parameters are present in in the SPS RBSP syntax")
("NumSubPics", m_numSubPics, 0u, "specifies the number of subpictures")
("SubPicSameSizeFlag", m_subPicSameSizeFlag, false, "equal to 1 specifies that all subpictures in the CLVS have the same width specified by sps_subpic_width_minus1[ 0 ] and the same height specified by sps_subpic_height_minus1[ 0 ].")
("SubPicCtuTopLeftX", cfg_subPicCtuTopLeftX, cfg_subPicCtuTopLeftX, "specifies horizontal position of top left CTU of i-th subpicture in unit of CtbSizeY")
("SubPicCtuTopLeftY", cfg_subPicCtuTopLeftY, cfg_subPicCtuTopLeftY, "specifies vertical position of top left CTU of i-th subpicture in unit of CtbSizeY")
("SubPicWidth", cfg_subPicWidth, cfg_subPicWidth, "specifies the width of the i-th subpicture in units of CtbSizeY")
("SubPicHeight", cfg_subPicHeight, cfg_subPicHeight, "specifies the height of the i-th subpicture in units of CtbSizeY")
("SubPicTreatedAsPicFlag", cfg_subPicTreatedAsPicFlag, cfg_subPicTreatedAsPicFlag, "equal to 1 specifies that the i-th subpicture of each coded picture in the CLVS is treated as a picture in the decoding process excluding in-loop filtering operations")
("LoopFilterAcrossSubpicEnabledFlag", cfg_loopFilterAcrossSubpicEnabledFlag, cfg_loopFilterAcrossSubpicEnabledFlag, "equal to 1 specifies that in-loop filtering operations may be performed across the boundaries of the i-th subpicture in each coded picture in the CLVS")
Kui Fan
committed
("SubPicIdMappingExplicitlySignalledFlag", m_subPicIdMappingExplicitlySignalledFlag, false, "equal to 1 specifies that the subpicture ID mapping is explicitly signalled, either in the SPS or in the PPSs")
Kui Fan
committed
("SubPicIdMappingInSpsFlag", m_subPicIdMappingInSpsFlag, false, "equal to 1 specifies that subpicture ID mapping is signalled in the SPS")
("SubPicIdLen", m_subPicIdLen, 0u, "specifies the number of bits used to represent the syntax element sps_subpic_id[ i ]. ")
("SubPicId", cfg_subPicId, cfg_subPicId, "specifies that subpicture ID of the i-th subpicture")

Karsten Suehring
committed
("SingleSlicePerSubpic", m_singleSlicePerSubPicFlag, false, "Enables setting of a single slice per sub-picture (no explicit configuration required)")
("EnablePartitionConstraintsOverride", m_SplitConsOverrideEnabledFlag, true, "Enable partition constraints override")
("MinQTISlice", m_minQt[0], 8u, "MinQTISlice")
("MinQTLumaISlice", m_minQt[0], 8u, "MinQTLumaISlice")
("MinQTChromaISliceInChromaSamples", m_minQt[2], 4u, "MinQTChromaISliceInChromaSamples")
("MinQTNonISlice", m_minQt[1], 8u, "MinQTNonISlice")
("MaxMTTHierarchyDepth", m_uiMaxMTTHierarchyDepth, 3u, "MaxMTTHierarchyDepth")
("MaxMTTHierarchyDepthI", m_uiMaxMTTHierarchyDepthI, 3u, "MaxMTTHierarchyDepthI")
("MaxMTTHierarchyDepthISliceL", m_uiMaxMTTHierarchyDepthI, 3u, "MaxMTTHierarchyDepthISliceL")
("MaxMTTHierarchyDepthISliceC", m_uiMaxMTTHierarchyDepthIChroma, 3u, "MaxMTTHierarchyDepthISliceC")
("MaxBTLumaISlice", m_maxBt[0], 32u, "MaxBTLumaISlice")
("MaxBTChromaISlice", m_maxBt[2], 64u, "MaxBTChromaISlice")
("MaxBTNonISlice", m_maxBt[1], 128u, "MaxBTNonISlice")
("MaxTTLumaISlice", m_maxTt[0], 32u, "MaxTTLumaISlice")
("MaxTTChromaISlice", m_maxTt[2], 32u, "MaxTTChromaISlice")
("MaxTTNonISlice", m_maxTt[1], 64u, "MaxTTNonISlice")
Lien-Fei Chen
committed
("TTFastSkip", m_ttFastSkip, 31, "fast skip method for TT split partition")
("TTFastSkipThr", m_ttFastSkipThr, 1.075, "Threshold value of fast skip method for TT split partition")

Karsten Suehring
committed
("DualITree", m_dualTree, false, "Use separate QTBT trees for intra slice luma and chroma channel types")
( "LFNST", m_LFNST, false, "Enable LFNST (0:off, 1:on) [default: off]" )
( "FastLFNST", m_useFastLFNST, false, "Fast methods for LFNST" )
("SbTMVP", m_sbTmvpEnableFlag, false, "Enable Subblock Temporal Motion Vector Prediction (0: off, 1: on) [default: off]")
("MMVD", m_MMVD, true, "Enable Merge mode with Motion Vector Difference (0:off, 1:on) [default: 1]")
("Affine", m_Affine, false, "Enable affine prediction (0:off, 1:on) [default: off]")
("AffineType", m_AffineType, true, "Enable affine type prediction (0:off, 1:on) [default: on]" )
("AdaptBypassAffineMe", m_adaptBypassAffineMe, false, "Adaptively bypass affine ME (0: off, 1:on, defaul: off]")
("PROF", m_PROF, false, "Enable Prediction refinement with optical flow for affine mode (0:off, 1:on) [default: off]")
("BIO", m_BIO, false, "Enable bi-directional optical flow")