Showing the changes to codec/encoder/core/src/encoder_ext.cpp (1 of 5 files). Show all
Unified · Split
| @@ -2238,8 +2238,7 @@ void WelsUninitEncoderExt (sWelsEncCtx** ppCtx) { · 2237 unmodified lines | ||
| 2238 | 2238 | while (iThreadIdx < iThreadCount) { |
| 2239 | 2239 | int res = 0; |
| 2240 | 2240 | if ((*ppCtx)->pSliceThreading->pThreadHandles[iThreadIdx]) { |
| 2241 | − WelsEventSignal (& (*ppCtx)->pSliceThreading->pExitEncodeEvent[iThreadIdx]); | |
| 2242 | − WelsEventSignal (& (*ppCtx)->pSliceThreading->pThreadMasterEvent[iThreadIdx]); | |
| 2241 | + | |
| 2243 | 2242 | res = WelsThreadJoin ((*ppCtx)->pSliceThreading->pThreadHandles[iThreadIdx]); // waiting thread exit |
| 2244 | 2243 | WelsLog (& (*ppCtx)->sLogCtx, WELS_LOG_INFO, "WelsUninitEncoderExt(), pthread_join(pThreadHandles%d) return %d..", |
| 2245 | 2244 | iThreadIdx, |
| @@ -3749,24 +3748,6 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 1503 unmodified lines | ||
| 3749 | 3748 | else if ((SM_SIZELIMITED_SLICE == pParam->sSliceArgument.uiSliceMode) && (pSvcParam->iMultipleThreadIdc > 1)) { |
| 3750 | 3749 | const int32_t kiPartitionCnt = pCtx->iActiveThreadsNum; |
| 3751 | 3750 | |
| 3752 | −#if 0 //TODO: temporarily use this to keep old codes for a while, will remove old codes later | |
| 3753 | − int32_t iRet = 0; | |
| 3754 | − // to fire slice coding threads | |
| 3755 | − iRet = FiredSliceThreads (pCtx, &pCtx->pSliceThreading->pThreadPEncCtx[0], | |
| 3756 | − &pCtx->pSliceThreading->pReadySliceCodingEvent[0], | |
| 3757 | − &pCtx->pSliceThreading->pThreadMasterEvent[0], | |
| 3758 | − pFbi, kiPartitionCnt); | |
| 3759 | − if (iRet) { | |
| 3760 | − WelsLog (pLogCtx, WELS_LOG_ERROR, | |
| 3761 | − "[MT] WelsEncoderEncodeExt(), FiredSliceThreads return(%d) failed and exit encoding frame, iSliceCount= %d, uiSliceMode= %d, iMultipleThreadIdc= %d!!", | |
| 3762 | − iRet, iSliceCount, pParam->sSliceArgument.uiSliceMode, pSvcParam->iMultipleThreadIdc); | |
| 3763 | − return ENC_RETURN_UNEXPECTED; | |
| 3764 | − } | |
| 3765 | − | |
| 3766 | − WelsMultipleEventsWaitAllBlocking (kiPartitionCnt, &pCtx->pSliceThreading->pSliceCodedEvent[0], | |
| 3767 | − &pCtx->pSliceThreading->pSliceCodedMasterEvent); | |
| 3768 | − WELS_VERIFY_RETURN_IFNEQ (pCtx->iEncoderError, ENC_RETURN_SUCCESS) | |
| 3769 | −#else | |
| 3770 | 3751 | //TODO: use a function to remove duplicate code here and ln3994 |
| 3771 | 3752 | int32_t iLayerBsIdx = pCtx->pOut->iLayerBsIndex; |
| 3772 | 3753 | SLayerBSInfo* pLbi = &pFbi->sLayerInfo[iLayerBsIdx]; |
| @@ -3800,7 +3781,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 27 unmodified lines | ||
| 3800 | 3781 | pParam->sSliceArgument.uiSliceMode, pCtx->iEncoderError); |
| 3801 | 3782 | return pCtx->iEncoderError; |
| 3802 | 3783 | } |
| 3803 | −#endif | |
| 3784 | + | |
| 3804 | 3785 | iRet = SliceLayerInfoUpdate (pCtx, pFbi, pLayerBsInfo, pParam->sSliceArgument.uiSliceMode); |
| 3805 | 3786 | if (iRet) { |
| 3806 | 3787 | WelsLog (pLogCtx, WELS_LOG_ERROR, |