History

improve the code structure

sijchen committed 10 years ago

Commit a1a38731 parent 43fdf741 file · +8 −13Browse files

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

Unified · Split

codec/encoder/core/src/encoder_ext.cpp+8−13
@@ -1267,12 +1267,6 @@ static inline int32_t InitDqLayers (sWelsEncCtx** ppCtx, SExistingParasetList* p · 1266 unmodified lines
12671267 pDqLayer = (SDqLayer*)pMa->WelsMallocz (sizeof (SDqLayer), "pDqLayer");
12681268 WELS_VERIFY_RETURN_PROC_IF (1, (NULL == pDqLayer), FreeDqLayer (pDqLayer, pMa))
12691269
1270− int32_t iMaxSliceNum = 1;
1271− const int32_t kiSliceNum = GetInitialSliceNum (kiMbW, kiMbH, &pDlayer->sSliceArgument);
1272− if (iMaxSliceNum < kiSliceNum)
1273− iMaxSliceNum = kiSliceNum;
1274− pDqLayer->iMaxSliceNum = iMaxSliceNum;
1275−
12761270 // for dynamic slicing mode
12771271 if (SM_SIZELIMITED_SLICE == pDlayer->sSliceArgument.uiSliceMode) {
12781272 const int32_t iSize = pParam->iMultipleThreadIdc * sizeof (int32_t);
@@ -1290,6 +1284,12 @@ static inline int32_t InitDqLayers (sWelsEncCtx** ppCtx, SExistingParasetList* p · 11 unmodified lines
12901284
12911285 pDqLayer->iMbWidth = kiMbW;
12921286 pDqLayer->iMbHeight = kiMbH;
1287+
1288+ int32_t iMaxSliceNum = 1;
1289+ const int32_t kiSliceNum = GetInitialSliceNum (kiMbW, kiMbH, &pDlayer->sSliceArgument);
1290+ if (iMaxSliceNum < kiSliceNum)
1291+ iMaxSliceNum = kiSliceNum;
1292+ pDqLayer->iMaxSliceNum = iMaxSliceNum;
12931293 {
12941294 pDqLayer->sLayerInfo.pSliceInLayer = (SSlice*)pMa->WelsMallocz (sizeof (SSlice) * iMaxSliceNum, "pSliceInLayer");
12951295 WELS_VERIFY_RETURN_PROC_IF (1, (NULL == pDqLayer->sLayerInfo.pSliceInLayer), FreeDqLayer (pDqLayer, pMa))
@@ -2029,17 +2029,12 @@ int32_t RequestMemorySvc (sWelsEncCtx** ppCtx, SExistingParasetList* pExistingPa · 733 unmodified lines
20292029
20302030 //End of pVaa memory allocation
20312031
2032− (*ppCtx)->ppRefPicListExt = (SRefList**)pMa->WelsMalloc (kiNumDependencyLayers * sizeof (SRefList*), "ppRefPicListExt");
2032+ (*ppCtx)->ppRefPicListExt = (SRefList**)pMa->WelsMallocz (kiNumDependencyLayers * sizeof (SRefList*), "ppRefPicListExt");
20332033 WELS_VERIFY_RETURN_PROC_IF (1, (NULL == (*ppCtx)->ppRefPicListExt), FreeMemorySvc (ppCtx))
20342034
2035− (*ppCtx)->ppDqLayerList = (SDqLayer**)pMa->WelsMalloc (kiNumDependencyLayers * sizeof (SDqLayer*), "ppDqLayerList");
2035+ (*ppCtx)->ppDqLayerList = (SDqLayer**)pMa->WelsMallocz (kiNumDependencyLayers * sizeof (SDqLayer*), "ppDqLayerList");
20362036 WELS_VERIFY_RETURN_PROC_IF (1, (NULL == (*ppCtx)->ppDqLayerList), FreeMemorySvc (ppCtx))
20372037
2038− for (int32_t k = 0; k < kiNumDependencyLayers; k++) {
2039− (*ppCtx)->ppRefPicListExt[k] = NULL;
2040− (*ppCtx)->ppDqLayerList[k] = NULL;
2041− }
2042−
20432038 iResult = InitDqLayers (ppCtx, pExistingParasetList);
20442039 if (iResult) {
20452040 WelsLog (& (*ppCtx)->sLogCtx, WELS_LOG_WARNING, "RequestMemorySvc(), InitDqLayers failed(%d)!", iResult);

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