Ticket #1063: idr_radl.patch
File idr_radl.patch, 2.7 KB (added by ksuehring, 11 years ago) |
---|
-
source/Lib/TLibEncoder/TEncGOP.cpp
440 440 continue; 441 441 } 442 442 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 ) 444 444 { 445 445 m_iLastIDR = pocCurr; 446 446 } … … 500 500 pcSlice->setSliceType(P_SLICE); 501 501 } 502 502 // Set the nal unit type 503 pcSlice->setNalUnitType(getNalUnitType(pocCurr ));503 pcSlice->setNalUnitType(getNalUnitType(pocCurr, m_iLastIDR)); 504 504 if(pcSlice->getNalUnitType()==NAL_UNIT_CODED_SLICE_TRAIL_R) 505 505 { 506 506 if(pcSlice->getTemporalLayerNonReferenceFlag()) … … 1082 1082 if ((SOPcurrPOC + deltaPOC) < m_pcCfg->getFramesToBeEncoded()) 1083 1083 { 1084 1084 SOPcurrPOC += deltaPOC; 1085 SOPDescriptionSEI.m_sopDescVclNaluType[i] = getNalUnitType(SOPcurrPOC );1085 SOPDescriptionSEI.m_sopDescVclNaluType[i] = getNalUnitType(SOPcurrPOC, m_iLastIDR); 1086 1086 SOPDescriptionSEI.m_sopDescTemporalId[i] = m_pcCfg->getGOPEntry(j).m_temporalId; 1087 1087 SOPDescriptionSEI.m_sopDescStRpsIdx[i] = m_pcEncTop->getReferencePictureSetIdxForSOP(pcSlice, SOPcurrPOC, j); 1088 1088 SOPDescriptionSEI.m_sopDescPocDelta[i] = deltaPOC; … … 2296 2296 * \returns the nal unit type of the picture 2297 2297 * This function checks the configuration and returns the appropriate nal_unit_type for the picture. 2298 2298 */ 2299 NalUnitType TEncGOP::getNalUnitType(Int pocCurr )2299 NalUnitType TEncGOP::getNalUnitType(Int pocCurr, Int lastIDR) 2300 2300 { 2301 2301 if (pocCurr == 0) 2302 2302 { … … 2325 2325 return NAL_UNIT_CODED_SLICE_RASL_R; 2326 2326 } 2327 2327 } 2328 if (lastIDR>0) 2329 { 2330 if (pocCurr < lastIDR) 2331 { 2332 return NAL_UNIT_CODED_SLICE_RADL_R; 2333 } 2334 } 2328 2335 return NAL_UNIT_CODED_SLICE_TRAIL_R; 2329 2336 } 2330 2337 -
source/Lib/TLibEncoder/TEncGOP.h
144 144 Void preLoopFilterPicAll ( TComPic* pcPic, UInt64& ruiDist, UInt64& ruiBits ); 145 145 146 146 TEncSlice* getSliceEncoder() { return m_pcSliceEncoder; } 147 NalUnitType getNalUnitType( Int pocCurr );147 NalUnitType getNalUnitType( Int pocCurr, Int lastIdr ); 148 148 Void arrangeLongtermPicturesInRPS(TComSlice *, TComList<TComPic*>& ); 149 149 protected: 150 150 TEncRateCtrl* getRateCtrl() { return m_pcRateCtrl; }