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


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

port rev 4221

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

Legend:

Unmodified
Added
Removed
  • 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.