[125] | 1 | /* The copyright in this software is being made available under the BSD |
---|
| 2 | * License, included below. This software may be subject to other third party |
---|
| 3 | * and contributor rights, including patent rights, and no such rights are |
---|
| 4 | * granted under this license. |
---|
| 5 | * |
---|
| 6 | * Copyright (c) 2010-2013, ITU/ISO/IEC |
---|
| 7 | * All rights reserved. |
---|
| 8 | * |
---|
| 9 | * Redistribution and use in source and binary forms, with or without |
---|
| 10 | * modification, are permitted provided that the following conditions are met: |
---|
| 11 | * |
---|
| 12 | * * Redistributions of source code must retain the above copyright notice, |
---|
| 13 | * this list of conditions and the following disclaimer. |
---|
| 14 | * * Redistributions in binary form must reproduce the above copyright notice, |
---|
| 15 | * this list of conditions and the following disclaimer in the documentation |
---|
| 16 | * and/or other materials provided with the distribution. |
---|
| 17 | * * Neither the name of the ITU/ISO/IEC nor the names of its contributors may |
---|
| 18 | * be used to endorse or promote products derived from this software without |
---|
| 19 | * specific prior written permission. |
---|
| 20 | * |
---|
| 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
---|
| 22 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
---|
| 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
---|
| 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS |
---|
| 25 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
---|
| 26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
---|
| 27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
---|
| 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
---|
| 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
---|
| 30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF |
---|
| 31 | * THE POSSIBILITY OF SUCH DAMAGE. |
---|
| 32 | */ |
---|
| 33 | |
---|
| 34 | /** \file TAppEncCfg.cpp |
---|
| 35 | \brief Handle encoder configuration parameters |
---|
| 36 | */ |
---|
| 37 | |
---|
| 38 | #include <stdlib.h> |
---|
| 39 | #include <cassert> |
---|
| 40 | #include <cstring> |
---|
| 41 | #include <string> |
---|
| 42 | #include "TLibCommon/TComRom.h" |
---|
| 43 | #include "TAppEncCfg.h" |
---|
| 44 | |
---|
| 45 | static istream& operator>>(istream &, Level::Name &); |
---|
| 46 | static istream& operator>>(istream &, Level::Tier &); |
---|
| 47 | static istream& operator>>(istream &, Profile::Name &); |
---|
| 48 | |
---|
| 49 | #include "TAppCommon/program_options_lite.h" |
---|
| 50 | #include "TLibEncoder/TEncRateCtrl.h" |
---|
| 51 | #ifdef WIN32 |
---|
| 52 | #define strdup _strdup |
---|
| 53 | #endif |
---|
| 54 | |
---|
| 55 | using namespace std; |
---|
| 56 | namespace po = df::program_options_lite; |
---|
| 57 | |
---|
| 58 | //! \ingroup TAppEncoder |
---|
| 59 | //! \{ |
---|
| 60 | |
---|
| 61 | // ==================================================================================================================== |
---|
| 62 | // Constructor / destructor / initialization / destroy |
---|
| 63 | // ==================================================================================================================== |
---|
| 64 | |
---|
| 65 | #if SVC_EXTENSION |
---|
| 66 | TAppEncCfg::TAppEncCfg() |
---|
| 67 | : m_pBitstreamFile() |
---|
| 68 | , m_pColumnWidth() |
---|
| 69 | , m_pRowHeight() |
---|
| 70 | , m_scalingListFile() |
---|
| 71 | #if REF_IDX_FRAMEWORK |
---|
| 72 | , m_elRapSliceBEnabled(0) |
---|
| 73 | #endif |
---|
| 74 | { |
---|
| 75 | for(UInt layer=0; layer<MAX_LAYERS; layer++) |
---|
| 76 | { |
---|
| 77 | m_acLayerCfg[layer].setAppEncCfg(this); |
---|
| 78 | } |
---|
| 79 | } |
---|
| 80 | #else |
---|
| 81 | TAppEncCfg::TAppEncCfg() |
---|
| 82 | : m_pchInputFile() |
---|
| 83 | , m_pchBitstreamFile() |
---|
| 84 | , m_pchReconFile() |
---|
| 85 | , m_pchdQPFile() |
---|
| 86 | , m_pColumnWidth() |
---|
| 87 | , m_pRowHeight() |
---|
| 88 | , m_scalingListFile() |
---|
| 89 | { |
---|
| 90 | m_aidQP = NULL; |
---|
[133] | 91 | #if J0149_TONE_MAPPING_SEI |
---|
| 92 | m_startOfCodedInterval = NULL; |
---|
| 93 | m_codedPivotValue = NULL; |
---|
| 94 | m_targetPivotValue = NULL; |
---|
| 95 | #endif |
---|
[125] | 96 | } |
---|
| 97 | #endif |
---|
| 98 | |
---|
| 99 | TAppEncCfg::~TAppEncCfg() |
---|
| 100 | { |
---|
| 101 | #if SVC_EXTENSION |
---|
| 102 | free(m_pBitstreamFile); |
---|
| 103 | #else |
---|
| 104 | free(m_pchBitstreamFile); |
---|
| 105 | if ( m_aidQP ) |
---|
| 106 | { |
---|
| 107 | delete[] m_aidQP; |
---|
| 108 | } |
---|
[133] | 109 | #if J0149_TONE_MAPPING_SEI |
---|
| 110 | if ( m_startOfCodedInterval ) |
---|
| 111 | { |
---|
| 112 | delete[] m_startOfCodedInterval; |
---|
| 113 | m_startOfCodedInterval = NULL; |
---|
| 114 | } |
---|
| 115 | if ( m_codedPivotValue ) |
---|
| 116 | { |
---|
| 117 | delete[] m_codedPivotValue; |
---|
| 118 | m_codedPivotValue = NULL; |
---|
| 119 | } |
---|
| 120 | if ( m_targetPivotValue ) |
---|
| 121 | { |
---|
| 122 | delete[] m_targetPivotValue; |
---|
| 123 | m_targetPivotValue = NULL; |
---|
| 124 | } |
---|
| 125 | #endif |
---|
[125] | 126 | free(m_pchInputFile); |
---|
| 127 | #endif |
---|
| 128 | #if !SVC_EXTENSION |
---|
| 129 | free(m_pchReconFile); |
---|
| 130 | free(m_pchdQPFile); |
---|
| 131 | #endif |
---|
| 132 | free(m_pColumnWidth); |
---|
| 133 | free(m_pRowHeight); |
---|
| 134 | free(m_scalingListFile); |
---|
| 135 | } |
---|
| 136 | |
---|
| 137 | Void TAppEncCfg::create() |
---|
| 138 | { |
---|
| 139 | } |
---|
| 140 | |
---|
| 141 | Void TAppEncCfg::destroy() |
---|
| 142 | { |
---|
[134] | 143 | #if VPS_EXTN_DIRECT_REF_LAYERS |
---|
| 144 | for(Int layer = 0; layer < MAX_LAYERS; layer++) |
---|
| 145 | { |
---|
| 146 | if( m_acLayerCfg[layer].m_numDirectRefLayers > 0 ) |
---|
| 147 | { |
---|
| 148 | delete [] m_acLayerCfg[layer].m_refLayerIds; |
---|
| 149 | } |
---|
| 150 | } |
---|
| 151 | #endif |
---|
[125] | 152 | } |
---|
| 153 | |
---|
| 154 | std::istringstream &operator>>(std::istringstream &in, GOPEntry &entry) //input |
---|
| 155 | { |
---|
| 156 | in>>entry.m_sliceType; |
---|
| 157 | in>>entry.m_POC; |
---|
| 158 | in>>entry.m_QPOffset; |
---|
| 159 | in>>entry.m_QPFactor; |
---|
| 160 | in>>entry.m_tcOffsetDiv2; |
---|
| 161 | in>>entry.m_betaOffsetDiv2; |
---|
| 162 | in>>entry.m_temporalId; |
---|
| 163 | in>>entry.m_numRefPicsActive; |
---|
| 164 | in>>entry.m_numRefPics; |
---|
| 165 | for ( Int i = 0; i < entry.m_numRefPics; i++ ) |
---|
| 166 | { |
---|
| 167 | in>>entry.m_referencePics[i]; |
---|
| 168 | } |
---|
| 169 | in>>entry.m_interRPSPrediction; |
---|
| 170 | #if AUTO_INTER_RPS |
---|
| 171 | if (entry.m_interRPSPrediction==1) |
---|
| 172 | { |
---|
| 173 | in>>entry.m_deltaRPS; |
---|
| 174 | in>>entry.m_numRefIdc; |
---|
| 175 | for ( Int i = 0; i < entry.m_numRefIdc; i++ ) |
---|
| 176 | { |
---|
| 177 | in>>entry.m_refIdc[i]; |
---|
| 178 | } |
---|
| 179 | } |
---|
| 180 | else if (entry.m_interRPSPrediction==2) |
---|
| 181 | { |
---|
| 182 | in>>entry.m_deltaRPS; |
---|
| 183 | } |
---|
| 184 | #else |
---|
| 185 | if (entry.m_interRPSPrediction) |
---|
| 186 | { |
---|
| 187 | in>>entry.m_deltaRPS; |
---|
| 188 | in>>entry.m_numRefIdc; |
---|
| 189 | for ( Int i = 0; i < entry.m_numRefIdc; i++ ) |
---|
| 190 | { |
---|
| 191 | in>>entry.m_refIdc[i]; |
---|
| 192 | } |
---|
| 193 | } |
---|
| 194 | #endif |
---|
| 195 | return in; |
---|
| 196 | } |
---|
| 197 | |
---|
| 198 | #if SVC_EXTENSION |
---|
| 199 | void TAppEncCfg::getDirFilename(string& filename, string& dir, const string path) |
---|
| 200 | { |
---|
| 201 | size_t pos = path.find_last_of("\\"); |
---|
| 202 | if(pos != std::string::npos) |
---|
| 203 | { |
---|
| 204 | filename.assign(path.begin() + pos + 1, path.end()); |
---|
| 205 | dir.assign(path.begin(), path.begin() + pos + 1); |
---|
| 206 | } |
---|
| 207 | else |
---|
| 208 | { |
---|
| 209 | pos = path.find_last_of("/"); |
---|
| 210 | if(pos != std::string::npos) |
---|
| 211 | { |
---|
| 212 | filename.assign(path.begin() + pos + 1, path.end()); |
---|
| 213 | dir.assign(path.begin(), path.begin() + pos + 1); |
---|
| 214 | } |
---|
| 215 | else |
---|
| 216 | { |
---|
| 217 | filename = path; |
---|
| 218 | dir.assign(""); |
---|
| 219 | } |
---|
| 220 | } |
---|
| 221 | } |
---|
| 222 | #endif |
---|
| 223 | |
---|
| 224 | static const struct MapStrToProfile { |
---|
| 225 | const Char* str; |
---|
| 226 | Profile::Name value; |
---|
| 227 | } strToProfile[] = { |
---|
| 228 | {"none", Profile::NONE}, |
---|
| 229 | {"main", Profile::MAIN}, |
---|
| 230 | {"main10", Profile::MAIN10}, |
---|
| 231 | {"main-still-picture", Profile::MAINSTILLPICTURE}, |
---|
| 232 | }; |
---|
| 233 | |
---|
| 234 | static const struct MapStrToTier { |
---|
| 235 | const Char* str; |
---|
| 236 | Level::Tier value; |
---|
| 237 | } strToTier[] = { |
---|
| 238 | {"main", Level::MAIN}, |
---|
| 239 | {"high", Level::HIGH}, |
---|
| 240 | }; |
---|
| 241 | |
---|
| 242 | static const struct MapStrToLevel { |
---|
| 243 | const Char* str; |
---|
| 244 | Level::Name value; |
---|
| 245 | } strToLevel[] = { |
---|
| 246 | {"none",Level::NONE}, |
---|
| 247 | {"1", Level::LEVEL1}, |
---|
| 248 | {"2", Level::LEVEL2}, |
---|
| 249 | {"2.1", Level::LEVEL2_1}, |
---|
| 250 | {"3", Level::LEVEL3}, |
---|
| 251 | {"3.1", Level::LEVEL3_1}, |
---|
| 252 | {"4", Level::LEVEL4}, |
---|
| 253 | {"4.1", Level::LEVEL4_1}, |
---|
| 254 | {"5", Level::LEVEL5}, |
---|
| 255 | {"5.1", Level::LEVEL5_1}, |
---|
| 256 | {"5.2", Level::LEVEL5_2}, |
---|
| 257 | {"6", Level::LEVEL6}, |
---|
| 258 | {"6.1", Level::LEVEL6_1}, |
---|
| 259 | {"6.2", Level::LEVEL6_2}, |
---|
| 260 | }; |
---|
| 261 | |
---|
| 262 | template<typename T, typename P> |
---|
| 263 | static istream& readStrToEnum(P map[], unsigned long mapLen, istream &in, T &val) |
---|
| 264 | { |
---|
| 265 | string str; |
---|
| 266 | in >> str; |
---|
| 267 | |
---|
| 268 | for (Int i = 0; i < mapLen; i++) |
---|
| 269 | { |
---|
| 270 | if (str == map[i].str) |
---|
| 271 | { |
---|
| 272 | val = map[i].value; |
---|
| 273 | goto found; |
---|
| 274 | } |
---|
| 275 | } |
---|
| 276 | /* not found */ |
---|
| 277 | in.setstate(ios::failbit); |
---|
| 278 | found: |
---|
| 279 | return in; |
---|
| 280 | } |
---|
| 281 | |
---|
| 282 | static istream& operator>>(istream &in, Profile::Name &profile) |
---|
| 283 | { |
---|
| 284 | return readStrToEnum(strToProfile, sizeof(strToProfile)/sizeof(*strToProfile), in, profile); |
---|
| 285 | } |
---|
| 286 | |
---|
| 287 | static istream& operator>>(istream &in, Level::Tier &tier) |
---|
| 288 | { |
---|
| 289 | return readStrToEnum(strToTier, sizeof(strToTier)/sizeof(*strToTier), in, tier); |
---|
| 290 | } |
---|
| 291 | |
---|
| 292 | static istream& operator>>(istream &in, Level::Name &level) |
---|
| 293 | { |
---|
| 294 | return readStrToEnum(strToLevel, sizeof(strToLevel)/sizeof(*strToLevel), in, level); |
---|
| 295 | } |
---|
| 296 | |
---|
| 297 | #if SIGNAL_BITRATE_PICRATE_IN_VPS |
---|
| 298 | Void readBoolString(const string inpString, const Int numEntries, Bool* &memberArray, const char *elementName); |
---|
| 299 | Void readIntString(const string inpString, const Int numEntries, Int* &memberArray, const char *elementName); |
---|
| 300 | #endif |
---|
| 301 | // ==================================================================================================================== |
---|
| 302 | // Public member functions |
---|
| 303 | // ==================================================================================================================== |
---|
| 304 | |
---|
| 305 | /** \param argc number of arguments |
---|
| 306 | \param argv array of arguments |
---|
| 307 | \retval true when success |
---|
| 308 | */ |
---|
| 309 | Bool TAppEncCfg::parseCfg( Int argc, Char* argv[] ) |
---|
| 310 | { |
---|
| 311 | Bool do_help = false; |
---|
| 312 | |
---|
| 313 | #if SVC_EXTENSION |
---|
| 314 | string cfg_LayerCfgFile [MAX_LAYERS]; |
---|
| 315 | string cfg_BitstreamFile; |
---|
| 316 | string* cfg_InputFile [MAX_LAYERS]; |
---|
| 317 | string* cfg_ReconFile [MAX_LAYERS]; |
---|
| 318 | Double* cfg_fQP [MAX_LAYERS]; |
---|
| 319 | |
---|
| 320 | Int* cfg_SourceWidth [MAX_LAYERS]; |
---|
| 321 | Int* cfg_SourceHeight [MAX_LAYERS]; |
---|
| 322 | Int* cfg_FrameRate [MAX_LAYERS]; |
---|
| 323 | Int* cfg_IntraPeriod [MAX_LAYERS]; |
---|
| 324 | Int* cfg_conformanceMode [MAX_LAYERS]; |
---|
[133] | 325 | #if VPS_EXTN_DIRECT_REF_LAYERS |
---|
| 326 | Int* cfg_numDirectRefLayers [MAX_LAYERS]; |
---|
| 327 | string cfg_refLayerIds [MAX_LAYERS]; |
---|
| 328 | string* cfg_refLayerIdsPtr [MAX_LAYERS]; |
---|
[125] | 329 | #endif |
---|
[184] | 330 | #if SCALED_REF_LAYER_OFFSETS |
---|
| 331 | Int* cfg_scaledRefLayerLeftOffset [MAX_LAYERS]; |
---|
| 332 | Int* cfg_scaledRefLayerTopOffset [MAX_LAYERS]; |
---|
| 333 | Int* cfg_scaledRefLayerRightOffset [MAX_LAYERS]; |
---|
| 334 | Int* cfg_scaledRefLayerBottomOffset [MAX_LAYERS]; |
---|
| 335 | #endif |
---|
[125] | 336 | for(UInt layer = 0; layer < MAX_LAYERS; layer++) |
---|
| 337 | { |
---|
| 338 | cfg_InputFile[layer] = &m_acLayerCfg[layer].m_cInputFile; |
---|
| 339 | cfg_ReconFile[layer] = &m_acLayerCfg[layer].m_cReconFile; |
---|
| 340 | cfg_fQP[layer] = &m_acLayerCfg[layer].m_fQP; |
---|
| 341 | cfg_SourceWidth[layer] = &m_acLayerCfg[layer].m_iSourceWidth; |
---|
| 342 | cfg_SourceHeight[layer] = &m_acLayerCfg[layer].m_iSourceHeight; |
---|
| 343 | cfg_FrameRate[layer] = &m_acLayerCfg[layer].m_iFrameRate; |
---|
| 344 | cfg_IntraPeriod[layer] = &m_acLayerCfg[layer].m_iIntraPeriod; |
---|
| 345 | cfg_conformanceMode[layer] = &m_acLayerCfg[layer].m_conformanceMode; |
---|
[133] | 346 | #if VPS_EXTN_DIRECT_REF_LAYERS |
---|
| 347 | cfg_numDirectRefLayers [layer] = &m_acLayerCfg[layer].m_numDirectRefLayers; |
---|
| 348 | cfg_refLayerIdsPtr [layer] = &cfg_refLayerIds[layer]; |
---|
[125] | 349 | #endif |
---|
[184] | 350 | #if SCALED_REF_LAYER_OFFSETS |
---|
| 351 | cfg_scaledRefLayerLeftOffset [layer] = &m_acLayerCfg[layer].m_scaledRefLayerLeftOffset; |
---|
| 352 | cfg_scaledRefLayerTopOffset [layer] = &m_acLayerCfg[layer].m_scaledRefLayerTopOffset; |
---|
| 353 | cfg_scaledRefLayerRightOffset [layer] = &m_acLayerCfg[layer].m_scaledRefLayerRightOffset; |
---|
| 354 | cfg_scaledRefLayerBottomOffset[layer] = &m_acLayerCfg[layer].m_scaledRefLayerBottomOffset; |
---|
| 355 | #endif |
---|
[125] | 356 | } |
---|
[154] | 357 | #if AVC_BASE |
---|
| 358 | string cfg_BLInputFile; |
---|
| 359 | #endif |
---|
[125] | 360 | #if AVC_SYNTAX |
---|
| 361 | string cfg_BLSyntaxFile; |
---|
| 362 | #endif |
---|
| 363 | #else |
---|
| 364 | string cfg_InputFile; |
---|
| 365 | string cfg_BitstreamFile; |
---|
| 366 | string cfg_ReconFile; |
---|
| 367 | string cfg_dQPFile; |
---|
| 368 | #endif |
---|
| 369 | string cfg_ColumnWidth; |
---|
| 370 | string cfg_RowHeight; |
---|
| 371 | string cfg_ScalingListFile; |
---|
[133] | 372 | #if J0149_TONE_MAPPING_SEI |
---|
| 373 | string cfg_startOfCodedInterval; |
---|
| 374 | string cfg_codedPivotValue; |
---|
| 375 | string cfg_targetPivotValue; |
---|
| 376 | #endif |
---|
[125] | 377 | #if SIGNAL_BITRATE_PICRATE_IN_VPS |
---|
| 378 | string cfg_bitRateInfoPresentFlag; |
---|
| 379 | string cfg_picRateInfoPresentFlag; |
---|
| 380 | string cfg_avgBitRate; |
---|
| 381 | string cfg_maxBitRate; |
---|
| 382 | string cfg_avgPicRate; |
---|
| 383 | string cfg_constantPicRateIdc; |
---|
| 384 | #endif |
---|
| 385 | po::Options opts; |
---|
| 386 | opts.addOptions() |
---|
| 387 | ("help", do_help, false, "this help text") |
---|
| 388 | ("c", po::parseConfigFile, "configuration file name") |
---|
| 389 | |
---|
| 390 | // File, I/O and source parameters |
---|
| 391 | #if SVC_EXTENSION |
---|
| 392 | ("InputFile%d,-i%d", cfg_InputFile, string(""), MAX_LAYERS, "original YUV input file name for layer %d") |
---|
| 393 | ("ReconFile%d,-o%d", cfg_ReconFile, string(""), MAX_LAYERS, "reconstruction YUV input file name for layer %d") |
---|
| 394 | ("LayerConfig%d,-lc%d", cfg_LayerCfgFile, string(""), MAX_LAYERS, "layer %d configuration file name") |
---|
| 395 | ("SourceWidth%d,-wdt%d", cfg_SourceWidth, 0, MAX_LAYERS, "Source picture width for layer %d") |
---|
| 396 | ("SourceHeight%d,-hgt%d", cfg_SourceHeight, 0, MAX_LAYERS, "Source picture height for layer %d") |
---|
| 397 | ("FrameRate%d,-fr%d", cfg_FrameRate, 0, MAX_LAYERS, "Frame rate for layer %d") |
---|
| 398 | ("LambdaModifier%d,-LM%d", m_adLambdaModifier, ( double )1.0, MAX_TLAYER, "Lambda modifier for temporal layer %d") |
---|
| 399 | #if VPS_EXTN_DIRECT_REF_LAYERS |
---|
[133] | 400 | ("NumDirectRefLayers%d", cfg_numDirectRefLayers, -1, MAX_LAYERS, "Number of direct reference layers") |
---|
[125] | 401 | ("RefLayerIds%d", cfg_refLayerIdsPtr, string(""), MAX_LAYERS, "direct reference layer IDs") |
---|
| 402 | #endif |
---|
| 403 | ("NumLayers", m_numLayers, 1, "Number of layers to code") |
---|
| 404 | ("ConformanceMode%d", cfg_conformanceMode,0, MAX_LAYERS, "Window conformance mode (0: no cropping, 1:automatic padding, 2: padding, 3:cropping") |
---|
| 405 | |
---|
| 406 | ("BitstreamFile,b", cfg_BitstreamFile, string(""), "Bitstream output file name") |
---|
| 407 | ("InputBitDepth", m_inputBitDepthY, 8, "Bit-depth of input file") |
---|
| 408 | ("OutputBitDepth", m_outputBitDepthY, 0, "Bit-depth of output file (default:InternalBitDepth)") |
---|
| 409 | ("InternalBitDepth", m_internalBitDepthY, 0, "Bit-depth the codec operates at. (default:InputBitDepth)" |
---|
| 410 | "If different to InputBitDepth, source data will be converted") |
---|
| 411 | ("InputBitDepthC", m_inputBitDepthC, 0, "As per InputBitDepth but for chroma component. (default:InputBitDepth)") |
---|
| 412 | ("OutputBitDepthC", m_outputBitDepthC, 0, "As per OutputBitDepth but for chroma component. (default:InternalBitDepthC)") |
---|
| 413 | ("InternalBitDepthC", m_internalBitDepthC, 0, "As per InternalBitDepth but for chroma component. (default:IntrenalBitDepth)") |
---|
[175] | 414 | #if SCALED_REF_LAYER_OFFSETS |
---|
[184] | 415 | ("ScaledRefLayerLeftOffset%d", cfg_scaledRefLayerLeftOffset, 0, MAX_LAYERS, "Horizontal offset of top-left luma sample of scaled base layer picture with respect to" |
---|
[175] | 416 | " top-left luma sample of the EL picture, in units of two luma samples") |
---|
[184] | 417 | ("ScaledRefLayerTopOffset%d", cfg_scaledRefLayerTopOffset, 0, MAX_LAYERS, "Vertical offset of top-left luma sample of scaled base layer picture with respect to" |
---|
[175] | 418 | " top-left luma sample of the EL picture, in units of two luma samples") |
---|
[184] | 419 | ("ScaledRefLayerRightOffset%d", cfg_scaledRefLayerRightOffset, 0, MAX_LAYERS, "Horizontal offset of bottom-right luma sample of scaled base layer picture with respect to" |
---|
[175] | 420 | " bottom-right luma sample of the EL picture, in units of two luma samples") |
---|
[184] | 421 | ("ScaledRefLayerBottomOffset%d", cfg_scaledRefLayerBottomOffset,0, MAX_LAYERS, "Vertical offset of bottom-right luma sample of scaled base layer picture with respect to" |
---|
[175] | 422 | " bottom-right luma sample of the EL picture, in units of two luma samples") |
---|
| 423 | #endif |
---|
[125] | 424 | #if AVC_BASE |
---|
[154] | 425 | ("AvcBase", m_avcBaseLayerFlag, 0, "AVC_BASElayer_flag") |
---|
| 426 | ("InputBLFile,-ibl", cfg_BLInputFile, string(""), "Base layer rec YUV input file name") |
---|
[125] | 427 | #if AVC_SYNTAX |
---|
| 428 | ("InputBLSyntaxFile,-ibs", cfg_BLSyntaxFile, string(""), "Base layer syntax input file name") |
---|
| 429 | #endif |
---|
| 430 | #endif |
---|
| 431 | #if REF_IDX_FRAMEWORK |
---|
| 432 | ("EnableElRapB,-use-rap-b", m_elRapSliceBEnabled, 0, "Set ILP over base-layer I picture to B picture (default is P picture_") |
---|
| 433 | #endif |
---|
| 434 | #else |
---|
| 435 | ("InputFile,i", cfg_InputFile, string(""), "Original YUV input file name") |
---|
| 436 | ("BitstreamFile,b", cfg_BitstreamFile, string(""), "Bitstream output file name") |
---|
| 437 | ("ReconFile,o", cfg_ReconFile, string(""), "Reconstructed YUV output file name") |
---|
| 438 | ("SourceWidth,-wdt", m_iSourceWidth, 0, "Source picture width") |
---|
| 439 | ("SourceHeight,-hgt", m_iSourceHeight, 0, "Source picture height") |
---|
| 440 | ("InputBitDepth", m_inputBitDepthY, 8, "Bit-depth of input file") |
---|
| 441 | ("OutputBitDepth", m_outputBitDepthY, 0, "Bit-depth of output file (default:InternalBitDepth)") |
---|
| 442 | ("InternalBitDepth", m_internalBitDepthY, 0, "Bit-depth the codec operates at. (default:InputBitDepth)" |
---|
| 443 | "If different to InputBitDepth, source data will be converted") |
---|
| 444 | ("InputBitDepthC", m_inputBitDepthC, 0, "As per InputBitDepth but for chroma component. (default:InputBitDepth)") |
---|
| 445 | ("OutputBitDepthC", m_outputBitDepthC, 0, "As per OutputBitDepth but for chroma component. (default:InternalBitDepthC)") |
---|
| 446 | ("InternalBitDepthC", m_internalBitDepthC, 0, "As per InternalBitDepth but for chroma component. (default:IntrenalBitDepth)") |
---|
| 447 | ("ConformanceMode", m_conformanceMode, 0, "Window conformance mode (0: no window, 1:automatic padding, 2:padding, 3:conformance") |
---|
| 448 | ("HorizontalPadding,-pdx",m_aiPad[0], 0, "Horizontal source padding for conformance window mode 2") |
---|
| 449 | ("VerticalPadding,-pdy", m_aiPad[1], 0, "Vertical source padding for conformance window mode 2") |
---|
| 450 | ("ConfLeft", m_confLeft, 0, "Left offset for window conformance mode 3") |
---|
| 451 | ("ConfRight", m_confRight, 0, "Right offset for window conformance mode 3") |
---|
| 452 | ("ConfTop", m_confTop, 0, "Top offset for window conformance mode 3") |
---|
| 453 | ("ConfBottom", m_confBottom, 0, "Bottom offset for window conformance mode 3") |
---|
| 454 | ("FrameRate,-fr", m_iFrameRate, 0, "Frame rate") |
---|
| 455 | #endif |
---|
| 456 | ("FrameSkip,-fs", m_FrameSkip, 0u, "Number of frames to skip at start of input YUV") |
---|
| 457 | ("FramesToBeEncoded,f", m_framesToBeEncoded, 0, "Number of frames to be encoded (default=all)") |
---|
| 458 | |
---|
| 459 | // Profile and level |
---|
| 460 | ("Profile", m_profile, Profile::NONE, "Profile to be used when encoding (Incomplete)") |
---|
| 461 | ("Level", m_level, Level::NONE, "Level limit to be used, eg 5.1 (Incomplete)") |
---|
| 462 | ("Tier", m_levelTier, Level::MAIN, "Tier to use for interpretation of --Level") |
---|
| 463 | |
---|
| 464 | #if L0046_CONSTRAINT_FLAGS |
---|
| 465 | ("ProgressiveSource", m_progressiveSourceFlag, false, "Indicate that source is progressive") |
---|
| 466 | ("InterlacedSource", m_interlacedSourceFlag, false, "Indicate that source is interlaced") |
---|
| 467 | ("NonPackedSource", m_nonPackedConstraintFlag, false, "Indicate that source does not contain frame packing") |
---|
| 468 | ("FrameOnly", m_frameOnlyConstraintFlag, false, "Indicate that the bitstream contains only frames") |
---|
| 469 | #endif |
---|
| 470 | |
---|
| 471 | // Unit definition parameters |
---|
| 472 | ("MaxCUWidth", m_uiMaxCUWidth, 64u) |
---|
| 473 | ("MaxCUHeight", m_uiMaxCUHeight, 64u) |
---|
| 474 | // todo: remove defaults from MaxCUSize |
---|
| 475 | ("MaxCUSize,s", m_uiMaxCUWidth, 64u, "Maximum CU size") |
---|
| 476 | ("MaxCUSize,s", m_uiMaxCUHeight, 64u, "Maximum CU size") |
---|
| 477 | ("MaxPartitionDepth,h", m_uiMaxCUDepth, 4u, "CU depth") |
---|
| 478 | |
---|
| 479 | ("QuadtreeTULog2MaxSize", m_uiQuadtreeTULog2MaxSize, 6u, "Maximum TU size in logarithm base 2") |
---|
| 480 | ("QuadtreeTULog2MinSize", m_uiQuadtreeTULog2MinSize, 2u, "Minimum TU size in logarithm base 2") |
---|
| 481 | |
---|
| 482 | ("QuadtreeTUMaxDepthIntra", m_uiQuadtreeTUMaxDepthIntra, 1u, "Depth of TU tree for intra CUs") |
---|
| 483 | ("QuadtreeTUMaxDepthInter", m_uiQuadtreeTUMaxDepthInter, 2u, "Depth of TU tree for inter CUs") |
---|
| 484 | |
---|
| 485 | // Coding structure paramters |
---|
| 486 | #if SVC_EXTENSION |
---|
| 487 | ("IntraPeriod%d,-ip%d", cfg_IntraPeriod, -1, MAX_LAYERS, "intra period in frames for layer %d, (-1: only first frame)") |
---|
| 488 | #else |
---|
| 489 | ("IntraPeriod,-ip", m_iIntraPeriod, -1, "Intra period in frames, (-1: only first frame)") |
---|
| 490 | #endif |
---|
| 491 | ("DecodingRefreshType,-dr", m_iDecodingRefreshType, 0, "Intra refresh type (0:none 1:CRA 2:IDR)") |
---|
| 492 | ("GOPSize,g", m_iGOPSize, 1, "GOP size of temporal structure") |
---|
[133] | 493 | #if !L0034_COMBINED_LIST_CLEANUP |
---|
[125] | 494 | ("ListCombination,-lc", m_bUseLComb, true, "Combined reference list for uni-prediction estimation in B-slices") |
---|
[133] | 495 | #endif |
---|
[125] | 496 | // motion options |
---|
| 497 | ("FastSearch", m_iFastSearch, 1, "0:Full search 1:Diamond 2:PMVFAST") |
---|
| 498 | ("SearchRange,-sr", m_iSearchRange, 96, "Motion search range") |
---|
| 499 | ("BipredSearchRange", m_bipredSearchRange, 4, "Motion search range for bipred refinement") |
---|
| 500 | ("HadamardME", m_bUseHADME, true, "Hadamard ME for fractional-pel") |
---|
| 501 | ("ASR", m_bUseASR, false, "Adaptive motion search range") |
---|
| 502 | |
---|
| 503 | #if SVC_EXTENSION |
---|
| 504 | ("LambdaModifier%d,-LM%d", m_adLambdaModifier, ( double )1.0, MAX_TLAYER, "Lambda modifier for temporal layer %d") |
---|
| 505 | #else |
---|
| 506 | // Mode decision parameters |
---|
| 507 | ("LambdaModifier0,-LM0", m_adLambdaModifier[ 0 ], ( Double )1.0, "Lambda modifier for temporal layer 0") |
---|
| 508 | ("LambdaModifier1,-LM1", m_adLambdaModifier[ 1 ], ( Double )1.0, "Lambda modifier for temporal layer 1") |
---|
| 509 | ("LambdaModifier2,-LM2", m_adLambdaModifier[ 2 ], ( Double )1.0, "Lambda modifier for temporal layer 2") |
---|
| 510 | ("LambdaModifier3,-LM3", m_adLambdaModifier[ 3 ], ( Double )1.0, "Lambda modifier for temporal layer 3") |
---|
| 511 | ("LambdaModifier4,-LM4", m_adLambdaModifier[ 4 ], ( Double )1.0, "Lambda modifier for temporal layer 4") |
---|
| 512 | ("LambdaModifier5,-LM5", m_adLambdaModifier[ 5 ], ( Double )1.0, "Lambda modifier for temporal layer 5") |
---|
| 513 | ("LambdaModifier6,-LM6", m_adLambdaModifier[ 6 ], ( Double )1.0, "Lambda modifier for temporal layer 6") |
---|
| 514 | ("LambdaModifier7,-LM7", m_adLambdaModifier[ 7 ], ( Double )1.0, "Lambda modifier for temporal layer 7") |
---|
| 515 | #endif |
---|
| 516 | |
---|
| 517 | /* Quantization parameters */ |
---|
| 518 | #if SVC_EXTENSION |
---|
| 519 | ("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") |
---|
| 520 | #else |
---|
| 521 | ("QP,q", m_fQP, 30.0, "Qp value, if value is float, QP is switched once during encoding") |
---|
| 522 | #endif |
---|
| 523 | ("DeltaQpRD,-dqr",m_uiDeltaQpRD, 0u, "max dQp offset for slice") |
---|
| 524 | ("MaxDeltaQP,d", m_iMaxDeltaQP, 0, "max dQp offset for block") |
---|
| 525 | ("MaxCuDQPDepth,-dqd", m_iMaxCuDQPDepth, 0, "max depth for a minimum CuDQP") |
---|
| 526 | |
---|
| 527 | ("CbQpOffset,-cbqpofs", m_cbQpOffset, 0, "Chroma Cb QP Offset") |
---|
| 528 | ("CrQpOffset,-crqpofs", m_crQpOffset, 0, "Chroma Cr QP Offset") |
---|
| 529 | |
---|
| 530 | #if ADAPTIVE_QP_SELECTION |
---|
| 531 | ("AdaptiveQpSelection,-aqps", m_bUseAdaptQpSelect, false, "AdaptiveQpSelection") |
---|
| 532 | #endif |
---|
| 533 | |
---|
| 534 | ("AdaptiveQP,-aq", m_bUseAdaptiveQP, false, "QP adaptation based on a psycho-visual model") |
---|
| 535 | ("MaxQPAdaptationRange,-aqr", m_iQPAdaptationRange, 6, "QP adaptation range") |
---|
| 536 | #if !SVC_EXTENSION |
---|
| 537 | ("dQPFile,m", cfg_dQPFile, string(""), "dQP file name") |
---|
| 538 | #endif |
---|
| 539 | ("RDOQ", m_useRDOQ, true ) |
---|
| 540 | ("RDOQTS", m_useRDOQTS, true ) |
---|
| 541 | #if L0232_RD_PENALTY |
---|
| 542 | ("RDpenalty", m_rdPenalty, 0, "RD-penalty for 32x32 TU for intra in non-intra slices. 0:disbaled 1:RD-penalty 2:maximum RD-penalty") |
---|
| 543 | #endif |
---|
| 544 | // Entropy coding parameters |
---|
| 545 | ("SBACRD", m_bUseSBACRD, true, "SBAC based RD estimation") |
---|
| 546 | |
---|
| 547 | // Deblocking filter parameters |
---|
| 548 | ("LoopFilterDisable", m_bLoopFilterDisable, false ) |
---|
| 549 | ("LoopFilterOffsetInPPS", m_loopFilterOffsetInPPS, false ) |
---|
| 550 | ("LoopFilterBetaOffset_div2", m_loopFilterBetaOffsetDiv2, 0 ) |
---|
| 551 | ("LoopFilterTcOffset_div2", m_loopFilterTcOffsetDiv2, 0 ) |
---|
| 552 | ("DeblockingFilterControlPresent", m_DeblockingFilterControlPresent, false ) |
---|
[133] | 553 | #if L0386_DB_METRIC |
---|
| 554 | ("DeblockingFilterMetric", m_DeblockingFilterMetric, false ) |
---|
| 555 | #endif |
---|
[125] | 556 | |
---|
| 557 | // Coding tools |
---|
| 558 | ("AMP", m_enableAMP, true, "Enable asymmetric motion partitions") |
---|
| 559 | ("TransformSkip", m_useTransformSkip, false, "Intra transform skipping") |
---|
| 560 | ("TransformSkipFast", m_useTransformSkipFast, false, "Fast intra transform skipping") |
---|
| 561 | ("SAO", m_bUseSAO, true, "Enable Sample Adaptive Offset") |
---|
| 562 | ("MaxNumOffsetsPerPic", m_maxNumOffsetsPerPic, 2048, "Max number of SAO offset per picture (Default: 2048)") |
---|
| 563 | ("SAOLcuBoundary", m_saoLcuBoundary, false, "0: right/bottom LCU boundary areas skipped from SAO parameter estimation, 1: non-deblocked pixels are used for those areas") |
---|
| 564 | ("SAOLcuBasedOptimization", m_saoLcuBasedOptimization, true, "0: SAO picture-based optimization, 1: SAO LCU-based optimization ") |
---|
| 565 | ("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") |
---|
| 566 | ("SliceArgument", m_sliceArgument, 0, "Depending on SliceMode being:" |
---|
| 567 | "\t1: max number of CTUs per slice" |
---|
| 568 | "\t2: max number of bytes per slice" |
---|
| 569 | "\t3: max number of tiles per slice") |
---|
| 570 | ("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") |
---|
| 571 | ("SliceSegmentArgument", m_sliceSegmentArgument, 0, "Depending on SliceSegmentMode being:" |
---|
| 572 | "\t1: max number of CTUs per slice segment" |
---|
| 573 | "\t2: max number of bytes per slice segment" |
---|
| 574 | "\t3: max number of tiles per slice segment") |
---|
| 575 | ("LFCrossSliceBoundaryFlag", m_bLFCrossSliceBoundaryFlag, true) |
---|
| 576 | |
---|
| 577 | ("ConstrainedIntraPred", m_bUseConstrainedIntraPred, false, "Constrained Intra Prediction") |
---|
| 578 | |
---|
| 579 | ("PCMEnabledFlag", m_usePCM, false) |
---|
| 580 | ("PCMLog2MaxSize", m_pcmLog2MaxSize, 5u) |
---|
| 581 | ("PCMLog2MinSize", m_uiPCMLog2MinSize, 3u) |
---|
| 582 | ("PCMInputBitDepthFlag", m_bPCMInputBitDepthFlag, true) |
---|
| 583 | ("PCMFilterDisableFlag", m_bPCMFilterDisableFlag, false) |
---|
| 584 | |
---|
| 585 | ("LosslessCuEnabled", m_useLossless, false) |
---|
| 586 | |
---|
| 587 | ("WeightedPredP,-wpP", m_useWeightedPred, false, "Use weighted prediction in P slices") |
---|
| 588 | ("WeightedPredB,-wpB", m_useWeightedBiPred, false, "Use weighted (bidirectional) prediction in B slices") |
---|
| 589 | ("Log2ParallelMergeLevel", m_log2ParallelMergeLevel, 2u, "Parallel merge estimation region") |
---|
| 590 | ("UniformSpacingIdc", m_iUniformSpacingIdr, 0, "Indicates if the column and row boundaries are distributed uniformly") |
---|
| 591 | ("NumTileColumnsMinus1", m_iNumColumnsMinus1, 0, "Number of columns in a picture minus 1") |
---|
| 592 | ("ColumnWidthArray", cfg_ColumnWidth, string(""), "Array containing ColumnWidth values in units of LCU") |
---|
| 593 | ("NumTileRowsMinus1", m_iNumRowsMinus1, 0, "Number of rows in a picture minus 1") |
---|
| 594 | ("RowHeightArray", cfg_RowHeight, string(""), "Array containing RowHeight values in units of LCU") |
---|
| 595 | ("LFCrossTileBoundaryFlag", m_bLFCrossTileBoundaryFlag, true, "1: cross-tile-boundary loop filtering. 0:non-cross-tile-boundary loop filtering") |
---|
| 596 | ("WaveFrontSynchro", m_iWaveFrontSynchro, 0, "0: no synchro; 1 synchro with TR; 2 TRR etc") |
---|
| 597 | ("ScalingList", m_useScalingListId, 0, "0: no scaling list, 1: default scaling lists, 2: scaling lists specified in ScalingListFile") |
---|
| 598 | ("ScalingListFile", cfg_ScalingListFile, string(""), "Scaling list file name") |
---|
| 599 | ("SignHideFlag,-SBH", m_signHideFlag, 1) |
---|
| 600 | ("MaxNumMergeCand", m_maxNumMergeCand, 5u, "Maximum number of merge candidates") |
---|
| 601 | |
---|
| 602 | /* Misc. */ |
---|
| 603 | ("SEIDecodedPictureHash", m_decodedPictureHashSEIEnabled, 0, "Control generation of decode picture hash SEI messages\n" |
---|
| 604 | "\t3: checksum\n" |
---|
| 605 | "\t2: CRC\n" |
---|
| 606 | "\t1: use MD5\n" |
---|
| 607 | "\t0: disable") |
---|
| 608 | ("SEIpictureDigest", m_decodedPictureHashSEIEnabled, 0, "deprecated alias for SEIDecodedPictureHash") |
---|
| 609 | ("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") |
---|
| 610 | ("FEN", m_bUseFastEnc, false, "fast encoder setting") |
---|
| 611 | ("ECU", m_bUseEarlyCU, false, "Early CU setting") |
---|
| 612 | ("FDM", m_useFastDecisionForMerge, true, "Fast decision for Merge RD Cost") |
---|
| 613 | ("CFM", m_bUseCbfFastMode, false, "Cbf fast mode setting") |
---|
| 614 | ("ESD", m_useEarlySkipDetection, false, "Early SKIP detection setting") |
---|
| 615 | #if RATE_CONTROL_LAMBDA_DOMAIN |
---|
| 616 | ( "RateControl", m_RCEnableRateControl, false, "Rate control: enable rate control" ) |
---|
| 617 | ( "TargetBitrate", m_RCTargetBitrate, 0, "Rate control: target bitrate" ) |
---|
| 618 | ( "KeepHierarchicalBit", m_RCKeepHierarchicalBit, false, "Rate control: keep hierarchical bit allocation in rate control algorithm" ) |
---|
| 619 | ( "LCULevelRateControl", m_RCLCULevelRC, true, "Rate control: true: LCU level RC; false: picture level RC" ) |
---|
| 620 | ( "RCLCUSeparateModel", m_RCUseLCUSeparateModel, true, "Rate control: use LCU level separate R-lambda model" ) |
---|
| 621 | ( "InitialQP", m_RCInitialQP, 0, "Rate control: initial QP" ) |
---|
| 622 | ( "RCForceIntraQP", m_RCForceIntraQP, false, "Rate control: force intra QP to be equal to initial QP" ) |
---|
| 623 | #else |
---|
| 624 | ("RateCtrl,-rc", m_enableRateCtrl, false, "Rate control on/off") |
---|
| 625 | ("TargetBitrate,-tbr", m_targetBitrate, 0, "Input target bitrate") |
---|
| 626 | ("NumLCUInUnit,-nu", m_numLCUInUnit, 0, "Number of LCUs in an Unit") |
---|
| 627 | #endif |
---|
| 628 | |
---|
| 629 | ("TransquantBypassEnableFlag", m_TransquantBypassEnableFlag, false, "transquant_bypass_enable_flag indicator in PPS") |
---|
| 630 | ("CUTransquantBypassFlagValue", m_CUTransquantBypassFlagValue, false, "Fixed cu_transquant_bypass_flag value, when transquant_bypass_enable_flag is enabled") |
---|
| 631 | ("RecalculateQPAccordingToLambda", m_recalculateQPAccordingToLambda, false, "Recalculate QP values according to lambda values. Do not suggest to be enabled in all intra case") |
---|
| 632 | ("StrongIntraSmoothing,-sis", m_useStrongIntraSmoothing, true, "Enable strong intra smoothing for 32x32 blocks") |
---|
| 633 | ("SEIActiveParameterSets", m_activeParameterSetsSEIEnabled, 0, "Enable generation of active parameter sets SEI messages") |
---|
| 634 | ("VuiParametersPresent,-vui", m_vuiParametersPresentFlag, false, "Enable generation of vui_parameters()") |
---|
| 635 | ("AspectRatioInfoPresent", m_aspectRatioInfoPresentFlag, false, "Signals whether aspect_ratio_idc is present") |
---|
| 636 | ("AspectRatioIdc", m_aspectRatioIdc, 0, "aspect_ratio_idc") |
---|
| 637 | ("SarWidth", m_sarWidth, 0, "horizontal size of the sample aspect ratio") |
---|
| 638 | ("SarHeight", m_sarHeight, 0, "vertical size of the sample aspect ratio") |
---|
| 639 | ("OverscanInfoPresent", m_overscanInfoPresentFlag, false, "Indicates whether conformant decoded pictures are suitable for display using overscan\n") |
---|
| 640 | ("OverscanAppropriate", m_overscanAppropriateFlag, false, "Indicates whether conformant decoded pictures are suitable for display using overscan\n") |
---|
| 641 | ("VideoSignalTypePresent", m_videoSignalTypePresentFlag, false, "Signals whether video_format, video_full_range_flag, and colour_description_present_flag are present") |
---|
| 642 | ("VideoFormat", m_videoFormat, 5, "Indicates representation of pictures") |
---|
| 643 | ("VideoFullRange", m_videoFullRangeFlag, false, "Indicates the black level and range of luma and chroma signals") |
---|
| 644 | ("ColourDescriptionPresent", m_colourDescriptionPresentFlag, false, "Signals whether colour_primaries, transfer_characteristics and matrix_coefficients are present") |
---|
| 645 | ("ColourPrimaries", m_colourPrimaries, 2, "Indicates chromaticity coordinates of the source primaries") |
---|
| 646 | ("TransferCharateristics", m_transferCharacteristics, 2, "Indicates the opto-electronic transfer characteristics of the source") |
---|
| 647 | ("MatrixCoefficients", m_matrixCoefficients, 2, "Describes the matrix coefficients used in deriving luma and chroma from RGB primaries") |
---|
| 648 | ("ChromaLocInfoPresent", m_chromaLocInfoPresentFlag, false, "Signals whether chroma_sample_loc_type_top_field and chroma_sample_loc_type_bottom_field are present") |
---|
| 649 | ("ChromaSampleLocTypeTopField", m_chromaSampleLocTypeTopField, 0, "Specifies the location of chroma samples for top field") |
---|
| 650 | ("ChromaSampleLocTypeBottomField", m_chromaSampleLocTypeBottomField, 0, "Specifies the location of chroma samples for bottom field") |
---|
| 651 | ("NeutralChromaIndication", m_neutralChromaIndicationFlag, false, "Indicates that the value of all decoded chroma samples is equal to 1<<(BitDepthCr-1)") |
---|
| 652 | ("DefaultDisplayWindowFlag", m_defaultDisplayWindowFlag, false, "Indicates the presence of the Default Window parameters") |
---|
| 653 | ("DefDispWinLeftOffset", m_defDispWinLeftOffset, 0, "Specifies the left offset of the default display window from the conformance window") |
---|
| 654 | ("DefDispWinRightOffset", m_defDispWinRightOffset, 0, "Specifies the right offset of the default display window from the conformance window") |
---|
| 655 | ("DefDispWinTopOffset", m_defDispWinTopOffset, 0, "Specifies the top offset of the default display window from the conformance window") |
---|
| 656 | ("DefDispWinBottomOffset", m_defDispWinBottomOffset, 0, "Specifies the bottom offset of the default display window from the conformance window") |
---|
| 657 | ("FrameFieldInfoPresentFlag", m_frameFieldInfoPresentFlag, false, "Indicates that pic_struct and field coding related values are present in picture timing SEI messages") |
---|
| 658 | ("PocProportionalToTimingFlag", m_pocProportionalToTimingFlag, false, "Indicates that the POC value is proportional to the output time w.r.t. first picture in CVS") |
---|
| 659 | ("NumTicksPocDiffOneMinus1", m_numTicksPocDiffOneMinus1, 0, "Number of ticks minus 1 that for a POC difference of one") |
---|
| 660 | ("BitstreamRestriction", m_bitstreamRestrictionFlag, false, "Signals whether bitstream restriction parameters are present") |
---|
| 661 | ("TilesFixedStructure", m_tilesFixedStructureFlag, false, "Indicates that each active picture parameter set has the same values of the syntax elements related to tiles") |
---|
| 662 | ("MotionVectorsOverPicBoundaries", m_motionVectorsOverPicBoundariesFlag, false, "Indicates that no samples outside the picture boundaries are used for inter prediction") |
---|
| 663 | ("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") |
---|
| 664 | ("MaxBitsPerMinCuDenom", m_maxBitsPerMinCuDenom, 1, "Indicates an upper bound for the number of bits of coding_unit() data") |
---|
| 665 | ("Log2MaxMvLengthHorizontal", m_log2MaxMvLengthHorizontal, 15, "Indicate the maximum absolute value of a decoded horizontal MV component in quarter-pel luma units") |
---|
| 666 | ("Log2MaxMvLengthVertical", m_log2MaxMvLengthVertical, 15, "Indicate the maximum absolute value of a decoded vertical MV component in quarter-pel luma units") |
---|
| 667 | ("SEIRecoveryPoint", m_recoveryPointSEIEnabled, 0, "Control generation of recovery point SEI messages") |
---|
| 668 | ("SEIBufferingPeriod", m_bufferingPeriodSEIEnabled, 0, "Control generation of buffering period SEI messages") |
---|
| 669 | ("SEIPictureTiming", m_pictureTimingSEIEnabled, 0, "Control generation of picture timing SEI messages") |
---|
[133] | 670 | #if J0149_TONE_MAPPING_SEI |
---|
| 671 | ("SEIToneMappingInfo", m_toneMappingInfoSEIEnabled, false, "Control generation of Tone Mapping SEI messages") |
---|
| 672 | ("SEIToneMapId", m_toneMapId, 0, "Specifies Id of Tone Mapping SEI message for a given session") |
---|
| 673 | ("SEIToneMapCancelFlag", m_toneMapCancelFlag, false, "Indicates that Tone Mapping SEI message cancels the persistance or follows") |
---|
| 674 | ("SEIToneMapPersistenceFlag", m_toneMapPersistenceFlag, true, "Specifies the persistence of the Tone Mapping SEI message") |
---|
| 675 | ("SEIToneMapCodedDataBitDepth", m_toneMapCodedDataBitDepth, 8, "Specifies Coded Data BitDepth of Tone Mapping SEI messages") |
---|
| 676 | ("SEIToneMapTargetBitDepth", m_toneMapTargetBitDepth, 8, "Specifies Output BitDepth of Tome mapping function") |
---|
| 677 | ("SEIToneMapModelId", m_toneMapModelId, 0, "Specifies Model utilized for mapping coded data into target_bit_depth range\n" |
---|
| 678 | "\t0: linear mapping with clipping\n" |
---|
| 679 | "\t1: sigmoidal mapping\n" |
---|
| 680 | "\t2: user-defined table mapping\n" |
---|
| 681 | "\t3: piece-wise linear mapping\n" |
---|
| 682 | "\t4: luminance dynamic range information ") |
---|
| 683 | ("SEIToneMapMinValue", m_toneMapMinValue, 0, "Specifies the minimum value in mode 0") |
---|
| 684 | ("SEIToneMapMaxValue", m_toneMapMaxValue, 1023, "Specifies the maxmum value in mode 0") |
---|
| 685 | ("SEIToneMapSigmoidMidpoint", m_sigmoidMidpoint, 512, "Specifies the centre point in mode 1") |
---|
| 686 | ("SEIToneMapSigmoidWidth", m_sigmoidWidth, 960, "Specifies the distance between 5% and 95% values of the target_bit_depth in mode 1") |
---|
| 687 | ("SEIToneMapStartOfCodedInterval", cfg_startOfCodedInterval, string(""), "Array of user-defined mapping table") |
---|
| 688 | ("SEIToneMapNumPivots", m_numPivots, 0, "Specifies the number of pivot points in mode 3") |
---|
| 689 | ("SEIToneMapCodedPivotValue", cfg_codedPivotValue, string(""), "Array of pivot point") |
---|
| 690 | ("SEIToneMapTargetPivotValue", cfg_targetPivotValue, string(""), "Array of pivot point") |
---|
| 691 | ("SEIToneMapCameraIsoSpeedIdc", m_cameraIsoSpeedIdc, 0, "Indicates the camera ISO speed for daylight illumination") |
---|
| 692 | ("SEIToneMapCameraIsoSpeedValue", m_cameraIsoSpeedValue, 400, "Specifies the camera ISO speed for daylight illumination of Extended_ISO") |
---|
| 693 | ("SEIToneMapExposureCompensationValueSignFlag", m_exposureCompensationValueSignFlag, 0, "Specifies the sign of ExposureCompensationValue") |
---|
| 694 | ("SEIToneMapExposureCompensationValueNumerator", m_exposureCompensationValueNumerator, 0, "Specifies the numerator of ExposureCompensationValue") |
---|
| 695 | ("SEIToneMapExposureCompensationValueDenomIdc", m_exposureCompensationValueDenomIdc, 2, "Specifies the denominator of ExposureCompensationValue") |
---|
| 696 | ("SEIToneMapRefScreenLuminanceWhite", m_refScreenLuminanceWhite, 350, "Specifies reference screen brightness setting in units of candela per square metre") |
---|
| 697 | ("SEIToneMapExtendedRangeWhiteLevel", m_extendedRangeWhiteLevel, 800, "Indicates the luminance dynamic range") |
---|
| 698 | ("SEIToneMapNominalBlackLevelLumaCodeValue", m_nominalBlackLevelLumaCodeValue, 16, "Specifies luma sample value of the nominal black level assigned decoded pictures") |
---|
| 699 | ("SEIToneMapNominalWhiteLevelLumaCodeValue", m_nominalWhiteLevelLumaCodeValue, 235, "Specifies luma sample value of the nominal white level assigned decoded pictures") |
---|
| 700 | ("SEIToneMapExtendedWhiteLevelLumaCodeValue", m_extendedWhiteLevelLumaCodeValue, 300, "Specifies luma sample value of the extended dynamic range assigned decoded pictures") |
---|
| 701 | #endif |
---|
[125] | 702 | ("SEIFramePacking", m_framePackingSEIEnabled, 0, "Control generation of frame packing SEI messages") |
---|
| 703 | ("SEIFramePackingType", m_framePackingSEIType, 0, "Define frame packing arrangement\n" |
---|
| 704 | "\t0: checkerboard - pixels alternatively represent either frames\n" |
---|
| 705 | "\t1: column alternation - frames are interlaced by column\n" |
---|
| 706 | "\t2: row alternation - frames are interlaced by row\n" |
---|
| 707 | "\t3: side by side - frames are displayed horizontally\n" |
---|
| 708 | "\t4: top bottom - frames are displayed vertically\n" |
---|
| 709 | "\t5: frame alternation - one frame is alternated with the other") |
---|
| 710 | ("SEIFramePackingId", m_framePackingSEIId, 0, "Id of frame packing SEI message for a given session") |
---|
| 711 | ("SEIFramePackingQuincunx", m_framePackingSEIQuincunx, 0, "Indicate the presence of a Quincunx type video frame") |
---|
| 712 | ("SEIFramePackingInterpretation", m_framePackingSEIInterpretation, 0, "Indicate the interpretation of the frame pair\n" |
---|
| 713 | "\t0: unspecified\n" |
---|
| 714 | "\t1: stereo pair, frame0 represents left view\n" |
---|
| 715 | "\t2: stereo pair, frame0 represents right view") |
---|
| 716 | ("SEIDisplayOrientation", m_displayOrientationSEIAngle, 0, "Control generation of display orientation SEI messages\n" |
---|
| 717 | "\tN: 0 < N < (2^16 - 1) enable display orientation SEI message with anticlockwise_rotation = N and display_orientation_repetition_period = 1\n" |
---|
| 718 | "\t0: disable") |
---|
| 719 | ("SEITemporalLevel0Index", m_temporalLevel0IndexSEIEnabled, 0, "Control generation of temporal level 0 index SEI messages") |
---|
| 720 | ("SEIGradualDecodingRefreshInfo", m_gradualDecodingRefreshInfoEnabled, 0, "Control generation of gradual decoding refresh information SEI message") |
---|
| 721 | ("SEIDecodingUnitInfo", m_decodingUnitInfoSEIEnabled, 0, "Control generation of decoding unit information SEI message.") |
---|
[133] | 722 | #if L0208_SOP_DESCRIPTION_SEI |
---|
| 723 | ("SEISOPDescription", m_SOPDescriptionSEIEnabled, 0, "Control generation of SOP description SEI messages") |
---|
| 724 | #endif |
---|
| 725 | #if K0180_SCALABLE_NESTING_SEI |
---|
| 726 | ("SEIScalableNesting", m_scalableNestingSEIEnabled, 0, "Control generation of scalable nesting SEI messages") |
---|
| 727 | #endif |
---|
[125] | 728 | #if SIGNAL_BITRATE_PICRATE_IN_VPS |
---|
| 729 | ("BitRatePicRateMaxTLayers", m_bitRatePicRateMaxTLayers, 0, "Maximum number of sub-layers signalled; can be inferred otherwise; here for easy parsing of config. file") |
---|
| 730 | ("BitRateInfoPresent", cfg_bitRateInfoPresentFlag, string(""), "Control signalling of bit rate information of avg. bit rate and max. bit rate in VPS\n" |
---|
| 731 | "\t0: Do not sent bit rate info\n" |
---|
| 732 | "\tN (N > 0): Send bit rate info for N sub-layers. N should equal maxTempLayers.") |
---|
| 733 | ("PicRateInfoPresent", cfg_picRateInfoPresentFlag, string(""), "Control signalling of picture rate information of avg. bit rate and max. bit rate in VPS\n" |
---|
| 734 | "\t0: Do not sent picture rate info\n" |
---|
| 735 | "\tN (N > 0): Send picture rate info for N sub-layers. N should equal maxTempLayers.") |
---|
| 736 | ("AvgBitRate", cfg_avgBitRate, string(""), "List of avg. bit rates for the different sub-layers; include non-negative number even if corresponding flag is 0") |
---|
| 737 | ("MaxBitRate", cfg_maxBitRate, string(""), "List of max. bit rates for the different sub-layers; include non-negative number even if corresponding flag is 0") |
---|
| 738 | ("AvgPicRate", cfg_avgPicRate, string(""), "List of avg. picture rates for the different sub-layers; include non-negative number even if corresponding flag is 0") |
---|
| 739 | ("ConstantPicRateIdc", cfg_constantPicRateIdc, string(""), "List of constant picture rate IDCs; include non-negative number even if corresponding flag is 0") |
---|
| 740 | #endif |
---|
| 741 | ; |
---|
| 742 | |
---|
[154] | 743 | #if AVC_BASE |
---|
| 744 | if( m_avcBaseLayerFlag ) |
---|
| 745 | { |
---|
| 746 | *cfg_InputFile[0] = cfg_BLInputFile; |
---|
| 747 | } |
---|
| 748 | #endif |
---|
| 749 | |
---|
[125] | 750 | for(Int i=1; i<MAX_GOP+1; i++) { |
---|
| 751 | std::ostringstream cOSS; |
---|
| 752 | cOSS<<"Frame"<<i; |
---|
| 753 | opts.addOptions()(cOSS.str(), m_GOPList[i-1], GOPEntry()); |
---|
| 754 | } |
---|
| 755 | po::setDefaults(opts); |
---|
| 756 | const list<const Char*>& argv_unhandled = po::scanArgv(opts, argc, (const Char**) argv); |
---|
| 757 | |
---|
| 758 | for (list<const Char*>::const_iterator it = argv_unhandled.begin(); it != argv_unhandled.end(); it++) |
---|
| 759 | { |
---|
| 760 | fprintf(stderr, "Unhandled argument ignored: `%s'\n", *it); |
---|
| 761 | } |
---|
| 762 | |
---|
| 763 | if (argc == 1 || do_help) |
---|
| 764 | { |
---|
| 765 | /* argc == 1: no options have been specified */ |
---|
| 766 | po::doHelp(cout, opts); |
---|
| 767 | return false; |
---|
| 768 | } |
---|
| 769 | |
---|
| 770 | /* |
---|
| 771 | * Set any derived parameters |
---|
| 772 | */ |
---|
| 773 | /* convert std::string to c string for compatability */ |
---|
| 774 | #if SVC_EXTENSION |
---|
| 775 | m_pBitstreamFile = cfg_BitstreamFile.empty() ? NULL : strdup(cfg_BitstreamFile.c_str()); |
---|
| 776 | #if AVC_SYNTAX |
---|
| 777 | m_BLSyntaxFile = cfg_BLSyntaxFile.empty() ? NULL : strdup(cfg_BLSyntaxFile.c_str()); |
---|
| 778 | #endif |
---|
| 779 | #else |
---|
| 780 | m_pchInputFile = cfg_InputFile.empty() ? NULL : strdup(cfg_InputFile.c_str()); |
---|
| 781 | m_pchBitstreamFile = cfg_BitstreamFile.empty() ? NULL : strdup(cfg_BitstreamFile.c_str()); |
---|
| 782 | m_pchReconFile = cfg_ReconFile.empty() ? NULL : strdup(cfg_ReconFile.c_str()); |
---|
| 783 | m_pchdQPFile = cfg_dQPFile.empty() ? NULL : strdup(cfg_dQPFile.c_str()); |
---|
| 784 | #endif |
---|
| 785 | |
---|
| 786 | Char* pColumnWidth = cfg_ColumnWidth.empty() ? NULL: strdup(cfg_ColumnWidth.c_str()); |
---|
| 787 | Char* pRowHeight = cfg_RowHeight.empty() ? NULL : strdup(cfg_RowHeight.c_str()); |
---|
| 788 | if( m_iUniformSpacingIdr == 0 && m_iNumColumnsMinus1 > 0 ) |
---|
| 789 | { |
---|
| 790 | char *columnWidth; |
---|
| 791 | int i=0; |
---|
| 792 | m_pColumnWidth = new UInt[m_iNumColumnsMinus1]; |
---|
| 793 | columnWidth = strtok(pColumnWidth, " ,-"); |
---|
| 794 | while(columnWidth!=NULL) |
---|
| 795 | { |
---|
| 796 | if( i>=m_iNumColumnsMinus1 ) |
---|
| 797 | { |
---|
| 798 | printf( "The number of columns whose width are defined is larger than the allowed number of columns.\n" ); |
---|
| 799 | exit( EXIT_FAILURE ); |
---|
| 800 | } |
---|
| 801 | *( m_pColumnWidth + i ) = atoi( columnWidth ); |
---|
| 802 | columnWidth = strtok(NULL, " ,-"); |
---|
| 803 | i++; |
---|
| 804 | } |
---|
| 805 | if( i<m_iNumColumnsMinus1 ) |
---|
| 806 | { |
---|
| 807 | printf( "The width of some columns is not defined.\n" ); |
---|
| 808 | exit( EXIT_FAILURE ); |
---|
| 809 | } |
---|
| 810 | } |
---|
| 811 | else |
---|
| 812 | { |
---|
| 813 | m_pColumnWidth = NULL; |
---|
| 814 | } |
---|
| 815 | |
---|
| 816 | if( m_iUniformSpacingIdr == 0 && m_iNumRowsMinus1 > 0 ) |
---|
| 817 | { |
---|
| 818 | char *rowHeight; |
---|
| 819 | int i=0; |
---|
| 820 | m_pRowHeight = new UInt[m_iNumRowsMinus1]; |
---|
| 821 | rowHeight = strtok(pRowHeight, " ,-"); |
---|
| 822 | while(rowHeight!=NULL) |
---|
| 823 | { |
---|
| 824 | if( i>=m_iNumRowsMinus1 ) |
---|
| 825 | { |
---|
| 826 | printf( "The number of rows whose height are defined is larger than the allowed number of rows.\n" ); |
---|
| 827 | exit( EXIT_FAILURE ); |
---|
| 828 | } |
---|
| 829 | *( m_pRowHeight + i ) = atoi( rowHeight ); |
---|
| 830 | rowHeight = strtok(NULL, " ,-"); |
---|
| 831 | i++; |
---|
| 832 | } |
---|
| 833 | if( i<m_iNumRowsMinus1 ) |
---|
| 834 | { |
---|
| 835 | printf( "The height of some rows is not defined.\n" ); |
---|
| 836 | exit( EXIT_FAILURE ); |
---|
| 837 | } |
---|
| 838 | } |
---|
| 839 | else |
---|
| 840 | { |
---|
| 841 | m_pRowHeight = NULL; |
---|
| 842 | } |
---|
[133] | 843 | #if VPS_EXTN_DIRECT_REF_LAYERS |
---|
| 844 | for(Int layer = 0; layer < MAX_LAYERS; layer++) |
---|
| 845 | { |
---|
[125] | 846 | Char* pRefLayerIds = cfg_refLayerIds[layer].empty() ? NULL: strdup(cfg_refLayerIds[layer].c_str()); |
---|
| 847 | if( m_acLayerCfg[layer].m_numDirectRefLayers > 0 ) |
---|
| 848 | { |
---|
| 849 | char *refLayerId; |
---|
| 850 | int i=0; |
---|
| 851 | m_acLayerCfg[layer].m_refLayerIds = new Int[m_acLayerCfg[layer].m_numDirectRefLayers]; |
---|
| 852 | refLayerId = strtok(pRefLayerIds, " ,-"); |
---|
| 853 | while(refLayerId != NULL) |
---|
| 854 | { |
---|
| 855 | if( i >= m_acLayerCfg[layer].m_numDirectRefLayers ) |
---|
| 856 | { |
---|
| 857 | printf( "The number of columns whose width are defined is larger than the allowed number of columns.\n" ); |
---|
| 858 | exit( EXIT_FAILURE ); |
---|
| 859 | } |
---|
| 860 | *( m_acLayerCfg[layer].m_refLayerIds + i ) = atoi( refLayerId ); |
---|
| 861 | refLayerId = strtok(NULL, " ,-"); |
---|
| 862 | i++; |
---|
| 863 | } |
---|
| 864 | if( i < m_acLayerCfg[layer].m_numDirectRefLayers ) |
---|
| 865 | { |
---|
| 866 | printf( "The width of some columns is not defined.\n" ); |
---|
| 867 | exit( EXIT_FAILURE ); |
---|
| 868 | } |
---|
| 869 | } |
---|
| 870 | else |
---|
| 871 | { |
---|
| 872 | m_acLayerCfg[layer].m_refLayerIds = NULL; |
---|
| 873 | } |
---|
[133] | 874 | } |
---|
[125] | 875 | #endif |
---|
| 876 | #if SIGNAL_BITRATE_PICRATE_IN_VPS |
---|
| 877 | readBoolString(cfg_bitRateInfoPresentFlag, m_bitRatePicRateMaxTLayers, m_bitRateInfoPresentFlag, "bit rate info. present flag" ); |
---|
| 878 | readIntString (cfg_avgBitRate, m_bitRatePicRateMaxTLayers, m_avgBitRate, "avg. bit rate" ); |
---|
| 879 | readIntString (cfg_maxBitRate, m_bitRatePicRateMaxTLayers, m_maxBitRate, "max. bit rate" ); |
---|
| 880 | readBoolString(cfg_picRateInfoPresentFlag, m_bitRatePicRateMaxTLayers, m_picRateInfoPresentFlag, "bit rate info. present flag" ); |
---|
| 881 | readIntString (cfg_avgPicRate, m_bitRatePicRateMaxTLayers, m_avgPicRate, "avg. pic rate" ); |
---|
| 882 | readIntString (cfg_constantPicRateIdc, m_bitRatePicRateMaxTLayers, m_constantPicRateIdc, "constant pic rate Idc" ); |
---|
| 883 | #endif |
---|
| 884 | m_scalingListFile = cfg_ScalingListFile.empty() ? NULL : strdup(cfg_ScalingListFile.c_str()); |
---|
| 885 | |
---|
| 886 | /* rules for input, output and internal bitdepths as per help text */ |
---|
| 887 | if (!m_internalBitDepthY) { m_internalBitDepthY = m_inputBitDepthY; } |
---|
| 888 | if (!m_internalBitDepthC) { m_internalBitDepthC = m_internalBitDepthY; } |
---|
| 889 | if (!m_inputBitDepthC) { m_inputBitDepthC = m_inputBitDepthY; } |
---|
| 890 | if (!m_outputBitDepthY) { m_outputBitDepthY = m_internalBitDepthY; } |
---|
| 891 | if (!m_outputBitDepthC) { m_outputBitDepthC = m_internalBitDepthC; } |
---|
| 892 | |
---|
| 893 | #if !SVC_EXTENSION |
---|
| 894 | // TODO:ChromaFmt assumes 4:2:0 below |
---|
| 895 | switch (m_conformanceMode) |
---|
| 896 | { |
---|
| 897 | case 0: |
---|
| 898 | { |
---|
| 899 | // no conformance or padding |
---|
| 900 | m_confLeft = m_confRight = m_confTop = m_confBottom = 0; |
---|
| 901 | m_aiPad[1] = m_aiPad[0] = 0; |
---|
| 902 | break; |
---|
| 903 | } |
---|
| 904 | case 1: |
---|
| 905 | { |
---|
| 906 | // automatic padding to minimum CU size |
---|
| 907 | Int minCuSize = m_uiMaxCUHeight >> (m_uiMaxCUDepth - 1); |
---|
| 908 | if (m_iSourceWidth % minCuSize) |
---|
| 909 | { |
---|
| 910 | m_aiPad[0] = m_confRight = ((m_iSourceWidth / minCuSize) + 1) * minCuSize - m_iSourceWidth; |
---|
| 911 | m_iSourceWidth += m_confRight; |
---|
| 912 | } |
---|
| 913 | if (m_iSourceHeight % minCuSize) |
---|
| 914 | { |
---|
| 915 | m_aiPad[1] = m_confBottom = ((m_iSourceHeight / minCuSize) + 1) * minCuSize - m_iSourceHeight; |
---|
| 916 | m_iSourceHeight += m_confBottom; |
---|
| 917 | } |
---|
| 918 | if (m_aiPad[0] % TComSPS::getWinUnitX(CHROMA_420) != 0) |
---|
| 919 | { |
---|
| 920 | fprintf(stderr, "Error: picture width is not an integer multiple of the specified chroma subsampling\n"); |
---|
| 921 | exit(EXIT_FAILURE); |
---|
| 922 | } |
---|
| 923 | if (m_aiPad[1] % TComSPS::getWinUnitY(CHROMA_420) != 0) |
---|
| 924 | { |
---|
| 925 | fprintf(stderr, "Error: picture height is not an integer multiple of the specified chroma subsampling\n"); |
---|
| 926 | exit(EXIT_FAILURE); |
---|
| 927 | } |
---|
| 928 | break; |
---|
| 929 | } |
---|
| 930 | case 2: |
---|
| 931 | { |
---|
| 932 | //padding |
---|
| 933 | m_iSourceWidth += m_aiPad[0]; |
---|
| 934 | m_iSourceHeight += m_aiPad[1]; |
---|
| 935 | m_confRight = m_aiPad[0]; |
---|
| 936 | m_confBottom = m_aiPad[1]; |
---|
| 937 | break; |
---|
| 938 | } |
---|
| 939 | case 3: |
---|
| 940 | { |
---|
| 941 | // conformance |
---|
| 942 | if ((m_confLeft == 0) && (m_confRight == 0) && (m_confTop == 0) && (m_confBottom == 0)) |
---|
| 943 | { |
---|
| 944 | fprintf(stderr, "Warning: Conformance window enabled, but all conformance window parameters set to zero\n"); |
---|
| 945 | } |
---|
| 946 | if ((m_aiPad[1] != 0) || (m_aiPad[0]!=0)) |
---|
| 947 | { |
---|
| 948 | fprintf(stderr, "Warning: Conformance window enabled, padding parameters will be ignored\n"); |
---|
| 949 | } |
---|
| 950 | m_aiPad[1] = m_aiPad[0] = 0; |
---|
| 951 | break; |
---|
| 952 | } |
---|
| 953 | } |
---|
| 954 | |
---|
| 955 | // allocate slice-based dQP values |
---|
| 956 | m_aidQP = new Int[ m_framesToBeEncoded + m_iGOPSize + 1 ]; |
---|
| 957 | ::memset( m_aidQP, 0, sizeof(Int)*( m_framesToBeEncoded + m_iGOPSize + 1 ) ); |
---|
| 958 | |
---|
| 959 | // handling of floating-point QP values |
---|
| 960 | // if QP is not integer, sequence is split into two sections having QP and QP+1 |
---|
| 961 | m_iQP = (Int)( m_fQP ); |
---|
| 962 | if ( m_iQP < m_fQP ) |
---|
| 963 | { |
---|
| 964 | Int iSwitchPOC = (Int)( m_framesToBeEncoded - (m_fQP - m_iQP)*m_framesToBeEncoded + 0.5 ); |
---|
| 965 | |
---|
| 966 | iSwitchPOC = (Int)( (Double)iSwitchPOC / m_iGOPSize + 0.5 )*m_iGOPSize; |
---|
| 967 | for ( Int i=iSwitchPOC; i<m_framesToBeEncoded + m_iGOPSize + 1; i++ ) |
---|
| 968 | { |
---|
| 969 | m_aidQP[i] = 1; |
---|
| 970 | } |
---|
| 971 | } |
---|
| 972 | |
---|
| 973 | // reading external dQP description from file |
---|
| 974 | if ( m_pchdQPFile ) |
---|
| 975 | { |
---|
| 976 | FILE* fpt=fopen( m_pchdQPFile, "r" ); |
---|
| 977 | if ( fpt ) |
---|
| 978 | { |
---|
| 979 | Int iValue; |
---|
| 980 | Int iPOC = 0; |
---|
| 981 | while ( iPOC < m_framesToBeEncoded ) |
---|
| 982 | { |
---|
| 983 | if ( fscanf(fpt, "%d", &iValue ) == EOF ) break; |
---|
| 984 | m_aidQP[ iPOC ] = iValue; |
---|
| 985 | iPOC++; |
---|
| 986 | } |
---|
| 987 | fclose(fpt); |
---|
| 988 | } |
---|
| 989 | } |
---|
| 990 | m_iWaveFrontSubstreams = m_iWaveFrontSynchro ? (m_iSourceHeight + m_uiMaxCUHeight - 1) / m_uiMaxCUHeight : 1; |
---|
| 991 | #endif |
---|
[133] | 992 | #if J0149_TONE_MAPPING_SEI |
---|
| 993 | if( m_toneMappingInfoSEIEnabled && !m_toneMapCancelFlag ) |
---|
| 994 | { |
---|
| 995 | Char* pcStartOfCodedInterval = cfg_startOfCodedInterval.empty() ? NULL: strdup(cfg_startOfCodedInterval.c_str()); |
---|
| 996 | Char* pcCodedPivotValue = cfg_codedPivotValue.empty() ? NULL: strdup(cfg_codedPivotValue.c_str()); |
---|
| 997 | Char* pcTargetPivotValue = cfg_targetPivotValue.empty() ? NULL: strdup(cfg_targetPivotValue.c_str()); |
---|
| 998 | if( m_toneMapModelId == 2 && pcStartOfCodedInterval ) |
---|
| 999 | { |
---|
| 1000 | char *startOfCodedInterval; |
---|
| 1001 | UInt num = 1u<< m_toneMapTargetBitDepth; |
---|
| 1002 | m_startOfCodedInterval = new Int[num]; |
---|
| 1003 | ::memset( m_startOfCodedInterval, 0, sizeof(Int)*num ); |
---|
| 1004 | startOfCodedInterval = strtok(pcStartOfCodedInterval, " ."); |
---|
| 1005 | int i = 0; |
---|
| 1006 | while( startOfCodedInterval && ( i < num ) ) |
---|
| 1007 | { |
---|
| 1008 | m_startOfCodedInterval[i] = atoi( startOfCodedInterval ); |
---|
| 1009 | startOfCodedInterval = strtok(NULL, " ."); |
---|
| 1010 | i++; |
---|
| 1011 | } |
---|
| 1012 | } |
---|
| 1013 | else |
---|
| 1014 | { |
---|
| 1015 | m_startOfCodedInterval = NULL; |
---|
| 1016 | } |
---|
| 1017 | if( ( m_toneMapModelId == 3 ) && ( m_numPivots > 0 ) ) |
---|
| 1018 | { |
---|
| 1019 | if( pcCodedPivotValue && pcTargetPivotValue ) |
---|
| 1020 | { |
---|
| 1021 | char *codedPivotValue; |
---|
| 1022 | char *targetPivotValue; |
---|
| 1023 | m_codedPivotValue = new Int[m_numPivots]; |
---|
| 1024 | m_targetPivotValue = new Int[m_numPivots]; |
---|
| 1025 | ::memset( m_codedPivotValue, 0, sizeof(Int)*( m_numPivots ) ); |
---|
| 1026 | ::memset( m_targetPivotValue, 0, sizeof(Int)*( m_numPivots ) ); |
---|
| 1027 | codedPivotValue = strtok(pcCodedPivotValue, " ."); |
---|
| 1028 | int i=0; |
---|
| 1029 | while(codedPivotValue&&i<m_numPivots) |
---|
| 1030 | { |
---|
| 1031 | m_codedPivotValue[i] = atoi( codedPivotValue ); |
---|
| 1032 | codedPivotValue = strtok(NULL, " ."); |
---|
| 1033 | i++; |
---|
| 1034 | } |
---|
| 1035 | i=0; |
---|
| 1036 | targetPivotValue = strtok(pcTargetPivotValue, " ."); |
---|
| 1037 | while(targetPivotValue&&i<m_numPivots) |
---|
| 1038 | { |
---|
| 1039 | m_targetPivotValue[i]= atoi( targetPivotValue ); |
---|
| 1040 | targetPivotValue = strtok(NULL, " ."); |
---|
| 1041 | i++; |
---|
| 1042 | } |
---|
| 1043 | } |
---|
| 1044 | } |
---|
| 1045 | else |
---|
| 1046 | { |
---|
| 1047 | m_codedPivotValue = NULL; |
---|
| 1048 | m_targetPivotValue = NULL; |
---|
| 1049 | } |
---|
| 1050 | } |
---|
| 1051 | #endif |
---|
[125] | 1052 | // check validity of input parameters |
---|
| 1053 | xCheckParameter(); |
---|
| 1054 | |
---|
| 1055 | // set global varibles |
---|
| 1056 | xSetGlobal(); |
---|
| 1057 | |
---|
| 1058 | // print-out parameters |
---|
| 1059 | xPrintParameter(); |
---|
| 1060 | |
---|
| 1061 | return true; |
---|
| 1062 | } |
---|
| 1063 | #if SIGNAL_BITRATE_PICRATE_IN_VPS |
---|
| 1064 | Void readBoolString(const string inpString, const Int numEntries, Bool* &memberArray, const char *elementName) |
---|
| 1065 | { |
---|
| 1066 | Char* inpArray = inpString.empty() ? NULL : strdup(inpString.c_str()); |
---|
| 1067 | Int i = 0; |
---|
| 1068 | if(numEntries) |
---|
| 1069 | { |
---|
| 1070 | Char* tempArray = strtok(inpArray, " ,-"); |
---|
| 1071 | memberArray = new Bool[numEntries]; |
---|
| 1072 | while( tempArray != NULL ) |
---|
| 1073 | { |
---|
| 1074 | if( i >= numEntries ) |
---|
| 1075 | { |
---|
| 1076 | printf( "The number of %s defined is larger than the allowed number\n", elementName ); |
---|
| 1077 | exit( EXIT_FAILURE ); |
---|
| 1078 | } |
---|
| 1079 | assert( (atoi(tempArray) == 0) || (atoi(tempArray) == 1) ); |
---|
| 1080 | *( memberArray + i ) = atoi(tempArray); |
---|
| 1081 | tempArray = strtok(NULL, " ,-"); |
---|
| 1082 | i++; |
---|
| 1083 | } |
---|
| 1084 | if( i < numEntries ) |
---|
| 1085 | { |
---|
| 1086 | printf( "Some %s are not defined\n", elementName ); |
---|
| 1087 | exit( EXIT_FAILURE ); |
---|
| 1088 | } |
---|
| 1089 | } |
---|
| 1090 | else |
---|
| 1091 | { |
---|
| 1092 | memberArray = NULL; |
---|
| 1093 | } |
---|
| 1094 | } |
---|
| 1095 | |
---|
| 1096 | Void readIntString(const string inpString, const Int numEntries, Int* &memberArray, const char *elementName) |
---|
| 1097 | { |
---|
| 1098 | Char* inpArray = inpString.empty() ? NULL : strdup(inpString.c_str()); |
---|
| 1099 | Int i = 0; |
---|
| 1100 | if(numEntries) |
---|
| 1101 | { |
---|
| 1102 | Char* tempArray = strtok(inpArray, " ,-"); |
---|
| 1103 | memberArray = new Int[numEntries]; |
---|
| 1104 | while( tempArray != NULL ) |
---|
| 1105 | { |
---|
| 1106 | if( i >= numEntries ) |
---|
| 1107 | { |
---|
| 1108 | printf( "The number of %s defined is larger than the allowed number\n", elementName ); |
---|
| 1109 | exit( EXIT_FAILURE ); |
---|
| 1110 | } |
---|
| 1111 | *( memberArray + i ) = atoi(tempArray); |
---|
| 1112 | tempArray = strtok(NULL, " ,-"); |
---|
| 1113 | i++; |
---|
| 1114 | } |
---|
| 1115 | if( i < numEntries ) |
---|
| 1116 | { |
---|
| 1117 | printf( "Some %s are not defined\n", elementName ); |
---|
| 1118 | exit( EXIT_FAILURE ); |
---|
| 1119 | } |
---|
| 1120 | } |
---|
| 1121 | else |
---|
| 1122 | { |
---|
| 1123 | memberArray = NULL; |
---|
| 1124 | } |
---|
| 1125 | } |
---|
| 1126 | #endif |
---|
| 1127 | // ==================================================================================================================== |
---|
| 1128 | // Private member functions |
---|
| 1129 | // ==================================================================================================================== |
---|
| 1130 | |
---|
| 1131 | Bool confirmPara(Bool bflag, const Char* message); |
---|
| 1132 | |
---|
| 1133 | Void TAppEncCfg::xCheckParameter() |
---|
| 1134 | { |
---|
| 1135 | if (!m_decodedPictureHashSEIEnabled) |
---|
| 1136 | { |
---|
| 1137 | fprintf(stderr, "******************************************************************\n"); |
---|
| 1138 | fprintf(stderr, "** WARNING: --SEIDecodedPictureHash is now disabled by default. **\n"); |
---|
| 1139 | fprintf(stderr, "** Automatic verification of decoded pictures by a **\n"); |
---|
| 1140 | fprintf(stderr, "** decoder requires this option to be enabled. **\n"); |
---|
| 1141 | fprintf(stderr, "******************************************************************\n"); |
---|
| 1142 | } |
---|
| 1143 | |
---|
| 1144 | Bool check_failed = false; /* abort if there is a fatal configuration problem */ |
---|
| 1145 | #define xConfirmPara(a,b) check_failed |= confirmPara(a,b) |
---|
| 1146 | // check range of parameters |
---|
| 1147 | xConfirmPara( m_inputBitDepthY < 8, "InputBitDepth must be at least 8" ); |
---|
| 1148 | xConfirmPara( m_inputBitDepthC < 8, "InputBitDepthC must be at least 8" ); |
---|
| 1149 | #if !SVC_EXTENSION |
---|
| 1150 | xConfirmPara( m_iFrameRate <= 0, "Frame rate must be more than 1" ); |
---|
| 1151 | #endif |
---|
| 1152 | xConfirmPara( m_framesToBeEncoded <= 0, "Total Number Of Frames encoded must be more than 0" ); |
---|
| 1153 | xConfirmPara( m_iGOPSize < 1 , "GOP Size must be greater or equal to 1" ); |
---|
| 1154 | xConfirmPara( m_iGOPSize > 1 && m_iGOPSize % 2, "GOP Size must be a multiple of 2, if GOP Size is greater than 1" ); |
---|
| 1155 | #if !SVC_EXTENSION |
---|
| 1156 | xConfirmPara( (m_iIntraPeriod > 0 && m_iIntraPeriod < m_iGOPSize) || m_iIntraPeriod == 0, "Intra period must be more than GOP size, or -1 , not 0" ); |
---|
| 1157 | #endif |
---|
| 1158 | xConfirmPara( m_iDecodingRefreshType < 0 || m_iDecodingRefreshType > 2, "Decoding Refresh Type must be equal to 0, 1 or 2" ); |
---|
| 1159 | #if !SVC_EXTENSION |
---|
| 1160 | xConfirmPara( m_iQP < -6 * (m_internalBitDepthY - 8) || m_iQP > 51, "QP exceeds supported range (-QpBDOffsety to 51)" ); |
---|
| 1161 | #endif |
---|
| 1162 | xConfirmPara( m_loopFilterBetaOffsetDiv2 < -13 || m_loopFilterBetaOffsetDiv2 > 13, "Loop Filter Beta Offset div. 2 exceeds supported range (-13 to 13)"); |
---|
| 1163 | xConfirmPara( m_loopFilterTcOffsetDiv2 < -13 || m_loopFilterTcOffsetDiv2 > 13, "Loop Filter Tc Offset div. 2 exceeds supported range (-13 to 13)"); |
---|
| 1164 | xConfirmPara( m_iFastSearch < 0 || m_iFastSearch > 2, "Fast Search Mode is not supported value (0:Full search 1:Diamond 2:PMVFAST)" ); |
---|
| 1165 | xConfirmPara( m_iSearchRange < 0 , "Search Range must be more than 0" ); |
---|
| 1166 | xConfirmPara( m_bipredSearchRange < 0 , "Search Range must be more than 0" ); |
---|
| 1167 | xConfirmPara( m_iMaxDeltaQP > 7, "Absolute Delta QP exceeds supported range (0 to 7)" ); |
---|
| 1168 | xConfirmPara( m_iMaxCuDQPDepth > m_uiMaxCUDepth - 1, "Absolute depth for a minimum CuDQP exceeds maximum coding unit depth" ); |
---|
| 1169 | |
---|
| 1170 | xConfirmPara( m_cbQpOffset < -12, "Min. Chroma Cb QP Offset is -12" ); |
---|
| 1171 | xConfirmPara( m_cbQpOffset > 12, "Max. Chroma Cb QP Offset is 12" ); |
---|
| 1172 | xConfirmPara( m_crQpOffset < -12, "Min. Chroma Cr QP Offset is -12" ); |
---|
| 1173 | xConfirmPara( m_crQpOffset > 12, "Max. Chroma Cr QP Offset is 12" ); |
---|
| 1174 | |
---|
| 1175 | xConfirmPara( m_iQPAdaptationRange <= 0, "QP Adaptation Range must be more than 0" ); |
---|
| 1176 | #if !SVC_EXTENSION |
---|
| 1177 | if (m_iDecodingRefreshType == 2) |
---|
| 1178 | { |
---|
| 1179 | xConfirmPara( m_iIntraPeriod > 0 && m_iIntraPeriod <= m_iGOPSize , "Intra period must be larger than GOP size for periodic IDR pictures"); |
---|
| 1180 | } |
---|
| 1181 | #endif |
---|
| 1182 | xConfirmPara( (m_uiMaxCUWidth >> m_uiMaxCUDepth) < 4, "Minimum partition width size should be larger than or equal to 8"); |
---|
| 1183 | xConfirmPara( (m_uiMaxCUHeight >> m_uiMaxCUDepth) < 4, "Minimum partition height size should be larger than or equal to 8"); |
---|
| 1184 | xConfirmPara( m_uiMaxCUWidth < 16, "Maximum partition width size should be larger than or equal to 16"); |
---|
| 1185 | xConfirmPara( m_uiMaxCUHeight < 16, "Maximum partition height size should be larger than or equal to 16"); |
---|
| 1186 | #if !SVC_EXTENSION |
---|
| 1187 | xConfirmPara( (m_iSourceWidth % (m_uiMaxCUWidth >> (m_uiMaxCUDepth-1)))!=0, "Resulting coded frame width must be a multiple of the minimum CU size"); |
---|
| 1188 | xConfirmPara( (m_iSourceHeight % (m_uiMaxCUHeight >> (m_uiMaxCUDepth-1)))!=0, "Resulting coded frame height must be a multiple of the minimum CU size"); |
---|
| 1189 | #endif |
---|
| 1190 | |
---|
| 1191 | xConfirmPara( m_uiQuadtreeTULog2MinSize < 2, "QuadtreeTULog2MinSize must be 2 or greater."); |
---|
| 1192 | xConfirmPara( m_uiQuadtreeTULog2MaxSize > 5, "QuadtreeTULog2MaxSize must be 5 or smaller."); |
---|
| 1193 | xConfirmPara( (1<<m_uiQuadtreeTULog2MaxSize) > m_uiMaxCUWidth, "QuadtreeTULog2MaxSize must be log2(maxCUSize) or smaller."); |
---|
| 1194 | |
---|
| 1195 | xConfirmPara( m_uiQuadtreeTULog2MaxSize < m_uiQuadtreeTULog2MinSize, "QuadtreeTULog2MaxSize must be greater than or equal to m_uiQuadtreeTULog2MinSize."); |
---|
| 1196 | xConfirmPara( (1<<m_uiQuadtreeTULog2MinSize)>(m_uiMaxCUWidth >>(m_uiMaxCUDepth-1)), "QuadtreeTULog2MinSize must not be greater than minimum CU size" ); // HS |
---|
| 1197 | xConfirmPara( (1<<m_uiQuadtreeTULog2MinSize)>(m_uiMaxCUHeight>>(m_uiMaxCUDepth-1)), "QuadtreeTULog2MinSize must not be greater than minimum CU size" ); // HS |
---|
| 1198 | xConfirmPara( ( 1 << m_uiQuadtreeTULog2MinSize ) > ( m_uiMaxCUWidth >> m_uiMaxCUDepth ), "Minimum CU width must be greater than minimum transform size." ); |
---|
| 1199 | xConfirmPara( ( 1 << m_uiQuadtreeTULog2MinSize ) > ( m_uiMaxCUHeight >> m_uiMaxCUDepth ), "Minimum CU height must be greater than minimum transform size." ); |
---|
| 1200 | xConfirmPara( m_uiQuadtreeTUMaxDepthInter < 1, "QuadtreeTUMaxDepthInter must be greater than or equal to 1" ); |
---|
| 1201 | 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" ); |
---|
| 1202 | xConfirmPara( m_uiQuadtreeTUMaxDepthIntra < 1, "QuadtreeTUMaxDepthIntra must be greater than or equal to 1" ); |
---|
| 1203 | 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" ); |
---|
| 1204 | |
---|
| 1205 | xConfirmPara( m_maxNumMergeCand < 1, "MaxNumMergeCand must be 1 or greater."); |
---|
| 1206 | xConfirmPara( m_maxNumMergeCand > 5, "MaxNumMergeCand must be 5 or smaller."); |
---|
| 1207 | |
---|
| 1208 | #if !SVC_EXTENSION |
---|
| 1209 | #if ADAPTIVE_QP_SELECTION |
---|
| 1210 | xConfirmPara( m_bUseAdaptQpSelect == true && m_iQP < 0, "AdaptiveQpSelection must be disabled when QP < 0."); |
---|
| 1211 | xConfirmPara( m_bUseAdaptQpSelect == true && (m_cbQpOffset !=0 || m_crQpOffset != 0 ), "AdaptiveQpSelection must be disabled when ChromaQpOffset is not equal to 0."); |
---|
| 1212 | #endif |
---|
| 1213 | #endif |
---|
| 1214 | |
---|
| 1215 | if( m_usePCM) |
---|
| 1216 | { |
---|
| 1217 | xConfirmPara( m_uiPCMLog2MinSize < 3, "PCMLog2MinSize must be 3 or greater."); |
---|
| 1218 | xConfirmPara( m_uiPCMLog2MinSize > 5, "PCMLog2MinSize must be 5 or smaller."); |
---|
| 1219 | xConfirmPara( m_pcmLog2MaxSize > 5, "PCMLog2MaxSize must be 5 or smaller."); |
---|
| 1220 | xConfirmPara( m_pcmLog2MaxSize < m_uiPCMLog2MinSize, "PCMLog2MaxSize must be equal to or greater than m_uiPCMLog2MinSize."); |
---|
| 1221 | } |
---|
| 1222 | |
---|
| 1223 | xConfirmPara( m_sliceMode < 0 || m_sliceMode > 3, "SliceMode exceeds supported range (0 to 3)" ); |
---|
| 1224 | if (m_sliceMode!=0) |
---|
| 1225 | { |
---|
| 1226 | xConfirmPara( m_sliceArgument < 1 , "SliceArgument should be larger than or equal to 1" ); |
---|
| 1227 | } |
---|
| 1228 | xConfirmPara( m_sliceSegmentMode < 0 || m_sliceSegmentMode > 3, "SliceSegmentMode exceeds supported range (0 to 3)" ); |
---|
| 1229 | if (m_sliceSegmentMode!=0) |
---|
| 1230 | { |
---|
| 1231 | xConfirmPara( m_sliceSegmentArgument < 1 , "SliceSegmentArgument should be larger than or equal to 1" ); |
---|
| 1232 | } |
---|
| 1233 | |
---|
| 1234 | Bool tileFlag = (m_iNumColumnsMinus1 > 0 || m_iNumRowsMinus1 > 0 ); |
---|
| 1235 | xConfirmPara( tileFlag && m_iWaveFrontSynchro, "Tile and Wavefront can not be applied together"); |
---|
| 1236 | |
---|
| 1237 | //TODO:ChromaFmt assumes 4:2:0 below |
---|
| 1238 | #if !SVC_EXTENSION |
---|
| 1239 | xConfirmPara( m_iSourceWidth % TComSPS::getWinUnitX(CHROMA_420) != 0, "Picture width must be an integer multiple of the specified chroma subsampling"); |
---|
| 1240 | xConfirmPara( m_iSourceHeight % TComSPS::getWinUnitY(CHROMA_420) != 0, "Picture height must be an integer multiple of the specified chroma subsampling"); |
---|
| 1241 | |
---|
| 1242 | xConfirmPara( m_aiPad[0] % TComSPS::getWinUnitX(CHROMA_420) != 0, "Horizontal padding must be an integer multiple of the specified chroma subsampling"); |
---|
| 1243 | xConfirmPara( m_aiPad[1] % TComSPS::getWinUnitY(CHROMA_420) != 0, "Vertical padding must be an integer multiple of the specified chroma subsampling"); |
---|
| 1244 | |
---|
| 1245 | xConfirmPara( m_confLeft % TComSPS::getWinUnitX(CHROMA_420) != 0, "Left conformance window offset must be an integer multiple of the specified chroma subsampling"); |
---|
| 1246 | xConfirmPara( m_confRight % TComSPS::getWinUnitX(CHROMA_420) != 0, "Right conformance window offset must be an integer multiple of the specified chroma subsampling"); |
---|
| 1247 | xConfirmPara( m_confTop % TComSPS::getWinUnitY(CHROMA_420) != 0, "Top conformance window offset must be an integer multiple of the specified chroma subsampling"); |
---|
| 1248 | xConfirmPara( m_confBottom % TComSPS::getWinUnitY(CHROMA_420) != 0, "Bottom conformance window offset must be an integer multiple of the specified chroma subsampling"); |
---|
| 1249 | #endif |
---|
| 1250 | |
---|
| 1251 | // max CU width and height should be power of 2 |
---|
| 1252 | UInt ui = m_uiMaxCUWidth; |
---|
| 1253 | while(ui) |
---|
| 1254 | { |
---|
| 1255 | ui >>= 1; |
---|
| 1256 | if( (ui & 1) == 1) |
---|
| 1257 | xConfirmPara( ui != 1 , "Width should be 2^n"); |
---|
| 1258 | } |
---|
| 1259 | ui = m_uiMaxCUHeight; |
---|
| 1260 | while(ui) |
---|
| 1261 | { |
---|
| 1262 | ui >>= 1; |
---|
| 1263 | if( (ui & 1) == 1) |
---|
| 1264 | xConfirmPara( ui != 1 , "Height should be 2^n"); |
---|
| 1265 | } |
---|
| 1266 | |
---|
| 1267 | |
---|
| 1268 | /* if this is an intra-only sequence, ie IntraPeriod=1, don't verify the GOP structure |
---|
| 1269 | * This permits the ability to omit a GOP structure specification */ |
---|
| 1270 | #if SVC_EXTENSION |
---|
| 1271 | for(UInt layer = 0; layer < MAX_LAYERS; layer++) |
---|
| 1272 | { |
---|
| 1273 | Int m_iIntraPeriod = m_acLayerCfg[layer].m_iIntraPeriod; |
---|
| 1274 | #endif |
---|
| 1275 | if (m_iIntraPeriod == 1 && m_GOPList[0].m_POC == -1) { |
---|
| 1276 | m_GOPList[0] = GOPEntry(); |
---|
| 1277 | m_GOPList[0].m_QPFactor = 1; |
---|
| 1278 | m_GOPList[0].m_betaOffsetDiv2 = 0; |
---|
| 1279 | m_GOPList[0].m_tcOffsetDiv2 = 0; |
---|
| 1280 | m_GOPList[0].m_POC = 1; |
---|
| 1281 | m_GOPList[0].m_numRefPicsActive = 4; |
---|
| 1282 | } |
---|
| 1283 | #if SVC_EXTENSION |
---|
| 1284 | } |
---|
| 1285 | #endif |
---|
| 1286 | |
---|
| 1287 | Bool verifiedGOP=false; |
---|
| 1288 | Bool errorGOP=false; |
---|
| 1289 | Int checkGOP=1; |
---|
| 1290 | Int numRefs = 1; |
---|
| 1291 | Int refList[MAX_NUM_REF_PICS+1]; |
---|
| 1292 | refList[0]=0; |
---|
| 1293 | Bool isOK[MAX_GOP]; |
---|
| 1294 | for(Int i=0; i<MAX_GOP; i++) |
---|
| 1295 | { |
---|
| 1296 | isOK[i]=false; |
---|
| 1297 | } |
---|
| 1298 | Int numOK=0; |
---|
| 1299 | #if !SVC_EXTENSION |
---|
| 1300 | xConfirmPara( m_iIntraPeriod >=0&&(m_iIntraPeriod%m_iGOPSize!=0), "Intra period must be a multiple of GOPSize, or -1" ); |
---|
| 1301 | #endif |
---|
| 1302 | |
---|
| 1303 | for(Int i=0; i<m_iGOPSize; i++) |
---|
| 1304 | { |
---|
| 1305 | if(m_GOPList[i].m_POC==m_iGOPSize) |
---|
| 1306 | { |
---|
| 1307 | xConfirmPara( m_GOPList[i].m_temporalId!=0 , "The last frame in each GOP must have temporal ID = 0 " ); |
---|
| 1308 | } |
---|
| 1309 | } |
---|
| 1310 | |
---|
| 1311 | #if SVC_EXTENSION |
---|
[146] | 1312 | xConfirmPara( m_numLayers > MAX_LAYERS , "Number of layers in config file is greater than MAX_LAYERS" ); |
---|
[145] | 1313 | m_numLayers = m_numLayers > MAX_LAYERS ? MAX_LAYERS : m_numLayers; |
---|
| 1314 | |
---|
[125] | 1315 | // verify layer configuration parameters |
---|
| 1316 | for(UInt layer=0; layer<m_numLayers; layer++) |
---|
| 1317 | { |
---|
| 1318 | if(m_acLayerCfg[layer].xCheckParameter()) |
---|
| 1319 | { |
---|
| 1320 | printf("\nError: invalid configuration parameter found in layer %d \n", layer); |
---|
| 1321 | check_failed = true; |
---|
| 1322 | } |
---|
| 1323 | } |
---|
| 1324 | #endif |
---|
| 1325 | |
---|
| 1326 | #if SVC_EXTENSION |
---|
| 1327 | // verify layer configuration parameters |
---|
| 1328 | for(UInt layer=0; layer<m_numLayers; layer++) |
---|
| 1329 | { |
---|
| 1330 | Int m_iIntraPeriod = m_acLayerCfg[layer].m_iIntraPeriod; |
---|
| 1331 | #endif |
---|
| 1332 | if ( (m_iIntraPeriod != 1) && !m_loopFilterOffsetInPPS && m_DeblockingFilterControlPresent && (!m_bLoopFilterDisable) ) |
---|
| 1333 | { |
---|
| 1334 | for(Int i=0; i<m_iGOPSize; i++) |
---|
| 1335 | { |
---|
| 1336 | 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)" ); |
---|
| 1337 | 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)" ); |
---|
| 1338 | } |
---|
| 1339 | } |
---|
| 1340 | #if SVC_EXTENSION |
---|
| 1341 | } |
---|
| 1342 | #endif |
---|
| 1343 | |
---|
| 1344 | m_extraRPSs=0; |
---|
| 1345 | //start looping through frames in coding order until we can verify that the GOP structure is correct. |
---|
| 1346 | while(!verifiedGOP&&!errorGOP) |
---|
| 1347 | { |
---|
| 1348 | Int curGOP = (checkGOP-1)%m_iGOPSize; |
---|
| 1349 | Int curPOC = ((checkGOP-1)/m_iGOPSize)*m_iGOPSize + m_GOPList[curGOP].m_POC; |
---|
| 1350 | if(m_GOPList[curGOP].m_POC<0) |
---|
| 1351 | { |
---|
| 1352 | printf("\nError: found fewer Reference Picture Sets than GOPSize\n"); |
---|
| 1353 | errorGOP=true; |
---|
| 1354 | } |
---|
| 1355 | else |
---|
| 1356 | { |
---|
| 1357 | //check that all reference pictures are available, or have a POC < 0 meaning they might be available in the next GOP. |
---|
| 1358 | Bool beforeI = false; |
---|
| 1359 | for(Int i = 0; i< m_GOPList[curGOP].m_numRefPics; i++) |
---|
| 1360 | { |
---|
| 1361 | Int absPOC = curPOC+m_GOPList[curGOP].m_referencePics[i]; |
---|
| 1362 | if(absPOC < 0) |
---|
| 1363 | { |
---|
| 1364 | beforeI=true; |
---|
| 1365 | } |
---|
| 1366 | else |
---|
| 1367 | { |
---|
| 1368 | Bool found=false; |
---|
| 1369 | for(Int j=0; j<numRefs; j++) |
---|
| 1370 | { |
---|
| 1371 | if(refList[j]==absPOC) |
---|
| 1372 | { |
---|
| 1373 | found=true; |
---|
| 1374 | for(Int k=0; k<m_iGOPSize; k++) |
---|
| 1375 | { |
---|
| 1376 | if(absPOC%m_iGOPSize == m_GOPList[k].m_POC%m_iGOPSize) |
---|
| 1377 | { |
---|
| 1378 | if(m_GOPList[k].m_temporalId==m_GOPList[curGOP].m_temporalId) |
---|
| 1379 | { |
---|
| 1380 | m_GOPList[k].m_refPic = true; |
---|
| 1381 | } |
---|
| 1382 | m_GOPList[curGOP].m_usedByCurrPic[i]=m_GOPList[k].m_temporalId<=m_GOPList[curGOP].m_temporalId; |
---|
| 1383 | } |
---|
| 1384 | } |
---|
| 1385 | } |
---|
| 1386 | } |
---|
| 1387 | if(!found) |
---|
| 1388 | { |
---|
| 1389 | printf("\nError: ref pic %d is not available for GOP frame %d\n",m_GOPList[curGOP].m_referencePics[i],curGOP+1); |
---|
| 1390 | errorGOP=true; |
---|
| 1391 | } |
---|
| 1392 | } |
---|
| 1393 | } |
---|
| 1394 | if(!beforeI&&!errorGOP) |
---|
| 1395 | { |
---|
| 1396 | //all ref frames were present |
---|
| 1397 | if(!isOK[curGOP]) |
---|
| 1398 | { |
---|
| 1399 | numOK++; |
---|
| 1400 | isOK[curGOP]=true; |
---|
| 1401 | if(numOK==m_iGOPSize) |
---|
| 1402 | { |
---|
| 1403 | verifiedGOP=true; |
---|
| 1404 | } |
---|
| 1405 | } |
---|
| 1406 | } |
---|
| 1407 | else |
---|
| 1408 | { |
---|
| 1409 | //create a new GOPEntry for this frame containing all the reference pictures that were available (POC > 0) |
---|
| 1410 | m_GOPList[m_iGOPSize+m_extraRPSs]=m_GOPList[curGOP]; |
---|
| 1411 | Int newRefs=0; |
---|
| 1412 | for(Int i = 0; i< m_GOPList[curGOP].m_numRefPics; i++) |
---|
| 1413 | { |
---|
| 1414 | Int absPOC = curPOC+m_GOPList[curGOP].m_referencePics[i]; |
---|
| 1415 | if(absPOC>=0) |
---|
| 1416 | { |
---|
| 1417 | m_GOPList[m_iGOPSize+m_extraRPSs].m_referencePics[newRefs]=m_GOPList[curGOP].m_referencePics[i]; |
---|
| 1418 | m_GOPList[m_iGOPSize+m_extraRPSs].m_usedByCurrPic[newRefs]=m_GOPList[curGOP].m_usedByCurrPic[i]; |
---|
| 1419 | newRefs++; |
---|
| 1420 | } |
---|
| 1421 | } |
---|
| 1422 | Int numPrefRefs = m_GOPList[curGOP].m_numRefPicsActive; |
---|
| 1423 | |
---|
| 1424 | for(Int offset = -1; offset>-checkGOP; offset--) |
---|
| 1425 | { |
---|
| 1426 | //step backwards in coding order and include any extra available pictures we might find useful to replace the ones with POC < 0. |
---|
| 1427 | Int offGOP = (checkGOP-1+offset)%m_iGOPSize; |
---|
| 1428 | Int offPOC = ((checkGOP-1+offset)/m_iGOPSize)*m_iGOPSize + m_GOPList[offGOP].m_POC; |
---|
| 1429 | if(offPOC>=0&&m_GOPList[offGOP].m_temporalId<=m_GOPList[curGOP].m_temporalId) |
---|
| 1430 | { |
---|
| 1431 | Bool newRef=false; |
---|
| 1432 | for(Int i=0; i<numRefs; i++) |
---|
| 1433 | { |
---|
| 1434 | if(refList[i]==offPOC) |
---|
| 1435 | { |
---|
| 1436 | newRef=true; |
---|
| 1437 | } |
---|
| 1438 | } |
---|
| 1439 | for(Int i=0; i<newRefs; i++) |
---|
| 1440 | { |
---|
| 1441 | if(m_GOPList[m_iGOPSize+m_extraRPSs].m_referencePics[i]==offPOC-curPOC) |
---|
| 1442 | { |
---|
| 1443 | newRef=false; |
---|
| 1444 | } |
---|
| 1445 | } |
---|
| 1446 | if(newRef) |
---|
| 1447 | { |
---|
| 1448 | Int insertPoint=newRefs; |
---|
| 1449 | //this picture can be added, find appropriate place in list and insert it. |
---|
| 1450 | if(m_GOPList[offGOP].m_temporalId==m_GOPList[curGOP].m_temporalId) |
---|
| 1451 | { |
---|
| 1452 | m_GOPList[offGOP].m_refPic = true; |
---|
| 1453 | } |
---|
| 1454 | for(Int j=0; j<newRefs; j++) |
---|
| 1455 | { |
---|
| 1456 | if(m_GOPList[m_iGOPSize+m_extraRPSs].m_referencePics[j]<offPOC-curPOC||m_GOPList[m_iGOPSize+m_extraRPSs].m_referencePics[j]>0) |
---|
| 1457 | { |
---|
| 1458 | insertPoint = j; |
---|
| 1459 | break; |
---|
| 1460 | } |
---|
| 1461 | } |
---|
| 1462 | Int prev = offPOC-curPOC; |
---|
| 1463 | Int prevUsed = m_GOPList[offGOP].m_temporalId<=m_GOPList[curGOP].m_temporalId; |
---|
| 1464 | for(Int j=insertPoint; j<newRefs+1; j++) |
---|
| 1465 | { |
---|
| 1466 | Int newPrev = m_GOPList[m_iGOPSize+m_extraRPSs].m_referencePics[j]; |
---|
| 1467 | Int newUsed = m_GOPList[m_iGOPSize+m_extraRPSs].m_usedByCurrPic[j]; |
---|
| 1468 | m_GOPList[m_iGOPSize+m_extraRPSs].m_referencePics[j]=prev; |
---|
| 1469 | m_GOPList[m_iGOPSize+m_extraRPSs].m_usedByCurrPic[j]=prevUsed; |
---|
| 1470 | prevUsed=newUsed; |
---|
| 1471 | prev=newPrev; |
---|
| 1472 | } |
---|
| 1473 | newRefs++; |
---|
| 1474 | } |
---|
| 1475 | } |
---|
| 1476 | if(newRefs>=numPrefRefs) |
---|
| 1477 | { |
---|
| 1478 | break; |
---|
| 1479 | } |
---|
| 1480 | } |
---|
| 1481 | m_GOPList[m_iGOPSize+m_extraRPSs].m_numRefPics=newRefs; |
---|
| 1482 | m_GOPList[m_iGOPSize+m_extraRPSs].m_POC = curPOC; |
---|
| 1483 | if (m_extraRPSs == 0) |
---|
| 1484 | { |
---|
| 1485 | m_GOPList[m_iGOPSize+m_extraRPSs].m_interRPSPrediction = 0; |
---|
| 1486 | m_GOPList[m_iGOPSize+m_extraRPSs].m_numRefIdc = 0; |
---|
| 1487 | } |
---|
| 1488 | else |
---|
| 1489 | { |
---|
| 1490 | Int rIdx = m_iGOPSize + m_extraRPSs - 1; |
---|
| 1491 | Int refPOC = m_GOPList[rIdx].m_POC; |
---|
| 1492 | Int refPics = m_GOPList[rIdx].m_numRefPics; |
---|
| 1493 | Int newIdc=0; |
---|
| 1494 | for(Int i = 0; i<= refPics; i++) |
---|
| 1495 | { |
---|
| 1496 | Int deltaPOC = ((i != refPics)? m_GOPList[rIdx].m_referencePics[i] : 0); // check if the reference abs POC is >= 0 |
---|
| 1497 | Int absPOCref = refPOC+deltaPOC; |
---|
| 1498 | Int refIdc = 0; |
---|
| 1499 | for (Int j = 0; j < m_GOPList[m_iGOPSize+m_extraRPSs].m_numRefPics; j++) |
---|
| 1500 | { |
---|
| 1501 | if ( (absPOCref - curPOC) == m_GOPList[m_iGOPSize+m_extraRPSs].m_referencePics[j]) |
---|
| 1502 | { |
---|
| 1503 | if (m_GOPList[m_iGOPSize+m_extraRPSs].m_usedByCurrPic[j]) |
---|
| 1504 | { |
---|
| 1505 | refIdc = 1; |
---|
| 1506 | } |
---|
| 1507 | else |
---|
| 1508 | { |
---|
| 1509 | refIdc = 2; |
---|
| 1510 | } |
---|
| 1511 | } |
---|
| 1512 | } |
---|
| 1513 | m_GOPList[m_iGOPSize+m_extraRPSs].m_refIdc[newIdc]=refIdc; |
---|
| 1514 | newIdc++; |
---|
| 1515 | } |
---|
| 1516 | m_GOPList[m_iGOPSize+m_extraRPSs].m_interRPSPrediction = 1; |
---|
| 1517 | m_GOPList[m_iGOPSize+m_extraRPSs].m_numRefIdc = newIdc; |
---|
| 1518 | m_GOPList[m_iGOPSize+m_extraRPSs].m_deltaRPS = refPOC - m_GOPList[m_iGOPSize+m_extraRPSs].m_POC; |
---|
| 1519 | } |
---|
| 1520 | curGOP=m_iGOPSize+m_extraRPSs; |
---|
| 1521 | m_extraRPSs++; |
---|
| 1522 | } |
---|
| 1523 | numRefs=0; |
---|
| 1524 | for(Int i = 0; i< m_GOPList[curGOP].m_numRefPics; i++) |
---|
| 1525 | { |
---|
| 1526 | Int absPOC = curPOC+m_GOPList[curGOP].m_referencePics[i]; |
---|
| 1527 | if(absPOC >= 0) |
---|
| 1528 | { |
---|
| 1529 | refList[numRefs]=absPOC; |
---|
| 1530 | numRefs++; |
---|
| 1531 | } |
---|
| 1532 | } |
---|
| 1533 | refList[numRefs]=curPOC; |
---|
| 1534 | numRefs++; |
---|
| 1535 | } |
---|
| 1536 | checkGOP++; |
---|
| 1537 | } |
---|
| 1538 | xConfirmPara(errorGOP,"Invalid GOP structure given"); |
---|
| 1539 | m_maxTempLayer = 1; |
---|
| 1540 | for(Int i=0; i<m_iGOPSize; i++) |
---|
| 1541 | { |
---|
| 1542 | if(m_GOPList[i].m_temporalId >= m_maxTempLayer) |
---|
| 1543 | { |
---|
| 1544 | m_maxTempLayer = m_GOPList[i].m_temporalId+1; |
---|
| 1545 | } |
---|
| 1546 | xConfirmPara(m_GOPList[i].m_sliceType!='B'&&m_GOPList[i].m_sliceType!='P', "Slice type must be equal to B or P"); |
---|
| 1547 | } |
---|
| 1548 | for(Int i=0; i<MAX_TLAYER; i++) |
---|
| 1549 | { |
---|
| 1550 | m_numReorderPics[i] = 0; |
---|
[133] | 1551 | #if L0323_DPB |
---|
| 1552 | m_maxDecPicBuffering[i] = 1; |
---|
| 1553 | #else |
---|
[125] | 1554 | m_maxDecPicBuffering[i] = 0; |
---|
[133] | 1555 | #endif |
---|
[125] | 1556 | } |
---|
| 1557 | for(Int i=0; i<m_iGOPSize; i++) |
---|
| 1558 | { |
---|
[133] | 1559 | #if L0323_DPB |
---|
| 1560 | if(m_GOPList[i].m_numRefPics+1 > m_maxDecPicBuffering[m_GOPList[i].m_temporalId]) |
---|
| 1561 | #else |
---|
[125] | 1562 | if(m_GOPList[i].m_numRefPics > m_maxDecPicBuffering[m_GOPList[i].m_temporalId]) |
---|
[133] | 1563 | #endif |
---|
[125] | 1564 | { |
---|
[133] | 1565 | #if L0323_DPB |
---|
| 1566 | m_maxDecPicBuffering[m_GOPList[i].m_temporalId] = m_GOPList[i].m_numRefPics + 1; |
---|
| 1567 | #else |
---|
[125] | 1568 | m_maxDecPicBuffering[m_GOPList[i].m_temporalId] = m_GOPList[i].m_numRefPics; |
---|
[133] | 1569 | #endif |
---|
[125] | 1570 | } |
---|
| 1571 | Int highestDecodingNumberWithLowerPOC = 0; |
---|
| 1572 | for(Int j=0; j<m_iGOPSize; j++) |
---|
| 1573 | { |
---|
| 1574 | if(m_GOPList[j].m_POC <= m_GOPList[i].m_POC) |
---|
| 1575 | { |
---|
| 1576 | highestDecodingNumberWithLowerPOC = j; |
---|
| 1577 | } |
---|
| 1578 | } |
---|
| 1579 | Int numReorder = 0; |
---|
| 1580 | for(Int j=0; j<highestDecodingNumberWithLowerPOC; j++) |
---|
| 1581 | { |
---|
| 1582 | if(m_GOPList[j].m_temporalId <= m_GOPList[i].m_temporalId && |
---|
| 1583 | m_GOPList[j].m_POC > m_GOPList[i].m_POC) |
---|
| 1584 | { |
---|
| 1585 | numReorder++; |
---|
| 1586 | } |
---|
| 1587 | } |
---|
| 1588 | if(numReorder > m_numReorderPics[m_GOPList[i].m_temporalId]) |
---|
| 1589 | { |
---|
| 1590 | m_numReorderPics[m_GOPList[i].m_temporalId] = numReorder; |
---|
| 1591 | } |
---|
| 1592 | } |
---|
| 1593 | for(Int i=0; i<MAX_TLAYER-1; i++) |
---|
| 1594 | { |
---|
| 1595 | // a lower layer can not have higher value of m_numReorderPics than a higher layer |
---|
| 1596 | if(m_numReorderPics[i+1] < m_numReorderPics[i]) |
---|
| 1597 | { |
---|
| 1598 | m_numReorderPics[i+1] = m_numReorderPics[i]; |
---|
| 1599 | } |
---|
[133] | 1600 | #if L0323_DPB |
---|
| 1601 | // the value of num_reorder_pics[ i ] shall be in the range of 0 to max_dec_pic_buffering[ i ] - 1, inclusive |
---|
| 1602 | if(m_numReorderPics[i] > m_maxDecPicBuffering[i] - 1) |
---|
| 1603 | { |
---|
| 1604 | m_maxDecPicBuffering[i] = m_numReorderPics[i] + 1; |
---|
| 1605 | } |
---|
| 1606 | #else |
---|
[125] | 1607 | // the value of num_reorder_pics[ i ] shall be in the range of 0 to max_dec_pic_buffering[ i ], inclusive |
---|
| 1608 | if(m_numReorderPics[i] > m_maxDecPicBuffering[i]) |
---|
| 1609 | { |
---|
| 1610 | m_maxDecPicBuffering[i] = m_numReorderPics[i]; |
---|
| 1611 | } |
---|
[133] | 1612 | #endif |
---|
[125] | 1613 | // a lower layer can not have higher value of m_uiMaxDecPicBuffering than a higher layer |
---|
| 1614 | if(m_maxDecPicBuffering[i+1] < m_maxDecPicBuffering[i]) |
---|
| 1615 | { |
---|
| 1616 | m_maxDecPicBuffering[i+1] = m_maxDecPicBuffering[i]; |
---|
| 1617 | } |
---|
| 1618 | } |
---|
[133] | 1619 | |
---|
| 1620 | |
---|
| 1621 | #if L0323_DPB |
---|
| 1622 | // the value of num_reorder_pics[ i ] shall be in the range of 0 to max_dec_pic_buffering[ i ] - 1, inclusive |
---|
| 1623 | if(m_numReorderPics[MAX_TLAYER-1] > m_maxDecPicBuffering[MAX_TLAYER-1] - 1) |
---|
| 1624 | { |
---|
| 1625 | m_maxDecPicBuffering[MAX_TLAYER-1] = m_numReorderPics[MAX_TLAYER-1] + 1; |
---|
| 1626 | } |
---|
| 1627 | #else |
---|
[125] | 1628 | // the value of num_reorder_pics[ i ] shall be in the range of 0 to max_dec_pic_buffering[ i ], inclusive |
---|
| 1629 | if(m_numReorderPics[MAX_TLAYER-1] > m_maxDecPicBuffering[MAX_TLAYER-1]) |
---|
| 1630 | { |
---|
| 1631 | m_maxDecPicBuffering[MAX_TLAYER-1] = m_numReorderPics[MAX_TLAYER-1]; |
---|
| 1632 | } |
---|
[133] | 1633 | #endif |
---|
[125] | 1634 | |
---|
| 1635 | #if SVC_EXTENSION // ToDo: it should be checked for the case when parameters are different for the layers |
---|
| 1636 | for(UInt layer = 0; layer < MAX_LAYERS; layer++) |
---|
| 1637 | { |
---|
| 1638 | Int m_iSourceWidth = m_acLayerCfg[layer].m_iSourceWidth; |
---|
| 1639 | Int m_iSourceHeight = m_acLayerCfg[layer].m_iSourceHeight; |
---|
| 1640 | #endif |
---|
| 1641 | if(m_vuiParametersPresentFlag && m_bitstreamRestrictionFlag) |
---|
| 1642 | { |
---|
| 1643 | Int PicSizeInSamplesY = m_iSourceWidth * m_iSourceHeight; |
---|
| 1644 | if(tileFlag) |
---|
| 1645 | { |
---|
| 1646 | Int maxTileWidth = 0; |
---|
| 1647 | Int maxTileHeight = 0; |
---|
| 1648 | Int widthInCU = (m_iSourceWidth % m_uiMaxCUWidth) ? m_iSourceWidth/m_uiMaxCUWidth + 1: m_iSourceWidth/m_uiMaxCUWidth; |
---|
| 1649 | Int heightInCU = (m_iSourceHeight % m_uiMaxCUHeight) ? m_iSourceHeight/m_uiMaxCUHeight + 1: m_iSourceHeight/m_uiMaxCUHeight; |
---|
| 1650 | if(m_iUniformSpacingIdr) |
---|
| 1651 | { |
---|
| 1652 | maxTileWidth = m_uiMaxCUWidth*((widthInCU+m_iNumColumnsMinus1)/(m_iNumColumnsMinus1+1)); |
---|
| 1653 | maxTileHeight = m_uiMaxCUHeight*((heightInCU+m_iNumRowsMinus1)/(m_iNumRowsMinus1+1)); |
---|
| 1654 | // if only the last tile-row is one treeblock higher than the others |
---|
| 1655 | // the maxTileHeight becomes smaller if the last row of treeblocks has lower height than the others |
---|
| 1656 | if(!((heightInCU-1)%(m_iNumRowsMinus1+1))) |
---|
| 1657 | { |
---|
| 1658 | maxTileHeight = maxTileHeight - m_uiMaxCUHeight + (m_iSourceHeight % m_uiMaxCUHeight); |
---|
| 1659 | } |
---|
| 1660 | // if only the last tile-column is one treeblock wider than the others |
---|
| 1661 | // the maxTileWidth becomes smaller if the last column of treeblocks has lower width than the others |
---|
| 1662 | if(!((widthInCU-1)%(m_iNumColumnsMinus1+1))) |
---|
| 1663 | { |
---|
| 1664 | maxTileWidth = maxTileWidth - m_uiMaxCUWidth + (m_iSourceWidth % m_uiMaxCUWidth); |
---|
| 1665 | } |
---|
| 1666 | } |
---|
| 1667 | else // not uniform spacing |
---|
| 1668 | { |
---|
| 1669 | if(m_iNumColumnsMinus1<1) |
---|
| 1670 | { |
---|
| 1671 | maxTileWidth = m_iSourceWidth; |
---|
| 1672 | } |
---|
| 1673 | else |
---|
| 1674 | { |
---|
| 1675 | Int accColumnWidth = 0; |
---|
| 1676 | for(Int col=0; col<(m_iNumColumnsMinus1); col++) |
---|
| 1677 | { |
---|
| 1678 | maxTileWidth = m_pColumnWidth[col]>maxTileWidth ? m_pColumnWidth[col]:maxTileWidth; |
---|
| 1679 | accColumnWidth += m_pColumnWidth[col]; |
---|
| 1680 | } |
---|
| 1681 | maxTileWidth = (widthInCU-accColumnWidth)>maxTileWidth ? m_uiMaxCUWidth*(widthInCU-accColumnWidth):m_uiMaxCUWidth*maxTileWidth; |
---|
| 1682 | } |
---|
| 1683 | if(m_iNumRowsMinus1<1) |
---|
| 1684 | { |
---|
| 1685 | maxTileHeight = m_iSourceHeight; |
---|
| 1686 | } |
---|
| 1687 | else |
---|
| 1688 | { |
---|
| 1689 | Int accRowHeight = 0; |
---|
| 1690 | for(Int row=0; row<(m_iNumRowsMinus1); row++) |
---|
| 1691 | { |
---|
| 1692 | maxTileHeight = m_pRowHeight[row]>maxTileHeight ? m_pRowHeight[row]:maxTileHeight; |
---|
| 1693 | accRowHeight += m_pRowHeight[row]; |
---|
| 1694 | } |
---|
| 1695 | maxTileHeight = (heightInCU-accRowHeight)>maxTileHeight ? m_uiMaxCUHeight*(heightInCU-accRowHeight):m_uiMaxCUHeight*maxTileHeight; |
---|
| 1696 | } |
---|
| 1697 | } |
---|
| 1698 | Int maxSizeInSamplesY = maxTileWidth*maxTileHeight; |
---|
| 1699 | m_minSpatialSegmentationIdc = 4*PicSizeInSamplesY/maxSizeInSamplesY-4; |
---|
| 1700 | } |
---|
| 1701 | else if(m_iWaveFrontSynchro) |
---|
| 1702 | { |
---|
| 1703 | m_minSpatialSegmentationIdc = 4*PicSizeInSamplesY/((2*m_iSourceHeight+m_iSourceWidth)*m_uiMaxCUHeight)-4; |
---|
| 1704 | } |
---|
| 1705 | else if(m_sliceMode == 1) |
---|
| 1706 | { |
---|
| 1707 | m_minSpatialSegmentationIdc = 4*PicSizeInSamplesY/(m_sliceArgument*m_uiMaxCUWidth*m_uiMaxCUHeight)-4; |
---|
| 1708 | } |
---|
| 1709 | else |
---|
| 1710 | { |
---|
| 1711 | m_minSpatialSegmentationIdc = 0; |
---|
| 1712 | } |
---|
| 1713 | } |
---|
| 1714 | #if SVC_EXTENSION |
---|
| 1715 | } |
---|
| 1716 | #endif |
---|
[133] | 1717 | #if !L0034_COMBINED_LIST_CLEANUP |
---|
[125] | 1718 | xConfirmPara( m_bUseLComb==false && m_numReorderPics[MAX_TLAYER-1]!=0, "ListCombination can only be 0 in low delay coding (more precisely when L0 and L1 are identical)" ); // Note however this is not the full necessary condition as ref_pic_list_combination_flag can only be 0 if L0 == L1. |
---|
[133] | 1719 | #endif |
---|
[125] | 1720 | xConfirmPara( m_iWaveFrontSynchro < 0, "WaveFrontSynchro cannot be negative" ); |
---|
| 1721 | #if !SVC_EXTENSION |
---|
| 1722 | xConfirmPara( m_iWaveFrontSubstreams <= 0, "WaveFrontSubstreams must be positive" ); |
---|
| 1723 | xConfirmPara( m_iWaveFrontSubstreams > 1 && !m_iWaveFrontSynchro, "Must have WaveFrontSynchro > 0 in order to have WaveFrontSubstreams > 1" ); |
---|
| 1724 | #endif |
---|
| 1725 | |
---|
| 1726 | xConfirmPara( m_decodedPictureHashSEIEnabled<0 || m_decodedPictureHashSEIEnabled>3, "this hash type is not correct!\n"); |
---|
| 1727 | |
---|
[133] | 1728 | #if J0149_TONE_MAPPING_SEI |
---|
| 1729 | if (m_toneMappingInfoSEIEnabled) |
---|
| 1730 | { |
---|
| 1731 | xConfirmPara( m_toneMapCodedDataBitDepth < 8 || m_toneMapCodedDataBitDepth > 14 , "SEIToneMapCodedDataBitDepth must be in rage 8 to 14"); |
---|
| 1732 | xConfirmPara( m_toneMapTargetBitDepth < 1 || (m_toneMapTargetBitDepth > 16 && m_toneMapTargetBitDepth < 255) , "SEIToneMapTargetBitDepth must be in rage 1 to 16 or equal to 255"); |
---|
| 1733 | xConfirmPara( m_toneMapModelId < 0 || m_toneMapModelId > 4 , "SEIToneMapModelId must be in rage 0 to 4"); |
---|
| 1734 | xConfirmPara( m_cameraIsoSpeedValue == 0, "SEIToneMapCameraIsoSpeedValue shall not be equal to 0"); |
---|
| 1735 | xConfirmPara( m_extendedRangeWhiteLevel < 100, "SEIToneMapExtendedRangeWhiteLevel should be greater than or equal to 100"); |
---|
| 1736 | xConfirmPara( m_nominalBlackLevelLumaCodeValue >= m_nominalWhiteLevelLumaCodeValue, "SEIToneMapNominalWhiteLevelLumaCodeValue shall be greater than SEIToneMapNominalBlackLevelLumaCodeValue"); |
---|
| 1737 | xConfirmPara( m_extendedWhiteLevelLumaCodeValue < m_nominalWhiteLevelLumaCodeValue, "SEIToneMapExtendedWhiteLevelLumaCodeValue shall be greater than or equal to SEIToneMapNominalWhiteLevelLumaCodeValue"); |
---|
| 1738 | } |
---|
| 1739 | #endif |
---|
| 1740 | |
---|
[125] | 1741 | #if RATE_CONTROL_LAMBDA_DOMAIN |
---|
| 1742 | if ( m_RCEnableRateControl ) |
---|
| 1743 | { |
---|
| 1744 | if ( m_RCForceIntraQP ) |
---|
| 1745 | { |
---|
| 1746 | if ( m_RCInitialQP == 0 ) |
---|
| 1747 | { |
---|
| 1748 | printf( "\nInitial QP for rate control is not specified. Reset not to use force intra QP!" ); |
---|
| 1749 | m_RCForceIntraQP = false; |
---|
| 1750 | } |
---|
| 1751 | } |
---|
| 1752 | xConfirmPara( m_uiDeltaQpRD > 0, "Rate control cannot be used together with slice level multiple-QP optimization!\n" ); |
---|
| 1753 | } |
---|
| 1754 | #else |
---|
| 1755 | if(m_enableRateCtrl) |
---|
| 1756 | { |
---|
| 1757 | Int numLCUInWidth = (m_iSourceWidth / m_uiMaxCUWidth) + (( m_iSourceWidth % m_uiMaxCUWidth ) ? 1 : 0); |
---|
| 1758 | Int numLCUInHeight = (m_iSourceHeight / m_uiMaxCUHeight)+ (( m_iSourceHeight % m_uiMaxCUHeight) ? 1 : 0); |
---|
| 1759 | Int numLCUInPic = numLCUInWidth * numLCUInHeight; |
---|
| 1760 | |
---|
| 1761 | xConfirmPara( (numLCUInPic % m_numLCUInUnit) != 0, "total number of LCUs in a frame should be completely divided by NumLCUInUnit" ); |
---|
| 1762 | |
---|
| 1763 | m_iMaxDeltaQP = MAX_DELTA_QP; |
---|
| 1764 | m_iMaxCuDQPDepth = MAX_CUDQP_DEPTH; |
---|
| 1765 | } |
---|
| 1766 | #endif |
---|
| 1767 | |
---|
| 1768 | xConfirmPara(!m_TransquantBypassEnableFlag && m_CUTransquantBypassFlagValue, "CUTransquantBypassFlagValue cannot be 1 when TransquantBypassEnableFlag is 0"); |
---|
| 1769 | |
---|
| 1770 | xConfirmPara(m_log2ParallelMergeLevel < 2, "Log2ParallelMergeLevel should be larger than or equal to 2"); |
---|
| 1771 | #if L0444_FPA_TYPE |
---|
| 1772 | if (m_framePackingSEIEnabled) |
---|
| 1773 | { |
---|
| 1774 | xConfirmPara(m_framePackingSEIType < 3 || m_framePackingSEIType > 5 , "SEIFramePackingType must be in rage 3 to 5"); |
---|
| 1775 | } |
---|
| 1776 | #endif |
---|
| 1777 | #if VPS_EXTN_DIRECT_REF_LAYERS |
---|
| 1778 | xConfirmPara( (m_acLayerCfg[0].m_numDirectRefLayers != 0) && (m_acLayerCfg[0].m_numDirectRefLayers != -1), "Layer 0 cannot have any reference layers" ); |
---|
| 1779 | // NOTE: m_numDirectRefLayers (for any layer) could be -1 (not signalled in cfg), in which case only the "previous layer" would be taken for reference |
---|
[133] | 1780 | for(Int layer = 1; layer < MAX_LAYERS; layer++) |
---|
| 1781 | { |
---|
| 1782 | xConfirmPara(m_acLayerCfg[layer].m_numDirectRefLayers > layer, "Cannot reference more layers than before current layer"); |
---|
| 1783 | for(Int i = 0; i < m_acLayerCfg[layer].m_numDirectRefLayers; i++) |
---|
| 1784 | { |
---|
| 1785 | xConfirmPara(m_acLayerCfg[layer].m_refLayerIds[i] > layer, "Cannot reference higher layers"); |
---|
| 1786 | xConfirmPara(m_acLayerCfg[layer].m_refLayerIds[i] == layer, "Cannot reference the current layer itself"); |
---|
| 1787 | } |
---|
| 1788 | } |
---|
[125] | 1789 | #endif |
---|
| 1790 | #undef xConfirmPara |
---|
| 1791 | if (check_failed) |
---|
| 1792 | { |
---|
| 1793 | exit(EXIT_FAILURE); |
---|
| 1794 | } |
---|
| 1795 | } |
---|
| 1796 | |
---|
| 1797 | /** \todo use of global variables should be removed later |
---|
| 1798 | */ |
---|
| 1799 | Void TAppEncCfg::xSetGlobal() |
---|
| 1800 | { |
---|
| 1801 | // set max CU width & height |
---|
| 1802 | g_uiMaxCUWidth = m_uiMaxCUWidth; |
---|
| 1803 | g_uiMaxCUHeight = m_uiMaxCUHeight; |
---|
| 1804 | |
---|
| 1805 | // compute actual CU depth with respect to config depth and max transform size |
---|
| 1806 | g_uiAddCUDepth = 0; |
---|
| 1807 | while( (m_uiMaxCUWidth>>m_uiMaxCUDepth) > ( 1 << ( m_uiQuadtreeTULog2MinSize + g_uiAddCUDepth ) ) ) g_uiAddCUDepth++; |
---|
| 1808 | |
---|
| 1809 | m_uiMaxCUDepth += g_uiAddCUDepth; |
---|
| 1810 | g_uiAddCUDepth++; |
---|
| 1811 | g_uiMaxCUDepth = m_uiMaxCUDepth; |
---|
| 1812 | |
---|
| 1813 | // set internal bit-depth and constants |
---|
| 1814 | g_bitDepthY = m_internalBitDepthY; |
---|
| 1815 | g_bitDepthC = m_internalBitDepthC; |
---|
| 1816 | |
---|
| 1817 | g_uiPCMBitDepthLuma = m_bPCMInputBitDepthFlag ? m_inputBitDepthY : m_internalBitDepthY; |
---|
| 1818 | g_uiPCMBitDepthChroma = m_bPCMInputBitDepthFlag ? m_inputBitDepthC : m_internalBitDepthC; |
---|
| 1819 | } |
---|
| 1820 | |
---|
| 1821 | Void TAppEncCfg::xPrintParameter() |
---|
| 1822 | { |
---|
| 1823 | printf("\n"); |
---|
| 1824 | #if SVC_EXTENSION |
---|
| 1825 | printf("Total number of layers : %d\n", m_numLayers ); |
---|
| 1826 | for(UInt layer=0; layer<m_numLayers; layer++) |
---|
| 1827 | { |
---|
| 1828 | printf("=== Layer %d settings === \n", layer); |
---|
| 1829 | m_acLayerCfg[layer].xPrintParameter(); |
---|
| 1830 | printf("\n"); |
---|
| 1831 | } |
---|
| 1832 | printf("=== Common configuration settings === \n"); |
---|
| 1833 | printf("Bitstream File : %s\n", m_pBitstreamFile ); |
---|
| 1834 | #else |
---|
| 1835 | printf("Input File : %s\n", m_pchInputFile ); |
---|
| 1836 | printf("Bitstream File : %s\n", m_pchBitstreamFile ); |
---|
| 1837 | printf("Reconstruction File : %s\n", m_pchReconFile ); |
---|
| 1838 | printf("Real Format : %dx%d %dHz\n", m_iSourceWidth - m_confLeft - m_confRight, m_iSourceHeight - m_confTop - m_confBottom, m_iFrameRate ); |
---|
| 1839 | printf("Internal Format : %dx%d %dHz\n", m_iSourceWidth, m_iSourceHeight, m_iFrameRate ); |
---|
| 1840 | #endif |
---|
| 1841 | printf("Frame index : %u - %d (%d frames)\n", m_FrameSkip, m_FrameSkip+m_framesToBeEncoded-1, m_framesToBeEncoded ); |
---|
| 1842 | printf("CU size / depth : %d / %d\n", m_uiMaxCUWidth, m_uiMaxCUDepth ); |
---|
| 1843 | printf("RQT trans. size (min / max) : %d / %d\n", 1 << m_uiQuadtreeTULog2MinSize, 1 << m_uiQuadtreeTULog2MaxSize ); |
---|
| 1844 | printf("Max RQT depth inter : %d\n", m_uiQuadtreeTUMaxDepthInter); |
---|
| 1845 | printf("Max RQT depth intra : %d\n", m_uiQuadtreeTUMaxDepthIntra); |
---|
| 1846 | printf("Min PCM size : %d\n", 1 << m_uiPCMLog2MinSize); |
---|
| 1847 | printf("Motion search range : %d\n", m_iSearchRange ); |
---|
| 1848 | #if !SVC_EXTENSION |
---|
| 1849 | printf("Intra period : %d\n", m_iIntraPeriod ); |
---|
| 1850 | #endif |
---|
| 1851 | printf("Decoding refresh type : %d\n", m_iDecodingRefreshType ); |
---|
| 1852 | #if !SVC_EXTENSION |
---|
| 1853 | printf("QP : %5.2f\n", m_fQP ); |
---|
| 1854 | #endif |
---|
| 1855 | printf("Max dQP signaling depth : %d\n", m_iMaxCuDQPDepth); |
---|
| 1856 | |
---|
| 1857 | printf("Cb QP Offset : %d\n", m_cbQpOffset ); |
---|
| 1858 | printf("Cr QP Offset : %d\n", m_crQpOffset); |
---|
| 1859 | |
---|
| 1860 | printf("QP adaptation : %d (range=%d)\n", m_bUseAdaptiveQP, (m_bUseAdaptiveQP ? m_iQPAdaptationRange : 0) ); |
---|
| 1861 | printf("GOP size : %d\n", m_iGOPSize ); |
---|
| 1862 | printf("Internal bit depth : (Y:%d, C:%d)\n", m_internalBitDepthY, m_internalBitDepthC ); |
---|
| 1863 | printf("PCM sample bit depth : (Y:%d, C:%d)\n", g_uiPCMBitDepthLuma, g_uiPCMBitDepthChroma ); |
---|
| 1864 | #if RATE_CONTROL_LAMBDA_DOMAIN |
---|
| 1865 | printf("RateControl : %d\n", m_RCEnableRateControl ); |
---|
| 1866 | if(m_RCEnableRateControl) |
---|
| 1867 | { |
---|
| 1868 | printf("TargetBitrate : %d\n", m_RCTargetBitrate ); |
---|
| 1869 | printf("KeepHierarchicalBit : %d\n", m_RCKeepHierarchicalBit ); |
---|
| 1870 | printf("LCULevelRC : %d\n", m_RCLCULevelRC ); |
---|
| 1871 | printf("UseLCUSeparateModel : %d\n", m_RCUseLCUSeparateModel ); |
---|
| 1872 | printf("InitialQP : %d\n", m_RCInitialQP ); |
---|
| 1873 | printf("ForceIntraQP : %d\n", m_RCForceIntraQP ); |
---|
| 1874 | } |
---|
| 1875 | #else |
---|
| 1876 | printf("RateControl : %d\n", m_enableRateCtrl); |
---|
| 1877 | if(m_enableRateCtrl) |
---|
| 1878 | { |
---|
| 1879 | printf("TargetBitrate : %d\n", m_targetBitrate); |
---|
| 1880 | printf("NumLCUInUnit : %d\n", m_numLCUInUnit); |
---|
| 1881 | } |
---|
| 1882 | #endif |
---|
| 1883 | printf("Max Num Merge Candidates : %d\n", m_maxNumMergeCand); |
---|
| 1884 | printf("\n"); |
---|
| 1885 | |
---|
| 1886 | printf("TOOL CFG: "); |
---|
| 1887 | printf("IBD:%d ", g_bitDepthY > m_inputBitDepthY || g_bitDepthC > m_inputBitDepthC); |
---|
| 1888 | printf("HAD:%d ", m_bUseHADME ); |
---|
| 1889 | printf("SRD:%d ", m_bUseSBACRD ); |
---|
| 1890 | printf("RDQ:%d ", m_useRDOQ ); |
---|
| 1891 | printf("RDQTS:%d ", m_useRDOQTS ); |
---|
| 1892 | #if L0232_RD_PENALTY |
---|
| 1893 | printf("RDpenalty:%d ", m_rdPenalty ); |
---|
| 1894 | #endif |
---|
| 1895 | printf("SQP:%d ", m_uiDeltaQpRD ); |
---|
| 1896 | printf("ASR:%d ", m_bUseASR ); |
---|
[133] | 1897 | #if !L0034_COMBINED_LIST_CLEANUP |
---|
[125] | 1898 | printf("LComb:%d ", m_bUseLComb ); |
---|
[133] | 1899 | #endif |
---|
[125] | 1900 | printf("FEN:%d ", m_bUseFastEnc ); |
---|
| 1901 | printf("ECU:%d ", m_bUseEarlyCU ); |
---|
| 1902 | printf("FDM:%d ", m_useFastDecisionForMerge ); |
---|
| 1903 | printf("CFM:%d ", m_bUseCbfFastMode ); |
---|
| 1904 | printf("ESD:%d ", m_useEarlySkipDetection ); |
---|
| 1905 | printf("RQT:%d ", 1 ); |
---|
| 1906 | printf("TransformSkip:%d ", m_useTransformSkip ); |
---|
| 1907 | printf("TransformSkipFast:%d ", m_useTransformSkipFast ); |
---|
| 1908 | printf("Slice: M=%d ", m_sliceMode); |
---|
| 1909 | if (m_sliceMode!=0) |
---|
| 1910 | { |
---|
| 1911 | printf("A=%d ", m_sliceArgument); |
---|
| 1912 | } |
---|
| 1913 | printf("SliceSegment: M=%d ",m_sliceSegmentMode); |
---|
| 1914 | if (m_sliceSegmentMode!=0) |
---|
| 1915 | { |
---|
| 1916 | printf("A=%d ", m_sliceSegmentArgument); |
---|
| 1917 | } |
---|
| 1918 | printf("CIP:%d ", m_bUseConstrainedIntraPred); |
---|
| 1919 | printf("SAO:%d ", (m_bUseSAO)?(1):(0)); |
---|
| 1920 | printf("PCM:%d ", (m_usePCM && (1<<m_uiPCMLog2MinSize) <= m_uiMaxCUWidth)? 1 : 0); |
---|
| 1921 | printf("SAOLcuBasedOptimization:%d ", (m_saoLcuBasedOptimization)?(1):(0)); |
---|
| 1922 | |
---|
| 1923 | printf("LosslessCuEnabled:%d ", (m_useLossless)? 1:0 ); |
---|
| 1924 | printf("WPP:%d ", (Int)m_useWeightedPred); |
---|
| 1925 | printf("WPB:%d ", (Int)m_useWeightedBiPred); |
---|
| 1926 | printf("PME:%d ", m_log2ParallelMergeLevel); |
---|
| 1927 | #if !SVC_EXTENSION |
---|
| 1928 | printf(" WaveFrontSynchro:%d WaveFrontSubstreams:%d", |
---|
| 1929 | m_iWaveFrontSynchro, m_iWaveFrontSubstreams); |
---|
| 1930 | #endif |
---|
| 1931 | printf(" ScalingList:%d ", m_useScalingListId ); |
---|
| 1932 | printf("TMVPMode:%d ", m_TMVPModeId ); |
---|
| 1933 | #if ADAPTIVE_QP_SELECTION |
---|
| 1934 | printf("AQpS:%d", m_bUseAdaptQpSelect ); |
---|
| 1935 | #endif |
---|
| 1936 | |
---|
| 1937 | printf(" SignBitHidingFlag:%d ", m_signHideFlag); |
---|
| 1938 | #if SVC_EXTENSION |
---|
| 1939 | printf("RecalQP:%d ", m_recalculateQPAccordingToLambda ? 1 : 0 ); |
---|
[154] | 1940 | #if AVC_BASE |
---|
| 1941 | printf("AvcBase:%d ", m_avcBaseLayerFlag ? 1 : 0); |
---|
| 1942 | #else |
---|
| 1943 | printf("AvcBase:%d ", 0); |
---|
| 1944 | #endif |
---|
[125] | 1945 | #if REF_IDX_FRAMEWORK |
---|
| 1946 | printf("REF_IDX_FRAMEWORK:%d ", REF_IDX_FRAMEWORK); |
---|
| 1947 | printf("EL_RAP_SliceType: %d ", m_elRapSliceBEnabled); |
---|
[161] | 1948 | printf("REF_IDX_ME_ZEROMV: %d ", REF_IDX_ME_ZEROMV); |
---|
| 1949 | printf("ENCODER_FAST_MODE: %d ", ENCODER_FAST_MODE); |
---|
| 1950 | printf("REF_IDX_MFM: %d ", REF_IDX_MFM); |
---|
[125] | 1951 | #elif INTRA_BL |
---|
| 1952 | printf("INTRA_BL:%d ", INTRA_BL); |
---|
| 1953 | #if !AVC_BASE |
---|
| 1954 | printf("SVC_MVP:%d ", SVC_MVP ); |
---|
| 1955 | printf("SVC_BL_CAND_INTRA:%d", SVC_BL_CAND_INTRA ); |
---|
| 1956 | #endif |
---|
| 1957 | #endif |
---|
| 1958 | #else |
---|
| 1959 | printf("RecalQP:%d", m_recalculateQPAccordingToLambda ? 1 : 0 ); |
---|
| 1960 | #endif |
---|
| 1961 | printf("\n\n"); |
---|
| 1962 | |
---|
| 1963 | fflush(stdout); |
---|
| 1964 | } |
---|
| 1965 | |
---|
| 1966 | Bool confirmPara(Bool bflag, const Char* message) |
---|
| 1967 | { |
---|
| 1968 | if (!bflag) |
---|
| 1969 | return false; |
---|
| 1970 | |
---|
| 1971 | printf("Error: %s\n",message); |
---|
| 1972 | return true; |
---|
| 1973 | } |
---|
| 1974 | |
---|
| 1975 | //! \} |
---|