Changeset 1237 in SHVCSoftware for branches/SHM-dev/source/Lib/TLibDecoder


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

port rev 4221

Location:
branches/SHM-dev/source/Lib/TLibDecoder
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • 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" );
Note: See TracChangeset for help on using the changeset viewer.