Changeset 1386 in 3DVCSoftware for trunk/source/App


Ignore:
Timestamp:
13 Nov 2015, 16:29:39 (9 years ago)
Author:
tech
Message:

Merged 15.1-dev1@1381.

Location:
trunk/source/App
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/App/TAppDecoder/TAppDecCfg.cpp

    r1356 r1386  
    6262    \param argv array of arguments
    6363 */
    64 Bool TAppDecCfg::parseCfg( Int argc, Char* argv[] )
     64Bool TAppDecCfg::parseCfg( Int argc, TChar* argv[] )
    6565{
    6666  Bool do_help = false;
    67   string cfg_BitstreamFile;
    68   string cfg_ReconFile;
    6967  string cfg_TargetDecLayerIdSetFile;
    7068#if NH_3D
     
    7977
    8078  ("help",                      do_help,                               false,      "this help text")
    81   ("BitstreamFile,b",           cfg_BitstreamFile,                     string(""), "bitstream input file name")
    82   ("ReconFile,o",               cfg_ReconFile,                         string(""), "reconstructed YUV output file name\n"
     79  ("BitstreamFile,b",           m_bitstreamFileName,                   string(""), "bitstream input file name")
     80  ("ReconFile,o",               m_reconFileName,                       string(""), "reconstructed YUV output file name\n"
    8381                                                                                   "YUV writing is skipped if omitted")
    8482#if NH_3D
     
    9290  ("OutputColourSpaceConvert",  outputColourSpaceConvert,              string(""), "Colour space conversion to apply to input 444 video. Permitted values are (empty string=UNCHANGED) " + getListOfColourSpaceConverts(false))
    9391#if NH_MV
    94   ("TargetOptLayerSetIdx,x",    m_targetOptLayerSetIdx,                -1,        "Target output layer set index. (default: -1, determine automatically to be equal to highest layer set index") // Should actually equal to 0 as default. However, this would cause only the base layer to be decoded. 
     92  ("TargetOptLayerSetIdx,x", m_targetOptLayerSetInd, std::vector<Int>(1,-1), "Target output layer set index. (default: -1, determine automatically to be equal to highest layer set index") // Should actually equal to 0 as default. However, this would cause only the base layer to be decoded. 
    9593#endif
    9694  ("MaxTemporalLayer,t",        m_iMaxTemporalLayer,                   -1,         "Maximum Temporal Layer to be decoded. -1 to decode all layers")
     
    106104  ("PrintNalus,n",              m_printReceivedNalus,                 false,        "Print information on received NAL units")
    107105#endif
     106  ("SEIColourRemappingInfoFilename",  m_colourRemapSEIFileName,        string(""), "Colour Remapping YUV output file name. If empty, no remapping is applied (ignore SEI message)\n")
     107
    108108#if O0043_BEST_EFFORT_DECODING
    109109  ("ForceDecodeBitDepth",       m_forceDecodeBitDepth,                 0U,         "Force the decoder to operate at a particular bit-depth (best effort decoding)")
    110110#endif
    111 #if NH_MV_SEI
     111#if NH_MV
    112112  ("OutputDecodedSEIMessagesFilename,m",  m_outputDecodedSEIMessagesFilename,    string(""), "When non empty, output decoded SEI messages to the indicated file. If file is '-', then output to stdout\n")
    113113#else
     
    119119  po::setDefaults(opts);
    120120  po::ErrorReporter err;
    121   const list<const Char*>& argv_unhandled = po::scanArgv(opts, argc, (const Char**) argv, err);
    122 
    123   for (list<const Char*>::const_iterator it = argv_unhandled.begin(); it != argv_unhandled.end(); it++)
     121  const list<const TChar*>& argv_unhandled = po::scanArgv(opts, argc, (const TChar**) argv, err);
     122
     123  for (list<const TChar*>::const_iterator it = argv_unhandled.begin(); it != argv_unhandled.end(); it++)
    124124  {
    125125    fprintf(stderr, "Unhandled argument ignored: `%s'\n", *it);
     
    148148  }
    149149
    150   /* convert std::string to c string for compatability */
    151   m_pchBitstreamFile = cfg_BitstreamFile.empty() ? NULL : strdup(cfg_BitstreamFile.c_str());
    152   m_pchReconFile = cfg_ReconFile.empty() ? NULL : strdup(cfg_ReconFile.c_str());
    153 
    154150#if NH_3D
    155151  m_pchScaleOffsetFile = cfg_ScaleOffsetFile.empty() ? NULL : strdup(cfg_ScaleOffsetFile.c_str());
    156152#endif
    157153
    158   if (!m_pchBitstreamFile)
     154  if (m_bitstreamFileName.empty())
    159155  {
    160156    fprintf(stderr, "No input file specified, aborting\n");
     
    217213
    218214#if NH_MV
    219 Void TAppDecCfg::xAppendToFileNameEnd( Char* pchInputFileName, const Char* pchStringToAppend, Char*& rpchOutputFileName)
     215Void TAppDecCfg::xAppendToFileNameEnd( const TChar* pchInputFileName, const TChar* pchStringToAppend, TChar*& rpchOutputFileName)
    220216{
    221217  size_t iInLength     = strlen(pchInputFileName);
    222218  size_t iAppendLength = strlen(pchStringToAppend);
    223219
    224   rpchOutputFileName = (Char*) malloc(iInLength+iAppendLength+1);                       
    225   Char* pCDot = strrchr(pchInputFileName,'.');         
     220  rpchOutputFileName = (TChar*) malloc(iInLength+iAppendLength+1);                       
     221  const TChar* pCDot = strrchr(pchInputFileName,'.');         
    226222  pCDot = pCDot ? pCDot : pchInputFileName + iInLength;       
    227223  size_t iCharsToDot = pCDot - pchInputFileName ;
  • trunk/source/App/TAppDecoder/TAppDecCfg.h

    r1356 r1386  
    6060{
    6161protected:
    62   Char*         m_pchBitstreamFile;                     ///< input bitstream file name
    63   Char*         m_pchReconFile;                         ///< output reconstruction file name
     62  std::string   m_bitstreamFileName;                    ///< input bitstream file name
     63  std::string   m_reconFileName;                        ///< output reconstruction file name
    6464  Int           m_iSkipFrame;                           ///< counter for frames prior to the random access point to skip
    6565  Int           m_outputBitDepth[MAX_NUM_CHANNEL_TYPE]; ///< bit depth used for writing output
     
    6969  Int           m_decodedPictureHashSEIEnabled;       ///< Checksum(3)/CRC(2)/MD5(1)/disable(0) acting on decoded picture hash SEI message
    7070  Bool          m_decodedNoDisplaySEIEnabled;         ///< Enable(true)/disable(false) writing only pictures that get displayed based on the no display SEI message
     71  std::string   m_colourRemapSEIFileName;             ///< output Colour Remapping file name
    7172  std::vector<Int> m_targetDecLayerIdSet;             ///< set of LayerIds to be included in the sub-bitstream extraction process.
    7273
     
    7879  Bool          m_bClipOutputVideoToRec709Range;      ///< If true, clip the output video to the Rec 709 range on saving.
    7980#if NH_MV
    80   std::vector<Char*> m_pchReconFiles;                   ///< array of output reconstruction file name create from output reconstruction file name
     81  std::vector<TChar*> m_pchReconFiles;                ///< array of output reconstruction file name create from output reconstruction file name
    8182
    82   Int           m_targetOptLayerSetIdx;                 ///< target output layer set index
     83  std::vector<Int> m_targetOptLayerSetInd;            ///< target output layer set indices (multiple decoding when more than one element, e.g. for additional layer sets)
     84  Int           m_targetOptLayerSetIdx;               ///< current target output layer set index
     85
    8386  Int           m_targetDecLayerSetIdx;
    8487  Int           m_baseLayerOutputFlag;
    8588  Int           m_baseLayerPicOutputFlag;
    8689  Int           m_auOutputFlag;
    87   Int           m_maxLayerId;                           ///< maximum nuh_layer_id decoded
     90  Int           m_maxLayerId;                         ///< maximum nuh_layer_id decoded
    8891  std::ifstream m_bitstreamFile;
    8992  Int           m_highestTid;
    9093  Bool          m_targetDecLayerIdSetFileEmpty;       ///< indication if target layers are given by file
    9194
    92   Bool          m_printVpsInfo;                      ///< Output VPS information
     95  Bool          m_printVpsInfo;                       ///< Output VPS information
    9396  Bool          m_printPicOutput;                     ///< Print information on picture output
    9497  Bool          m_printReceivedNalus;                 ///< Print information on received NAL units
    9598#if NH_3D
    96   Char*         m_pchScaleOffsetFile;                   ///< output coded scale and offset parameters
     99  TChar*        m_pchScaleOffsetFile;                   ///< output coded scale and offset parameters
    97100  Bool          m_depth420OutputFlag;                   ///< output depth layers in 4:2:0
    98101#endif
    99102
    100   Void xAppendToFileNameEnd( Char* pchInputFileName, const Char* pchStringToAppend, Char*& rpchOutputFileName); ///< create filenames
     103  Void xAppendToFileNameEnd( const TChar* pchInputFileName, const TChar* pchStringToAppend, TChar*& rpchOutputFileName); ///< create filenames
    101104#endif
    102105
    103106public:
    104107  TAppDecCfg()
    105   : m_pchBitstreamFile(NULL)
    106   , m_pchReconFile(NULL)
     108  : m_bitstreamFileName()
     109  , m_reconFileName()
    107110  , m_iSkipFrame(0)
     111  // m_outputBitDepth array initialised below
    108112  , m_outputColourSpaceConvert(IPCOLOURSPACE_UNCHANGED)
    109113  , m_iMaxTemporalLayer(-1)
    110114  , m_decodedPictureHashSEIEnabled(0)
    111115  , m_decodedNoDisplaySEIEnabled(false)
     116  , m_colourRemapSEIFileName()
     117  , m_targetDecLayerIdSet()
    112118  , m_respectDefDispWindow(0)
    113119#if O0043_BEST_EFFORT_DECODING
    114120  , m_forceDecodeBitDepth(0)
    115121#endif
     122  , m_outputDecodedSEIMessagesFilename()
     123  , m_bClipOutputVideoToRec709Range(false)
    116124#if NH_MV
    117125  , m_highestTid(-1)
     
    131139  virtual ~TAppDecCfg() {}
    132140
    133   Bool  parseCfg        ( Int argc, Char* argv[] );   ///< initialize option class from configuration
     141  Bool  parseCfg        ( Int argc, TChar* argv[] );   ///< initialize option class from configuration
     142#if NH_MV
     143  Int   getNumDecodings ( ) { return (Int) m_targetOptLayerSetInd.size();  };
     144#endif
    134145};
    135146
  • trunk/source/App/TAppDecoder/TAppDecTop.cpp

    r1321 r1386  
    6262: m_numDecoders( 0 )
    6363#endif
     64 ,m_pcSeiColourRemappingInfoPrevious(NULL)
    6465{
    6566#if NH_MV
     
    118119  xDestroyDecLib();
    119120#endif
    120 
    121   if (m_pchBitstreamFile)
    122   {
    123     free (m_pchBitstreamFile);
    124     m_pchBitstreamFile = NULL;
    125   }
     121  m_bitstreamFileName.clear();
    126122#if NH_MV
    127123  for (Int decIdx = 0; decIdx < m_numDecoders; decIdx++)
     
    134130  }
    135131#endif
    136   if (m_pchReconFile)
    137   {
    138     free (m_pchReconFile);
    139     m_pchReconFile = NULL;
    140   }
     132  m_reconFileName.clear();
    141133#if NH_3D
    142134  if (m_pchScaleOffsetFile)
     
    160152 .
    161153 */
    162 
    163154#if NH_MV
    164 Void TAppDecTop::decode()
    165 {
     155Void TAppDecTop::decode( Int num )
     156{
     157  m_targetOptLayerSetIdx = m_targetOptLayerSetInd[ num ];
    166158  // create & initialize internal classes
    167159  xInitFileIO  ();
     
    221213
    222214#if !NH_MV
    223 Void TAppDecTop::decode()
     215Void TAppDecTop::decode( )
    224216{
    225217  Int                 poc;
    226218  TComList<TComPic*>* pcListPic = NULL;
    227219
    228   ifstream bitstreamFile(m_pchBitstreamFile, ifstream::in | ifstream::binary);
     220  ifstream bitstreamFile(m_bitstreamFileName.c_str(), ifstream::in | ifstream::binary);
    229221  if (!bitstreamFile)
    230222  {
    231     fprintf(stderr, "\nfailed to open bitstream file `%s' for reading\n", m_pchBitstreamFile);
     223    fprintf(stderr, "\nfailed to open bitstream file `%s' for reading\n", m_bitstreamFileName.c_str());
    232224    exit(EXIT_FAILURE);
    233225  }
     
    250242
    251243  m_iPOCLastDisplay += m_iSkipFrame;      // set the last displayed POC correctly for skip forward.
     244
     245  // clear contents of colour-remap-information-SEI output file
     246  if (!m_colourRemapSEIFileName.empty())
     247  {
     248    std::ofstream ofile(m_colourRemapSEIFileName.c_str());
     249    if (!ofile.good() || !ofile.is_open())
     250    {
     251      fprintf(stderr, "\nUnable to open file '%s' for writing colour-remap-information-SEI video\n", m_colourRemapSEIFileName.c_str());
     252      exit(EXIT_FAILURE);
     253    }
     254  }
    252255
    253256  // main decoder loop
     
    336339    if( pcListPic )
    337340    {
    338       if ( m_pchReconFile && !openedReconFile )
     341      if ( (!m_reconFileName.empty()) && (!openedReconFile) )
    339342      {
    340343        const BitDepths &bitDepths=pcListPic->front()->getPicSym()->getSPS().getBitDepths(); // use bit depths of first reconstructed picture.
     
    346349          }
    347350        }
    348         m_cTVideoIOYuvReconFile.open( m_pchReconFile, true, m_outputBitDepth, m_outputBitDepth, bitDepths.recon ); // write mode
     351
     352        m_cTVideoIOYuvReconFile.open( m_reconFileName, true, m_outputBitDepth, m_outputBitDepth, bitDepths.recon ); // write mode
    349353        openedReconFile = true;
    350354      }
     
    436440  }
    437441#else
    438   if ( m_pchReconFile )
     442  if ( !m_reconFileName.empty() )
    439443  {
    440444    m_cTVideoIOYuvReconFile. close();
     
    444448  m_cTDecTop.destroy();
    445449#endif
     450  if (m_pcSeiColourRemappingInfoPrevious != NULL)
     451  {
     452    delete m_pcSeiColourRemappingInfoPrevious;
     453    m_pcSeiColourRemappingInfoPrevious = NULL;
     454  }
    446455#if NH_3D
    447456  m_cCamParsCollector.uninit();
     
    474483  }
    475484#endif
     485  if (m_pcSeiColourRemappingInfoPrevious != NULL)
     486  {
     487    delete m_pcSeiColourRemappingInfoPrevious;
     488    m_pcSeiColourRemappingInfoPrevious = NULL;
     489  }
    476490}
    477491
     
    549563        // write to file
    550564        numPicsNotYetDisplayed = numPicsNotYetDisplayed-2;
    551         if ( m_pchReconFile )
     565        if ( !m_reconFileName.empty() )
    552566        {
    553567          const Window &conf = pcPicTop->getConformanceWindow();
     
    617631          dpbFullness--;
    618632        }
    619         if ( m_pchReconFile )
     633        if ( !m_reconFileName.empty() )
    620634        {
    621635          const Window &conf    = pcPic->getConformanceWindow();
     
    631645        }
    632646
     647        if (!m_colourRemapSEIFileName.empty())
     648        {
     649          xOutputColourRemapPic(pcPic);
     650        }
     651
    633652        // update POC of display order
    634653        m_iPOCLastDisplay = pcPic->getPOC();
     
    678697        // write to file
    679698
    680         if ( m_pchReconFile )
     699        if ( !m_reconFileName.empty() )
    681700        {
    682701          const Window &conf = pcPicTop->getConformanceWindow();
     
    736755      {
    737756        // write to file
    738         if ( m_pchReconFile )
     757        if ( !m_reconFileName.empty() )
    739758        {
    740759          const Window &conf    = pcPic->getConformanceWindow();
     
    749768        }
    750769
     770        if (!m_colourRemapSEIFileName.empty())
     771        {
     772          xOutputColourRemapPic(pcPic);
     773        }
     774
    751775        // update POC of display order
    752776        m_iPOCLastDisplay = pcPic->getPOC();
     
    10681092    m_newVpsActivatedbyCurAu  = true; //TBD
    10691093    m_newVpsActivatedbyCurPic = true;
    1070 #if NH_3D
     1094#if NH_3D_VSO
    10711095    m_dpb.setVPS( m_vps );
    10721096#endif
     
    12321256  }
    12331257
    1234   if ( m_printVpsInfo  && ( m_decProcCvsg == ANNEX_F ) )
     1258  if ( m_printVpsInfo  && ( m_decProcCvsg == ANNEX_F ) && ( m_targetOptLayerSetIdx == m_targetOptLayerSetInd[ 0 ] ) )
    12351259  {
    12361260    m_vps->printScalabilityId();
     
    19792003      // - After all slices of the current picture have been decoded, the decoding process for ending the decoding of a
    19802004      //   coded picture with nuh_layer_id greater than 0 specified in clause F.8.1.6 is invoked.
    1981       xF816decProcEndDecOfCodPicLIdGrtZero( );
     2005      xF816decProcEndDecOfCodPicLIdGrtZero( );     
    19822006    }
    19832007
     
    26712695
    26722696    // create recon file related stuff
    2673     Char* pchTempFilename = NULL;
    2674     if ( m_pchReconFile )
    2675     {
    2676       Char buffer[4];
     2697    TChar* pchTempFilename = NULL;
     2698    if ( !m_reconFileName.empty() )
     2699    {
     2700      TChar buffer[4];
    26772701      sprintf(buffer,"_%i", layerId );
    2678       assert ( m_pchReconFile );
    2679       xAppendToFileNameEnd( m_pchReconFile , buffer, pchTempFilename );
     2702      assert ( !m_reconFileName.empty() );
     2703      xAppendToFileNameEnd( m_reconFileName.c_str() , buffer, pchTempFilename );
    26802704      assert( m_pchReconFiles.size() == m_numDecoders );
    26812705    }
     
    28702894Void TAppDecTop::xInitFileIO()
    28712895{
    2872   m_bitstreamFile.open(m_pchBitstreamFile, ifstream::in | ifstream::binary);
     2896  m_bitstreamFile.open(m_bitstreamFileName.c_str(), ifstream::in | ifstream::binary);
    28732897
    28742898  if ( !m_bitstreamFile)
    28752899  {
    2876     fprintf(stderr, "\nUnable to open bitstream file `%s' for reading\n", m_pchBitstreamFile);
     2900    fprintf(stderr, "\nUnable to open bitstream file `%s' for reading\n", m_bitstreamFileName.c_str());
    28772901    exit(EXIT_FAILURE);
    28782902  }
     
    29052929  Int decIdx = xGetDecoderIdx( curPic->getLayerId() );
    29062930
    2907   if ( m_pchReconFile && !m_reconOpen[decIdx] )
     2931  if ( !m_reconFileName.empty() && !m_reconOpen[decIdx] )
    29082932  {
    29092933    const BitDepths &bitDepths= curPic->getPicSym()->getSPS().getBitDepths(); // use bit depths of first reconstructed picture.
     
    30073031
    30083032#endif
     3033
     3034Void TAppDecTop::xOutputColourRemapPic(TComPic* pcPic)
     3035{
     3036  const TComSPS &sps=pcPic->getPicSym()->getSPS();
     3037  SEIMessages colourRemappingInfo = getSeisByType(pcPic->getSEIs(), SEI::COLOUR_REMAPPING_INFO );
     3038  SEIColourRemappingInfo *seiColourRemappingInfo = ( colourRemappingInfo.size() > 0 ) ? (SEIColourRemappingInfo*) *(colourRemappingInfo.begin()) : NULL;
     3039
     3040  if (colourRemappingInfo.size() > 1)
     3041  {
     3042    printf ("Warning: Got multiple Colour Remapping Information SEI messages. Using first.");
     3043  }
     3044  if (seiColourRemappingInfo)
     3045  {
     3046    applyColourRemapping(*pcPic->getPicYuvRec(), *seiColourRemappingInfo, sps);
     3047
     3048    // save the last CRI SEI received
     3049    if (m_pcSeiColourRemappingInfoPrevious == NULL)
     3050    {
     3051      m_pcSeiColourRemappingInfoPrevious = new SEIColourRemappingInfo();
     3052    }
     3053    m_pcSeiColourRemappingInfoPrevious->copyFrom(*seiColourRemappingInfo);
     3054  }
     3055  else  // using the last CRI SEI received
     3056  {
     3057    // TODO: prevent persistence of CRI SEI across C(L)VS.
     3058    if (m_pcSeiColourRemappingInfoPrevious != NULL)
     3059    {
     3060      if (m_pcSeiColourRemappingInfoPrevious->m_colourRemapPersistenceFlag == false)
     3061      {
     3062        printf("Warning No SEI-CRI message is present for the current picture, persistence of the CRI is not managed\n");
     3063      }
     3064      applyColourRemapping(*pcPic->getPicYuvRec(), *m_pcSeiColourRemappingInfoPrevious, sps);
     3065    }
     3066  }
     3067}
     3068
     3069// compute lut from SEI
     3070// use at lutPoints points aligned on a power of 2 value
     3071// SEI Lut must be in ascending values of coded Values
     3072static std::vector<Int>
     3073initColourRemappingInfoLut(const Int                                          bitDepth_in,     // bit-depth of the input values of the LUT
     3074                           const Int                                          nbDecimalValues, // Position of the fixed point
     3075                           const std::vector<SEIColourRemappingInfo::CRIlut> &lut,
     3076                           const Int                                          maxValue, // maximum output value
     3077                           const Int                                          lutOffset)
     3078{
     3079  const Int lutPoints = (1 << bitDepth_in) + 1 ;
     3080  std::vector<Int> retLut(lutPoints);
     3081
     3082  // missing values: need to define default values before first definition (check codedValue[0] == 0)
     3083  Int iTargetPrev = (lut.size() && lut[0].codedValue == 0) ? lut[0].targetValue: 0;
     3084  Int startPivot = (lut.size())? ((lut[0].codedValue == 0)? 1: 0): 1;
     3085  Int iCodedPrev  = 0;
     3086  // set max value with the coded bit-depth
     3087  // + ((1 << nbDecimalValues) - 1) is for the added bits
     3088  const Int maxValueFixedPoint = (maxValue << nbDecimalValues) + ((1 << nbDecimalValues) - 1);
     3089
     3090  Int iValue = 0;
     3091
     3092  for ( Int iPivot=startPivot ; iPivot < (Int)lut.size(); iPivot++ )
     3093  {
     3094    Int iCodedNext  = lut[iPivot].codedValue;
     3095    Int iTargetNext = lut[iPivot].targetValue;
     3096
     3097    // ensure correct bit depth and avoid overflow in lut address
     3098    Int iCodedNext_bitDepth = std::min(iCodedNext, (1 << bitDepth_in));
     3099
     3100    const Int divValue =  (iCodedNext - iCodedPrev > 0)? (iCodedNext - iCodedPrev): 1;
     3101    const Int lutValInit = (lutOffset + iTargetPrev) << nbDecimalValues;
     3102    const Int roundValue = divValue / 2;
     3103    for ( ; iValue<iCodedNext_bitDepth; iValue++ )
     3104    {
     3105      Int value = iValue;
     3106      Int interpol = ((((value-iCodedPrev) * (iTargetNext - iTargetPrev)) << nbDecimalValues) + roundValue) / divValue;               
     3107      retLut[iValue]  = std::min(lutValInit + interpol , maxValueFixedPoint);
     3108    }
     3109    iCodedPrev  = iCodedNext;
     3110    iTargetPrev = iTargetNext;
     3111  }
     3112  // fill missing values if necessary
     3113  if(iCodedPrev < (1 << bitDepth_in)+1)
     3114  {
     3115    Int iCodedNext  = (1 << bitDepth_in);
     3116    Int iTargetNext = (1 << bitDepth_in) - 1;
     3117
     3118    const Int divValue =  (iCodedNext - iCodedPrev > 0)? (iCodedNext - iCodedPrev): 1;
     3119    const Int lutValInit = (lutOffset + iTargetPrev) << nbDecimalValues;
     3120    const Int roundValue = divValue / 2;
     3121
     3122    for ( ; iValue<=iCodedNext; iValue++ )
     3123    {
     3124      Int value = iValue;
     3125      Int interpol = ((((value-iCodedPrev) * (iTargetNext - iTargetPrev)) << nbDecimalValues) + roundValue) / divValue;
     3126      retLut[iValue]  = std::min(lutValInit + interpol , maxValueFixedPoint);
     3127    }
     3128  }
     3129  return retLut;
     3130}
     3131
     3132static Void
     3133initColourRemappingInfoLuts(std::vector<Int>      (&preLut)[3],
     3134                            std::vector<Int>      (&postLut)[3],
     3135                            SEIColourRemappingInfo &pCriSEI,
     3136                            const Int               maxBitDepth)
     3137{
     3138  Int internalBitDepth = pCriSEI.m_colourRemapBitDepth;
     3139  for ( Int c=0 ; c<3 ; c++ )
     3140  {
     3141    std::sort(pCriSEI.m_preLut[c].begin(), pCriSEI.m_preLut[c].end()); // ensure preLut is ordered in ascending values of codedValues   
     3142    preLut[c] = initColourRemappingInfoLut(pCriSEI.m_colourRemapInputBitDepth, maxBitDepth - pCriSEI.m_colourRemapInputBitDepth, pCriSEI.m_preLut[c], ((1 << internalBitDepth) - 1), 0); //Fill preLut
     3143
     3144    std::sort(pCriSEI.m_postLut[c].begin(), pCriSEI.m_postLut[c].end()); // ensure postLut is ordered in ascending values of codedValues       
     3145    postLut[c] = initColourRemappingInfoLut(pCriSEI.m_colourRemapBitDepth, maxBitDepth - pCriSEI.m_colourRemapBitDepth, pCriSEI.m_postLut[c], (1 << internalBitDepth) - 1, 0); //Fill postLut
     3146  }
     3147}
     3148
     3149// apply lut.
     3150// Input lut values are aligned on power of 2 boundaries
     3151static Int
     3152applyColourRemappingInfoLut1D(Int inVal, const std::vector<Int> &lut, const Int inValPrecisionBits)
     3153{
     3154  const Int roundValue = (inValPrecisionBits)? 1 << (inValPrecisionBits - 1): 0;
     3155  inVal = std::min(std::max(0, inVal), (Int)(((lut.size()-1) << inValPrecisionBits)));
     3156  Int index  = (Int) std::min((inVal >> inValPrecisionBits), (Int)(lut.size()-2));
     3157  Int outVal = (( inVal - (index<<inValPrecisionBits) ) * (lut[index+1] - lut[index]) + roundValue) >> inValPrecisionBits;
     3158  outVal +=  lut[index] ;
     3159
     3160  return outVal;
     3161
     3162
     3163static Int
     3164applyColourRemappingInfoMatrix(const Int (&colourRemapCoeffs)[3], const Int postOffsetShift, const Int p0, const Int p1, const Int p2, const Int offset)
     3165{
     3166  Int YUVMat = (colourRemapCoeffs[0]* p0 + colourRemapCoeffs[1]* p1 + colourRemapCoeffs[2]* p2  + offset) >> postOffsetShift;
     3167  return YUVMat;
     3168}
     3169
     3170static Void
     3171setColourRemappingInfoMatrixOffset(Int (&matrixOffset)[3], Int offset0, Int offset1, Int offset2)
     3172{
     3173  matrixOffset[0] = offset0;
     3174  matrixOffset[1] = offset1;
     3175  matrixOffset[2] = offset2;
     3176}
     3177
     3178static Void
     3179setColourRemappingInfoMatrixOffsets(      Int  (&matrixInputOffset)[3],
     3180                                          Int  (&matrixOutputOffset)[3],
     3181                                    const Int  bitDepth,
     3182                                    const Bool crInputFullRangeFlag,
     3183                                    const Int  crInputMatrixCoefficients,
     3184                                    const Bool crFullRangeFlag,
     3185                                    const Int  crMatrixCoefficients)
     3186{
     3187  // set static matrix offsets
     3188  Int crInputOffsetLuma = (crInputFullRangeFlag)? 0:-(16 << (bitDepth-8));
     3189  Int crOffsetLuma = (crFullRangeFlag)? 0:(16 << (bitDepth-8));
     3190  Int crInputOffsetChroma = 0;
     3191  Int crOffsetChroma = 0;
     3192
     3193  switch(crInputMatrixCoefficients)
     3194  {
     3195    case MATRIX_COEFFICIENTS_RGB:
     3196      crInputOffsetChroma = 0;
     3197      if(!crInputFullRangeFlag)
     3198      {
     3199        fprintf(stderr, "WARNING: crInputMatrixCoefficients set to MATRIX_COEFFICIENTS_RGB and crInputFullRangeFlag not set\n");
     3200        crInputOffsetLuma = 0;
     3201      }
     3202      break;
     3203    case MATRIX_COEFFICIENTS_UNSPECIFIED:
     3204    case MATRIX_COEFFICIENTS_BT709:
     3205    case MATRIX_COEFFICIENTS_BT2020_NON_CONSTANT_LUMINANCE:
     3206      crInputOffsetChroma = -(1 << (bitDepth-1));
     3207      break;
     3208    default:
     3209      fprintf(stderr, "WARNING: crInputMatrixCoefficients set to undefined value: %d\n", crInputMatrixCoefficients);
     3210  }
     3211
     3212  switch(crMatrixCoefficients)
     3213  {
     3214    case MATRIX_COEFFICIENTS_RGB:
     3215      crOffsetChroma = 0;
     3216      if(!crFullRangeFlag)
     3217      {
     3218        fprintf(stderr, "WARNING: crMatrixCoefficients set to MATRIX_COEFFICIENTS_RGB and crInputFullRangeFlag not set\n");
     3219        crOffsetLuma = 0;
     3220      }
     3221      break;
     3222    case MATRIX_COEFFICIENTS_UNSPECIFIED:
     3223    case MATRIX_COEFFICIENTS_BT709:
     3224    case MATRIX_COEFFICIENTS_BT2020_NON_CONSTANT_LUMINANCE:
     3225      crOffsetChroma = (1 << (bitDepth-1));
     3226      break;
     3227    default:
     3228      fprintf(stderr, "WARNING: crMatrixCoefficients set to undefined value: %d\n", crMatrixCoefficients);
     3229  }
     3230
     3231  setColourRemappingInfoMatrixOffset(matrixInputOffset, crInputOffsetLuma, crInputOffsetChroma, crInputOffsetChroma);
     3232  setColourRemappingInfoMatrixOffset(matrixOutputOffset, crOffsetLuma, crOffsetChroma, crOffsetChroma);
     3233}
     3234
     3235Void TAppDecTop::applyColourRemapping(const TComPicYuv& pic, SEIColourRemappingInfo& criSEI, const TComSPS &activeSPS)
     3236
     3237  const Int maxBitDepth = 16;
     3238
     3239  // create colour remapped picture
     3240  if( !criSEI.m_colourRemapCancelFlag && pic.getChromaFormat()!=CHROMA_400) // 4:0:0 not supported.
     3241  {
     3242    const Int          iHeight         = pic.getHeight(COMPONENT_Y);
     3243    const Int          iWidth          = pic.getWidth(COMPONENT_Y);
     3244    const ChromaFormat chromaFormatIDC = pic.getChromaFormat();
     3245
     3246    TComPicYuv picYuvColourRemapped;
     3247    picYuvColourRemapped.createWithoutCUInfo( iWidth, iHeight, chromaFormatIDC );
     3248
     3249    const Int  iStrideIn   = pic.getStride(COMPONENT_Y);
     3250    const Int  iCStrideIn  = pic.getStride(COMPONENT_Cb);
     3251    const Int  iStrideOut  = picYuvColourRemapped.getStride(COMPONENT_Y);
     3252    const Int  iCStrideOut = picYuvColourRemapped.getStride(COMPONENT_Cb);
     3253    const Bool b444        = ( pic.getChromaFormat() == CHROMA_444 );
     3254    const Bool b422        = ( pic.getChromaFormat() == CHROMA_422 );
     3255    const Bool b420        = ( pic.getChromaFormat() == CHROMA_420 );
     3256
     3257    std::vector<Int> preLut[3];
     3258    std::vector<Int> postLut[3];
     3259    Int matrixInputOffset[3];
     3260    Int matrixOutputOffset[3];
     3261    const Pel *YUVIn[MAX_NUM_COMPONENT];
     3262    Pel *YUVOut[MAX_NUM_COMPONENT];
     3263    YUVIn[COMPONENT_Y]  = pic.getAddr(COMPONENT_Y);
     3264    YUVIn[COMPONENT_Cb] = pic.getAddr(COMPONENT_Cb);
     3265    YUVIn[COMPONENT_Cr] = pic.getAddr(COMPONENT_Cr);
     3266    YUVOut[COMPONENT_Y]  = picYuvColourRemapped.getAddr(COMPONENT_Y);
     3267    YUVOut[COMPONENT_Cb] = picYuvColourRemapped.getAddr(COMPONENT_Cb);
     3268    YUVOut[COMPONENT_Cr] = picYuvColourRemapped.getAddr(COMPONENT_Cr);
     3269
     3270    const Int bitDepth = criSEI.m_colourRemapBitDepth;
     3271    BitDepths        bitDepthsCriFile;
     3272    bitDepthsCriFile.recon[CHANNEL_TYPE_LUMA]   = bitDepth;
     3273    bitDepthsCriFile.recon[CHANNEL_TYPE_CHROMA] = bitDepth; // Different bitdepth is not implemented
     3274
     3275    const Int postOffsetShift = criSEI.m_log2MatrixDenom;
     3276    const Int matrixRound = 1 << (postOffsetShift - 1);
     3277    const Int postLutInputPrecision = (maxBitDepth - criSEI.m_colourRemapBitDepth);
     3278
     3279    if ( ! criSEI.m_colourRemapVideoSignalInfoPresentFlag ) // setting default
     3280    {
     3281      setColourRemappingInfoMatrixOffsets(matrixInputOffset, matrixOutputOffset, maxBitDepth,
     3282          activeSPS.getVuiParameters()->getVideoFullRangeFlag(), activeSPS.getVuiParameters()->getMatrixCoefficients(),
     3283          activeSPS.getVuiParameters()->getVideoFullRangeFlag(), activeSPS.getVuiParameters()->getMatrixCoefficients());
     3284    }
     3285    else
     3286    {
     3287      setColourRemappingInfoMatrixOffsets(matrixInputOffset, matrixOutputOffset, maxBitDepth,
     3288          activeSPS.getVuiParameters()->getVideoFullRangeFlag(), activeSPS.getVuiParameters()->getMatrixCoefficients(),
     3289          criSEI.m_colourRemapFullRangeFlag, criSEI.m_colourRemapMatrixCoefficients);
     3290    }
     3291
     3292    // add matrix rounding to output matrix offsets
     3293    matrixOutputOffset[0] = (matrixOutputOffset[0] << postOffsetShift) + matrixRound;
     3294    matrixOutputOffset[1] = (matrixOutputOffset[1] << postOffsetShift) + matrixRound;
     3295    matrixOutputOffset[2] = (matrixOutputOffset[2] << postOffsetShift) + matrixRound;
     3296
     3297    // Merge   matrixInputOffset and matrixOutputOffset to matrixOutputOffset
     3298    matrixOutputOffset[0] += applyColourRemappingInfoMatrix(criSEI.m_colourRemapCoeffs[0], 0, matrixInputOffset[0], matrixInputOffset[1], matrixInputOffset[2], 0);
     3299    matrixOutputOffset[1] += applyColourRemappingInfoMatrix(criSEI.m_colourRemapCoeffs[1], 0, matrixInputOffset[0], matrixInputOffset[1], matrixInputOffset[2], 0);
     3300    matrixOutputOffset[2] += applyColourRemappingInfoMatrix(criSEI.m_colourRemapCoeffs[2], 0, matrixInputOffset[0], matrixInputOffset[1], matrixInputOffset[2], 0);
     3301
     3302    // rescaling output: include CRI/output frame difference
     3303    const Int scaleShiftOut_neg = abs(bitDepth - maxBitDepth);
     3304    const Int scaleOut_round = 1 << (scaleShiftOut_neg-1);
     3305
     3306    initColourRemappingInfoLuts(preLut, postLut, criSEI, maxBitDepth);
     3307
     3308    assert(pic.getChromaFormat() != CHROMA_400);
     3309    const Int hs = pic.getComponentScaleX(ComponentID(COMPONENT_Cb));
     3310    const Int maxOutputValue = (1 << bitDepth) - 1;
     3311
     3312    for( Int y = 0; y < iHeight; y++ )
     3313    {
     3314      for( Int x = 0; x < iWidth; x++ )
     3315      {
     3316        const Int xc = (x>>hs);
     3317        Bool computeChroma = b444 || ((b422 || !(y&1)) && !(x&1));
     3318
     3319        Int YUVPre_0 = applyColourRemappingInfoLut1D(YUVIn[COMPONENT_Y][x], preLut[0], 0);
     3320        Int YUVPre_1 = applyColourRemappingInfoLut1D(YUVIn[COMPONENT_Cb][xc], preLut[1], 0);
     3321        Int YUVPre_2 = applyColourRemappingInfoLut1D(YUVIn[COMPONENT_Cr][xc], preLut[2], 0);
     3322
     3323        Int YUVMat_0 = applyColourRemappingInfoMatrix(criSEI.m_colourRemapCoeffs[0], postOffsetShift, YUVPre_0, YUVPre_1, YUVPre_2, matrixOutputOffset[0]);
     3324        Int YUVLutB_0 = applyColourRemappingInfoLut1D(YUVMat_0, postLut[0], postLutInputPrecision);
     3325        YUVOut[COMPONENT_Y][x] = std::min(maxOutputValue, (YUVLutB_0 + scaleOut_round) >> scaleShiftOut_neg);
     3326
     3327        if( computeChroma )
     3328        {
     3329          Int YUVMat_1 = applyColourRemappingInfoMatrix(criSEI.m_colourRemapCoeffs[1], postOffsetShift, YUVPre_0, YUVPre_1, YUVPre_2, matrixOutputOffset[1]);
     3330          Int YUVLutB_1 = applyColourRemappingInfoLut1D(YUVMat_1, postLut[1], postLutInputPrecision);
     3331          YUVOut[COMPONENT_Cb][xc] = std::min(maxOutputValue, (YUVLutB_1 + scaleOut_round) >> scaleShiftOut_neg);
     3332
     3333          Int YUVMat_2 = applyColourRemappingInfoMatrix(criSEI.m_colourRemapCoeffs[2], postOffsetShift, YUVPre_0, YUVPre_1, YUVPre_2, matrixOutputOffset[2]);
     3334          Int YUVLutB_2 = applyColourRemappingInfoLut1D(YUVMat_2, postLut[2], postLutInputPrecision);
     3335          YUVOut[COMPONENT_Cr][xc] = std::min(maxOutputValue, (YUVLutB_2 + scaleOut_round) >> scaleShiftOut_neg);
     3336        }
     3337      }
     3338
     3339      YUVIn[COMPONENT_Y]  += iStrideIn;
     3340      YUVOut[COMPONENT_Y] += iStrideOut;
     3341      if( !(b420 && !(y&1)) )
     3342      {
     3343         YUVIn[COMPONENT_Cb]  += iCStrideIn;
     3344         YUVIn[COMPONENT_Cr]  += iCStrideIn;
     3345         YUVOut[COMPONENT_Cb] += iCStrideOut;
     3346         YUVOut[COMPONENT_Cr] += iCStrideOut;
     3347      }
     3348    }
     3349    //Write remapped picture in display order
     3350    picYuvColourRemapped.dump( m_colourRemapSEIFileName, bitDepthsCriFile, true );
     3351    picYuvColourRemapped.destroy();
     3352  }
     3353}
    30093354//! \}
  • trunk/source/App/TAppDecoder/TAppDecTop.h

    r1321 r1386  
    128128#endif
    129129  std::ofstream                   m_seiMessageFileStream;         ///< Used for outputing SEI messages. 
     130
     131  SEIColourRemappingInfo*         m_pcSeiColourRemappingInfoPrevious;
     132
    130133public:
    131134  TAppDecTop();
     
    134137  Void  create            (); ///< create internal members
    135138  Void  destroy           (); ///< destroy internal members
    136   Void  decode            (); ///< main decoding function
     139 
    137140#if NH_MV
     141  Void  decode            ( Int i ); ///< main decoding function
    138142  UInt  getNumberOfChecksumErrorsDetected( ) const;
    139143  UInt  getNumberOfChecksumErrorsDetected( Int decIdx ) const { return m_tDecTop[decIdx]->getNumberOfChecksumErrorsDetected(); }
    140144#else
     145  Void  decode            ( ); ///< main decoding function
    141146  UInt  getNumberOfChecksumErrorsDetected() const { return m_cTDecTop.getNumberOfChecksumErrorsDetected(); }
    142147#endif
     
    206211  Void  xCropAndOutput                     ( TComPic* curPic ); 
    207212#endif
     213
     214private:
     215  Void applyColourRemapping(const TComPicYuv& pic, SEIColourRemappingInfo& pCriSEI, const TComSPS &activeSPS);
     216  Void xOutputColourRemapPic(TComPic* pcPic);
    208217};
    209218
  • trunk/source/App/TAppDecoder/decmain.cpp

    r1313 r1386  
    5151{
    5252  Int returnCode = EXIT_SUCCESS;
     53#if !NH_MV
    5354  TAppDecTop  cTAppDecTop;
    54 
     55#endif
    5556  // print information
    5657  fprintf( stdout, "\n" );
     
    6566  fprintf( stdout, "\n" );
    6667
    67   // create application decoder class
    68   cTAppDecTop.create();
     68#if NH_MV
     69  Int numDecodings = 1;
     70  Int curDecoding  = 0;
     71  Double dResult = 0;
     72  do {
     73    TAppDecTop  cTAppDecTop;
     74#endif
     75    // create application decoder class
     76    cTAppDecTop.create();
    6977
    70   // parse configuration
    71   if(!cTAppDecTop.parseCfg( argc, argv ))
    72   {
    73     cTAppDecTop.destroy();
    74     returnCode = EXIT_FAILURE;
    75     return returnCode;
    76   }
     78    // parse configuration
     79    if(!cTAppDecTop.parseCfg( argc, argv ))
     80    {
     81      cTAppDecTop.destroy();
     82      returnCode = EXIT_FAILURE;
     83      return returnCode;
     84    }
     85#if NH_MV
     86    numDecodings = cTAppDecTop.getNumDecodings();
     87#endif
    7788
    78   // starting time
     89    // starting time   
     90#if !NH_MV
    7991  Double dResult;
    80   clock_t lBefore = clock();
     92#endif
     93    clock_t lBefore = clock();
    8194
    82   // call decoding function
    83   cTAppDecTop.decode();
     95    // call decoding function
     96#if NH_MV
     97    cTAppDecTop.decode( curDecoding );
     98#else
     99    cTAppDecTop.decode();
     100#endif
    84101
    85   if (cTAppDecTop.getNumberOfChecksumErrorsDetected() != 0)
    86   {
    87     printf("\n\n***ERROR*** A decoding mismatch occured: signalled md5sum does not match\n");
    88     returnCode = EXIT_FAILURE;
    89   }
     102    if (cTAppDecTop.getNumberOfChecksumErrorsDetected() != 0)
     103    {
     104      printf("\n\n***ERROR*** A decoding mismatch occured: signalled md5sum does not match\n");
     105      returnCode = EXIT_FAILURE;
     106    }
    90107
    91   // ending time
     108    // ending time
     109#if NH_MV
     110    dResult += (double)(clock()-lBefore) / CLOCKS_PER_SEC;
     111#else
    92112  dResult = (Double)(clock()-lBefore) / CLOCKS_PER_SEC;
    93113  printf("\n Total Time: %12.3f sec.\n", dResult);
     114#endif
    94115
    95   // destroy application decoder class
    96   cTAppDecTop.destroy();
     116    // destroy application decoder class
     117    cTAppDecTop.destroy();
     118#if NH_MV
     119    curDecoding++;
     120  }
     121  while ( curDecoding < numDecodings );
    97122
     123  printf("\n Total Time: %12.3f sec.\n", dResult);
     124#endif
    98125  return returnCode;
    99126}
  • trunk/source/App/TAppEncoder/TAppEncCfg.cpp

    r1356 r1386  
    109109
    110110TAppEncCfg::TAppEncCfg()
    111 #if NH_MV
    112 : m_pchBitstreamFile()
    113 #else
    114 : m_pchInputFile()
    115 , m_pchBitstreamFile()
    116 , m_pchReconFile()
    117 #endif
    118 , m_inputColourSpaceConvert(IPCOLOURSPACE_UNCHANGED)
     111: m_inputColourSpaceConvert(IPCOLOURSPACE_UNCHANGED)
    119112, m_snrInternalColourSpace(false)
    120113, m_outputInternalColourSpace(false)
    121 , m_pchdQPFile()
    122 , m_scalingListFile()
    123114{
    124115#if !NH_MV
     
    171162    m_targetPivotValue = NULL;
    172163  }
    173 #if !NH_MV
    174   free(m_pchInputFile);
    175 #endif
    176   free(m_pchBitstreamFile);
    177164#if NH_MV
    178165  for(Int i = 0; i< m_pchReconFileList.size(); i++ )
     
    181168      free (m_pchReconFileList[i]);
    182169  }
    183 #else
    184   free(m_pchReconFile);
    185 #endif
    186   free(m_pchdQPFile);
    187   free(m_scalingListFile);
    188 #if NH_MV
     170
    189171  for( Int i = 0; i < m_GOPListMvc.size(); i++ )
    190172  {
     
    195177    }
    196178  }
    197 #endif
    198 #if NH_3D
     179
     180  if ( m_pchBaseViewCameraNumbers != NULL )
     181  {
     182    free ( m_pchBaseViewCameraNumbers );
     183  }
     184#endif
    199185#if NH_3D_VSO
    200186  if (  m_pchVSOConfig != NULL)
     
    202188    free (  m_pchVSOConfig );
    203189  }
    204 #endif
     190 
    205191  if ( m_pchCameraParameterFile != NULL )
    206192  {
    207193    free ( m_pchCameraParameterFile );
    208   }
    209 
    210   if ( m_pchBaseViewCameraNumbers != NULL )
    211   {
    212     free ( m_pchBaseViewCameraNumbers );
    213194  }
    214195#endif
     
    224205
    225206
    226 #if NH_MV_SEI
     207#if NH_MV
    227208Void TAppEncCfg::xParseSeiCfg()
    228209{
     
    302283}
    303284
    304 Bool confirmPara(Bool bflag, const Char* message);
     285Bool confirmPara(Bool bflag, const TChar* message);
    305286
    306287static inline ChromaFormat numberToChromaFormat(const Int val)
     
    318299static const struct MapStrToProfile
    319300{
    320   const Char* str;
     301  const TChar* str;
    321302  Profile::Name value;
    322303}
     
    340321static const struct MapStrToExtendedProfile
    341322{
    342   const Char* str;
     323  const TChar* str;
    343324  ExtendedProfileName value;
    344325}
     
    405386static const struct MapStrToTier
    406387{
    407   const Char* str;
     388  const TChar* str;
    408389  Level::Tier value;
    409390}
     
    416397static const struct MapStrToLevel
    417398{
    418   const Char* str;
     399  const TChar* str;
    419400  Level::Name value;
    420401}
     
    438419};
    439420
     421#if U0132_TARGET_BITS_SATURATION
     422UInt g_uiMaxCpbSize[2][21] =
     423{
     424  //         LEVEL1,        LEVEL2,LEVEL2_1,     LEVEL3, LEVEL3_1,      LEVEL4, LEVEL4_1,       LEVEL5,  LEVEL5_1,  LEVEL5_2,    LEVEL6,  LEVEL6_1,  LEVEL6_2
     425  { 0, 0, 0, 350000, 0, 0, 1500000, 3000000, 0, 6000000, 10000000, 0, 12000000, 20000000, 0,  25000000,  40000000,  60000000,  60000000, 120000000, 240000000 },
     426  { 0, 0, 0,      0, 0, 0,       0,       0, 0,       0,        0, 0, 30000000, 50000000, 0, 100000000, 160000000, 240000000, 240000000, 480000000, 800000000 }
     427};
     428#endif
     429
    440430static const struct MapStrToCostMode
    441431{
    442   const Char* str;
     432  const TChar* str;
    443433  CostMode    value;
    444434}
     
    453443static const struct MapStrToScalingListMode
    454444{
    455   const Char* str;
     445  const TChar* str;
    456446  ScalingListMode value;
    457447}
     
    533523{
    534524  const T              minValIncl;
    535   const T              maxValIncl; // Use 0 for unlimited
     525  const T              maxValIncl;
    536526  const std::size_t    minNumValuesIncl;
    537527  const std::size_t    maxNumValuesIncl; // Use 0 for unlimited
     
    545535  SMultiValueInput<T> &operator=(const std::vector<T> &userValues) { values=userValues; return *this; }
    546536  SMultiValueInput<T> &operator=(const SMultiValueInput<T> &userValues) { values=userValues.values; return *this; }
     537
     538  T readValue(const TChar *&pStr, Bool &bSuccess);
     539
     540  istream& readValues(std::istream &in);
    547541};
    548542
    549 static inline istream& operator >> (istream &in, SMultiValueInput<UInt> &values)
     543template <class T>
     544static inline istream& operator >> (std::istream &in, SMultiValueInput<T> &values)
    550545{
    551   values.values.clear();
     546  return values.readValues(in);
     547  }
     548
     549template<>
     550UInt SMultiValueInput<UInt>::readValue(const TChar *&pStr, Bool &bSuccess)
     551    {
     552  TChar *eptr;
     553      UInt val=strtoul(pStr, &eptr, 0);
     554  pStr=eptr;
     555  bSuccess=!(*eptr!=0 && !isspace(*eptr) && *eptr!=',') && !(val<minValIncl || val>maxValIncl);
     556  return val;
     557      }
     558
     559template<>
     560Int SMultiValueInput<Int>::readValue(const TChar *&pStr, Bool &bSuccess)
     561      {
     562  TChar *eptr;
     563  Int val=strtol(pStr, &eptr, 0);
     564      pStr=eptr;
     565  bSuccess=!(*eptr!=0 && !isspace(*eptr) && *eptr!=',') && !(val<minValIncl || val>maxValIncl);
     566  return val;
     567}
     568
     569template<>
     570Double SMultiValueInput<Double>::readValue(const TChar *&pStr, Bool &bSuccess)
     571  {
     572  TChar *eptr;
     573  Double val=strtod(pStr, &eptr);
     574  pStr=eptr;
     575  bSuccess=!(*eptr!=0 && !isspace(*eptr) && *eptr!=',') && !(val<minValIncl || val>maxValIncl);
     576  return val;
     577  }
     578
     579template<>
     580Bool SMultiValueInput<Bool>::readValue(const TChar *&pStr, Bool &bSuccess)
     581    {
     582  TChar *eptr;
     583      Int val=strtol(pStr, &eptr, 0);
     584      pStr=eptr;
     585  bSuccess=!(*eptr!=0 && !isspace(*eptr) && *eptr!=',') && !(val<Int(minValIncl) || val>Int(maxValIncl));
     586  return val!=0;
     587}
     588
     589template <class T>
     590istream& SMultiValueInput<T>::readValues(std::istream &in)
     591{
     592  values.clear();
    552593  string str;
    553594  while (!in.eof())
     
    557598  if (!str.empty())
    558599  {
    559     const Char *pStr=str.c_str();
     600    const TChar *pStr=str.c_str();
    560601    // soak up any whitespace
    561602    for(;isspace(*pStr);pStr++);
     
    563604    while (*pStr != 0)
    564605    {
    565       Char *eptr;
    566       UInt val=strtoul(pStr, &eptr, 0);
    567       if (*eptr!=0 && !isspace(*eptr) && *eptr!=',')
     606      Bool bSuccess=true;
     607      T val=readValue(pStr, bSuccess);
     608      if (!bSuccess)
    568609      {
    569610        in.setstate(ios::failbit);
    570611        break;
    571612      }
    572       if (val<values.minValIncl || val>values.maxValIncl)
     613
     614      if (maxNumValuesIncl != 0 && values.size() >= maxNumValuesIncl)
    573615      {
    574616        in.setstate(ios::failbit);
    575617        break;
    576618      }
    577 
    578       if (values.maxNumValuesIncl != 0 && values.values.size() >= values.maxNumValuesIncl)
    579       {
    580         in.setstate(ios::failbit);
    581         break;
    582       }
    583       values.values.push_back(val);
     619      values.push_back(val);
    584620      // soak up any whitespace and up to 1 comma.
    585       pStr=eptr;
    586621      for(;isspace(*pStr);pStr++);
    587622      if (*pStr == ',')
     
    592627    }
    593628  }
    594   if (values.values.size() < values.minNumValuesIncl)
    595   {
    596     in.setstate(ios::failbit);
    597   }
    598   return in;
    599 }
    600 
    601 static inline istream& operator >> (istream &in, SMultiValueInput<Int> &values)
    602 {
    603   values.values.clear();
    604   string str;
    605   while (!in.eof())
    606   {
    607     string tmp; in >> tmp; str+=" " + tmp;
    608   }
    609   if (!str.empty())
    610   {
    611     const Char *pStr=str.c_str();
    612     // soak up any whitespace
    613     for(;isspace(*pStr);pStr++);
    614 
    615     while (*pStr != 0)
    616     {
    617       Char *eptr;
    618       Int val=strtol(pStr, &eptr, 0);
    619       if (*eptr!=0 && !isspace(*eptr) && *eptr!=',')
    620       {
    621         in.setstate(ios::failbit);
    622         break;
    623       }
    624       if (val<values.minValIncl || val>values.maxValIncl)
    625       {
    626         in.setstate(ios::failbit);
    627         break;
    628       }
    629 
    630       if (values.maxNumValuesIncl != 0 && values.values.size() >= values.maxNumValuesIncl)
    631       {
    632         in.setstate(ios::failbit);
    633         break;
    634       }
    635       values.values.push_back(val);
    636       // soak up any whitespace and up to 1 comma.
    637       pStr=eptr;
    638       for(;isspace(*pStr);pStr++);
    639       if (*pStr == ',')
    640       {
    641         pStr++;
    642       }
    643       for(;isspace(*pStr);pStr++);
    644     }
    645   }
    646   if (values.values.size() < values.minNumValuesIncl)
    647   {
    648     in.setstate(ios::failbit);
    649   }
    650   return in;
    651 }
    652 
    653 static inline istream& operator >> (istream &in, SMultiValueInput<Bool> &values)
    654 {
    655   values.values.clear();
    656   string str;
    657   while (!in.eof())
    658   {
    659     string tmp; in >> tmp; str+=" " + tmp;
    660   }
    661   if (!str.empty())
    662   {
    663     const Char *pStr=str.c_str();
    664     // soak up any whitespace
    665     for(;isspace(*pStr);pStr++);
    666 
    667     while (*pStr != 0)
    668     {
    669       Char *eptr;
    670       Int val=strtol(pStr, &eptr, 0);
    671       if (*eptr!=0 && !isspace(*eptr) && *eptr!=',')
    672       {
    673         in.setstate(ios::failbit);
    674         break;
    675       }
    676       if (val<Int(values.minValIncl) || val>Int(values.maxValIncl))
    677       {
    678         in.setstate(ios::failbit);
    679         break;
    680       }
    681 
    682       if (values.maxNumValuesIncl != 0 && values.values.size() >= values.maxNumValuesIncl)
    683       {
    684         in.setstate(ios::failbit);
    685         break;
    686       }
    687       values.values.push_back(val!=0);
    688       // soak up any whitespace and up to 1 comma.
    689       pStr=eptr;
    690       for(;isspace(*pStr);pStr++);
    691       if (*pStr == ',')
    692       {
    693         pStr++;
    694       }
    695       for(;isspace(*pStr);pStr++);
    696     }
    697   }
    698   if (values.values.size() < values.minNumValuesIncl)
     629  if (values.size() < minNumValuesIncl)
    699630  {
    700631    in.setstate(ios::failbit);
     
    786717    \retval             true when success
    787718 */
    788 Bool TAppEncCfg::parseCfg( Int argc, Char* argv[] )
     719Bool TAppEncCfg::parseCfg( Int argc, TChar* argv[] )
    789720{
    790721  Bool do_help = false;
    791722
    792 #if !NH_MV
    793   string cfg_InputFile;
    794 #endif
    795   string cfg_BitstreamFile;
    796 #if !NH_MV
    797   string cfg_ReconFile;
    798 #endif
    799723#if NH_MV
    800724  vector<Int>   cfg_dimensionLength;
     
    809733#endif
    810734#endif
    811   string cfg_dQPFile;
    812   string cfg_ScalingListFile;
    813735
    814736  Int tmpChromaFormat;
    815737  Int tmpInputChromaFormat;
    816738  Int tmpConstraintChromaFormat;
     739  Int tmpWeightedPredictionMethod;
     740  Int tmpFastInterSearchMode;
     741  Int tmpMotionEstimationSearchMethod;
     742  Int tmpSliceMode;
     743  Int tmpSliceSegmentMode;
     744  Int tmpDecodedPictureHashSEIMappedType;
    817745  string inputColourSpaceConvert;
    818746#if NH_MV
     
    829757  SMultiValueInput<Int>  cfg_codedPivotValue                 (std::numeric_limits<Int>::min(), std::numeric_limits<Int>::max(), 0, 1<<16);
    830758  SMultiValueInput<Int>  cfg_targetPivotValue                (std::numeric_limits<Int>::min(), std::numeric_limits<Int>::max(), 0, 1<<16);
     759
     760  SMultiValueInput<Double> cfg_adIntraLambdaModifier         (0, std::numeric_limits<Double>::max(), 0, MAX_TLAYER); ///< Lambda modifier for Intra pictures, one for each temporal layer. If size>temporalLayer, then use [temporalLayer], else if size>0, use [size()-1], else use m_adLambdaModifier.
     761
    831762
    832763  const UInt defaultInputKneeCodes[3]  = { 600, 800, 900 };
     
    866797  ("InputFile_%d,i_%d",       m_pchInputFileList,       (char *) 0 , MAX_NUM_LAYER_IDS , "original Yuv input file name %d")
    867798#else
    868   ("InputFile,i",                                     cfg_InputFile,                               string(""), "Original YUV input file name")
    869 #endif
    870   ("BitstreamFile,b",                                 cfg_BitstreamFile,                           string(""), "Bitstream output file name")
     799  ("InputFile,i",                                     m_inputFileName,                             string(""), "Original YUV input file name")
     800#endif
     801  ("BitstreamFile,b",                                 m_bitstreamFileName,                         string(""), "Bitstream output file name")
    871802#if NH_MV
    872803  ("ReconFile_%d,o_%d",       m_pchReconFileList,       (char *) 0 , MAX_NUM_LAYER_IDS , "reconstructed Yuv output file name %d")
    873804#else
    874   ("ReconFile,o",                                     cfg_ReconFile,                               string(""), "Reconstructed YUV output file name")
    875 #endif
    876 #if NH_MV
    877   ("NumberOfLayers",        m_numberOfLayers     , 1,                     "Number of layers")
    878 #if !NH_3D
    879   ("ScalabilityMask",       m_scalabilityMask    , 2                    , "Scalability Mask: 2: Multiview, 8: Auxiliary, 10: Multiview + Auxiliary")   
    880 #else
    881   ("ScalabilityMask",       m_scalabilityMask    , 3                    , "Scalability Mask, 1: Texture 3: Texture + Depth ")   
     805  ("ReconFile,o",                                     m_reconFileName,                             string(""), "Reconstructed YUV output file name")
     806#endif
     807#if NH_MV
     808  ("NumberOfLayers",                 m_numberOfLayers     , 1,                     "Number of layers")
     809#if !NH_3D                           
     810  ("ScalabilityMask",                m_scalabilityMask    , 2                    , "Scalability Mask: 2: Multiview, 8: Auxiliary, 10: Multiview + Auxiliary")   
     811#else                               
     812  ("ScalabilityMask",                m_scalabilityMask    , 3                    , "Scalability Mask, 1: Texture 3: Texture + Depth ")   
    882813#endif 
    883   ("DimensionIdLen",        m_dimensionIdLen     , cfg_dimensionLength  , "Number of bits used to store dimensions Id")
     814  ("DimensionIdLen",                 m_dimensionIdLen     , cfg_dimensionLength  , "Number of bits used to store dimensions Id")
    884815  ("ViewOrderIndex",                 m_viewOrderIndex              , IntAry1d(1,0),                                 "View Order Index per layer")
    885816  ("ViewId",                         m_viewId                      , IntAry1d(1,0),                                 "View Id per View Order Index")
    886817  ("AuxId",                          m_auxId                       , IntAry1d(1,0),                                 "AuxId per layer")
    887 #if NH_3D
     818#if NH_3D_VSO
    888819  ("DepthFlag",                      m_depthFlag                   , IntAry1d(1,0),                                 "Depth Flag")
    889820#endif
    890821  ("TargetEncLayerIdList",           m_targetEncLayerIdList        , IntAry1d(0,0),                                 "LayerIds in Nuh to be encoded") 
    891822  ("LayerIdInNuh",                   m_layerIdInNuh                , IntAry1d(1,0),                                 "LayerId in Nuh") 
    892   ("SplittingFlag",         m_splittingFlag       , false                , "Splitting Flag")   
     823  ("SplittingFlag",                  m_splittingFlag               , false,                                        "Splitting Flag")   
    893824
    894825  // Layer Sets + Output Layer Sets + Profile Tier Level
    895   ("VpsNumLayerSets",       m_vpsNumLayerSets    , 1                    , "Number of layer sets")   
    896   ("LayerIdsInSet_%d"              , m_layerIdsInSets              , IntAry1d(1,0) , MAX_VPS_OP_SETS_PLUS1      ,   "LayerIds of Layer set") 
    897   ("NumAddLayerSets"     , m_numAddLayerSets     , 0                                              , "NumAddLayerSets     ")
     826  ("VpsNumLayerSets"               , m_vpsNumLayerSets             , 1                                          ,  "Number of layer sets")   
     827  ("LayerIdsInSet_%d"              , m_layerIdxInVpsInSets         , IntAry1d(1,0) , MAX_VPS_OP_SETS_PLUS1      ,   "Layer indices in VPS of layers in layer set") 
     828  ("NumAddLayerSets"               , m_numAddLayerSets             , 0 ,                                            "NumAddLayerSets     ")
    898829  ("HighestLayerIdxPlus1_%d"       , m_highestLayerIdxPlus1        , IntAry1d(0,0) , MAX_VPS_NUM_ADD_LAYER_SETS ,   "HighestLayerIdxPlus1")
    899   ("DefaultTargetOutputLayerIdc"     , m_defaultOutputLayerIdc     , 0, "Specifies output layers of layer sets, 0: output all layers, 1: output highest layer, 2: specified by LayerIdsInDefOutputLayerSet")
     830  ("DefaultTargetOutputLayerIdc"   , m_defaultOutputLayerIdc       , 0 ,                                            "Specifies output layers of layer sets, 0: output all layers, 1: output highest layer, 2: specified by LayerIdsInDefOutputLayerSet")
    900831  ("OutputLayerSetIdx"             , m_outputLayerSetIdx           , IntAry1d(0,0)                              ,   "Indices of layer sets used as additional output layer sets")
    901832  ("LayerIdsInAddOutputLayerSet_%d", m_layerIdsInAddOutputLayerSet , IntAry1d(0,0) , MAX_VPS_ADD_OUTPUT_LAYER_SETS, "Indices in VPS of output layers in additional output layer set") 
     
    941872  ("ConfWinTop",                                      m_confWinTop,                                         0, "Top offset for window conformance mode 3")
    942873  ("ConfWinBottom",                                   m_confWinBottom,                                      0, "Bottom offset for window conformance mode 3")
     874  ("AccessUnitDelimiter",                             m_AccessUnitDelimiter,                            false, "Enable Access Unit Delimiter NALUs")
    943875  ("FrameRate,-fr",                                   m_iFrameRate,                                         0, "Frame rate")
    944876  ("FrameSkip,-fs",                                   m_FrameSkip,                                         0u, "Number of frames to skip at start of input YUV")
     
    1003935  // motion search options
    1004936  ("DisableIntraInInter",                             m_bDisableIntraPUsInInterSlices,                  false, "Flag to disable intra PUs in inter slices")
    1005   ("FastSearch",                                      m_iFastSearch,                                        1, "0:Full search  1:Diamond  2:PMVFAST")
     937  ("FastSearch",                                      tmpMotionEstimationSearchMethod,  Int(MESEARCH_DIAMOND), "0:Full search 1:Diamond 2:Selective 3:Enhanced Diamond")
    1006938  ("SearchRange,-sr",                                 m_iSearchRange,                                      96, "Motion search range")
    1007939#if NH_MV
     
    1010942#endif
    1011943  ("BipredSearchRange",                               m_bipredSearchRange,                                  4, "Motion search range for bipred refinement")
     944  ("MinSearchWindow",                                 m_minSearchWindow,                                    8, "Minimum motion search window size for the adaptive window ME")
     945  ("RestrictMESampling",                              m_bRestrictMESampling,                            false, "Restrict ME Sampling for selective inter motion search")
    1012946  ("ClipForBiPredMEEnabled",                          m_bClipForBiPredMeEnabled,                        false, "Enables clipping in the Bi-Pred ME. It is disabled to reduce encoder run-time")
    1013947  ("FastMEAssumingSmootherMVEnabled",                 m_bFastMEAssumingSmootherMVEnabled,                true, "Enables fast ME assuming a smoother MV.")
     
    1017951
    1018952  // Mode decision parameters
    1019   ("LambdaModifier0,-LM0",                            m_adLambdaModifier[ 0 ],                  ( Double )1.0, "Lambda modifier for temporal layer 0")
    1020   ("LambdaModifier1,-LM1",                            m_adLambdaModifier[ 1 ],                  ( Double )1.0, "Lambda modifier for temporal layer 1")
    1021   ("LambdaModifier2,-LM2",                            m_adLambdaModifier[ 2 ],                  ( Double )1.0, "Lambda modifier for temporal layer 2")
    1022   ("LambdaModifier3,-LM3",                            m_adLambdaModifier[ 3 ],                  ( Double )1.0, "Lambda modifier for temporal layer 3")
    1023   ("LambdaModifier4,-LM4",                            m_adLambdaModifier[ 4 ],                  ( Double )1.0, "Lambda modifier for temporal layer 4")
    1024   ("LambdaModifier5,-LM5",                            m_adLambdaModifier[ 5 ],                  ( Double )1.0, "Lambda modifier for temporal layer 5")
    1025   ("LambdaModifier6,-LM6",                            m_adLambdaModifier[ 6 ],                  ( Double )1.0, "Lambda modifier for temporal layer 6")
     953  ("LambdaModifier0,-LM0",                            m_adLambdaModifier[ 0 ],                  ( Double )1.0, "Lambda modifier for temporal layer 0. If LambdaModifierI is used, this will not affect intra pictures")
     954  ("LambdaModifier1,-LM1",                            m_adLambdaModifier[ 1 ],                  ( Double )1.0, "Lambda modifier for temporal layer 1. If LambdaModifierI is used, this will not affect intra pictures")
     955  ("LambdaModifier2,-LM2",                            m_adLambdaModifier[ 2 ],                  ( Double )1.0, "Lambda modifier for temporal layer 2. If LambdaModifierI is used, this will not affect intra pictures")
     956  ("LambdaModifier3,-LM3",                            m_adLambdaModifier[ 3 ],                  ( Double )1.0, "Lambda modifier for temporal layer 3. If LambdaModifierI is used, this will not affect intra pictures")
     957  ("LambdaModifier4,-LM4",                            m_adLambdaModifier[ 4 ],                  ( Double )1.0, "Lambda modifier for temporal layer 4. If LambdaModifierI is used, this will not affect intra pictures")
     958  ("LambdaModifier5,-LM5",                            m_adLambdaModifier[ 5 ],                  ( Double )1.0, "Lambda modifier for temporal layer 5. If LambdaModifierI is used, this will not affect intra pictures")
     959  ("LambdaModifier6,-LM6",                            m_adLambdaModifier[ 6 ],                  ( Double )1.0, "Lambda modifier for temporal layer 6. If LambdaModifierI is used, this will not affect intra pictures")
     960  ("LambdaModifierI,-LMI",                            cfg_adIntraLambdaModifier,    cfg_adIntraLambdaModifier, "Lambda modifiers for Intra pictures, comma separated, up to one the number of temporal layer. If entry for temporalLayer exists, then use it, else if some are specified, use the last, else use the standard LambdaModifiers.")
     961  ("IQPFactor,-IQF",                                  m_dIntraQpFactor,                                  -1.0, "Intra QP Factor for Lambda Computation. If negative, use the default equation: 0.57*(1.0 - Clip3( 0.0, 0.5, 0.05*(Double)(isField ? (GopSize-1)/2 : GopSize-1) ))")
    1026962
    1027963  /* Quantization parameters */
     
    1046982  ("AdaptiveQP,-aq",                                  m_bUseAdaptiveQP,                                 false, "QP adaptation based on a psycho-visual model")
    1047983  ("MaxQPAdaptationRange,-aqr",                       m_iQPAdaptationRange,                                 6, "QP adaptation range")
    1048   ("dQPFile,m",                                       cfg_dQPFile,                                 string(""), "dQP file name")
     984  ("dQPFile,m",                                       m_dQPFileName,                               string(""), "dQP file name")
    1049985  ("RDOQ",                                            m_useRDOQ,                                         true)
    1050986  ("RDOQTS",                                          m_useRDOQTS,                                       true)
     
    10901026  ("MaxNumOffsetsPerPic",                             m_maxNumOffsetsPerPic,                             2048, "Max number of SAO offset per picture (Default: 2048)")
    10911027  ("SAOLcuBoundary",                                  m_saoCtuBoundary,                                 false, "0: right/bottom CTU boundary areas skipped from SAO parameter estimation, 1: non-deblocked pixels are used for those areas")
    1092   ("SliceMode",                                       m_sliceMode,                                          0, "0: Disable all Recon slice limits, 1: Enforce max # of CTUs, 2: Enforce max # of bytes, 3:specify tiles per dependent slice")
     1028  ("SliceMode",                                       tmpSliceMode,                            Int(NO_SLICES), "0: Disable all Recon slice limits, 1: Enforce max # of CTUs, 2: Enforce max # of bytes, 3:specify tiles per dependent slice")
    10931029  ("SliceArgument",                                   m_sliceArgument,                                      0, "Depending on SliceMode being:"
    10941030                                                                                                               "\t1: max number of CTUs per slice"
    10951031                                                                                                               "\t2: max number of bytes per slice"
    10961032                                                                                                               "\t3: max number of tiles per slice")
    1097   ("SliceSegmentMode",                                m_sliceSegmentMode,                                   0, "0: Disable all slice segment limits, 1: Enforce max # of CTUs, 2: Enforce max # of bytes, 3:specify tiles per dependent slice")
     1033  ("SliceSegmentMode",                                tmpSliceSegmentMode,                     Int(NO_SLICES), "0: Disable all slice segment limits, 1: Enforce max # of CTUs, 2: Enforce max # of bytes, 3:specify tiles per dependent slice")
    10981034  ("SliceSegmentArgument",                            m_sliceSegmentArgument,                               0, "Depending on SliceSegmentMode being:"
    10991035                                                                                                               "\t1: max number of CTUs per slice segment"
     
    11121048  ("PCMInputBitDepthFlag",                            m_bPCMInputBitDepthFlag,                           true)
    11131049  ("PCMFilterDisableFlag",                            m_bPCMFilterDisableFlag,                          false)
    1114   ("IntraReferenceSmoothing",                         m_enableIntraReferenceSmoothing,                   true, "0: Disable use of intra reference smoothing. 1: Enable use of intra reference smoothing (not valid in V1 profiles)")
     1050  ("IntraReferenceSmoothing",                         m_enableIntraReferenceSmoothing,                   true, "0: Disable use of intra reference smoothing (not valid in V1 profiles). 1: Enable use of intra reference smoothing (same as V1)")
    11151051  ("WeightedPredP,-wpP",                              m_useWeightedPred,                                false, "Use weighted prediction in P slices")
    11161052  ("WeightedPredB,-wpB",                              m_useWeightedBiPred,                              false, "Use weighted (bidirectional) prediction in B slices")
     1053  ("WeightedPredMethod,-wpM",                         tmpWeightedPredictionMethod, Int(WP_PER_PICTURE_WITH_SIMPLE_DC_COMBINED_COMPONENT), "Weighted prediction method")
    11171054  ("Log2ParallelMergeLevel",                          m_log2ParallelMergeLevel,                            2u, "Parallel merge estimation region")
    11181055    //deprecated copies of renamed tile parameters
     
    11271064  ("TileRowHeightArray",                              cfg_RowHeight,                            cfg_RowHeight, "Array containing tile row height values in units of CTU")
    11281065  ("LFCrossTileBoundaryFlag",                         m_bLFCrossTileBoundaryFlag,                        true, "1: cross-tile-boundary loop filtering. 0:non-cross-tile-boundary loop filtering")
    1129   ("WaveFrontSynchro",                                m_iWaveFrontSynchro,                                  0, "0: no synchro; 1 synchro with top-right-right")
     1066  ("WaveFrontSynchro",                                m_entropyCodingSyncEnabledFlag,                   false, "0: entropy coding sync disabled; 1 entropy coding sync enabled")
    11301067  ("ScalingList",                                     m_useScalingListId,                    SCALING_LIST_OFF, "0/off: no scaling list, 1/default: default scaling lists, 2/file: scaling lists specified in ScalingListFile")
    1131   ("ScalingListFile",                                 cfg_ScalingListFile,                         string(""), "Scaling list file name. Use an empty string to produce help.")
     1068  ("ScalingListFile",                                 m_scalingListFileName,                       string(""), "Scaling list file name. Use an empty string to produce help.")
    11321069  ("SignHideFlag,-SBH",                               m_signHideFlag,                                    true)
    11331070  ("MaxNumMergeCand",                                 m_maxNumMergeCand,                                   5u, "Maximum number of merge candidates")
    11341071  /* Misc. */
    1135   ("SEIDecodedPictureHash",                           m_decodedPictureHashSEIEnabled,                       0, "Control generation of decode picture hash SEI messages\n"
     1072  ("SEIDecodedPictureHash",                           tmpDecodedPictureHashSEIMappedType,                   0, "Control generation of decode picture hash SEI messages\n"
    11361073                                                                                                               "\t3: checksum\n"
    11371074                                                                                                               "\t2: CRC\n"
     
    11391076                                                                                                               "\t0: disable")
    11401077  ("TMVPMode",                                        m_TMVPModeId,                                         1, "TMVP mode 0: TMVP disable for all slices. 1: TMVP enable for all slices (default) 2: TMVP enable for certain slices only")
    1141   ("FEN",                                             m_bUseFastEnc,                                    false, "fast encoder setting")
     1078  ("FEN",                                             tmpFastInterSearchMode,   Int(FASTINTERSEARCH_DISABLED), "fast encoder setting")
    11421079  ("ECU",                                             m_bUseEarlyCU,                                    false, "Early CU setting")
    11431080  ("FDM",                                             m_useFastDecisionForMerge,                         true, "Fast decision for Merge RD Cost")
     
    11521089  ( "RCForceIntraQP",                                 m_RCForceIntraQP,                                 false, "Rate control: force intra QP to be equal to initial QP" )
    11531090
     1091#if U0132_TARGET_BITS_SATURATION
     1092  ( "RCCpbSaturation",                                m_RCCpbSaturationEnabled,                         false, "Rate control: enable target bits saturation to avoid CPB overflow and underflow" )
     1093  ( "RCCpbSize",                                      m_RCCpbSize,                                         0u, "Rate control: CPB size" )
     1094  ( "RCInitialCpbFullness",                           m_RCInitialCpbFullness,                             0.9, "Rate control: initial CPB fullness" )
     1095#endif
     1096
    11541097#if KWU_RC_VIEWRC_E0227
    11551098  ("ViewWiseTargetBits, -vtbr" ,  m_viewTargetBits,  std::vector<Int>(1, 32), "View-wise target bit-rate setting")
     
    11621105// A lot of this stuff could should actually be derived by the encoder.
    11631106  // VPS VUI
    1164   ("VpsVuiPresentFlag"           , m_vpsVuiPresentFlag           , false                                           , "VpsVuiPresentFlag           ")
    1165   ("CrossLayerPicTypeAlignedFlag", m_crossLayerPicTypeAlignedFlag, false                                           , "CrossLayerPicTypeAlignedFlag")  // Could actually be derived by the encoder
    1166   ("CrossLayerIrapAlignedFlag"   , m_crossLayerIrapAlignedFlag   , false                                           , "CrossLayerIrapAlignedFlag   ")  // Could actually be derived by the encoder
    1167   ("AllLayersIdrAlignedFlag"     , m_allLayersIdrAlignedFlag     , false                                           , "CrossLayerIrapAlignedFlag   ")  // Could actually be derived by the encoder
    1168   ("BitRatePresentVpsFlag"       , m_bitRatePresentVpsFlag       , false                                           , "BitRatePresentVpsFlag       ")
    1169   ("PicRatePresentVpsFlag"       , m_picRatePresentVpsFlag       , false                                           , "PicRatePresentVpsFlag       ")
    1170   ("BitRatePresentFlag"          , m_bitRatePresentFlag          , BoolAry1d(1,0)  ,MAX_VPS_OP_SETS_PLUS1, "BitRatePresentFlag per sub layer for the N-th layer set")
    1171   ("PicRatePresentFlag"          , m_picRatePresentFlag          , BoolAry1d(1,0)  ,MAX_VPS_OP_SETS_PLUS1, "PicRatePresentFlag per sub layer for the N-th layer set")
    1172   ("AvgBitRate"                  , m_avgBitRate                   , IntAry1d (1,0), MAX_VPS_OP_SETS_PLUS1, "AvgBitRate         per sub layer for the N-th layer set")
    1173   ("MaxBitRate"                  , m_maxBitRate                   , IntAry1d (1,0), MAX_VPS_OP_SETS_PLUS1, "MaxBitRate         per sub layer for the N-th layer set")
    1174   ("ConstantPicRateIdc"          , m_constantPicRateIdc           , IntAry1d (1,0), MAX_VPS_OP_SETS_PLUS1, "ConstantPicRateIdc per sub layer for the N-th layer set")
    1175   ("AvgPicRate"                  , m_avgPicRate                   , IntAry1d (1,0), MAX_VPS_OP_SETS_PLUS1, "AvgPicRate         per sub layer for the N-th layer set")
    1176   ("TilesNotInUseFlag"            , m_tilesNotInUseFlag            , true                                          , "TilesNotInUseFlag            ")
     1107  ("VpsVuiPresentFlag"            , m_vpsVuiPresentFlag            , false                                , "VpsVuiPresentFlag           ")
     1108  ("CrossLayerPicTypeAlignedFlag" , m_crossLayerPicTypeAlignedFlag , false                                , "CrossLayerPicTypeAlignedFlag")  // Could actually be derived by the encoder
     1109  ("CrossLayerIrapAlignedFlag"    , m_crossLayerIrapAlignedFlag    , false                                , "CrossLayerIrapAlignedFlag   ")  // Could actually be derived by the encoder
     1110  ("AllLayersIdrAlignedFlag"      , m_allLayersIdrAlignedFlag      , false                                , "CrossLayerIrapAlignedFlag   ")  // Could actually be derived by the encoder
     1111  ("BitRatePresentVpsFlag"        , m_bitRatePresentVpsFlag        , false                                , "BitRatePresentVpsFlag       ")
     1112  ("PicRatePresentVpsFlag"        , m_picRatePresentVpsFlag        , false                                , "PicRatePresentVpsFlag       ")
     1113  ("BitRatePresentFlag"           , m_bitRatePresentFlag           , BoolAry1d(1,0), MAX_VPS_OP_SETS_PLUS1, "BitRatePresentFlag per sub layer for the N-th layer set")
     1114  ("PicRatePresentFlag"           , m_picRatePresentFlag           , BoolAry1d(1,0), MAX_VPS_OP_SETS_PLUS1, "PicRatePresentFlag per sub layer for the N-th layer set")
     1115  ("AvgBitRate"                   , m_avgBitRate                   , IntAry1d (1,0), MAX_VPS_OP_SETS_PLUS1, "AvgBitRate         per sub layer for the N-th layer set")
     1116  ("MaxBitRate"                   , m_maxBitRate                   , IntAry1d (1,0), MAX_VPS_OP_SETS_PLUS1, "MaxBitRate         per sub layer for the N-th layer set")
     1117  ("ConstantPicRateIdc"           , m_constantPicRateIdc           , IntAry1d (1,0), MAX_VPS_OP_SETS_PLUS1, "ConstantPicRateIdc per sub layer for the N-th layer set")
     1118  ("AvgPicRate"                   , m_avgPicRate                   , IntAry1d (1,0), MAX_VPS_OP_SETS_PLUS1, "AvgPicRate         per sub layer for the N-th layer set")
     1119  ("TilesNotInUseFlag"            , m_tilesNotInUseFlag            , true                                 , "TilesNotInUseFlag            ")
    11771120  ("TilesInUseFlag"               , m_tilesInUseFlag               , BoolAry1d(1,false)                   , "TilesInUseFlag               ")
    1178   ("LoopFilterNotAcrossTilesFlag" , m_loopFilterNotAcrossTilesFlag , BoolAry1d(1,false)                  , "LoopFilterNotAcrossTilesFlag ")
    1179   ("WppNotInUseFlag"              , m_wppNotInUseFlag              , true                                          , "WppNotInUseFlag              ")
    1180   ("WppInUseFlag"                 , m_wppInUseFlag                 , BoolAry1d(1,0)                      , "WppInUseFlag                 ")
    1181   ("TileBoundariesAlignedFlag"   , m_tileBoundariesAlignedFlag   , BoolAry1d(1,0)  ,MAX_NUM_LAYERS       , "TileBoundariesAlignedFlag    per direct reference for the N-th layer")
    1182   ("IlpRestrictedRefLayersFlag"  , m_ilpRestrictedRefLayersFlag  , false                                           , "IlpRestrictedRefLayersFlag")
    1183   ("MinSpatialSegmentOffsetPlus1", m_minSpatialSegmentOffsetPlus1 , IntAry1d (1,0), MAX_NUM_LAYERS       , "MinSpatialSegmentOffsetPlus1 per direct reference for the N-th layer")
    1184   ("CtuBasedOffsetEnabledFlag"   , m_ctuBasedOffsetEnabledFlag   , BoolAry1d(1,0)  ,MAX_NUM_LAYERS       , "CtuBasedOffsetEnabledFlag    per direct reference for the N-th layer")
    1185   ("MinHorizontalCtuOffsetPlus1" , m_minHorizontalCtuOffsetPlus1  , IntAry1d (1,0), MAX_NUM_LAYERS       , "MinHorizontalCtuOffsetPlus1  per direct reference for the N-th layer")
    1186   ("SingleLayerForNonIrapFlag", m_singleLayerForNonIrapFlag, false                                          , "SingleLayerForNonIrapFlag")
    1187   ("HigherLayerIrapSkipFlag"  , m_higherLayerIrapSkipFlag  , false                                          , "HigherLayerIrapSkipFlag  ")
     1121  ("LoopFilterNotAcrossTilesFlag" , m_loopFilterNotAcrossTilesFlag , BoolAry1d(1,false)                   , "LoopFilterNotAcrossTilesFlag ")
     1122  ("WppNotInUseFlag"              , m_wppNotInUseFlag              , true                                 , "WppNotInUseFlag              ")
     1123  ("WppInUseFlag"                 , m_wppInUseFlag                 , BoolAry1d(1,0)                       , "WppInUseFlag                 ")
     1124  ("TileBoundariesAlignedFlag"    , m_tileBoundariesAlignedFlag    , BoolAry1d(1,0)  ,MAX_NUM_LAYERS      , "TileBoundariesAlignedFlag    per direct reference for the N-th layer")
     1125  ("IlpRestrictedRefLayersFlag"   , m_ilpRestrictedRefLayersFlag   , false                                , "IlpRestrictedRefLayersFlag")
     1126  ("MinSpatialSegmentOffsetPlus1" , m_minSpatialSegmentOffsetPlus1 , IntAry1d (1,0), MAX_NUM_LAYERS       , "MinSpatialSegmentOffsetPlus1 per direct reference for the N-th layer")
     1127  ("CtuBasedOffsetEnabledFlag"    , m_ctuBasedOffsetEnabledFlag    , BoolAry1d(1,0)  ,MAX_NUM_LAYERS      , "CtuBasedOffsetEnabledFlag    per direct reference for the N-th layer")
     1128  ("MinHorizontalCtuOffsetPlus1"  , m_minHorizontalCtuOffsetPlus1  , IntAry1d (1,0), MAX_NUM_LAYERS       , "MinHorizontalCtuOffsetPlus1  per direct reference for the N-th layer")
     1129  ("SingleLayerForNonIrapFlag"    , m_singleLayerForNonIrapFlag    , false                                , "SingleLayerForNonIrapFlag")
     1130  ("HigherLayerIrapSkipFlag"      , m_higherLayerIrapSkipFlag      , false                                , "HigherLayerIrapSkipFlag  ")
    11881131#endif
    11891132
     
    12271170  ("Log2MaxMvLengthHorizontal",                       m_log2MaxMvLengthHorizontal,                         15, "Indicate the maximum absolute value of a decoded horizontal MV component in quarter-pel luma units")
    12281171  ("Log2MaxMvLengthVertical",                         m_log2MaxMvLengthVertical,                           15, "Indicate the maximum absolute value of a decoded vertical MV component in quarter-pel luma units")
    1229   ("SEIRecoveryPoint",                                m_recoveryPointSEIEnabled,                            0, "Control generation of recovery point SEI messages")
    1230   ("SEIBufferingPeriod",                              m_bufferingPeriodSEIEnabled,                          0, "Control generation of buffering period SEI messages")
    1231   ("SEIPictureTiming",                                m_pictureTimingSEIEnabled,                            0, "Control generation of picture timing SEI messages")
     1172  ("SEIColourRemappingInfoFileRoot,-cri",             m_colourRemapSEIFileRoot,                    string(""), "Colour Remapping Information SEI parameters root file name (wo num ext)")
     1173  ("SEIRecoveryPoint",                                m_recoveryPointSEIEnabled,                        false, "Control generation of recovery point SEI messages")
     1174  ("SEIBufferingPeriod",                              m_bufferingPeriodSEIEnabled,                      false, "Control generation of buffering period SEI messages")
     1175  ("SEIPictureTiming",                                m_pictureTimingSEIEnabled,                        false, "Control generation of picture timing SEI messages")
    12321176  ("SEIToneMappingInfo",                              m_toneMappingInfoSEIEnabled,                      false, "Control generation of Tone Mapping SEI messages")
    12331177  ("SEIToneMapId",                                    m_toneMapId,                                          0, "Specifies Id of Tone Mapping SEI message for a given session")
     
    12621206  ("SEIToneMapNominalWhiteLevelLumaCodeValue",        m_nominalWhiteLevelLumaCodeValue,                   235, "Specifies luma sample value of the nominal white level assigned decoded pictures")
    12631207  ("SEIToneMapExtendedWhiteLevelLumaCodeValue",       m_extendedWhiteLevelLumaCodeValue,                  300, "Specifies luma sample value of the extended dynamic range assigned decoded pictures")
    1264   ("SEIChromaSamplingFilterHint",                     m_chromaSamplingFilterSEIenabled,                 false, "Control generation of the chroma sampling filter hint SEI message")
    1265   ("SEIChromaSamplingHorizontalFilterType",           m_chromaSamplingHorFilterIdc,                         2, "Defines the Index of the chroma sampling horizontal filter\n"
     1208  ("SEIChromaResamplingFilterHint",                   m_chromaResamplingFilterSEIenabled,               false, "Control generation of the chroma sampling filter hint SEI message")
     1209  ("SEIChromaResamplingHorizontalFilterType",         m_chromaResamplingHorFilterIdc,                       2, "Defines the Index of the chroma sampling horizontal filter\n"
    12661210                                                                                                               "\t0: unspecified  - Chroma filter is unknown or is determined by the application"
    12671211                                                                                                               "\t1: User-defined - Filter coefficients are specified in the chroma sampling filter hint SEI message"
    12681212                                                                                                               "\t2: Standards-defined - ITU-T Rec. T.800 | ISO/IEC15444-1, 5/3 filter")
    1269   ("SEIChromaSamplingVerticalFilterType",             m_chromaSamplingVerFilterIdc,                         2, "Defines the Index of the chroma sampling vertical filter\n"
     1213  ("SEIChromaResamplingVerticalFilterType",           m_chromaResamplingVerFilterIdc,                         2, "Defines the Index of the chroma sampling vertical filter\n"
    12701214                                                                                                               "\t0: unspecified  - Chroma filter is unknown or is determined by the application"
    12711215                                                                                                               "\t1: User-defined - Filter coefficients are specified in the chroma sampling filter hint SEI message"
    12721216                                                                                                               "\t2: Standards-defined - ITU-T Rec. T.800 | ISO/IEC15444-1, 5/3 filter")
    1273   ("SEIFramePacking",                                 m_framePackingSEIEnabled,                             0, "Control generation of frame packing SEI messages")
     1217  ("SEIFramePacking",                                 m_framePackingSEIEnabled,                         false, "Control generation of frame packing SEI messages")
    12741218  ("SEIFramePackingType",                             m_framePackingSEIType,                                0, "Define frame packing arrangement\n"
    12751219                                                                                                               "\t3: side by side - frames are displayed horizontally\n"
     
    12821226                                                                                                               "\t1: stereo pair, frame0 represents left view\n"
    12831227                                                                                                               "\t2: stereo pair, frame0 represents right view")
    1284   ("SEISegmentedRectFramePacking",                    m_segmentedRectFramePackingSEIEnabled,                0, "Controls generation of segmented rectangular frame packing SEI messages")
     1228  ("SEISegmentedRectFramePacking",                    m_segmentedRectFramePackingSEIEnabled,            false, "Controls generation of segmented rectangular frame packing SEI messages")
    12851229  ("SEISegmentedRectFramePackingCancel",              m_segmentedRectFramePackingSEICancel,             false, "If equal to 1, cancels the persistence of any previous SRFPA SEI message")
    12861230  ("SEISegmentedRectFramePackingType",                m_segmentedRectFramePackingSEIType,                   0, "Specifies the arrangement of the frames in the reconstructed picture")
     
    12891233                                                                                                               "\tN: 0 < N < (2^16 - 1) enable display orientation SEI message with anticlockwise_rotation = N and display_orientation_repetition_period = 1\n"
    12901234                                                                                                               "\t0: disable")
    1291   ("SEITemporalLevel0Index",                          m_temporalLevel0IndexSEIEnabled,                      0, "Control generation of temporal level 0 index SEI messages")
    1292   ("SEIGradualDecodingRefreshInfo",                   m_gradualDecodingRefreshInfoEnabled,                  0, "Control generation of gradual decoding refresh information SEI message")
     1235  ("SEITemporalLevel0Index",                          m_temporalLevel0IndexSEIEnabled,                  false, "Control generation of temporal level 0 index SEI messages")
     1236  ("SEIGradualDecodingRefreshInfo",                   m_gradualDecodingRefreshInfoEnabled,              false, "Control generation of gradual decoding refresh information SEI message")
    12931237  ("SEINoDisplay",                                    m_noDisplaySEITLayer,                                 0, "Control generation of no display SEI message\n"
    12941238                                                                                                               "\tN: 0 < N enable no display SEI message for temporal layer N or higher\n"
    12951239                                                                                                               "\t0: disable")
    1296   ("SEIDecodingUnitInfo",                             m_decodingUnitInfoSEIEnabled,                         0, "Control generation of decoding unit information SEI message.")
    1297   ("SEISOPDescription",                               m_SOPDescriptionSEIEnabled,                           0, "Control generation of SOP description SEI messages")
    1298   ("SEIScalableNesting",                              m_scalableNestingSEIEnabled,                          0, "Control generation of scalable nesting SEI messages")
     1240  ("SEIDecodingUnitInfo",                             m_decodingUnitInfoSEIEnabled,                     false, "Control generation of decoding unit information SEI message.")
     1241  ("SEISOPDescription",                               m_SOPDescriptionSEIEnabled,                       false, "Control generation of SOP description SEI messages")
     1242  ("SEIScalableNesting",                              m_scalableNestingSEIEnabled,                      false, "Control generation of scalable nesting SEI messages")
    12991243  ("SEITempMotionConstrainedTileSets",                m_tmctsSEIEnabled,                                false, "Control generation of temporal motion constrained tile sets SEI message")
    13001244  ("SEITimeCodeEnabled",                              m_timeCodeSEIEnabled,                             false, "Control generation of time code information SEI message")
     
    13321276  ("SEIMasteringDisplayWhitePoint",                   cfg_DisplayWhitePointCode,     cfg_DisplayWhitePointCode, "Mastering display white point CIE xy coordinates in normalised increments of 1/50000 (e.g. 0.333 = 16667)")
    13331277#if NH_MV
    1334 #if !NH_MV_SEI
    1335   ("SubBitstreamPropSEIEnabled",                      m_subBistreamPropSEIEnabled,    false                     ,"Enable signaling of sub-bitstream property SEI message")
    1336   ("SEISubBitstreamNumAdditionalSubStreams",          m_sbPropNumAdditionalSubStreams,0                         ,"Number of substreams for which additional information is signalled")
    1337   ("SEISubBitstreamSubBitstreamMode",                 m_sbPropSubBitstreamMode,       IntAry1d (1,0)            ,"Specifies mode of generation of the i-th sub-bitstream (0 or 1)")
    1338   ("SEISubBitstreamOutputLayerSetIdxToVps",           m_sbPropOutputLayerSetIdxToVps, IntAry1d (1,0)            ,"Specifies output layer set index of the i-th sub-bitstream ")
    1339   ("SEISubBitstreamHighestSublayerId",                m_sbPropHighestSublayerId,      IntAry1d (1,0)            ,"Specifies highest TemporalId of the i-th sub-bitstream")
    1340   ("SEISubBitstreamAvgBitRate",                       m_sbPropAvgBitRate,             IntAry1d (1,0)            ,"Specifies average bit rate of the i-th sub-bitstream")
    1341   ("SEISubBitstreamMaxBitRate",                       m_sbPropMaxBitRate,             IntAry1d (1,0)            ,"Specifies maximum bit rate of the i-th sub-bitstream")
    1342 #else
    1343   ("SeiCfgFileName_%d",                               m_seiCfgFileNames,             (Char *) 0 , MAX_NUM_SEIS , "SEI cfg file name %d")
    1344 #endif
     1278  ("SeiCfgFileName_%d",                               m_seiCfgFileNames,             (TChar *) 0 ,MAX_NUM_SEIS , "SEI cfg file name %d")
    13451279  ("OutputVpsInfo",                                   m_outputVpsInfo,                false                     ,"Output information about the layer dependencies and layer sets")
     1280
     1281/* Camera parameters */   
     1282  ("BaseViewCameraNumbers",                           m_pchBaseViewCameraNumbers,   (TChar *) 0                 , "Numbers of base views")
    13461283#endif
    13471284#if NH_3D
    1348 /* Camera parameters */ 
    13491285  ("Depth420OutputFlag",                              m_depth420OutputFlag,           true                     , "Output depth layers in 4:2:0 ")
    1350   ("CameraParameterFile,cpf",                         m_pchCameraParameterFile,    (Char *) 0,                    "Camera Parameter File Name")
    1351   ("BaseViewCameraNumbers",                           m_pchBaseViewCameraNumbers,  (Char *) 0,                    "Numbers of base views")
     1286#endif
     1287#if NH_3D_VSO 
     1288  ("CameraParameterFile,cpf",                         m_pchCameraParameterFile,    (TChar *) 0                 , "Camera Parameter File Name")
    13521289  ("CodedCamParsPrecision",                           m_iCodedCamParPrecision,      STD_CAM_PARAMETERS_PRECISION, "precision for coding of camera parameters (in units of 2^(-x) luma samples)" )
    13531290
    1354 #if NH_3D_VSO
    13551291  /* View Synthesis Optimization */
    1356   ("VSOConfig",                                       m_pchVSOConfig            , (Char *) 0                    ,"VSO configuration")
     1292  ("VSOConfig",                                       m_pchVSOConfig            , (TChar *) 0                   ,"VSO configuration")
    13571293  ("VSO",                                             m_bUseVSO                 , false                         ,"Use VSO" )   
    13581294  ("VSOMode",                                         m_uiVSOMode               , (UInt)   4                    ,"VSO Mode")
     
    13711307#endif //HHI_VSO
    13721308/* 3D- HEVC Tools */                                                           
     1309#if NH_3D_QTL
    13731310  ("QTL"                   ,                          m_bUseQTL                 , true                          , "Use depth quad tree limitation (encoder only)" )
     1311#endif
     1312#if NH_3D
     1313
    13741314  ("IvMvPredFlag"          ,                          m_ivMvPredFlag            , BoolAry1d(2,true)             , "Inter-view motion prediction"              )
    13751315  ("IvMvScalingFlag"       ,                          m_ivMvScalingFlag         , BoolAry1d(2,true)             , "Inter-view motion vector scaling"          )
     
    14471387  po::setDefaults(opts);
    14481388  po::ErrorReporter err;
    1449   const list<const Char*>& argv_unhandled = po::scanArgv(opts, argc, (const Char**) argv, err);
    1450 
    1451   for (list<const Char*>::const_iterator it = argv_unhandled.begin(); it != argv_unhandled.end(); it++)
     1389  const list<const TChar*>& argv_unhandled = po::scanArgv(opts, argc, (const TChar**) argv, err);
     1390
     1391  for (list<const TChar*>::const_iterator it = argv_unhandled.begin(); it != argv_unhandled.end(); it++)
    14521392  {
    14531393    fprintf(stderr, "Unhandled argument ignored: `%s'\n", *it);
     
    14731413   * Set any derived parameters
    14741414   */
    1475   /* convert std::string to c string for compatability */
    1476 #if !NH_MV
    1477   m_pchInputFile = cfg_InputFile.empty() ? NULL : strdup(cfg_InputFile.c_str());
    1478 #endif
    1479   m_pchBitstreamFile = cfg_BitstreamFile.empty() ? NULL : strdup(cfg_BitstreamFile.c_str());
    1480 #if !NH_MV
    1481   m_pchReconFile = cfg_ReconFile.empty() ? NULL : strdup(cfg_ReconFile.c_str());
    1482 #endif
    1483   m_pchdQPFile = cfg_dQPFile.empty() ? NULL : strdup(cfg_dQPFile.c_str());
    1484 
     1415  m_adIntraLambdaModifier = cfg_adIntraLambdaModifier.values;
    14851416  if(m_isField)
    14861417  {
     
    15451476  }
    15461477
    1547   m_scalingListFile = cfg_ScalingListFile.empty() ? NULL : strdup(cfg_ScalingListFile.c_str());
    1548 
    15491478  /* rules for input, output and internal bitdepths as per help text */
    15501479  if (m_MSBExtendedBitDepth[CHANNEL_TYPE_LUMA  ] == 0)
     
    15791508  m_InputChromaFormatIDC = numberToChromaFormat(tmpInputChromaFormat);
    15801509  m_chromaFormatIDC      = ((tmpChromaFormat == 0) ? (m_InputChromaFormatIDC) : (numberToChromaFormat(tmpChromaFormat)));
     1510
     1511
     1512  assert(tmpWeightedPredictionMethod>=0 && tmpWeightedPredictionMethod<=WP_PER_PICTURE_WITH_HISTOGRAM_AND_PER_COMPONENT_AND_CLIPPING_AND_EXTENSION);
     1513  if (!(tmpWeightedPredictionMethod>=0 && tmpWeightedPredictionMethod<=WP_PER_PICTURE_WITH_HISTOGRAM_AND_PER_COMPONENT_AND_CLIPPING_AND_EXTENSION))
     1514  {
     1515    exit(EXIT_FAILURE);
     1516  }
     1517  m_weightedPredictionMethod = WeightedPredictionMethod(tmpWeightedPredictionMethod);
     1518
     1519  assert(tmpFastInterSearchMode>=0 && tmpFastInterSearchMode<=FASTINTERSEARCH_MODE3);
     1520  if (tmpFastInterSearchMode<0 || tmpFastInterSearchMode>FASTINTERSEARCH_MODE3)
     1521  {
     1522    exit(EXIT_FAILURE);
     1523  }
     1524  m_fastInterSearchMode = FastInterSearchMode(tmpFastInterSearchMode);
     1525
     1526  assert(tmpMotionEstimationSearchMethod>=0 && tmpMotionEstimationSearchMethod<MESEARCH_NUMBER_OF_METHODS);
     1527  if (tmpMotionEstimationSearchMethod<0 || tmpMotionEstimationSearchMethod>=MESEARCH_NUMBER_OF_METHODS)
     1528  {
     1529    exit(EXIT_FAILURE);
     1530  }
     1531  m_motionEstimationSearchMethod=MESearchMethod(tmpMotionEstimationSearchMethod);
    15811532
    15821533#if NH_MV
     
    18021753  }
    18031754
     1755  if (tmpSliceMode<0 || tmpSliceMode>=Int(NUMBER_OF_SLICE_CONSTRAINT_MODES))
     1756  {
     1757    fprintf(stderr, "Error: bad slice mode\n");
     1758    exit(EXIT_FAILURE);
     1759  }
     1760  m_sliceMode = SliceConstraint(tmpSliceMode);
     1761  if (tmpSliceSegmentMode<0 || tmpSliceSegmentMode>=Int(NUMBER_OF_SLICE_CONSTRAINT_MODES))
     1762  {
     1763    fprintf(stderr, "Error: bad slice segment mode\n");
     1764    exit(EXIT_FAILURE);
     1765  }
     1766  m_sliceSegmentMode = SliceConstraint(tmpSliceSegmentMode);
     1767
     1768  if (tmpDecodedPictureHashSEIMappedType<0 || tmpDecodedPictureHashSEIMappedType>=Int(NUMBER_OF_HASHTYPES))
     1769  {
     1770    fprintf(stderr, "Error: bad checksum mode\n");
     1771    exit(EXIT_FAILURE);
     1772  }
     1773  // Need to map values to match those of the SEI message:
     1774  if (tmpDecodedPictureHashSEIMappedType==0)
     1775  {
     1776    m_decodedPictureHashSEIType=HASHTYPE_NONE;
     1777  }
     1778  else
     1779  {
     1780    m_decodedPictureHashSEIType=HashType(tmpDecodedPictureHashSEIMappedType-1);
     1781  }
     1782
    18041783  // allocate slice-based dQP values
    18051784#if NH_MV
     
    18281807  xResizeVector( m_auxId );
    18291808
    1830 #if NH_3D
     1809#if NH_3D_VSO
    18311810  xResizeVector( m_depthFlag );
    18321811#endif
     
    19231902
    19241903  // reading external dQP description from file
    1925   if ( m_pchdQPFile )
    1926   {
    1927     FILE* fpt=fopen( m_pchdQPFile, "r" );
     1904  if ( !m_dQPFileName.empty() )
     1905  {
     1906    FILE* fpt=fopen( m_dQPFileName.c_str(), "r" );
    19281907    if ( fpt )
    19291908    {
     
    19531932  }
    19541933
    1955 #if NH_MV_SEI
     1934#if NH_MV
    19561935  xParseSeiCfg();
    19571936#endif
     
    20372016  }
    20382017
    2039 #if NH_3D
     2018
    20402019#if NH_3D_VSO
    20412020  // Table base optimization
     
    20542033    for (Int layer = 0; layer < m_numberOfLayers; layer++ )
    20552034    {
    2056       if ( m_depthFlag[ layer ])
     2035      if ( m_depthFlag[ layer ]  || m_auxId[ layer ] == 2 )
    20572036      {
    20582037        firstDepthLayer = layer;
     
    20912070      LOG2_DISP_PREC_LUT );
    20922071  }
     2072#if NH_3D
    20932073  else
    20942074  {
     
    21042084      LOG2_DISP_PREC_LUT );
    21052085  }
    2106 #else
    2107   m_cCameraData     .init     ( ((UInt) m_iNumberOfViews ),
    2108     m_internalBitDepth[ CHANNEL_TYPE_LUMA],
    2109     (UInt) m_iCodedCamParPrecision,
    2110     m_FrameSkip,
    2111     (UInt) m_framesToBeEncoded,
    2112     m_pchCameraParameterFile,
    2113     m_pchBaseViewCameraNumbers,
    2114     NULL,
    2115     NULL,
    2116     LOG2_DISP_PREC_LUT );
    2117 #endif
    21182086  m_cCameraData.check( false, true );
     2087#endif
    21192088#endif
    21202089
     
    21452114Void TAppEncCfg::xCheckParameter()
    21462115{
    2147   if (!m_decodedPictureHashSEIEnabled)
     2116  if (m_decodedPictureHashSEIType==HASHTYPE_NONE)
    21482117  {
    21492118    fprintf(stderr, "******************************************************************\n");
     
    21732142#define xConfirmPara(a,b) check_failed |= confirmPara(a,b)
    21742143
    2175   xConfirmPara(m_pchBitstreamFile==NULL, "A bitstream file name must be specified (BitstreamFile)");
     2144  xConfirmPara(m_bitstreamFileName.empty(), "A bitstream file name must be specified (BitstreamFile)");
    21762145  const UInt maxBitDepth=(m_chromaFormatIDC==CHROMA_400) ? m_internalBitDepth[CHANNEL_TYPE_LUMA] : std::max(m_internalBitDepth[CHANNEL_TYPE_LUMA], m_internalBitDepth[CHANNEL_TYPE_CHROMA]);
    21772146  xConfirmPara(m_bitDepthConstraint<maxBitDepth, "The internalBitDepth must not be greater than the bitDepthConstraint value");
     
    23012270#endif
    23022271
    2303 #if NH_3D
     2272#if NH_3D_VSO
    23042273  if ( m_scalabilityMask & ( 1 << DEPTH_ID ) )
    23052274  {
     
    23972366    if (lsIdx == 0)
    23982367    {
    2399       xConfirmPara( m_layerIdsInSets[lsIdx].size() != 1 || m_layerIdsInSets[lsIdx][0] != 0 , "0-th layer shall only include layer 0. ");
    2400     }
    2401     for ( Int i = 0; i < m_layerIdsInSets[lsIdx].size(); i++ )
    2402     {
    2403       xConfirmPara( m_layerIdsInSets[lsIdx][i] < 0 || m_layerIdsInSets[lsIdx][i] >= MAX_NUM_LAYER_IDS, "LayerIdsInSet must be greater than 0 and less than MAX_NUM_LAYER_IDS" );
     2368      xConfirmPara( m_layerIdxInVpsInSets[lsIdx].size() != 1 || m_layerIdxInVpsInSets[lsIdx][0] != 0 , "0-th layer shall only include layer 0. ");
     2369    }
     2370    for ( Int i = 0; i < m_layerIdxInVpsInSets[lsIdx].size(); i++ )
     2371    {
     2372      xConfirmPara( m_layerIdxInVpsInSets[lsIdx][i] < 0 || m_layerIdxInVpsInSets[lsIdx][i] >= MAX_NUM_LAYER_IDS, "LayerIdsInSet must be greater than 0 and less than MAX_NUM_LAYER_IDS" );
    24042373    }
    24052374  }
     
    24342403      {
    24352404        Bool inLayerSetFlag = false;
    2436         for (Int j = 0; j < m_layerIdsInSets[ lsIdx].size(); j++ )
     2405        for (Int j = 0; j < m_layerIdxInVpsInSets[ lsIdx].size(); j++ )
    24372406        {
    2438           if ( m_layerIdsInSets[ lsIdx ][ j ] == m_layerIdsInDefOutputLayerSet[ lsIdx ][ i ] )
     2407          if ( m_layerIdxInVpsInSets[ lsIdx ][ j ] == m_layerIdsInDefOutputLayerSet[ lsIdx ][ i ] )
    24392408          {
    24402409            inLayerSetFlag = true;
     
    25442513  xConfirmPara( m_loopFilterBetaOffsetDiv2 < -6 || m_loopFilterBetaOffsetDiv2 > 6,        "Loop Filter Beta Offset div. 2 exceeds supported range (-6 to 6)");
    25452514  xConfirmPara( m_loopFilterTcOffsetDiv2 < -6 || m_loopFilterTcOffsetDiv2 > 6,            "Loop Filter Tc Offset div. 2 exceeds supported range (-6 to 6)");
    2546   xConfirmPara( m_iFastSearch < 0 || m_iFastSearch > 2,                                     "Fast Search Mode is not supported value (0:Full search  1:Diamond  2:PMVFAST)" );
    25472515  xConfirmPara( m_iSearchRange < 0 ,                                                        "Search Range must be more than 0" );
    2548   xConfirmPara( m_bipredSearchRange < 0 ,                                                   "Search Range must be more than 0" );
     2516  xConfirmPara( m_bipredSearchRange < 0 ,                                                   "Bi-prediction refinement search range must be more than 0" );
     2517  xConfirmPara( m_minSearchWindow < 0,                                                      "Minimum motion search window size for the adaptive window ME must be greater than or equal to 0" );
    25492518#if NH_MV
    25502519  xConfirmPara( m_iVerticalDisparitySearchRange <= 0 ,                                      "Vertical Disparity Search Range must be more than 0" );
     
    26242593  }
    26252594
    2626   xConfirmPara( m_sliceMode < 0 || m_sliceMode > 3, "SliceMode exceeds supported range (0 to 3)" );
    2627   if (m_sliceMode!=0)
     2595  if (m_sliceMode!=NO_SLICES)
    26282596  {
    26292597    xConfirmPara( m_sliceArgument < 1 ,         "SliceArgument should be larger than or equal to 1" );
    26302598  }
    2631   xConfirmPara( m_sliceSegmentMode < 0 || m_sliceSegmentMode > 3, "SliceSegmentMode exceeds supported range (0 to 3)" );
    2632   if (m_sliceSegmentMode!=0)
     2599  if (m_sliceSegmentMode!=NO_SLICES)
    26332600  {
    26342601    xConfirmPara( m_sliceSegmentArgument < 1 ,         "SliceSegmentArgument should be larger than or equal to 1" );
     
    26382605  if (m_profile!=Profile::HIGHTHROUGHPUTREXT)
    26392606  {
    2640     xConfirmPara( tileFlag && m_iWaveFrontSynchro,            "Tile and Wavefront can not be applied together, except in the High Throughput Intra 4:4:4 16 profile");
     2607    xConfirmPara( tileFlag && m_entropyCodingSyncEnabledFlag, "Tiles and entropy-coding-sync (Wavefronts) can not be applied together, except in the High Throughput Intra 4:4:4 16 profile");
    26412608  }
    26422609
     
    26622629  }
    26632630
    2664 #if NH_3D
     2631#if NH_3D_VSO
    26652632  xConfirmPara( m_pchCameraParameterFile    == 0                ,   "CameraParameterFile must be given");
    26662633  xConfirmPara( m_pchBaseViewCameraNumbers  == 0                ,   "BaseViewCameraNumbers must be given" );
    26672634  xConfirmPara( m_iNumberOfViews != m_cCameraData.getBaseViewNumbers().size() ,   "Number of Views in BaseViewCameraNumbers must be equal to NumberOfViews" );
    26682635  xConfirmPara    ( m_iCodedCamParPrecision < 0 || m_iCodedCamParPrecision > 5,       "CodedCamParsPrecision must be in range of 0..5" );
    2669 #if NH_3D_VSO
    26702636    if( m_bUseVSO )
    26712637    {
     
    26732639      xConfirmPara( m_uiVSOMode > 4 ,                                                "VSO Mode must be less than 5");
    26742640    }
    2675 #endif
    26762641#endif
    26772642  // max CU width and height should be power of 2
     
    32373202      m_minSpatialSegmentationIdc = 4*PicSizeInSamplesY/maxSizeInSamplesY-4;
    32383203    }
    3239     else if(m_iWaveFrontSynchro)
     3204    else if(m_entropyCodingSyncEnabledFlag)
    32403205    {
    32413206      m_minSpatialSegmentationIdc = 4*PicSizeInSamplesY/((2*m_iSourceHeight+m_iSourceWidth)*m_uiMaxCUHeight)-4;
     
    32503215    }
    32513216  }
    3252 
    3253   xConfirmPara( m_iWaveFrontSynchro < 0, "WaveFrontSynchro cannot be negative" );
    3254 
    3255   xConfirmPara( m_decodedPictureHashSEIEnabled<0 || m_decodedPictureHashSEIEnabled>3, "this hash type is not correct!\n");
    32563217
    32573218  if (m_toneMappingInfoSEIEnabled)
     
    32823243  }
    32833244
     3245  if (m_chromaResamplingFilterSEIenabled)
     3246  {
     3247    xConfirmPara( (m_chromaFormatIDC == CHROMA_400 ), "chromaResamplingFilterSEI is not allowed to be present when ChromaFormatIDC is equal to zero (4:0:0)" );
     3248    xConfirmPara(m_vuiParametersPresentFlag && m_chromaLocInfoPresentFlag && (m_chromaSampleLocTypeTopField != m_chromaSampleLocTypeBottomField ), "When chromaResamplingFilterSEI is enabled, ChromaSampleLocTypeTopField has to be equal to ChromaSampleLocTypeBottomField" );
     3249  }
     3250
    32843251  if ( m_RCEnableRateControl )
    32853252  {
     
    32933260    }
    32943261    xConfirmPara( m_uiDeltaQpRD > 0, "Rate control cannot be used together with slice level multiple-QP optimization!\n" );
    3295   }
     3262#if U0132_TARGET_BITS_SATURATION
     3263#if NH_MV
     3264    if ((m_RCCpbSaturationEnabled) && (m_level[0]!=Level::NONE) && (m_profile!=Profile::NONE))
     3265    {
     3266      UInt uiLevelIdx = (m_level[0] / 10) + (UInt)((m_level[0] % 10) / 3);    // (m_level / 30)*3 + ((m_level % 10) / 3);
     3267      xConfirmPara(m_RCCpbSize > g_uiMaxCpbSize[m_levelTier[0]][uiLevelIdx], "RCCpbSize should be smaller than or equal to Max CPB size according to tier and level");
     3268      xConfirmPara(m_RCInitialCpbFullness > 1, "RCInitialCpbFullness should be smaller than or equal to 1");
     3269    }
     3270#else
     3271    if ((m_RCCpbSaturationEnabled) && (m_level!=Level::NONE) && (m_profile!=Profile::NONE))
     3272    {
     3273      UInt uiLevelIdx = (m_level / 10) + (UInt)((m_level % 10) / 3);    // (m_level / 30)*3 + ((m_level % 10) / 3);
     3274      xConfirmPara(m_RCCpbSize > g_uiMaxCpbSize[m_levelTier][uiLevelIdx], "RCCpbSize should be smaller than or equal to Max CPB size according to tier and level");
     3275      xConfirmPara(m_RCInitialCpbFullness > 1, "RCInitialCpbFullness should be smaller than or equal to 1");
     3276    }
     3277#endif
     3278#endif
     3279  }
     3280#if U0132_TARGET_BITS_SATURATION
     3281  else
     3282  {
     3283    xConfirmPara( m_RCCpbSaturationEnabled != 0, "Target bits saturation cannot be processed without Rate control" );
     3284  }
     3285#endif
     3286
    32963287#if NH_MV
    32973288  // VPS VUI
     
    33283319  }
    33293320  }
    3330 #if !NH_MV_SEI
    3331   // Check input parameters for Sub-bitstream property SEI message
    3332   if( m_subBistreamPropSEIEnabled )
    3333   {
    3334     xConfirmPara(
    3335       (this->m_sbPropNumAdditionalSubStreams != m_sbPropAvgBitRate.size() )
    3336       || (this->m_sbPropNumAdditionalSubStreams != m_sbPropHighestSublayerId.size() )
    3337       || (this->m_sbPropNumAdditionalSubStreams != m_sbPropMaxBitRate.size() )
    3338       || (this->m_sbPropNumAdditionalSubStreams != m_sbPropOutputLayerSetIdxToVps.size() )
    3339       || (this->m_sbPropNumAdditionalSubStreams != m_sbPropSubBitstreamMode.size()), "Some parameters of some sub-bitstream not defined");
    3340 
    3341     for( Int i = 0; i < m_sbPropNumAdditionalSubStreams; i++ )
    3342     {
    3343       xConfirmPara( m_sbPropSubBitstreamMode[i] < 0 || m_sbPropSubBitstreamMode[i] > 1, "Mode value should be 0 or 1" );
    3344       xConfirmPara( m_sbPropHighestSublayerId[i] < 0 || m_sbPropHighestSublayerId[i] > MAX_TLAYER-1, "Maximum sub-layer ID out of range" );
    3345       xConfirmPara( m_sbPropOutputLayerSetIdxToVps[i] < 0 || m_sbPropOutputLayerSetIdxToVps[i] >= MAX_VPS_OUTPUTLAYER_SETS, "OutputLayerSetIdxToVps should be within allowed range" );
    3346     }
    3347   }
    3348 #endif
    33493321#endif
    33503322
    33513323  if (m_segmentedRectFramePackingSEIEnabled)
    33523324  {
    3353     xConfirmPara(m_framePackingSEIEnabled > 0 , "SEISegmentedRectFramePacking must be 0 when SEIFramePacking is 1");
     3325    xConfirmPara(m_framePackingSEIEnabled , "SEISegmentedRectFramePacking must be 0 when SEIFramePacking is 1");
    33543326  }
    33553327
     
    33723344}
    33733345
    3374 const Char *profileToString(const Profile::Name profile)
     3346const TChar *profileToString(const Profile::Name profile)
    33753347{
    33763348  static const UInt numberOfProfiles = sizeof(strToProfile)/sizeof(*strToProfile);
     
    34003372  }
    34013373#else
    3402   printf("Input          File               : %s\n", m_pchInputFile          );
    3403 #endif
    3404   printf("Bitstream      File               : %s\n", m_pchBitstreamFile      );
     3374  printf("Input          File                    : %s\n", m_inputFileName.c_str()          );
     3375#endif
     3376  printf("Bitstream      File                    : %s\n", m_bitstreamFileName.c_str()      );
    34053377#if NH_MV
    34063378  for( Int layer = 0; layer < m_numberOfLayers; layer++)
     
    34093381  }
    34103382#else
    3411   printf("Reconstruction File               : %s\n", m_pchReconFile          );
     3383  printf("Reconstruction File                    : %s\n", m_reconFileName.c_str()          );
    34123384#endif
    34133385#if NH_MV
     
    34213393  xPrintParaVector( "AuxId", m_auxId );
    34223394#endif
    3423 #if NH_3D
     3395#if NH_3D_VSO
    34243396  xPrintParaVector( "DepthLayerFlag", m_depthFlag );
    34253397  printf("Coded Camera Param. Precision     : %d\n", m_iCodedCamParPrecision); 
     
    35813553
    35823554  printf("RateControl                       : %d\n", m_RCEnableRateControl );
     3555  printf("WPMethod                               : %d\n", Int(m_weightedPredictionMethod));
    35833556
    35843557  if(m_RCEnableRateControl)
     
    35913564    printf("ForceIntraQP                      : %d\n", m_RCForceIntraQP );
    35923565
     3566#if U0132_TARGET_BITS_SATURATION
     3567    printf("CpbSaturation                          : %d\n", m_RCCpbSaturationEnabled );
     3568    if (m_RCCpbSaturationEnabled)
     3569    {
     3570      printf("CpbSize                                : %d\n", m_RCCpbSize);
     3571      printf("InitalCpbFullness                      : %.2f\n", m_RCInitialCpbFullness);
     3572    }
     3573#endif
     3574
    35933575#if KWU_RC_MADPRED_E0227
    35943576    printf("Depth based MAD prediction   : %d\n", m_depthMADPred);
     
    36133595
    36143596  printf("Max Num Merge Candidates          : %d\n", m_maxNumMergeCand);
    3615 #if NH_3D
     3597#if NH_3D_VSO
    36163598  printf("BaseViewCameraNumbers             : %s\n", m_pchBaseViewCameraNumbers );
    36173599  printf("Coded Camera Param. Precision     : %d\n", m_iCodedCamParPrecision);
    3618 #if NH_3D_VSO
    36193600  printf("Force use of Lambda Scale         : %d\n", m_bForceLambdaScaleVSO );
    36203601
     
    36343615  }
    36353616#endif //HHI_VSO
    3636 #endif //NH_3D
    36373617  printf("\n");
    36383618#if NH_MV
     
    36483628  printf("SQP:%d ", m_uiDeltaQpRD         );
    36493629  printf("ASR:%d ", m_bUseASR             );
    3650   printf("FEN:%d ", m_bUseFastEnc         );
     3630  printf("MinSearchWindow:%d ", m_minSearchWindow        );
     3631  printf("RestrictMESampling:%d ", m_bRestrictMESampling );
     3632  printf("FEN:%d ", Int(m_fastInterSearchMode)           );
    36513633  printf("ECU:%d ", m_bUseEarlyCU         );
    36523634  printf("FDM:%d ", m_useFastDecisionForMerge );
     
    36573639  printf("TransformSkipFast:%d ", m_useTransformSkipFast       );
    36583640  printf("TransformSkipLog2MaxSize:%d ", m_log2MaxTransformSkipBlockSize);
    3659   printf("Slice: M=%d ", m_sliceMode);
     3641  printf("Slice: M=%d ", Int(m_sliceMode));
    36603642  if (m_sliceMode!=NO_SLICES)
    36613643  {
     
    36853667  printf("WPB:%d ", (Int)m_useWeightedBiPred);
    36863668  printf("PME:%d ", m_log2ParallelMergeLevel);
    3687   const Int iWaveFrontSubstreams = m_iWaveFrontSynchro ? (m_iSourceHeight + m_uiMaxCUHeight - 1) / m_uiMaxCUHeight : 1;
    3688   printf(" WaveFrontSynchro:%d WaveFrontSubstreams:%d",
    3689           m_iWaveFrontSynchro, iWaveFrontSubstreams);
     3669  const Int iWaveFrontSubstreams = m_entropyCodingSyncEnabledFlag ? (m_iSourceHeight + m_uiMaxCUHeight - 1) / m_uiMaxCUHeight : 1;
     3670  printf(" WaveFrontSynchro:%d WaveFrontSubstreams:%d", m_entropyCodingSyncEnabledFlag?1:0, iWaveFrontSubstreams);
    36903671  printf(" ScalingList:%d ", m_useScalingListId );
    36913672  printf("TMVPMode:%d ", m_TMVPModeId     );
     
    37003681  printf("WVSO:%d ", m_bUseWVSO ); 
    37013682#endif
     3683#if NH_3D_QTL
     3684  printf( "QTL:%d "                  , m_bUseQTL);
     3685#endif
    37023686#if NH_3D
    3703   printf( "QTL:%d "                  , m_bUseQTL);
    37043687  printf( "IlluCompEnable:%d "       , m_abUseIC);
    37053688  printf( "IlluCompLowLatencyEnc:%d ",  m_bUseLowLatencyICEnc);
     
    37303713}
    37313714
    3732 Bool confirmPara(Bool bflag, const Char* message)
     3715Bool confirmPara(Bool bflag, const TChar* message)
    37333716{
    37343717  if (!bflag)
  • trunk/source/App/TAppEncoder/TAppEncCfg.h

    r1356 r1386  
    6262  // file I/O
    6363#if NH_MV
    64   std::vector<char*>     m_pchInputFileList;                  ///< source file names
    65 #else
    66   Char*     m_pchInputFile;                                   ///< source file name
    67 #endif
    68   Char*     m_pchBitstreamFile;                               ///< output bitstream file
     64  std::vector<TChar*>     m_pchInputFileList;                  ///< source file names
     65#else
     66  std::string m_inputFileName;                                ///< source file name
     67#endif
     68  std::string m_bitstreamFileName;                            ///< output bitstream file
    6969#if NH_MV
    7070  std::vector<char*>     m_pchReconFileList;                  ///< output reconstruction file names
     
    7272  Int                    m_iNumberOfViews;                    ///< number of Layers that are views
    7373#else
    74   Char*     m_pchReconFile;                                   ///< output reconstruction file
     74  std::string m_reconFileName;                                ///< output reconstruction file
    7575#endif
    7676  #if NH_MV
     
    8080  IntAry1d               m_viewOrderIndex;                    ///< view order index 
    8181  IntAry1d               m_auxId;                             ///< auxiliary id
    82 #if NH_3D
     82#if NH_3D_VSO
    8383  IntAry1d               m_depthFlag;                         ///< depth flag
    8484#endif
     
    9191// layer sets   
    9292  Int                    m_vpsNumLayerSets;                   ///< Number of layer sets
    93   IntAry2d m_layerIdsInSets;           ///< LayerIds in vps of layer set
     93  IntAry2d m_layerIdxInVpsInSets;           ///< LayerIds in vps of layer set
    9494  Int                    m_numAddLayerSets;                    ///< Number of additional layer sets
    9595  IntAry2d m_highestLayerIdxPlus1;      ///< HighestLayerIdxPlus1 for each additional layer set and each independent layer (value with index 0 will be ignored)
     
    112112  Bool m_bitRatePresentVpsFlag;
    113113  Bool m_picRatePresentVpsFlag;
    114   BoolAry2d              m_bitRatePresentFlag;
    115   BoolAry2d              m_picRatePresentFlag;
    116   IntAry2d               m_avgBitRate;
    117   IntAry2d               m_maxBitRate;
    118   IntAry2d               m_constantPicRateIdc;
    119   IntAry2d               m_avgPicRate;
    120   Bool                              m_tilesNotInUseFlag;
    121   BoolAry1d               m_tilesInUseFlag;
    122   BoolAry1d               m_loopFilterNotAcrossTilesFlag;
    123   Bool                              m_wppNotInUseFlag;
    124   BoolAry1d               m_wppInUseFlag;
    125 
    126   BoolAry2d              m_tileBoundariesAlignedFlag; 
    127   Bool m_ilpRestrictedRefLayersFlag;
    128   IntAry2d               m_minSpatialSegmentOffsetPlus1;
    129   BoolAry2d              m_ctuBasedOffsetEnabledFlag;
    130   IntAry2d               m_minHorizontalCtuOffsetPlus1;
    131   Bool m_singleLayerForNonIrapFlag;
    132   Bool m_higherLayerIrapSkipFlag;
    133 
    134 
     114  BoolAry2d m_bitRatePresentFlag;
     115  BoolAry2d m_picRatePresentFlag;
     116  IntAry2d  m_avgBitRate;
     117  IntAry2d  m_maxBitRate;
     118  IntAry2d  m_constantPicRateIdc;
     119  IntAry2d  m_avgPicRate;
     120  Bool      m_tilesNotInUseFlag;
     121  BoolAry1d m_tilesInUseFlag;
     122  BoolAry1d m_loopFilterNotAcrossTilesFlag;
     123  Bool      m_wppNotInUseFlag;
     124  BoolAry1d m_wppInUseFlag;
     125
     126  BoolAry2d m_tileBoundariesAlignedFlag; 
     127  Bool      m_ilpRestrictedRefLayersFlag;
     128  IntAry2d  m_minSpatialSegmentOffsetPlus1;
     129  BoolAry2d m_ctuBasedOffsetEnabledFlag;
     130  IntAry2d  m_minHorizontalCtuOffsetPlus1;
     131  Bool      m_singleLayerForNonIrapFlag;
     132  Bool      m_higherLayerIrapSkipFlag;
    135133#if NH_3D
    136134  Bool      m_abUseIC;
    137135  Bool      m_bUseLowLatencyICEnc;
    138136#endif
    139 
    140 #endif
     137#endif
     138  // Lambda modifiers
    141139  Double    m_adLambdaModifier[ MAX_TLAYER ];                 ///< Lambda modifier array for each temporal layer
     140  std::vector<Double> m_adIntraLambdaModifier;                ///< Lambda modifier for Intra pictures, one for each temporal layer. If size>temporalLayer, then use [temporalLayer], else if size>0, use [size()-1], else use m_adLambdaModifier.
     141  Double    m_dIntraQpFactor;                                 ///< Intra Q Factor. If negative, use a default equation: 0.57*(1.0 - Clip3( 0.0, 0.5, 0.05*(Double)(isField ? (GopSize-1)/2 : GopSize-1) ))
     142
    142143  // source specification
    143144  Int       m_iFrameRate;                                     ///< source frame-rates (Hz)
     
    160161  Int       m_framesToBeEncoded;                              ///< number of encoded frames
    161162  Int       m_aiPad[2];                                       ///< number of padded pixels for width and height
     163  Bool      m_AccessUnitDelimiter;                            ///< add Access Unit Delimiter NAL units
    162164  InputColourSpaceConversion m_inputColourSpaceConvert;       ///< colour space conversion to apply to input video
    163165  Bool      m_snrInternalColourSpace;                       ///< if true, then no colour space conversion is applied for snr calculation, otherwise inverse of input is applied.
     
    237239  Int       m_iQP;                                            ///< QP value of key-picture (integer)
    238240#endif
    239   Char*     m_pchdQPFile;                                     ///< QP offset for each slice (initialized from external file)
     241  std::string m_dQPFileName;                                  ///< QP offset for each slice (initialized from external file)
    240242#if NH_MV
    241243  std::vector<Int*> m_aidQP;                                    ///< array of slice QP values for each layer
     
    256258#endif
    257259  TComSEIMasteringDisplay m_masteringDisplay;
    258 #if NH_MV_SEI
     260#if NH_MV
    259261  std::vector<char*>     m_seiCfgFileNames;               ///< SEI message files.
    260262  SEIMessages            m_seiMessages;                       ///< Buffer for SEI messages.
     
    338340  Int       m_rdPenalty;                                      ///< RD-penalty for 32x32 TU for intra in non-intra slices (0: no RD-penalty, 1: RD-penalty, 2: maximum RD-penalty)
    339341  Bool      m_bDisableIntraPUsInInterSlices;                  ///< Flag for disabling intra predicted PUs in inter slices.
    340   Int       m_iFastSearch;                                    ///< ME mode, 0 = full, 1 = diamond, 2 = PMVFAST
     342  MESearchMethod m_motionEstimationSearchMethod;
     343  Bool      m_bRestrictMESampling;                            ///< Restrict sampling for the Selective ME
    341344  Int       m_iSearchRange;                                   ///< ME search range
    342345  Int       m_bipredSearchRange;                              ///< ME search range for bipred refinement
     346  Int       m_minSearchWindow;                                ///< ME minimum search window size for the Adaptive Window ME
    343347  Bool      m_bClipForBiPredMeEnabled;                        ///< Enables clipping for Bi-Pred ME.
    344348  Bool      m_bFastMEAssumingSmootherMVEnabled;               ///< Enables fast ME assuming a smoother MV.
     
    347351  Int       m_iVerticalDisparitySearchRange;                  ///< ME vertical search range for inter-view prediction
    348352#endif
    349   Bool      m_bUseFastEnc;                                    ///< flag for using fast encoder setting
     353  FastInterSearchMode m_fastInterSearchMode;                  ///< Parameter that controls fast encoder settings
    350354  Bool      m_bUseEarlyCU;                                    ///< flag for using Early CU setting
    351355  Bool      m_useFastDecisionForMerge;                        ///< flag for using Fast Decision Merge RD-Cost
    352356  Bool      m_bUseCbfFastMode;                              ///< flag for using Cbf Fast PU Mode Decision
    353357  Bool      m_useEarlySkipDetection;                         ///< flag for using Early SKIP Detection
    354   Int       m_sliceMode;                                     ///< 0: no slice limits, 1 : max number of CTBs per slice, 2: max number of bytes per slice,
    355                                                              ///< 3: max number of tiles per slice
     358  SliceConstraint m_sliceMode;
    356359  Int       m_sliceArgument;                                 ///< argument according to selected slice mode
    357   Int       m_sliceSegmentMode;                              ///< 0: no slice segment limits, 1 : max number of CTBs per slice segment, 2: max number of bytes per slice segment,
    358                                                              ///< 3: max number of tiles per slice segment
     360  SliceConstraint m_sliceSegmentMode;
    359361  Int       m_sliceSegmentArgument;                          ///< argument according to selected slice segment mode
    360362
     
    366368  std::vector<Int> m_tileColumnWidth;
    367369  std::vector<Int> m_tileRowHeight;
    368   Int       m_iWaveFrontSynchro; //< 0: no WPP. >= 1: WPP is enabled, the "Top right" from which inheritance occurs is this LCU offset in the line above the current.
    369   Int       m_iWaveFrontFlush; //< enable(1)/disable(0) the CABAC flush at the end of each line of LCUs.
     370  Bool      m_entropyCodingSyncEnabledFlag;
    370371
    371372  Bool      m_bUseConstrainedIntraPred;                       ///< flag for using constrained intra prediction
     
    374375  Bool      m_bUseBLambdaForNonKeyLowDelayPictures;
    375376
    376   Int       m_decodedPictureHashSEIEnabled;                    ///< Checksum(3)/CRC(2)/MD5(1)/disable(0) acting on decoded picture hash SEI message
    377   Int       m_recoveryPointSEIEnabled;
    378   Int       m_bufferingPeriodSEIEnabled;
    379   Int       m_pictureTimingSEIEnabled;
     377  HashType  m_decodedPictureHashSEIType;                      ///< Checksum mode for decoded picture hash SEI message
     378  Bool      m_recoveryPointSEIEnabled;
     379  Bool      m_bufferingPeriodSEIEnabled;
     380  Bool      m_pictureTimingSEIEnabled;
    380381  Bool      m_toneMappingInfoSEIEnabled;
    381   Bool      m_chromaSamplingFilterSEIenabled;
    382   Int       m_chromaSamplingHorFilterIdc;
    383   Int       m_chromaSamplingVerFilterIdc;
     382  Bool      m_chromaResamplingFilterSEIenabled;
     383  Int       m_chromaResamplingHorFilterIdc;
     384  Int       m_chromaResamplingVerFilterIdc;
    384385  Int       m_toneMapId;
    385386  Bool      m_toneMapCancelFlag;
     
    408409  Int*      m_codedPivotValue;
    409410  Int*      m_targetPivotValue;
    410   Int       m_framePackingSEIEnabled;
     411  Bool      m_framePackingSEIEnabled;
    411412  Int       m_framePackingSEIType;
    412413  Int       m_framePackingSEIId;
    413414  Int       m_framePackingSEIQuincunx;
    414415  Int       m_framePackingSEIInterpretation;
    415   Int       m_segmentedRectFramePackingSEIEnabled;
     416  Bool      m_segmentedRectFramePackingSEIEnabled;
    416417  Bool      m_segmentedRectFramePackingSEICancel;
    417418  Int       m_segmentedRectFramePackingSEIType;
    418419  Bool      m_segmentedRectFramePackingSEIPersistence;
    419420  Int       m_displayOrientationSEIAngle;
    420   Int       m_temporalLevel0IndexSEIEnabled;
    421   Int       m_gradualDecodingRefreshInfoEnabled;
     421  Bool      m_temporalLevel0IndexSEIEnabled;
     422  Bool      m_gradualDecodingRefreshInfoEnabled;
    422423  Int       m_noDisplaySEITLayer;
    423   Int       m_decodingUnitInfoSEIEnabled;
    424   Int       m_SOPDescriptionSEIEnabled;
    425   Int       m_scalableNestingSEIEnabled;
     424  Bool      m_decodingUnitInfoSEIEnabled;
     425  Bool      m_SOPDescriptionSEIEnabled;
     426  Bool      m_scalableNestingSEIEnabled;
    426427  Bool      m_tmctsSEIEnabled;
    427428  Bool      m_timeCodeSEIEnabled;
     
    442443  Bool      m_useWeightedPred;                    ///< Use of weighted prediction in P slices
    443444  Bool      m_useWeightedBiPred;                  ///< Use of bi-directional weighted prediction in B slices
     445  WeightedPredictionMethod m_weightedPredictionMethod;
    444446
    445447  UInt      m_log2ParallelMergeLevel;                         ///< Parallel merge estimation region
     
    455457  Int       m_RCInitialQP;                        ///< inital QP for rate control
    456458  Bool      m_RCForceIntraQP;                     ///< force all intra picture to use initial QP or not
    457  
     459
     460#if U0132_TARGET_BITS_SATURATION
     461  Bool      m_RCCpbSaturationEnabled;             ///< enable target bits saturation to avoid CPB overflow and underflow
     462  UInt      m_RCCpbSize;                          ///< CPB size
     463  Double    m_RCInitialCpbFullness;               ///< initial CPB fullness
     464#endif
     465
    458466#if KWU_RC_VIEWRC_E0227
    459467  vector<Int>     m_viewTargetBits;
     
    464472#endif
    465473
    466 ScalingListMode m_useScalingListId;                         ///< using quantization matrix
    467   Char*     m_scalingListFile;                                ///< quantization matrix file name
     474  ScalingListMode m_useScalingListId;                         ///< using quantization matrix
     475  std::string m_scalingListFileName;                          ///< quantization matrix file name
    468476
    469477  Bool      m_TransquantBypassEnableFlag;                     ///< transquant_bypass_enable_flag setting in PPS.
     
    509517  Int       m_log2MaxMvLengthHorizontal;                      ///< Indicate the maximum absolute value of a decoded horizontal MV component in quarter-pel luma units
    510518  Int       m_log2MaxMvLengthVertical;                        ///< Indicate the maximum absolute value of a decoded vertical MV component in quarter-pel luma units
     519  std::string m_colourRemapSEIFileRoot;
     520
    511521  std::string m_summaryOutFilename;                           ///< filename to use for producing summary output file.
    512522  std::string m_summaryPicFilenameBase;                       ///< Base filename to use for producing summary picture output files. The actual filenames used will have I.txt, P.txt and B.txt appended.
    513523  UInt        m_summaryVerboseness;                           ///< Specifies the level of the verboseness of the text output.
    514524#if NH_MV
    515 #if !NH_MV_SEI
    516   Bool              m_subBistreamPropSEIEnabled;
    517   Int               m_sbPropNumAdditionalSubStreams;
    518   IntAry1d          m_sbPropSubBitstreamMode;
    519   IntAry1d          m_sbPropOutputLayerSetIdxToVps;
    520   IntAry1d          m_sbPropHighestSublayerId;
    521   IntAry1d          m_sbPropAvgBitRate;
    522   IntAry1d          m_sbPropMaxBitRate;
    523 #endif
    524525  Bool              m_outputVpsInfo;
    525 #endif
     526  TChar*            m_pchBaseViewCameraNumbers;
     527#endif
     528
    526529#if NH_3D
    527530  // Output Format
    528531  Bool      m_depth420OutputFlag;                             ///< Output depth layers in 4:2:0 format
    529   // Camera parameters
    530   Char*     m_pchCameraParameterFile;                         ///< camera parameter file
    531   Char*     m_pchBaseViewCameraNumbers;
     532#endif
     533    // Camera parameters
     534#if NH_3D_VSO
     535  TChar*    m_pchCameraParameterFile;                         ///< camera parameter file
    532536  TAppComCamPara m_cCameraData;
    533537  Int       m_iCodedCamParPrecision;                          ///< precision for coding of camera parameters
    534 #if NH_3D_VSO
    535   Char*     m_pchVSOConfig;
     538  TChar*    m_pchVSOConfig;
    536539  Bool      m_bUseVSO;                                        ///< flag for using View Synthesis Optimization
    537540  Bool      m_bVSOLSTable;                                    ///< Depth QP dependent Lagrange parameter optimization (m23714)
     
    556559  TRenModSetupStrParser       m_cRenModStrParser;
    557560#endif
    558 
     561#if NH_3D
    559562  Bool       m_useDLT;                                        ///< flag for using DLT
     563#endif
     564#if NH_3D_QTL
    560565  Bool       m_bUseQTL;                                        ///< flag for using depth QuadTree Limitation
     566#endif
     567#if NH_3D
    561568  BoolAry1d  m_ivMvPredFlag;
    562569  BoolAry1d  m_ivMvScalingFlag;
     
    660667  Void xPrintVectorElem( Double elem ) { printf(" %5.2f", elem            );}; 
    661668  Void xPrintVectorElem( Bool   elem ) { printf(" %d"   , ( elem ? 1 : 0 ));};
    662 #if NH_MV_SEI
    663669  Void xParseSeiCfg();
    664 #endif
    665 #endif
    666 #if NH_MV
     670
    667671  Int   getGOPSize() { return m_iGOPSize; }
    668672#endif
     
    674678  Void  create    ();                                         ///< create option handling class
    675679  Void  destroy   ();                                         ///< destroy option handling class
    676   Bool  parseCfg  ( Int argc, Char* argv[] );                 ///< parse configuration file to fill member variables
     680  Bool  parseCfg  ( Int argc, TChar* argv[] );                ///< parse configuration file to fill member variables
    677681
    678682};// END CLASS DEFINITION TAppEncCfg
  • trunk/source/App/TAppEncoder/TAppEncTop.cpp

    r1356 r1386  
    147147#if NH_3D
    148148  xSetCamPara              ( vps );
     149#endif
     150#if NH_3D_VSO
    149151  m_ivPicLists.setVPS      ( &vps );
    150152#endif
     
    186188  for (Int d = 0; d < 2; d++)
    187189  { 
    188     m_sps3dExtension.setIvMvPredFlag          ( d, m_ivMvPredFlag[d]       );
    189     m_sps3dExtension.setIvMvScalingFlag       ( d, m_ivMvScalingFlag[d]    );
     190    m_sps3dExtension.setIvDiMcEnabledFlag          ( d, m_ivMvPredFlag[d]       );
     191    m_sps3dExtension.setIvMvScalEnabledFlag       ( d, m_ivMvScalingFlag[d]    );
    190192    if (d == 0 )
    191193    {   
    192       m_sps3dExtension.setLog2SubPbSizeMinus3   ( d, m_log2SubPbSizeMinus3   );
    193       m_sps3dExtension.setIvResPredFlag         ( d, m_ivResPredFlag         );
    194       m_sps3dExtension.setDepthRefinementFlag   ( d, m_depthRefinementFlag   );
    195       m_sps3dExtension.setViewSynthesisPredFlag ( d, m_viewSynthesisPredFlag );
    196       m_sps3dExtension.setDepthBasedBlkPartFlag ( d, m_depthBasedBlkPartFlag );
     194      m_sps3dExtension.setLog2IvmcSubPbSizeMinus3   ( d, m_log2SubPbSizeMinus3   );
     195      m_sps3dExtension.setIvResPredEnabledFlag         ( d, m_ivResPredFlag         );
     196      m_sps3dExtension.setDepthRefEnabledFlag   ( d, m_depthRefinementFlag   );
     197      m_sps3dExtension.setVspMcEnabledFlag ( d, m_viewSynthesisPredFlag );
     198      m_sps3dExtension.setDbbpEnabledFlag ( d, m_depthBasedBlkPartFlag );
    197199    }
    198200    else
    199201    {   
    200       m_sps3dExtension.setMpiFlag               ( d, m_mpiFlag               );
    201       m_sps3dExtension.setLog2MpiSubPbSizeMinus3( d, m_log2MpiSubPbSizeMinus3);
    202       m_sps3dExtension.setIntraContourFlag      ( d, m_intraContourFlag      );
    203       m_sps3dExtension.setIntraSdcWedgeFlag     ( d, m_intraSdcFlag || m_intraWedgeFlag     );
    204       m_sps3dExtension.setQtPredFlag            ( d, m_qtPredFlag            );
    205       m_sps3dExtension.setInterSdcFlag          ( d, m_interSdcFlag          );
    206       m_sps3dExtension.setDepthIntraSkipFlag    ( d, m_depthIntraSkipFlag    ); 
     202      m_sps3dExtension.setTexMcEnabledFlag               ( d, m_mpiFlag               );
     203      m_sps3dExtension.setLog2TexmcSubPbSizeMinus3( d, m_log2MpiSubPbSizeMinus3);
     204      m_sps3dExtension.setIntraContourEnabledFlag      ( d, m_intraContourFlag      );
     205      m_sps3dExtension.setIntraDcOnlyWedgeEnabledFlag     ( d, m_intraSdcFlag || m_intraWedgeFlag     );
     206      m_sps3dExtension.setCqtCuPartPredEnabledFlag            ( d, m_qtPredFlag            );
     207      m_sps3dExtension.setInterDcOnlyEnabledFlag          ( d, m_interSdcFlag          );
     208      m_sps3dExtension.setSkipIntraEnabledFlag    ( d, m_depthIntraSkipFlag    ); 
    207209    }
    208210  }
     
    276278    m_cTEncTop.setViewId                       ( vps.getViewId      (  layerId ) );
    277279    m_cTEncTop.setViewIndex                    ( vps.getViewIndex   (  layerId ) );
    278 #if NH_3D
    279     Bool isDepth = ( vps.getDepthId     ( layerId ) != 0 ) ;
    280     m_cTEncTop.setIsDepth                      ( isDepth );
     280#if NH_3D_VSO
     281    Bool isDepth    = ( vps.getDepthId     ( layerId ) != 0  ) ;
     282    Bool isAuxDepth = ( vps.getAuxId       ( layerId ) ==  2 ) ; // TBD: define 2 as AUX_DEPTH
     283    m_cTEncTop.setIsDepth                  ( isDepth    );
     284    m_cTEncTop.setIsAuxDepth               ( isAuxDepth );
    281285    //====== Camera Parameters =========
    282286    m_cTEncTop.setCameraParameters             ( &m_cCameraData );     
    283 #if NH_3D_VSO
    284287    //====== VSO =========
    285288    m_cTEncTop.setRenderModelParameters        ( &m_cRenModStrParser );
    286     m_cTEncTop.setForceLambdaScaleVSO          ( isDepth ? m_bForceLambdaScaleVSO : false );
    287     m_cTEncTop.setLambdaScaleVSO               ( isDepth ? m_dLambdaScaleVSO      : 1     );
    288     m_cTEncTop.setVSOMode                      ( isDepth ? m_uiVSOMode            : 0     );
    289 
    290     m_cTEncTop.setAllowNegDist                 ( isDepth ? m_bAllowNegDist        : false );
     289    m_cTEncTop.setForceLambdaScaleVSO          ( isDepth || isAuxDepth ? m_bForceLambdaScaleVSO : false );
     290    m_cTEncTop.setLambdaScaleVSO               ( isDepth || isAuxDepth ? m_dLambdaScaleVSO      : 1     );
     291    m_cTEncTop.setVSOMode                      ( isDepth || isAuxDepth ? m_uiVSOMode            : 0     );
     292
     293    m_cTEncTop.setAllowNegDist                 ( isDepth || isAuxDepth ? m_bAllowNegDist        : false );
    291294
    292295    // SAIT_VSO_EST_A0033
    293     m_cTEncTop.setUseEstimatedVSD              ( isDepth ? m_bUseEstimatedVSD     : false );
     296    m_cTEncTop.setUseEstimatedVSD              ( isDepth || isAuxDepth ? m_bUseEstimatedVSD     : false );
    294297
    295298    // LGE_WVSO_A0119
    296     m_cTEncTop.setUseWVSO                      ( isDepth ? m_bUseWVSO             : false );   
    297     m_cTEncTop.setVSOWeight                    ( isDepth ? m_iVSOWeight           : 0     );
    298     m_cTEncTop.setVSDWeight                    ( isDepth ? m_iVSDWeight           : 0     );
    299     m_cTEncTop.setDWeight                      ( isDepth ? m_iDWeight             : 0     );
     299    m_cTEncTop.setUseWVSO                      ( isDepth || isAuxDepth ? m_bUseWVSO             : false );   
     300    m_cTEncTop.setVSOWeight                    ( isDepth || isAuxDepth ? m_iVSOWeight           : 0     );
     301    m_cTEncTop.setVSDWeight                    ( isDepth || isAuxDepth ? m_iVSDWeight           : 0     );
     302    m_cTEncTop.setDWeight                      ( isDepth || isAuxDepth ? m_iDWeight             : 0     );
    300303#endif // H_3D_VSO
     304#if NH_3D
    301305#if NH_3D_IC
    302306    m_cTEncTop.setUseIC                        ( vps.getViewIndex( layerId ) == 0 || isDepth ? false : m_abUseIC );
     
    308312    m_cTEncTop.setUseSDC                       ( isDepth ? m_intraSdcFlag     : false );
    309313    m_cTEncTop.setUseDLT                       ( isDepth ? m_useDLT   : false );
    310     m_cTEncTop.setUseQTL                       ( isDepth ? m_bUseQTL  : false );
     314#endif
     315#if NH_3D_QTL
     316    m_cTEncTop.setUseQTL                       ( isDepth || isAuxDepth ? m_bUseQTL  : false );
     317#endif
     318#if NH_3D
    311319    m_cTEncTop.setSps3dExtension               ( m_sps3dExtension );
    312320#endif // NH_3D
     
    378386    m_cTEncTop.setLambdaModifier                                  ( uiLoop, m_adLambdaModifier[ uiLoop ] );
    379387  }
     388  m_cTEncTop.setIntraLambdaModifier                               ( m_adIntraLambdaModifier );
     389  m_cTEncTop.setIntraQpFactor                                     ( m_dIntraQpFactor );
     390
    380391#if NH_MV
    381392  m_cTEncTop.setQP                                                ( m_iQP[layerIdInVps] );
     
    385396
    386397  m_cTEncTop.setPad                                               ( m_aiPad );
    387 
     398  m_cTEncTop.setAccessUnitDelimiter                               ( m_AccessUnitDelimiter );
    388399#if NH_MV
    389400  m_cTEncTop.setMaxTempLayer                                      ( m_maxTempLayerMvc[layerIdInVps] );
     
    408419  //====== Motion search ========
    409420  m_cTEncTop.setDisableIntraPUsInInterSlices                      ( m_bDisableIntraPUsInInterSlices );
    410   m_cTEncTop.setFastSearch                                        ( m_iFastSearch  );
     421  m_cTEncTop.setMotionEstimationSearchMethod                      ( m_motionEstimationSearchMethod  );
    411422  m_cTEncTop.setSearchRange                                       ( m_iSearchRange );
    412423  m_cTEncTop.setBipredSearchRange                                 ( m_bipredSearchRange );
    413424  m_cTEncTop.setClipForBiPredMeEnabled                            ( m_bClipForBiPredMeEnabled );
    414425  m_cTEncTop.setFastMEAssumingSmootherMVEnabled                   ( m_bFastMEAssumingSmootherMVEnabled );
     426  m_cTEncTop.setMinSearchWindow                                   ( m_minSearchWindow );
     427  m_cTEncTop.setRestrictMESampling                                ( m_bRestrictMESampling );
    415428
    416429#if NH_MV
     
    439452  m_cTEncTop.setExtendedPrecisionProcessingFlag                   ( m_extendedPrecisionProcessingFlag );
    440453  m_cTEncTop.setHighPrecisionOffsetsEnabledFlag                   ( m_highPrecisionOffsetsEnabledFlag );
     454
     455  m_cTEncTop.setWeightedPredictionMethod( m_weightedPredictionMethod );
     456
    441457  //====== Tool list ========
    442458  m_cTEncTop.setDeltaQpRD                                         ( m_uiDeltaQpRD  );
     
    463479  m_cTEncTop.setQuadtreeTUMaxDepthInter                           ( m_uiQuadtreeTUMaxDepthInter );
    464480  m_cTEncTop.setQuadtreeTUMaxDepthIntra                           ( m_uiQuadtreeTUMaxDepthIntra );
    465   m_cTEncTop.setUseFastEnc                                        ( m_bUseFastEnc );
     481  m_cTEncTop.setFastInterSearchMode                               ( m_fastInterSearchMode );
    466482  m_cTEncTop.setUseEarlyCU                                        ( m_bUseEarlyCU  );
    467483  m_cTEncTop.setUseFastDecisionForMerge                           ( m_useFastDecisionForMerge  );
     
    513529
    514530  //====== Slice ========
    515   m_cTEncTop.setSliceMode                                         ( (SliceConstraint) m_sliceMode );
     531  m_cTEncTop.setSliceMode                                         ( m_sliceMode );
    516532  m_cTEncTop.setSliceArgument                                     ( m_sliceArgument            );
    517533
    518534  //====== Dependent Slice ========
    519   m_cTEncTop.setSliceSegmentMode                                  (  (SliceConstraint) m_sliceSegmentMode );
     535  m_cTEncTop.setSliceSegmentMode                                  ( m_sliceSegmentMode );
    520536  m_cTEncTop.setSliceSegmentArgument                              ( m_sliceSegmentArgument     );
    521537
     
    540556
    541557  m_cTEncTop.setIntraSmoothingDisabledFlag                        (!m_enableIntraReferenceSmoothing );
    542   m_cTEncTop.setDecodedPictureHashSEIEnabled                      ( m_decodedPictureHashSEIEnabled );
     558  m_cTEncTop.setDecodedPictureHashSEIType                         ( m_decodedPictureHashSEIType );
    543559  m_cTEncTop.setRecoveryPointSEIEnabled                           ( m_recoveryPointSEIEnabled );
    544560  m_cTEncTop.setBufferingPeriodSEIEnabled                         ( m_bufferingPeriodSEIEnabled );
     
    571587  m_cTEncTop.setTMISEINominalWhiteLevelLumaCodeValue              ( m_nominalWhiteLevelLumaCodeValue );
    572588  m_cTEncTop.setTMISEIExtendedWhiteLevelLumaCodeValue             ( m_extendedWhiteLevelLumaCodeValue );
    573   m_cTEncTop.setChromaSamplingFilterHintEnabled                   ( m_chromaSamplingFilterSEIenabled );
    574   m_cTEncTop.setChromaSamplingHorFilterIdc                        ( m_chromaSamplingHorFilterIdc );
    575   m_cTEncTop.setChromaSamplingVerFilterIdc                        ( m_chromaSamplingVerFilterIdc );
     589  m_cTEncTop.setChromaResamplingFilterHintEnabled                 ( m_chromaResamplingFilterSEIenabled );
     590  m_cTEncTop.setChromaResamplingHorFilterIdc                      ( m_chromaResamplingHorFilterIdc );
     591  m_cTEncTop.setChromaResamplingVerFilterIdc                      ( m_chromaResamplingVerFilterIdc );
    576592  m_cTEncTop.setFramePackingArrangementSEIEnabled                 ( m_framePackingSEIEnabled );
    577593  m_cTEncTop.setFramePackingArrangementSEIType                    ( m_framePackingSEIType );
     
    590606  m_cTEncTop.setSOPDescriptionSEIEnabled                          ( m_SOPDescriptionSEIEnabled );
    591607  m_cTEncTop.setScalableNestingSEIEnabled                         ( m_scalableNestingSEIEnabled );
    592 #if NH_MV
    593 #if !NH_MV_SEI
    594   m_cTEncTop.setSubBitstreamPropSEIEnabled                        ( m_subBistreamPropSEIEnabled );
    595   if( m_subBistreamPropSEIEnabled )                               
    596   {                                                               
    597     m_cTEncTop.setNumAdditionalSubStreams                         ( m_sbPropNumAdditionalSubStreams );
    598     m_cTEncTop.setSubBitstreamMode                                ( m_sbPropSubBitstreamMode );
    599     m_cTEncTop.setOutputLayerSetIdxToVps                          ( m_sbPropOutputLayerSetIdxToVps );
    600     m_cTEncTop.setHighestSublayerId                               ( m_sbPropHighestSublayerId );
    601     m_cTEncTop.setAvgBitRate                                      ( m_sbPropAvgBitRate );
    602     m_cTEncTop.setMaxBitRate                                      ( m_sbPropMaxBitRate );
    603   }
    604 #endif
    605 #endif
    606 
    607608  m_cTEncTop.setTMCTSSEIEnabled                                   ( m_tmctsSEIEnabled );
    608609  m_cTEncTop.setTimeCodeSEIEnabled                                ( m_timeCodeSEIEnabled );
     
    623624  m_cTEncTop.setKneeSEIInputKneePoint                             ( m_kneeSEIInputKneePoint );
    624625  m_cTEncTop.setKneeSEIOutputKneePoint                            ( m_kneeSEIOutputKneePoint );
     626  m_cTEncTop.setColourRemapInfoSEIFileRoot                        ( m_colourRemapSEIFileRoot );
    625627  m_cTEncTop.setMasteringDisplaySEI                               ( m_masteringDisplay );
    626628
    627 #if NH_MV_SEI
     629#if NH_MV
    628630  m_cTEncTop.setSeiMessages                                       ( &m_seiMessages );
    629631#endif
     
    644646  }
    645647  m_cTEncTop.setLFCrossTileBoundaryFlag                           ( m_bLFCrossTileBoundaryFlag );
    646   m_cTEncTop.setWaveFrontSynchro                                  ( m_iWaveFrontSynchro );
     648  m_cTEncTop.setEntropyCodingSyncEnabledFlag                      ( m_entropyCodingSyncEnabledFlag );
    647649  m_cTEncTop.setTMVPModeId                                        ( m_TMVPModeId );
    648650  m_cTEncTop.setUseScalingListId                                  ( m_useScalingListId  );
    649   m_cTEncTop.setScalingListFile                                   ( m_scalingListFile  );
     651  m_cTEncTop.setScalingListFileName                               ( m_scalingListFileName );
    650652  m_cTEncTop.setSignHideFlag                                      ( m_signHideFlag);
    651653#if KWU_RC_VIEWRC_E0227 || KWU_RC_MADPRED_E0227
     
    669671  m_cTEncTop.setInitialQP                                         ( m_RCInitialQP );
    670672  m_cTEncTop.setForceIntraQP                                      ( m_RCForceIntraQP );
     673#if U0132_TARGET_BITS_SATURATION
     674  m_cTEncTop.setCpbSaturationEnabled                              ( m_RCCpbSaturationEnabled );
     675  m_cTEncTop.setCpbSize                                           ( m_RCCpbSize );
     676  m_cTEncTop.setInitialCpbFullness                                ( m_RCInitialCpbFullness );
     677#endif
     678
    671679#if KWU_RC_MADPRED_E0227
    672680  if(m_cTEncTop.getUseRateCtrl() && !m_cTEncTop.getIsDepth())
     
    796804        TEncTop* pcEncTop =  m_acTEncTopList[ layer ];
    797805        Int iViewNum      = pcEncTop->getViewIndex();
    798         Int iContent      = pcEncTop->getIsDepth() ? 1 : 0;
     806        Int iContent      = pcEncTop->getIsDepth() || pcEncTop->getIsAuxDepth() ? 1 : 0;
    799807        Int iNumOfModels  = m_cRenModStrParser.getNumOfModelsForView(iViewNum, iContent);
    800808
     
    843851#else
    844852  // Video I/O
    845   m_cTVideoIOYuvInputFile.open( m_pchInputFile,     false, m_inputBitDepth, m_MSBExtendedBitDepth, m_internalBitDepth );  // read  mode
     853  m_cTVideoIOYuvInputFile.open( m_inputFileName,     false, m_inputBitDepth, m_MSBExtendedBitDepth, m_internalBitDepth );  // read  mode
    846854  m_cTVideoIOYuvInputFile.skipFrames(m_FrameSkip, m_iSourceWidth - m_aiPad[0], m_iSourceHeight - m_aiPad[1], m_InputChromaFormatIDC);
    847855
    848   if (m_pchReconFile)
    849   {
    850     m_cTVideoIOYuvReconFile.open(m_pchReconFile, true, m_outputBitDepth, m_outputBitDepth, m_internalBitDepth);  // write mode
     856  if (!m_reconFileName.empty())
     857  {
     858    m_cTVideoIOYuvReconFile.open(m_reconFileName, true, m_outputBitDepth, m_outputBitDepth, m_internalBitDepth);  // write mode
    851859  }
    852860
     
    917925Void TAppEncTop::encode()
    918926{
    919   fstream bitstreamFile(m_pchBitstreamFile, fstream::binary | fstream::out);
     927  fstream bitstreamFile(m_bitstreamFileName.c_str(), fstream::binary | fstream::out);
    920928  if (!bitstreamFile)
    921929  {
    922     fprintf(stderr, "\nfailed to open bitstream file `%s' for writing\n", m_pchBitstreamFile);
     930    fprintf(stderr, "\nfailed to open bitstream file `%s' for writing\n", m_bitstreamFileName.c_str());
    923931    exit(EXIT_FAILURE);
    924932  }
     
    10281036    for ( Int gopId=0; gopId < gopSize; gopId++ )
    10291037    {
    1030 #if NH_3D
     1038#if NH_3D_VSO
    10311039      UInt iNextPoc = m_acTEncTopList[0] -> getFrameId( gopId );
    10321040      if ( iNextPoc < m_framesToBeEncoded )
     
    11501158  printRateSummary();
    11511159
    1152 #if H_3D_REN_MAX_DEV_OUT
     1160#if NH_3D_REN_MAX_DEV_OUT
    11531161  Double dMaxDispDiff = m_cCameraData.getMaxShiftDeviation();
    11541162
     
    12951303  }
    12961304#else
    1297       if (m_pchReconFile)
     1305      if (!m_reconFileName.empty())
    12981306      {
    12991307        m_cTVideoIOYuvReconFile.write( pcPicYuvRecTop, pcPicYuvRecBottom, ipCSC, m_confWinLeft, m_confWinRight, m_confWinTop, m_confWinBottom, NUM_CHROMA_FORMAT, m_isTopFieldFirst );
     
    13521360  }
    13531361#else
    1354       if (m_pchReconFile)
     1362      if (!m_reconFileName.empty())
    13551363      {
    13561364        m_cTVideoIOYuvReconFile.write( pcPicYuvRec, ipCSC, m_confWinLeft, m_confWinRight, m_confWinTop, m_confWinBottom,
     
    16701678          if( m_depthFlag[ curLayerIdInVps ] && ( m_mpiFlag|| m_qtPredFlag || m_intraContourFlag ) )
    16711679          {         
    1672             Int nuhLayerIdTex = vps.getLayerIdInNuh( vps.getViewIndex( curLayerIdInNuh ), false );
     1680            Int nuhLayerIdTex = vps.getLayerIdInNuh( vps.getViewIndex( curLayerIdInNuh ), false, 0 );
    16731681            if ( nuhLayerIdTex == refLayerIdInNuh )
    16741682            {
     
    16961704                for (Int j = 0; j < geCur.m_numActiveRefLayerPics; j++ )
    16971705                {
    1698                   Int nuhLayerIdDep = vps.getLayerIdInNuh( vps.getViewIndex( vps.getIdRefListLayer( curLayerIdInNuh, geCur.m_interLayerPredLayerIdc[j] ) ), true );
     1706                  Int nuhLayerIdDep = vps.getLayerIdInNuh( vps.getViewIndex( vps.getIdRefListLayer( curLayerIdInNuh, geCur.m_interLayerPredLayerIdc[j] ) ), true, 0 );
    16991707                  if ( nuhLayerIdDep == refLayerIdInNuh )
    17001708                  {
     
    20632071      vps.setLayerIdIncludedFlag( false, lsIdx, layerId );
    20642072    }
    2065     for ( Int i = 0; i < m_layerIdsInSets[lsIdx].size(); i++)
     2073    for ( Int i = 0; i < m_layerIdxInVpsInSets[lsIdx].size(); i++)
    20662074    {       
    2067       vps.setLayerIdIncludedFlag( true, lsIdx, vps.getLayerIdInNuh( m_layerIdsInSets[lsIdx][i] ) );
     2075      vps.setLayerIdIncludedFlag( true, lsIdx, vps.getLayerIdInNuh( m_layerIdxInVpsInSets[lsIdx][i] ) );
    20682076    }
    20692077  }
  • trunk/source/App/TAppEncoder/TAppEncTop.h

    r1313 r1386  
    4646#include "TLibCommon/AccessUnit.h"
    4747#include "TAppEncCfg.h"
    48 #if NH_3D
     48#if NH_3D_VSO
    4949#include "../../Lib/TLibRenderer/TRenTop.h"
    5050#endif
  • trunk/source/App/TAppExtractor/TAppExtrCfg.cpp

    r1179 r1386  
    5858    \param argv array of arguments
    5959 */
    60 Bool TAppExtrCfg::parseCfg( Int argc, Char* argv[] )
     60Bool TAppExtrCfg::parseCfg( Int argc, TChar* argv[] )
    6161{
    6262  bool do_help = false;
  • trunk/source/App/TAppExtractor/TAppExtrCfg.h

    r1179 r1386  
    6565  virtual ~TAppExtrCfg() {}
    6666 
    67   Bool  parseCfg        ( Int argc, Char* argv[] );    ///< initialize option class from configuration
     67  Bool  parseCfg        ( Int argc, TChar* argv[] );    ///< initialize option class from configuration
    6868
    6969protected:
  • trunk/source/App/TAppRenderer/RendererMain.cpp

    r1313 r1386  
    3535#include <time.h>
    3636#include "../../Lib/TLibCommon/CommonDef.h"
    37 #if NH_3D
     37#if NH_3D_VSO
    3838#include "TAppRendererTop.h"
    3939// ====================================================================================================================
  • trunk/source/App/TAppRenderer/TAppRendererCfg.cpp

    r1313 r1386  
    4444#include "../../Lib/TAppCommon/program_options_lite.h"
    4545
    46 #if NH_3D
     46#if NH_3D_VSO
    4747
    4848using namespace std;
     
    111111\retval             true when success
    112112*/
    113 Bool TAppRendererCfg::parseCfg( Int argc, Char* argv[] )
     113Bool TAppRendererCfg::parseCfg( Int argc, TChar* argv[] )
    114114{
    115115  bool do_help = false;
     
    121121
    122122    /* File I/O */
    123     ("VideoInputFileBaseName,v",  m_pchVideoInputFileBaseName,  (Char*) 0, "Basename to generate video input file names")
    124     ("DepthInputFileBaseName,d",  m_pchDepthInputFileBaseName,  (Char*) 0, "Basename to generate depth input file names")
    125     ("SynthOutputFileBaseName,s", m_pchSynthOutputFileBaseName, (Char*) 0, "Basename to generate synthesized output file names")
     123    ("VideoInputFileBaseName,v",  m_pchVideoInputFileBaseName,  (TChar*) 0, "Basename to generate video input file names")
     124    ("DepthInputFileBaseName,d",  m_pchDepthInputFileBaseName,  (TChar*) 0, "Basename to generate depth input file names")
     125    ("SynthOutputFileBaseName,s", m_pchSynthOutputFileBaseName, (TChar*) 0, "Basename to generate synthesized output file names")
    126126    ("ContOutputFileNumbering", m_bContOutputFileNumbering  ,  false   , "Continuous Output File Numbering")
    127127    ("Sweep"                  , m_bSweep                    ,  false   , "Store all views in first Output File")
    128128
    129     ("VideoInputFile_%d,v_%d",  m_pchVideoInputFileList ,    (Char *) 0, MAX_INPUT_VIEW_NUM , "Original Yuv video input file name %d")
    130     ("DepthInputFile_%d,d_%d",  m_pchDepthInputFileList ,    (Char *) 0, MAX_INPUT_VIEW_NUM , "Original Yuv depth input file name %d")
    131     ("SynthOutputFile_%d,s_%d", m_pchSynthOutputFileList,    (Char *) 0, MAX_OUTPUT_VIEW_NUM, "Synthesized Yuv output file name %d")
     129    ("VideoInputFile_%d,v_%d",  m_pchVideoInputFileList ,    (TChar *) 0, MAX_INPUT_VIEW_NUM , "Original Yuv video input file name %d")
     130    ("DepthInputFile_%d,d_%d",  m_pchDepthInputFileList ,    (TChar *) 0, MAX_INPUT_VIEW_NUM , "Original Yuv depth input file name %d")
     131    ("SynthOutputFile_%d,s_%d", m_pchSynthOutputFileList,    (TChar *) 0, MAX_OUTPUT_VIEW_NUM, "Synthesized Yuv output file name %d")
    132132
    133133    ("InputBitDepth",           m_inputBitDepth[0],                     8, "Bit-depth of input file")
     
    146146
    147147    /* Camera Specification */
    148     ("CameraParameterFile,-cpf", m_pchCameraParameterFile,          (Char *) 0, "Camera Parameter File Name")
    149     ("BaseViewCameraNumbers"  , m_pchBaseViewCameraNumbers,        (Char *) 0, "Numbers of base views")
    150     ("SynthViewCameraNumbers" , m_pchSynthViewCameraNumbers,       (Char *) 0, "Numbers of views to synthesis")
    151     ("ViewConfig"             , m_pchViewConfig,                   (Char *) 0, "View Configuration"               )
     148    ("CameraParameterFile,-cpf", m_pchCameraParameterFile,         (TChar *) 0, "Camera Parameter File Name")
     149    ("BaseViewCameraNumbers"  , m_pchBaseViewCameraNumbers,        (TChar *) 0, "Numbers of base views")
     150    ("SynthViewCameraNumbers" , m_pchSynthViewCameraNumbers,       (TChar *) 0, "Numbers of views to synthesis")
     151    ("ViewConfig"             , m_pchViewConfig,                   (TChar *) 0, "View Configuration"               )
    152152
    153153    /* Renderer Modes */
     
    458458}
    459459
    460 Void TAppRendererCfg::xAddNumberToFileName( Char* pchSourceFileName, Char*& rpchTargetFileName, Int iNumberToAdd, UInt uiPrecBefore, UInt uiPrecAfter )
     460Void TAppRendererCfg::xAddNumberToFileName( TChar* pchSourceFileName, TChar*& rpchTargetFileName, Int iNumberToAdd, UInt uiPrecBefore, UInt uiPrecAfter )
    461461{
    462462
     
    468468  }
    469469
    470   Char pchNumberBuffer[2* LOG10_VIEW_NUM_PREC + 2];
    471   Char pchPrintBuffer[10];
     470  TChar pchNumberBuffer[2* LOG10_VIEW_NUM_PREC + 2];
     471  TChar pchPrintBuffer[10];
    472472
    473473  Double dNumberToAdd = ( (Double) iNumberToAdd ) / VIEW_NUM_PREC;
     
    488488  size_t iAddLength = strlen(pchNumberBuffer);
    489489
    490   rpchTargetFileName = (Char*) malloc(iInLength+iAddLength+1);
    491 
    492   Char* pchPlaceHolder = strrchr(pchSourceFileName,'$');
     490  rpchTargetFileName = (TChar*) malloc(iInLength+iAddLength+1);
     491
     492  TChar* pchPlaceHolder = strrchr(pchSourceFileName,'$');
    493493  assert( pchPlaceHolder );
    494494
  • trunk/source/App/TAppRenderer/TAppRendererCfg.h

    r1313 r1386  
    4747#include <vector>
    4848
    49 #if NH_3D
     49#if NH_3D_VSO
    5050
    5151// ====================================================================================================================
     
    5959
    6060  //// file I/O ////
    61   Char*              m_pchVideoInputFileBaseName;      ///< input video  file base name, placeholder for numbering $$
    62   Char*              m_pchDepthInputFileBaseName;      ///< input depth  file base name, placeholder for numbering $$
    63   Char*              m_pchSynthOutputFileBaseName;     ///< output synth file base name, placeholder for numbering $$
     61  TChar*             m_pchVideoInputFileBaseName;      ///< input video  file base name, placeholder for numbering $$
     62  TChar*             m_pchDepthInputFileBaseName;      ///< input depth  file base name, placeholder for numbering $$
     63  TChar*             m_pchSynthOutputFileBaseName;     ///< output synth file base name, placeholder for numbering $$
    6464  Bool               m_bContOutputFileNumbering;       ///< use continous numbering instead of view numbering
    6565  Bool               m_bSweep;                         ///< 1: Store view range in file
     
    7373
    7474  // derived
    75   std::vector<Char*> m_pchVideoInputFileList;          ///< source file names
    76   std::vector<Char*> m_pchDepthInputFileList;          ///< source depth file names
    77   std::vector<Char*> m_pchSynthOutputFileList;         ///< output reconstruction file names
     75  std::vector<TChar*> m_pchVideoInputFileList;         ///< source file names
     76  std::vector<TChar*> m_pchDepthInputFileList;         ///< source depth file names
     77  std::vector<TChar*> m_pchSynthOutputFileList;        ///< output reconstruction file names
    7878
    7979  //// source specification ////
     
    8484
    8585  ////camera specification ////
    86   Char*               m_pchCameraParameterFile;         ///< camera parameter file
    87   Char*               m_pchSynthViewCameraNumbers;      ///< numbers of views to synthesize
    88   Char*               m_pchViewConfig;                  ///< String to setup renderer
    89   Char*               m_pchBaseViewCameraNumbers;       ///< numbers of base views
     86  TChar*             m_pchCameraParameterFile;         ///< camera parameter file
     87  TChar*             m_pchSynthViewCameraNumbers;      ///< numbers of views to synthesize
     88  TChar*             m_pchViewConfig;                  ///< String to setup renderer
     89  TChar*             m_pchBaseViewCameraNumbers;       ///< numbers of base views
    9090
    9191  // derived
     
    123123  Void xCreateFileNames();
    124124  Void xGetMaxPrecision( IntAry1d adIn, Int& iPrecBefore, Int& iPrecAfter );
    125   Void xAddNumberToFileName( Char* pchSourceFileName, Char*& rpchTargetFileName, Int iNumberToAdd, UInt uiPrecBefore, UInt uiPrecAfter );
     125  Void xAddNumberToFileName( TChar* pchSourceFileName, TChar*& rpchTargetFileName, Int iNumberToAdd, UInt uiPrecBefore, UInt uiPrecAfter );
    126126public:
    127127  TAppRendererCfg();
     
    131131  Void  create    ();                                         ///< create option handling class
    132132  Void  destroy   ();                                         ///< destroy option handling class
    133   Bool  parseCfg  ( Int argc, Char* argv[] );                 ///< parse configuration file to fill member variables
    134   Bool  xConfirmParameter(Bool bflag, const Char* message);
     133  Bool  parseCfg  ( Int argc, TChar* argv[] );                 ///< parse configuration file to fill member variables
     134  Bool  xConfirmParameter(Bool bflag, const TChar* message);
    135135
    136136
  • trunk/source/App/TAppRenderer/TAppRendererTop.cpp

    r1313 r1386  
    4141#include "TAppRendererTop.h"
    4242
    43 #if NH_3D
     43#if NH_3D_VSO
    4444
    4545// ====================================================================================================================
     
    488488  }
    489489
    490 #if H_3D_REN_MAX_DEV_OUT
     490#if NH_3D_REN_MAX_DEV_OUT
    491491  Double dMaxDispDiff = m_cCameraData.getMaxShiftDeviation();
    492492
  • trunk/source/App/TAppRenderer/TAppRendererTop.h

    r1313 r1386  
    4040#define __TAppRendererTOP__
    4141#include "../../Lib/TLibCommon/CommonDef.h"
    42 #if NH_3D
     42#if NH_3D_VSO
    4343#include "../../Lib/TLibRenderer/TRenTop.h"
    4444#include "../../Lib/TLibVideoIO/TVideoIOYuv.h"
  • trunk/source/App/utils/convert_NtoMbit_YCbCr.cpp

    r1313 r1386  
    105105
    106106  TComPicYuv frame;
    107   frame.create( width, height, chromaFormatIDC, width, height, 0, false);
     107  frame.createWithoutCUInfo( width, height, chromaFormatIDC);
    108108
    109109  Int pad[2] = {0, 0};
    110110
    111111  TComPicYuv cPicYuvTrueOrg;
    112   cPicYuvTrueOrg.create( width, height, chromaFormatIDC, width, height, 0, false );
     112  cPicYuvTrueOrg.createWithoutCUInfo( width, height, chromaFormatIDC );
    113113
    114114  UInt num_frames_processed = 0;
Note: See TracChangeset for help on using the changeset viewer.