History

fix low memory crash issue

huili2 committed 9 years ago

Commit d1c0a931 parent 48c2fe116 files · +401 −386Browse files

Showing the changes to codec/encoder/core/src/encoder_ext.cpp (1 of 16 files). Show all

Unified · Split

codec/encoder/core/src/encoder_ext.cpp+39−50
@@ -907,10 +907,10 @@ int32_t InitMbListD (sWelsEncCtx** ppCtx) { · 906 unmodified lines
907907
908908 (*ppCtx)->ppMbListD = static_cast<SMB**> ((*ppCtx)->pMemAlign->WelsMallocz (iNumDlayer * sizeof (SMB*), "ppMbListD"));
909909 (*ppCtx)->ppMbListD[0] = NULL;
910− WELS_VERIFY_RETURN_PROC_IF (1, (*ppCtx)->ppMbListD == NULL, FreeMemorySvc (ppCtx));
910+ WELS_VERIFY_RETURN_IF (1, (*ppCtx)->ppMbListD == NULL)
911911 (*ppCtx)->ppMbListD[0] = static_cast<SMB*> ((*ppCtx)->pMemAlign->WelsMallocz (iOverallMbNum * sizeof (SMB),
912912 "ppMbListD[0]"));
913− WELS_VERIFY_RETURN_PROC_IF (1, (*ppCtx)->ppMbListD[0] == NULL, FreeMemorySvc (ppCtx));
913+ WELS_VERIFY_RETURN_IF (1, (*ppCtx)->ppMbListD[0] == NULL)
914914 (*ppCtx)->ppDqLayerList[0]->sMbDataP = (*ppCtx)->ppMbListD[0];
915915 InitMbInfo (*ppCtx, (*ppCtx)->ppMbListD[0], (*ppCtx)->ppDqLayerList[0], 0, iMbSize[iNumDlayer - 1]);
916916 for (i = 1; i < iNumDlayer; i++) {
@@ -1166,7 +1166,7 @@ static inline int32_t InitDqLayers (sWelsEncCtx** ppCtx, SExistingParasetList* p · 249 unmodified lines
11661166
11671167 // pRef list
11681168 pRefList = (SRefList*)pMa->WelsMallocz (sizeof (SRefList), "pRefList");
1169− WELS_VERIFY_RETURN_PROC_IF (1, (NULL == pRefList), FreeMemorySvc (ppCtx))
1169+ WELS_VERIFY_RETURN_IF (1, (NULL == pRefList))
11701170 do {
11711171 pRefList->pRef[i] = AllocPicture (pMa, kiWidth, kiHeight, true,
11721172 (iDlayerIndex == iDlayerCount - 1) ? kiNeedFeatureStorage : 0); // to use actual size of current layer
@@ -1255,11 +1255,11 @@ static inline int32_t InitDqLayers (sWelsEncCtx** ppCtx, SExistingParasetList* p · 82 unmodified lines
12551255 if (kiNeedFeatureStorage && iDlayerIndex == iDlayerCount - 1) {
12561256 pDqLayer->pFeatureSearchPreparation = static_cast<SFeatureSearchPreparation*> (pMa->WelsMallocz (sizeof (
12571257 SFeatureSearchPreparation), "pFeatureSearchPreparation"));
1258− WELS_VERIFY_RETURN_PROC_IF (1, NULL == pDqLayer->pFeatureSearchPreparation, FreeMemorySvc (ppCtx));
1258+ WELS_VERIFY_RETURN_IF (1, NULL == pDqLayer->pFeatureSearchPreparation)
12591259 int32_t iReturn = RequestFeatureSearchPreparation (pMa, pDlayer->iVideoWidth, pDlayer->iVideoHeight,
12601260 kiNeedFeatureStorage,
12611261 pDqLayer->pFeatureSearchPreparation);
1262− WELS_VERIFY_RETURN_PROC_IF (1, ENC_RETURN_SUCCESS != iReturn, FreeMemorySvc (ppCtx));
1262+ WELS_VERIFY_RETURN_IF (1, ENC_RETURN_SUCCESS != iReturn)
12631263 } else {
12641264 pDqLayer->pFeatureSearchPreparation = NULL;
12651265 }
@@ -1270,15 +1270,15 @@ static inline int32_t InitDqLayers (sWelsEncCtx** ppCtx, SExistingParasetList* p · 4 unmodified lines
12701270 }
12711271
12721272 // for dynamically malloc for parameter sets memory instead of maximal items for standard to reduce size, 3/18/2010
1273− WELS_VERIFY_RETURN_PROC_IF (1, (NULL == (*ppCtx)->pFuncList), FreeMemorySvc (ppCtx))
1274− WELS_VERIFY_RETURN_PROC_IF (1, (NULL == (*ppCtx)->pFuncList->pParametersetStrategy), FreeMemorySvc (ppCtx))
1273+ WELS_VERIFY_RETURN_IF (1, (NULL == (*ppCtx)->pFuncList))
1274+ WELS_VERIFY_RETURN_IF (1, (NULL == (*ppCtx)->pFuncList->pParametersetStrategy))
12751275 const int32_t kiNeededSpsNum = (*ppCtx)->pFuncList->pParametersetStrategy->GetNeededSpsNum();
12761276 const int32_t kiNeededSubsetSpsNum = (*ppCtx)->pFuncList->pParametersetStrategy->GetNeededSubsetSpsNum();
12771277 (*ppCtx)->pSpsArray = (SWelsSPS*)pMa->WelsMallocz (kiNeededSpsNum * sizeof (SWelsSPS), "pSpsArray");
1278− WELS_VERIFY_RETURN_PROC_IF (1, (NULL == (*ppCtx)->pSpsArray), FreeMemorySvc (ppCtx))
1278+ WELS_VERIFY_RETURN_IF (1, (NULL == (*ppCtx)->pSpsArray))
12791279 if (kiNeededSubsetSpsNum > 0) {
12801280 (*ppCtx)->pSubsetArray = (SSubsetSps*)pMa->WelsMallocz (kiNeededSubsetSpsNum * sizeof (SSubsetSps), "pSubsetArray");
1281− WELS_VERIFY_RETURN_PROC_IF (1, (NULL == (*ppCtx)->pSubsetArray), FreeMemorySvc (ppCtx))
1281+ WELS_VERIFY_RETURN_IF (1, (NULL == (*ppCtx)->pSubsetArray))
12821282 } else {
12831283 (*ppCtx)->pSubsetArray = NULL;
12841284 }
@@ -1286,14 +1286,14 @@ static inline int32_t InitDqLayers (sWelsEncCtx** ppCtx, SExistingParasetList* p · 1 unmodified line
12861286 // PPS
12871287 const int32_t kiNeededPpsNum = (*ppCtx)->pFuncList->pParametersetStrategy->GetNeededPpsNum();
12881288 (*ppCtx)->pPPSArray = (SWelsPPS*)pMa->WelsMallocz (kiNeededPpsNum * sizeof (SWelsPPS), "pPPSArray");
1289− WELS_VERIFY_RETURN_PROC_IF (1, (NULL == (*ppCtx)->pPPSArray), FreeMemorySvc (ppCtx))
1289+ WELS_VERIFY_RETURN_IF (1, (NULL == (*ppCtx)->pPPSArray))
12901290
12911291 (*ppCtx)->pFuncList->pParametersetStrategy->LoadPrevious (pExistingParasetList, (*ppCtx)->pSpsArray,
12921292 (*ppCtx)->pSubsetArray, (*ppCtx)->pPPSArray);
12931293
12941294
12951295 (*ppCtx)->pDqIdcMap = (SDqIdc*)pMa->WelsMallocz (iDlayerCount * sizeof (SDqIdc), "pDqIdcMap");
1296− WELS_VERIFY_RETURN_PROC_IF (1, (NULL == (*ppCtx)->pDqIdcMap), FreeMemorySvc (ppCtx))
1296+ WELS_VERIFY_RETURN_IF (1, (NULL == (*ppCtx)->pDqIdcMap))
12971297
12981298 iDlayerIndex = 0;
12991299 while (iDlayerIndex < iDlayerCount) {
@@ -1328,7 +1328,6 @@ static inline int32_t InitDqLayers (sWelsEncCtx** ppCtx, SExistingParasetList* p · 28 unmodified lines
13281328 pPps);
13291329 if (iResult) {
13301330 WelsLog (& (*ppCtx)->sLogCtx, WELS_LOG_WARNING, "InitDqLayers(), InitSlicePEncCtx failed(%d)!", iResult);
1331− FreeMemorySvc (ppCtx);
13321331 return iResult;
13331332 }
13341333 }
@@ -1682,7 +1681,6 @@ int32_t RequestMemorySvc (sWelsEncCtx** ppCtx, SExistingParasetList* pExistingPa · 347 unmodified lines
16821681 if (kiNumDependencyLayers < 1 || kiNumDependencyLayers > MAX_DEPENDENCY_LAYER) {
16831682 WelsLog (& (*ppCtx)->sLogCtx, WELS_LOG_WARNING, "RequestMemorySvc() failed due to invalid iNumDependencyLayers(%d)!",
16841683 kiNumDependencyLayers);
1685− FreeMemorySvc (ppCtx);
16861684 return 1;
16871685 }
16881686
@@ -1690,7 +1688,6 @@ int32_t RequestMemorySvc (sWelsEncCtx** ppCtx, SExistingParasetList* pExistingPa · 1 unmodified line
16901688 WelsLog (& (*ppCtx)->sLogCtx, WELS_LOG_WARNING,
16911689 "RequestMemorySvc() failed due to invalid uiIntraPeriod(%d) (=multipler of uiGopSize(%d)!",
16921690 pParam->uiIntraPeriod, pParam->uiGopSize);
1693− FreeMemorySvc (ppCtx);
16941691 return 1;
16951692 }
16961693
@@ -1702,7 +1699,6 @@ int32_t RequestMemorySvc (sWelsEncCtx** ppCtx, SExistingParasetList* pExistingPa · 5 unmodified lines
17021699 iResult = AcquireLayersNals (ppCtx, pParam, &iCountLayers, &iCountNals);
17031700 if (iResult) {
17041701 WelsLog (& (*ppCtx)->sLogCtx, WELS_LOG_WARNING, "RequestMemorySvc(), AcquireLayersNals failed(%d)!", iResult);
1705− FreeMemorySvc (ppCtx);
17061702 return 1;
17071703 }
17081704
@@ -1755,21 +1751,20 @@ int32_t RequestMemorySvc (sWelsEncCtx** ppCtx, SExistingParasetList* pExistingPa · 46 unmodified lines
17551751
17561752 // Output
17571753 (*ppCtx)->pOut = (SWelsEncoderOutput*)pMa->WelsMallocz (sizeof (SWelsEncoderOutput), "SWelsEncoderOutput");
1758− WELS_VERIFY_RETURN_PROC_IF (1, (NULL == (*ppCtx)->pOut), FreeMemorySvc (ppCtx))
1754+ WELS_VERIFY_RETURN_IF (1, (NULL == (*ppCtx)->pOut))
17591755 (*ppCtx)->pOut->pBsBuffer = (uint8_t*)pMa->WelsMallocz (iCountBsLen, "pOut->pBsBuffer");
1760− WELS_VERIFY_RETURN_PROC_IF (1, (NULL == (*ppCtx)->pOut->pBsBuffer), FreeMemorySvc (ppCtx))
1756+ WELS_VERIFY_RETURN_IF (1, (NULL == (*ppCtx)->pOut->pBsBuffer))
17611757 (*ppCtx)->pOut->uiSize = iCountBsLen;
17621758 (*ppCtx)->pOut->sNalList = (SWelsNalRaw*)pMa->WelsMallocz (iCountNals * sizeof (SWelsNalRaw), "pOut->sNalList");
1763− WELS_VERIFY_RETURN_PROC_IF (1, (NULL == (*ppCtx)->pOut->sNalList), FreeMemorySvc (ppCtx))
1759+ WELS_VERIFY_RETURN_IF (1, (NULL == (*ppCtx)->pOut->sNalList))
17641760 (*ppCtx)->pOut->pNalLen = (int32_t*)pMa->WelsMallocz (iCountNals * sizeof (int32_t), "pOut->pNalLen");
1765− WELS_VERIFY_RETURN_PROC_IF (1, (NULL == (*ppCtx)->pOut->pNalLen), FreeMemorySvc (ppCtx))
1761+ WELS_VERIFY_RETURN_IF (1, (NULL == (*ppCtx)->pOut->pNalLen))
17661762 (*ppCtx)->pOut->iCountNals = iCountNals;
17671763 (*ppCtx)->pOut->iNalIndex = 0;
17681764 (*ppCtx)->pOut->iLayerBsIndex = 0;
17691765
1770−
17711766 (*ppCtx)->pFrameBs = (uint8_t*)pMa->WelsMalloc (iTotalLength, "pFrameBs");
1772− WELS_VERIFY_RETURN_PROC_IF (1, (NULL == (*ppCtx)->pFrameBs), FreeMemorySvc (ppCtx))
1767+ WELS_VERIFY_RETURN_IF (1, (NULL == (*ppCtx)->pFrameBs))
17731768 (*ppCtx)->iFrameBsSize = iTotalLength;
17741769 (*ppCtx)->iPosBsBuffer = 0;
17751770
@@ -1777,45 +1772,44 @@ int32_t RequestMemorySvc (sWelsEncCtx** ppCtx, SExistingParasetList* pExistingPa · 1 unmodified line
17771772 if (bDynamicSlice && pParam->iEntropyCodingModeFlag) {
17781773 for (int32_t iIdx = 0; iIdx < MAX_THREADS_NUM; iIdx++) {
17791774 (*ppCtx)->pDynamicBsBuffer[iIdx] = (uint8_t*)pMa->WelsMalloc (iMaxSliceBufferSize, "DynamicSliceBs");
1780− WELS_VERIFY_RETURN_PROC_IF (1, (NULL == (*ppCtx)->pDynamicBsBuffer[iIdx]), FreeMemorySvc (ppCtx))
1775+ WELS_VERIFY_RETURN_IF (1, (NULL == (*ppCtx)->pDynamicBsBuffer[iIdx]))
17811776 }
17821777 }
17831778 // for pSlice bs buffers
17841779 if (pParam->iMultipleThreadIdc > 1
17851780 && RequestMtResource (ppCtx, pParam, iCountBsLen, iMaxSliceBufferSize, bDynamicSlice)) {
17861781 WelsLog (& (*ppCtx)->sLogCtx, WELS_LOG_WARNING, "RequestMemorySvc(), RequestMtResource failed!");
1787− FreeMemorySvc (ppCtx);
17881782 return 1;
17891783 }
17901784
17911785 (*ppCtx)->pReferenceStrategy = IWelsReferenceStrategy::CreateReferenceStrategy ((*ppCtx), pParam->iUsageType,
17921786 pParam->bEnableLongTermReference);
1793− WELS_VERIFY_RETURN_PROC_IF (1, (NULL == (*ppCtx)->pReferenceStrategy), FreeMemorySvc (ppCtx))
1787+ WELS_VERIFY_RETURN_IF (1, (NULL == (*ppCtx)->pReferenceStrategy))
17941788
17951789 (*ppCtx)->pIntra4x4PredModeBlocks = static_cast<int8_t*>
17961790 (pMa->WelsMallocz (iCountMaxMbNum * INTRA_4x4_MODE_NUM, "pIntra4x4PredModeBlocks"));
1797− WELS_VERIFY_RETURN_PROC_IF (1, (NULL == (*ppCtx)->pIntra4x4PredModeBlocks), FreeMemorySvc (ppCtx))
1791+ WELS_VERIFY_RETURN_IF (1, (NULL == (*ppCtx)->pIntra4x4PredModeBlocks))
17981792
17991793 (*ppCtx)->pNonZeroCountBlocks = static_cast<int8_t*>
18001794 (pMa->WelsMallocz (iCountMaxMbNum * MB_LUMA_CHROMA_BLOCK4x4_NUM, "pNonZeroCountBlocks"));
1801− WELS_VERIFY_RETURN_PROC_IF (1, (NULL == (*ppCtx)->pNonZeroCountBlocks), FreeMemorySvc (ppCtx))
1795+ WELS_VERIFY_RETURN_IF (1, (NULL == (*ppCtx)->pNonZeroCountBlocks))
18021796
18031797 (*ppCtx)->pMvUnitBlock4x4 = static_cast<SMVUnitXY*>
18041798 (pMa->WelsMallocz (iCountMaxMbNum * 2 * MB_BLOCK4x4_NUM * sizeof (SMVUnitXY), "pMvUnitBlock4x4"));
1805− WELS_VERIFY_RETURN_PROC_IF (1, (NULL == (*ppCtx)->pMvUnitBlock4x4), FreeMemorySvc (ppCtx))
1799+ WELS_VERIFY_RETURN_IF (1, (NULL == (*ppCtx)->pMvUnitBlock4x4))
18061800
18071801 (*ppCtx)->pRefIndexBlock4x4 = static_cast<int8_t*>
18081802 (pMa->WelsMallocz (iCountMaxMbNum * 2 * MB_BLOCK8x8_NUM * sizeof (int8_t), "pRefIndexBlock4x4"));
1809− WELS_VERIFY_RETURN_PROC_IF (1, (NULL == (*ppCtx)->pRefIndexBlock4x4), FreeMemorySvc (ppCtx))
1803+ WELS_VERIFY_RETURN_IF (1, (NULL == (*ppCtx)->pRefIndexBlock4x4))
18101804
18111805 (*ppCtx)->pSadCostMb = static_cast<int32_t*>
18121806 (pMa->WelsMallocz (iCountMaxMbNum * sizeof (int32_t), "pSadCostMb"));
1813− WELS_VERIFY_RETURN_PROC_IF (1, (NULL == (*ppCtx)->pSadCostMb), FreeMemorySvc (ppCtx))
1807+ WELS_VERIFY_RETURN_IF (1, (NULL == (*ppCtx)->pSadCostMb))
18141808
18151809 (*ppCtx)->iGlobalQp = 26; // global qp in default
18161810
18171811 (*ppCtx)->pLtr = (SLTRState*)pMa->WelsMallocz (kiNumDependencyLayers * sizeof (SLTRState), "SLTRState");
1818− WELS_VERIFY_RETURN_PROC_IF (1, (NULL == (*ppCtx)->pLtr), FreeMemorySvc (ppCtx))
1812+ WELS_VERIFY_RETURN_IF (1, (NULL == (*ppCtx)->pLtr))
18191813 int32_t i = 0;
18201814 for (i = 0; i < kiNumDependencyLayers; i++) {
18211815 ResetLtrState (& (*ppCtx)->pLtr[i]);
@@ -1824,85 +1818,80 @@ int32_t RequestMemorySvc (sWelsEncCtx** ppCtx, SExistingParasetList* pExistingPa · 2 unmodified lines
18241818 // stride tables
18251819 if (AllocStrideTables (ppCtx, kiNumDependencyLayers)) {
18261820 WelsLog (& (*ppCtx)->sLogCtx, WELS_LOG_WARNING, "RequestMemorySvc(), AllocStrideTables failed!");
1827− FreeMemorySvc (ppCtx);
18281821 return 1;
18291822 }
18301823
18311824 //Rate control module memory allocation
18321825 // only malloc once for RC pData, 12/14/2009
18331826 (*ppCtx)->pWelsSvcRc = (SWelsSvcRc*)pMa->WelsMallocz (kiNumDependencyLayers * sizeof (SWelsSvcRc), "pWelsSvcRc");
1834− WELS_VERIFY_RETURN_PROC_IF (1, (NULL == (*ppCtx)->pWelsSvcRc), FreeMemorySvc (ppCtx))
1827+ WELS_VERIFY_RETURN_IF (1, (NULL == (*ppCtx)->pWelsSvcRc))
18351828 //End of Rate control module memory allocation
18361829
18371830 //pVaa memory allocation
18381831 if (pParam->iUsageType == SCREEN_CONTENT_REAL_TIME) {
18391832 (*ppCtx)->pVaa = (SVAAFrameInfoExt*)pMa->WelsMallocz (sizeof (SVAAFrameInfoExt), "pVaa");
1840− WELS_VERIFY_RETURN_PROC_IF (1, (NULL == (*ppCtx)->pVaa), FreeMemorySvc (ppCtx))
1833+ WELS_VERIFY_RETURN_IF (1, (NULL == (*ppCtx)->pVaa))
18411834 if (RequestMemoryVaaScreen ((*ppCtx)->pVaa, pMa, (*ppCtx)->pSvcParam->iMaxNumRefFrame, iCountMaxMbNum << 2)) {
18421835 WelsLog (& (*ppCtx)->sLogCtx, WELS_LOG_WARNING, "RequestMemorySvc(), RequestMemoryVaaScreen failed!");
1843− FreeMemorySvc (ppCtx);
18441836 return 1;
18451837 }
18461838 } else {
18471839 (*ppCtx)->pVaa = (SVAAFrameInfo*)pMa->WelsMallocz (sizeof (SVAAFrameInfo), "pVaa");
1848− WELS_VERIFY_RETURN_PROC_IF (1, (NULL == (*ppCtx)->pVaa), FreeMemorySvc (ppCtx))
1840+ WELS_VERIFY_RETURN_IF (1, (NULL == (*ppCtx)->pVaa))
18491841 }
18501842
18511843 if ((*ppCtx)->pSvcParam->bEnableAdaptiveQuant) { //malloc mem
18521844 (*ppCtx)->pVaa->sAdaptiveQuantParam.pMotionTextureUnit = static_cast<SMotionTextureUnit*>
18531845 (pMa->WelsMallocz (iCountMaxMbNum * sizeof (SMotionTextureUnit), "pVaa->sAdaptiveQuantParam.pMotionTextureUnit"));
1854− WELS_VERIFY_RETURN_PROC_IF (1, (NULL == (*ppCtx)->pVaa->sAdaptiveQuantParam.pMotionTextureUnit), FreeMemorySvc (ppCtx))
1846+ WELS_VERIFY_RETURN_IF (1, (NULL == (*ppCtx)->pVaa->sAdaptiveQuantParam.pMotionTextureUnit))
18551847 (*ppCtx)->pVaa->sAdaptiveQuantParam.pMotionTextureIndexToDeltaQp = static_cast<int8_t*>
18561848 (pMa->WelsMallocz (iCountMaxMbNum * sizeof (int8_t), "pVaa->sAdaptiveQuantParam.pMotionTextureIndexToDeltaQp"));
1857− WELS_VERIFY_RETURN_PROC_IF (1, (NULL == (*ppCtx)->pVaa->sAdaptiveQuantParam.pMotionTextureIndexToDeltaQp),
1858− FreeMemorySvc (ppCtx))
1849+ WELS_VERIFY_RETURN_IF (1, (NULL == (*ppCtx)->pVaa->sAdaptiveQuantParam.pMotionTextureIndexToDeltaQp))
18591850 }
18601851
18611852 (*ppCtx)->pVaa->pVaaBackgroundMbFlag = (int8_t*)pMa->WelsMallocz (iCountMaxMbNum * sizeof (int8_t),
18621853 "pVaa->pVaaBackgroundMbFlag");
1863− WELS_VERIFY_RETURN_PROC_IF (1, (NULL == (*ppCtx)->pVaa->pVaaBackgroundMbFlag), FreeMemorySvc (ppCtx))
1854+ WELS_VERIFY_RETURN_IF (1, (NULL == (*ppCtx)->pVaa->pVaaBackgroundMbFlag))
18641855
18651856 (*ppCtx)->pVaa->sVaaCalcInfo.pSad8x8 = static_cast<int32_t (*)[4]>
18661857 (pMa->WelsMallocz (iCountMaxMbNum * 4 * sizeof (int32_t), "pVaa->sVaaCalcInfo.sad8x8"));
1867− WELS_VERIFY_RETURN_PROC_IF (1, (NULL == (*ppCtx)->pVaa->sVaaCalcInfo.pSad8x8), FreeMemorySvc (ppCtx))
1858+ WELS_VERIFY_RETURN_IF (1, (NULL == (*ppCtx)->pVaa->sVaaCalcInfo.pSad8x8))
18681859 (*ppCtx)->pVaa->sVaaCalcInfo.pSsd16x16 = static_cast<int32_t*>
18691860 (pMa->WelsMallocz (iCountMaxMbNum * sizeof (int32_t), "pVaa->sVaaCalcInfo.pSsd16x16"));
1870− WELS_VERIFY_RETURN_PROC_IF (1, (NULL == (*ppCtx)->pVaa->sVaaCalcInfo.pSsd16x16), FreeMemorySvc (ppCtx))
1861+ WELS_VERIFY_RETURN_IF (1, (NULL == (*ppCtx)->pVaa->sVaaCalcInfo.pSsd16x16))
18711862 (*ppCtx)->pVaa->sVaaCalcInfo.pSum16x16 = static_cast<int32_t*>
18721863 (pMa->WelsMallocz (iCountMaxMbNum * sizeof (int32_t), "pVaa->sVaaCalcInfo.pSum16x16"));
1873− WELS_VERIFY_RETURN_PROC_IF (1, (NULL == (*ppCtx)->pVaa->sVaaCalcInfo.pSum16x16), FreeMemorySvc (ppCtx))
1864+ WELS_VERIFY_RETURN_IF (1, (NULL == (*ppCtx)->pVaa->sVaaCalcInfo.pSum16x16))
18741865 (*ppCtx)->pVaa->sVaaCalcInfo.pSumOfSquare16x16 = static_cast<int32_t*>
18751866 (pMa->WelsMallocz (iCountMaxMbNum * sizeof (int32_t), "pVaa->sVaaCalcInfo.pSumOfSquare16x16"));
1876− WELS_VERIFY_RETURN_PROC_IF (1, (NULL == (*ppCtx)->pVaa->sVaaCalcInfo.pSumOfSquare16x16), FreeMemorySvc (ppCtx))
1867+ WELS_VERIFY_RETURN_IF (1, (NULL == (*ppCtx)->pVaa->sVaaCalcInfo.pSumOfSquare16x16))
18771868
18781869 if ((*ppCtx)->pSvcParam->bEnableBackgroundDetection) { //BGD control
18791870 (*ppCtx)->pVaa->sVaaCalcInfo.pSumOfDiff8x8 = static_cast<int32_t (*)[4]>
18801871 (pMa->WelsMallocz (iCountMaxMbNum * 4 * sizeof (int32_t), "pVaa->sVaaCalcInfo.pSumOfDiff8x8"));
1881− WELS_VERIFY_RETURN_PROC_IF (1, (NULL == (*ppCtx)->pVaa->sVaaCalcInfo.pSumOfDiff8x8), FreeMemorySvc (ppCtx))
1872+ WELS_VERIFY_RETURN_IF (1, (NULL == (*ppCtx)->pVaa->sVaaCalcInfo.pSumOfDiff8x8))
18821873 (*ppCtx)->pVaa->sVaaCalcInfo.pMad8x8 = static_cast<uint8_t (*)[4]>
18831874 (pMa->WelsMallocz (iCountMaxMbNum * 4 * sizeof (uint8_t), "pVaa->sVaaCalcInfo.pMad8x8"));
1884− WELS_VERIFY_RETURN_PROC_IF (1, (NULL == (*ppCtx)->pVaa->sVaaCalcInfo.pMad8x8), FreeMemorySvc (ppCtx))
1875+ WELS_VERIFY_RETURN_IF (1, (NULL == (*ppCtx)->pVaa->sVaaCalcInfo.pMad8x8))
18851876 }
18861877
18871878 //End of pVaa memory allocation
18881879
18891880 (*ppCtx)->ppRefPicListExt = (SRefList**)pMa->WelsMallocz (kiNumDependencyLayers * sizeof (SRefList*),
18901881 "ppRefPicListExt");
1891− WELS_VERIFY_RETURN_PROC_IF (1, (NULL == (*ppCtx)->ppRefPicListExt), FreeMemorySvc (ppCtx))
1882+ WELS_VERIFY_RETURN_IF (1, (NULL == (*ppCtx)->ppRefPicListExt))
18921883
18931884 (*ppCtx)->ppDqLayerList = (SDqLayer**)pMa->WelsMallocz (kiNumDependencyLayers * sizeof (SDqLayer*), "ppDqLayerList");
1894− WELS_VERIFY_RETURN_PROC_IF (1, (NULL == (*ppCtx)->ppDqLayerList), FreeMemorySvc (ppCtx))
1885+ WELS_VERIFY_RETURN_IF (1, (NULL == (*ppCtx)->ppDqLayerList))
18951886
18961887 iResult = InitDqLayers (ppCtx, pExistingParasetList);
18971888 if (iResult) {
18981889 WelsLog (& (*ppCtx)->sLogCtx, WELS_LOG_WARNING, "RequestMemorySvc(), InitDqLayers failed(%d)!", iResult);
1899− FreeMemorySvc (ppCtx);
19001890 return iResult;
19011891 }
19021892
19031893 if (InitMbListD (ppCtx)) {
19041894 WelsLog (& (*ppCtx)->sLogCtx, WELS_LOG_WARNING, "RequestMemorySvc(), InitMbListD failed!");
1905− FreeMemorySvc (ppCtx);
19061895 return 1;
19071896 }
19081897
@@ -1915,7 +1904,7 @@ int32_t RequestMemorySvc (sWelsEncCtx** ppCtx, SExistingParasetList* pExistingPa · 6 unmodified lines
19151904 (*ppCtx)->iMvdCostTableSize = kuiMvdInterTableSize;
19161905 (*ppCtx)->iMvdCostTableStride = kuiMvdInterTableStride;
19171906 (*ppCtx)->pMvdCostTable = (uint16_t*)pMa->WelsMallocz (52 * kuiMvdCacheAlignedSize, "pMvdCostTable");
1918− WELS_VERIFY_RETURN_PROC_IF (1, (NULL == (*ppCtx)->pMvdCostTable), FreeMemorySvc (ppCtx))
1907+ WELS_VERIFY_RETURN_IF (1, (NULL == (*ppCtx)->pMvdCostTable))
19191908 MvdCostInit ((*ppCtx)->pMvdCostTable, kuiMvdInterTableStride); //should put to a better place?
19201909
19211910 if ((*ppCtx)->ppRefPicListExt[0] != NULL && (*ppCtx)->ppRefPicListExt[0]->pRef[0] != NULL)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t