Changeset 540 in SHVCSoftware for trunk/source/App/TAppDecoder


Ignore:
Timestamp:
9 Jan 2014, 05:04:17 (11 years ago)
Author:
seregin
Message:

merge SHM-4.1-dev branch

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/source

  • trunk/source/App/TAppDecoder/TAppDecCfg.cpp

    r313 r540  
    6969  string cfg_ReconFile [MAX_LAYERS];
    7070  Int nLayerNum;
     71#if OUTPUT_LAYER_SET_INDEX
     72  Int olsIdx;
     73#endif
    7174#if AVC_BASE
    7275  string cfg_BLReconFile;
     
    110113#if SVC_EXTENSION
    111114  ("LayerNum,-ls", nLayerNum, 1, "Number of layers to be decoded.")
     115#if OUTPUT_LAYER_SET_INDEX
     116  ("OutpuLayerSetIdx,-olsidx", olsIdx, -1, "Index of output layer set to be decoded.")
     117#endif
    112118#endif
    113119  ("MaxTemporalLayer,t", m_iMaxTemporalLayer, -1, "Maximum Temporal Layer to be decoded. -1 to decode all layers")
     
    138144  m_tgtLayerId = nLayerNum - 1;
    139145  assert( m_tgtLayerId >= 0 );
     146#if OUTPUT_LAYER_SET_INDEX 
     147  this->getCommonDecoderParams()->setOutputLayerSetIdx( olsIdx       );
     148  this->getCommonDecoderParams()->setTargetLayerId    ( m_tgtLayerId );
     149#endif
    140150  for(UInt layer=0; layer<= m_tgtLayerId; layer++)
    141151  {
     
    201211      fprintf(stderr, "File %s could not be opened. Using all LayerIds as default.\n", cfg_TargetDecLayerIdSetFile.c_str() );
    202212    }
     213#if OUTPUT_LAYER_SET_INDEX 
     214    this->getCommonDecoderParams()->setTargetDecLayerIdSet( &m_targetDecLayerIdSet );
     215#endif
    203216  }
    204217
  • trunk/source/App/TAppDecoder/TAppDecCfg.h

    r313 r540  
    9191  std::vector<Int> m_targetDecLayerIdSet;             ///< set of LayerIds to be included in the sub-bitstream extraction process.
    9292  Int           m_respectDefDispWindow;               ///< Only output content inside the default display window
     93#if OUTPUT_LAYER_SET_INDEX
     94  CommonDecoderParams             m_commonDecoderParams;
     95#endif
    9396
    9497public:
     
    120123 
    121124  Bool  parseCfg        ( Int argc, Char* argv[] );   ///< initialize option class from configuration
     125#if OUTPUT_LAYER_SET_INDEX
     126  CommonDecoderParams* getCommonDecoderParams() {return &m_commonDecoderParams;}
     127#endif
    122128};
    123129
  • trunk/source/App/TAppDecoder/TAppDecTop.cpp

    r494 r540  
    145145  // main decoder loop
    146146  Bool openedReconFile[MAX_LAYERS]; // reconstruction file not yet opened. (must be performed after SPS is seen)
     147  Bool loopFiltered[MAX_LAYERS];
     148  memset( loopFiltered, false, sizeof( loopFiltered ) );
     149
    147150  for(UInt layer=0; layer<=m_tgtLayerId; layer++)
    148151  {
     
    223226      }
    224227    }
    225     if (bNewPicture || !bitstreamFile)
     228
     229    if (bNewPicture || !bitstreamFile || nalu.m_nalUnitType == NAL_UNIT_EOS)
    226230    {
    227231#if O0194_DIFFERENT_BITDEPTH_EL_BL
     
    230234      g_bitDepthC = g_bitDepthCLayer[curLayerId];
    231235#endif
    232       m_acTDecTop[curLayerId].executeLoopFilters(poc, pcListPic);
     236      if (!loopFiltered[curLayerId] || bitstreamFile)
     237      {
     238        m_acTDecTop[curLayerId].executeLoopFilters(poc, pcListPic);
     239      }
     240      loopFiltered[curLayerId] = (nalu.m_nalUnitType == NAL_UNIT_EOS);
    233241#if EARLY_REF_PIC_MARKING
    234242      m_acTDecTop[curLayerId].earlyPicMarking(m_iMaxTemporalLayer, m_targetDecLayerIdSet);
     
    256264        xFlushOutput( pcListPic, curLayerId );
    257265      }
     266      if (nalu.m_nalUnitType == NAL_UNIT_EOS)
     267      {
     268        xFlushOutput( pcListPic, curLayerId );       
     269      }
    258270      // write reconstruction to file
    259271      if(bNewPicture)
     
    316328  // main decoder loop
    317329  Bool openedReconFile = false; // reconstruction file not yet opened. (must be performed after SPS is seen)
     330  Bool loopFiltered = false;
    318331
    319332#if SYNTAX_OUTPUT
     
    384397      }
    385398    }
    386     if (bNewPicture || !bitstreamFile)
    387     {
    388       m_cTDecTop.executeLoopFilters(poc, pcListPic);
     399    if (bNewPicture || !bitstreamFile || nalu.m_nalUnitType == NAL_UNIT_EOS)
     400    {
     401      if (!loopFiltered || bitstreamFile)
     402      {
     403        m_cTDecTop.executeLoopFilters(poc, pcListPic);
     404      }
     405      loopFiltered = (nalu.m_nalUnitType == NAL_UNIT_EOS);
    389406    }
    390407
     
    408425        xFlushOutput( pcListPic );
    409426      }
     427      if (nalu.m_nalUnitType == NAL_UNIT_EOS)
     428      {
     429        xFlushOutput( pcListPic );       
     430      }
    410431      // write reconstruction to file
    411432      if(bNewPicture)
     
    494515    m_acTDecTop[layer].setDecodedPictureHashSEIEnabled(m_decodedPictureHashSEIEnabled);
    495516    m_acTDecTop[layer].setNumLayer( m_tgtLayerId + 1 );
     517#if OUTPUT_LAYER_SET_INDEX
     518    m_acTDecTop[layer].setCommonDecoderParams( this->getCommonDecoderParams() );
     519#endif
    496520  }
    497521
     
    503527
    504528/** \param pcListPic list of pictures to be written to file
    505 \todo            DYN_REF_FREE should be revised
    506 */
     529    \todo            DYN_REF_FREE should be revised
     530 */
    507531#if SVC_EXTENSION
    508532Void TAppDecTop::xWriteOutput( TComList<TComPic*>* pcListPic, UInt layerId, UInt tId )
     
    511535#endif
    512536{
     537  if (pcListPic->empty())
     538  {
     539    return;
     540  }
     541
    513542  TComList<TComPic*>::iterator iterPic   = pcListPic->begin();
    514543  Int numPicsNotYetDisplayed = 0;
     
    730759#endif
    731760{
    732   if(!pcListPic)
     761  if(!pcListPic || pcListPic->empty())
    733762  {
    734763    return;
Note: See TracChangeset for help on using the changeset viewer.