Changeset 1211 in SHVCSoftware for branches/SHM-dev/source/Lib


Ignore:
Timestamp:
8 Jul 2015, 23:11:18 (10 years ago)
Author:
seregin
Message:

macro cleanup: Q0108_TSA_STSA

Location:
branches/SHM-dev/source/Lib
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-dev/source/Lib/TLibCommon/TypeDef.h

    r1210 r1211  
    4848#define BSP_INIT_ARRIVAL_SEI             1      ///< JCTVC-R0231: Make signalling of vcl_initial_arrival_delay independent of NalHrdBpPresentFlag
    4949
    50 #define Q0108_TSA_STSA                   1      ///< JCTVC-Q0108, Remove cross-layer alignment constraints of TSA and STSA pictures, enable to have different prediction structures in different layers
    5150#define Q0177_EOS_CHECKS                 1      ///< JCTVC-Q0177; Put checks on handling EOS
    5251#define P0130_EOB                        1      ///< JCTVC-P0130, set layer Id of EOB NALU to be fixed to 0
  • branches/SHM-dev/source/Lib/TLibDecoder/NALread.cpp

    r1029 r1211  
    123123  if ( nalu.m_temporalId )
    124124  {
    125 #if !Q0108_TSA_STSA
     125#if SVC_EXTENSION
     126    assert( nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_BLA_W_LP
     127         && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_BLA_W_RADL
     128         && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_BLA_N_LP
     129         && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_IDR_W_RADL
     130         && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_IDR_N_LP
     131         && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_CRA
     132         && nalu.m_nalUnitType != NAL_UNIT_VPS
     133         && nalu.m_nalUnitType != NAL_UNIT_SPS
     134         && nalu.m_nalUnitType != NAL_UNIT_EOS);
     135#else
    126136    assert( nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_BLA_W_LP
    127137         && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_BLA_W_RADL
     
    133143         && nalu.m_nalUnitType != NAL_UNIT_SPS
    134144         && nalu.m_nalUnitType != NAL_UNIT_EOS
    135          && nalu.m_nalUnitType != NAL_UNIT_EOB );
    136 #else
    137     assert( nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_BLA_W_LP
    138          && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_BLA_W_RADL
    139          && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_BLA_N_LP
    140          && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_IDR_W_RADL
    141          && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_IDR_N_LP
    142          && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_CRA
    143          && nalu.m_nalUnitType != NAL_UNIT_VPS
    144          && nalu.m_nalUnitType != NAL_UNIT_SPS
    145          && nalu.m_nalUnitType != NAL_UNIT_EOS);
     145         && nalu.m_nalUnitType != NAL_UNIT_EOB );
    146146#endif
    147147  }
    148148  else
    149149  {
    150 #if !Q0108_TSA_STSA
     150#if SVC_EXTENSION
     151    assert( nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_TSA_R
     152         && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_TSA_N
     153         );
     154#else
    151155    assert( nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_TSA_R
    152156         && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_TSA_N
    153157         && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_STSA_R
    154158         && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_STSA_N );
    155 #else
    156     assert( nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_TSA_R
    157          && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_TSA_N
    158          );
    159159#endif
    160160  }
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp

    r1210 r1211  
    11881188  m_bFirstSliceInBitstream  = false;
    11891189
    1190   // Alignment of TSA and STSA pictures across AU
    1191 #if !Q0108_TSA_STSA
    1192   if( m_apcSlicePilot->getLayerId() > 0 )
    1193   {
    1194     // Check for TSA alignment
    1195     if( m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_TSA_N ||
    1196         m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_TSA_R
    1197          )
    1198     {
    1199       for(Int dependentLayerIdx = 0; dependentLayerIdx < m_apcSlicePilot->getVPS()->getNumDirectRefLayers(m_layerId); dependentLayerIdx++)
    1200       {
    1201         TComList<TComPic*> *cListPic = getRefLayerDec( dependentLayerIdx )->getListPic();
    1202         TComPic* refpicLayer = m_apcSlicePilot->getRefPic(*cListPic, m_apcSlicePilot->getPOC() );
    1203         if( refpicLayer )
    1204         {
    1205           assert( m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_TSA_N ||
    1206                     m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_TSA_R );    // TSA pictures should be aligned among depenedent layers
    1207         }
    1208       }
    1209     }
    1210     // Check for STSA alignment
    1211     if( m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_STSA_N ||
    1212          m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_STSA_R
    1213          )
    1214     {
    1215       for(Int dependentLayerIdx = 0; dependentLayerIdx < m_apcSlicePilot->getVPS()->getNumDirectRefLayers(m_layerId); dependentLayerIdx++)
    1216       {
    1217         TComList<TComPic*> *cListPic = getRefLayerDec( dependentLayerIdx )->getListPic();
    1218         TComPic* refpicLayer = m_apcSlicePilot->getRefPic(*cListPic, m_apcSlicePilot->getPOC() ); // STSA pictures should be aligned among dependent layers
    1219         if( refpicLayer )
    1220 
    1221         {
    1222           assert( m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_STSA_N ||
    1223                     m_apcSlicePilot->getNalUnitType() == NAL_UNIT_CODED_SLICE_STSA_R );
    1224         }
    1225       }
    1226     }
    1227   }
    1228 #endif
    1229 
    12301190#else //SVC_EXTENSION
    12311191  //we should only get a different poc for a new picture (with CTU address==0)
     
    12601220  m_bFirstSliceInBitstream  = false;
    12611221#endif //SVC_EXTENSION
     1222
    12621223  //detect lost reference picture and insert copy of earlier frame.
    12631224  Int lostPoc;
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp

    r1209 r1211  
    15921592      if(pcSlice->isTemporalLayerSwitchingPoint(rcListPic) || pcSlice->getSPS()->getTemporalIdNestingFlag())
    15931593      {
    1594 #if SVC_EXTENSION && !Q0108_TSA_STSA
    1595         if( pcSlice->getLayerId() > 0 )
    1596         {
    1597           Bool oneRefLayerTSA = false, oneRefLayerNotTSA = false;
    1598           for( Int i = 0; i < pcSlice->getLayerId(); i++)
    1599           {
    1600             TComList<TComPic *> *cListPic = m_ppcTEncTop[i]->getListPic();
    1601             TComPic *lowerLayerPic = pcSlice->getRefPic(*cListPic, pcSlice->getPOC());
    1602             if( lowerLayerPic && pcSlice->getVPS()->getDirectDependencyFlag(pcSlice->getLayerId(), i) )
    1603             {
    1604               if( ( lowerLayerPic->getSlice(0)->getNalUnitType() == NAL_UNIT_CODED_SLICE_TSA_N ) ||
    1605                   ( lowerLayerPic->getSlice(0)->getNalUnitType() == NAL_UNIT_CODED_SLICE_TSA_R )
    1606                 )
    1607               {
    1608                 if(pcSlice->getTemporalLayerNonReferenceFlag() )
    1609                 {
    1610                   pcSlice->setNalUnitType(NAL_UNIT_CODED_SLICE_TSA_N);
    1611                 }
    1612                 else
    1613                 {
    1614                   pcSlice->setNalUnitType(NAL_UNIT_CODED_SLICE_TSA_R );
    1615                 }
    1616                 oneRefLayerTSA = true;
    1617               }
    1618               else
    1619               {
    1620                 oneRefLayerNotTSA = true;
    1621               }
    1622             }
    1623           }
    1624           assert( !( oneRefLayerNotTSA && oneRefLayerTSA ) ); // Only one variable should be true - failure of this assert means
    1625                                                                 // that two independent reference layers that are not dependent on
    1626                                                                 // each other, but are reference for current layer have inconsistency
    1627           if( oneRefLayerNotTSA /*&& !oneRefLayerTSA*/ )          // No reference layer is TSA - set current as TRAIL
    1628           {
    1629             if(pcSlice->getTemporalLayerNonReferenceFlag() )
    1630             {
    1631               pcSlice->setNalUnitType( NAL_UNIT_CODED_SLICE_TRAIL_N );
    1632             }
    1633             else
    1634             {
    1635               pcSlice->setNalUnitType( NAL_UNIT_CODED_SLICE_TRAIL_R );
    1636             }
    1637           }
    1638           else  // This means there is no reference layer picture for current picture in this AU
    1639           {
    1640             if(pcSlice->getTemporalLayerNonReferenceFlag() )
    1641             {
    1642               pcSlice->setNalUnitType(NAL_UNIT_CODED_SLICE_TSA_N);
    1643             }
    1644             else
    1645             {
    1646               pcSlice->setNalUnitType(NAL_UNIT_CODED_SLICE_TSA_R );
    1647             }
    1648           }
    1649         }
    1650 #else
    16511594        if(pcSlice->getTemporalLayerNonReferenceFlag())
    16521595        {
     
    16571600          pcSlice->setNalUnitType(NAL_UNIT_CODED_SLICE_TSA_R);
    16581601        }
    1659 #endif
    16601602      }
    16611603      else if(pcSlice->isStepwiseTemporalLayerSwitchingPointCandidate(rcListPic))
     
    16911633        if(isSTSA==true)
    16921634        {
    1693 #if SVC_EXTENSION && !Q0108_TSA_STSA
    1694           if( pcSlice->getLayerId() > 0 )
    1695           {
    1696             Bool oneRefLayerSTSA = false, oneRefLayerNotSTSA = false;
    1697             for( Int i = 0; i < pcSlice->getLayerId(); i++)
    1698             {
    1699               TComList<TComPic *> *cListPic = m_ppcTEncTop[i]->getListPic();
    1700               TComPic *lowerLayerPic = pcSlice->getRefPic(*cListPic, pcSlice->getPOC());
    1701               if( lowerLayerPic && pcSlice->getVPS()->getDirectDependencyFlag(pcSlice->getLayerId(), i) )
    1702               {
    1703                 if( ( lowerLayerPic->getSlice(0)->getNalUnitType() == NAL_UNIT_CODED_SLICE_STSA_N ) ||
    1704                     ( lowerLayerPic->getSlice(0)->getNalUnitType() == NAL_UNIT_CODED_SLICE_STSA_R )
    1705                   )
    1706                 {
    1707                   if(pcSlice->getTemporalLayerNonReferenceFlag() )
    1708                   {
    1709                     pcSlice->setNalUnitType(NAL_UNIT_CODED_SLICE_STSA_N);
    1710                   }
    1711                   else
    1712                   {
    1713                     pcSlice->setNalUnitType(NAL_UNIT_CODED_SLICE_STSA_R );
    1714                   }
    1715                   oneRefLayerSTSA = true;
    1716                 }
    1717                 else
    1718                 {
    1719                   oneRefLayerNotSTSA = true;
    1720                 }
    1721               }
    1722             }
    1723             assert( !( oneRefLayerNotSTSA && oneRefLayerSTSA ) ); // Only one variable should be true - failure of this assert means
    1724                                                                   // that two independent reference layers that are not dependent on
    1725                                                                   // each other, but are reference for current layer have inconsistency
    1726             if( oneRefLayerNotSTSA /*&& !oneRefLayerSTSA*/ )          // No reference layer is STSA - set current as TRAIL
    1727             {
    1728               if(pcSlice->getTemporalLayerNonReferenceFlag() )
    1729               {
    1730                 pcSlice->setNalUnitType( NAL_UNIT_CODED_SLICE_TRAIL_N );
    1731               }
    1732               else
    1733               {
    1734                 pcSlice->setNalUnitType( NAL_UNIT_CODED_SLICE_TRAIL_R );
    1735               }
    1736             }
    1737             else  // This means there is no reference layer picture for current picture in this AU
    1738             {
    1739               if(pcSlice->getTemporalLayerNonReferenceFlag() )
    1740               {
    1741                 pcSlice->setNalUnitType(NAL_UNIT_CODED_SLICE_STSA_N);
    1742               }
    1743               else
    1744               {
    1745                 pcSlice->setNalUnitType(NAL_UNIT_CODED_SLICE_STSA_R );
    1746               }
    1747             }
    1748           }
    1749 #else
    17501635          if(pcSlice->getTemporalLayerNonReferenceFlag())
    17511636          {
     
    17561641            pcSlice->setNalUnitType(NAL_UNIT_CODED_SLICE_STSA_R);
    17571642          }
    1758 #endif
    17591643        }
    17601644      }
     
    18091693      }
    18101694    }
    1811 #endif //SVC_EXTENSION
    1812 
    1813 #if Q0108_TSA_STSA
     1695
    18141696   if( ( pcSlice->getTLayer() == 0 && pcSlice->getLayerId() > 0  )    // only for enhancement layer and with temporal layer 0
    18151697     && !( pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_RADL_N     
     
    18801762        }
    18811763    }
    1882 #endif
     1764#endif //SVC_EXTENSION
    18831765
    18841766#if ADAPTIVE_QP_SELECTION
Note: See TracChangeset for help on using the changeset viewer.