Changeset 1200 in 3DVCSoftware for branches/HTM-14.1-update-dev0/source/App/TAppDecoder/TAppDecCfg.cpp
- Timestamp:
- 4 May 2015, 18:38:08 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-14.1-update-dev0/source/App/TAppDecoder/TAppDecCfg.cpp
r1179 r1200 2 2 * License, included below. This software may be subject to other third party 3 3 * and contributor rights, including patent rights, and no such rights are 4 * granted under this license. 5 * 6 * Copyright (c) 2010-2015, ITU/ISO/IEC4 * granted under this license. 5 * 6 * Copyright (c) 2010-2015, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 41 41 #include "TAppDecCfg.h" 42 42 #include "TAppCommon/program_options_lite.h" 43 44 #if H_MV 45 #include <cassert> 46 #endif 43 #include "TLibCommon/TComChromaFormat.h" 47 44 #ifdef WIN32 48 45 #define strdup _strdup 46 #endif 47 #if NH_MV 48 #include <cassert> 49 49 #endif 50 50 … … 68 68 string cfg_ReconFile; 69 69 string cfg_TargetDecLayerIdSetFile; 70 #if H_3D70 #if NH_3D 71 71 string cfg_ScaleOffsetFile; 72 72 #endif 73 string outputColourSpaceConvert; 74 Int warnUnknowParameter = 0; 73 75 74 76 po::Options opts; 75 77 opts.addOptions() 76 ("help", do_help, false, "this help text") 77 ("BitstreamFile,b", cfg_BitstreamFile, string(""), "bitstream input file name") 78 ("ReconFile,o", cfg_ReconFile, string(""), "reconstructed YUV output file name\n" 79 "YUV writing is skipped if omitted") 80 #if H_3D 81 ("ScaleOffsetFile,p", cfg_ScaleOffsetFile, string(""), "file with coded scales and offsets") 82 #endif 83 ("SkipFrames,s", m_iSkipFrame, 0, "number of frames to skip before random access") 84 ("OutputBitDepth,d", m_outputBitDepthY, 0, "bit depth of YUV output luma component (default: use 0 for native depth)") 85 ("OutputBitDepthC,d", m_outputBitDepthC, 0, "bit depth of YUV output chroma component (default: use 0 for native depth)") 86 #if H_MV 87 ("TargetOptLayerSetIdx,x", m_targetOptLayerSetIdx, -1, "Target output layer set index. (default: -1, determine automatically to be equal to highest layer set index") // Should actually equal to 0 as default. However, this would cause only the base layer to be decoded. 88 #endif 89 ("MaxTemporalLayer,t", m_iMaxTemporalLayer, -1, "Maximum Temporal Layer to be decoded. -1 to decode all layers") 90 ("SEIDecodedPictureHash", m_decodedPictureHashSEIEnabled, 1, "Control handling of decoded picture hash SEI messages\n" 91 "\t1: check hash in SEI messages if available in the bitstream\n" 92 "\t0: ignore SEI message") 93 ("SEIpictureDigest", m_decodedPictureHashSEIEnabled, 1, "deprecated alias for SEIDecodedPictureHash") 94 ("TarDecLayerIdSetFile,l", cfg_TargetDecLayerIdSetFile, string(""), "targetDecLayerIdSet file name. The file should include white space separated LayerId values to be decoded. Omitting the option or a value of -1 in the file decodes all layers.") 95 ("RespectDefDispWindow,w", m_respectDefDispWindow, 0, "Only output content inside the default display window\n") 96 #if H_MV 97 ("OutputVpsInfo,v", m_outputVpsInfo, false, "Output information about the layer dependencies and layer sets") 98 #endif 78 79 80 ("help", do_help, false, "this help text") 81 ("BitstreamFile,b", cfg_BitstreamFile, string(""), "bitstream input file name") 82 ("ReconFile,o", cfg_ReconFile, string(""), "reconstructed YUV output file name\n" 83 "YUV writing is skipped if omitted") 84 #if NH_3D 85 ("ScaleOffsetFile,p", cfg_ScaleOffsetFile, string(""), "file with coded scales and offsets") 86 ("Depth420OutputFlag", m_depth420OutputFlag, true , "Output depth layers in 4:2:0 ") 87 #endif 88 ("WarnUnknowParameter,w", warnUnknowParameter, 0, "warn for unknown configuration parameters instead of failing") 89 ("SkipFrames,s", m_iSkipFrame, 0, "number of frames to skip before random access") 90 ("OutputBitDepth,d", m_outputBitDepth[CHANNEL_TYPE_LUMA], 0, "bit depth of YUV output luma component (default: use 0 for native depth)") 91 ("OutputBitDepthC,d", m_outputBitDepth[CHANNEL_TYPE_CHROMA], 0, "bit depth of YUV output chroma component (default: use 0 for native depth)") 92 ("OutputColourSpaceConvert", outputColourSpaceConvert, string(""), "Colour space conversion to apply to input 444 video. Permitted values are (empty string=UNCHANGED) " + getListOfColourSpaceConverts(false)) 93 #if NH_MV 94 ("TargetOptLayerSetIdx,x", m_targetOptLayerSetIdx, -1, "Target output layer set index. (default: -1, determine automatically to be equal to highest layer set index") // Should actually equal to 0 as default. However, this would cause only the base layer to be decoded. 95 #endif 96 ("MaxTemporalLayer,t", m_iMaxTemporalLayer, -1, "Maximum Temporal Layer to be decoded. -1 to decode all layers") 97 ("SEIDecodedPictureHash", m_decodedPictureHashSEIEnabled, 1, "Control handling of decoded picture hash SEI messages\n" 98 "\t1: check hash in SEI messages if available in the bitstream\n" 99 "\t0: ignore SEI message") 100 ("SEINoDisplay", m_decodedNoDisplaySEIEnabled, true, "Control handling of decoded no display SEI messages") 101 ("TarDecLayerIdSetFile,l", cfg_TargetDecLayerIdSetFile, string(""), "targetDecLayerIdSet file name. The file should include white space separated LayerId values to be decoded. Omitting the option or a value of -1 in the file decodes all layers.") 102 ("RespectDefDispWindow,w", m_respectDefDispWindow, 0, "Only output content inside the default display window\n") 103 #if NH_MV 104 ("OutputVpsInfo,v", m_outputVpsInfo, false, "Output information about the layer dependencies and layer sets") 105 #endif 106 #if O0043_BEST_EFFORT_DECODING 107 ("ForceDecodeBitDepth", m_forceDecodeBitDepth, 0U, "Force the decoder to operate at a particular bit-depth (best effort decoding)") 108 #endif 109 ("OutputDecodedSEIMessagesFilename", m_outputDecodedSEIMessagesFilename, string(""), "When non empty, output decoded SEI messages to the indicated file. If file is '-', then output to stdout\n") 110 ("ClipOutputVideoToRec709Range", m_bClipOutputVideoToRec709Range, false, "If true then clip output video to the Rec. 709 Range on saving") 99 111 ; 112 100 113 po::setDefaults(opts); 101 const list<const Char*>& argv_unhandled = po::scanArgv(opts, argc, (const Char**) argv); 114 po::ErrorReporter err; 115 const list<const Char*>& argv_unhandled = po::scanArgv(opts, argc, (const Char**) argv, err); 102 116 103 117 for (list<const Char*>::const_iterator it = argv_unhandled.begin(); it != argv_unhandled.end(); it++) … … 109 123 { 110 124 po::doHelp(cout, opts); 125 return false; 126 } 127 128 if (err.is_errored) 129 { 130 if (!warnUnknowParameter) 131 { 132 /* errors have already been reported to stderr */ 133 return false; 134 } 135 } 136 137 m_outputColourSpaceConvert = stringToInputColourSpaceConvert(outputColourSpaceConvert, false); 138 if (m_outputColourSpaceConvert>=NUMBER_INPUT_COLOUR_SPACE_CONVERSIONS) 139 { 140 fprintf(stderr, "Bad output colour space conversion string\n"); 111 141 return false; 112 142 } … … 116 146 m_pchReconFile = cfg_ReconFile.empty() ? NULL : strdup(cfg_ReconFile.c_str()); 117 147 118 #if H_3D148 #if NH_3D 119 149 m_pchScaleOffsetFile = cfg_ScaleOffsetFile.empty() ? NULL : strdup(cfg_ScaleOffsetFile.c_str()); 120 150 #endif 151 121 152 if (!m_pchBitstreamFile) 122 153 { 123 fprintf(stderr, "No input file specif ed, aborting\n");154 fprintf(stderr, "No input file specified, aborting\n"); 124 155 return false; 125 156 } … … 127 158 if ( !cfg_TargetDecLayerIdSetFile.empty() ) 128 159 { 129 #if H_MV160 #if NH_MV 130 161 m_targetDecLayerIdSetFileEmpty = false; 131 162 #endif … … 152 183 if ( layerIdParsed < 0 || layerIdParsed >= MAX_NUM_LAYER_IDS ) 153 184 { 154 fprintf(stderr, "Warning! Parsed LayerId %d is not within gallowed range [0,%d]. Ignoring this value.\n", layerIdParsed, MAX_NUM_LAYER_IDS-1 );185 fprintf(stderr, "Warning! Parsed LayerId %d is not within allowed range [0,%d]. Ignoring this value.\n", layerIdParsed, MAX_NUM_LAYER_IDS-1 ); 155 186 } 156 187 else … … 172 203 } 173 204 } 174 #if H_MV 175 m_targetDecLayerIdSet.push_back( 0 ); // Only base layer at startup 176 #endif 177 205 206 #if NH_MV 207 //m_targetDecLayerIdSet.push_back( 0 ); // Only base layer at startup 208 #endif 178 209 return true; 179 210 } 180 211 181 #if H_MV212 #if NH_MV 182 213 Void TAppDecCfg::xAppendToFileNameEnd( Char* pchInputFileName, const Char* pchStringToAppend, Char*& rpchOutputFileName) 183 214 {
Note: See TracChangeset for help on using the changeset viewer.