Changeset 438 in 3DVCSoftware for branches/HTM-DEV-0.2-dev/source/App/TAppDecoder
- Timestamp:
- 23 May 2013, 15:40:36 (12 years ago)
- Location:
- branches/HTM-DEV-0.2-dev/source/App/TAppDecoder
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-DEV-0.2-dev/source/App/TAppDecoder/TAppDecCfg.cpp
r368 r438 45 45 #include <cassert> 46 46 #endif 47 47 48 #ifdef WIN32 48 49 #define strdup _strdup … … 78 79 ("OutputBitDepth,d", m_outputBitDepthY, 0, "bit depth of YUV output luma component (default: use 0 for native depth)") 79 80 ("OutputBitDepthC,d", m_outputBitDepthC, 0, "bit depth of YUV output chroma component (default: use 0 for native depth)") 81 80 82 #if H_MV 81 83 ("MaxLayerId,-ls", m_maxLayerId, MAX_NUM_LAYER_IDS-1, "Maximum LayerId to be decoded.") 82 84 #endif 85 83 86 ("MaxTemporalLayer,t", m_iMaxTemporalLayer, -1, "Maximum Temporal Layer to be decoded. -1 to decode all layers") 84 87 ("SEIDecodedPictureHash", m_decodedPictureHashSEIEnabled, 1, "Control handling of decoded picture hash SEI messages\n" … … 105 108 /* convert std::string to c string for compatability */ 106 109 m_pchBitstreamFile = cfg_BitstreamFile.empty() ? NULL : strdup(cfg_BitstreamFile.c_str()); 110 107 111 m_pchReconFile = cfg_ReconFile.empty() ? NULL : strdup(cfg_ReconFile.c_str()); 108 112 … … 187 191 } 188 192 #endif 193 189 194 //! \} -
branches/HTM-DEV-0.2-dev/source/App/TAppDecoder/TAppDecTop.cpp
r401 r438 54 54 55 55 TAppDecTop::TAppDecTop() 56 56 57 #if !H_MV 57 58 : m_iPOCLastDisplay(-MAX_INT) … … 59 60 : m_numDecoders( 0 ) 60 61 #endif 62 61 63 { 62 64 ::memset (m_abDecFlag, 0, sizeof (m_abDecFlag)); … … 77 79 m_pchBitstreamFile = NULL; 78 80 } 81 79 82 #if H_MV 80 83 for (Int decIdx = 0; decIdx < m_numDecoders; decIdx++) … … 112 115 poc = -1; 113 116 #endif 117 114 118 TComList<TComPic*>* pcListPic = NULL; 115 119 … … 143 147 Bool firstSlice = true; 144 148 #endif 149 145 150 146 151 while (!!bitstreamFile) … … 151 156 * nal unit. */ 152 157 streampos location = bitstreamFile.tellg(); 153 #if H_MV154 #if ENC_DEC_TRACE155 Int64 symCount = g_nSymbolCounter;156 #endif157 #endif158 158 AnnexBStats stats = AnnexBStats(); 159 159 #if !H_MV 160 160 Bool bPreviousPictureDecoded = false; 161 161 #endif 162 163 162 vector<uint8_t> nalUnit; 164 163 InputNALUnit nalu; … … 251 250 bitstreamFile.seekg(location-streamoff(3)); 252 251 bytestream.reset(); 253 #if H_MV254 #if ENC_DEC_TRACE255 g_nSymbolCounter = symCount;256 #endif257 #endif258 259 252 } 260 253 #if !H_MV … … 283 276 } 284 277 #endif 285 286 278 if( pcListPic ) 287 279 { … … 294 286 if (!m_outputBitDepthY) { m_outputBitDepthY = g_bitDepthY; } 295 287 if (!m_outputBitDepthC) { m_outputBitDepthC = g_bitDepthC; } 296 297 288 #if H_MV 298 289 m_tVideoIOYuvReconFile[decIdxLastPic]->open( m_pchReconFiles[decIdxLastPic], true, m_outputBitDepthY, m_outputBitDepthC, g_bitDepthY, g_bitDepthC ); // write mode … … 306 297 if ( bNewPicture && 307 298 #endif 308 ( nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR _W_RADL299 ( nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR 309 300 || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_N_LP 310 301 || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA_N_LP 311 || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA _W_RADL312 || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA _W_LP) )302 || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_BLANT 303 || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA ) ) 313 304 { 314 305 #if H_MV … … 602 593 } 603 594 604 #if H_MV605 Int TAppDecTop::xGetDecoderIdx( Int layerId, Bool createFlag /*= false */ )606 {607 Int decIdx = -1;608 if ( m_layerIdToDecIdx[ layerId ] != -1 )609 {610 decIdx = m_layerIdToDecIdx[ layerId ];611 }612 else613 {614 assert ( createFlag );615 assert( m_numDecoders < MAX_NUM_LAYERS );616 617 decIdx = m_numDecoders;618 619 // Init decoder620 m_tDecTop[ decIdx ] = new TDecTop;621 m_tDecTop[ decIdx ]->create();622 m_tDecTop[ decIdx ]->init( );623 m_tDecTop[ decIdx ]->setLayerId( layerId );624 m_tDecTop[ decIdx ]->setDecodedPictureHashSEIEnabled(m_decodedPictureHashSEIEnabled);625 m_tDecTop[ decIdx ]->setIvPicLists( &m_ivPicLists );626 627 // append pic list of new decoder to PicLists628 assert( m_ivPicLists.size() == m_numDecoders );629 m_ivPicLists.push_back( m_tDecTop[ decIdx ]->getListPic() );630 631 // create recon file related stuff632 Char* pchTempFilename = NULL;633 if ( m_pchReconFile )634 {635 Char buffer[4];636 sprintf(buffer,"_%i", layerId );637 assert ( m_pchReconFile );638 xAppendToFileNameEnd( m_pchReconFile , buffer, pchTempFilename );639 assert( m_pchReconFiles.size() == m_numDecoders );640 }641 642 m_pchReconFiles.push_back( pchTempFilename );643 644 m_tVideoIOYuvReconFile[ decIdx ] = new TVideoIOYuv;645 m_reconOpen [ decIdx ] = false;646 647 // set others648 m_pocLastDisplay [ decIdx ] = -MAX_INT;649 m_layerIdToDecIdx [ layerId ] = decIdx;650 651 m_numDecoders++;652 };653 return decIdx;654 }655 #endif656 595 //! \} -
branches/HTM-DEV-0.2-dev/source/App/TAppDecoder/TAppDecTop.h
r401 r438 74 74 // for output control 75 75 Bool m_abDecFlag[ MAX_GOP ]; ///< decoded flag in one GOP 76 76 77 #if H_MV 77 78 Int m_pocLastDisplay [ MAX_NUM_LAYERS ]; ///< last POC in display order … … 89 90 Void decode (); ///< main decoding function 90 91 92 91 93 protected: 92 94 Void xCreateDecLib (); ///< create internal classes … … 97 99 Void xWriteOutput ( TComList<TComPic*>* pcListPic, Int layerId, Int tId ); ///< write YUV to file 98 100 Void xFlushOutput ( TComList<TComPic*>* pcListPic, Int layerId ); ///< flush all remaining decoded pictures to file 99 Int xGetDecoderIdx ( Int layerId, Bool createFlag = false ); 101 Int xGetDecoderIdx ( Int layerId, Bool createFlag = false ) 102 { 103 Int decIdx = -1; 104 if ( m_layerIdToDecIdx[ layerId ] != -1 ) 105 { 106 decIdx = m_layerIdToDecIdx[ layerId ]; 107 } 108 else 109 { 110 assert ( createFlag ); 111 assert( m_numDecoders < MAX_NUM_LAYERS ); 112 113 decIdx = m_numDecoders; 114 115 // Init decoder 116 m_tDecTop[ decIdx ] = new TDecTop; 117 m_tDecTop[ decIdx ]->create(); 118 m_tDecTop[ decIdx ]->init( ); 119 m_tDecTop[ decIdx ]->setLayerId( layerId ); 120 m_tDecTop[ decIdx ]->setDecodedPictureHashSEIEnabled(m_decodedPictureHashSEIEnabled); 121 m_tDecTop[ decIdx ]->setIvPicLists( &m_ivPicLists ); 122 123 // append pic list of new decoder to PicLists 124 assert( m_ivPicLists.size() == m_numDecoders ); 125 m_ivPicLists.push_back( m_tDecTop[ decIdx ]->getListPic() ); 126 127 // create recon file related stuff 128 Char* pchTempFilename = NULL; 129 if ( m_pchReconFile ) 130 { 131 Char buffer[4]; 132 sprintf(buffer,"_%i", layerId ); 133 assert ( m_pchReconFile ); 134 xAppendToFileNameEnd( m_pchReconFile , buffer, pchTempFilename ); 135 assert( m_pchReconFiles.size() == m_numDecoders ); 136 } 137 138 m_pchReconFiles.push_back( pchTempFilename ); 139 140 m_tVideoIOYuvReconFile[ decIdx ] = new TVideoIOYuv; 141 m_reconOpen [ decIdx ] = false; 142 143 // set others 144 m_pocLastDisplay [ decIdx ] = -MAX_INT; 145 m_layerIdToDecIdx [ layerId ] = decIdx; 146 147 m_numDecoders++; 148 }; 149 return decIdx; 150 } 100 151 #else 101 152 Void xWriteOutput ( TComList<TComPic*>* pcListPic , UInt tId); ///< write YUV to file 102 153 Void xFlushOutput ( TComList<TComPic*>* pcListPic ); ///< flush all remaining decoded pictures to file 103 154 #endif 155 104 156 Bool isNaluWithinTargetDecLayerIdSet ( InputNALUnit* nalu ); ///< check whether given Nalu is within targetDecLayerIdSet 105 157 };
Note: See TracChangeset for help on using the changeset viewer.