Ticket #1063: idr_radl.patch

File idr_radl.patch, 2.7 KB (added by ksuehring, 11 years ago)
  • source/Lib/TLibEncoder/TEncGOP.cpp

     
    440440      continue;
    441441    }
    442442
    443     if( getNalUnitType(pocCurr) == NAL_UNIT_CODED_SLICE_IDR_W_RADL || getNalUnitType(pocCurr) == NAL_UNIT_CODED_SLICE_IDR_N_LP )
     443    if( getNalUnitType(pocCurr, m_iLastIDR) == NAL_UNIT_CODED_SLICE_IDR_W_RADL || getNalUnitType(pocCurr, m_iLastIDR) == NAL_UNIT_CODED_SLICE_IDR_N_LP )
    444444    {
    445445      m_iLastIDR = pocCurr;
    446446    }       
     
    500500      pcSlice->setSliceType(P_SLICE);
    501501    }
    502502    // Set the nal unit type
    503     pcSlice->setNalUnitType(getNalUnitType(pocCurr));
     503    pcSlice->setNalUnitType(getNalUnitType(pocCurr, m_iLastIDR));
    504504    if(pcSlice->getNalUnitType()==NAL_UNIT_CODED_SLICE_TRAIL_R)
    505505    {
    506506      if(pcSlice->getTemporalLayerNonReferenceFlag())
     
    10821082        if ((SOPcurrPOC + deltaPOC) < m_pcCfg->getFramesToBeEncoded())
    10831083        {
    10841084          SOPcurrPOC += deltaPOC;
    1085           SOPDescriptionSEI.m_sopDescVclNaluType[i] = getNalUnitType(SOPcurrPOC);
     1085          SOPDescriptionSEI.m_sopDescVclNaluType[i] = getNalUnitType(SOPcurrPOC, m_iLastIDR);
    10861086          SOPDescriptionSEI.m_sopDescTemporalId[i] = m_pcCfg->getGOPEntry(j).m_temporalId;
    10871087          SOPDescriptionSEI.m_sopDescStRpsIdx[i] = m_pcEncTop->getReferencePictureSetIdxForSOP(pcSlice, SOPcurrPOC, j);
    10881088          SOPDescriptionSEI.m_sopDescPocDelta[i] = deltaPOC;
     
    22962296 * \returns the nal unit type of the picture
    22972297 * This function checks the configuration and returns the appropriate nal_unit_type for the picture.
    22982298 */
    2299 NalUnitType TEncGOP::getNalUnitType(Int pocCurr)
     2299NalUnitType TEncGOP::getNalUnitType(Int pocCurr, Int lastIDR)
    23002300{
    23012301  if (pocCurr == 0)
    23022302  {
     
    23252325      return NAL_UNIT_CODED_SLICE_RASL_R;
    23262326    }
    23272327  }
     2328  if (lastIDR>0)
     2329  {
     2330    if (pocCurr < lastIDR)
     2331    {
     2332      return NAL_UNIT_CODED_SLICE_RADL_R;
     2333    }
     2334  }
    23282335  return NAL_UNIT_CODED_SLICE_TRAIL_R;
    23292336}
    23302337
  • source/Lib/TLibEncoder/TEncGOP.h

     
    144144  Void  preLoopFilterPicAll  ( TComPic* pcPic, UInt64& ruiDist, UInt64& ruiBits );
    145145 
    146146  TEncSlice*  getSliceEncoder()   { return m_pcSliceEncoder; }
    147   NalUnitType getNalUnitType( Int pocCurr );
     147  NalUnitType getNalUnitType( Int pocCurr, Int lastIdr );
    148148  Void arrangeLongtermPicturesInRPS(TComSlice *, TComList<TComPic*>& );
    149149protected:
    150150  TEncRateCtrl* getRateCtrl()       { return m_pcRateCtrl;  }