Showing the changes to codec/decoder/core/src/decoder.cpp (1 of 1 file). Show all
Unified · Split
| @@ -167,20 +167,20 @@ static int32_t IncreasePicBuff (PWelsDecoderContext pCtx, PPicBuff* ppPicBuf, co · 166 unmodified lines | ||
| 167 | 167 | |
| 168 | 168 | static void ResetRefPicReferences (const PWelsDecoderContext& pCtx, const PPicture& inPPic) { |
| 169 | 169 | //seach and reset the references of deleted references. |
| 170 | − if (pCtx->eSliceType != B_SLICE) { | |
| 171 | − return; | |
| 172 | − } | |
| 173 | − for (int32_t list = LIST_0; list < LIST_A; ++list) { | |
| 170 | + int32_t list_count = pCtx->eSliceType == B_SLICE ? 2 : 1; | |
| 171 | + for (int32_t list = LIST_0; list < list_count; ++list) { | |
| 174 | 172 | int32_t refIdx = 0; |
| 175 | 173 | PPicture pPic = pCtx->sRefPic.pRefList[list][refIdx]; |
| 176 | 174 | while (refIdx < MAX_DPB_COUNT && pPic != NULL) { |
| 177 | 175 | ++refIdx; |
| 178 | − int32_t ref = 0; | |
| 179 | − while (ref < MAX_DPB_COUNT && *pPic->pRefPic[ref] != NULL) { | |
| 180 | − if (*pPic->pRefPic[ref] == inPPic) { | |
| 181 | − *pPic->pRefPic[ref] = NULL; | |
| 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; | |
| 182 | 183 | } |
| 183 | − ++ref; | |
| 184 | 184 | } |
| 185 | 185 | } |
| 186 | 186 | } |