| 814 | } |
| 815 | |
| 816 | static PPicture WelsDelLongFromList (PRefPic pRefPic, uint32_t uiLongTermFrameIdx) { |
| 817 | PPicture pPic = NULL; |
| 818 | int32_t i = 0; |
| 819 | for (i = 0; i < pRefPic->uiLongRefCount[LIST_0]; i++) { |
| 820 | pPic = pRefPic->pLongRefList[LIST_0][i]; |
| 821 | if (pPic->iLongTermFrameIdx == (int32_t)uiLongTermFrameIdx) { |
| 822 | int32_t iMoveSize = pRefPic->uiLongRefCount[LIST_0] - i - 1; |
| 823 | pPic->bUsedAsRef = false; |
| 824 | pPic->bIsLongRef = false; |
| 825 | if (iMoveSize > 0) { |
| 826 | memmove (&pRefPic->pLongRefList[LIST_0][i], &pRefPic->pLongRefList[LIST_0][i + 1], |
| 827 | iMoveSize * sizeof (PPicture)); //confirmed_safe_unsafe_usage |
| 828 | } |
| 829 | pRefPic->uiLongRefCount[LIST_0]--; |
| 830 | pRefPic->pLongRefList[LIST_0][pRefPic->uiLongRefCount[LIST_0]] = NULL; |
| 831 | return pPic; |
| 832 | } |
| 833 | } |
| 834 | return NULL; |
| 835 | } |
| 836 | |
| 837 | static PPicture WelsDelLongFromListSetUnref (PRefPic pRefPic, uint32_t uiLongTermFrameIdx) { |
| 838 | PPicture pPic = WelsDelLongFromList (pRefPic, uiLongTermFrameIdx); |
no outgoing calls
no test coverage detected