Changeset 1472 in SHVCSoftware for branches/SHM-dev/source/App


Ignore:
Timestamp:
14 Sep 2015, 19:46:40 (9 years ago)
Author:
seregin
Message:

fix writing bitdepth

Location:
branches/SHM-dev/source/App/TAppDecoder
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-dev/source/App/TAppDecoder/TAppDecCfg.cpp

    r1460 r1472  
    7070  Int olsIdx;
    7171#if CONFORMANCE_BITSTREAM_MODE
    72   string cfg_confPrefix;
    73 #endif
     72  string confPrefix;
     73#endif
     74
     75  Int* cfg_outputBitDepthY[MAX_LAYERS];
     76  Int* cfg_outputBitDepthC[MAX_LAYERS];
     77
     78  for( Int layer = 0; layer < MAX_LAYERS; layer++ )
     79  {
     80    cfg_outputBitDepthY[layer] = &m_outputBitDepth[layer][CHANNEL_TYPE_LUMA];
     81    cfg_outputBitDepthC[layer] = &m_outputBitDepth[layer][CHANNEL_TYPE_CHROMA];
     82  }
    7483#endif
    7584
     
    8594  ("BitstreamFile,b",           m_bitstreamFileName,                   string(""), "bitstream input file name")
    8695#if SVC_EXTENSION
    87   ("ReconFileL%d,-o%d",                 m_reconFileName,   string(""), MAX_LAYERS, "Layer %d reconstructed YUV output file name\n"
     96  ("c",                         po::parseConfigFile,                               "configuration file name")
     97  ("ReconFile%d,-o%d",          m_reconFileName,           string(""), MAX_LAYERS, "Layer %d reconstructed YUV output file name\n"
    8898                                                                                   "YUV writing is skipped if omitted")
    8999#if AVC_BASE
     
    94104  ("OutpuLayerSetIdx,-olsidx",                                         olsIdx, -1, "Index of output layer set to be decoded.")
    95105#if CONFORMANCE_BITSTREAM_MODE
    96   ("ConformanceBitstremMode,-confMode",                     m_confModeFlag, false, "Enable generation of conformance bitstream metadata; True: Generate metadata, False: No metadata generated")
    97   ("ConformanceMetadataPrefix,           -confPrefix", cfg_confPrefix, string(""), "Prefix for the file name of the conformance data. Default name - 'decodedBitstream'")
     106  ("ConformanceBitstremMode,-confMode",                      m_confModeFlag, false, "Enable generation of conformance bitstream metadata; True: Generate metadata, False: No metadata generated")
     107  ("ConformanceMetadataPrefix,-confPrefix",                 confPrefix, string(""), "Prefix for the file name of the conformance data. Default name - 'decodedBitstream'")
    98108#endif
    99109#else
     
    103113  ("WarnUnknowParameter,w",     warnUnknowParameter,                                  0, "warn for unknown configuration parameters instead of failing")
    104114  ("SkipFrames,s",              m_iSkipFrame,                          0,          "number of frames to skip before random access")
     115#if SVC_EXTENSION
     116  ("OutputBitDepth%d,%d",       cfg_outputBitDepthY,                0, MAX_LAYERS, "bit depth of YUV output luma component (default: use 0 for native depth)")
     117  ("OutputBitDepthC%d,%d",      cfg_outputBitDepthC,                0, MAX_LAYERS, "bit depth of YUV output chroma component (default: use 0 for native depth)")
     118#else
    105119  ("OutputBitDepth,d",          m_outputBitDepth[CHANNEL_TYPE_LUMA],   0,          "bit depth of YUV output luma component (default: use 0 for native depth)")
    106120  ("OutputBitDepthC,d",         m_outputBitDepth[CHANNEL_TYPE_CHROMA], 0,          "bit depth of YUV output chroma component (default: use 0 for native depth)")
     121#endif
    107122  ("OutputColourSpaceConvert",  outputColourSpaceConvert,              string(""), "Colour space conversion to apply to input 444 video. Permitted values are (empty string=UNCHANGED) " + getListOfColourSpaceConverts(false))
    108123  ("MaxTemporalLayer,t",        m_iMaxTemporalLayer,                   -1,         "Maximum Temporal Layer to be decoded. -1 to decode all layers")
     
    168183    assert( olsIdx != -1 ); // In the conformance mode, target output layer set index is to be explicitly specified.
    169184
    170     if( cfg_confPrefix.empty() )
     185    if( confPrefix.empty() )
    171186    {
    172187      m_confPrefix = string("decodedBitstream");
     
    174189    else
    175190    {
    176       m_confPrefix = cfg_confPrefix;
     191      m_confPrefix = confPrefix;
    177192    }
    178193      // Open metadata file and write
  • branches/SHM-dev/source/App/TAppDecoder/TAppDecCfg.h

    r1460 r1472  
    6464#endif
    6565  Int           m_iSkipFrame;                           ///< counter for frames prior to the random access point to skip
     66#if SVC_EXTENSION
     67  Int           m_outputBitDepth[MAX_LAYERS][MAX_NUM_CHANNEL_TYPE]; ///< bit depth used for writing output
     68#else
    6669  Int           m_outputBitDepth[MAX_NUM_CHANNEL_TYPE]; ///< bit depth used for writing output
     70#endif
    6771  InputColourSpaceConversion m_outputColourSpaceConvert;
    6872
     
    119123  , m_bClipOutputVideoToRec709Range(false)
    120124  {
     125#if SVC_EXTENSION
     126    for( Int layerId = 0; layerId < MAX_LAYERS; layerId++ )
     127    {
     128      for( UInt channelTypeIndex = 0; channelTypeIndex < MAX_NUM_CHANNEL_TYPE; channelTypeIndex++ )
     129      {
     130        m_outputBitDepth[layerId][channelTypeIndex] = 0;
     131      }
     132    }
     133#else
    121134    for (UInt channelTypeIndex = 0; channelTypeIndex < MAX_NUM_CHANNEL_TYPE; channelTypeIndex++)
    122135    {
    123136      m_outputBitDepth[channelTypeIndex] = 0;
    124137    }
     138#endif
    125139  }
    126140
  • branches/SHM-dev/source/App/TAppDecoder/TAppDecTop.cpp

    r1471 r1472  
    325325      if ( !m_reconFileName[curLayerId].empty() && !openedReconFile[curLayerId] )
    326326      {
    327         const BitDepths &bitDepths=pcListPic->front()->getSlice(0)->getBitDepths(); // use bit depths of first reconstructed picture.
    328         for (UInt channelType = 0; channelType < MAX_NUM_CHANNEL_TYPE; channelType++)
    329         {
    330           if (m_outputBitDepth[channelType] == 0)
     327        const BitDepths& bitDepths = m_apcTDecTop[curLayerId]->getParameterSetManager()->getActiveVPS()->getBitDepths( m_apcTDecTop[curLayerId]->getParameterSetManager()->getActiveSPS(), curLayerId );
     328
     329        for( UInt channelType = 0; channelType < MAX_NUM_CHANNEL_TYPE; channelType++)
     330        {
     331          if( m_outputBitDepth[curLayerId][channelType] == 0 )
    331332          {
    332             m_outputBitDepth[channelType] = bitDepths.recon[channelType];
     333            m_outputBitDepth[curLayerId][channelType] = bitDepths.recon[channelType];
    333334          }
    334335        }
    335         m_apcTVideoIOYuvReconFile[curLayerId]->open( m_reconFileName[curLayerId], true, m_outputBitDepth, m_outputBitDepth, bitDepths.recon ); // write mode
     336        m_apcTVideoIOYuvReconFile[curLayerId]->open( m_reconFileName[curLayerId], true, m_outputBitDepth[curLayerId], m_outputBitDepth[curLayerId], bitDepths.recon ); // write mode
    336337
    337338        openedReconFile[curLayerId] = true;
Note: See TracChangeset for help on using the changeset viewer.