Changeset 1442 in SHVCSoftware for branches/SHM-dev/source/App
- Timestamp:
- 13 Aug 2015, 19:11:53 (9 years ago)
- Location:
- branches/SHM-dev/source/App
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev/source/App/TAppDecoder/TAppDecCfg.cpp
r1377 r1442 63 63 \param argv array of arguments 64 64 */ 65 Bool TAppDecCfg::parseCfg( Int argc, Char* argv[] )65 Bool TAppDecCfg::parseCfg( Int argc, TChar* argv[] ) 66 66 { 67 67 Bool do_help = false; 68 string cfg_BitstreamFile; 69 #if SVC_EXTENSION 70 string cfg_ReconFile [MAX_LAYERS]; 68 #if SVC_EXTENSION 71 69 Int layerNum, targetLayerId; 72 70 Int olsIdx; … … 74 72 string cfg_confPrefix; 75 73 #endif 76 #if AVC_BASE77 string cfg_BLReconFile;78 #endif79 #else80 string cfg_ReconFile;81 74 #endif 82 75 … … 90 83 91 84 ("help", do_help, false, "this help text") 92 ("BitstreamFile,b", cfg_BitstreamFile,string(""), "bitstream input file name")93 #if SVC_EXTENSION 94 ("ReconFileL%d,-o%d", cfg_ReconFile, string(""), MAX_LAYERS, "Layer %d reconstructed YUV output file name\n"85 ("BitstreamFile,b", m_bitstreamFileName, string(""), "bitstream input file name") 86 #if SVC_EXTENSION 87 ("ReconFileL%d,-o%d", m_reconFileName, string(""), MAX_LAYERS, "Layer %d reconstructed YUV output file name\n" 95 88 "YUV writing is skipped if omitted") 96 89 #if AVC_BASE 97 ("BLReconFile,-ibl", cfg_BLReconFile,string(""), "BL reconstructed YUV input file name")90 ("BLReconFile,-ibl", m_reconFileNameBL, string(""), "BL reconstructed YUV input file name") 98 91 #endif 99 92 ("TargetLayerId,-lid", targetLayerId, -1, "Target layer id") … … 105 98 #endif 106 99 #else 107 ("ReconFile,o", cfg_ReconFile,string(""), "reconstructed YUV output file name\n"100 ("ReconFile,o", m_reconFileName, string(""), "reconstructed YUV output file name\n" 108 101 "YUV writing is skipped if omitted") 109 102 #endif … … 134 127 po::setDefaults(opts); 135 128 po::ErrorReporter err; 136 const list<const Char*>& argv_unhandled = po::scanArgv(opts, argc, (constChar**) argv, err);137 138 for (list<const Char*>::const_iterator it = argv_unhandled.begin(); it != argv_unhandled.end(); it++)129 const list<const TChar*>& argv_unhandled = po::scanArgv(opts, argc, (const TChar**) argv, err); 130 131 for (list<const TChar*>::const_iterator it = argv_unhandled.begin(); it != argv_unhandled.end(); it++) 139 132 { 140 133 fprintf(stderr, "Unhandled argument ignored: `%s'\n", *it); … … 163 156 } 164 157 165 /* convert std::string to c string for compatability */166 m_pchBitstreamFile = cfg_BitstreamFile.empty() ? NULL : strdup(cfg_BitstreamFile.c_str());167 158 #if SVC_EXTENSION 168 159 if( targetLayerId < 0 ) … … 204 195 m_commonDecoderParams.setTargetOutputLayerSetIdx( olsIdx ); 205 196 m_commonDecoderParams.setTargetLayerId( targetLayerId ); 206 207 #if CONFORMANCE_BITSTREAM_MODE 208 for(Int layer = 0; layer < MAX_VPS_LAYER_IDX_PLUS1; layer++ ) 209 { 210 #else 211 for(UInt layer=0; layer<= m_tgtLayerId; layer++) 212 { 213 assert( layer < MAX_LAYERS ); 214 #endif 215 m_pchReconFile[layer] = cfg_ReconFile[layer].empty() ? NULL : strdup(cfg_ReconFile[layer].c_str()); 216 } 217 #if AVC_BASE 218 m_pchBLReconFile = cfg_BLReconFile.empty() ? NULL : strdup(cfg_BLReconFile.c_str()); 219 #endif 220 #else 221 m_pchReconFile = cfg_ReconFile.empty() ? NULL : strdup(cfg_ReconFile.c_str()); 222 #endif 223 224 if (!m_pchBitstreamFile) 197 #endif 198 199 if (m_bitstreamFileName.empty()) 225 200 { 226 201 fprintf(stderr, "No input file specified, aborting\n"); -
branches/SHM-dev/source/App/TAppDecoder/TAppDecCfg.h
r1323 r1442 57 57 { 58 58 protected: 59 Char* m_pchBitstreamFile;///< input bitstream file name59 std::string m_bitstreamFileName; ///< input bitstream file name 60 60 #if SVC_EXTENSION 61 Char* m_pchReconFile [MAX_LAYERS];///< output reconstruction file name61 std::string m_reconFileName[MAX_LAYERS]; ///< output reconstruction file name 62 62 #else 63 Char* m_pchReconFile;///< output reconstruction file name63 std::string m_reconFileName; ///< output reconstruction file name 64 64 #endif 65 65 Int m_iSkipFrame; ///< counter for frames prior to the random access point to skip … … 84 84 #if SVC_EXTENSION 85 85 #if AVC_BASE 86 Char* m_pchBLReconFile; ///< input BL reconstruction file name86 std::string m_reconFileNameBL; ///< input BL reconstruction file name 87 87 #endif 88 88 CommonDecoderParams m_commonDecoderParams; … … 99 99 public: 100 100 TAppDecCfg() 101 : m_ pchBitstreamFile(NULL)101 : m_bitstreamFileName() 102 102 #if !SVC_EXTENSION 103 , m_ pchReconFile(NULL)103 , m_reconFileName() 104 104 #endif 105 105 , m_iSkipFrame(0) 106 // m_outputBitDepth array initialised below 106 107 , m_outputColourSpaceConvert(IPCOLOURSPACE_UNCHANGED) 107 108 , m_iMaxTemporalLayer(-1) 108 109 , m_decodedPictureHashSEIEnabled(0) 109 110 , m_decodedNoDisplaySEIEnabled(false) 111 , m_targetDecLayerIdSet() 110 112 #if Q0074_COLOUR_REMAPPING_SEI 111 113 , m_colourRemapSEIEnabled(0) … … 115 117 , m_forceDecodeBitDepth(0) 116 118 #endif 119 , m_outputDecodedSEIMessagesFilename() 120 , m_bClipOutputVideoToRec709Range(false) 117 121 { 118 122 for (UInt channelTypeIndex = 0; channelTypeIndex < MAX_NUM_CHANNEL_TYPE; channelTypeIndex++) … … 124 128 virtual ~TAppDecCfg() {} 125 129 126 Bool parseCfg ( Int argc, Char* argv[] ); ///< initialize option class from configuration130 Bool parseCfg ( Int argc, TChar* argv[] ); ///< initialize option class from configuration 127 131 128 132 #if SVC_EXTENSION -
branches/SHM-dev/source/App/TAppDecoder/TAppDecTop.cpp
r1420 r1442 90 90 Void TAppDecTop::destroy() 91 91 { 92 if (m_pchBitstreamFile) 93 { 94 free (m_pchBitstreamFile); 95 m_pchBitstreamFile = NULL; 96 } 92 m_bitstreamFileName.clear(); 97 93 #if SVC_EXTENSION 98 94 #if CONFORMANCE_BITSTREAM_MODE … … 102 98 #endif 103 99 { 104 if( m_pchReconFile[i] ) 105 { 106 free ( m_pchReconFile[i] ); 107 m_pchReconFile[i] = NULL; 108 } 100 m_reconFileName[i].clear(); 109 101 110 102 if( m_apcTDecTop[i] ) … … 121 113 } 122 114 #if AVC_BASE 123 if( m_pchBLReconFile ) 124 { 125 free ( m_pchBLReconFile ); 126 m_pchBLReconFile = NULL; 127 } 128 #endif 129 #else 130 if (m_pchReconFile) 131 { 132 free (m_pchReconFile); 133 m_pchReconFile = NULL; 134 } 115 m_reconFileNameBL.clear(); 116 #endif 117 #else 118 m_reconFileName.clear(); 135 119 #endif 136 120 #if Q0074_COLOUR_REMAPPING_SEI … … 160 144 TComList<TComPic*>* pcListPic = NULL; 161 145 162 ifstream bitstreamFile(m_ pchBitstreamFile, ifstream::in | ifstream::binary);146 ifstream bitstreamFile(m_bitstreamFileName.c_str(), ifstream::in | ifstream::binary); 163 147 if (!bitstreamFile) 164 148 { 165 fprintf(stderr, "\nfailed to open bitstream file `%s' for reading\n", m_ pchBitstreamFile);149 fprintf(stderr, "\nfailed to open bitstream file `%s' for reading\n", m_bitstreamFileName.c_str()); 166 150 exit(EXIT_FAILURE); 167 151 } … … 203 187 TComPic pcBLPic; 204 188 fstream streamYUV; 205 if( m_pchBLReconFile)206 { 207 streamYUV.open( m_ pchBLReconFile, fstream::in | fstream::binary );189 if( !m_reconFileNameBL.empty() ) 190 { 191 streamYUV.open( m_reconFileNameBL, fstream::in | fstream::binary ); 208 192 } 209 193 TComList<TComPic*> *cListPic = m_apcTDecTop[0]->getListPic(); … … 329 313 if( pcListPic ) 330 314 { 331 if ( m_pchReconFile[curLayerId]&& !openedReconFile[curLayerId] )315 if ( !m_reconFileName[curLayerId].empty() && !openedReconFile[curLayerId] ) 332 316 { 333 317 const BitDepths &bitDepths=pcListPic->front()->getSlice(0)->getBitDepths(); // use bit depths of first reconstructed picture. … … 339 323 } 340 324 } 341 m_apcTVideoIOYuvReconFile[curLayerId]->open( m_ pchReconFile[curLayerId], true, m_outputBitDepth, m_outputBitDepth, bitDepths.recon ); // write mode325 m_apcTVideoIOYuvReconFile[curLayerId]->open( m_reconFileName[curLayerId], true, m_outputBitDepth, m_outputBitDepth, bitDepths.recon ); // write mode 342 326 343 327 openedReconFile[curLayerId] = true; … … 442 426 TComList<TComPic*>* pcListPic = NULL; 443 427 444 ifstream bitstreamFile(m_ pchBitstreamFile, ifstream::in | ifstream::binary);428 ifstream bitstreamFile(m_bitstreamFileName.c_str(), ifstream::in | ifstream::binary); 445 429 if (!bitstreamFile) 446 430 { 447 fprintf(stderr, "\nfailed to open bitstream file `%s' for reading\n", m_ pchBitstreamFile);431 fprintf(stderr, "\nfailed to open bitstream file `%s' for reading\n", m_bitstreamFileName.c_str()); 448 432 exit(EXIT_FAILURE); 449 433 } … … 548 532 if( pcListPic ) 549 533 { 550 if ( m_pchReconFile && !openedReconFile)534 if ( (!m_reconFileName.empty()) && (!openedReconFile) ) 551 535 { 552 536 const BitDepths &bitDepths=pcListPic->front()->getPicSym()->getSPS().getBitDepths(); // use bit depths of first reconstructed picture. … … 559 543 } 560 544 561 m_cTVideoIOYuvReconFile.open( m_ pchReconFile, true, m_outputBitDepth, m_outputBitDepth, bitDepths.recon ); // write mode545 m_cTVideoIOYuvReconFile.open( m_reconFileName, true, m_outputBitDepth, m_outputBitDepth, bitDepths.recon ); // write mode 562 546 openedReconFile = true; 563 547 } … … 648 632 #endif 649 633 { 650 if ( m_pchReconFile[layer])634 if ( !m_reconFileName[layer].empty() ) 651 635 { 652 636 m_apcTVideoIOYuvReconFile[layer]->close(); … … 657 641 } 658 642 #else 659 if ( m_pchReconFile)660 { 661 m_cTVideoIOYuvReconFile. 643 if ( !m_reconFileName.empty() ) 644 { 645 m_cTVideoIOYuvReconFile.close(); 662 646 } 663 647 … … 792 776 numPicsNotYetDisplayed = numPicsNotYetDisplayed-2; 793 777 #if SVC_EXTENSION 794 if ( m_pchReconFile[layerId])778 if ( !m_reconFileName[layerId].empty() ) 795 779 { 796 780 const Window &conf = pcPicTop->getConformanceWindow(); … … 826 810 m_aiPOCLastDisplay[layerId] = pcPicBottom->getPOC(); 827 811 #else 828 if ( m_pchReconFile)812 if ( !m_reconFileName.empty() ) 829 813 { 830 814 const Window &conf = pcPicTop->getConformanceWindow(); … … 901 885 } 902 886 #if SVC_EXTENSION 903 if ( m_pchReconFile[layerId])887 if ( !m_reconFileName[layerId].empty() ) 904 888 { 905 889 const Window &conf = pcPic->getConformanceWindow(); … … 920 904 m_aiPOCLastDisplay[layerId] = pcPic->getPOC(); 921 905 #else 922 if ( m_pchReconFile)906 if ( !m_reconFileName.empty() ) 923 907 { 924 908 const Window &conf = pcPic->getConformanceWindow(); … … 1024 1008 // write to file 1025 1009 #if SVC_EXTENSION 1026 if ( m_pchReconFile[layerId])1010 if ( !m_reconFileName[layerId].empty() ) 1027 1011 { 1028 1012 const Window &conf = pcPicTop->getConformanceWindow(); … … 1043 1027 m_aiPOCLastDisplay[layerId] = pcPicBottom->getPOC(); 1044 1028 #else 1045 if ( m_pchReconFile)1029 if ( !m_reconFileName.empty() ) 1046 1030 { 1047 1031 const Window &conf = pcPicTop->getConformanceWindow(); … … 1103 1087 // write to file 1104 1088 #if SVC_EXTENSION 1105 if ( m_pchReconFile[layerId])1089 if ( !m_reconFileName[layerId].empty() ) 1106 1090 { 1107 1091 const Window &conf = pcPic->getConformanceWindow(); … … 1123 1107 m_aiPOCLastDisplay[layerId] = pcPic->getPOC(); 1124 1108 #else 1125 if ( m_pchReconFile)1109 if ( !m_reconFileName.empty() ) 1126 1110 { 1127 1111 const Window &conf = pcPic->getConformanceWindow(); … … 1234 1218 #if ALIGNED_BUMPING 1235 1219 // Function outputs a picture, and marks it as not needed for output. 1236 Void TAppDecTop::xOutputAndMarkPic( TComPic *pic, const Char *reconFile, const Int layerId, Int &pocLastDisplay, DpbStatus &dpbStatus )1237 { 1238 if ( reconFile)1220 Void TAppDecTop::xOutputAndMarkPic( TComPic *pic, std::string& reconFileName, const Int layerId, Int &pocLastDisplay, DpbStatus &dpbStatus ) 1221 { 1222 if( !reconFileName.empty() ) 1239 1223 { 1240 1224 const Window &conf = pic->getConformanceWindow(); … … 1488 1472 TComPic *pic = *iterPic; 1489 1473 1490 xOutputAndMarkPic( pic, m_ pchReconFile[layerId], layerId, m_aiPOCLastDisplay[layerId], dpbStatus );1474 xOutputAndMarkPic( pic, m_reconFileName[layerId], layerId, m_aiPOCLastDisplay[layerId], dpbStatus ); 1491 1475 1492 1476 #if CONFORMANCE_BITSTREAM_MODE … … 1961 1945 1962 1946 //Write remapped picture in decoding order 1963 Char cTemp[255];1947 TChar cTemp[255]; 1964 1948 sprintf(cTemp, "seiColourRemappedPic_L%d_%dx%d_%dbits.yuv", layerId, iWidth, iHeight, storeCriSEI[layerId].m_colourRemapBitDepth ); 1965 1949 picColourRemapped.dump( cTemp, true, storeCriSEI[layerId].m_colourRemapBitDepth ); … … 1974 1958 if (storeCriSEI[layerId].m_colourRemapBitDepth == 8 || storeCriSEI[layerId].m_colourRemapBitDepth == 10) 1975 1959 { 1976 Char cTemp[255];1960 TChar cTemp[255]; 1977 1961 sprintf(cTemp, "seiColourRemappedPic_L%d_%dx%d_%dbits.yuv", layerId, pic.getWidth(COMPONENT_Y), pic.getHeight(COMPONENT_Y), storeCriSEI[layerId].m_colourRemapBitDepth ); 1978 1962 pic.dump( cTemp, true, storeCriSEI[layerId].m_colourRemapBitDepth ); -
branches/SHM-dev/source/App/TAppDecoder/TAppDecTop.h
r1378 r1442 136 136 Void flushAllPictures(Int layerId, Bool outputPictures); 137 137 138 Void xOutputAndMarkPic( TComPic *pic, const Char *reconFile, const Int layerId, Int &pocLastDisplay, DpbStatus &dpbStatus);138 Void xOutputAndMarkPic( TComPic *pic, std::string& reconFileName, const Int layerId, Int &pocLastDisplay, DpbStatus &dpbStatus); 139 139 Void outputAllPictures(Int layerId, Bool notOutputCurrAu); 140 140 Void xFindDPBStatus( std::vector<Int> &listOfPocs -
branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.cpp
r1441 r1442 110 110 TAppEncCfg::TAppEncCfg() 111 111 #if AVC_BASE 112 : m_nonHEVCBaseLayerFlag( 0)112 : m_nonHEVCBaseLayerFlag(false) 113 113 #endif 114 114 , m_maxTidRefPresentFlag(1) 115 115 , m_defaultTargetOutputLayerIdc (-1) 116 116 , m_numOutputLayerSets (-1) 117 , m_pchBitstreamFile()118 117 , m_inputColourSpaceConvert(IPCOLOURSPACE_UNCHANGED) 119 118 , m_snrInternalColourSpace(false) … … 126 125 #else 127 126 TAppEncCfg::TAppEncCfg() 128 : m_pchInputFile() 129 , m_pchBitstreamFile() 130 , m_pchReconFile() 131 , m_inputColourSpaceConvert(IPCOLOURSPACE_UNCHANGED) 127 : m_inputColourSpaceConvert(IPCOLOURSPACE_UNCHANGED) 132 128 , m_snrInternalColourSpace(false) 133 129 , m_outputInternalColourSpace(false) 134 , m_pchdQPFile()135 , m_scalingListFile()136 130 { 137 131 m_aidQP = NULL; … … 164 158 m_targetPivotValue = NULL; 165 159 } 166 167 free(m_pchInputFile); 168 #endif 169 free(m_pchBitstreamFile); 170 #if !SVC_EXTENSION 171 free(m_pchReconFile); 172 free(m_pchdQPFile); 173 free(m_scalingListFile); 174 #endif 160 #endif 175 161 } 176 162 … … 240 226 } 241 227 242 Bool confirmPara(Bool bflag, const Char* message);228 Bool confirmPara(Bool bflag, const TChar* message); 243 229 244 230 static inline ChromaFormat numberToChromaFormat(const Int val) … … 254 240 } 255 241 256 #if SVC_EXTENSION257 void TAppEncCfg::getDirFilename(string& filename, string& dir, const string path)258 {259 size_t pos = path.find_last_of("\\");260 if(pos != std::string::npos)261 {262 filename.assign(path.begin() + pos + 1, path.end());263 dir.assign(path.begin(), path.begin() + pos + 1);264 }265 else266 {267 pos = path.find_last_of("/");268 if(pos != std::string::npos)269 {270 filename.assign(path.begin() + pos + 1, path.end());271 dir.assign(path.begin(), path.begin() + pos + 1);272 }273 else274 {275 filename = path;276 dir.assign("");277 }278 }279 }280 #endif281 282 242 static const struct MapStrToProfile 283 243 { 284 const Char* str;244 const TChar* str; 285 245 Profile::Name value; 286 246 } … … 302 262 static const struct MapStrToExtendedProfile 303 263 { 304 const Char* str;264 const TChar* str; 305 265 ExtendedProfileName value; 306 266 } … … 366 326 static const struct MapStrToTier 367 327 { 368 const Char* str;328 const TChar* str; 369 329 Level::Tier value; 370 330 } … … 377 337 static const struct MapStrToLevel 378 338 { 379 const Char* str;339 const TChar* str; 380 340 Level::Name value; 381 341 } … … 410 370 static const struct MapStrToCostMode 411 371 { 412 const Char* str;372 const TChar* str; 413 373 CostMode value; 414 374 } … … 423 383 static const struct MapStrToScalingListMode 424 384 { 425 const Char* str;385 const TChar* str; 426 386 ScalingListMode value; 427 387 } … … 526 486 SMultiValueInput<T> &operator=(const SMultiValueInput<T> &userValues) { values=userValues.values; return *this; } 527 487 528 T readValue(const Char *&pStr, Bool &bSuccess);488 T readValue(const TChar *&pStr, Bool &bSuccess); 529 489 530 490 istream& readValues(std::istream &in); … … 538 498 539 499 template<> 540 UInt SMultiValueInput<UInt>::readValue(const Char *&pStr, Bool &bSuccess)500 UInt SMultiValueInput<UInt>::readValue(const TChar *&pStr, Bool &bSuccess) 541 501 { 542 Char *eptr;502 TChar *eptr; 543 503 UInt val=strtoul(pStr, &eptr, 0); 544 504 pStr=eptr; … … 548 508 549 509 template<> 550 Int SMultiValueInput<Int>::readValue(const Char *&pStr, Bool &bSuccess)510 Int SMultiValueInput<Int>::readValue(const TChar *&pStr, Bool &bSuccess) 551 511 { 552 Char *eptr;512 TChar *eptr; 553 513 Int val=strtol(pStr, &eptr, 0); 554 514 pStr=eptr; … … 558 518 559 519 template<> 560 Double SMultiValueInput<Double>::readValue(const Char *&pStr, Bool &bSuccess)520 Double SMultiValueInput<Double>::readValue(const TChar *&pStr, Bool &bSuccess) 561 521 { 562 Char *eptr;522 TChar *eptr; 563 523 Double val=strtod(pStr, &eptr); 564 524 pStr=eptr; … … 568 528 569 529 template<> 570 Bool SMultiValueInput<Bool>::readValue(const Char *&pStr, Bool &bSuccess)530 Bool SMultiValueInput<Bool>::readValue(const TChar *&pStr, Bool &bSuccess) 571 531 { 572 Char *eptr;532 TChar *eptr; 573 533 Int val=strtol(pStr, &eptr, 0); 574 534 pStr=eptr; … … 588 548 if (!str.empty()) 589 549 { 590 const Char *pStr=str.c_str();550 const TChar *pStr=str.c_str(); 591 551 // soak up any whitespace 592 552 for(;isspace(*pStr);pStr++); … … 703 663 // ==================================================================================================================== 704 664 705 #if SVC_EXTENSION706 665 /** \param argc number of arguments 707 666 \param argv array of arguments 708 667 \retval true when success 709 668 */ 710 Bool TAppEncCfg::parseCfgNumLayersAndInit( Int argc, Char* argv[] ) 711 { 712 po::Options opts; 713 opts.addOptions() 714 ("c", po::parseConfigFile, "configuration file name") 715 ("NumLayers", m_numLayers, 1, "Number of layers to code") 716 ; 717 718 po::setDefaults(opts); 719 po::ErrorReporter err; 720 err.verbose = false; 721 po::scanArgv(opts, argc, (const Char**) argv, err); 722 723 if( m_numLayers <= 0 ) 724 { 725 printf("Wrong number of layers %d\n", m_numLayers); 726 return false; 727 } 728 729 for( Int layer = 0; layer < m_numLayers; layer++ ) 730 { 731 m_apcLayerCfg[layer] = new TAppEncLayerCfg; 732 m_apcLayerCfg[layer]->setAppEncCfg(this); 733 } 734 735 return true; 736 } 737 #endif 738 739 /** \param argc number of arguments 740 \param argv array of arguments 741 \retval true when success 742 */ 743 Bool TAppEncCfg::parseCfg( Int argc, Char* argv[] ) 669 Bool TAppEncCfg::parseCfg( Int argc, TChar* argv[] ) 744 670 { 745 671 Bool do_help = false; 746 672 747 #if SVC_EXTENSION 748 string cfg_BitstreamFile;749 string* cfg_ InputFile[MAX_LAYERS];750 string* cfg_ ReconFile[MAX_LAYERS];751 Double* cfg_fQP 752 Int* cfg_layerId 673 #if SVC_EXTENSION 674 string* cfg_InputFile [MAX_LAYERS]; 675 string* cfg_ReconFile [MAX_LAYERS]; 676 string* cfg_dQPFileName [MAX_LAYERS]; 677 Double* cfg_fQP [MAX_LAYERS]; 678 Int* cfg_layerId [MAX_LAYERS]; 753 679 Int* cfg_repFormatIdx [MAX_LAYERS]; 754 680 Int* cfg_SourceWidth [MAX_LAYERS]; … … 848 774 Int* cfg_maxTidIlRefPicsPlus1[MAX_LAYERS]; 849 775 #if Q0074_COLOUR_REMAPPING_SEI 850 string* cfg_colourRemapSEIFile Root[MAX_LAYERS];776 string* cfg_colourRemapSEIFileName[MAX_LAYERS]; 851 777 #endif 852 778 Int* cfg_waveFrontSynchro[MAX_LAYERS]; … … 861 787 for( UInt layer = 0; layer < m_numLayers; layer++ ) 862 788 { 863 cfg_InputFile[layer] = &m_apcLayerCfg[layer]->m_cInputFile; 864 cfg_ReconFile[layer] = &m_apcLayerCfg[layer]->m_cReconFile; 789 cfg_InputFile[layer] = &m_apcLayerCfg[layer]->m_inputFileName; 790 cfg_ReconFile[layer] = &m_apcLayerCfg[layer]->m_reconFileName; 791 cfg_dQPFileName[layer] = &m_apcLayerCfg[layer]->m_dQPFileName; 865 792 cfg_fQP[layer] = &m_apcLayerCfg[layer]->m_fQP; 866 793 #if Q0074_COLOUR_REMAPPING_SEI 867 cfg_colourRemapSEIFile Root[layer] = &m_apcLayerCfg[layer]->m_colourRemapSEIFileRoot;794 cfg_colourRemapSEIFileName[layer] = &m_apcLayerCfg[layer]->m_colourRemapSEIFileName; 868 795 #endif 869 796 cfg_repFormatIdx[layer] = &m_apcLayerCfg[layer]->m_repFormatIdx; … … 979 906 string* cfg_listOfLayerPTLOfOlss = new string[MAX_VPS_OUTPUT_LAYER_SETS_PLUS1]; 980 907 #if AVC_BASE 981 string cfg_BLInputFile;908 string m_inputFileNameBL; 982 909 #endif 983 910 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI 984 string cfg_tileSets; 985 #endif 986 #else //SVC_EXTENSION 987 string cfg_InputFile; 988 string cfg_BitstreamFile; 989 string cfg_ReconFile; 990 string cfg_dQPFile; 991 #if Q0074_COLOUR_REMAPPING_SEI 992 string cfg_colourRemapSEIFileRoot; 993 #endif 994 string cfg_ScalingListFile; 911 string m_tileSets; 912 #endif 995 913 #endif //SVC_EXTENSION 996 914 … … 1121 1039 ("ScalabilityMask3", m_scalabilityMask[AUX_ID], 0, "scalability_mask[3] (auxiliary pictures)" ) 1122 1040 #endif 1123 ("BitstreamFile,b", cfg_BitstreamFile,string(""), "Bitstream output file name")1124 ("NumRefLocationOffsets%d", cfg_numRefLayerLocationOffsets, 0, m_numLayers, 1041 ("BitstreamFile,b", m_bitstreamFileName, string(""), "Bitstream output file name") 1042 ("NumRefLocationOffsets%d", cfg_numRefLayerLocationOffsets, 0, m_numLayers, "Number of reference layer offset sets ") 1125 1043 ("RefLocationOffsetLayerId%d", cfg_refLocationOffsetLayerIdPtr, string(""), m_numLayers, "Layer ID of reference location offset") 1126 1044 ("ScaledRefLayerLeftOffset%d", cfg_scaledRefLayerLeftOffsetPtr, string(""), m_numLayers, "Horizontal offset of top-left luma sample of scaled base layer picture with respect to" … … 1148 1066 ("PhaseVerChroma%d", cfg_phaseVerChromaPtr, string(""), m_numLayers, "chroma shift in the vertical direction used in resampling proces") 1149 1067 #if Q0074_COLOUR_REMAPPING_SEI 1150 ("SEIColourRemappingInfoFileRoot%d", cfg_colourRemapSEIFile Root, string(""), m_numLayers, "Colour Remapping Information SEI parameters file name for layer %d")1068 ("SEIColourRemappingInfoFileRoot%d", cfg_colourRemapSEIFileName, string(""), m_numLayers, "Colour Remapping Information SEI parameters file name for layer %d") 1151 1069 #endif 1152 1070 ("InputBitDepth%d", cfg_InputBitDepth[CHANNEL_TYPE_LUMA], 8, m_numLayers, "Bit-depth of input file for layer %d") … … 1165 1083 ("InterLayerWeightedPred", m_useInterLayerWeightedPred, false, "enable IL WP parameters estimation at encoder" ) 1166 1084 #if AVC_BASE 1167 ("NonHEVCBase,-nonhevc", m_nonHEVCBaseLayerFlag, 0, "BL is available but not internal")1168 ("InputBLFile,-ibl", cfg_BLInputFile,string(""), "Base layer rec YUV input file name")1085 ("NonHEVCBase,-nonhevc", m_nonHEVCBaseLayerFlag, false, "BL is available but not internal") 1086 ("InputBLFile,-ibl", m_inputFileNameBL, string(""), "Base layer rec YUV input file name") 1169 1087 #endif 1170 1088 ("EnableElRapB,-use-rap-b", m_elRapSliceBEnabled, false, "Set ILP over base-layer I picture to B picture (default is P picture)") … … 1172 1090 ("ChromaFormatIDC,-cf", tmpChromaFormat, 0, "ChromaFormatIDC (400|420|422|444 or set 0 (default) for same as InputChromaFormat)") 1173 1091 #else //SVC_EXTENSION 1174 ("InputFile,i", cfg_InputFile,string(""), "Original YUV input file name")1175 ("BitstreamFile,b", cfg_BitstreamFile,string(""), "Bitstream output file name")1176 ("ReconFile,o", cfg_ReconFile,string(""), "Reconstructed YUV output file name")1092 ("InputFile,i", m_inputFileName, string(""), "Original YUV input file name") 1093 ("BitstreamFile,b", m_bitstreamFileName, string(""), "Bitstream output file name") 1094 ("ReconFile,o", m_reconFileName, string(""), "Reconstructed YUV output file name") 1177 1095 ("SourceWidth,-wdt", m_iSourceWidth, 0, "Source picture width") 1178 1096 ("SourceHeight,-hgt", m_iSourceHeight, 0, "Source picture height") … … 1217 1135 ("FrameRate,-fr", m_iFrameRate, 0, "Frame rate") 1218 1136 #if Q0074_COLOUR_REMAPPING_SEI 1219 ("SEIColourRemappingInfoFileRoot", cfg_colourRemapSEIFileRoot,string(""), "Colour Remapping Information SEI parameters file name")1137 ("SEIColourRemappingInfoFileRoot", m_colourRemapSEIFileName, string(""), "Colour Remapping Information SEI parameters file name") 1220 1138 #endif 1221 1139 #endif //SVC_EXTENSION … … 1362 1280 ("AdaptiveQP,-aq", m_bUseAdaptiveQP, false, "QP adaptation based on a psycho-visual model") 1363 1281 ("MaxQPAdaptationRange,-aqr", m_iQPAdaptationRange, 6, "QP adaptation range") 1364 #if !SVC_EXTENSION 1365 ("dQPFile,m", cfg_dQPFile, string(""), "dQP file name") 1282 #if SVC_EXTENSION 1283 ("dQPFile,m", cfg_dQPFileName, string(""), m_numLayers, "dQP file name") 1284 #else 1285 ("dQPFile,m", m_dQPFileName, string(""), "dQP file name") 1366 1286 #endif 1367 1287 ("RDOQ", m_useRDOQ, true) … … 1452 1372 ("WaveFrontSynchro", m_iWaveFrontSynchro, 0, "0: no synchro; 1 synchro with top-right-right") 1453 1373 ("ScalingList", m_useScalingListId, SCALING_LIST_OFF, "0/off: no scaling list, 1/default: default scaling lists, 2/file: scaling lists specified in ScalingListFile") 1454 ("ScalingListFile", cfg_ScalingListFile,string(""), "Scaling list file name. Use an empty string to produce help.")1374 ("ScalingListFile", m_scalingListFileName, string(""), "Scaling list file name. Use an empty string to produce help.") 1455 1375 #endif 1456 1376 ("SignHideFlag,-SBH", m_signHideFlag, true) … … 1714 1634 ("SEIInterLayerConstrainedTileSets", m_interLayerConstrainedTileSetsSEIEnabled, false, "Control generation of inter layer constrained tile sets SEI message") 1715 1635 ("IlNumSetsInMessage", m_ilNumSetsInMessage, 0u, "Number of inter layer constrained tile sets") 1716 ("TileSetsArray", cfg_tileSets,string(""), "Array containing tile sets params (TopLeftTileIndex, BottonRightTileIndex and ilcIdc for each set) ")1636 ("TileSetsArray", m_tileSets, string(""), "Array containing tile sets params (TopLeftTileIndex, BottonRightTileIndex and ilcIdc for each set) ") 1717 1637 #endif 1718 1638 ("AltOutputLayerFlag", m_altOutputLayerFlag, false, "Specifies the value of alt_output_layer_flag in VPS extension") … … 1753 1673 po::setDefaults(opts); 1754 1674 po::ErrorReporter err; 1755 const list<const Char*>& argv_unhandled = po::scanArgv(opts, argc, (const Char**) argv, err); 1756 1757 #if SVC_EXTENSION 1675 const list<const TChar*>& argv_unhandled = po::scanArgv(opts, argc, (const TChar**) argv, err); 1676 1677 #if SVC_EXTENSION 1678 #if AVC_BASE 1679 if( m_nonHEVCBaseLayerFlag ) 1680 { 1681 *cfg_InputFile[0] = m_inputFileNameBL; 1682 } 1683 #endif 1684 1758 1685 for (Int i=1; i<m_numLayers; i++) 1759 1686 { … … 1775 1702 #endif 1776 1703 1777 for (list<const Char*>::const_iterator it = argv_unhandled.begin(); it != argv_unhandled.end(); it++)1704 for (list<const TChar*>::const_iterator it = argv_unhandled.begin(); it != argv_unhandled.end(); it++) 1778 1705 { 1779 1706 fprintf(stderr, "Unhandled argument ignored: `%s'\n", *it); … … 1799 1726 * Set any derived parameters 1800 1727 */ 1801 /* convert std::string to c string for compatability */1802 #if SVC_EXTENSION1803 #if AVC_BASE1804 if( m_nonHEVCBaseLayerFlag )1805 {1806 *cfg_InputFile[0] = cfg_BLInputFile;1807 }1808 #endif1809 #else //SVC_EXTENSION1810 m_pchInputFile = cfg_InputFile.empty() ? NULL : strdup(cfg_InputFile.c_str());1811 #endif1812 m_pchBitstreamFile = cfg_BitstreamFile.empty() ? NULL : strdup(cfg_BitstreamFile.c_str());1813 #if !SVC_EXTENSION1814 m_pchReconFile = cfg_ReconFile.empty() ? NULL : strdup(cfg_ReconFile.c_str());1815 m_pchdQPFile = cfg_dQPFile.empty() ? NULL : strdup(cfg_dQPFile.c_str());1816 #if Q0074_COLOUR_REMAPPING_SEI1817 if( !cfg_colourRemapSEIFileRoot.empty() )1818 {1819 m_colourRemapSEIFileRoot = strdup(cfg_colourRemapSEIFileRoot.c_str());1820 }1821 #endif1822 #endif //SVC_EXTENSION1823 1824 1728 1825 1729 m_adIntraLambdaModifier = cfg_adIntraLambdaModifier.values; … … 1895 1799 m_tileRowHeight.clear(); 1896 1800 } 1897 1898 /* rules for input, output and internal bitdepths as per help text */ 1801 1899 1802 #if SVC_EXTENSION 1900 1803 for( Int layer = 0; layer < m_numLayers; layer++ ) 1901 1804 { 1902 m_apcLayerCfg[layer]->m_scalingListFile = cfg_ScalingListFile[layer].empty() ? NULL : strdup(cfg_ScalingListFile[layer].c_str());1805 m_apcLayerCfg[layer]->m_scalingListFileName = cfg_ScalingListFile[layer].empty() ? NULL : strdup(cfg_ScalingListFile[layer].c_str()); 1903 1806 1904 1807 if( m_apcLayerCfg[layer]->m_layerId < 0 ) … … 2034 1937 } 2035 1938 #else 2036 m_scalingListFile = cfg_ScalingListFile.empty() ? NULL : strdup(cfg_ScalingListFile.c_str());2037 2038 1939 /* rules for input, output and internal bitdepths as per help text */ 2039 1940 if (m_MSBExtendedBitDepth[CHANNEL_TYPE_LUMA ] == 0) … … 2436 2337 } 2437 2338 2438 Char* pSamplePredRefLayerIds = cfg_samplePredRefLayerIds[layer].empty() ? NULL: strdup(cfg_samplePredRefLayerIds[layer].c_str());2339 TChar* pSamplePredRefLayerIds = cfg_samplePredRefLayerIds[layer].empty() ? NULL: strdup(cfg_samplePredRefLayerIds[layer].c_str()); 2439 2340 if( m_apcLayerCfg[layer]->m_numSamplePredRefLayers > 0 ) 2440 2341 { … … 2471 2372 } 2472 2373 2473 Char* pMotionPredRefLayerIds = cfg_motionPredRefLayerIds[layer].empty() ? NULL: strdup(cfg_motionPredRefLayerIds[layer].c_str());2374 TChar* pMotionPredRefLayerIds = cfg_motionPredRefLayerIds[layer].empty() ? NULL: strdup(cfg_motionPredRefLayerIds[layer].c_str()); 2474 2375 if( m_apcLayerCfg[layer]->m_numMotionPredRefLayers > 0 ) 2475 2376 { … … 2506 2407 } 2507 2408 2508 Char* pPredLayerIds = cfg_predLayerIds[layer].empty() ? NULL: strdup(cfg_predLayerIds[layer].c_str());2409 TChar* pPredLayerIds = cfg_predLayerIds[layer].empty() ? NULL: strdup(cfg_predLayerIds[layer].c_str()); 2509 2410 if( m_apcLayerCfg[layer]->m_numActiveRefLayers > 0 ) 2510 2411 { 2511 char *refLayerId;2512 int i=0;2412 TChar *refLayerId; 2413 Int i=0; 2513 2414 m_apcLayerCfg[layer]->m_predLayerIds = new Int[m_apcLayerCfg[layer]->m_numActiveRefLayers]; 2514 2415 refLayerId = strtok(pPredLayerIds, " ,-"); … … 2661 2562 Double& m_fQP = m_apcLayerCfg[layer]->m_fQP; 2662 2563 2663 Char* m_pchdQPFile = m_apcLayerCfg[layer]->m_pchdQPFile;2564 string& m_dQPFileName = m_apcLayerCfg[layer]->m_dQPFileName; 2664 2565 Int* m_internalBitDepth = m_apcLayerCfg[layer]->m_internalBitDepth; 2665 2566 #endif //SVC_EXTENSION 2567 2666 2568 switch (m_conformanceWindowMode) 2667 2569 { … … 2778 2680 2779 2681 // reading external dQP description from file 2780 if ( m_pchdQPFile ) 2781 { 2782 FILE* fpt=fopen( m_pchdQPFile, "r" ); 2682 if ( !m_dQPFileName.empty() ) 2683 { 2684 FILE* fpt=fopen( m_dQPFileName.c_str(), "r" ); 2685 2783 2686 if ( fpt ) 2784 2687 { … … 2965 2868 exit( EXIT_FAILURE ); 2966 2869 } 2967 Char* pTileSets = cfg_tileSets.empty() ? NULL : strdup(cfg_tileSets.c_str());2870 TChar* pTileSets = m_tileSets.empty() ? NULL : strdup(m_tileSets.c_str()); 2968 2871 int i = 0; 2969 char *topLeftTileIndex = strtok(pTileSets, " ,");2872 TChar *topLeftTileIndex = strtok(pTileSets, " ,"); 2970 2873 while(topLeftTileIndex != NULL) 2971 2874 { … … 3161 3064 #define xConfirmPara(a,b) check_failed |= confirmPara(a,b) 3162 3065 3163 xConfirmPara(m_ pchBitstreamFile==NULL, "A bitstream file name must be specified (BitstreamFile)");3066 xConfirmPara(m_bitstreamFileName.empty(), "A bitstream file name must be specified (BitstreamFile)"); 3164 3067 const UInt maxBitDepth=(m_chromaFormatIDC==CHROMA_400) ? m_internalBitDepth[CHANNEL_TYPE_LUMA] : std::max(m_internalBitDepth[CHANNEL_TYPE_LUMA], m_internalBitDepth[CHANNEL_TYPE_CHROMA]); 3165 3068 xConfirmPara(m_bitDepthConstraint<maxBitDepth, "The internalBitDepth must not be greater than the bitDepthConstraint value"); … … 4394 4297 } 4395 4298 4396 const Char *profileToString(const Profile::Name profile)4299 const TChar *profileToString(const Profile::Name profile) 4397 4300 { 4398 4301 static const UInt numberOfProfiles = sizeof(strToProfile)/sizeof(*strToProfile); … … 4454 4357 Int& m_iSourceHeight = m_apcLayerCfg[layerIdx]->m_iSourceHeight; 4455 4358 4456 const Char* m_pchInputFile = m_apcLayerCfg[layerIdx]->m_cInputFile.c_str();4457 const Char* m_pchReconFile = m_apcLayerCfg[layerIdx]->m_cReconFile.c_str();4359 string& m_inputFileName = m_apcLayerCfg[layerIdx]->m_inputFileName; 4360 string& m_reconFileName = m_apcLayerCfg[layerIdx]->m_reconFileName; 4458 4361 4459 4362 Int& m_iFrameRate = m_apcLayerCfg[layerIdx]->m_iFrameRate; … … 4499 4402 #endif 4500 4403 4501 printf("Input File : %s\n", m_ pchInputFile);4404 printf("Input File : %s\n", m_inputFileName.c_str() ); 4502 4405 4503 4406 #if SVC_EXTENSION … … 4507 4410 #endif 4508 4411 4509 printf("Bitstream File : %s\n", m_ pchBitstreamFile);4412 printf("Bitstream File : %s\n", m_bitstreamFileName.c_str() ); 4510 4413 4511 4414 #if SVC_EXTENSION … … 4514 4417 { 4515 4418 #endif 4516 4517 printf("Reconstruction File : %s\n", m_ pchReconFile);4419 4420 printf("Reconstruction File : %s\n", m_reconFileName.c_str() ); 4518 4421 printf("Real Format : %dx%d %dHz\n", m_iSourceWidth - m_confWinLeft - m_confWinRight, m_iSourceHeight - m_confWinTop - m_confWinBottom, m_iFrameRate ); 4519 4422 printf("Internal Format : %dx%d %dHz\n", m_iSourceWidth, m_iSourceHeight, m_iFrameRate ); … … 4801 4704 } 4802 4705 4803 printf(" \nSHVC TOOL CFG: ");4706 printf("SHVC TOOL CFG: "); 4804 4707 printf("ElRapSliceType: %c-slice ", m_elRapSliceBEnabled ? 'B' : 'P'); 4805 4708 printf("REF_IDX_ME_ZEROMV: %d ", REF_IDX_ME_ZEROMV); … … 4822 4725 } 4823 4726 4824 Bool confirmPara(Bool bflag, const Char* message)4727 Bool confirmPara(Bool bflag, const TChar* message) 4825 4728 { 4826 4729 if (!bflag) … … 4836 4739 Void TAppEncCfg::cfgStringToArray(Int **arr, string const cfgString, Int const numEntries, const char* logString) 4837 4740 { 4838 Char *tempChar = cfgString.empty() ? NULL : strdup(cfgString.c_str());4741 TChar *tempChar = cfgString.empty() ? NULL : strdup(cfgString.c_str()); 4839 4742 if( numEntries > 0 ) 4840 4743 { 4841 Char *arrayEntry;4744 TChar *arrayEntry; 4842 4745 Int i = 0; 4843 4746 *arr = new Int[numEntries]; … … 4918 4821 Void TAppEncCfg::cfgStringToArrayNumEntries(Int **arr, string const cfgString, Int &numEntries, const char* logString) 4919 4822 { 4920 Char *tempChar = cfgString.empty() ? NULL : strdup(cfgString.c_str());4823 TChar *tempChar = cfgString.empty() ? NULL : strdup(cfgString.c_str()); 4921 4824 if (numEntries > 0) 4922 4825 { 4923 Char *arrayEntry;4826 TChar *arrayEntry; 4924 4827 Int i = 0; 4925 4828 *arr = new Int[numEntries]; … … 4983 4886 return false; 4984 4887 } 4888 4889 void TAppEncCfg::getDirFilename(string& filename, string& dir, const string path) 4890 { 4891 size_t pos = path.find_last_of("\\"); 4892 if(pos != std::string::npos) 4893 { 4894 filename.assign(path.begin() + pos + 1, path.end()); 4895 dir.assign(path.begin(), path.begin() + pos + 1); 4896 } 4897 else 4898 { 4899 pos = path.find_last_of("/"); 4900 if(pos != std::string::npos) 4901 { 4902 filename.assign(path.begin() + pos + 1, path.end()); 4903 dir.assign(path.begin(), path.begin() + pos + 1); 4904 } 4905 else 4906 { 4907 filename = path; 4908 dir.assign(""); 4909 } 4910 } 4911 } 4912 4913 /** \param argc number of arguments 4914 \param argv array of arguments 4915 \retval true when success 4916 */ 4917 Bool TAppEncCfg::parseCfgNumLayersAndInit( Int argc, TChar* argv[] ) 4918 { 4919 po::Options opts; 4920 opts.addOptions() 4921 ("c", po::parseConfigFile, "configuration file name") 4922 ("NumLayers", m_numLayers, 1, "Number of layers to code") 4923 ; 4924 4925 po::setDefaults(opts); 4926 po::ErrorReporter err; 4927 err.verbose = false; 4928 po::scanArgv(opts, argc, (const TChar**) argv, err); 4929 4930 if( m_numLayers <= 0 ) 4931 { 4932 printf("Wrong number of layers %d\n", m_numLayers); 4933 return false; 4934 } 4935 4936 for( Int layer = 0; layer < m_numLayers; layer++ ) 4937 { 4938 m_apcLayerCfg[layer] = new TAppEncLayerCfg; 4939 m_apcLayerCfg[layer]->setAppEncCfg(this); 4940 } 4941 4942 return true; 4943 } 4985 4944 #endif //SVC_EXTENSION 4986 4945 //! \} -
branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.h
r1437 r1442 65 65 Int m_scalabilityMask[MAX_VPS_NUM_SCALABILITY_TYPES]; ///< scalability_mask 66 66 #if AVC_BASE 67 Intm_nonHEVCBaseLayerFlag; ///< non HEVC BL67 Bool m_nonHEVCBaseLayerFlag; ///< non HEVC BL 68 68 #endif 69 69 Bool m_maxTidRefPresentFlag; … … 82 82 std::vector< std::vector<Int> > m_listOfOutputLayers; 83 83 #else 84 Char* m_pchInputFile;///< source file name85 #endif 86 Char* m_pchBitstreamFile;///< output bitstream file87 #if !SVC_EXTENSION 88 Char* m_pchReconFile;///< output reconstruction file84 std::string m_inputFileName; ///< source file name 85 #endif 86 std::string m_bitstreamFileName; ///< output bitstream file 87 #if !SVC_EXTENSION 88 std::string m_reconFileName; ///< output reconstruction file 89 89 #endif 90 90 // Lambda modifiers … … 199 199 Double m_fQP; ///< QP value of key-picture (floating point) 200 200 Int m_iQP; ///< QP value of key-picture (integer) 201 Char* m_pchdQPFile;///< QP offset for each slice (initialized from external file)201 std::string m_dQPFileName; ///< QP offset for each slice (initialized from external file) 202 202 Int* m_aidQP; ///< array of slice QP values 203 203 #endif … … 419 419 #if !SVC_EXTENSION 420 420 ScalingListMode m_useScalingListId; ///< using quantization matrix 421 Char* m_scalingListFile;///< quantization matrix file name421 std::string m_scalingListFileName; ///< quantization matrix file name 422 422 #endif 423 423 … … 495 495 #if Q0074_COLOUR_REMAPPING_SEI 496 496 #if !SVC_EXTENSION 497 string m_colourRemapSEIFile Root;497 string m_colourRemapSEIFileName; 498 498 #endif 499 499 #endif … … 567 567 Void create (); ///< create option handling class 568 568 Void destroy (); ///< destroy option handling class 569 Bool parseCfg ( Int argc, Char* argv[] );///< parse configuration file to fill member variables569 Bool parseCfg ( Int argc, TChar* argv[] ); ///< parse configuration file to fill member variables 570 570 571 571 #if SVC_EXTENSION 572 Bool parseCfgNumLayersAndInit( Int argc, Char* argv[] );///< parse configuration file to to get number of layers and allocate memory572 Bool parseCfgNumLayersAndInit( Int argc, TChar* argv[] ); ///< parse configuration file to to get number of layers and allocate memory 573 573 Int getNumFrameToBeEncoded() { return m_framesToBeEncoded; } 574 574 Int getNumLayer() { return m_numLayers; } -
branches/SHM-dev/source/App/TAppEncoder/TAppEncLayerCfg.cpp
r1437 r1442 42 42 #if SVC_EXTENSION 43 43 TAppEncLayerCfg::TAppEncLayerCfg() 44 : m_cInputFile(string("")) 45 , m_cReconFile(string("")) 46 , m_conformanceWindowMode(0) 47 , m_scalingListFile(NULL) 48 , m_pchdQPFile(NULL) 44 : m_conformanceWindowMode(0) 49 45 , m_aidQP(NULL) 50 46 , m_repFormatIdx(-1) 51 #if Q0074_COLOUR_REMAPPING_SEI52 , m_colourRemapSEIFileRoot(string(""))53 #endif54 47 { 55 48 #if Q0074_COLOUR_REMAPPING_SEI … … 107 100 } 108 101 #endif 109 free(m_scalingListFile);110 102 } 111 103 -
branches/SHM-dev/source/App/TAppEncoder/TAppEncLayerCfg.h
r1437 r1442 28 28 protected: 29 29 // file I/O0 30 string m_ cInputFile; ///< source file name31 string m_ cReconFile; ///< output reconstruction file30 string m_inputFileName; ///< source file name 31 string m_reconFileName; ///< output reconstruction file 32 32 Int m_layerId; ///< layer Id 33 33 Int m_iFrameRate; ///< source frame-rates (Hz) … … 95 95 96 96 ScalingListMode m_useScalingListId; ///< using quantization matrix 97 Char* m_scalingListFile;///< quantization matrix file name97 std::string m_scalingListFileName; ///< quantization matrix file name 98 98 99 99 Int m_maxTidIlRefPicsPlus1; … … 102 102 103 103 Int m_iQP; ///< QP value of key-picture (integer) 104 Char* m_pchdQPFile;///< QP offset for each slice (initialized from external file)104 std::string m_dQPFileName; ///< QP offset for each slice (initialized from external file) 105 105 Int* m_aidQP; ///< array of slice QP values 106 106 TAppEncCfg* m_cAppEncCfg; ///< pointer to app encoder config … … 130 130 Int m_repFormatIdx; 131 131 #if Q0074_COLOUR_REMAPPING_SEI 132 string m_colourRemapSEIFile Root;///< Colour Remapping Information SEI message parameters file132 string m_colourRemapSEIFileName; ///< Colour Remapping Information SEI message parameters file 133 133 Int m_colourRemapSEIId; 134 134 Bool m_colourRemapSEICancelFlag; … … 168 168 Void setAppEncCfg(TAppEncCfg* p) {m_cAppEncCfg = p; } 169 169 170 string getInputFile() {return m_cInputFile; }171 string getReconFile() {return m_cReconFile; }172 Double getFloatQP() {return m_fQP; }170 string& getInputFileName() {return m_inputFileName; } 171 string& getReconFileName() {return m_reconFileName; } 172 Double getFloatQP() {return m_fQP; } 173 173 Int getConfWinLeft() {return m_confWinLeft; } 174 174 Int getConfWinRight() {return m_confWinRight; } -
branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp
r1437 r1442 499 499 500 500 ScalingListMode& m_useScalingListId = m_apcLayerCfg[layer]->m_useScalingListId; 501 Char* m_scalingListFile = m_apcLayerCfg[layer]->m_scalingListFile;501 string& m_scalingListFileName = m_apcLayerCfg[layer]->m_scalingListFileName; 502 502 Bool& m_bUseSAO = m_apcLayerCfg[layer]->m_bUseSAO; 503 504 string& m_colourRemapSEIFileName = m_apcLayerCfg[layer]->m_colourRemapSEIFileName; 503 505 #endif 504 506 … … 785 787 m_cTEncTop.setTMVPModeId ( m_TMVPModeId ); 786 788 m_cTEncTop.setUseScalingListId ( m_useScalingListId ); 787 m_cTEncTop.setScalingListFile ( m_scalingListFile);789 m_cTEncTop.setScalingListFileName ( m_scalingListFileName ); 788 790 m_cTEncTop.setSignHideFlag ( m_signHideFlag); 789 791 m_cTEncTop.setUseRateCtrl ( m_RCEnableRateControl ); … … 843 845 844 846 #if Q0074_COLOUR_REMAPPING_SEI 845 #if SVC_EXTENSION 846 m_cTEncTop.xSetCRISEIFileRoot ( const_cast<Char*>(m_apcLayerCfg[layer]->m_colourRemapSEIFileRoot.c_str()) ); 847 #else 848 m_cTEncTop.xSetCRISEIFileRoot ( const_cast<Char*>(m_colourRemapSEIFileRoot.c_str()) ); 849 #endif 847 m_cTEncTop.xSetCRISEIFileRoot ( m_colourRemapSEIFileName ); 850 848 #endif 851 849 #if LAYERS_NOT_PRESENT_SEI … … 877 875 //2 878 876 // Video I/O 879 m_apcTVideoIOYuvInputFile[layer]->open( (Char *)m_apcLayerCfg[layer]->getInputFile().c_str(), false, m_apcLayerCfg[layer]->m_inputBitDepth, m_apcLayerCfg[layer]->m_MSBExtendedBitDepth, m_apcLayerCfg[layer]->m_internalBitDepth ); // read mode877 m_apcTVideoIOYuvInputFile[layer]->open( m_apcLayerCfg[layer]->getInputFileName(), false, m_apcLayerCfg[layer]->m_inputBitDepth, m_apcLayerCfg[layer]->m_MSBExtendedBitDepth, m_apcLayerCfg[layer]->m_internalBitDepth ); // read mode 880 878 m_apcTVideoIOYuvInputFile[layer]->skipFrames(m_FrameSkip, m_apcLayerCfg[layer]->m_iSourceWidth - m_apcLayerCfg[layer]->m_aiPad[0], m_apcLayerCfg[layer]->m_iSourceHeight - m_apcLayerCfg[layer]->m_aiPad[1], m_apcLayerCfg[layer]->m_InputChromaFormatIDC); 881 879 882 if( !m_apcLayerCfg[layer]->getReconFile ().empty() )883 { 884 m_apcTVideoIOYuvReconFile[layer]->open( (Char *)m_apcLayerCfg[layer]->getReconFile().c_str(), true, m_apcLayerCfg[layer]->m_outputBitDepth, m_apcLayerCfg[layer]->m_MSBExtendedBitDepth, m_apcLayerCfg[layer]->m_internalBitDepth ); // write mode880 if( !m_apcLayerCfg[layer]->getReconFileName().empty() ) 881 { 882 m_apcTVideoIOYuvReconFile[layer]->open( m_apcLayerCfg[layer]->getReconFileName(), true, m_apcLayerCfg[layer]->m_outputBitDepth, m_apcLayerCfg[layer]->m_MSBExtendedBitDepth, m_apcLayerCfg[layer]->m_internalBitDepth ); // write mode 885 883 } 886 884 … … 890 888 #else //SVC_EXTENSION 891 889 // Video I/O 892 m_cTVideoIOYuvInputFile.open( m_ pchInputFile, false, m_inputBitDepth, m_MSBExtendedBitDepth, m_internalBitDepth ); // read mode890 m_cTVideoIOYuvInputFile.open( m_inputFileName, false, m_inputBitDepth, m_MSBExtendedBitDepth, m_internalBitDepth ); // read mode 893 891 m_cTVideoIOYuvInputFile.skipFrames(m_FrameSkip, m_iSourceWidth - m_aiPad[0], m_iSourceHeight - m_aiPad[1], m_InputChromaFormatIDC); 894 892 895 if ( m_pchReconFile)896 { 897 m_cTVideoIOYuvReconFile.open(m_ pchReconFile, true, m_outputBitDepth, m_outputBitDepth, m_internalBitDepth); // write mode893 if (!m_reconFileName.empty()) 894 { 895 m_cTVideoIOYuvReconFile.open(m_reconFileName, true, m_outputBitDepth, m_outputBitDepth, m_internalBitDepth); // write mode 898 896 } 899 897 … … 1439 1437 Void TAppEncTop::encode() 1440 1438 { 1441 fstream bitstreamFile(m_ pchBitstreamFile, fstream::binary | fstream::out);1439 fstream bitstreamFile(m_bitstreamFileName.c_str(), fstream::binary | fstream::out); 1442 1440 if (!bitstreamFile) 1443 1441 { 1444 fprintf(stderr, "\nfailed to open bitstream file `%s' for writing\n", m_ pchBitstreamFile);1442 fprintf(stderr, "\nfailed to open bitstream file `%s' for writing\n", m_bitstreamFileName.c_str()); 1445 1443 exit(EXIT_FAILURE); 1446 1444 } … … 1801 1799 Void TAppEncTop::encode() 1802 1800 { 1803 fstream bitstreamFile(m_ pchBitstreamFile, fstream::binary | fstream::out);1801 fstream bitstreamFile(m_bitstreamFileName.c_str(), fstream::binary | fstream::out); 1804 1802 if (!bitstreamFile) 1805 1803 { 1806 fprintf(stderr, "\nfailed to open bitstream file `%s' for writing\n", m_ pchBitstreamFile);1804 fprintf(stderr, "\nfailed to open bitstream file `%s' for writing\n", m_bitstreamFileName.c_str()); 1807 1805 exit(EXIT_FAILURE); 1808 1806 } … … 1973 1971 TComPicYuv* pcPicYuvRecBottom = *(iterPicYuvRec++); 1974 1972 1975 if( !m_apcLayerCfg[layer]->getReconFile ().empty() && pcPicYuvRecTop->isReconstructed() && pcPicYuvRecBottom->isReconstructed() )1973 if( !m_apcLayerCfg[layer]->getReconFileName().empty() && pcPicYuvRecTop->isReconstructed() && pcPicYuvRecBottom->isReconstructed() ) 1976 1974 { 1977 1975 m_apcTVideoIOYuvReconFile[layer]->write( pcPicYuvRecTop, pcPicYuvRecBottom, ipCSC, m_apcLayerCfg[layer]->getConfWinLeft() * xScal, m_apcLayerCfg[layer]->getConfWinRight() * xScal, … … 1994 1992 { 1995 1993 TComPicYuv* pcPicYuvRec = *(iterPicYuvRec++); 1996 if( !m_apcLayerCfg[layer]->getReconFile ().empty() && pcPicYuvRec->isReconstructed() )1994 if( !m_apcLayerCfg[layer]->getReconFileName().empty() && pcPicYuvRec->isReconstructed() ) 1997 1995 { 1998 1996 m_apcTVideoIOYuvReconFile[layer]->write( pcPicYuvRec, ipCSC, m_apcLayerCfg[layer]->getConfWinLeft() * xScal, m_apcLayerCfg[layer]->getConfWinRight() * xScal, … … 2101 2099 TComPicYuv* pcPicYuvRecBottom = *(iterPicYuvRec++); 2102 2100 2103 if ( m_pchReconFile)2101 if (!m_reconFileName.empty()) 2104 2102 { 2105 2103 m_cTVideoIOYuvReconFile.write( pcPicYuvRecTop, pcPicYuvRecBottom, ipCSC, m_confWinLeft, m_confWinRight, m_confWinTop, m_confWinBottom, NUM_CHROMA_FORMAT, m_isTopFieldFirst ); … … 2130 2128 { 2131 2129 TComPicYuv* pcPicYuvRec = *(iterPicYuvRec++); 2132 if ( m_pchReconFile)2130 if (!m_reconFileName.empty()) 2133 2131 { 2134 2132 m_cTVideoIOYuvReconFile.write( pcPicYuvRec, ipCSC, m_confWinLeft, m_confWinRight, m_confWinTop, m_confWinBottom,
Note: See TracChangeset for help on using the changeset viewer.