add ref-original frame assigment
This commit is contained in:
@@ -103,7 +103,7 @@ struct TagDqLayer {
|
||||
|
||||
SPicture* pRefPic; // reference picture pointer
|
||||
SPicture* pDecPic; // reconstruction picture pointer for layer
|
||||
SPicture* pRefOri;
|
||||
SPicture* pRefOri[MAX_REF_PIC_COUNT];
|
||||
|
||||
SSliceCtx* pSliceEncCtx; // current slice context
|
||||
|
||||
|
||||
@@ -126,7 +126,7 @@ class CWelsPreProcess {
|
||||
int32_t AnalyzeSpatialPic (sWelsEncCtx* pEncCtx, const int32_t kiDIdx);
|
||||
int32_t UpdateSpatialPictures (sWelsEncCtx* pEncCtx, SWelsSvcCodingParam* pParam, const int8_t iCurTid,
|
||||
const int32_t d_idx);
|
||||
int32_t GetRefCandidateLtrIndex (int32_t iRefIdx);
|
||||
int32_t GetRefFrameInfo (int32_t iRefIdx,SPicture *&pRefOri);
|
||||
void AnalyzePictureComplexity (sWelsEncCtx* pCtx, SPicture* pCurPicture, SPicture* pRefPicture,
|
||||
const int32_t kiDependencyId, const bool kbCalculateBGD);
|
||||
|
||||
|
||||
@@ -763,12 +763,14 @@ bool WelsBuildRefListScreen (void* pEncCtx, const int32_t iPOC, int32_t iBestLtr
|
||||
|
||||
if (pCtx->eSliceType != I_SLICE) {
|
||||
int iLtrRefIdx = 0;
|
||||
SPicture *pRefOri = NULL;
|
||||
for (int idx = 0; idx < pVaaExt->iNumOfAvailableRef; idx++) {
|
||||
iLtrRefIdx = pCtx->pVpp->GetRefCandidateLtrIndex (idx);
|
||||
iLtrRefIdx = pCtx->pVpp->GetRefFrameInfo(idx,pRefOri);
|
||||
if (iLtrRefIdx >= 0 && iLtrRefIdx <= pParam->iLTRRefNum) {
|
||||
SPicture* pRefPic = pRefList->pLongRefList[iLtrRefIdx];
|
||||
if (pRefPic != NULL && pRefPic->bUsedAsRef && pRefPic->bIsLongRef) {
|
||||
if (pRefPic->uiTemporalId <= pCtx->uiTemporalId && (!pCtx->bCurFrameMarkedAsSceneLtr || pRefPic->bIsSceneLTR)) {
|
||||
pCtx->pCurDqLayer->pRefOri[pCtx->iNumRef0] = pRefOri;
|
||||
pCtx->pRefList0[pCtx->iNumRef0++] = pRefPic;
|
||||
WelsLog (pCtx, WELS_LOG_INFO,
|
||||
"WelsBuildRefListScreen(), ref !current iFrameNum = %d, ref iFrameNum = %d,LTR number = %d,iNumRef = %d ref is Scene LTR = %d\n",
|
||||
@@ -785,6 +787,7 @@ bool WelsBuildRefListScreen (void* pEncCtx, const int32_t iPOC, int32_t iBestLtr
|
||||
continue;
|
||||
} else if (pRefList->pLongRefList[i]->uiTemporalId == 0
|
||||
|| pRefList->pLongRefList[i]->uiTemporalId < pCtx->uiTemporalId) {
|
||||
pCtx->pCurDqLayer->pRefOri[pCtx->iNumRef0] = pRefOri;
|
||||
pCtx->pRefList0[pCtx->iNumRef0++] = pRefList->pLongRefList[i];
|
||||
WelsLog (pCtx, WELS_LOG_INFO,
|
||||
"WelsBuildRefListScreen(), ref !current iFrameNum = %d, ref iFrameNum = %d,LTR number = %d\n",
|
||||
|
||||
@@ -194,7 +194,7 @@ bool JudgeStaticSkip (sWelsEncCtx* pEncCtx, SMB* pCurMb, SMbCache* pMbCache, SWe
|
||||
if (bTryStaticSkip) {
|
||||
int32_t iStrideUV, iOffsetUV;
|
||||
SWelsFuncPtrList* pFunc = pEncCtx->pFuncList;
|
||||
SPicture* pRefOri = pCurDqLayer->pRefOri;
|
||||
SPicture* pRefOri = pCurDqLayer->pRefOri[0];
|
||||
if (pRefOri != NULL) {
|
||||
iStrideUV = pCurDqLayer->iEncStride[1];
|
||||
iOffsetUV = (kiMbX + kiMbY * iStrideUV) << 3;
|
||||
@@ -229,7 +229,7 @@ bool JudgeScrollSkip (sWelsEncCtx* pEncCtx, SMB* pCurMb, SMbCache* pMbCache, SWe
|
||||
if (bTryScrollSkip) {
|
||||
int32_t iStrideUV, iOffsetUV;
|
||||
SWelsFuncPtrList* pFunc = pEncCtx->pFuncList;
|
||||
SPicture* pRefOri = pCurDqLayer->pRefOri;
|
||||
SPicture* pRefOri = pCurDqLayer->pRefOri[0];
|
||||
if (pRefOri != NULL) {
|
||||
int32_t iScrollMvX = pVaaExt->sScrollDetectInfo.iScrollMvX;
|
||||
int32_t iScrollMvY = pVaaExt->sScrollDetectInfo.iScrollMvY;
|
||||
|
||||
@@ -1078,11 +1078,12 @@ ESceneChangeIdc CWelsPreProcess::DetectSceneChangeScreen (sWelsEncCtx* pCtx, SPi
|
||||
return static_cast<ESceneChangeIdc> (iVaaFrameSceneChangeIdc);
|
||||
}
|
||||
|
||||
int32_t CWelsPreProcess::GetRefCandidateLtrIndex (int32_t iRefIdx) {
|
||||
int32_t CWelsPreProcess::GetRefFrameInfo(int32_t iRefIdx,SPicture *&pRefOri) {
|
||||
const int32_t iTargetDid = m_pEncCtx->pSvcParam->iSpatialLayerNum - 1;
|
||||
SVAAFrameInfoExt* pVaaExt = static_cast<SVAAFrameInfoExt*> (m_pEncCtx->pVaa);
|
||||
SRefInfoParam* BestRefCandidateParam = & (pVaaExt->sVaaStrBestRefCandidate[iRefIdx]);
|
||||
int32_t iLtrRefIdx = m_pSpatialPic[iTargetDid][BestRefCandidateParam->iSrcListIdx]->iLongTermPicNum;
|
||||
pRefOri = m_pSpatialPic[iTargetDid][BestRefCandidateParam->iSrcListIdx];
|
||||
return iLtrRefIdx;
|
||||
}
|
||||
void CWelsPreProcess::Padding (uint8_t* pSrcY, uint8_t* pSrcU, uint8_t* pSrcV, int32_t iStrideY, int32_t iStrideUV,
|
||||
|
||||
Reference in New Issue
Block a user