Ignore:
Timestamp:
26 May 2013, 16:22:23 (13 years ago)
Author:
tech
Message:

Added missing parts.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-DEV-0.2-dev/source/App/TAppDecoder/TAppDecTop.cpp

    r438 r446  
    5454
    5555TAppDecTop::TAppDecTop()
    56 
    5756#if !H_MV
    5857: m_iPOCLastDisplay(-MAX_INT)
     
    6059: m_numDecoders( 0 )
    6160#endif
    62 
    6361{
    6462  ::memset (m_abDecFlag, 0, sizeof (m_abDecFlag));
    6563#if H_MV
    6664  for (Int i = 0; i < MAX_NUM_LAYER_IDS; i++) m_layerIdToDecIdx[i] = -1;
     65#endif
     66#if H_3D
     67    m_pScaleOffsetFile  = 0;
    6768#endif
    6869}
     
    7980    m_pchBitstreamFile = NULL;
    8081  }
    81 
    8282#if H_MV
    8383  for (Int decIdx = 0; decIdx < m_numDecoders; decIdx++)
     
    115115  poc = -1;
    116116#endif
    117 
    118117  TComList<TComPic*>* pcListPic = NULL;
    119118
     
    125124  }
    126125
     126#if H_3D
     127  if( m_pchScaleOffsetFile )
     128  {
     129    m_pScaleOffsetFile = ::fopen( m_pchScaleOffsetFile, "wt" );
     130    AOF( m_pScaleOffsetFile );
     131  }
     132  m_cCamParsCollector.init( m_pScaleOffsetFile );
     133#endif
    127134  InputByteStream bytestream(bitstreamFile);
    128135
     
    147154  Bool firstSlice        = true;
    148155#endif
    149 
    150156 
    151157  while (!!bitstreamFile)
     
    156162     * nal unit. */
    157163    streampos location = bitstreamFile.tellg();
     164#if H_MV
     165#if ENC_DEC_TRACE
     166    Int64 symCount = g_nSymbolCounter;
     167#endif
     168#endif
    158169    AnnexBStats stats = AnnexBStats();
    159170#if !H_MV
    160171    Bool bPreviousPictureDecoded = false;
    161172#endif
     173
    162174    vector<uint8_t> nalUnit;
    163175    InputNALUnit nalu;
     
    250262          bitstreamFile.seekg(location-streamoff(3));
    251263          bytestream.reset();
     264#if H_MV
     265#if ENC_DEC_TRACE
     266          g_nSymbolCounter = symCount;
     267#endif
     268#endif
    252269        }
    253270#if !H_MV
     
    276293    }
    277294#endif
     295
    278296    if( pcListPic )
    279297    {
     
    286304        if (!m_outputBitDepthY) { m_outputBitDepthY = g_bitDepthY; }
    287305        if (!m_outputBitDepthC) { m_outputBitDepthC = g_bitDepthC; }
     306
    288307#if H_MV
    289308        m_tVideoIOYuvReconFile[decIdxLastPic]->open( m_pchReconFiles[decIdxLastPic], true, m_outputBitDepthY, m_outputBitDepthC, g_bitDepthY, g_bitDepthC ); // write mode
     
    297316      if ( bNewPicture &&
    298317#endif
    299            (   nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR
     318           (   nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_W_RADL
    300319            || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_N_LP
    301320            || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA_N_LP
    302             || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_BLANT
    303             || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA ) )
     321            || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA_W_RADL
     322            || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA_W_LP ) )
    304323      {
    305324#if H_MV
     
    318337  }
    319338
     339#if H_3D
     340  if( m_cCamParsCollector.isInitialized() )
     341  {
     342    m_cCamParsCollector.setSlice( 0 );
     343  }
     344#endif
    320345  for(UInt decIdx = 0; decIdx < m_numDecoders; decIdx++)
    321346  {
     
    383408  // destroy decoder class
    384409  m_cTDecTop.destroy();
     410#endif
     411#if H_3D
     412  m_cCamParsCollector.uninit();
     413  if( m_pScaleOffsetFile )
     414  {
     415    ::fclose( m_pScaleOffsetFile );
     416  }
    385417#endif
    386418}
     
    593625}
    594626
     627#if H_MV
     628Int TAppDecTop::xGetDecoderIdx( Int layerId, Bool createFlag /*= false */ )
     629{
     630  Int decIdx = -1;
     631  if ( m_layerIdToDecIdx[ layerId ] != -1 )
     632  {     
     633    decIdx = m_layerIdToDecIdx[ layerId ];
     634  }
     635  else
     636  {     
     637    assert ( createFlag );
     638    assert( m_numDecoders < MAX_NUM_LAYERS );
     639
     640    decIdx = m_numDecoders;
     641
     642    // Init decoder
     643    m_tDecTop[ decIdx ] =  new TDecTop;
     644    m_tDecTop[ decIdx ]->create();
     645    m_tDecTop[ decIdx ]->init( );
     646    m_tDecTop[ decIdx ]->setLayerId( layerId );
     647    m_tDecTop[ decIdx ]->setDecodedPictureHashSEIEnabled(m_decodedPictureHashSEIEnabled);
     648    m_tDecTop[ decIdx ]->setIvPicLists( &m_ivPicLists );
     649#if H_3D
     650   m_tDecTop[ decIdx ]->setCamParsCollector( &m_cCamParsCollector );
     651#endif
     652
     653    // append pic list of new decoder to PicLists
     654    assert( m_ivPicLists.size() == m_numDecoders );
     655    m_ivPicLists.push_back( m_tDecTop[ decIdx ]->getListPic() );
     656
     657    // create recon file related stuff     
     658    Char* pchTempFilename = NULL;
     659    if ( m_pchReconFile )
     660    {     
     661      Char buffer[4];     
     662      sprintf(buffer,"_%i", layerId );
     663      assert ( m_pchReconFile );
     664      xAppendToFileNameEnd( m_pchReconFile , buffer, pchTempFilename );
     665      assert( m_pchReconFiles.size() == m_numDecoders );
     666    }
     667
     668    m_pchReconFiles.push_back( pchTempFilename );   
     669
     670    m_tVideoIOYuvReconFile[ decIdx ] = new TVideoIOYuv;
     671    m_reconOpen           [ decIdx ] = false;
     672
     673    // set others
     674    m_pocLastDisplay      [ decIdx ] = -MAX_INT;
     675    m_layerIdToDecIdx     [ layerId ] = decIdx;
     676
     677    m_numDecoders++;
     678  };
     679  return decIdx;
     680}
     681#endif
    595682//! \}
Note: See TracChangeset for help on using the changeset viewer.