diff -rupNw tmp1/source/Lib/TLibDecoder/TDecTop.cpp tmp2/source/Lib/TLibDecoder/TDecTop.cpp
old
|
new
|
TDecTop::TDecTop() |
62 | 62 | m_prevPOC = MAX_INT; |
63 | 63 | m_bFirstSliceInPicture = true; |
64 | 64 | m_bFirstSliceInSequence = true; |
65 | | m_digestCanBeChecked = false; |
| 65 | m_lastNALSkipped = false; |
66 | 66 | } |
67 | 67 | |
68 | 68 | TDecTop::~TDecTop() |
… |
… |
Void TDecTop::executeLoopFilters(Int& po |
192 | 192 | // Execute Deblock + Cleanup |
193 | 193 | |
194 | 194 | m_cGopDecoder.filterPicture(pcPic); |
195 | | m_digestCanBeChecked = true; |
196 | 195 | TComSlice::sortPicList( m_cListPic ); // sorting for application output |
197 | 196 | poc = pcPic->getSlice(m_uiSliceIdx-1)->getPOC(); |
198 | 197 | rpcListPic = &m_cListPic; |
… |
… |
Void TDecTop::xActivateParameterSets() |
276 | 275 | TComSPS *sps = m_parameterSetManagerDecoder.getSPS(pps->getSPSId()); |
277 | 276 | assert (sps != 0); |
278 | 277 | |
| 278 | Bool spsChanged=sps!=m_parameterSetManagerDecoder.getActiveSPS(); |
279 | 279 | if (false == m_parameterSetManagerDecoder.activatePPS(m_apcSlicePilot->getPPSId(),m_apcSlicePilot->isIRAP())) |
280 | 280 | { |
281 | 281 | printf ("Parameter set activation failed!"); |
… |
… |
Void TDecTop::xActivateParameterSets() |
312 | 312 | g_uiMaxCUDepth = sps->getMaxCUDepth(); |
313 | 313 | g_uiAddCUDepth = max (0, sps->getLog2MinCodingBlockSize() - (Int)sps->getQuadtreeTULog2MinSize() ); |
314 | 314 | |
| 315 | if (spsChanged) |
| 316 | { |
| 317 | for (TComList<TComPic *>::iterator It=m_cListPic.begin(); It!=m_cListPic.end(); ) { |
| 318 | TComList<TComPic *>::iterator CIt=It++; |
| 319 | (*CIt)->destroy(); |
| 320 | delete *CIt; |
| 321 | m_cListPic.erase(CIt); |
| 322 | } |
| 323 | } |
315 | 324 | for (Int i = 0; i < sps->getLog2DiffMaxMinCodingBlockSize(); i++) |
316 | 325 | { |
317 | 326 | sps->setAMPAcc( i, sps->getUseAMP() ); |
… |
… |
Bool TDecTop::xDecodeSlice(InputNALUnit |
331 | 340 | { |
332 | 341 | TComPic*& pcPic = m_pcPic; |
333 | 342 | |
334 | | if (isRandomAccessSkipPicture(iSkipFrame, iPOCLastDisplay)) |
335 | | { |
336 | | m_digestCanBeChecked = false; |
337 | | return false; |
338 | | } |
339 | | // Skip TFD pictures associated with BLA/BLANT pictures |
340 | | if (isSkipPictureForBLA(iPOCLastDisplay)) |
341 | | { |
342 | | m_digestCanBeChecked = false; |
343 | | return false; |
344 | | } |
345 | 343 | m_apcSlicePilot->initSlice(); |
346 | 344 | |
347 | 345 | if (m_bFirstSliceInPicture) |
… |
… |
Bool TDecTop::xDecodeSlice(InputNALUnit |
349 | 347 | m_uiSliceIdx = 0; |
350 | 348 | } |
351 | 349 | m_apcSlicePilot->setSliceIdx(m_uiSliceIdx); |
352 | | if (!m_bFirstSliceInPicture) |
| 350 | if (!m_bFirstSliceInPicture && !m_lastNALSkipped) |
353 | 351 | { |
354 | 352 | m_apcSlicePilot->copySliceInfo( pcPic->getPicSym()->getSlice(m_uiSliceIdx-1) ); |
355 | 353 | } |
… |
… |
Bool TDecTop::xDecodeSlice(InputNALUnit |
367 | 365 | |
368 | 366 | m_cEntropyDecoder.decodeSliceHeader (m_apcSlicePilot, &m_parameterSetManagerDecoder); |
369 | 367 | |
370 | | // Skip pictures due to random access |
371 | | if (isRandomAccessSkipPicture(iSkipFrame, iPOCLastDisplay)) |
372 | | { |
373 | | return false; |
| 368 | if (m_apcSlicePilot->getSliceCurStartCUAddr() == 0 && |
| 369 | m_apcSlicePilot->getSliceSegmentCurStartCUAddr() == 0 && |
| 370 | (nalu.m_nalUnitType==NAL_UNIT_CODED_SLICE_BLA_W_LP || |
| 371 | nalu.m_nalUnitType==NAL_UNIT_CODED_SLICE_BLA_W_RADL || |
| 372 | nalu.m_nalUnitType==NAL_UNIT_CODED_SLICE_BLA_N_LP || |
| 373 | nalu.m_nalUnitType==NAL_UNIT_CODED_SLICE_IDR_W_RADL || |
| 374 | nalu.m_nalUnitType==NAL_UNIT_CODED_SLICE_IDR_N_LP)) { |
| 375 | m_pocRandomAccess=MAX_INT; |
374 | 376 | } |
| 377 | // Skip pictures due to random access |
375 | 378 | // Skip TFD pictures associated with BLA/BLANT pictures |
376 | | if (isSkipPictureForBLA(iPOCLastDisplay)) |
| 379 | if (isRandomAccessSkipPicture(iSkipFrame, iPOCLastDisplay) || isSkipPictureForBLA(iPOCLastDisplay)) |
377 | 380 | { |
| 381 | m_lastNALSkipped=true; |
378 | 382 | return false; |
379 | 383 | } |
380 | | |
| 384 | else m_lastNALSkipped=false; |
381 | 385 | //we should only get a different poc for a new picture (with CTU address==0) |
382 | 386 | if (m_apcSlicePilot->isNextSlice() && m_apcSlicePilot->getPOC()!=m_prevPOC && !m_bFirstSliceInSequence && (!m_apcSlicePilot->getSliceCurStartCUAddr()==0)) |
383 | 387 | { |
… |
… |
Bool TDecTop::xDecodeSlice(InputNALUnit |
386 | 390 | // exit when a new picture is found |
387 | 391 | if (m_apcSlicePilot->isNextSlice() && (m_apcSlicePilot->getSliceCurStartCUAddr() == 0 && !m_bFirstSliceInPicture) && !m_bFirstSliceInSequence ) |
388 | 392 | { |
389 | | if (m_prevPOC >= m_pocRandomAccess) |
| 393 | if (m_prevPOC >= m_pocRandomAccess || m_apcSlicePilot->getPOC()==m_pocRandomAccess) |
390 | 394 | { |
391 | 395 | m_prevPOC = m_apcSlicePilot->getPOC(); |
392 | 396 | return true; |
… |
… |
Bool TDecTop::xDecodeSlice(InputNALUnit |
622 | 626 | m_cGopDecoder.decompressSlice(nalu.m_Bitstream, pcPic, bPicComplete); |
623 | 627 | |
624 | 628 | m_bFirstSliceInPicture = false; |
625 | | m_digestCanBeChecked = false; |
626 | 629 | m_uiSliceIdx++; |
627 | 630 | |
628 | 631 | return false; |
… |
… |
Void TDecTop::xDecodeSEI( TComInputBitst |
655 | 658 | if(nalUnitType == NAL_UNIT_SUFFIX_SEI) |
656 | 659 | { |
657 | 660 | m_seiReader.parseSEImessage( bs, m_pcPic->getSEIs(), nalUnitType, m_parameterSetManagerDecoder.getActiveSPS() ); |
658 | | if (m_decodedPictureHashSEIEnabled && m_digestCanBeChecked) |
| 661 | if (m_decodedPictureHashSEIEnabled && !m_lastNALSkipped) |
659 | 662 | { |
660 | 663 | SEIMessages pictureHashes = getSeisByType(m_pcPic->getSEIs(), SEI::DECODED_PICTURE_HASH ); |
661 | 664 | const SEIDecodedPictureHash *hash = ( pictureHashes.size() > 0 ) ? (SEIDecodedPictureHash*) *(pictureHashes.begin()) : NULL; |
… |
… |
Bool TDecTop::decode(InputNALUnit& nalu, |
708 | 711 | xDecodeSEI( nalu.m_Bitstream, nalu.m_nalUnitType ); |
709 | 712 | return false; |
710 | 713 | |
| 714 | case NAL_UNIT_EOS: |
| 715 | m_pocRandomAccess=MAX_INT; |
| 716 | break; |
711 | 717 | case NAL_UNIT_CODED_SLICE_TRAIL_R: |
712 | 718 | case NAL_UNIT_CODED_SLICE_TRAIL_N: |
713 | 719 | case NAL_UNIT_CODED_SLICE_TLA_R: |
diff -rupNw tmp1/source/Lib/TLibDecoder/TDecTop.h tmp2/source/Lib/TLibDecoder/TDecTop.h
old
|
new
|
private: |
98 | 98 | Bool m_bFirstSliceInPicture; |
99 | 99 | Bool m_bFirstSliceInSequence; |
100 | 100 | Int m_decodedPictureHashSEIEnabled; ///< Checksum(3)/CRC(2)/MD5(1)/disable(0) acting on decoded picture hash SEI message |
101 | | Bool m_digestCanBeChecked; |
| 101 | Bool m_lastNALSkipped; |
102 | 102 | |
103 | 103 | public: |
104 | 104 | TDecTop(); |