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


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

merge SHM-4.1-dev branch

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/source

  • trunk/source/App/TAppEncoder/TAppEncCfg.cpp

    r494 r540  
    399399  string* cfg_predLayerIdsPtr    [MAX_LAYERS];
    400400#endif
     401#if O0098_SCALED_REF_LAYER_ID
     402  string    cfg_scaledRefLayerId [MAX_LAYERS];
     403#endif
    401404  string    cfg_scaledRefLayerLeftOffset [MAX_LAYERS];
    402405  string    cfg_scaledRefLayerTopOffset [MAX_LAYERS];
     
    405408  Int*      cfg_numScaledRefLayerOffsets[MAX_LAYERS];
    406409
     410#if O0098_SCALED_REF_LAYER_ID
     411  string*    cfg_scaledRefLayerIdPtr           [MAX_LAYERS];
     412#endif
    407413  string*    cfg_scaledRefLayerLeftOffsetPtr   [MAX_LAYERS];
    408414  string*    cfg_scaledRefLayerTopOffsetPtr    [MAX_LAYERS];
     
    471477    for(Int i = 0; i < MAX_LAYERS; i++)
    472478    {
     479#if O0098_SCALED_REF_LAYER_ID
     480      cfg_scaledRefLayerIdPtr          [layer] = &cfg_scaledRefLayerId[layer]          ;
     481#endif
    473482      cfg_scaledRefLayerLeftOffsetPtr  [layer] = &cfg_scaledRefLayerLeftOffset[layer]  ;
    474483      cfg_scaledRefLayerTopOffsetPtr   [layer] = &cfg_scaledRefLayerTopOffset[layer]   ;
     
    582591#endif
    583592  ("NumScaledRefLayerOffsets%d",    cfg_numScaledRefLayerOffsets,     0, MAX_LAYERS,  "Number of scaled offset layer sets ")
     593#if O0098_SCALED_REF_LAYER_ID
     594  ("ScaledRefLayerId%d",           cfg_scaledRefLayerIdPtr,          string(""), MAX_LAYERS, "Layer ID of scaled base layer picture")
     595#endif
    584596  ("ScaledRefLayerLeftOffset%d",   cfg_scaledRefLayerLeftOffsetPtr,  string(""), MAX_LAYERS, "Horizontal offset of top-left luma sample of scaled base layer picture with respect to"
    585597                                                                 " top-left luma sample of the EL picture, in units of two luma samples")
     
    602614  ("MaxTidRefPresentFlag", m_maxTidRefPresentFlag, true, "max_tid_ref_present_flag (0: not present, 1: present(default)) " )
    603615  ("MaxTidIlRefPicsPlus1%d", cfg_maxTidIlRefPicsPlus1, 1, MAX_LAYERS, "allowed maximum temporal_id for inter-layer prediction")
    604 #endif
     616#endif
     617#if O0223_PICTURE_TYPES_ALIGN_FLAG
     618  ("CrossLayerPictureTypeAlignFlag", m_crossLayerPictureTypeAlignFlag, true, "align picture type across layers" ) 
     619#endif
     620#if N0147_IRAP_ALIGN_FLAG
     621    ("CrossLayerIrapAlignFlag", m_crossLayerIrapAlignFlag, true, "align IRAP across layers" ) 
     622#endif
    605623#if AVC_BASE
    606624  ("AvcBase,-avc",            m_avcBaseLayerFlag,     0, "avc_base_layer_flag")
     
    773791  ("MaxNumOffsetsPerPic",      m_maxNumOffsetsPerPic,       2048,  "Max number of SAO offset per picture (Default: 2048)")   
    774792  ("SAOLcuBoundary",           m_saoLcuBoundary,            false, "0: right/bottom LCU boundary areas skipped from SAO parameter estimation, 1: non-deblocked pixels are used for those areas")
     793#if !HM_CLEANUP_SAO
    775794  ("SAOLcuBasedOptimization",  m_saoLcuBasedOptimization,   true,  "0: SAO picture-based optimization, 1: SAO LCU-based optimization ")
     795#endif 
    776796  ("SliceMode",                m_sliceMode,                0,     "0: Disable all Recon slice limits, 1: Enforce max # of LCUs, 2: Enforce max # of bytes, 3:specify tiles per dependent slice")
    777797  ("SliceArgument",            m_sliceArgument,            0,     "Depending on SliceMode being:"
     
    827847  ("FIS", m_useFastIntraScalable, false, "Fast Intra Decision for Scalable HEVC")
    828848#endif
    829 #if RATE_CONTROL_LAMBDA_DOMAIN
    830849#if RC_SHVC_HARMONIZATION
    831850  ("RateControl%d", cfg_RCEnableRateControl, false, MAX_LAYERS, "Rate control: enable rate control for layer %d")
     
    839858  ( "RateControl",         m_RCEnableRateControl,   false, "Rate control: enable rate control" )
    840859  ( "TargetBitrate",       m_RCTargetBitrate,           0, "Rate control: target bitrate" )
    841 #if M0036_RC_IMPROVEMENT
    842860  ( "KeepHierarchicalBit", m_RCKeepHierarchicalBit,     0, "Rate control: 0: equal bit allocation; 1: fixed ratio bit allocation; 2: adaptive ratio bit allocation" )
    843 #else
    844   ( "KeepHierarchicalBit", m_RCKeepHierarchicalBit, false, "Rate control: keep hierarchical bit allocation in rate control algorithm" )
    845 #endif
    846861  ( "LCULevelRateControl", m_RCLCULevelRC,           true, "Rate control: true: LCU level RC; false: picture level RC" )
    847862  ( "RCLCUSeparateModel",  m_RCUseLCUSeparateModel,  true, "Rate control: use LCU level separate R-lambda model" )
    848863  ( "InitialQP",           m_RCInitialQP,               0, "Rate control: initial QP" )
    849864  ( "RCForceIntraQP",      m_RCForceIntraQP,        false, "Rate control: force intra QP to be equal to initial QP" )
    850 #endif
    851 #else
    852   ("RateCtrl,-rc", m_enableRateCtrl, false, "Rate control on/off")
    853   ("TargetBitrate,-tbr", m_targetBitrate, 0, "Input target bitrate")
    854   ("NumLCUInUnit,-nu", m_numLCUInUnit, 0, "Number of LCUs in an Unit")
    855865#endif
    856866
     
    954964  ("AdaptiveResolutionChange",     m_adaptiveResolutionChange, 0, "Adaptive resolution change frame number. Should coincide with EL RAP picture. (0: disable)")
    955965#endif
     966#if HIGHER_LAYER_IRAP_SKIP_FLAG
     967  ("SkipPictureAtArcSwitch",     m_skipPictureAtArcSwitch, false, "Code the higher layer picture in ARC up-switching as a skip picture. (0: disable)")
     968#endif
    956969#if N0383_IL_CONSTRAINED_TILE_SETS_SEI
    957970  ("SEIInterLayerConstrainedTileSets", m_interLayerConstrainedTileSetsSEIEnabled, false, "Control generation of inter layer constrained tile sets SEI message")
    958971  ("IlNumSetsInMessage",               m_ilNumSetsInMessage,                         0u, "Number of inter layer constrained tile sets")
    959972  ("TileSetsArray",                    cfg_tileSets,                         string(""), "Array containing tile sets params (TopLeftTileIndex, BottonRightTileIndex and ilcIdc for each set) ")
     973#endif
     974#if O0153_ALT_OUTPUT_LAYER_FLAG
     975  ("AltOutputLayerFlag",               m_altOutputLayerFlag,                      false, "Specifies the value of alt_output_layer_flag in VPS extension")
     976#endif
     977#if O0149_CROSS_LAYER_BLA_FLAG
     978  ("CrossLayerBLAFlag",                m_crossLayerBLAFlag,                       false, "Specifies the value of cross_layer_bla_flag in VPS")
    960979#endif
    961980  ;
     
    10861105    if(m_acLayerCfg[layer].m_numScaledRefLayerOffsets)
    10871106    {
     1107#if O0098_SCALED_REF_LAYER_ID
     1108      assert( strcmp(cfg_scaledRefLayerId[layer].c_str(),  ""));
     1109#endif
    10881110      assert( strcmp(cfg_scaledRefLayerLeftOffset[layer].c_str(),  "") ||
    10891111              strcmp(cfg_scaledRefLayerRightOffset[layer].c_str(), "") ||
     
    10941116
    10951117    Int *tempArray = NULL;   // Contain the value
     1118
     1119#if O0098_SCALED_REF_LAYER_ID
     1120    // ID //
     1121    if(strcmp(cfg_scaledRefLayerId[layer].c_str(),  ""))
     1122    {
     1123      cfgStringToArray( &tempArray, cfg_scaledRefLayerId[layer], m_acLayerCfg[layer].m_numScaledRefLayerOffsets, "ScaledRefLayerId");
     1124      if(tempArray)
     1125      {
     1126        for(Int i = 0; i < m_acLayerCfg[layer].m_numScaledRefLayerOffsets; i++)
     1127        {
     1128          m_acLayerCfg[layer].m_scaledRefLayerId[i] = tempArray[i];
     1129        }
     1130        delete [] tempArray; tempArray = NULL;
     1131      }
     1132    }
     1133#endif
     1134
    10961135    // Left offset //
    10971136    if(strcmp(cfg_scaledRefLayerLeftOffset[layer].c_str(),  ""))
     
    21532192  }
    21542193
    2155 #if RATE_CONTROL_LAMBDA_DOMAIN
    21562194#if RC_SHVC_HARMONIZATION
    21572195  for ( Int layer=0; layer<m_numLayers; layer++ )
     
    21842222  }
    21852223#endif
    2186 #else
    2187   if(m_enableRateCtrl)
    2188   {
    2189     Int numLCUInWidth  = (m_iSourceWidth  / m_uiMaxCUWidth) + (( m_iSourceWidth  %  m_uiMaxCUWidth ) ? 1 : 0);
    2190     Int numLCUInHeight = (m_iSourceHeight / m_uiMaxCUHeight)+ (( m_iSourceHeight %  m_uiMaxCUHeight) ? 1 : 0);
    2191     Int numLCUInPic    =  numLCUInWidth * numLCUInHeight;
    2192 
    2193     xConfirmPara( (numLCUInPic % m_numLCUInUnit) != 0, "total number of LCUs in a frame should be completely divided by NumLCUInUnit" );
    2194 
    2195     m_iMaxDeltaQP       = MAX_DELTA_QP;
    2196     m_iMaxCuDQPDepth    = MAX_CUDQP_DEPTH;
    2197   }
    2198 #endif
    21992224
    22002225  xConfirmPara(!m_TransquantBypassEnableFlag && m_CUTransquantBypassFlagValue, "CUTransquantBypassFlagValue cannot be 1 when TransquantBypassEnableFlag is 0");
     
    22842309    xConfirmPara(m_numLayers != 2, "Adaptive resolution change works with 2 layers only");
    22852310    xConfirmPara(m_acLayerCfg[1].m_iIntraPeriod == 0 || (m_adaptiveResolutionChange % m_acLayerCfg[1].m_iIntraPeriod) != 0, "Adaptive resolution change must happen at enhancement layer RAP picture");
     2311  }
     2312#endif
     2313#if HIGHER_LAYER_IRAP_SKIP_FLAG
     2314  if (m_adaptiveResolutionChange > 0)
     2315  {
     2316    xConfirmPara(m_crossLayerIrapAlignFlag != 0, "Cross layer IRAP alignment must be disabled when using adaptive resolution change.");
     2317  }
     2318  if (m_skipPictureAtArcSwitch)
     2319  {
     2320    xConfirmPara(m_adaptiveResolutionChange <= 0, "Skip picture at ARC switching only works when Adaptive Resolution Change is active (AdaptiveResolutionChange > 0)");
    22862321  }
    22872322#endif
     
    23792414  printf("Multiview                     : %d\n", m_scalabilityMask[1] );
    23802415  printf("Scalable                      : %d\n", m_scalabilityMask[2] );
     2416#if AVC_BASE
     2417  printf("Base layer                    : %s\n", m_avcBaseLayerFlag ? "AVC" : "HEVC");
     2418#endif
    23812419#if AUXILIARY_PICTURES
    23822420  printf("Auxiliary pictures            : %d\n", m_scalabilityMask[3] );
     
    23882426#if M0040_ADAPTIVE_RESOLUTION_CHANGE
    23892427  printf("Adaptive Resolution Change    : %d\n", m_adaptiveResolutionChange );
     2428#endif
     2429#if HIGHER_LAYER_IRAP_SKIP_FLAG
     2430  printf("Skip picture at ARC switch    : %d\n", m_skipPictureAtArcSwitch );
     2431#endif
     2432#if O0223_PICTURE_TYPES_ALIGN_FLAG
     2433  printf("Align picture type            : %d\n", m_crossLayerPictureTypeAlignFlag );
     2434#endif
     2435#if N0147_IRAP_ALIGN_FLAG
     2436  printf("Cross layer IRAP alignment    : %d\n", m_crossLayerIrapAlignFlag );
    23902437#endif
    23912438  for(UInt layer=0; layer<m_numLayers; layer++)
     
    24532500#endif
    24542501#if O0215_PHASE_ALIGNMENT
    2455   printf("cross-layer sample alignment : %d\n", m_phaseAlignFlag);
    2456 #endif
    2457 #if RATE_CONTROL_LAMBDA_DOMAIN
     2502  printf("Cross-layer sample alignment : %d\n", m_phaseAlignFlag);
     2503#endif
    24582504#if !RC_SHVC_HARMONIZATION
    24592505  printf("RateControl                  : %d\n", m_RCEnableRateControl );
     
    24682514  }
    24692515#endif
    2470 #else
    2471   printf("RateControl                  : %d\n", m_enableRateCtrl);
    2472   if(m_enableRateCtrl)
    2473   {
    2474     printf("TargetBitrate                : %d\n", m_targetBitrate);
    2475     printf("NumLCUInUnit                 : %d\n", m_numLCUInUnit);
    2476   }
    2477 #endif
     2516
    24782517  printf("Max Num Merge Candidates     : %d\n", m_maxNumMergeCand);
    24792518  printf("\n");
     
    25162555  printf("PCM:%d ", (m_usePCM && (1<<m_uiPCMLog2MinSize) <= m_uiMaxCUWidth)? 1 : 0);
    25172556#endif
     2557#if !HM_CLEANUP_SAO
    25182558  printf("SAOLcuBasedOptimization:%d ", (m_saoLcuBasedOptimization)?(1):(0));
    2519 
     2559#endif
    25202560  printf("LosslessCuEnabled:%d ", (m_useLossless)? 1:0 );
    25212561  printf("WPP:%d ", (Int)m_useWeightedPred);
     
    25352575#if SVC_EXTENSION
    25362576  printf("RecalQP:%d ", m_recalculateQPAccordingToLambda ? 1 : 0 );
    2537 #if AVC_BASE
    2538   printf("AvcBase:%d ", m_avcBaseLayerFlag ? 1 : 0);
    2539 #else
    2540   printf("AvcBase:%d ", 0);
    2541 #endif
    25422577  printf("EL_RAP_SliceType: %d ", m_elRapSliceBEnabled);
    25432578  printf("REF_IDX_ME_ZEROMV: %d ", REF_IDX_ME_ZEROMV);
  • trunk/source/App/TAppEncoder/TAppEncCfg.h

    r494 r540  
    187187  Int       m_maxNumOffsetsPerPic;                            ///< SAO maximun number of offset per picture
    188188  Bool      m_saoLcuBoundary;                                 ///< SAO parameter estimation using non-deblocked pixels for LCU bottom and right boundary areas
     189#if !HM_CLEANUP_SAO
    189190  Bool      m_saoLcuBasedOptimization;                        ///< SAO LCU-based optimization
     191#endif
    190192  // coding tools (loop filter)
    191193  Bool      m_bLoopFilterDisable;                             ///< flag for using deblocking filter
     
    295297  Int       m_TMVPModeId;
    296298  Int       m_signHideFlag;
    297 #if RATE_CONTROL_LAMBDA_DOMAIN
    298299#if !RC_SHVC_HARMONIZATION
    299300  Bool      m_RCEnableRateControl;                ///< enable rate control or not
    300301  Int       m_RCTargetBitrate;                    ///< target bitrate when rate control is enabled
    301 #if M0036_RC_IMPROVEMENT
    302302  Int       m_RCKeepHierarchicalBit;              ///< 0: equal bit allocation; 1: fixed ratio bit allocation; 2: adaptive ratio bit allocation
    303 #else
    304   Bool      m_RCKeepHierarchicalBit;              ///< whether keeping hierarchical bit allocation structure or not
    305 #endif
    306303  Bool      m_RCLCULevelRC;                       ///< true: LCU level rate control; false: picture level rate control
    307304  Bool      m_RCUseLCUSeparateModel;              ///< use separate R-lambda model at LCU level
    308305  Int       m_RCInitialQP;                        ///< inital QP for rate control
    309306  Bool      m_RCForceIntraQP;                     ///< force all intra picture to use initial QP or not
    310 #endif
    311 #else
    312   Bool      m_enableRateCtrl;                                   ///< Flag for using rate control algorithm
    313   Int       m_targetBitrate;                                 ///< target bitrate
    314   Int       m_numLCUInUnit;                                  ///< Total number of LCUs in a frame should be completely divided by the NumLCUInUnit
    315307#endif
    316308  Int       m_useScalingListId;                               ///< using quantization matrix
     
    358350  Int       m_log2MaxMvLengthHorizontal;                      ///< Indicate the maximum absolute value of a decoded horizontal MV component in quarter-pel luma units
    359351  Int       m_log2MaxMvLengthVertical;                        ///< Indicate the maximum absolute value of a decoded vertical MV component in quarter-pel luma units
     352#if O0153_ALT_OUTPUT_LAYER_FLAG
     353  Bool      m_altOutputLayerFlag;                             ///< Specifies the value of alt_output_laye_flag in VPS extension
     354#endif
    360355
    361356#if SVC_EXTENSION
     
    373368#if M0040_ADAPTIVE_RESOLUTION_CHANGE
    374369  Int       m_adaptiveResolutionChange;                       ///< Indicate adaptive resolution change frame
     370#endif
     371#if HIGHER_LAYER_IRAP_SKIP_FLAG
     372  Bool      m_skipPictureAtArcSwitch;                         ///< Indicates that when ARC up-switching is performed the higher layer picture is a skip picture
    375373#endif
    376374#if REPN_FORMAT_IN_VPS
     
    386384#endif
    387385#if O0215_PHASE_ALIGNMENT
    388   bool m_phaseAlignFlag;
     386  Bool m_phaseAlignFlag;
     387#endif
     388#if O0223_PICTURE_TYPES_ALIGN_FLAG
     389  Bool m_crossLayerPictureTypeAlignFlag;
     390#endif
     391#if N0147_IRAP_ALIGN_FLAG
     392  Bool m_crossLayerIrapAlignFlag;
     393#endif
     394#if O0149_CROSS_LAYER_BLA_FLAG
     395  bool      m_crossLayerBLAFlag;
    389396#endif
    390397public:
  • trunk/source/App/TAppEncoder/TAppEncLayerCfg.cpp

    r494 r540  
    5353  m_aiPad[1] = m_aiPad[0] = 0;
    5454  m_numScaledRefLayerOffsets = 0;
     55#if O0098_SCALED_REF_LAYER_ID
     56  ::memset(m_scaledRefLayerId,           0, sizeof(m_scaledRefLayerId));
     57#endif
    5558  ::memset(m_scaledRefLayerLeftOffset,   0, sizeof(m_scaledRefLayerLeftOffset));
    5659  ::memset(m_scaledRefLayerTopOffset,    0, sizeof(m_scaledRefLayerTopOffset));
  • trunk/source/App/TAppEncoder/TAppEncLayerCfg.h

    r494 r540  
    9595  TAppEncCfg* m_cAppEncCfg;                                   ///< pointer to app encoder config
    9696  Int       m_numScaledRefLayerOffsets  ;
     97#if O0098_SCALED_REF_LAYER_ID
     98  Int       m_scaledRefLayerId          [MAX_LAYERS];
     99#endif
    97100  Int       m_scaledRefLayerLeftOffset  [MAX_LAYERS];
    98101  Int       m_scaledRefLayerTopOffset   [MAX_LAYERS];
  • trunk/source/App/TAppEncoder/TAppEncTop.cpp

    r498 r540  
    9090    vps->setMaxDecPicBuffering             ( m_maxDecPicBuffering[i], i );
    9191  }
     92
    9293#if REPN_FORMAT_IN_VPS
    9394  vps->setRepFormatIdxPresentFlag( true );   // Could be disabled to optimize in some cases.
     
    148149  {
    149150    RepFormat *repFormat = vps->getVpsRepFormat( idx );
     151#if REPN_FORMAT_CONTROL_FLAG
     152    repFormat->setChromaAndBitDepthVpsPresentFlag( true );
     153    if (idx==0)
     154    {
     155      assert(repFormat->getChromaAndBitDepthVpsPresentFlag() == true);
     156    }
     157#endif
    150158    repFormat->setPicWidthVpsInLumaSamples  ( m_acLayerCfg[mapIdxToLayer[idx]].getSourceWidth()   );
    151159    repFormat->setPicHeightVpsInLumaSamples ( m_acLayerCfg[mapIdxToLayer[idx]].getSourceHeight()  );
     
    162170    repFormat->setBitDepthVpsLuma           ( getInternalBitDepthY()                        );  // Need modification to change for each layer
    163171    repFormat->setBitDepthVpsChroma         ( getInternalBitDepthC()                        );  // Need modification to change for each layer
     172#endif
     173#if HIGHER_LAYER_IRAP_SKIP_FLAG
     174    m_acTEncTop[mapIdxToLayer[idx]].setSkipPictureAtArcSwitch( m_skipPictureAtArcSwitch );
    164175#endif
    165176  }
     
    459470
    460471    m_acTEncTop[layer].setSaoLcuBoundary (m_saoLcuBoundary);
     472#if !HM_CLEANUP_SAO
    461473    m_acTEncTop[layer].setSaoLcuBasedOptimization (m_saoLcuBasedOptimization);
     474#endif
    462475    m_acTEncTop[layer].setPCMInputBitDepthFlag  ( m_bPCMInputBitDepthFlag);
    463476    m_acTEncTop[layer].setPCMFilterDisableFlag  ( m_bPCMFilterDisableFlag);
     
    535548    m_acTEncTop[layer].setScalingListFile            ( m_scalingListFile   );
    536549    m_acTEncTop[layer].setSignHideFlag(m_signHideFlag);
    537 #if RATE_CONTROL_LAMBDA_DOMAIN
    538550#if RC_SHVC_HARMONIZATION
    539551    m_acTEncTop[layer].setUseRateCtrl     (m_acLayerCfg[layer].getRCEnableRateControl());
     
    552564    m_acTEncTop[layer].setInitialQP           ( m_RCInitialQP );
    553565    m_acTEncTop[layer].setForceIntraQP        ( m_RCForceIntraQP );
    554 #endif
    555 #else
    556     m_acTEncTop[layer].setUseRateCtrl     ( m_enableRateCtrl);
    557     m_acTEncTop[layer].setTargetBitrate   ( m_targetBitrate);
    558     m_acTEncTop[layer].setNumLCUInUnit    ( m_numLCUInUnit);
    559566#endif
    560567    m_acTEncTop[layer].setTransquantBypassEnableFlag(m_TransquantBypassEnableFlag);
     
    598605      for(Int i = 0; i < m_acLayerCfg[layer].m_numScaledRefLayerOffsets; i++)
    599606      {
     607#if O0098_SCALED_REF_LAYER_ID
     608        m_acTEncTop[layer].setScaledRefLayerId(i, m_acLayerCfg[layer].m_scaledRefLayerId[i]);
     609#endif
    600610        m_acTEncTop[layer].getScaledRefLayerWindow(i).setWindow( 2*m_acLayerCfg[layer].m_scaledRefLayerLeftOffset[i], 2*m_acLayerCfg[layer].m_scaledRefLayerRightOffset[i],
    601611                                                  2*m_acLayerCfg[layer].m_scaledRefLayerTopOffset[i], 2*m_acLayerCfg[layer].m_scaledRefLayerBottomOffset[i]);
     
    607617#if AUXILIARY_PICTURES
    608618    m_acTEncTop[layer].setChromaFormatIDC( m_acLayerCfg[layer].m_chromaFormatIDC );
     619#endif
     620#if O0153_ALT_OUTPUT_LAYER_FLAG
     621    m_acTEncTop[layer].setAltOuputLayerFlag( m_altOutputLayerFlag );
     622#endif
     623#if O0149_CROSS_LAYER_BLA_FLAG
     624    m_acTEncTop[layer].setCrossLayerBLAFlag( m_crossLayerBLAFlag );
    609625#endif
    610626  }
     
    768784
    769785  m_cTEncTop.setSaoLcuBoundary (m_saoLcuBoundary);
     786#if !HM_CLEANUP_SAO
    770787  m_cTEncTop.setSaoLcuBasedOptimization (m_saoLcuBasedOptimization);
     788#endif
    771789  m_cTEncTop.setPCMInputBitDepthFlag  ( m_bPCMInputBitDepthFlag);
    772790  m_cTEncTop.setPCMFilterDisableFlag  ( m_bPCMFilterDisableFlag);
     
    836854  m_cTEncTop.setScalingListFile            ( m_scalingListFile   );
    837855  m_cTEncTop.setSignHideFlag(m_signHideFlag);
    838 #if RATE_CONTROL_LAMBDA_DOMAIN
    839856  m_cTEncTop.setUseRateCtrl         ( m_RCEnableRateControl );
    840857  m_cTEncTop.setTargetBitrate       ( m_RCTargetBitrate );
     
    844861  m_cTEncTop.setInitialQP           ( m_RCInitialQP );
    845862  m_cTEncTop.setForceIntraQP        ( m_RCForceIntraQP );
    846 #else
    847   m_cTEncTop.setUseRateCtrl     ( m_enableRateCtrl);
    848   m_cTEncTop.setTargetBitrate   ( m_targetBitrate);
    849   m_cTEncTop.setNumLCUInUnit    ( m_numLCUInUnit);
    850 #endif
    851863  m_cTEncTop.setTransquantBypassEnableFlag(m_TransquantBypassEnableFlag);
    852864  m_cTEncTop.setCUTransquantBypassFlagValue(m_CUTransquantBypassFlagValue);
     
    10871099#endif
    10881100#endif
     1101#if VPS_TSLAYERS
     1102    vps->setMaxTSLayersPresentFlag(true);
     1103    for( i = 0; i < MAX_VPS_LAYER_ID_PLUS1 - 1; i++ )
     1104    {
     1105        vps->setMaxTSLayersMinus1(i, vps->getMaxTLayers()-1);
     1106    }
     1107#endif
    10891108#if N0120_MAX_TID_REF_PRESENT_FLAG
    10901109#if N0120_MAX_TID_REF_CFG
     
    11711190  }
    11721191#endif
     1192 #if VPS_DPB_SIZE_TABLE
     1193  // The Layer ID List variables can be derived here. 
     1194#if DERIVE_LAYER_ID_LIST_VARIABLES
     1195  vps->deriveLayerIdListVariables();
     1196#endif
     1197  vps->deriveNumberOfSubDpbs();
     1198  // Initialize dpb_size_table() for all ouput layer sets in the VPS extension
     1199  for(i = 1; i < vps->getNumOutputLayerSets(); i++)
     1200  {
     1201    Int layerSetId = vps->getOutputLayerSetIdx(i);
     1202
     1203    // For each output layer set, set the DPB size for each layer and the reorder/latency value the maximum for all layers
     1204    Bool checkFlagOuter = false;      // Used to calculate sub_layer_flag_info_present_flag
     1205    Bool checkFlagInner[MAX_TLAYER];  // Used to calculate sub_layer_dpb_info_present_flag
     1206
     1207    for(Int j = 0; j < vps->getMaxTLayers(); j++)
     1208    {
     1209
     1210      Int maxNumReorderPics = -1;
     1211      for(Int k = 0; k < vps->getNumSubDpbs(i); k++)
     1212      {
     1213        Int layerId = vps->getLayerSetLayerIdList(layerSetId, k); // k-th layer in the output layer set
     1214        vps->setMaxVpsDecPicBufferingMinus1( i, k, j,  m_acTEncTop[layerId].getMaxDecPicBuffering(j) - 1 );
     1215        maxNumReorderPics       = std::max( maxNumReorderPics, m_acTEncTop[layerId].getNumReorderPics(j));
     1216      }
     1217      vps->setMaxVpsNumReorderPics(i, j, maxNumReorderPics);
     1218     
     1219      if( j == 0 )  // checkFlagInner[0] is always 1
     1220      {
     1221        checkFlagInner[j] = true;     // Always signal sub-layer DPB information for the first sub-layer
     1222      }
     1223      else
     1224      {
     1225        checkFlagInner[j] = false;    // Initialize to be false. If the values of the current sub-layers matches with the earlier sub-layer,
     1226                                      // then will be continue to be false - i.e. the j-th sub-layer DPB info is not signaled
     1227        checkFlagInner[j] |= ( maxNumReorderPics != vps->getMaxVpsNumReorderPics(i, j - 1) );
     1228        for(Int k = 0; k < vps->getNumSubDpbs(i) && !checkFlagInner[j]; k++)  // If checkFlagInner[j] is true, break and signal the values
     1229        {
     1230          checkFlagInner[j] |= ( vps->getMaxVpsDecPicBufferingMinus1(i, k, j - 1) != vps->getMaxVpsDecPicBufferingMinus1(i, k, j) );
     1231        }
     1232      }
     1233      // If checkFlagInner[j] = true, then some value needs to be signalled for the j-th sub-layer
     1234      vps->setSubLayerDpbInfoPresentFlag( i, j, checkFlagInner[j] );
     1235    }
     1236    for(Int j = 1; j < vps->getMaxTLayers(); j++) // Check if DPB info of any of non-zero sub-layers is signaled. If so set flag to one
     1237    {
     1238      if( vps->getSubLayerDpbInfoPresentFlag(i, j) )
     1239      {
     1240        checkFlagOuter = true;
     1241        break;
     1242      }
     1243    }
     1244    vps->setSubLayerFlagInfoPresentFlag( i, checkFlagOuter );
     1245  }
     1246#endif
    11731247#if VPS_EXTN_DIRECT_REF_LAYERS
    11741248  // Direct reference layers
    11751249  UInt maxDirectRefLayers = 0;
     1250#if O0096_DEFAULT_DEPENDENCY_TYPE
     1251  Bool isDefaultDirectDependencyTypeSet = false;
     1252#endif
    11761253  for(UInt layerCtr = 1;layerCtr <= vps->getMaxLayers() - 1; layerCtr++)
    11771254  {
     
    12021279        vps->setDirectDependencyType( layerCtr, refLayerCtr, ((m_acTEncTop[layerCtr].getSamplePredEnabledFlag(refLayerCtr) ? 1 : 0) |
    12031280                                                              (m_acTEncTop[layerCtr].getMotionPredEnabledFlag(refLayerCtr) ? 2 : 0)) - 1);
     1281#if O0096_DEFAULT_DEPENDENCY_TYPE
     1282        if (!isDefaultDirectDependencyTypeSet)
     1283        {
     1284          vps->setDefaultDirectDependecyTypeFlag(1);
     1285          vps->setDefaultDirectDependecyType(vps->getDirectDependencyType(layerCtr, refLayerCtr));
     1286          isDefaultDirectDependencyTypeSet = true;
     1287        }
     1288        else if (vps->getDirectDependencyType(layerCtr, refLayerCtr) != vps->getDefaultDirectDependencyType())
     1289        {
     1290          vps->setDefaultDirectDependecyTypeFlag(0);
     1291        }
     1292#endif
    12041293      }
    12051294      else
     
    12101299#endif
    12111300  }
    1212 #if IL_SL_SIGNALLING_N0371
    1213   for(i = 1; i < vps->getMaxLayers(); i++)
    1214   {
    1215     for(Int j = 0; j < i; j++)
    1216     {
    1217       vps->setScalingListLayerDependency( i, j, vps->checkLayerDependency( i,j ) );
     1301
     1302#if O0092_0094_DEPENDENCY_CONSTRAINT
     1303  for(UInt layerCtr = 1;layerCtr <= vps->getMaxLayers() - 1; layerCtr++)
     1304  {
     1305    vps->setNumRefLayers(vps->getLayerIdInNuh(layerCtr));   // identify the number of direct and indirect reference layers of current layer and set recursiveRefLayersFlags
     1306  }
     1307  if(vps->getMaxLayers() > MAX_REF_LAYERS)
     1308  {
     1309    for(UInt layerCtr = 1;layerCtr <= vps->getMaxLayers() - 1; layerCtr++)
     1310    {
     1311      assert( vps->getNumRefLayers(vps->getLayerIdInNuh(layerCtr)) <= MAX_REF_LAYERS);
    12181312    }
    12191313  }
     
    12321326    }
    12331327#endif
     1328#if O0223_PICTURE_TYPES_ALIGN_FLAG
     1329    vps->setCrossLayerPictureTypeAlignFlag( m_crossLayerPictureTypeAlignFlag );
     1330#endif
    12341331#if N0147_IRAP_ALIGN_FLAG
    1235     vps->setCrossLayerIrapAlignFlag(true);
     1332    vps->setCrossLayerIrapAlignFlag( m_crossLayerIrapAlignFlag );
    12361333    for(UInt layerCtr = 1;layerCtr <= vps->getMaxLayers() - 1; layerCtr++)
    12371334    {
     
    12561353#if M0040_ADAPTIVE_RESOLUTION_CHANGE
    12571354  vps->setSingleLayerForNonIrapFlag(m_adaptiveResolutionChange > 0 ? true : false);
     1355#endif
     1356#if HIGHER_LAYER_IRAP_SKIP_FLAG
     1357  vps->setHigherLayerIrapSkipFlag(m_skipPictureAtArcSwitch);
    12581358#endif
    12591359#if !VPS_EXTN_OFFSET_CALC
     
    12661366#if O0215_PHASE_ALIGNMENT
    12671367  vps->setPhaseAlignFlag( m_phaseAlignFlag );
     1368#endif
     1369
     1370#if O0153_ALT_OUTPUT_LAYER_FLAG
     1371  vps->setAltOuputLayerFlag( m_altOutputLayerFlag );
    12681372#endif
    12691373
     
    20222126    case NAL_UNIT_CODED_SLICE_TRAIL_R:
    20232127    case NAL_UNIT_CODED_SLICE_TRAIL_N:
    2024     case NAL_UNIT_CODED_SLICE_TLA_R:
     2128    case NAL_UNIT_CODED_SLICE_TSA_R:
    20252129    case NAL_UNIT_CODED_SLICE_TSA_N:
    20262130    case NAL_UNIT_CODED_SLICE_STSA_R:
Note: See TracChangeset for help on using the changeset viewer.