Changeset 38 in SHVCSoftware for branches/SHM-1.1-dev/source/App/TAppDecoder
- Timestamp:
- 20 Feb 2013, 21:24:20 (12 years ago)
- Location:
- branches/SHM-1.1-dev/source/App/TAppDecoder
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-1.1-dev/source/App/TAppDecoder/TAppDecCfg.cpp
r2 r38 75 75 string cfg_ReconFile; 76 76 #endif 77 #if AVC_SYNTAX || SYNTAX_OUTPUT 78 string cfg_BLSyntaxFile; 79 #endif 77 80 #if TARGET_DECLAYERID_SET 78 81 string cfg_TargetDecLayerIdSetFile; … … 90 93 ("BLSourceWidth,-wdt", m_iBLSourceWidth, 0, "BL source picture width") 91 94 ("BLSourceHeight,-hgt", m_iBLSourceHeight, 0, "BL source picture height") 95 #if AVC_SYNTAX 96 ("BLSyntaxFile,-ibs", cfg_BLSyntaxFile, string(""), "BL syntax input file name") 97 #endif 92 98 #endif 93 99 #else 94 100 ("ReconFile,o", cfg_ReconFile, string(""), "reconstructed YUV output file name\n" 95 101 "YUV writing is skipped if omitted") 102 #endif 103 #if SYNTAX_OUTPUT 104 ("BLSyntaxFile,-ibs", cfg_BLSyntaxFile, string(""), "BL syntax input file name") 105 ("BLSourceWidth,-wdt", m_iBLSourceWidth, 0, "BL source picture width") 106 ("BLSourceHeight,-hgt", m_iBLSourceHeight, 0, "BL source picture height") 107 ("BLFrames,-fr", m_iBLFrames, 0, "BL number of frames") 96 108 #endif 97 109 ("SkipFrames,s", m_iSkipFrame, 0, "number of frames to skip before random access") … … 138 150 #else 139 151 m_pchReconFile = cfg_ReconFile.empty() ? NULL : strdup(cfg_ReconFile.c_str()); 152 #endif 153 #if AVC_SYNTAX || SYNTAX_OUTPUT 154 m_pchBLSyntaxFile = cfg_BLSyntaxFile.empty() ? NULL : strdup(cfg_BLSyntaxFile.c_str()); 140 155 #endif 141 156 -
branches/SHM-1.1-dev/source/App/TAppDecoder/TAppDecCfg.h
r2 r38 66 66 Int m_iBLSourceWidth; 67 67 Int m_iBLSourceHeight; 68 #if AVC_SYNTAX 69 char* m_pchBLSyntaxFile; ///< input BL syntax file name 70 #endif 68 71 #endif 69 72 #else 70 73 char* m_pchReconFile; ///< output reconstruction file name 74 #endif 75 #if SYNTAX_OUTPUT 76 char* m_pchBLSyntaxFile; ///< input BL syntax file name 77 Int m_iBLSourceWidth; 78 Int m_iBLSourceHeight; 79 Int m_iBLFrames; 71 80 #endif 72 81 Int m_iSkipFrame; ///< counter for frames prior to the random access point to skip -
branches/SHM-1.1-dev/source/App/TAppDecoder/TAppDecTop.cpp
r6 r38 102 102 } 103 103 #endif 104 #if AVC_SYNTAX || SYNTAX_OUTPUT 105 if( m_pchBLSyntaxFile ) 106 { 107 free ( m_pchBLSyntaxFile ); 108 m_pchBLSyntaxFile = NULL; 109 } 110 #endif 104 111 } 105 112 … … 147 154 #if AVC_BASE 148 155 TComPic pcBLPic; 149 FILE* pFile = fopen( m_pchBLReconFile, "rb" ); 150 if( !pFile ) 151 { 152 printf( "BL input reading error\n" ); 153 exit(0); 156 if( !m_pchBLReconFile ) 157 { 158 printf( "Wrong base layer YUV input file\n" ); 159 exit(EXIT_FAILURE); 160 } 161 fstream streamYUV( m_pchBLReconFile, fstream::in | fstream::binary ); 162 if( !streamYUV.good() ) 163 { 164 printf( "Base layer YUV input reading error\n" ); 165 exit(EXIT_FAILURE); 154 166 } 155 167 TComList<TComPic*> *cListPic = m_acTDecTop[0].getListPic(); 156 168 m_acTDecTop[0].setBLsize( m_iBLSourceWidth, m_iBLSourceHeight ); 157 m_acTDecTop[0].setBLReconFile( pFile);169 m_acTDecTop[0].setBLReconFile( &streamYUV ); 158 170 pcBLPic.setLayerId( 0 ); 159 171 cListPic->pushBack( &pcBLPic ); 172 #if AVC_SYNTAX 173 if( !m_pchBLSyntaxFile ) 174 { 175 printf( "Wrong base layer syntax file\n" ); 176 exit(EXIT_FAILURE); 177 } 178 fstream streamSyntaxFile( m_pchBLSyntaxFile, fstream::in | fstream::binary ); 179 if( !streamSyntaxFile.good() ) 180 { 181 printf( "Base layer syntax input reading error\n" ); 182 exit(EXIT_FAILURE); 183 } 184 m_acTDecTop[0].setBLSyntaxFile( &streamSyntaxFile ); 185 #endif 160 186 #endif 161 187 … … 254 280 // delete buffers 255 281 #if AVC_BASE 256 if( pFile ) 257 { 258 fclose( pFile ); 259 } 282 if( streamYUV.is_open() ) 283 { 284 streamYUV.close(); 285 } 286 #if AVC_SYNTAX 287 if( streamSyntaxFile.is_open() ) 288 { 289 streamSyntaxFile.close(); 290 } 291 #endif 260 292 pcBLPic.destroy(); 261 293 … … 293 325 // main decoder loop 294 326 bool recon_opened = false; // reconstruction file not yet opened. (must be performed after SPS is seen) 327 328 #if SYNTAX_OUTPUT 329 if( !m_pchBLSyntaxFile ) 330 { 331 printf( "Wrong base layer syntax file\n" ); 332 exit(EXIT_FAILURE); 333 } 334 fstream streamSyntaxFile( m_pchBLSyntaxFile, fstream::out | fstream::binary ); 335 if( !streamSyntaxFile.good() ) 336 { 337 printf( "Base layer syntax input reading error\n" ); 338 exit(EXIT_FAILURE); 339 } 340 m_cTDecTop.setBLSyntaxFile( &streamSyntaxFile ); 341 342 for( Int i = m_iBLFrames * m_iBLSourceWidth * m_iBLSourceHeight * SYNTAX_BYTES / 16; i >= 0; i-- ) 343 { 344 streamSyntaxFile.put( 0 ); 345 } 346 streamSyntaxFile.seekp( 0 ); 347 #endif 295 348 296 349 while (!!bitstreamFile) … … 389 442 } 390 443 } 444 445 #if SYNTAX_OUTPUT 446 if( streamSyntaxFile.is_open() ) 447 { 448 streamSyntaxFile.close(); 449 } 450 #endif 391 451 392 452 xFlushOutput( pcListPic );
Note: See TracChangeset for help on using the changeset viewer.