Changeset 189 in SHVCSoftware for trunk/source/Lib/TLibDecoder/NALread.cpp


Ignore:
Timestamp:
13 May 2013, 16:58:44 (12 years ago)
Author:
seregin
Message:

merge with SHM-2.0-dev branch

Location:
trunk/source
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/source

  • trunk/source/Lib/TLibDecoder/NALread.cpp

    r125 r189  
    5050//! \ingroup TLibDecoder
    5151//! \{
    52 static void convertPayloadToRBSP(vector<uint8_t>& nalUnitBuf, Bool isVclNalUnit)
     52static void convertPayloadToRBSP(vector<uint8_t>& nalUnitBuf, TComInputBitstream *bitstream, Bool isVclNalUnit)
    5353{
    5454  UInt zeroCount = 0;
    5555  vector<uint8_t>::iterator it_read, it_write;
    5656
    57   for (it_read = it_write = nalUnitBuf.begin(); it_read != nalUnitBuf.end(); it_read++, it_write++)
     57  UInt pos = 0;
     58  bitstream->clearEmulationPreventionByteLocation();
     59  for (it_read = it_write = nalUnitBuf.begin(); it_read != nalUnitBuf.end(); it_read++, it_write++, pos++)
    5860  {
    5961    assert(zeroCount < 2 || *it_read >= 0x03);
    6062    if (zeroCount == 2 && *it_read == 0x03)
    6163    {
     64      bitstream->pushEmulationPreventionByteLocation( pos );
     65      pos++;
    6266      it_read++;
    6367      zeroCount = 0;
     
    109113  if ( nalu.m_temporalId )
    110114  {
    111     assert( nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_BLA
    112          && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_BLANT
     115    assert( nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_BLA_W_LP
     116         && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_BLA_W_RADL
    113117         && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_BLA_N_LP
    114          && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_IDR
     118         && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_IDR_W_RADL
    115119         && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_IDR_N_LP
    116120         && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_CRA
     
    122126  else
    123127  {
    124     assert( nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_TLA
     128    assert( nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_TLA_R
    125129         && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_TSA_N
    126130         && nalu.m_nalUnitType != NAL_UNIT_CODED_SLICE_STSA_R
     
    136140  /* perform anti-emulation prevention */
    137141  TComInputBitstream *pcBitstream = new TComInputBitstream(NULL);
    138   convertPayloadToRBSP(nalUnitBuf, (nalUnitBuf[0] & 64) == 0);
     142  convertPayloadToRBSP(nalUnitBuf, pcBitstream, (nalUnitBuf[0] & 64) == 0);
    139143 
    140144  nalu.m_Bitstream = new TComInputBitstream(&nalUnitBuf);
     145  nalu.m_Bitstream->setEmulationPreventionByteLocation(pcBitstream->getEmulationPreventionByteLocation());
    141146  delete pcBitstream;
    142147  readNalUnitHeader(nalu);
Note: See TracChangeset for help on using the changeset viewer.