Changeset 1237 in SHVCSoftware


Ignore:
Timestamp:
13 Jul 2015, 20:56:47 (9 years ago)
Author:
seregin
Message:

port rev 4221

Location:
branches/SHM-dev/source
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-dev/source/App/TAppDecoder/TAppDecTop.cpp

    r1235 r1237  
    235235      if( (m_iMaxTemporalLayer >= 0 && nalu.m_temporalId > m_iMaxTemporalLayer) || !isNaluWithinTargetDecLayerIdSet(&nalu)  ||
    236236#if CONFORMANCE_BITSTREAM_MODE
    237         (nalu.m_layerId > m_commonDecoderParams.getTargetLayerId()) )
    238 #else
    239         (nalu.m_layerId > m_tgtLayerId) )
     237        (nalu.m_nuhLayerId > m_commonDecoderParams.getTargetLayerId()) )
     238#else
     239        (nalu.m_nuhLayerId > m_tgtLayerId) )
    240240#endif
    241241      {
     
    244244      else
    245245      {
    246         bNewPicture = m_acTDecTop[nalu.m_layerId].decode(nalu, m_iSkipFrame, m_aiPOCLastDisplay[nalu.m_layerId], curLayerId, bNewPOC);
     246        bNewPicture = m_acTDecTop[nalu.m_nuhLayerId].decode(nalu, m_iSkipFrame, m_aiPOCLastDisplay[nalu.m_nuhLayerId], curLayerId, bNewPOC);
    247247
    248248#if SVC_POC
    249         if( (bNewPicture && m_acTDecTop[nalu.m_layerId].getParseIdc() == 3) || (m_acTDecTop[nalu.m_layerId].getParseIdc() == 0) )
     249        if( (bNewPicture && m_acTDecTop[nalu.m_nuhLayerId].getParseIdc() == 3) || (m_acTDecTop[nalu.m_nuhLayerId].getParseIdc() == 0) )
    250250#else
    251251        if (bNewPicture)
     
    267267        }
    268268#if SVC_POC
    269         else if(m_acTDecTop[nalu.m_layerId].getParseIdc() == 1)
     269        else if(m_acTDecTop[nalu.m_nuhLayerId].getParseIdc() == 1)
    270270        {
    271271          bitstreamFile.clear();
     
    283283
    284284#if SVC_POC
    285     if( ( (bNewPicture && m_acTDecTop[nalu.m_layerId].getParseIdc() == 3) || m_acTDecTop[nalu.m_layerId].getParseIdc() == 0 || !bitstreamFile || nalu.m_nalUnitType == NAL_UNIT_EOS ) &&
    286         !m_acTDecTop[nalu.m_layerId].getFirstSliceInSequence() )
     285    if( ( (bNewPicture && m_acTDecTop[nalu.m_nuhLayerId].getParseIdc() == 3) || m_acTDecTop[nalu.m_nuhLayerId].getParseIdc() == 0 || !bitstreamFile || nalu.m_nalUnitType == NAL_UNIT_EOS ) &&
     286        !m_acTDecTop[nalu.m_nuhLayerId].getFirstSliceInSequence() )
    287287#else
    288288    if ( (bNewPicture || !bitstreamFile || nalu.m_nalUnitType == NAL_UNIT_EOS) &&
    289         !m_acTDecTop[nalu.m_layerId].getFirstSliceInSequence() )
     289        !m_acTDecTop[nalu.m_nuhLayerId].getFirstSliceInSequence() )
    290290#endif
    291291    {
     
    302302      if (nalu.m_nalUnitType == NAL_UNIT_EOS)
    303303      {
    304         m_acTDecTop[nalu.m_layerId].setFirstSliceInSequence(true);
     304        m_acTDecTop[nalu.m_nuhLayerId].setFirstSliceInSequence(true);
    305305      }
    306306    }
    307307    else if ( (bNewPicture || !bitstreamFile || nalu.m_nalUnitType == NAL_UNIT_EOS ) &&
    308               m_acTDecTop[nalu.m_layerId].getFirstSliceInSequence () )
    309     {
    310       m_acTDecTop[nalu.m_layerId].setFirstSliceInPicture (true);
     308              m_acTDecTop[nalu.m_nuhLayerId].getFirstSliceInSequence () )
     309    {
     310      m_acTDecTop[nalu.m_nuhLayerId].setFirstSliceInPicture (true);
    311311    }
    312312
    313313#if SVC_POC
    314     if( bNewPicture && m_acTDecTop[nalu.m_layerId].getParseIdc() == 0 )
    315     {
    316       outputAllPictures( nalu.m_layerId, true );
     314    if( bNewPicture && m_acTDecTop[nalu.m_nuhLayerId].getParseIdc() == 0 )
     315    {
     316      outputAllPictures( nalu.m_nuhLayerId, true );
    317317    }
    318318#endif
     
    333333      Bool outputPicturesFlag = true; 
    334334
    335       if( m_acTDecTop[nalu.m_layerId].getNoOutputPriorPicsFlag() )
     335      if( m_acTDecTop[nalu.m_nuhLayerId].getNoOutputPriorPicsFlag() )
    336336      {
    337337        outputPicturesFlag = false;
     
    340340      if (nalu.m_nalUnitType == NAL_UNIT_EOS) // End of sequence
    341341      {
    342         flushAllPictures( nalu.m_layerId, outputPicturesFlag );       
     342        flushAllPictures( nalu.m_nuhLayerId, outputPicturesFlag );       
    343343      }
    344344
    345345#if SVC_POC
    346       if( bNewPicture && m_acTDecTop[nalu.m_layerId].getParseIdc() != 0 )
     346      if( bNewPicture && m_acTDecTop[nalu.m_nuhLayerId].getParseIdc() != 0 )
    347347      // New picture, slice header parsed but picture not decoded
    348348#else
     
    356356            || nalu.m_nalUnitType == NAL_UNIT_CODED_SLICE_BLA_W_LP   )
    357357        {
    358           flushAllPictures( nalu.m_layerId, outputPicturesFlag );
     358          flushAllPictures( nalu.m_nuhLayerId, outputPicturesFlag );
    359359        }
    360360        else
    361361        {
    362           this->checkOutputBeforeDecoding( nalu.m_layerId );
     362          this->checkOutputBeforeDecoding( nalu.m_nuhLayerId );
    363363        }
    364364      }
     
    12421242  }
    12431243#if SVC_EXTENSION
    1244   if (nalu->m_layerId == 0 && (nalu->m_nalUnitType == NAL_UNIT_VPS || nalu->m_nalUnitType == NAL_UNIT_SPS || nalu->m_nalUnitType == NAL_UNIT_PPS || nalu->m_nalUnitType == NAL_UNIT_EOS))
     1244  if (nalu->m_nuhLayerId == 0 && (nalu->m_nalUnitType == NAL_UNIT_VPS || nalu->m_nalUnitType == NAL_UNIT_SPS || nalu->m_nalUnitType == NAL_UNIT_PPS || nalu->m_nalUnitType == NAL_UNIT_EOS))
    12451245  {
    12461246    return true;
     
    12491249  for (std::vector<Int>::iterator it = m_targetDecLayerIdSet.begin(); it != m_targetDecLayerIdSet.end(); it++)
    12501250  {
    1251     if ( nalu->m_reservedZero6Bits == (*it) )
     1251    if ( nalu->m_nuhLayerId == (*it) )
    12521252    {
    12531253      return true;
  • branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp

    r1235 r1237  
    19041904      {
    19051905        OutputNALUnit nalu(NAL_UNIT_EOB);
    1906         nalu.m_layerId = 0;
     1906        nalu.m_nuhLayerId = 0;
    19071907
    19081908        AccessUnit& accessUnit = outputAccessUnits.back();
  • branches/SHM-dev/source/Lib/TLibCommon/NAL.h

    r1029 r1237  
    5050  NalUnitType m_nalUnitType; ///< nal_unit_type
    5151  UInt        m_temporalId;  ///< temporal_id
    52 #if SVC_EXTENSION
    53   UInt        m_layerId;   ///< layer id
    54 #endif
    55   UInt        m_reservedZero6Bits; ///< reserved_zero_6bits
     52  UInt        m_nuhLayerId;  ///< nuh_layer_id
    5653
    5754  /** construct an NALunit structure with given header values. */
    58   NALUnit(
     55NALUnit(
    5956    NalUnitType nalUnitType,
    6057    Int         temporalId = 0,
    61 #if SVC_EXTENSION
    62     UInt        layerId = 0,
    63 #endif
    64     Int         reservedZero6Bits = 0)
     58    Int         nuhLayerId = 0)
    6559    :m_nalUnitType (nalUnitType)
    6660    ,m_temporalId  (temporalId)
    67 #if SVC_EXTENSION
    68     ,m_layerId   (layerId)
    69 #endif
    70     ,m_reservedZero6Bits(reservedZero6Bits)
     61    ,m_nuhLayerId  (nuhLayerId)
    7162  {}
    7263
  • branches/SHM-dev/source/Lib/TLibDecoder/NALread.cpp

    r1211 r1237  
    110110  assert(forbidden_zero_bit == 0);
    111111  nalu.m_nalUnitType = (NalUnitType) bs.read(6);  // nal_unit_type
    112   nalu.m_reservedZero6Bits = bs.read(6);       // nuh_reserved_zero_6bits
    113 #if SVC_EXTENSION
    114   nalu.m_layerId = nalu.m_reservedZero6Bits;
    115 #else
    116   assert(nalu.m_reservedZero6Bits == 0);
    117 #endif
     112  nalu.m_nuhLayerId = bs.read(6);                 // nuh_layer_id
    118113  nalu.m_temporalId = bs.read(3) - 1;             // nuh_temporal_id_plus1
    119114#if RExt__DECODER_DEBUG_BIT_STATISTICS
     
    121116#endif
    122117
    123   if ( nalu.m_temporalId )
     118  // only check these rules for base layer
     119  if (nalu.m_nuhLayerId == 0)
    124120  {
     121    if ( nalu.m_temporalId )
     122    {
     123      assert( nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_BLA_W_LP
     124           && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_BLA_W_RADL
     125           && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_BLA_N_LP
     126           && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_IDR_W_RADL
     127           && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_IDR_N_LP
     128           && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_CRA
     129           && nalu.m_nalUnitType != NAL_UNIT_VPS
     130           && nalu.m_nalUnitType != NAL_UNIT_SPS
     131           && nalu.m_nalUnitType != NAL_UNIT_EOS
     132           && nalu.m_nalUnitType != NAL_UNIT_EOB );
     133    }
     134    else
     135    {
     136      assert( nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_TSA_R
     137           && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_TSA_N
     138           && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_STSA_R
     139           && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_STSA_N );
     140    }
     141  }
    125142#if SVC_EXTENSION
     143  else if ( nalu.m_temporalId )
     144  {
    126145    assert( nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_BLA_W_LP
    127146         && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_BLA_W_RADL
     
    133152         && nalu.m_nalUnitType != NAL_UNIT_SPS
    134153         && nalu.m_nalUnitType != NAL_UNIT_EOS);
    135 #else
    136     assert( nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_BLA_W_LP
    137          && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_BLA_W_RADL
    138          && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_BLA_N_LP
    139          && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_IDR_W_RADL
    140          && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_IDR_N_LP
    141          && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_CRA
    142          && nalu.m_nalUnitType != NAL_UNIT_VPS
    143          && nalu.m_nalUnitType != NAL_UNIT_SPS
    144          && nalu.m_nalUnitType != NAL_UNIT_EOS
    145          && nalu.m_nalUnitType != NAL_UNIT_EOB );
    146 #endif
    147154  }
    148155  else
    149156  {
    150 #if SVC_EXTENSION
    151157    assert( nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_TSA_R
    152158         && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_TSA_N
    153159         );
    154 #else
    155     assert( nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_TSA_R
    156          && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_TSA_N
    157          && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_STSA_R
    158          && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_STSA_N );
     160  }
    159161#endif
    160   }
    161162}
    162163/**
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r1235 r1237  
    10061006#else
    10071007  READ_CODE( 2,  uiCode,  "vps_reserved_three_2bits" );           assert(uiCode == 3);
    1008   READ_CODE( 6,  uiCode,  "vps_reserved_zero_6bits" );            assert(uiCode == 0);
     1008  READ_CODE( 6,  uiCode,  "vps_max_layers_minus1" );
    10091009#endif
    10101010  READ_CODE( 3,  uiCode,  "vps_max_sub_layers_minus1" );          pcVPS->setMaxTLayers( uiCode + 1 );    assert(uiCode+1 <= MAX_TLAYER);
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecTop.cpp

    r1235 r1237  
    723723{
    724724#if SVC_EXTENSION
    725   m_apcSlicePilot->initSlice( nalu.m_layerId );
     725  m_apcSlicePilot->initSlice( nalu.m_nuhLayerId );
    726726  m_apcSlicePilot->setTLayer( nalu.m_temporalId );
    727727#else //SVC_EXTENSION
     
    768768  if( !vps->getBaseLayerAvailableFlag() )
    769769  {
    770     assert( nalu.m_layerId != 0 );
     770    assert( nalu.m_nuhLayerId != 0 );
    771771    assert( vps->getNumAddLayerSets() > 0 );
    772772
     
    15121512
    15131513#if SVC_EXTENSION
    1514   m_pcPic->setLayerId(nalu.m_layerId);
    1515   pcSlice->setLayerId(nalu.m_layerId);
     1514  m_pcPic->setLayerId(nalu.m_nuhLayerId);
     1515  pcSlice->setLayerId(nalu.m_nuhLayerId);
    15161516  pcSlice->setPic(m_pcPic);
    15171517#endif
     
    19281928#endif
    19291929{
     1930#if !SVC_EXTENSION
     1931  // ignore all NAL units of layers > 0
     1932  if (nalu.m_nuhLayerId > 0)
     1933  {
     1934    fprintf (stderr, "Warning: found NAL unit with nuh_layer_id equal to %d. Ignoring.\n", nalu.m_nuhLayerId);
     1935    return false;
     1936  }
     1937#endif
    19301938  // Initialize entropy decoder
    19311939  m_cEntropyDecoder.setEntropyDecoder (&m_cCavlcDecoder);
     
    19341942#if SVC_EXTENSION
    19351943  // ignore any NAL units with nuh_layer_id == 63
    1936   if( nalu.m_layerId == 63 )
     1944  if( nalu.m_nuhLayerId == 63 )
    19371945  { 
    19381946    return false;
     
    19431951    case NAL_UNIT_VPS:
    19441952#if SVC_EXTENSION
    1945       assert( nalu.m_layerId == 0 ); // Non-conforming bitstream. The value of nuh_layer_id of VPS NAL unit shall be equal to 0.
     1953      assert( nalu.m_nuhLayerId == 0 ); // Non-conforming bitstream. The value of nuh_layer_id of VPS NAL unit shall be equal to 0.
    19461954#endif
    19471955      xDecodeVPS(nalu.m_Bitstream->getFifo());
     
    20412049#if SVC_EXTENSION
    20422050      //Check layer id of the nalu. if it is not 0, give a warning message.
    2043       if (nalu.m_layerId > 0)
     2051      if (nalu.m_nuhLayerId > 0)
    20442052      {
    20452053        printf( "\n\nThis bitstream is ended with EOB NALU that has layer id greater than 0\n" );
  • branches/SHM-dev/source/Lib/TLibEncoder/NALwrite.cpp

    r1029 r1237  
    5353  bsNALUHeader.write(0,1);                    // forbidden_zero_bit
    5454  bsNALUHeader.write(nalu.m_nalUnitType, 6);  // nal_unit_type
    55 #if SVC_EXTENSION
    56   bsNALUHeader.write(nalu.m_layerId, 6); // reserved_one_5bits
    57 #else
    58   bsNALUHeader.write(nalu.m_reservedZero6Bits, 6);                   // nuh_reserved_zero_6bits
    59 #endif
     55  bsNALUHeader.write(nalu.m_nuhLayerId, 6);   // nuh_layer_id
    6056  bsNALUHeader.write(nalu.m_temporalId+1, 3); // nuh_temporal_id_plus1
    6157
  • branches/SHM-dev/source/Lib/TLibEncoder/NALwrite.h

    r1029 r1237  
    6161    UInt temporalID = 0,
    6262#if SVC_EXTENSION
    63     UInt     layerId = 0,
     63    UInt     layerId = 0)
     64#else
     65    UInt reserved_zero_6bits = 0)
    6466#endif
    65     UInt reserved_zero_6bits = 0)
    6667#if SVC_EXTENSION
    67   : NALUnit(nalUnitType, temporalID, layerId, reserved_zero_6bits)
     68  : NALUnit(nalUnitType, temporalID, layerId)
    6869#else
    6970  : NALUnit(nalUnitType, temporalID, reserved_zero_6bits)
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncCavlc.cpp

    r1235 r1237  
    785785#else
    786786  WRITE_CODE( 3,                                    2,        "vps_reserved_three_2bits" );
    787   WRITE_CODE( 0,                                    6,        "vps_reserved_zero_6bits" );
     787  WRITE_CODE( 0,                                    6,        "vps_max_layers_minus1" );
    788788#endif
    789789  WRITE_CODE( pcVPS->getMaxTLayers() - 1,           3,        "vps_max_sub_layers_minus1" );
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp

    r1235 r1237  
    21392139      {
    21402140        // For independent base layer rewriting
    2141         nalu.m_layerId = 0;
     2141        nalu.m_nuhLayerId = 0;
    21422142      }
    21432143#else
     
    21632163      {
    21642164        // For independent base layer rewriting
    2165         nalu.m_layerId = 0;
     2165        nalu.m_nuhLayerId = 0;
    21662166      }
    21672167#else
Note: See TracChangeset for help on using the changeset viewer.