Ignore:
Timestamp:
8 Jul 2015, 20:02:01 (9 years ago)
Author:
seregin
Message:

macro cleanup: P0297_VPS_POC_LSB_ALIGNED_FLAG

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp

    r1191 r1199  
    124124  resetPocRestrictionCheckParameters();
    125125#endif
    126 #if P0297_VPS_POC_LSB_ALIGNED_FLAG
    127126  m_pocResettingFlag        = false;
    128127  m_pocDecrementedInDPBFlag = false;
    129 #endif
    130128#if CONFORMANCE_BITSTREAM_MODE
    131129  m_confModeFlag = false;
     
    909907#endif
    910908      markAllPicsAsNoCurrAu(m_apcSlicePilot->getVPS());
    911 #if P0297_VPS_POC_LSB_ALIGNED_FLAG
    912       for (UInt i = 0; i < MAX_LAYERS; i++)
     909
     910      for( UInt i = 0; i < MAX_LAYERS; i++ )
    913911      {
    914912        m_ppcTDecTop[m_apcSlicePilot->getVPS()->getLayerIdInNuh(i)]->m_pocDecrementedInDPBFlag = false;
    915913      }
    916 #endif
    917     }
    918 
    919 
    920 #if P0297_VPS_POC_LSB_ALIGNED_FLAG
     914    }
     915
    921916    m_pocResettingFlag = false;
    922917
    923     if (m_apcSlicePilot->getPocResetIdc() != 0)
    924     {
    925       if (m_apcSlicePilot->getVPS()->getVpsPocLsbAlignedFlag())
     918    if( m_apcSlicePilot->getPocResetIdc() != 0 )
     919    {
     920      if( m_apcSlicePilot->getVPS()->getVpsPocLsbAlignedFlag() )
    926921      {
    927922        m_pocResettingFlag = true;
     
    936931      }
    937932    }
    938 #endif
    939933
    940934    if( m_apcSlicePilot->getPocResetIdc() && m_apcSlicePilot->getSliceIdx() == 0 )
     
    984978#if ALIGNED_BUMPING
    985979#if POC_RESET_IDC_DECODER
    986 
    987 #if P0297_VPS_POC_LSB_ALIGNED_FLAG
    988980  UInt affectedLayerList[MAX_LAYERS];
    989981  Int  numAffectedLayers;
     
    992984  numAffectedLayers = 1;
    993985
    994   if (m_apcSlicePilot->getVPS()->getVpsPocLsbAlignedFlag())
    995   {
    996     for (UInt j = 0; j < m_apcSlicePilot->getVPS()->getNumPredictedLayers(m_apcSlicePilot->getLayerId()); j++)
     986  if( m_apcSlicePilot->getVPS()->getVpsPocLsbAlignedFlag() )
     987  {
     988    for( UInt j = 0; j < m_apcSlicePilot->getVPS()->getNumPredictedLayers(m_apcSlicePilot->getLayerId()); j++ )
    997989    {
    998990      affectedLayerList[j + 1] = m_apcSlicePilot->getVPS()->getPredictedLayerId(m_apcSlicePilot->getLayerId(), j);
     
    1000992    numAffectedLayers = m_apcSlicePilot->getVPS()->getNumPredictedLayers(m_apcSlicePilot->getLayerId()) + 1;
    1001993  }
    1002 #endif
    1003 
    1004   //if(  (bNewPOC || m_layerId != m_uiPrevLayerId) && ( m_parseIdc != 1) )
    1005 #if P0297_VPS_POC_LSB_ALIGNED_FLAG
    1006   if (m_parseIdc == 1 && m_pocResettingFlag)
    1007 #else
    1008   if (m_parseIdc == 1)
    1009 #endif
     994
     995  if( m_parseIdc == 1 && m_pocResettingFlag )
    1010996  {
    1011997    // Invoke output of pictures if the current picture is a POC reset picture
     
    1013999    /* Include reset of all POCs in the layer */
    10141000
    1015   // This operation would do the following:
    1016   // 1. Update the other picture in the DPB. This should be done only for the first slice of the picture.
    1017   // 2. Update the value of m_pocCRA.
    1018   // 3. Reset the POC values at the decoder for the current picture to be zero - will be done later
    1019   // 4. update value of POCLastDisplay
    1020      
    1021   //Do the reset stuff here
     1001    // This operation would do the following:
     1002    // 1. Update the other picture in the DPB. This should be done only for the first slice of the picture.
     1003    // 2. Update the value of m_pocCRA.
     1004    // 3. Reset the POC values at the decoder for the current picture to be zero - will be done later
     1005    // 4. update value of POCLastDisplay
     1006
     1007    //Do the reset stuff here
    10221008    Int maxPocLsb = 1 << m_apcSlicePilot->getSPS()->getBitsForPOC();
    10231009    Int pocLsbVal;
     
    10321018
    10331019    Int pocMsbDelta = 0;
    1034     if ( m_apcSlicePilot->getPocMsbValPresentFlag() )
     1020    if( m_apcSlicePilot->getPocMsbValPresentFlag() )
    10351021    {
    10361022      pocMsbDelta = m_apcSlicePilot->getPocMsbVal() * maxPocLsb;
     
    10581044    Int deltaPocVal  =  pocMsbDelta + pocLsbDelta;
    10591045
    1060 #if P0297_VPS_POC_LSB_ALIGNED_FLAG
    1061     for (UInt layerIdx = 0; layerIdx < numAffectedLayers; layerIdx++)
     1046    for( UInt layerIdx = 0; layerIdx < numAffectedLayers; layerIdx++ )
    10621047    {
    10631048      if (!m_ppcTDecTop[affectedLayerList[layerIdx]]->m_pocDecrementedInDPBFlag)
     
    10651050        m_ppcTDecTop[affectedLayerList[layerIdx]]->m_pocDecrementedInDPBFlag = true;
    10661051        TComList<TComPic*>::iterator  iterPic = m_ppcTDecTop[affectedLayerList[layerIdx]]->getListPic()->begin();
     1052
    10671053        while (iterPic != m_ppcTDecTop[affectedLayerList[layerIdx]]->getListPic()->end())
    1068 #else
    1069     //Reset all POC for DPB -> basically do it for each slice in the picutre
    1070     TComList<TComPic*>::iterator  iterPic = m_cListPic.begin(); 
    1071 
    1072     // Iterate through all picture in DPB
    1073     while( iterPic != m_cListPic.end() )
    1074 #endif
    1075     {
    1076       TComPic *dpbPic = *iterPic;
    1077       // Check if the picture pointed to by iterPic is either used for reference or
    1078       // needed for output, are in the same layer, and not the current picture.
    1079 #if P0297_VPS_POC_LSB_ALIGNED_FLAG
    1080       assert(dpbPic->getLayerId() == affectedLayerList[layerIdx]);
    1081       if ( (dpbPic->getReconMark()) && (dpbPic->getPicSym()->getSlice(0)->getPicOutputFlag()) )
    1082 #else
    1083       if ( /*  ( ( dpbPic->getSlice(0)->isReferenced() ) || ( dpbPic->getOutputMark() ) )
    1084           &&*/ ( dpbPic->getLayerId() == m_apcSlicePilot->getLayerId() )
    1085             && ( dpbPic->getReconMark() ) && ( dpbPic->getPicSym()->getSlice(0)->getPicOutputFlag() ))
    1086 #endif
    1087       {
    1088         for(Int i = dpbPic->getNumAllocatedSlice()-1; i >= 0; i--)
    1089         {
    1090 
    1091           TComSlice *slice = dpbPic->getSlice(i);
    1092           TComReferencePictureSet *rps = slice->getRPS();
    1093           slice->setPOC( slice->getPOC() - deltaPocVal );
    1094 
    1095           // Also adjust the POC value stored in the RPS of each such slice
    1096           for(Int j = rps->getNumberOfPictures(); j >= 0; j--)
     1054        {
     1055          TComPic *dpbPic = *iterPic;
     1056          // Check if the picture pointed to by iterPic is either used for reference or
     1057          // needed for output, are in the same layer, and not the current picture.
     1058          assert(dpbPic->getLayerId() == affectedLayerList[layerIdx]);
     1059
     1060          if( (dpbPic->getReconMark()) && (dpbPic->getPicSym()->getSlice(0)->getPicOutputFlag()) )
    10971061          {
    1098             rps->setPOC( j, rps->getPOC(j) - deltaPocVal );
    1099           }
    1100           // Also adjust the value of refPOC
    1101           for(Int k = 0; k < 2; k++)  // For List 0 and List 1
    1102           {
    1103             RefPicList list = (k == 1) ? REF_PIC_LIST_1 : REF_PIC_LIST_0;
    1104             for(Int j = 0; j < slice->getNumRefIdx(list); j++)
     1062            for(Int i = dpbPic->getNumAllocatedSlice()-1; i >= 0; i--)
    11051063            {
    1106               slice->setRefPOC( slice->getRefPOC(list, j) - deltaPocVal, list, j);
     1064
     1065              TComSlice *slice = dpbPic->getSlice(i);
     1066              TComReferencePictureSet *rps = slice->getRPS();
     1067              slice->setPOC( slice->getPOC() - deltaPocVal );
     1068
     1069              // Also adjust the POC value stored in the RPS of each such slice
     1070              for(Int j = rps->getNumberOfPictures(); j >= 0; j--)
     1071              {
     1072                rps->setPOC( j, rps->getPOC(j) - deltaPocVal );
     1073              }
     1074              // Also adjust the value of refPOC
     1075              for(Int k = 0; k < 2; k++)  // For List 0 and List 1
     1076              {
     1077                RefPicList list = (k == 1) ? REF_PIC_LIST_1 : REF_PIC_LIST_0;
     1078                for(Int j = 0; j < slice->getNumRefIdx(list); j++)
     1079                {
     1080                  slice->setRefPOC( slice->getRefPOC(list, j) - deltaPocVal, list, j);
     1081                }
     1082              }
    11071083            }
    11081084          }
    1109         }
    1110       }
    1111       iterPic++;
    1112     }
    1113 #if P0297_VPS_POC_LSB_ALIGNED_FLAG
     1085          iterPic++;
     1086        }
    11141087        // Update the value of pocCRA
    11151088        m_ppcTDecTop[affectedLayerList[layerIdx]]->m_pocCRA -= deltaPocVal;
    11161089      }
    11171090    }
    1118 #else
    1119     // Update the value of pocCRA
    1120     m_pocCRA -= deltaPocVal;
    1121 #endif
    11221091
    11231092    // Update value of POCLastDisplay
     
    11271096  Int slicePicOrderCntLsb = m_apcSlicePilot->getPicOrderCntLsb();
    11281097
    1129 #if P0297_VPS_POC_LSB_ALIGNED_FLAG
    1130   if (m_pocResettingFlag && (m_parseIdc == 1 || m_parseIdc == 2))
    1131 #else
    1132   if (m_parseIdc == 1 || m_parseIdc == 2) // TODO This should be replaced by pocResettingFlag.
    1133 #endif
     1098  if( m_pocResettingFlag && (m_parseIdc == 1 || m_parseIdc == 2) )
    11341099  {
    11351100    // Set poc for current slice
     
    11721137    // Adjust prevPicOrderCnt
    11731138    if(    !m_apcSlicePilot->getRaslPicFlag()
    1174         && !m_apcSlicePilot->getRadlPicFlag()
    1175         && (m_apcSlicePilot->getNalUnitType() % 2 == 1)
    1176         && ( nalu.m_temporalId == 0 )
    1177         && !m_apcSlicePilot->getDiscardableFlag() )
    1178     {
    1179 #if P0297_VPS_POC_LSB_ALIGNED_FLAG
    1180       for (UInt i = 0; i < numAffectedLayers; i++)
     1139      && !m_apcSlicePilot->getRadlPicFlag()
     1140      && (m_apcSlicePilot->getNalUnitType() % 2 == 1)
     1141      && ( nalu.m_temporalId == 0 )
     1142      && !m_apcSlicePilot->getDiscardableFlag() )
     1143    {
     1144      for( UInt i = 0; i < numAffectedLayers; i++ )
    11811145      {
    11821146        m_ppcTDecTop[affectedLayerList[i]]->setPrevPicOrderCnt(m_apcSlicePilot->getPOC());
    11831147      }
    1184 #else
    1185       this->setPrevPicOrderCnt( m_apcSlicePilot->getPOC() );
    1186 #endif
    1187     }
    1188     else if ( m_apcSlicePilot->getPocResetIdc() == 3 )
    1189     {
    1190 #if P0297_VPS_POC_LSB_ALIGNED_FLAG
    1191       if (!m_firstPicInLayerDecodedFlag || (m_firstPicInLayerDecodedFlag && m_pocResettingFlag))
    1192       {
    1193         for (UInt i = 0; i < numAffectedLayers; i++)
    1194         {
    1195           m_ppcTDecTop[affectedLayerList[i]]->setPrevPicOrderCnt( m_apcSlicePilot->getFullPocResetFlag()
    1196                                                                   ? 0 : m_apcSlicePilot->getPocLsbVal() );
    1197         }
    1198       }
    1199 #else
    1200       this->setPrevPicOrderCnt( m_apcSlicePilot->getFullPocResetFlag()
    1201                                             ? 0 : m_apcSlicePilot->getPocLsbVal() );
    1202 #endif
     1148    }
     1149    else if( m_apcSlicePilot->getPocResetIdc() == 3 )
     1150    {
     1151      if( !m_firstPicInLayerDecodedFlag || (m_firstPicInLayerDecodedFlag && m_pocResettingFlag) )
     1152      {
     1153        for( UInt i = 0; i < numAffectedLayers; i++ )
     1154        {
     1155          m_ppcTDecTop[affectedLayerList[i]]->setPrevPicOrderCnt( m_apcSlicePilot->getFullPocResetFlag() ? 0 : m_apcSlicePilot->getPocLsbVal() );
     1156        }
     1157      }
    12031158    }
    12041159#else
     
    19471902  m_cGopDecoder.decompressSlice(nalu.m_Bitstream, m_pcPic);
    19481903
    1949 #if P0297_VPS_POC_LSB_ALIGNED_FLAG
     1904#if SVC_EXTENSION
    19501905  setFirstPicInLayerDecodedFlag(true);
    1951 #endif
    1952 #if SVC_EXTENSION
    19531906  m_lastPicHasEos = false;
    19541907#endif
Note: See TracChangeset for help on using the changeset viewer.