History

try to use decoder error conditions to determine how to continue instead of trying to loacate deleted references.

xiaotiansf committed 7 years ago

Commit 3bf69ad1 parent 579a5bc2 files · +4 −22Browse files

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

Unified · Split

codec/decoder/core/src/decoder.cpp+0−22
@@ -165,27 +165,6 @@ static int32_t IncreasePicBuff (PWelsDecoderContext pCtx, PPicBuff* ppPicBuf, co · 164 unmodified lines
165165 return ERR_NONE;
166166 }
167167
168−static void ResetRefPicReferences (const PWelsDecoderContext& pCtx, const PPicture& inPPic) {
169− //seach and reset the references of deleted references.
170− int32_t list_count = pCtx->eSliceType == B_SLICE ? 2 : 1;
171− for (int32_t list = LIST_0; list < list_count; ++list) {
172− int32_t refIdx = 0;
173− PPicture pPic = pCtx->sRefPic.pRefList[list][refIdx];
174− while (refIdx < MAX_DPB_COUNT && pPic != NULL) {
175− ++refIdx;
176− for (int32_t i = LIST_0; i < LIST_A; ++i) {
177− int32_t ref = 0;
178− while (ref < MAX_DPB_COUNT && pPic->pRefPic[i][ref] != NULL) {
179− if (pPic->pRefPic[i][ref] == inPPic) {
180− pPic->pRefPic[i][ref] = NULL;
181− }
182− ++ref;
183− }
184− }
185− }
186− }
187−}
188−
189168 static int32_t DecreasePicBuff (PWelsDecoderContext pCtx, PPicBuff* ppPicBuf, const int32_t kiOldSize,
190169 const int32_t kiPicWidth, const int32_t kiPicHeight, const int32_t kiNewSize) {
191170 PPicBuff pPicOldBuf = *ppPicBuf;
@@ -233,7 +212,6 @@ static int32_t DecreasePicBuff (PWelsDecoderContext pCtx, PPicBuff* ppPicBuf, co · 41 unmodified lines
233212 for (iPicIdx = iDelIdx; iPicIdx < kiOldSize; iPicIdx++) {
234213 if (iPrevPicIdx != iPicIdx) {
235214 if (pPicOldBuf->ppPic[iPicIdx] != NULL) {
236− ResetRefPicReferences (pCtx, pPicOldBuf->ppPic[iPicIdx]);
237215 FreePicture (pPicOldBuf->ppPic[iPicIdx], pMa);
238216 pPicOldBuf->ppPic[iPicIdx] = NULL;
239217 }

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