ref: 02b08d278a9cb306afe90d60464eabf1ea1b070a
parent: 4469519baf134113495d46502ae9b26a93af521b
parent: 27da2b21bfbf3e2e08fb6ce48571b065283c7c47
author: volvet <[email protected]>
date: Thu Apr 3 14:15:58 EDT 2014
Merge pull request #623 from ruil2/enc_update add the condition branch for screen content Approved by Sijia Chen @ RBComments
--- a/codec/encoder/core/src/encoder_ext.cpp
+++ b/codec/encoder/core/src/encoder_ext.cpp
@@ -1314,7 +1314,11 @@
//End of Rate control module 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))
if ((*ppCtx)->pSvcParam->bEnableAdaptiveQuant) { //malloc mem
--- a/codec/encoder/core/src/ref_list_mgr_svc.cpp
+++ b/codec/encoder/core/src/ref_list_mgr_svc.cpp
@@ -707,6 +707,20 @@
pLtr->uiLtrMarkInterval = 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;
}
bool WelsBuildRefListScreen (void* pEncCtx, const int32_t iPOC, int32_t iBestLtrRefIdx) {
--- a/codec/encoder/core/src/wels_preprocess.cpp
+++ b/codec/encoder/core/src/wels_preprocess.cpp
@@ -279,7 +279,11 @@
++ i;
} 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;
++ iDlayerIndex;
} while (iDlayerIndex < kiDlayerCount);
@@ -363,12 +367,12 @@
AdaptiveQuantCalculation (pCtx->pVaa, pCurPic, pRefPic);
}
- if (pSvcParam->bEnableRc) {
- AnalyzePictureComplexity (pCtx, pCurPic, pRefPic, kiDidx, bCalculateBGD);
+ if(pSvcParam->iUsageType != SCREEN_CONTENT_REAL_TIME){
+ 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;
}