Ticket #750: TargetDecLayer_NALInit_fix.patch

File TargetDecLayer_NALInit_fix.patch, 3.9 KB (added by obici, 9 years ago)

Patch for the fix

  • source/App/TAppDecoder/TAppDecTop.cpp

     
    373373  }
    374374  for (std::vector<Int>::iterator it = m_targetDecLayerIdSet.begin(); it != m_targetDecLayerIdSet.end(); it++)
    375375  {
    376     if ( nalu->m_reserved_one_6bits == (*it) )
     376    if ( nalu->m_reserved_zero_6bits == (*it) )
    377377    {
    378378      return true;
    379379    }
  • source/Lib/TLibCommon/NAL.h

     
    5050#endif
    5151  unsigned    m_temporalId;  ///< temporal_id
    5252#if TARGET_DECLAYERID_SET
    53   unsigned    m_reserved_one_6bits; ///< reserved_one_6bits
     53  unsigned    m_reserved_zero_6bits; ///< reserved_zero_6bits
    5454#endif
    5555
    5656  /** construct an NALunit structure with given header values. */
     
    6060    Bool        nalRefFlag,
    6161#endif
    6262#if TARGET_DECLAYERID_SET
    63     Int         reserved_one_6bits = 0,
     63    Int         temporalId = 0,
     64    Int         reserved_zero_6bits = 0)
     65#else
     66    Int         temporalId = 0)
    6467#endif
    65     Int         temporalId = 0)
    6668    :m_nalUnitType (nalUnitType)
    6769#if !REMOVE_NAL_REF_FLAG
    6870    ,m_nalRefFlag  (nalRefFlag)
    6971#endif
    7072    ,m_temporalId  (temporalId)
    7173#if TARGET_DECLAYERID_SET
    72     ,m_reserved_one_6bits(reserved_one_6bits)
     74    ,m_reserved_zero_6bits(reserved_zero_6bits)
    7375#endif
    7476  {}
    7577
  • source/Lib/TLibDecoder/NALread.cpp

     
    7171  assert(forbidden_zero_bit == 0);
    7272  nalu.m_nalUnitType = (NalUnitType) bs.read(6);  // nal_unit_type
    7373#if TARGET_DECLAYERID_SET
    74   nalu.m_reserved_one_6bits = bs.read(6);       // nuh_reserved_zero_6bits
    75   assert(nalu.m_reserved_one_6bits == 0);
     74  nalu.m_reserved_zero_6bits = bs.read(6);       // nuh_reserved_zero_6bits
     75  assert(nalu.m_reserved_zero_6bits == 0);
    7676#else
    7777  unsigned reserved_one_6bits = bs.read(6);       // nuh_reserved_zero_6bits
    7878  assert(reserved_one_6bits == 0);
  • source/Lib/TLibEncoder/NALwrite.cpp

     
    5353
    5454  bsNALUHeader.write(0,1);                    // forbidden_zero_bit
    5555  bsNALUHeader.write(nalu.m_nalUnitType, 6);  // nal_unit_type
     56#if TARGET_DECLAYERID_SET
     57  bsNALUHeader.write(nalu.m_reserved_zero_6bits, 6);                   // nuh_reserved_zero_6bits
     58#else
    5659  bsNALUHeader.write(0, 6);                   // nuh_reserved_zero_6bits
     60#endif
    5761  bsNALUHeader.write(nalu.m_temporalId+1, 3); // nuh_temporal_id_plus1
    5862
    5963  out.write(bsNALUHeader.getByteStream(), bsNALUHeader.getByteStreamLength());
     
    170174#if !REMOVE_NAL_REF_FLAG
    171175  naluDest.m_nalRefFlag  = naluSrc.m_nalRefFlag;
    172176#endif
     177#if TARGET_DECLAYERID_SET
     178  naluDest.m_reserved_zero_6bits  = naluSrc.m_reserved_zero_6bits;
     179#endif
    173180  naluDest.m_temporalId  = naluSrc.m_temporalId;
    174181  naluDest.m_Bitstream   = naluSrc.m_Bitstream;
    175182}
  • source/Lib/TLibEncoder/NALwrite.h

     
    5858#if !REMOVE_NAL_REF_FLAG
    5959    Bool nalRefFlag,
    6060#endif
     61#if TARGET_DECLAYERID_SET
     62    unsigned temporalID = 0,
     63    unsigned reserved_zero_6bits = 0)
     64#else
    6165    unsigned temporalID = 0)
     66#endif
    6267#if REMOVE_NAL_REF_FLAG
     68#if TARGET_DECLAYERID_SET
     69  : NALUnit(nalUnitType, temporalID, reserved_zero_6bits)
     70#else
    6371  : NALUnit(nalUnitType, temporalID)
     72#endif
    6473#else
    6574  : NALUnit(nalUnitType, nalRefFlag, temporalID)
    6675#endif