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 | static void ResetRefPicReferences (const PWelsDecoderContext& pCtx, const PPicture& inPPic) { | 168 | static void ResetRefPicReferences (const PWelsDecoderContext& pCtx, const PPicture& inPPic) { |
| 169 | //seach and reset the references of deleted references. | 169 | //seach and reset the references of deleted references. |
| 170 | if (pCtx->eSliceType != B_SLICE) { | 170 | int32_t list_count = pCtx->eSliceType == B_SLICE ? 2 : 1; |
| 171 | return; | 171 | for (int32_t list = LIST_0; list < list_count; ++list) { |
| 172 | } | ||
| 173 | for (int32_t list = LIST_0; list < LIST_A; ++list) { | ||
| 174 | int32_t refIdx = 0; | 172 | int32_t refIdx = 0; |
| 175 | PPicture pPic = pCtx->sRefPic.pRefList[list][refIdx]; | 173 | PPicture pPic = pCtx->sRefPic.pRefList[list][refIdx]; |
| 176 | while (refIdx < MAX_DPB_COUNT && pPic != NULL) { | 174 | while (refIdx < MAX_DPB_COUNT && pPic != NULL) { |
| 177 | ++refIdx; | 175 | ++refIdx; |
| 178 | int32_t ref = 0; | 176 | for (int32_t i = LIST_0; i < LIST_A; ++i) { |
| 179 | while (ref < MAX_DPB_COUNT && *pPic->pRefPic[ref] != NULL) { | 177 | int32_t ref = 0; |
| 180 | if (*pPic->pRefPic[ref] == inPPic) { | 178 | while (ref < MAX_DPB_COUNT && pPic->pRefPic[i][ref] != NULL) { |
| 181 | *pPic->pRefPic[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 | } |