Showing the changes to codec/encoder/core/src/wels_task_encoder.cpp (1 of 7 files). Show all
Unified · Split
| @@ -240,18 +240,14 @@ WelsErrorType CWelsConstrainedSizeSlicingEncodingTask::ExecuteTask() { · 239 unmodified lines | |||
| 240 | 240 | ||
| 241 | //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 | 241 | //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 |
| 242 | const int32_t kiPartitionId = m_iSliceIdx % kiSliceIdxStep; | 242 | const int32_t kiPartitionId = m_iSliceIdx % kiSliceIdxStep; |
| 243 | SSliceThreadPrivateData* pPrivateData = & (m_pCtx->pSliceThreading->pThreadPEncCtx[kiPartitionId]); | 243 | const int32_t kiFirstMbInPartition = pCurDq->pFirstMbIdxOfPartition[kiPartitionId]; |
| 244 | const int32_t kiFirstMbInPartition = pPrivateData->iStartMbIndex; // inclusive | 244 | const int32_t kiEndMbIdxInPartition = pCurDq->pEndMbIdxOfPartition[kiPartitionId]; |
| 245 | const int32_t kiEndMbInPartition = pPrivateData->iEndMbIndex; // exclusive | ||
| 246 | pStartSliceHeaderExt->sSliceHeader.iFirstMbInSlice = kiFirstMbInPartition; | 245 | pStartSliceHeaderExt->sSliceHeader.iFirstMbInSlice = kiFirstMbInPartition; |
| 247 | pCurDq->pNumSliceCodedOfPartition[kiPartitionId] = | 246 | pCurDq->pNumSliceCodedOfPartition[kiPartitionId] = 1; |
| 248 | 1; // one pSlice per partition intialized, dynamic slicing inside | ||
| 249 | pCurDq->pLastMbIdxOfPartition[kiPartitionId] = kiEndMbInPartition - 1; | ||
| 250 | |||
| 251 | pCurDq->pLastCodedMbIdxOfPartition[kiPartitionId] = 0; | 247 | pCurDq->pLastCodedMbIdxOfPartition[kiPartitionId] = 0; |
| 252 | //end of deal with partition | 248 | //end of deal with partition |
| 253 | 249 | ||
| 254 | int32_t iAnyMbLeftInPartition = kiEndMbInPartition - kiFirstMbInPartition; | 250 | int32_t iAnyMbLeftInPartition = kiEndMbIdxInPartition - kiFirstMbInPartition + 1; |
| 255 | int32_t iLocalSliceIdx = m_iSliceIdx; | 251 | int32_t iLocalSliceIdx = m_iSliceIdx; |
| 256 | while (iAnyMbLeftInPartition > 0) { | 252 | while (iAnyMbLeftInPartition > 0) { |
| 257 | if (iLocalSliceIdx >= pSliceCtx->iMaxSliceNumConstraint) { | 253 | if (iLocalSliceIdx >= pSliceCtx->iMaxSliceNumConstraint) { |
| @@ -312,9 +308,9 @@ WelsErrorType CWelsConstrainedSizeSlicingEncodingTask::ExecuteTask() { · 54 unmodified lines | |||
| 312 | WelsLog (&m_pCtx->sLogCtx, WELS_LOG_DEBUG, | 308 | WelsLog (&m_pCtx->sLogCtx, WELS_LOG_DEBUG, |
| 313 | "[MT] CWelsConstrainedSizeSlicingEncodingTask(), coding_idx %d, iPartitionId %d, m_iThreadIdx %d, iLocalSliceIdx %d, m_iSliceSize %d, ParamValidationExt(), invalid uiMaxNalSizeiEndMbInPartition %d, pCurDq->pLastCodedMbIdxOfPartition[%d] %d\n", | 309 | "[MT] CWelsConstrainedSizeSlicingEncodingTask(), coding_idx %d, iPartitionId %d, m_iThreadIdx %d, iLocalSliceIdx %d, m_iSliceSize %d, ParamValidationExt(), invalid uiMaxNalSizeiEndMbInPartition %d, pCurDq->pLastCodedMbIdxOfPartition[%d] %d\n", |
| 314 | pParamInternal->iCodingIndex, kiPartitionId, m_iThreadIdx, iLocalSliceIdx, m_iSliceSize, | 310 | pParamInternal->iCodingIndex, kiPartitionId, m_iThreadIdx, iLocalSliceIdx, m_iSliceSize, |
| 315 | kiEndMbInPartition, kiPartitionId, pCurDq->pLastCodedMbIdxOfPartition[kiPartitionId]); | 311 | kiEndMbIdxInPartition, kiPartitionId, pCurDq->pLastCodedMbIdxOfPartition[kiPartitionId]); |
| 316 | 312 | ||
| 317 | iAnyMbLeftInPartition = kiEndMbInPartition - (1 + pCurDq->pLastCodedMbIdxOfPartition[kiPartitionId]); | 313 | iAnyMbLeftInPartition = kiEndMbIdxInPartition - pCurDq->pLastCodedMbIdxOfPartition[kiPartitionId]; |
| 318 | iLocalSliceIdx += kiSliceIdxStep; | 314 | iLocalSliceIdx += kiSliceIdxStep; |
| 319 | } | 315 | } |
| 320 | 316 | ||