Showing the changes to codec/encoder/core/src/encoder_ext.cpp (1 of 1 file). Show all
Unified · Split
| @@ -1267,12 +1267,6 @@ static inline int32_t InitDqLayers (sWelsEncCtx** ppCtx, SExistingParasetList* p · 1266 unmodified lines | |||
| 1267 | pDqLayer = (SDqLayer*)pMa->WelsMallocz (sizeof (SDqLayer), "pDqLayer"); | 1267 | pDqLayer = (SDqLayer*)pMa->WelsMallocz (sizeof (SDqLayer), "pDqLayer"); |
| 1268 | WELS_VERIFY_RETURN_PROC_IF (1, (NULL == pDqLayer), FreeDqLayer (pDqLayer, pMa)) | 1268 | WELS_VERIFY_RETURN_PROC_IF (1, (NULL == pDqLayer), FreeDqLayer (pDqLayer, pMa)) |
| 1269 | 1269 | ||
| 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 | |||
| 1276 | // for dynamic slicing mode | 1270 | // for dynamic slicing mode |
| 1277 | if (SM_SIZELIMITED_SLICE == pDlayer->sSliceArgument.uiSliceMode) { | 1271 | if (SM_SIZELIMITED_SLICE == pDlayer->sSliceArgument.uiSliceMode) { |
| 1278 | const int32_t iSize = pParam->iMultipleThreadIdc * sizeof (int32_t); | 1272 | 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 | |||
| 1290 | 1284 | ||
| 1291 | pDqLayer->iMbWidth = kiMbW; | 1285 | pDqLayer->iMbWidth = kiMbW; |
| 1292 | pDqLayer->iMbHeight = kiMbH; | 1286 | 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; | ||
| 1293 | { | 1293 | { |
| 1294 | pDqLayer->sLayerInfo.pSliceInLayer = (SSlice*)pMa->WelsMallocz (sizeof (SSlice) * iMaxSliceNum, "pSliceInLayer"); | 1294 | pDqLayer->sLayerInfo.pSliceInLayer = (SSlice*)pMa->WelsMallocz (sizeof (SSlice) * iMaxSliceNum, "pSliceInLayer"); |
| 1295 | WELS_VERIFY_RETURN_PROC_IF (1, (NULL == pDqLayer->sLayerInfo.pSliceInLayer), FreeDqLayer (pDqLayer, pMa)) | 1295 | 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 | |||
| 2029 | 2029 | ||
| 2030 | //End of pVaa memory allocation | 2030 | //End of pVaa memory allocation |
| 2031 | 2031 | ||
| 2032 | (*ppCtx)->ppRefPicListExt = (SRefList**)pMa->WelsMalloc (kiNumDependencyLayers * sizeof (SRefList*), "ppRefPicListExt"); | 2032 | (*ppCtx)->ppRefPicListExt = (SRefList**)pMa->WelsMallocz (kiNumDependencyLayers * sizeof (SRefList*), "ppRefPicListExt"); |
| 2033 | WELS_VERIFY_RETURN_PROC_IF (1, (NULL == (*ppCtx)->ppRefPicListExt), FreeMemorySvc (ppCtx)) | 2033 | WELS_VERIFY_RETURN_PROC_IF (1, (NULL == (*ppCtx)->ppRefPicListExt), FreeMemorySvc (ppCtx)) |
| 2034 | 2034 | ||
| 2035 | (*ppCtx)->ppDqLayerList = (SDqLayer**)pMa->WelsMalloc (kiNumDependencyLayers * sizeof (SDqLayer*), "ppDqLayerList"); | 2035 | (*ppCtx)->ppDqLayerList = (SDqLayer**)pMa->WelsMallocz (kiNumDependencyLayers * sizeof (SDqLayer*), "ppDqLayerList"); |
| 2036 | WELS_VERIFY_RETURN_PROC_IF (1, (NULL == (*ppCtx)->ppDqLayerList), FreeMemorySvc (ppCtx)) | 2036 | WELS_VERIFY_RETURN_PROC_IF (1, (NULL == (*ppCtx)->ppDqLayerList), FreeMemorySvc (ppCtx)) |
| 2037 | 2037 | ||
| 2038 | for (int32_t k = 0; k < kiNumDependencyLayers; k++) { | ||
| 2039 | (*ppCtx)->ppRefPicListExt[k] = NULL; | ||
| 2040 | (*ppCtx)->ppDqLayerList[k] = NULL; | ||
| 2041 | } | ||
| 2042 | |||
| 2043 | iResult = InitDqLayers (ppCtx, pExistingParasetList); | 2038 | iResult = InitDqLayers (ppCtx, pExistingParasetList); |
| 2044 | if (iResult) { | 2039 | if (iResult) { |
| 2045 | WelsLog (& (*ppCtx)->sLogCtx, WELS_LOG_WARNING, "RequestMemorySvc(), InitDqLayers failed(%d)!", iResult); | 2040 | WelsLog (& (*ppCtx)->sLogCtx, WELS_LOG_WARNING, "RequestMemorySvc(), InitDqLayers failed(%d)!", iResult); |