Showing the changes to codec/decoder/core/src/decoder.cpp (1 of 1 file). Show all
Unified · Split
| @@ -209,6 +209,17 @@ static int32_t DecreasePicBuff (PWelsDecoderContext pCtx, PPicBuff* ppPicBuf, co · 208 unmodified lines | |||
| 209 | iDelIdx = kiNewSize; | 209 | iDelIdx = kiNewSize; |
| 210 | } | 210 | } |
| 211 | 211 | ||
| 212 | //remove references | ||
| 213 | for (int32_t i = 0; i < kiNewSize; i++) { | ||
| 214 | for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) { | ||
| 215 | uint32_t j = 0; | ||
| 216 | while (j < MAX_DPB_COUNT && pPicNewBuf->ppPic[i]->pRefPic[listIdx][j]) { | ||
| 217 | pPicNewBuf->ppPic[i]->pRefPic[listIdx][j] = 0; | ||
| 218 | ++j; | ||
| 219 | } | ||
| 220 | } | ||
| 221 | } | ||
| 222 | |||
| 212 | for (iPicIdx = iDelIdx; iPicIdx < kiOldSize; iPicIdx++) { | 223 | for (iPicIdx = iDelIdx; iPicIdx < kiOldSize; iPicIdx++) { |
| 213 | if (iPrevPicIdx != iPicIdx) { | 224 | if (iPrevPicIdx != iPicIdx) { |
| 214 | if (pPicOldBuf->ppPic[iPicIdx] != NULL) { | 225 | if (pPicOldBuf->ppPic[iPicIdx] != NULL) { |
| @@ -228,14 +239,6 @@ static int32_t DecreasePicBuff (PWelsDecoderContext pCtx, PPicBuff* ppPicBuf, co · 13 unmodified lines | |||
| 228 | pPicNewBuf->ppPic[i]->uiRefCount = 0; | 239 | pPicNewBuf->ppPic[i]->uiRefCount = 0; |
| 229 | pPicNewBuf->ppPic[i]->bAvailableFlag = true; | 240 | pPicNewBuf->ppPic[i]->bAvailableFlag = true; |
| 230 | pPicNewBuf->ppPic[i]->bIsComplete = false; | 241 | pPicNewBuf->ppPic[i]->bIsComplete = false; |
| 231 | //remove references | ||
| 232 | for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) { | ||
| 233 | uint32_t i = 0; | ||
| 234 | while (i < MAX_DPB_COUNT && pPicNewBuf->ppPic[i]->pRefPic[listIdx][i]) { | ||
| 235 | pPicNewBuf->ppPic[i]->pRefPic[listIdx][i] = 0; | ||
| 236 | ++i; | ||
| 237 | } | ||
| 238 | } | ||
| 239 | } | 242 | } |
| 240 | // remove old PicBuf | 243 | // remove old PicBuf |
| 241 | if (pPicOldBuf->ppPic != NULL) { | 244 | if (pPicOldBuf->ppPic != NULL) { |