History

Fix a few more fixes found during creating thread unit tests. 1. set all none-zero pCurDqLayer->pNzc to 1 before a MB deblocking. 2. make ReleaseBufferedReadyPicture to behaviour to be more close between thread and non-thread. 3. Fix a typo "sSliceDecodeFinsh"

xiaotiansf committed 6 years ago

Commit ffdf9121 parent e3882546 files · +93 −39Browse files

Showing the changes to codec/decoder/core/src/decoder_core.cpp (1 of 6 files). Show all

Unified · Split

codec/decoder/core/src/decoder_core.cpp+9−12
@@ -2530,14 +2530,14 @@ int32_t DecodeCurrentAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, SBuf · 2529 unmodified lines
25302530 pSh = &pNalCur->sNalData.sVclNal.sSliceHeaderExt.sSliceHeader;
25312531 if (pSh->iFirstMbInSlice == 0) {
25322532 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);
25342534 }
25352535 pCtx->pDec = NULL;
25362536 pCtx->iTotalNumMbRec = 0;
25372537 } else if (pLastThreadCtx->pCtx->pDec != NULL) {
25382538 if (pSh->iFrameNum == pLastThreadCtx->pCtx->pDec->iFrameNum
25392539 && 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);
25412541 pCtx->pDec = pLastThreadCtx->pCtx->pDec;
25422542 pCtx->pDec->bIsUngroupedMultiSlice = true;
25432543 pCtx->sRefPic = pLastThreadCtx->pCtx->sRefPic;
@@ -2822,12 +2822,9 @@ int32_t DecodeCurrentAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, SBuf · 278 unmodified lines
28222822 if (iThreadCount >= 1) {
28232823 int32_t id = pThreadCtx->sThreadInfo.uiThrNum;
28242824 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);
28312828 }
28322829 }
28332830 pCtx->pLastDecPicInfo->uiDecodingTimeStamp = pCtx->uiDecodingTimeStamp;
@@ -2835,7 +2832,7 @@ int32_t DecodeCurrentAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, SBuf · 1 unmodified line
28352832 iRet = DecodeFrameConstruction (pCtx, ppDst, pDstInfo);
28362833 if (iRet) {
28372834 if (iThreadCount > 1) {
2838− SET_EVENT (&pThreadCtx->sSliceDecodeFinsh);
2835+ SET_EVENT (&pThreadCtx->sSliceDecodeFinish);
28392836 }
28402837 return iRet;
28412838 }
@@ -2892,9 +2889,9 @@ int32_t DecodeCurrentAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, SBuf · 50 unmodified lines
28922889 }
28932890 }
28942891 }
2895− }
2896− if (iThreadCount > 1) {
2897− SET_EVENT (&pThreadCtx->sSliceDecodeFinsh);
2892+ if (iThreadCount > 1) {
2893+ SET_EVENT (&pThreadCtx->sSliceDecodeFinish);
2894+ }
28982895 }
28992896 return ERR_NONE;
29002897 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t