Changeset 644 in SHVCSoftware for trunk/source/Lib/TLibCommon


Ignore:
Timestamp:
25 Mar 2014, 21:51:30 (11 years ago)
Author:
seregin
Message:

merge with SHM-5.1-dev branch

Location:
trunk
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/source

  • trunk/source/Lib/TLibCommon/CommonDef.h

    r595 r644  
    5858#if SVC_EXTENSION
    5959#include <vector>
    60 #define NV_VERSION        "5.0 (HM-13.0)"                 ///< Current software version
     60#define NV_VERSION        "5.1 (HM-13.0)"                 ///< Current software version
    6161#else
    6262#define NV_VERSION        "13.0"                ///< Current software version
     
    178178
    179179// Explicit temporal layer QP offset
    180 #define MAX_TLAYER                  8           ///< max number of temporal layer
     180#define MAX_TLAYER                  7           ///< max number of temporal layer
    181181#define HB_LAMBDA_FOR_LDC           1           ///< use of B-style lambda for non-key pictures in low-delay mode
    182182
     
    288288  std::vector<Int> *m_targetDecLayerIdSet;
    289289  Bool m_valueCheckedFlag;
     290  Int m_highestTId;
    290291public:
    291292  CommonDecoderParams():
     
    294295    , m_targetDecLayerIdSet(NULL)
    295296    , m_valueCheckedFlag(false)
     297    , m_highestTId(6)
    296298 {}
    297299
     
    308310  Bool getValueCheckedFlag()            { return m_valueCheckedFlag;}
    309311 
     312  Void setHighestTId(const Int x) { m_highestTId = x; }
     313  Int  getHighestTId()            { return m_highestTId; }
    310314};
    311315#endif
  • trunk/source/Lib/TLibCommon/SEI.h

    r595 r644  
    4040//! \{
    4141class TComSPS;
     42#if O0164_MULTI_LAYER_HRD
     43class TComHRD;
     44#endif
    4245
    4346/**
     
    8184   ,SUB_BITSTREAM_PROPERTY               = 139    // Final PayloadType to be defined after finalization
    8285#endif
     86#if O0164_MULTI_LAYER_HRD
     87   ,BSP_NESTING                          = 140
     88   ,BSP_INITIAL_ARRIVAL_TIME             = 141
     89   ,BSP_HRD                              = 142
     90#endif
    8391  };
    8492 
     
    157165  , m_cpbDelayOffset      (0)
    158166  , m_dpbDelayOffset      (0)
     167#if P0138_USE_ALT_CPB_PARAMS_FLAG
     168  , m_useAltCpbParamsFlagPresent(false)
     169  , m_useAltCpbParamsFlag (false)
     170#endif
    159171  {
    160172    ::memset(m_initialCpbRemovalDelay, 0, sizeof(m_initialCpbRemovalDelay));
     
    175187  Bool m_concatenationFlag;
    176188  UInt m_auCpbRemovalDelayDelta;
     189#if P0138_USE_ALT_CPB_PARAMS_FLAG
     190  Bool m_useAltCpbParamsFlagPresent;
     191  Bool m_useAltCpbParamsFlag;
     192#endif
    177193};
    178194class SEIPictureTiming : public SEI
     
    440456Void deleteSEIs (SEIMessages &seiList);
    441457
     458#if O0164_MULTI_LAYER_HRD
     459
     460class SEIBspNesting : public SEI
     461{
     462public:
     463  PayloadType payloadType() const { return BSP_NESTING; }
     464
     465  SEIBspNesting() {}
     466  virtual ~SEIBspNesting()
     467  {
     468    if (!m_callerOwnsSEIs)
     469    {
     470      deleteSEIs(m_nestedSEIs);
     471    }
     472  }
     473
     474  Int  m_bspIdx;
     475  Bool  m_callerOwnsSEIs;
     476  SEIMessages m_nestedSEIs;
     477};
     478
     479class SEIBspInitialArrivalTime : public SEI
     480{
     481public:
     482  PayloadType payloadType() const { return BSP_INITIAL_ARRIVAL_TIME; }
     483
     484  SEIBspInitialArrivalTime () {}
     485  virtual ~SEIBspInitialArrivalTime () {}
     486
     487  UInt m_nalInitialArrivalDelay[256];
     488  UInt m_vclInitialArrivalDelay[256];
     489};
     490
     491class SEIBspHrd : public SEI
     492{
     493public:
     494  PayloadType payloadType() const { return BSP_HRD; }
     495
     496  SEIBspHrd () {}
     497  virtual ~SEIBspHrd () {}
     498
     499  UInt m_seiNumBspHrdParametersMinus1;
     500  Bool m_seiBspCprmsPresentFlag[MAX_VPS_LAYER_SETS_PLUS1];
     501  UInt m_seiNumBitstreamPartitionsMinus1[MAX_VPS_LAYER_SETS_PLUS1];
     502  Bool m_seiLayerInBspFlag[MAX_VPS_LAYER_SETS_PLUS1][8][MAX_LAYERS];
     503  UInt m_seiNumBspSchedCombinationsMinus1[MAX_VPS_LAYER_SETS_PLUS1];
     504  UInt m_seiBspCombHrdIdx[MAX_VPS_LAYER_SETS_PLUS1][16][16];
     505  UInt m_seiBspCombScheddx[MAX_VPS_LAYER_SETS_PLUS1][16][16];
     506  UInt m_vpsMaxLayers;
     507  Bool m_layerIdIncludedFlag[MAX_VPS_LAYER_SETS_PLUS1][MAX_VPS_LAYER_ID_PLUS1];
     508
     509  TComHRD *hrd;
     510};
     511
     512#endif
     513
    442514class SEIScalableNesting : public SEI
    443515{
  • trunk/source/Lib/TLibCommon/TComBitStream.cpp

    r595 r644  
    229229  UChar saved_held_bits = m_held_bits;
    230230  UInt saved_fifo_idx = m_fifo_idx;
     231#if P0138_USE_ALT_CPB_PARAMS_FLAG
     232  UInt saved_numBitsRead = m_numBitsRead;
     233#endif
    231234
    232235  UInt num_bits_to_read = min(uiNumberOfBits, getNumBitsLeft());
     
    237240  m_held_bits = saved_held_bits;
    238241  m_num_held_bits = saved_num_held_bits;
     242#if P0138_USE_ALT_CPB_PARAMS_FLAG
     243  m_numBitsRead = saved_numBitsRead;
     244#endif
    239245}
    240246
  • trunk/source/Lib/TLibCommon/TComPrediction.cpp

    r595 r644  
    768768#if O0215_PHASE_ALIGNMENT
    769769#if O0194_JOINT_US_BITSHIFT
    770 Void TComPrediction::upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, bool phaseAlignFlag )
     770Void TComPrediction::upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, Bool phaseAlignFlag )
    771771{
    772772  m_cUsf.upsampleBasePic( currSlice, refLayerIdc, pcUsPic, pcBasePic, pcTempPic, window, phaseAlignFlag );
    773773}
    774774#else
    775 Void TComPrediction::upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, bool phaseAlignFlag )
     775Void TComPrediction::upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, Bool phaseAlignFlag )
    776776{
    777777  m_cUsf.upsampleBasePic( refLayerIdc, pcUsPic, pcBasePic, pcTempPic, window, phaseAlignFlag );
  • trunk/source/Lib/TLibCommon/TComPrediction.h

    r595 r644  
    4949
    5050#if SVC_UPSAMPLING
    51 #include "TComDataCU.h"
    5251#include "TComUpsampleFilter.h"
    5352#endif
     
    122121#if O0215_PHASE_ALIGNMENT
    123122#if O0194_JOINT_US_BITSHIFT
    124   Void upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, bool phaseAlignFlag );
     123  Void upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, Bool phaseAlignFlag );
    125124#else
    126   Void upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, bool phaseAlignFlag );
     125  Void upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, Bool phaseAlignFlag );
    127126#endif
    128127#else
  • trunk/source/Lib/TLibCommon/TComRom.h

    r595 r644  
    273273#if SVC_EXTENSION
    274274#if FAST_INTRA_SHVC
    275 extern       UInt g_reducedSetIntraModes[NUM_INTRA_MODE-1];
    276 extern       UInt g_predefSetIntraModes[NUM_INTRA_MODE-1];
     275extern UInt g_reducedSetIntraModes[NUM_INTRA_MODE-1];
     276extern UInt g_predefSetIntraModes[NUM_INTRA_MODE-1];
    277277#endif
    278278extern Int g_mvScalingFactor  [MAX_LAYERS][2];
  • trunk/source/Lib/TLibCommon/TComSampleAdaptiveOffset.cpp

    r595 r644  
    4444//! \ingroup TLibCommon
    4545//! \{
     46#if !SVC_EXTENSION
    4647UInt g_saoMaxOffsetQVal[NUM_SAO_COMPONENTS];
     48#endif
    4749
    4850SAOOffset::SAOOffset()
     
    160162    Int bitDepthSample = (compIdx == SAO_Y)?g_bitDepthY:g_bitDepthC;
    161163    m_offsetStepLog2  [compIdx] = max(bitDepthSample - MAX_SAO_TRUNCATED_BITDEPTH, 0);
     164#if SVC_EXTENSION
     165    m_saoMaxOffsetQVal[compIdx] = (1<<(min(bitDepthSample,MAX_SAO_TRUNCATED_BITDEPTH)-5))-1; //Table 9-32, inclusive
     166#else
    162167    g_saoMaxOffsetQVal[compIdx] = (1<<(min(bitDepthSample,MAX_SAO_TRUNCATED_BITDEPTH)-5))-1; //Table 9-32, inclusive
     168#endif
    163169  }
    164170
     
    168174    Int bitDepthSample = (compIdx == SAO_Y)?g_bitDepthY:g_bitDepthC; //exclusive
    169175    Int maxSampleValue = (1<< bitDepthSample); //exclusive
     176#if SVC_EXTENSION
     177    Int maxOffsetValue = (m_saoMaxOffsetQVal[compIdx] << m_offsetStepLog2[compIdx]);
     178#else
    170179    Int maxOffsetValue = (g_saoMaxOffsetQVal[compIdx] << m_offsetStepLog2[compIdx]);
     180#endif
    171181
    172182    m_offsetClipTable[compIdx] = new Int[(maxSampleValue + maxOffsetValue -1)+ (maxOffsetValue)+1 ]; //positive & negative range plus 0
  • trunk/source/Lib/TLibCommon/TComSampleAdaptiveOffset.h

    r595 r644  
    5353// Class definition
    5454// ====================================================================================================================
     55#if !SVC_EXTENSION
    5556extern UInt g_saoMaxOffsetQVal[NUM_SAO_COMPONENTS];
     57#endif
    5658
    5759class TComSampleAdaptiveOffset
     
    6971  Void reconstructBlkSAOParams(TComPic* pic, SAOBlkParam* saoBlkParams);
    7072  Void PCMLFDisableProcess (TComPic* pcPic);
     73#if SVC_EXTENSION
     74  UInt* getSaoMaxOffsetQVal() { return m_saoMaxOffsetQVal; }
     75#endif
    7176protected:
    7277  Void offsetBlock(Int compIdx, Int typeIdx, Int* offset, Pel* srcBlk, Pel* resBlk, Int srcStride, Int resStride,  Int width, Int height
     
    101106  Int*   m_offsetClipTable[NUM_SAO_COMPONENTS];
    102107  Short* m_signTable;
    103 
     108#if SVC_EXTENSION
     109  UInt m_saoMaxOffsetQVal[NUM_SAO_COMPONENTS];
     110#endif
    104111};
    105112
  • trunk/source/Lib/TLibCommon/TComSlice.cpp

    r597 r644  
    111111, m_bCrossLayerBLAFlag            ( false )
    112112#endif
     113#if NO_OUTPUT_OF_PRIOR_PICS
     114, m_noOutputOfPriorPicsFlag       ( false )
     115, m_noRaslOutputFlag              ( false )
     116, m_handleCraAsBlaFlag            ( false )
     117#endif
     118#if POC_RESET_IDC_SIGNALLING
     119, m_pocResetIdc                   ( 0 )
     120, m_pocResetPeriodId              ( 0 )
     121, m_fullPocResetFlag              ( false )
     122, m_pocLsbVal                     ( 0 )
     123, m_pocMsbVal                     ( 0 )
     124, m_pocMsbValRequiredFlag         ( false )
     125, m_pocMsbValPresentFlag          ( false )
     126#endif
    113127#endif //SVC_EXTENSION
    114128{
     
    120134  m_interLayerPredEnabledFlag = 0;
    121135  ::memset( m_interLayerPredLayerIdc, 0, sizeof(m_interLayerPredLayerIdc) );
     136#if P0312_VERT_PHASE_ADJ
     137  ::memset( m_vertPhasePositionFlag, 0, sizeof(m_vertPhasePositionFlag) );
     138#endif
    122139#endif //SVC_EXTENSION
    123140
     
    194211      || getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA;
    195212}
     213#if NO_OUTPUT_OF_PRIOR_PICS
     214Bool TComSlice::getBlaPicFlag       ()
     215{
     216    return  getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP
     217    || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL
     218    || getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP;
     219}
     220Bool TComSlice::getCraPicFlag       ()
     221{
     222    return getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA;
     223}
     224#endif
    196225
    197226/**
     
    848877
    849878#if SVC_EXTENSION
    850   if( m_eSliceType == I_SLICE || ( m_pcSPS->getLayerId() &&
     879  if( m_eSliceType == I_SLICE || ( m_layerId &&
    851880    (m_eNalUnitType >= NAL_UNIT_CODED_SLICE_BLA_W_LP) &&
    852881    (m_eNalUnitType <= NAL_UNIT_CODED_SLICE_CRA) ) )
     
    872901  {
    873902    numRpsCurrTempList += m_activeNumILRRefIdx;
    874 }
     903  }
    875904#endif
    876905
     
    11051134  m_interLayerPredEnabledFlag  = pSrc->m_interLayerPredEnabledFlag;
    11061135  memcpy( m_interLayerPredLayerIdc, pSrc->m_interLayerPredLayerIdc, sizeof( m_interLayerPredLayerIdc ) );
     1136#if P0312_VERT_PHASE_ADJ
     1137  memcpy( m_vertPhasePositionFlag, pSrc->m_vertPhasePositionFlag, sizeof( m_vertPhasePositionFlag ) );
     1138#endif
    11071139#endif
    11081140  m_pcSPS                = pSrc->m_pcSPS;
     
    13891421  Int i, isReference;
    13901422
     1423#if !ALIGNED_BUMPING
    13911424  checkLeadingPictureRestrictions(rcListPic);
     1425#endif
    13921426
    13931427  // loop through all pictures in the reference picture buffer
     
    20712105  m_crossLayerIrapAlignFlag = true;
    20722106#endif
     2107#if P0068_CROSS_LAYER_ALIGNED_IDR_ONLY_FOR_IRAP_FLAG
     2108  m_crossLayerAlignedIdrOnlyFlag = false;
     2109#endif
    20732110#if N0120_MAX_TID_REF_PRESENT_FLAG
    20742111  m_maxTidRefPresentFlag = true;
     
    24552492  return -1;  // Layer not found
    24562493}
     2494#if O0164_MULTI_LAYER_HRD
     2495Void TComVPS::setBspHrdParameters( UInt hrdIdx, UInt frameRate, UInt numDU, UInt bitRate, Bool randomAccess )
     2496{
     2497  if( !getVpsVuiBspHrdPresentFlag() )
     2498  {
     2499    return;
     2500  }
     2501
     2502  TComHRD *hrd = getBspHrd(hrdIdx);
     2503
     2504  Bool rateCnt = ( bitRate > 0 );
     2505  hrd->setNalHrdParametersPresentFlag( rateCnt );
     2506  hrd->setVclHrdParametersPresentFlag( rateCnt );
     2507
     2508  hrd->setSubPicCpbParamsPresentFlag( ( numDU > 1 ) );
     2509
     2510  if( hrd->getSubPicCpbParamsPresentFlag() )
     2511  {
     2512    hrd->setTickDivisorMinus2( 100 - 2 );                          //
     2513    hrd->setDuCpbRemovalDelayLengthMinus1( 7 );                    // 8-bit precision ( plus 1 for last DU in AU )
     2514    hrd->setSubPicCpbParamsInPicTimingSEIFlag( true );
     2515    hrd->setDpbOutputDelayDuLengthMinus1( 5 + 7 );                 // With sub-clock tick factor of 100, at least 7 bits to have the same value as AU dpb delay
     2516  }
     2517  else
     2518  {
     2519    hrd->setSubPicCpbParamsInPicTimingSEIFlag( false ); 
     2520  }
     2521
     2522  hrd->setBitRateScale( 4 );                                       // in units of 2~( 6 + 4 ) = 1,024 bps
     2523  hrd->setCpbSizeScale( 6 );                                       // in units of 2~( 4 + 4 ) = 1,024 bit
     2524  hrd->setDuCpbSizeScale( 6 );                                       // in units of 2~( 4 + 4 ) = 1,024 bit
     2525
     2526  hrd->setInitialCpbRemovalDelayLengthMinus1(15);                  // assuming 0.5 sec, log2( 90,000 * 0.5 ) = 16-bit
     2527  if( randomAccess )
     2528  {
     2529    hrd->setCpbRemovalDelayLengthMinus1(5);                        // 32 = 2^5 (plus 1)
     2530    hrd->setDpbOutputDelayLengthMinus1 (5);                        // 32 + 3 = 2^6
     2531  }
     2532  else
     2533  {
     2534    hrd->setCpbRemovalDelayLengthMinus1(9);                        // max. 2^10
     2535    hrd->setDpbOutputDelayLengthMinus1 (9);                        // max. 2^10
     2536  }
     2537
     2538  /*
     2539  Note: only the case of "vps_max_temporal_layers_minus1 = 0" is supported.
     2540  */
     2541  Int i, j;
     2542  UInt birateValue, cpbSizeValue;
     2543  UInt ducpbSizeValue;
     2544  UInt duBitRateValue = 0;
     2545
     2546  for( i = 0; i < MAX_TLAYER; i ++ )
     2547  {
     2548    hrd->setFixedPicRateFlag( i, 1 );
     2549    hrd->setPicDurationInTcMinus1( i, 0 );
     2550    hrd->setLowDelayHrdFlag( i, 0 );
     2551    hrd->setCpbCntMinus1( i, 0 );
     2552
     2553    birateValue  = bitRate;
     2554    cpbSizeValue = bitRate;                                     // 1 second
     2555    ducpbSizeValue = bitRate/numDU;
     2556    duBitRateValue = bitRate;
     2557    for( j = 0; j < ( hrd->getCpbCntMinus1( i ) + 1 ); j ++ )
     2558    {
     2559      hrd->setBitRateValueMinus1( i, j, 0, ( birateValue  - 1 ) );
     2560      hrd->setCpbSizeValueMinus1( i, j, 0, ( cpbSizeValue - 1 ) );
     2561      hrd->setDuCpbSizeValueMinus1( i, j, 0, ( ducpbSizeValue - 1 ) );
     2562      hrd->setCbrFlag( i, j, 0, ( j == 0 ) );
     2563
     2564      hrd->setBitRateValueMinus1( i, j, 1, ( birateValue  - 1) );
     2565      hrd->setCpbSizeValueMinus1( i, j, 1, ( cpbSizeValue - 1 ) );
     2566      hrd->setDuCpbSizeValueMinus1( i, j, 1, ( ducpbSizeValue - 1 ) );
     2567      hrd->setDuBitRateValueMinus1( i, j, 1, ( duBitRateValue - 1 ) );
     2568      hrd->setCbrFlag( i, j, 1, ( j == 0 ) );
     2569    }
     2570  }
     2571}
     2572#endif
    24572573// RepFormat Assignment operator
    24582574RepFormat& RepFormat::operator= (const RepFormat &other)
     
    25482664  ::memset(m_ltRefPicPocLsbSps, 0, sizeof(m_ltRefPicPocLsbSps));
    25492665  ::memset(m_usedByCurrPicLtSPSFlag, 0, sizeof(m_usedByCurrPicLtSPSFlag));
     2666
     2667#if P0312_VERT_PHASE_ADJ
     2668  ::memset(m_vertPhasePositionEnableFlag, 0, sizeof(m_vertPhasePositionEnableFlag));
     2669#endif
    25502670}
    25512671
     
    27362856, m_scalingListRefLayerId ( 0 )
    27372857#endif
     2858#if POC_RESET_IDC
     2859, m_pocResetInfoPresentFlag   (false)
     2860#endif
    27382861{
    27392862  m_scalingList = new TComScalingList;
     
    34053528    //set reference picture POC of each ILP reference
    34063529    Int thePoc = ilpPic[refLayerIdc]->getPOC();
    3407     assert(thePoc >= 0);
    34083530    assert(thePoc == pcRefPicBL->getPOC());
    34093531
  • trunk/source/Lib/TLibCommon/TComSlice.h

    r595 r644  
    231231{
    232232  ProfileTierLevel m_generalPTL;
    233   ProfileTierLevel m_subLayerPTL[6];      // max. value of max_sub_layers_minus1 is 6
    234   Bool m_subLayerProfilePresentFlag[6];
    235   Bool m_subLayerLevelPresentFlag[6];
     233  ProfileTierLevel m_subLayerPTL    [MAX_TLAYER-1];      // max. value of max_sub_layers_minus1 is MAX_TLAYER-1 ( = 6 )
     234  Bool m_subLayerProfilePresentFlag [MAX_TLAYER-1];
     235  Bool m_subLayerLevelPresentFlag   [MAX_TLAYER-1];
    236236
    237237public:
     
    568568  Bool       m_crossLayerIrapAlignFlag;
    569569#endif
     570#if P0068_CROSS_LAYER_ALIGNED_IDR_ONLY_FOR_IRAP_FLAG
     571  Bool       m_crossLayerAlignedIdrOnlyFlag;
     572#endif
    570573#if O0225_MAX_TID_FOR_REF_LAYERS
    571574  UInt       m_maxTidIlRefPicsPlus1[MAX_VPS_LAYER_ID_PLUS1 - 1][MAX_VPS_LAYER_ID_PLUS1];
     
    599602#endif
    600603#if N0160_VUI_EXT_ILP_REF   
    601   Bool        m_ilpRestrictedRefLayersFlag;
    602   Int         m_minSpatialSegmentOffsetPlus1[MAX_VPS_LAYER_ID_PLUS1][MAX_VPS_LAYER_ID_PLUS1];
    603   Bool        m_ctuBasedOffsetEnabledFlag   [MAX_VPS_LAYER_ID_PLUS1][MAX_VPS_LAYER_ID_PLUS1];
    604   Int         m_minHorizontalCtuOffsetPlus1 [MAX_VPS_LAYER_ID_PLUS1][MAX_VPS_LAYER_ID_PLUS1];
     604  Bool       m_ilpRestrictedRefLayersFlag;
     605  Int        m_minSpatialSegmentOffsetPlus1[MAX_VPS_LAYER_ID_PLUS1][MAX_VPS_LAYER_ID_PLUS1];
     606  Bool       m_ctuBasedOffsetEnabledFlag   [MAX_VPS_LAYER_ID_PLUS1][MAX_VPS_LAYER_ID_PLUS1];
     607  Int        m_minHorizontalCtuOffsetPlus1 [MAX_VPS_LAYER_ID_PLUS1][MAX_VPS_LAYER_ID_PLUS1];
    605608#endif
    606609#if VPS_VUI_VIDEO_SIGNAL
    607   Bool        m_vidSigPresentVpsFlag;
    608   Int         m_vpsVidSigInfo;
    609   Int         m_vpsVidSigIdx[MAX_VPS_LAYER_ID_PLUS1];
    610   Int         m_vpsVidFormat[16];
    611   Bool        m_vpsFullRangeFlag[16];
    612   Int         m_vpsColorPrimaries[16];
    613   Int         m_vpsTransChar[16];
    614   Int         m_vpsMatCoeff[16];
     610  Bool       m_vidSigPresentVpsFlag;
     611  Int        m_vpsVidSigInfo;
     612  Int        m_vpsVidSigIdx[MAX_VPS_LAYER_ID_PLUS1];
     613  Int        m_vpsVidFormat[16];
     614  Bool       m_vpsFullRangeFlag[16];
     615  Int        m_vpsColorPrimaries[16];
     616  Int        m_vpsTransChar[16];
     617  Int        m_vpsMatCoeff[16];
    615618#endif
    616619#if VPS_VUI_BITRATE_PICRATE
    617   Bool        m_bitRatePresentVpsFlag;
    618   Bool        m_picRatePresentVpsFlag;
    619   Bool        m_bitRatePresentFlag  [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER];
    620   Bool        m_picRatePresentFlag  [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER];
    621   Int         m_avgBitRate          [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER];
    622   Int         m_maxBitRate          [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER];
    623   Int         m_constPicRateIdc     [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER];
    624   Int         m_avgPicRate          [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER];
    625 #endif
     620  Bool       m_bitRatePresentVpsFlag;
     621  Bool       m_picRatePresentVpsFlag;
     622  Bool       m_bitRatePresentFlag  [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER];
     623  Bool       m_picRatePresentFlag  [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER];
     624  Int        m_avgBitRate          [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER];
     625  Int        m_maxBitRate          [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER];
     626  Int        m_constPicRateIdc     [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER];
     627  Int        m_avgPicRate          [MAX_VPS_LAYER_SETS_PLUS1][MAX_TLAYER];
     628#endif
     629 
     630#if P0312_VERT_PHASE_ADJ
     631  Bool       m_vpsVuiVertPhaseInUseFlag;
     632#endif
     633
     634#if P0300_ALT_OUTPUT_LAYER_FLAG
     635  Bool       m_altOutputLayerFlag[MAX_VPS_LAYER_SETS_PLUS1];
     636#else
    626637#if O0153_ALT_OUTPUT_LAYER_FLAG
    627638  Bool       m_altOutputLayerFlag;
     639#endif
    628640#endif
    629641#if REPN_FORMAT_IN_VPS
     
    635647#if VIEW_ID_RELATED_SIGNALING
    636648#if O0109_VIEW_ID_LEN
    637   Int         m_viewIdLen;
     649  Int        m_viewIdLen;
    638650#else
    639   Int         m_viewIdLenMinus1;
    640 #endif
    641   Int         m_viewIdVal                [MAX_LAYERS];
     651  Int        m_viewIdLenMinus1;
     652#endif
     653  Int        m_viewIdVal                [MAX_LAYERS];
    642654#endif
    643655
     
    650662  Bool       m_recursiveRefLayerFlag[MAX_NUM_LAYER_IDS][MAX_NUM_LAYER_IDS];  // flag to indicate if j-th layer is a direct or indirect reference layer of i-th layer
    651663#endif
     664#if SPS_DPB_PARAMS
     665  Int        m_TolsIdx;
     666#endif
    652667#if VPS_DPB_SIZE_TABLE
    653   Bool    m_subLayerFlagInfoPresentFlag [MAX_VPS_OP_LAYER_SETS_PLUS1];
    654   Bool    m_subLayerDpbInfoPresentFlag  [MAX_VPS_OP_LAYER_SETS_PLUS1][MAX_LAYERS];
    655   Int     m_maxVpsDecPicBufferingMinus1 [MAX_VPS_OP_LAYER_SETS_PLUS1][MAX_LAYERS][MAX_TLAYER];
     668  Bool       m_subLayerFlagInfoPresentFlag [MAX_VPS_OP_LAYER_SETS_PLUS1];
     669  Bool       m_subLayerDpbInfoPresentFlag  [MAX_VPS_OP_LAYER_SETS_PLUS1][MAX_LAYERS];
     670  Int        m_maxVpsDecPicBufferingMinus1 [MAX_VPS_OP_LAYER_SETS_PLUS1][MAX_LAYERS][MAX_TLAYER];
    656671#if RESOLUTION_BASED_DPB
    657   Int     m_maxVpsLayerDecPicBuffMinus1 [MAX_VPS_OP_LAYER_SETS_PLUS1][MAX_LAYERS][MAX_TLAYER]; 
    658 #endif
    659   Int     m_maxVpsNumReorderPics        [MAX_VPS_OP_LAYER_SETS_PLUS1][MAX_LAYERS];
    660   Int     m_maxVpsLatencyIncreasePlus1  [MAX_VPS_OP_LAYER_SETS_PLUS1][MAX_LAYERS];
     672  Int        m_maxVpsLayerDecPicBuffMinus1 [MAX_VPS_OP_LAYER_SETS_PLUS1][MAX_LAYERS][MAX_TLAYER]; 
     673#endif
     674  Int        m_maxVpsNumReorderPics        [MAX_VPS_OP_LAYER_SETS_PLUS1][MAX_LAYERS];
     675  Int        m_maxVpsLatencyIncreasePlus1  [MAX_VPS_OP_LAYER_SETS_PLUS1][MAX_LAYERS];
    661676#if CHANGE_NUMSUBDPB_IDX
    662   Int     m_numSubDpbs                  [MAX_VPS_LAYER_SETS_PLUS1];
     677  Int        m_numSubDpbs                  [MAX_VPS_LAYER_SETS_PLUS1];
    663678#else
    664   Int     m_numSubDpbs                  [MAX_VPS_OP_LAYER_SETS_PLUS1];
     679  Int        m_numSubDpbs                  [MAX_VPS_OP_LAYER_SETS_PLUS1];
    665680#endif
    666681#endif
     
    670685#endif
    671686
     687#if O0164_MULTI_LAYER_HRD
     688  Bool       m_vpsVuiBspHrdPresentFlag;
     689  UInt       m_vpsNumBspHrdParametersMinus1;
     690  Bool       m_bspCprmsPresentFlag[MAX_VPS_LAYER_SETS_PLUS1];
     691  TComHRD    *m_bspHrd;
     692  UInt       m_numBitstreamPartitions[MAX_VPS_LAYER_SETS_PLUS1];
     693  Bool       m_layerInBspFlag[MAX_VPS_LAYER_SETS_PLUS1][8][MAX_LAYERS];
     694  UInt       m_numBspSchedCombinations[MAX_VPS_LAYER_SETS_PLUS1];
     695  UInt       m_bspCombHrdIdx[MAX_VPS_LAYER_SETS_PLUS1][16][16];
     696  UInt       m_bspCombSchedIdx[MAX_VPS_LAYER_SETS_PLUS1][16][16];
     697#endif
     698
     699#if P0182_VPS_VUI_PS_FLAG
     700  UInt       m_SPSId[MAX_LAYERS];
     701  UInt       m_PPSId[MAX_LAYERS];
     702  UInt       m_baseLayerPSCompatibilityFlag[MAX_LAYERS];
     703#endif
     704
    672705#if !P0307_REMOVE_VPS_VUI_OFFSET
    673706#if VPS_VUI_OFFSET
    674   Int     m_vpsVuiOffset;
     707  Int        m_vpsVuiOffset;
    675708#endif
    676709#endif
    677710#if P0307_VPS_NON_VUI_EXTENSION
    678   Int     m_vpsNonVuiExtLength;
     711  Int        m_vpsNonVuiExtLength;
    679712#endif
    680713#if RESOLUTION_BASED_DPB
    681   Int     m_subDpbAssigned            [MAX_VPS_LAYER_SETS_PLUS1][MAX_LAYERS];
     714  Int        m_subDpbAssigned            [MAX_VPS_LAYER_SETS_PLUS1][MAX_LAYERS];
    682715#endif
    683716#endif //SVC_EXTENSION
     
    692725    m_cprmsPresentFlag = new Bool   [ getNumHrdParameters() ];
    693726  }
     727
     728#if O0164_MULTI_LAYER_HRD
     729  Void    createBspHrdParamBuffer(UInt numHrds)
     730  {
     731    m_bspHrd    = new TComHRD[ numHrds ];
     732//    m_hrdOpSetIdx      = new UInt   [ getNumHrdParameters() ];
     733//    m_cprmsPresentFlag = new Bool   [ getNumHrdParameters() ];
     734  }
     735#endif
    694736
    695737  TComHRD* getHrdParameters   ( UInt i )             { return &m_hrdParameters[ i ]; }
     
    875917  Bool   getCrossLayerPictureTypeAlignFlag()                                    { return m_crossLayerPictureTypeAlignFlag;                      }
    876918  Void   setCrossLayerPictureTypeAlignFlag(Bool x)                              { m_crossLayerPictureTypeAlignFlag = x;                         }
     919#endif
     920#if P0068_CROSS_LAYER_ALIGNED_IDR_ONLY_FOR_IRAP_FLAG
     921  Bool   getCrossLayerAlignedIdrOnlyFlag()                                    { return m_crossLayerAlignedIdrOnlyFlag;                      }
     922  Void   setCrossLayerAlignedIdrOnlyFlag(Bool x)                              { m_crossLayerAlignedIdrOnlyFlag = x;                         }
    877923#endif
    878924#if N0147_IRAP_ALIGN_FLAG
     
    892938#endif
    893939#if VPS_TSLAYERS
    894     Bool   getMaxTSLayersPresentFlag()                                  { return m_maxTSLayersPresentFlag ;}
    895     Void   setMaxTSLayersPresentFlag(Bool x)                            { m_maxTSLayersPresentFlag = x;}
    896     UInt   getMaxTSLayersMinus1(Int layerId)                            { return m_maxTSLayerMinus1[layerId];}
    897     Void   setMaxTSLayersMinus1(Int layerId, UInt maxTSublayer)         { m_maxTSLayerMinus1[layerId] = maxTSublayer;}
     940  Bool   getMaxTSLayersPresentFlag()                                  { return m_maxTSLayersPresentFlag ;}
     941  Void   setMaxTSLayersPresentFlag(Bool x)                            { m_maxTSLayersPresentFlag = x;}
     942  UInt   getMaxTSLayersMinus1(Int layerId)                            { return m_maxTSLayerMinus1[layerId];}
     943  Void   setMaxTSLayersMinus1(Int layerId, UInt maxTSublayer)         { m_maxTSLayerMinus1[layerId] = maxTSublayer;}
    898944#endif
    899945#if M0040_ADAPTIVE_RESOLUTION_CHANGE
     
    924970#endif
    925971#if N0160_VUI_EXT_ILP_REF 
    926   Bool  getIlpRestrictedRefLayersFlag   ( )                                        { return m_ilpRestrictedRefLayersFlag        ;}
    927   Void  setIlpRestrictedRefLayersFlag   ( Int val )                                { m_ilpRestrictedRefLayersFlag         = val;}
    928  
    929   Int  getMinSpatialSegmentOffsetPlus1( Int currLayerId, Int refLayerId )          { return m_minSpatialSegmentOffsetPlus1[currLayerId][refLayerId];}
    930   Void setMinSpatialSegmentOffsetPlus1( Int currLayerId, Int refLayerId, Int val ) { m_minSpatialSegmentOffsetPlus1[currLayerId][refLayerId] = val;}
    931  
    932   Bool getCtuBasedOffsetEnabledFlag   ( Int currLayerId, Int refLayerId )            { return m_ctuBasedOffsetEnabledFlag[currLayerId][refLayerId];}
    933   Void setCtuBasedOffsetEnabledFlag   ( Int currLayerId, Int refLayerId, Bool flag ) { m_ctuBasedOffsetEnabledFlag[currLayerId][refLayerId] = flag;}
    934  
    935   Int  getMinHorizontalCtuOffsetPlus1 ( Int currLayerId, Int refLayerId )            { return m_minHorizontalCtuOffsetPlus1[currLayerId][refLayerId];}
    936   Void setMinHorizontalCtuOffsetPlus1 ( Int currLayerId, Int refLayerId, Int val )   { m_minHorizontalCtuOffsetPlus1[currLayerId][refLayerId] = val;} 
     972  Bool   getIlpRestrictedRefLayersFlag   ( )                                        { return m_ilpRestrictedRefLayersFlag        ;}
     973  Void   setIlpRestrictedRefLayersFlag   ( Int val )                                { m_ilpRestrictedRefLayersFlag         = val;}
     974 
     975  Int    getMinSpatialSegmentOffsetPlus1( Int currLayerId, Int refLayerId )          { return m_minSpatialSegmentOffsetPlus1[currLayerId][refLayerId];}
     976  Void   setMinSpatialSegmentOffsetPlus1( Int currLayerId, Int refLayerId, Int val ) { m_minSpatialSegmentOffsetPlus1[currLayerId][refLayerId] = val;}
     977 
     978  Bool   getCtuBasedOffsetEnabledFlag   ( Int currLayerId, Int refLayerId )            { return m_ctuBasedOffsetEnabledFlag[currLayerId][refLayerId];}
     979  Void   setCtuBasedOffsetEnabledFlag   ( Int currLayerId, Int refLayerId, Bool flag ) { m_ctuBasedOffsetEnabledFlag[currLayerId][refLayerId] = flag;}
     980 
     981  Int    getMinHorizontalCtuOffsetPlus1 ( Int currLayerId, Int refLayerId )            { return m_minHorizontalCtuOffsetPlus1[currLayerId][refLayerId];}
     982  Void   setMinHorizontalCtuOffsetPlus1 ( Int currLayerId, Int refLayerId, Int val )   { m_minHorizontalCtuOffsetPlus1[currLayerId][refLayerId] = val;} 
    937983#endif
    938984#if VPS_VUI_VIDEO_SIGNAL
    939     Bool   getVideoSigPresentVpsFlag()           { return m_vidSigPresentVpsFlag; }
    940     Void   setVideoSigPresentVpsFlag(Bool x)     { m_vidSigPresentVpsFlag = x;    }
    941     Int    getNumVideoSignalInfo()               { return m_vpsVidSigInfo;        }
    942     Void   setNumVideoSignalInfo(Int x)          { m_vpsVidSigInfo = x;           }
    943     Int    getVideoSignalInfoIdx(Int idx)        { return m_vpsVidSigIdx[idx];    }
    944     Void   setVideoSignalInfoIdx(Int idx, Int x) { m_vpsVidSigIdx[idx] = x;       }
    945     Int    getVideoVPSFormat(Int idx)            { return m_vpsVidFormat[idx];    }
    946     Void   setVideoVPSFormat(Int idx, Int x)     { m_vpsVidFormat[idx] = x;       }
    947     Bool   getVideoFullRangeVpsFlag(Int idx)     { return m_vpsFullRangeFlag[idx];}
    948     Void   setVideoFullRangeVpsFlag(Int idx, Bool x) { m_vpsFullRangeFlag[idx] = x;   }
    949     Int    getColorPrimaries(Int idx)            { return m_vpsColorPrimaries[idx];   }
    950     Void   setColorPrimaries(Int idx, Int x)     { m_vpsColorPrimaries[idx] = x;      }
    951     Int    getTransCharacter(Int idx)            { return m_vpsTransChar[idx];    }
    952     Void   setTransCharacter(Int idx, Int x)     { m_vpsTransChar[idx] = x;       }
    953     Int    getMaxtrixCoeff(Int idx)              { return m_vpsMatCoeff[idx];     }
    954     Void   setMaxtrixCoeff(Int idx, Int x)       { m_vpsMatCoeff[idx] = x;        }
     985  Bool   getVideoSigPresentVpsFlag()           { return m_vidSigPresentVpsFlag; }
     986  Void   setVideoSigPresentVpsFlag(Bool x)     { m_vidSigPresentVpsFlag = x;    }
     987  Int    getNumVideoSignalInfo()               { return m_vpsVidSigInfo;        }
     988  Void   setNumVideoSignalInfo(Int x)          { m_vpsVidSigInfo = x;           }
     989  Int    getVideoSignalInfoIdx(Int idx)        { return m_vpsVidSigIdx[idx];    }
     990  Void   setVideoSignalInfoIdx(Int idx, Int x) { m_vpsVidSigIdx[idx] = x;       }
     991  Int    getVideoVPSFormat(Int idx)            { return m_vpsVidFormat[idx];    }
     992  Void   setVideoVPSFormat(Int idx, Int x)     { m_vpsVidFormat[idx] = x;       }
     993  Bool   getVideoFullRangeVpsFlag(Int idx)     { return m_vpsFullRangeFlag[idx];}
     994  Void   setVideoFullRangeVpsFlag(Int idx, Bool x) { m_vpsFullRangeFlag[idx] = x;   }
     995  Int    getColorPrimaries(Int idx)            { return m_vpsColorPrimaries[idx];   }
     996  Void   setColorPrimaries(Int idx, Int x)     { m_vpsColorPrimaries[idx] = x;      }
     997  Int    getTransCharacter(Int idx)            { return m_vpsTransChar[idx];    }
     998  Void   setTransCharacter(Int idx, Int x)     { m_vpsTransChar[idx] = x;       }
     999  Int    getMaxtrixCoeff(Int idx)              { return m_vpsMatCoeff[idx];     }
     1000  Void   setMaxtrixCoeff(Int idx, Int x)       { m_vpsMatCoeff[idx] = x;        }
    9551001#endif
    9561002#if VPS_VUI_BITRATE_PICRATE
    957   Bool getBitRatePresentVpsFlag()       { return m_bitRatePresentVpsFlag; }
    958   Void setBitRatePresentVpsFlag(Bool x) { m_bitRatePresentVpsFlag = x;    }
    959   Bool getPicRatePresentVpsFlag()       { return m_picRatePresentVpsFlag; }
    960   Void setPicRatePresentVpsFlag(Bool x) { m_picRatePresentVpsFlag = x;    }
    961 
    962   Bool getBitRatePresentFlag(Int i, Int j)          { return m_bitRatePresentFlag[i][j]; }
    963   Void setBitRatePresentFlag(Int i, Int j, Bool x)  { m_bitRatePresentFlag[i][j] = x;    }
    964   Bool getPicRatePresentFlag(Int i, Int j)          { return m_picRatePresentFlag[i][j]; }
    965   Void setPicRatePresentFlag(Int i, Int j, Bool x)  { m_picRatePresentFlag[i][j] = x;    }
    966  
    967   Int  getAvgBitRate(Int i, Int j)          { return m_avgBitRate[i][j]; }
    968   Void setAvgBitRate(Int i, Int j, Int x)   { m_avgBitRate[i][j] = x;    }
    969   Int  getMaxBitRate(Int i, Int j)          { return m_maxBitRate[i][j]; }
    970   Void setMaxBitRate(Int i, Int j, Int x)   { m_maxBitRate[i][j] = x;    }
    971  
    972   Int  getConstPicRateIdc(Int i, Int j)          { return m_constPicRateIdc[i][j]; }
    973   Void setConstPicRateIdc(Int i, Int j, Int x)   { m_constPicRateIdc[i][j] = x;    }
    974   Int  getAvgPicRate(Int i, Int j)          { return m_avgPicRate[i][j]; }
    975   Void setAvgPicRate(Int i, Int j, Int x)   { m_avgPicRate[i][j] = x;    }
    976 #endif
     1003  Bool   getBitRatePresentVpsFlag()       { return m_bitRatePresentVpsFlag; }
     1004  Void   setBitRatePresentVpsFlag(Bool x) { m_bitRatePresentVpsFlag = x;    }
     1005  Bool   getPicRatePresentVpsFlag()       { return m_picRatePresentVpsFlag; }
     1006  Void   setPicRatePresentVpsFlag(Bool x) { m_picRatePresentVpsFlag = x;    }
     1007         
     1008  Bool   getBitRatePresentFlag(Int i, Int j)          { return m_bitRatePresentFlag[i][j]; }
     1009  Void   setBitRatePresentFlag(Int i, Int j, Bool x)  { m_bitRatePresentFlag[i][j] = x;    }
     1010  Bool   getPicRatePresentFlag(Int i, Int j)          { return m_picRatePresentFlag[i][j]; }
     1011  Void   setPicRatePresentFlag(Int i, Int j, Bool x)  { m_picRatePresentFlag[i][j] = x;    }
     1012         
     1013  Int    getAvgBitRate(Int i, Int j)          { return m_avgBitRate[i][j]; }
     1014  Void   setAvgBitRate(Int i, Int j, Int x)   { m_avgBitRate[i][j] = x;    }
     1015  Int    getMaxBitRate(Int i, Int j)          { return m_maxBitRate[i][j]; }
     1016  Void   setMaxBitRate(Int i, Int j, Int x)   { m_maxBitRate[i][j] = x;    }
     1017         
     1018  Int    getConstPicRateIdc(Int i, Int j)          { return m_constPicRateIdc[i][j]; }
     1019  Void   setConstPicRateIdc(Int i, Int j, Int x)   { m_constPicRateIdc[i][j] = x;    }
     1020  Int    getAvgPicRate(Int i, Int j)          { return m_avgPicRate[i][j]; }
     1021  Void   setAvgPicRate(Int i, Int j, Int x)   { m_avgPicRate[i][j] = x;    }
     1022#endif
     1023#if O0164_MULTI_LAYER_HRD
     1024  Bool     getVpsVuiBspHrdPresentFlag()                         { return m_vpsVuiBspHrdPresentFlag;      }
     1025  Void     setVpsVuiBspHrdPresentFlag(Bool x)                   { m_vpsVuiBspHrdPresentFlag = x;         }
     1026  UInt     getVpsNumBspHrdParametersMinus1()                    { return m_vpsNumBspHrdParametersMinus1; }
     1027  Void     setVpsNumBspHrdParametersMinus1(UInt i)              { m_vpsNumBspHrdParametersMinus1 = i;    }
     1028  Bool     getBspCprmsPresentFlag(UInt i)                       { return m_bspCprmsPresentFlag[i];       }
     1029  Void     setBspCprmsPresentFlag(UInt i, Bool val)             { m_bspCprmsPresentFlag[i] = val;        }
     1030  TComHRD* getBspHrd(UInt i)                                    { return &m_bspHrd[i];                    }
     1031  UInt     getNumBitstreamPartitions(UInt i)                    { return m_numBitstreamPartitions[i];    }
     1032  Void     setNumBitstreamPartitions(UInt i, UInt val)          { m_numBitstreamPartitions[i] = val;     }
     1033  UInt     getLayerInBspFlag(UInt h, UInt i, UInt j)            { return m_layerInBspFlag[h][i][j];      }
     1034  Void     setLayerInBspFlag(UInt h, UInt i, UInt j, UInt val)  { m_layerInBspFlag[h][i][j] = val;       }
     1035  UInt     getNumBspSchedCombinations(UInt i)                   { return m_numBspSchedCombinations[i];   }
     1036  Void     setNumBspSchedCombinations(UInt i, UInt val)         { m_numBspSchedCombinations[i] = val;    }
     1037  UInt     getBspCombHrdIdx(UInt h, UInt i, UInt j)             { return m_bspCombHrdIdx[h][i][j];       }
     1038  Void     setBspCombHrdIdx(UInt h, UInt i, UInt j, UInt val)   { m_bspCombHrdIdx[h][i][j] = val;        }
     1039  UInt     getBspCombSchedIdx(UInt h, UInt i, UInt j)           { return m_bspCombSchedIdx[h][i][j];     }
     1040  Void     setBspCombSchedIdx(UInt h, UInt i, UInt j, UInt val) { m_bspCombSchedIdx[h][i][j] = val;      }
     1041#endif
     1042#if P0182_VPS_VUI_PS_FLAG
     1043  Int    getSPSId       (Int layer)                   { return m_SPSId[layer];       }
     1044  Void   setSPSId       (Int layer, Int val)          { m_SPSId[layer] = val;        }
     1045  Int    getPPSId       (Int layer)                   { return m_PPSId[layer];       }
     1046  Void   setPPSId       (Int layer, Int val)          { m_PPSId[layer] = val;        }
     1047  Void   setBaseLayerPSCompatibilityFlag (Int layer, int val)        { m_baseLayerPSCompatibilityFlag[layer] = val; }
     1048  Int    getBaseLayerPSCompatibilityFlag (Int layer)   { return m_baseLayerPSCompatibilityFlag[layer];}
     1049#endif
     1050
     1051#if P0312_VERT_PHASE_ADJ
     1052  Bool   getVpsVuiVertPhaseInUseFlag()       { return m_vpsVuiVertPhaseInUseFlag; }
     1053  Void   setVpsVuiVertPhaseInUseFlag(Bool x) { m_vpsVuiVertPhaseInUseFlag = x;    }
     1054#endif
     1055
     1056#if P0300_ALT_OUTPUT_LAYER_FLAG
     1057  Bool   getAltOuputLayerFlag(Int idx)         { return m_altOutputLayerFlag[idx]; }
     1058  Void   setAltOuputLayerFlag(Int idx, Bool x) { m_altOutputLayerFlag[idx] = x;    }
     1059#else
    9771060#if O0153_ALT_OUTPUT_LAYER_FLAG
    9781061  Bool   getAltOuputLayerFlag()             { return m_altOutputLayerFlag; }
    9791062  Void   setAltOuputLayerFlag(Bool x)       { m_altOutputLayerFlag = x;    }
    9801063#endif
     1064#endif
    9811065#if REPN_FORMAT_IN_VPS
    9821066  Bool   getRepFormatIdxPresentFlag()       { return m_repFormatIdxPresentFlag; }
     
    9881072  RepFormat* getVpsRepFormat(Int idx)       { return &m_vpsRepFormat[idx];      }
    9891073
    990   Int    getVpsRepFormatIdx(Int idx)        { return m_vpsRepFormatIdx[idx];   }
    991   Void   setVpsRepFormatIdx(Int idx, Int x) { m_vpsRepFormatIdx[idx] = x;      }         
     1074  Int    getVpsRepFormatIdx(Int idx)        { return m_vpsRepFormatIdx[idx];    }
     1075  Void   setVpsRepFormatIdx(Int idx, Int x) { m_vpsRepFormatIdx[idx] = x;       }         
    9921076#endif
    9931077#if VIEW_ID_RELATED_SIGNALING
    9941078#if O0109_VIEW_ID_LEN
    995   Void    setViewIdLen( Int  val )                                   { m_viewIdLen = val; }
    996   Int     getViewIdLen(  )                                           { return m_viewIdLen; }
     1079  Void   setViewIdLen( Int  val )                                   { m_viewIdLen = val; }
     1080  Int    getViewIdLen(  )                                           { return m_viewIdLen; }
    9971081#else
    998   Void    setViewIdLenMinus1( Int  val )                                   { m_viewIdLenMinus1 = val; }
    999   Int     getViewIdLenMinus1(  )                                           { return m_viewIdLenMinus1; }
    1000 #endif
    1001 
    1002   Void    setViewIdVal( Int viewOrderIndex, Int  val )                     { m_viewIdVal[viewOrderIndex] = val; }
    1003   Int     getViewIdVal( Int viewOrderIndex )                               { return m_viewIdVal[viewOrderIndex]; }
    1004   Int     getScalabilityId(Int, ScalabilityType scalType );
    1005 
    1006   Int     getViewIndex    ( Int layerIdInNuh )                             { return getScalabilityId( getLayerIdInVps(layerIdInNuh), VIEW_ORDER_INDEX  ); }   
    1007 
    1008   Int     getNumViews();
    1009   Int     scalTypeToScalIdx( ScalabilityType scalType );
     1082  Void   setViewIdLenMinus1( Int  val )                             { m_viewIdLenMinus1 = val; }
     1083  Int    getViewIdLenMinus1(  )                                     { return m_viewIdLenMinus1; }
     1084#endif
     1085
     1086  Void   setViewIdVal( Int viewOrderIndex, Int  val )               { m_viewIdVal[viewOrderIndex] = val; }
     1087  Int    getViewIdVal( Int viewOrderIndex )                         { return m_viewIdVal[viewOrderIndex]; }
     1088  Int    getScalabilityId(Int, ScalabilityType scalType );
     1089
     1090  Int    getViewIndex    ( Int layerIdInNuh )                       { return getScalabilityId( getLayerIdInVps(layerIdInNuh), VIEW_ORDER_INDEX  ); }   
     1091
     1092  Int    getNumViews();
     1093  Int    scalTypeToScalIdx( ScalabilityType scalType );
    10101094#endif
    10111095#if !P0125_REVERT_VPS_EXTN_OFFSET_TO_RESERVED
    10121096#if VPS_EXTN_OFFSET
    1013   Int     getExtensionOffset()                 { return m_extensionOffset;   }
    1014   Void    setExtensionOffset( UInt offset )    { m_extensionOffset = offset; }
     1097  Int    getExtensionOffset()                 { return m_extensionOffset;   }
     1098  Void   setExtensionOffset( UInt offset )    { m_extensionOffset = offset; }
    10151099#endif
    10161100#endif
     
    10201104#endif
    10211105#if VPS_DPB_SIZE_TABLE
    1022   Bool    getSubLayerFlagInfoPresentFlag(Int i)         {return m_subLayerFlagInfoPresentFlag[i]; }
    1023   Void    setSubLayerFlagInfoPresentFlag(Int i, Bool x) {m_subLayerFlagInfoPresentFlag[i] = x;    }
    1024 
    1025   Bool    getSubLayerDpbInfoPresentFlag(Int i, Int j)         {return m_subLayerDpbInfoPresentFlag[i][j]; }
    1026   Void    setSubLayerDpbInfoPresentFlag(Int i, Int j, Bool x) {m_subLayerDpbInfoPresentFlag[i][j] = x;    }
     1106  Bool   getSubLayerFlagInfoPresentFlag(Int i)         {return m_subLayerFlagInfoPresentFlag[i]; }
     1107  Void   setSubLayerFlagInfoPresentFlag(Int i, Bool x) {m_subLayerFlagInfoPresentFlag[i] = x;    }
     1108
     1109  Bool   getSubLayerDpbInfoPresentFlag(Int i, Int j)         {return m_subLayerDpbInfoPresentFlag[i][j]; }
     1110  Void   setSubLayerDpbInfoPresentFlag(Int i, Int j, Bool x) {m_subLayerDpbInfoPresentFlag[i][j] = x;    }
    10271111
    10281112  // For the 0-th output layer set, use the date from the active SPS for base layer.
    1029   Int     getMaxVpsDecPicBufferingMinus1(Int i, Int k, Int j)         { assert(i != 0); return m_maxVpsDecPicBufferingMinus1[i][k][j]; }
    1030   Void    setMaxVpsDecPicBufferingMinus1(Int i, Int k, Int j, Int x) { m_maxVpsDecPicBufferingMinus1[i][k][j] = x;    }
     1113  Int    getMaxVpsDecPicBufferingMinus1(Int i, Int k, Int j)         { assert(i != 0); return m_maxVpsDecPicBufferingMinus1[i][k][j]; }
     1114  Void   setMaxVpsDecPicBufferingMinus1(Int i, Int k, Int j, Int x) { m_maxVpsDecPicBufferingMinus1[i][k][j] = x;    }
    10311115
    10321116#if RESOLUTION_BASED_DPB
    1033   Int     getMaxVpsLayerDecPicBuffMinus1(Int i, Int k, Int j)        { assert(i != 0); return m_maxVpsLayerDecPicBuffMinus1[i][k][j]; }
    1034   Void    setMaxVpsLayerDecPicBuffMinus1(Int i, Int k, Int j, Int x) { m_maxVpsLayerDecPicBuffMinus1[i][k][j] = x;    }
    1035 #endif
    1036 
    1037   Int     getMaxVpsNumReorderPics(Int i, Int j)         { assert(i != 0); return m_maxVpsNumReorderPics[i][j]; }
    1038   Void    setMaxVpsNumReorderPics(Int i, Int j, Int x) { m_maxVpsNumReorderPics[i][j] = x;    }
    1039 
    1040   Int     getMaxVpsLatencyIncreasePlus1(Int i, Int j)         { assert(i != 0); return m_maxVpsLatencyIncreasePlus1[i][j]; }
    1041   Void    setMaxVpsLatencyIncreasePlus1(Int i, Int j, Int x) { m_maxVpsLatencyIncreasePlus1[i][j] = x;    }
    1042 
    1043   Int     getNumSubDpbs(Int i)                          { return m_numSubDpbs[i]; }
    1044   Void    setNumSubDpbs(Int i, Int x)                   { m_numSubDpbs[i] = x;    }
    1045   Void    determineSubDpbInfoFlags();
     1117  Int    getMaxVpsLayerDecPicBuffMinus1(Int i, Int k, Int j)        { assert(i != 0); return m_maxVpsLayerDecPicBuffMinus1[i][k][j]; }
     1118  Void   setMaxVpsLayerDecPicBuffMinus1(Int i, Int k, Int j, Int x) { m_maxVpsLayerDecPicBuffMinus1[i][k][j] = x;    }
     1119#endif
     1120
     1121  Int    getMaxVpsNumReorderPics(Int i, Int j)        { assert(i != 0); return m_maxVpsNumReorderPics[i][j]; }
     1122  Void   setMaxVpsNumReorderPics(Int i, Int j, Int x) { m_maxVpsNumReorderPics[i][j] = x;    }
     1123
     1124  Int    getMaxVpsLatencyIncreasePlus1(Int i, Int j)        { assert(i != 0); return m_maxVpsLatencyIncreasePlus1[i][j]; }
     1125  Void   setMaxVpsLatencyIncreasePlus1(Int i, Int j, Int x) { m_maxVpsLatencyIncreasePlus1[i][j] = x;    }
     1126
     1127  Int    getNumSubDpbs(Int i)                          { return m_numSubDpbs[i]; }
     1128  Void   setNumSubDpbs(Int i, Int x)                   { m_numSubDpbs[i] = x;    }
     1129  Void   determineSubDpbInfoFlags();
    10461130#endif
    10471131
     
    10531137#if !P0307_REMOVE_VPS_VUI_OFFSET
    10541138#if VPS_VUI_OFFSET
    1055   Int     getVpsVuiOffset()         { return m_vpsVuiOffset; }
    1056   Void    setVpsVuiOffset(Int x)    { m_vpsVuiOffset = x; }
     1139  Int    getVpsVuiOffset()         { return m_vpsVuiOffset; }
     1140  Void   setVpsVuiOffset(Int x)    { m_vpsVuiOffset = x; }
    10571141#endif
    10581142#endif
    10591143#if P0307_VPS_NON_VUI_EXTENSION
    1060   Int     getVpsNonVuiExtLength()         { return m_vpsNonVuiExtLength; }
    1061   Void    setVpsNonVuiExtLength(Int x)    { m_vpsNonVuiExtLength = x; }
     1144  Int    getVpsNonVuiExtLength()         { return m_vpsNonVuiExtLength; }
     1145  Void   setVpsNonVuiExtLength(Int x)    { m_vpsNonVuiExtLength = x; }
    10621146#endif
    10631147#if RESOLUTION_BASED_DPB
    1064   Void assignSubDpbIndices();
    1065   Int  getSubDpbAssigned  (Int lsIdx, Int layerIdx) { return m_subDpbAssigned[lsIdx][layerIdx]; }
    1066   Int  findLayerIdxInLayerSet ( Int lsIdx, Int nuhLayerId );
     1148  Void   assignSubDpbIndices();
     1149  Int    getSubDpbAssigned  (Int lsIdx, Int layerIdx) { return m_subDpbAssigned[lsIdx][layerIdx]; }
     1150  Int    findLayerIdxInLayerSet ( Int lsIdx, Int nuhLayerId );
     1151#endif
     1152#if O0164_MULTI_LAYER_HRD
     1153  Void setBspHrdParameters( UInt hrdIdx, UInt frameRate, UInt numDU, UInt bitRate, Bool randomAccess );
    10671154#endif
    10681155#endif //SVC_EXTENSION
     
    10771164  Int           m_winTopOffset;
    10781165  Int           m_winBottomOffset;
     1166#if P0312_VERT_PHASE_ADJ
     1167  Bool          m_vertPhasePositionEnableFlag;
     1168#endif
    10791169public:
    10801170  Window()
     
    10841174  , m_winTopOffset      (0)
    10851175  , m_winBottomOffset   (0)
     1176#if P0312_VERT_PHASE_ADJ
     1177  , m_vertPhasePositionEnableFlag(false) 
     1178#endif
    10861179  { }
    10871180
    10881181  Bool          getWindowEnabledFlag() const      { return m_enabledFlag; }
    1089   Void          resetWindow()                     { m_enabledFlag = false; m_winLeftOffset = m_winRightOffset = m_winTopOffset = m_winBottomOffset = 0; }
     1182#if P0312_VERT_PHASE_ADJ
     1183  Void          resetWindow()                     { m_enabledFlag = false; m_winLeftOffset = m_winRightOffset = m_winTopOffset = m_winBottomOffset = 0; m_vertPhasePositionEnableFlag = false; }
     1184#else
     1185  Void          resetWindow()                     { m_enabledFlag = false; m_winLeftOffset = m_winRightOffset = m_winTopOffset = m_winBottomOffset = 0;}
     1186#endif
    10901187  Int           getWindowLeftOffset() const       { return m_enabledFlag ? m_winLeftOffset : 0; }
    10911188  Void          setWindowLeftOffset(Int val)      { m_winLeftOffset = val; m_enabledFlag = true; }
     
    10971194  Void          setWindowBottomOffset(Int val)    { m_winBottomOffset = val; m_enabledFlag = true; }
    10981195
     1196#if P0312_VERT_PHASE_ADJ
     1197  Bool          getVertPhasePositionEnableFlag() const     { return m_vertPhasePositionEnableFlag;  }
     1198  Void          setVertPhasePositionEnableFlag(Bool val)    { m_vertPhasePositionEnableFlag = val;  }
     1199  Void          setWindow(Int offsetLeft, Int offsetLRight, Int offsetLTop, Int offsetLBottom, Bool vertPhasePositionEnableFlag = 0)
     1200#else
    10991201  Void          setWindow(Int offsetLeft, Int offsetLRight, Int offsetLTop, Int offsetLBottom)
     1202#endif
    11001203  {
    11011204    m_enabledFlag       = true;
     
    11041207    m_winTopOffset      = offsetLTop;
    11051208    m_winBottomOffset   = offsetLBottom;
     1209#if P0312_VERT_PHASE_ADJ
     1210    m_vertPhasePositionEnableFlag = vertPhasePositionEnableFlag;   
     1211#endif
    11061212  }
    11071213};
     
    13531459
    13541460#if SVC_EXTENSION
    1355   UInt m_layerId;
     1461  UInt        m_layerId;
    13561462  UInt        m_numScaledRefLayerOffsets;
     1463#if P0312_VERT_PHASE_ADJ
     1464 Bool         m_vertPhasePositionEnableFlag[MAX_LAYERS];
     1465#endif
    13571466#if O0098_SCALED_REF_LAYER_ID
    13581467  UInt        m_scaledRefLayerId[MAX_LAYERS];
     
    13601469  Window      m_scaledRefLayerWindow[MAX_LAYERS];
    13611470#if REPN_FORMAT_IN_VPS
    1362   Bool m_updateRepFormatFlag;
     1471  Bool        m_updateRepFormatFlag;
    13631472#if O0096_REP_FORMAT_INDEX
    1364   UInt m_updateRepFormatIndex;
     1473  UInt        m_updateRepFormatIndex;
    13651474#endif
    13661475#endif
    13671476#if SCALINGLIST_INFERRING
    1368   Bool       m_inferScalingListFlag;
    1369   UInt       m_scalingListRefLayerId;
     1477  Bool        m_inferScalingListFlag;
     1478  UInt        m_scalingListRefLayerId;
    13701479#endif
    13711480#endif //SVC_EXTENSION
     
    15071616
    15081617#if SVC_EXTENSION
    1509   Void     setLayerId(UInt layerId) { m_layerId = layerId; }
    1510   UInt     getLayerId() { return m_layerId; }
    1511   UInt     getNumScaledRefLayerOffsets()  { return m_numScaledRefLayerOffsets; }
    1512   Void     setNumScaledRefLayerOffsets(Int x)  { m_numScaledRefLayerOffsets = x; }
     1618  Void     setLayerId(UInt layerId)            { m_layerId = layerId; }
     1619  UInt     getLayerId()                        { return m_layerId;    }
     1620  UInt     getNumScaledRefLayerOffsets()       { return m_numScaledRefLayerOffsets; }
     1621  Void     setNumScaledRefLayerOffsets(Int x)  { m_numScaledRefLayerOffsets = x;    }
     1622#if P0312_VERT_PHASE_ADJ
     1623  Bool     getVertPhasePositionEnableFlag(Int x)          { return m_vertPhasePositionEnableFlag[x]; }
     1624  Void     setVertPhasePositionEnableFlag(Int x, Bool b)  { m_vertPhasePositionEnableFlag[x] = b;    }
     1625#endif
    15131626#if O0098_SCALED_REF_LAYER_ID
    15141627  UInt     getScaledRefLayerId(Int x)          { return m_scaledRefLayerId[x]; }
    1515   Void     setScaledRefLayerId(Int x, UInt id) { m_scaledRefLayerId[x] = id; }
     1628  Void     setScaledRefLayerId(Int x, UInt id) { m_scaledRefLayerId[x] = id;   }
    15161629  Window&  getScaledRefLayerWindowForLayer( Int layerId );
    15171630#endif
     
    16241737  Bool     m_inferScalingListFlag;
    16251738  UInt     m_scalingListRefLayerId;
     1739#endif
     1740#if POC_RESET_IDC
     1741  Bool     m_pocResetInfoPresentFlag;
    16261742#endif
    16271743#endif
     
    17621878  Bool getSliceHeaderExtensionPresentFlag   ()                    { return m_sliceHeaderExtensionPresentFlag; }
    17631879  Void setSliceHeaderExtensionPresentFlag   (Bool val)            { m_sliceHeaderExtensionPresentFlag = val; }
     1880#if POC_RESET_IDC
     1881  Bool getPocResetInfoPresentFlag   ()                    { return m_pocResetInfoPresentFlag; }
     1882  Void setPocResetInfoPresentFlag   (const Bool val)      { m_pocResetInfoPresentFlag = val; }
     1883#endif
    17641884};
    17651885
     
    18992019  Int         m_activeNumILRRefIdx;        //< Active inter-layer reference pictures
    19002020  Int         m_interLayerPredLayerIdc  [MAX_VPS_LAYER_ID_PLUS1];
     2021#if P0312_VERT_PHASE_ADJ
     2022  Bool        m_vertPhasePositionFlag[MAX_VPS_LAYER_ID_PLUS1];
     2023#endif
    19012024#if POC_RESET_FLAG
    19022025  Bool        m_bPocResetFlag;
     
    19062029#if O0149_CROSS_LAYER_BLA_FLAG
    19072030  Bool        m_bCrossLayerBLAFlag;
     2031#endif
     2032#if NO_OUTPUT_OF_PRIOR_PICS
     2033  Bool        m_noOutputOfPriorPicsFlag;
     2034  Bool        m_noRaslOutputFlag;
     2035  Bool        m_handleCraAsBlaFlag;
     2036#endif
     2037#if POC_RESET_IDC_SIGNALLING
     2038  Int         m_pocResetIdc;
     2039  Int         m_pocResetPeriodId;
     2040  Bool        m_fullPocResetFlag;
     2041  Int         m_pocLsbVal;
     2042  Int         m_pocMsbVal;
     2043  Bool        m_pocMsbValRequiredFlag;
     2044  Bool        m_pocMsbValPresentFlag;
    19082045#endif
    19092046#endif //SVC_EXTENSION
     
    19932130  NalUnitType getNalUnitType    () const                        { return m_eNalUnitType;        }
    19942131  Bool      getRapPicFlag       (); 
     2132#if NO_OUTPUT_OF_PRIOR_PICS
     2133  Bool      getBlaPicFlag       ();
     2134  Bool      getCraPicFlag       ();
     2135#endif
    19952136  Bool      getIdrPicFlag       ()                              { return getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL || getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP; }
    19962137  Bool      isIRAP              () const                        { return (getNalUnitType() >= 16) && (getNalUnitType() <= 23); } 
     
    21702311  Bool      getInterLayerPredEnabledFlag     ()                { return m_interLayerPredEnabledFlag;}
    21712312
     2313#if P0312_VERT_PHASE_ADJ
     2314  Int       getVertPhasePositionFlag (UInt layerIdx)              { return   m_vertPhasePositionFlag[layerIdx];}
     2315  Void      setVertPhasePositionFlag (Bool b, UInt layerIdx)      {  m_vertPhasePositionFlag[layerIdx] = b;  }
     2316#endif
     2317
    21722318  Void      setNumMotionPredRefLayers(int i)            { m_numMotionPredRefLayers = i; }
    21732319  Int       getNumMotionPredRefLayers()                 { return m_numMotionPredRefLayers; }
     
    22142360
    22152361  Void setILRPic(TComPic **pcIlpPic);
     2362#if NO_OUTPUT_OF_PRIOR_PICS
     2363  Void setNoOutputOfPriorPicsFlag(const Bool x)   { m_noOutputOfPriorPicsFlag = x;    }
     2364  Bool getNoOutputOfPriorPicsFlag()               { return m_noOutputOfPriorPicsFlag; }
     2365
     2366  Void setNoRaslOutputFlag    ( const Bool val )   { m_noRaslOutputFlag = val;  }
     2367  Bool getNoRaslOutputFlag    ()                   { return m_noRaslOutputFlag; }
     2368
     2369  Void setHandleCraAsBlaFlag  ( const Bool val )   { m_handleCraAsBlaFlag = val;  }
     2370  Bool getHandleCraAsBlaFlag  ()                   { return m_handleCraAsBlaFlag; }
     2371
     2372#endif
     2373#if POC_RESET_IDC_SIGNALLING
     2374  Int       getPocResetIdc       ()                              { return m_pocResetIdc;       }
     2375  Void      setPocResetIdc       (Int b)                         { m_pocResetIdc = b;          }
     2376  Int       getPocResetPeriodId  ()                              { return m_pocResetPeriodId;       }
     2377  Void      setPocResetPeriodId  (Int b)                         { m_pocResetPeriodId = b;          }
     2378  Bool      getFullPocResetFlag  ()                              { return m_fullPocResetFlag;       }
     2379  Void      setFullPocResetFlag  (Bool b)                        { m_fullPocResetFlag = b;          }
     2380  Int       getPocLsbVal         ()                              { return m_pocLsbVal;       }
     2381  Void      setPocLsbVal       (Int b)                           { m_pocLsbVal = b;          }
     2382  Int       getPocMsbVal         ()                              { return m_pocMsbVal;       }
     2383  Void      setPocMsbVal       (Int b)                           { m_pocMsbVal = b;          }
     2384  Bool      getPocMsbValPresentFlag ()                           { return m_pocMsbValPresentFlag; }
     2385  Void      setPocMsbValPresentFlag (Bool x)                     { m_pocMsbValPresentFlag = x; }
     2386  Bool      getPocMsbValRequiredFlag ()                           { return m_pocMsbValRequiredFlag; }
     2387  Void      setPocMsbValRequiredFlag (Bool x)                     { m_pocMsbValRequiredFlag = x; }
     2388#endif
    22162389
    22172390#endif //SVC_EXTENSION
  • trunk/source/Lib/TLibCommon/TComUpsampleFilter.cpp

    r498 r644  
    127127  Int strideEL  = pcUsPic->getStride();
    128128
     129#if P0312_VERT_PHASE_ADJ
     130  Bool vertPhasePositionEnableFlag = scalEL.getVertPhasePositionEnableFlag();
     131  Bool vertPhasePositionFlag = currSlice->getVertPhasePositionFlag( refLayerIdc );
     132  if( vertPhasePositionFlag )
     133  {
     134    assert( vertPhasePositionEnableFlag );
     135  }
     136#endif
     137
    129138  Pel* piTempBufY = pcTempPic->getLumaAddr();
    130139  Pel* piSrcBufY  = pcBasePic->getLumaAddr();
     
    155164#endif
    156165
     166  // non-normative software optimization for certain simple resampling cases
    157167  if( scaleX == 65536 && scaleY == 65536 ) // ratio 1x
    158168  {
    159169    piSrcY = piSrcBufY;
    160170    piDstY = piDstBufY + scalEL.getWindowLeftOffset() + scalEL.getWindowTopOffset() * strideEL;
     171
     172#if O0194_JOINT_US_BITSHIFT
     173    Int shift = g_bitDepthYLayer[currLayerId] - g_bitDepthYLayer[refLayerId];
     174#endif
     175
    161176    for( i = 0; i < heightBL; i++ )
    162177    {
     178#if O0194_JOINT_US_BITSHIFT
     179      for( j = 0; j < widthBL; j++ )
     180      {
     181        piDstY[j] = piSrcY[j] << shift;
     182      }
     183#else
    163184      memcpy( piDstY, piSrcY, sizeof(Pel) * widthBL );
     185#endif
    164186      piSrcY += strideBL;
    165187      piDstY += strideEL;
     
    172194    heightBL >>= 1;
    173195
    174     strideBL  = pcBasePic->getCStride();
    175     strideEL  = pcUsPic->getCStride();
     196    strideBL = pcBasePic->getCStride();
     197    strideEL = pcUsPic->getCStride();
    176198
    177199    piSrcU = piSrcBufU;
     
    181203    piDstV = piDstBufV + ( scalEL.getWindowLeftOffset() >> 1 ) + ( scalEL.getWindowTopOffset() >> 1 ) * strideEL;
    182204
     205#if O0194_JOINT_US_BITSHIFT
     206    shift = g_bitDepthCLayer[currLayerId] - g_bitDepthCLayer[refLayerId];
     207#endif
     208
    183209    for( i = 0; i < heightBL; i++ )
    184210    {
     211#if O0194_JOINT_US_BITSHIFT
     212      for( j = 0; j < widthBL; j++ )
     213      {
     214        piDstU[j] = piSrcU[j] << shift;
     215        piDstV[j] = piSrcV[j] << shift;
     216      }
     217#else
    185218      memcpy( piDstU, piSrcU, sizeof(Pel) * widthBL );
    186219      memcpy( piDstV, piSrcV, sizeof(Pel) * widthBL );
     220#endif
    187221      piSrcU += strideBL;
    188222      piSrcV += strideBL;
     
    191225    }
    192226  }
    193   else
     227  else // general resampling process
    194228  {
    195229    Int refPos16 = 0;
     
    212246
    213247    pcBasePic->setBorderExtension(false);
    214     pcBasePic->extendPicBorder   (); // extend the border.
     248    pcBasePic->extendPicBorder(); // extend the border.
    215249
    216250    Int   shiftX = 16;
     
    219253#if O0215_PHASE_ALIGNMENT //for Luma, if Phase 0, then both PhaseX  and PhaseY should be 0. If symmetric: both PhaseX and PhaseY should be 2
    220254    Int   phaseX = 2*phaseAlignFlag;
     255#if P0312_VERT_PHASE_ADJ
     256    Int   phaseY = vertPhasePositionEnableFlag ? ( vertPhasePositionFlag * 4 ) : ( 2 * phaseAlignFlag );
     257#else
    221258    Int   phaseY = 2*phaseAlignFlag;
     259#endif
    222260#else
    223261    Int   phaseX = 0;
     262#if P0312_VERT_PHASE_ADJ
     263    Int   phaseY = (vertPhasePositionEnableFlag?(vertPhasePositionFlag *4):(0));
     264#else
    224265    Int   phaseY = 0;
     266#endif
    225267#endif
    226268
     
    251293    Int leftOffset = leftStartL > 0 ? leftStartL : 0;
    252294
    253 #if  N0214_INTERMEDIATE_BUFFER_16BITS
     295#if N0214_INTERMEDIATE_BUFFER_16BITS
    254296#if O0194_JOINT_US_BITSHIFT
    255297    // g_bitDepthY was set to EL bit-depth, but shift1 should be calculated using BL bit-depth
     
    274316      for( j = 0; j < heightBL ; j++ )
    275317      {
    276 #if  N0214_INTERMEDIATE_BUFFER_16BITS
     318#if N0214_INTERMEDIATE_BUFFER_16BITS
    277319        *piDstY = sumLumaHor(piSrcY, coeff) >> shift1;
    278320#else
     
    290332    pcTempPic->setHeight(heightEL);
    291333
    292 #if  N0214_INTERMEDIATE_BUFFER_16BITS
     334#if N0214_INTERMEDIATE_BUFFER_16BITS
    293335#if O0194_JOINT_US_BITSHIFT
    294336    Int nShift = 20 - g_bitDepthYLayer[currLayerId];
     
    363405
    364406#if O0215_PHASE_ALIGNMENT
     407    Int phaseXC = phaseAlignFlag;
     408#if P0312_VERT_PHASE_ADJ
     409    Int phaseYC = vertPhasePositionEnableFlag ? ( vertPhasePositionFlag * 4 ) : ( phaseAlignFlag + 1 );
     410#else
     411    Int phaseYC = phaseAlignFlag + 1;
     412#endif
     413#else
    365414    Int phaseXC = 0;
     415#if P0312_VERT_PHASE_ADJ
     416    Int phaseYC = vertPhasePositionEnableFlag ? (vertPhasePositionFlag * 4): 1;
     417#else
    366418    Int phaseYC = 1;
    367 
     419#endif
     420#endif
     421   
    368422#if ROUNDING_OFFSET
    369     addX       = ( ( (phaseXC+phaseAlignFlag) * scaleX + 2 ) >> 2 ) + ( 1 << ( shiftX - 5 ) );
    370     addY       = ( ( (phaseYC+phaseAlignFlag) * scaleY + 2 ) >> 2 ) + ( 1 << ( shiftY - 5 ) );
    371 #else
    372     addX       = ( ( ( widthBL * (phaseXC+phaseAlignFlag) ) << ( shiftX - 2 ) ) + ( widthEL >> 1 ) ) / widthEL + ( 1 << ( shiftX - 5 ) );
    373     addY       = ( ( ( heightBL * (phaseYC+phaseAlignFlag) ) << ( shiftY - 2 ) ) + ( heightEL >> 1 ) ) / heightEL+ ( 1 << ( shiftY - 5 ) );
    374 #endif
    375 
    376     deltaX     = 4 * (phaseXC+phaseAlignFlag);
    377     deltaY     = 4 * (phaseYC+phaseAlignFlag);
    378 #else
    379     phaseX = 0;
    380     phaseY = 1;
    381 
    382 #if ROUNDING_OFFSET
    383     addX       = ( ( phaseX * scaleX + 2 ) >> 2 ) + ( 1 << ( shiftX - 5 ) );
    384     addY       = ( ( phaseY * scaleY + 2 ) >> 2 ) + ( 1 << ( shiftY - 5 ) );
    385 #else
    386     addX       = ( ( ( widthBL * phaseX ) << ( shiftX - 2 ) ) + ( widthEL >> 1 ) ) / widthEL + ( 1 << ( shiftX - 5 ) );
    387     addY       = ( ( ( heightBL * phaseY ) << ( shiftY - 2 ) ) + ( heightEL >> 1 ) ) / heightEL+ ( 1 << ( shiftY - 5 ) );
    388 #endif
    389 
    390     deltaX     = 4 * phaseX;
    391     deltaY     = 4 * phaseY;
    392 #endif
     423    addX       = ( ( phaseXC * scaleX + 2 ) >> 2 ) + ( 1 << ( shiftX - 5 ) );
     424    addY       = ( ( phaseYC * scaleY + 2 ) >> 2 ) + ( 1 << ( shiftY - 5 ) );
     425#else
     426    addX       = ( ( ( widthBL * (phaseXC) ) << ( shiftX - 2 ) ) + ( widthEL >> 1 ) ) / widthEL + ( 1 << ( shiftX - 5 ) );
     427    addY       = ( ( ( heightBL * (phaseYC) ) << ( shiftY - 2 ) ) + ( heightEL >> 1 ) ) / heightEL+ ( 1 << ( shiftY - 5 ) );
     428#endif
     429
     430    deltaX     = 4 * phaseXC;
     431    deltaY     = 4 * phaseYC;
    393432
    394433    shiftXM4 = shiftX - 4;
     
    401440    heightBL  = min<Int>( pcBasePic->getHeight() >> 1, heightEL );
    402441
    403 #if  N0214_INTERMEDIATE_BUFFER_16BITS
     442#if N0214_INTERMEDIATE_BUFFER_16BITS
    404443#if O0194_JOINT_US_BITSHIFT
    405444    // g_bitDepthC was set to EL bit-depth, but shift1 should be calculated using BL bit-depth
     
    426465      for( j = 0; j < heightBL ; j++ )
    427466      {
    428 #if  N0214_INTERMEDIATE_BUFFER_16BITS
     467#if N0214_INTERMEDIATE_BUFFER_16BITS
    429468        *piDstU = sumChromaHor(piSrcU, coeff) >> shift1;
    430469        *piDstV = sumChromaHor(piSrcV, coeff) >> shift1;
     
    447486    pcTempPic->setHeight(heightEL << 1);
    448487
    449 #if  N0214_INTERMEDIATE_BUFFER_16BITS
     488#if N0214_INTERMEDIATE_BUFFER_16BITS
    450489#if O0194_JOINT_US_BITSHIFT
    451490    nShift = 20 - g_bitDepthCLayer[currLayerId];
  • trunk/source/Lib/TLibCommon/TComUpsampleFilter.h

    r494 r644  
    4545#if O0215_PHASE_ALIGNMENT
    4646#if O0194_JOINT_US_BITSHIFT
    47   Void upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, bool phaseAlignFlag );
     47  Void upsampleBasePic( TComSlice* currSlice, UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, Bool phaseAlignFlag );
    4848#else
    49   Void upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, bool phaseAlignFlag );
     49  Void upsampleBasePic( UInt refLayerIdc, TComPicYuv* pcUsPic, TComPicYuv* pcBasePic, TComPicYuv* pcTempPic, const Window window, Bool phaseAlignFlag );
    5050#endif
    5151#else
  • trunk/source/Lib/TLibCommon/TypeDef.h

    r595 r644  
    5050#define O0137_MAX_LAYERID                1      ///< JCTVC-O0137, JCTVC-O0200, JCTVC-O0223: restrict nuh_layer_id and vps_max_layers_minus1
    5151
     52#define P0312_VERT_PHASE_ADJ             1      ///< JCTVC-P0312: vertical phase adjustment in re-sampling process (BoG report)
    5253#define P0130_EOB                        1      ///< JCTVC-P0130, set layer Id of EOB NALU to be fixed to 0
    5354#define P0307_REMOVE_VPS_VUI_OFFSET      1      ///< JCTVC-P0307, remove implementation related to VPS VUI offset signalling
    5455#define P0307_VPS_NON_VUI_EXTENSION      1      ///< JCTVC-P0307, implementation related to NON VUI VPS Extension signalling
     56#define P0307_VPS_NON_VUI_EXT_UPDATE     1      ///< JCTVC-P0307, implementation related to NON VUI VPS Extension signalling
    5557
    5658#define DISCARDABLE_PIC_RPS              1      ///< JCTVC-P0130: Inter-layer RPS and temporal RPS should not contain picture with discardable_flag equal to 1
     
    5860#define CHANGE_NUMSUBDPB_IDX             1      ///< Change index of NumSubDpb from output layer set to layer set, to be more aligned with the Spec
    5961#define RESOLUTION_BASED_DPB             1      ///< JCTVC-P0192: Assign layers to sub-DPBs based on the rep_format() signaled in the VPS
     62#define ALIGNED_BUMPING                  1      ///< JCTVC-P0192: Align bumping of pictures in an AU
     63#define MAX_SUBDPBS                      MAX_LAYERS
    6064#define SUB_BITSTREAM_PROPERTY_SEI       1      ///< JCTVC-P0204: Sub-bitstream property SEI message
    6165#if SUB_BITSTREAM_PROPERTY_SEI
     
    7579
    7680#define O0135_DEFAULT_ONE_OUT_SEMANTIC   1      ///< JCTVC-O0135: semantics change of default_one_target_output_layer_idc for auxiliary pictures
     81
     82#define O0164_MULTI_LAYER_HRD            1      ///< JCTVC-O0164: Multi-layer HRD operation
    7783
    7884#define O0194_DIFFERENT_BITDEPTH_EL_BL   1      ///< JCTVC-O0194: Support for different bitdepth values for BL and EL, add required configuration parameters (and Some bugfixes when REPN_FORMAT_IN_VPS (JCTVC-N0092) is enabled)
     
    8490#define VPS_NUH_LAYER_ID                 1      ///< JCTVC-N0085: Assert that the nuh_layer_id of VPS NAL unit should be 0
    8591#define POC_RESET_FLAG                   1      ///< JCTVC-N0244: POC reset flag for  layer pictures.
     92#define POC_RESET_IDC                    1      ///< JCTVC-P0041: Include poc_reset_idc and related derivation - eventually will replace POC_RESET_FLAG
     93#if POC_RESET_IDC
     94#define POC_RESET_IDC_SIGNALLING         1      ///< JCTVC-P0041: Include signalling for poc_reset related syntax elements
     95#endif
     96#define NO_OUTPUT_OF_PRIOR_PICS          1      ///< Use no_output_of_prior_pics_flag
    8697#define ALIGN_TSA_STSA_PICS              1      ///< JCTVC-N0084: Alignment of TSA and STSA pictures across AU.
    8798#define REPN_FORMAT_IN_VPS               1      ///< JCTVC-N0092: Signal represenation format (spatial resolution, bit depth, colour format) in the VPS
     
    137148#define VPS_VUI_VIDEO_SIGNAL_MOVE        1      ///< JCTVC-P0076 Move video signal information syntax structure earlier in the VPS VUI
    138149#endif
     150#define P0182_VPS_VUI_PS_FLAG            1      ///< JCTVC-P0182, add base_layer_parameter_set_compatibility_flag
    139151#endif //VPS_VUI
    140152
     
    179191#define O0223_PICTURE_TYPES_ALIGN_FLAG   1  ///< a flag to indicatate whether picture types are aligned across layers.
    180192
     193#define P0068_CROSS_LAYER_ALIGNED_IDR_ONLY_FOR_IRAP_FLAG   1  ///< a flag to indicatate whether picture types for IRAP are IDR across layers.
     194
    181195#define N0147_IRAP_ALIGN_FLAG            1      ///< a flag to indicatate whether IRAPs are aligned across layers
    182196#if N0147_IRAP_ALIGN_FLAG
     
    216230
    217231#define O0153_ALT_OUTPUT_LAYER_FLAG      1      ///< JCTVC-O0153: alt output layer flag
     232#define P0300_ALT_OUTPUT_LAYER_FLAG      1      ///< JCTVC-P0300: alt output layer flag
    218233
    219234#define VPS_DPB_SIZE_TABLE               1      ///< JCTVC-O0217: DPB operations: signaling DPB-related parameters
     
    224239#endif
    225240#endif
    226 
     241#define SPS_DPB_PARAMS                   1      ///< JCTVC-P0155 signaling & inferrence for sps dpb parameters for nuh_layer_id > 0
     242#define DPB_PARAMS_MAXTLAYERS            1      ///< JCTVC-P0156 DPB parameters up to maximum temporal sub-layers in the layer set
     243#define NUM_OL_FLAGS                     1      ///< JCTVC-P0156 output_layer_flag[ i ][ j ] is signalled for j equal to 0 to NumLayersInIdList[ lsIdx ] inclusive
    227244#define NO_CLRAS_OUTPUT_FLAG             1
    228245#define O0149_CROSS_LAYER_BLA_FLAG       1      ///< JCTVC-O0149: signal cross_layer_bla_flag in slice header
     246
     247#define P0138_USE_ALT_CPB_PARAMS_FLAG    1      ///< JCTVC-P0138: use_alt_cpb_params_flag syntax in buffering period SEI message extension
     248#define P0166_MODIFIED_PPS_EXTENSION     1      ///< JCTVC-P0166: add pps_extension_type_flag
    229249
    230250#if VIEW_ID_RELATED_SIGNALING
Note: See TracChangeset for help on using the changeset viewer.