History

Threaded decoding enhancement:

1. Distinguish non-threaded decoding with m_iThreadCount = 0 from one-thread decoding with m_iThreadCount=1. 2. Removed the use of bAvailable of PPicture and replaced by the use of iRefCount to more preciously represent the picture's being-use counts in both threaded and non-threaded mode.

xiaotiansf committed 7 years ago

Commit e7f5f6a1 parent 033c6a014 files · +125 −104Browse files

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

Unified · Split

codec/decoder/core/src/pic_queue.cpp+7−5
@@ -106,12 +106,14 @@ PPicture AllocPicture (PWelsDecoderContext pCtx, const int32_t kiPicWidth, const · 105 unmodified lines
106106 pPic->iWidthInPixel = kiPicWidth;
107107 pPic->iHeightInPixel = kiPicHeight;
108108 pPic->iFrameNum = -1;
109− pPic->bAvailableFlag = true;
109+ pPic->iRefCount = 0;
110110
111111 uint32_t uiMbWidth = (kiPicWidth + 15) >> 4;
112112 uint32_t uiMbHeight = (kiPicHeight + 15) >> 4;
113113 uint32_t uiMbCount = uiMbWidth * uiMbHeight;
114+
114115 pPic->pMbCorrectlyDecodedFlag = (bool*)pMa->WelsMallocz (uiMbCount * sizeof (bool), "pPic->pMbCorrectlyDecodedFlag");
116+
115117 pPic->pMbType = (uint32_t*)pMa->WelsMallocz (uiMbCount * sizeof (uint32_t), "pPic->pMbType");
116118 pPic->pMv[LIST_0] = (int16_t (*)[16][2])pMa->WelsMallocz (uiMbCount * sizeof (
117119 int16_t) * MV_A * MB_BLOCK4x4_NUM, "pPic->pMv[]");
@@ -182,8 +184,8 @@ PPicture PrefetchPic (PPicBuff pPicBuf) { · 64 unmodified lines
182184 }
183185
184186 for (iPicIdx = pPicBuf->iCurrentIdx + 1; iPicIdx < pPicBuf->iCapacity ; ++iPicIdx) {
185− if (pPicBuf->ppPic[iPicIdx] != NULL && pPicBuf->ppPic[iPicIdx]->bAvailableFlag
186− && !pPicBuf->ppPic[iPicIdx]->bUsedAsRef) {
187+ if (pPicBuf->ppPic[iPicIdx] != NULL && !pPicBuf->ppPic[iPicIdx]->bUsedAsRef
188+ && pPicBuf->ppPic[iPicIdx]->iRefCount <= 0) {
187189 pPic = pPicBuf->ppPic[iPicIdx];
188190 break;
189191 }
@@ -194,8 +196,8 @@ PPicture PrefetchPic (PPicBuff pPicBuf) { · 4 unmodified lines
194196 return pPic;
195197 }
196198 for (iPicIdx = 0 ; iPicIdx <= pPicBuf->iCurrentIdx ; ++iPicIdx) {
197− if (pPicBuf->ppPic[iPicIdx] != NULL && pPicBuf->ppPic[iPicIdx]->bAvailableFlag
198− && !pPicBuf->ppPic[iPicIdx]->bUsedAsRef) {
199+ if (pPicBuf->ppPic[iPicIdx] != NULL && !pPicBuf->ppPic[iPicIdx]->bUsedAsRef
200+ && pPicBuf->ppPic[iPicIdx]->iRefCount <= 0) {
199201 pPic = pPicBuf->ppPic[iPicIdx];
200202 break;
201203 }

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