Showing the changes to codec/decoder/core/src/decoder_core.cpp (1 of 4 files). Show all
Unified · Split
| @@ -101,10 +101,8 @@ static inline int32_t DecodeFrameConstruction (PWelsDecoderContext pCtx, uint8_t · 100 unmodified lines | |||
| 101 | return 0; | 101 | return 0; |
| 102 | } | 102 | } |
| 103 | 103 | ||
| 104 | inline bool CheckSliceNeedReconstruct (int16_t iCurDid, int16_t iCurQid, bool bStoreRefBasePicFlag, | 104 | inline bool CheckSliceNeedReconstruct (uint8_t uiLayerDqId, uint8_t uiTargetDqId) { |
| 105 | uint8_t uiDidMax, uint8_t uiLayerDqId, uint8_t uiTargetDqId) { | 105 | return (uiLayerDqId == uiTargetDqId); // target layer |
| 106 | return ((iCurDid == uiDidMax) && (iCurQid == BASE_QUALITY_ID) && (bStoreRefBasePicFlag)) // store base | ||
| 107 | || (uiLayerDqId == uiTargetDqId); // target layer | ||
| 108 | } | 106 | } |
| 109 | 107 | ||
| 110 | inline uint8_t GetTargetDqId (uint8_t uiTargetDqId, SDecodingParam* psParam) { | 108 | inline uint8_t GetTargetDqId (uint8_t uiTargetDqId, SDecodingParam* psParam) { |
| @@ -1863,8 +1861,7 @@ int32_t DecodeCurrentAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, int3 · 1752 unmodified lines | |||
| 1863 | pSh = &pNalCur->sNalData.sVclNal.sSliceHeaderExt.sSliceHeader; | 1861 | pSh = &pNalCur->sNalData.sVclNal.sSliceHeaderExt.sSliceHeader; |
| 1864 | pShExt = &pNalCur->sNalData.sVclNal.sSliceHeaderExt; | 1862 | pShExt = &pNalCur->sNalData.sVclNal.sSliceHeaderExt; |
| 1865 | 1863 | ||
| 1866 | bReconstructSlice = CheckSliceNeedReconstruct (iCurrIdD, iCurrIdQ, pShExt->bStoreRefBasePicFlag, | 1864 | bReconstructSlice = CheckSliceNeedReconstruct (pNalCur->sNalHeaderExt.uiLayerDqId, kuiTargetLayerDqId); |
| 1867 | kuiDependencyIdMax, pNalCur->sNalHeaderExt.uiLayerDqId, kuiTargetLayerDqId); | ||
| 1868 | 1865 | ||
| 1869 | memcpy (&pLayerInfo.sNalHeaderExt, &pNalCur->sNalHeaderExt, sizeof (SNalUnitHeaderExt)); //confirmed_safe_unsafe_usage | 1866 | memcpy (&pLayerInfo.sNalHeaderExt, &pNalCur->sNalHeaderExt, sizeof (SNalUnitHeaderExt)); //confirmed_safe_unsafe_usage |
| 1870 | 1867 | ||
| @@ -1995,25 +1992,15 @@ int32_t DecodeCurrentAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, int3 · 124 unmodified lines | |||
| 1995 | #endif | 1992 | #endif |
| 1996 | 1993 | ||
| 1997 | } | 1994 | } |
| 1998 | if ((uiNalRefIdc > 0) && (iCurrIdQ || (!dq_cur->bStoreRefBasePicFlag))) { | ||
| 1999 | WelsMarkAsRef (pCtx, false); | ||
| 2000 | ExpandReferencingPicture (pCtx->pDec, pCtx->sExpandPicFunc.pExpandLumaPicture, | ||
| 2001 | pCtx->sExpandPicFunc.pExpandChromaPicture); | ||
| 2002 | pCtx->pDec = NULL; | ||
| 2003 | } | ||
| 2004 | } | ||
| 2005 | |||
| 2006 | if ((iCurrIdD == kuiDependencyIdMax) && (iCurrIdQ == BASE_QUALITY_ID) && (dq_cur->bStoreRefBasePicFlag)) { | ||
| 2007 | pStoreBasePic = pCtx->pDec; | ||
| 2008 | |||
| 2009 | if (uiNalRefIdc > 0) { | 1995 | if (uiNalRefIdc > 0) { |
| 2010 | WelsMarkAsRef (pCtx, true); | 1996 | WelsMarkAsRef (pCtx); |
| 2011 | ExpandReferencingPicture (pCtx->pDec, pCtx->sExpandPicFunc.pExpandLumaPicture, | 1997 | ExpandReferencingPicture (pCtx->pDec, pCtx->sExpandPicFunc.pExpandLumaPicture, |
| 2012 | pCtx->sExpandPicFunc.pExpandChromaPicture); | 1998 | pCtx->sExpandPicFunc.pExpandChromaPicture); |
| 2013 | pCtx->pDec = NULL; | 1999 | pCtx->pDec = NULL; |
| 2014 | } | 2000 | } |
| 2015 | } | 2001 | } |
| 2016 | // need update frame_num due current frame is well decoded | 2002 | |
| 2003 | // need update frame_num due current frame is well decoded | ||
| 2017 | pCtx->iPrevFrameNum = pSh->iFrameNum; | 2004 | pCtx->iPrevFrameNum = pSh->iFrameNum; |
| 2018 | if (pCtx->bLastHasMmco5) | 2005 | if (pCtx->bLastHasMmco5) |
| 2019 | pCtx->iPrevFrameNum = 0; | 2006 | pCtx->iPrevFrameNum = 0; |