Showing the changes to codec/decoder/core/src/decoder_core.cpp (1 of 6 files). Show all
Unified · Split
| @@ -2530,14 +2530,14 @@ int32_t DecodeCurrentAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, SBuf · 2529 unmodified lines | |||
| 2530 | pSh = &pNalCur->sNalData.sVclNal.sSliceHeaderExt.sSliceHeader; | 2530 | pSh = &pNalCur->sNalData.sVclNal.sSliceHeaderExt.sSliceHeader; |
| 2531 | if (pSh->iFirstMbInSlice == 0) { | 2531 | if (pSh->iFirstMbInSlice == 0) { |
| 2532 | if (pLastThreadCtx->pCtx->pDec != NULL && pLastThreadCtx->pCtx->pDec->bIsUngroupedMultiSlice) { | 2532 | if (pLastThreadCtx->pCtx->pDec != NULL && pLastThreadCtx->pCtx->pDec->bIsUngroupedMultiSlice) { |
| 2533 | WAIT_EVENT (&pLastThreadCtx->sSliceDecodeFinsh, WELS_DEC_THREAD_WAIT_INFINITE); | 2533 | WAIT_EVENT (&pLastThreadCtx->sSliceDecodeFinish, WELS_DEC_THREAD_WAIT_INFINITE); |
| 2534 | } | 2534 | } |
| 2535 | pCtx->pDec = NULL; | 2535 | pCtx->pDec = NULL; |
| 2536 | pCtx->iTotalNumMbRec = 0; | 2536 | pCtx->iTotalNumMbRec = 0; |
| 2537 | } else if (pLastThreadCtx->pCtx->pDec != NULL) { | 2537 | } else if (pLastThreadCtx->pCtx->pDec != NULL) { |
| 2538 | if (pSh->iFrameNum == pLastThreadCtx->pCtx->pDec->iFrameNum | 2538 | if (pSh->iFrameNum == pLastThreadCtx->pCtx->pDec->iFrameNum |
| 2539 | && pSh->iPicOrderCntLsb == pLastThreadCtx->pCtx->pDec->iFramePoc) { | 2539 | && pSh->iPicOrderCntLsb == pLastThreadCtx->pCtx->pDec->iFramePoc) { |
| 2540 | WAIT_EVENT (&pLastThreadCtx->sSliceDecodeFinsh, WELS_DEC_THREAD_WAIT_INFINITE); | 2540 | WAIT_EVENT (&pLastThreadCtx->sSliceDecodeFinish, WELS_DEC_THREAD_WAIT_INFINITE); |
| 2541 | pCtx->pDec = pLastThreadCtx->pCtx->pDec; | 2541 | pCtx->pDec = pLastThreadCtx->pCtx->pDec; |
| 2542 | pCtx->pDec->bIsUngroupedMultiSlice = true; | 2542 | pCtx->pDec->bIsUngroupedMultiSlice = true; |
| 2543 | pCtx->sRefPic = pLastThreadCtx->pCtx->sRefPic; | 2543 | pCtx->sRefPic = pLastThreadCtx->pCtx->sRefPic; |
| @@ -2822,12 +2822,9 @@ int32_t DecodeCurrentAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, SBuf · 278 unmodified lines | |||
| 2822 | if (iThreadCount >= 1) { | 2822 | if (iThreadCount >= 1) { |
| 2823 | int32_t id = pThreadCtx->sThreadInfo.uiThrNum; | 2823 | int32_t id = pThreadCtx->sThreadInfo.uiThrNum; |
| 2824 | for (int32_t i = 0; i < iThreadCount; ++i) { | 2824 | for (int32_t i = 0; i < iThreadCount; ++i) { |
| 2825 | if (i != id) { | 2825 | if (i == id || pThreadCtx[i - id].pCtx->uiDecodingTimeStamp == 0) continue; |
| 2826 | if (pThreadCtx[i - id].sSliceDecodeStart.isSignaled) { | 2826 | if (pThreadCtx[i - id].pCtx->uiDecodingTimeStamp < pCtx->uiDecodingTimeStamp) { |
| 2827 | while (pThreadCtx[i - id].pCtx->uiDecodingTimeStamp < pCtx->uiDecodingTimeStamp) { | 2827 | WAIT_EVENT (&pThreadCtx[i - id].sSliceDecodeFinish, WELS_DEC_THREAD_WAIT_INFINITE); |
| 2828 | WelsSleep (1); | ||
| 2829 | } | ||
| 2830 | } | ||
| 2831 | } | 2828 | } |
| 2832 | } | 2829 | } |
| 2833 | pCtx->pLastDecPicInfo->uiDecodingTimeStamp = pCtx->uiDecodingTimeStamp; | 2830 | pCtx->pLastDecPicInfo->uiDecodingTimeStamp = pCtx->uiDecodingTimeStamp; |
| @@ -2835,7 +2832,7 @@ int32_t DecodeCurrentAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, SBuf · 1 unmodified line | |||
| 2835 | iRet = DecodeFrameConstruction (pCtx, ppDst, pDstInfo); | 2832 | iRet = DecodeFrameConstruction (pCtx, ppDst, pDstInfo); |
| 2836 | if (iRet) { | 2833 | if (iRet) { |
| 2837 | if (iThreadCount > 1) { | 2834 | if (iThreadCount > 1) { |
| 2838 | SET_EVENT (&pThreadCtx->sSliceDecodeFinsh); | 2835 | SET_EVENT (&pThreadCtx->sSliceDecodeFinish); |
| 2839 | } | 2836 | } |
| 2840 | return iRet; | 2837 | return iRet; |
| 2841 | } | 2838 | } |
| @@ -2892,9 +2889,9 @@ int32_t DecodeCurrentAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, SBuf · 50 unmodified lines | |||
| 2892 | } | 2889 | } |
| 2893 | } | 2890 | } |
| 2894 | } | 2891 | } |
| 2895 | } | 2892 | if (iThreadCount > 1) { |
| 2896 | if (iThreadCount > 1) { | 2893 | SET_EVENT (&pThreadCtx->sSliceDecodeFinish); |
| 2897 | SET_EVENT (&pThreadCtx->sSliceDecodeFinsh); | 2894 | } |
| 2898 | } | 2895 | } |
| 2899 | return ERR_NONE; | 2896 | return ERR_NONE; |
| 2900 | } | 2897 | } |