Showing the changes to codec/decoder/core/src/decoder.cpp (1 of 2 files). Show all
Unified · Split
| @@ -165,27 +165,6 @@ static int32_t IncreasePicBuff (PWelsDecoderContext pCtx, PPicBuff* ppPicBuf, co · 164 unmodified lines | |||
| 165 | return ERR_NONE; | 165 | return ERR_NONE; |
| 166 | } | 166 | } |
| 167 | 167 | ||
| 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 | |||
| 189 | static int32_t DecreasePicBuff (PWelsDecoderContext pCtx, PPicBuff* ppPicBuf, const int32_t kiOldSize, | 168 | static int32_t DecreasePicBuff (PWelsDecoderContext pCtx, PPicBuff* ppPicBuf, const int32_t kiOldSize, |
| 190 | const int32_t kiPicWidth, const int32_t kiPicHeight, const int32_t kiNewSize) { | 169 | const int32_t kiPicWidth, const int32_t kiPicHeight, const int32_t kiNewSize) { |
| 191 | PPicBuff pPicOldBuf = *ppPicBuf; | 170 | PPicBuff pPicOldBuf = *ppPicBuf; |
| @@ -233,7 +212,6 @@ static int32_t DecreasePicBuff (PWelsDecoderContext pCtx, PPicBuff* ppPicBuf, co · 41 unmodified lines | |||
| 233 | for (iPicIdx = iDelIdx; iPicIdx < kiOldSize; iPicIdx++) { | 212 | for (iPicIdx = iDelIdx; iPicIdx < kiOldSize; iPicIdx++) { |
| 234 | if (iPrevPicIdx != iPicIdx) { | 213 | if (iPrevPicIdx != iPicIdx) { |
| 235 | if (pPicOldBuf->ppPic[iPicIdx] != NULL) { | 214 | if (pPicOldBuf->ppPic[iPicIdx] != NULL) { |
| 236 | ResetRefPicReferences (pCtx, pPicOldBuf->ppPic[iPicIdx]); | ||
| 237 | FreePicture (pPicOldBuf->ppPic[iPicIdx], pMa); | 215 | FreePicture (pPicOldBuf->ppPic[iPicIdx], pMa); |
| 238 | pPicOldBuf->ppPic[iPicIdx] = NULL; | 216 | pPicOldBuf->ppPic[iPicIdx] = NULL; |
| 239 | } | 217 | } |