static int32_t MMCO (PWelsDecoderContext pCtx, PRefPicMarking pRefPicMarking) { PSps pSps = pCtx->pCurDqLayer->sLayerInfo.pSps; int32_t i = 0; int32_t iRet = ERR_NONE; for (i = 0; i < MAX_MMCO_COUNT && pRefPicMarking->sMmcoRef[i].uiMmcoType != MMCO_END; i++) { uint32_t uiMmcoType = pRefPicMarking->sMmcoRef[i].uiMmcoType; int32_t iShortFrameNum = (pCtx->iFrameNum - pRefPicMarking->sMmcoRef[i].iDiffOfPicNum) & (( 1 << pSps->uiLog2MaxFrameNum) - 1); uint32_t uiLongTermPicNum = pRefPicMarking->sMmcoRef[i].uiLongTermPicNum; int32_t iLongTermFrameIdx = pRefPicMarking->sMmcoRef[i].iLongTermFrameIdx; int32_t iMaxLongTermFrameIdx = pRefPicMarking->sMmcoRef[i].iMaxLongTermFrameIdx; if (uiMmcoType > MMCO_LONG) { return ERR_INFO_INVALID_MMCO_OPCODE_BASE; } iRet = MMCOProcess (pCtx, uiMmcoType, iShortFrameNum, uiLongTermPicNum, iLongTermFrameIdx, iMaxLongTermFrameIdx); if (iRet != ERR_NONE) { return iRet; } } if (i == MAX_MMCO_COUNT) { //although Rec does not handle this condition, we here prohibit too many MMCO op return ERR_INFO_INVALID_MMCO_NUM; } return ERR_NONE; }
static int32_t MMCO (PWelsDecoderContext pCtx, PRefPicMarking pRefPicMarking) { PSps pSps = pCtx->pCurDqLayer->sLayerInfo.pSps; int32_t i = 0; int32_t iRet = ERR_NONE; for (i = 0; pRefPicMarking->sMmcoRef[i].uiMmcoType != MMCO_END; i++) { uint32_t uiMmcoType = pRefPicMarking->sMmcoRef[i].uiMmcoType; int32_t iShortFrameNum = (pCtx->iFrameNum - pRefPicMarking->sMmcoRef[i].iDiffOfPicNum) & (( 1 << pSps->uiLog2MaxFrameNum) - 1); uint32_t uiLongTermPicNum = pRefPicMarking->sMmcoRef[i].uiLongTermPicNum; int32_t iLongTermFrameIdx = pRefPicMarking->sMmcoRef[i].iLongTermFrameIdx; int32_t iMaxLongTermFrameIdx = pRefPicMarking->sMmcoRef[i].iMaxLongTermFrameIdx; if (uiMmcoType > MMCO_LONG) { return ERR_INFO_INVALID_MMCO_OPCODE_BASE; } iRet = MMCOProcess (pCtx, uiMmcoType, iShortFrameNum, uiLongTermPicNum, iLongTermFrameIdx, iMaxLongTermFrameIdx); if (iRet != ERR_NONE) { return iRet; } } return ERR_NONE; }
static int32_t MMCOBase(PWelsDecoderContext pCtx,PRefBasePicMarking pRefPicBaseMarking) { PSps pSps = pCtx->pCurDqLayer->sLayerInfo.pSps; int32_t i = 0; int32_t iRet = ERR_NONE; for ( i = 0 ; pRefPicBaseMarking->mmco_base[i].uiMmcoType != MMCO_END; i++){ uint32_t uiMmcoType = pRefPicBaseMarking->mmco_base[i].uiMmcoType; int32_t iShortFrameNum = (pCtx->iFrameNum - pRefPicBaseMarking->mmco_base[i].uiDiffOfPicNums) &((1<<pSps->uiLog2MaxFrameNum)-1); uint32_t uiLongTermPicNum = pRefPicBaseMarking->mmco_base[i].uiLongTermPicNum; if ( uiMmcoType > MMCO_LONG2UNUSED) { return ERR_INFO_INVALID_MMCO_OPCODE_BASE; } iRet = MMCOProcess(pCtx,uiMmcoType,TRUE,iShortFrameNum,uiLongTermPicNum,0,0); if (iRet != ERR_NONE){ return iRet; } } return ERR_NONE; }