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 | WELS_VERIFY_RETURN_IFNEQ (iReturn, ENC_RETURN_SUCCESS) | 116 | WELS_VERIFY_RETURN_IFNEQ (iReturn, ENC_RETURN_SUCCESS) |
| 117 | m_pSliceBs = &m_pSlice->sSliceBs; | 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 | WELS_VERIFY_RETURN_IFNEQ (iReturn, ENC_RETURN_SUCCESS) | 120 | WELS_VERIFY_RETURN_IFNEQ (iReturn, ENC_RETURN_SUCCESS) |
| 121 | 121 | ||
| 122 | SetOneSliceBsBufferUnderMultithread (m_pCtx, m_iThreadIdx, m_pSlice); | 122 | SetOneSliceBsBufferUnderMultithread (m_pCtx, m_iThreadIdx, m_pSlice); |
| @@ -244,7 +244,7 @@ WelsErrorType CWelsConstrainedSizeSlicingEncodingTask::ExecuteTask() { · 121 unmodified lines | |||
| 244 | bool bNeedReallocate = false; | 244 | bool bNeedReallocate = false; |
| 245 | 245 | ||
| 246 | int32_t iDiffMbIdx = kiEndMbIdxInPartition - kiFirstMbInPartition; | 246 | int32_t iDiffMbIdx = kiEndMbIdxInPartition - kiFirstMbInPartition; |
| 247 | if( 0 == iDiffMbIdx) { | 247 | if (0 == iDiffMbIdx) { |
| 248 | m_pSlice->iSliceIdx = -1; | 248 | m_pSlice->iSliceIdx = -1; |
| 249 | return ENC_RETURN_SUCCESS; | 249 | return ENC_RETURN_SUCCESS; |
| 250 | } | 250 | } |
| @@ -252,17 +252,17 @@ WelsErrorType CWelsConstrainedSizeSlicingEncodingTask::ExecuteTask() { · 1 unmodified line | |||
| 252 | int32_t iAnyMbLeftInPartition = iDiffMbIdx + 1; | 252 | int32_t iAnyMbLeftInPartition = iDiffMbIdx + 1; |
| 253 | int32_t iLocalSliceIdx = m_iSliceIdx; | 253 | int32_t iLocalSliceIdx = m_iSliceIdx; |
| 254 | while (iAnyMbLeftInPartition > 0) { | 254 | while (iAnyMbLeftInPartition > 0) { |
| 255 | bNeedReallocate = (pCurDq->sSliceBufferInfo[m_iThreadIdx].iCodedSliceNum | 255 | bNeedReallocate = (pCurDq->sSliceBufferInfo[m_iThreadIdx].iCodedSliceNum |
| 256 | >= pCurDq->sSliceBufferInfo[m_iThreadIdx].iMaxSliceNum -1) ? true : false; | 256 | >= pCurDq->sSliceBufferInfo[m_iThreadIdx].iMaxSliceNum - 1) ? true : false; |
| 257 | if (bNeedReallocate) { | 257 | if (bNeedReallocate) { |
| 258 | WelsMutexLock (&m_pCtx->pSliceThreading->mutexThreadSlcBuffReallocate); | 258 | WelsMutexLock (&m_pCtx->pSliceThreading->mutexThreadSlcBuffReallocate); |
| 259 | //for memory statistic variable | 259 | //for memory statistic variable |
| 260 | iReturn = ReallocateSliceInThread(m_pCtx, pCurDq, m_pCtx->uiDependencyId, m_iThreadIdx); | 260 | iReturn = ReallocateSliceInThread (m_pCtx, pCurDq, m_pCtx->uiDependencyId, m_iThreadIdx); |
| 261 | WelsMutexUnlock (&m_pCtx->pSliceThreading->mutexThreadSlcBuffReallocate); | 261 | WelsMutexUnlock (&m_pCtx->pSliceThreading->mutexThreadSlcBuffReallocate); |
| 262 | if (ENC_RETURN_SUCCESS != iReturn) { | 262 | if (ENC_RETURN_SUCCESS != iReturn) { |
| 263 | return iReturn; | 263 | return iReturn; |
| 264 | } | ||
| 265 | } | 264 | } |
| 265 | } | ||
| 266 | 266 | ||
| 267 | iReturn = InitOneSliceInThread (m_pCtx, m_pSlice, m_iThreadIdx, m_pCtx->uiDependencyId, iLocalSliceIdx); | 267 | iReturn = InitOneSliceInThread (m_pCtx, m_pSlice, m_iThreadIdx, m_pCtx->uiDependencyId, iLocalSliceIdx); |
| 268 | WELS_VERIFY_RETURN_IFNEQ (iReturn, ENC_RETURN_SUCCESS) | 268 | WELS_VERIFY_RETURN_IFNEQ (iReturn, ENC_RETURN_SUCCESS) |