Changeset 644 in SHVCSoftware for trunk/source/Lib/TLibCommon/TComSlice.cpp


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

merge with SHM-5.1-dev branch

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/source

  • 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
Note: See TracChangeset for help on using the changeset viewer.