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