HEVC Test Model (HM)  HM-16.18
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TAppEncCfg.cpp
Go to the documentation of this file.
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
4  * granted under this license.
5  *
6  * Copyright (c) 2010-2017, ITU/ISO/IEC
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 
38 #include <stdio.h>
39 #include <stdlib.h>
40 #include <cassert>
41 #include <cstring>
42 #include <string>
43 #include <limits>
44 #include "TLibCommon/TComRom.h"
45 #include "TAppEncCfg.h"
48 #ifdef WIN32
49 #define strdup _strdup
50 #endif
51 
52 #define MACRO_TO_STRING_HELPER(val) #val
53 #define MACRO_TO_STRING(val) MACRO_TO_STRING_HELPER(val)
54 
55 using namespace std;
56 namespace po = df::program_options_lite;
57 
58 enum UIProfileName // this is used for determining profile strings, where multiple profiles map to a single profile idc with various constraint flag combinations
59 {
60  UI_NONE = 0,
61  UI_MAIN = 1,
62  UI_MAIN10 = 2,
67  // The following are RExt profiles, which would map to the MAINREXT profile idc.
68  // The enumeration indicates the bit-depth constraint in the bottom 2 digits
69  // the chroma format in the next digit
70  // the intra constraint in the next digit (1 for no intra constraint, 2 for intra constraint)
71  // If it is a RExt still picture, there is a '1' for the top digit.
75  UI_MAIN_12 = 1112,
78  UI_MAIN_444 = 1308,
81  UI_MAIN_444_16 = 1316, // non-standard profile definition, used for development purposes
82  UI_MAIN_INTRA = 2108,
93  // The following are high throughput profiles, which would map to the HIGHTHROUGHPUTREXT profile idc.
94  // The enumeration indicates the bit-depth constraint in the bottom 2 digits
95  // the chroma format in the next digit
96  // the intra constraint in the next digit
97  // There is a '2' for the top digit to indicate it is high throughput profile
98 
103 };
104 
105 
108 
109 // ====================================================================================================================
110 // Constructor / destructor / initialization / destroy
111 // ====================================================================================================================
112 
114 : m_inputColourSpaceConvert(IPCOLOURSPACE_UNCHANGED)
115 , m_snrInternalColourSpace(false)
116 , m_outputInternalColourSpace(false)
118 , m_ext360(*this)
119 #endif
120 {
121  m_aidQP = NULL;
125 }
126 
128 {
129  if ( m_aidQP )
130  {
131  delete[] m_aidQP;
132  }
134  {
135  delete[] m_startOfCodedInterval;
137  }
138  if ( m_codedPivotValue )
139  {
140  delete[] m_codedPivotValue;
142  }
143  if ( m_targetPivotValue )
144  {
145  delete[] m_targetPivotValue;
147  }
148 }
149 
151 {
152 }
153 
155 {
156 }
157 
158 std::istringstream &operator>>(std::istringstream &in, GOPEntry &entry) //input
159 {
160  in>>entry.m_sliceType;
161  in>>entry.m_POC;
162  in>>entry.m_QPOffset;
163 #if X0038_LAMBDA_FROM_QP_CAPABILITY
164  in>>entry.m_QPOffsetModelOffset;
165  in>>entry.m_QPOffsetModelScale;
166 #endif
167  in>>entry.m_CbQPoffset;
168  in>>entry.m_CrQPoffset;
169  in>>entry.m_QPFactor;
170  in>>entry.m_tcOffsetDiv2;
171  in>>entry.m_betaOffsetDiv2;
172  in>>entry.m_temporalId;
173  in>>entry.m_numRefPicsActive;
174  in>>entry.m_numRefPics;
175  for ( Int i = 0; i < entry.m_numRefPics; i++ )
176  {
177  in>>entry.m_referencePics[i];
178  }
179  in>>entry.m_interRPSPrediction;
180  if (entry.m_interRPSPrediction==1)
181  {
182  in>>entry.m_deltaRPS;
183  in>>entry.m_numRefIdc;
184  for ( Int i = 0; i < entry.m_numRefIdc; i++ )
185  {
186  in>>entry.m_refIdc[i];
187  }
188  }
189  else if (entry.m_interRPSPrediction==2)
190  {
191  in>>entry.m_deltaRPS;
192  }
193  return in;
194 }
195 
196 Bool confirmPara(Bool bflag, const TChar* message);
197 
198 static inline ChromaFormat numberToChromaFormat(const Int val)
199 {
200  switch (val)
201  {
202  case 400: return CHROMA_400; break;
203  case 420: return CHROMA_420; break;
204  case 422: return CHROMA_422; break;
205  case 444: return CHROMA_444; break;
206  default: return NUM_CHROMA_FORMAT;
207  }
208 }
209 
210 static const struct MapStrToProfile
211 {
212  const TChar* str;
214 }
215 strToProfile[] =
216 {
217  {"none", Profile::NONE },
218  {"main", Profile::MAIN },
219  {"main10", Profile::MAIN10 },
220  {"main-still-picture", Profile::MAINSTILLPICTURE },
221  {"main10-still-picture", Profile::MAIN10 },
222  {"main-RExt", Profile::MAINREXT },
223  {"high-throughput-RExt", Profile::HIGHTHROUGHPUTREXT }
224 };
225 
226 static const struct MapStrToUIProfileName
227 {
228  const TChar* str;
230 }
232 {
233  {"none", UI_NONE },
234  {"main", UI_MAIN },
235  {"main10", UI_MAIN10 },
236  {"main10_still_picture", UI_MAIN10_STILL_PICTURE },
237  {"main10-still-picture", UI_MAIN10_STILL_PICTURE },
238  {"main_still_picture", UI_MAINSTILLPICTURE },
239  {"main-still-picture", UI_MAINSTILLPICTURE },
240  {"main_RExt", UI_MAINREXT },
241  {"main-RExt", UI_MAINREXT },
242  {"main_rext", UI_MAINREXT },
243  {"main-rext", UI_MAINREXT },
244  {"high_throughput_RExt", UI_HIGHTHROUGHPUTREXT },
245  {"high-throughput-RExt", UI_HIGHTHROUGHPUTREXT },
246  {"high_throughput_rext", UI_HIGHTHROUGHPUTREXT },
247  {"high-throughput-rext", UI_HIGHTHROUGHPUTREXT },
248  {"monochrome", UI_MONOCHROME_8 },
249  {"monochrome12", UI_MONOCHROME_12 },
250  {"monochrome16", UI_MONOCHROME_16 },
251  {"main12", UI_MAIN_12 },
252  {"main_422_10", UI_MAIN_422_10 },
253  {"main_422_12", UI_MAIN_422_12 },
254  {"main_444", UI_MAIN_444 },
255  {"main_444_10", UI_MAIN_444_10 },
256  {"main_444_12", UI_MAIN_444_12 },
257  {"main_444_16", UI_MAIN_444_16 },
258  {"main_intra", UI_MAIN_INTRA },
259  {"main_10_intra", UI_MAIN_10_INTRA },
260  {"main_12_intra", UI_MAIN_12_INTRA },
261  {"main_422_10_intra", UI_MAIN_422_10_INTRA},
262  {"main_422_12_intra", UI_MAIN_422_12_INTRA},
263  {"main_444_intra", UI_MAIN_444_INTRA },
264  {"main_444_still_picture", UI_MAIN_444_STILL_PICTURE },
265  {"main_444_10_intra", UI_MAIN_444_10_INTRA},
266  {"main_444_12_intra", UI_MAIN_444_12_INTRA},
267  {"main_444_16_intra", UI_MAIN_444_16_INTRA},
268  {"main_444_16_still_picture", UI_MAIN_444_16_STILL_PICTURE },
269  {"high_throughput_444", UI_HIGHTHROUGHPUT_444 },
270  {"high_throughput_444_10", UI_HIGHTHROUGHPUT_444_10 },
271  {"high_throughput_444_14", UI_HIGHTHROUGHPUT_444_14 },
272  {"high_throughput_444_16_intra", UI_HIGHTHROUGHPUT_444_16_INTRA }
273 };
274 
275 static const UIProfileName validRExtHighThroughPutProfileNames[2/* intraConstraintFlag*/][4/* bit depth constraint 8=0, 10=1, 12=2, 16=3*/]=
276 {
277  { UI_HIGHTHROUGHPUT_444, UI_HIGHTHROUGHPUT_444_10, UI_HIGHTHROUGHPUT_444_14, UI_NONE }, // intraConstraintFlag 0 - 8-bit,10-bit,14-bit and 16-bit
278  { UI_NONE, UI_NONE, UI_NONE, UI_HIGHTHROUGHPUT_444_16_INTRA } // intraConstraintFlag 1 - 8-bit,10-bit,14-bit and 16-bit
279 };
280 
281 static const UIProfileName validRExtProfileNames[2/* intraConstraintFlag*/][4/* bit depth constraint 8=0, 10=1, 12=2, 16=3*/][4/*chroma format*/]=
282 {
283  {
284  { UI_MONOCHROME_8, UI_NONE, UI_NONE, UI_MAIN_444 }, // 8-bit inter for 400, 420, 422 and 444
285  { UI_NONE, UI_NONE, UI_MAIN_422_10, UI_MAIN_444_10 }, // 10-bit inter for 400, 420, 422 and 444
286  { UI_MONOCHROME_12, UI_MAIN_12, UI_MAIN_422_12, UI_MAIN_444_12 }, // 12-bit inter for 400, 420, 422 and 444
287  { UI_MONOCHROME_16, UI_NONE, UI_NONE, UI_MAIN_444_16 } // 16-bit inter for 400, 420, 422 and 444 (the latter is non standard used for development)
288  },
289  {
290  { UI_NONE, UI_MAIN_INTRA, UI_NONE, UI_MAIN_444_INTRA }, // 8-bit intra for 400, 420, 422 and 444
291  { UI_NONE, UI_MAIN_10_INTRA, UI_MAIN_422_10_INTRA, UI_MAIN_444_10_INTRA }, // 10-bit intra for 400, 420, 422 and 444
292  { UI_NONE, UI_MAIN_12_INTRA, UI_MAIN_422_12_INTRA, UI_MAIN_444_12_INTRA }, // 12-bit intra for 400, 420, 422 and 444
293  { UI_NONE, UI_NONE, UI_NONE, UI_MAIN_444_16_INTRA } // 16-bit intra for 400, 420, 422 and 444
294  }
295 };
296 
297 static const struct MapStrToTier
298 {
299  const TChar* str;
301 }
302 strToTier[] =
303 {
304  {"main", Level::MAIN},
305  {"high", Level::HIGH},
306 };
307 
308 static const struct MapStrToLevel
309 {
310  const TChar* str;
312 }
313 strToLevel[] =
314 {
315  {"none",Level::NONE},
316  {"1", Level::LEVEL1},
317  {"2", Level::LEVEL2},
318  {"2.1", Level::LEVEL2_1},
319  {"3", Level::LEVEL3},
320  {"3.1", Level::LEVEL3_1},
321  {"4", Level::LEVEL4},
322  {"4.1", Level::LEVEL4_1},
323  {"5", Level::LEVEL5},
324  {"5.1", Level::LEVEL5_1},
325  {"5.2", Level::LEVEL5_2},
326  {"6", Level::LEVEL6},
327  {"6.1", Level::LEVEL6_1},
328  {"6.2", Level::LEVEL6_2},
329  {"8.5", Level::LEVEL8_5},
330 };
331 
333 {
334  // LEVEL1, LEVEL2,LEVEL2_1, LEVEL3, LEVEL3_1, LEVEL4, LEVEL4_1, LEVEL5, LEVEL5_1, LEVEL5_2, LEVEL6, LEVEL6_1, LEVEL6_2
335  { 0, 0, 0, 350000, 0, 0, 1500000, 3000000, 0, 6000000, 10000000, 0, 12000000, 20000000, 0, 25000000, 40000000, 60000000, 60000000, 120000000, 240000000 },
336  { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30000000, 50000000, 0, 100000000, 160000000, 240000000, 240000000, 480000000, 800000000 }
337 };
338 
339 static const struct MapStrToCostMode
340 {
341  const TChar* str;
343 }
344 strToCostMode[] =
345 {
346  {"lossy", COST_STANDARD_LOSSY},
347  {"sequence_level_lossless", COST_SEQUENCE_LEVEL_LOSSLESS},
348  {"lossless", COST_LOSSLESS_CODING},
349  {"mixed_lossless_lossy", COST_MIXED_LOSSLESS_LOSSY_CODING}
350 };
351 
352 static const struct MapStrToScalingListMode
353 {
354  const TChar* str;
356 }
358 {
359  {"0", SCALING_LIST_OFF},
360  {"1", SCALING_LIST_DEFAULT},
361  {"2", SCALING_LIST_FILE_READ},
362  {"off", SCALING_LIST_OFF},
363  {"default", SCALING_LIST_DEFAULT},
364  {"file", SCALING_LIST_FILE_READ}
365 };
366 
367 template<typename T, typename P>
368 static std::string enumToString(P map[], UInt mapLen, const T val)
369 {
370  for (UInt i = 0; i < mapLen; i++)
371  {
372  if (val == map[i].value)
373  {
374  return map[i].str;
375  }
376  }
377  return std::string();
378 }
379 
380 template<typename T, typename P>
381 static istream& readStrToEnum(P map[], UInt mapLen, istream &in, T &val)
382 {
383  string str;
384  in >> str;
385 
386  UInt i=0;
387  for (; i < mapLen && str!=map[i].str; i++);
388 
389  if (i < mapLen)
390  {
391  val = map[i].value;
392  }
393  else
394  {
395  in.setstate(ios::failbit);
396  }
397  return in;
398 }
399 
400 //inline to prevent compiler warnings for "unused static function"
401 
402 static inline istream& operator >> (istream &in, UIProfileName &profile)
403 {
404  return readStrToEnum(strToUIProfileName, sizeof(strToUIProfileName)/sizeof(*strToUIProfileName), in, profile);
405 }
406 
407 namespace Level
408 {
409  static inline istream& operator >> (istream &in, Tier &tier)
410  {
411  return readStrToEnum(strToTier, sizeof(strToTier)/sizeof(*strToTier), in, tier);
412  }
413 
414  static inline istream& operator >> (istream &in, Name &level)
415  {
416  return readStrToEnum(strToLevel, sizeof(strToLevel)/sizeof(*strToLevel), in, level);
417  }
418 }
419 
420 static inline istream& operator >> (istream &in, CostMode &mode)
421 {
422  return readStrToEnum(strToCostMode, sizeof(strToCostMode)/sizeof(*strToCostMode), in, mode);
423 }
424 
425 static inline istream& operator >> (istream &in, ScalingListMode &mode)
426 {
428 }
429 
430 template <class T>
432 {
433  const T minValIncl;
434  const T maxValIncl;
435  const std::size_t minNumValuesIncl;
436  const std::size_t maxNumValuesIncl; // Use 0 for unlimited
437  std::vector<T> values;
439  SMultiValueInput(std::vector<T> &defaults) : minValIncl(0), maxValIncl(0), minNumValuesIncl(0), maxNumValuesIncl(0), values(defaults) { }
440  SMultiValueInput(const T &minValue, const T &maxValue, std::size_t minNumberValues=0, std::size_t maxNumberValues=0)
441  : minValIncl(minValue), maxValIncl(maxValue), minNumValuesIncl(minNumberValues), maxNumValuesIncl(maxNumberValues), values() { }
442  SMultiValueInput(const T &minValue, const T &maxValue, std::size_t minNumberValues, std::size_t maxNumberValues, const T* defValues, const UInt numDefValues)
443  : minValIncl(minValue), maxValIncl(maxValue), minNumValuesIncl(minNumberValues), maxNumValuesIncl(maxNumberValues), values(defValues, defValues+numDefValues) { }
444  SMultiValueInput<T> &operator=(const std::vector<T> &userValues) { values=userValues; return *this; }
445  SMultiValueInput<T> &operator=(const SMultiValueInput<T> &userValues) { values=userValues.values; return *this; }
446 
447  T readValue(const TChar *&pStr, Bool &bSuccess);
448 
449  istream& readValues(std::istream &in);
450 };
451 
452 template <class T>
453 static inline istream& operator >> (std::istream &in, SMultiValueInput<T> &values)
454 {
455  return values.readValues(in);
456 }
457 
458 template<>
460 {
461  TChar *eptr;
462  UInt val=strtoul(pStr, &eptr, 0);
463  pStr=eptr;
464  bSuccess=!(*eptr!=0 && !isspace(*eptr) && *eptr!=',') && !(val<minValIncl || val>maxValIncl);
465  return val;
466 }
467 
468 template<>
470 {
471  TChar *eptr;
472  Int val=strtol(pStr, &eptr, 0);
473  pStr=eptr;
474  bSuccess=!(*eptr!=0 && !isspace(*eptr) && *eptr!=',') && !(val<minValIncl || val>maxValIncl);
475  return val;
476 }
477 
478 template<>
480 {
481  TChar *eptr;
482  Double val=strtod(pStr, &eptr);
483  pStr=eptr;
484  bSuccess=!(*eptr!=0 && !isspace(*eptr) && *eptr!=',') && !(val<minValIncl || val>maxValIncl);
485  return val;
486 }
487 
488 template<>
490 {
491  TChar *eptr;
492  Int val=strtol(pStr, &eptr, 0);
493  pStr=eptr;
494  bSuccess=!(*eptr!=0 && !isspace(*eptr) && *eptr!=',') && !(val<Int(minValIncl) || val>Int(maxValIncl));
495  return val!=0;
496 }
497 
498 template <class T>
499 istream& SMultiValueInput<T>::readValues(std::istream &in)
500 {
501  values.clear();
502  string str;
503  while (!in.eof())
504  {
505  string tmp; in >> tmp; str+=" " + tmp;
506  }
507  if (!str.empty())
508  {
509  const TChar *pStr=str.c_str();
510  // soak up any whitespace
511  for(;isspace(*pStr);pStr++);
512 
513  while (*pStr != 0)
514  {
515  Bool bSuccess=true;
516  T val=readValue(pStr, bSuccess);
517  if (!bSuccess)
518  {
519  in.setstate(ios::failbit);
520  break;
521  }
522 
523  if (maxNumValuesIncl != 0 && values.size() >= maxNumValuesIncl)
524  {
525  in.setstate(ios::failbit);
526  break;
527  }
528  values.push_back(val);
529  // soak up any whitespace and up to 1 comma.
530  for(;isspace(*pStr);pStr++);
531  if (*pStr == ',')
532  {
533  pStr++;
534  }
535  for(;isspace(*pStr);pStr++);
536  }
537  }
538  if (values.size() < minNumValuesIncl)
539  {
540  in.setstate(ios::failbit);
541  }
542  return in;
543 }
544 
545 #if JVET_E0059_FLOATING_POINT_QP_FIX
546 template <class T>
547 static inline istream& operator >> (std::istream &in, TAppEncCfg::OptionalValue<T> &value)
548 {
549  in >> std::ws;
550  if (in.eof())
551  {
552  value.bPresent=false;
553  }
554  else
555  {
556  in >> value.value;
557  value.bPresent=true;
558  }
559  return in;
560 }
561 #endif
562 
563 static Void
564 automaticallySelectRExtProfile(const Bool bUsingGeneralRExtTools,
565  const Bool bUsingChromaQPAdjustment,
566  const Bool bUsingExtendedPrecision,
567  const Bool bIntraConstraintFlag,
568  UInt &bitDepthConstraint,
569  ChromaFormat &chromaFormatConstraint,
570  const Int maxBitDepth,
571  const ChromaFormat chromaFormat)
572 {
573  // Try to choose profile, according to table in Q1013.
574  UInt trialBitDepthConstraint=maxBitDepth;
575  if (trialBitDepthConstraint<8)
576  {
577  trialBitDepthConstraint=8;
578  }
579  else if (trialBitDepthConstraint==9 || trialBitDepthConstraint==11)
580  {
581  trialBitDepthConstraint++;
582  }
583  else if (trialBitDepthConstraint>12)
584  {
585  trialBitDepthConstraint=16;
586  }
587 
588  // both format and bit depth constraints are unspecified
589  if (bUsingExtendedPrecision || trialBitDepthConstraint==16)
590  {
591  bitDepthConstraint = 16;
592  chromaFormatConstraint = (!bIntraConstraintFlag && chromaFormat==CHROMA_400) ? CHROMA_400 : CHROMA_444;
593  }
594  else if (bUsingGeneralRExtTools)
595  {
596  if (chromaFormat == CHROMA_400 && !bIntraConstraintFlag)
597  {
598  bitDepthConstraint = 16;
599  chromaFormatConstraint = CHROMA_400;
600  }
601  else
602  {
603  bitDepthConstraint = trialBitDepthConstraint;
604  chromaFormatConstraint = CHROMA_444;
605  }
606  }
607  else if (chromaFormat == CHROMA_400)
608  {
609  if (bIntraConstraintFlag)
610  {
611  chromaFormatConstraint = CHROMA_420; // there is no intra 4:0:0 profile.
612  bitDepthConstraint = trialBitDepthConstraint;
613  }
614  else
615  {
616  chromaFormatConstraint = CHROMA_400;
617  bitDepthConstraint = trialBitDepthConstraint == 8 ? 8 : 12;
618  }
619  }
620  else
621  {
622  bitDepthConstraint = trialBitDepthConstraint;
623  chromaFormatConstraint = chromaFormat;
624  if (bUsingChromaQPAdjustment && chromaFormat == CHROMA_420)
625  {
626  chromaFormatConstraint = CHROMA_422; // 4:2:0 cannot use the chroma qp tool.
627  }
628  if (chromaFormatConstraint == CHROMA_422 && bitDepthConstraint == 8)
629  {
630  bitDepthConstraint = 10; // there is no 8-bit 4:2:2 profile.
631  }
632  if (chromaFormatConstraint == CHROMA_420 && !bIntraConstraintFlag)
633  {
634  bitDepthConstraint = 12; // there is no 8 or 10-bit 4:2:0 inter RExt profile.
635  }
636  }
637 }
638 // ====================================================================================================================
639 // Public member functions
640 // ====================================================================================================================
641 
647 {
648  Bool do_help = false;
649 
650  Int tmpChromaFormat;
651  Int tmpInputChromaFormat;
652  Int tmpConstraintChromaFormat;
653  Int tmpWeightedPredictionMethod;
654  Int tmpFastInterSearchMode;
655  Int tmpMotionEstimationSearchMethod;
656  Int tmpSliceMode;
657  Int tmpSliceSegmentMode;
658  Int tmpDecodedPictureHashSEIMappedType;
659  string inputColourSpaceConvert;
660  UIProfileName UIProfile;
661  Int saoOffsetBitShift[MAX_NUM_CHANNEL_TYPE];
662 
663  // Multi-value input fields: // minval, maxval (incl), min_entries, max_entries (incl) [, default values, number of default values]
664  SMultiValueInput<UInt> cfg_ColumnWidth (0, std::numeric_limits<UInt>::max(), 0, std::numeric_limits<UInt>::max());
665  SMultiValueInput<UInt> cfg_RowHeight (0, std::numeric_limits<UInt>::max(), 0, std::numeric_limits<UInt>::max());
666  SMultiValueInput<Int> cfg_startOfCodedInterval (std::numeric_limits<Int>::min(), std::numeric_limits<Int>::max(), 0, 1<<16);
667  SMultiValueInput<Int> cfg_codedPivotValue (std::numeric_limits<Int>::min(), std::numeric_limits<Int>::max(), 0, 1<<16);
668  SMultiValueInput<Int> cfg_targetPivotValue (std::numeric_limits<Int>::min(), std::numeric_limits<Int>::max(), 0, 1<<16);
669 
670  SMultiValueInput<Double> cfg_adIntraLambdaModifier (0, std::numeric_limits<Double>::max(), 0, MAX_TLAYER);
671 
672  const Int defaultLumaLevelTodQp_QpChangePoints[] = {-3, -2, -1, 0, 1, 2, 3, 4, 5, 6};
673  const Int defaultLumaLevelTodQp_LumaChangePoints[] = { 0, 301, 367, 434, 501, 567, 634, 701, 767, 834};
674  SMultiValueInput<Int> cfg_lumaLeveltoDQPMappingQP (-MAX_QP, MAX_QP, 0, LUMA_LEVEL_TO_DQP_LUT_MAXSIZE, defaultLumaLevelTodQp_QpChangePoints, sizeof(defaultLumaLevelTodQp_QpChangePoints )/sizeof(Int));
675  SMultiValueInput<Int> cfg_lumaLeveltoDQPMappingLuma (0, std::numeric_limits<Int>::max(), 0, LUMA_LEVEL_TO_DQP_LUT_MAXSIZE, defaultLumaLevelTodQp_LumaChangePoints, sizeof(defaultLumaLevelTodQp_LumaChangePoints)/sizeof(Int));
676  UInt lumaLevelToDeltaQPMode;
677 
678  const UInt defaultInputKneeCodes[3] = { 600, 800, 900 };
679  const UInt defaultOutputKneeCodes[3] = { 100, 250, 450 };
680  Int cfg_kneeSEINumKneePointsMinus1=0;
681  SMultiValueInput<UInt> cfg_kneeSEIInputKneePointValue (1, 999, 0, 999, defaultInputKneeCodes, sizeof(defaultInputKneeCodes )/sizeof(UInt));
682  SMultiValueInput<UInt> cfg_kneeSEIOutputKneePointValue (0, 1000, 0, 999, defaultOutputKneeCodes, sizeof(defaultOutputKneeCodes)/sizeof(UInt));
683  const Int defaultPrimaryCodes[6] = { 0,50000, 0,0, 50000,0 };
684  const Int defaultWhitePointCode[2] = { 16667, 16667 };
685  SMultiValueInput<Int> cfg_DisplayPrimariesCode (0, 50000, 6, 6, defaultPrimaryCodes, sizeof(defaultPrimaryCodes )/sizeof(Int));
686  SMultiValueInput<Int> cfg_DisplayWhitePointCode (0, 50000, 2, 2, defaultWhitePointCode, sizeof(defaultWhitePointCode)/sizeof(Int));
687 
688  SMultiValueInput<Bool> cfg_timeCodeSeiTimeStampFlag (0, 1, 0, MAX_TIMECODE_SEI_SETS);
689  SMultiValueInput<Bool> cfg_timeCodeSeiNumUnitFieldBasedFlag(0, 1, 0, MAX_TIMECODE_SEI_SETS);
690  SMultiValueInput<Int> cfg_timeCodeSeiCountingType (0, 6, 0, MAX_TIMECODE_SEI_SETS);
691  SMultiValueInput<Bool> cfg_timeCodeSeiFullTimeStampFlag (0, 1, 0, MAX_TIMECODE_SEI_SETS);
692  SMultiValueInput<Bool> cfg_timeCodeSeiDiscontinuityFlag (0, 1, 0, MAX_TIMECODE_SEI_SETS);
693  SMultiValueInput<Bool> cfg_timeCodeSeiCntDroppedFlag (0, 1, 0, MAX_TIMECODE_SEI_SETS);
694  SMultiValueInput<Int> cfg_timeCodeSeiNumberOfFrames (0,511, 0, MAX_TIMECODE_SEI_SETS);
695  SMultiValueInput<Int> cfg_timeCodeSeiSecondsValue (0, 59, 0, MAX_TIMECODE_SEI_SETS);
696  SMultiValueInput<Int> cfg_timeCodeSeiMinutesValue (0, 59, 0, MAX_TIMECODE_SEI_SETS);
697  SMultiValueInput<Int> cfg_timeCodeSeiHoursValue (0, 23, 0, MAX_TIMECODE_SEI_SETS);
698  SMultiValueInput<Bool> cfg_timeCodeSeiSecondsFlag (0, 1, 0, MAX_TIMECODE_SEI_SETS);
699  SMultiValueInput<Bool> cfg_timeCodeSeiMinutesFlag (0, 1, 0, MAX_TIMECODE_SEI_SETS);
700  SMultiValueInput<Bool> cfg_timeCodeSeiHoursFlag (0, 1, 0, MAX_TIMECODE_SEI_SETS);
701  SMultiValueInput<Int> cfg_timeCodeSeiTimeOffsetLength (0, 31, 0, MAX_TIMECODE_SEI_SETS);
702  SMultiValueInput<Int> cfg_timeCodeSeiTimeOffsetValue (std::numeric_limits<Int>::min(), std::numeric_limits<Int>::max(), 0, MAX_TIMECODE_SEI_SETS);
703 #if ERP_SR_OV_SEI_MESSAGE
704  SMultiValueInput<Int> cfg_omniViewportSEIAzimuthCentre (-11796480, 11796479, 0, 15);
705  SMultiValueInput<Int> cfg_omniViewportSEIElevationCentre ( -5898240, 5898240, 0, 15);
706  SMultiValueInput<Int> cfg_omniViewportSEITiltCentre (-11796480, 11796479, 0, 15);
707  SMultiValueInput<UInt> cfg_omniViewportSEIHorRange ( 1, 23592960, 0, 15);
708  SMultiValueInput<UInt> cfg_omniViewportSEIVerRange ( 1, 11796480, 0, 15);
709 #endif
710 #if RWP_SEI_MESSAGE
711  SMultiValueInput<UInt> cfg_rwpSEIRwpTransformType (0, 7, 0, std::numeric_limits<UChar>::max());
712  SMultiValueInput<Bool> cfg_rwpSEIRwpGuardBandFlag (0, 1, 0, std::numeric_limits<UChar>::max());
713  SMultiValueInput<UInt> cfg_rwpSEIProjRegionWidth (0, std::numeric_limits<UInt>::max(), 0, std::numeric_limits<UChar>::max());
714  SMultiValueInput<UInt> cfg_rwpSEIProjRegionHeight (0, std::numeric_limits<UInt>::max(), 0, std::numeric_limits<UChar>::max());
715  SMultiValueInput<UInt> cfg_rwpSEIRwpSEIProjRegionTop (0, std::numeric_limits<UInt>::max(), 0, std::numeric_limits<UChar>::max());
716  SMultiValueInput<UInt> cfg_rwpSEIProjRegionLeft (0, std::numeric_limits<UInt>::max(), 0, std::numeric_limits<UChar>::max());
717  SMultiValueInput<UInt> cfg_rwpSEIPackedRegionWidth (0, std::numeric_limits<UShort>::max(), 0, std::numeric_limits<UChar>::max());
718  SMultiValueInput<UInt> cfg_rwpSEIPackedRegionHeight (0, std::numeric_limits<UShort>::max(), 0, std::numeric_limits<UChar>::max());
719  SMultiValueInput<UInt> cfg_rwpSEIPackedRegionTop (0, std::numeric_limits<UShort>::max(), 0, std::numeric_limits<UChar>::max());
720  SMultiValueInput<UInt> cfg_rwpSEIPackedRegionLeft (0, std::numeric_limits<UShort>::max(), 0, std::numeric_limits<UChar>::max());
721  SMultiValueInput<UInt> cfg_rwpSEIRwpLeftGuardBandWidth (0, std::numeric_limits<UChar>::max(), 0, std::numeric_limits<UChar>::max());
722  SMultiValueInput<UInt> cfg_rwpSEIRwpRightGuardBandWidth (0, std::numeric_limits<UChar>::max(), 0, std::numeric_limits<UChar>::max());
723  SMultiValueInput<UInt> cfg_rwpSEIRwpTopGuardBandHeight (0, std::numeric_limits<UChar>::max(), 0, std::numeric_limits<UChar>::max());
724  SMultiValueInput<UInt> cfg_rwpSEIRwpBottomGuardBandHeight (0, std::numeric_limits<UChar>::max(), 0, std::numeric_limits<UChar>::max());
725  SMultiValueInput<Bool> cfg_rwpSEIRwpGuardBandNotUsedForPredFlag (0, 1, 0, std::numeric_limits<UChar>::max());
726  SMultiValueInput<UInt> cfg_rwpSEIRwpGuardBandType (0, 7, 0, 4*std::numeric_limits<UChar>::max());
727 #endif
728  Int warnUnknowParameter = 0;
729  po::Options opts;
730  opts.addOptions()
731  ("help", do_help, false, "this help text")
732  ("c", po::parseConfigFile, "configuration file name")
733  ("WarnUnknowParameter,w", warnUnknowParameter, 0, "warn for unknown configuration parameters instead of failing")
734 
735  // File, I/O and source parameters
736  ("InputFile,i", m_inputFileName, string(""), "Original YUV input file name")
737  ("BitstreamFile,b", m_bitstreamFileName, string(""), "Bitstream output file name")
738  ("ReconFile,o", m_reconFileName, string(""), "Reconstructed YUV output file name")
739  ("SourceWidth,-wdt", m_iSourceWidth, 0, "Source picture width")
740  ("SourceHeight,-hgt", m_iSourceHeight, 0, "Source picture height")
741  ("InputBitDepth", m_inputBitDepth[CHANNEL_TYPE_LUMA], 8, "Bit-depth of input file")
742  ("OutputBitDepth", m_outputBitDepth[CHANNEL_TYPE_LUMA], 0, "Bit-depth of output file (default:InternalBitDepth)")
743  ("MSBExtendedBitDepth", m_MSBExtendedBitDepth[CHANNEL_TYPE_LUMA], 0, "bit depth of luma component after addition of MSBs of value 0 (used for synthesising High Dynamic Range source material). (default:InputBitDepth)")
744  ("InternalBitDepth", m_internalBitDepth[CHANNEL_TYPE_LUMA], 0, "Bit-depth the codec operates at. (default:MSBExtendedBitDepth). If different to MSBExtendedBitDepth, source data will be converted")
745  ("InputBitDepthC", m_inputBitDepth[CHANNEL_TYPE_CHROMA], 0, "As per InputBitDepth but for chroma component. (default:InputBitDepth)")
746  ("OutputBitDepthC", m_outputBitDepth[CHANNEL_TYPE_CHROMA], 0, "As per OutputBitDepth but for chroma component. (default:InternalBitDepthC)")
747  ("MSBExtendedBitDepthC", m_MSBExtendedBitDepth[CHANNEL_TYPE_CHROMA], 0, "As per MSBExtendedBitDepth but for chroma component. (default:MSBExtendedBitDepth)")
748  ("InternalBitDepthC", m_internalBitDepth[CHANNEL_TYPE_CHROMA], 0, "As per InternalBitDepth but for chroma component. (default:InternalBitDepth)")
749  ("ExtendedPrecision", m_extendedPrecisionProcessingFlag, false, "Increased internal accuracies to support high bit depths (not valid in V1 profiles)")
750  ("HighPrecisionPredictionWeighting", m_highPrecisionOffsetsEnabledFlag, false, "Use high precision option for weighted prediction (not valid in V1 profiles)")
751  ("InputColourSpaceConvert", inputColourSpaceConvert, string(""), "Colour space conversion to apply to input video. Permitted values are (empty string=UNCHANGED) " + getListOfColourSpaceConverts(true))
752  ("SNRInternalColourSpace", m_snrInternalColourSpace, false, "If true, then no colour space conversion is applied prior to SNR, otherwise inverse of input is applied.")
753  ("OutputInternalColourSpace", m_outputInternalColourSpace, false, "If true, then no colour space conversion is applied for reconstructed video, otherwise inverse of input is applied.")
754  ("InputChromaFormat", tmpInputChromaFormat, 420, "InputChromaFormatIDC")
755  ("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")
756  ("PrintFrameMSE", m_printFrameMSE, false, "0 (default) emit only bit count and PSNRs for each frame, 1 = also emit MSE values")
757  ("PrintSequenceMSE", m_printSequenceMSE, false, "0 (default) emit only bit rate and PSNRs for the whole sequence, 1 = also emit MSE values")
759  ("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")
760 #endif
761  ("CabacZeroWordPaddingEnabled", m_cabacZeroWordPaddingEnabled, true, "0 do not add conforming cabac-zero-words to bit streams, 1 (default) = add cabac-zero-words as required")
762  ("ChromaFormatIDC,-cf", tmpChromaFormat, 0, "ChromaFormatIDC (400|420|422|444 or set 0 (default) for same as InputChromaFormat)")
763  ("ConformanceMode", m_conformanceWindowMode, 0, "Deprecated alias of ConformanceWindowMode")
764  ("ConformanceWindowMode", m_conformanceWindowMode, 0, "Window conformance mode (0: no window, 1:automatic padding, 2:padding, 3:conformance")
765  ("HorizontalPadding,-pdx", m_aiPad[0], 0, "Horizontal source padding for conformance window mode 2")
766  ("VerticalPadding,-pdy", m_aiPad[1], 0, "Vertical source padding for conformance window mode 2")
767  ("ConfLeft", m_confWinLeft, 0, "Deprecated alias of ConfWinLeft")
768  ("ConfRight", m_confWinRight, 0, "Deprecated alias of ConfWinRight")
769  ("ConfTop", m_confWinTop, 0, "Deprecated alias of ConfWinTop")
770  ("ConfBottom", m_confWinBottom, 0, "Deprecated alias of ConfWinBottom")
771  ("ConfWinLeft", m_confWinLeft, 0, "Left offset for window conformance mode 3")
772  ("ConfWinRight", m_confWinRight, 0, "Right offset for window conformance mode 3")
773  ("ConfWinTop", m_confWinTop, 0, "Top offset for window conformance mode 3")
774  ("ConfWinBottom", m_confWinBottom, 0, "Bottom offset for window conformance mode 3")
775  ("AccessUnitDelimiter", m_AccessUnitDelimiter, false, "Enable Access Unit Delimiter NALUs")
776  ("FrameRate,-fr", m_iFrameRate, 0, "Frame rate")
777  ("FrameSkip,-fs", m_FrameSkip, 0u, "Number of frames to skip at start of input YUV")
778  ("TemporalSubsampleRatio,-ts", m_temporalSubsampleRatio, 1u, "Temporal sub-sample ratio when reading input YUV")
779  ("FramesToBeEncoded,f", m_framesToBeEncoded, 0, "Number of frames to be encoded (default=all)")
780  ("ClipInputVideoToRec709Range", m_bClipInputVideoToRec709Range, false, "If true then clip input video to the Rec. 709 Range on loading when InternalBitDepth is less than MSBExtendedBitDepth")
781  ("ClipOutputVideoToRec709Range", m_bClipOutputVideoToRec709Range, false, "If true then clip output video to the Rec. 709 Range on saving when OutputBitDepth is less than InternalBitDepth")
782  ("SummaryOutFilename", m_summaryOutFilename, string(), "Filename to use for producing summary output file. If empty, do not produce a file.")
783  ("SummaryPicFilenameBase", m_summaryPicFilenameBase, 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.")
784  ("SummaryVerboseness", m_summaryVerboseness, 0u, "Specifies the level of the verboseness of the text output")
785 
786  //Field coding parameters
787  ("FieldCoding", m_isField, false, "Signals if it's a field based coding")
788  ("TopFieldFirst, Tff", m_isTopFieldFirst, false, "In case of field based coding, signals whether if it's a top field first or not")
789  ("EfficientFieldIRAPEnabled", m_bEfficientFieldIRAPEnabled, true, "Enable to code fields in a specific, potentially more efficient, order.")
790  ("HarmonizeGopFirstFieldCoupleEnabled", m_bHarmonizeGopFirstFieldCoupleEnabled, true, "Enables harmonization of Gop first field couple")
791 
792  // Profile and level
793  ("Profile", UIProfile, UI_NONE, "Profile name to use for encoding. Use main (for main), main10 (for main10), main-still-picture, main-RExt (for Range Extensions profile), any of the RExt specific profile names, or none")
794  ("Level", m_level, Level::NONE, "Level limit to be used, eg 5.1, or none")
795  ("Tier", m_levelTier, Level::MAIN, "Tier to use for interpretation of --Level (main or high only)")
796  ("MaxBitDepthConstraint", m_bitDepthConstraint, 0u, "Bit depth to use for profile-constraint for RExt profiles. 0=automatically choose based upon other parameters")
797  ("MaxChromaFormatConstraint", tmpConstraintChromaFormat, 0, "Chroma-format to use for the profile-constraint for RExt profiles. 0=automatically choose based upon other parameters")
798  ("IntraConstraintFlag", m_intraConstraintFlag, false, "Value of general_intra_constraint_flag to use for RExt profiles (not used if an explicit RExt sub-profile is specified)")
799  ("OnePictureOnlyConstraintFlag", m_onePictureOnlyConstraintFlag, false, "Value of general_one_picture_only_constraint_flag to use for RExt profiles (not used if an explicit RExt sub-profile is specified)")
800  ("LowerBitRateConstraintFlag", m_lowerBitRateConstraintFlag, true, "Value of general_lower_bit_rate_constraint_flag to use for RExt profiles")
801 
802  ("ProgressiveSource", m_progressiveSourceFlag, false, "Indicate that source is progressive")
803  ("InterlacedSource", m_interlacedSourceFlag, false, "Indicate that source is interlaced")
804  ("NonPackedSource", m_nonPackedConstraintFlag, false, "Indicate that source does not contain frame packing")
805  ("FrameOnly", m_frameOnlyConstraintFlag, false, "Indicate that the bitstream contains only frames")
806 
807  // Unit definition parameters
808  ("MaxCUWidth", m_uiMaxCUWidth, 64u)
809  ("MaxCUHeight", m_uiMaxCUHeight, 64u)
810  // todo: remove defaults from MaxCUSize
811  ("MaxCUSize,s", m_uiMaxCUWidth, 64u, "Maximum CU size")
812  ("MaxCUSize,s", m_uiMaxCUHeight, 64u, "Maximum CU size")
813  ("MaxPartitionDepth,h", m_uiMaxCUDepth, 4u, "CU depth")
814 
815  ("QuadtreeTULog2MaxSize", m_uiQuadtreeTULog2MaxSize, 6u, "Maximum TU size in logarithm base 2")
816  ("QuadtreeTULog2MinSize", m_uiQuadtreeTULog2MinSize, 2u, "Minimum TU size in logarithm base 2")
817 
818  ("QuadtreeTUMaxDepthIntra", m_uiQuadtreeTUMaxDepthIntra, 1u, "Depth of TU tree for intra CUs")
819  ("QuadtreeTUMaxDepthInter", m_uiQuadtreeTUMaxDepthInter, 2u, "Depth of TU tree for inter CUs")
820 
821  // Coding structure paramters
822  ("IntraPeriod,-ip", m_iIntraPeriod, -1, "Intra period in frames, (-1: only first frame)")
823  ("DecodingRefreshType,-dr", m_iDecodingRefreshType, 0, "Intra refresh type (0:none 1:CRA 2:IDR 3:RecPointSEI)")
824  ("GOPSize,g", m_iGOPSize, 1, "GOP size of temporal structure")
825 #if JCTVC_Y0038_PARAMS
826  ("ReWriteParamSetsFlag", m_bReWriteParamSetsFlag, true, "Enable rewriting of Parameter sets before every (intra) random access point")
827 #endif
828 
829  // motion search options
830  ("DisableIntraInInter", m_bDisableIntraPUsInInterSlices, false, "Flag to disable intra PUs in inter slices")
831  ("FastSearch", tmpMotionEstimationSearchMethod, Int(MESEARCH_DIAMOND), "0:Full search 1:Diamond 2:Selective 3:Enhanced Diamond")
832  ("SearchRange,-sr", m_iSearchRange, 96, "Motion search range")
833  ("BipredSearchRange", m_bipredSearchRange, 4, "Motion search range for bipred refinement")
834  ("MinSearchWindow", m_minSearchWindow, 8, "Minimum motion search window size for the adaptive window ME")
835  ("RestrictMESampling", m_bRestrictMESampling, false, "Restrict ME Sampling for selective inter motion search")
836  ("ClipForBiPredMEEnabled", m_bClipForBiPredMeEnabled, false, "Enables clipping in the Bi-Pred ME. It is disabled to reduce encoder run-time")
837  ("FastMEAssumingSmootherMVEnabled", m_bFastMEAssumingSmootherMVEnabled, true, "Enables fast ME assuming a smoother MV.")
838 
839  ("HadamardME", m_bUseHADME, true, "Hadamard ME for fractional-pel")
840  ("ASR", m_bUseASR, false, "Adaptive motion search range");
841  opts.addOptions()
842 
843  // Mode decision parameters
844  ("LambdaModifier0,-LM0", m_adLambdaModifier[ 0 ], ( Double )1.0, "Lambda modifier for temporal layer 0. If LambdaModifierI is used, this will not affect intra pictures")
845  ("LambdaModifier1,-LM1", m_adLambdaModifier[ 1 ], ( Double )1.0, "Lambda modifier for temporal layer 1. If LambdaModifierI is used, this will not affect intra pictures")
846  ("LambdaModifier2,-LM2", m_adLambdaModifier[ 2 ], ( Double )1.0, "Lambda modifier for temporal layer 2. If LambdaModifierI is used, this will not affect intra pictures")
847  ("LambdaModifier3,-LM3", m_adLambdaModifier[ 3 ], ( Double )1.0, "Lambda modifier for temporal layer 3. If LambdaModifierI is used, this will not affect intra pictures")
848  ("LambdaModifier4,-LM4", m_adLambdaModifier[ 4 ], ( Double )1.0, "Lambda modifier for temporal layer 4. If LambdaModifierI is used, this will not affect intra pictures")
849  ("LambdaModifier5,-LM5", m_adLambdaModifier[ 5 ], ( Double )1.0, "Lambda modifier for temporal layer 5. If LambdaModifierI is used, this will not affect intra pictures")
850  ("LambdaModifier6,-LM6", m_adLambdaModifier[ 6 ], ( Double )1.0, "Lambda modifier for temporal layer 6. If LambdaModifierI is used, this will not affect intra pictures")
851  ("LambdaModifierI,-LMI", cfg_adIntraLambdaModifier, cfg_adIntraLambdaModifier, "Lambda modifiers for Intra pictures, comma separated, up to one the number of temporal layer. If entry for temporalLayer exists, then use it, else if some are specified, use the last, else use the standard LambdaModifiers.")
852  ("IQPFactor,-IQF", m_dIntraQpFactor, -1.0, "Intra QP Factor for Lambda Computation. If negative, the default will scale lambda based on GOP size (unless LambdaFromQpEnable then IntraQPOffset is used instead)")
853 
854  /* Quantization parameters */
855 #if JVET_E0059_FLOATING_POINT_QP_FIX
856  ("QP,q", m_iQP, 30, "Qp value")
857  ("QPIncrementFrame,-qpif", m_qpIncrementAtSourceFrame, OptionalValue<UInt>(), "If a source file frame number is specified, the internal QP will be incremented for all POCs associated with source frames >= frame number. If empty, do not increment.")
858 #else
859  ("QP,q", m_fQP, 30.0, "Qp value, if value is float, QP is switched once during encoding")
860 #endif
861 #if X0038_LAMBDA_FROM_QP_CAPABILITY
862  ("IntraQPOffset", m_intraQPOffset, 0, "Qp offset value for intra slice, typically determined based on GOP size")
863  ("LambdaFromQpEnable", m_lambdaFromQPEnable, false, "Enable flag for derivation of lambda from QP")
864 #endif
865  ("DeltaQpRD,-dqr", m_uiDeltaQpRD, 0u, "max dQp offset for slice")
866  ("MaxDeltaQP,d", m_iMaxDeltaQP, 0, "max dQp offset for block")
867  ("MaxCuDQPDepth,-dqd", m_iMaxCuDQPDepth, 0, "max depth for a minimum CuDQP")
868  ("MaxCUChromaQpAdjustmentDepth", m_diffCuChromaQpOffsetDepth, -1, "Maximum depth for CU chroma Qp adjustment - set less than 0 to disable")
869  ("FastDeltaQP", m_bFastDeltaQP, false, "Fast Delta QP Algorithm")
870  ("LumaLevelToDeltaQPMode", lumaLevelToDeltaQPMode, 0u, "Luma based Delta QP 0(default): not used. 1: Based on CTU average, 2: Based on Max luma in CTU")
871  ("LumaLevelToDeltaQPMaxValWeight", m_lumaLevelToDeltaQPMapping.maxMethodWeight, 1.0, "Weight of block max luma val when LumaLevelToDeltaQPMode = 2")
872  ("LumaLevelToDeltaQPMappingLuma", cfg_lumaLeveltoDQPMappingLuma, cfg_lumaLeveltoDQPMappingLuma, "Luma to Delta QP Mapping - luma thresholds")
873  ("LumaLevelToDeltaQPMappingDQP", cfg_lumaLeveltoDQPMappingQP, cfg_lumaLeveltoDQPMappingQP, "Luma to Delta QP Mapping - DQP values")
874  ("CbQpOffset,-cbqpofs", m_cbQpOffset, 0, "Chroma Cb QP Offset")
875  ("CrQpOffset,-crqpofs", m_crQpOffset, 0, "Chroma Cr QP Offset")
876  ("WCGPPSEnable", m_wcgChromaQpControl.enabled, false, "1: Enable the WCG PPS chroma modulation scheme. 0 (default) disabled")
877  ("WCGPPSCbQpScale", m_wcgChromaQpControl.chromaCbQpScale, 1.0, "WCG PPS Chroma Cb QP Scale")
878  ("WCGPPSCrQpScale", m_wcgChromaQpControl.chromaCrQpScale, 1.0, "WCG PPS Chroma Cr QP Scale")
879  ("WCGPPSChromaQpScale", m_wcgChromaQpControl.chromaQpScale, 0.0, "WCG PPS Chroma QP Scale")
880  ("WCGPPSChromaQpOffset", m_wcgChromaQpControl.chromaQpOffset, 0.0, "WCG PPS Chroma QP Offset")
881  ("SliceChromaQPOffsetPeriodicity", m_sliceChromaQpOffsetPeriodicity, 0u, "Used in conjunction with Slice Cb/Cr QpOffsetIntraOrPeriodic. Use 0 (default) to disable periodic nature.")
882  ("SliceCbQpOffsetIntraOrPeriodic", m_sliceChromaQpOffsetIntraOrPeriodic[0], 0, "Chroma Cb QP Offset at slice level for I slice or for periodic inter slices as defined by SliceChromaQPOffsetPeriodicity. Replaces offset in the GOP table.")
883  ("SliceCrQpOffsetIntraOrPeriodic", m_sliceChromaQpOffsetIntraOrPeriodic[1], 0, "Chroma Cr QP Offset at slice level for I slice or for periodic inter slices as defined by SliceChromaQPOffsetPeriodicity. Replaces offset in the GOP table.")
885  ("AdaptiveQpSelection,-aqps", m_bUseAdaptQpSelect, false, "AdaptiveQpSelection")
886 #endif
887 
888  ("AdaptiveQP,-aq", m_bUseAdaptiveQP, false, "QP adaptation based on a psycho-visual model")
889  ("MaxQPAdaptationRange,-aqr", m_iQPAdaptationRange, 6, "QP adaptation range")
890  ("dQPFile,m", m_dQPFileName, string(""), "dQP file name")
891  ("RDOQ", m_useRDOQ, true)
892  ("RDOQTS", m_useRDOQTS, true)
893  ("SelectiveRDOQ", m_useSelectiveRDOQ, false, "Enable selective RDOQ")
894  ("RDpenalty", m_rdPenalty, 0, "RD-penalty for 32x32 TU for intra in non-intra slices. 0:disabled 1:RD-penalty 2:maximum RD-penalty")
895 
896  // Deblocking filter parameters
897  ("LoopFilterDisable", m_bLoopFilterDisable, false)
898  ("LoopFilterOffsetInPPS", m_loopFilterOffsetInPPS, true)
899  ("LoopFilterBetaOffset_div2", m_loopFilterBetaOffsetDiv2, 0)
900  ("LoopFilterTcOffset_div2", m_loopFilterTcOffsetDiv2, 0)
901  ("DeblockingFilterMetric", m_deblockingFilterMetric, 0)
902  // Coding tools
903  ("AMP", m_enableAMP, true, "Enable asymmetric motion partitions")
904  ("CrossComponentPrediction", m_crossComponentPredictionEnabledFlag, false, "Enable the use of cross-component prediction (not valid in V1 profiles)")
905  ("ReconBasedCrossCPredictionEstimate", m_reconBasedCrossCPredictionEstimate, false, "When determining the alpha value for cross-component prediction, use the decoded residual rather than the pre-transform encoder-side residual")
906  ("SaoLumaOffsetBitShift", saoOffsetBitShift[CHANNEL_TYPE_LUMA], 0, "Specify the luma SAO bit-shift. If negative, automatically calculate a suitable value based upon bit depth and initial QP")
907  ("SaoChromaOffsetBitShift", saoOffsetBitShift[CHANNEL_TYPE_CHROMA], 0, "Specify the chroma SAO bit-shift. If negative, automatically calculate a suitable value based upon bit depth and initial QP")
908  ("TransformSkip", m_useTransformSkip, false, "Intra transform skipping")
909  ("TransformSkipFast", m_useTransformSkipFast, false, "Fast intra transform skipping")
910  ("TransformSkipLog2MaxSize", m_log2MaxTransformSkipBlockSize, 2U, "Specify transform-skip maximum size. Minimum 2. (not valid in V1 profiles)")
911  ("ImplicitResidualDPCM", m_rdpcmEnabledFlag[RDPCM_SIGNAL_IMPLICIT], false, "Enable implicitly signalled residual DPCM for intra (also known as sample-adaptive intra predict) (not valid in V1 profiles)")
912  ("ExplicitResidualDPCM", m_rdpcmEnabledFlag[RDPCM_SIGNAL_EXPLICIT], false, "Enable explicitly signalled residual DPCM for inter (not valid in V1 profiles)")
913  ("ResidualRotation", m_transformSkipRotationEnabledFlag, false, "Enable rotation of transform-skipped and transquant-bypassed TUs through 180 degrees prior to entropy coding (not valid in V1 profiles)")
914  ("SingleSignificanceMapContext", m_transformSkipContextEnabledFlag, false, "Enable, for transform-skipped and transquant-bypassed TUs, the selection of a single significance map context variable for all coefficients (not valid in V1 profiles)")
915  ("GolombRiceParameterAdaptation", m_persistentRiceAdaptationEnabledFlag, false, "Enable the adaptation of the Golomb-Rice parameter over the course of each slice")
916  ("AlignCABACBeforeBypass", m_cabacBypassAlignmentEnabledFlag, false, "Align the CABAC engine to a defined fraction of a bit prior to coding bypass data. Must be 1 in high bit rate profile, 0 otherwise" )
917  ("SAO", m_bUseSAO, true, "Enable Sample Adaptive Offset")
918  ("TestSAODisableAtPictureLevel", m_bTestSAODisableAtPictureLevel, false, "Enables the testing of disabling SAO at the picture level after having analysed all blocks")
919  ("SaoEncodingRate", m_saoEncodingRate, 0.75, "When >0 SAO early picture termination is enabled for luma and chroma")
920  ("SaoEncodingRateChroma", m_saoEncodingRateChroma, 0.5, "The SAO early picture termination rate to use for chroma (when m_SaoEncodingRate is >0). If <=0, use results for luma")
921  ("MaxNumOffsetsPerPic", m_maxNumOffsetsPerPic, 2048, "Max number of SAO offset per picture (Default: 2048)")
922  ("SAOLcuBoundary", m_saoCtuBoundary, false, "0: right/bottom CTU boundary areas skipped from SAO parameter estimation, 1: non-deblocked pixels are used for those areas")
923  ("SAOResetEncoderStateAfterIRAP", m_saoResetEncoderStateAfterIRAP, false, "When true, resets the encoder's SAO state after an IRAP (POC order). Disabled by default.")
924  ("SliceMode", tmpSliceMode, Int(NO_SLICES), "0: Disable all Recon slice limits, 1: Enforce max # of CTUs, 2: Enforce max # of bytes, 3:specify tiles per dependent slice")
925  ("SliceArgument", m_sliceArgument, 0, "Depending on SliceMode being:"
926  "\t1: max number of CTUs per slice"
927  "\t2: max number of bytes per slice"
928  "\t3: max number of tiles per slice")
929  ("SliceSegmentMode", tmpSliceSegmentMode, Int(NO_SLICES), "0: Disable all slice segment limits, 1: Enforce max # of CTUs, 2: Enforce max # of bytes, 3:specify tiles per dependent slice")
930  ("SliceSegmentArgument", m_sliceSegmentArgument, 0, "Depending on SliceSegmentMode being:"
931  "\t1: max number of CTUs per slice segment"
932  "\t2: max number of bytes per slice segment"
933  "\t3: max number of tiles per slice segment")
934  ("LFCrossSliceBoundaryFlag", m_bLFCrossSliceBoundaryFlag, true)
935 
936  ("ConstrainedIntraPred", m_bUseConstrainedIntraPred, false, "Constrained Intra Prediction")
937  ("FastUDIUseMPMEnabled", m_bFastUDIUseMPMEnabled, true, "If enabled, adapt intra direction search, accounting for MPM")
938  ("FastMEForGenBLowDelayEnabled", m_bFastMEForGenBLowDelayEnabled, true, "If enabled use a fast ME for generalised B Low Delay slices")
939  ("UseBLambdaForNonKeyLowDelayPictures", m_bUseBLambdaForNonKeyLowDelayPictures, true, "Enables use of B-Lambda for non-key low-delay pictures")
940  ("PCMEnabledFlag", m_usePCM, false)
941  ("PCMLog2MaxSize", m_pcmLog2MaxSize, 5u)
942  ("PCMLog2MinSize", m_uiPCMLog2MinSize, 3u)
943 
944  ("PCMInputBitDepthFlag", m_bPCMInputBitDepthFlag, true)
945  ("PCMFilterDisableFlag", m_bPCMFilterDisableFlag, false)
946  ("IntraReferenceSmoothing", m_enableIntraReferenceSmoothing, true, "0: Disable use of intra reference smoothing (not valid in V1 profiles). 1: Enable use of intra reference smoothing (same as V1)")
947  ("WeightedPredP,-wpP", m_useWeightedPred, false, "Use weighted prediction in P slices")
948  ("WeightedPredB,-wpB", m_useWeightedBiPred, false, "Use weighted (bidirectional) prediction in B slices")
949  ("WeightedPredMethod,-wpM", tmpWeightedPredictionMethod, Int(WP_PER_PICTURE_WITH_SIMPLE_DC_COMBINED_COMPONENT), "Weighted prediction method")
950  ("Log2ParallelMergeLevel", m_log2ParallelMergeLevel, 2u, "Parallel merge estimation region")
951  //deprecated copies of renamed tile parameters
952  ("UniformSpacingIdc", m_tileUniformSpacingFlag, false, "deprecated alias of TileUniformSpacing")
953  ("ColumnWidthArray", cfg_ColumnWidth, cfg_ColumnWidth, "deprecated alias of TileColumnWidthArray")
954  ("RowHeightArray", cfg_RowHeight, cfg_RowHeight, "deprecated alias of TileRowHeightArray")
955 
956  ("TileUniformSpacing", m_tileUniformSpacingFlag, false, "Indicates that tile columns and rows are distributed uniformly")
957  ("NumTileColumnsMinus1", m_numTileColumnsMinus1, 0, "Number of tile columns in a picture minus 1")
958  ("NumTileRowsMinus1", m_numTileRowsMinus1, 0, "Number of rows in a picture minus 1")
959  ("TileColumnWidthArray", cfg_ColumnWidth, cfg_ColumnWidth, "Array containing tile column width values in units of CTU")
960  ("TileRowHeightArray", cfg_RowHeight, cfg_RowHeight, "Array containing tile row height values in units of CTU")
961  ("LFCrossTileBoundaryFlag", m_bLFCrossTileBoundaryFlag, true, "1: cross-tile-boundary loop filtering. 0:non-cross-tile-boundary loop filtering")
962  ("WaveFrontSynchro", m_entropyCodingSyncEnabledFlag, false, "0: entropy coding sync disabled; 1 entropy coding sync enabled")
963  ("ScalingList", m_useScalingListId, SCALING_LIST_OFF, "0/off: no scaling list, 1/default: default scaling lists, 2/file: scaling lists specified in ScalingListFile")
964  ("ScalingListFile", m_scalingListFileName, string(""), "Scaling list file name. Use an empty string to produce help.")
965  ("SignHideFlag,-SBH", m_signDataHidingEnabledFlag, true)
966  ("MaxNumMergeCand", m_maxNumMergeCand, 5u, "Maximum number of merge candidates")
967  /* Misc. */
968  ("SEIDecodedPictureHash", tmpDecodedPictureHashSEIMappedType, 0, "Control generation of decode picture hash SEI messages\n"
969  "\t3: checksum\n"
970  "\t2: CRC\n"
971  "\t1: use MD5\n"
972  "\t0: disable")
973  ("TMVPMode", m_TMVPModeId, 1, "TMVP mode 0: TMVP disable for all slices. 1: TMVP enable for all slices (default) 2: TMVP enable for certain slices only")
974  ("FEN", tmpFastInterSearchMode, Int(FASTINTERSEARCH_DISABLED), "fast encoder setting")
975  ("ECU", m_bUseEarlyCU, false, "Early CU setting")
976  ("FDM", m_useFastDecisionForMerge, true, "Fast decision for Merge RD Cost")
977  ("CFM", m_bUseCbfFastMode, false, "Cbf fast mode setting")
978  ("ESD", m_useEarlySkipDetection, false, "Early SKIP detection setting")
979  ( "RateControl", m_RCEnableRateControl, false, "Rate control: enable rate control" )
980  ( "TargetBitrate", m_RCTargetBitrate, 0, "Rate control: target bit-rate" )
981  ( "KeepHierarchicalBit", m_RCKeepHierarchicalBit, 0, "Rate control: 0: equal bit allocation; 1: fixed ratio bit allocation; 2: adaptive ratio bit allocation" )
982  ( "LCULevelRateControl", m_RCLCULevelRC, true, "Rate control: true: CTU level RC; false: picture level RC" )
983  ( "RCLCUSeparateModel", m_RCUseLCUSeparateModel, true, "Rate control: use CTU level separate R-lambda model" )
984  ( "InitialQP", m_RCInitialQP, 0, "Rate control: initial QP" )
985  ( "RCForceIntraQP", m_RCForceIntraQP, false, "Rate control: force intra QP to be equal to initial QP" )
986  ( "RCCpbSaturation", m_RCCpbSaturationEnabled, false, "Rate control: enable target bits saturation to avoid CPB overflow and underflow" )
987  ( "RCCpbSize", m_RCCpbSize, 0u, "Rate control: CPB size" )
988  ( "RCInitialCpbFullness", m_RCInitialCpbFullness, 0.9, "Rate control: initial CPB fullness" )
989  ("TransquantBypassEnable", m_TransquantBypassEnabledFlag, false, "transquant_bypass_enabled_flag indicator in PPS")
990  ("TransquantBypassEnableFlag", m_TransquantBypassEnabledFlag, false, "deprecated alias for TransquantBypassEnable")
991  ("CUTransquantBypassFlagForce", m_CUTransquantBypassFlagForce, false, "Force transquant bypass mode, when transquant_bypass_enabled_flag is enabled")
992  ("CostMode", m_costMode, COST_STANDARD_LOSSY, "Use alternative cost functions: choose between 'lossy', 'sequence_level_lossless', 'lossless' (which forces QP to " MACRO_TO_STRING(LOSSLESS_AND_MIXED_LOSSLESS_RD_COST_TEST_QP) ") and 'mixed_lossless_lossy' (which used QP'=" MACRO_TO_STRING(LOSSLESS_AND_MIXED_LOSSLESS_RD_COST_TEST_QP_PRIME) " for pre-estimates of transquant-bypass blocks).")
993  ("RecalculateQPAccordingToLambda", m_recalculateQPAccordingToLambda, false, "Recalculate QP values according to lambda values. Do not suggest to be enabled in all intra case")
994  ("StrongIntraSmoothing,-sis", m_useStrongIntraSmoothing, true, "Enable strong intra smoothing for 32x32 blocks")
995  ("SEIActiveParameterSets", m_activeParameterSetsSEIEnabled, 0, "Enable generation of active parameter sets SEI messages");
996  opts.addOptions()
997  ("VuiParametersPresent,-vui", m_vuiParametersPresentFlag, false, "Enable generation of vui_parameters()")
998  ("AspectRatioInfoPresent", m_aspectRatioInfoPresentFlag, false, "Signals whether aspect_ratio_idc is present")
999  ("AspectRatioIdc", m_aspectRatioIdc, 0, "aspect_ratio_idc")
1000  ("SarWidth", m_sarWidth, 0, "horizontal size of the sample aspect ratio")
1001  ("SarHeight", m_sarHeight, 0, "vertical size of the sample aspect ratio")
1002  ("OverscanInfoPresent", m_overscanInfoPresentFlag, false, "Indicates whether conformant decoded pictures are suitable for display using overscan\n")
1003  ("OverscanAppropriate", m_overscanAppropriateFlag, false, "Indicates whether conformant decoded pictures are suitable for display using overscan\n")
1004  ("VideoSignalTypePresent", m_videoSignalTypePresentFlag, false, "Signals whether video_format, video_full_range_flag, and colour_description_present_flag are present")
1005  ("VideoFormat", m_videoFormat, 5, "Indicates representation of pictures")
1006  ("VideoFullRange", m_videoFullRangeFlag, false, "Indicates the black level and range of luma and chroma signals")
1007  ("ColourDescriptionPresent", m_colourDescriptionPresentFlag, false, "Signals whether colour_primaries, transfer_characteristics and matrix_coefficients are present")
1008  ("ColourPrimaries", m_colourPrimaries, 2, "Indicates chromaticity coordinates of the source primaries")
1009  ("TransferCharacteristics", m_transferCharacteristics, 2, "Indicates the opto-electronic transfer characteristics of the source")
1010  ("MatrixCoefficients", m_matrixCoefficients, 2, "Describes the matrix coefficients used in deriving luma and chroma from RGB primaries")
1011  ("ChromaLocInfoPresent", m_chromaLocInfoPresentFlag, false, "Signals whether chroma_sample_loc_type_top_field and chroma_sample_loc_type_bottom_field are present")
1012  ("ChromaSampleLocTypeTopField", m_chromaSampleLocTypeTopField, 0, "Specifies the location of chroma samples for top field")
1013  ("ChromaSampleLocTypeBottomField", m_chromaSampleLocTypeBottomField, 0, "Specifies the location of chroma samples for bottom field")
1014  ("NeutralChromaIndication", m_neutralChromaIndicationFlag, false, "Indicates that the value of all decoded chroma samples is equal to 1<<(BitDepthCr-1)")
1015  ("DefaultDisplayWindowFlag", m_defaultDisplayWindowFlag, false, "Indicates the presence of the Default Window parameters")
1016  ("DefDispWinLeftOffset", m_defDispWinLeftOffset, 0, "Specifies the left offset of the default display window from the conformance window")
1017  ("DefDispWinRightOffset", m_defDispWinRightOffset, 0, "Specifies the right offset of the default display window from the conformance window")
1018  ("DefDispWinTopOffset", m_defDispWinTopOffset, 0, "Specifies the top offset of the default display window from the conformance window")
1019  ("DefDispWinBottomOffset", m_defDispWinBottomOffset, 0, "Specifies the bottom offset of the default display window from the conformance window")
1020  ("FrameFieldInfoPresentFlag", m_frameFieldInfoPresentFlag, false, "Indicates that pic_struct and field coding related values are present in picture timing SEI messages")
1021  ("PocProportionalToTimingFlag", m_pocProportionalToTimingFlag, false, "Indicates that the POC value is proportional to the output time w.r.t. first picture in CVS")
1022  ("NumTicksPocDiffOneMinus1", m_numTicksPocDiffOneMinus1, 0, "Number of ticks minus 1 that for a POC difference of one")
1023  ("BitstreamRestriction", m_bitstreamRestrictionFlag, false, "Signals whether bitstream restriction parameters are present")
1024  ("TilesFixedStructure", m_tilesFixedStructureFlag, false, "Indicates that each active picture parameter set has the same values of the syntax elements related to tiles")
1025  ("MotionVectorsOverPicBoundaries", m_motionVectorsOverPicBoundariesFlag, false, "Indicates that no samples outside the picture boundaries are used for inter prediction")
1026  ("MaxBytesPerPicDenom", m_maxBytesPerPicDenom, 2, "Indicates a number of bytes not exceeded by the sum of the sizes of the VCL NAL units associated with any coded picture")
1027  ("MaxBitsPerMinCuDenom", m_maxBitsPerMinCuDenom, 1, "Indicates an upper bound for the number of bits of coding_unit() data")
1028  ("Log2MaxMvLengthHorizontal", m_log2MaxMvLengthHorizontal, 15, "Indicate the maximum absolute value of a decoded horizontal MV component in quarter-pel luma units")
1029  ("Log2MaxMvLengthVertical", m_log2MaxMvLengthVertical, 15, "Indicate the maximum absolute value of a decoded vertical MV component in quarter-pel luma units");
1030  opts.addOptions()
1031  ("SEIColourRemappingInfoFileRoot,-cri", m_colourRemapSEIFileRoot, string(""), "Colour Remapping Information SEI parameters root file name (wo num ext)")
1032  ("SEIRecoveryPoint", m_recoveryPointSEIEnabled, false, "Control generation of recovery point SEI messages")
1033  ("SEIBufferingPeriod", m_bufferingPeriodSEIEnabled, false, "Control generation of buffering period SEI messages")
1034  ("SEIPictureTiming", m_pictureTimingSEIEnabled, false, "Control generation of picture timing SEI messages")
1035  ("SEIToneMappingInfo", m_toneMappingInfoSEIEnabled, false, "Control generation of Tone Mapping SEI messages")
1036  ("SEIToneMapId", m_toneMapId, 0, "Specifies Id of Tone Mapping SEI message for a given session")
1037  ("SEIToneMapCancelFlag", m_toneMapCancelFlag, false, "Indicates that Tone Mapping SEI message cancels the persistence or follows")
1038  ("SEIToneMapPersistenceFlag", m_toneMapPersistenceFlag, true, "Specifies the persistence of the Tone Mapping SEI message")
1039  ("SEIToneMapCodedDataBitDepth", m_toneMapCodedDataBitDepth, 8, "Specifies Coded Data BitDepth of Tone Mapping SEI messages")
1040  ("SEIToneMapTargetBitDepth", m_toneMapTargetBitDepth, 8, "Specifies Output BitDepth of Tone mapping function")
1041  ("SEIToneMapModelId", m_toneMapModelId, 0, "Specifies Model utilized for mapping coded data into target_bit_depth range\n"
1042  "\t0: linear mapping with clipping\n"
1043  "\t1: sigmoidal mapping\n"
1044  "\t2: user-defined table mapping\n"
1045  "\t3: piece-wise linear mapping\n"
1046  "\t4: luminance dynamic range information ")
1047  ("SEIToneMapMinValue", m_toneMapMinValue, 0, "Specifies the minimum value in mode 0")
1048  ("SEIToneMapMaxValue", m_toneMapMaxValue, 1023, "Specifies the maximum value in mode 0")
1049  ("SEIToneMapSigmoidMidpoint", m_sigmoidMidpoint, 512, "Specifies the centre point in mode 1")
1050  ("SEIToneMapSigmoidWidth", m_sigmoidWidth, 960, "Specifies the distance between 5% and 95% values of the target_bit_depth in mode 1")
1051  ("SEIToneMapStartOfCodedInterval", cfg_startOfCodedInterval, cfg_startOfCodedInterval, "Array of user-defined mapping table")
1052  ("SEIToneMapNumPivots", m_numPivots, 0, "Specifies the number of pivot points in mode 3")
1053  ("SEIToneMapCodedPivotValue", cfg_codedPivotValue, cfg_codedPivotValue, "Array of pivot point")
1054  ("SEIToneMapTargetPivotValue", cfg_targetPivotValue, cfg_targetPivotValue, "Array of pivot point")
1055  ("SEIToneMapCameraIsoSpeedIdc", m_cameraIsoSpeedIdc, 0, "Indicates the camera ISO speed for daylight illumination")
1056  ("SEIToneMapCameraIsoSpeedValue", m_cameraIsoSpeedValue, 400, "Specifies the camera ISO speed for daylight illumination of Extended_ISO")
1057  ("SEIToneMapExposureIndexIdc", m_exposureIndexIdc, 0, "Indicates the exposure index setting of the camera")
1058  ("SEIToneMapExposureIndexValue", m_exposureIndexValue, 400, "Specifies the exposure index setting of the camera of Extended_ISO")
1059  ("SEIToneMapExposureCompensationValueSignFlag", m_exposureCompensationValueSignFlag, false, "Specifies the sign of ExposureCompensationValue")
1060  ("SEIToneMapExposureCompensationValueNumerator", m_exposureCompensationValueNumerator, 0, "Specifies the numerator of ExposureCompensationValue")
1061  ("SEIToneMapExposureCompensationValueDenomIdc", m_exposureCompensationValueDenomIdc, 2, "Specifies the denominator of ExposureCompensationValue")
1062  ("SEIToneMapRefScreenLuminanceWhite", m_refScreenLuminanceWhite, 350, "Specifies reference screen brightness setting in units of candela per square metre")
1063  ("SEIToneMapExtendedRangeWhiteLevel", m_extendedRangeWhiteLevel, 800, "Indicates the luminance dynamic range")
1064  ("SEIToneMapNominalBlackLevelLumaCodeValue", m_nominalBlackLevelLumaCodeValue, 16, "Specifies luma sample value of the nominal black level assigned decoded pictures")
1065  ("SEIToneMapNominalWhiteLevelLumaCodeValue", m_nominalWhiteLevelLumaCodeValue, 235, "Specifies luma sample value of the nominal white level assigned decoded pictures")
1066  ("SEIToneMapExtendedWhiteLevelLumaCodeValue", m_extendedWhiteLevelLumaCodeValue, 300, "Specifies luma sample value of the extended dynamic range assigned decoded pictures")
1067  ("SEIChromaResamplingFilterHint", m_chromaResamplingFilterSEIenabled, false, "Control generation of the chroma sampling filter hint SEI message")
1068  ("SEIChromaResamplingHorizontalFilterType", m_chromaResamplingHorFilterIdc, 2, "Defines the Index of the chroma sampling horizontal filter\n"
1069  "\t0: unspecified - Chroma filter is unknown or is determined by the application"
1070  "\t1: User-defined - Filter coefficients are specified in the chroma sampling filter hint SEI message"
1071  "\t2: Standards-defined - ITU-T Rec. T.800 | ISO/IEC15444-1, 5/3 filter")
1072  ("SEIChromaResamplingVerticalFilterType", m_chromaResamplingVerFilterIdc, 2, "Defines the Index of the chroma sampling vertical filter\n"
1073  "\t0: unspecified - Chroma filter is unknown or is determined by the application"
1074  "\t1: User-defined - Filter coefficients are specified in the chroma sampling filter hint SEI message"
1075  "\t2: Standards-defined - ITU-T Rec. T.800 | ISO/IEC15444-1, 5/3 filter")
1076  ("SEIFramePacking", m_framePackingSEIEnabled, false, "Control generation of frame packing SEI messages")
1077  ("SEIFramePackingType", m_framePackingSEIType, 0, "Define frame packing arrangement\n"
1078  "\t3: side by side - frames are displayed horizontally\n"
1079  "\t4: top bottom - frames are displayed vertically\n"
1080  "\t5: frame alternation - one frame is alternated with the other")
1081  ("SEIFramePackingId", m_framePackingSEIId, 0, "Id of frame packing SEI message for a given session")
1082  ("SEIFramePackingQuincunx", m_framePackingSEIQuincunx, 0, "Indicate the presence of a Quincunx type video frame")
1083  ("SEIFramePackingInterpretation", m_framePackingSEIInterpretation, 0, "Indicate the interpretation of the frame pair\n"
1084  "\t0: unspecified\n"
1085  "\t1: stereo pair, frame0 represents left view\n"
1086  "\t2: stereo pair, frame0 represents right view")
1087  ("SEISegmentedRectFramePacking", m_segmentedRectFramePackingSEIEnabled, false, "Controls generation of segmented rectangular frame packing SEI messages")
1088  ("SEISegmentedRectFramePackingCancel", m_segmentedRectFramePackingSEICancel, false, "If equal to 1, cancels the persistence of any previous SRFPA SEI message")
1089  ("SEISegmentedRectFramePackingType", m_segmentedRectFramePackingSEIType, 0, "Specifies the arrangement of the frames in the reconstructed picture")
1090  ("SEISegmentedRectFramePackingPersistence", m_segmentedRectFramePackingSEIPersistence, false, "If equal to 0, the SEI applies to the current frame only")
1091  ("SEIDisplayOrientation", m_displayOrientationSEIAngle, 0, "Control generation of display orientation SEI messages\n"
1092  "\tN: 0 < N < (2^16 - 1) enable display orientation SEI message with anticlockwise_rotation = N and display_orientation_repetition_period = 1\n"
1093  "\t0: disable")
1094  ("SEITemporalLevel0Index", m_temporalLevel0IndexSEIEnabled, false, "Control generation of temporal level 0 index SEI messages")
1095  ("SEIGradualDecodingRefreshInfo", m_gradualDecodingRefreshInfoEnabled, false, "Control generation of gradual decoding refresh information SEI message")
1096  ("SEINoDisplay", m_noDisplaySEITLayer, 0, "Control generation of no display SEI message\n"
1097  "\tN: 0 < N enable no display SEI message for temporal layer N or higher\n"
1098  "\t0: disable")
1099  ("SEIDecodingUnitInfo", m_decodingUnitInfoSEIEnabled, false, "Control generation of decoding unit information SEI message.")
1100  ("SEISOPDescription", m_SOPDescriptionSEIEnabled, false, "Control generation of SOP description SEI messages")
1101  ("SEIScalableNesting", m_scalableNestingSEIEnabled, false, "Control generation of scalable nesting SEI messages")
1102  ("SEITempMotionConstrainedTileSets", m_tmctsSEIEnabled, false, "Control generation of temporal motion constrained tile sets SEI message")
1103 #if MCTS_ENC_CHECK
1104  ("SEITMCTSTileConstraint", m_tmctsSEITileConstraint, false, "Constrain motion vectors at tile boundaries")
1105 #endif
1106  ("SEITimeCodeEnabled", m_timeCodeSEIEnabled, false, "Control generation of time code information SEI message")
1107  ("SEITimeCodeNumClockTs", m_timeCodeSEINumTs, 0, "Number of clock time sets [0..3]")
1108  ("SEITimeCodeTimeStampFlag", cfg_timeCodeSeiTimeStampFlag, cfg_timeCodeSeiTimeStampFlag, "Time stamp flag associated to each time set")
1109  ("SEITimeCodeFieldBasedFlag", cfg_timeCodeSeiNumUnitFieldBasedFlag, cfg_timeCodeSeiNumUnitFieldBasedFlag, "Field based flag associated to each time set")
1110  ("SEITimeCodeCountingType", cfg_timeCodeSeiCountingType, cfg_timeCodeSeiCountingType, "Counting type associated to each time set")
1111  ("SEITimeCodeFullTsFlag", cfg_timeCodeSeiFullTimeStampFlag, cfg_timeCodeSeiFullTimeStampFlag, "Full time stamp flag associated to each time set")
1112  ("SEITimeCodeDiscontinuityFlag", cfg_timeCodeSeiDiscontinuityFlag, cfg_timeCodeSeiDiscontinuityFlag, "Discontinuity flag associated to each time set")
1113  ("SEITimeCodeCntDroppedFlag", cfg_timeCodeSeiCntDroppedFlag, cfg_timeCodeSeiCntDroppedFlag, "Counter dropped flag associated to each time set")
1114  ("SEITimeCodeNumFrames", cfg_timeCodeSeiNumberOfFrames, cfg_timeCodeSeiNumberOfFrames, "Number of frames associated to each time set")
1115  ("SEITimeCodeSecondsValue", cfg_timeCodeSeiSecondsValue, cfg_timeCodeSeiSecondsValue, "Seconds value for each time set")
1116  ("SEITimeCodeMinutesValue", cfg_timeCodeSeiMinutesValue, cfg_timeCodeSeiMinutesValue, "Minutes value for each time set")
1117  ("SEITimeCodeHoursValue", cfg_timeCodeSeiHoursValue, cfg_timeCodeSeiHoursValue, "Hours value for each time set")
1118  ("SEITimeCodeSecondsFlag", cfg_timeCodeSeiSecondsFlag, cfg_timeCodeSeiSecondsFlag, "Flag to signal seconds value presence in each time set")
1119  ("SEITimeCodeMinutesFlag", cfg_timeCodeSeiMinutesFlag, cfg_timeCodeSeiMinutesFlag, "Flag to signal minutes value presence in each time set")
1120  ("SEITimeCodeHoursFlag", cfg_timeCodeSeiHoursFlag, cfg_timeCodeSeiHoursFlag, "Flag to signal hours value presence in each time set")
1121  ("SEITimeCodeOffsetLength", cfg_timeCodeSeiTimeOffsetLength, cfg_timeCodeSeiTimeOffsetLength, "Time offset length associated to each time set")
1122  ("SEITimeCodeTimeOffset", cfg_timeCodeSeiTimeOffsetValue, cfg_timeCodeSeiTimeOffsetValue, "Time offset associated to each time set")
1123  ("SEIKneeFunctionInfo", m_kneeSEIEnabled, false, "Control generation of Knee function SEI messages")
1124  ("SEIKneeFunctionId", m_kneeFunctionInformationSEI.m_kneeFunctionId, 0, "Specifies Id of Knee function SEI message for a given session")
1125  ("SEIKneeFunctionCancelFlag", m_kneeFunctionInformationSEI.m_kneeFunctionCancelFlag, false, "Indicates that Knee function SEI message cancels the persistence or follows")
1126  ("SEIKneeFunctionPersistenceFlag", m_kneeFunctionInformationSEI.m_kneeFunctionPersistenceFlag, true, "Specifies the persistence of the Knee function SEI message")
1127  ("SEIKneeFunctionInputDrange", m_kneeFunctionInformationSEI.m_inputDRange, 1000, "Specifies the peak luminance level for the input picture of Knee function SEI messages")
1128  ("SEIKneeFunctionInputDispLuminance", m_kneeFunctionInformationSEI.m_inputDispLuminance, 100, "Specifies the expected display brightness for the input picture of Knee function SEI messages")
1129  ("SEIKneeFunctionOutputDrange", m_kneeFunctionInformationSEI.m_outputDRange, 4000, "Specifies the peak luminance level for the output picture of Knee function SEI messages")
1130  ("SEIKneeFunctionOutputDispLuminance", m_kneeFunctionInformationSEI.m_outputDispLuminance, 800, "Specifies the expected display brightness for the output picture of Knee function SEI messages")
1131  ("SEIKneeFunctionNumKneePointsMinus1", cfg_kneeSEINumKneePointsMinus1, 2, "Specifies the number of knee points - 1")
1132  ("SEIKneeFunctionInputKneePointValue", cfg_kneeSEIInputKneePointValue, cfg_kneeSEIInputKneePointValue, "Array of input knee point")
1133  ("SEIKneeFunctionOutputKneePointValue", cfg_kneeSEIOutputKneePointValue, cfg_kneeSEIOutputKneePointValue, "Array of output knee point")
1134  ("SEIMasteringDisplayColourVolume", m_masteringDisplay.colourVolumeSEIEnabled, false, "Control generation of mastering display colour volume SEI messages")
1135  ("SEIMasteringDisplayMaxLuminance", m_masteringDisplay.maxLuminance, 10000u, "Specifies the mastering display maximum luminance value in units of 1/10000 candela per square metre (32-bit code value)")
1136  ("SEIMasteringDisplayMinLuminance", m_masteringDisplay.minLuminance, 0u, "Specifies the mastering display minimum luminance value in units of 1/10000 candela per square metre (32-bit code value)")
1137  ("SEIMasteringDisplayPrimaries", cfg_DisplayPrimariesCode, cfg_DisplayPrimariesCode, "Mastering display primaries for all three colour planes in CIE xy coordinates in increments of 1/50000 (results in the ranges 0 to 50000 inclusive)")
1138  ("SEIMasteringDisplayWhitePoint", cfg_DisplayWhitePointCode, cfg_DisplayWhitePointCode, "Mastering display white point CIE xy coordinates in normalised increments of 1/50000 (e.g. 0.333 = 16667)")
1139  ("SEIPreferredTransferCharacterisics", m_preferredTransferCharacteristics, -1, "Value for the preferred_transfer_characteristics field of the Alternative transfer characteristics SEI which will override the corresponding entry in the VUI. If negative, do not produce the respective SEI message")
1140  ("SEIGreenMetadataType", m_greenMetadataType, 0u, "Value for the green_metadata_type specifies the type of metadata that is present in the SEI message. If green_metadata_type is 1, then metadata enabling quality recovery after low-power encoding is present")
1141  ("SEIXSDMetricType", m_xsdMetricType, 0u, "Value for the xsd_metric_type indicates the type of the objective quality metric. PSNR is the only type currently supported")
1142 #if CCV_SEI_MESSAGE
1143  ("SEICCVEnabled", m_ccvSEIEnabled, false, "Enables the Content Colour Volume SEI message")
1144  ("SEICCVCancelFlag", m_ccvSEICancelFlag, true, "Specifies the persistence of any previous content colour volume SEI message in output order.")
1145  ("SEICCVPersistenceFlag", m_ccvSEIPersistenceFlag, false, "Specifies the persistence of the content colour volume SEI message for the current layer.")
1146  ("SEICCVPrimariesPresent", m_ccvSEIPrimariesPresentFlag, true, "Specifies whether the CCV primaries are present in the content colour volume SEI message.")
1147  ("m_ccvSEIPrimariesX0", m_ccvSEIPrimariesX[0], 0.300, "Specifies the x coordinate of the first (green) primary for the content colour volume SEI message")
1148  ("m_ccvSEIPrimariesY0", m_ccvSEIPrimariesY[0], 0.600, "Specifies the y coordinate of the first (green) primary for the content colour volume SEI message")
1149  ("m_ccvSEIPrimariesX1", m_ccvSEIPrimariesX[1], 0.150, "Specifies the x coordinate of the second (blue) primary for the content colour volume SEI message")
1150  ("m_ccvSEIPrimariesY1", m_ccvSEIPrimariesY[1], 0.060, "Specifies the y coordinate of the second (blue) primary for the content colour volume SEI message")
1151  ("m_ccvSEIPrimariesX2", m_ccvSEIPrimariesX[2], 0.640, "Specifies the x coordinate of the third (red) primary for the content colour volume SEI message")
1152  ("m_ccvSEIPrimariesY2", m_ccvSEIPrimariesY[2], 0.330, "Specifies the y coordinate of the third (red) primary for the content colour volume SEI message")
1153  ("SEICCVMinLuminanceValuePresent", m_ccvSEIMinLuminanceValuePresentFlag, true, "Specifies whether the CCV min luminance value is present in the content colour volume SEI message")
1154  ("SEICCVMinLuminanceValue", m_ccvSEIMinLuminanceValue, 0.0, "specifies the CCV min luminance value in the content colour volume SEI message")
1155  ("SEICCVMaxLuminanceValuePresent", m_ccvSEIMaxLuminanceValuePresentFlag, true, "Specifies whether the CCV max luminance value is present in the content colour volume SEI message")
1156  ("SEICCVMaxLuminanceValue", m_ccvSEIMaxLuminanceValue, 0.1, "specifies the CCV max luminance value in the content colour volume SEI message")
1157  ("SEICCVAvgLuminanceValuePresent", m_ccvSEIAvgLuminanceValuePresentFlag, true, "Specifies whether the CCV avg luminance value is present in the content colour volume SEI message")
1158  ("SEICCVAvgLuminanceValue", m_ccvSEIAvgLuminanceValue, 0.01, "specifies the CCV avg luminance value in the content colour volume SEI message")
1159 #endif
1160 #if ERP_SR_OV_SEI_MESSAGE
1161  ("SEIErpEnabled", m_erpSEIEnabled, false, "Control generation of equirectangular projection SEI messages")
1162  ("SEIErpCancelFlag", m_erpSEICancelFlag, true, "Indicate that equirectangular projection SEI message cancels the persistence or follows")
1163  ("SEIErpPersistenceFlag", m_erpSEIPersistenceFlag, false, "Specifies the persistence of the equirectangular projection SEI messages")
1164  ("SEIErpGuardBandFlag", m_erpSEIGuardBandFlag, false, "Indicate the existence of guard band areas in the constituent picture")
1165  ("SEIErpGuardBandType", m_erpSEIGuardBandType, 0u, "Indicate the type of the guard band")
1166  ("SEIErpLeftGuardBandWidth", m_erpSEILeftGuardBandWidth, 0u, "Indicate the width of the guard band on the left side of the constituent picture")
1167  ("SEIErpRightGuardBandWidth", m_erpSEIRightGuardBandWidth, 0u, "Indicate the width of the guard band on the right side of the constituent picture")
1168  ("SEISphereRotationEnabled", m_sphereRotationSEIEnabled, false, "Control generation of sphere rotation SEI messages")
1169  ("SEISphereRotationCancelFlag", m_sphereRotationSEICancelFlag, true, "Indicate that sphere rotation SEI message cancels the persistence or follows")
1170  ("SEISphereRotationPersistenceFlag", m_sphereRotationSEIPersistenceFlag, false, "Specifies the persistence of the sphere rotation SEI messages")
1171  ("SEISphereRotationYaw", m_sphereRotationSEIYaw, 0, "Specifies the value of the yaw rotation angle")
1172  ("SEISphereRotationPitch", m_sphereRotationSEIPitch, 0, "Specifies the value of the pitch rotation angle")
1173  ("SEISphereRotationRoll", m_sphereRotationSEIRoll, 0, "Specifies the value of the roll rotation angle")
1174  ("SEIOmniViewportEnabled", m_omniViewportSEIEnabled, false, "Control generation of omni viewport SEI messages")
1175  ("SEIOmniViewportId", m_omniViewportSEIId, 0u, "An identifying number that may be used to identify the purpose of the one or more recommended viewport regions")
1176  ("SEIOmniViewportCancelFlag", m_omniViewportSEICancelFlag, true, "Indicate that omni viewport SEI message cancels the persistence or follows")
1177  ("SEIOmniViewportPersistenceFlag", m_omniViewportSEIPersistenceFlag, false, "Specifies the persistence of the omni viewport SEI messages")
1178  ("SEIOmniViewportCntMinus1", m_omniViewportSEICntMinus1, 0u, "specifies the number of recommended viewport regions minus 1")
1179  ("SEIOmniViewportAzimuthCentre", cfg_omniViewportSEIAzimuthCentre, cfg_omniViewportSEIAzimuthCentre, "Indicate the centre of the i-th recommended viewport region")
1180  ("SEIOmniViewportElevationCentre", cfg_omniViewportSEIElevationCentre, cfg_omniViewportSEIElevationCentre, "Indicate the centre of the i-th recommended viewport region")
1181  ("SEIOmniViewportTiltCentre", cfg_omniViewportSEITiltCentre, cfg_omniViewportSEITiltCentre, "Indicates the tilt angle of the i-th recommended viewport region")
1182  ("SEIOmniViewportHorRange", cfg_omniViewportSEIHorRange, cfg_omniViewportSEIHorRange, "Indicates the azimuth range of the i-th recommended viewport region")
1183  ("SEIOmniViewportVerRange", cfg_omniViewportSEIVerRange, cfg_omniViewportSEIVerRange, "Indicates the elevation range of the i-th recommended viewport region")
1184 #endif
1185 #if CMP_SEI_MESSAGE
1186  ("SEICmpEnabled", m_cmpSEIEnabled, false, "Controls generation of cubemap projection SEI message")
1187  ("SEICmpCancelFlag", m_cmpSEICmpCancelFlag, true, "Specifies the persistence of any previous cubemap projection SEI message in output order.")
1188  ("SEICmpPersistenceFlag", m_cmpSEICmpPersistenceFlag, false, "Specifies the persistence of the cubemap projection SEI message for the current layer.")
1189 #endif
1190 #if RWP_SEI_MESSAGE
1191  ("SEIRwpEnabled", m_rwpSEIEnabled, false, "Controls if region-wise packing SEI message enabled")
1192  ("SEIRwpCancelFlag", m_rwpSEIRwpCancelFlag, true, "Specifies the persistence of any previous region-wise packing SEI message in output order.")
1193  ("SEIRwpPersistenceFlag", m_rwpSEIRwpPersistenceFlag, false, "Specifies the persistence of the region-wise packing SEI message for the current layer.")
1194  ("SEIRwpConstituentPictureMatchingFlag", m_rwpSEIConstituentPictureMatchingFlag, false, "Specifies the information in the SEI message apply individually to each constituent picture or to the projected picture.")
1195  ("SEIRwpNumPackedRegions", m_rwpSEINumPackedRegions, 0, "specifies the number of packed regions when constituent picture matching flag is equal to 0.")
1196  ("SEIRwpProjPictureWidth", m_rwpSEIProjPictureWidth, 0, "Specifies the width of the projected picture.")
1197  ("SEIRwpProjPictureHeight", m_rwpSEIProjPictureHeight, 0, "Specifies the height of the projected picture.")
1198  ("SEIRwpPackedPictureWidth", m_rwpSEIPackedPictureWidth, 0, "specifies the width of the packed picture.")
1199  ("SEIRwpPackedPictureHeight", m_rwpSEIPackedPictureHeight, 0, "Specifies the height of the packed picture.")
1200  ("SEIRwpTransformType", cfg_rwpSEIRwpTransformType, cfg_rwpSEIRwpTransformType, "specifies the rotation and mirroring to be applied to the i-th packed region.")
1201  ("SEIRwpGuardBandFlag", cfg_rwpSEIRwpGuardBandFlag, cfg_rwpSEIRwpGuardBandFlag, "specifies the existence of guard band in the i-th packed region.")
1202  ("SEIRwpProjRegionWidth", cfg_rwpSEIProjRegionWidth, cfg_rwpSEIProjRegionWidth, "specifies the width of the i-th projected region.")
1203  ("SEIRwpProjRegionHeight", cfg_rwpSEIProjRegionHeight, cfg_rwpSEIProjRegionHeight, "specifies the height of the i-th projected region.")
1204  ("SEIRwpProjRegionTop", cfg_rwpSEIRwpSEIProjRegionTop, cfg_rwpSEIRwpSEIProjRegionTop, "specifies the top sample row of the i-th projected region.")
1205  ("SEIRwpProjRegionLeft", cfg_rwpSEIProjRegionLeft, cfg_rwpSEIProjRegionLeft, "specifies the left-most sample column of the i-th projected region.")
1206  ("SEIRwpPackedRegionWidth", cfg_rwpSEIPackedRegionWidth, cfg_rwpSEIPackedRegionWidth, "specifies the width of the i-th packed region.")
1207  ("SEIRwpPackedRegionHeight", cfg_rwpSEIPackedRegionHeight, cfg_rwpSEIPackedRegionHeight, "specifies the height of the i-th packed region.")
1208  ("SEIRwpPackedRegionTop", cfg_rwpSEIPackedRegionTop, cfg_rwpSEIPackedRegionTop, "specifies the top luma sample row of the i-th packed region.")
1209  ("SEIRwpPackedRegionLeft", cfg_rwpSEIPackedRegionLeft, cfg_rwpSEIPackedRegionLeft, "specifies the left-most luma sample column of the i-th packed region.")
1210  ("SEIRwpLeftGuardBandWidth", cfg_rwpSEIRwpLeftGuardBandWidth, cfg_rwpSEIRwpLeftGuardBandWidth, "specifies the width of the guard band on the left side of the i-th packed region.")
1211  ("SEIRwpRightGuardBandWidth", cfg_rwpSEIRwpRightGuardBandWidth, cfg_rwpSEIRwpRightGuardBandWidth, "specifies the width of the guard band on the right side of the i-th packed region.")
1212  ("SEIRwpTopGuardBandHeight", cfg_rwpSEIRwpTopGuardBandHeight, cfg_rwpSEIRwpTopGuardBandHeight, "specifies the height of the guard band above the i-th packed region.")
1213  ("SEIRwpBottomGuardBandHeight", cfg_rwpSEIRwpBottomGuardBandHeight, cfg_rwpSEIRwpBottomGuardBandHeight, "specifies the height of the guard band below the i-th packed region.")
1214  ("SEIRwpGuardBandNotUsedForPredFlag", cfg_rwpSEIRwpGuardBandNotUsedForPredFlag, cfg_rwpSEIRwpGuardBandNotUsedForPredFlag, "Specifies if the guard bands is used in the inter prediction process.")
1215  ("SEIRwpGuardBandType", cfg_rwpSEIRwpGuardBandType, cfg_rwpSEIRwpGuardBandType, "Specifies the type of the guard bands for the i-th packed region.")
1216 #endif
1217 #if RNSEI
1218  ("SEIRegionalNestingFileRoot,-rns", m_regionalNestingSEIFileRoot, string(""), "Regional nesting SEI parameters root file name (wo num ext)")
1219 #endif
1220  ;
1221 
1222 #if EXTENSION_360_VIDEO
1223  TExt360AppEncCfg::TExt360AppEncCfgContext ext360CfgContext;
1224  m_ext360.addOptions(opts, ext360CfgContext);
1225 #endif
1226 
1227  for(Int i=1; i<MAX_GOP+1; i++)
1228  {
1229  std::ostringstream cOSS;
1230  cOSS<<"Frame"<<i;
1231  opts.addOptions()(cOSS.str(), m_GOPList[i-1], GOPEntry());
1232  }
1233  po::setDefaults(opts);
1234  po::ErrorReporter err;
1235  const list<const TChar*>& argv_unhandled = po::scanArgv(opts, argc, (const TChar**) argv, err);
1236 
1237  for (list<const TChar*>::const_iterator it = argv_unhandled.begin(); it != argv_unhandled.end(); it++)
1238  {
1239  fprintf(stderr, "Unhandled argument ignored: `%s'\n", *it);
1240  }
1241 
1242  if (argc == 1 || do_help)
1243  {
1244  /* argc == 1: no options have been specified */
1245  po::doHelp(cout, opts);
1246  return false;
1247  }
1248 
1249  if (err.is_errored)
1250  {
1251  if (!warnUnknowParameter)
1252  {
1253  /* error report has already been printed on stderr */
1254  return false;
1255  }
1256  }
1257 
1258  /*
1259  * Set any derived parameters
1260  */
1263 
1265  m_adIntraLambdaModifier = cfg_adIntraLambdaModifier.values;
1266  if(m_isField)
1267  {
1268  //Frame height
1270  //Field height
1272  //number of fields to encode
1273  m_framesToBeEncoded *= 2;
1274  }
1275 
1277  {
1278  if (cfg_ColumnWidth.values.size() > m_numTileColumnsMinus1)
1279  {
1280  printf( "The number of columns whose width are defined is larger than the allowed number of columns.\n" );
1281  exit( EXIT_FAILURE );
1282  }
1283  else if (cfg_ColumnWidth.values.size() < m_numTileColumnsMinus1)
1284  {
1285  printf( "The width of some columns is not defined.\n" );
1286  exit( EXIT_FAILURE );
1287  }
1288  else
1289  {
1291  for(UInt i=0; i<cfg_ColumnWidth.values.size(); i++)
1292  {
1293  m_tileColumnWidth[i]=cfg_ColumnWidth.values[i];
1294  }
1295  }
1296  }
1297  else
1298  {
1299  m_tileColumnWidth.clear();
1300  }
1301 
1303  {
1304  if (cfg_RowHeight.values.size() > m_numTileRowsMinus1)
1305  {
1306  printf( "The number of rows whose height are defined is larger than the allowed number of rows.\n" );
1307  exit( EXIT_FAILURE );
1308  }
1309  else if (cfg_RowHeight.values.size() < m_numTileRowsMinus1)
1310  {
1311  printf( "The height of some rows is not defined.\n" );
1312  exit( EXIT_FAILURE );
1313  }
1314  else
1315  {
1317  for(UInt i=0; i<cfg_RowHeight.values.size(); i++)
1318  {
1319  m_tileRowHeight[i]=cfg_RowHeight.values[i];
1320  }
1321  }
1322  }
1323  else
1324  {
1325  m_tileRowHeight.clear();
1326  }
1327 
1328  /* rules for input, output and internal bitdepths as per help text */
1329  if (m_MSBExtendedBitDepth[CHANNEL_TYPE_LUMA ] == 0)
1330  {
1332  }
1333  if (m_MSBExtendedBitDepth[CHANNEL_TYPE_CHROMA] == 0)
1334  {
1336  }
1337  if (m_internalBitDepth [CHANNEL_TYPE_LUMA ] == 0)
1338  {
1340  }
1341  if (m_internalBitDepth [CHANNEL_TYPE_CHROMA] == 0)
1342  {
1344  }
1345  if (m_inputBitDepth [CHANNEL_TYPE_CHROMA] == 0)
1346  {
1348  }
1349  if (m_outputBitDepth [CHANNEL_TYPE_LUMA ] == 0)
1350  {
1352  }
1353  if (m_outputBitDepth [CHANNEL_TYPE_CHROMA] == 0)
1354  {
1356  }
1357 
1358  m_InputChromaFormatIDC = numberToChromaFormat(tmpInputChromaFormat);
1359  m_chromaFormatIDC = ((tmpChromaFormat == 0) ? (m_InputChromaFormatIDC) : (numberToChromaFormat(tmpChromaFormat)));
1360 
1361 #if EXTENSION_360_VIDEO
1362  m_ext360.processOptions(ext360CfgContext);
1363 #endif
1364 
1365  assert(tmpWeightedPredictionMethod>=0 && tmpWeightedPredictionMethod<=WP_PER_PICTURE_WITH_HISTOGRAM_AND_PER_COMPONENT_AND_CLIPPING_AND_EXTENSION);
1366  if (!(tmpWeightedPredictionMethod>=0 && tmpWeightedPredictionMethod<=WP_PER_PICTURE_WITH_HISTOGRAM_AND_PER_COMPONENT_AND_CLIPPING_AND_EXTENSION))
1367  {
1368  exit(EXIT_FAILURE);
1369  }
1370  m_weightedPredictionMethod = WeightedPredictionMethod(tmpWeightedPredictionMethod);
1371 
1372  assert(tmpFastInterSearchMode>=0 && tmpFastInterSearchMode<=FASTINTERSEARCH_MODE3);
1373  if (tmpFastInterSearchMode<0 || tmpFastInterSearchMode>FASTINTERSEARCH_MODE3)
1374  {
1375  exit(EXIT_FAILURE);
1376  }
1377  m_fastInterSearchMode = FastInterSearchMode(tmpFastInterSearchMode);
1378 
1379  assert(tmpMotionEstimationSearchMethod>=0 && tmpMotionEstimationSearchMethod<MESEARCH_NUMBER_OF_METHODS);
1380  if (tmpMotionEstimationSearchMethod<0 || tmpMotionEstimationSearchMethod>=MESEARCH_NUMBER_OF_METHODS)
1381  {
1382  exit(EXIT_FAILURE);
1383  }
1384  m_motionEstimationSearchMethod=MESearchMethod(tmpMotionEstimationSearchMethod);
1385 
1386  switch (UIProfile)
1387  {
1388  case UI_NONE:
1391  break;
1392  case UI_MAIN:
1395  break;
1396  case UI_MAIN10:
1399  break;
1400  case UI_MAINSTILLPICTURE:
1403  break;
1407  break;
1408  case UI_MAINREXT:
1411  break;
1412  case UI_HIGHTHROUGHPUTREXT:
1415  break;
1416  default:
1417  if (UIProfile >= 1000 && UIProfile <= 12316)
1418  {
1420  if (m_bitDepthConstraint != 0 || tmpConstraintChromaFormat != 0)
1421  {
1422  fprintf(stderr, "Error: The bit depth and chroma format constraints are not used when an explicit RExt profile is specified\n");
1423  exit(EXIT_FAILURE);
1424  }
1425  m_bitDepthConstraint = (UIProfile%100);
1426  m_intraConstraintFlag = ((UIProfile%10000)>=2000);
1427  m_onePictureOnlyConstraintFlag = (UIProfile >= 10000);
1428  switch ((UIProfile/100)%10)
1429  {
1430  case 0: tmpConstraintChromaFormat=400; break;
1431  case 1: tmpConstraintChromaFormat=420; break;
1432  case 2: tmpConstraintChromaFormat=422; break;
1433  default: tmpConstraintChromaFormat=444; break;
1434  }
1435  }
1436  else if (UIProfile >= 21308 && UIProfile <= 22316)
1437  {
1439  if (m_bitDepthConstraint != 0 || tmpConstraintChromaFormat != 0)
1440  {
1441  fprintf(stderr, "Error: The bit depth and chroma format constraints are not used when an explicit RExt profile is specified\n");
1442  exit(EXIT_FAILURE);
1443  }
1444  m_bitDepthConstraint = (UIProfile%100);
1445  m_intraConstraintFlag = ((UIProfile%10000)>=2000);
1447  if((UIProfile == UI_HIGHTHROUGHPUT_444) || (UIProfile == UI_HIGHTHROUGHPUT_444_10) )
1448  {
1450  }
1451  switch ((UIProfile/100)%10)
1452  {
1453  case 0: tmpConstraintChromaFormat=400; break;
1454  case 1: tmpConstraintChromaFormat=420; break;
1455  case 2: tmpConstraintChromaFormat=422; break;
1456  default: tmpConstraintChromaFormat=444; break;
1457  }
1458  }
1459  else
1460  {
1461  fprintf(stderr, "Error: Unprocessed UI profile\n");
1462  assert(0);
1463  exit(EXIT_FAILURE);
1464  }
1465  break;
1466  }
1467 
1468  switch (m_profile)
1469  {
1471  {
1472  if (m_bitDepthConstraint == 0)
1473  {
1474  m_bitDepthConstraint = 16;
1475  }
1476  m_chromaFormatConstraint = (tmpConstraintChromaFormat == 0) ? CHROMA_444 : numberToChromaFormat(tmpConstraintChromaFormat);
1477  }
1478  break;
1479  case Profile::MAINREXT:
1480  {
1481  if (m_bitDepthConstraint == 0 && tmpConstraintChromaFormat == 0)
1482  {
1483  // produce a valid combination, if possible.
1484  const Bool bUsingGeneralRExtTools = m_transformSkipRotationEnabledFlag ||
1491  const Bool bUsingChromaQPAdjustment= m_diffCuChromaQpOffsetDepth >= 0;
1492  const Bool bUsingExtendedPrecision = m_extendedPrecisionProcessingFlag;
1494  {
1496  if (m_intraConstraintFlag != true)
1497  {
1498  fprintf(stderr, "Error: Intra constraint flag must be true when one_picture_only_constraint_flag is true\n");
1499  exit(EXIT_FAILURE);
1500  }
1501  const Int maxBitDepth = m_chromaFormatIDC==CHROMA_400 ? m_internalBitDepth[CHANNEL_TYPE_LUMA] : std::max(m_internalBitDepth[CHANNEL_TYPE_LUMA], m_internalBitDepth[CHANNEL_TYPE_CHROMA]);
1502  m_bitDepthConstraint = maxBitDepth>8 ? 16:8;
1503  }
1504  else
1505  {
1507  automaticallySelectRExtProfile(bUsingGeneralRExtTools,
1508  bUsingChromaQPAdjustment,
1509  bUsingExtendedPrecision,
1513  m_chromaFormatIDC==CHROMA_400 ? m_internalBitDepth[CHANNEL_TYPE_LUMA] : std::max(m_internalBitDepth[CHANNEL_TYPE_LUMA], m_internalBitDepth[CHANNEL_TYPE_CHROMA]),
1515  }
1516  }
1517  else if (m_bitDepthConstraint == 0 || tmpConstraintChromaFormat == 0)
1518  {
1519  fprintf(stderr, "Error: The bit depth and chroma format constraints must either both be specified or both be configured automatically\n");
1520  exit(EXIT_FAILURE);
1521  }
1522  else
1523  {
1524  m_chromaFormatConstraint = numberToChromaFormat(tmpConstraintChromaFormat);
1525  }
1526  }
1527  break;
1528  case Profile::MAIN:
1529  case Profile::MAIN10:
1531  m_chromaFormatConstraint = (tmpConstraintChromaFormat == 0) ? m_chromaFormatIDC : numberToChromaFormat(tmpConstraintChromaFormat);
1533  break;
1534  case Profile::NONE:
1537  break;
1538  default:
1539  fprintf(stderr, "Unknown profile selected\n");
1540  exit(EXIT_FAILURE);
1541  break;
1542  }
1543 
1544 
1545  m_inputColourSpaceConvert = stringToInputColourSpaceConvert(inputColourSpaceConvert, true);
1546 
1547  switch (m_conformanceWindowMode)
1548  {
1549  case 0:
1550  {
1551  // no conformance or padding
1553  m_aiPad[1] = m_aiPad[0] = 0;
1554  break;
1555  }
1556  case 1:
1557  {
1558  // automatic padding to minimum CU size
1559  Int minCuSize = m_uiMaxCUHeight >> (m_uiMaxCUDepth - 1);
1560  if (m_iSourceWidth % minCuSize)
1561  {
1562  m_aiPad[0] = m_confWinRight = ((m_iSourceWidth / minCuSize) + 1) * minCuSize - m_iSourceWidth;
1563  m_iSourceWidth += m_confWinRight;
1564  }
1565  if (m_iSourceHeight % minCuSize)
1566  {
1567  m_aiPad[1] = m_confWinBottom = ((m_iSourceHeight / minCuSize) + 1) * minCuSize - m_iSourceHeight;
1568  m_iSourceHeight += m_confWinBottom;
1569  if ( m_isField )
1570  {
1572  m_aiPad[1] = m_confWinBottom << 1;
1573  }
1574  }
1576  {
1577  fprintf(stderr, "Error: picture width is not an integer multiple of the specified chroma subsampling\n");
1578  exit(EXIT_FAILURE);
1579  }
1581  {
1582  fprintf(stderr, "Error: picture height is not an integer multiple of the specified chroma subsampling\n");
1583  exit(EXIT_FAILURE);
1584  }
1585  break;
1586  }
1587  case 2:
1588  {
1589  //padding
1590  m_iSourceWidth += m_aiPad[0];
1591  m_iSourceHeight += m_aiPad[1];
1592  m_confWinRight = m_aiPad[0];
1593  m_confWinBottom = m_aiPad[1];
1594  break;
1595  }
1596  case 3:
1597  {
1598  // conformance
1599  if ((m_confWinLeft == 0) && (m_confWinRight == 0) && (m_confWinTop == 0) && (m_confWinBottom == 0))
1600  {
1601  fprintf(stderr, "Warning: Conformance window enabled, but all conformance window parameters set to zero\n");
1602  }
1603  if ((m_aiPad[1] != 0) || (m_aiPad[0]!=0))
1604  {
1605  fprintf(stderr, "Warning: Conformance window enabled, padding parameters will be ignored\n");
1606  }
1607  m_aiPad[1] = m_aiPad[0] = 0;
1608  break;
1609  }
1610  }
1611 
1612  if (tmpSliceMode<0 || tmpSliceMode>=Int(NUMBER_OF_SLICE_CONSTRAINT_MODES))
1613  {
1614  fprintf(stderr, "Error: bad slice mode\n");
1615  exit(EXIT_FAILURE);
1616  }
1617  m_sliceMode = SliceConstraint(tmpSliceMode);
1618  if (tmpSliceSegmentMode<0 || tmpSliceSegmentMode>=Int(NUMBER_OF_SLICE_CONSTRAINT_MODES))
1619  {
1620  fprintf(stderr, "Error: bad slice segment mode\n");
1621  exit(EXIT_FAILURE);
1622  }
1623  m_sliceSegmentMode = SliceConstraint(tmpSliceSegmentMode);
1624 
1625  if (tmpDecodedPictureHashSEIMappedType<0 || tmpDecodedPictureHashSEIMappedType>=Int(NUMBER_OF_HASHTYPES))
1626  {
1627  fprintf(stderr, "Error: bad checksum mode\n");
1628  exit(EXIT_FAILURE);
1629  }
1630  // Need to map values to match those of the SEI message:
1631  if (tmpDecodedPictureHashSEIMappedType==0)
1632  {
1634  }
1635  else
1636  {
1637  m_decodedPictureHashSEIType=HashType(tmpDecodedPictureHashSEIMappedType-1);
1638  }
1639 
1640  // allocate slice-based dQP values
1641  m_aidQP = new Int[ m_framesToBeEncoded + m_iGOPSize + 1 ];
1642  ::memset( m_aidQP, 0, sizeof(Int)*( m_framesToBeEncoded + m_iGOPSize + 1 ) );
1643 
1644 #if JVET_E0059_FLOATING_POINT_QP_FIX
1646  {
1647  UInt switchingPOC=0;
1649  {
1650  // if switch source frame (ssf) = 10, and frame skip (fs)=2 and temporal subsample ratio (tsr) =1, then
1651  // for this simulation switch at POC 8 (=10-2).
1652  // if ssf=10, fs=2, tsr=2, then for this simulation, switch at POC 4 (=(10-2)/2): POC0=Src2, POC1=Src4, POC2=Src6, POC3=Src8, POC4=Src10
1654  }
1655  for(UInt i=switchingPOC; i<( m_framesToBeEncoded + m_iGOPSize + 1 ); i++)
1656  {
1657  m_aidQP[i]=1;
1658  }
1659  }
1660 #else
1661  // handling of floating-point QP values
1662  // if QP is not integer, sequence is split into two sections having QP and QP+1
1663  m_iQP = (Int)( m_fQP );
1664  if ( m_iQP < m_fQP )
1665  {
1666  Int iSwitchPOC = (Int)( m_framesToBeEncoded - (m_fQP - m_iQP)*m_framesToBeEncoded + 0.5 );
1667 
1668  iSwitchPOC = (Int)( (Double)iSwitchPOC / m_iGOPSize + 0.5 )*m_iGOPSize;
1669  for ( Int i=iSwitchPOC; i<m_framesToBeEncoded + m_iGOPSize + 1; i++ )
1670  {
1671  m_aidQP[i] = 1;
1672  }
1673  }
1674 #endif
1675 
1676  for(UInt ch=0; ch<MAX_NUM_CHANNEL_TYPE; ch++)
1677  {
1678  if (saoOffsetBitShift[ch]<0)
1679  {
1680  if (m_internalBitDepth[ch]>10)
1681  {
1682  m_log2SaoOffsetScale[ch]=UInt(Clip3<Int>(0, m_internalBitDepth[ch]-10, Int(m_internalBitDepth[ch]-10 + 0.165*m_iQP - 3.22 + 0.5) ) );
1683  }
1684  else
1685  {
1686  m_log2SaoOffsetScale[ch]=0;
1687  }
1688  }
1689  else
1690  {
1691  m_log2SaoOffsetScale[ch]=UInt(saoOffsetBitShift[ch]);
1692  }
1693  }
1694 
1695  assert(lumaLevelToDeltaQPMode<LUMALVL_TO_DQP_NUM_MODES);
1696  if (lumaLevelToDeltaQPMode>=LUMALVL_TO_DQP_NUM_MODES)
1697  {
1698  exit(EXIT_FAILURE);
1699  }
1700  m_lumaLevelToDeltaQPMapping.mode=LumaLevelToDQPMode(lumaLevelToDeltaQPMode);
1701 
1703  {
1704  assert( cfg_lumaLeveltoDQPMappingLuma.values.size() == cfg_lumaLeveltoDQPMappingQP.values.size() );
1705  m_lumaLevelToDeltaQPMapping.mapping.resize(cfg_lumaLeveltoDQPMappingLuma.values.size());
1706  for(UInt i=0; i<cfg_lumaLeveltoDQPMappingLuma.values.size(); i++)
1707  {
1708  m_lumaLevelToDeltaQPMapping.mapping[i]=std::pair<Int,Int>(cfg_lumaLeveltoDQPMappingLuma.values[i], cfg_lumaLeveltoDQPMappingQP.values[i]);
1709  }
1710  }
1711 
1712  // reading external dQP description from file
1713  if ( !m_dQPFileName.empty() )
1714  {
1715  FILE* fpt=fopen( m_dQPFileName.c_str(), "r" );
1716  if ( fpt )
1717  {
1718  Int iValue;
1719  Int iPOC = 0;
1720  while ( iPOC < m_framesToBeEncoded )
1721  {
1722  if ( fscanf(fpt, "%d", &iValue ) == EOF )
1723  {
1724  break;
1725  }
1726  m_aidQP[ iPOC ] = iValue;
1727  iPOC++;
1728  }
1729  fclose(fpt);
1730  }
1731  }
1732 
1734  {
1735  for(UInt idx=0; idx<6; idx++)
1736  {
1737  m_masteringDisplay.primaries[idx/2][idx%2] = UShort((cfg_DisplayPrimariesCode.values.size() > idx) ? cfg_DisplayPrimariesCode.values[idx] : 0);
1738  }
1739  for(UInt idx=0; idx<2; idx++)
1740  {
1741  m_masteringDisplay.whitePoint[idx] = UShort((cfg_DisplayWhitePointCode.values.size() > idx) ? cfg_DisplayWhitePointCode.values[idx] : 0);
1742  }
1743  }
1744 
1746  {
1747  if( m_toneMapModelId == 2 && !cfg_startOfCodedInterval.values.empty() )
1748  {
1749  const UInt num = 1u<< m_toneMapTargetBitDepth;
1750  m_startOfCodedInterval = new Int[num];
1751  for(UInt i=0; i<num; i++)
1752  {
1753  m_startOfCodedInterval[i] = cfg_startOfCodedInterval.values.size() > i ? cfg_startOfCodedInterval.values[i] : 0;
1754  }
1755  }
1756  else
1757  {
1759  }
1760  if( ( m_toneMapModelId == 3 ) && ( m_numPivots > 0 ) )
1761  {
1762  if( !cfg_codedPivotValue.values.empty() && !cfg_targetPivotValue.values.empty() )
1763  {
1766  for(UInt i=0; i<m_numPivots; i++)
1767  {
1768  m_codedPivotValue[i] = cfg_codedPivotValue.values.size() > i ? cfg_codedPivotValue.values [i] : 0;
1769  m_targetPivotValue[i] = cfg_targetPivotValue.values.size() > i ? cfg_targetPivotValue.values[i] : 0;
1770  }
1771  }
1772  }
1773  else
1774  {
1777  }
1778  }
1779 
1781  {
1782  assert ( cfg_kneeSEINumKneePointsMinus1 >= 0 && cfg_kneeSEINumKneePointsMinus1 < 999 );
1783  m_kneeFunctionInformationSEI.m_kneeSEIKneePointPairs.resize(cfg_kneeSEINumKneePointsMinus1+1);
1784  for(Int i=0; i<(cfg_kneeSEINumKneePointsMinus1+1); i++)
1785  {
1787  kpp.inputKneePoint = cfg_kneeSEIInputKneePointValue.values.size() > i ? cfg_kneeSEIInputKneePointValue.values[i] : 1;
1788  kpp.outputKneePoint = cfg_kneeSEIOutputKneePointValue.values.size() > i ? cfg_kneeSEIOutputKneePointValue.values[i] : 0;
1789  }
1790  }
1791 
1792 #if ERP_SR_OV_SEI_MESSAGE
1794  {
1801  for(Int i=0; i<(m_omniViewportSEICntMinus1+1); i++)
1802  {
1803  m_omniViewportSEIAzimuthCentre[i] = cfg_omniViewportSEIAzimuthCentre .values.size() > i ? cfg_omniViewportSEIAzimuthCentre .values[i] : 0;
1804  m_omniViewportSEIElevationCentre[i] = cfg_omniViewportSEIElevationCentre.values.size() > i ? cfg_omniViewportSEIElevationCentre.values[i] : 0;
1805  m_omniViewportSEITiltCentre[i] = cfg_omniViewportSEITiltCentre .values.size() > i ? cfg_omniViewportSEITiltCentre .values[i] : 0;
1806  m_omniViewportSEIHorRange[i] = cfg_omniViewportSEIHorRange .values.size() > i ? cfg_omniViewportSEIHorRange .values[i] : 0;
1807  m_omniViewportSEIVerRange[i] = cfg_omniViewportSEIVerRange .values.size() > i ? cfg_omniViewportSEIVerRange .values[i] : 0;
1808  }
1809  }
1810 #endif
1811 
1812 #if RWP_SEI_MESSAGE
1814  {
1815  assert ( m_rwpSEINumPackedRegions > 0 && m_rwpSEINumPackedRegions <= std::numeric_limits<UChar>::max() );
1816  assert (cfg_rwpSEIRwpTransformType.values.size() == m_rwpSEINumPackedRegions && cfg_rwpSEIRwpGuardBandFlag.values.size() == m_rwpSEINumPackedRegions && cfg_rwpSEIProjRegionWidth.values.size() == m_rwpSEINumPackedRegions &&
1817  cfg_rwpSEIProjRegionHeight.values.size() == m_rwpSEINumPackedRegions && cfg_rwpSEIRwpSEIProjRegionTop.values.size() == m_rwpSEINumPackedRegions && cfg_rwpSEIProjRegionLeft.values.size() == m_rwpSEINumPackedRegions &&
1818  cfg_rwpSEIPackedRegionWidth.values.size() == m_rwpSEINumPackedRegions && cfg_rwpSEIPackedRegionHeight.values.size() == m_rwpSEINumPackedRegions && cfg_rwpSEIPackedRegionTop.values.size() == m_rwpSEINumPackedRegions &&
1819  cfg_rwpSEIPackedRegionLeft.values.size() == m_rwpSEINumPackedRegions);
1836  for( Int i=0; i < m_rwpSEINumPackedRegions; i++ )
1837  {
1838  m_rwpSEIRwpTransformType[i] = cfg_rwpSEIRwpTransformType.values[i];
1839  assert ( m_rwpSEIRwpTransformType[i] >= 0 && m_rwpSEIRwpTransformType[i] <= 7 );
1840  m_rwpSEIRwpGuardBandFlag[i] = cfg_rwpSEIRwpGuardBandFlag.values[i];
1841  m_rwpSEIProjRegionWidth[i] = cfg_rwpSEIProjRegionWidth.values[i];
1842  m_rwpSEIProjRegionHeight[i] = cfg_rwpSEIProjRegionHeight.values[i];
1843  m_rwpSEIRwpSEIProjRegionTop[i] = cfg_rwpSEIRwpSEIProjRegionTop.values[i];
1844  m_rwpSEIProjRegionLeft[i] = cfg_rwpSEIProjRegionLeft.values[i];
1845  m_rwpSEIPackedRegionWidth[i] = cfg_rwpSEIPackedRegionWidth.values[i];
1846  m_rwpSEIPackedRegionHeight[i] = cfg_rwpSEIPackedRegionHeight.values[i];
1847  m_rwpSEIPackedRegionTop[i] = cfg_rwpSEIPackedRegionTop.values[i];
1848  m_rwpSEIPackedRegionLeft[i] = cfg_rwpSEIPackedRegionLeft.values[i];
1849  if( m_rwpSEIRwpGuardBandFlag[i] )
1850  {
1851  m_rwpSEIRwpLeftGuardBandWidth[i] = cfg_rwpSEIRwpLeftGuardBandWidth.values[i];
1852  m_rwpSEIRwpRightGuardBandWidth[i] = cfg_rwpSEIRwpRightGuardBandWidth.values[i];
1853  m_rwpSEIRwpTopGuardBandHeight[i] = cfg_rwpSEIRwpTopGuardBandHeight.values[i];
1854  m_rwpSEIRwpBottomGuardBandHeight[i] = cfg_rwpSEIRwpBottomGuardBandHeight.values[i];
1856  m_rwpSEIRwpGuardBandNotUsedForPredFlag[i] = cfg_rwpSEIRwpGuardBandNotUsedForPredFlag.values[i];
1857  for( Int j=0; j < 4; j++ )
1858  {
1859  m_rwpSEIRwpGuardBandType[i*4 + j] = cfg_rwpSEIRwpGuardBandType.values[i*4 + j];
1860  }
1861 
1862  }
1863  }
1864  }
1865 #endif
1867  {
1868  for(Int i = 0; i < m_timeCodeSEINumTs && i < MAX_TIMECODE_SEI_SETS; i++)
1869  {
1870  m_timeSetArray[i].clockTimeStampFlag = cfg_timeCodeSeiTimeStampFlag .values.size()>i ? cfg_timeCodeSeiTimeStampFlag .values [i] : false;
1871  m_timeSetArray[i].numUnitFieldBasedFlag = cfg_timeCodeSeiNumUnitFieldBasedFlag.values.size()>i ? cfg_timeCodeSeiNumUnitFieldBasedFlag.values [i] : 0;
1872  m_timeSetArray[i].countingType = cfg_timeCodeSeiCountingType .values.size()>i ? cfg_timeCodeSeiCountingType .values [i] : 0;
1873  m_timeSetArray[i].fullTimeStampFlag = cfg_timeCodeSeiFullTimeStampFlag .values.size()>i ? cfg_timeCodeSeiFullTimeStampFlag .values [i] : 0;
1874  m_timeSetArray[i].discontinuityFlag = cfg_timeCodeSeiDiscontinuityFlag .values.size()>i ? cfg_timeCodeSeiDiscontinuityFlag .values [i] : 0;
1875  m_timeSetArray[i].cntDroppedFlag = cfg_timeCodeSeiCntDroppedFlag .values.size()>i ? cfg_timeCodeSeiCntDroppedFlag .values [i] : 0;
1876  m_timeSetArray[i].numberOfFrames = cfg_timeCodeSeiNumberOfFrames .values.size()>i ? cfg_timeCodeSeiNumberOfFrames .values [i] : 0;
1877  m_timeSetArray[i].secondsValue = cfg_timeCodeSeiSecondsValue .values.size()>i ? cfg_timeCodeSeiSecondsValue .values [i] : 0;
1878  m_timeSetArray[i].minutesValue = cfg_timeCodeSeiMinutesValue .values.size()>i ? cfg_timeCodeSeiMinutesValue .values [i] : 0;
1879  m_timeSetArray[i].hoursValue = cfg_timeCodeSeiHoursValue .values.size()>i ? cfg_timeCodeSeiHoursValue .values [i] : 0;
1880  m_timeSetArray[i].secondsFlag = cfg_timeCodeSeiSecondsFlag .values.size()>i ? cfg_timeCodeSeiSecondsFlag .values [i] : 0;
1881  m_timeSetArray[i].minutesFlag = cfg_timeCodeSeiMinutesFlag .values.size()>i ? cfg_timeCodeSeiMinutesFlag .values [i] : 0;
1882  m_timeSetArray[i].hoursFlag = cfg_timeCodeSeiHoursFlag .values.size()>i ? cfg_timeCodeSeiHoursFlag .values [i] : 0;
1883  m_timeSetArray[i].timeOffsetLength = cfg_timeCodeSeiTimeOffsetLength .values.size()>i ? cfg_timeCodeSeiTimeOffsetLength .values [i] : 0;
1884  m_timeSetArray[i].timeOffsetValue = cfg_timeCodeSeiTimeOffsetValue .values.size()>i ? cfg_timeCodeSeiTimeOffsetValue .values [i] : 0;
1885  }
1886  }
1887 
1888  // check validity of input parameters
1889  xCheckParameter();
1890 
1891  // compute actual CU depth with respect to config depth and max transform size
1892  UInt uiAddCUDepth = 0;
1893  while( (m_uiMaxCUWidth>>m_uiMaxCUDepth) > ( 1 << ( m_uiQuadtreeTULog2MinSize + uiAddCUDepth ) ) )
1894  {
1895  uiAddCUDepth++;
1896  }
1897 
1898  m_uiMaxTotalCUDepth = m_uiMaxCUDepth + uiAddCUDepth + getMaxCUDepthOffset(m_chromaFormatIDC, m_uiQuadtreeTULog2MinSize); // if minimum TU larger than 4x4, allow for additional part indices for 4:2:2 SubTUs.
1900 
1901  // print-out parameters
1902  xPrintParameter();
1903 
1904  return true;
1905 }
1906 
1907 
1908 // ====================================================================================================================
1909 // Private member functions
1910 // ====================================================================================================================
1911 
1913 {
1915  {
1916  fprintf(stderr, "******************************************************************\n");
1917  fprintf(stderr, "** WARNING: --SEIDecodedPictureHash is now disabled by default. **\n");
1918  fprintf(stderr, "** Automatic verification of decoded pictures by a **\n");
1919  fprintf(stderr, "** decoder requires this option to be enabled. **\n");
1920  fprintf(stderr, "******************************************************************\n");
1921  }
1922  if( m_profile==Profile::NONE )
1923  {
1924  fprintf(stderr, "***************************************************************************\n");
1925  fprintf(stderr, "** WARNING: For conforming bitstreams a valid Profile value must be set! **\n");
1926  fprintf(stderr, "***************************************************************************\n");
1927  }
1928  if( m_level==Level::NONE )
1929  {
1930  fprintf(stderr, "***************************************************************************\n");
1931  fprintf(stderr, "** WARNING: For conforming bitstreams a valid Level value must be set! **\n");
1932  fprintf(stderr, "***************************************************************************\n");
1933  }
1934 
1935  Bool check_failed = false; /* abort if there is a fatal configuration problem */
1936 #define xConfirmPara(a,b) check_failed |= confirmPara(a,b)
1937 
1938  xConfirmPara(m_bitstreamFileName.empty(), "A bitstream file name must be specified (BitstreamFile)");
1940  xConfirmPara(m_bitDepthConstraint<maxBitDepth, "The internalBitDepth must not be greater than the bitDepthConstraint value");
1941  xConfirmPara(m_chromaFormatConstraint<m_chromaFormatIDC, "The chroma format used must not be greater than the chromaFormatConstraint value");
1942 
1943  switch (m_profile)
1944  {
1945  case Profile::MAINREXT:
1947  {
1948  xConfirmPara(m_lowerBitRateConstraintFlag==false && m_intraConstraintFlag==false, "The lowerBitRateConstraint flag cannot be false when intraConstraintFlag is false");
1949  xConfirmPara(m_cabacBypassAlignmentEnabledFlag && m_profile!=Profile::HIGHTHROUGHPUTREXT, "AlignCABACBeforeBypass must not be enabled unless the high throughput profile is being used.");
1951  {
1952  const UInt intraIdx = m_intraConstraintFlag ? 1:0;
1953  const UInt bitDepthIdx = (m_bitDepthConstraint == 8 ? 0 : (m_bitDepthConstraint ==10 ? 1 : (m_bitDepthConstraint == 12 ? 2 : (m_bitDepthConstraint == 16 ? 3 : 4 ))));
1954  const UInt chromaFormatIdx = UInt(m_chromaFormatConstraint);
1955  const Bool bValidProfile = (bitDepthIdx > 3 || chromaFormatIdx>3) ? false : (validRExtProfileNames[intraIdx][bitDepthIdx][chromaFormatIdx] != UI_NONE);
1956  xConfirmPara(!bValidProfile, "Invalid intra constraint flag, bit depth constraint flag and chroma format constraint flag combination for a RExt profile");
1957  const Bool bUsingGeneralRExtTools = m_transformSkipRotationEnabledFlag ||
1964  const Bool bUsingChromaQPTool = m_diffCuChromaQpOffsetDepth >= 0;
1965  const Bool bUsingExtendedPrecision = m_extendedPrecisionProcessingFlag;
1966 
1967  xConfirmPara((m_chromaFormatConstraint==CHROMA_420 || m_chromaFormatConstraint==CHROMA_400) && bUsingChromaQPTool, "CU Chroma QP adjustment cannot be used for 4:0:0 or 4:2:0 RExt profiles");
1968  xConfirmPara(m_bitDepthConstraint != 16 && bUsingExtendedPrecision, "Extended precision can only be used in 16-bit RExt profiles");
1970  {
1971  xConfirmPara(bUsingGeneralRExtTools, "Combination of tools and profiles are not possible in the specified RExt profile.");
1972  }
1973  xConfirmPara( m_onePictureOnlyConstraintFlag && m_chromaFormatConstraint!=CHROMA_444, "chroma format constraint must be 4:4:4 when one-picture-only constraint flag is 1");
1974  xConfirmPara( m_onePictureOnlyConstraintFlag && m_bitDepthConstraint != 8 && m_bitDepthConstraint != 16, "bit depth constraint must be 8 or 16 when one-picture-only constraint flag is 1");
1975  xConfirmPara( m_onePictureOnlyConstraintFlag && m_framesToBeEncoded > 1, "Number of frames to be encoded must be 1 when one-picture-only constraint flag is 1.");
1976 
1978  {
1979  fprintf(stderr, "********************************************************************************************************\n");
1980  fprintf(stderr, "** WARNING: The RExt constraint flags describe a non standard combination (used for development only) **\n");
1981  fprintf(stderr, "********************************************************************************************************\n");
1982  }
1983  }
1984  else
1985  {
1986  xConfirmPara( m_chromaFormatConstraint != CHROMA_444, "chroma format constraint must be 4:4:4 in the High Throughput 4:4:4 16-bit Intra profile.");
1987  const UInt intraIdx = m_intraConstraintFlag ? 1:0;
1988  const UInt bitDepthIdx = (m_bitDepthConstraint == 8 ? 0 : (m_bitDepthConstraint ==10 ? 1 : (m_bitDepthConstraint == 14 ? 2 : (m_bitDepthConstraint == 16 ? 3 : 4 ))));
1989  const Bool bValidProfile = (bitDepthIdx > 3) ? false : (validRExtHighThroughPutProfileNames[intraIdx][bitDepthIdx] != UI_NONE);
1990  xConfirmPara(!bValidProfile, "Invalid intra constraint flag and bit depth constraint flag combination for a RExt high profile throughput profile");
1991  if(bitDepthIdx < 2)
1992  {
1993  xConfirmPara((m_extendedPrecisionProcessingFlag || m_cabacBypassAlignmentEnabledFlag), "Invalid configuration for a RExt high throughput 8 and 10 bit profile");
1994  }
1995  if(bitDepthIdx == 3)
1996  {
1997  xConfirmPara(!m_cabacBypassAlignmentEnabledFlag, "Cabac Bypass Alignment flag must be 1 in the High Throughput 4:4:4 16-bit Intra profile");
1998  }
1999  else if(bitDepthIdx < 3)
2000  {
2001  xConfirmPara(!m_entropyCodingSyncEnabledFlag, "WPP flag must be 1 in the High Throughput 4:4:4 non 16-bit Intra profile");
2002  }
2003  }
2004  }
2005  break;
2006  case Profile::MAIN:
2007  case Profile::MAIN10:
2009  {
2010  xConfirmPara(m_bitDepthConstraint!=((m_profile==Profile::MAIN10)?10:8), "BitDepthConstraint must be 8 for MAIN profile and 10 for MAIN10 profile.");
2011  xConfirmPara(m_chromaFormatConstraint!=CHROMA_420, "ChromaFormatConstraint must be 420 for non main-RExt profiles.");
2012  xConfirmPara(m_intraConstraintFlag==true, "IntraConstraintFlag must be false for non main_RExt profiles.");
2013  xConfirmPara(m_lowerBitRateConstraintFlag==false, "LowerBitrateConstraintFlag must be true for non main-RExt profiles.");
2014  xConfirmPara(m_profile == Profile::MAINSTILLPICTURE && m_framesToBeEncoded > 1, "Number of frames to be encoded must be 1 when main still picture profile is used.");
2015 
2016  xConfirmPara(m_crossComponentPredictionEnabledFlag==true, "CrossComponentPrediction must not be used for non main-RExt profiles.");
2017  xConfirmPara(m_log2MaxTransformSkipBlockSize!=2, "Transform Skip Log2 Max Size must be 2 for V1 profiles.");
2018  xConfirmPara(m_transformSkipRotationEnabledFlag==true, "UseResidualRotation must not be enabled for non main-RExt profiles.");
2019  xConfirmPara(m_transformSkipContextEnabledFlag==true, "UseSingleSignificanceMapContext must not be enabled for non main-RExt profiles.");
2020  xConfirmPara(m_rdpcmEnabledFlag[RDPCM_SIGNAL_IMPLICIT]==true, "ImplicitResidualDPCM must not be enabled for non main-RExt profiles.");
2021  xConfirmPara(m_rdpcmEnabledFlag[RDPCM_SIGNAL_EXPLICIT]==true, "ExplicitResidualDPCM must not be enabled for non main-RExt profiles.");
2022  xConfirmPara(m_persistentRiceAdaptationEnabledFlag==true, "GolombRiceParameterAdaption must not be enabled for non main-RExt profiles.");
2023  xConfirmPara(m_extendedPrecisionProcessingFlag==true, "UseExtendedPrecision must not be enabled for non main-RExt profiles.");
2024  xConfirmPara(m_highPrecisionOffsetsEnabledFlag==true, "UseHighPrecisionPredictionWeighting must not be enabled for non main-RExt profiles.");
2025  xConfirmPara(m_enableIntraReferenceSmoothing==false, "EnableIntraReferenceSmoothing must be enabled for non main-RExt profiles.");
2026  xConfirmPara(m_cabacBypassAlignmentEnabledFlag, "AlignCABACBeforeBypass cannot be enabled for non main-RExt profiles.");
2027  }
2028  break;
2029  case Profile::NONE:
2030  // Non-conforming configuration, so all settings are valid.
2031  break;
2032  default:
2033  xConfirmPara( 1, "Unknown profile selected.");
2034  break;
2035  }
2036 
2037  // check range of parameters
2038  xConfirmPara( m_inputBitDepth[CHANNEL_TYPE_LUMA ] < 8, "InputBitDepth must be at least 8" );
2039  xConfirmPara( m_inputBitDepth[CHANNEL_TYPE_CHROMA] < 8, "InputBitDepthC must be at least 8" );
2040 
2041 #if !RExt__HIGH_BIT_DEPTH_SUPPORT
2043  {
2044  for (UInt channelType = 0; channelType < MAX_NUM_CHANNEL_TYPE; channelType++)
2045  {
2046  xConfirmPara((m_internalBitDepth[channelType] > 8) , "Model is not configured to support high enough internal accuracies - enable RExt__HIGH_BIT_DEPTH_SUPPORT to use increased precision internal data types etc...");
2047  }
2048  }
2049  else
2050  {
2051  for (UInt channelType = 0; channelType < MAX_NUM_CHANNEL_TYPE; channelType++)
2052  {
2053  xConfirmPara((m_internalBitDepth[channelType] > 12) , "Model is not configured to support high enough internal accuracies - enable RExt__HIGH_BIT_DEPTH_SUPPORT to use increased precision internal data types etc...");
2054  }
2055  }
2056 #endif
2057 
2058  xConfirmPara( (m_MSBExtendedBitDepth[CHANNEL_TYPE_LUMA ] < m_inputBitDepth[CHANNEL_TYPE_LUMA ]), "MSB-extended bit depth for luma channel (--MSBExtendedBitDepth) must be greater than or equal to input bit depth for luma channel (--InputBitDepth)" );
2059  xConfirmPara( (m_MSBExtendedBitDepth[CHANNEL_TYPE_CHROMA] < m_inputBitDepth[CHANNEL_TYPE_CHROMA]), "MSB-extended bit depth for chroma channel (--MSBExtendedBitDepthC) must be greater than or equal to input bit depth for chroma channel (--InputBitDepthC)" );
2060 
2061  xConfirmPara( m_log2SaoOffsetScale[CHANNEL_TYPE_LUMA] > (m_internalBitDepth[CHANNEL_TYPE_LUMA ]<10?0:(m_internalBitDepth[CHANNEL_TYPE_LUMA ]-10)), "SaoLumaOffsetBitShift must be in the range of 0 to InternalBitDepth-10, inclusive");
2062  xConfirmPara( m_log2SaoOffsetScale[CHANNEL_TYPE_CHROMA] > (m_internalBitDepth[CHANNEL_TYPE_CHROMA]<10?0:(m_internalBitDepth[CHANNEL_TYPE_CHROMA]-10)), "SaoChromaOffsetBitShift must be in the range of 0 to InternalBitDepthC-10, inclusive");
2063 
2064  xConfirmPara( m_chromaFormatIDC >= NUM_CHROMA_FORMAT, "ChromaFormatIDC must be either 400, 420, 422 or 444" );
2065  std::string sTempIPCSC="InputColourSpaceConvert must be empty, "+getListOfColourSpaceConverts(true);
2067  xConfirmPara( m_InputChromaFormatIDC >= NUM_CHROMA_FORMAT, "InputChromaFormatIDC must be either 400, 420, 422 or 444" );
2068  xConfirmPara( m_iFrameRate <= 0, "Frame rate must be more than 1" );
2069  xConfirmPara( m_temporalSubsampleRatio < 1, "Temporal subsample rate must be no less than 1" );
2070  xConfirmPara( m_framesToBeEncoded <= 0, "Total Number Of Frames encoded must be more than 0" );
2071  xConfirmPara( m_iGOPSize < 1 , "GOP Size must be greater or equal to 1" );
2072  xConfirmPara( m_iGOPSize > 1 && m_iGOPSize % 2, "GOP Size must be a multiple of 2, if GOP Size is greater than 1" );
2073  xConfirmPara( (m_iIntraPeriod > 0 && m_iIntraPeriod < m_iGOPSize) || m_iIntraPeriod == 0, "Intra period must be more than GOP size, or -1 , not 0" );
2074  xConfirmPara( m_iDecodingRefreshType < 0 || m_iDecodingRefreshType > 3, "Decoding Refresh Type must be comprised between 0 and 3 included" );
2075  if(m_iDecodingRefreshType == 3)
2076  {
2077  xConfirmPara( !m_recoveryPointSEIEnabled, "When using RecoveryPointSEI messages as RA points, recoveryPointSEI must be enabled" );
2078  }
2079 
2080  if (m_isField)
2081  {
2083  {
2084  fprintf(stderr, "****************************************************************************\n");
2085  fprintf(stderr, "** WARNING: Picture Timing SEI should be enabled for field coding! **\n");
2086  fprintf(stderr, "****************************************************************************\n");
2087  }
2088  }
2089 
2091  {
2092  fprintf(stderr, "****************************************************************************\n");
2093  fprintf(stderr, "** WARNING: Cross-component prediction is specified for 4:4:4 format only **\n");
2094  fprintf(stderr, "****************************************************************************\n");
2095 
2097  }
2098 
2100  {
2101  fprintf(stderr, "****************************************************************************\n");
2102  fprintf(stderr, "** WARNING: --HadamardME has been disabled due to the enabling of **\n");
2103  fprintf(stderr, "** --CUTransquantBypassFlagForce **\n");
2104  fprintf(stderr, "****************************************************************************\n");
2105 
2106  m_bUseHADME = false; // this has been disabled so that the lambda is calculated slightly differently for lossless modes (as a result of JCTVC-R0104).
2107  }
2108 
2109  xConfirmPara (m_log2MaxTransformSkipBlockSize < 2, "Transform Skip Log2 Max Size must be at least 2 (4x4)");
2110 
2112  {
2113  fprintf(stderr, "***************************************************************************\n");
2114  fprintf(stderr, "** WARNING: Transform skip fast is enabled (which only tests NxN splits),**\n");
2115  fprintf(stderr, "** but transform skip log2 max size is not 2 (4x4) **\n");
2116  fprintf(stderr, "** It may be better to disable transform skip fast mode **\n");
2117  fprintf(stderr, "***************************************************************************\n");
2118  }
2119 
2120  xConfirmPara( m_iQP < -6 * (m_internalBitDepth[CHANNEL_TYPE_LUMA] - 8) || m_iQP > 51, "QP exceeds supported range (-QpBDOffsety to 51)" );
2121  xConfirmPara( m_deblockingFilterMetric!=0 && (m_bLoopFilterDisable || m_loopFilterOffsetInPPS), "If DeblockingFilterMetric is non-zero then both LoopFilterDisable and LoopFilterOffsetInPPS must be 0");
2122  xConfirmPara( m_loopFilterBetaOffsetDiv2 < -6 || m_loopFilterBetaOffsetDiv2 > 6, "Loop Filter Beta Offset div. 2 exceeds supported range (-6 to 6)");
2123  xConfirmPara( m_loopFilterTcOffsetDiv2 < -6 || m_loopFilterTcOffsetDiv2 > 6, "Loop Filter Tc Offset div. 2 exceeds supported range (-6 to 6)");
2124  xConfirmPara( m_iSearchRange < 0 , "Search Range must be more than 0" );
2125  xConfirmPara( m_bipredSearchRange < 0 , "Bi-prediction refinement search range must be more than 0" );
2126  xConfirmPara( m_minSearchWindow < 0, "Minimum motion search window size for the adaptive window ME must be greater than or equal to 0" );
2127  xConfirmPara( m_iMaxDeltaQP > 7, "Absolute Delta QP exceeds supported range (0 to 7)" );
2128  xConfirmPara(m_lumaLevelToDeltaQPMapping.mode && m_uiDeltaQpRD > 0, "Luma-level-based Delta QP cannot be used together with slice level multiple-QP optimization\n" );
2129  xConfirmPara( m_iMaxCuDQPDepth > m_uiMaxCUDepth - 1, "Absolute depth for a minimum CuDQP exceeds maximum coding unit depth" );
2130 
2131  xConfirmPara( m_cbQpOffset < -12, "Min. Chroma Cb QP Offset is -12" );
2132  xConfirmPara( m_cbQpOffset > 12, "Max. Chroma Cb QP Offset is 12" );
2133  xConfirmPara( m_crQpOffset < -12, "Min. Chroma Cr QP Offset is -12" );
2134  xConfirmPara( m_crQpOffset > 12, "Max. Chroma Cr QP Offset is 12" );
2135 
2136  xConfirmPara( m_iQPAdaptationRange <= 0, "QP Adaptation Range must be more than 0" );
2137  if (m_iDecodingRefreshType == 2)
2138  {
2139  xConfirmPara( m_iIntraPeriod > 0 && m_iIntraPeriod <= m_iGOPSize , "Intra period must be larger than GOP size for periodic IDR pictures");
2140  }
2142  {
2143  xConfirmPara( m_iIntraPeriod > 0 && m_iIntraPeriod <= m_iGOPSize , "Intra period must be larger than GOP size when SAOResetEncoderStateAfterIRAP is enabled");
2144  }
2145  xConfirmPara( m_uiMaxCUDepth < 1, "MaxPartitionDepth must be greater than zero");
2146  xConfirmPara( (m_uiMaxCUWidth >> m_uiMaxCUDepth) < 4, "Minimum partition width size should be larger than or equal to 8");
2147  xConfirmPara( (m_uiMaxCUHeight >> m_uiMaxCUDepth) < 4, "Minimum partition height size should be larger than or equal to 8");
2148  xConfirmPara( m_uiMaxCUWidth < 16, "Maximum partition width size should be larger than or equal to 16");
2149  xConfirmPara( m_uiMaxCUHeight < 16, "Maximum partition height size should be larger than or equal to 16");
2150  xConfirmPara( (m_iSourceWidth % (m_uiMaxCUWidth >> (m_uiMaxCUDepth-1)))!=0, "Resulting coded frame width must be a multiple of the minimum CU size");
2151  xConfirmPara( (m_iSourceHeight % (m_uiMaxCUHeight >> (m_uiMaxCUDepth-1)))!=0, "Resulting coded frame height must be a multiple of the minimum CU size");
2152 
2153  xConfirmPara( m_uiQuadtreeTULog2MinSize < 2, "QuadtreeTULog2MinSize must be 2 or greater.");
2154  xConfirmPara( m_uiQuadtreeTULog2MaxSize > 5, "QuadtreeTULog2MaxSize must be 5 or smaller.");
2155  xConfirmPara( m_uiQuadtreeTULog2MaxSize < m_uiQuadtreeTULog2MinSize, "QuadtreeTULog2MaxSize must be greater than or equal to m_uiQuadtreeTULog2MinSize.");
2156  xConfirmPara( (1<<m_uiQuadtreeTULog2MaxSize) > m_uiMaxCUWidth, "QuadtreeTULog2MaxSize must be log2(maxCUSize) or smaller.");
2157  xConfirmPara( ( 1 << m_uiQuadtreeTULog2MinSize ) >= ( m_uiMaxCUWidth >> (m_uiMaxCUDepth-1)), "QuadtreeTULog2MinSize must not be greater than or equal to minimum CU size" );
2158  xConfirmPara( ( 1 << m_uiQuadtreeTULog2MinSize ) >= ( m_uiMaxCUHeight >> (m_uiMaxCUDepth-1)), "QuadtreeTULog2MinSize must not be greater than or equal to minimum CU size" );
2159  xConfirmPara( m_uiQuadtreeTUMaxDepthInter < 1, "QuadtreeTUMaxDepthInter must be greater than or equal to 1" );
2160  xConfirmPara( m_uiMaxCUWidth < ( 1 << (m_uiQuadtreeTULog2MinSize + m_uiQuadtreeTUMaxDepthInter - 1) ), "QuadtreeTUMaxDepthInter must be less than or equal to the difference between log2(maxCUSize) and QuadtreeTULog2MinSize plus 1" );
2161  xConfirmPara( m_uiQuadtreeTUMaxDepthIntra < 1, "QuadtreeTUMaxDepthIntra must be greater than or equal to 1" );
2162  xConfirmPara( m_uiMaxCUWidth < ( 1 << (m_uiQuadtreeTULog2MinSize + m_uiQuadtreeTUMaxDepthIntra - 1) ), "QuadtreeTUMaxDepthInter must be less than or equal to the difference between log2(maxCUSize) and QuadtreeTULog2MinSize plus 1" );
2163 
2164  xConfirmPara( m_maxNumMergeCand < 1, "MaxNumMergeCand must be 1 or greater.");
2165  xConfirmPara( m_maxNumMergeCand > 5, "MaxNumMergeCand must be 5 or smaller.");
2166 
2167 #if ADAPTIVE_QP_SELECTION
2168  xConfirmPara( m_bUseAdaptQpSelect == true && m_iQP < 0, "AdaptiveQpSelection must be disabled when QP < 0.");
2169  xConfirmPara( m_bUseAdaptQpSelect == true && (m_cbQpOffset !=0 || m_crQpOffset != 0 ), "AdaptiveQpSelection must be disabled when ChromaQpOffset is not equal to 0.");
2170 #endif
2171 
2172  if( m_usePCM)
2173  {
2174  for (UInt channelType = 0; channelType < MAX_NUM_CHANNEL_TYPE; channelType++)
2175  {
2176  xConfirmPara(((m_MSBExtendedBitDepth[channelType] > m_internalBitDepth[channelType]) && m_bPCMInputBitDepthFlag), "PCM bit depth cannot be greater than internal bit depth (PCMInputBitDepthFlag cannot be used when InputBitDepth or MSBExtendedBitDepth > InternalBitDepth)");
2177  }
2178  xConfirmPara( m_uiPCMLog2MinSize < 3, "PCMLog2MinSize must be 3 or greater.");
2179  xConfirmPara( m_uiPCMLog2MinSize > 5, "PCMLog2MinSize must be 5 or smaller.");
2180  xConfirmPara( m_pcmLog2MaxSize > 5, "PCMLog2MaxSize must be 5 or smaller.");
2181  xConfirmPara( m_pcmLog2MaxSize < m_uiPCMLog2MinSize, "PCMLog2MaxSize must be equal to or greater than m_uiPCMLog2MinSize.");
2182  }
2183 
2184  if (m_sliceMode!=NO_SLICES)
2185  {
2186  xConfirmPara( m_sliceArgument < 1 , "SliceArgument should be larger than or equal to 1" );
2187  }
2189  {
2190  xConfirmPara( m_sliceSegmentArgument < 1 , "SliceSegmentArgument should be larger than or equal to 1" );
2191  }
2192 
2193  Bool tileFlag = (m_numTileColumnsMinus1 > 0 || m_numTileRowsMinus1 > 0 );
2195  {
2196  xConfirmPara( tileFlag && m_entropyCodingSyncEnabledFlag, "Tiles and entropy-coding-sync (Wavefronts) can not be applied together, except in the High Throughput Intra 4:4:4 16 profile");
2197  }
2198 
2199  xConfirmPara( m_iSourceWidth % TComSPS::getWinUnitX(m_chromaFormatIDC) != 0, "Picture width must be an integer multiple of the specified chroma subsampling");
2200  xConfirmPara( m_iSourceHeight % TComSPS::getWinUnitY(m_chromaFormatIDC) != 0, "Picture height must be an integer multiple of the specified chroma subsampling");
2201 
2202  xConfirmPara( m_aiPad[0] % TComSPS::getWinUnitX(m_chromaFormatIDC) != 0, "Horizontal padding must be an integer multiple of the specified chroma subsampling");
2203  xConfirmPara( m_aiPad[1] % TComSPS::getWinUnitY(m_chromaFormatIDC) != 0, "Vertical padding must be an integer multiple of the specified chroma subsampling");
2204 
2205  xConfirmPara( m_confWinLeft % TComSPS::getWinUnitX(m_chromaFormatIDC) != 0, "Left conformance window offset must be an integer multiple of the specified chroma subsampling");
2206  xConfirmPara( m_confWinRight % TComSPS::getWinUnitX(m_chromaFormatIDC) != 0, "Right conformance window offset must be an integer multiple of the specified chroma subsampling");
2207  xConfirmPara( m_confWinTop % TComSPS::getWinUnitY(m_chromaFormatIDC) != 0, "Top conformance window offset must be an integer multiple of the specified chroma subsampling");
2208  xConfirmPara( m_confWinBottom % TComSPS::getWinUnitY(m_chromaFormatIDC) != 0, "Bottom conformance window offset must be an integer multiple of the specified chroma subsampling");
2209 
2210  xConfirmPara( m_defaultDisplayWindowFlag && !m_vuiParametersPresentFlag, "VUI needs to be enabled for default display window");
2211 
2213  {
2214  xConfirmPara( m_defDispWinLeftOffset % TComSPS::getWinUnitX(m_chromaFormatIDC) != 0, "Left default display window offset must be an integer multiple of the specified chroma subsampling");
2215  xConfirmPara( m_defDispWinRightOffset % TComSPS::getWinUnitX(m_chromaFormatIDC) != 0, "Right default display window offset must be an integer multiple of the specified chroma subsampling");
2216  xConfirmPara( m_defDispWinTopOffset % TComSPS::getWinUnitY(m_chromaFormatIDC) != 0, "Top default display window offset must be an integer multiple of the specified chroma subsampling");
2217  xConfirmPara( m_defDispWinBottomOffset % TComSPS::getWinUnitY(m_chromaFormatIDC) != 0, "Bottom default display window offset must be an integer multiple of the specified chroma subsampling");
2218  }
2219 
2220  // max CU width and height should be power of 2
2221  UInt ui = m_uiMaxCUWidth;
2222  while(ui)
2223  {
2224  ui >>= 1;
2225  if( (ui & 1) == 1)
2226  {
2227  xConfirmPara( ui != 1 , "Width should be 2^n");
2228  }
2229  }
2230  ui = m_uiMaxCUHeight;
2231  while(ui)
2232  {
2233  ui >>= 1;
2234  if( (ui & 1) == 1)
2235  {
2236  xConfirmPara( ui != 1 , "Height should be 2^n");
2237  }
2238  }
2239 
2240  /* if this is an intra-only sequence, ie IntraPeriod=1, don't verify the GOP structure
2241  * This permits the ability to omit a GOP structure specification */
2242  if (m_iIntraPeriod == 1 && m_GOPList[0].m_POC == -1)
2243  {
2244  m_GOPList[0] = GOPEntry();
2245  m_GOPList[0].m_QPFactor = 1;
2246  m_GOPList[0].m_betaOffsetDiv2 = 0;
2247  m_GOPList[0].m_tcOffsetDiv2 = 0;
2248  m_GOPList[0].m_POC = 1;
2250  }
2251  else
2252  {
2253  xConfirmPara( m_intraConstraintFlag, "IntraConstraintFlag cannot be 1 for inter sequences");
2254  }
2255 
2256  Bool verifiedGOP=false;
2257  Bool errorGOP=false;
2258  Int checkGOP=1;
2259  Int numRefs = m_isField ? 2 : 1;
2260  Int refList[MAX_NUM_REF_PICS+1];
2261  refList[0]=0;
2262  if(m_isField)
2263  {
2264  refList[1] = 1;
2265  }
2266  Bool isOK[MAX_GOP];
2267  for(Int i=0; i<MAX_GOP; i++)
2268  {
2269  isOK[i]=false;
2270  }
2271  Int numOK=0;
2272  xConfirmPara( m_iIntraPeriod >=0&&(m_iIntraPeriod%m_iGOPSize!=0), "Intra period must be a multiple of GOPSize, or -1" );
2273 
2274  for(Int i=0; i<m_iGOPSize; i++)
2275  {
2276  if(m_GOPList[i].m_POC==m_iGOPSize)
2277  {
2278  xConfirmPara( m_GOPList[i].m_temporalId!=0 , "The last frame in each GOP must have temporal ID = 0 " );
2279  }
2280  }
2281 
2283  {
2284  for(Int i=0; i<m_iGOPSize; i++)
2285  {
2286  xConfirmPara( (m_GOPList[i].m_betaOffsetDiv2 + m_loopFilterBetaOffsetDiv2) < -6 || (m_GOPList[i].m_betaOffsetDiv2 + m_loopFilterBetaOffsetDiv2) > 6, "Loop Filter Beta Offset div. 2 for one of the GOP entries exceeds supported range (-6 to 6)" );
2287  xConfirmPara( (m_GOPList[i].m_tcOffsetDiv2 + m_loopFilterTcOffsetDiv2) < -6 || (m_GOPList[i].m_tcOffsetDiv2 + m_loopFilterTcOffsetDiv2) > 6, "Loop Filter Tc Offset div. 2 for one of the GOP entries exceeds supported range (-6 to 6)" );
2288  }
2289  }
2290 
2291  for(Int i=0; i<m_iGOPSize; i++)
2292  {
2293  xConfirmPara( abs(m_GOPList[i].m_CbQPoffset ) > 12, "Cb QP Offset for one of the GOP entries exceeds supported range (-12 to 12)" );
2294  xConfirmPara( abs(m_GOPList[i].m_CbQPoffset + m_cbQpOffset) > 12, "Cb QP Offset for one of the GOP entries, when combined with the PPS Cb offset, exceeds supported range (-12 to 12)" );
2295  xConfirmPara( abs(m_GOPList[i].m_CrQPoffset ) > 12, "Cr QP Offset for one of the GOP entries exceeds supported range (-12 to 12)" );
2296  xConfirmPara( abs(m_GOPList[i].m_CrQPoffset + m_crQpOffset) > 12, "Cr QP Offset for one of the GOP entries, when combined with the PPS Cr offset, exceeds supported range (-12 to 12)" );
2297  }
2298  xConfirmPara( abs(m_sliceChromaQpOffsetIntraOrPeriodic[0] ) > 12, "Intra/periodic Cb QP Offset exceeds supported range (-12 to 12)" );
2299  xConfirmPara( abs(m_sliceChromaQpOffsetIntraOrPeriodic[0] + m_cbQpOffset ) > 12, "Intra/periodic Cb QP Offset, when combined with the PPS Cb offset, exceeds supported range (-12 to 12)" );
2300  xConfirmPara( abs(m_sliceChromaQpOffsetIntraOrPeriodic[1] ) > 12, "Intra/periodic Cr QP Offset exceeds supported range (-12 to 12)" );
2301  xConfirmPara( abs(m_sliceChromaQpOffsetIntraOrPeriodic[1] + m_crQpOffset ) > 12, "Intra/periodic Cr QP Offset, when combined with the PPS Cr offset, exceeds supported range (-12 to 12)" );
2302 
2303  m_extraRPSs=0;
2304  //start looping through frames in coding order until we can verify that the GOP structure is correct.
2305  while(!verifiedGOP&&!errorGOP)
2306  {
2307  Int curGOP = (checkGOP-1)%m_iGOPSize;
2308  Int curPOC = ((checkGOP-1)/m_iGOPSize)*m_iGOPSize + m_GOPList[curGOP].m_POC;
2309  if(m_GOPList[curGOP].m_POC<0)
2310  {
2311  printf("\nError: found fewer Reference Picture Sets than GOPSize\n");
2312  errorGOP=true;
2313  }
2314  else
2315  {
2316  //check that all reference pictures are available, or have a POC < 0 meaning they might be available in the next GOP.
2317  Bool beforeI = false;
2318  for(Int i = 0; i< m_GOPList[curGOP].m_numRefPics; i++)
2319  {
2320  Int absPOC = curPOC+m_GOPList[curGOP].m_referencePics[i];
2321  if(absPOC < 0)
2322  {
2323  beforeI=true;
2324  }
2325  else
2326  {
2327  Bool found=false;
2328  for(Int j=0; j<numRefs; j++)
2329  {
2330  if(refList[j]==absPOC)
2331  {
2332  found=true;
2333  for(Int k=0; k<m_iGOPSize; k++)
2334  {
2335  if(absPOC%m_iGOPSize == m_GOPList[k].m_POC%m_iGOPSize)
2336  {
2337  if(m_GOPList[k].m_temporalId==m_GOPList[curGOP].m_temporalId)
2338  {
2339  m_GOPList[k].m_refPic = true;
2340  }
2342  }
2343  }
2344  }
2345  }
2346  if(!found)
2347  {
2348  printf("\nError: ref pic %d is not available for GOP frame %d\n",m_GOPList[curGOP].m_referencePics[i],curGOP+1);
2349  errorGOP=true;
2350  }
2351  }
2352  }
2353  if(!beforeI&&!errorGOP)
2354  {
2355  //all ref frames were present
2356  if(!isOK[curGOP])
2357  {
2358  numOK++;
2359  isOK[curGOP]=true;
2360  if(numOK==m_iGOPSize)
2361  {
2362  verifiedGOP=true;
2363  }
2364  }
2365  }
2366  else
2367  {
2368  //create a new GOPEntry for this frame containing all the reference pictures that were available (POC > 0)
2369  m_GOPList[m_iGOPSize+m_extraRPSs]=m_GOPList[curGOP];
2370  Int newRefs=0;
2371  for(Int i = 0; i< m_GOPList[curGOP].m_numRefPics; i++)
2372  {
2373  Int absPOC = curPOC+m_GOPList[curGOP].m_referencePics[i];
2374  if(absPOC>=0)
2375  {
2376  m_GOPList[m_iGOPSize+m_extraRPSs].m_referencePics[newRefs]=m_GOPList[curGOP].m_referencePics[i];
2377  m_GOPList[m_iGOPSize+m_extraRPSs].m_usedByCurrPic[newRefs]=m_GOPList[curGOP].m_usedByCurrPic[i];
2378  newRefs++;
2379  }
2380  }
2381  Int numPrefRefs = m_GOPList[curGOP].m_numRefPicsActive;
2382 
2383  for(Int offset = -1; offset>-checkGOP; offset--)
2384  {
2385  //step backwards in coding order and include any extra available pictures we might find useful to replace the ones with POC < 0.
2386  Int offGOP = (checkGOP-1+offset)%m_iGOPSize;
2387  Int offPOC = ((checkGOP-1+offset)/m_iGOPSize)*m_iGOPSize + m_GOPList[offGOP].m_POC;
2388  if(offPOC>=0&&m_GOPList[offGOP].m_temporalId<=m_GOPList[curGOP].m_temporalId)
2389  {
2390  Bool newRef=false;
2391  for(Int i=0; i<numRefs; i++)
2392  {
2393  if(refList[i]==offPOC)
2394  {
2395  newRef=true;
2396  }
2397  }
2398  for(Int i=0; i<newRefs; i++)
2399  {
2400  if(m_GOPList[m_iGOPSize+m_extraRPSs].m_referencePics[i]==offPOC-curPOC)
2401  {
2402  newRef=false;
2403  }
2404  }
2405  if(newRef)
2406  {
2407  Int insertPoint=newRefs;
2408  //this picture can be added, find appropriate place in list and insert it.
2409  if(m_GOPList[offGOP].m_temporalId==m_GOPList[curGOP].m_temporalId)
2410  {
2411  m_GOPList[offGOP].m_refPic = true;
2412  }
2413  for(Int j=0; j<newRefs; j++)
2414  {
2415  if(m_GOPList[m_iGOPSize+m_extraRPSs].m_referencePics[j]<offPOC-curPOC||m_GOPList[m_iGOPSize+m_extraRPSs].m_referencePics[j]>0)
2416  {
2417  insertPoint = j;
2418  break;
2419  }
2420  }
2421  Int prev = offPOC-curPOC;
2422  Int prevUsed = m_GOPList[offGOP].m_temporalId<=m_GOPList[curGOP].m_temporalId;
2423  for(Int j=insertPoint; j<newRefs+1; j++)
2424  {
2425  Int newPrev = m_GOPList[m_iGOPSize+m_extraRPSs].m_referencePics[j];
2426  Int newUsed = m_GOPList[m_iGOPSize+m_extraRPSs].m_usedByCurrPic[j];
2427  m_GOPList[m_iGOPSize+m_extraRPSs].m_referencePics[j]=prev;
2428  m_GOPList[m_iGOPSize+m_extraRPSs].m_usedByCurrPic[j]=prevUsed;
2429  prevUsed=newUsed;
2430  prev=newPrev;
2431  }
2432  newRefs++;
2433  }
2434  }
2435  if(newRefs>=numPrefRefs)
2436  {
2437  break;
2438  }
2439  }
2440  m_GOPList[m_iGOPSize+m_extraRPSs].m_numRefPics=newRefs;
2441  m_GOPList[m_iGOPSize+m_extraRPSs].m_POC = curPOC;
2442  if (m_extraRPSs == 0)
2443  {
2444  m_GOPList[m_iGOPSize+m_extraRPSs].m_interRPSPrediction = 0;
2445  m_GOPList[m_iGOPSize+m_extraRPSs].m_numRefIdc = 0;
2446  }
2447  else
2448  {
2449  Int rIdx = m_iGOPSize + m_extraRPSs - 1;
2450  Int refPOC = m_GOPList[rIdx].m_POC;
2451  Int refPics = m_GOPList[rIdx].m_numRefPics;
2452  Int newIdc=0;
2453  for(Int i = 0; i<= refPics; i++)
2454  {
2455  Int deltaPOC = ((i != refPics)? m_GOPList[rIdx].m_referencePics[i] : 0); // check if the reference abs POC is >= 0
2456  Int absPOCref = refPOC+deltaPOC;
2457  Int refIdc = 0;
2458  for (Int j = 0; j < m_GOPList[m_iGOPSize+m_extraRPSs].m_numRefPics; j++)
2459  {
2460  if ( (absPOCref - curPOC) == m_GOPList[m_iGOPSize+m_extraRPSs].m_referencePics[j])
2461  {
2462  if (m_GOPList[m_iGOPSize+m_extraRPSs].m_usedByCurrPic[j])
2463  {
2464  refIdc = 1;
2465  }
2466  else
2467  {
2468  refIdc = 2;
2469  }
2470  }
2471  }
2472  m_GOPList[m_iGOPSize+m_extraRPSs].m_refIdc[newIdc]=refIdc;
2473  newIdc++;
2474  }
2475  m_GOPList[m_iGOPSize+m_extraRPSs].m_interRPSPrediction = 1;
2476  m_GOPList[m_iGOPSize+m_extraRPSs].m_numRefIdc = newIdc;
2477  m_GOPList[m_iGOPSize+m_extraRPSs].m_deltaRPS = refPOC - m_GOPList[m_iGOPSize+m_extraRPSs].m_POC;
2478  }
2479  curGOP=m_iGOPSize+m_extraRPSs;
2480  m_extraRPSs++;
2481  }
2482  numRefs=0;
2483  for(Int i = 0; i< m_GOPList[curGOP].m_numRefPics; i++)
2484  {
2485  Int absPOC = curPOC+m_GOPList[curGOP].m_referencePics[i];
2486  if(absPOC >= 0)
2487  {
2488  refList[numRefs]=absPOC;
2489  numRefs++;
2490  }
2491  }
2492  refList[numRefs]=curPOC;
2493  numRefs++;
2494  }
2495  checkGOP++;
2496  }
2497  xConfirmPara(errorGOP,"Invalid GOP structure given");
2498  m_maxTempLayer = 1;
2499  for(Int i=0; i<m_iGOPSize; i++)
2500  {
2501  if(m_GOPList[i].m_temporalId >= m_maxTempLayer)
2502  {
2504  }
2505  xConfirmPara(m_GOPList[i].m_sliceType!='B' && m_GOPList[i].m_sliceType!='P' && m_GOPList[i].m_sliceType!='I', "Slice type must be equal to B or P or I");
2506  }
2507  for(Int i=0; i<MAX_TLAYER; i++)
2508  {
2509  m_numReorderPics[i] = 0;
2510  m_maxDecPicBuffering[i] = 1;
2511  }
2512  for(Int i=0; i<m_iGOPSize; i++)
2513  {
2514  if(m_GOPList[i].m_numRefPics+1 > m_maxDecPicBuffering[m_GOPList[i].m_temporalId])
2515  {
2516  m_maxDecPicBuffering[m_GOPList[i].m_temporalId] = m_GOPList[i].m_numRefPics + 1;
2517  }
2518  Int highestDecodingNumberWithLowerPOC = 0;
2519  for(Int j=0; j<m_iGOPSize; j++)
2520  {
2521  if(m_GOPList[j].m_POC <= m_GOPList[i].m_POC)
2522  {
2523  highestDecodingNumberWithLowerPOC = j;
2524  }
2525  }
2526  Int numReorder = 0;
2527  for(Int j=0; j<highestDecodingNumberWithLowerPOC; j++)
2528  {
2529  if(m_GOPList[j].m_temporalId <= m_GOPList[i].m_temporalId &&
2530  m_GOPList[j].m_POC > m_GOPList[i].m_POC)
2531  {
2532  numReorder++;
2533  }
2534  }
2535  if(numReorder > m_numReorderPics[m_GOPList[i].m_temporalId])
2536  {
2537  m_numReorderPics[m_GOPList[i].m_temporalId] = numReorder;
2538  }
2539  }
2540  for(Int i=0; i<MAX_TLAYER-1; i++)
2541  {
2542  // a lower layer can not have higher value of m_numReorderPics than a higher layer
2543  if(m_numReorderPics[i+1] < m_numReorderPics[i])
2544  {
2546  }
2547  // the value of num_reorder_pics[ i ] shall be in the range of 0 to max_dec_pic_buffering[ i ] - 1, inclusive
2548  if(m_numReorderPics[i] > m_maxDecPicBuffering[i] - 1)
2549  {
2551  }
2552  // a lower layer can not have higher value of m_uiMaxDecPicBuffering than a higher layer
2554  {
2556  }
2557  }
2558 
2559  // the value of num_reorder_pics[ i ] shall be in the range of 0 to max_dec_pic_buffering[ i ] - 1, inclusive
2560  if(m_numReorderPics[MAX_TLAYER-1] > m_maxDecPicBuffering[MAX_TLAYER-1] - 1)
2561  {
2562  m_maxDecPicBuffering[MAX_TLAYER-1] = m_numReorderPics[MAX_TLAYER-1] + 1;
2563  }
2564 
2566  {
2567  Int PicSizeInSamplesY = m_iSourceWidth * m_iSourceHeight;
2568  if(tileFlag)
2569  {
2570  Int maxTileWidth = 0;
2571  Int maxTileHeight = 0;
2573  Int heightInCU = (m_iSourceHeight % m_uiMaxCUHeight) ? m_iSourceHeight/m_uiMaxCUHeight + 1: m_iSourceHeight/m_uiMaxCUHeight;
2575  {
2576  maxTileWidth = m_uiMaxCUWidth*((widthInCU+m_numTileColumnsMinus1)/(m_numTileColumnsMinus1+1));
2577  maxTileHeight = m_uiMaxCUHeight*((heightInCU+m_numTileRowsMinus1)/(m_numTileRowsMinus1+1));
2578  // if only the last tile-row is one treeblock higher than the others
2579  // the maxTileHeight becomes smaller if the last row of treeblocks has lower height than the others
2580  if(!((heightInCU-1)%(m_numTileRowsMinus1+1)))
2581  {
2582  maxTileHeight = maxTileHeight - m_uiMaxCUHeight + (m_iSourceHeight % m_uiMaxCUHeight);
2583  }
2584  // if only the last tile-column is one treeblock wider than the others
2585  // the maxTileWidth becomes smaller if the last column of treeblocks has lower width than the others
2586  if(!((widthInCU-1)%(m_numTileColumnsMinus1+1)))
2587  {
2588  maxTileWidth = maxTileWidth - m_uiMaxCUWidth + (m_iSourceWidth % m_uiMaxCUWidth);
2589  }
2590  }
2591  else // not uniform spacing
2592  {
2594  {
2595  maxTileWidth = m_iSourceWidth;
2596  }
2597  else
2598  {
2599  Int accColumnWidth = 0;
2600  for(Int col=0; col<(m_numTileColumnsMinus1); col++)
2601  {
2602  maxTileWidth = m_tileColumnWidth[col]>maxTileWidth ? m_tileColumnWidth[col]:maxTileWidth;
2603  accColumnWidth += m_tileColumnWidth[col];
2604  }
2605  maxTileWidth = (widthInCU-accColumnWidth)>maxTileWidth ? m_uiMaxCUWidth*(widthInCU-accColumnWidth):m_uiMaxCUWidth*maxTileWidth;
2606  }
2607  if(m_numTileRowsMinus1<1)
2608  {
2609  maxTileHeight = m_iSourceHeight;
2610  }
2611  else
2612  {
2613  Int accRowHeight = 0;
2614  for(Int row=0; row<(m_numTileRowsMinus1); row++)
2615  {
2616  maxTileHeight = m_tileRowHeight[row]>maxTileHeight ? m_tileRowHeight[row]:maxTileHeight;
2617  accRowHeight += m_tileRowHeight[row];
2618  }
2619  maxTileHeight = (heightInCU-accRowHeight)>maxTileHeight ? m_uiMaxCUHeight*(heightInCU-accRowHeight):m_uiMaxCUHeight*maxTileHeight;
2620  }
2621  }
2622  Int maxSizeInSamplesY = maxTileWidth*maxTileHeight;
2623  m_minSpatialSegmentationIdc = 4*PicSizeInSamplesY/maxSizeInSamplesY-4;
2624  }
2626  {
2627  m_minSpatialSegmentationIdc = 4*PicSizeInSamplesY/((2*m_iSourceHeight+m_iSourceWidth)*m_uiMaxCUHeight)-4;
2628  }
2629  else if(m_sliceMode == FIXED_NUMBER_OF_CTU)
2630  {
2632  }
2633  else
2634  {
2636  }
2637  }
2638 
2640  {
2641  xConfirmPara( m_toneMapCodedDataBitDepth < 8 || m_toneMapCodedDataBitDepth > 14 , "SEIToneMapCodedDataBitDepth must be in rage 8 to 14");
2642  xConfirmPara( m_toneMapTargetBitDepth < 1 || (m_toneMapTargetBitDepth > 16 && m_toneMapTargetBitDepth < 255) , "SEIToneMapTargetBitDepth must be in rage 1 to 16 or equal to 255");
2643  xConfirmPara( m_toneMapModelId < 0 || m_toneMapModelId > 4 , "SEIToneMapModelId must be in rage 0 to 4");
2644  xConfirmPara( m_cameraIsoSpeedValue == 0, "SEIToneMapCameraIsoSpeedValue shall not be equal to 0");
2645  xConfirmPara( m_exposureIndexValue == 0, "SEIToneMapExposureIndexValue shall not be equal to 0");
2646  xConfirmPara( m_extendedRangeWhiteLevel < 100, "SEIToneMapExtendedRangeWhiteLevel should be greater than or equal to 100");
2647  xConfirmPara( m_nominalBlackLevelLumaCodeValue >= m_nominalWhiteLevelLumaCodeValue, "SEIToneMapNominalWhiteLevelLumaCodeValue shall be greater than SEIToneMapNominalBlackLevelLumaCodeValue");
2648  xConfirmPara( m_extendedWhiteLevelLumaCodeValue < m_nominalWhiteLevelLumaCodeValue, "SEIToneMapExtendedWhiteLevelLumaCodeValue shall be greater than or equal to SEIToneMapNominalWhiteLevelLumaCodeValue");
2649  }
2650 
2652  {
2653  Int kneeSEINumKneePointsMinus1=Int(m_kneeFunctionInformationSEI.m_kneeSEIKneePointPairs.size())-1;
2654  xConfirmPara( kneeSEINumKneePointsMinus1 < 0 || kneeSEINumKneePointsMinus1 > 998, "SEIKneeFunctionNumKneePointsMinus1 must be in the range of 0 to 998");
2655  for ( UInt i=0; i<=kneeSEINumKneePointsMinus1; i++ )
2656  {
2658  xConfirmPara( kpp.inputKneePoint < 1 || kpp.inputKneePoint > 999, "SEIKneeFunctionInputKneePointValue must be in the range of 1 to 999");
2659  xConfirmPara( kpp.outputKneePoint < 0 || kpp.outputKneePoint > 1000, "SEIKneeFunctionOutputKneePointValue must be in the range of 0 to 1000");
2660  if ( i > 0 )
2661  {
2663  xConfirmPara( kppPrev.inputKneePoint >= kpp.inputKneePoint, "The i-th SEIKneeFunctionInputKneePointValue must be greater than the (i-1)-th value");
2664  xConfirmPara( kppPrev.outputKneePoint >= kpp.outputKneePoint, "The i-th SEIKneeFunctionOutputKneePointValue must be greater than or equal to the (i-1)-th value");
2665  }
2666  }
2667  }
2668 
2670  {
2671  xConfirmPara( (m_chromaFormatIDC == CHROMA_400 ), "chromaResamplingFilterSEI is not allowed to be present when ChromaFormatIDC is equal to zero (4:0:0)" );
2672  xConfirmPara(m_vuiParametersPresentFlag && m_chromaLocInfoPresentFlag && (m_chromaSampleLocTypeTopField != m_chromaSampleLocTypeBottomField ), "When chromaResamplingFilterSEI is enabled, ChromaSampleLocTypeTopField has to be equal to ChromaSampleLocTypeBottomField" );
2673  }
2674 
2675  if ( m_RCEnableRateControl )
2676  {
2677  if ( m_RCForceIntraQP )
2678  {
2679  if ( m_RCInitialQP == 0 )
2680  {
2681  printf( "\nInitial QP for rate control is not specified. Reset not to use force intra QP!" );
2682  m_RCForceIntraQP = false;
2683  }
2684  }
2685  xConfirmPara( m_uiDeltaQpRD > 0, "Rate control cannot be used together with slice level multiple-QP optimization!\n" );
2687  {
2688  UInt uiLevelIdx = (m_level / 10) + (UInt)((m_level % 10) / 3); // (m_level / 30)*3 + ((m_level % 10) / 3);
2689  xConfirmPara(m_RCCpbSize > g_uiMaxCpbSize[m_levelTier][uiLevelIdx], "RCCpbSize should be smaller than or equal to Max CPB size according to tier and level");
2690  xConfirmPara(m_RCInitialCpbFullness > 1, "RCInitialCpbFullness should be smaller than or equal to 1");
2691  }
2692  }
2693  else
2694  {
2695  xConfirmPara( m_RCCpbSaturationEnabled != 0, "Target bits saturation cannot be processed without Rate control" );
2696  }
2698  {
2699  xConfirmPara(m_RCTargetBitrate == 0, "A target bit rate is required to be set for VUI/HRD parameters.");
2700  if (m_RCCpbSize == 0)
2701  {
2702  printf ("Warning: CPB size is set equal to zero. Adjusting value to be equal to TargetBitrate!\n");
2704  }
2705  }
2706 
2707  xConfirmPara(!m_TransquantBypassEnabledFlag && m_CUTransquantBypassFlagForce, "CUTransquantBypassFlagForce cannot be 1 when TransquantBypassEnableFlag is 0");
2708 
2709  xConfirmPara(m_log2ParallelMergeLevel < 2, "Log2ParallelMergeLevel should be larger than or equal to 2");
2710 
2712  {
2713  xConfirmPara(m_framePackingSEIType < 3 || m_framePackingSEIType > 5 , "SEIFramePackingType must be in rage 3 to 5");
2714  }
2715 
2717  {
2718  xConfirmPara(m_framePackingSEIEnabled , "SEISegmentedRectFramePacking must be 0 when SEIFramePacking is 1");
2719  }
2720 
2722  {
2723  printf("Warning: SEITempMotionConstrainedTileSets is set to false to disable temporal motion-constrained tile sets SEI message because there are no tiles enabled.\n");
2724  m_tmctsSEIEnabled = false;
2725  }
2726 
2727 #if MCTS_ENC_CHECK
2729  {
2730  printf("Warning: Constrained Encoding for Temporal Motion Constrained Tile Sets is enabled. Disabling filtering across tile boundaries!\n");
2732  }
2733 #endif
2734 
2736  {
2737  xConfirmPara(m_timeCodeSEINumTs > MAX_TIMECODE_SEI_SETS, "Number of time sets cannot exceed 3");
2738  }
2739 
2740  xConfirmPara(m_preferredTransferCharacteristics > 255, "transfer_characteristics_idc should not be greater than 255.");
2741 
2742 #if ERP_SR_OV_SEI_MESSAGE
2744  {
2745  xConfirmPara( m_erpSEIGuardBandType < 0 || m_erpSEIGuardBandType > 8, "SEIEquirectangularprojectionGuardBandType must be in the range of 0 to 7");
2746  xConfirmPara( (m_chromaFormatIDC == CHROMA_420 || m_chromaFormatIDC == CHROMA_422) && (m_erpSEILeftGuardBandWidth%2 == 1), "SEIEquirectangularprojectionLeftGuardBandWidth must be an even number for 4:2:0 or 4:2:2 chroma format");
2747  xConfirmPara( (m_chromaFormatIDC == CHROMA_420 || m_chromaFormatIDC == CHROMA_422) && (m_erpSEIRightGuardBandWidth%2 == 1), "SEIEquirectangularprojectionRightGuardBandWidth must be an even number for 4:2:0 or 4:2:2 chroma format");
2748  }
2749 
2751  {
2752  xConfirmPara( m_sphereRotationSEIYaw < -(180<<16) || m_sphereRotationSEIYaw > (180<<16)-1, "SEISphereRotationYaw must be in the range of -11 796 480 to 11 796 479");
2753  xConfirmPara( m_sphereRotationSEIPitch < -(90<<16) || m_sphereRotationSEIYaw > (90<<16), "SEISphereRotationPitch must be in the range of -5 898 240 to 5 898 240");
2754  xConfirmPara( m_sphereRotationSEIRoll < -(180<<16) || m_sphereRotationSEIYaw > (180<<16)-1, "SEISphereRotationRoll must be in the range of -11 796 480 to 11 796 479");
2755  xConfirmPara( m_erpSEICancelFlag == 1 && m_cmpSEICmpCancelFlag == 1, "erp_cancel_flag equal to 0 or cmp_cancel_flag equal to 0 must be present");
2756  }
2757 
2759  {
2760  xConfirmPara( m_omniViewportSEIId < 0 || m_omniViewportSEIId > 1023, "SEIomniViewportId must be in the range of 0 to 1023");
2761  xConfirmPara( m_omniViewportSEICntMinus1 < 0 || m_omniViewportSEICntMinus1 > 15, "SEIomniViewportCntMinus1 must be in the range of 0 to 15");
2762  for ( UInt i=0; i<=m_omniViewportSEICntMinus1; i++ )
2763  {
2764  xConfirmPara( m_omniViewportSEIAzimuthCentre[i] < -(180<<16) || m_omniViewportSEIAzimuthCentre[i] > (180<<16)-1, "SEIOmniViewportAzimuthCentre must be in the range of -11 796 480 to 11 796 479");
2765  xConfirmPara( m_omniViewportSEIElevationCentre[i] < -(90<<16) || m_omniViewportSEIElevationCentre[i] > (90<<16), "SEIOmniViewportSEIElevationCentre must be in the range of -5 898 240 to 5 898 240");
2766  xConfirmPara( m_omniViewportSEITiltCentre[i] < -(180<<16) || m_omniViewportSEITiltCentre[i] > (180<<16)-1, "SEIOmniViewportTiltCentre must be in the range of -11 796 480 to 11 796 479");
2767  xConfirmPara( m_omniViewportSEIHorRange[i] < 1 || m_omniViewportSEIHorRange[i] > (360<<16), "SEIOmniViewportHorRange must be in the range of 1 to 360*2^16");
2768  xConfirmPara( m_omniViewportSEIVerRange[i] < 1 || m_omniViewportSEIVerRange[i] > (180<<16), "SEIOmniViewportVerRange must be in the range of 1 to 180*2^16");
2769  }
2770  }
2771 #endif
2772 
2773 #if EXTENSION_360_VIDEO
2774  check_failed |= m_ext360.verifyParameters();
2775 #endif
2776 
2777 #undef xConfirmPara
2778  if (check_failed)
2779  {
2780  exit(EXIT_FAILURE);
2781  }
2782 }
2783 
2784 const TChar *profileToString(const Profile::Name profile)
2785 {
2786  static const UInt numberOfProfiles = sizeof(strToProfile)/sizeof(*strToProfile);
2787 
2788  for (UInt profileIndex = 0; profileIndex < numberOfProfiles; profileIndex++)
2789  {
2790  if (strToProfile[profileIndex].value == profile)
2791  {
2792  return strToProfile[profileIndex].str;
2793  }
2794  }
2795 
2796  //if we get here, we didn't find this profile in the list - so there is an error
2797  std::cerr << "ERROR: Unknown profile \"" << profile << "\" in profileToString" << std::endl;
2798  assert(false);
2799  exit(1);
2800  return "";
2801 }
2802 
2804 {
2805  printf("\n");
2806  printf("Input File : %s\n", m_inputFileName.c_str() );
2807  printf("Bitstream File : %s\n", m_bitstreamFileName.c_str() );
2808  printf("Reconstruction File : %s\n", m_reconFileName.c_str() );
2810  printf("Internal Format : %dx%d %gHz\n", m_iSourceWidth, m_iSourceHeight, (Double)m_iFrameRate/m_temporalSubsampleRatio );
2811  printf("Sequence PSNR output : %s\n", (m_printMSEBasedSequencePSNR ? "Linear average, MSE-based" : "Linear average only") );
2812  printf("Sequence MSE output : %s\n", (m_printSequenceMSE ? "Enabled" : "Disabled") );
2813  printf("Frame MSE output : %s\n", (m_printFrameMSE ? "Enabled" : "Disabled") );
2814 #if JVET_F0064_MSSSIM
2815  printf("MS-SSIM output : %s\n", (m_printMSSSIM ? "Enabled" : "Disabled") );
2816 #endif
2817  printf("Cabac-zero-word-padding : %s\n", (m_cabacZeroWordPaddingEnabled? "Enabled" : "Disabled") );
2818  if (m_isField)
2819  {
2820  printf("Frame/Field : Field based coding\n");
2821  printf("Field index : %u - %d (%d fields)\n", m_FrameSkip, m_FrameSkip+m_framesToBeEncoded-1, m_framesToBeEncoded );
2822  printf("Field Order : %s field first\n", m_isTopFieldFirst?"Top":"Bottom");
2823 
2824  }
2825  else
2826  {
2827  printf("Frame/Field : Frame based coding\n");
2828  printf("Frame index : %u - %d (%d frames)\n", m_FrameSkip, m_FrameSkip+m_framesToBeEncoded-1, m_framesToBeEncoded );
2829  }
2831  {
2832  UIProfileName validProfileName;
2834  {
2836  }
2837  else
2838  {
2839  const UInt intraIdx = m_intraConstraintFlag ? 1:0;
2840  const UInt bitDepthIdx = (m_bitDepthConstraint == 8 ? 0 : (m_bitDepthConstraint ==10 ? 1 : (m_bitDepthConstraint == 12 ? 2 : (m_bitDepthConstraint == 16 ? 3 : 4 ))));
2841  const UInt chromaFormatIdx = UInt(m_chromaFormatConstraint);
2842  validProfileName = (bitDepthIdx > 3 || chromaFormatIdx>3) ? UI_NONE : validRExtProfileNames[intraIdx][bitDepthIdx][chromaFormatIdx];
2843  }
2844  std::string rextSubProfile;
2845  if (validProfileName!=UI_NONE)
2846  {
2847  rextSubProfile=enumToString(strToUIProfileName, sizeof(strToUIProfileName)/sizeof(*strToUIProfileName), validProfileName);
2848  }
2849  if (rextSubProfile == "main_444_16")
2850  {
2851  rextSubProfile="main_444_16 [NON STANDARD]";
2852  }
2853  printf("Profile : %s (%s)\n", profileToString(m_profile), (rextSubProfile.empty())?"INVALID REXT PROFILE":rextSubProfile.c_str() );
2854  }
2856  {
2857  UIProfileName validProfileName;
2858  const UInt intraIdx = m_intraConstraintFlag ? 1:0;
2859  const UInt bitDepthIdx = (m_bitDepthConstraint == 8 ? 0 : (m_bitDepthConstraint ==10 ? 1 : (m_bitDepthConstraint == 12 ? 2 : (m_bitDepthConstraint == 16 ? 3 : 4 ))));
2860  validProfileName = (bitDepthIdx > 3) ? UI_NONE : validRExtHighThroughPutProfileNames[intraIdx][bitDepthIdx];
2861  std::string subProfile;
2862  if (validProfileName!=UI_NONE)
2863  {
2864  subProfile=enumToString(strToUIProfileName, sizeof(strToUIProfileName)/sizeof(*strToUIProfileName), validProfileName);
2865  }
2866  printf("Profile : %s (%s)\n", profileToString(m_profile), (subProfile.empty())?"INVALID HIGH THROUGHPUT REXT PROFILE":subProfile.c_str() );
2867  }
2869  {
2870  printf("Profile : %s (main10-still-picture)\n", profileToString(m_profile) );
2871  }
2872  else
2873  {
2874  printf("Profile : %s\n", profileToString(m_profile) );
2875  }
2876  printf("CU size / depth / total-depth : %d / %d / %d\n", m_uiMaxCUWidth, m_uiMaxCUDepth, m_uiMaxTotalCUDepth );
2877  printf("RQT trans. size (min / max) : %d / %d\n", 1 << m_uiQuadtreeTULog2MinSize, 1 << m_uiQuadtreeTULog2MaxSize );
2878  printf("Max RQT depth inter : %d\n", m_uiQuadtreeTUMaxDepthInter);
2879  printf("Max RQT depth intra : %d\n", m_uiQuadtreeTUMaxDepthIntra);
2880  printf("Min PCM size : %d\n", 1 << m_uiPCMLog2MinSize);
2881  printf("Motion search range : %d\n", m_iSearchRange );
2882  printf("Intra period : %d\n", m_iIntraPeriod );
2883  printf("Decoding refresh type : %d\n", m_iDecodingRefreshType );
2884 #if JVET_E0059_FLOATING_POINT_QP_FIX
2886  {
2887  printf("QP : %d (incrementing internal QP at source frame %d)\n", m_iQP, m_qpIncrementAtSourceFrame.value );
2888  }
2889  else
2890  {
2891  printf("QP : %d\n", m_iQP );
2892  }
2893 #else
2894  printf("QP : %5.2f\n", m_fQP );
2895 #endif
2896  printf("Max dQP signaling depth : %d\n", m_iMaxCuDQPDepth);
2897 
2898  printf("Cb QP Offset : %d\n", m_cbQpOffset );
2899  printf("Cr QP Offset : %d\n", m_crQpOffset);
2900  printf("QP adaptation : %d (range=%d)\n", m_bUseAdaptiveQP, (m_bUseAdaptiveQP ? m_iQPAdaptationRange : 0) );
2901  printf("GOP size : %d\n", m_iGOPSize );
2902  printf("Input bit depth : (Y:%d, C:%d)\n", m_inputBitDepth[CHANNEL_TYPE_LUMA], m_inputBitDepth[CHANNEL_TYPE_CHROMA] );
2903  printf("MSB-extended bit depth : (Y:%d, C:%d)\n", m_MSBExtendedBitDepth[CHANNEL_TYPE_LUMA], m_MSBExtendedBitDepth[CHANNEL_TYPE_CHROMA] );
2904  printf("Internal bit depth : (Y:%d, C:%d)\n", m_internalBitDepth[CHANNEL_TYPE_LUMA], m_internalBitDepth[CHANNEL_TYPE_CHROMA] );
2905  printf("PCM sample bit depth : (Y:%d, C:%d)\n", m_bPCMInputBitDepthFlag ? m_MSBExtendedBitDepth[CHANNEL_TYPE_LUMA] : m_internalBitDepth[CHANNEL_TYPE_LUMA],
2906  m_bPCMInputBitDepthFlag ? m_MSBExtendedBitDepth[CHANNEL_TYPE_CHROMA] : m_internalBitDepth[CHANNEL_TYPE_CHROMA] );
2907  printf("Intra reference smoothing : %s\n", (m_enableIntraReferenceSmoothing ? "Enabled" : "Disabled") );
2908  printf("diff_cu_chroma_qp_offset_depth : %d\n", m_diffCuChromaQpOffsetDepth);
2909  printf("extended_precision_processing_flag : %s\n", (m_extendedPrecisionProcessingFlag ? "Enabled" : "Disabled") );
2910  printf("implicit_rdpcm_enabled_flag : %s\n", (m_rdpcmEnabledFlag[RDPCM_SIGNAL_IMPLICIT] ? "Enabled" : "Disabled") );
2911  printf("explicit_rdpcm_enabled_flag : %s\n", (m_rdpcmEnabledFlag[RDPCM_SIGNAL_EXPLICIT] ? "Enabled" : "Disabled") );
2912  printf("transform_skip_rotation_enabled_flag : %s\n", (m_transformSkipRotationEnabledFlag ? "Enabled" : "Disabled") );
2913  printf("transform_skip_context_enabled_flag : %s\n", (m_transformSkipContextEnabledFlag ? "Enabled" : "Disabled") );
2914  printf("cross_component_prediction_enabled_flag: %s\n", (m_crossComponentPredictionEnabledFlag ? (m_reconBasedCrossCPredictionEstimate ? "Enabled (reconstructed-residual-based estimate)" : "Enabled (encoder-side-residual-based estimate)") : "Disabled") );
2915  printf("high_precision_offsets_enabled_flag : %s\n", (m_highPrecisionOffsetsEnabledFlag ? "Enabled" : "Disabled") );
2916  printf("persistent_rice_adaptation_enabled_flag: %s\n", (m_persistentRiceAdaptationEnabledFlag ? "Enabled" : "Disabled") );
2917  printf("cabac_bypass_alignment_enabled_flag : %s\n", (m_cabacBypassAlignmentEnabledFlag ? "Enabled" : "Disabled") );
2918  if (m_bUseSAO)
2919  {
2920  printf("log2_sao_offset_scale_luma : %d\n", m_log2SaoOffsetScale[CHANNEL_TYPE_LUMA]);
2921  printf("log2_sao_offset_scale_chroma : %d\n", m_log2SaoOffsetScale[CHANNEL_TYPE_CHROMA]);
2922  }
2923 
2924  switch (m_costMode)
2925  {
2926  case COST_STANDARD_LOSSY: printf("Cost function: : Lossy coding (default)\n"); break;
2927  case COST_SEQUENCE_LEVEL_LOSSLESS: printf("Cost function: : Sequence_level_lossless coding\n"); break;
2928  case COST_LOSSLESS_CODING: printf("Cost function: : Lossless coding with fixed QP of %d\n", LOSSLESS_AND_MIXED_LOSSLESS_RD_COST_TEST_QP); break;
2929  case COST_MIXED_LOSSLESS_LOSSY_CODING: printf("Cost function: : Mixed_lossless_lossy coding with QP'=%d for lossless evaluation\n", LOSSLESS_AND_MIXED_LOSSLESS_RD_COST_TEST_QP_PRIME); break;
2930  default: printf("Cost function: : Unknown\n"); break;
2931  }
2932 
2933  printf("RateControl : %d\n", m_RCEnableRateControl );
2934  printf("WPMethod : %d\n", Int(m_weightedPredictionMethod));
2935 
2937  {
2938  printf("TargetBitrate : %d\n", m_RCTargetBitrate );
2939  printf("KeepHierarchicalBit : %d\n", m_RCKeepHierarchicalBit );
2940  printf("LCULevelRC : %d\n", m_RCLCULevelRC );
2941  printf("UseLCUSeparateModel : %d\n", m_RCUseLCUSeparateModel );
2942  printf("InitialQP : %d\n", m_RCInitialQP );
2943  printf("ForceIntraQP : %d\n", m_RCForceIntraQP );
2944  printf("CpbSaturation : %d\n", m_RCCpbSaturationEnabled );
2946  {
2947  printf("CpbSize : %d\n", m_RCCpbSize);
2948  printf("InitalCpbFullness : %.2f\n", m_RCInitialCpbFullness);
2949  }
2950  }
2951 
2952  printf("Max Num Merge Candidates : %d\n", m_maxNumMergeCand);
2953  printf("\n");
2954 
2955  printf("TOOL CFG: ");
2956  printf("IBD:%d ", ((m_internalBitDepth[CHANNEL_TYPE_LUMA] > m_MSBExtendedBitDepth[CHANNEL_TYPE_LUMA]) || (m_internalBitDepth[CHANNEL_TYPE_CHROMA] > m_MSBExtendedBitDepth[CHANNEL_TYPE_CHROMA])));
2957  printf("HAD:%d ", m_bUseHADME );
2958  printf("RDQ:%d ", m_useRDOQ );
2959  printf("RDQTS:%d ", m_useRDOQTS );
2960  printf("RDpenalty:%d ", m_rdPenalty );
2961  printf("LQP:%d ", m_lumaLevelToDeltaQPMapping.mode );
2962  printf("SQP:%d ", m_uiDeltaQpRD );
2963  printf("ASR:%d ", m_bUseASR );
2964  printf("MinSearchWindow:%d ", m_minSearchWindow );
2965  printf("RestrictMESampling:%d ", m_bRestrictMESampling );
2966  printf("FEN:%d ", Int(m_fastInterSearchMode) );
2967  printf("ECU:%d ", m_bUseEarlyCU );
2968  printf("FDM:%d ", m_useFastDecisionForMerge );
2969  printf("CFM:%d ", m_bUseCbfFastMode );
2970  printf("ESD:%d ", m_useEarlySkipDetection );
2971  printf("RQT:%d ", 1 );
2972  printf("TransformSkip:%d ", m_useTransformSkip );
2973  printf("TransformSkipFast:%d ", m_useTransformSkipFast );
2974  printf("TransformSkipLog2MaxSize:%d ", m_log2MaxTransformSkipBlockSize);
2975  printf("Slice: M=%d ", Int(m_sliceMode));
2976  if (m_sliceMode!=NO_SLICES)
2977  {
2978  printf("A=%d ", m_sliceArgument);
2979  }
2980  printf("SliceSegment: M=%d ",m_sliceSegmentMode);
2982  {
2983  printf("A=%d ", m_sliceSegmentArgument);
2984  }
2985  printf("CIP:%d ", m_bUseConstrainedIntraPred);
2986  printf("SAO:%d ", (m_bUseSAO)?(1):(0));
2987  printf("PCM:%d ", (m_usePCM && (1<<m_uiPCMLog2MinSize) <= m_uiMaxCUWidth)? 1 : 0);
2988 
2990  {
2991  printf("TransQuantBypassEnabled: =1");
2992  }
2993  else
2994  {
2995  printf("TransQuantBypassEnabled:%d ", (m_TransquantBypassEnabledFlag)? 1:0 );
2996  }
2997 
2998  printf("WPP:%d ", (Int)m_useWeightedPred);
2999  printf("WPB:%d ", (Int)m_useWeightedBiPred);
3000  printf("PME:%d ", m_log2ParallelMergeLevel);
3001  const Int iWaveFrontSubstreams = m_entropyCodingSyncEnabledFlag ? (m_iSourceHeight + m_uiMaxCUHeight - 1) / m_uiMaxCUHeight : 1;
3002  printf(" WaveFrontSynchro:%d WaveFrontSubstreams:%d", m_entropyCodingSyncEnabledFlag?1:0, iWaveFrontSubstreams);
3003  printf(" ScalingList:%d ", m_useScalingListId );
3004  printf("TMVPMode:%d ", m_TMVPModeId );
3005 #if ADAPTIVE_QP_SELECTION
3006  printf("AQpS:%d", m_bUseAdaptQpSelect );
3007 #endif
3008 
3009  printf(" SignBitHidingFlag:%d ", m_signDataHidingEnabledFlag);
3010  printf("RecalQP:%d", m_recalculateQPAccordingToLambda ? 1 : 0 );
3011 
3012 #if EXTENSION_360_VIDEO
3013  m_ext360.outputConfigurationSummary();
3014 #endif
3015 
3016  printf("\n\n");
3017 
3018  fflush(stdout);
3019 }
3020 
3021 Bool confirmPara(Bool bflag, const TChar* message)
3022 {
3023  if (!bflag)
3024  {
3025  return false;
3026  }
3027 
3028  printf("Error: %s\n",message);
3029  return true;
3030 }
3031 
UInt m_pcmLog2MaxSize
log2 of maximum PCM block size
Definition: TAppEncCfg.h:238
Int m_sphereRotationSEIYaw
Definition: TAppEncCfg.h:370
static struct MapStrToScalingListMode strToScalingListMode[]
Void create()
create option handling class
Definition: TAppEncCfg.cpp:150
ChromaFormat m_InputChromaFormatIDC
Definition: TAppEncCfg.h:108
Int m_toneMapModelId
Definition: TAppEncCfg.h:295
TComSEIMasteringDisplay m_masteringDisplay
Definition: TAppEncCfg.h:186
static const Int MAX_NUM_REF_PICS
max. number of pictures used for reference
Definition: CommonDef.h:124
Bool m_RCEnableRateControl
enable rate control or not
Definition: TAppEncCfg.h:430
std::string m_scalingListFileName
quantization matrix file name
Definition: TAppEncCfg.h:441
Bool m_recalculateQPAccordingToLambda
recalculate QP value according to the lambda value
Definition: TAppEncCfg.h:447
Bool m_ccvSEIMaxLuminanceValuePresentFlag
Definition: TAppEncCfg.h:350
Bool m_signDataHidingEnabledFlag
Definition: TAppEncCfg.h:429
T readValue(const TChar *&pStr, Bool &bSuccess)
Int m_chromaSampleLocTypeTopField
Specifies the location of chroma samples for top field.
Definition: TAppEncCfg.h:466
Int m_sigmoidWidth
Definition: TAppEncCfg.h:299
UInt m_RCCpbSize
CPB size.
Definition: TAppEncCfg.h:438
Double m_ccvSEIAvgLuminanceValue
Definition: TAppEncCfg.h:356
Bool m_bFastUDIUseMPMEnabled
Definition: TAppEncCfg.h:278
Bool m_useStrongIntraSmoothing
enable strong intra smoothing for 32x32 blocks where the reference samples are flat ...
Definition: TAppEncCfg.h:448
std::vector< Int > m_omniViewportSEIAzimuthCentre
Definition: TAppEncCfg.h:379
Int m_iDecodingRefreshType
random access type
Definition: TAppEncCfg.h:136
Bool m_loopFilterOffsetInPPS
offset for deblocking filter in 0 = slice header, 1 = PPS
Definition: TAppEncCfg.h:232
Bool m_TransquantBypassEnabledFlag
transquant_bypass_enabled_flag setting in PPS.
Definition: TAppEncCfg.h:443
Bool m_transformSkipRotationEnabledFlag
control flag for transform-skip/transquant-bypass residual rotation
Definition: TAppEncCfg.h:151
Int m_deblockingFilterMetric
blockiness metric in encoder
Definition: TAppEncCfg.h:235
Int m_betaOffsetDiv2
Definition: TEncCfg.h:61
std::vector< UChar > m_rwpSEIRwpTopGuardBandHeight
Definition: TAppEncCfg.h:412
std::vector< UInt > m_rwpSEIProjRegionHeight
Definition: TAppEncCfg.h:403
unsigned short UShort
Definition: TypeDef.h:210
UInt m_uiMaxCUDepth
max. CU depth (as specified by command line)
Definition: TAppEncCfg.h:197
UInt m_FrameSkip
number of skipped frames from the beginning
Definition: TAppEncCfg.h:83
Bool m_enableAMP
Definition: TAppEncCfg.h:154
UInt g_uiMaxCpbSize[2][21]
Definition: TAppEncCfg.cpp:332
UInt m_greenMetadataType
Definition: TAppEncCfg.h:342
Int m_confWinTop
Definition: TAppEncCfg.h:100
#define xConfirmPara(a, b)
Double m_ccvSEIMaxLuminanceValue
Definition: TAppEncCfg.h:355
Bool m_videoFullRangeFlag
Indicates the black level and range of luma and chroma signals.
Definition: TAppEncCfg.h:460
void doHelp(ostream &out, Options &opts, unsigned columns)
Double chromaQpOffset
Chroma QP Offset (0.0:default)
Definition: TypeDef.h:904
Bool m_colourDescriptionPresentFlag
Signals whether colour_primaries, transfer_characteristics and matrix_coefficients are present...
Definition: TAppEncCfg.h:461
std::vector< KneePointPair > m_kneeSEIKneePointPairs
Definition: TEncCfg.h:130
Int m_crQpOffset
Chroma Cr QP Offset (0:default)
Definition: TAppEncCfg.h:178
Bool m_saoCtuBoundary
SAO parameter estimation using non-deblocked pixels for CTU bottom and right boundary areas...
Definition: TAppEncCfg.h:228
Bool m_rwpSEIRwpPersistenceFlag
Definition: TAppEncCfg.h:393
static const Int LOSSLESS_AND_MIXED_LOSSLESS_RD_COST_TEST_QP
QP to use for lossless coding.
Definition: CommonDef.h:210
Bool m_cmpSEICmpPersistenceFlag
Definition: TAppEncCfg.h:388
Bool m_bUseAdaptiveQP
Flag for enabling QP adaptation based on a psycho-visual model.
Definition: TAppEncCfg.h:188
Bool m_recoveryPointSEIEnabled
Definition: TAppEncCfg.h:283
#define MACRO_TO_STRING(val)
Definition: TAppEncCfg.cpp:53
Int m_log2MaxMvLengthHorizontal
Indicate the maximum absolute value of a decoded horizontal MV component in quarter-pel luma units...
Definition: TAppEncCfg.h:483
Int m_colourPrimaries
Indicates chromaticity coordinates of the source primaries.
Definition: TAppEncCfg.h:462
Level::Name value
Definition: TAppEncCfg.cpp:311
Bool m_erpSEICancelFlag
Definition: TAppEncCfg.h:360
Bool m_bPCMInputBitDepthFlag
0: PCM bit-depth is internal bit-depth. 1: PCM bit-depth is input bit-depth.
Definition: TAppEncCfg.h:220
Int m_inputFileHeight
height of image in input file (this is equivalent to sourceHeight, if sourceHeight is not subsequentl...
Definition: TAppEncCfg.h:88
GOPEntry m_GOPList[MAX_GOP]
the coding structure entries from the config file
Definition: TAppEncCfg.h:142
void Void
Definition: TypeDef.h:203
std::string m_reconFileName
output reconstruction file
Definition: TAppEncCfg.h:74
MESearchMethod
supported ME search methods
Definition: TypeDef.h:463
Int m_cbQpOffset
Chroma Cb QP Offset (0:default)
Definition: TAppEncCfg.h:177
Int m_deltaRPS
Definition: TEncCfg.h:70
std::vector< std::pair< Int, Int > > mapping
first=luma level, second=delta QP.
Definition: TypeDef.h:893
Int m_matrixCoefficients
Describes the matrix coefficients used in deriving luma and chroma from RGB primaries.
Definition: TAppEncCfg.h:464
Bool m_intraConstraintFlag
Definition: TAppEncCfg.h:126
Int m_MSBExtendedBitDepth[MAX_NUM_CHANNEL_TYPE]
bit-depth of input samples after MSB extension
Definition: TAppEncCfg.h:211
Int m_iQPAdaptationRange
dQP range by QP adaptation
Definition: TAppEncCfg.h:189
Int timeOffsetValue
Definition: TypeDef.h:877
Int m_CbQPoffset
Definition: TEncCfg.h:57
Int m_outputBitDepth[MAX_NUM_CHANNEL_TYPE]
bit-depth of output file
Definition: TAppEncCfg.h:210
Int numberOfFrames
Definition: TypeDef.h:869
Profile::Name value
Definition: TAppEncCfg.cpp:213
Bool m_lowerBitRateConstraintFlag
Definition: TAppEncCfg.h:128
Double maxMethodWeight
weight of max luma value when mode = 2
Definition: TypeDef.h:892
Bool m_toneMappingInfoSEIEnabled
Definition: TAppEncCfg.h:286
Int m_transferCharacteristics
Indicates the opto-electronic transfer characteristics of the source.
Definition: TAppEncCfg.h:463
#define CMP_SEI_MESSAGE
Definition: TypeDef.h:100
std::vector< Int > m_omniViewportSEITiltCentre
Definition: TAppEncCfg.h:381
global variables &amp; functions (header)
Int m_inputBitDepth[MAX_NUM_CHANNEL_TYPE]
bit-depth of input file
Definition: TAppEncCfg.h:209
static std::string enumToString(P map[], UInt mapLen, const T val)
Definition: TAppEncCfg.cpp:368
std::vector< UInt > m_rwpSEIProjRegionWidth
Definition: TAppEncCfg.h:402
#define NULL
Definition: CommonDef.h:107
Bool m_ccvSEIAvgLuminanceValuePresentFlag
Definition: TAppEncCfg.h:351
Double m_dIntraQpFactor
Intra Q Factor. If negative, use a default equation: 0.57*(1.0 - Clip3( 0.0, 0.5, 0...
Definition: TAppEncCfg.h:79
Int m_framePackingSEIId
Definition: TAppEncCfg.h:318
Int m_extendedWhiteLevelLumaCodeValue
Definition: TAppEncCfg.h:312
ChromaFormat m_chromaFormatConstraint
Definition: TAppEncCfg.h:125
Bool m_ccvSEIMinLuminanceValuePresentFlag
Definition: TAppEncCfg.h:349
std::vector< UInt > m_rwpSEIProjRegionLeft
Definition: TAppEncCfg.h:405
don&#39;t use slices / slice segments
Definition: TypeDef.h:516
Bool m_tmctsSEIEnabled
Definition: TAppEncCfg.h:332
Int m_iFrameRate
source frame-rates (Hz)
Definition: TAppEncCfg.h:82
Int m_chromaSampleLocTypeBottomField
Specifies the location of chroma samples for bottom field.
Definition: TAppEncCfg.h:467
Bool m_snrInternalColourSpace
if true, then no colour space conversion is applied for snr calculation, otherwise inverse of input i...
Definition: TAppEncCfg.h:106
Int m_exposureCompensationValueNumerator
Definition: TAppEncCfg.h:306
Bool parseCfg(Int argc, TChar *argv[])
parse configuration file to fill member variables
Definition: TAppEncCfg.cpp:646
Bool m_vuiParametersPresentFlag
enable generation of VUI parameters
Definition: TAppEncCfg.h:451
UInt m_sliceChromaQpOffsetPeriodicity
Used in conjunction with Slice Cb/Cr QpOffsetIntraOrPeriodic. Use 0 (default) to disable periodic nat...
Definition: TAppEncCfg.h:180
Bool m_bitstreamRestrictionFlag
Signals whether bitstream restriction parameters are present.
Definition: TAppEncCfg.h:477
Bool m_tilesFixedStructureFlag
Indicates that each active picture parameter set has the same values of the syntax elements related t...
Definition: TAppEncCfg.h:478
Int m_iQP
QP value of key-picture (integer)
Definition: TAppEncCfg.h:164
Bool m_omniViewportSEIEnabled
Definition: TAppEncCfg.h:374
unsigned int UInt
Definition: TypeDef.h:212
Bool clockTimeStampFlag
Definition: TypeDef.h:863
UInt m_uiQuadtreeTULog2MaxSize
Definition: TAppEncCfg.h:202
std::string m_colourRemapSEIFileRoot
Definition: TAppEncCfg.h:485
Int m_noDisplaySEITLayer
Definition: TAppEncCfg.h:328
SliceConstraint m_sliceMode
Definition: TAppEncCfg.h:263
static Int getWinUnitY(Int chromaFormatIdc)
Definition: TComSlice.h:830
Bool m_cmpSEICmpCancelFlag
Definition: TAppEncCfg.h:387
Bool m_bufferingPeriodSEIEnabled
Definition: TAppEncCfg.h:284
Bool m_bHarmonizeGopFirstFieldCoupleEnabled
Definition: TAppEncCfg.h:95
static struct MapStrToUIProfileName strToUIProfileName[]
UInt m_temporalSubsampleRatio
temporal subsample ratio, 2 means code every two frames
Definition: TAppEncCfg.h:84
Int m_iSourceWidth
source width in pixel
Definition: TAppEncCfg.h:85
Int m_chromaResamplingHorFilterIdc
Definition: TAppEncCfg.h:288
Int m_sarHeight
vertical size of the sample aspect ratio
Definition: TAppEncCfg.h:455
std::vector< UShort > m_rwpSEIPackedRegionHeight
Definition: TAppEncCfg.h:407
Int m_numRefPics
Definition: TEncCfg.h:66
Definition: TEncCfg.h:49
Int m_POC
Definition: TEncCfg.h:51
Bool m_bUseSAO
Definition: TAppEncCfg.h:223
ScalingListMode m_useScalingListId
using quantization matrix
Definition: TAppEncCfg.h:440
const std::size_t minNumValuesIncl
Definition: TAppEncCfg.cpp:435
Int m_cameraIsoSpeedValue
Definition: TAppEncCfg.h:302
Int m_videoFormat
Indicates representation of pictures.
Definition: TAppEncCfg.h:459
Double chromaQpScale
Chroma QP Scale (0.0:default)
Definition: TypeDef.h:903
UInt m_log2ParallelMergeLevel
Parallel merge estimation region.
Definition: TAppEncCfg.h:425
Int m_usedByCurrPic[MAX_NUM_REF_PICS]
Definition: TEncCfg.h:68
Double m_saoEncodingRate
When &gt;0 SAO early picture termination is enabled for luma and chroma.
Definition: TAppEncCfg.h:225
Bool m_motionVectorsOverPicBoundariesFlag
Indicates that no samples outside the picture boundaries are used for inter prediction.
Definition: TAppEncCfg.h:479
Int m_framePackingSEIInterpretation
Definition: TAppEncCfg.h:320
Int m_defDispWinRightOffset
Specifies the right offset from the conformance window of the default window.
Definition: TAppEncCfg.h:471
std::string m_summaryOutFilename
filename to use for producing summary output file.
Definition: TAppEncCfg.h:490
Int m_displayOrientationSEIAngle
Definition: TAppEncCfg.h:325
std::vector< UChar > m_rwpSEIRwpRightGuardBandWidth
Definition: TAppEncCfg.h:411
static struct MapStrToProfile strToProfile[]
Int m_loopFilterTcOffsetDiv2
tc offset for deblocking filter
Definition: TAppEncCfg.h:234
std::vector< Int > m_tileColumnWidth
Definition: TAppEncCfg.h:273
std::string m_bitstreamFileName
output bitstream file
Definition: TAppEncCfg.h:73
Bool m_aspectRatioInfoPresentFlag
Signals whether aspect_ratio_idc is present.
Definition: TAppEncCfg.h:452
Bool m_bFastMEAssumingSmootherMVEnabled
Enables fast ME assuming a smoother MV.
Definition: TAppEncCfg.h:257
Bool m_bLoopFilterDisable
flag for using deblocking filter
Definition: TAppEncCfg.h:231
Int m_exposureIndexValue
Definition: TAppEncCfg.h:304
Bool m_bUseBLambdaForNonKeyLowDelayPictures
Definition: TAppEncCfg.h:280
Bool m_sphereRotationSEICancelFlag
Definition: TAppEncCfg.h:368
Int m_numReorderPics[MAX_TLAYER]
total number of reorder pictures
Definition: TAppEncCfg.h:143
char TChar
Definition: TypeDef.h:206
Level::Tier value
Definition: TAppEncCfg.cpp:300
UInt m_xsdMetricType
Definition: TAppEncCfg.h:343
Int m_loopFilterBetaOffsetDiv2
beta offset for deblocking filter
Definition: TAppEncCfg.h:233
UInt m_uiLog2DiffMaxMinCodingBlockSize
difference between largest and smallest CU depth
Definition: TAppEncCfg.h:199
Int m_exposureCompensationValueDenomIdc
Definition: TAppEncCfg.h:307
SMultiValueInput(const T &minValue, const T &maxValue, std::size_t minNumberValues, std::size_t maxNumberValues, const T *defValues, const UInt numDefValues)
Definition: TAppEncCfg.cpp:442
list< const char * > scanArgv(Options &opts, unsigned argc, const char *argv[], ErrorReporter &error_reporter)
Bool m_exposureCompensationValueSignFlag
Definition: TAppEncCfg.h:305
Int m_interRPSPrediction
Definition: TEncCfg.h:69
UInt m_erpSEIRightGuardBandWidth
Definition: TAppEncCfg.h:365
Bool m_SOPDescriptionSEIEnabled
Definition: TAppEncCfg.h:330
Bool m_frameOnlyConstraintFlag
Definition: TAppEncCfg.h:132
static ChromaFormat numberToChromaFormat(const Int val)
Definition: TAppEncCfg.cpp:198
Bool confirmPara(Bool bflag, const TChar *message)
Int * m_targetPivotValue
Definition: TAppEncCfg.h:315
Bool m_omniViewportSEICancelFlag
Definition: TAppEncCfg.h:376
Bool m_highPrecisionOffsetsEnabledFlag
Definition: TAppEncCfg.h:214
std::vector< UShort > m_rwpSEIPackedRegionLeft
Definition: TAppEncCfg.h:409
InputColourSpaceConversion stringToInputColourSpaceConvert(const std::string &value, const Bool bIsForward)
Int countingType
Definition: TypeDef.h:865
Bool m_timeCodeSEIEnabled
Definition: TAppEncCfg.h:336
Bool m_isField
enable field coding
Definition: TAppEncCfg.h:92
std::vector< UChar > m_rwpSEIRwpTransformType
Definition: TAppEncCfg.h:400
Bool hoursFlag
Definition: TypeDef.h:875
Bool m_isTopFieldFirst
Definition: TAppEncCfg.h:93
FastInterSearchMode m_fastInterSearchMode
Parameter that controls fast encoder settings.
Definition: TAppEncCfg.h:258
WCGChromaQPControl m_wcgChromaQpControl
Wide-colour-gamut chroma QP control.
Definition: TAppEncCfg.h:179
Int m_refIdc[MAX_NUM_REF_PICS+1]
Definition: TEncCfg.h:72
#define EXTENSION_360_VIDEO
extension for 360/spherical video coding support; this macro should be controlled by makefile...
Definition: TypeDef.h:94
std::vector< Bool > m_rwpSEIRwpGuardBandFlag
Definition: TAppEncCfg.h:401
Int m_maxNumOffsetsPerPic
SAO maximun number of offset per picture.
Definition: TAppEncCfg.h:227
Bool m_RCForceIntraQP
force all intra picture to use initial QP or not
Definition: TAppEncCfg.h:436
Bool m_useEarlySkipDetection
flag for using Early SKIP Detection
Definition: TAppEncCfg.h:262
std::string m_summaryPicFilenameBase
Base filename to use for producing summary picture output files. The actual filenames used will have ...
Definition: TAppEncCfg.h:491
Int m_preferredTransferCharacteristics
Definition: TAppEncCfg.h:341
Double m_saoEncodingRateChroma
The SAO early picture termination rate to use for chroma (when m_SaoEncodingRate is &gt;0)...
Definition: TAppEncCfg.h:226
Int * m_codedPivotValue
Definition: TAppEncCfg.h:314
Bool m_framePackingSEIEnabled
Definition: TAppEncCfg.h:316
Double m_ccvSEIPrimariesX[MAX_NUM_COMPONENT]
Definition: TAppEncCfg.h:352
Bool secondsFlag
Definition: TypeDef.h:873
LumaLevelToDQPMode mode
use deltaQP determined by block luma level
Definition: TypeDef.h:891
std::string m_inputFileName
source file name
Definition: TAppEncCfg.h:72
Int m_tcOffsetDiv2
Definition: TEncCfg.h:60
Int m_iSourceHeight
source height in pixel (when interlaced = field height)
Definition: TAppEncCfg.h:86
HashType
Definition: TypeDef.h:524
static const UIProfileName validRExtHighThroughPutProfileNames[2][4]
Definition: TAppEncCfg.cpp:275
Bool m_outputInternalColourSpace
if true, then no colour space conversion is applied for reconstructed video, otherwise inverse of inp...
Definition: TAppEncCfg.h:107
Int m_toneMapCodedDataBitDepth
Definition: TAppEncCfg.h:293
Int m_RCKeepHierarchicalBit
0: equal bit allocation; 1: fixed ratio bit allocation; 2: adaptive ratio bit allocation ...
Definition: TAppEncCfg.h:432
Bool m_rwpSEIEnabled
Definition: TAppEncCfg.h:391
Int m_QPOffset
Definition: TEncCfg.h:52
Int m_toneMapId
Definition: TAppEncCfg.h:290
UInt m_omniViewportSEICntMinus1
Definition: TAppEncCfg.h:378
Int m_activeParameterSetsSEIEnabled
Definition: TAppEncCfg.h:449
Double m_QPOffsetModelScale
Definition: TEncCfg.h:55
Int m_toneMapMaxValue
Definition: TAppEncCfg.h:297
static const Int MAX_GOP
max. value of hierarchical GOP size
Definition: CommonDef.h:123
Bool m_crossComponentPredictionEnabledFlag
flag enabling the use of cross-component prediction
Definition: TAppEncCfg.h:145
Int m_minSearchWindow
ME minimum search window size for the Adaptive Window ME.
Definition: TAppEncCfg.h:255
Bool m_omniViewportSEIPersistenceFlag
Definition: TAppEncCfg.h:377
SMultiValueInput(std::vector< T > &defaults)
Definition: TAppEncCfg.cpp:439
Bool m_sphereRotationSEIEnabled
Definition: TAppEncCfg.h:367
Int hoursValue
Definition: TypeDef.h:872
Int m_toneMapTargetBitDepth
Definition: TAppEncCfg.h:294
static struct MapStrToLevel strToLevel[]
Double m_ccvSEIPrimariesY[MAX_NUM_COMPONENT]
Definition: TAppEncCfg.h:353
Bool m_segmentedRectFramePackingSEICancel
Definition: TAppEncCfg.h:322
Bool m_useRDOQTS
flag for using RD optimized quantization for transform skip
Definition: TAppEncCfg.h:247
Int m_defDispWinTopOffset
Specifies the top offset from the conformance window of the default window.
Definition: TAppEncCfg.h:472
Int m_confWinLeft
Definition: TAppEncCfg.h:98
Int m_conformanceWindowMode
Definition: TAppEncCfg.h:97
static struct MapStrToTier strToTier[]
bool Bool
Definition: TypeDef.h:204
Bool m_transformSkipContextEnabledFlag
control flag for transform-skip/transquant-bypass single significance map context ...
Definition: TAppEncCfg.h:152
Bool m_extendedPrecisionProcessingFlag
Definition: TAppEncCfg.h:213
Int minutesValue
Definition: TypeDef.h:871
std::vector< UShort > m_rwpSEIPackedRegionWidth
Definition: TAppEncCfg.h:406
std::vector< Int > m_tileRowHeight
Definition: TAppEncCfg.h:274
Bool m_useSelectiveRDOQ
flag for using selective RDOQ
Definition: TAppEncCfg.h:248
Int m_confWinBottom
Definition: TAppEncCfg.h:101
const TChar * str
Definition: TAppEncCfg.cpp:310
UInt m_erpSEIGuardBandType
Definition: TAppEncCfg.h:363
static const Int LOSSLESS_AND_MIXED_LOSSLESS_RD_COST_TEST_QP_PRIME
QP&#39; to use for mixed_lossy_lossless coding.
Definition: CommonDef.h:211
#define ADAPTIVE_QP_SELECTION
G382: Adaptive reconstruction levels, non-normative part for adaptive QP selection.
Definition: TypeDef.h:112
Int m_sphereRotationSEIPitch
Definition: TAppEncCfg.h:371
Bool m_bClipOutputVideoToRec709Range
Definition: TAppEncCfg.h:118
Bool m_ccvSEIPrimariesPresentFlag
Definition: TAppEncCfg.h:348
Level::Tier m_levelTier
Definition: TAppEncCfg.h:122
#define JVET_F0064_MSSSIM
Calculate MS-SSIM scores.
Definition: TypeDef.h:91
Bool enabled
Enabled flag (0:default)
Definition: TypeDef.h:900
Int m_iIntraPeriod
period of I-slice (random access period)
Definition: TAppEncCfg.h:135
LumaLevelToDeltaQPMapping m_lumaLevelToDeltaQPMapping
mapping from luma level to Delta QP.
Definition: TAppEncCfg.h:182
Bool m_ccvSEIEnabled
Definition: TAppEncCfg.h:345
Int m_maxBytesPerPicDenom
Indicates a number of bytes not exceeded by the sum of the sizes of the VCL NAL units associated with...
Definition: TAppEncCfg.h:481
Int m_cameraIsoSpeedIdc
Definition: TAppEncCfg.h:301
Int * m_aidQP
array of slice QP values
Definition: TAppEncCfg.h:170
Bool m_gradualDecodingRefreshInfoEnabled
Definition: TAppEncCfg.h:327
Bool m_bFastDeltaQP
Fast Delta QP (false:default)
Definition: TAppEncCfg.h:175
Int m_segmentedRectFramePackingSEIType
Definition: TAppEncCfg.h:323
Bool m_toneMapPersistenceFlag
Definition: TAppEncCfg.h:292
Int m_RCInitialQP
inital QP for rate control
Definition: TAppEncCfg.h:435
Bool m_rwpSEIConstituentPictureMatchingFlag
Definition: TAppEncCfg.h:394
Int m_confWinRight
Definition: TAppEncCfg.h:99
FastInterSearchMode
Definition: TypeDef.h:637
UInt m_uiMaxCUWidth
max. CU width in pixel
Definition: TAppEncCfg.h:195
Bool m_AccessUnitDelimiter
add Access Unit Delimiter NAL units
Definition: TAppEncCfg.h:104
Bool m_sphereRotationSEIPersistenceFlag
Definition: TAppEncCfg.h:369
Bool m_bUseEarlyCU
flag for using Early CU setting
Definition: TAppEncCfg.h:259
UIProfileName value
Definition: TAppEncCfg.cpp:229
Bool m_RCLCULevelRC
true: LCU level rate control; false: picture level rate control NOTE: code-tidy - rename to m_RCCtuLe...
Definition: TAppEncCfg.h:433
Bool numUnitFieldBasedFlag
Definition: TypeDef.h:864
Int m_sarWidth
horizontal size of the sample aspect ratio
Definition: TAppEncCfg.h:454
Bool m_bLFCrossTileBoundaryFlag
1: filter across tile boundaries 0: do not filter across tile boundaries
Definition: TAppEncCfg.h:269
TEncCfg::TEncSEIKneeFunctionInformation m_kneeFunctionInformationSEI
Definition: TAppEncCfg.h:340
UInt m_omniViewportSEIId
Definition: TAppEncCfg.h:375
istream & readValues(std::istream &in)
Definition: TAppEncCfg.cpp:499
SChar m_sliceType
Definition: TEncCfg.h:65
Double chromaCrQpScale
Chroma Cr QP Scale (1.0:default)
Definition: TypeDef.h:902
static istream & readStrToEnum(P map[], UInt mapLen, istream &in, T &val)
Definition: TAppEncCfg.cpp:381
Int m_maxBitsPerMinCuDenom
Indicates an upper bound for the number of bits of coding_unit() data.
Definition: TAppEncCfg.h:482
Bool m_erpSEIPersistenceFlag
Definition: TAppEncCfg.h:361
Bool m_useWeightedPred
Use of weighted prediction in P slices.
Definition: TAppEncCfg.h:421
Double m_ccvSEIMinLuminanceValue
Definition: TAppEncCfg.h:354
Bool m_useTransformSkip
flag for enabling intra transform skipping
Definition: TAppEncCfg.h:148
Void xCheckParameter()
check validity of configuration values
Int m_rwpSEIPackedPictureHeight
Definition: TAppEncCfg.h:399
Int m_iGOPSize
GOP size of hierarchical structure.
Definition: TAppEncCfg.h:137
Int m_sliceSegmentArgument
argument according to selected slice segment mode
Definition: TAppEncCfg.h:266
static istream & operator>>(istream &in, Tier &tier)
Definition: TAppEncCfg.cpp:409
Int m_numRefIdc
Definition: TEncCfg.h:71
Int m_bipredSearchRange
ME search range for bipred refinement.
Definition: TAppEncCfg.h:254
Bool m_entropyCodingSyncEnabledFlag
Definition: TAppEncCfg.h:275
Double m_QPOffsetModelOffset
Definition: TEncCfg.h:54
Bool m_cabacZeroWordPaddingEnabled
Definition: TAppEncCfg.h:116
Bool m_pictureTimingSEIEnabled
Definition: TAppEncCfg.h:285
UInt m_summaryVerboseness
Specifies the level of the verboseness of the text output.
Definition: TAppEncCfg.h:492
Handle encoder configuration parameters (header)
std::vector< UChar > m_rwpSEIRwpBottomGuardBandHeight
Definition: TAppEncCfg.h:413
Bool m_cabacBypassAlignmentEnabledFlag
Definition: TAppEncCfg.h:156
SliceConstraint
Definition: TypeDef.h:514
Profile::Name m_profile
Definition: TAppEncCfg.h:121
Bool m_printFrameMSE
Definition: TAppEncCfg.h:111
UInt m_uiQuadtreeTULog2MinSize
Definition: TAppEncCfg.h:203
Int m_nominalBlackLevelLumaCodeValue
Definition: TAppEncCfg.h:310
Bool m_cmpSEIEnabled
Definition: TAppEncCfg.h:386
Int m_inputFileWidth
width of image in input file (this is equivalent to sourceWidth, if sourceWidth is not subsequently a...
Definition: TAppEncCfg.h:87
Bool m_printSequenceMSE
Definition: TAppEncCfg.h:112
ChromaFormat m_chromaFormatIDC
Definition: TAppEncCfg.h:217
ChromaFormat
chroma formats (according to semantics of chroma_format_idc)
Definition: TypeDef.h:292
WeightedPredictionMethod m_weightedPredictionMethod
Definition: TAppEncCfg.h:423
Bool m_progressiveSourceFlag
Definition: TAppEncCfg.h:129
Double m_adLambdaModifier[MAX_TLAYER]
Lambda modifier array for each temporal layer.
Definition: TAppEncCfg.h:77
std::vector< UInt > m_omniViewportSEIVerRange
Definition: TAppEncCfg.h:383
Bool m_bClipForBiPredMeEnabled
Enables clipping for Bi-Pred ME.
Definition: TAppEncCfg.h:256
Bool m_printMSEBasedSequencePSNR
Definition: TAppEncCfg.h:110
Int m_intraQPOffset
QP offset for intra slice (integer)
Definition: TAppEncCfg.h:166
static struct MapStrToCostMode strToCostMode[]
Bool m_frameFieldInfoPresentFlag
Indicates that pic_struct values are present in picture timing SEI messages.
Definition: TAppEncCfg.h:474
Limit maximum number of largest coding tree units in a slice / slice segments.
Definition: TypeDef.h:517
Bool m_nonPackedConstraintFlag
Definition: TAppEncCfg.h:131
Int m_sliceArgument
argument according to selected slice mode
Definition: TAppEncCfg.h:264
Bool m_useRDOQ
flag for using RD optimized quantization
Definition: TAppEncCfg.h:246
Double chromaCbQpScale
Chroma Cb QP Scale (1.0:default)
Definition: TypeDef.h:901
Bool discontinuityFlag
Definition: TypeDef.h:867
SMultiValueInput< T > & operator=(const std::vector< T > &userValues)
Definition: TAppEncCfg.cpp:444
CostMode
Definition: TypeDef.h:620
Bool m_bUseCbfFastMode
flag for using Cbf Fast PU Mode Decision
Definition: TAppEncCfg.h:261
std::string m_dQPFileName
QP offset for each slice (initialized from external file)
Definition: TAppEncCfg.h:169
Bool m_toneMapCancelFlag
Definition: TAppEncCfg.h:291
Int m_exposureIndexIdc
Definition: TAppEncCfg.h:303
static const UInt LUMA_LEVEL_TO_DQP_LUT_MAXSIZE
max LUT size for QP offset based on luma
Definition: CommonDef.h:246
Int m_CrQPoffset
Definition: TEncCfg.h:58
UInt m_log2SaoOffsetScale[MAX_NUM_CHANNEL_TYPE]
number of bits for the upward bit shift operation on the decoded SAO offsets
Definition: TAppEncCfg.h:147
Bool m_chromaLocInfoPresentFlag
Signals whether chroma_sample_loc_type_top_field and chroma_sample_loc_type_bottom_field are present...
Definition: TAppEncCfg.h:465
Bool m_useWeightedBiPred
Use of bi-directional weighted prediction in B slices.
Definition: TAppEncCfg.h:422
std::vector< UChar > m_rwpSEIRwpGuardBandType
Definition: TAppEncCfg.h:415
Bool m_videoSignalTypePresentFlag
Signals whether video_format, video_full_range_flag, and colour_description_present_flag are present...
Definition: TAppEncCfg.h:458
Bool m_rdpcmEnabledFlag[NUMBER_OF_RDPCM_SIGNALLING_MODES]
control flags for residual DPCM
Definition: TAppEncCfg.h:153
void parseConfigFile(Options &opts, const string &filename, ErrorReporter &error_reporter)
const TChar * str
Definition: TAppEncCfg.cpp:212
Bool m_scalableNestingSEIEnabled
Definition: TAppEncCfg.h:331
Name
Definition: TypeDef.h:599
Bool m_RCUseLCUSeparateModel
use separate R-lambda model at LCU level NOTE: code-tidy - rename to m_RCUseCtuSeparateModel ...
Definition: TAppEncCfg.h:434
virtual ~TAppEncCfg()
Definition: TAppEncCfg.cpp:127
Void destroy()
destroy option handling class
Definition: TAppEncCfg.cpp:154
LumaLevelToDQPMode
Definition: TypeDef.h:742
Bool minutesFlag
Definition: TypeDef.h:874
UInt m_uiPCMLog2MinSize
log2 of minimum PCM block size
Definition: TAppEncCfg.h:239
static const UIProfileName validRExtProfileNames[2][4][4]
Definition: TAppEncCfg.cpp:281
Bool m_bReWriteParamSetsFlag
Flag to enable rewriting of parameter sets at random access points.
Definition: TAppEncCfg.h:139
Bool m_useTransformSkipFast
flag for enabling fast intra transform skipping
Definition: TAppEncCfg.h:149
Int m_iSourceHeightOrg
original source height in pixel (when interlaced = frame height)
Definition: TAppEncCfg.h:90
Int m_minSpatialSegmentationIdc
Indicates the maximum size of the spatial segments in the pictures in the coded video sequence...
Definition: TAppEncCfg.h:480
UInt m_bitDepthConstraint
Definition: TAppEncCfg.h:124
Int m_rwpSEIPackedPictureWidth
Definition: TAppEncCfg.h:398
Bool m_bEfficientFieldIRAPEnabled
enable an efficient field IRAP structure.
Definition: TAppEncCfg.h:94
static const Int MAX_TLAYER
Explicit temporal layer QP offset - max number of temporal layer.
Definition: CommonDef.h:134
std::string getListOfColourSpaceConverts(const Bool bIsForward)
Bool m_tileUniformSpacingFlag
Definition: TAppEncCfg.h:270
std::vector< UShort > m_rwpSEIPackedRegionTop
Definition: TAppEncCfg.h:408
Bool m_bTestSAODisableAtPictureLevel
Definition: TAppEncCfg.h:224
UInt m_uiQuadtreeTUMaxDepthIntra
Definition: TAppEncCfg.h:206
UIProfileName
Definition: TAppEncCfg.cpp:58
ScalingListMode
Definition: TypeDef.h:497
Bool m_bPCMFilterDisableFlag
PCM filter disable flag.
Definition: TAppEncCfg.h:240
InputColourSpaceConversion m_inputColourSpaceConvert
colour space conversion to apply to input video
Definition: TAppEncCfg.h:105
const std::size_t maxNumValuesIncl
Definition: TAppEncCfg.cpp:436
Bool m_bUseAdaptQpSelect
Definition: TAppEncCfg.h:184
std::vector< T > values
Definition: TAppEncCfg.cpp:437
Bool m_segmentedRectFramePackingSEIPersistence
Definition: TAppEncCfg.h:324
Bool m_printMSSSIM
Definition: TAppEncCfg.h:114
Int * m_startOfCodedInterval
Definition: TAppEncCfg.h:313
Bool m_saoResetEncoderStateAfterIRAP
When true, SAO encoder state will be reset following an IRAP.
Definition: TAppEncCfg.h:229
Int m_chromaResamplingVerFilterIdc
Definition: TAppEncCfg.h:289
Int m_framePackingSEIType
Definition: TAppEncCfg.h:317
Bool m_bRestrictMESampling
Restrict sampling for the Selective ME.
Definition: TAppEncCfg.h:252
Int m_numRefPicsActive
Definition: TEncCfg.h:64
Int secondsValue
Definition: TypeDef.h:870
Int m_toneMapMinValue
Definition: TAppEncCfg.h:296
UShort whitePoint[2]
Definition: TypeDef.h:886
Int m_aspectRatioIdc
aspect_ratio_idc
Definition: TAppEncCfg.h:453
const TChar * str
Definition: TAppEncCfg.cpp:341
#define RNSEI
Support for signalling regional nesting SEI message.
Definition: TypeDef.h:103
Int m_timeCodeSEINumTs
Definition: TAppEncCfg.h:337
CostMode m_costMode
Cost mode to use.
Definition: TAppEncCfg.h:445
Tier
Definition: TypeDef.h:592
std::vector< Double > m_adIntraLambdaModifier
Lambda modifier for Intra pictures, one for each temporal layer. If size&gt;temporalLayer, then use [temporalLayer], else if size&gt;0, use [size()-1], else use m_adLambdaModifier.
Definition: TAppEncCfg.h:78
Int m_sigmoidMidpoint
Definition: TAppEncCfg.h:298
static Int getWinUnitX(Int chromaFormatIdc)
Definition: TComSlice.h:829
Int m_numTileColumnsMinus1
Definition: TAppEncCfg.h:271
WeightedPredictionMethod
Definition: TypeDef.h:628
Int m_maxDecPicBuffering[MAX_TLAYER]
total number of pictures in the decoded picture buffer
Definition: TAppEncCfg.h:144
Bool m_ccvSEICancelFlag
Definition: TAppEncCfg.h:346
Bool m_bDisableIntraPUsInInterSlices
Flag for disabling intra predicted PUs in inter slices.
Definition: TAppEncCfg.h:250
UInt m_uiQuadtreeTUMaxDepthInter
Definition: TAppEncCfg.h:205
Bool m_RCCpbSaturationEnabled
enable target bits saturation to avoid CPB overflow and underflow
Definition: TAppEncCfg.h:437
#define MCTS_ENC_CHECK
Temporal MCTS encoder constraint and decoder checks. Also requires SEITMCTSTileConstraint to be enabl...
Definition: TypeDef.h:97
Bool m_bUseASR
flag for using adaptive motion search range
Definition: TAppEncCfg.h:244
ScalingListMode value
Definition: TAppEncCfg.cpp:355
UInt m_maxNumMergeCand
Max number of merge candidates.
Definition: TAppEncCfg.h:426
Int m_numPivots
Definition: TAppEncCfg.h:300
Bool m_ccvSEIPersistenceFlag
Definition: TAppEncCfg.h:347
TComSEITimeSet m_timeSetArray[MAX_TIMECODE_SEI_SETS]
Definition: TAppEncCfg.h:338
UInt m_erpSEILeftGuardBandWidth
Definition: TAppEncCfg.h:364
std::vector< Bool > m_rwpSEIRwpGuardBandNotUsedForPredFlag
Definition: TAppEncCfg.h:414
Bool m_chromaResamplingFilterSEIenabled
Definition: TAppEncCfg.h:287
static Void automaticallySelectRExtProfile(const Bool bUsingGeneralRExtTools, const Bool bUsingChromaQPAdjustment, const Bool bUsingExtendedPrecision, const Bool bIntraConstraintFlag, UInt &bitDepthConstraint, ChromaFormat &chromaFormatConstraint, const Int maxBitDepth, const ChromaFormat chromaFormat)
Definition: TAppEncCfg.cpp:564
Level::Name m_level
Definition: TAppEncCfg.h:123
Int m_rwpSEINumPackedRegions
Definition: TAppEncCfg.h:395
Bool m_refPic
Definition: TEncCfg.h:63
Int m_diffCuChromaQpOffsetDepth
If negative, then do not apply chroma qp offsets.
Definition: TAppEncCfg.h:174
Bool m_enableIntraReferenceSmoothing
flag for enabling(default)/disabling intra reference smoothing/filtering
Definition: TAppEncCfg.h:241
Bool m_segmentedRectFramePackingSEIEnabled
Definition: TAppEncCfg.h:321
std::vector< UChar > m_rwpSEIRwpLeftGuardBandWidth
Definition: TAppEncCfg.h:410
int Int
Definition: TypeDef.h:211
MESearchMethod m_motionEstimationSearchMethod
Definition: TAppEncCfg.h:251
static UInt getMaxCUDepthOffset(const ChromaFormat chFmt, const UInt quadtreeTULog2MinSize)
Bool m_tmctsSEITileConstraint
Definition: TAppEncCfg.h:334
Bool m_rwpSEIRwpCancelFlag
Definition: TAppEncCfg.h:392
UInt m_uiMaxTotalCUDepth
max. total CU depth - includes depth of transform-block structure
Definition: TAppEncCfg.h:198
Bool m_reconBasedCrossCPredictionEstimate
causes the alpha calculation in encoder search to be based on the decoded residual rather than the pr...
Definition: TAppEncCfg.h:146
Rate control manager class.
Void xPrintParameter()
print configuration values
Bool m_bUseConstrainedIntraPred
flag for using constrained intra prediction
Definition: TAppEncCfg.h:277
Int m_defDispWinBottomOffset
Specifies the bottom offset from the conformance window of the default window.
Definition: TAppEncCfg.h:473
std::string m_regionalNestingSEIFileRoot
Definition: TAppEncCfg.h:487
UInt m_uiDeltaQpRD
dQP range for multi-pass slice QP optimization
Definition: TAppEncCfg.h:172
Bool m_persistentRiceAdaptationEnabledFlag
control flag for Golomb-Rice parameter adaptation over each slice
Definition: TAppEncCfg.h:155
std::vector< UInt > m_omniViewportSEIHorRange
Definition: TAppEncCfg.h:382
Int m_TMVPModeId
Definition: TAppEncCfg.h:428
Bool m_erpSEIEnabled
Definition: TAppEncCfg.h:359
Bool m_defaultDisplayWindowFlag
Indicates the presence of the default window parameters.
Definition: TAppEncCfg.h:469
Bool m_overscanAppropriateFlag
Indicates whether conformant decoded pictures are suitable for display using overscan.
Definition: TAppEncCfg.h:457
Int m_internalBitDepth[MAX_NUM_CHANNEL_TYPE]
bit-depth codec operates at (input/output files will be converted)
Definition: TAppEncCfg.h:212
Int m_sphereRotationSEIRoll
Definition: TAppEncCfg.h:372
Bool fullTimeStampFlag
Definition: TypeDef.h:866
Int m_refScreenLuminanceWhite
Definition: TAppEncCfg.h:308
Int m_defDispWinLeftOffset
Specifies the left offset from the conformance window of the default window.
Definition: TAppEncCfg.h:470
Int m_temporalId
Definition: TEncCfg.h:62
Bool m_bUseHADME
flag for using HAD in sub-pel ME
Definition: TAppEncCfg.h:245
Bool m_onePictureOnlyConstraintFlag
Definition: TAppEncCfg.h:127
Int m_iSearchRange
ME search range.
Definition: TAppEncCfg.h:253
SliceConstraint m_sliceSegmentMode
Definition: TAppEncCfg.h:265
Int m_RCTargetBitrate
target bitrate when rate control is enabled
Definition: TAppEncCfg.h:431
Int timeOffsetLength
Definition: TypeDef.h:876
Bool m_bClipInputVideoToRec709Range
Definition: TAppEncCfg.h:117
double Double
Definition: TypeDef.h:213
Int m_framePackingSEIQuincunx
Definition: TAppEncCfg.h:319
Bool m_neutralChromaIndicationFlag
Indicates that the value of all decoded chroma samples is equal to 1&lt;&lt;(BitDepthCr-1) ...
Definition: TAppEncCfg.h:468
Bool m_interlacedSourceFlag
Definition: TAppEncCfg.h:130
SMultiValueInput(const T &minValue, const T &maxValue, std::size_t minNumberValues=0, std::size_t maxNumberValues=0)
Definition: TAppEncCfg.cpp:440
Int m_rwpSEIProjPictureHeight
Definition: TAppEncCfg.h:397
static const Int MAX_TIMECODE_SEI_SETS
Maximum number of time sets.
Definition: CommonDef.h:218
Int m_sliceChromaQpOffsetIntraOrPeriodic[2]
Chroma Cb QP Offset at slice level for I slice or for periodic inter slices as defined by SliceChroma...
Definition: TAppEncCfg.h:181
Int m_numTicksPocDiffOneMinus1
Number of ticks minus 1 that for a POC difference of one.
Definition: TAppEncCfg.h:476
Bool m_CUTransquantBypassFlagForce
if transquant_bypass_enabled_flag, then, if true, all CU transquant bypass flags will be set to true...
Definition: TAppEncCfg.h:444
std::vector< UInt > m_rwpSEIRwpSEIProjRegionTop
Definition: TAppEncCfg.h:404
Bool m_usePCM
flag for using IPCM
Definition: TAppEncCfg.h:237
const TChar * str
Definition: TAppEncCfg.cpp:299
static const Int MAX_QP
Definition: CommonDef.h:126
std::istringstream & operator>>(std::istringstream &in, GOPEntry &entry)
Definition: TAppEncCfg.cpp:158
Double m_RCInitialCpbFullness
initial CPB fullness
Definition: TAppEncCfg.h:439
Bool m_temporalLevel0IndexSEIEnabled
Definition: TAppEncCfg.h:326
Bool cntDroppedFlag
Definition: TypeDef.h:868
Int m_nominalWhiteLevelLumaCodeValue
Definition: TAppEncCfg.h:311
Int m_extraRPSs
extra RPSs added to handle CRA
Definition: TAppEncCfg.h:141
std::vector< Int > m_omniViewportSEIElevationCentre
Definition: TAppEncCfg.h:380
Int m_rwpSEIProjPictureWidth
Definition: TAppEncCfg.h:396
Bool m_erpSEIGuardBandFlag
Definition: TAppEncCfg.h:362
Int m_maxTempLayer
Max temporal layer.
Definition: TAppEncCfg.h:191
Bool m_bFastMEForGenBLowDelayEnabled
Definition: TAppEncCfg.h:279
Int m_referencePics[MAX_NUM_REF_PICS]
Definition: TEncCfg.h:67
Bool m_pocProportionalToTimingFlag
Indicates that the POC value is proportional to the output time w.r.t. first picture in CVS...
Definition: TAppEncCfg.h:475
OptionalValue< UInt > m_qpIncrementAtSourceFrame
Optional source frame number at which all subsequent frames are to use an increased internal QP...
Definition: TAppEncCfg.h:160
HashType m_decodedPictureHashSEIType
Checksum mode for decoded picture hash SEI message.
Definition: TAppEncCfg.h:282
Bool m_useFastDecisionForMerge
flag for using Fast Decision Merge RD-Cost
Definition: TAppEncCfg.h:260
Int m_aiPad[2]
number of padded pixels for width and height
Definition: TAppEncCfg.h:103
UInt m_log2MaxTransformSkipBlockSize
transform-skip maximum size (minimum of 2)
Definition: TAppEncCfg.h:150
Int m_log2MaxMvLengthVertical
Indicate the maximum absolute value of a decoded vertical MV component in quarter-pel luma units...
Definition: TAppEncCfg.h:484
Bool m_decodingUnitInfoSEIEnabled
Definition: TAppEncCfg.h:329
Int m_framesToBeEncoded
number of encoded frames
Definition: TAppEncCfg.h:102
Int m_numTileRowsMinus1
Definition: TAppEncCfg.h:272
Int m_extendedRangeWhiteLevel
Definition: TAppEncCfg.h:309
UInt m_uiMaxCUHeight
max. CU height in pixel
Definition: TAppEncCfg.h:196
Int m_iMaxDeltaQP
max. |delta QP|
Definition: TAppEncCfg.h:171
SMultiValueInput< T > & operator=(const SMultiValueInput< T > &userValues)
Definition: TAppEncCfg.cpp:445
Double m_QPFactor
Definition: TEncCfg.h:59
Int m_iMaxCuDQPDepth
Max. depth for a minimum CuDQPSize (0:default)
Definition: TAppEncCfg.h:173
Bool m_lambdaFromQPEnable
enable flag for QP:lambda fix
Definition: TAppEncCfg.h:167
UShort primaries[3][2]
Definition: TypeDef.h:885
Bool m_bLFCrossSliceBoundaryFlag
1: filter across slice boundaries 0: do not filter across slice boundaries
Definition: TAppEncCfg.h:268
Bool m_kneeSEIEnabled
Definition: TAppEncCfg.h:339