Showing the changes to codec/decoder/core/src/fmo.cpp (1 of 12 files). Show all
Unified · Split
| @@ -116,7 +116,7 @@ static inline int32_t FmoGenerateMbAllocMapType1 (PFmo pFmo, PPps pPps, const in · 115 unmodified lines | ||
| 116 | 116 | * \return 0 - successful; none 0 - failed |
| 117 | 117 | */ |
| 118 | 118 | static inline int32_t FmoGenerateSliceGroup (PFmo pFmo, const PPps kpPps, const int32_t kiMbWidth, |
| 119 | − const int32_t kiMbHeight) { | |
| 119 | + const int32_t kiMbHeight, CMemoryAlign* pMa) { | |
| 120 | 120 | int32_t iNumMb = 0; |
| 121 | 121 | int32_t iErr = 0; |
| 122 | 122 | bool bResolutionChanged = false; |
| @@ -131,9 +131,8 @@ static inline int32_t FmoGenerateSliceGroup (PFmo pFmo, const PPps kpPps, const · 8 unmodified lines | ||
| 131 | 131 | if (0 == iNumMb) |
| 132 | 132 | return 1; |
| 133 | 133 | |
| 134 | − | |
| 135 | − WelsFree (pFmo->pMbAllocMap, "_fmo->pMbAllocMap"); | |
| 136 | − pFmo->pMbAllocMap = (uint8_t*)WelsMallocz (iNumMb * sizeof (uint8_t), "_fmo->pMbAllocMap"); | |
| 134 | + pMa->WelsFree (pFmo->pMbAllocMap, "_fmo->pMbAllocMap"); | |
| 135 | + pFmo->pMbAllocMap = (uint8_t*)pMa->WelsMallocz (iNumMb * sizeof (uint8_t), "_fmo->pMbAllocMap"); | |
| 137 | 136 | WELS_VERIFY_RETURN_IF (1, (NULL == pFmo->pMbAllocMap)) // out of memory |
| 138 | 137 | |
| 139 | 138 | pFmo->iCountMbNum = iNumMb; |
| @@ -186,8 +185,8 @@ static inline int32_t FmoGenerateSliceGroup (PFmo pFmo, const PPps kpPps, const · 46 unmodified lines | ||
| 186 | 185 | * |
| 187 | 186 | * \return 0 - successful; none 0 - failed; |
| 188 | 187 | */ |
| 189 | −int32_t InitFmo (PFmo pFmo, PPps pPps, const int32_t kiMbWidth, const int32_t kiMbHeight) { | |
| 190 | − return FmoGenerateSliceGroup (pFmo, pPps, kiMbWidth, kiMbHeight); | |
| 188 | +int32_t InitFmo (PFmo pFmo, PPps pPps, const int32_t kiMbWidth, const int32_t kiMbHeight, CMemoryAlign* pMa) { | |
| 189 | + return FmoGenerateSliceGroup (pFmo, pPps, kiMbWidth, kiMbHeight, pMa); | |
| 191 | 190 | } |
| 192 | 191 | |
| 193 | 192 | |
| @@ -200,7 +199,7 @@ int32_t InitFmo (PFmo pFmo, PPps pPps, const int32_t kiMbWidth, const int32_t ki · 6 unmodified lines | ||
| 200 | 199 | * |
| 201 | 200 | * \return NONE |
| 202 | 201 | */ |
| 203 | −void UninitFmoList (PFmo pFmo, const int32_t kiCnt, const int32_t kiAvail) { | |
| 202 | +void UninitFmoList (PFmo pFmo, const int32_t kiCnt, const int32_t kiAvail, CMemoryAlign* pMa) { | |
| 204 | 203 | PFmo pIter = pFmo; |
| 205 | 204 | int32_t i = 0; |
| 206 | 205 | int32_t iFreeNodes = 0; |
| @@ -211,7 +210,7 @@ void UninitFmoList (PFmo pFmo, const int32_t kiCnt, const int32_t kiAvail) { · 4 unmodified lines | ||
| 211 | 210 | while (i < kiCnt) { |
| 212 | 211 | if (pIter != NULL && pIter->bActiveFlag) { |
| 213 | 212 | if (NULL != pIter->pMbAllocMap) { |
| 214 | − WelsFree (pIter->pMbAllocMap, "pIter->pMbAllocMap"); | |
| 213 | + pMa->WelsFree (pIter->pMbAllocMap, "pIter->pMbAllocMap"); | |
| 215 | 214 | |
| 216 | 215 | pIter->pMbAllocMap = NULL; |
| 217 | 216 | } |
| @@ -258,7 +257,7 @@ bool FmoParamSetsChanged (PFmo pFmo, const int32_t kiCountNumMb, const int32_t k · 40 unmodified lines | ||
| 258 | 257 | * |
| 259 | 258 | * \return true - update/insert successfully; false - failed; |
| 260 | 259 | */ |
| 261 | −bool FmoParamUpdate (PFmo pFmo, PSps pSps, PPps pPps, int32_t* pActiveFmoNum) { | |
| 260 | +bool FmoParamUpdate (PFmo pFmo, PSps pSps, PPps pPps, int32_t* pActiveFmoNum, CMemoryAlign* pMa) { | |
| 262 | 261 | const uint32_t kuiMbWidth = pSps->iMbWidth; |
| 263 | 262 | const uint32_t kuiMbHeight = pSps->iMbHeight; |
| 264 | 263 | |
| @@ -267,7 +266,7 @@ bool FmoParamUpdate (PFmo pFmo, PSps pSps, PPps pPps, int32_t* pActiveFmoNum) { · 2 unmodified lines | ||
| 267 | 266 | pPps->uiSliceGroupMapType, |
| 268 | 267 | pPps->uiNumSliceGroups)) { |
| 269 | 268 | |
| 270 | − if (InitFmo (pFmo, pPps, kuiMbWidth, kuiMbHeight)) { | |
| 269 | + if (InitFmo (pFmo, pPps, kuiMbWidth, kuiMbHeight, pMa)) { | |
| 271 | 270 | return false; |
| 272 | 271 | } else { |
| 273 | 272 | if (!pFmo->bActiveFlag && *pActiveFmoNum < MAX_PPS_COUNT) { |