[313] | 1 | /* The copyright in this software is being made available under the BSD |
---|
| 2 | * License, included below. This software may be subject to other third party |
---|
| 3 | * and contributor rights, including patent rights, and no such rights are |
---|
| 4 | * granted under this license. |
---|
| 5 | * |
---|
| 6 | * Copyright (c) 2010-2013, 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 | |
---|
| 34 | /** \file TAppEncCfg.cpp |
---|
| 35 | \brief Handle encoder configuration parameters |
---|
| 36 | */ |
---|
| 37 | |
---|
| 38 | #include <stdlib.h> |
---|
| 39 | #include <cassert> |
---|
| 40 | #include <cstring> |
---|
| 41 | #include <string> |
---|
| 42 | #include "TLibCommon/TComRom.h" |
---|
| 43 | #include "TAppEncCfg.h" |
---|
| 44 | |
---|
| 45 | static istream& operator>>(istream &, Level::Name &); |
---|
| 46 | static istream& operator>>(istream &, Level::Tier &); |
---|
| 47 | static istream& operator>>(istream &, Profile::Name &); |
---|
| 48 | |
---|
| 49 | #include "TAppCommon/program_options_lite.h" |
---|
| 50 | #include "TLibEncoder/TEncRateCtrl.h" |
---|
| 51 | #ifdef WIN32 |
---|
| 52 | #define strdup _strdup |
---|
| 53 | #endif |
---|
| 54 | |
---|
| 55 | using namespace std; |
---|
| 56 | namespace po = df::program_options_lite; |
---|
| 57 | |
---|
| 58 | //! \ingroup TAppEncoder |
---|
| 59 | //! \{ |
---|
| 60 | |
---|
| 61 | // ==================================================================================================================== |
---|
| 62 | // Constructor / destructor / initialization / destroy |
---|
| 63 | // ==================================================================================================================== |
---|
| 64 | |
---|
| 65 | #if SVC_EXTENSION |
---|
| 66 | TAppEncCfg::TAppEncCfg() |
---|
| 67 | : m_pBitstreamFile() |
---|
| 68 | #if AVC_BASE |
---|
| 69 | , m_avcBaseLayerFlag(0) |
---|
| 70 | #endif |
---|
[442] | 71 | #if N0120_MAX_TID_REF_CFG |
---|
| 72 | , m_maxTidRefPresentFlag(1) |
---|
| 73 | #endif |
---|
[313] | 74 | , m_pColumnWidth() |
---|
| 75 | , m_pRowHeight() |
---|
| 76 | , m_scalingListFile() |
---|
| 77 | , m_elRapSliceBEnabled(0) |
---|
| 78 | { |
---|
| 79 | for(UInt layer=0; layer<MAX_LAYERS; layer++) |
---|
| 80 | { |
---|
| 81 | m_acLayerCfg[layer].setAppEncCfg(this); |
---|
| 82 | #if M0457_IL_SAMPLE_PRED_ONLY_FLAG |
---|
| 83 | m_ilSampleOnlyPred[layer] = 0; |
---|
| 84 | #endif |
---|
| 85 | } |
---|
| 86 | memset( m_scalabilityMask, 0, sizeof(m_scalabilityMask) ); |
---|
| 87 | } |
---|
| 88 | #else |
---|
| 89 | TAppEncCfg::TAppEncCfg() |
---|
| 90 | : m_pchInputFile() |
---|
| 91 | , m_pchBitstreamFile() |
---|
| 92 | , m_pchReconFile() |
---|
| 93 | , m_pchdQPFile() |
---|
| 94 | , m_pColumnWidth() |
---|
| 95 | , m_pRowHeight() |
---|
| 96 | , m_scalingListFile() |
---|
| 97 | { |
---|
| 98 | m_aidQP = NULL; |
---|
| 99 | m_startOfCodedInterval = NULL; |
---|
| 100 | m_codedPivotValue = NULL; |
---|
| 101 | m_targetPivotValue = NULL; |
---|
| 102 | } |
---|
| 103 | #endif |
---|
| 104 | |
---|
| 105 | TAppEncCfg::~TAppEncCfg() |
---|
| 106 | { |
---|
| 107 | #if SVC_EXTENSION |
---|
| 108 | free(m_pBitstreamFile); |
---|
| 109 | #else |
---|
| 110 | free(m_pchBitstreamFile); |
---|
| 111 | if ( m_aidQP ) |
---|
| 112 | { |
---|
| 113 | delete[] m_aidQP; |
---|
| 114 | } |
---|
| 115 | if ( m_startOfCodedInterval ) |
---|
| 116 | { |
---|
| 117 | delete[] m_startOfCodedInterval; |
---|
| 118 | m_startOfCodedInterval = NULL; |
---|
| 119 | } |
---|
| 120 | if ( m_codedPivotValue ) |
---|
| 121 | { |
---|
| 122 | delete[] m_codedPivotValue; |
---|
| 123 | m_codedPivotValue = NULL; |
---|
| 124 | } |
---|
| 125 | if ( m_targetPivotValue ) |
---|
| 126 | { |
---|
| 127 | delete[] m_targetPivotValue; |
---|
| 128 | m_targetPivotValue = NULL; |
---|
| 129 | } |
---|
| 130 | free(m_pchInputFile); |
---|
| 131 | #endif |
---|
| 132 | #if !SVC_EXTENSION |
---|
| 133 | free(m_pchReconFile); |
---|
| 134 | free(m_pchdQPFile); |
---|
| 135 | #endif |
---|
| 136 | free(m_pColumnWidth); |
---|
| 137 | free(m_pRowHeight); |
---|
| 138 | free(m_scalingListFile); |
---|
| 139 | } |
---|
| 140 | |
---|
| 141 | Void TAppEncCfg::create() |
---|
| 142 | { |
---|
| 143 | } |
---|
| 144 | |
---|
| 145 | Void TAppEncCfg::destroy() |
---|
| 146 | { |
---|
| 147 | #if VPS_EXTN_DIRECT_REF_LAYERS |
---|
| 148 | #if M0457_PREDICTION_INDICATIONS |
---|
| 149 | for(Int layer = 0; layer < MAX_LAYERS; layer++) |
---|
| 150 | { |
---|
| 151 | if( m_acLayerCfg[layer].m_numSamplePredRefLayers > 0 ) |
---|
| 152 | { |
---|
| 153 | delete [] m_acLayerCfg[layer].m_samplePredRefLayerIds; |
---|
| 154 | } |
---|
| 155 | } |
---|
| 156 | for(Int layer = 0; layer < MAX_LAYERS; layer++) |
---|
| 157 | { |
---|
| 158 | if( m_acLayerCfg[layer].m_numMotionPredRefLayers > 0 ) |
---|
| 159 | { |
---|
| 160 | delete [] m_acLayerCfg[layer].m_motionPredRefLayerIds; |
---|
| 161 | } |
---|
| 162 | } |
---|
| 163 | #else |
---|
| 164 | for(Int layer = 0; layer < MAX_LAYERS; layer++) |
---|
| 165 | { |
---|
| 166 | if( m_acLayerCfg[layer].m_numDirectRefLayers > 0 ) |
---|
| 167 | { |
---|
| 168 | delete [] m_acLayerCfg[layer].m_refLayerIds; |
---|
| 169 | } |
---|
| 170 | } |
---|
| 171 | #endif |
---|
| 172 | for(Int layer = 0; layer < MAX_LAYERS; layer++) |
---|
| 173 | { |
---|
| 174 | if( m_acLayerCfg[layer].m_numActiveRefLayers > 0 ) |
---|
| 175 | { |
---|
| 176 | delete [] m_acLayerCfg[layer].m_predLayerIds; |
---|
| 177 | } |
---|
| 178 | } |
---|
| 179 | #endif |
---|
| 180 | } |
---|
| 181 | |
---|
| 182 | std::istringstream &operator>>(std::istringstream &in, GOPEntry &entry) //input |
---|
| 183 | { |
---|
| 184 | in>>entry.m_sliceType; |
---|
| 185 | in>>entry.m_POC; |
---|
| 186 | in>>entry.m_QPOffset; |
---|
| 187 | in>>entry.m_QPFactor; |
---|
| 188 | in>>entry.m_tcOffsetDiv2; |
---|
| 189 | in>>entry.m_betaOffsetDiv2; |
---|
| 190 | in>>entry.m_temporalId; |
---|
| 191 | in>>entry.m_numRefPicsActive; |
---|
| 192 | in>>entry.m_numRefPics; |
---|
| 193 | for ( Int i = 0; i < entry.m_numRefPics; i++ ) |
---|
| 194 | { |
---|
| 195 | in>>entry.m_referencePics[i]; |
---|
| 196 | } |
---|
| 197 | in>>entry.m_interRPSPrediction; |
---|
| 198 | #if AUTO_INTER_RPS |
---|
| 199 | if (entry.m_interRPSPrediction==1) |
---|
| 200 | { |
---|
| 201 | in>>entry.m_deltaRPS; |
---|
| 202 | in>>entry.m_numRefIdc; |
---|
| 203 | for ( Int i = 0; i < entry.m_numRefIdc; i++ ) |
---|
| 204 | { |
---|
| 205 | in>>entry.m_refIdc[i]; |
---|
| 206 | } |
---|
| 207 | } |
---|
| 208 | else if (entry.m_interRPSPrediction==2) |
---|
| 209 | { |
---|
| 210 | in>>entry.m_deltaRPS; |
---|
| 211 | } |
---|
| 212 | #else |
---|
| 213 | if (entry.m_interRPSPrediction) |
---|
| 214 | { |
---|
| 215 | in>>entry.m_deltaRPS; |
---|
| 216 | in>>entry.m_numRefIdc; |
---|
| 217 | for ( Int i = 0; i < entry.m_numRefIdc; i++ ) |
---|
| 218 | { |
---|
| 219 | in>>entry.m_refIdc[i]; |
---|
| 220 | } |
---|
| 221 | } |
---|
| 222 | #endif |
---|
| 223 | return in; |
---|
| 224 | } |
---|
| 225 | |
---|
[475] | 226 | #if AUXILIARY_PICTURES |
---|
| 227 | static inline ChromaFormat numberToChromaFormat(const Int val) |
---|
| 228 | { |
---|
| 229 | switch (val) |
---|
| 230 | { |
---|
| 231 | case 400: return CHROMA_400; break; |
---|
| 232 | case 420: return CHROMA_420; break; |
---|
| 233 | case 422: return CHROMA_422; break; |
---|
| 234 | case 444: return CHROMA_444; break; |
---|
| 235 | default: return NUM_CHROMA_FORMAT; |
---|
| 236 | } |
---|
| 237 | } |
---|
| 238 | #endif |
---|
| 239 | |
---|
[313] | 240 | #if SVC_EXTENSION |
---|
| 241 | void TAppEncCfg::getDirFilename(string& filename, string& dir, const string path) |
---|
| 242 | { |
---|
| 243 | size_t pos = path.find_last_of("\\"); |
---|
| 244 | if(pos != std::string::npos) |
---|
| 245 | { |
---|
| 246 | filename.assign(path.begin() + pos + 1, path.end()); |
---|
| 247 | dir.assign(path.begin(), path.begin() + pos + 1); |
---|
| 248 | } |
---|
| 249 | else |
---|
| 250 | { |
---|
| 251 | pos = path.find_last_of("/"); |
---|
| 252 | if(pos != std::string::npos) |
---|
| 253 | { |
---|
| 254 | filename.assign(path.begin() + pos + 1, path.end()); |
---|
| 255 | dir.assign(path.begin(), path.begin() + pos + 1); |
---|
| 256 | } |
---|
| 257 | else |
---|
| 258 | { |
---|
| 259 | filename = path; |
---|
| 260 | dir.assign(""); |
---|
| 261 | } |
---|
| 262 | } |
---|
| 263 | } |
---|
| 264 | #endif |
---|
| 265 | |
---|
| 266 | static const struct MapStrToProfile { |
---|
| 267 | const Char* str; |
---|
| 268 | Profile::Name value; |
---|
| 269 | } strToProfile[] = { |
---|
| 270 | {"none", Profile::NONE}, |
---|
| 271 | {"main", Profile::MAIN}, |
---|
| 272 | {"main10", Profile::MAIN10}, |
---|
| 273 | {"main-still-picture", Profile::MAINSTILLPICTURE}, |
---|
| 274 | }; |
---|
| 275 | |
---|
| 276 | static const struct MapStrToTier { |
---|
| 277 | const Char* str; |
---|
| 278 | Level::Tier value; |
---|
| 279 | } strToTier[] = { |
---|
| 280 | {"main", Level::MAIN}, |
---|
| 281 | {"high", Level::HIGH}, |
---|
| 282 | }; |
---|
| 283 | |
---|
| 284 | static const struct MapStrToLevel { |
---|
| 285 | const Char* str; |
---|
| 286 | Level::Name value; |
---|
| 287 | } strToLevel[] = { |
---|
| 288 | {"none",Level::NONE}, |
---|
| 289 | {"1", Level::LEVEL1}, |
---|
| 290 | {"2", Level::LEVEL2}, |
---|
| 291 | {"2.1", Level::LEVEL2_1}, |
---|
| 292 | {"3", Level::LEVEL3}, |
---|
| 293 | {"3.1", Level::LEVEL3_1}, |
---|
| 294 | {"4", Level::LEVEL4}, |
---|
| 295 | {"4.1", Level::LEVEL4_1}, |
---|
| 296 | {"5", Level::LEVEL5}, |
---|
| 297 | {"5.1", Level::LEVEL5_1}, |
---|
| 298 | {"5.2", Level::LEVEL5_2}, |
---|
| 299 | {"6", Level::LEVEL6}, |
---|
| 300 | {"6.1", Level::LEVEL6_1}, |
---|
| 301 | {"6.2", Level::LEVEL6_2}, |
---|
| 302 | }; |
---|
| 303 | |
---|
| 304 | template<typename T, typename P> |
---|
| 305 | static istream& readStrToEnum(P map[], unsigned long mapLen, istream &in, T &val) |
---|
| 306 | { |
---|
| 307 | string str; |
---|
| 308 | in >> str; |
---|
| 309 | |
---|
| 310 | for (Int i = 0; i < mapLen; i++) |
---|
| 311 | { |
---|
| 312 | if (str == map[i].str) |
---|
| 313 | { |
---|
| 314 | val = map[i].value; |
---|
| 315 | goto found; |
---|
| 316 | } |
---|
| 317 | } |
---|
| 318 | /* not found */ |
---|
| 319 | in.setstate(ios::failbit); |
---|
| 320 | found: |
---|
| 321 | return in; |
---|
| 322 | } |
---|
| 323 | |
---|
| 324 | static istream& operator>>(istream &in, Profile::Name &profile) |
---|
| 325 | { |
---|
| 326 | return readStrToEnum(strToProfile, sizeof(strToProfile)/sizeof(*strToProfile), in, profile); |
---|
| 327 | } |
---|
| 328 | |
---|
| 329 | static istream& operator>>(istream &in, Level::Tier &tier) |
---|
| 330 | { |
---|
| 331 | return readStrToEnum(strToTier, sizeof(strToTier)/sizeof(*strToTier), in, tier); |
---|
| 332 | } |
---|
| 333 | |
---|
| 334 | static istream& operator>>(istream &in, Level::Name &level) |
---|
| 335 | { |
---|
| 336 | return readStrToEnum(strToLevel, sizeof(strToLevel)/sizeof(*strToLevel), in, level); |
---|
| 337 | } |
---|
| 338 | |
---|
| 339 | // ==================================================================================================================== |
---|
| 340 | // Public member functions |
---|
| 341 | // ==================================================================================================================== |
---|
| 342 | |
---|
| 343 | /** \param argc number of arguments |
---|
| 344 | \param argv array of arguments |
---|
| 345 | \retval true when success |
---|
| 346 | */ |
---|
| 347 | Bool TAppEncCfg::parseCfg( Int argc, Char* argv[] ) |
---|
| 348 | { |
---|
| 349 | Bool do_help = false; |
---|
| 350 | |
---|
| 351 | #if SVC_EXTENSION |
---|
[442] | 352 | string cfg_LayerCfgFile [MAX_LAYERS]; |
---|
[313] | 353 | string cfg_BitstreamFile; |
---|
[442] | 354 | string* cfg_InputFile [MAX_LAYERS]; |
---|
| 355 | string* cfg_ReconFile [MAX_LAYERS]; |
---|
| 356 | Double* cfg_fQP [MAX_LAYERS]; |
---|
[313] | 357 | |
---|
[442] | 358 | #if REPN_FORMAT_IN_VPS |
---|
| 359 | Int* cfg_repFormatIdx [MAX_LAYERS]; |
---|
| 360 | #endif |
---|
[313] | 361 | Int* cfg_SourceWidth [MAX_LAYERS]; |
---|
| 362 | Int* cfg_SourceHeight [MAX_LAYERS]; |
---|
| 363 | Int* cfg_FrameRate [MAX_LAYERS]; |
---|
| 364 | Int* cfg_IntraPeriod [MAX_LAYERS]; |
---|
| 365 | Int* cfg_conformanceMode [MAX_LAYERS]; |
---|
[467] | 366 | #if LAYER_CTB |
---|
| 367 | // coding unit (CU) definition |
---|
| 368 | UInt* cfg_uiMaxCUWidth[MAX_LAYERS]; ///< max. CU width in pixel |
---|
| 369 | UInt* cfg_uiMaxCUHeight[MAX_LAYERS]; ///< max. CU height in pixel |
---|
| 370 | UInt* cfg_uiMaxCUDepth[MAX_LAYERS]; ///< max. CU depth |
---|
| 371 | |
---|
| 372 | // transfom unit (TU) definition |
---|
| 373 | UInt* cfg_uiQuadtreeTULog2MaxSize[MAX_LAYERS]; |
---|
| 374 | UInt* cfg_uiQuadtreeTULog2MinSize[MAX_LAYERS]; |
---|
| 375 | |
---|
| 376 | UInt* cfg_uiQuadtreeTUMaxDepthInter[MAX_LAYERS]; |
---|
| 377 | UInt* cfg_uiQuadtreeTUMaxDepthIntra[MAX_LAYERS]; |
---|
| 378 | #endif |
---|
[475] | 379 | #if AUXILIARY_PICTURES |
---|
| 380 | Int cfg_tmpChromaFormatIDC [MAX_LAYERS]; |
---|
| 381 | Int cfg_tmpInputChromaFormat[MAX_LAYERS]; |
---|
| 382 | Int* cfg_auxId [MAX_LAYERS]; |
---|
| 383 | #endif |
---|
[313] | 384 | #if VPS_EXTN_DIRECT_REF_LAYERS |
---|
| 385 | #if M0457_PREDICTION_INDICATIONS |
---|
| 386 | Int* cfg_numSamplePredRefLayers [MAX_LAYERS]; |
---|
| 387 | string cfg_samplePredRefLayerIds [MAX_LAYERS]; |
---|
| 388 | string* cfg_samplePredRefLayerIdsPtr[MAX_LAYERS]; |
---|
| 389 | Int* cfg_numMotionPredRefLayers [MAX_LAYERS]; |
---|
| 390 | string cfg_motionPredRefLayerIds [MAX_LAYERS]; |
---|
| 391 | string* cfg_motionPredRefLayerIdsPtr[MAX_LAYERS]; |
---|
| 392 | #else |
---|
| 393 | Int* cfg_numDirectRefLayers [MAX_LAYERS]; |
---|
| 394 | string cfg_refLayerIds [MAX_LAYERS]; |
---|
| 395 | string* cfg_refLayerIdsPtr [MAX_LAYERS]; |
---|
| 396 | #endif |
---|
| 397 | Int* cfg_numActiveRefLayers [MAX_LAYERS]; |
---|
| 398 | string cfg_predLayerIds [MAX_LAYERS]; |
---|
| 399 | string* cfg_predLayerIdsPtr [MAX_LAYERS]; |
---|
| 400 | #endif |
---|
| 401 | string cfg_scaledRefLayerLeftOffset [MAX_LAYERS]; |
---|
| 402 | string cfg_scaledRefLayerTopOffset [MAX_LAYERS]; |
---|
| 403 | string cfg_scaledRefLayerRightOffset [MAX_LAYERS]; |
---|
| 404 | string cfg_scaledRefLayerBottomOffset [MAX_LAYERS]; |
---|
| 405 | Int* cfg_numScaledRefLayerOffsets[MAX_LAYERS]; |
---|
| 406 | |
---|
| 407 | string* cfg_scaledRefLayerLeftOffsetPtr [MAX_LAYERS]; |
---|
| 408 | string* cfg_scaledRefLayerTopOffsetPtr [MAX_LAYERS]; |
---|
| 409 | string* cfg_scaledRefLayerRightOffsetPtr [MAX_LAYERS]; |
---|
| 410 | string* cfg_scaledRefLayerBottomOffsetPtr [MAX_LAYERS]; |
---|
| 411 | #if RC_SHVC_HARMONIZATION |
---|
| 412 | Bool* cfg_RCEnableRateControl [MAX_LAYERS]; |
---|
| 413 | Int* cfg_RCTargetBitRate [MAX_LAYERS]; |
---|
| 414 | Bool* cfg_RCKeepHierarchicalBit[MAX_LAYERS]; |
---|
| 415 | Bool* cfg_RCLCULevelRC [MAX_LAYERS]; |
---|
| 416 | Bool* cfg_RCUseLCUSeparateModel[MAX_LAYERS]; |
---|
| 417 | Int* cfg_RCInitialQP [MAX_LAYERS]; |
---|
| 418 | Bool* cfg_RCForceIntraQP [MAX_LAYERS]; |
---|
| 419 | #endif |
---|
[466] | 420 | #if O0194_DIFFERENT_BITDEPTH_EL_BL |
---|
| 421 | Int* cfg_InputBitDepthY [MAX_LAYERS]; |
---|
| 422 | Int* cfg_InternalBitDepthY [MAX_LAYERS]; |
---|
| 423 | Int* cfg_InputBitDepthC [MAX_LAYERS]; |
---|
| 424 | Int* cfg_InternalBitDepthC [MAX_LAYERS]; |
---|
| 425 | Int* cfg_OutputBitDepthY [MAX_LAYERS]; |
---|
| 426 | Int* cfg_OutputBitDepthC [MAX_LAYERS]; |
---|
| 427 | #endif |
---|
[442] | 428 | #if N0120_MAX_TID_REF_CFG |
---|
| 429 | Int* cfg_maxTidIlRefPicsPlus1[MAX_LAYERS]; |
---|
| 430 | #endif |
---|
[313] | 431 | for(UInt layer = 0; layer < MAX_LAYERS; layer++) |
---|
| 432 | { |
---|
| 433 | cfg_InputFile[layer] = &m_acLayerCfg[layer].m_cInputFile; |
---|
| 434 | cfg_ReconFile[layer] = &m_acLayerCfg[layer].m_cReconFile; |
---|
| 435 | cfg_fQP[layer] = &m_acLayerCfg[layer].m_fQP; |
---|
[442] | 436 | #if REPN_FORMAT_IN_VPS |
---|
| 437 | cfg_repFormatIdx[layer] = &m_acLayerCfg[layer].m_repFormatIdx; |
---|
| 438 | #endif |
---|
[313] | 439 | cfg_SourceWidth[layer] = &m_acLayerCfg[layer].m_iSourceWidth; |
---|
| 440 | cfg_SourceHeight[layer] = &m_acLayerCfg[layer].m_iSourceHeight; |
---|
| 441 | cfg_FrameRate[layer] = &m_acLayerCfg[layer].m_iFrameRate; |
---|
| 442 | cfg_IntraPeriod[layer] = &m_acLayerCfg[layer].m_iIntraPeriod; |
---|
| 443 | cfg_conformanceMode[layer] = &m_acLayerCfg[layer].m_conformanceMode; |
---|
[467] | 444 | #if LAYER_CTB |
---|
| 445 | // coding unit (CU) definition |
---|
| 446 | cfg_uiMaxCUWidth[layer] = &m_acLayerCfg[layer].m_uiMaxCUWidth; |
---|
| 447 | cfg_uiMaxCUHeight[layer] = &m_acLayerCfg[layer].m_uiMaxCUHeight; |
---|
| 448 | cfg_uiMaxCUDepth[layer] = &m_acLayerCfg[layer].m_uiMaxCUDepth; |
---|
| 449 | |
---|
| 450 | // transfom unit (TU) definition. |
---|
| 451 | cfg_uiQuadtreeTULog2MaxSize[layer] = &m_acLayerCfg[layer].m_uiQuadtreeTULog2MaxSize; |
---|
| 452 | cfg_uiQuadtreeTULog2MinSize[layer] = &m_acLayerCfg[layer].m_uiQuadtreeTULog2MinSize; |
---|
| 453 | |
---|
| 454 | cfg_uiQuadtreeTUMaxDepthInter[layer] = &m_acLayerCfg[layer].m_uiQuadtreeTUMaxDepthInter; |
---|
| 455 | cfg_uiQuadtreeTUMaxDepthIntra[layer] = &m_acLayerCfg[layer].m_uiQuadtreeTUMaxDepthIntra; |
---|
| 456 | #endif |
---|
[313] | 457 | #if VPS_EXTN_DIRECT_REF_LAYERS |
---|
| 458 | #if M0457_PREDICTION_INDICATIONS |
---|
| 459 | cfg_numSamplePredRefLayers [layer] = &m_acLayerCfg[layer].m_numSamplePredRefLayers; |
---|
| 460 | cfg_samplePredRefLayerIdsPtr[layer] = &cfg_samplePredRefLayerIds[layer]; |
---|
| 461 | cfg_numMotionPredRefLayers [layer] = &m_acLayerCfg[layer].m_numMotionPredRefLayers; |
---|
| 462 | cfg_motionPredRefLayerIdsPtr[layer] = &cfg_motionPredRefLayerIds[layer]; |
---|
| 463 | #else |
---|
| 464 | cfg_numDirectRefLayers [layer] = &m_acLayerCfg[layer].m_numDirectRefLayers; |
---|
| 465 | cfg_refLayerIdsPtr [layer] = &cfg_refLayerIds[layer]; |
---|
| 466 | #endif |
---|
| 467 | cfg_numActiveRefLayers [layer] = &m_acLayerCfg[layer].m_numActiveRefLayers; |
---|
| 468 | cfg_predLayerIdsPtr [layer] = &cfg_predLayerIds[layer]; |
---|
| 469 | #endif |
---|
| 470 | cfg_numScaledRefLayerOffsets [layer] = &m_acLayerCfg[layer].m_numScaledRefLayerOffsets; |
---|
| 471 | for(Int i = 0; i < MAX_LAYERS; i++) |
---|
| 472 | { |
---|
| 473 | cfg_scaledRefLayerLeftOffsetPtr [layer] = &cfg_scaledRefLayerLeftOffset[layer] ; |
---|
| 474 | cfg_scaledRefLayerTopOffsetPtr [layer] = &cfg_scaledRefLayerTopOffset[layer] ; |
---|
| 475 | cfg_scaledRefLayerRightOffsetPtr [layer] = &cfg_scaledRefLayerRightOffset[layer] ; |
---|
| 476 | cfg_scaledRefLayerBottomOffsetPtr[layer] = &cfg_scaledRefLayerBottomOffset[layer]; |
---|
| 477 | } |
---|
| 478 | #if RC_SHVC_HARMONIZATION |
---|
| 479 | cfg_RCEnableRateControl[layer] = &m_acLayerCfg[layer].m_RCEnableRateControl; |
---|
| 480 | cfg_RCTargetBitRate[layer] = &m_acLayerCfg[layer].m_RCTargetBitrate; |
---|
| 481 | cfg_RCKeepHierarchicalBit[layer] = &m_acLayerCfg[layer].m_RCKeepHierarchicalBit; |
---|
| 482 | cfg_RCLCULevelRC[layer] = &m_acLayerCfg[layer].m_RCLCULevelRC; |
---|
| 483 | cfg_RCUseLCUSeparateModel[layer] = &m_acLayerCfg[layer].m_RCUseLCUSeparateModel; |
---|
| 484 | cfg_RCInitialQP[layer] = &m_acLayerCfg[layer].m_RCInitialQP; |
---|
| 485 | cfg_RCForceIntraQP[layer] = &m_acLayerCfg[layer].m_RCForceIntraQP; |
---|
| 486 | #endif |
---|
[466] | 487 | #if O0194_DIFFERENT_BITDEPTH_EL_BL |
---|
| 488 | cfg_InputBitDepthY [layer] = &m_acLayerCfg[layer].m_inputBitDepthY; |
---|
| 489 | cfg_InternalBitDepthY[layer] = &m_acLayerCfg[layer].m_internalBitDepthY; |
---|
| 490 | cfg_InputBitDepthC [layer] = &m_acLayerCfg[layer].m_inputBitDepthC; |
---|
| 491 | cfg_InternalBitDepthC[layer] = &m_acLayerCfg[layer].m_internalBitDepthC; |
---|
| 492 | cfg_OutputBitDepthY [layer] = &m_acLayerCfg[layer].m_outputBitDepthY; |
---|
| 493 | cfg_OutputBitDepthC [layer] = &m_acLayerCfg[layer].m_outputBitDepthC; |
---|
| 494 | #endif |
---|
[442] | 495 | #if N0120_MAX_TID_REF_CFG |
---|
| 496 | cfg_maxTidIlRefPicsPlus1[layer] = &m_acLayerCfg[layer].m_maxTidIlRefPicsPlus1; |
---|
| 497 | #endif |
---|
[475] | 498 | #if AUXILIARY_PICTURES |
---|
| 499 | cfg_auxId[layer] = &m_acLayerCfg[layer].m_auxId; |
---|
| 500 | #endif |
---|
[313] | 501 | } |
---|
| 502 | #if AVC_BASE |
---|
| 503 | string cfg_BLInputFile; |
---|
| 504 | #endif |
---|
| 505 | #if AVC_SYNTAX |
---|
| 506 | string cfg_BLSyntaxFile; |
---|
| 507 | #endif |
---|
[442] | 508 | #if N0383_IL_CONSTRAINED_TILE_SETS_SEI |
---|
| 509 | string cfg_tileSets; |
---|
| 510 | #endif |
---|
[467] | 511 | #else //SVC_EXTENSION |
---|
[313] | 512 | string cfg_InputFile; |
---|
| 513 | string cfg_BitstreamFile; |
---|
| 514 | string cfg_ReconFile; |
---|
| 515 | string cfg_dQPFile; |
---|
[467] | 516 | #endif //SVC_EXTENSION |
---|
[313] | 517 | string cfg_ColumnWidth; |
---|
| 518 | string cfg_RowHeight; |
---|
| 519 | string cfg_ScalingListFile; |
---|
| 520 | string cfg_startOfCodedInterval; |
---|
| 521 | string cfg_codedPivotValue; |
---|
| 522 | string cfg_targetPivotValue; |
---|
| 523 | po::Options opts; |
---|
| 524 | opts.addOptions() |
---|
| 525 | ("help", do_help, false, "this help text") |
---|
| 526 | ("c", po::parseConfigFile, "configuration file name") |
---|
| 527 | |
---|
| 528 | // File, I/O and source parameters |
---|
| 529 | #if SVC_EXTENSION |
---|
| 530 | ("InputFile%d,-i%d", cfg_InputFile, string(""), MAX_LAYERS, "original YUV input file name for layer %d") |
---|
| 531 | ("ReconFile%d,-o%d", cfg_ReconFile, string(""), MAX_LAYERS, "reconstruction YUV input file name for layer %d") |
---|
| 532 | ("LayerConfig%d,-lc%d", cfg_LayerCfgFile, string(""), MAX_LAYERS, "layer %d configuration file name") |
---|
| 533 | ("SourceWidth%d,-wdt%d", cfg_SourceWidth, 0, MAX_LAYERS, "Source picture width for layer %d") |
---|
| 534 | ("SourceHeight%d,-hgt%d", cfg_SourceHeight, 0, MAX_LAYERS, "Source picture height for layer %d") |
---|
| 535 | ("FrameRate%d,-fr%d", cfg_FrameRate, 0, MAX_LAYERS, "Frame rate for layer %d") |
---|
| 536 | ("LambdaModifier%d,-LM%d", m_adLambdaModifier, ( double )1.0, MAX_TLAYER, "Lambda modifier for temporal layer %d") |
---|
[464] | 537 | #if O0215_PHASE_ALIGNMENT |
---|
| 538 | ("PhaseAlignment", m_phaseAlignFlag, false, "indicate the sample location alignment between layers (0: zero position aligned, 1: central position aligned)") |
---|
| 539 | #endif |
---|
[442] | 540 | #if REPN_FORMAT_IN_VPS |
---|
| 541 | ("RepFormatIdx%d", cfg_repFormatIdx, -1, MAX_LAYERS, "Index to the representation format structure used from the VPS") |
---|
| 542 | #endif |
---|
[313] | 543 | #if VPS_EXTN_DIRECT_REF_LAYERS |
---|
| 544 | #if M0457_PREDICTION_INDICATIONS |
---|
| 545 | ("NumSamplePredRefLayers%d",cfg_numSamplePredRefLayers, -1, MAX_LAYERS, "Number of sample prediction reference layers") |
---|
| 546 | ("SamplePredRefLayerIds%d", cfg_samplePredRefLayerIdsPtr, string(""), MAX_LAYERS, "sample pred reference layer IDs") |
---|
| 547 | ("NumMotionPredRefLayers%d",cfg_numMotionPredRefLayers, -1, MAX_LAYERS, "Number of motion prediction reference layers") |
---|
| 548 | ("MotionPredRefLayerIds%d", cfg_motionPredRefLayerIdsPtr, string(""), MAX_LAYERS, "motion pred reference layer IDs") |
---|
| 549 | #else |
---|
| 550 | ("NumDirectRefLayers%d", cfg_numDirectRefLayers, -1, MAX_LAYERS, "Number of direct reference layers") |
---|
| 551 | ("RefLayerIds%d", cfg_refLayerIdsPtr, string(""), MAX_LAYERS, "direct reference layer IDs") |
---|
| 552 | #endif |
---|
| 553 | ("NumActiveRefLayers%d", cfg_numActiveRefLayers, -1, MAX_LAYERS, "Number of active reference layers") |
---|
| 554 | ("PredLayerIds%d", cfg_predLayerIdsPtr, string(""), MAX_LAYERS, "inter-layer prediction layer IDs") |
---|
| 555 | #endif |
---|
| 556 | ("NumLayers", m_numLayers, 1, "Number of layers to code") |
---|
[475] | 557 | #if AUXILIARY_PICTURES |
---|
| 558 | ("InputChromaFormat%d", cfg_tmpInputChromaFormat, 420, MAX_LAYERS, "InputChromaFormatIDC for layer %d") |
---|
| 559 | ("ChromaFormatIDC%d,-cf", cfg_tmpChromaFormatIDC, 420, MAX_LAYERS, "ChromaFormatIDC (400|420|422|444 or set 0 (default) for same as InputChromaFormat) for layer %d") |
---|
| 560 | ("AuxId%d", cfg_auxId, 0, MAX_LAYERS, "Auxilary picture ID for layer %d (0: Not aux pic, 1: Alpha plane, 2: Depth picture, 3: Cb enh, 4: Cr enh") |
---|
| 561 | #endif |
---|
[313] | 562 | ("ConformanceMode%d", cfg_conformanceMode,0, MAX_LAYERS, "Window conformance mode (0: no cropping, 1:automatic padding, 2: padding, 3:cropping") |
---|
[442] | 563 | #if SCALABILITY_MASK_E0104 |
---|
| 564 | ("ScalabilityMask1", m_scalabilityMask[1], 0, "scalability_mask[1] (multiview)") |
---|
| 565 | ("ScalabilityMask2", m_scalabilityMask[2], 1, "scalability_mask[2] (scalable)" ) |
---|
[475] | 566 | #if AUXILIARY_PICTURES |
---|
| 567 | ("ScalabilityMask3", m_scalabilityMask[3], 0, "scalability_mask[3] (auxiliary pictures)" ) |
---|
| 568 | #endif |
---|
[442] | 569 | #else |
---|
[313] | 570 | ("ScalabilityMask0", m_scalabilityMask[0], 0, "scalability_mask[0] (multiview)") |
---|
| 571 | ("ScalabilityMask1", m_scalabilityMask[1], 1, "scalability_mask[1] (scalable)" ) |
---|
[442] | 572 | #endif |
---|
[313] | 573 | ("BitstreamFile,b", cfg_BitstreamFile, string(""), "Bitstream output file name") |
---|
[466] | 574 | #if !O0194_DIFFERENT_BITDEPTH_EL_BL |
---|
[313] | 575 | ("InputBitDepth", m_inputBitDepthY, 8, "Bit-depth of input file") |
---|
| 576 | ("OutputBitDepth", m_outputBitDepthY, 0, "Bit-depth of output file (default:InternalBitDepth)") |
---|
| 577 | ("InternalBitDepth", m_internalBitDepthY, 0, "Bit-depth the codec operates at. (default:InputBitDepth)" |
---|
| 578 | "If different to InputBitDepth, source data will be converted") |
---|
| 579 | ("InputBitDepthC", m_inputBitDepthC, 0, "As per InputBitDepth but for chroma component. (default:InputBitDepth)") |
---|
| 580 | ("OutputBitDepthC", m_outputBitDepthC, 0, "As per OutputBitDepth but for chroma component. (default:InternalBitDepthC)") |
---|
| 581 | ("InternalBitDepthC", m_internalBitDepthC, 0, "As per InternalBitDepth but for chroma component. (default:IntrenalBitDepth)") |
---|
[466] | 582 | #endif |
---|
[313] | 583 | ("NumScaledRefLayerOffsets%d", cfg_numScaledRefLayerOffsets, 0, MAX_LAYERS, "Number of scaled offset layer sets ") |
---|
| 584 | ("ScaledRefLayerLeftOffset%d", cfg_scaledRefLayerLeftOffsetPtr, string(""), MAX_LAYERS, "Horizontal offset of top-left luma sample of scaled base layer picture with respect to" |
---|
| 585 | " top-left luma sample of the EL picture, in units of two luma samples") |
---|
| 586 | ("ScaledRefLayerTopOffset%d", cfg_scaledRefLayerTopOffsetPtr, string(""), MAX_LAYERS, "Vertical offset of top-left luma sample of scaled base layer picture with respect to" |
---|
| 587 | " top-left luma sample of the EL picture, in units of two luma samples") |
---|
| 588 | ("ScaledRefLayerRightOffset%d", cfg_scaledRefLayerRightOffsetPtr, string(""), MAX_LAYERS, "Horizontal offset of bottom-right luma sample of scaled base layer picture with respect to" |
---|
| 589 | " bottom-right luma sample of the EL picture, in units of two luma samples") |
---|
| 590 | ("ScaledRefLayerBottomOffset%d", cfg_scaledRefLayerBottomOffsetPtr,string(""), MAX_LAYERS, "Vertical offset of bottom-right luma sample of scaled base layer picture with respect to" |
---|
| 591 | " bottom-right luma sample of the EL picture, in units of two luma samples") |
---|
[466] | 592 | #if O0194_DIFFERENT_BITDEPTH_EL_BL |
---|
| 593 | ("InputBitDepth%d", cfg_InputBitDepthY, 8, MAX_LAYERS, "Bit-depth of input file for layer %d") |
---|
| 594 | ("InternalBitDepth%d", cfg_InternalBitDepthY, 0, MAX_LAYERS, "Bit-depth the codec operates at. (default:InputBitDepth) for layer %d ") |
---|
| 595 | // "If different to InputBitDepth, source data will be converted") |
---|
| 596 | ("InputBitDepthC%d", cfg_InputBitDepthC, 0, MAX_LAYERS, "As per InputBitDepth but for chroma component. (default:InputBitDepth) for layer %d") |
---|
| 597 | ("InternalBitDepthC%d", cfg_InternalBitDepthC, 0, MAX_LAYERS, "As per InternalBitDepth but for chroma component. (default:IntrenalBitDepth) for layer %d") |
---|
| 598 | ("OutputBitDepth%d", cfg_OutputBitDepthY, 0, MAX_LAYERS, "Bit-depth of output file (default:InternalBitDepth)") |
---|
| 599 | ("OutputBitDepthC%d", cfg_OutputBitDepthC, 0, MAX_LAYERS, "As per OutputBitDepth but for chroma component. (default:InternalBitDepthC)") |
---|
| 600 | #endif |
---|
[442] | 601 | #if N0120_MAX_TID_REF_CFG |
---|
| 602 | ("MaxTidRefPresentFlag", m_maxTidRefPresentFlag, true, "max_tid_ref_present_flag (0: not present, 1: present(default)) " ) |
---|
| 603 | ("MaxTidIlRefPicsPlus1%d", cfg_maxTidIlRefPicsPlus1, 1, MAX_LAYERS, "allowed maximum temporal_id for inter-layer prediction") |
---|
| 604 | #endif |
---|
[313] | 605 | #if AVC_BASE |
---|
| 606 | ("AvcBase,-avc", m_avcBaseLayerFlag, 0, "avc_base_layer_flag") |
---|
| 607 | ("InputBLFile,-ibl", cfg_BLInputFile, string(""), "Base layer rec YUV input file name") |
---|
| 608 | #if AVC_SYNTAX |
---|
| 609 | ("InputBLSyntaxFile,-ibs", cfg_BLSyntaxFile, string(""), "Base layer syntax input file name") |
---|
| 610 | #endif |
---|
| 611 | #endif |
---|
| 612 | ("EnableElRapB,-use-rap-b", m_elRapSliceBEnabled, 0, "Set ILP over base-layer I picture to B picture (default is P picture)") |
---|
| 613 | #if M0457_IL_SAMPLE_PRED_ONLY_FLAG |
---|
| 614 | ("IlSampleOnlyPred%d", m_ilSampleOnlyPred, 0, MAX_LAYERS, "Set inter_layer_sample_pred_only_flag for all slices") |
---|
| 615 | #endif |
---|
[467] | 616 | #else //SVC_EXTENSION |
---|
[313] | 617 | ("InputFile,i", cfg_InputFile, string(""), "Original YUV input file name") |
---|
| 618 | ("BitstreamFile,b", cfg_BitstreamFile, string(""), "Bitstream output file name") |
---|
| 619 | ("ReconFile,o", cfg_ReconFile, string(""), "Reconstructed YUV output file name") |
---|
| 620 | ("SourceWidth,-wdt", m_iSourceWidth, 0, "Source picture width") |
---|
| 621 | ("SourceHeight,-hgt", m_iSourceHeight, 0, "Source picture height") |
---|
| 622 | ("InputBitDepth", m_inputBitDepthY, 8, "Bit-depth of input file") |
---|
| 623 | ("OutputBitDepth", m_outputBitDepthY, 0, "Bit-depth of output file (default:InternalBitDepth)") |
---|
| 624 | ("InternalBitDepth", m_internalBitDepthY, 0, "Bit-depth the codec operates at. (default:InputBitDepth)" |
---|
| 625 | "If different to InputBitDepth, source data will be converted") |
---|
| 626 | ("InputBitDepthC", m_inputBitDepthC, 0, "As per InputBitDepth but for chroma component. (default:InputBitDepth)") |
---|
| 627 | ("OutputBitDepthC", m_outputBitDepthC, 0, "As per OutputBitDepth but for chroma component. (default:InternalBitDepthC)") |
---|
| 628 | ("InternalBitDepthC", m_internalBitDepthC, 0, "As per InternalBitDepth but for chroma component. (default:IntrenalBitDepth)") |
---|
[475] | 629 | #if AUXILIARY_PICTURES |
---|
| 630 | ("InputChromaFormat", tmpInputChromaFormat, 420, "InputChromaFormatIDC") |
---|
| 631 | ("ChromaFormatIDC,-cf", tmpChromaFormat, 0, "ChromaFormatIDC (400|420|422|444 or set 0 (default) for same as InputChromaFormat)") |
---|
| 632 | #endif |
---|
[313] | 633 | ("ConformanceMode", m_conformanceMode, 0, "Window conformance mode (0: no window, 1:automatic padding, 2:padding, 3:conformance") |
---|
| 634 | ("HorizontalPadding,-pdx",m_aiPad[0], 0, "Horizontal source padding for conformance window mode 2") |
---|
| 635 | ("VerticalPadding,-pdy", m_aiPad[1], 0, "Vertical source padding for conformance window mode 2") |
---|
| 636 | ("ConfLeft", m_confLeft, 0, "Left offset for window conformance mode 3") |
---|
| 637 | ("ConfRight", m_confRight, 0, "Right offset for window conformance mode 3") |
---|
| 638 | ("ConfTop", m_confTop, 0, "Top offset for window conformance mode 3") |
---|
| 639 | ("ConfBottom", m_confBottom, 0, "Bottom offset for window conformance mode 3") |
---|
| 640 | ("FrameRate,-fr", m_iFrameRate, 0, "Frame rate") |
---|
[467] | 641 | #endif //SVC_EXTENSION |
---|
[442] | 642 | |
---|
| 643 | //Field coding parameters |
---|
| 644 | ("FieldCoding", m_isField, false, "Signals if it's a field based coding") |
---|
| 645 | ("TopFieldFirst, Tff", m_isTopFieldFirst, false, "In case of field based coding, signals whether if it's a top field first or not") |
---|
[313] | 646 | ("FrameSkip,-fs", m_FrameSkip, 0u, "Number of frames to skip at start of input YUV") |
---|
| 647 | ("FramesToBeEncoded,f", m_framesToBeEncoded, 0, "Number of frames to be encoded (default=all)") |
---|
| 648 | // Profile and level |
---|
| 649 | ("Profile", m_profile, Profile::NONE, "Profile to be used when encoding (Incomplete)") |
---|
| 650 | ("Level", m_level, Level::NONE, "Level limit to be used, eg 5.1 (Incomplete)") |
---|
| 651 | ("Tier", m_levelTier, Level::MAIN, "Tier to use for interpretation of --Level") |
---|
| 652 | |
---|
| 653 | ("ProgressiveSource", m_progressiveSourceFlag, false, "Indicate that source is progressive") |
---|
| 654 | ("InterlacedSource", m_interlacedSourceFlag, false, "Indicate that source is interlaced") |
---|
| 655 | ("NonPackedSource", m_nonPackedConstraintFlag, false, "Indicate that source does not contain frame packing") |
---|
| 656 | ("FrameOnly", m_frameOnlyConstraintFlag, false, "Indicate that the bitstream contains only frames") |
---|
| 657 | |
---|
[467] | 658 | #if LAYER_CTB |
---|
[313] | 659 | // Unit definition parameters |
---|
[467] | 660 | ("MaxCUWidth%d", cfg_uiMaxCUWidth, 64u, MAX_LAYERS, "Maximum CU width") |
---|
| 661 | ("MaxCUHeight%d", cfg_uiMaxCUHeight, 64u, MAX_LAYERS, "Maximum CU height") |
---|
| 662 | // todo: remove defaults from MaxCUSize |
---|
| 663 | ("MaxCUSize%d,s%d", cfg_uiMaxCUWidth, 64u, MAX_LAYERS, "Maximum CU size") |
---|
| 664 | ("MaxCUSize%d,s%d", cfg_uiMaxCUHeight, 64u, MAX_LAYERS, "Maximum CU size") |
---|
| 665 | ("MaxPartitionDepth%d,h%d", cfg_uiMaxCUDepth, 4u, MAX_LAYERS, "CU depth") |
---|
| 666 | |
---|
| 667 | ("QuadtreeTULog2MaxSize%d", cfg_uiQuadtreeTULog2MaxSize, 6u, MAX_LAYERS, "Maximum TU size in logarithm base 2") |
---|
| 668 | ("QuadtreeTULog2MinSize%d", cfg_uiQuadtreeTULog2MinSize, 2u, MAX_LAYERS, "Minimum TU size in logarithm base 2") |
---|
| 669 | |
---|
| 670 | ("QuadtreeTUMaxDepthIntra%d", cfg_uiQuadtreeTUMaxDepthIntra, 1u, MAX_LAYERS, "Depth of TU tree for intra CUs") |
---|
| 671 | ("QuadtreeTUMaxDepthInter%d", cfg_uiQuadtreeTUMaxDepthInter, 2u, MAX_LAYERS, "Depth of TU tree for inter CUs") |
---|
| 672 | |
---|
| 673 | |
---|
| 674 | // set the same CU realted settings across all the layers if config file parameters are not layer specific |
---|
| 675 | ("MaxCUWidth", cfg_uiMaxCUWidth, 64u, MAX_LAYERS, "Maximum CU width") |
---|
| 676 | ("MaxCUHeight", cfg_uiMaxCUHeight, 64u, MAX_LAYERS, "Maximum CU height") |
---|
| 677 | // todo: remove defaults from MaxCUSize |
---|
| 678 | ("MaxCUSize,s", cfg_uiMaxCUWidth, 64u, MAX_LAYERS, "Maximum CU size") |
---|
| 679 | ("MaxCUSize,s", cfg_uiMaxCUHeight, 64u, MAX_LAYERS, "Maximum CU size") |
---|
| 680 | ("MaxPartitionDepth,h", cfg_uiMaxCUDepth, 4u, MAX_LAYERS, "CU depth") |
---|
| 681 | |
---|
| 682 | ("QuadtreeTULog2MaxSize", cfg_uiQuadtreeTULog2MaxSize, 6u, MAX_LAYERS, "Maximum TU size in logarithm base 2") |
---|
| 683 | ("QuadtreeTULog2MinSize", cfg_uiQuadtreeTULog2MinSize, 2u, MAX_LAYERS, "Minimum TU size in logarithm base 2") |
---|
| 684 | |
---|
| 685 | ("QuadtreeTUMaxDepthIntra", cfg_uiQuadtreeTUMaxDepthIntra, 1u, MAX_LAYERS, "Depth of TU tree for intra CUs") |
---|
| 686 | ("QuadtreeTUMaxDepthInter", cfg_uiQuadtreeTUMaxDepthInter, 2u, MAX_LAYERS, "Depth of TU tree for inter CUs") |
---|
| 687 | #else |
---|
| 688 | // Unit definition parameters |
---|
[313] | 689 | ("MaxCUWidth", m_uiMaxCUWidth, 64u) |
---|
| 690 | ("MaxCUHeight", m_uiMaxCUHeight, 64u) |
---|
| 691 | // todo: remove defaults from MaxCUSize |
---|
| 692 | ("MaxCUSize,s", m_uiMaxCUWidth, 64u, "Maximum CU size") |
---|
| 693 | ("MaxCUSize,s", m_uiMaxCUHeight, 64u, "Maximum CU size") |
---|
| 694 | ("MaxPartitionDepth,h", m_uiMaxCUDepth, 4u, "CU depth") |
---|
| 695 | |
---|
| 696 | ("QuadtreeTULog2MaxSize", m_uiQuadtreeTULog2MaxSize, 6u, "Maximum TU size in logarithm base 2") |
---|
| 697 | ("QuadtreeTULog2MinSize", m_uiQuadtreeTULog2MinSize, 2u, "Minimum TU size in logarithm base 2") |
---|
| 698 | |
---|
| 699 | ("QuadtreeTUMaxDepthIntra", m_uiQuadtreeTUMaxDepthIntra, 1u, "Depth of TU tree for intra CUs") |
---|
| 700 | ("QuadtreeTUMaxDepthInter", m_uiQuadtreeTUMaxDepthInter, 2u, "Depth of TU tree for inter CUs") |
---|
[467] | 701 | #endif |
---|
[313] | 702 | |
---|
| 703 | // Coding structure paramters |
---|
| 704 | #if SVC_EXTENSION |
---|
| 705 | ("IntraPeriod%d,-ip%d", cfg_IntraPeriod, -1, MAX_LAYERS, "intra period in frames for layer %d, (-1: only first frame)") |
---|
| 706 | #else |
---|
| 707 | ("IntraPeriod,-ip", m_iIntraPeriod, -1, "Intra period in frames, (-1: only first frame)") |
---|
| 708 | #endif |
---|
| 709 | ("DecodingRefreshType,-dr", m_iDecodingRefreshType, 0, "Intra refresh type (0:none 1:CRA 2:IDR)") |
---|
| 710 | ("GOPSize,g", m_iGOPSize, 1, "GOP size of temporal structure") |
---|
| 711 | // motion options |
---|
| 712 | ("FastSearch", m_iFastSearch, 1, "0:Full search 1:Diamond 2:PMVFAST") |
---|
| 713 | ("SearchRange,-sr", m_iSearchRange, 96, "Motion search range") |
---|
| 714 | ("BipredSearchRange", m_bipredSearchRange, 4, "Motion search range for bipred refinement") |
---|
| 715 | ("HadamardME", m_bUseHADME, true, "Hadamard ME for fractional-pel") |
---|
| 716 | ("ASR", m_bUseASR, false, "Adaptive motion search range") |
---|
| 717 | |
---|
| 718 | #if SVC_EXTENSION |
---|
| 719 | ("LambdaModifier%d,-LM%d", m_adLambdaModifier, ( double )1.0, MAX_TLAYER, "Lambda modifier for temporal layer %d") |
---|
| 720 | #else |
---|
| 721 | // Mode decision parameters |
---|
| 722 | ("LambdaModifier0,-LM0", m_adLambdaModifier[ 0 ], ( Double )1.0, "Lambda modifier for temporal layer 0") |
---|
| 723 | ("LambdaModifier1,-LM1", m_adLambdaModifier[ 1 ], ( Double )1.0, "Lambda modifier for temporal layer 1") |
---|
| 724 | ("LambdaModifier2,-LM2", m_adLambdaModifier[ 2 ], ( Double )1.0, "Lambda modifier for temporal layer 2") |
---|
| 725 | ("LambdaModifier3,-LM3", m_adLambdaModifier[ 3 ], ( Double )1.0, "Lambda modifier for temporal layer 3") |
---|
| 726 | ("LambdaModifier4,-LM4", m_adLambdaModifier[ 4 ], ( Double )1.0, "Lambda modifier for temporal layer 4") |
---|
| 727 | ("LambdaModifier5,-LM5", m_adLambdaModifier[ 5 ], ( Double )1.0, "Lambda modifier for temporal layer 5") |
---|
| 728 | ("LambdaModifier6,-LM6", m_adLambdaModifier[ 6 ], ( Double )1.0, "Lambda modifier for temporal layer 6") |
---|
| 729 | ("LambdaModifier7,-LM7", m_adLambdaModifier[ 7 ], ( Double )1.0, "Lambda modifier for temporal layer 7") |
---|
| 730 | #endif |
---|
| 731 | |
---|
| 732 | /* Quantization parameters */ |
---|
| 733 | #if SVC_EXTENSION |
---|
| 734 | ("QP%d,-q%d", cfg_fQP, 30.0, MAX_LAYERS, "Qp value for layer %d, if value is float, QP is switched once during encoding") |
---|
| 735 | #else |
---|
| 736 | ("QP,q", m_fQP, 30.0, "Qp value, if value is float, QP is switched once during encoding") |
---|
| 737 | #endif |
---|
| 738 | ("DeltaQpRD,-dqr",m_uiDeltaQpRD, 0u, "max dQp offset for slice") |
---|
| 739 | ("MaxDeltaQP,d", m_iMaxDeltaQP, 0, "max dQp offset for block") |
---|
| 740 | ("MaxCuDQPDepth,-dqd", m_iMaxCuDQPDepth, 0, "max depth for a minimum CuDQP") |
---|
| 741 | |
---|
| 742 | ("CbQpOffset,-cbqpofs", m_cbQpOffset, 0, "Chroma Cb QP Offset") |
---|
| 743 | ("CrQpOffset,-crqpofs", m_crQpOffset, 0, "Chroma Cr QP Offset") |
---|
| 744 | |
---|
| 745 | #if ADAPTIVE_QP_SELECTION |
---|
| 746 | ("AdaptiveQpSelection,-aqps", m_bUseAdaptQpSelect, false, "AdaptiveQpSelection") |
---|
| 747 | #endif |
---|
| 748 | |
---|
| 749 | ("AdaptiveQP,-aq", m_bUseAdaptiveQP, false, "QP adaptation based on a psycho-visual model") |
---|
| 750 | ("MaxQPAdaptationRange,-aqr", m_iQPAdaptationRange, 6, "QP adaptation range") |
---|
| 751 | #if !SVC_EXTENSION |
---|
| 752 | ("dQPFile,m", cfg_dQPFile, string(""), "dQP file name") |
---|
| 753 | #endif |
---|
| 754 | ("RDOQ", m_useRDOQ, true ) |
---|
| 755 | ("RDOQTS", m_useRDOQTS, true ) |
---|
| 756 | ("RDpenalty", m_rdPenalty, 0, "RD-penalty for 32x32 TU for intra in non-intra slices. 0:disbaled 1:RD-penalty 2:maximum RD-penalty") |
---|
| 757 | // Entropy coding parameters |
---|
| 758 | ("SBACRD", m_bUseSBACRD, true, "SBAC based RD estimation") |
---|
| 759 | |
---|
| 760 | // Deblocking filter parameters |
---|
| 761 | ("LoopFilterDisable", m_bLoopFilterDisable, false ) |
---|
| 762 | ("LoopFilterOffsetInPPS", m_loopFilterOffsetInPPS, false ) |
---|
| 763 | ("LoopFilterBetaOffset_div2", m_loopFilterBetaOffsetDiv2, 0 ) |
---|
| 764 | ("LoopFilterTcOffset_div2", m_loopFilterTcOffsetDiv2, 0 ) |
---|
| 765 | ("DeblockingFilterControlPresent", m_DeblockingFilterControlPresent, false ) |
---|
| 766 | ("DeblockingFilterMetric", m_DeblockingFilterMetric, false ) |
---|
| 767 | |
---|
| 768 | // Coding tools |
---|
| 769 | ("AMP", m_enableAMP, true, "Enable asymmetric motion partitions") |
---|
| 770 | ("TransformSkip", m_useTransformSkip, false, "Intra transform skipping") |
---|
| 771 | ("TransformSkipFast", m_useTransformSkipFast, false, "Fast intra transform skipping") |
---|
| 772 | ("SAO", m_bUseSAO, true, "Enable Sample Adaptive Offset") |
---|
| 773 | ("MaxNumOffsetsPerPic", m_maxNumOffsetsPerPic, 2048, "Max number of SAO offset per picture (Default: 2048)") |
---|
| 774 | ("SAOLcuBoundary", m_saoLcuBoundary, false, "0: right/bottom LCU boundary areas skipped from SAO parameter estimation, 1: non-deblocked pixels are used for those areas") |
---|
| 775 | ("SAOLcuBasedOptimization", m_saoLcuBasedOptimization, true, "0: SAO picture-based optimization, 1: SAO LCU-based optimization ") |
---|
| 776 | ("SliceMode", m_sliceMode, 0, "0: Disable all Recon slice limits, 1: Enforce max # of LCUs, 2: Enforce max # of bytes, 3:specify tiles per dependent slice") |
---|
| 777 | ("SliceArgument", m_sliceArgument, 0, "Depending on SliceMode being:" |
---|
| 778 | "\t1: max number of CTUs per slice" |
---|
| 779 | "\t2: max number of bytes per slice" |
---|
| 780 | "\t3: max number of tiles per slice") |
---|
| 781 | ("SliceSegmentMode", m_sliceSegmentMode, 0, "0: Disable all slice segment limits, 1: Enforce max # of LCUs, 2: Enforce max # of bytes, 3:specify tiles per dependent slice") |
---|
| 782 | ("SliceSegmentArgument", m_sliceSegmentArgument, 0, "Depending on SliceSegmentMode being:" |
---|
| 783 | "\t1: max number of CTUs per slice segment" |
---|
| 784 | "\t2: max number of bytes per slice segment" |
---|
| 785 | "\t3: max number of tiles per slice segment") |
---|
| 786 | ("LFCrossSliceBoundaryFlag", m_bLFCrossSliceBoundaryFlag, true) |
---|
| 787 | |
---|
| 788 | ("ConstrainedIntraPred", m_bUseConstrainedIntraPred, false, "Constrained Intra Prediction") |
---|
| 789 | |
---|
| 790 | ("PCMEnabledFlag", m_usePCM, false) |
---|
| 791 | ("PCMLog2MaxSize", m_pcmLog2MaxSize, 5u) |
---|
| 792 | ("PCMLog2MinSize", m_uiPCMLog2MinSize, 3u) |
---|
| 793 | ("PCMInputBitDepthFlag", m_bPCMInputBitDepthFlag, true) |
---|
| 794 | ("PCMFilterDisableFlag", m_bPCMFilterDisableFlag, false) |
---|
| 795 | |
---|
| 796 | ("LosslessCuEnabled", m_useLossless, false) |
---|
| 797 | |
---|
| 798 | ("WeightedPredP,-wpP", m_useWeightedPred, false, "Use weighted prediction in P slices") |
---|
| 799 | ("WeightedPredB,-wpB", m_useWeightedBiPred, false, "Use weighted (bidirectional) prediction in B slices") |
---|
| 800 | ("Log2ParallelMergeLevel", m_log2ParallelMergeLevel, 2u, "Parallel merge estimation region") |
---|
| 801 | ("UniformSpacingIdc", m_iUniformSpacingIdr, 0, "Indicates if the column and row boundaries are distributed uniformly") |
---|
| 802 | ("NumTileColumnsMinus1", m_iNumColumnsMinus1, 0, "Number of columns in a picture minus 1") |
---|
| 803 | ("ColumnWidthArray", cfg_ColumnWidth, string(""), "Array containing ColumnWidth values in units of LCU") |
---|
| 804 | ("NumTileRowsMinus1", m_iNumRowsMinus1, 0, "Number of rows in a picture minus 1") |
---|
| 805 | ("RowHeightArray", cfg_RowHeight, string(""), "Array containing RowHeight values in units of LCU") |
---|
| 806 | ("LFCrossTileBoundaryFlag", m_bLFCrossTileBoundaryFlag, true, "1: cross-tile-boundary loop filtering. 0:non-cross-tile-boundary loop filtering") |
---|
| 807 | ("WaveFrontSynchro", m_iWaveFrontSynchro, 0, "0: no synchro; 1 synchro with TR; 2 TRR etc") |
---|
| 808 | ("ScalingList", m_useScalingListId, 0, "0: no scaling list, 1: default scaling lists, 2: scaling lists specified in ScalingListFile") |
---|
| 809 | ("ScalingListFile", cfg_ScalingListFile, string(""), "Scaling list file name") |
---|
| 810 | ("SignHideFlag,-SBH", m_signHideFlag, 1) |
---|
| 811 | ("MaxNumMergeCand", m_maxNumMergeCand, 5u, "Maximum number of merge candidates") |
---|
| 812 | |
---|
| 813 | /* Misc. */ |
---|
| 814 | ("SEIDecodedPictureHash", m_decodedPictureHashSEIEnabled, 0, "Control generation of decode picture hash SEI messages\n" |
---|
| 815 | "\t3: checksum\n" |
---|
| 816 | "\t2: CRC\n" |
---|
| 817 | "\t1: use MD5\n" |
---|
| 818 | "\t0: disable") |
---|
| 819 | ("SEIpictureDigest", m_decodedPictureHashSEIEnabled, 0, "deprecated alias for SEIDecodedPictureHash") |
---|
| 820 | ("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") |
---|
| 821 | ("FEN", m_bUseFastEnc, false, "fast encoder setting") |
---|
| 822 | ("ECU", m_bUseEarlyCU, false, "Early CU setting") |
---|
| 823 | ("FDM", m_useFastDecisionForMerge, true, "Fast decision for Merge RD Cost") |
---|
| 824 | ("CFM", m_bUseCbfFastMode, false, "Cbf fast mode setting") |
---|
| 825 | ("ESD", m_useEarlySkipDetection, false, "Early SKIP detection setting") |
---|
| 826 | #if FAST_INTRA_SHVC |
---|
| 827 | ("FIS", m_useFastIntraScalable, false, "Fast Intra Decision for Scalable HEVC") |
---|
| 828 | #endif |
---|
| 829 | #if RATE_CONTROL_LAMBDA_DOMAIN |
---|
| 830 | #if RC_SHVC_HARMONIZATION |
---|
| 831 | ("RateControl%d", cfg_RCEnableRateControl, false, MAX_LAYERS, "Rate control: enable rate control for layer %d") |
---|
| 832 | ("TargetBitrate%d", cfg_RCTargetBitRate, 0, MAX_LAYERS, "Rate control: target bitrate for layer %d") |
---|
| 833 | ("KeepHierarchicalBit%d", cfg_RCKeepHierarchicalBit, false, MAX_LAYERS, "Rate control: keep hierarchical bit allocation for layer %d") |
---|
| 834 | ("LCULevelRateControl%d", cfg_RCLCULevelRC, true, MAX_LAYERS, "Rate control: LCU level RC") |
---|
| 835 | ("RCLCUSeparateModel%d", cfg_RCUseLCUSeparateModel, true, MAX_LAYERS, "Rate control: Use LCU level separate R-lambda model") |
---|
| 836 | ("InitialQP%d", cfg_RCInitialQP, 0, MAX_LAYERS, "Rate control: initial QP") |
---|
| 837 | ("RCForceIntraQP%d", cfg_RCForceIntraQP, false, MAX_LAYERS, "Rate control: force intra QP to be equal to initial QP") |
---|
| 838 | #else |
---|
| 839 | ( "RateControl", m_RCEnableRateControl, false, "Rate control: enable rate control" ) |
---|
| 840 | ( "TargetBitrate", m_RCTargetBitrate, 0, "Rate control: target bitrate" ) |
---|
| 841 | #if M0036_RC_IMPROVEMENT |
---|
| 842 | ( "KeepHierarchicalBit", m_RCKeepHierarchicalBit, 0, "Rate control: 0: equal bit allocation; 1: fixed ratio bit allocation; 2: adaptive ratio bit allocation" ) |
---|
| 843 | #else |
---|
| 844 | ( "KeepHierarchicalBit", m_RCKeepHierarchicalBit, false, "Rate control: keep hierarchical bit allocation in rate control algorithm" ) |
---|
| 845 | #endif |
---|
| 846 | ( "LCULevelRateControl", m_RCLCULevelRC, true, "Rate control: true: LCU level RC; false: picture level RC" ) |
---|
| 847 | ( "RCLCUSeparateModel", m_RCUseLCUSeparateModel, true, "Rate control: use LCU level separate R-lambda model" ) |
---|
| 848 | ( "InitialQP", m_RCInitialQP, 0, "Rate control: initial QP" ) |
---|
| 849 | ( "RCForceIntraQP", m_RCForceIntraQP, false, "Rate control: force intra QP to be equal to initial QP" ) |
---|
| 850 | #endif |
---|
| 851 | #else |
---|
| 852 | ("RateCtrl,-rc", m_enableRateCtrl, false, "Rate control on/off") |
---|
| 853 | ("TargetBitrate,-tbr", m_targetBitrate, 0, "Input target bitrate") |
---|
| 854 | ("NumLCUInUnit,-nu", m_numLCUInUnit, 0, "Number of LCUs in an Unit") |
---|
| 855 | #endif |
---|
| 856 | |
---|
| 857 | ("TransquantBypassEnableFlag", m_TransquantBypassEnableFlag, false, "transquant_bypass_enable_flag indicator in PPS") |
---|
| 858 | ("CUTransquantBypassFlagValue", m_CUTransquantBypassFlagValue, false, "Fixed cu_transquant_bypass_flag value, when transquant_bypass_enable_flag is enabled") |
---|
| 859 | ("RecalculateQPAccordingToLambda", m_recalculateQPAccordingToLambda, false, "Recalculate QP values according to lambda values. Do not suggest to be enabled in all intra case") |
---|
| 860 | ("StrongIntraSmoothing,-sis", m_useStrongIntraSmoothing, true, "Enable strong intra smoothing for 32x32 blocks") |
---|
| 861 | ("SEIActiveParameterSets", m_activeParameterSetsSEIEnabled, 0, "Enable generation of active parameter sets SEI messages") |
---|
| 862 | ("VuiParametersPresent,-vui", m_vuiParametersPresentFlag, false, "Enable generation of vui_parameters()") |
---|
| 863 | ("AspectRatioInfoPresent", m_aspectRatioInfoPresentFlag, false, "Signals whether aspect_ratio_idc is present") |
---|
| 864 | ("AspectRatioIdc", m_aspectRatioIdc, 0, "aspect_ratio_idc") |
---|
| 865 | ("SarWidth", m_sarWidth, 0, "horizontal size of the sample aspect ratio") |
---|
| 866 | ("SarHeight", m_sarHeight, 0, "vertical size of the sample aspect ratio") |
---|
| 867 | ("OverscanInfoPresent", m_overscanInfoPresentFlag, false, "Indicates whether conformant decoded pictures are suitable for display using overscan\n") |
---|
| 868 | ("OverscanAppropriate", m_overscanAppropriateFlag, false, "Indicates whether conformant decoded pictures are suitable for display using overscan\n") |
---|
| 869 | ("VideoSignalTypePresent", m_videoSignalTypePresentFlag, false, "Signals whether video_format, video_full_range_flag, and colour_description_present_flag are present") |
---|
| 870 | ("VideoFormat", m_videoFormat, 5, "Indicates representation of pictures") |
---|
| 871 | ("VideoFullRange", m_videoFullRangeFlag, false, "Indicates the black level and range of luma and chroma signals") |
---|
| 872 | ("ColourDescriptionPresent", m_colourDescriptionPresentFlag, false, "Signals whether colour_primaries, transfer_characteristics and matrix_coefficients are present") |
---|
| 873 | ("ColourPrimaries", m_colourPrimaries, 2, "Indicates chromaticity coordinates of the source primaries") |
---|
| 874 | ("TransferCharateristics", m_transferCharacteristics, 2, "Indicates the opto-electronic transfer characteristics of the source") |
---|
| 875 | ("MatrixCoefficients", m_matrixCoefficients, 2, "Describes the matrix coefficients used in deriving luma and chroma from RGB primaries") |
---|
| 876 | ("ChromaLocInfoPresent", m_chromaLocInfoPresentFlag, false, "Signals whether chroma_sample_loc_type_top_field and chroma_sample_loc_type_bottom_field are present") |
---|
| 877 | ("ChromaSampleLocTypeTopField", m_chromaSampleLocTypeTopField, 0, "Specifies the location of chroma samples for top field") |
---|
| 878 | ("ChromaSampleLocTypeBottomField", m_chromaSampleLocTypeBottomField, 0, "Specifies the location of chroma samples for bottom field") |
---|
| 879 | ("NeutralChromaIndication", m_neutralChromaIndicationFlag, false, "Indicates that the value of all decoded chroma samples is equal to 1<<(BitDepthCr-1)") |
---|
| 880 | ("DefaultDisplayWindowFlag", m_defaultDisplayWindowFlag, false, "Indicates the presence of the Default Window parameters") |
---|
| 881 | ("DefDispWinLeftOffset", m_defDispWinLeftOffset, 0, "Specifies the left offset of the default display window from the conformance window") |
---|
| 882 | ("DefDispWinRightOffset", m_defDispWinRightOffset, 0, "Specifies the right offset of the default display window from the conformance window") |
---|
| 883 | ("DefDispWinTopOffset", m_defDispWinTopOffset, 0, "Specifies the top offset of the default display window from the conformance window") |
---|
| 884 | ("DefDispWinBottomOffset", m_defDispWinBottomOffset, 0, "Specifies the bottom offset of the default display window from the conformance window") |
---|
| 885 | ("FrameFieldInfoPresentFlag", m_frameFieldInfoPresentFlag, false, "Indicates that pic_struct and field coding related values are present in picture timing SEI messages") |
---|
| 886 | ("PocProportionalToTimingFlag", m_pocProportionalToTimingFlag, false, "Indicates that the POC value is proportional to the output time w.r.t. first picture in CVS") |
---|
| 887 | ("NumTicksPocDiffOneMinus1", m_numTicksPocDiffOneMinus1, 0, "Number of ticks minus 1 that for a POC difference of one") |
---|
| 888 | ("BitstreamRestriction", m_bitstreamRestrictionFlag, false, "Signals whether bitstream restriction parameters are present") |
---|
| 889 | ("TilesFixedStructure", m_tilesFixedStructureFlag, false, "Indicates that each active picture parameter set has the same values of the syntax elements related to tiles") |
---|
| 890 | ("MotionVectorsOverPicBoundaries", m_motionVectorsOverPicBoundariesFlag, false, "Indicates that no samples outside the picture boundaries are used for inter prediction") |
---|
| 891 | ("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") |
---|
| 892 | ("MaxBitsPerMinCuDenom", m_maxBitsPerMinCuDenom, 1, "Indicates an upper bound for the number of bits of coding_unit() data") |
---|
| 893 | ("Log2MaxMvLengthHorizontal", m_log2MaxMvLengthHorizontal, 15, "Indicate the maximum absolute value of a decoded horizontal MV component in quarter-pel luma units") |
---|
| 894 | ("Log2MaxMvLengthVertical", m_log2MaxMvLengthVertical, 15, "Indicate the maximum absolute value of a decoded vertical MV component in quarter-pel luma units") |
---|
| 895 | ("SEIRecoveryPoint", m_recoveryPointSEIEnabled, 0, "Control generation of recovery point SEI messages") |
---|
| 896 | ("SEIBufferingPeriod", m_bufferingPeriodSEIEnabled, 0, "Control generation of buffering period SEI messages") |
---|
| 897 | ("SEIPictureTiming", m_pictureTimingSEIEnabled, 0, "Control generation of picture timing SEI messages") |
---|
| 898 | ("SEIToneMappingInfo", m_toneMappingInfoSEIEnabled, false, "Control generation of Tone Mapping SEI messages") |
---|
| 899 | ("SEIToneMapId", m_toneMapId, 0, "Specifies Id of Tone Mapping SEI message for a given session") |
---|
| 900 | ("SEIToneMapCancelFlag", m_toneMapCancelFlag, false, "Indicates that Tone Mapping SEI message cancels the persistance or follows") |
---|
| 901 | ("SEIToneMapPersistenceFlag", m_toneMapPersistenceFlag, true, "Specifies the persistence of the Tone Mapping SEI message") |
---|
| 902 | ("SEIToneMapCodedDataBitDepth", m_toneMapCodedDataBitDepth, 8, "Specifies Coded Data BitDepth of Tone Mapping SEI messages") |
---|
| 903 | ("SEIToneMapTargetBitDepth", m_toneMapTargetBitDepth, 8, "Specifies Output BitDepth of Tome mapping function") |
---|
| 904 | ("SEIToneMapModelId", m_toneMapModelId, 0, "Specifies Model utilized for mapping coded data into target_bit_depth range\n" |
---|
| 905 | "\t0: linear mapping with clipping\n" |
---|
| 906 | "\t1: sigmoidal mapping\n" |
---|
| 907 | "\t2: user-defined table mapping\n" |
---|
| 908 | "\t3: piece-wise linear mapping\n" |
---|
| 909 | "\t4: luminance dynamic range information ") |
---|
| 910 | ("SEIToneMapMinValue", m_toneMapMinValue, 0, "Specifies the minimum value in mode 0") |
---|
| 911 | ("SEIToneMapMaxValue", m_toneMapMaxValue, 1023, "Specifies the maxmum value in mode 0") |
---|
| 912 | ("SEIToneMapSigmoidMidpoint", m_sigmoidMidpoint, 512, "Specifies the centre point in mode 1") |
---|
| 913 | ("SEIToneMapSigmoidWidth", m_sigmoidWidth, 960, "Specifies the distance between 5% and 95% values of the target_bit_depth in mode 1") |
---|
| 914 | ("SEIToneMapStartOfCodedInterval", cfg_startOfCodedInterval, string(""), "Array of user-defined mapping table") |
---|
| 915 | ("SEIToneMapNumPivots", m_numPivots, 0, "Specifies the number of pivot points in mode 3") |
---|
| 916 | ("SEIToneMapCodedPivotValue", cfg_codedPivotValue, string(""), "Array of pivot point") |
---|
| 917 | ("SEIToneMapTargetPivotValue", cfg_targetPivotValue, string(""), "Array of pivot point") |
---|
| 918 | ("SEIToneMapCameraIsoSpeedIdc", m_cameraIsoSpeedIdc, 0, "Indicates the camera ISO speed for daylight illumination") |
---|
| 919 | ("SEIToneMapCameraIsoSpeedValue", m_cameraIsoSpeedValue, 400, "Specifies the camera ISO speed for daylight illumination of Extended_ISO") |
---|
| 920 | ("SEIToneMapExposureCompensationValueSignFlag", m_exposureCompensationValueSignFlag, 0, "Specifies the sign of ExposureCompensationValue") |
---|
| 921 | ("SEIToneMapExposureCompensationValueNumerator", m_exposureCompensationValueNumerator, 0, "Specifies the numerator of ExposureCompensationValue") |
---|
| 922 | ("SEIToneMapExposureCompensationValueDenomIdc", m_exposureCompensationValueDenomIdc, 2, "Specifies the denominator of ExposureCompensationValue") |
---|
| 923 | ("SEIToneMapRefScreenLuminanceWhite", m_refScreenLuminanceWhite, 350, "Specifies reference screen brightness setting in units of candela per square metre") |
---|
| 924 | ("SEIToneMapExtendedRangeWhiteLevel", m_extendedRangeWhiteLevel, 800, "Indicates the luminance dynamic range") |
---|
| 925 | ("SEIToneMapNominalBlackLevelLumaCodeValue", m_nominalBlackLevelLumaCodeValue, 16, "Specifies luma sample value of the nominal black level assigned decoded pictures") |
---|
| 926 | ("SEIToneMapNominalWhiteLevelLumaCodeValue", m_nominalWhiteLevelLumaCodeValue, 235, "Specifies luma sample value of the nominal white level assigned decoded pictures") |
---|
| 927 | ("SEIToneMapExtendedWhiteLevelLumaCodeValue", m_extendedWhiteLevelLumaCodeValue, 300, "Specifies luma sample value of the extended dynamic range assigned decoded pictures") |
---|
| 928 | ("SEIFramePacking", m_framePackingSEIEnabled, 0, "Control generation of frame packing SEI messages") |
---|
| 929 | ("SEIFramePackingType", m_framePackingSEIType, 0, "Define frame packing arrangement\n" |
---|
| 930 | "\t0: checkerboard - pixels alternatively represent either frames\n" |
---|
| 931 | "\t1: column alternation - frames are interlaced by column\n" |
---|
| 932 | "\t2: row alternation - frames are interlaced by row\n" |
---|
| 933 | "\t3: side by side - frames are displayed horizontally\n" |
---|
| 934 | "\t4: top bottom - frames are displayed vertically\n" |
---|
| 935 | "\t5: frame alternation - one frame is alternated with the other") |
---|
| 936 | ("SEIFramePackingId", m_framePackingSEIId, 0, "Id of frame packing SEI message for a given session") |
---|
| 937 | ("SEIFramePackingQuincunx", m_framePackingSEIQuincunx, 0, "Indicate the presence of a Quincunx type video frame") |
---|
| 938 | ("SEIFramePackingInterpretation", m_framePackingSEIInterpretation, 0, "Indicate the interpretation of the frame pair\n" |
---|
| 939 | "\t0: unspecified\n" |
---|
| 940 | "\t1: stereo pair, frame0 represents left view\n" |
---|
| 941 | "\t2: stereo pair, frame0 represents right view") |
---|
| 942 | ("SEIDisplayOrientation", m_displayOrientationSEIAngle, 0, "Control generation of display orientation SEI messages\n" |
---|
| 943 | "\tN: 0 < N < (2^16 - 1) enable display orientation SEI message with anticlockwise_rotation = N and display_orientation_repetition_period = 1\n" |
---|
| 944 | "\t0: disable") |
---|
| 945 | ("SEITemporalLevel0Index", m_temporalLevel0IndexSEIEnabled, 0, "Control generation of temporal level 0 index SEI messages") |
---|
| 946 | ("SEIGradualDecodingRefreshInfo", m_gradualDecodingRefreshInfoEnabled, 0, "Control generation of gradual decoding refresh information SEI message") |
---|
| 947 | ("SEIDecodingUnitInfo", m_decodingUnitInfoSEIEnabled, 0, "Control generation of decoding unit information SEI message.") |
---|
| 948 | #if M0043_LAYERS_PRESENT_SEI |
---|
| 949 | ("SEILayersPresent", m_layersPresentSEIEnabled, 0, "Control generation of layers present SEI message") |
---|
| 950 | #endif |
---|
| 951 | ("SEISOPDescription", m_SOPDescriptionSEIEnabled, 0, "Control generation of SOP description SEI messages") |
---|
| 952 | ("SEIScalableNesting", m_scalableNestingSEIEnabled, 0, "Control generation of scalable nesting SEI messages") |
---|
| 953 | #if M0040_ADAPTIVE_RESOLUTION_CHANGE |
---|
| 954 | ("AdaptiveResolutionChange", m_adaptiveResolutionChange, 0, "Adaptive resolution change frame number. Should coincide with EL RAP picture. (0: disable)") |
---|
| 955 | #endif |
---|
[442] | 956 | #if N0383_IL_CONSTRAINED_TILE_SETS_SEI |
---|
| 957 | ("SEIInterLayerConstrainedTileSets", m_interLayerConstrainedTileSetsSEIEnabled, false, "Control generation of inter layer constrained tile sets SEI message") |
---|
| 958 | ("IlNumSetsInMessage", m_ilNumSetsInMessage, 0u, "Number of inter layer constrained tile sets") |
---|
| 959 | ("TileSetsArray", cfg_tileSets, string(""), "Array containing tile sets params (TopLeftTileIndex, BottonRightTileIndex and ilcIdc for each set) ") |
---|
| 960 | #endif |
---|
[313] | 961 | ; |
---|
| 962 | |
---|
| 963 | for(Int i=1; i<MAX_GOP+1; i++) { |
---|
| 964 | std::ostringstream cOSS; |
---|
| 965 | cOSS<<"Frame"<<i; |
---|
| 966 | opts.addOptions()(cOSS.str(), m_GOPList[i-1], GOPEntry()); |
---|
| 967 | } |
---|
| 968 | po::setDefaults(opts); |
---|
| 969 | const list<const Char*>& argv_unhandled = po::scanArgv(opts, argc, (const Char**) argv); |
---|
| 970 | |
---|
[442] | 971 | if(m_isField) |
---|
| 972 | { |
---|
| 973 | #if SVC_EXTENSION |
---|
| 974 | for(Int layer = 0; layer < MAX_LAYERS; layer++) |
---|
| 975 | { |
---|
| 976 | //Frame height |
---|
| 977 | m_acLayerCfg[layer].m_iSourceHeightOrg = m_acLayerCfg[layer].m_iSourceHeight; |
---|
| 978 | //Field height |
---|
| 979 | m_acLayerCfg[layer].m_iSourceHeight = m_acLayerCfg[layer].m_iSourceHeight >> 1; |
---|
| 980 | } |
---|
| 981 | #else |
---|
| 982 | //Frame height |
---|
| 983 | m_iSourceHeightOrg = m_iSourceHeight; |
---|
| 984 | //Field height |
---|
| 985 | m_iSourceHeight = m_iSourceHeight >> 1; |
---|
| 986 | #endif |
---|
| 987 | //number of fields to encode |
---|
| 988 | m_framesToBeEncoded *= 2; |
---|
| 989 | } |
---|
| 990 | |
---|
[313] | 991 | for (list<const Char*>::const_iterator it = argv_unhandled.begin(); it != argv_unhandled.end(); it++) |
---|
| 992 | { |
---|
| 993 | fprintf(stderr, "Unhandled argument ignored: `%s'\n", *it); |
---|
| 994 | } |
---|
| 995 | |
---|
| 996 | if (argc == 1 || do_help) |
---|
| 997 | { |
---|
| 998 | /* argc == 1: no options have been specified */ |
---|
| 999 | po::doHelp(cout, opts); |
---|
| 1000 | return false; |
---|
| 1001 | } |
---|
| 1002 | |
---|
| 1003 | /* |
---|
| 1004 | * Set any derived parameters |
---|
| 1005 | */ |
---|
| 1006 | /* convert std::string to c string for compatability */ |
---|
| 1007 | #if SVC_EXTENSION |
---|
| 1008 | #if AVC_BASE |
---|
| 1009 | if( m_avcBaseLayerFlag ) |
---|
| 1010 | { |
---|
| 1011 | *cfg_InputFile[0] = cfg_BLInputFile; |
---|
| 1012 | } |
---|
| 1013 | #endif |
---|
| 1014 | m_pBitstreamFile = cfg_BitstreamFile.empty() ? NULL : strdup(cfg_BitstreamFile.c_str()); |
---|
| 1015 | #if AVC_SYNTAX |
---|
| 1016 | m_BLSyntaxFile = cfg_BLSyntaxFile.empty() ? NULL : strdup(cfg_BLSyntaxFile.c_str()); |
---|
| 1017 | #endif |
---|
[467] | 1018 | #else //SVC_EXTENSION |
---|
[313] | 1019 | m_pchInputFile = cfg_InputFile.empty() ? NULL : strdup(cfg_InputFile.c_str()); |
---|
| 1020 | m_pchBitstreamFile = cfg_BitstreamFile.empty() ? NULL : strdup(cfg_BitstreamFile.c_str()); |
---|
| 1021 | m_pchReconFile = cfg_ReconFile.empty() ? NULL : strdup(cfg_ReconFile.c_str()); |
---|
| 1022 | m_pchdQPFile = cfg_dQPFile.empty() ? NULL : strdup(cfg_dQPFile.c_str()); |
---|
[467] | 1023 | #endif //SVC_EXTENSION |
---|
[313] | 1024 | |
---|
| 1025 | Char* pColumnWidth = cfg_ColumnWidth.empty() ? NULL: strdup(cfg_ColumnWidth.c_str()); |
---|
| 1026 | Char* pRowHeight = cfg_RowHeight.empty() ? NULL : strdup(cfg_RowHeight.c_str()); |
---|
| 1027 | if( m_iUniformSpacingIdr == 0 && m_iNumColumnsMinus1 > 0 ) |
---|
| 1028 | { |
---|
| 1029 | char *columnWidth; |
---|
| 1030 | int i=0; |
---|
| 1031 | m_pColumnWidth = new UInt[m_iNumColumnsMinus1]; |
---|
| 1032 | columnWidth = strtok(pColumnWidth, " ,-"); |
---|
| 1033 | while(columnWidth!=NULL) |
---|
| 1034 | { |
---|
| 1035 | if( i>=m_iNumColumnsMinus1 ) |
---|
| 1036 | { |
---|
| 1037 | printf( "The number of columns whose width are defined is larger than the allowed number of columns.\n" ); |
---|
| 1038 | exit( EXIT_FAILURE ); |
---|
| 1039 | } |
---|
| 1040 | *( m_pColumnWidth + i ) = atoi( columnWidth ); |
---|
| 1041 | columnWidth = strtok(NULL, " ,-"); |
---|
| 1042 | i++; |
---|
| 1043 | } |
---|
| 1044 | if( i<m_iNumColumnsMinus1 ) |
---|
| 1045 | { |
---|
| 1046 | printf( "The width of some columns is not defined.\n" ); |
---|
| 1047 | exit( EXIT_FAILURE ); |
---|
| 1048 | } |
---|
| 1049 | } |
---|
| 1050 | else |
---|
| 1051 | { |
---|
| 1052 | m_pColumnWidth = NULL; |
---|
| 1053 | } |
---|
| 1054 | |
---|
| 1055 | if( m_iUniformSpacingIdr == 0 && m_iNumRowsMinus1 > 0 ) |
---|
| 1056 | { |
---|
| 1057 | char *rowHeight; |
---|
| 1058 | int i=0; |
---|
| 1059 | m_pRowHeight = new UInt[m_iNumRowsMinus1]; |
---|
| 1060 | rowHeight = strtok(pRowHeight, " ,-"); |
---|
| 1061 | while(rowHeight!=NULL) |
---|
| 1062 | { |
---|
| 1063 | if( i>=m_iNumRowsMinus1 ) |
---|
| 1064 | { |
---|
| 1065 | printf( "The number of rows whose height are defined is larger than the allowed number of rows.\n" ); |
---|
| 1066 | exit( EXIT_FAILURE ); |
---|
| 1067 | } |
---|
| 1068 | *( m_pRowHeight + i ) = atoi( rowHeight ); |
---|
| 1069 | rowHeight = strtok(NULL, " ,-"); |
---|
| 1070 | i++; |
---|
| 1071 | } |
---|
| 1072 | if( i<m_iNumRowsMinus1 ) |
---|
| 1073 | { |
---|
| 1074 | printf( "The height of some rows is not defined.\n" ); |
---|
| 1075 | exit( EXIT_FAILURE ); |
---|
| 1076 | } |
---|
| 1077 | } |
---|
| 1078 | else |
---|
| 1079 | { |
---|
| 1080 | m_pRowHeight = NULL; |
---|
| 1081 | } |
---|
[467] | 1082 | #if SVC_EXTENSION |
---|
[313] | 1083 | for(Int layer = 0; layer < MAX_LAYERS; layer++) |
---|
| 1084 | { |
---|
| 1085 | // If number of scaled ref. layer offsets is non-zero, at least one of the offsets should be specified |
---|
| 1086 | if(m_acLayerCfg[layer].m_numScaledRefLayerOffsets) |
---|
| 1087 | { |
---|
| 1088 | assert( strcmp(cfg_scaledRefLayerLeftOffset[layer].c_str(), "") || |
---|
| 1089 | strcmp(cfg_scaledRefLayerRightOffset[layer].c_str(), "") || |
---|
| 1090 | strcmp(cfg_scaledRefLayerTopOffset[layer].c_str(), "") || |
---|
| 1091 | strcmp(cfg_scaledRefLayerBottomOffset[layer].c_str(),"") |
---|
| 1092 | ); |
---|
| 1093 | } |
---|
| 1094 | |
---|
| 1095 | Int *tempArray = NULL; // Contain the value |
---|
| 1096 | // Left offset // |
---|
| 1097 | if(strcmp(cfg_scaledRefLayerLeftOffset[layer].c_str(), "")) |
---|
| 1098 | { |
---|
| 1099 | cfgStringToArray( &tempArray, cfg_scaledRefLayerLeftOffset[layer], m_acLayerCfg[layer].m_numScaledRefLayerOffsets, "LeftOffset"); |
---|
| 1100 | if(tempArray) |
---|
| 1101 | { |
---|
| 1102 | for(Int i = 0; i < m_acLayerCfg[layer].m_numScaledRefLayerOffsets; i++) |
---|
| 1103 | { |
---|
| 1104 | m_acLayerCfg[layer].m_scaledRefLayerLeftOffset[i] = tempArray[i]; |
---|
| 1105 | } |
---|
| 1106 | delete [] tempArray; tempArray = NULL; |
---|
| 1107 | } |
---|
| 1108 | } |
---|
| 1109 | |
---|
| 1110 | // Top offset // |
---|
| 1111 | if(strcmp(cfg_scaledRefLayerTopOffset[layer].c_str(), "")) |
---|
| 1112 | { |
---|
| 1113 | cfgStringToArray( &tempArray, cfg_scaledRefLayerTopOffset[layer], m_acLayerCfg[layer].m_numScaledRefLayerOffsets, "TopOffset"); |
---|
| 1114 | if(tempArray) |
---|
| 1115 | { |
---|
| 1116 | for(Int i = 0; i < m_acLayerCfg[layer].m_numScaledRefLayerOffsets; i++) |
---|
| 1117 | { |
---|
| 1118 | m_acLayerCfg[layer].m_scaledRefLayerTopOffset[i] = tempArray[i]; |
---|
| 1119 | } |
---|
| 1120 | delete [] tempArray; tempArray = NULL; |
---|
| 1121 | } |
---|
| 1122 | } |
---|
| 1123 | |
---|
| 1124 | // Right offset // |
---|
| 1125 | if(strcmp(cfg_scaledRefLayerRightOffset[layer].c_str(), "")) |
---|
| 1126 | { |
---|
| 1127 | cfgStringToArray( &tempArray, cfg_scaledRefLayerRightOffset[layer], m_acLayerCfg[layer].m_numScaledRefLayerOffsets, "RightOffset"); |
---|
| 1128 | if(tempArray) |
---|
| 1129 | { |
---|
| 1130 | for(Int i = 0; i < m_acLayerCfg[layer].m_numScaledRefLayerOffsets; i++) |
---|
| 1131 | { |
---|
| 1132 | m_acLayerCfg[layer].m_scaledRefLayerRightOffset[i] = tempArray[i]; |
---|
| 1133 | } |
---|
| 1134 | delete [] tempArray; tempArray = NULL; |
---|
| 1135 | } |
---|
| 1136 | } |
---|
| 1137 | |
---|
| 1138 | // Bottom offset // |
---|
| 1139 | if(strcmp(cfg_scaledRefLayerBottomOffset[layer].c_str(), "")) |
---|
| 1140 | { |
---|
| 1141 | cfgStringToArray( &tempArray, cfg_scaledRefLayerBottomOffset[layer], m_acLayerCfg[layer].m_numScaledRefLayerOffsets, "BottomOffset"); |
---|
| 1142 | if(tempArray) |
---|
| 1143 | { |
---|
| 1144 | for(Int i = 0; i < m_acLayerCfg[layer].m_numScaledRefLayerOffsets; i++) |
---|
| 1145 | { |
---|
| 1146 | m_acLayerCfg[layer].m_scaledRefLayerBottomOffset[i] = tempArray[i]; |
---|
| 1147 | } |
---|
| 1148 | delete [] tempArray; tempArray = NULL; |
---|
| 1149 | } |
---|
| 1150 | } |
---|
| 1151 | } |
---|
| 1152 | #if VPS_EXTN_DIRECT_REF_LAYERS |
---|
| 1153 | #if M0457_PREDICTION_INDICATIONS |
---|
| 1154 | for(Int layer = 0; layer < MAX_LAYERS; layer++) |
---|
| 1155 | { |
---|
| 1156 | Char* pSamplePredRefLayerIds = cfg_samplePredRefLayerIds[layer].empty() ? NULL: strdup(cfg_samplePredRefLayerIds[layer].c_str()); |
---|
| 1157 | if( m_acLayerCfg[layer].m_numSamplePredRefLayers > 0 ) |
---|
| 1158 | { |
---|
| 1159 | char *samplePredRefLayerId; |
---|
| 1160 | int i=0; |
---|
| 1161 | m_acLayerCfg[layer].m_samplePredRefLayerIds = new Int[m_acLayerCfg[layer].m_numSamplePredRefLayers]; |
---|
| 1162 | samplePredRefLayerId = strtok(pSamplePredRefLayerIds, " ,-"); |
---|
| 1163 | while(samplePredRefLayerId != NULL) |
---|
| 1164 | { |
---|
| 1165 | if( i >= m_acLayerCfg[layer].m_numSamplePredRefLayers ) |
---|
| 1166 | { |
---|
| 1167 | printf( "NumSamplePredRefLayers: The number of columns whose width are defined is larger than the allowed number of columns.\n" ); |
---|
| 1168 | exit( EXIT_FAILURE ); |
---|
| 1169 | } |
---|
| 1170 | *( m_acLayerCfg[layer].m_samplePredRefLayerIds + i ) = atoi( samplePredRefLayerId ); |
---|
| 1171 | samplePredRefLayerId = strtok(NULL, " ,-"); |
---|
| 1172 | i++; |
---|
| 1173 | } |
---|
| 1174 | if( i < m_acLayerCfg[layer].m_numSamplePredRefLayers ) |
---|
| 1175 | { |
---|
| 1176 | printf( "NumSamplePredRefLayers: The width of some columns is not defined.\n" ); |
---|
| 1177 | exit( EXIT_FAILURE ); |
---|
| 1178 | } |
---|
| 1179 | } |
---|
| 1180 | else |
---|
| 1181 | { |
---|
| 1182 | m_acLayerCfg[layer].m_samplePredRefLayerIds = NULL; |
---|
| 1183 | } |
---|
| 1184 | } |
---|
| 1185 | for(Int layer = 0; layer < MAX_LAYERS; layer++) |
---|
| 1186 | { |
---|
| 1187 | Char* pMotionPredRefLayerIds = cfg_motionPredRefLayerIds[layer].empty() ? NULL: strdup(cfg_motionPredRefLayerIds[layer].c_str()); |
---|
| 1188 | if( m_acLayerCfg[layer].m_numMotionPredRefLayers > 0 ) |
---|
| 1189 | { |
---|
| 1190 | char *motionPredRefLayerId; |
---|
| 1191 | int i=0; |
---|
| 1192 | m_acLayerCfg[layer].m_motionPredRefLayerIds = new Int[m_acLayerCfg[layer].m_numMotionPredRefLayers]; |
---|
| 1193 | motionPredRefLayerId = strtok(pMotionPredRefLayerIds, " ,-"); |
---|
| 1194 | while(motionPredRefLayerId != NULL) |
---|
| 1195 | { |
---|
| 1196 | if( i >= m_acLayerCfg[layer].m_numMotionPredRefLayers ) |
---|
| 1197 | { |
---|
| 1198 | printf( "NumMotionPredRefLayers: The number of columns whose width are defined is larger than the allowed number of columns.\n" ); |
---|
| 1199 | exit( EXIT_FAILURE ); |
---|
| 1200 | } |
---|
| 1201 | *( m_acLayerCfg[layer].m_motionPredRefLayerIds + i ) = atoi( motionPredRefLayerId ); |
---|
| 1202 | motionPredRefLayerId = strtok(NULL, " ,-"); |
---|
| 1203 | i++; |
---|
| 1204 | } |
---|
| 1205 | if( i < m_acLayerCfg[layer].m_numMotionPredRefLayers ) |
---|
| 1206 | { |
---|
| 1207 | printf( "NumMotionPredRefLayers: The width of some columns is not defined.\n" ); |
---|
| 1208 | exit( EXIT_FAILURE ); |
---|
| 1209 | } |
---|
| 1210 | } |
---|
| 1211 | else |
---|
| 1212 | { |
---|
| 1213 | m_acLayerCfg[layer].m_motionPredRefLayerIds = NULL; |
---|
| 1214 | } |
---|
| 1215 | } |
---|
| 1216 | #else |
---|
| 1217 | for(Int layer = 0; layer < MAX_LAYERS; layer++) |
---|
| 1218 | { |
---|
| 1219 | Char* pRefLayerIds = cfg_refLayerIds[layer].empty() ? NULL: strdup(cfg_refLayerIds[layer].c_str()); |
---|
| 1220 | if( m_acLayerCfg[layer].m_numDirectRefLayers > 0 ) |
---|
| 1221 | { |
---|
| 1222 | char *refLayerId; |
---|
| 1223 | int i=0; |
---|
| 1224 | m_acLayerCfg[layer].m_refLayerIds = new Int[m_acLayerCfg[layer].m_numDirectRefLayers]; |
---|
| 1225 | refLayerId = strtok(pRefLayerIds, " ,-"); |
---|
| 1226 | while(refLayerId != NULL) |
---|
| 1227 | { |
---|
| 1228 | if( i >= m_acLayerCfg[layer].m_numDirectRefLayers ) |
---|
| 1229 | { |
---|
| 1230 | printf( "NumDirectRefLayers: The number of columns whose width are defined is larger than the allowed number of columns.\n" ); |
---|
| 1231 | exit( EXIT_FAILURE ); |
---|
| 1232 | } |
---|
| 1233 | *( m_acLayerCfg[layer].m_refLayerIds + i ) = atoi( refLayerId ); |
---|
| 1234 | refLayerId = strtok(NULL, " ,-"); |
---|
| 1235 | i++; |
---|
| 1236 | } |
---|
| 1237 | if( i < m_acLayerCfg[layer].m_numDirectRefLayers ) |
---|
| 1238 | { |
---|
| 1239 | printf( "NumDirectRefLayers: The width of some columns is not defined.\n" ); |
---|
| 1240 | exit( EXIT_FAILURE ); |
---|
| 1241 | } |
---|
| 1242 | } |
---|
| 1243 | else |
---|
| 1244 | { |
---|
| 1245 | m_acLayerCfg[layer].m_refLayerIds = NULL; |
---|
| 1246 | } |
---|
| 1247 | } |
---|
| 1248 | #endif |
---|
[475] | 1249 | #if AUXILIARY_PICTURES |
---|
| 1250 | for(UInt layer = 0; layer < MAX_LAYERS; layer++) |
---|
| 1251 | { |
---|
| 1252 | m_acLayerCfg[layer].m_InputChromaFormat = numberToChromaFormat(cfg_tmpChromaFormatIDC[layer]); |
---|
| 1253 | m_acLayerCfg[layer].m_chromaFormatIDC = ((cfg_tmpChromaFormatIDC[layer] == 0) ? (m_acLayerCfg[layer].m_InputChromaFormat ) : (numberToChromaFormat(cfg_tmpChromaFormatIDC[layer]))); |
---|
| 1254 | } |
---|
| 1255 | #endif |
---|
[313] | 1256 | for(Int layer = 0; layer < MAX_LAYERS; layer++) |
---|
| 1257 | { |
---|
| 1258 | Char* pPredLayerIds = cfg_predLayerIds[layer].empty() ? NULL: strdup(cfg_predLayerIds[layer].c_str()); |
---|
| 1259 | if( m_acLayerCfg[layer].m_numActiveRefLayers > 0 ) |
---|
| 1260 | { |
---|
| 1261 | char *refLayerId; |
---|
| 1262 | int i=0; |
---|
| 1263 | m_acLayerCfg[layer].m_predLayerIds = new Int[m_acLayerCfg[layer].m_numActiveRefLayers]; |
---|
| 1264 | refLayerId = strtok(pPredLayerIds, " ,-"); |
---|
| 1265 | while(refLayerId != NULL) |
---|
| 1266 | { |
---|
| 1267 | if( i >= m_acLayerCfg[layer].m_numActiveRefLayers ) |
---|
| 1268 | { |
---|
| 1269 | printf( "NumActiveRefLayers: The number of columns whose width are defined is larger than the allowed number of columns.\n" ); |
---|
| 1270 | exit( EXIT_FAILURE ); |
---|
| 1271 | } |
---|
| 1272 | *( m_acLayerCfg[layer].m_predLayerIds + i ) = atoi( refLayerId ); |
---|
| 1273 | refLayerId = strtok(NULL, " ,-"); |
---|
| 1274 | i++; |
---|
| 1275 | } |
---|
| 1276 | if( i < m_acLayerCfg[layer].m_numActiveRefLayers ) |
---|
| 1277 | { |
---|
| 1278 | printf( "NumActiveRefLayers: The width of some columns is not defined.\n" ); |
---|
| 1279 | exit( EXIT_FAILURE ); |
---|
| 1280 | } |
---|
| 1281 | } |
---|
| 1282 | else |
---|
| 1283 | { |
---|
| 1284 | m_acLayerCfg[layer].m_predLayerIds = NULL; |
---|
| 1285 | } |
---|
| 1286 | } |
---|
| 1287 | #endif |
---|
[467] | 1288 | #endif //SVC_EXTENSION |
---|
[313] | 1289 | m_scalingListFile = cfg_ScalingListFile.empty() ? NULL : strdup(cfg_ScalingListFile.c_str()); |
---|
[442] | 1290 | |
---|
[313] | 1291 | /* rules for input, output and internal bitdepths as per help text */ |
---|
[466] | 1292 | #if O0194_DIFFERENT_BITDEPTH_EL_BL |
---|
[468] | 1293 | for(Int layer = 0; layer < MAX_LAYERS; layer++) |
---|
| 1294 | { |
---|
[466] | 1295 | if (!m_acLayerCfg[layer].m_internalBitDepthY) { m_acLayerCfg[layer].m_internalBitDepthY = m_acLayerCfg[layer].m_inputBitDepthY; } |
---|
| 1296 | if (!m_acLayerCfg[layer].m_internalBitDepthC) { m_acLayerCfg[layer].m_internalBitDepthC = m_acLayerCfg[layer].m_internalBitDepthY; } |
---|
| 1297 | if (!m_acLayerCfg[layer].m_inputBitDepthC) { m_acLayerCfg[layer].m_inputBitDepthC = m_acLayerCfg[layer].m_inputBitDepthY; } |
---|
| 1298 | if (!m_acLayerCfg[layer].m_outputBitDepthY) { m_acLayerCfg[layer].m_outputBitDepthY = m_acLayerCfg[layer].m_internalBitDepthY; } |
---|
| 1299 | if (!m_acLayerCfg[layer].m_outputBitDepthC) { m_acLayerCfg[layer].m_outputBitDepthC = m_acLayerCfg[layer].m_internalBitDepthC; } |
---|
| 1300 | } |
---|
| 1301 | #else |
---|
[313] | 1302 | if (!m_internalBitDepthY) { m_internalBitDepthY = m_inputBitDepthY; } |
---|
| 1303 | if (!m_internalBitDepthC) { m_internalBitDepthC = m_internalBitDepthY; } |
---|
| 1304 | if (!m_inputBitDepthC) { m_inputBitDepthC = m_inputBitDepthY; } |
---|
| 1305 | if (!m_outputBitDepthY) { m_outputBitDepthY = m_internalBitDepthY; } |
---|
| 1306 | if (!m_outputBitDepthC) { m_outputBitDepthC = m_internalBitDepthC; } |
---|
[466] | 1307 | #endif |
---|
[313] | 1308 | |
---|
| 1309 | #if !SVC_EXTENSION |
---|
| 1310 | // TODO:ChromaFmt assumes 4:2:0 below |
---|
| 1311 | switch (m_conformanceMode) |
---|
| 1312 | { |
---|
| 1313 | case 0: |
---|
| 1314 | { |
---|
| 1315 | // no conformance or padding |
---|
| 1316 | m_confLeft = m_confRight = m_confTop = m_confBottom = 0; |
---|
| 1317 | m_aiPad[1] = m_aiPad[0] = 0; |
---|
| 1318 | break; |
---|
| 1319 | } |
---|
| 1320 | case 1: |
---|
| 1321 | { |
---|
| 1322 | // automatic padding to minimum CU size |
---|
| 1323 | Int minCuSize = m_uiMaxCUHeight >> (m_uiMaxCUDepth - 1); |
---|
| 1324 | if (m_iSourceWidth % minCuSize) |
---|
| 1325 | { |
---|
| 1326 | m_aiPad[0] = m_confRight = ((m_iSourceWidth / minCuSize) + 1) * minCuSize - m_iSourceWidth; |
---|
| 1327 | m_iSourceWidth += m_confRight; |
---|
| 1328 | } |
---|
| 1329 | if (m_iSourceHeight % minCuSize) |
---|
| 1330 | { |
---|
| 1331 | m_aiPad[1] = m_confBottom = ((m_iSourceHeight / minCuSize) + 1) * minCuSize - m_iSourceHeight; |
---|
| 1332 | m_iSourceHeight += m_confBottom; |
---|
[442] | 1333 | if ( m_isField ) |
---|
| 1334 | { |
---|
| 1335 | m_iSourceHeightOrg += m_confBottom << 1; |
---|
| 1336 | m_aiPad[1] = m_confBottom << 1; |
---|
| 1337 | } |
---|
[313] | 1338 | } |
---|
| 1339 | if (m_aiPad[0] % TComSPS::getWinUnitX(CHROMA_420) != 0) |
---|
| 1340 | { |
---|
| 1341 | fprintf(stderr, "Error: picture width is not an integer multiple of the specified chroma subsampling\n"); |
---|
| 1342 | exit(EXIT_FAILURE); |
---|
| 1343 | } |
---|
| 1344 | if (m_aiPad[1] % TComSPS::getWinUnitY(CHROMA_420) != 0) |
---|
| 1345 | { |
---|
| 1346 | fprintf(stderr, "Error: picture height is not an integer multiple of the specified chroma subsampling\n"); |
---|
| 1347 | exit(EXIT_FAILURE); |
---|
| 1348 | } |
---|
| 1349 | break; |
---|
| 1350 | } |
---|
| 1351 | case 2: |
---|
| 1352 | { |
---|
| 1353 | //padding |
---|
| 1354 | m_iSourceWidth += m_aiPad[0]; |
---|
| 1355 | m_iSourceHeight += m_aiPad[1]; |
---|
| 1356 | m_confRight = m_aiPad[0]; |
---|
| 1357 | m_confBottom = m_aiPad[1]; |
---|
| 1358 | break; |
---|
| 1359 | } |
---|
| 1360 | case 3: |
---|
| 1361 | { |
---|
| 1362 | // conformance |
---|
| 1363 | if ((m_confLeft == 0) && (m_confRight == 0) && (m_confTop == 0) && (m_confBottom == 0)) |
---|
| 1364 | { |
---|
| 1365 | fprintf(stderr, "Warning: Conformance window enabled, but all conformance window parameters set to zero\n"); |
---|
| 1366 | } |
---|
| 1367 | if ((m_aiPad[1] != 0) || (m_aiPad[0]!=0)) |
---|
| 1368 | { |
---|
| 1369 | fprintf(stderr, "Warning: Conformance window enabled, padding parameters will be ignored\n"); |
---|
| 1370 | } |
---|
| 1371 | m_aiPad[1] = m_aiPad[0] = 0; |
---|
| 1372 | break; |
---|
| 1373 | } |
---|
| 1374 | } |
---|
| 1375 | |
---|
| 1376 | // allocate slice-based dQP values |
---|
| 1377 | m_aidQP = new Int[ m_framesToBeEncoded + m_iGOPSize + 1 ]; |
---|
| 1378 | ::memset( m_aidQP, 0, sizeof(Int)*( m_framesToBeEncoded + m_iGOPSize + 1 ) ); |
---|
| 1379 | |
---|
| 1380 | // handling of floating-point QP values |
---|
| 1381 | // if QP is not integer, sequence is split into two sections having QP and QP+1 |
---|
| 1382 | m_iQP = (Int)( m_fQP ); |
---|
| 1383 | if ( m_iQP < m_fQP ) |
---|
| 1384 | { |
---|
| 1385 | Int iSwitchPOC = (Int)( m_framesToBeEncoded - (m_fQP - m_iQP)*m_framesToBeEncoded + 0.5 ); |
---|
| 1386 | |
---|
| 1387 | iSwitchPOC = (Int)( (Double)iSwitchPOC / m_iGOPSize + 0.5 )*m_iGOPSize; |
---|
| 1388 | for ( Int i=iSwitchPOC; i<m_framesToBeEncoded + m_iGOPSize + 1; i++ ) |
---|
| 1389 | { |
---|
| 1390 | m_aidQP[i] = 1; |
---|
| 1391 | } |
---|
| 1392 | } |
---|
| 1393 | |
---|
| 1394 | // reading external dQP description from file |
---|
| 1395 | if ( m_pchdQPFile ) |
---|
| 1396 | { |
---|
| 1397 | FILE* fpt=fopen( m_pchdQPFile, "r" ); |
---|
| 1398 | if ( fpt ) |
---|
| 1399 | { |
---|
| 1400 | Int iValue; |
---|
| 1401 | Int iPOC = 0; |
---|
| 1402 | while ( iPOC < m_framesToBeEncoded ) |
---|
| 1403 | { |
---|
| 1404 | if ( fscanf(fpt, "%d", &iValue ) == EOF ) break; |
---|
| 1405 | m_aidQP[ iPOC ] = iValue; |
---|
| 1406 | iPOC++; |
---|
| 1407 | } |
---|
| 1408 | fclose(fpt); |
---|
| 1409 | } |
---|
| 1410 | } |
---|
| 1411 | m_iWaveFrontSubstreams = m_iWaveFrontSynchro ? (m_iSourceHeight + m_uiMaxCUHeight - 1) / m_uiMaxCUHeight : 1; |
---|
| 1412 | #endif |
---|
| 1413 | if( m_toneMappingInfoSEIEnabled && !m_toneMapCancelFlag ) |
---|
| 1414 | { |
---|
| 1415 | Char* pcStartOfCodedInterval = cfg_startOfCodedInterval.empty() ? NULL: strdup(cfg_startOfCodedInterval.c_str()); |
---|
| 1416 | Char* pcCodedPivotValue = cfg_codedPivotValue.empty() ? NULL: strdup(cfg_codedPivotValue.c_str()); |
---|
| 1417 | Char* pcTargetPivotValue = cfg_targetPivotValue.empty() ? NULL: strdup(cfg_targetPivotValue.c_str()); |
---|
| 1418 | if( m_toneMapModelId == 2 && pcStartOfCodedInterval ) |
---|
| 1419 | { |
---|
| 1420 | char *startOfCodedInterval; |
---|
| 1421 | UInt num = 1u<< m_toneMapTargetBitDepth; |
---|
| 1422 | m_startOfCodedInterval = new Int[num]; |
---|
| 1423 | ::memset( m_startOfCodedInterval, 0, sizeof(Int)*num ); |
---|
| 1424 | startOfCodedInterval = strtok(pcStartOfCodedInterval, " ."); |
---|
| 1425 | int i = 0; |
---|
| 1426 | while( startOfCodedInterval && ( i < num ) ) |
---|
| 1427 | { |
---|
| 1428 | m_startOfCodedInterval[i] = atoi( startOfCodedInterval ); |
---|
| 1429 | startOfCodedInterval = strtok(NULL, " ."); |
---|
| 1430 | i++; |
---|
| 1431 | } |
---|
| 1432 | } |
---|
| 1433 | else |
---|
| 1434 | { |
---|
| 1435 | m_startOfCodedInterval = NULL; |
---|
| 1436 | } |
---|
| 1437 | if( ( m_toneMapModelId == 3 ) && ( m_numPivots > 0 ) ) |
---|
| 1438 | { |
---|
| 1439 | if( pcCodedPivotValue && pcTargetPivotValue ) |
---|
| 1440 | { |
---|
| 1441 | char *codedPivotValue; |
---|
| 1442 | char *targetPivotValue; |
---|
| 1443 | m_codedPivotValue = new Int[m_numPivots]; |
---|
| 1444 | m_targetPivotValue = new Int[m_numPivots]; |
---|
| 1445 | ::memset( m_codedPivotValue, 0, sizeof(Int)*( m_numPivots ) ); |
---|
| 1446 | ::memset( m_targetPivotValue, 0, sizeof(Int)*( m_numPivots ) ); |
---|
| 1447 | codedPivotValue = strtok(pcCodedPivotValue, " ."); |
---|
| 1448 | int i=0; |
---|
| 1449 | while(codedPivotValue&&i<m_numPivots) |
---|
| 1450 | { |
---|
| 1451 | m_codedPivotValue[i] = atoi( codedPivotValue ); |
---|
| 1452 | codedPivotValue = strtok(NULL, " ."); |
---|
| 1453 | i++; |
---|
| 1454 | } |
---|
| 1455 | i=0; |
---|
| 1456 | targetPivotValue = strtok(pcTargetPivotValue, " ."); |
---|
| 1457 | while(targetPivotValue&&i<m_numPivots) |
---|
| 1458 | { |
---|
| 1459 | m_targetPivotValue[i]= atoi( targetPivotValue ); |
---|
| 1460 | targetPivotValue = strtok(NULL, " ."); |
---|
| 1461 | i++; |
---|
| 1462 | } |
---|
| 1463 | } |
---|
| 1464 | } |
---|
| 1465 | else |
---|
| 1466 | { |
---|
| 1467 | m_codedPivotValue = NULL; |
---|
| 1468 | m_targetPivotValue = NULL; |
---|
| 1469 | } |
---|
| 1470 | } |
---|
[442] | 1471 | #if N0383_IL_CONSTRAINED_TILE_SETS_SEI |
---|
| 1472 | if (m_interLayerConstrainedTileSetsSEIEnabled) |
---|
| 1473 | { |
---|
| 1474 | if (m_iNumColumnsMinus1 == 0 && m_iNumRowsMinus1 == 0) |
---|
| 1475 | { |
---|
| 1476 | printf( "Tiles are not defined (needed for inter-layer comnstrained tile sets SEI).\n" ); |
---|
| 1477 | exit( EXIT_FAILURE ); |
---|
| 1478 | } |
---|
| 1479 | Char* pTileSets = cfg_tileSets.empty() ? NULL : strdup(cfg_tileSets.c_str()); |
---|
| 1480 | int i = 0; |
---|
| 1481 | char *topLeftTileIndex = strtok(pTileSets, " ,"); |
---|
| 1482 | while(topLeftTileIndex != NULL) |
---|
| 1483 | { |
---|
| 1484 | if( i >= m_ilNumSetsInMessage ) |
---|
| 1485 | { |
---|
| 1486 | printf( "The number of tile sets is larger than defined by IlNumSetsInMessage.\n" ); |
---|
| 1487 | exit( EXIT_FAILURE ); |
---|
| 1488 | } |
---|
| 1489 | *( m_topLeftTileIndex + i ) = atoi( topLeftTileIndex ); |
---|
| 1490 | char *bottonRightTileIndex = strtok(NULL, " ,"); |
---|
| 1491 | if( bottonRightTileIndex == NULL ) |
---|
| 1492 | { |
---|
| 1493 | printf( "BottonRightTileIndex is missing in the tile sets.\n" ); |
---|
| 1494 | exit( EXIT_FAILURE ); |
---|
| 1495 | } |
---|
| 1496 | *( m_bottomRightTileIndex + i ) = atoi( bottonRightTileIndex ); |
---|
| 1497 | char *ilcIdc = strtok(NULL, " ,"); |
---|
| 1498 | if( ilcIdc == NULL ) |
---|
| 1499 | { |
---|
| 1500 | printf( "IlcIdc is missing in the tile sets.\n" ); |
---|
| 1501 | exit( EXIT_FAILURE ); |
---|
| 1502 | } |
---|
| 1503 | *( m_ilcIdc + i ) = atoi( ilcIdc ); |
---|
| 1504 | topLeftTileIndex = strtok(NULL, " ,"); |
---|
| 1505 | i++; |
---|
| 1506 | } |
---|
| 1507 | if( i < m_ilNumSetsInMessage ) |
---|
| 1508 | { |
---|
| 1509 | printf( "The number of tile sets is smaller than defined by IlNumSetsInMessage.\n" ); |
---|
| 1510 | exit( EXIT_FAILURE ); |
---|
| 1511 | } |
---|
| 1512 | m_skippedTileSetPresentFlag = false; |
---|
| 1513 | } |
---|
| 1514 | #endif |
---|
[313] | 1515 | // check validity of input parameters |
---|
| 1516 | xCheckParameter(); |
---|
| 1517 | |
---|
| 1518 | // set global varibles |
---|
[467] | 1519 | #if LAYER_CTB |
---|
| 1520 | for(Int layer = 0; layer < MAX_LAYERS; layer++) |
---|
| 1521 | { |
---|
| 1522 | xSetGlobal(layer); |
---|
| 1523 | } |
---|
| 1524 | #else |
---|
[313] | 1525 | xSetGlobal(); |
---|
[467] | 1526 | #endif |
---|
[313] | 1527 | |
---|
| 1528 | // print-out parameters |
---|
| 1529 | xPrintParameter(); |
---|
| 1530 | |
---|
| 1531 | return true; |
---|
| 1532 | } |
---|
| 1533 | // ==================================================================================================================== |
---|
| 1534 | // Private member functions |
---|
| 1535 | // ==================================================================================================================== |
---|
| 1536 | |
---|
| 1537 | Bool confirmPara(Bool bflag, const Char* message); |
---|
| 1538 | |
---|
| 1539 | Void TAppEncCfg::xCheckParameter() |
---|
| 1540 | { |
---|
| 1541 | if (!m_decodedPictureHashSEIEnabled) |
---|
| 1542 | { |
---|
| 1543 | fprintf(stderr, "******************************************************************\n"); |
---|
| 1544 | fprintf(stderr, "** WARNING: --SEIDecodedPictureHash is now disabled by default. **\n"); |
---|
| 1545 | fprintf(stderr, "** Automatic verification of decoded pictures by a **\n"); |
---|
| 1546 | fprintf(stderr, "** decoder requires this option to be enabled. **\n"); |
---|
| 1547 | fprintf(stderr, "******************************************************************\n"); |
---|
| 1548 | } |
---|
| 1549 | if( m_profile==Profile::NONE ) |
---|
| 1550 | { |
---|
| 1551 | fprintf(stderr, "***************************************************************************\n"); |
---|
| 1552 | fprintf(stderr, "** WARNING: For conforming bitstreams a valid Profile value must be set! **\n"); |
---|
| 1553 | fprintf(stderr, "***************************************************************************\n"); |
---|
| 1554 | } |
---|
| 1555 | if( m_level==Level::NONE ) |
---|
| 1556 | { |
---|
| 1557 | fprintf(stderr, "***************************************************************************\n"); |
---|
| 1558 | fprintf(stderr, "** WARNING: For conforming bitstreams a valid Level value must be set! **\n"); |
---|
| 1559 | fprintf(stderr, "***************************************************************************\n"); |
---|
| 1560 | } |
---|
| 1561 | |
---|
| 1562 | Bool check_failed = false; /* abort if there is a fatal configuration problem */ |
---|
| 1563 | #define xConfirmPara(a,b) check_failed |= confirmPara(a,b) |
---|
| 1564 | // check range of parameters |
---|
[466] | 1565 | #if O0194_DIFFERENT_BITDEPTH_EL_BL |
---|
[468] | 1566 | for(UInt layer=0; layer<m_numLayers; layer++) |
---|
| 1567 | { |
---|
[466] | 1568 | xConfirmPara( m_acLayerCfg[layer].m_inputBitDepthY < 8, "InputBitDepth must be at least 8" ); |
---|
| 1569 | xConfirmPara( m_acLayerCfg[layer].m_inputBitDepthC < 8, "InputBitDepthC must be at least 8" ); |
---|
| 1570 | } |
---|
| 1571 | #else |
---|
[313] | 1572 | xConfirmPara( m_inputBitDepthY < 8, "InputBitDepth must be at least 8" ); |
---|
| 1573 | xConfirmPara( m_inputBitDepthC < 8, "InputBitDepthC must be at least 8" ); |
---|
[466] | 1574 | #endif |
---|
[313] | 1575 | #if !SVC_EXTENSION |
---|
| 1576 | xConfirmPara( m_iFrameRate <= 0, "Frame rate must be more than 1" ); |
---|
| 1577 | #endif |
---|
| 1578 | xConfirmPara( m_framesToBeEncoded <= 0, "Total Number Of Frames encoded must be more than 0" ); |
---|
| 1579 | xConfirmPara( m_iGOPSize < 1 , "GOP Size must be greater or equal to 1" ); |
---|
| 1580 | xConfirmPara( m_iGOPSize > 1 && m_iGOPSize % 2, "GOP Size must be a multiple of 2, if GOP Size is greater than 1" ); |
---|
| 1581 | #if !SVC_EXTENSION |
---|
| 1582 | xConfirmPara( (m_iIntraPeriod > 0 && m_iIntraPeriod < m_iGOPSize) || m_iIntraPeriod == 0, "Intra period must be more than GOP size, or -1 , not 0" ); |
---|
| 1583 | #endif |
---|
| 1584 | xConfirmPara( m_iDecodingRefreshType < 0 || m_iDecodingRefreshType > 2, "Decoding Refresh Type must be equal to 0, 1 or 2" ); |
---|
| 1585 | #if !SVC_EXTENSION |
---|
| 1586 | xConfirmPara( m_iQP < -6 * (m_internalBitDepthY - 8) || m_iQP > 51, "QP exceeds supported range (-QpBDOffsety to 51)" ); |
---|
| 1587 | #endif |
---|
| 1588 | xConfirmPara( m_loopFilterBetaOffsetDiv2 < -6 || m_loopFilterBetaOffsetDiv2 > 6, "Loop Filter Beta Offset div. 2 exceeds supported range (-6 to 6)"); |
---|
| 1589 | xConfirmPara( m_loopFilterTcOffsetDiv2 < -6 || m_loopFilterTcOffsetDiv2 > 6, "Loop Filter Tc Offset div. 2 exceeds supported range (-6 to 6)"); |
---|
| 1590 | xConfirmPara( m_iFastSearch < 0 || m_iFastSearch > 2, "Fast Search Mode is not supported value (0:Full search 1:Diamond 2:PMVFAST)" ); |
---|
| 1591 | xConfirmPara( m_iSearchRange < 0 , "Search Range must be more than 0" ); |
---|
| 1592 | xConfirmPara( m_bipredSearchRange < 0 , "Search Range must be more than 0" ); |
---|
| 1593 | xConfirmPara( m_iMaxDeltaQP > 7, "Absolute Delta QP exceeds supported range (0 to 7)" ); |
---|
[467] | 1594 | #if LAYER_CTB |
---|
| 1595 | for(UInt layer = 0; layer < MAX_LAYERS; layer++) |
---|
| 1596 | { |
---|
| 1597 | xConfirmPara( m_iMaxCuDQPDepth > m_acLayerCfg[layer].m_uiMaxCUDepth - 1, "Absolute depth for a minimum CuDQP exceeds maximum coding unit depth" ); |
---|
| 1598 | } |
---|
| 1599 | #else |
---|
[313] | 1600 | xConfirmPara( m_iMaxCuDQPDepth > m_uiMaxCUDepth - 1, "Absolute depth for a minimum CuDQP exceeds maximum coding unit depth" ); |
---|
[467] | 1601 | #endif |
---|
[313] | 1602 | |
---|
| 1603 | xConfirmPara( m_cbQpOffset < -12, "Min. Chroma Cb QP Offset is -12" ); |
---|
| 1604 | xConfirmPara( m_cbQpOffset > 12, "Max. Chroma Cb QP Offset is 12" ); |
---|
| 1605 | xConfirmPara( m_crQpOffset < -12, "Min. Chroma Cr QP Offset is -12" ); |
---|
| 1606 | xConfirmPara( m_crQpOffset > 12, "Max. Chroma Cr QP Offset is 12" ); |
---|
| 1607 | |
---|
| 1608 | xConfirmPara( m_iQPAdaptationRange <= 0, "QP Adaptation Range must be more than 0" ); |
---|
| 1609 | #if !SVC_EXTENSION |
---|
| 1610 | if (m_iDecodingRefreshType == 2) |
---|
| 1611 | { |
---|
| 1612 | xConfirmPara( m_iIntraPeriod > 0 && m_iIntraPeriod <= m_iGOPSize , "Intra period must be larger than GOP size for periodic IDR pictures"); |
---|
| 1613 | } |
---|
| 1614 | #endif |
---|
[467] | 1615 | #if !LAYER_CTB |
---|
[313] | 1616 | xConfirmPara( (m_uiMaxCUWidth >> m_uiMaxCUDepth) < 4, "Minimum partition width size should be larger than or equal to 8"); |
---|
| 1617 | xConfirmPara( (m_uiMaxCUHeight >> m_uiMaxCUDepth) < 4, "Minimum partition height size should be larger than or equal to 8"); |
---|
| 1618 | xConfirmPara( m_uiMaxCUWidth < 16, "Maximum partition width size should be larger than or equal to 16"); |
---|
| 1619 | xConfirmPara( m_uiMaxCUHeight < 16, "Maximum partition height size should be larger than or equal to 16"); |
---|
[467] | 1620 | #endif |
---|
[313] | 1621 | #if !SVC_EXTENSION |
---|
| 1622 | xConfirmPara( (m_iSourceWidth % (m_uiMaxCUWidth >> (m_uiMaxCUDepth-1)))!=0, "Resulting coded frame width must be a multiple of the minimum CU size"); |
---|
| 1623 | xConfirmPara( (m_iSourceHeight % (m_uiMaxCUHeight >> (m_uiMaxCUDepth-1)))!=0, "Resulting coded frame height must be a multiple of the minimum CU size"); |
---|
| 1624 | #endif |
---|
| 1625 | |
---|
[467] | 1626 | #if !LAYER_CTB |
---|
[313] | 1627 | xConfirmPara( m_uiQuadtreeTULog2MinSize < 2, "QuadtreeTULog2MinSize must be 2 or greater."); |
---|
| 1628 | xConfirmPara( m_uiQuadtreeTULog2MaxSize > 5, "QuadtreeTULog2MaxSize must be 5 or smaller."); |
---|
| 1629 | xConfirmPara( (1<<m_uiQuadtreeTULog2MaxSize) > m_uiMaxCUWidth, "QuadtreeTULog2MaxSize must be log2(maxCUSize) or smaller."); |
---|
| 1630 | |
---|
| 1631 | xConfirmPara( m_uiQuadtreeTULog2MaxSize < m_uiQuadtreeTULog2MinSize, "QuadtreeTULog2MaxSize must be greater than or equal to m_uiQuadtreeTULog2MinSize."); |
---|
| 1632 | xConfirmPara( (1<<m_uiQuadtreeTULog2MinSize)>(m_uiMaxCUWidth >>(m_uiMaxCUDepth-1)), "QuadtreeTULog2MinSize must not be greater than minimum CU size" ); // HS |
---|
| 1633 | xConfirmPara( (1<<m_uiQuadtreeTULog2MinSize)>(m_uiMaxCUHeight>>(m_uiMaxCUDepth-1)), "QuadtreeTULog2MinSize must not be greater than minimum CU size" ); // HS |
---|
| 1634 | xConfirmPara( ( 1 << m_uiQuadtreeTULog2MinSize ) > ( m_uiMaxCUWidth >> m_uiMaxCUDepth ), "Minimum CU width must be greater than minimum transform size." ); |
---|
| 1635 | xConfirmPara( ( 1 << m_uiQuadtreeTULog2MinSize ) > ( m_uiMaxCUHeight >> m_uiMaxCUDepth ), "Minimum CU height must be greater than minimum transform size." ); |
---|
| 1636 | xConfirmPara( m_uiQuadtreeTUMaxDepthInter < 1, "QuadtreeTUMaxDepthInter must be greater than or equal to 1" ); |
---|
| 1637 | 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" ); |
---|
| 1638 | xConfirmPara( m_uiQuadtreeTUMaxDepthIntra < 1, "QuadtreeTUMaxDepthIntra must be greater than or equal to 1" ); |
---|
| 1639 | 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" ); |
---|
[467] | 1640 | #endif |
---|
[313] | 1641 | |
---|
| 1642 | xConfirmPara( m_maxNumMergeCand < 1, "MaxNumMergeCand must be 1 or greater."); |
---|
| 1643 | xConfirmPara( m_maxNumMergeCand > 5, "MaxNumMergeCand must be 5 or smaller."); |
---|
| 1644 | |
---|
| 1645 | #if !SVC_EXTENSION |
---|
| 1646 | #if ADAPTIVE_QP_SELECTION |
---|
| 1647 | xConfirmPara( m_bUseAdaptQpSelect == true && m_iQP < 0, "AdaptiveQpSelection must be disabled when QP < 0."); |
---|
| 1648 | xConfirmPara( m_bUseAdaptQpSelect == true && (m_cbQpOffset !=0 || m_crQpOffset != 0 ), "AdaptiveQpSelection must be disabled when ChromaQpOffset is not equal to 0."); |
---|
| 1649 | #endif |
---|
| 1650 | #endif |
---|
| 1651 | |
---|
| 1652 | if( m_usePCM) |
---|
| 1653 | { |
---|
| 1654 | xConfirmPara( m_uiPCMLog2MinSize < 3, "PCMLog2MinSize must be 3 or greater."); |
---|
| 1655 | xConfirmPara( m_uiPCMLog2MinSize > 5, "PCMLog2MinSize must be 5 or smaller."); |
---|
| 1656 | xConfirmPara( m_pcmLog2MaxSize > 5, "PCMLog2MaxSize must be 5 or smaller."); |
---|
| 1657 | xConfirmPara( m_pcmLog2MaxSize < m_uiPCMLog2MinSize, "PCMLog2MaxSize must be equal to or greater than m_uiPCMLog2MinSize."); |
---|
| 1658 | } |
---|
| 1659 | |
---|
| 1660 | xConfirmPara( m_sliceMode < 0 || m_sliceMode > 3, "SliceMode exceeds supported range (0 to 3)" ); |
---|
| 1661 | if (m_sliceMode!=0) |
---|
| 1662 | { |
---|
| 1663 | xConfirmPara( m_sliceArgument < 1 , "SliceArgument should be larger than or equal to 1" ); |
---|
| 1664 | } |
---|
| 1665 | xConfirmPara( m_sliceSegmentMode < 0 || m_sliceSegmentMode > 3, "SliceSegmentMode exceeds supported range (0 to 3)" ); |
---|
| 1666 | if (m_sliceSegmentMode!=0) |
---|
| 1667 | { |
---|
| 1668 | xConfirmPara( m_sliceSegmentArgument < 1 , "SliceSegmentArgument should be larger than or equal to 1" ); |
---|
| 1669 | } |
---|
| 1670 | |
---|
| 1671 | Bool tileFlag = (m_iNumColumnsMinus1 > 0 || m_iNumRowsMinus1 > 0 ); |
---|
| 1672 | xConfirmPara( tileFlag && m_iWaveFrontSynchro, "Tile and Wavefront can not be applied together"); |
---|
| 1673 | |
---|
| 1674 | //TODO:ChromaFmt assumes 4:2:0 below |
---|
| 1675 | #if !SVC_EXTENSION |
---|
| 1676 | xConfirmPara( m_iSourceWidth % TComSPS::getWinUnitX(CHROMA_420) != 0, "Picture width must be an integer multiple of the specified chroma subsampling"); |
---|
| 1677 | xConfirmPara( m_iSourceHeight % TComSPS::getWinUnitY(CHROMA_420) != 0, "Picture height must be an integer multiple of the specified chroma subsampling"); |
---|
| 1678 | |
---|
| 1679 | xConfirmPara( m_aiPad[0] % TComSPS::getWinUnitX(CHROMA_420) != 0, "Horizontal padding must be an integer multiple of the specified chroma subsampling"); |
---|
| 1680 | xConfirmPara( m_aiPad[1] % TComSPS::getWinUnitY(CHROMA_420) != 0, "Vertical padding must be an integer multiple of the specified chroma subsampling"); |
---|
| 1681 | |
---|
| 1682 | xConfirmPara( m_confLeft % TComSPS::getWinUnitX(CHROMA_420) != 0, "Left conformance window offset must be an integer multiple of the specified chroma subsampling"); |
---|
| 1683 | xConfirmPara( m_confRight % TComSPS::getWinUnitX(CHROMA_420) != 0, "Right conformance window offset must be an integer multiple of the specified chroma subsampling"); |
---|
| 1684 | xConfirmPara( m_confTop % TComSPS::getWinUnitY(CHROMA_420) != 0, "Top conformance window offset must be an integer multiple of the specified chroma subsampling"); |
---|
| 1685 | xConfirmPara( m_confBottom % TComSPS::getWinUnitY(CHROMA_420) != 0, "Bottom conformance window offset must be an integer multiple of the specified chroma subsampling"); |
---|
| 1686 | #endif |
---|
| 1687 | |
---|
[467] | 1688 | #if !LAYER_CTB |
---|
[313] | 1689 | // max CU width and height should be power of 2 |
---|
| 1690 | UInt ui = m_uiMaxCUWidth; |
---|
| 1691 | while(ui) |
---|
| 1692 | { |
---|
| 1693 | ui >>= 1; |
---|
| 1694 | if( (ui & 1) == 1) |
---|
| 1695 | xConfirmPara( ui != 1 , "Width should be 2^n"); |
---|
| 1696 | } |
---|
| 1697 | ui = m_uiMaxCUHeight; |
---|
| 1698 | while(ui) |
---|
| 1699 | { |
---|
| 1700 | ui >>= 1; |
---|
| 1701 | if( (ui & 1) == 1) |
---|
| 1702 | xConfirmPara( ui != 1 , "Height should be 2^n"); |
---|
| 1703 | } |
---|
[467] | 1704 | #endif |
---|
[313] | 1705 | |
---|
| 1706 | /* if this is an intra-only sequence, ie IntraPeriod=1, don't verify the GOP structure |
---|
| 1707 | * This permits the ability to omit a GOP structure specification */ |
---|
| 1708 | #if SVC_EXTENSION |
---|
| 1709 | for(UInt layer = 0; layer < MAX_LAYERS; layer++) |
---|
| 1710 | { |
---|
| 1711 | Int m_iIntraPeriod = m_acLayerCfg[layer].m_iIntraPeriod; |
---|
| 1712 | #endif |
---|
| 1713 | if (m_iIntraPeriod == 1 && m_GOPList[0].m_POC == -1) { |
---|
| 1714 | m_GOPList[0] = GOPEntry(); |
---|
| 1715 | m_GOPList[0].m_QPFactor = 1; |
---|
| 1716 | m_GOPList[0].m_betaOffsetDiv2 = 0; |
---|
| 1717 | m_GOPList[0].m_tcOffsetDiv2 = 0; |
---|
| 1718 | m_GOPList[0].m_POC = 1; |
---|
| 1719 | m_GOPList[0].m_numRefPicsActive = 4; |
---|
| 1720 | } |
---|
| 1721 | #if SVC_EXTENSION |
---|
| 1722 | } |
---|
| 1723 | #endif |
---|
| 1724 | |
---|
[471] | 1725 | |
---|
[313] | 1726 | Bool verifiedGOP=false; |
---|
| 1727 | Bool errorGOP=false; |
---|
| 1728 | Int checkGOP=1; |
---|
[442] | 1729 | Int numRefs = m_isField ? 2 : 1; |
---|
[313] | 1730 | Int refList[MAX_NUM_REF_PICS+1]; |
---|
| 1731 | refList[0]=0; |
---|
[442] | 1732 | if(m_isField) |
---|
| 1733 | { |
---|
| 1734 | refList[1] = 1; |
---|
| 1735 | } |
---|
[313] | 1736 | Bool isOK[MAX_GOP]; |
---|
| 1737 | for(Int i=0; i<MAX_GOP; i++) |
---|
| 1738 | { |
---|
| 1739 | isOK[i]=false; |
---|
| 1740 | } |
---|
| 1741 | Int numOK=0; |
---|
| 1742 | #if !SVC_EXTENSION |
---|
| 1743 | xConfirmPara( m_iIntraPeriod >=0&&(m_iIntraPeriod%m_iGOPSize!=0), "Intra period must be a multiple of GOPSize, or -1" ); |
---|
| 1744 | #endif |
---|
| 1745 | |
---|
| 1746 | for(Int i=0; i<m_iGOPSize; i++) |
---|
| 1747 | { |
---|
| 1748 | if(m_GOPList[i].m_POC==m_iGOPSize) |
---|
| 1749 | { |
---|
| 1750 | xConfirmPara( m_GOPList[i].m_temporalId!=0 , "The last frame in each GOP must have temporal ID = 0 " ); |
---|
| 1751 | } |
---|
| 1752 | } |
---|
| 1753 | |
---|
| 1754 | #if SVC_EXTENSION |
---|
| 1755 | xConfirmPara( m_numLayers > MAX_LAYERS , "Number of layers in config file is greater than MAX_LAYERS" ); |
---|
| 1756 | m_numLayers = m_numLayers > MAX_LAYERS ? MAX_LAYERS : m_numLayers; |
---|
| 1757 | |
---|
| 1758 | // verify layer configuration parameters |
---|
| 1759 | for(UInt layer=0; layer<m_numLayers; layer++) |
---|
| 1760 | { |
---|
[442] | 1761 | if(m_acLayerCfg[layer].xCheckParameter(m_isField)) |
---|
[313] | 1762 | { |
---|
| 1763 | printf("\nError: invalid configuration parameter found in layer %d \n", layer); |
---|
| 1764 | check_failed = true; |
---|
| 1765 | } |
---|
| 1766 | } |
---|
| 1767 | |
---|
| 1768 | // verify layer configuration parameters |
---|
| 1769 | for(UInt layer=0; layer<m_numLayers; layer++) |
---|
| 1770 | { |
---|
| 1771 | Int m_iIntraPeriod = m_acLayerCfg[layer].m_iIntraPeriod; |
---|
| 1772 | #endif |
---|
| 1773 | if ( (m_iIntraPeriod != 1) && !m_loopFilterOffsetInPPS && m_DeblockingFilterControlPresent && (!m_bLoopFilterDisable) ) |
---|
| 1774 | { |
---|
| 1775 | for(Int i=0; i<m_iGOPSize; i++) |
---|
| 1776 | { |
---|
| 1777 | 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)" ); |
---|
| 1778 | 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)" ); |
---|
| 1779 | } |
---|
| 1780 | } |
---|
| 1781 | #if SVC_EXTENSION |
---|
| 1782 | } |
---|
| 1783 | #endif |
---|
[471] | 1784 | |
---|
[313] | 1785 | m_extraRPSs=0; |
---|
| 1786 | //start looping through frames in coding order until we can verify that the GOP structure is correct. |
---|
| 1787 | while(!verifiedGOP&&!errorGOP) |
---|
| 1788 | { |
---|
| 1789 | Int curGOP = (checkGOP-1)%m_iGOPSize; |
---|
| 1790 | Int curPOC = ((checkGOP-1)/m_iGOPSize)*m_iGOPSize + m_GOPList[curGOP].m_POC; |
---|
| 1791 | if(m_GOPList[curGOP].m_POC<0) |
---|
| 1792 | { |
---|
| 1793 | printf("\nError: found fewer Reference Picture Sets than GOPSize\n"); |
---|
| 1794 | errorGOP=true; |
---|
| 1795 | } |
---|
| 1796 | else |
---|
| 1797 | { |
---|
| 1798 | //check that all reference pictures are available, or have a POC < 0 meaning they might be available in the next GOP. |
---|
| 1799 | Bool beforeI = false; |
---|
| 1800 | for(Int i = 0; i< m_GOPList[curGOP].m_numRefPics; i++) |
---|
| 1801 | { |
---|
| 1802 | Int absPOC = curPOC+m_GOPList[curGOP].m_referencePics[i]; |
---|
| 1803 | if(absPOC < 0) |
---|
| 1804 | { |
---|
| 1805 | beforeI=true; |
---|
| 1806 | } |
---|
| 1807 | else |
---|
| 1808 | { |
---|
| 1809 | Bool found=false; |
---|
| 1810 | for(Int j=0; j<numRefs; j++) |
---|
| 1811 | { |
---|
| 1812 | if(refList[j]==absPOC) |
---|
| 1813 | { |
---|
| 1814 | found=true; |
---|
| 1815 | for(Int k=0; k<m_iGOPSize; k++) |
---|
| 1816 | { |
---|
| 1817 | if(absPOC%m_iGOPSize == m_GOPList[k].m_POC%m_iGOPSize) |
---|
| 1818 | { |
---|
| 1819 | if(m_GOPList[k].m_temporalId==m_GOPList[curGOP].m_temporalId) |
---|
| 1820 | { |
---|
| 1821 | m_GOPList[k].m_refPic = true; |
---|
| 1822 | } |
---|
| 1823 | m_GOPList[curGOP].m_usedByCurrPic[i]=m_GOPList[k].m_temporalId<=m_GOPList[curGOP].m_temporalId; |
---|
| 1824 | } |
---|
| 1825 | } |
---|
| 1826 | } |
---|
| 1827 | } |
---|
| 1828 | if(!found) |
---|
| 1829 | { |
---|
| 1830 | printf("\nError: ref pic %d is not available for GOP frame %d\n",m_GOPList[curGOP].m_referencePics[i],curGOP+1); |
---|
| 1831 | errorGOP=true; |
---|
| 1832 | } |
---|
| 1833 | } |
---|
| 1834 | } |
---|
| 1835 | if(!beforeI&&!errorGOP) |
---|
| 1836 | { |
---|
| 1837 | //all ref frames were present |
---|
| 1838 | if(!isOK[curGOP]) |
---|
| 1839 | { |
---|
| 1840 | numOK++; |
---|
| 1841 | isOK[curGOP]=true; |
---|
| 1842 | if(numOK==m_iGOPSize) |
---|
| 1843 | { |
---|
| 1844 | verifiedGOP=true; |
---|
| 1845 | } |
---|
| 1846 | } |
---|
| 1847 | } |
---|
| 1848 | else |
---|
| 1849 | { |
---|
| 1850 | //create a new GOPEntry for this frame containing all the reference pictures that were available (POC > 0) |
---|
| 1851 | m_GOPList[m_iGOPSize+m_extraRPSs]=m_GOPList[curGOP]; |
---|
| 1852 | Int newRefs=0; |
---|
| 1853 | for(Int i = 0; i< m_GOPList[curGOP].m_numRefPics; i++) |
---|
| 1854 | { |
---|
| 1855 | Int absPOC = curPOC+m_GOPList[curGOP].m_referencePics[i]; |
---|
| 1856 | if(absPOC>=0) |
---|
| 1857 | { |
---|
| 1858 | m_GOPList[m_iGOPSize+m_extraRPSs].m_referencePics[newRefs]=m_GOPList[curGOP].m_referencePics[i]; |
---|
| 1859 | m_GOPList[m_iGOPSize+m_extraRPSs].m_usedByCurrPic[newRefs]=m_GOPList[curGOP].m_usedByCurrPic[i]; |
---|
| 1860 | newRefs++; |
---|
| 1861 | } |
---|
| 1862 | } |
---|
| 1863 | Int numPrefRefs = m_GOPList[curGOP].m_numRefPicsActive; |
---|
| 1864 | |
---|
| 1865 | for(Int offset = -1; offset>-checkGOP; offset--) |
---|
| 1866 | { |
---|
| 1867 | //step backwards in coding order and include any extra available pictures we might find useful to replace the ones with POC < 0. |
---|
| 1868 | Int offGOP = (checkGOP-1+offset)%m_iGOPSize; |
---|
| 1869 | Int offPOC = ((checkGOP-1+offset)/m_iGOPSize)*m_iGOPSize + m_GOPList[offGOP].m_POC; |
---|
| 1870 | if(offPOC>=0&&m_GOPList[offGOP].m_temporalId<=m_GOPList[curGOP].m_temporalId) |
---|
| 1871 | { |
---|
| 1872 | Bool newRef=false; |
---|
| 1873 | for(Int i=0; i<numRefs; i++) |
---|
| 1874 | { |
---|
| 1875 | if(refList[i]==offPOC) |
---|
| 1876 | { |
---|
| 1877 | newRef=true; |
---|
| 1878 | } |
---|
| 1879 | } |
---|
| 1880 | for(Int i=0; i<newRefs; i++) |
---|
| 1881 | { |
---|
| 1882 | if(m_GOPList[m_iGOPSize+m_extraRPSs].m_referencePics[i]==offPOC-curPOC) |
---|
| 1883 | { |
---|
| 1884 | newRef=false; |
---|
| 1885 | } |
---|
| 1886 | } |
---|
| 1887 | if(newRef) |
---|
| 1888 | { |
---|
| 1889 | Int insertPoint=newRefs; |
---|
| 1890 | //this picture can be added, find appropriate place in list and insert it. |
---|
| 1891 | if(m_GOPList[offGOP].m_temporalId==m_GOPList[curGOP].m_temporalId) |
---|
| 1892 | { |
---|
| 1893 | m_GOPList[offGOP].m_refPic = true; |
---|
| 1894 | } |
---|
| 1895 | for(Int j=0; j<newRefs; j++) |
---|
| 1896 | { |
---|
| 1897 | if(m_GOPList[m_iGOPSize+m_extraRPSs].m_referencePics[j]<offPOC-curPOC||m_GOPList[m_iGOPSize+m_extraRPSs].m_referencePics[j]>0) |
---|
| 1898 | { |
---|
| 1899 | insertPoint = j; |
---|
| 1900 | break; |
---|
| 1901 | } |
---|
| 1902 | } |
---|
| 1903 | Int prev = offPOC-curPOC; |
---|
| 1904 | Int prevUsed = m_GOPList[offGOP].m_temporalId<=m_GOPList[curGOP].m_temporalId; |
---|
| 1905 | for(Int j=insertPoint; j<newRefs+1; j++) |
---|
| 1906 | { |
---|
| 1907 | Int newPrev = m_GOPList[m_iGOPSize+m_extraRPSs].m_referencePics[j]; |
---|
| 1908 | Int newUsed = m_GOPList[m_iGOPSize+m_extraRPSs].m_usedByCurrPic[j]; |
---|
| 1909 | m_GOPList[m_iGOPSize+m_extraRPSs].m_referencePics[j]=prev; |
---|
| 1910 | m_GOPList[m_iGOPSize+m_extraRPSs].m_usedByCurrPic[j]=prevUsed; |
---|
| 1911 | prevUsed=newUsed; |
---|
| 1912 | prev=newPrev; |
---|
| 1913 | } |
---|
| 1914 | newRefs++; |
---|
| 1915 | } |
---|
| 1916 | } |
---|
| 1917 | if(newRefs>=numPrefRefs) |
---|
| 1918 | { |
---|
| 1919 | break; |
---|
| 1920 | } |
---|
| 1921 | } |
---|
| 1922 | m_GOPList[m_iGOPSize+m_extraRPSs].m_numRefPics=newRefs; |
---|
| 1923 | m_GOPList[m_iGOPSize+m_extraRPSs].m_POC = curPOC; |
---|
| 1924 | if (m_extraRPSs == 0) |
---|
| 1925 | { |
---|
| 1926 | m_GOPList[m_iGOPSize+m_extraRPSs].m_interRPSPrediction = 0; |
---|
| 1927 | m_GOPList[m_iGOPSize+m_extraRPSs].m_numRefIdc = 0; |
---|
| 1928 | } |
---|
| 1929 | else |
---|
| 1930 | { |
---|
| 1931 | Int rIdx = m_iGOPSize + m_extraRPSs - 1; |
---|
| 1932 | Int refPOC = m_GOPList[rIdx].m_POC; |
---|
| 1933 | Int refPics = m_GOPList[rIdx].m_numRefPics; |
---|
| 1934 | Int newIdc=0; |
---|
| 1935 | for(Int i = 0; i<= refPics; i++) |
---|
| 1936 | { |
---|
| 1937 | Int deltaPOC = ((i != refPics)? m_GOPList[rIdx].m_referencePics[i] : 0); // check if the reference abs POC is >= 0 |
---|
| 1938 | Int absPOCref = refPOC+deltaPOC; |
---|
| 1939 | Int refIdc = 0; |
---|
| 1940 | for (Int j = 0; j < m_GOPList[m_iGOPSize+m_extraRPSs].m_numRefPics; j++) |
---|
| 1941 | { |
---|
| 1942 | if ( (absPOCref - curPOC) == m_GOPList[m_iGOPSize+m_extraRPSs].m_referencePics[j]) |
---|
| 1943 | { |
---|
| 1944 | if (m_GOPList[m_iGOPSize+m_extraRPSs].m_usedByCurrPic[j]) |
---|
| 1945 | { |
---|
| 1946 | refIdc = 1; |
---|
| 1947 | } |
---|
| 1948 | else |
---|
| 1949 | { |
---|
| 1950 | refIdc = 2; |
---|
| 1951 | } |
---|
| 1952 | } |
---|
| 1953 | } |
---|
| 1954 | m_GOPList[m_iGOPSize+m_extraRPSs].m_refIdc[newIdc]=refIdc; |
---|
| 1955 | newIdc++; |
---|
| 1956 | } |
---|
| 1957 | m_GOPList[m_iGOPSize+m_extraRPSs].m_interRPSPrediction = 1; |
---|
| 1958 | m_GOPList[m_iGOPSize+m_extraRPSs].m_numRefIdc = newIdc; |
---|
| 1959 | m_GOPList[m_iGOPSize+m_extraRPSs].m_deltaRPS = refPOC - m_GOPList[m_iGOPSize+m_extraRPSs].m_POC; |
---|
| 1960 | } |
---|
| 1961 | curGOP=m_iGOPSize+m_extraRPSs; |
---|
| 1962 | m_extraRPSs++; |
---|
| 1963 | } |
---|
| 1964 | numRefs=0; |
---|
| 1965 | for(Int i = 0; i< m_GOPList[curGOP].m_numRefPics; i++) |
---|
| 1966 | { |
---|
| 1967 | Int absPOC = curPOC+m_GOPList[curGOP].m_referencePics[i]; |
---|
| 1968 | if(absPOC >= 0) |
---|
| 1969 | { |
---|
| 1970 | refList[numRefs]=absPOC; |
---|
| 1971 | numRefs++; |
---|
| 1972 | } |
---|
| 1973 | } |
---|
| 1974 | refList[numRefs]=curPOC; |
---|
| 1975 | numRefs++; |
---|
| 1976 | } |
---|
| 1977 | checkGOP++; |
---|
| 1978 | } |
---|
| 1979 | xConfirmPara(errorGOP,"Invalid GOP structure given"); |
---|
[471] | 1980 | |
---|
[313] | 1981 | m_maxTempLayer = 1; |
---|
| 1982 | for(Int i=0; i<m_iGOPSize; i++) |
---|
| 1983 | { |
---|
| 1984 | if(m_GOPList[i].m_temporalId >= m_maxTempLayer) |
---|
| 1985 | { |
---|
| 1986 | m_maxTempLayer = m_GOPList[i].m_temporalId+1; |
---|
| 1987 | } |
---|
| 1988 | xConfirmPara(m_GOPList[i].m_sliceType!='B'&&m_GOPList[i].m_sliceType!='P', "Slice type must be equal to B or P"); |
---|
| 1989 | } |
---|
| 1990 | for(Int i=0; i<MAX_TLAYER; i++) |
---|
| 1991 | { |
---|
| 1992 | m_numReorderPics[i] = 0; |
---|
| 1993 | m_maxDecPicBuffering[i] = 1; |
---|
| 1994 | } |
---|
| 1995 | for(Int i=0; i<m_iGOPSize; i++) |
---|
| 1996 | { |
---|
| 1997 | if(m_GOPList[i].m_numRefPics+1 > m_maxDecPicBuffering[m_GOPList[i].m_temporalId]) |
---|
| 1998 | { |
---|
| 1999 | m_maxDecPicBuffering[m_GOPList[i].m_temporalId] = m_GOPList[i].m_numRefPics + 1; |
---|
| 2000 | } |
---|
| 2001 | |
---|
| 2002 | Int highestDecodingNumberWithLowerPOC = 0; |
---|
| 2003 | for(Int j=0; j<m_iGOPSize; j++) |
---|
| 2004 | { |
---|
| 2005 | if(m_GOPList[j].m_POC <= m_GOPList[i].m_POC) |
---|
| 2006 | { |
---|
| 2007 | highestDecodingNumberWithLowerPOC = j; |
---|
| 2008 | } |
---|
| 2009 | } |
---|
| 2010 | Int numReorder = 0; |
---|
| 2011 | for(Int j=0; j<highestDecodingNumberWithLowerPOC; j++) |
---|
| 2012 | { |
---|
| 2013 | if(m_GOPList[j].m_temporalId <= m_GOPList[i].m_temporalId && |
---|
| 2014 | m_GOPList[j].m_POC > m_GOPList[i].m_POC) |
---|
| 2015 | { |
---|
| 2016 | numReorder++; |
---|
| 2017 | } |
---|
| 2018 | } |
---|
| 2019 | if(numReorder > m_numReorderPics[m_GOPList[i].m_temporalId]) |
---|
| 2020 | { |
---|
| 2021 | m_numReorderPics[m_GOPList[i].m_temporalId] = numReorder; |
---|
| 2022 | } |
---|
| 2023 | } |
---|
| 2024 | for(Int i=0; i<MAX_TLAYER-1; i++) |
---|
| 2025 | { |
---|
| 2026 | // a lower layer can not have higher value of m_numReorderPics than a higher layer |
---|
| 2027 | if(m_numReorderPics[i+1] < m_numReorderPics[i]) |
---|
| 2028 | { |
---|
| 2029 | m_numReorderPics[i+1] = m_numReorderPics[i]; |
---|
| 2030 | } |
---|
| 2031 | // the value of num_reorder_pics[ i ] shall be in the range of 0 to max_dec_pic_buffering[ i ] - 1, inclusive |
---|
| 2032 | if(m_numReorderPics[i] > m_maxDecPicBuffering[i] - 1) |
---|
| 2033 | { |
---|
| 2034 | m_maxDecPicBuffering[i] = m_numReorderPics[i] + 1; |
---|
| 2035 | } |
---|
| 2036 | // a lower layer can not have higher value of m_uiMaxDecPicBuffering than a higher layer |
---|
| 2037 | if(m_maxDecPicBuffering[i+1] < m_maxDecPicBuffering[i]) |
---|
| 2038 | { |
---|
| 2039 | m_maxDecPicBuffering[i+1] = m_maxDecPicBuffering[i]; |
---|
| 2040 | } |
---|
| 2041 | } |
---|
| 2042 | |
---|
| 2043 | |
---|
| 2044 | // the value of num_reorder_pics[ i ] shall be in the range of 0 to max_dec_pic_buffering[ i ] - 1, inclusive |
---|
| 2045 | if(m_numReorderPics[MAX_TLAYER-1] > m_maxDecPicBuffering[MAX_TLAYER-1] - 1) |
---|
| 2046 | { |
---|
| 2047 | m_maxDecPicBuffering[MAX_TLAYER-1] = m_numReorderPics[MAX_TLAYER-1] + 1; |
---|
| 2048 | } |
---|
| 2049 | |
---|
| 2050 | #if SVC_EXTENSION // ToDo: it should be checked for the case when parameters are different for the layers |
---|
| 2051 | for(UInt layer = 0; layer < MAX_LAYERS; layer++) |
---|
| 2052 | { |
---|
| 2053 | Int m_iSourceWidth = m_acLayerCfg[layer].m_iSourceWidth; |
---|
| 2054 | Int m_iSourceHeight = m_acLayerCfg[layer].m_iSourceHeight; |
---|
[467] | 2055 | #if LAYER_CTB |
---|
| 2056 | Int m_uiMaxCUWidth = m_acLayerCfg[layer].m_uiMaxCUWidth; |
---|
| 2057 | Int m_uiMaxCUHeight = m_acLayerCfg[layer].m_uiMaxCUHeight; |
---|
[313] | 2058 | #endif |
---|
[467] | 2059 | #endif |
---|
[313] | 2060 | if(m_vuiParametersPresentFlag && m_bitstreamRestrictionFlag) |
---|
| 2061 | { |
---|
| 2062 | Int PicSizeInSamplesY = m_iSourceWidth * m_iSourceHeight; |
---|
| 2063 | if(tileFlag) |
---|
| 2064 | { |
---|
| 2065 | Int maxTileWidth = 0; |
---|
| 2066 | Int maxTileHeight = 0; |
---|
| 2067 | Int widthInCU = (m_iSourceWidth % m_uiMaxCUWidth) ? m_iSourceWidth/m_uiMaxCUWidth + 1: m_iSourceWidth/m_uiMaxCUWidth; |
---|
| 2068 | Int heightInCU = (m_iSourceHeight % m_uiMaxCUHeight) ? m_iSourceHeight/m_uiMaxCUHeight + 1: m_iSourceHeight/m_uiMaxCUHeight; |
---|
| 2069 | if(m_iUniformSpacingIdr) |
---|
| 2070 | { |
---|
| 2071 | maxTileWidth = m_uiMaxCUWidth*((widthInCU+m_iNumColumnsMinus1)/(m_iNumColumnsMinus1+1)); |
---|
| 2072 | maxTileHeight = m_uiMaxCUHeight*((heightInCU+m_iNumRowsMinus1)/(m_iNumRowsMinus1+1)); |
---|
| 2073 | // if only the last tile-row is one treeblock higher than the others |
---|
| 2074 | // the maxTileHeight becomes smaller if the last row of treeblocks has lower height than the others |
---|
| 2075 | if(!((heightInCU-1)%(m_iNumRowsMinus1+1))) |
---|
| 2076 | { |
---|
| 2077 | maxTileHeight = maxTileHeight - m_uiMaxCUHeight + (m_iSourceHeight % m_uiMaxCUHeight); |
---|
| 2078 | } |
---|
| 2079 | // if only the last tile-column is one treeblock wider than the others |
---|
| 2080 | // the maxTileWidth becomes smaller if the last column of treeblocks has lower width than the others |
---|
| 2081 | if(!((widthInCU-1)%(m_iNumColumnsMinus1+1))) |
---|
| 2082 | { |
---|
| 2083 | maxTileWidth = maxTileWidth - m_uiMaxCUWidth + (m_iSourceWidth % m_uiMaxCUWidth); |
---|
| 2084 | } |
---|
| 2085 | } |
---|
| 2086 | else // not uniform spacing |
---|
| 2087 | { |
---|
| 2088 | if(m_iNumColumnsMinus1<1) |
---|
| 2089 | { |
---|
| 2090 | maxTileWidth = m_iSourceWidth; |
---|
| 2091 | } |
---|
| 2092 | else |
---|
| 2093 | { |
---|
| 2094 | Int accColumnWidth = 0; |
---|
| 2095 | for(Int col=0; col<(m_iNumColumnsMinus1); col++) |
---|
| 2096 | { |
---|
| 2097 | maxTileWidth = m_pColumnWidth[col]>maxTileWidth ? m_pColumnWidth[col]:maxTileWidth; |
---|
| 2098 | accColumnWidth += m_pColumnWidth[col]; |
---|
| 2099 | } |
---|
| 2100 | maxTileWidth = (widthInCU-accColumnWidth)>maxTileWidth ? m_uiMaxCUWidth*(widthInCU-accColumnWidth):m_uiMaxCUWidth*maxTileWidth; |
---|
| 2101 | } |
---|
| 2102 | if(m_iNumRowsMinus1<1) |
---|
| 2103 | { |
---|
| 2104 | maxTileHeight = m_iSourceHeight; |
---|
| 2105 | } |
---|
| 2106 | else |
---|
| 2107 | { |
---|
| 2108 | Int accRowHeight = 0; |
---|
| 2109 | for(Int row=0; row<(m_iNumRowsMinus1); row++) |
---|
| 2110 | { |
---|
| 2111 | maxTileHeight = m_pRowHeight[row]>maxTileHeight ? m_pRowHeight[row]:maxTileHeight; |
---|
| 2112 | accRowHeight += m_pRowHeight[row]; |
---|
| 2113 | } |
---|
| 2114 | maxTileHeight = (heightInCU-accRowHeight)>maxTileHeight ? m_uiMaxCUHeight*(heightInCU-accRowHeight):m_uiMaxCUHeight*maxTileHeight; |
---|
| 2115 | } |
---|
| 2116 | } |
---|
| 2117 | Int maxSizeInSamplesY = maxTileWidth*maxTileHeight; |
---|
| 2118 | m_minSpatialSegmentationIdc = 4*PicSizeInSamplesY/maxSizeInSamplesY-4; |
---|
| 2119 | } |
---|
| 2120 | else if(m_iWaveFrontSynchro) |
---|
| 2121 | { |
---|
| 2122 | m_minSpatialSegmentationIdc = 4*PicSizeInSamplesY/((2*m_iSourceHeight+m_iSourceWidth)*m_uiMaxCUHeight)-4; |
---|
| 2123 | } |
---|
| 2124 | else if(m_sliceMode == 1) |
---|
| 2125 | { |
---|
| 2126 | m_minSpatialSegmentationIdc = 4*PicSizeInSamplesY/(m_sliceArgument*m_uiMaxCUWidth*m_uiMaxCUHeight)-4; |
---|
| 2127 | } |
---|
| 2128 | else |
---|
| 2129 | { |
---|
| 2130 | m_minSpatialSegmentationIdc = 0; |
---|
| 2131 | } |
---|
| 2132 | } |
---|
| 2133 | #if SVC_EXTENSION |
---|
| 2134 | } |
---|
| 2135 | #endif |
---|
| 2136 | xConfirmPara( m_iWaveFrontSynchro < 0, "WaveFrontSynchro cannot be negative" ); |
---|
| 2137 | #if !SVC_EXTENSION |
---|
| 2138 | xConfirmPara( m_iWaveFrontSubstreams <= 0, "WaveFrontSubstreams must be positive" ); |
---|
| 2139 | xConfirmPara( m_iWaveFrontSubstreams > 1 && !m_iWaveFrontSynchro, "Must have WaveFrontSynchro > 0 in order to have WaveFrontSubstreams > 1" ); |
---|
| 2140 | #endif |
---|
| 2141 | |
---|
| 2142 | xConfirmPara( m_decodedPictureHashSEIEnabled<0 || m_decodedPictureHashSEIEnabled>3, "this hash type is not correct!\n"); |
---|
| 2143 | |
---|
| 2144 | if (m_toneMappingInfoSEIEnabled) |
---|
| 2145 | { |
---|
| 2146 | xConfirmPara( m_toneMapCodedDataBitDepth < 8 || m_toneMapCodedDataBitDepth > 14 , "SEIToneMapCodedDataBitDepth must be in rage 8 to 14"); |
---|
| 2147 | xConfirmPara( m_toneMapTargetBitDepth < 1 || (m_toneMapTargetBitDepth > 16 && m_toneMapTargetBitDepth < 255) , "SEIToneMapTargetBitDepth must be in rage 1 to 16 or equal to 255"); |
---|
| 2148 | xConfirmPara( m_toneMapModelId < 0 || m_toneMapModelId > 4 , "SEIToneMapModelId must be in rage 0 to 4"); |
---|
| 2149 | xConfirmPara( m_cameraIsoSpeedValue == 0, "SEIToneMapCameraIsoSpeedValue shall not be equal to 0"); |
---|
| 2150 | xConfirmPara( m_extendedRangeWhiteLevel < 100, "SEIToneMapExtendedRangeWhiteLevel should be greater than or equal to 100"); |
---|
| 2151 | xConfirmPara( m_nominalBlackLevelLumaCodeValue >= m_nominalWhiteLevelLumaCodeValue, "SEIToneMapNominalWhiteLevelLumaCodeValue shall be greater than SEIToneMapNominalBlackLevelLumaCodeValue"); |
---|
| 2152 | xConfirmPara( m_extendedWhiteLevelLumaCodeValue < m_nominalWhiteLevelLumaCodeValue, "SEIToneMapExtendedWhiteLevelLumaCodeValue shall be greater than or equal to SEIToneMapNominalWhiteLevelLumaCodeValue"); |
---|
| 2153 | } |
---|
| 2154 | |
---|
| 2155 | #if RATE_CONTROL_LAMBDA_DOMAIN |
---|
| 2156 | #if RC_SHVC_HARMONIZATION |
---|
| 2157 | for ( Int layer=0; layer<m_numLayers; layer++ ) |
---|
| 2158 | { |
---|
| 2159 | if ( m_acLayerCfg[layer].m_RCEnableRateControl ) |
---|
| 2160 | { |
---|
| 2161 | if ( m_acLayerCfg[layer].m_RCForceIntraQP ) |
---|
| 2162 | { |
---|
| 2163 | if ( m_acLayerCfg[layer].m_RCInitialQP == 0 ) |
---|
| 2164 | { |
---|
| 2165 | printf( "\nInitial QP for rate control is not specified. Reset not to use force intra QP!" ); |
---|
| 2166 | m_acLayerCfg[layer].m_RCForceIntraQP = false; |
---|
| 2167 | } |
---|
| 2168 | } |
---|
| 2169 | } |
---|
| 2170 | xConfirmPara( m_uiDeltaQpRD > 0, "Rate control cannot be used together with slice level multiple-QP optimization!\n" ); |
---|
| 2171 | } |
---|
| 2172 | #else |
---|
| 2173 | if ( m_RCEnableRateControl ) |
---|
| 2174 | { |
---|
| 2175 | if ( m_RCForceIntraQP ) |
---|
| 2176 | { |
---|
| 2177 | if ( m_RCInitialQP == 0 ) |
---|
| 2178 | { |
---|
| 2179 | printf( "\nInitial QP for rate control is not specified. Reset not to use force intra QP!" ); |
---|
| 2180 | m_RCForceIntraQP = false; |
---|
| 2181 | } |
---|
| 2182 | } |
---|
| 2183 | xConfirmPara( m_uiDeltaQpRD > 0, "Rate control cannot be used together with slice level multiple-QP optimization!\n" ); |
---|
| 2184 | } |
---|
| 2185 | #endif |
---|
| 2186 | #else |
---|
| 2187 | if(m_enableRateCtrl) |
---|
| 2188 | { |
---|
| 2189 | Int numLCUInWidth = (m_iSourceWidth / m_uiMaxCUWidth) + (( m_iSourceWidth % m_uiMaxCUWidth ) ? 1 : 0); |
---|
| 2190 | Int numLCUInHeight = (m_iSourceHeight / m_uiMaxCUHeight)+ (( m_iSourceHeight % m_uiMaxCUHeight) ? 1 : 0); |
---|
| 2191 | Int numLCUInPic = numLCUInWidth * numLCUInHeight; |
---|
| 2192 | |
---|
| 2193 | xConfirmPara( (numLCUInPic % m_numLCUInUnit) != 0, "total number of LCUs in a frame should be completely divided by NumLCUInUnit" ); |
---|
| 2194 | |
---|
| 2195 | m_iMaxDeltaQP = MAX_DELTA_QP; |
---|
| 2196 | m_iMaxCuDQPDepth = MAX_CUDQP_DEPTH; |
---|
| 2197 | } |
---|
| 2198 | #endif |
---|
| 2199 | |
---|
| 2200 | xConfirmPara(!m_TransquantBypassEnableFlag && m_CUTransquantBypassFlagValue, "CUTransquantBypassFlagValue cannot be 1 when TransquantBypassEnableFlag is 0"); |
---|
| 2201 | |
---|
| 2202 | xConfirmPara(m_log2ParallelMergeLevel < 2, "Log2ParallelMergeLevel should be larger than or equal to 2"); |
---|
| 2203 | if (m_framePackingSEIEnabled) |
---|
| 2204 | { |
---|
| 2205 | xConfirmPara(m_framePackingSEIType < 3 || m_framePackingSEIType > 5 , "SEIFramePackingType must be in rage 3 to 5"); |
---|
| 2206 | } |
---|
| 2207 | #if VPS_EXTN_DIRECT_REF_LAYERS |
---|
| 2208 | #if M0457_PREDICTION_INDICATIONS |
---|
| 2209 | xConfirmPara( (m_acLayerCfg[0].m_numSamplePredRefLayers != 0) && (m_acLayerCfg[0].m_numSamplePredRefLayers != -1), "Layer 0 cannot have any reference layers" ); |
---|
| 2210 | // NOTE: m_numSamplePredRefLayers (for any layer) could be -1 (not signalled in cfg), in which case only the "previous layer" would be taken for reference |
---|
| 2211 | for(Int layer = 1; layer < MAX_LAYERS; layer++) |
---|
| 2212 | { |
---|
| 2213 | xConfirmPara(m_acLayerCfg[layer].m_numSamplePredRefLayers > layer, "Cannot reference more layers than before current layer"); |
---|
| 2214 | for(Int i = 0; i < m_acLayerCfg[layer].m_numSamplePredRefLayers; i++) |
---|
| 2215 | { |
---|
| 2216 | xConfirmPara(m_acLayerCfg[layer].m_samplePredRefLayerIds[i] > layer, "Cannot reference higher layers"); |
---|
| 2217 | xConfirmPara(m_acLayerCfg[layer].m_samplePredRefLayerIds[i] == layer, "Cannot reference the current layer itself"); |
---|
| 2218 | } |
---|
| 2219 | } |
---|
| 2220 | xConfirmPara( (m_acLayerCfg[0].m_numMotionPredRefLayers != 0) && (m_acLayerCfg[0].m_numMotionPredRefLayers != -1), "Layer 0 cannot have any reference layers" ); |
---|
| 2221 | // NOTE: m_numMotionPredRefLayers (for any layer) could be -1 (not signalled in cfg), in which case only the "previous layer" would be taken for reference |
---|
| 2222 | for(Int layer = 1; layer < MAX_LAYERS; layer++) |
---|
| 2223 | { |
---|
| 2224 | xConfirmPara(m_acLayerCfg[layer].m_numMotionPredRefLayers > layer, "Cannot reference more layers than before current layer"); |
---|
| 2225 | for(Int i = 0; i < m_acLayerCfg[layer].m_numMotionPredRefLayers; i++) |
---|
| 2226 | { |
---|
| 2227 | xConfirmPara(m_acLayerCfg[layer].m_motionPredRefLayerIds[i] > layer, "Cannot reference higher layers"); |
---|
| 2228 | xConfirmPara(m_acLayerCfg[layer].m_motionPredRefLayerIds[i] == layer, "Cannot reference the current layer itself"); |
---|
| 2229 | } |
---|
| 2230 | } |
---|
| 2231 | #else |
---|
| 2232 | xConfirmPara( (m_acLayerCfg[0].m_numDirectRefLayers != 0) && (m_acLayerCfg[0].m_numDirectRefLayers != -1), "Layer 0 cannot have any reference layers" ); |
---|
| 2233 | // NOTE: m_numDirectRefLayers (for any layer) could be -1 (not signalled in cfg), in which case only the "previous layer" would be taken for reference |
---|
| 2234 | for(Int layer = 1; layer < MAX_LAYERS; layer++) |
---|
| 2235 | { |
---|
| 2236 | xConfirmPara(m_acLayerCfg[layer].m_numDirectRefLayers > layer, "Cannot reference more layers than before current layer"); |
---|
| 2237 | for(Int i = 0; i < m_acLayerCfg[layer].m_numDirectRefLayers; i++) |
---|
| 2238 | { |
---|
| 2239 | xConfirmPara(m_acLayerCfg[layer].m_refLayerIds[i] > layer, "Cannot reference higher layers"); |
---|
| 2240 | xConfirmPara(m_acLayerCfg[layer].m_refLayerIds[i] == layer, "Cannot reference the current layer itself"); |
---|
| 2241 | } |
---|
| 2242 | } |
---|
| 2243 | #endif |
---|
| 2244 | xConfirmPara( (m_acLayerCfg[0].m_numActiveRefLayers != 0) && (m_acLayerCfg[0].m_numActiveRefLayers != -1), "Layer 0 cannot have any active reference layers" ); |
---|
| 2245 | // NOTE: m_numActiveRefLayers (for any layer) could be -1 (not signalled in cfg), in which case only the "previous layer" would be taken for reference |
---|
| 2246 | for(Int layer = 1; layer < MAX_LAYERS; layer++) |
---|
| 2247 | { |
---|
| 2248 | #if M0457_PREDICTION_INDICATIONS |
---|
| 2249 | Bool predEnabledFlag[MAX_LAYERS]; |
---|
| 2250 | for (Int refLayer = 0; refLayer < layer; refLayer++) |
---|
| 2251 | { |
---|
| 2252 | predEnabledFlag[refLayer] = false; |
---|
| 2253 | } |
---|
| 2254 | for(Int i = 0; i < m_acLayerCfg[layer].m_numSamplePredRefLayers; i++) |
---|
| 2255 | { |
---|
| 2256 | predEnabledFlag[m_acLayerCfg[layer].m_samplePredRefLayerIds[i]] = true; |
---|
| 2257 | } |
---|
| 2258 | for(Int i = 0; i < m_acLayerCfg[layer].m_numMotionPredRefLayers; i++) |
---|
| 2259 | { |
---|
| 2260 | predEnabledFlag[m_acLayerCfg[layer].m_motionPredRefLayerIds[i]] = true; |
---|
| 2261 | } |
---|
| 2262 | Int numDirectRefLayers = 0; |
---|
| 2263 | for (Int refLayer = 0; refLayer < layer; refLayer++) |
---|
| 2264 | { |
---|
| 2265 | if (predEnabledFlag[refLayer] == true) numDirectRefLayers++; |
---|
| 2266 | } |
---|
| 2267 | xConfirmPara(m_acLayerCfg[layer].m_numActiveRefLayers > numDirectRefLayers, "Cannot reference more layers than NumDirectRefLayers"); |
---|
| 2268 | for(Int i = 0; i < m_acLayerCfg[layer].m_numActiveRefLayers; i++) |
---|
| 2269 | { |
---|
| 2270 | xConfirmPara(m_acLayerCfg[layer].m_predLayerIds[i] >= numDirectRefLayers, "Cannot reference higher layers"); |
---|
| 2271 | } |
---|
| 2272 | #else |
---|
| 2273 | xConfirmPara(m_acLayerCfg[layer].m_numActiveRefLayers > m_acLayerCfg[layer].m_numDirectRefLayers, "Cannot reference more layers than NumDirectRefLayers"); |
---|
| 2274 | for(Int i = 0; i < m_acLayerCfg[layer].m_numActiveRefLayers; i++) |
---|
| 2275 | { |
---|
| 2276 | xConfirmPara(m_acLayerCfg[layer].m_predLayerIds[i] >= m_acLayerCfg[layer].m_numDirectRefLayers, "Cannot reference higher layers"); |
---|
| 2277 | } |
---|
| 2278 | #endif |
---|
| 2279 | } |
---|
| 2280 | #endif |
---|
| 2281 | #if M0040_ADAPTIVE_RESOLUTION_CHANGE |
---|
| 2282 | if (m_adaptiveResolutionChange > 0) |
---|
| 2283 | { |
---|
| 2284 | xConfirmPara(m_numLayers != 2, "Adaptive resolution change works with 2 layers only"); |
---|
| 2285 | xConfirmPara(m_acLayerCfg[1].m_iIntraPeriod == 0 || (m_adaptiveResolutionChange % m_acLayerCfg[1].m_iIntraPeriod) != 0, "Adaptive resolution change must happen at enhancement layer RAP picture"); |
---|
| 2286 | } |
---|
| 2287 | #endif |
---|
[442] | 2288 | #if N0120_MAX_TID_REF_CFG |
---|
| 2289 | for (UInt layer=0; layer < MAX_LAYERS-1; layer++) |
---|
| 2290 | { |
---|
| 2291 | xConfirmPara(m_acLayerCfg[layer].m_maxTidIlRefPicsPlus1 < 0 || m_acLayerCfg[layer].m_maxTidIlRefPicsPlus1 > 7, "MaxTidIlRefPicsPlus1 must be in range 0 to 7"); |
---|
| 2292 | } |
---|
| 2293 | #endif |
---|
[475] | 2294 | #if AUXILIARY_PICTURES |
---|
| 2295 | for (UInt layer=0; layer < MAX_LAYERS-1; layer++) |
---|
| 2296 | { |
---|
| 2297 | xConfirmPara(m_acLayerCfg[layer].m_auxId < 0 || m_acLayerCfg[layer].m_auxId > 4, "AuxId must be in range 0 to 4"); |
---|
| 2298 | xConfirmPara(m_acLayerCfg[layer].m_auxId > 0 && m_acLayerCfg[layer].m_chromaFormatIDC != CHROMA_400, "Auxiliary picture must be monochrome picture"); |
---|
| 2299 | } |
---|
| 2300 | #endif |
---|
[313] | 2301 | #undef xConfirmPara |
---|
| 2302 | if (check_failed) |
---|
| 2303 | { |
---|
| 2304 | exit(EXIT_FAILURE); |
---|
| 2305 | } |
---|
| 2306 | } |
---|
| 2307 | |
---|
| 2308 | /** \todo use of global variables should be removed later |
---|
| 2309 | */ |
---|
[467] | 2310 | #if LAYER_CTB |
---|
| 2311 | Void TAppEncCfg::xSetGlobal(UInt layerId) |
---|
| 2312 | { |
---|
| 2313 | // set max CU width & height |
---|
| 2314 | g_auiLayerMaxCUWidth[layerId] = m_acLayerCfg[layerId].m_uiMaxCUWidth; |
---|
| 2315 | g_auiLayerMaxCUHeight[layerId] = m_acLayerCfg[layerId].m_uiMaxCUHeight; |
---|
| 2316 | |
---|
| 2317 | // compute actual CU depth with respect to config depth and max transform size |
---|
| 2318 | g_auiLayerAddCUDepth[layerId] = 0; |
---|
| 2319 | while( (m_acLayerCfg[layerId].m_uiMaxCUWidth>>m_acLayerCfg[layerId].m_uiMaxCUDepth) > ( 1 << ( m_acLayerCfg[layerId].m_uiQuadtreeTULog2MinSize + g_auiLayerAddCUDepth[layerId] ) ) ) g_auiLayerAddCUDepth[layerId]++; |
---|
| 2320 | |
---|
| 2321 | m_acLayerCfg[layerId].m_uiMaxCUDepth += g_auiLayerAddCUDepth[layerId]; |
---|
| 2322 | g_auiLayerAddCUDepth[layerId]++; |
---|
| 2323 | g_auiLayerMaxCUDepth[layerId] = m_acLayerCfg[layerId].m_uiMaxCUDepth; |
---|
| 2324 | |
---|
| 2325 | #if O0194_DIFFERENT_BITDEPTH_EL_BL |
---|
| 2326 | // set internal bit-depth to constant value to make sure to be updated later |
---|
| 2327 | g_bitDepthY = -1; |
---|
| 2328 | g_bitDepthC = -1; |
---|
| 2329 | |
---|
| 2330 | g_uiPCMBitDepthLuma = -1; |
---|
| 2331 | g_uiPCMBitDepthChroma = -1; |
---|
| 2332 | #else |
---|
| 2333 | // set internal bit-depth and constants |
---|
| 2334 | g_bitDepthY = m_internalBitDepthY; |
---|
| 2335 | g_bitDepthC = m_internalBitDepthC; |
---|
| 2336 | |
---|
| 2337 | g_uiPCMBitDepthLuma = m_bPCMInputBitDepthFlag ? m_inputBitDepthY : m_internalBitDepthY; |
---|
| 2338 | g_uiPCMBitDepthChroma = m_bPCMInputBitDepthFlag ? m_inputBitDepthC : m_internalBitDepthC; |
---|
| 2339 | #endif |
---|
| 2340 | } |
---|
| 2341 | #else |
---|
[313] | 2342 | Void TAppEncCfg::xSetGlobal() |
---|
| 2343 | { |
---|
| 2344 | // set max CU width & height |
---|
| 2345 | g_uiMaxCUWidth = m_uiMaxCUWidth; |
---|
| 2346 | g_uiMaxCUHeight = m_uiMaxCUHeight; |
---|
| 2347 | |
---|
| 2348 | // compute actual CU depth with respect to config depth and max transform size |
---|
| 2349 | g_uiAddCUDepth = 0; |
---|
| 2350 | while( (m_uiMaxCUWidth>>m_uiMaxCUDepth) > ( 1 << ( m_uiQuadtreeTULog2MinSize + g_uiAddCUDepth ) ) ) g_uiAddCUDepth++; |
---|
| 2351 | |
---|
| 2352 | m_uiMaxCUDepth += g_uiAddCUDepth; |
---|
| 2353 | g_uiAddCUDepth++; |
---|
| 2354 | g_uiMaxCUDepth = m_uiMaxCUDepth; |
---|
| 2355 | |
---|
[466] | 2356 | #if O0194_DIFFERENT_BITDEPTH_EL_BL |
---|
| 2357 | // set internal bit-depth to constant value to make sure to be updated later |
---|
| 2358 | g_bitDepthY = -1; |
---|
| 2359 | g_bitDepthC = -1; |
---|
| 2360 | |
---|
| 2361 | g_uiPCMBitDepthLuma = -1; |
---|
| 2362 | g_uiPCMBitDepthChroma = -1; |
---|
| 2363 | #else |
---|
[313] | 2364 | g_bitDepthY = m_internalBitDepthY; |
---|
| 2365 | g_bitDepthC = m_internalBitDepthC; |
---|
| 2366 | |
---|
| 2367 | g_uiPCMBitDepthLuma = m_bPCMInputBitDepthFlag ? m_inputBitDepthY : m_internalBitDepthY; |
---|
| 2368 | g_uiPCMBitDepthChroma = m_bPCMInputBitDepthFlag ? m_inputBitDepthC : m_internalBitDepthC; |
---|
[466] | 2369 | #endif |
---|
[313] | 2370 | } |
---|
[467] | 2371 | #endif |
---|
[313] | 2372 | |
---|
| 2373 | Void TAppEncCfg::xPrintParameter() |
---|
| 2374 | { |
---|
| 2375 | printf("\n"); |
---|
| 2376 | #if SVC_EXTENSION |
---|
| 2377 | printf("Total number of layers : %d\n", m_numLayers ); |
---|
[442] | 2378 | #if SCALABILITY_MASK_E0104 |
---|
| 2379 | printf("Multiview : %d\n", m_scalabilityMask[1] ); |
---|
| 2380 | printf("Scalable : %d\n", m_scalabilityMask[2] ); |
---|
[475] | 2381 | #if AUXILIARY_PICTURES |
---|
| 2382 | printf("Auxiliary pictures : %d\n", m_scalabilityMask[3] ); |
---|
| 2383 | #endif |
---|
[442] | 2384 | #else |
---|
[313] | 2385 | printf("Multiview : %d\n", m_scalabilityMask[0] ); |
---|
| 2386 | printf("Scalable : %d\n", m_scalabilityMask[1] ); |
---|
[442] | 2387 | #endif |
---|
[313] | 2388 | #if M0040_ADAPTIVE_RESOLUTION_CHANGE |
---|
| 2389 | printf("Adaptive Resolution Change : %d\n", m_adaptiveResolutionChange ); |
---|
| 2390 | #endif |
---|
| 2391 | for(UInt layer=0; layer<m_numLayers; layer++) |
---|
| 2392 | { |
---|
| 2393 | printf("=== Layer %d settings === \n", layer); |
---|
| 2394 | #if AVC_SYNTAX |
---|
| 2395 | m_acLayerCfg[layer].xPrintParameter( layer ); |
---|
| 2396 | #else |
---|
| 2397 | m_acLayerCfg[layer].xPrintParameter(); |
---|
| 2398 | #endif |
---|
| 2399 | printf("\n"); |
---|
| 2400 | } |
---|
| 2401 | printf("=== Common configuration settings === \n"); |
---|
| 2402 | printf("Bitstream File : %s\n", m_pBitstreamFile ); |
---|
| 2403 | #else |
---|
| 2404 | printf("Input File : %s\n", m_pchInputFile ); |
---|
| 2405 | printf("Bitstream File : %s\n", m_pchBitstreamFile ); |
---|
| 2406 | printf("Reconstruction File : %s\n", m_pchReconFile ); |
---|
| 2407 | printf("Real Format : %dx%d %dHz\n", m_iSourceWidth - m_confLeft - m_confRight, m_iSourceHeight - m_confTop - m_confBottom, m_iFrameRate ); |
---|
| 2408 | printf("Internal Format : %dx%d %dHz\n", m_iSourceWidth, m_iSourceHeight, m_iFrameRate ); |
---|
| 2409 | #endif |
---|
[442] | 2410 | if (m_isField) |
---|
| 2411 | { |
---|
| 2412 | printf("Frame/Field : Field based coding\n"); |
---|
| 2413 | printf("Field index : %u - %d (%d fields)\n", m_FrameSkip, m_FrameSkip+m_framesToBeEncoded-1, m_framesToBeEncoded ); |
---|
| 2414 | if (m_isTopFieldFirst) |
---|
| 2415 | { |
---|
| 2416 | printf("Field Order : Top field first\n"); |
---|
| 2417 | } |
---|
| 2418 | else |
---|
| 2419 | { |
---|
| 2420 | printf("Field Order : Bottom field first\n"); |
---|
| 2421 | } |
---|
| 2422 | } |
---|
| 2423 | else |
---|
| 2424 | { |
---|
| 2425 | printf("Frame/Field : Frame based coding\n"); |
---|
| 2426 | printf("Frame index : %u - %d (%d frames)\n", m_FrameSkip, m_FrameSkip+m_framesToBeEncoded-1, m_framesToBeEncoded ); |
---|
| 2427 | } |
---|
[467] | 2428 | #if !LAYER_CTB |
---|
[313] | 2429 | printf("CU size / depth : %d / %d\n", m_uiMaxCUWidth, m_uiMaxCUDepth ); |
---|
| 2430 | printf("RQT trans. size (min / max) : %d / %d\n", 1 << m_uiQuadtreeTULog2MinSize, 1 << m_uiQuadtreeTULog2MaxSize ); |
---|
| 2431 | printf("Max RQT depth inter : %d\n", m_uiQuadtreeTUMaxDepthInter); |
---|
| 2432 | printf("Max RQT depth intra : %d\n", m_uiQuadtreeTUMaxDepthIntra); |
---|
[467] | 2433 | #endif |
---|
[313] | 2434 | printf("Min PCM size : %d\n", 1 << m_uiPCMLog2MinSize); |
---|
| 2435 | printf("Motion search range : %d\n", m_iSearchRange ); |
---|
| 2436 | #if !SVC_EXTENSION |
---|
| 2437 | printf("Intra period : %d\n", m_iIntraPeriod ); |
---|
| 2438 | #endif |
---|
| 2439 | printf("Decoding refresh type : %d\n", m_iDecodingRefreshType ); |
---|
| 2440 | #if !SVC_EXTENSION |
---|
| 2441 | printf("QP : %5.2f\n", m_fQP ); |
---|
| 2442 | #endif |
---|
| 2443 | printf("Max dQP signaling depth : %d\n", m_iMaxCuDQPDepth); |
---|
| 2444 | |
---|
| 2445 | printf("Cb QP Offset : %d\n", m_cbQpOffset ); |
---|
| 2446 | printf("Cr QP Offset : %d\n", m_crQpOffset); |
---|
| 2447 | |
---|
| 2448 | printf("QP adaptation : %d (range=%d)\n", m_bUseAdaptiveQP, (m_bUseAdaptiveQP ? m_iQPAdaptationRange : 0) ); |
---|
| 2449 | printf("GOP size : %d\n", m_iGOPSize ); |
---|
[486] | 2450 | #if !O0194_DIFFERENT_BITDEPTH_EL_BL |
---|
[313] | 2451 | printf("Internal bit depth : (Y:%d, C:%d)\n", m_internalBitDepthY, m_internalBitDepthC ); |
---|
[486] | 2452 | printf("PCM sample bit depth : (Y:%d, C:%d)\n", g_uiPCMBitDepthLuma, g_uiPCMBitDepthChroma ); |
---|
[466] | 2453 | #endif |
---|
[464] | 2454 | #if O0215_PHASE_ALIGNMENT |
---|
| 2455 | printf("cross-layer sample alignment : %d\n", m_phaseAlignFlag); |
---|
| 2456 | #endif |
---|
[313] | 2457 | #if RATE_CONTROL_LAMBDA_DOMAIN |
---|
| 2458 | #if !RC_SHVC_HARMONIZATION |
---|
| 2459 | printf("RateControl : %d\n", m_RCEnableRateControl ); |
---|
| 2460 | if(m_RCEnableRateControl) |
---|
| 2461 | { |
---|
| 2462 | printf("TargetBitrate : %d\n", m_RCTargetBitrate ); |
---|
| 2463 | printf("KeepHierarchicalBit : %d\n", m_RCKeepHierarchicalBit ); |
---|
| 2464 | printf("LCULevelRC : %d\n", m_RCLCULevelRC ); |
---|
| 2465 | printf("UseLCUSeparateModel : %d\n", m_RCUseLCUSeparateModel ); |
---|
| 2466 | printf("InitialQP : %d\n", m_RCInitialQP ); |
---|
| 2467 | printf("ForceIntraQP : %d\n", m_RCForceIntraQP ); |
---|
| 2468 | } |
---|
| 2469 | #endif |
---|
| 2470 | #else |
---|
| 2471 | printf("RateControl : %d\n", m_enableRateCtrl); |
---|
| 2472 | if(m_enableRateCtrl) |
---|
| 2473 | { |
---|
| 2474 | printf("TargetBitrate : %d\n", m_targetBitrate); |
---|
| 2475 | printf("NumLCUInUnit : %d\n", m_numLCUInUnit); |
---|
| 2476 | } |
---|
| 2477 | #endif |
---|
| 2478 | printf("Max Num Merge Candidates : %d\n", m_maxNumMergeCand); |
---|
| 2479 | printf("\n"); |
---|
| 2480 | |
---|
| 2481 | printf("TOOL CFG: "); |
---|
[486] | 2482 | #if !O0194_DIFFERENT_BITDEPTH_EL_BL |
---|
[313] | 2483 | printf("IBD:%d ", g_bitDepthY > m_inputBitDepthY || g_bitDepthC > m_inputBitDepthC); |
---|
[466] | 2484 | #endif |
---|
[313] | 2485 | printf("HAD:%d ", m_bUseHADME ); |
---|
| 2486 | printf("SRD:%d ", m_bUseSBACRD ); |
---|
| 2487 | printf("RDQ:%d ", m_useRDOQ ); |
---|
| 2488 | printf("RDQTS:%d ", m_useRDOQTS ); |
---|
| 2489 | printf("RDpenalty:%d ", m_rdPenalty ); |
---|
| 2490 | printf("SQP:%d ", m_uiDeltaQpRD ); |
---|
| 2491 | printf("ASR:%d ", m_bUseASR ); |
---|
| 2492 | printf("FEN:%d ", m_bUseFastEnc ); |
---|
| 2493 | printf("ECU:%d ", m_bUseEarlyCU ); |
---|
| 2494 | printf("FDM:%d ", m_useFastDecisionForMerge ); |
---|
| 2495 | printf("CFM:%d ", m_bUseCbfFastMode ); |
---|
| 2496 | printf("ESD:%d ", m_useEarlySkipDetection ); |
---|
| 2497 | #if FAST_INTRA_SHVC |
---|
| 2498 | printf("FIS:%d ", m_useFastIntraScalable ); |
---|
| 2499 | #endif |
---|
| 2500 | printf("RQT:%d ", 1 ); |
---|
| 2501 | printf("TransformSkip:%d ", m_useTransformSkip ); |
---|
| 2502 | printf("TransformSkipFast:%d ", m_useTransformSkipFast ); |
---|
| 2503 | printf("Slice: M=%d ", m_sliceMode); |
---|
| 2504 | if (m_sliceMode!=0) |
---|
| 2505 | { |
---|
| 2506 | printf("A=%d ", m_sliceArgument); |
---|
| 2507 | } |
---|
| 2508 | printf("SliceSegment: M=%d ",m_sliceSegmentMode); |
---|
| 2509 | if (m_sliceSegmentMode!=0) |
---|
| 2510 | { |
---|
| 2511 | printf("A=%d ", m_sliceSegmentArgument); |
---|
| 2512 | } |
---|
| 2513 | printf("CIP:%d ", m_bUseConstrainedIntraPred); |
---|
| 2514 | printf("SAO:%d ", (m_bUseSAO)?(1):(0)); |
---|
[467] | 2515 | #if !LAYER_CTB |
---|
[313] | 2516 | printf("PCM:%d ", (m_usePCM && (1<<m_uiPCMLog2MinSize) <= m_uiMaxCUWidth)? 1 : 0); |
---|
[467] | 2517 | #endif |
---|
[313] | 2518 | printf("SAOLcuBasedOptimization:%d ", (m_saoLcuBasedOptimization)?(1):(0)); |
---|
| 2519 | |
---|
| 2520 | printf("LosslessCuEnabled:%d ", (m_useLossless)? 1:0 ); |
---|
| 2521 | printf("WPP:%d ", (Int)m_useWeightedPred); |
---|
| 2522 | printf("WPB:%d ", (Int)m_useWeightedBiPred); |
---|
| 2523 | printf("PME:%d ", m_log2ParallelMergeLevel); |
---|
| 2524 | #if !SVC_EXTENSION |
---|
| 2525 | printf(" WaveFrontSynchro:%d WaveFrontSubstreams:%d", |
---|
| 2526 | m_iWaveFrontSynchro, m_iWaveFrontSubstreams); |
---|
| 2527 | #endif |
---|
| 2528 | printf(" ScalingList:%d ", m_useScalingListId ); |
---|
| 2529 | printf("TMVPMode:%d ", m_TMVPModeId ); |
---|
| 2530 | #if ADAPTIVE_QP_SELECTION |
---|
| 2531 | printf("AQpS:%d", m_bUseAdaptQpSelect ); |
---|
| 2532 | #endif |
---|
| 2533 | |
---|
| 2534 | printf(" SignBitHidingFlag:%d ", m_signHideFlag); |
---|
| 2535 | #if SVC_EXTENSION |
---|
| 2536 | printf("RecalQP:%d ", m_recalculateQPAccordingToLambda ? 1 : 0 ); |
---|
| 2537 | #if AVC_BASE |
---|
| 2538 | printf("AvcBase:%d ", m_avcBaseLayerFlag ? 1 : 0); |
---|
| 2539 | #else |
---|
| 2540 | printf("AvcBase:%d ", 0); |
---|
| 2541 | #endif |
---|
| 2542 | printf("EL_RAP_SliceType: %d ", m_elRapSliceBEnabled); |
---|
| 2543 | printf("REF_IDX_ME_ZEROMV: %d ", REF_IDX_ME_ZEROMV); |
---|
| 2544 | printf("ENCODER_FAST_MODE: %d ", ENCODER_FAST_MODE); |
---|
| 2545 | printf("REF_IDX_MFM: %d ", REF_IDX_MFM); |
---|
| 2546 | #else |
---|
| 2547 | printf("RecalQP:%d", m_recalculateQPAccordingToLambda ? 1 : 0 ); |
---|
| 2548 | #endif |
---|
[466] | 2549 | printf("O0194_DIFFERENT_BITDEPTH_EL_BL: %d ", O0194_DIFFERENT_BITDEPTH_EL_BL); |
---|
| 2550 | printf("O0194_JOINT_US_BITSHIFT: %d ", O0194_JOINT_US_BITSHIFT); |
---|
| 2551 | printf("O0194_WEIGHTED_PREDICTION_CGS: %d ",O0194_WEIGHTED_PREDICTION_CGS); |
---|
[313] | 2552 | printf("\n\n"); |
---|
| 2553 | |
---|
| 2554 | fflush(stdout); |
---|
| 2555 | } |
---|
| 2556 | |
---|
| 2557 | Bool confirmPara(Bool bflag, const Char* message) |
---|
| 2558 | { |
---|
| 2559 | if (!bflag) |
---|
| 2560 | return false; |
---|
| 2561 | |
---|
| 2562 | printf("Error: %s\n",message); |
---|
| 2563 | return true; |
---|
| 2564 | } |
---|
| 2565 | |
---|
[467] | 2566 | #if SVC_EXTENSION |
---|
[313] | 2567 | Void TAppEncCfg::cfgStringToArray(Int **arr, string cfgString, Int numEntries, const char* logString) |
---|
| 2568 | { |
---|
| 2569 | Char *tempChar = cfgString.empty() ? NULL : strdup(cfgString.c_str()); |
---|
| 2570 | if( numEntries > 0 ) |
---|
| 2571 | { |
---|
| 2572 | Char *arrayEntry; |
---|
| 2573 | Int i = 0; |
---|
| 2574 | *arr = new Int[numEntries]; |
---|
| 2575 | |
---|
| 2576 | arrayEntry = strtok( tempChar, " ,"); |
---|
| 2577 | while(arrayEntry != NULL) |
---|
| 2578 | { |
---|
| 2579 | if( i >= numEntries ) |
---|
| 2580 | { |
---|
| 2581 | printf( "%s: The number of entries specified is larger than the allowed number.\n", logString ); |
---|
| 2582 | exit( EXIT_FAILURE ); |
---|
| 2583 | } |
---|
| 2584 | *( *arr + i ) = atoi( arrayEntry ); |
---|
| 2585 | arrayEntry = strtok(NULL, " ,"); |
---|
| 2586 | i++; |
---|
| 2587 | } |
---|
| 2588 | if( i < numEntries ) |
---|
| 2589 | { |
---|
| 2590 | printf( "%s: Some entries are not specified.\n", logString ); |
---|
| 2591 | exit( EXIT_FAILURE ); |
---|
| 2592 | } |
---|
| 2593 | } |
---|
| 2594 | else |
---|
| 2595 | { |
---|
| 2596 | *arr = NULL; |
---|
| 2597 | } |
---|
| 2598 | } |
---|
[345] | 2599 | |
---|
[467] | 2600 | #endif //SVC_EXTENSION |
---|
[313] | 2601 | //! \} |
---|