History

Multi-thread-fixed:RBC#1710:move PartitionMBIdx info from slice thread private to layer data structure and refactoring for its int/update module

Huade Shi (huashi) committed 9 years ago

Commit 0d84ead1 parent 83305d87 files · +73 −83Browse files

Showing the changes to codec/encoder/core/src/wels_task_encoder.cpp (1 of 7 files). Show all

Unified · Split

codec/encoder/core/src/wels_task_encoder.cpp+6−10
@@ -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 confusion241 //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; // inclusive244 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 partition248 //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

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t