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

Function WelsBuildRefListScreen

codec/encoder/core/src/ref_list_mgr_svc.cpp:811–887  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

809}
810
811bool WelsBuildRefListScreen (sWelsEncCtx* pCtx, const int32_t iPOC, int32_t iBestLtrRefIdx) {
812 SRefList* pRefList = pCtx->ppRefPicListExt[pCtx->uiDependencyId];
813 SWelsSvcCodingParam* pParam = pCtx->pSvcParam;
814 SVAAFrameInfoExt* pVaaExt = static_cast<SVAAFrameInfoExt*> (pCtx->pVaa);
815 const int32_t iNumRef = pParam->iNumRefFrame;
816 SSpatialLayerInternal* pParamD = &pCtx->pSvcParam->sDependencyLayers[pCtx->uiDependencyId];
817 pCtx->iNumRef0 = 0;
818
819 if (pCtx->eSliceType != I_SLICE) {
820 int iLtrRefIdx = 0;
821 SPicture* pRefOri = NULL;
822 for (int idx = 0; idx < pVaaExt->iNumOfAvailableRef; idx++) {
823 iLtrRefIdx = pCtx->pVpp->GetRefFrameInfo (idx, pCtx->bCurFrameMarkedAsSceneLtr, pRefOri);
824 if (iLtrRefIdx >= 0 && iLtrRefIdx <= pParam->iLTRRefNum) {
825 SPicture* pRefPic = pRefList->pLongRefList[iLtrRefIdx];
826 if (pRefPic != NULL && pRefPic->bUsedAsRef && pRefPic->bIsLongRef) {
827 if (pRefPic->uiTemporalId <= pCtx->uiTemporalId && (!pCtx->bCurFrameMarkedAsSceneLtr || pRefPic->bIsSceneLTR)) {
828 pCtx->pCurDqLayer->pRefOri[pCtx->iNumRef0] = pRefOri;
829 pCtx->pRefList0[pCtx->iNumRef0++] = pRefPic;
830 WelsLog (& (pCtx->sLogCtx), WELS_LOG_DEBUG,
831 "WelsBuildRefListScreen(), current iFrameNum = %d, current Tid = %d, ref iFrameNum = %d, ref uiTemporalId = %d, ref is Scene LTR = %d, LTR count = %d,iNumRef = %d",
832 pParamD->iFrameNum, pCtx->uiTemporalId,
833 pRefPic->iFrameNum, pRefPic->uiTemporalId, pRefPic->bIsSceneLTR,
834 pRefList->uiLongRefCount, iNumRef);
835 }
836 }
837 } else {
838 for (int32_t i = iNumRef ; i >= 0 ; --i) {
839 if (pRefList->pLongRefList[i] == NULL) {
840 continue;
841 } else if (pRefList->pLongRefList[i]->uiTemporalId == 0
842 || pRefList->pLongRefList[i]->uiTemporalId < pCtx->uiTemporalId) {
843 pCtx->pCurDqLayer->pRefOri[pCtx->iNumRef0] = pRefOri;
844 pCtx->pRefList0[pCtx->iNumRef0++] = pRefList->pLongRefList[i];
845 WelsLog (& (pCtx->sLogCtx), WELS_LOG_DEBUG,
846 "WelsBuildRefListScreen(), ref !current iFrameNum = %d, ref iFrameNum = %d,LTR number = %d",
847 pParamD->iFrameNum, pCtx->pRefList0[pCtx->iNumRef0 - 1]->iFrameNum, pRefList->uiLongRefCount);
848 break;
849 }
850 }
851 }
852 } // end of (int idx = 0; idx < pVaaExt->iNumOfAvailableRef; idx++)
853
854 WelsLog (& (pCtx->sLogCtx), WELS_LOG_DEBUG,
855 "WelsBuildRefListScreen(), CurrentFramePoc=%d, isLTR=%d", iPOC, pCtx->bCurFrameMarkedAsSceneLtr);
856 for (int j = 0; j < iNumRef; j++) {
857 SPicture* pARefPicture = pRefList->pLongRefList[j];
858 if (pARefPicture != NULL) {
859 WelsLog (& (pCtx->sLogCtx), WELS_LOG_DEBUG,
860 "WelsBuildRefListScreen()\tRefLot[%d]: iPoc=%d, iPictureType=%d, bUsedAsRef=%d, bIsLongRef=%d, bIsSceneLTR=%d, uiTemporalId=%d, iFrameNum=%d, iMarkFrameNum=%d, iLongTermPicNum=%d, uiRecieveConfirmed=%d",
861 j,
862 pARefPicture->iFramePoc,
863 pARefPicture->iPictureType,
864 pARefPicture->bUsedAsRef,
865 pARefPicture->bIsLongRef,
866 pARefPicture->bIsSceneLTR,
867 pARefPicture->uiTemporalId,
868 pARefPicture->iFrameNum,

Callers 1

BuildRefListMethod · 0.85

Calls 4

WelsLogFunction · 0.85
WelsResetRefListFunction · 0.85
ResetLtrStateFunction · 0.85
GetRefFrameInfoMethod · 0.80

Tested by

no test coverage detected