Changeset 1442 in SHVCSoftware for branches/SHM-dev/source/App/TAppDecoder
- Timestamp:
- 13 Aug 2015, 19:11:53 (9 years ago)
- Location:
- branches/SHM-dev/source/App/TAppDecoder
- Files:
-
- 4 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
Note: See TracChangeset for help on using the changeset viewer.