Changeset 1029 in SHVCSoftware for branches/SHM-dev/source/App/TAppDecoder


Ignore:
Timestamp:
26 Feb 2015, 00:21:54 (10 years ago)
Author:
seregin
Message:

merge with SHM-upgrade branch

Location:
branches/SHM-dev
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-dev

  • branches/SHM-dev/source

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

    r1005 r1029  
    4141#include "TAppDecCfg.h"
    4242#include "TAppCommon/program_options_lite.h"
     43#include "TLibCommon/TComChromaFormat.h"
    4344#if SVC_EXTENSION
    4445#include <cassert>
     
    8384
    8485  string cfg_TargetDecLayerIdSetFile;
     86  string outputColourSpaceConvert;
    8587
    8688  po::Options opts;
    8789  opts.addOptions()
    88   ("help", do_help, false, "this help text")
    89   ("BitstreamFile,b", cfg_BitstreamFile, string(""), "bitstream input file name")
     90
     91
     92  ("help",                      do_help,                               false,      "this help text")
     93  ("BitstreamFile,b",           cfg_BitstreamFile,                     string(""), "bitstream input file name")
    9094#if SVC_EXTENSION
    9195  ("ReconFileL%d,-o%d",   cfg_ReconFile,   string(""), MAX_LAYERS, "Layer %d reconstructed YUV output file name\n"
     
    98102#endif
    99103#endif
    100 #else
    101   ("ReconFile,o",     cfg_ReconFile,     string(""), "reconstructed YUV output file name\n"
    102                                                      "YUV writing is skipped if omitted")
    103 #endif
    104   ("SkipFrames,s", m_iSkipFrame, 0, "number of frames to skip before random access")
    105   ("OutputBitDepth,d", m_outputBitDepthY, 0, "bit depth of YUV output luma component (default: use 0 for native depth)")
    106   ("OutputBitDepthC,d", m_outputBitDepthC, 0, "bit depth of YUV output chroma component (default: use 0 for native depth)")
    107 #if SVC_EXTENSION
    108104#if FIX_CONF_MODE
    109105  ("LayerNum,-ls", nLayerNum, MAX_NUM_LAYER_IDS, "Number of layers to be decoded.")
     
    118114  ("ConformanceMetadataPrefix,-confPrefix", cfg_confPrefix, string(""), "Prefix for the file name of the conformance data. Default name - 'decodedBitstream'")
    119115#endif
    120 #endif
    121   ("MaxTemporalLayer,t", m_iMaxTemporalLayer, -1, "Maximum Temporal Layer to be decoded. -1 to decode all layers")
    122   ("SEIDecodedPictureHash", m_decodedPictureHashSEIEnabled, 1, "Control handling of decoded picture hash SEI messages\n"
    123                                               "\t1: check hash in SEI messages if available in the bitstream\n"
    124                                               "\t0: ignore SEI message")
    125   ("SEIpictureDigest", m_decodedPictureHashSEIEnabled, 1, "deprecated alias for SEIDecodedPictureHash")
    126   ("TarDecLayerIdSetFile,l", cfg_TargetDecLayerIdSetFile, string(""), "targetDecLayerIdSet file name. The file should include white space separated LayerId values to be decoded. Omitting the option or a value of -1 in the file decodes all layers.")
    127   ("RespectDefDispWindow,w", m_respectDefDispWindow, 0, "Only output content inside the default display window\n")
     116#else
     117  ("ReconFile,o",               cfg_ReconFile,                         string(""), "reconstructed YUV output file name\n"
     118                                                                                   "YUV writing is skipped if omitted")
     119#endif
     120
     121  ("SkipFrames,s",              m_iSkipFrame,                          0,          "number of frames to skip before random access")
     122  ("OutputBitDepth,d",          m_outputBitDepth[CHANNEL_TYPE_LUMA],   0,          "bit depth of YUV output luma component (default: use 0 for native depth)")
     123  ("OutputBitDepthC,d",         m_outputBitDepth[CHANNEL_TYPE_CHROMA], 0,          "bit depth of YUV output chroma component (default: use 0 for native depth)")
     124  ("OutputColourSpaceConvert",  outputColourSpaceConvert,              string(""), "Colour space conversion to apply to input 444 video. Permitted values are (empty string=UNCHANGED) " + getListOfColourSpaceConverts(false))
     125  ("MaxTemporalLayer,t",        m_iMaxTemporalLayer,                   -1,         "Maximum Temporal Layer to be decoded. -1 to decode all layers")
     126  ("SEIDecodedPictureHash",     m_decodedPictureHashSEIEnabled,        1,          "Control handling of decoded picture hash SEI messages\n"
     127                                                                                   "\t1: check hash in SEI messages if available in the bitstream\n"
     128                                                                                   "\t0: ignore SEI message")
     129  ("SEIpictureDigest",          m_decodedPictureHashSEIEnabled,        1,          "deprecated alias for SEIDecodedPictureHash")
     130  ("SEINoDisplay",              m_decodedNoDisplaySEIEnabled,          true,       "Control handling of decoded no display SEI messages")
     131  ("TarDecLayerIdSetFile,l",    cfg_TargetDecLayerIdSetFile,           string(""), "targetDecLayerIdSet file name. The file should include white space separated LayerId values to be decoded. Omitting the option or a value of -1 in the file decodes all layers.")
     132  ("RespectDefDispWindow,w",    m_respectDefDispWindow,                0,          "Only output content inside the default display window\n")
     133#if O0043_BEST_EFFORT_DECODING
     134  ("ForceDecodeBitDepth",       m_forceDecodeBitDepth,                 0U,         "Force the decoder to operate at a particular bit-depth (best effort decoding)")
     135#endif
    128136#if Q0074_COLOUR_REMAPPING_SEI
    129137  ("SEIColourRemappingInfo", m_colourRemapSEIEnabled, false, "Control handling of Colour Remapping Information SEI messages\n"
     
    132140#endif
    133141  ;
     142
    134143  po::setDefaults(opts);
    135144  const list<const Char*>& argv_unhandled = po::scanArgv(opts, argc, (const Char**) argv);
     
    143152  {
    144153    po::doHelp(cout, opts);
     154    return false;
     155  }
     156
     157  m_outputColourSpaceConvert = stringToInputColourSpaceConvert(outputColourSpaceConvert, false);
     158  if (m_outputColourSpaceConvert>=NUMBER_INPUT_COLOUR_SPACE_CONVERSIONS)
     159  {
     160    fprintf(stderr, "Bad output colour space conversion string\n");
    145161    return false;
    146162  }
     
    157173  assert( m_tgtLayerId < MAX_NUM_LAYER_IDS );
    158174#endif
    159 #if OUTPUT_LAYER_SET_INDEX 
     175#if OUTPUT_LAYER_SET_INDEX
    160176#if CONFORMANCE_BITSTREAM_MODE
    161177  if( m_confModeFlag )
     
    179195    // Decoded layer YUV files
    180196#if FIX_CONF_MODE
    181     for(Int layer= 0; layer <= MAX_VPS_LAYER_ID_PLUS1-1; layer++ )
     197    for(Int layer= 0; layer < MAX_VPS_LAYER_ID_PLUS1; layer++ )
    182198#else
    183199    for(UInt layer=0; layer<= m_tgtLayerId; layer++)
     
    190206  }
    191207#endif
    192   this->getCommonDecoderParams()->setTargetOutputLayerSetIdx( olsIdx      );
    193   this->getCommonDecoderParams()->setTargetLayerId    ( m_tgtLayerId );
     208  m_commonDecoderParams.setTargetOutputLayerSetIdx( olsIdx );
     209  m_commonDecoderParams.setTargetLayerId( m_tgtLayerId );
    194210#endif
    195211#if FIX_CONF_MODE
    196   for(Int layer = 0; layer <= MAX_VPS_LAYER_ID_PLUS1-1; layer++ )
     212  for(Int layer = 0; layer < MAX_VPS_LAYER_ID_PLUS1; layer++ )
    197213  {
    198214#else
     
    212228  if (!m_pchBitstreamFile)
    213229  {
    214     fprintf(stderr, "No input file specifed, aborting\n");
     230    fprintf(stderr, "No input file specified, aborting\n");
    215231    return false;
    216232  }
     
    240256        if ( layerIdParsed < 0 || layerIdParsed >= MAX_NUM_LAYER_IDS )
    241257        {
    242           fprintf(stderr, "Warning! Parsed LayerId %d is not withing allowed range [0,%d]. Ignoring this value.\n", layerIdParsed, MAX_NUM_LAYER_IDS-1 );
     258          fprintf(stderr, "Warning! Parsed LayerId %d is not within allowed range [0,%d]. Ignoring this value.\n", layerIdParsed, MAX_NUM_LAYER_IDS-1 );
    243259        }
    244260        else
     
    250266      fclose (targetDecLayerIdSetFile);
    251267#if !R0235_SMALLEST_LAYER_ID  // LayerId=0 is not required anymore in some cases
    252       if (m_targetDecLayerIdSet.size() > 0 && !isLayerIdZeroIncluded)
     268      if ( m_targetDecLayerIdSet.size() > 0 && !isLayerIdZeroIncluded )
    253269      {
    254270        fprintf(stderr, "TargetDecLayerIdSet must contain LayerId=0, aborting" );
  • branches/SHM-dev/source/App/TAppDecoder/TAppDecCfg.h

    r924 r1029  
    5757{
    5858protected:
    59   Char*         m_pchBitstreamFile;                   ///< input bitstream file name
     59  Char*         m_pchBitstreamFile;                     ///< input bitstream file name
    6060#if SVC_EXTENSION
    6161  Char*         m_pchReconFile [MAX_LAYERS];          ///< output reconstruction file name
    6262#else
    63   Char*         m_pchReconFile;                       ///< output reconstruction file name
     63  Char*         m_pchReconFile;                         ///< output reconstruction file name
    6464#endif
    65   Int           m_iSkipFrame;                         ///< counter for frames prior to the random access point to skip
    66   Int           m_outputBitDepthY;                     ///< bit depth used for writing output (luma)
    67   Int           m_outputBitDepthC;                     ///< bit depth used for writing output (chroma)t
     65  Int           m_iSkipFrame;                           ///< counter for frames prior to the random access point to skip
     66  Int           m_outputBitDepth[MAX_NUM_CHANNEL_TYPE]; ///< bit depth used for writing output
     67  InputColourSpaceConversion m_outputColourSpaceConvert;
    6868
    6969  Int           m_iMaxTemporalLayer;                  ///< maximum temporal layer to be decoded
    7070  Int           m_decodedPictureHashSEIEnabled;       ///< Checksum(3)/CRC(2)/MD5(1)/disable(0) acting on decoded picture hash SEI message
     71  Bool          m_decodedNoDisplaySEIEnabled;         ///< Enable(true)/disable(false) writing only pictures that get displayed based on the no display SEI message
    7172#if Q0074_COLOUR_REMAPPING_SEI
    7273  Bool          m_colourRemapSEIEnabled;              ///< Enable the Colour Remapping Information SEI message if available (remapping decoded pictures)
     
    8586
    8687  std::vector<Int> m_targetDecLayerIdSet;             ///< set of LayerIds to be included in the sub-bitstream extraction process.
    87   Int           m_respectDefDispWindow;               ///< Only output content inside the default display window
     88  Int           m_respectDefDispWindow;               ///< Only output content inside the default display window
     89#if O0043_BEST_EFFORT_DECODING
     90  UInt          m_forceDecodeBitDepth;                ///< if non-zero, force the bit depth at the decoder (best effort decoding)
     91#endif
     92  std::string   m_outputDecodedSEIMessagesFilename;   ///< filename to output decoded SEI messages to. If '-', then use stdout. If empty, do not output details.
    8893#if OUTPUT_LAYER_SET_INDEX
    8994  CommonDecoderParams             m_commonDecoderParams;
     
    9196#if CONFORMANCE_BITSTREAM_MODE
    9297  Bool          m_confModeFlag;
    93   std::string m_confPrefix;
    94   std::string m_metadataFileName;
    95   Bool m_metadataFileRefresh;
     98  std::string   m_confPrefix;
     99  std::string   m_metadataFileName;
     100  Bool          m_metadataFileRefresh;
    96101  std::string   m_decodedYuvLayerFileName[63];
    97102  Bool          m_decodedYuvLayerRefresh[63];
     
    102107  : m_pchBitstreamFile(NULL)
    103108#if !SVC_EXTENSION
    104   , m_pchReconFile(NULL) 
     109  , m_pchReconFile(NULL)
    105110#endif
    106111  , m_iSkipFrame(0)
    107   , m_outputBitDepthY(0)
    108   , m_outputBitDepthC(0)
     112  , m_outputColourSpaceConvert(IPCOLOURSPACE_UNCHANGED)
    109113  , m_iMaxTemporalLayer(-1)
    110114  , m_decodedPictureHashSEIEnabled(0)
     115  , m_decodedNoDisplaySEIEnabled(false)
    111116#if Q0074_COLOUR_REMAPPING_SEI
    112117  , m_colourRemapSEIEnabled(0)
     
    120125#endif
    121126  , m_respectDefDispWindow(0)
    122   {}
     127#if O0043_BEST_EFFORT_DECODING
     128  , m_forceDecodeBitDepth(0)
     129#endif
     130  {
     131    for (UInt channelTypeIndex = 0; channelTypeIndex < MAX_NUM_CHANNEL_TYPE; channelTypeIndex++)
     132      m_outputBitDepth[channelTypeIndex] = 0;
     133  }
     134
    123135  virtual ~TAppDecCfg() {}
    124  
     136
    125137  Bool  parseCfg        ( Int argc, Char* argv[] );   ///< initialize option class from configuration
    126138#if OUTPUT_LAYER_SET_INDEX
  • branches/SHM-dev/source/App/TAppDecoder/TAppDecTop.cpp

    r1005 r1029  
    4141#include <fcntl.h>
    4242#include <assert.h>
    43 #include <iostream>
     43
    4444#include "TAppDecTop.h"
    4545#include "TLibDecoder/AnnexBread.h"
    4646#include "TLibDecoder/NALread.h"
     47#if RExt__DECODER_DEBUG_BIT_STATISTICS
     48#include "TLibCommon/TComCodingStatistics.h"
     49#endif
     50#if CONFORMANCE_BITSTREAM_MODE
    4751#include "TLibCommon/TComPicYuv.h"
    4852#include "libmd5/MD5.h"
     53#endif
     54
    4955//! \ingroup TAppDecoder
    5056//! \{
     
    8389#if SVC_EXTENSION
    8490#if FIX_CONF_MODE
    85   for(Int i = 0; i <= MAX_VPS_LAYER_ID_PLUS1-1; i++ )
     91  for(Int i = 0; i < MAX_VPS_LAYER_ID_PLUS1; i++ )
    8692#else
    8793  for( Int i = 0; i <= m_tgtLayerId; i++ )
     
    137143  InputByteStream bytestream(bitstreamFile);
    138144
     145  if (!m_outputDecodedSEIMessagesFilename.empty() && m_outputDecodedSEIMessagesFilename!="-")
     146  {
     147    m_seiMessageFileStream.open(m_outputDecodedSEIMessagesFilename.c_str(), std::ios::out);
     148    if (!m_seiMessageFileStream.is_open() || !m_seiMessageFileStream.good())
     149    {
     150      fprintf(stderr, "\nUnable to open file `%s' for writing decoded SEI messages\n", m_outputDecodedSEIMessagesFilename.c_str());
     151      exit(EXIT_FAILURE);
     152    }
     153  }
     154
    139155  // create & initialize internal classes
    140156  xCreateDecLib();
    141   xInitDecLib  ();
     157  xInitDecLib  (); 
    142158
    143159  // main decoder loop
     
    147163
    148164#if FIX_CONF_MODE
    149   for(UInt layer = 0; layer <= MAX_VPS_LAYER_ID_PLUS1-1; layer++)
     165  for(UInt layer = 0; layer < MAX_VPS_LAYER_ID_PLUS1; layer++)
    150166#else
    151167  for(UInt layer=0; layer<=m_tgtLayerId; layer++)
     
    177193     * requires the TDecTop::decode() method to be called again with the same
    178194     * nal unit. */
     195#if RExt__DECODER_DEBUG_BIT_STATISTICS
     196    TComCodingStatistics::TComCodingStatisticsData backupStats(TComCodingStatistics::GetStatistics());
     197    streampos location = bitstreamFile.tellg() - streampos(bytestream.GetNumBufferedBytes());
     198#else
    179199    streampos location = bitstreamFile.tellg();
     200#endif
    180201    AnnexBStats stats = AnnexBStats();
    181202
     
    183204    InputNALUnit nalu;
    184205    byteStreamNALUnit(bytestream, nalUnit, stats);
     206
    185207    // call actual decoding function
    186208    Bool bNewPicture = false;
    187209    Bool bNewPOC = false;
     210
    188211    if (nalUnit.empty())
    189212    {
     
    221244           * [1] except for the first NAL unit in the file
    222245           *     (but bNewPicture doesn't happen then) */
     246#if RExt__DECODER_DEBUG_BIT_STATISTICS
     247          bitstreamFile.seekg(location);
     248          bytestream.reset();
     249          TComCodingStatistics::SetStatistics(backupStats);
     250#else
    223251          bitstreamFile.seekg(location-streamoff(3));
    224252          bytestream.reset();
     253#endif
    225254        }
    226255#if POC_RESET_IDC_DECODER
     
    232261          bitstreamFile.seekg(location);
    233262          bytestream.reset();
     263#if RExt__DECODER_DEBUG_BIT_STATISTICS
     264          TComCodingStatistics::SetStatistics(backupStats);
     265#endif
    234266        }
    235267#endif
     
    238270
    239271#if POC_RESET_IDC_DECODER
    240     if ((bNewPicture && m_acTDecTop[nalu.m_layerId].getParseIdc() == 3) || (m_acTDecTop[nalu.m_layerId].getParseIdc() == 0) || !bitstreamFile || nalu.m_nalUnitType == NAL_UNIT_EOS)
    241 #else
    242     if (bNewPicture || !bitstreamFile || nalu.m_nalUnitType == NAL_UNIT_EOS)
     272    if ( ( (bNewPicture && m_acTDecTop[nalu.m_layerId].getParseIdc() == 3) || m_acTDecTop[nalu.m_layerId].getParseIdc() == 0 || !bitstreamFile || nalu.m_nalUnitType == NAL_UNIT_EOS ) &&
     273        !m_acTDecTop[nalu.m_layerId].getFirstSliceInSequence() )
     274#else
     275    if ( (bNewPicture || !bitstreamFile || nalu.m_nalUnitType == NAL_UNIT_EOS) &&
     276        !m_acTDecTop[nalu.m_layerId].getFirstSliceInSequence() )
    243277#endif
    244278    {
    245279#if O0194_DIFFERENT_BITDEPTH_EL_BL
    246280      //Bug fix: The bit depth was not set correctly for each layer when doing DBF
    247       g_bitDepthY = g_bitDepthYLayer[curLayerId];
    248       g_bitDepthC = g_bitDepthCLayer[curLayerId];
     281      g_bitDepth[CHANNEL_TYPE_LUMA]   = g_bitDepthLayer[CHANNEL_TYPE_LUMA][curLayerId];
     282      g_bitDepth[CHANNEL_TYPE_CHROMA] = g_bitDepthLayer[CHANNEL_TYPE_CHROMA][curLayerId];
    249283#endif
    250284      if (!loopFiltered[curLayerId] || bitstreamFile)
     
    256290      m_acTDecTop[curLayerId].earlyPicMarking(m_iMaxTemporalLayer, m_targetDecLayerIdSet);
    257291#endif
     292      if (nalu.m_nalUnitType == NAL_UNIT_EOS)
     293      {
     294        m_acTDecTop[nalu.m_layerId].setFirstSliceInSequence(true);
     295      }
     296    }
     297    else if ( (bNewPicture || !bitstreamFile || nalu.m_nalUnitType == NAL_UNIT_EOS ) &&
     298              m_acTDecTop[nalu.m_layerId].getFirstSliceInSequence () )
     299    {
     300      m_acTDecTop[nalu.m_layerId].setFirstSliceInPicture (true);
    258301    }
    259302
     
    269312      if ( m_pchReconFile[curLayerId] && !openedReconFile[curLayerId] )
    270313      {
    271         if (!m_outputBitDepthY) { m_outputBitDepthY = g_bitDepthY; }
    272         if (!m_outputBitDepthC) { m_outputBitDepthC = g_bitDepthC; }
    273 
    274         m_acTVideoIOYuvReconFile[curLayerId].open( m_pchReconFile[curLayerId], true, m_outputBitDepthY, m_outputBitDepthC, g_bitDepthY, g_bitDepthC ); // write mode
     314        for (UInt channelType = 0; channelType < MAX_NUM_CHANNEL_TYPE; channelType++)
     315        {
     316          if (m_outputBitDepth[channelType] == 0) m_outputBitDepth[channelType] = g_bitDepth[channelType];
     317        }
     318        m_acTVideoIOYuvReconFile[curLayerId].open( m_pchReconFile[curLayerId], true, m_outputBitDepth, m_outputBitDepth, g_bitDepth ); // write mode
    275319
    276320        openedReconFile[curLayerId] = true;
     
    362406
    363407#if FIX_CONF_MODE
    364   for(UInt layer = layerIdmin; layer <= MAX_VPS_LAYER_ID_PLUS1-1; layer++)
     408  for(UInt layer = layerIdmin; layer < MAX_VPS_LAYER_ID_PLUS1; layer++)
    365409#else
    366410  for(UInt layer = layerIdmin; layer <= m_tgtLayerId; layer++)
     
    390434
    391435  InputByteStream bytestream(bitstreamFile);
     436
     437  if (!m_outputDecodedSEIMessagesFilename.empty() && m_outputDecodedSEIMessagesFilename!="-")
     438  {
     439    m_seiMessageFileStream.open(m_outputDecodedSEIMessagesFilename.c_str(), std::ios::out);
     440    if (!m_seiMessageFileStream.is_open() || !m_seiMessageFileStream.good())
     441    {
     442      fprintf(stderr, "\nUnable to open file `%s' for writing decoded SEI messages\n", m_outputDecodedSEIMessagesFilename.c_str());
     443      exit(EXIT_FAILURE);
     444    }
     445  }
    392446
    393447  // create & initialize internal classes
     
    406460     * requires the TDecTop::decode() method to be called again with the same
    407461     * nal unit. */
     462#if RExt__DECODER_DEBUG_BIT_STATISTICS
     463    TComCodingStatistics::TComCodingStatisticsData backupStats(TComCodingStatistics::GetStatistics());
     464    streampos location = bitstreamFile.tellg() - streampos(bytestream.GetNumBufferedBytes());
     465#else
    408466    streampos location = bitstreamFile.tellg();
     467#endif
    409468    AnnexBStats stats = AnnexBStats();
    410469
     
    429488      if( (m_iMaxTemporalLayer >= 0 && nalu.m_temporalId > m_iMaxTemporalLayer) || !isNaluWithinTargetDecLayerIdSet(&nalu)  )
    430489      {
    431           bNewPicture = false;
    432         }
     490        bNewPicture = false;
     491      }
    433492      else
    434493      {
     
    441500           * [1] except for the first NAL unit in the file
    442501           *     (but bNewPicture doesn't happen then) */
     502#if RExt__DECODER_DEBUG_BIT_STATISTICS
     503          bitstreamFile.seekg(location);
     504          bytestream.reset();
     505          TComCodingStatistics::SetStatistics(backupStats);
     506#else
    443507          bitstreamFile.seekg(location-streamoff(3));
    444508          bytestream.reset();
    445         }
    446       }
    447     }
    448     if (bNewPicture || !bitstreamFile || nalu.m_nalUnitType == NAL_UNIT_EOS)
     509#endif
     510        }
     511      }
     512    }
     513
     514    if ( (bNewPicture || !bitstreamFile || nalu.m_nalUnitType == NAL_UNIT_EOS) &&
     515        !m_cTDecTop.getFirstSliceInSequence () )
    449516    {
    450517      if (!loopFiltered || bitstreamFile)
     
    453520      }
    454521      loopFiltered = (nalu.m_nalUnitType == NAL_UNIT_EOS);
    455     }
    456 #if !FIX_WRITING_OUTPUT
    457 #if SETTING_NO_OUT_PIC_PRIOR
    458     if (bNewPicture && m_cTDecTop.getNoOutputPriorPicsFlag())
    459     {
    460       m_cTDecTop.checkNoOutputPriorPics( pcListPic );
    461     }
    462 #endif
    463 #endif
     522      if (nalu.m_nalUnitType == NAL_UNIT_EOS)
     523      {
     524        m_cTDecTop.setFirstSliceInSequence(true);
     525      }
     526    }
     527    else if ( (bNewPicture || !bitstreamFile || nalu.m_nalUnitType == NAL_UNIT_EOS ) &&
     528              m_cTDecTop.getFirstSliceInSequence () )
     529    {
     530      m_cTDecTop.setFirstSliceInPicture (true);
     531    }
    464532
    465533    if( pcListPic )
     
    467535      if ( m_pchReconFile && !openedReconFile )
    468536      {
    469         if (!m_outputBitDepthY) { m_outputBitDepthY = g_bitDepthY; }
    470         if (!m_outputBitDepthC) { m_outputBitDepthC = g_bitDepthC; }
    471 
    472         m_cTVideoIOYuvReconFile.open( m_pchReconFile, true, m_outputBitDepthY, m_outputBitDepthC, g_bitDepthY, g_bitDepthC ); // write mode
     537        for (UInt channelType = 0; channelType < MAX_NUM_CHANNEL_TYPE; channelType++)
     538        {
     539          if (m_outputBitDepth[channelType] == 0) m_outputBitDepth[channelType] = g_bitDepth[channelType];
     540        }
     541
     542        m_cTVideoIOYuvReconFile.open( m_pchReconFile, true, m_outputBitDepth, m_outputBitDepth, g_bitDepth ); // write mode
    473543        openedReconFile = true;
    474544      }
    475 #if FIX_WRITING_OUTPUT
    476545      // write reconstruction to file
    477546      if( bNewPicture )
     
    479548        xWriteOutput( pcListPic, nalu.m_temporalId );
    480549      }
    481 #if SETTING_NO_OUT_PIC_PRIOR
    482550      if ( (bNewPicture || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_CRA) && m_cTDecTop.getNoOutputPriorPicsFlag() )
    483551      {
     
    485553        m_cTDecTop.setNoOutputPriorPicsFlag (false);
    486554      }
    487 #endif
    488 #endif
    489555      if ( bNewPicture &&
    490556           (   nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_W_RADL
     
    498564      if (nalu.m_nalUnitType == NAL_UNIT_EOS)
    499565      {
    500 #if FIX_OUTPUT_EOS
    501566        xWriteOutput( pcListPic, nalu.m_temporalId );
    502 #else
    503         xFlushOutput( pcListPic );       
    504 #endif
     567        m_cTDecTop.setFirstSliceInPicture (false);
    505568      }
    506569      // write reconstruction to file -- for additional bumping as defined in C.5.2.3
    507 #if FIX_WRITING_OUTPUT
    508570      if(!bNewPicture && nalu.m_nalUnitType >= NAL_UNIT_CODED_SLICE_TRAIL_N && nalu.m_nalUnitType <= NAL_UNIT_RESERVED_VCL31)
    509 #else
    510       if(bNewPicture)
    511 #endif
    512571      {
    513572        xWriteOutput( pcListPic, nalu.m_temporalId );
     
    534593  // initialize global variables
    535594  initROM();
     595
    536596#if FIX_CONF_MODE
    537   for(UInt layer = 0; layer <= MAX_VPS_LAYER_ID_PLUS1-1; layer++)
     597  for(UInt layer = 0; layer < MAX_VPS_LAYER_ID_PLUS1; layer++)
    538598#else
    539599  for(UInt layer = 0; layer <= m_tgtLayerId; layer++)
     
    559619  // destroy ROM
    560620  destroyROM();
     621
    561622#if FIX_CONF_MODE
    562   for(UInt layer = 0; layer <= MAX_VPS_LAYER_ID_PLUS1-1; layer++)
     623  for(UInt layer = 0; layer < MAX_VPS_LAYER_ID_PLUS1; layer++)
    563624#else
    564625  for(UInt layer = 0; layer <= m_tgtLayerId; layer++)
     
    589650#if SVC_EXTENSION
    590651#if FIX_CONF_MODE
    591   for(UInt layer = 0; layer <= MAX_VPS_LAYER_ID_PLUS1-1; layer++)
     652  for(UInt layer = 0; layer < MAX_VPS_LAYER_ID_PLUS1; layer++)
    592653#else
    593654  for(UInt layer = 0; layer <= m_tgtLayerId; layer++)
     
    605666#endif
    606667#if OUTPUT_LAYER_SET_INDEX
    607     m_acTDecTop[layer].setCommonDecoderParams( this->getCommonDecoderParams() );
     668    m_acTDecTop[layer].setCommonDecoderParams( &m_commonDecoderParams );
    608669#endif
    609670  }
     
    615676#endif
    616677  {
    617     m_acTDecTop[layer].setConfModeFlag ( this->getConfModeFlag() );
     678    m_acTDecTop[layer].setConfModeFlag( m_confModeFlag );
    618679  }
    619680#endif
     
    621682  m_cTDecTop.init();
    622683  m_cTDecTop.setDecodedPictureHashSEIEnabled(m_decodedPictureHashSEIEnabled);
     684#if O0043_BEST_EFFORT_DECODING
     685  m_cTDecTop.setForceDecodeBitDepth(m_forceDecodeBitDepth);
     686#endif
     687  if (!m_outputDecodedSEIMessagesFilename.empty())
     688  {
     689    std::ostream &os=m_seiMessageFileStream.is_open() ? m_seiMessageFileStream : std::cout;
     690    m_cTDecTop.setDecodedSEIMessageOutputStream(&os);
     691  }
    623692#if Q0074_COLOUR_REMAPPING_SEI
    624693  m_cTDecTop.setColourRemappingInfoSEIEnabled(m_colourRemapSEIEnabled);
     
    673742#endif
    674743    {
    675       numPicsNotYetDisplayed++;
     744       numPicsNotYetDisplayed++;
    676745      dpbFullness++;
    677746    }
     
    682751    iterPic++;
    683752  }
    684   iterPic   = pcListPic->begin();
     753
     754  iterPic = pcListPic->begin();
     755
    685756  if (numPicsNotYetDisplayed>2)
    686757  {
     
    720791          const Window &defDisp = m_respectDefDispWindow ? pcPicTop->getDefDisplayWindow() : Window();
    721792          const Bool isTff = pcPicTop->isTopField();
    722           TComPicYuv* pPicCYuvRecTop = pcPicTop->getPicYuvRec();
    723           TComPicYuv* pPicCYuvRecBot = pcPicBottom->getPicYuvRec();
     793
     794          Bool display = true;
     795          if( m_decodedNoDisplaySEIEnabled )
     796          {
     797            SEIMessages noDisplay = getSeisByType(pcPic->getSEIs(), SEI::NO_DISPLAY );
     798            const SEINoDisplay *nd = ( noDisplay.size() > 0 ) ? (SEINoDisplay*) *(noDisplay.begin()) : NULL;
     799            if( (nd != NULL) && nd->m_noDisplay )
     800            {
     801              display = false;
     802            }
     803          }
     804
     805          if (display)
     806          {           
    724807#if REPN_FORMAT_IN_VPS
    725           UInt chromaFormatIdc = pcPic->getSlice(0)->getChromaFormatIdc();
    726           Int xScal =  TComSPS::getWinUnitX( chromaFormatIdc ), yScal = TComSPS::getWinUnitY( chromaFormatIdc );
    727 
    728           m_acTVideoIOYuvReconFile[layerId].write( pPicCYuvRecTop, pPicCYuvRecBot,
    729             conf.getWindowLeftOffset()  * xScal + defDisp.getWindowLeftOffset(),
    730             conf.getWindowRightOffset() * xScal + defDisp.getWindowRightOffset(),
    731             conf.getWindowTopOffset()   * yScal + defDisp.getWindowTopOffset(),
    732             conf.getWindowBottomOffset()* yScal + defDisp.getWindowBottomOffset(), isTff );
    733 #else
    734           m_acTVideoIOYuvReconFile[layerId].write( pPicCYuvRecTop, pPicCYuvRecBot,
    735             conf.getWindowLeftOffset()   + defDisp.getWindowLeftOffset(),
    736             conf.getWindowRightOffset()  + defDisp.getWindowRightOffset(),
    737             conf.getWindowTopOffset()    + defDisp.getWindowTopOffset(),
    738             conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset(), isTff );
    739 #endif
     808            UInt chromaFormatIdc = pcPic->getSlice(0)->getChromaFormatIdc();
     809            Int xScal =  TComSPS::getWinUnitX( chromaFormatIdc ), yScal = TComSPS::getWinUnitY( chromaFormatIdc );
     810
     811            m_acTVideoIOYuvReconFile[layerId].write( pcPicTop->getPicYuvRec(), pcPicBottom->getPicYuvRec(),
     812              m_outputColourSpaceConvert,
     813              conf.getWindowLeftOffset()  * xScal + defDisp.getWindowLeftOffset(),
     814              conf.getWindowRightOffset() * xScal + defDisp.getWindowRightOffset(),
     815              conf.getWindowTopOffset()   * yScal + defDisp.getWindowTopOffset(),
     816              conf.getWindowBottomOffset()* yScal + defDisp.getWindowBottomOffset(), NUM_CHROMA_FORMAT, isTff );
     817#else
     818            m_acTVideoIOYuvReconFile[layerId].write( pcPicTop->getPicYuvRec(), pcPicBottom->getPicYuvRec(),
     819              m_outputColourSpaceConvert,
     820              conf.getWindowLeftOffset()   + defDisp.getWindowLeftOffset(),
     821              conf.getWindowRightOffset()  + defDisp.getWindowRightOffset(),
     822              conf.getWindowTopOffset()    + defDisp.getWindowTopOffset(),
     823              conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset(), NUM_CHROMA_FORMAT, isTff );
     824#endif
     825          }
    740826        }
    741827
     
    748834          const Window &defDisp = m_respectDefDispWindow ? pcPicTop->getDefDisplayWindow() : Window();
    749835          const Bool isTff = pcPicTop->isTopField();
    750           TComPicYuv* pPicCYuvRecTop = pcPicTop->getPicYuvRec();
    751           TComPicYuv* pPicCYuvRecBot = pcPicBottom->getPicYuvRec();
    752           m_cTVideoIOYuvReconFile.write( pPicCYuvRecTop, pPicCYuvRecBot,
    753             conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(),
    754             conf.getWindowRightOffset() + defDisp.getWindowRightOffset(),
    755             conf.getWindowTopOffset() + defDisp.getWindowTopOffset(),
    756             conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset(), isTff );
     836
     837          Bool display = true;
     838          if( m_decodedNoDisplaySEIEnabled )
     839          {
     840            SEIMessages noDisplay = getSeisByType(pcPic->getSEIs(), SEI::NO_DISPLAY );
     841            const SEINoDisplay *nd = ( noDisplay.size() > 0 ) ? (SEINoDisplay*) *(noDisplay.begin()) : NULL;
     842            if( (nd != NULL) && nd->m_noDisplay )
     843            {
     844              display = false;
     845            }
     846          }
     847
     848          if (display)
     849          {
     850            m_cTVideoIOYuvReconFile.write( pcPicTop->getPicYuvRec(), pcPicBottom->getPicYuvRec(),
     851                                           m_outputColourSpaceConvert,
     852                                           conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(),
     853                                           conf.getWindowRightOffset() + defDisp.getWindowRightOffset(),
     854                                           conf.getWindowTopOffset() + defDisp.getWindowTopOffset(),
     855                                           conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset(), NUM_CHROMA_FORMAT, isTff );
     856          }
    757857        }
    758858
     
    800900  {
    801901    iterPic = pcListPic->begin();
     902
    802903    while (iterPic != pcListPic->end())
    803904    {
     
    813914      {
    814915        // write to file
    815         numPicsNotYetDisplayed--;
     916         numPicsNotYetDisplayed--;
    816917        if(pcPic->getSlice(0)->isReferenced() == false)
    817918        {
     
    822923        {
    823924          const Window &conf = pcPic->getConformanceWindow();
    824           const Window &defDisp = m_respectDefDispWindow ? pcPic->getDefDisplayWindow() : Window();
    825           TComPicYuv* pPicCYuvRec = pcPic->getPicYuvRec();
     925          const Window &defDisp = m_respectDefDispWindow ? pcPic->getDefDisplayWindow() : Window();         
    826926#if REPN_FORMAT_IN_VPS
    827927          UInt chromaFormatIdc = pcPic->getSlice(0)->getChromaFormatIdc();
    828928          Int xScal =  TComSPS::getWinUnitX( chromaFormatIdc ), yScal = TComSPS::getWinUnitY( chromaFormatIdc );
    829929
    830           m_acTVideoIOYuvReconFile[layerId].write( pPicCYuvRec,
     930          m_acTVideoIOYuvReconFile[layerId].write( pcPic->getPicYuvRec(), m_outputColourSpaceConvert,
    831931            conf.getWindowLeftOffset()  * xScal + defDisp.getWindowLeftOffset(),
    832932            conf.getWindowRightOffset() * xScal + defDisp.getWindowRightOffset(),
     
    834934            conf.getWindowBottomOffset()* yScal + defDisp.getWindowBottomOffset() );
    835935#else
    836           m_acTVideoIOYuvReconFile[layerId].write( pPicCYuvRec,
     936          m_acTVideoIOYuvReconFile[layerId].write( pcPic->getPicYuvRec(), m_outputColourSpaceConvert,
    837937            conf.getWindowLeftOffset()   + defDisp.getWindowLeftOffset(),
    838938            conf.getWindowRightOffset()  + defDisp.getWindowRightOffset(),
     
    847947        if ( m_pchReconFile )
    848948        {
    849           const Window &conf = pcPic->getConformanceWindow();
     949          const Window &conf    = pcPic->getConformanceWindow();
    850950          const Window &defDisp = m_respectDefDispWindow ? pcPic->getDefDisplayWindow() : Window();
     951
    851952          m_cTVideoIOYuvReconFile.write( pcPic->getPicYuvRec(),
    852                                         conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(),
    853                                         conf.getWindowRightOffset() + defDisp.getWindowRightOffset(),
    854                                         conf.getWindowTopOffset() + defDisp.getWindowTopOffset(),
    855                                         conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset() );
     953                                         m_outputColourSpaceConvert,
     954                                         conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(),
     955                                         conf.getWindowRightOffset() + defDisp.getWindowRightOffset(),
     956                                         conf.getWindowTopOffset() + defDisp.getWindowTopOffset(),
     957                                         conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset() );
    856958        }
    857959
     
    9211023          const Window &conf = pcPicTop->getConformanceWindow();
    9221024          const Window &defDisp = m_respectDefDispWindow ? pcPicTop->getDefDisplayWindow() : Window();
    923           const Bool isTff = pcPicTop->isTopField();
    924           TComPicYuv* pPicCYuvRecTop = pcPicTop->getPicYuvRec();
    925           TComPicYuv* pPicCYuvRecBot = pcPicBottom->getPicYuvRec();
     1025          const Bool isTff = pcPicTop->isTopField();         
    9261026#if REPN_FORMAT_IN_VPS
    9271027          UInt chromaFormatIdc = pcPic->getSlice(0)->getChromaFormatIdc();
    9281028          Int xScal =  TComSPS::getWinUnitX( chromaFormatIdc ), yScal = TComSPS::getWinUnitY( chromaFormatIdc );
    9291029
    930           m_acTVideoIOYuvReconFile[layerId].write( pPicCYuvRecTop, pPicCYuvRecBot,
     1030          m_acTVideoIOYuvReconFile[layerId].write( pcPicTop->getPicYuvRec(), pcPicBottom->getPicYuvRec(), m_outputColourSpaceConvert,
    9311031            conf.getWindowLeftOffset()  *xScal + defDisp.getWindowLeftOffset(),
    9321032            conf.getWindowRightOffset() *xScal + defDisp.getWindowRightOffset(),
    9331033            conf.getWindowTopOffset()   *yScal + defDisp.getWindowTopOffset(),
    934             conf.getWindowBottomOffset()*yScal + defDisp.getWindowBottomOffset(), isTff );
    935 #else
    936           m_acTVideoIOYuvReconFile[layerId].write( pPicCYuvRecTop, pPicCYuvRecBot,
     1034            conf.getWindowBottomOffset()*yScal + defDisp.getWindowBottomOffset(), NUM_CHROMA_FORMAT, isTff );
     1035#else
     1036          m_acTVideoIOYuvReconFile[layerId].write( pcPicTop->getPicYuvRec(), pcPicBottom->getPicYuvRec(), m_outputColourSpaceConvert,
    9371037            conf.getWindowLeftOffset()   + defDisp.getWindowLeftOffset(),
    9381038            conf.getWindowRightOffset()  + defDisp.getWindowRightOffset(),
    9391039            conf.getWindowTopOffset()    + defDisp.getWindowTopOffset(),
    940             conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset(), isTff );
     1040            conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset(), NUM_CHROMA_FORMAT, isTff );
    9411041#endif
    9421042        }
     
    9501050          const Window &defDisp = m_respectDefDispWindow ? pcPicTop->getDefDisplayWindow() : Window();
    9511051          const Bool isTff = pcPicTop->isTopField();
    952           TComPicYuv* pPicCYuvRecTop = pcPicTop->getPicYuvRec();
    953           TComPicYuv* pPicCYuvRecBot = pcPicBottom->getPicYuvRec();
    954           m_cTVideoIOYuvReconFile.write( pPicCYuvRecTop, pPicCYuvRecBot,
    955             conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(),
    956             conf.getWindowRightOffset() + defDisp.getWindowRightOffset(),
    957             conf.getWindowTopOffset() + defDisp.getWindowTopOffset(),
    958             conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset(), isTff );
     1052          m_cTVideoIOYuvReconFile.write( pcPicTop->getPicYuvRec(), pcPicBottom->getPicYuvRec(),
     1053                                         m_outputColourSpaceConvert,
     1054                                         conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(),
     1055                                         conf.getWindowRightOffset() + defDisp.getWindowRightOffset(),
     1056                                         conf.getWindowTopOffset() + defDisp.getWindowTopOffset(),
     1057                                         conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset(), NUM_CHROMA_FORMAT, isTff );
    9591058        }
    9601059
     
    10271126        {
    10281127          const Window &conf = pcPic->getConformanceWindow();
    1029           const Window &defDisp = m_respectDefDispWindow ? pcPic->getDefDisplayWindow() : Window();
    1030           TComPicYuv* pPicCYuvRec = pcPic->getPicYuvRec();
     1128          const Window &defDisp = m_respectDefDispWindow ? pcPic->getDefDisplayWindow() : Window();         
    10311129#if REPN_FORMAT_IN_VPS
    10321130          UInt chromaFormatIdc = pcPic->getSlice(0)->getChromaFormatIdc();
    10331131          Int xScal =  TComSPS::getWinUnitX( chromaFormatIdc ), yScal = TComSPS::getWinUnitY( chromaFormatIdc );
    10341132
    1035           m_acTVideoIOYuvReconFile[layerId].write( pPicCYuvRec,
     1133          m_acTVideoIOYuvReconFile[layerId].write( pcPic->getPicYuvRec(), m_outputColourSpaceConvert,
    10361134            conf.getWindowLeftOffset()  *xScal + defDisp.getWindowLeftOffset(),
    10371135            conf.getWindowRightOffset() *xScal + defDisp.getWindowRightOffset(),
     
    10391137            conf.getWindowBottomOffset()*yScal + defDisp.getWindowBottomOffset() );
    10401138#else
    1041           m_acTVideoIOYuvReconFile[layerId].write( pPicCYuvRec,
     1139          m_acTVideoIOYuvReconFile[layerId].write( pcPic->getPicYuvRec(), m_outputColourSpaceConvert,
    10421140            conf.getWindowLeftOffset()   + defDisp.getWindowLeftOffset(),
    10431141            conf.getWindowRightOffset()  + defDisp.getWindowRightOffset(),
     
    10521150        if ( m_pchReconFile )
    10531151        {
    1054           const Window &conf = pcPic->getConformanceWindow();
     1152          const Window &conf    = pcPic->getConformanceWindow();
    10551153          const Window &defDisp = m_respectDefDispWindow ? pcPic->getDefDisplayWindow() : Window();
    1056           TComPicYuv* pPicCYuvRec = pcPic->getPicYuvRec();
    1057           m_cTVideoIOYuvReconFile.write( pPicCYuvRec,
    1058             conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(),
    1059             conf.getWindowRightOffset() + defDisp.getWindowRightOffset(),
    1060             conf.getWindowTopOffset() + defDisp.getWindowTopOffset(),
    1061             conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset() );
     1154
     1155          m_cTVideoIOYuvReconFile.write( pcPic->getPicYuvRec(),
     1156                                         m_outputColourSpaceConvert,
     1157                                         conf.getWindowLeftOffset() + defDisp.getWindowLeftOffset(),
     1158                                         conf.getWindowRightOffset() + defDisp.getWindowRightOffset(),
     1159                                         conf.getWindowTopOffset() + defDisp.getWindowTopOffset(),
     1160                                         conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset() );
    10621161        }
    10631162
     
    11431242#endif
    11441243    TComPicYuv* pPicCYuvRec = pic->getPicYuvRec();
    1145     m_acTVideoIOYuvReconFile[layerIdx].write( pPicCYuvRec,
     1244    m_acTVideoIOYuvReconFile[layerIdx].write( pPicCYuvRec, m_outputColourSpaceConvert,
    11461245      conf.getWindowLeftOffset()  * xScal + defDisp.getWindowLeftOffset(),
    11471246      conf.getWindowRightOffset() * xScal + defDisp.getWindowRightOffset(),
     
    11491248      conf.getWindowBottomOffset()* yScal + defDisp.getWindowBottomOffset() );
    11501249  }
    1151 
    11521250  // update POC of display order
    11531251  pocLastDisplay = pic->getPOC();
     
    14051503#if CONFORMANCE_BITSTREAM_MODE
    14061504      FILE *fptr;
    1407       if( this->getConfModeFlag() )
    1408       {
    1409         if( this->getMetadataFileRefresh() )
     1505      if( m_confModeFlag )
     1506      {
     1507        if( m_metadataFileRefresh )
    14101508        {
    14111509          fptr = fopen( this->getMetadataFileName().c_str(), "w" );
     
    14181516        }
    14191517        this->setMetadataFileRefresh(false);
    1420         UChar recon_digest[3][16];
    1421         calcMD5(*pic->getPicYuvRec(), recon_digest);
    1422         fprintf(fptr, "%8d%9d    MD5:%s\n", pic->getLayerId(), pic->getSlice(0)->getPOC(), digestToString(recon_digest, 16));
     1518
     1519        TComDigest recon_digest;
     1520        Int numChar = calcMD5(*pic->getPicYuvRec(), recon_digest);
     1521        fprintf(fptr, "%8d%9d    MD5:%s\n", pic->getLayerId(), pic->getSlice(0)->getPOC(), digestToString(recon_digest, numChar).c_str());
    14231522        fclose(fptr);
    14241523      }
    14251524#endif
    1426 
    14271525
    14281526      listOfPocsInEachLayer[layerIdx].erase( it );
     
    14341532  }
    14351533#if !FIX_ALIGN_BUMPING
    1436 #  // Update sub-DPB status
     1534  // Update sub-DPB status
    14371535  for( Int subDpbIdx = 0; subDpbIdx < dpbStatus.m_numSubDpbs; subDpbIdx++)
    14381536  {
     
    14401538  }
    14411539#endif
    1442   dpbStatus.m_numAUsNotDisplayed--;   
     1540  dpbStatus.m_numAUsNotDisplayed--;
    14431541
    14441542#if CONFORMANCE_BITSTREAM_MODE
    1445   if( this->getConfModeFlag() )
     1543  if( m_confModeFlag )
    14461544  {
    14471545    for( Int dpbLayerCtr = 0; dpbLayerCtr < dpbStatus.m_numLayers; dpbLayerCtr++)
     
    14531551      if( this->getDecodedYuvLayerRefresh(layerIdx) )
    14541552      {
    1455         if (!m_outputBitDepthY) { m_outputBitDepthY = g_bitDepthY; }
    1456         if (!m_outputBitDepthC) { m_outputBitDepthC = g_bitDepthC; }
     1553        if (!m_outputBitDepth[CHANNEL_TYPE_LUMA]) { m_outputBitDepth[CHANNEL_TYPE_LUMA] = g_bitDepth[CHANNEL_TYPE_LUMA]; }
     1554        if (!m_outputBitDepth[CHANNEL_TYPE_CHROMA]) { m_outputBitDepth[CHANNEL_TYPE_CHROMA] = g_bitDepth[CHANNEL_TYPE_CHROMA]; }
    14571555
    14581556        char tempFileName[256];
    14591557        strcpy(tempFileName, this->getDecodedYuvLayerFileName( layerIdx ).c_str());
    1460         m_confReconFile[layerIdx].open(tempFileName, true, m_outputBitDepthY, m_outputBitDepthC, g_bitDepthY, g_bitDepthC ); // write mode
     1558        m_confReconFile[layerIdx].open(tempFileName, true, m_outputBitDepth, m_outputBitDepth, g_bitDepth ); // write mode
    14611559        this->setDecodedYuvLayerRefresh( layerIdx, false );
    14621560      }
     
    14681566        const Window &conf = checkPic.getConformanceWindow();
    14691567        const Window &defDisp = m_respectDefDispWindow ? checkPic.getDefDisplayWindow() : Window();
    1470         Int xScal =  1, yScal = 1;
     1568        Int xScal = 1, yScal = 1;
    14711569  #if REPN_FORMAT_IN_VPS
    14721570        UInt chromaFormatIdc = checkPic.getSlice(0)->getChromaFormatIdc();
     
    14771575        {
    14781576          TComPicYuv* pPicCYuvRec = checkPic.getPicYuvRec();
    1479           m_confReconFile[layerIdx].write( pPicCYuvRec,
     1577          m_confReconFile[layerIdx].write( pPicCYuvRec, m_outputColourSpaceConvert,
    14801578            conf.getWindowLeftOffset()  * xScal + defDisp.getWindowLeftOffset(),
    14811579            conf.getWindowRightOffset() * xScal + defDisp.getWindowRightOffset(),
     
    14931591  }
    14941592#endif
     1593
    14951594  // Remove the picture from the listOfPocs
    14961595  listOfPocs.erase( listOfPocs.begin() );
    14971596}
    1498 
    14991597
    15001598TComVPS *TAppDecTop::findDpbParametersFromVps(std::vector<Int> const &listOfPocs, std::vector<Int> const *listOfPocsInEachLayer, std::vector<Int> const *listOfPocsPositionInEachLayer, DpbStatus &maxDpbLimit)
  • branches/SHM-dev/source/App/TAppDecoder/TAppDecTop.h

    r953 r1029  
    22 * License, included below. This software may be subject to other third party
    33 * and contributor rights, including patent rights, and no such rights are
    4  * granted under this license. 
     4 * granted under this license.
    55 *
    66 * Copyright (c) 2010-2014, ITU/ISO/IEC
     
    7171  TVideoIOYuv                     m_cTVideoIOYuvReconFile;        ///< reconstruction YUV class
    7272#endif
    73 #if CONFORMANCE_BITSTREAM_MODE
    74   TVideoIOYuv   m_confReconFile[63];        ///< decode YUV files
    75 #endif 
     73 
    7674  // for output control 
    7775#if SVC_EXTENSION
     76#if CONFORMANCE_BITSTREAM_MODE
     77  TVideoIOYuv                      m_confReconFile[63];        ///< decode YUV files
     78#endif
    7879  Int                             m_aiPOCLastDisplay [MAX_LAYERS]; ///< last POC in display order
    7980#else
    8081  Int                             m_iPOCLastDisplay;              ///< last POC in display order
    8182#endif
    82  
     83  std::ofstream                   m_seiMessageFileStream;         ///< Used for outputing SEI messages. 
     84
    8385public:
    8486  TAppDecTop();
    8587  virtual ~TAppDecTop() {}
    86  
     88
    8789  Void  create            (); ///< create internal members
    8890  Void  destroy           (); ///< destroy internal members
    8991  Void  decode            (); ///< main decoding function
    90  
     92
    9193protected:
    9294  Void  xCreateDecLib     (); ///< create internal classes
  • branches/SHM-dev/source/App/TAppDecoder/decmain.cpp

    r595 r1029  
    4444//! \{
    4545
    46 bool g_md5_mismatch = false; ///< top level flag that indicates if there has been a decoding mismatch
     46Bool g_md5_mismatch = false; ///< top level flag that indicates if there has been a decoding mismatch
    4747
    4848// ====================================================================================================================
     
    5959  fprintf( stdout, "SHM software: Decoder Version [%s]", NV_VERSION );
    6060#else
    61   fprintf( stdout, "HM software: Decoder Version [%s]", NV_VERSION );
     61  fprintf( stdout, "HM software: Decoder Version [%s] (including RExt)", NV_VERSION );
    6262#endif
    6363  fprintf( stdout, NVM_ONOS );
     
    7777
    7878  // starting time
    79   double dResult;
    80   long lBefore = clock();
     79  Double dResult;
     80  clock_t lBefore = clock();
    8181
    8282  // call decoding function
     
    8989
    9090  // ending time
    91   dResult = (double)(clock()-lBefore) / CLOCKS_PER_SEC;
     91  dResult = (Double)(clock()-lBefore) / CLOCKS_PER_SEC;
    9292  printf("\n Total Time: %12.3f sec.\n", dResult);
    9393
Note: See TracChangeset for help on using the changeset viewer.