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

Function MMCO

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

Source from the content-addressed store, hash-verified

662}
663
664static int32_t MMCO (PWelsDecoderContext pCtx, PRefPic pRefPic, PRefPicMarking pRefPicMarking) {
665 PSps pSps = pCtx->pCurDqLayer->sLayerInfo.pSps;
666 int32_t i = 0;
667 int32_t iRet = ERR_NONE;
668 for (i = 0; i < MAX_MMCO_COUNT && pRefPicMarking->sMmcoRef[i].uiMmcoType != MMCO_END; i++) {
669 uint32_t uiMmcoType = pRefPicMarking->sMmcoRef[i].uiMmcoType;
670 int32_t iShortFrameNum = (pCtx->iFrameNum - pRefPicMarking->sMmcoRef[i].iDiffOfPicNum) & ((
671 1 << pSps->uiLog2MaxFrameNum) - 1);
672 uint32_t uiLongTermPicNum = pRefPicMarking->sMmcoRef[i].uiLongTermPicNum;
673 int32_t iLongTermFrameIdx = pRefPicMarking->sMmcoRef[i].iLongTermFrameIdx;
674 int32_t iMaxLongTermFrameIdx = pRefPicMarking->sMmcoRef[i].iMaxLongTermFrameIdx;
675 if (uiMmcoType > MMCO_LONG) {
676 return ERR_INFO_INVALID_MMCO_OPCODE_BASE;
677 }
678 iRet = MMCOProcess (pCtx, pRefPic, uiMmcoType, iShortFrameNum, uiLongTermPicNum, iLongTermFrameIdx,
679 iMaxLongTermFrameIdx);
680 if (iRet != ERR_NONE) {
681 return iRet;
682 }
683 }
684 if (i == MAX_MMCO_COUNT) { //although Rec does not handle this condition, we here prohibit too many MMCO op
685 return ERR_INFO_INVALID_MMCO_NUM;
686 }
687
688 return ERR_NONE;
689}
690static int32_t MMCOProcess (PWelsDecoderContext pCtx, PRefPic pRefPic, uint32_t uiMmcoType,
691 int32_t iShortFrameNum, uint32_t uiLongTermPicNum, int32_t iLongTermFrameIdx, int32_t iMaxLongTermFrameIdx) {
692 PPicture pPic = NULL;

Callers 1

WelsMarkAsRefFunction · 0.85

Calls 1

MMCOProcessFunction · 0.85

Tested by

no test coverage detected