Showing the changes to codec/encoder/core/src/slice_multi_threading.cpp (1 of 10 files). Show all
Unified · Split
| @@ -236,11 +236,11 @@ void DynamicAdjustSlicing (sWelsEncCtx* pCtx, · 235 unmodified lines | |||
| 236 | 236 | ||
| 237 | iSliceIdx = 0; | 237 | iSliceIdx = 0; |
| 238 | while (iSliceIdx + 1 < kiCountSliceNum) { | 238 | while (iSliceIdx + 1 < kiCountSliceNum) { |
| 239 | int32_t iNumMbAssigning = (int32_t) (kiCountNumMb * pSliceComplexRatio[iSliceIdx] + EPSN); | 239 | int32_t iNumMbAssigning = WELS_ROUND (kiCountNumMb * pSliceComplexRatio[iSliceIdx]); |
| 240 | 240 | ||
| 241 | // GOM boundary aligned | 241 | // GOM boundary aligned |
| 242 | if (pCtx->pSvcParam->iRCMode != RC_OFF_MODE) { | 242 | if (pCtx->pSvcParam->iRCMode != RC_OFF_MODE) { |
| 243 | iNumMbAssigning = (int32_t) (1.0f * iNumMbAssigning / iNumMbInEachGom + 0.5f + EPSN) * iNumMbInEachGom; | 243 | iNumMbAssigning = WELS_ROUND (1.0f * iNumMbAssigning / iNumMbInEachGom) * iNumMbInEachGom; |
| 244 | } | 244 | } |
| 245 | 245 | ||
| 246 | // make sure one GOM at least in each pSlice for safe | 246 | // make sure one GOM at least in each pSlice for safe |