Showing the changes to codec/encoder/core/src/wels_task_encoder.cpp (1 of 13 files). Show all
Unified · Split
| @@ -145,7 +145,7 @@ WelsErrorType CWelsSliceEncodingTask::ExecuteTask() { · 144 unmodified lines | |||
| 145 | #if MT_DEBUG_BS_WR | 145 | #if MT_DEBUG_BS_WR |
| 146 | m_pSliceBs->bSliceCodedFlag = false; | 146 | m_pSliceBs->bSliceCodedFlag = false; |
| 147 | #endif//MT_DEBUG_BS_WR | 147 | #endif//MT_DEBUG_BS_WR |
| 148 | 148 | SSpatialLayerInternal *pParamInternal = &m_pCtx->pSvcParam->sDependencyLayers[m_pCtx->uiDependencyId]; | |
| 149 | if (m_bNeedPrefix) { | 149 | if (m_bNeedPrefix) { |
| 150 | if (m_eNalRefIdc != NRI_PRI_LOWEST) { | 150 | if (m_eNalRefIdc != NRI_PRI_LOWEST) { |
| 151 | WelsLoadNalForSlice (m_pSliceBs, NAL_UNIT_PREFIX, m_eNalRefIdc); | 151 | WelsLoadNalForSlice (m_pSliceBs, NAL_UNIT_PREFIX, m_eNalRefIdc); |
| @@ -171,7 +171,7 @@ WelsErrorType CWelsSliceEncodingTask::ExecuteTask() { · 19 unmodified lines | |||
| 171 | if (ENC_RETURN_SUCCESS != iReturn) { | 171 | if (ENC_RETURN_SUCCESS != iReturn) { |
| 172 | WelsLog (&m_pCtx->sLogCtx, WELS_LOG_WARNING, | 172 | WelsLog (&m_pCtx->sLogCtx, WELS_LOG_WARNING, |
| 173 | "[MT] CWelsSliceEncodingTask ExecuteTask(), WriteSliceBs not successful: coding_idx %d, um_iSliceIdx %d", | 173 | "[MT] CWelsSliceEncodingTask ExecuteTask(), WriteSliceBs not successful: coding_idx %d, um_iSliceIdx %d", |
| 174 | m_pCtx->iCodingIndex, | 174 | pParamInternal->iCodingIndex, |
| 175 | m_iSliceIdx); | 175 | m_iSliceIdx); |
| 176 | return iReturn; | 176 | return iReturn; |
| 177 | } | 177 | } |
| @@ -209,11 +209,11 @@ WelsErrorType CWelsLoadBalancingSlicingEncodingTask::InitTask() { · 31 unmodified lines | |||
| 209 | 209 | ||
| 210 | void CWelsLoadBalancingSlicingEncodingTask::FinishTask() { | 210 | void CWelsLoadBalancingSlicingEncodingTask::FinishTask() { |
| 211 | CWelsSliceEncodingTask::FinishTask(); | 211 | CWelsSliceEncodingTask::FinishTask(); |
| 212 | 212 | SSpatialLayerInternal *pParamInternal = &m_pCtx->pSvcParam->sDependencyLayers[m_pCtx->uiDependencyId]; | |
| 213 | m_pSlice->uiSliceConsumeTime = (uint32_t) (WelsTime() - m_iSliceStart); | 213 | m_pSlice->uiSliceConsumeTime = (uint32_t) (WelsTime() - m_iSliceStart); |
| 214 | WelsLog (&m_pCtx->sLogCtx, WELS_LOG_DEBUG, | 214 | WelsLog (&m_pCtx->sLogCtx, WELS_LOG_DEBUG, |
| 215 | "[MT] CWelsLoadBalancingSlicingEncodingTask()FinishTask, coding_idx %d, um_iSliceIdx %d, uiSliceConsumeTime %d, m_iSliceSize %d, iFirstMbInSlice %d, count_num_mb_in_slice %d at time=%" PRId64, | 215 | "[MT] CWelsLoadBalancingSlicingEncodingTask()FinishTask, coding_idx %d, um_iSliceIdx %d, uiSliceConsumeTime %d, m_iSliceSize %d, iFirstMbInSlice %d, count_num_mb_in_slice %d at time=%" PRId64, |
| 216 | m_pCtx->iCodingIndex, | 216 | pParamInternal->iCodingIndex, |
| 217 | m_iSliceIdx, | 217 | m_iSliceIdx, |
| 218 | m_pSlice->uiSliceConsumeTime, | 218 | m_pSlice->uiSliceConsumeTime, |
| 219 | m_iSliceSize, | 219 | m_iSliceSize, |
| @@ -230,7 +230,7 @@ WelsErrorType CWelsConstrainedSizeSlicingEncodingTask::ExecuteTask() { · 10 unmodified lines | |||
| 230 | SSliceCtx* pSliceCtx = &pCurDq->sSliceEncCtx; | 230 | SSliceCtx* pSliceCtx = &pCurDq->sSliceEncCtx; |
| 231 | const int32_t kiSliceIdxStep = m_pCtx->iActiveThreadsNum; | 231 | const int32_t kiSliceIdxStep = m_pCtx->iActiveThreadsNum; |
| 232 | 232 | ||
| 233 | 233 | SSpatialLayerInternal *pParamInternal = &m_pCtx->pSvcParam->sDependencyLayers[m_pCtx->uiDependencyId]; | |
| 234 | SSliceHeaderExt* pStartSliceHeaderExt = &pCurDq->sLayerInfo.pSliceInLayer[m_iSliceIdx].sSliceHeaderExt; | 234 | SSliceHeaderExt* pStartSliceHeaderExt = &pCurDq->sLayerInfo.pSliceInLayer[m_iSliceIdx].sSliceHeaderExt; |
| 235 | 235 | ||
| 236 | //deal with partition: TODO: here SSliceThreadPrivateData is just for parition info and actually has little relationship with threadbuffer, and iThreadIndex is not used in threadpool model, need renaming after removing old logic to avoid confusion | 236 | //deal with partition: TODO: here SSliceThreadPrivateData is just for parition info and actually has little relationship with threadbuffer, and iThreadIndex is not used in threadpool model, need renaming after removing old logic to avoid confusion |
| @@ -252,7 +252,7 @@ WelsErrorType CWelsConstrainedSizeSlicingEncodingTask::ExecuteTask() { · 15 unmodified lines | |||
| 252 | if (iLocalSliceIdx >= pSliceCtx->iMaxSliceNumConstraint) { | 252 | if (iLocalSliceIdx >= pSliceCtx->iMaxSliceNumConstraint) { |
| 253 | WelsLog (&m_pCtx->sLogCtx, WELS_LOG_WARNING, | 253 | WelsLog (&m_pCtx->sLogCtx, WELS_LOG_WARNING, |
| 254 | "[MT] CWelsConstrainedSizeSlicingEncodingTask ExecuteTask() coding_idx %d, uiLocalSliceIdx %d, pSliceCtx->iMaxSliceNumConstraint %d", | 254 | "[MT] CWelsConstrainedSizeSlicingEncodingTask ExecuteTask() coding_idx %d, uiLocalSliceIdx %d, pSliceCtx->iMaxSliceNumConstraint %d", |
| 255 | m_pCtx->iCodingIndex, | 255 | pParamInternal->iCodingIndex, |
| 256 | iLocalSliceIdx, pSliceCtx->iMaxSliceNumConstraint); | 256 | iLocalSliceIdx, pSliceCtx->iMaxSliceNumConstraint); |
| 257 | return ENC_RETURN_KNOWN_ISSUE; | 257 | return ENC_RETURN_KNOWN_ISSUE; |
| 258 | } | 258 | } |
| @@ -288,7 +288,7 @@ WelsErrorType CWelsConstrainedSizeSlicingEncodingTask::ExecuteTask() { · 29 unmodified lines | |||
| 288 | if (ENC_RETURN_SUCCESS != iReturn) { | 288 | if (ENC_RETURN_SUCCESS != iReturn) { |
| 289 | WelsLog (&m_pCtx->sLogCtx, WELS_LOG_WARNING, | 289 | WelsLog (&m_pCtx->sLogCtx, WELS_LOG_WARNING, |
| 290 | "[MT] CWelsConstrainedSizeSlicingEncodingTask ExecuteTask(), WriteSliceBs not successful: coding_idx %d, uiLocalSliceIdx %d, BufferSize %d, m_iSliceSize %d, iPayloadSize %d", | 290 | "[MT] CWelsConstrainedSizeSlicingEncodingTask ExecuteTask(), WriteSliceBs not successful: coding_idx %d, uiLocalSliceIdx %d, BufferSize %d, m_iSliceSize %d, iPayloadSize %d", |
| 291 | m_pCtx->iCodingIndex, | 291 | pParamInternal->iCodingIndex, |
| 292 | iLocalSliceIdx, m_pSliceBs->uiSize, m_iSliceSize, m_pSliceBs->sNalList[0].iPayloadSize); | 292 | iLocalSliceIdx, m_pSliceBs->uiSize, m_iSliceSize, m_pSliceBs->sNalList[0].iPayloadSize); |
| 293 | return iReturn; | 293 | return iReturn; |
| 294 | } | 294 | } |
| @@ -305,7 +305,7 @@ WelsErrorType CWelsConstrainedSizeSlicingEncodingTask::ExecuteTask() { · 10 unmodified lines | |||
| 305 | 305 | ||
| 306 | WelsLog (&m_pCtx->sLogCtx, WELS_LOG_DEBUG, | 306 | WelsLog (&m_pCtx->sLogCtx, WELS_LOG_DEBUG, |
| 307 | "[MT] CWelsConstrainedSizeSlicingEncodingTask(), coding_idx %d, iPartitionId %d, m_iThreadIdx %d, iLocalSliceIdx %d, m_iSliceSize %d, ParamValidationExt(), invalid uiMaxNalSizeiEndMbInPartition %d, pCurDq->pLastCodedMbIdxOfPartition[%d] %d\n", | 307 | "[MT] CWelsConstrainedSizeSlicingEncodingTask(), coding_idx %d, iPartitionId %d, m_iThreadIdx %d, iLocalSliceIdx %d, m_iSliceSize %d, ParamValidationExt(), invalid uiMaxNalSizeiEndMbInPartition %d, pCurDq->pLastCodedMbIdxOfPartition[%d] %d\n", |
| 308 | m_pCtx->iCodingIndex, kiPartitionId, m_iThreadIdx, iLocalSliceIdx, m_iSliceSize, | 308 | pParamInternal->iCodingIndex, kiPartitionId, m_iThreadIdx, iLocalSliceIdx, m_iSliceSize, |
| 309 | kiEndMbInPartition, kiPartitionId, pCurDq->pLastCodedMbIdxOfPartition[kiPartitionId]); | 309 | kiEndMbInPartition, kiPartitionId, pCurDq->pLastCodedMbIdxOfPartition[kiPartitionId]); |
| 310 | 310 | ||
| 311 | iAnyMbLeftInPartition = kiEndMbInPartition - (1 + pCurDq->pLastCodedMbIdxOfPartition[kiPartitionId]); | 311 | iAnyMbLeftInPartition = kiEndMbInPartition - (1 + pCurDq->pLastCodedMbIdxOfPartition[kiPartitionId]); |