Merge pull request #623 from ruil2/enc_update

add the condition branch for screen content

Approved by Sijia Chen @ RBComments
This commit is contained in:
volvet
2014-04-03 18:15:58 -07:00
3 changed files with 29 additions and 7 deletions

View File

@@ -1314,7 +1314,11 @@ int32_t RequestMemorySvc (sWelsEncCtx** ppCtx) {
//End of Rate control module memory allocation //End of Rate control module memory allocation
//pVaa memory allocation //pVaa memory allocation
(*ppCtx)->pVaa = (SVAAFrameInfo*)pMa->WelsMallocz (sizeof (SVAAFrameInfo), "pVaa"); if(pParam->iUsageType == SCREEN_CONTENT_REAL_TIME)
(*ppCtx)->pVaa = (SVAAFrameInfoExt*)pMa->WelsMallocz (sizeof (SVAAFrameInfoExt), "pVaa");
else
(*ppCtx)->pVaa = (SVAAFrameInfo*)pMa->WelsMallocz (sizeof (SVAAFrameInfo), "pVaa");
WELS_VERIFY_RETURN_PROC_IF (1, (NULL == (*ppCtx)->pVaa), FreeMemorySvc (ppCtx)) WELS_VERIFY_RETURN_PROC_IF (1, (NULL == (*ppCtx)->pVaa), FreeMemorySvc (ppCtx))
if ((*ppCtx)->pSvcParam->bEnableAdaptiveQuant) { //malloc mem if ((*ppCtx)->pSvcParam->bEnableAdaptiveQuant) { //malloc mem

View File

@@ -707,6 +707,20 @@ bool WelsUpdateRefListScreen (void* pEncCtx) {
pLtr->uiLtrMarkInterval = 0; pLtr->uiLtrMarkInterval = 0;
pCtx->pVaa->uiValidLongTermPicIdx = 0; pCtx->pVaa->uiValidLongTermPicIdx = 0;
} }
//update info in src list
if (pCtx->pEncPic) {
pCtx->pEncPic->iPictureType = pCtx->pDecPic->iPictureType;
pCtx->pEncPic->iFramePoc = pCtx->pDecPic->iFramePoc;
pCtx->pEncPic->iFrameNum = pCtx->pDecPic->iFrameNum;
pCtx->pEncPic->uiSpatialId = pCtx->pDecPic->uiSpatialId;
pCtx->pEncPic->uiTemporalId = pCtx->pDecPic->uiTemporalId;
pCtx->pEncPic->iLongTermPicNum = pCtx->pDecPic->iLongTermPicNum;
pCtx->pEncPic->bUsedAsRef = pCtx->pDecPic->bUsedAsRef;
pCtx->pEncPic->bIsLongRef = pCtx->pDecPic->bIsLongRef;
pCtx->pEncPic->bIsSceneLTR = pCtx->pDecPic->bIsSceneLTR;
pCtx->pEncPic->iFrameAverageQp = pCtx->pDecPic->iFrameAverageQp;
}
return true; return true;
} }
bool WelsBuildRefListScreen (void* pEncCtx, const int32_t iPOC, int32_t iBestLtrRefIdx) { bool WelsBuildRefListScreen (void* pEncCtx, const int32_t iPOC, int32_t iBestLtrRefIdx) {

View File

@@ -279,7 +279,11 @@ int32_t CWelsPreProcess::AllocSpatialPictures (sWelsEncCtx* pCtx, SWelsSvcCoding
++ i; ++ i;
} while (i < kuiRefNumInTemporal); } while (i < kuiRefNumInTemporal);
m_uiSpatialLayersInTemporal[iDlayerIndex] = kuiLayerInTemporal; if(pParam->iUsageType == SCREEN_CONTENT_REAL_TIME)
m_uiSpatialLayersInTemporal[iDlayerIndex] = 1;
else
m_uiSpatialLayersInTemporal[iDlayerIndex] = kuiLayerInTemporal;
m_uiSpatialPicNum[iDlayerIndex] = kuiRefNumInTemporal; m_uiSpatialPicNum[iDlayerIndex] = kuiRefNumInTemporal;
++ iDlayerIndex; ++ iDlayerIndex;
} while (iDlayerIndex < kiDlayerCount); } while (iDlayerIndex < kiDlayerCount);
@@ -363,12 +367,12 @@ int32_t CWelsPreProcess::AnalyzeSpatialPic (sWelsEncCtx* pCtx, const int32_t kiD
AdaptiveQuantCalculation (pCtx->pVaa, pCurPic, pRefPic); AdaptiveQuantCalculation (pCtx->pVaa, pCurPic, pRefPic);
} }
if (pSvcParam->bEnableRc) { if(pSvcParam->iUsageType != SCREEN_CONTENT_REAL_TIME){
AnalyzePictureComplexity (pCtx, pCurPic, pRefPic, kiDidx, bCalculateBGD); if (pSvcParam->bEnableRc) {
AnalyzePictureComplexity (pCtx, pCurPic, pRefPic, kiDidx, bCalculateBGD);
}
WelsExchangeSpatialPictures (&m_pLastSpatialPicture[kiDidx][1], &m_pLastSpatialPicture[kiDidx][0]);
} }
WelsExchangeSpatialPictures (&m_pLastSpatialPicture[kiDidx][1], &m_pLastSpatialPicture[kiDidx][0]);
return 0; return 0;
} }