Changeset 1588 in SHVCSoftware


Ignore:
Timestamp:
23 Nov 2016, 01:44:46 (8 years ago)
Author:
seregin
Message:

fix POC reset and POC update for intra period equal to -1, problem reported by Ramin Ghaznavi-Youvalari <ramin.ghaznavi-youvalari@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp

    r1579 r1588  
    14871487    Bool pocResettingFlag = false;
    14881488
    1489     if( pcSlice->getPocResetIdc() != 0 )
     1489    if( pcSlice->getPocResetIdc() )
    14901490    {
    14911491      if( pcSlice->getVPS()->getVpsPocLsbAlignedFlag() )
     
    15111511    {
    15121512      // Check the base layer picture is IDR. If so, just set current POC equal to 0 (alignment of POC)
    1513       if( ( m_ppcTEncTop[0]->getGOPEncoder()->getIntraRefreshType() == 2) && ( pocCurr % m_ppcTEncTop[0]->getGOPEncoder()->getIntraRefreshInterval() == 0 ) )       
     1513      if( ( m_ppcTEncTop[0]->getGOPEncoder()->getIntraRefreshType() == 2) && m_ppcTEncTop[0]->getGOPEncoder()->getIntraRefreshInterval() >= 0 && ( pocCurr % m_ppcTEncTop[0]->getGOPEncoder()->getIntraRefreshInterval() == 0 ) )       
    15141514      {
    15151515        m_pcEncTop->setPocAdjustmentValue( pocCurr );
     
    39223922  if( slice->getSliceIdx() == 0 ) // First slice - compute, copy for other slices
    39233923  {
    3924     Int needReset = false;
    3925     Int resetDueToBL = false;
     3924    Bool needReset = false, resetDueToBL = false;
     3925
    39263926    if( slice->getVPS()->getMaxLayers() > 1 )
    39273927    {
    39283928      // If IRAP is refreshed in this access unit for base layer
    3929       if( (m_ppcTEncTop[0]->getGOPEncoder()->getIntraRefreshType() == 1 || m_ppcTEncTop[0]->getGOPEncoder()->getIntraRefreshType() == 2)
    3930         && ( pocCurr % m_ppcTEncTop[0]->getGOPEncoder()->getIntraRefreshInterval() == 0 )
    3931         )
     3929      if( m_ppcTEncTop[0]->getGOPEncoder()->getIntraRefreshType() > 0 && pocCurr && m_ppcTEncTop[0]->getGOPEncoder()->getIntraRefreshInterval() >= 0 && ( pocCurr % m_ppcTEncTop[0]->getGOPEncoder()->getIntraRefreshInterval() == 0 ) )
    39323930      {
    39333931        // Check if the IRAP refresh interval of any layer does not match that of the base layer
    3934         for(Int i = 1; i < slice->getVPS()->getMaxLayers(); i++)
    3935         {
    3936           Bool refreshIntervalFlag = ( pocCurr % m_ppcTEncTop[i]->getGOPEncoder()->getIntraRefreshInterval() == 0 );
    3937           Bool refreshTypeFlag     = ( m_ppcTEncTop[0]->getGOPEncoder()->getIntraRefreshType() == m_ppcTEncTop[i]->getGOPEncoder()->getIntraRefreshType() );
    3938           if( !(refreshIntervalFlag && refreshTypeFlag) )
     3932        for( Int i = 1; i < slice->getVPS()->getMaxLayers(); i++ )
     3933        {
     3934          Bool refreshIntervalFlag = pocCurr % m_ppcTEncTop[i]->getGOPEncoder()->getIntraRefreshInterval() == 0;
     3935          Bool refreshTypeFlag     = m_ppcTEncTop[0]->getGOPEncoder()->getIntraRefreshType() == m_ppcTEncTop[i]->getGOPEncoder()->getIntraRefreshType();
     3936
     3937          if( !refreshIntervalFlag || !refreshTypeFlag )
    39393938          {
    39403939            needReset = true;
     
    39493948    {
    39503949      // Check if EL IDRs results in POC Reset
    3951       for(Int i = 1; i < slice->getVPS()->getMaxLayers() && !needReset; i++)
    3952       {
    3953         Bool idrFlag = ( (m_ppcTEncTop[i]->getGOPEncoder()->getIntraRefreshType() == 2)
    3954           && ( pocCurr % m_ppcTEncTop[i]->getGOPEncoder()->getIntraRefreshInterval() == 0 )
    3955           );
    3956         for(Int j = 0; j < slice->getVPS()->getMaxLayers(); j++)
     3950      for( Int i = 1; i < slice->getVPS()->getMaxLayers() && !needReset; i++ )
     3951      {
     3952        Bool idrFlag = m_ppcTEncTop[i]->getGOPEncoder()->getIntraRefreshType() == 2 && pocCurr && m_ppcTEncTop[i]->getGOPEncoder()->getIntraRefreshInterval() >= 0 && ( pocCurr % m_ppcTEncTop[i]->getGOPEncoder()->getIntraRefreshInterval() == 0 );
     3953
     3954        for( Int j = 0; j < slice->getVPS()->getMaxLayers(); j++ )
    39573955        {
    39583956          if( j == i )
     
    39613959          }
    39623960
    3963           Bool idrOtherPicFlag = ( (m_ppcTEncTop[j]->getGOPEncoder()->getIntraRefreshType() == 2)
    3964             && ( pocCurr % m_ppcTEncTop[j]->getGOPEncoder()->getIntraRefreshInterval() == 0 )
    3965             );
     3961          Bool idrOtherPicFlag = m_ppcTEncTop[j]->getGOPEncoder()->getIntraRefreshType() == 2 && pocCurr && m_ppcTEncTop[j]->getGOPEncoder()->getIntraRefreshInterval() >= 0 && ( pocCurr % m_ppcTEncTop[j]->getGOPEncoder()->getIntraRefreshInterval() == 0 );
    39663962
    39673963          if( idrFlag != idrOtherPicFlag )
     
    39733969      }
    39743970    }
     3971
    39753972    if( needReset )
    39763973    {
     
    39973994
    39983995      // Start a new POC reset period
    3999       if (m_layerId == 0)   // Assuming BL picture is always present at encoder; for other AU structures, need to change this
     3996      if( m_layerId == 0 )   // Assuming BL picture is always present at encoder; for other AU structures, need to change this
    40003997      {
    40013998        Int periodId = rand() % 64;
    4002         m_lastPocPeriodId = (periodId == m_lastPocPeriodId) ? (periodId + 1) % 64 : periodId ;
     3999        m_lastPocPeriodId = periodId == m_lastPocPeriodId ? (periodId + 1) % 64 : periodId;
    40034000
    40044001        for( UInt i = 0; i < m_pcCfg->getNumLayer(); i++ )
Note: See TracChangeset for help on using the changeset viewer.