MCPcopy Create free account
hub / github.com/cisco/openh264 / WelsDelLongFromList

Function WelsDelLongFromList

codec/decoder/core/src/manage_dec_ref.cpp:816–835  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

814}
815
816static 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
837static PPicture WelsDelLongFromListSetUnref (PRefPic pRefPic, uint32_t uiLongTermFrameIdx) {
838 PPicture pPic = WelsDelLongFromList (pRefPic, uiLongTermFrameIdx);

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected