Ticket #1101: SVN_HEVCSoftware_trunk_multiple_cvs_fix.patch
File SVN_HEVCSoftware_trunk_multiple_cvs_fix.patch, 5.4 KB (added by jackh, 11 years ago) |
---|
-
source/Lib/TLibDecoder/TDecTop.cpp
54 54 m_prevRAPisBLA = false; 55 55 m_pocRandomAccess = MAX_INT; 56 56 m_prevPOC = MAX_INT; 57 m_prevSuppressOutput = false; 57 58 m_bFirstSliceInPicture = true; 58 59 m_bFirstSliceInSequence = true; 60 m_bLastNALSkipped = false; 59 61 } 60 62 61 63 TDecTop::~TDecTop() … … 255 257 TComSPS *sps = m_parameterSetManagerDecoder.getSPS(pps->getSPSId()); 256 258 assert (sps != 0); 257 259 260 Bool spsChanged=sps!=m_parameterSetManagerDecoder.getActiveSPS(); 258 261 if (false == m_parameterSetManagerDecoder.activatePPS(m_apcSlicePilot->getPPSId(),m_apcSlicePilot->isIRAP())) 259 262 { 260 263 printf ("Parameter set activation failed!"); … … 291 294 g_uiMaxCUDepth = sps->getMaxCUDepth(); 292 295 g_uiAddCUDepth = max (0, sps->getLog2MinCodingBlockSize() - (Int)sps->getQuadtreeTULog2MinSize() ); 293 296 297 if (spsChanged) 298 { 299 for (TComList<TComPic *>::iterator It=m_cListPic.begin(); It!=m_cListPic.end(); ) { 300 TComList<TComPic *>::iterator CIt=It++; 301 (*CIt)->destroy(); 302 delete *CIt; 303 m_cListPic.erase(CIt); 304 } 305 } 306 294 307 for (Int i = 0; i < sps->getLog2DiffMaxMinCodingBlockSize(); i++) 295 308 { 296 309 sps->setAMPAcc( i, sps->getUseAMP() ); … … 316 329 m_uiSliceIdx = 0; 317 330 } 318 331 m_apcSlicePilot->setSliceIdx(m_uiSliceIdx); 319 if (!m_bFirstSliceInPicture )332 if (!m_bFirstSliceInPicture && !m_bLastNALSkipped) 320 333 { 321 334 m_apcSlicePilot->copySliceInfo( pcPic->getPicSym()->getSlice(m_uiSliceIdx-1) ); 322 335 } … … 334 347 335 348 m_cEntropyDecoder.decodeSliceHeader (m_apcSlicePilot, &m_parameterSetManagerDecoder); 336 349 350 if (m_apcSlicePilot->getSliceCurStartCUAddr() == 0 && 351 m_apcSlicePilot->getSliceSegmentCurStartCUAddr() == 0) { 352 if (nalu.m_nalUnitType==NAL_UNIT_CODED_SLICE_BLA_W_LP || 353 nalu.m_nalUnitType==NAL_UNIT_CODED_SLICE_BLA_W_RADL || 354 nalu.m_nalUnitType==NAL_UNIT_CODED_SLICE_BLA_N_LP || 355 nalu.m_nalUnitType==NAL_UNIT_CODED_SLICE_IDR_W_RADL || 356 nalu.m_nalUnitType==NAL_UNIT_CODED_SLICE_IDR_N_LP) 357 { 358 m_pocRandomAccess=MAX_INT; 359 } 360 } 337 361 // Skip pictures due to random access 338 if (isRandomAccessSkipPicture(iSkipFrame, iPOCLastDisplay))339 {340 return false;341 }342 362 // Skip TFD pictures associated with BLA/BLANT pictures 343 if (is SkipPictureForBLA(iPOCLastDisplay))363 if (isRandomAccessSkipPicture(iSkipFrame, iPOCLastDisplay) || isSkipPictureForBLA(iPOCLastDisplay)) 344 364 { 365 m_bLastNALSkipped=true; 345 366 return false; 346 367 } 347 368 else m_bLastNALSkipped=false; 348 369 //we should only get a different poc for a new picture (with CTU address==0) 349 370 if (m_apcSlicePilot->isNextSlice() && m_apcSlicePilot->getPOC()!=m_prevPOC && !m_bFirstSliceInSequence && (!m_apcSlicePilot->getSliceCurStartCUAddr()==0)) 350 371 { … … 353 374 // exit when a new picture is found 354 375 if (m_apcSlicePilot->isNextSlice() && (m_apcSlicePilot->getSliceCurStartCUAddr() == 0 && !m_bFirstSliceInPicture) && !m_bFirstSliceInSequence ) 355 376 { 356 if (m_prevPOC >= m_pocRandomAccess)377 if (!m_prevSuppressOutput) 357 378 { 358 379 m_prevPOC = m_apcSlicePilot->getPOC(); 380 m_prevSuppressOutput = m_apcSlicePilot->getPOC() < m_pocRandomAccess && (m_apcSlicePilot->getNalUnitType()==NAL_UNIT_CODED_SLICE_RASL_N || m_apcSlicePilot->getNalUnitType()==NAL_UNIT_CODED_SLICE_RASL_R); 359 381 return true; 360 382 } 361 383 m_prevPOC = m_apcSlicePilot->getPOC(); 384 m_prevSuppressOutput = m_apcSlicePilot->getPOC() < m_pocRandomAccess && (m_apcSlicePilot->getNalUnitType()==NAL_UNIT_CODED_SLICE_RASL_N || m_apcSlicePilot->getNalUnitType()==NAL_UNIT_CODED_SLICE_RASL_R); 362 385 } 363 386 // actual decoding starts here 364 387 xActivateParameterSets(); … … 366 389 if (m_apcSlicePilot->isNextSlice()) 367 390 { 368 391 m_prevPOC = m_apcSlicePilot->getPOC(); 392 m_prevSuppressOutput = m_apcSlicePilot->getPOC() < m_pocRandomAccess && (m_apcSlicePilot->getNalUnitType()==NAL_UNIT_CODED_SLICE_RASL_N || m_apcSlicePilot->getNalUnitType()==NAL_UNIT_CODED_SLICE_RASL_R); 369 393 } 370 394 m_bFirstSliceInSequence = false; 371 395 //detect lost reference picture and insert copy of earlier frame. … … 620 644 { 621 645 if(nalUnitType == NAL_UNIT_SUFFIX_SEI) 622 646 { 623 m_seiReader.parseSEImessage( bs, m_pcPic->getSEIs(), nalUnitType, m_parameterSetManagerDecoder.getActiveSPS() ); 647 if (!m_bLastNALSkipped) { 648 m_seiReader.parseSEImessage( bs, m_pcPic->getSEIs(), nalUnitType, m_parameterSetManagerDecoder.getActiveSPS() ); 649 } 624 650 } 625 651 else 626 652 { … … 664 690 xDecodeSEI( nalu.m_Bitstream, nalu.m_nalUnitType ); 665 691 return false; 666 692 693 case NAL_UNIT_EOS: 694 m_pocRandomAccess=MAX_INT; 695 break; 696 667 697 case NAL_UNIT_CODED_SLICE_TRAIL_R: 668 698 case NAL_UNIT_CODED_SLICE_TRAIL_N: 669 699 case NAL_UNIT_CODED_SLICE_TLA_R: -
source/Lib/TLibDecoder/TDecTop.h
95 95 TComPic* m_pcPic; 96 96 UInt m_uiSliceIdx; 97 97 Int m_prevPOC; 98 Bool m_prevSuppressOutput; 98 99 Bool m_bFirstSliceInPicture; 99 100 Bool m_bFirstSliceInSequence; 101 Bool m_bLastNALSkipped; 100 102 101 103 public: 102 104 TDecTop();