Showing the changes to codec/encoder/core/src/wels_task_encoder.cpp (1 of 15 files). Show all
Unified · Split
| @@ -116,7 +116,7 @@ WelsErrorType CWelsSliceEncodingTask::InitTask() { · 115 unmodified lines | ||
| 116 | 116 | WELS_VERIFY_RETURN_IFNEQ (iReturn, ENC_RETURN_SUCCESS) |
| 117 | 117 | m_pSliceBs = &m_pSlice->sSliceBs; |
| 118 | 118 | |
| 119 | − iReturn = SetSliceBoundaryInfo(m_pCtx->pCurDqLayer, m_pSlice, m_iSliceIdx); | |
| 119 | + iReturn = SetSliceBoundaryInfo (m_pCtx->pCurDqLayer, m_pSlice, m_iSliceIdx); | |
| 120 | 120 | WELS_VERIFY_RETURN_IFNEQ (iReturn, ENC_RETURN_SUCCESS) |
| 121 | 121 | |
| 122 | 122 | SetOneSliceBsBufferUnderMultithread (m_pCtx, m_iThreadIdx, m_pSlice); |
| @@ -244,7 +244,7 @@ WelsErrorType CWelsConstrainedSizeSlicingEncodingTask::ExecuteTask() { · 121 unmodified lines | ||
| 244 | 244 | bool bNeedReallocate = false; |
| 245 | 245 | |
| 246 | 246 | int32_t iDiffMbIdx = kiEndMbIdxInPartition - kiFirstMbInPartition; |
| 247 | − if( 0 == iDiffMbIdx) { | |
| 247 | + if (0 == iDiffMbIdx) { | |
| 248 | 248 | m_pSlice->iSliceIdx = -1; |
| 249 | 249 | return ENC_RETURN_SUCCESS; |
| 250 | 250 | } |
| @@ -252,17 +252,17 @@ WelsErrorType CWelsConstrainedSizeSlicingEncodingTask::ExecuteTask() { · 1 unmodified line | ||
| 252 | 252 | int32_t iAnyMbLeftInPartition = iDiffMbIdx + 1; |
| 253 | 253 | int32_t iLocalSliceIdx = m_iSliceIdx; |
| 254 | 254 | while (iAnyMbLeftInPartition > 0) { |
| 255 | − bNeedReallocate = (pCurDq->sSliceBufferInfo[m_iThreadIdx].iCodedSliceNum | |
| 256 | − >= pCurDq->sSliceBufferInfo[m_iThreadIdx].iMaxSliceNum -1) ? true : false; | |
| 257 | − if (bNeedReallocate) { | |
| 258 | − WelsMutexLock (&m_pCtx->pSliceThreading->mutexThreadSlcBuffReallocate); | |
| 259 | − //for memory statistic variable | |
| 260 | − iReturn = ReallocateSliceInThread(m_pCtx, pCurDq, m_pCtx->uiDependencyId, m_iThreadIdx); | |
| 261 | − WelsMutexUnlock (&m_pCtx->pSliceThreading->mutexThreadSlcBuffReallocate); | |
| 262 | − if (ENC_RETURN_SUCCESS != iReturn) { | |
| 263 | − return iReturn; | |
| 264 | − } | |
| 255 | + bNeedReallocate = (pCurDq->sSliceBufferInfo[m_iThreadIdx].iCodedSliceNum | |
| 256 | + >= pCurDq->sSliceBufferInfo[m_iThreadIdx].iMaxSliceNum - 1) ? true : false; | |
| 257 | + if (bNeedReallocate) { | |
| 258 | + WelsMutexLock (&m_pCtx->pSliceThreading->mutexThreadSlcBuffReallocate); | |
| 259 | + //for memory statistic variable | |
| 260 | + iReturn = ReallocateSliceInThread (m_pCtx, pCurDq, m_pCtx->uiDependencyId, m_iThreadIdx); | |
| 261 | + WelsMutexUnlock (&m_pCtx->pSliceThreading->mutexThreadSlcBuffReallocate); | |
| 262 | + if (ENC_RETURN_SUCCESS != iReturn) { | |
| 263 | + return iReturn; | |
| 265 | 264 | } |
| 265 | + } | |
| 266 | 266 | |
| 267 | 267 | iReturn = InitOneSliceInThread (m_pCtx, m_pSlice, m_iThreadIdx, m_pCtx->uiDependencyId, iLocalSliceIdx); |
| 268 | 268 | WELS_VERIFY_RETURN_IFNEQ (iReturn, ENC_RETURN_SUCCESS) |