Merge pull request #1356 from ruil2/memory
refine memory tag in order to trace issues related memory
This commit is contained in:
commit
399ca33284
@ -1254,7 +1254,7 @@ int32_t RequestMemoryVaaScreen (SVAAFrameInfo* pVaa, CMemoryAlign* pMa, const
|
||||
void ReleaseMemoryVaaScreen (SVAAFrameInfo* pVaa, CMemoryAlign* pMa, const int32_t iNumRef) {
|
||||
SVAAFrameInfoExt* pVaaExt = static_cast<SVAAFrameInfoExt*> (pVaa);
|
||||
if (pVaaExt && pMa && pVaaExt->pVaaBlockStaticIdc[0]) {
|
||||
pMa->WelsFree (pVaaExt->pVaaBlockStaticIdc[0], "pVaa->pVaaBlockStaticIdc");
|
||||
pMa->WelsFree (pVaaExt->pVaaBlockStaticIdc[0], "pVaa->pVaaBlockStaticIdc[0]");
|
||||
|
||||
for (int32_t idx = 0; idx < iNumRef; idx++) {
|
||||
pVaaExt->pVaaBlockStaticIdc[idx] = NULL;
|
||||
@ -1470,7 +1470,7 @@ int32_t RequestMemorySvc (sWelsEncCtx** ppCtx) {
|
||||
}
|
||||
|
||||
(*ppCtx)->pVaa->pVaaBackgroundMbFlag = (int8_t*)pMa->WelsMallocz (iCountMaxMbNum * sizeof (int8_t),
|
||||
"pVaa->vaa_skip_mb_flag");
|
||||
"pVaa->pVaaBackgroundMbFlag");
|
||||
WELS_VERIFY_RETURN_PROC_IF (1, (NULL == (*ppCtx)->pVaa->pVaaBackgroundMbFlag), FreeMemorySvc (ppCtx))
|
||||
|
||||
(*ppCtx)->pVaa->sVaaCalcInfo.pSad8x8 = static_cast<int32_t (*)[4]>
|
||||
@ -1488,10 +1488,10 @@ int32_t RequestMemorySvc (sWelsEncCtx** ppCtx) {
|
||||
|
||||
if ((*ppCtx)->pSvcParam->bEnableBackgroundDetection) { //BGD control
|
||||
(*ppCtx)->pVaa->sVaaCalcInfo.pSumOfDiff8x8 = static_cast<int32_t (*)[4]>
|
||||
(pMa->WelsMallocz (iCountMaxMbNum * 4 * sizeof (int32_t), "pVaa->sVaaCalcInfo.sd_16x16"));
|
||||
(pMa->WelsMallocz (iCountMaxMbNum * 4 * sizeof (int32_t), "pVaa->sVaaCalcInfo.pSumOfDiff8x8"));
|
||||
WELS_VERIFY_RETURN_PROC_IF (1, (NULL == (*ppCtx)->pVaa->sVaaCalcInfo.pSumOfDiff8x8), FreeMemorySvc (ppCtx))
|
||||
(*ppCtx)->pVaa->sVaaCalcInfo.pMad8x8 = static_cast<uint8_t (*)[4]>
|
||||
(pMa->WelsMallocz (iCountMaxMbNum * 4 * sizeof (uint8_t), "pVaa->sVaaCalcInfo.mad_16x16"));
|
||||
(pMa->WelsMallocz (iCountMaxMbNum * 4 * sizeof (uint8_t), "pVaa->sVaaCalcInfo.pMad8x8"));
|
||||
WELS_VERIFY_RETURN_PROC_IF (1, (NULL == (*ppCtx)->pVaa->sVaaCalcInfo.pMad8x8), FreeMemorySvc (ppCtx))
|
||||
}
|
||||
|
||||
|
@ -98,7 +98,7 @@ SPicture* AllocPicture (CMemoryAlign* pMa, const int32_t kiWidth , const int32_t
|
||||
pPic->uiRefMbType = (uint32_t*)pMa->WelsMallocz (kuiCountMbNum * sizeof (uint32_t), "pPic->uiRefMbType");
|
||||
WELS_VERIFY_RETURN_PROC_IF (NULL, NULL == pPic->uiRefMbType, FreePicture (pMa, &pPic));
|
||||
|
||||
pPic->pRefMbQp = (uint8_t*)pMa->WelsMallocz (kuiCountMbNum * sizeof (uint8_t), "pPic->bgd_mb_qp");
|
||||
pPic->pRefMbQp = (uint8_t*)pMa->WelsMallocz (kuiCountMbNum * sizeof (uint8_t), "pPic->pRefMbQp");
|
||||
WELS_VERIFY_RETURN_PROC_IF (NULL, NULL == pPic->pRefMbQp, FreePicture (pMa, &pPic));
|
||||
|
||||
pPic->sMvList = static_cast<SMVUnitXY*> (pMa->WelsMallocz (kuiCountMbNum * sizeof (SMVUnitXY),
|
||||
@ -152,11 +152,11 @@ void FreePicture (CMemoryAlign* pMa, SPicture** ppPic) {
|
||||
pPic->iMarkFrameNum = -1;
|
||||
|
||||
if (pPic->uiRefMbType) {
|
||||
pMa->WelsFree (pPic->uiRefMbType, "pPic->bgd_mb_type");
|
||||
pMa->WelsFree (pPic->uiRefMbType, "pPic->uiRefMbType");
|
||||
pPic->uiRefMbType = NULL;
|
||||
}
|
||||
if (pPic->pRefMbQp) {
|
||||
pMa->WelsFree (pPic->pRefMbQp, "pPic->bgd_mb_qp");
|
||||
pMa->WelsFree (pPic->pRefMbQp, "pPic->pRefMbQp");
|
||||
pPic->pRefMbQp = NULL;
|
||||
}
|
||||
|
||||
|
@ -70,7 +70,7 @@ void RcInitLayerMemory (SWelsSvcRc* pWelsSvcRc, CMemoryAlign* pMA, const int32_t
|
||||
const int32_t kiGomSizeD = kiGomSize * sizeof (double);
|
||||
const int32_t kiGomSizeI = kiGomSize * sizeof (int32_t);
|
||||
const int32_t kiLayerRcSize = kiGomSizeD + (kiGomSizeI * 3) + sizeof (SRCTemporal) * kiMaxTl;
|
||||
uint8_t* pBaseMem = (uint8_t*)pMA->WelsMalloc (kiLayerRcSize, "rc_layer_memory");
|
||||
uint8_t* pBaseMem = (uint8_t*)pMA->WelsMalloc (kiLayerRcSize, "pWelsSvcRc->pTemporalOverRc");
|
||||
|
||||
if (NULL == pBaseMem)
|
||||
return;
|
||||
@ -94,7 +94,7 @@ void RcFreeLayerMemory (SWelsSvcRc* pWelsSvcRc, CMemoryAlign* pMA) {
|
||||
pWelsSvcRc->pSlicingOverRc = NULL;
|
||||
}
|
||||
if (pWelsSvcRc != NULL && pWelsSvcRc->pTemporalOverRc != NULL) {
|
||||
pMA->WelsFree (pWelsSvcRc->pTemporalOverRc, "rc_layer_memory");
|
||||
pMA->WelsFree (pWelsSvcRc->pTemporalOverRc, "pWelsSvcRc->pTemporalOverRc");
|
||||
pWelsSvcRc->pTemporalOverRc = NULL;
|
||||
pWelsSvcRc->pGomComplexity = NULL;
|
||||
pWelsSvcRc->pGomForegroundBlockNum = NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user