Changeset 189 in SHVCSoftware for trunk/source/App


Ignore:
Timestamp:
13 May 2013, 16:58:44 (12 years ago)
Author:
seregin
Message:

merge with SHM-2.0-dev branch

Location:
trunk/source
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/source

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

    r125 r189  
    6060#if SVC_EXTENSION
    6161  Char*         m_pchReconFile [MAX_LAYERS];          ///< output reconstruction file name
    62 #if AVC_BASE
    63   Char*         m_pchBLReconFile;                     ///< input BL reconstruction file name
    64   Int           m_iBLSourceWidth;
    65   Int           m_iBLSourceHeight;
    66 #if AVC_SYNTAX
    67   Char*         m_pchBLSyntaxFile;                     ///< input BL syntax file name 
    68 #endif
    69 #endif
    7062#else
    7163  Char*         m_pchReconFile;                       ///< output reconstruction file name
    72 #endif
    73 #if SYNTAX_OUTPUT
    74   Char*         m_pchBLSyntaxFile;                     ///< input BL syntax file name
    75   Int           m_iBLSourceWidth;
    76   Int           m_iBLSourceHeight;
    77   Int           m_iBLFrames;
    7864#endif
    7965  Int           m_iSkipFrame;                         ///< counter for frames prior to the random access point to skip
     
    8672#if SVC_EXTENSION
    8773  Int           m_tgtLayerId;                        ///< target layer ID
     74#if AVC_BASE
     75  Char*         m_pchBLReconFile;                     ///< input BL reconstruction file name
     76  Int           m_iBLSourceWidth;
     77  Int           m_iBLSourceHeight;
     78#if AVC_SYNTAX
     79  Char*         m_pchBLSyntaxFile;                     ///< input BL syntax file name 
    8880#endif
     81#endif
     82#endif
     83
     84#if SYNTAX_OUTPUT
     85  Char*         m_pchBLSyntaxFile;                     ///< input BL syntax file name
     86  Int           m_iBLSourceWidth;
     87  Int           m_iBLSourceHeight;
     88  Int           m_iBLFrames;
     89#endif
     90
    8991  std::vector<Int> m_targetDecLayerIdSet;             ///< set of LayerIds to be included in the sub-bitstream extraction process.
    9092  Int           m_respectDefDispWindow;               ///< Only output content inside the default display window
     
    103105#if SVC_EXTENSION
    104106  , m_tgtLayerId(0)
    105 #endif
    106   , m_respectDefDispWindow(0)
    107107#if AVC_BASE
    108108  , m_iBLSourceWidth(0)
     
    114114  , m_iBLFrames(0)
    115115#endif
     116#endif
     117  , m_respectDefDispWindow(0)
    116118  {}
    117119  virtual ~TAppDecCfg() {}
  • trunk/source/App/TAppDecoder/TAppDecTop.cpp

    r125 r189  
    157157#if AVC_BASE
    158158  TComPic pcBLPic;
    159   if( !m_pchBLReconFile )
    160   {
    161     printf( "Wrong base layer YUV input file\n" );
    162     exit(EXIT_FAILURE);
    163   }
    164   fstream streamYUV( m_pchBLReconFile, fstream::in | fstream::binary );
    165   if( !streamYUV.good() )
    166   {
    167     printf( "Base layer YUV input reading error\n" );
    168     exit(EXIT_FAILURE);
     159  fstream streamYUV;
     160  if( m_pchBLReconFile )
     161  {
     162    streamYUV.open( m_pchBLReconFile, fstream::in | fstream::binary );
    169163  }
    170164  TComList<TComPic*> *cListPic = m_acTDecTop[0].getListPic();
     
    174168  cListPic->pushBack( &pcBLPic );
    175169#if AVC_SYNTAX
    176   if( !m_pchBLSyntaxFile )
    177   {
    178     printf( "Wrong base layer syntax file\n" );
    179     exit(EXIT_FAILURE);
    180   }
    181   fstream streamSyntaxFile( m_pchBLSyntaxFile, fstream::in | fstream::binary );
    182   if( !streamSyntaxFile.good() )
    183   {
    184     printf( "Base layer syntax input reading error\n" );
    185     exit(EXIT_FAILURE);
     170  fstream streamSyntaxFile;
     171  if( m_pchBLSyntaxFile )
     172  {
     173    streamSyntaxFile.open( m_pchBLSyntaxFile, fstream::in | fstream::binary );
    186174  }
    187175  m_acTDecTop[0].setBLSyntaxFile( &streamSyntaxFile );
     
    254242      }
    255243      if ( bNewPicture && bNewPOC &&
    256            (   nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR
     244           (   nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_W_RADL
    257245            || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_N_LP
    258246            || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA_N_LP
    259             || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_BLANT
    260             || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA ) )
     247            || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA_W_RADL
     248            || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA_W_LP ) )
    261249      {
    262250        xFlushOutput( pcListPic, curLayerId );
     
    414402      }
    415403      if ( bNewPicture &&
    416            (   nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR
     404           (   nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_W_RADL
    417405            || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_IDR_N_LP
    418406            || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA_N_LP
    419             || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_BLANT
    420             || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA ) )
     407            || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA_W_RADL
     408            || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA_W_LP ) )
    421409      {
    422410        xFlushOutput( pcListPic );
     
    572560      if ( m_pchReconFile )
    573561      {
     562#if SYNTAX_OUTPUT && ILP_DECODED_PICTURE
     563        m_cTVideoIOYuvReconFile.write( pcPic->getPicYuvRec() );
     564#else
    574565        const Window &conf = pcPic->getConformanceWindow();
    575566        const Window &defDisp = m_respectDefDispWindow ? pcPic->getDefDisplayWindow() : Window();
     
    579570                                       conf.getWindowTopOffset() + defDisp.getWindowTopOffset(),
    580571                                       conf.getWindowBottomOffset() + defDisp.getWindowBottomOffset() );
     572#endif
    581573      }
    582574     
  • trunk/source/App/TAppEncoder/TAppEncCfg.cpp

    r125 r189  
    6666TAppEncCfg::TAppEncCfg()
    6767: m_pBitstreamFile()
     68#if AVC_BASE
     69, m_avcBaseLayerFlag(0)
     70#endif
    6871, m_pColumnWidth()
    6972, m_pRowHeight()
     
    8992{
    9093  m_aidQP = NULL;
     94#if J0149_TONE_MAPPING_SEI
     95  m_startOfCodedInterval = NULL;
     96  m_codedPivotValue = NULL;
     97  m_targetPivotValue = NULL;
     98#endif
    9199}
    92100#endif
     
    102110    delete[] m_aidQP;
    103111  }
     112#if J0149_TONE_MAPPING_SEI
     113  if ( m_startOfCodedInterval )
     114  {
     115    delete[] m_startOfCodedInterval;
     116    m_startOfCodedInterval = NULL;
     117  }
     118   if ( m_codedPivotValue )
     119  {
     120    delete[] m_codedPivotValue;
     121    m_codedPivotValue = NULL;
     122  }
     123  if ( m_targetPivotValue )
     124  {
     125    delete[] m_targetPivotValue;
     126    m_targetPivotValue = NULL;
     127  }
     128#endif
    104129  free(m_pchInputFile);
    105130#endif
     
    119144Void TAppEncCfg::destroy()
    120145{
     146#if VPS_EXTN_DIRECT_REF_LAYERS
     147  for(Int layer = 0; layer < MAX_LAYERS; layer++)
     148  {
     149    if( m_acLayerCfg[layer].m_numDirectRefLayers > 0 )
     150    {
     151      delete [] m_acLayerCfg[layer].m_refLayerIds;
     152    }
     153  }
     154#endif
    121155}
    122156
     
    297331  string* cfg_refLayerIdsPtr   [MAX_LAYERS];
    298332#endif
     333#if SCALED_REF_LAYER_OFFSETS
     334  Int*    cfg_scaledRefLayerLeftOffset [MAX_LAYERS];
     335  Int*    cfg_scaledRefLayerTopOffset [MAX_LAYERS];
     336  Int*    cfg_scaledRefLayerRightOffset [MAX_LAYERS];
     337  Int*    cfg_scaledRefLayerBottomOffset [MAX_LAYERS];
     338#endif
    299339  for(UInt layer = 0; layer < MAX_LAYERS; layer++)
    300340  {
     
    311351    cfg_refLayerIdsPtr      [layer]  = &cfg_refLayerIds[layer];
    312352#endif
    313   }
     353#if SCALED_REF_LAYER_OFFSETS
     354    cfg_scaledRefLayerLeftOffset  [layer] = &m_acLayerCfg[layer].m_scaledRefLayerLeftOffset;
     355    cfg_scaledRefLayerTopOffset   [layer] = &m_acLayerCfg[layer].m_scaledRefLayerTopOffset;
     356    cfg_scaledRefLayerRightOffset [layer] = &m_acLayerCfg[layer].m_scaledRefLayerRightOffset;
     357    cfg_scaledRefLayerBottomOffset[layer] = &m_acLayerCfg[layer].m_scaledRefLayerBottomOffset;
     358#endif
     359  }
     360#if AVC_BASE
     361  string  cfg_BLInputFile;
     362#endif
    314363#if AVC_SYNTAX
    315364  string  cfg_BLSyntaxFile;
     
    324373  string cfg_RowHeight;
    325374  string cfg_ScalingListFile;
     375#if J0149_TONE_MAPPING_SEI
     376  string cfg_startOfCodedInterval;
     377  string cfg_codedPivotValue;
     378  string cfg_targetPivotValue;
     379#endif
    326380#if SIGNAL_BITRATE_PICRATE_IN_VPS
    327381  string cfg_bitRateInfoPresentFlag;
     
    361415  ("OutputBitDepthC",       m_outputBitDepthC,   0, "As per OutputBitDepth but for chroma component. (default:InternalBitDepthC)")
    362416  ("InternalBitDepthC",     m_internalBitDepthC, 0, "As per InternalBitDepth but for chroma component. (default:IntrenalBitDepth)")
    363 
     417#if SCALED_REF_LAYER_OFFSETS
     418  ("ScaledRefLayerLeftOffset%d",   cfg_scaledRefLayerLeftOffset,  0, MAX_LAYERS, "Horizontal offset of top-left luma sample of scaled base layer picture with respect to"
     419                                                                 " top-left luma sample of the EL picture, in units of two luma samples")
     420  ("ScaledRefLayerTopOffset%d",    cfg_scaledRefLayerTopOffset,   0, MAX_LAYERS,   "Vertical offset of top-left luma sample of scaled base layer picture with respect to"
     421                                                                 " top-left luma sample of the EL picture, in units of two luma samples")
     422  ("ScaledRefLayerRightOffset%d",  cfg_scaledRefLayerRightOffset, 0, MAX_LAYERS, "Horizontal offset of bottom-right luma sample of scaled base layer picture with respect to"
     423                                                                 " bottom-right luma sample of the EL picture, in units of two luma samples")
     424  ("ScaledRefLayerBottomOffset%d", cfg_scaledRefLayerBottomOffset,0, MAX_LAYERS, "Vertical offset of bottom-right luma sample of scaled base layer picture with respect to"
     425                                                                 " bottom-right luma sample of the EL picture, in units of two luma samples")
     426#endif
    364427#if AVC_BASE
    365   ("InputBLFile,-ibl",        *cfg_InputFile[0],     string(""), "Base layer rec YUV input file name")
     428  ("AvcBase,-avc",            m_avcBaseLayerFlag,     0, "avc_base_layer_flag")
     429  ("InputBLFile,-ibl",        cfg_BLInputFile,     string(""), "Base layer rec YUV input file name")
    366430#if AVC_SYNTAX
    367431  ("InputBLSyntaxFile,-ibs",  cfg_BLSyntaxFile,     string(""), "Base layer syntax input file name")
     
    369433#endif
    370434#if REF_IDX_FRAMEWORK
    371   ("EnableElRapB,-use-rap-b",  m_elRapSliceBEnabled, 0, "Set ILP over base-layer I picture to B picture (default is P picture_")
     435  ("EnableElRapB,-use-rap-b",  m_elRapSliceBEnabled, 0, "Set ILP over base-layer I picture to B picture (default is P picture)")
    372436#endif 
    373437#else 
     
    430494  ("DecodingRefreshType,-dr", m_iDecodingRefreshType,       0, "Intra refresh type (0:none 1:CRA 2:IDR)")
    431495  ("GOPSize,g",               m_iGOPSize,                   1, "GOP size of temporal structure")
     496#if !L0034_COMBINED_LIST_CLEANUP
    432497  ("ListCombination,-lc",     m_bUseLComb,               true, "Combined reference list for uni-prediction estimation in B-slices")
     498#endif
    433499  // motion options
    434500  ("FastSearch",              m_iFastSearch,                1, "0:Full search  1:Diamond  2:PMVFAST")
     
    488554  ("LoopFilterTcOffset_div2",        m_loopFilterTcOffsetDiv2,             0 )
    489555  ("DeblockingFilterControlPresent", m_DeblockingFilterControlPresent, false )
     556#if L0386_DB_METRIC
     557  ("DeblockingFilterMetric",         m_DeblockingFilterMetric,         false )
     558#endif
    490559
    491560  // Coding tools
     
    602671  ("SEIBufferingPeriod",             m_bufferingPeriodSEIEnabled,              0, "Control generation of buffering period SEI messages")
    603672  ("SEIPictureTiming",               m_pictureTimingSEIEnabled,                0, "Control generation of picture timing SEI messages")
     673#if J0149_TONE_MAPPING_SEI
     674  ("SEIToneMappingInfo",                       m_toneMappingInfoSEIEnabled,    false, "Control generation of Tone Mapping SEI messages")
     675  ("SEIToneMapId",                             m_toneMapId,                        0, "Specifies Id of Tone Mapping SEI message for a given session")
     676  ("SEIToneMapCancelFlag",                     m_toneMapCancelFlag,            false, "Indicates that Tone Mapping SEI message cancels the persistance or follows")
     677  ("SEIToneMapPersistenceFlag",                m_toneMapPersistenceFlag,        true, "Specifies the persistence of the Tone Mapping SEI message")
     678  ("SEIToneMapCodedDataBitDepth",              m_toneMapCodedDataBitDepth,         8, "Specifies Coded Data BitDepth of Tone Mapping SEI messages")
     679  ("SEIToneMapTargetBitDepth",                 m_toneMapTargetBitDepth,            8, "Specifies Output BitDepth of Tome mapping function")
     680  ("SEIToneMapModelId",                        m_toneMapModelId,                   0, "Specifies Model utilized for mapping coded data into target_bit_depth range\n"
     681                                                                                      "\t0:  linear mapping with clipping\n"
     682                                                                                      "\t1:  sigmoidal mapping\n"
     683                                                                                      "\t2:  user-defined table mapping\n"
     684                                                                                      "\t3:  piece-wise linear mapping\n"
     685                                                                                      "\t4:  luminance dynamic range information ")
     686  ("SEIToneMapMinValue",                              m_toneMapMinValue,                          0, "Specifies the minimum value in mode 0")
     687  ("SEIToneMapMaxValue",                              m_toneMapMaxValue,                       1023, "Specifies the maxmum value in mode 0")
     688  ("SEIToneMapSigmoidMidpoint",                       m_sigmoidMidpoint,                        512, "Specifies the centre point in mode 1")
     689  ("SEIToneMapSigmoidWidth",                          m_sigmoidWidth,                           960, "Specifies the distance between 5% and 95% values of the target_bit_depth in mode 1")
     690  ("SEIToneMapStartOfCodedInterval",                  cfg_startOfCodedInterval,          string(""), "Array of user-defined mapping table")
     691  ("SEIToneMapNumPivots",                             m_numPivots,                                0, "Specifies the number of pivot points in mode 3")
     692  ("SEIToneMapCodedPivotValue",                       cfg_codedPivotValue,               string(""), "Array of pivot point")
     693  ("SEIToneMapTargetPivotValue",                      cfg_targetPivotValue,              string(""), "Array of pivot point")
     694  ("SEIToneMapCameraIsoSpeedIdc",                     m_cameraIsoSpeedIdc,                        0, "Indicates the camera ISO speed for daylight illumination")
     695  ("SEIToneMapCameraIsoSpeedValue",                   m_cameraIsoSpeedValue,                    400, "Specifies the camera ISO speed for daylight illumination of Extended_ISO")
     696  ("SEIToneMapExposureCompensationValueSignFlag",     m_exposureCompensationValueSignFlag,        0, "Specifies the sign of ExposureCompensationValue")
     697  ("SEIToneMapExposureCompensationValueNumerator",    m_exposureCompensationValueNumerator,       0, "Specifies the numerator of ExposureCompensationValue")
     698  ("SEIToneMapExposureCompensationValueDenomIdc",     m_exposureCompensationValueDenomIdc,        2, "Specifies the denominator of ExposureCompensationValue")
     699  ("SEIToneMapRefScreenLuminanceWhite",               m_refScreenLuminanceWhite,                350, "Specifies reference screen brightness setting in units of candela per square metre")
     700  ("SEIToneMapExtendedRangeWhiteLevel",               m_extendedRangeWhiteLevel,                800, "Indicates the luminance dynamic range")
     701  ("SEIToneMapNominalBlackLevelLumaCodeValue",        m_nominalBlackLevelLumaCodeValue,          16, "Specifies luma sample value of the nominal black level assigned decoded pictures")
     702  ("SEIToneMapNominalWhiteLevelLumaCodeValue",        m_nominalWhiteLevelLumaCodeValue,         235, "Specifies luma sample value of the nominal white level assigned decoded pictures")
     703  ("SEIToneMapExtendedWhiteLevelLumaCodeValue",       m_extendedWhiteLevelLumaCodeValue,        300, "Specifies luma sample value of the extended dynamic range assigned decoded pictures")
     704#endif
    604705  ("SEIFramePacking",                m_framePackingSEIEnabled,                 0, "Control generation of frame packing SEI messages")
    605706  ("SEIFramePackingType",            m_framePackingSEIType,                    0, "Define frame packing arrangement\n"
     
    622723  ("SEIGradualDecodingRefreshInfo",  m_gradualDecodingRefreshInfoEnabled,      0, "Control generation of gradual decoding refresh information SEI message")
    623724  ("SEIDecodingUnitInfo",             m_decodingUnitInfoSEIEnabled,                       0, "Control generation of decoding unit information SEI message.")
     725#if L0208_SOP_DESCRIPTION_SEI
     726  ("SEISOPDescription",              m_SOPDescriptionSEIEnabled,              0, "Control generation of SOP description SEI messages")
     727#endif
     728#if K0180_SCALABLE_NESTING_SEI
     729  ("SEIScalableNesting",             m_scalableNestingSEIEnabled,              0, "Control generation of scalable nesting SEI messages")
     730#endif
    624731#if SIGNAL_BITRATE_PICRATE_IN_VPS
    625732  ("BitRatePicRateMaxTLayers",   m_bitRatePicRateMaxTLayers,           0, "Maximum number of sub-layers signalled; can be inferred otherwise; here for easy parsing of config. file")
     
    662769  /* convert std::string to c string for compatability */
    663770#if SVC_EXTENSION
     771#if AVC_BASE
     772  if( m_avcBaseLayerFlag )
     773  {
     774    *cfg_InputFile[0] = cfg_BLInputFile;
     775  }
     776#endif
    664777  m_pBitstreamFile = cfg_BitstreamFile.empty() ? NULL : strdup(cfg_BitstreamFile.c_str());
    665778#if AVC_SYNTAX
     
    878991  }
    879992  m_iWaveFrontSubstreams = m_iWaveFrontSynchro ? (m_iSourceHeight + m_uiMaxCUHeight - 1) / m_uiMaxCUHeight : 1;
     993#endif
     994#if J0149_TONE_MAPPING_SEI
     995  if( m_toneMappingInfoSEIEnabled && !m_toneMapCancelFlag )
     996  {
     997    Char* pcStartOfCodedInterval = cfg_startOfCodedInterval.empty() ? NULL: strdup(cfg_startOfCodedInterval.c_str());
     998    Char* pcCodedPivotValue = cfg_codedPivotValue.empty() ? NULL: strdup(cfg_codedPivotValue.c_str());
     999    Char* pcTargetPivotValue = cfg_targetPivotValue.empty() ? NULL: strdup(cfg_targetPivotValue.c_str());
     1000    if( m_toneMapModelId == 2 && pcStartOfCodedInterval )
     1001    {
     1002      char *startOfCodedInterval;
     1003      UInt num = 1u<< m_toneMapTargetBitDepth;
     1004      m_startOfCodedInterval = new Int[num];
     1005      ::memset( m_startOfCodedInterval, 0, sizeof(Int)*num );
     1006      startOfCodedInterval = strtok(pcStartOfCodedInterval, " .");
     1007      int i = 0;
     1008      while( startOfCodedInterval && ( i < num ) )
     1009      {
     1010        m_startOfCodedInterval[i] = atoi( startOfCodedInterval );
     1011        startOfCodedInterval = strtok(NULL, " .");
     1012        i++;
     1013      }
     1014    }
     1015    else
     1016    {
     1017      m_startOfCodedInterval = NULL;
     1018    }
     1019    if( ( m_toneMapModelId == 3 ) && ( m_numPivots > 0 ) )
     1020    {
     1021      if( pcCodedPivotValue && pcTargetPivotValue )
     1022      {
     1023        char *codedPivotValue;
     1024        char *targetPivotValue;
     1025        m_codedPivotValue = new Int[m_numPivots];
     1026        m_targetPivotValue = new Int[m_numPivots];
     1027        ::memset( m_codedPivotValue, 0, sizeof(Int)*( m_numPivots ) );
     1028        ::memset( m_targetPivotValue, 0, sizeof(Int)*( m_numPivots ) );
     1029        codedPivotValue = strtok(pcCodedPivotValue, " .");
     1030        int i=0;
     1031        while(codedPivotValue&&i<m_numPivots)
     1032        {
     1033          m_codedPivotValue[i] = atoi( codedPivotValue );
     1034          codedPivotValue = strtok(NULL, " .");
     1035          i++;
     1036        }
     1037        i=0;
     1038        targetPivotValue = strtok(pcTargetPivotValue, " .");
     1039        while(targetPivotValue&&i<m_numPivots)
     1040        {
     1041          m_targetPivotValue[i]= atoi( targetPivotValue );
     1042          targetPivotValue = strtok(NULL, " .");
     1043          i++;
     1044        }
     1045      }
     1046    }
     1047    else
     1048    {
     1049      m_codedPivotValue = NULL;
     1050      m_targetPivotValue = NULL;
     1051    }
     1052  }
    8801053#endif
    8811054  // check validity of input parameters
     
    11391312
    11401313#if SVC_EXTENSION
     1314  xConfirmPara( m_numLayers > MAX_LAYERS , "Number of layers in config file is greater than MAX_LAYERS" );
     1315  m_numLayers = m_numLayers > MAX_LAYERS ? MAX_LAYERS : m_numLayers;
     1316
    11411317  // verify layer configuration parameters
    11421318  for(UInt layer=0; layer<m_numLayers; layer++)
     
    13751551  {
    13761552    m_numReorderPics[i] = 0;
     1553#if L0323_DPB
     1554    m_maxDecPicBuffering[i] = 1;
     1555#else
    13771556    m_maxDecPicBuffering[i] = 0;
     1557#endif
    13781558  }
    13791559  for(Int i=0; i<m_iGOPSize; i++)
    13801560  {
     1561#if L0323_DPB
     1562    if(m_GOPList[i].m_numRefPics+1 > m_maxDecPicBuffering[m_GOPList[i].m_temporalId])
     1563#else
    13811564    if(m_GOPList[i].m_numRefPics > m_maxDecPicBuffering[m_GOPList[i].m_temporalId])
    1382     {
     1565#endif
     1566    {
     1567#if L0323_DPB
     1568      m_maxDecPicBuffering[m_GOPList[i].m_temporalId] = m_GOPList[i].m_numRefPics + 1;
     1569#else
    13831570      m_maxDecPicBuffering[m_GOPList[i].m_temporalId] = m_GOPList[i].m_numRefPics;
     1571#endif
    13841572    }
    13851573    Int highestDecodingNumberWithLowerPOC = 0;
     
    14121600      m_numReorderPics[i+1] = m_numReorderPics[i];
    14131601    }
     1602#if L0323_DPB
     1603    // the value of num_reorder_pics[ i ] shall be in the range of 0 to max_dec_pic_buffering[ i ] - 1, inclusive
     1604    if(m_numReorderPics[i] > m_maxDecPicBuffering[i] - 1)
     1605    {
     1606      m_maxDecPicBuffering[i] = m_numReorderPics[i] + 1;
     1607    }
     1608#else
    14141609    // the value of num_reorder_pics[ i ] shall be in the range of 0 to max_dec_pic_buffering[ i ], inclusive
    14151610    if(m_numReorderPics[i] > m_maxDecPicBuffering[i])
     
    14171612      m_maxDecPicBuffering[i] = m_numReorderPics[i];
    14181613    }
     1614#endif
    14191615    // a lower layer can not have higher value of m_uiMaxDecPicBuffering than a higher layer
    14201616    if(m_maxDecPicBuffering[i+1] < m_maxDecPicBuffering[i])
     
    14231619    }
    14241620  }
     1621
     1622
     1623#if L0323_DPB
     1624  // the value of num_reorder_pics[ i ] shall be in the range of 0 to max_dec_pic_buffering[ i ] -  1, inclusive
     1625  if(m_numReorderPics[MAX_TLAYER-1] > m_maxDecPicBuffering[MAX_TLAYER-1] - 1)
     1626  {
     1627    m_maxDecPicBuffering[MAX_TLAYER-1] = m_numReorderPics[MAX_TLAYER-1] + 1;
     1628  }
     1629#else
    14251630  // the value of num_reorder_pics[ i ] shall be in the range of 0 to max_dec_pic_buffering[ i ], inclusive
    14261631  if(m_numReorderPics[MAX_TLAYER-1] > m_maxDecPicBuffering[MAX_TLAYER-1])
     
    14281633    m_maxDecPicBuffering[MAX_TLAYER-1] = m_numReorderPics[MAX_TLAYER-1];
    14291634  }
     1635#endif
    14301636
    14311637#if SVC_EXTENSION // ToDo: it should be checked for the case when parameters are different for the layers
     
    15111717  }
    15121718#endif
    1513 
     1719#if !L0034_COMBINED_LIST_CLEANUP
    15141720  xConfirmPara( m_bUseLComb==false && m_numReorderPics[MAX_TLAYER-1]!=0, "ListCombination can only be 0 in low delay coding (more precisely when L0 and L1 are identical)" );  // Note however this is not the full necessary condition as ref_pic_list_combination_flag can only be 0 if L0 == L1.
     1721#endif
    15151722  xConfirmPara( m_iWaveFrontSynchro < 0, "WaveFrontSynchro cannot be negative" );
    15161723#if !SVC_EXTENSION
     
    15201727
    15211728  xConfirmPara( m_decodedPictureHashSEIEnabled<0 || m_decodedPictureHashSEIEnabled>3, "this hash type is not correct!\n");
     1729
     1730#if J0149_TONE_MAPPING_SEI
     1731  if (m_toneMappingInfoSEIEnabled)
     1732  {
     1733    xConfirmPara( m_toneMapCodedDataBitDepth < 8 || m_toneMapCodedDataBitDepth > 14 , "SEIToneMapCodedDataBitDepth must be in rage 8 to 14");
     1734    xConfirmPara( m_toneMapTargetBitDepth < 1 || (m_toneMapTargetBitDepth > 16 && m_toneMapTargetBitDepth < 255) , "SEIToneMapTargetBitDepth must be in rage 1 to 16 or equal to 255");
     1735    xConfirmPara( m_toneMapModelId < 0 || m_toneMapModelId > 4 , "SEIToneMapModelId must be in rage 0 to 4");
     1736    xConfirmPara( m_cameraIsoSpeedValue == 0, "SEIToneMapCameraIsoSpeedValue shall not be equal to 0");
     1737    xConfirmPara( m_extendedRangeWhiteLevel < 100, "SEIToneMapExtendedRangeWhiteLevel should be greater than or equal to 100");
     1738    xConfirmPara( m_nominalBlackLevelLumaCodeValue >= m_nominalWhiteLevelLumaCodeValue, "SEIToneMapNominalWhiteLevelLumaCodeValue shall be greater than SEIToneMapNominalBlackLevelLumaCodeValue");
     1739    xConfirmPara( m_extendedWhiteLevelLumaCodeValue < m_nominalWhiteLevelLumaCodeValue, "SEIToneMapExtendedWhiteLevelLumaCodeValue shall be greater than or equal to SEIToneMapNominalWhiteLevelLumaCodeValue");
     1740  }
     1741#endif
    15221742
    15231743#if RATE_CONTROL_LAMBDA_DOMAIN
     
    16091829  {
    16101830    printf("=== Layer %d settings === \n", layer);
     1831#if AVC_SYNTAX
     1832    m_acLayerCfg[layer].xPrintParameter( layer );
     1833#else
    16111834    m_acLayerCfg[layer].xPrintParameter();
     1835#endif
    16121836    printf("\n");
    16131837  }
     
    16771901  printf("SQP:%d ", m_uiDeltaQpRD         );
    16781902  printf("ASR:%d ", m_bUseASR             );
     1903#if !L0034_COMBINED_LIST_CLEANUP
    16791904  printf("LComb:%d ", m_bUseLComb         );
     1905#endif
    16801906  printf("FEN:%d ", m_bUseFastEnc         );
    16811907  printf("ECU:%d ", m_bUseEarlyCU         );
     
    17181944#if SVC_EXTENSION
    17191945  printf("RecalQP:%d ", m_recalculateQPAccordingToLambda ? 1 : 0 );
    1720   printf("AVC_BASE:%d ", AVC_BASE);
     1946#if AVC_BASE
     1947  printf("AvcBase:%d ", m_avcBaseLayerFlag ? 1 : 0);
     1948#else
     1949  printf("AvcBase:%d ", 0);
     1950#endif
    17211951#if REF_IDX_FRAMEWORK
    17221952  printf("REF_IDX_FRAMEWORK:%d ", REF_IDX_FRAMEWORK);
    17231953  printf("EL_RAP_SliceType: %d ", m_elRapSliceBEnabled);
    1724   printf("REF_IDX_ME_ZEROMV: %d", REF_IDX_ME_ZEROMV);
     1954  printf("REF_IDX_ME_ZEROMV: %d ", REF_IDX_ME_ZEROMV);
     1955  printf("ENCODER_FAST_MODE: %d ", ENCODER_FAST_MODE);
     1956  printf("REF_IDX_MFM: %d ", REF_IDX_MFM);
    17251957#elif INTRA_BL
    17261958  printf("INTRA_BL:%d ", INTRA_BL);
  • trunk/source/App/TAppEncoder/TAppEncCfg.h

    r125 r189  
    6767  UInt      m_FrameSkip;                                      ///< number of skipped frames from the beginning
    6868  Int       m_framesToBeEncoded;                              ///< number of encoded frames
     69#if AVC_BASE
     70  Int       m_avcBaseLayerFlag;                               ///< AVC_BASElayer_flag
     71#endif
    6972#if AVC_SYNTAX
    70   char*     m_BLSyntaxFile;                                   ///< input syntax file
     73  Char*     m_BLSyntaxFile;                                   ///< input syntax file
    7174#endif
    7275#else
     
    109112  GOPEntry  m_GOPList[MAX_GOP];                               ///< the coding structure entries from the config file
    110113  Int       m_numReorderPics[MAX_TLAYER];                     ///< total number of reorder pictures
     114#if L0323_DPB
     115  Int       m_maxDecPicBuffering[MAX_TLAYER];                 ///< total number of pictures in the decoded picture buffer
     116#else
    111117  Int       m_maxDecPicBuffering[MAX_TLAYER];                 ///< total number of reference pictures needed for decoding
     118#endif
     119#if !L0034_COMBINED_LIST_CLEANUP
    112120  Bool      m_bUseLComb;                                      ///< flag for using combined reference list for uni-prediction in B-slices (JCTVC-D421)
     121#endif
    113122  Bool      m_useTransformSkip;                               ///< flag for enabling intra transform skipping
    114123  Bool      m_useTransformSkipFast;                           ///< flag for enabling fast intra transform skipping
     
    172181  Int       m_loopFilterTcOffsetDiv2;                       ///< tc offset for deblocking filter
    173182  Bool      m_DeblockingFilterControlPresent;                 ///< deblocking filter control present flag in PPS
     183#if L0386_DB_METRIC
     184  Bool      m_DeblockingFilterMetric;                         ///< blockiness metric in encoder
     185#endif
    174186 
    175187  // coding tools (PCM)
     
    223235  Int       m_bufferingPeriodSEIEnabled;
    224236  Int       m_pictureTimingSEIEnabled;
     237#if J0149_TONE_MAPPING_SEI
     238  Bool      m_toneMappingInfoSEIEnabled;
     239  Int       m_toneMapId;
     240  Bool      m_toneMapCancelFlag;
     241  Bool      m_toneMapPersistenceFlag;
     242  Int       m_toneMapCodedDataBitDepth;
     243  Int       m_toneMapTargetBitDepth;
     244  Int       m_toneMapModelId;
     245  Int       m_toneMapMinValue;
     246  Int       m_toneMapMaxValue;
     247  Int       m_sigmoidMidpoint;
     248  Int       m_sigmoidWidth;
     249  Int       m_numPivots;
     250  Int       m_cameraIsoSpeedIdc;
     251  Int       m_cameraIsoSpeedValue;
     252  Int       m_exposureCompensationValueSignFlag;
     253  Int       m_exposureCompensationValueNumerator;
     254  Int       m_exposureCompensationValueDenomIdc;
     255  Int       m_refScreenLuminanceWhite;
     256  Int       m_extendedRangeWhiteLevel;
     257  Int       m_nominalBlackLevelLumaCodeValue;
     258  Int       m_nominalWhiteLevelLumaCodeValue;
     259  Int       m_extendedWhiteLevelLumaCodeValue;
     260  Int*      m_startOfCodedInterval;
     261  Int*      m_codedPivotValue;
     262  Int*      m_targetPivotValue;
     263#endif
    225264  Int       m_framePackingSEIEnabled;
    226265  Int       m_framePackingSEIType;
     
    232271  Int       m_gradualDecodingRefreshInfoEnabled;
    233272  Int       m_decodingUnitInfoSEIEnabled;
     273#if L0208_SOP_DESCRIPTION_SEI
     274  Int       m_SOPDescriptionSEIEnabled;
     275#endif
     276#if K0180_SCALABLE_NESTING_SEI
     277  Int       m_scalableNestingSEIEnabled;
     278#endif
    234279  // weighted prediction
    235280  Bool      m_useWeightedPred;                    ///< Use of weighted prediction in P slices
     
    316361  Int*      m_constantPicRateIdc;                                ///< Indicates constant picture rate idc for various sub-layers
    317362#endif
    318   #
    319363public:
    320364  TAppEncCfg();
  • trunk/source/App/TAppEncoder/TAppEncLayerCfg.cpp

    r125 r189  
    116116}
    117117
     118#if AVC_SYNTAX
     119Void TAppEncLayerCfg::xPrintParameter( UInt layerId )
     120#else
    118121Void TAppEncLayerCfg::xPrintParameter()
     122#endif
    119123{
    120124  printf("Input File                    : %s\n", m_cInputFile.c_str()  );
    121125  printf("Reconstruction File           : %s\n", m_cReconFile.c_str()  );
    122126#if AVC_SYNTAX
    123   printf("Base layer input file         : %s\n", m_cAppEncCfg->getBLSyntaxFile() );
     127  if( layerId == 0 )
     128  {
     129    printf("Base layer syntax file        : %s\n", m_cAppEncCfg->getBLSyntaxFile() );
     130  }
    124131#endif
    125132  printf("Real     Format               : %dx%d %dHz\n", m_iSourceWidth - m_confLeft - m_confRight, m_iSourceHeight - m_confTop - m_confBottom, m_iFrameRate );
  • trunk/source/App/TAppEncoder/TAppEncLayerCfg.h

    r125 r189  
    5454  Int*      m_aidQP;                                          ///< array of slice QP values
    5555  TAppEncCfg* m_cAppEncCfg;                                   ///< pointer to app encoder config
     56#if SCALED_REF_LAYER_OFFSETS
     57  Int       m_scaledRefLayerLeftOffset;
     58  Int       m_scaledRefLayerTopOffset;
     59  Int       m_scaledRefLayerRightOffset;
     60  Int       m_scaledRefLayerBottomOffset;
     61#endif 
    5662public:
    5763  TAppEncLayerCfg();
     
    6369  bool  parseCfg  ( const string& cfgFileName );              ///< parse layer configuration file to fill member variables
    6470
     71#if AVC_SYNTAX
     72  Void  xPrintParameter( UInt layerId );
     73#else
    6574  Void  xPrintParameter();
     75#endif
    6676  Bool  xCheckParameter();
    6777
  • trunk/source/App/TAppEncoder/TAppEncTop.cpp

    r125 r189  
    11/* The copyright in this software is being made available under the BSD
    2 * License, included below. This software may be subject to other third party
    3 * and contributor rights, including patent rights, and no such rights are
    4 * granted under this license. 
    5 *
    6 * Copyright (c) 2010-2013, ITU/ISO/IEC
    7 * All rights reserved.
    8 *
    9 * Redistribution and use in source and binary forms, with or without
    10 * modification, are permitted provided that the following conditions are met:
    11 *
    12 *  * Redistributions of source code must retain the above copyright notice,
    13 *    this list of conditions and the following disclaimer.
    14 *  * Redistributions in binary form must reproduce the above copyright notice,
    15 *    this list of conditions and the following disclaimer in the documentation
    16 *    and/or other materials provided with the distribution.
    17 *  * Neither the name of the ITU/ISO/IEC nor the names of its contributors may
    18 *    be used to endorse or promote products derived from this software without
    19 *    specific prior written permission.
    20 *
    21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
    22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
    24 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
    25 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
    26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
    27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
    28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
    29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
    30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
    31 * THE POSSIBILITY OF SUCH DAMAGE.
    32 */
     2 * License, included below. This software may be subject to other third party
     3 * and contributor rights, including patent rights, and no such rights are
     4 * granted under this license. 
     5 *
     6 * Copyright (c) 2010-2013, ITU/ISO/IEC
     7 * All rights reserved.
     8 *
     9 * Redistribution and use in source and binary forms, with or without
     10 * modification, are permitted provided that the following conditions are met:
     11 *
     12 *  * Redistributions of source code must retain the above copyright notice,
     13 *    this list of conditions and the following disclaimer.
     14 *  * Redistributions in binary form must reproduce the above copyright notice,
     15 *    this list of conditions and the following disclaimer in the documentation
     16 *    and/or other materials provided with the distribution.
     17 *  * Neither the name of the ITU/ISO/IEC nor the names of its contributors may
     18 *    be used to endorse or promote products derived from this software without
     19 *    specific prior written permission.
     20 *
     21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     24 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
     25 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
     31 * THE POSSIBILITY OF SUCH DAMAGE.
     32 */
    3333
    3434/** \file     TAppEncTop.cpp
    35 \brief    Encoder application class
     35    \brief    Encoder application class
    3636*/
    3737
     
    112112
    113113#if REF_IDX_MFM
     114#if AVC_BASE
     115    m_acTEncTop[layer].setMFMEnabledFlag(layer == 0 ? false : ( m_avcBaseLayerFlag ? AVC_SYNTAX : true ));
     116#else
    114117    m_acTEncTop[layer].setMFMEnabledFlag(layer == 0 ? false : true);
     118#endif
    115119#endif
    116120    // set layer ID
     
    167171    m_acTEncTop[layer].setLoopFilterTcOffset           ( m_loopFilterTcOffsetDiv2    );
    168172    m_acTEncTop[layer].setDeblockingFilterControlPresent( m_DeblockingFilterControlPresent);
     173#if L0386_DB_METRIC
     174    m_acTEncTop[layer].setDeblockingFilterMetric       ( m_DeblockingFilterMetric );
     175#endif
    169176
    170177    //====== Motion search ========
     
    200207    m_acTEncTop[layer].setUseHADME                     ( m_bUseHADME    );
    201208    m_acTEncTop[layer].setUseLossless                  ( m_useLossless );
    202     m_acTEncTop[layer].setUseLComb                     ( m_bUseLComb    );
     209#if !L0034_COMBINED_LIST_CLEANUP
     210    m_cTEncTop.setUseLComb                             ( m_bUseLComb    );
     211#endif
    203212    m_acTEncTop[layer].setdQPs                         ( m_acLayerCfg[layer].getdQPs() );
    204213    m_acTEncTop[layer].setUseRDOQ                      ( m_useRDOQ     );
     
    270279    m_acTEncTop[layer].setBufferingPeriodSEIEnabled( m_bufferingPeriodSEIEnabled );
    271280    m_acTEncTop[layer].setPictureTimingSEIEnabled( m_pictureTimingSEIEnabled );
     281#if J0149_TONE_MAPPING_SEI
     282    m_acTEncTop[layer].setToneMappingInfoSEIEnabled                 ( m_toneMappingInfoSEIEnabled );
     283    m_acTEncTop[layer].setTMISEIToneMapId                           ( m_toneMapId );
     284    m_acTEncTop[layer].setTMISEIToneMapCancelFlag                   ( m_toneMapCancelFlag );
     285    m_acTEncTop[layer].setTMISEIToneMapPersistenceFlag              ( m_toneMapPersistenceFlag );
     286    m_acTEncTop[layer].setTMISEICodedDataBitDepth                   ( m_toneMapCodedDataBitDepth );
     287    m_acTEncTop[layer].setTMISEITargetBitDepth                      ( m_toneMapTargetBitDepth );
     288    m_acTEncTop[layer].setTMISEIModelID                             ( m_toneMapModelId );
     289    m_acTEncTop[layer].setTMISEIMinValue                            ( m_toneMapMinValue );
     290    m_acTEncTop[layer].setTMISEIMaxValue                            ( m_toneMapMaxValue );
     291    m_acTEncTop[layer].setTMISEISigmoidMidpoint                     ( m_sigmoidMidpoint );
     292    m_acTEncTop[layer].setTMISEISigmoidWidth                        ( m_sigmoidWidth );
     293    m_acTEncTop[layer].setTMISEIStartOfCodedInterva                 ( m_startOfCodedInterval );
     294    m_acTEncTop[layer].setTMISEINumPivots                           ( m_numPivots );
     295    m_acTEncTop[layer].setTMISEICodedPivotValue                     ( m_codedPivotValue );
     296    m_acTEncTop[layer].setTMISEITargetPivotValue                    ( m_targetPivotValue );
     297    m_acTEncTop[layer].setTMISEICameraIsoSpeedIdc                   ( m_cameraIsoSpeedIdc );
     298    m_acTEncTop[layer].setTMISEICameraIsoSpeedValue                 ( m_cameraIsoSpeedValue );
     299    m_acTEncTop[layer].setTMISEIExposureCompensationValueSignFlag   ( m_exposureCompensationValueSignFlag );
     300    m_acTEncTop[layer].setTMISEIExposureCompensationValueNumerator  ( m_exposureCompensationValueNumerator );
     301    m_acTEncTop[layer].setTMISEIExposureCompensationValueDenomIdc   ( m_exposureCompensationValueDenomIdc );
     302    m_acTEncTop[layer].setTMISEIRefScreenLuminanceWhite             ( m_refScreenLuminanceWhite );
     303    m_acTEncTop[layer].setTMISEIExtendedRangeWhiteLevel             ( m_extendedRangeWhiteLevel );
     304    m_acTEncTop[layer].setTMISEINominalBlackLevelLumaCodeValue      ( m_nominalBlackLevelLumaCodeValue );
     305    m_acTEncTop[layer].setTMISEINominalWhiteLevelLumaCodeValue      ( m_nominalWhiteLevelLumaCodeValue );
     306    m_acTEncTop[layer].setTMISEIExtendedWhiteLevelLumaCodeValue     ( m_extendedWhiteLevelLumaCodeValue );
     307#endif
    272308    m_acTEncTop[layer].setFramePackingArrangementSEIEnabled( m_framePackingSEIEnabled );
    273309    m_acTEncTop[layer].setFramePackingArrangementSEIType( m_framePackingSEIType );
     
    279315    m_acTEncTop[layer].setGradualDecodingRefreshInfoEnabled( m_gradualDecodingRefreshInfoEnabled );
    280316    m_acTEncTop[layer].setDecodingUnitInfoSEIEnabled( m_decodingUnitInfoSEIEnabled );
     317#if L0208_SOP_DESCRIPTION_SEI
     318    m_acTEncTop[layer].setSOPDescriptionSEIEnabled( m_SOPDescriptionSEIEnabled );
     319#endif
     320#if K0180_SCALABLE_NESTING_SEI
     321    m_acTEncTop[layer].setScalableNestingSEIEnabled( m_scalableNestingSEIEnabled );
     322#endif
    281323    m_acTEncTop[layer].setUniformSpacingIdr          ( m_iUniformSpacingIdr );
    282324    m_acTEncTop[layer].setNumColumnsMinus1           ( m_iNumColumnsMinus1 );
     
    376418    m_acTEncTop[layer].setElRapSliceTypeB(layer == 0? 0 : m_elRapSliceBEnabled);
    377419#endif
     420#if SCALED_REF_LAYER_OFFSETS
     421    if( layer > 0 )
     422    {
     423      m_acTEncTop[layer].getScaledRefLayerWindow().setWindow( 2*m_acLayerCfg[layer].m_scaledRefLayerLeftOffset, 2*m_acLayerCfg[layer].m_scaledRefLayerRightOffset,
     424                                                  2*m_acLayerCfg[layer].m_scaledRefLayerTopOffset, 2*m_acLayerCfg[layer].m_scaledRefLayerBottomOffset); 
     425    }
     426#endif
    378427  }
    379428}
     
    442491  m_cTEncTop.setLoopFilterTcOffset           ( m_loopFilterTcOffsetDiv2    );
    443492  m_cTEncTop.setDeblockingFilterControlPresent( m_DeblockingFilterControlPresent);
     493#if L0386_DB_METRIC
     494  m_cTEncTop.setDeblockingFilterMetric       ( m_DeblockingFilterMetric );
     495#endif
    444496
    445497  //====== Motion search ========
     
    475527  m_cTEncTop.setUseHADME                     ( m_bUseHADME    );
    476528  m_cTEncTop.setUseLossless                  ( m_useLossless );
     529#if !L0034_COMBINED_LIST_CLEANUP
    477530  m_cTEncTop.setUseLComb                     ( m_bUseLComb    );
     531#endif
    478532  m_cTEncTop.setdQPs                         ( m_aidQP        );
    479533  m_cTEncTop.setUseRDOQ                      ( m_useRDOQ     );
     
    545599  m_cTEncTop.setBufferingPeriodSEIEnabled( m_bufferingPeriodSEIEnabled );
    546600  m_cTEncTop.setPictureTimingSEIEnabled( m_pictureTimingSEIEnabled );
     601#if J0149_TONE_MAPPING_SEI
     602  m_cTEncTop.setToneMappingInfoSEIEnabled                 ( m_toneMappingInfoSEIEnabled );
     603  m_cTEncTop.setTMISEIToneMapId                           ( m_toneMapId );
     604  m_cTEncTop.setTMISEIToneMapCancelFlag                   ( m_toneMapCancelFlag );
     605  m_cTEncTop.setTMISEIToneMapPersistenceFlag              ( m_toneMapPersistenceFlag );
     606  m_cTEncTop.setTMISEICodedDataBitDepth                   ( m_toneMapCodedDataBitDepth );
     607  m_cTEncTop.setTMISEITargetBitDepth                      ( m_toneMapTargetBitDepth );
     608  m_cTEncTop.setTMISEIModelID                             ( m_toneMapModelId );
     609  m_cTEncTop.setTMISEIMinValue                            ( m_toneMapMinValue );
     610  m_cTEncTop.setTMISEIMaxValue                            ( m_toneMapMaxValue );
     611  m_cTEncTop.setTMISEISigmoidMidpoint                     ( m_sigmoidMidpoint );
     612  m_cTEncTop.setTMISEISigmoidWidth                        ( m_sigmoidWidth );
     613  m_cTEncTop.setTMISEIStartOfCodedInterva                 ( m_startOfCodedInterval );
     614  m_cTEncTop.setTMISEINumPivots                           ( m_numPivots );
     615  m_cTEncTop.setTMISEICodedPivotValue                     ( m_codedPivotValue );
     616  m_cTEncTop.setTMISEITargetPivotValue                    ( m_targetPivotValue );
     617  m_cTEncTop.setTMISEICameraIsoSpeedIdc                   ( m_cameraIsoSpeedIdc );
     618  m_cTEncTop.setTMISEICameraIsoSpeedValue                 ( m_cameraIsoSpeedValue );
     619  m_cTEncTop.setTMISEIExposureCompensationValueSignFlag   ( m_exposureCompensationValueSignFlag );
     620  m_cTEncTop.setTMISEIExposureCompensationValueNumerator  ( m_exposureCompensationValueNumerator );
     621  m_cTEncTop.setTMISEIExposureCompensationValueDenomIdc   ( m_exposureCompensationValueDenomIdc );
     622  m_cTEncTop.setTMISEIRefScreenLuminanceWhite             ( m_refScreenLuminanceWhite );
     623  m_cTEncTop.setTMISEIExtendedRangeWhiteLevel             ( m_extendedRangeWhiteLevel );
     624  m_cTEncTop.setTMISEINominalBlackLevelLumaCodeValue      ( m_nominalBlackLevelLumaCodeValue );
     625  m_cTEncTop.setTMISEINominalWhiteLevelLumaCodeValue      ( m_nominalWhiteLevelLumaCodeValue );
     626  m_cTEncTop.setTMISEIExtendedWhiteLevelLumaCodeValue     ( m_extendedWhiteLevelLumaCodeValue );
     627#endif
    547628  m_cTEncTop.setFramePackingArrangementSEIEnabled( m_framePackingSEIEnabled );
    548629  m_cTEncTop.setFramePackingArrangementSEIType( m_framePackingSEIType );
     
    554635  m_cTEncTop.setGradualDecodingRefreshInfoEnabled( m_gradualDecodingRefreshInfoEnabled );
    555636  m_cTEncTop.setDecodingUnitInfoSEIEnabled( m_decodingUnitInfoSEIEnabled );
     637#if L0208_SOP_DESCRIPTION_SEI
     638  m_cTEncTop.setSOPDescriptionSEIEnabled( m_SOPDescriptionSEIEnabled );
     639#endif
     640#if K0180_SCALABLE_NESTING_SEI
     641  m_cTEncTop.setScalableNestingSEIEnabled( m_scalableNestingSEIEnabled );
     642#endif
    556643  m_cTEncTop.setUniformSpacingIdr          ( m_iUniformSpacingIdr );
    557644  m_cTEncTop.setNumColumnsMinus1           ( m_iNumColumnsMinus1 );
     
    729816#if VPS_EXTN_MASK_AND_DIM_INFO
    730817  UInt i = 0, dimIdLen = 0;
     818#if AVC_BASE
     819  vps->setAvcBaseLayerFlag(m_avcBaseLayerFlag);
     820#else
    731821  vps->setAvcBaseLayerFlag(false);
     822#endif
    732823  vps->setSplittingFlag(false);
    733824  for(i = 0; i < MAX_VPS_NUM_SCALABILITY_TYPES; i++)
     
    769860#endif
    770861  // Target output layer
     862#if VPS_PROFILE_OUTPUT_LAYERS
     863  vps->setNumOutputLayerSets(2);    // 2 including the default base-layer set.
     864  vps->setNumProfileTierLevel(2);   // 1 for the enhancement layer
     865  vps->setProfileLevelTierIdx(1, 1);
     866  vps->setDefaultOneTargetOutputLayerFlag(true);
     867  Int lsIdx = 1;
     868  vps->setOutputLayerSetIdx(1, lsIdx); // Because only one layer set
     869#else
    771870  vps->setNumOutputLayerSets(1);
    772871  Int lsIdx = 1;
    773872  vps->setOutputLayerSetIdx(0, lsIdx); // Because only one layer set
     873#endif
    774874  // Include the highest layer as output layer
    775875  for(UInt layer=0; layer <= vps->getMaxLayerId() ; layer++)
     
    802902  }
    803903#endif
     904#if JCTVC_M0458_INTERLAYER_RPS_SIG       
     905    vps->setMaxOneActiveRefLayerFlag(true);
     906#endif
    804907#else
    805908  m_cTEncTop.init();
     
    812915
    813916/**
    814 - create internal class
    815 - initialize internal variable
    816 - until the end of input YUV file, call encoding function in TEncTop class
    817 - delete allocated buffers
    818 - destroy internal class
    819 .
    820 */
     917 - create internal class
     918 - initialize internal variable
     919 - until the end of input YUV file, call encoding function in TEncTop class
     920 - delete allocated buffers
     921 - destroy internal class
     922 .
     923 */
    821924#if SVC_EXTENSION
    822925Void TAppEncTop::encode()
     
    855958
    856959#if AVC_SYNTAX
    857   if( !m_BLSyntaxFile )
    858   {
    859     printf( "Wrong base layer syntax input file\n" );
    860     exit(EXIT_FAILURE);
    861   }
    862   fstream streamSyntaxFile( m_BLSyntaxFile, fstream::in | fstream::binary );
    863   if( !streamSyntaxFile.good() )
    864   {
    865     printf( "Base layer syntax input reading error\n" );
    866     exit(EXIT_FAILURE);
    867   }
    868   m_acTEncTop[0].setBLSyntaxFile( &streamSyntaxFile );
     960  fstream streamSyntaxFile;
     961  if( m_acTEncTop[0].getVPS()->getAvcBaseLayerFlag() )
     962  {
     963    if( !m_BLSyntaxFile )
     964    {
     965      printf( "Wrong base layer syntax input file\n" );
     966      exit(EXIT_FAILURE);
     967    }
     968    streamSyntaxFile.open( m_BLSyntaxFile, fstream::in | fstream::binary );
     969    if( !streamSyntaxFile.good() )
     970    {
     971      printf( "Base layer syntax input reading error\n" );
     972      exit(EXIT_FAILURE);
     973    }
     974    m_acTEncTop[0].setBLSyntaxFile( &streamSyntaxFile );
     975  }
    869976#endif
    870977
     
    11021209
    11031210/**
    1104 - application has picture buffer list with size of GOP
    1105 - picture buffer list acts as ring buffer
    1106 - end of the list has the latest picture
    1107 .
    1108 */
     1211 - application has picture buffer list with size of GOP
     1212 - picture buffer list acts as ring buffer
     1213 - end of the list has the latest picture
     1214 .
     1215 */
    11091216#if SVC_EXTENSION
    11101217Void TAppEncTop::xGetBuffer( TComPicYuv*& rpcPicYuvRec, UInt layer)
     
    12221329
    12231330/** \param iNumEncoded  number of encoded frames
    1224 */
     1331 */
    12251332Void TAppEncTop::xWriteOutput(std::ostream& bitstreamFile, Int iNumEncoded, const std::list<AccessUnit>& accessUnits)
    12261333{
     
    12401347    if (m_pchReconFile)
    12411348    {
     1349#if SYNTAX_OUTPUT && ILP_DECODED_PICTURE
     1350      m_cTVideoIOYuvReconFile.write( pcPicYuvRec );
     1351#else
    12421352      m_cTVideoIOYuvReconFile.write( pcPicYuvRec, m_confLeft, m_confRight, m_confTop, m_confBottom );
     1353#endif
    12431354    }
    12441355
     
    12511362
    12521363/**
    1253 *
    1254 */
     1364 *
     1365 */
    12551366void TAppEncTop::rateStatsAccum(const AccessUnit& au, const std::vector<UInt>& annexBsizes)
    12561367{
     
    12641375    case NAL_UNIT_CODED_SLICE_TRAIL_R:
    12651376    case NAL_UNIT_CODED_SLICE_TRAIL_N:
    1266     case NAL_UNIT_CODED_SLICE_TLA:
     1377    case NAL_UNIT_CODED_SLICE_TLA_R:
    12671378    case NAL_UNIT_CODED_SLICE_TSA_N:
    12681379    case NAL_UNIT_CODED_SLICE_STSA_R:
    12691380    case NAL_UNIT_CODED_SLICE_STSA_N:
    1270     case NAL_UNIT_CODED_SLICE_BLA:
    1271     case NAL_UNIT_CODED_SLICE_BLANT:
     1381    case NAL_UNIT_CODED_SLICE_BLA_W_LP:
     1382    case NAL_UNIT_CODED_SLICE_BLA_W_RADL:
    12721383    case NAL_UNIT_CODED_SLICE_BLA_N_LP:
    1273     case NAL_UNIT_CODED_SLICE_IDR:
     1384    case NAL_UNIT_CODED_SLICE_IDR_W_RADL:
    12741385    case NAL_UNIT_CODED_SLICE_IDR_N_LP:
    12751386    case NAL_UNIT_CODED_SLICE_CRA:
    12761387    case NAL_UNIT_CODED_SLICE_RADL_N:
    1277     case NAL_UNIT_CODED_SLICE_DLP:
     1388    case NAL_UNIT_CODED_SLICE_RADL_R:
    12781389    case NAL_UNIT_CODED_SLICE_RASL_N:
    1279     case NAL_UNIT_CODED_SLICE_TFD:
     1390    case NAL_UNIT_CODED_SLICE_RASL_R:
    12801391    case NAL_UNIT_VPS:
    12811392    case NAL_UNIT_SPS:
Note: See TracChangeset for help on using the changeset viewer.