[Encoder] remove duplicated operation after thread pool
Showing the changes to codec/encoder/core/src/slice_multi_threading.cpp (1 of 7 files). Show all
Unified · Split
| @@ -242,21 +242,10 @@ void DynamicAdjustSlicing (sWelsEncCtx* pCtx, · 241 unmodified lines | |||
| 242 | } | 242 | } |
| 243 | iRunLen[iSliceIdx] = iMbNumLeft; | 243 | iRunLen[iSliceIdx] = iMbNumLeft; |
| 244 | MT_TRACE_LOG (pCtx, WELS_LOG_DEBUG, | 244 | MT_TRACE_LOG (pCtx, WELS_LOG_DEBUG, |
| 245 | "[MT] DynamicAdjustSlicing(), iSliceIdx= %d, iSliceComplexRatio= %.2f, slice_run_org= %d, slice_run_adj= %d", | 245 | "[MT] DynamicAdjustSlicing(), iSliceIdx= %d, pSliceComplexRatio= %.2f, slice_run_org= %d, slice_run_adj= %d", |
| 246 | iSliceIdx, pSliceInLayer[iSliceIdx].iSliceComplexRatio * 1.0f / INT_MULTIPLY, | 246 | iSliceIdx, pSliceComplexRatio[iSliceIdx] * 1.0f / INT_MULTIPLY, pSliceCtx->pCountMbNumInSlice[iSliceIdx], iMbNumLeft); |
| 247 | pSliceInLayer[iSliceIdx].iCountMbNumInSlice, iMbNumLeft); | ||
| 248 | 247 | ||
| 249 | if (DynamicAdjustSlicePEncCtxAll (pCurDqLayer, iRunLen) == 0) { | 248 | pCurDqLayer->bNeedAdjustingSlicing = !DynamicAdjustSlicePEncCtxAll (pCurDqLayer, iRunLen); |
| 250 | const int32_t kiThreadNum = pCtx->pSvcParam->iCountThreadsNum; | ||
| 251 | int32_t iThreadIdx = 0; | ||
| 252 | do { | ||
| 253 | WelsEventSignal (&pCtx->pSliceThreading->pUpdateMbListEvent[iThreadIdx]); | ||
| 254 | WelsEventSignal (&pCtx->pSliceThreading->pThreadMasterEvent[iThreadIdx]); | ||
| 255 | ++ iThreadIdx; | ||
| 256 | } while (iThreadIdx < kiThreadNum); | ||
| 257 | |||
| 258 | WelsMultipleEventsWaitAllBlocking (kiThreadNum, &pCtx->pSliceThreading->pFinUpdateMbListEvent[0]); | ||
| 259 | } | ||
| 260 | } | 249 | } |
| 261 | 250 | ||
| 262 | int32_t SetMultiSliceBuffer (sWelsEncCtx** ppCtx, CMemoryAlign* pMa, SSliceThreading* pSmt, | 251 | int32_t SetMultiSliceBuffer (sWelsEncCtx** ppCtx, CMemoryAlign* pMa, SSliceThreading* pSmt, |