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 | 2530 | pSh = &pNalCur->sNalData.sVclNal.sSliceHeaderExt.sSliceHeader; |
| 2531 | 2531 | if (pSh->iFirstMbInSlice == 0) { |
| 2532 | 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 | 2535 | pCtx->pDec = NULL; |
| 2536 | 2536 | pCtx->iTotalNumMbRec = 0; |
| 2537 | 2537 | } else if (pLastThreadCtx->pCtx->pDec != NULL) { |
| 2538 | 2538 | if (pSh->iFrameNum == pLastThreadCtx->pCtx->pDec->iFrameNum |
| 2539 | 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 | 2541 | pCtx->pDec = pLastThreadCtx->pCtx->pDec; |
| 2542 | 2542 | pCtx->pDec->bIsUngroupedMultiSlice = true; |
| 2543 | 2543 | pCtx->sRefPic = pLastThreadCtx->pCtx->sRefPic; |
| @@ -2822,12 +2822,9 @@ int32_t DecodeCurrentAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, SBuf · 278 unmodified lines | ||
| 2822 | 2822 | if (iThreadCount >= 1) { |
| 2823 | 2823 | int32_t id = pThreadCtx->sThreadInfo.uiThrNum; |
| 2824 | 2824 | for (int32_t i = 0; i < iThreadCount; ++i) { |
| 2825 | − if (i != id) { | |
| 2826 | − if (pThreadCtx[i - id].sSliceDecodeStart.isSignaled) { | |
| 2827 | − while (pThreadCtx[i - id].pCtx->uiDecodingTimeStamp < pCtx->uiDecodingTimeStamp) { | |
| 2828 | − WelsSleep (1); | |
| 2829 | − } | |
| 2830 | − } | |
| 2825 | + if (i == id || pThreadCtx[i - id].pCtx->uiDecodingTimeStamp == 0) continue; | |
| 2826 | + if (pThreadCtx[i - id].pCtx->uiDecodingTimeStamp < pCtx->uiDecodingTimeStamp) { | |
| 2827 | + WAIT_EVENT (&pThreadCtx[i - id].sSliceDecodeFinish, WELS_DEC_THREAD_WAIT_INFINITE); | |
| 2831 | 2828 | } |
| 2832 | 2829 | } |
| 2833 | 2830 | pCtx->pLastDecPicInfo->uiDecodingTimeStamp = pCtx->uiDecodingTimeStamp; |
| @@ -2835,7 +2832,7 @@ int32_t DecodeCurrentAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, SBuf · 1 unmodified line | ||
| 2835 | 2832 | iRet = DecodeFrameConstruction (pCtx, ppDst, pDstInfo); |
| 2836 | 2833 | if (iRet) { |
| 2837 | 2834 | if (iThreadCount > 1) { |
| 2838 | − SET_EVENT (&pThreadCtx->sSliceDecodeFinsh); | |
| 2835 | + SET_EVENT (&pThreadCtx->sSliceDecodeFinish); | |
| 2839 | 2836 | } |
| 2840 | 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 | − } | |
| 2896 | − if (iThreadCount > 1) { | |
| 2897 | − SET_EVENT (&pThreadCtx->sSliceDecodeFinsh); | |
| 2892 | + if (iThreadCount > 1) { | |
| 2893 | + SET_EVENT (&pThreadCtx->sSliceDecodeFinish); | |
| 2894 | + } | |
| 2898 | 2895 | } |
| 2899 | 2896 | return ERR_NONE; |
| 2900 | 2897 | } |