Showing the changes to codec/encoder/core/src/wels_task_encoder.cpp (1 of 5 files). Show all
Unified · Split
| @@ -232,26 +232,24 @@ void CWelsLoadBalancingSlicingEncodingTask::FinishTask() { · 231 unmodified lines | ||
| 232 | 232 | //CWelsConstrainedSizeSlicingEncodingTask |
| 233 | 233 | WelsErrorType CWelsConstrainedSizeSlicingEncodingTask::ExecuteTask() { |
| 234 | 234 | |
| 235 | − SDqLayer* pCurDq = m_pCtx->pCurDqLayer; | |
| 236 | − | |
| 235 | + SDqLayer* pCurDq = m_pCtx->pCurDqLayer; | |
| 237 | 236 | SSliceCtx* pSliceCtx = &pCurDq->sSliceEncCtx; |
| 238 | 237 | const int32_t kiSliceIdxStep = m_pCtx->iActiveThreadsNum; |
| 239 | − | |
| 240 | − SSpatialLayerInternal* pParamInternal = &m_pCtx->pSvcParam->sDependencyLayers[m_pCtx->uiDependencyId]; | |
| 238 | + SSpatialLayerInternal* pParamInternal = &m_pCtx->pSvcParam->sDependencyLayers[m_pCtx->uiDependencyId]; | |
| 241 | 239 | SSliceHeaderExt* pStartSliceHeaderExt = &pCurDq->ppSliceInLayer[m_iSliceIdx]->sSliceHeaderExt; |
| 242 | − | |
| 243 | − //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 | |
| 244 | 240 | const int32_t kiPartitionId = m_iSliceIdx % kiSliceIdxStep; |
| 245 | 241 | const int32_t kiFirstMbInPartition = pCurDq->pFirstMbIdxOfPartition[kiPartitionId]; |
| 246 | 242 | const int32_t kiEndMbIdxInPartition = pCurDq->pEndMbIdxOfPartition[kiPartitionId]; |
| 247 | 243 | pStartSliceHeaderExt->sSliceHeader.iFirstMbInSlice = kiFirstMbInPartition; |
| 248 | 244 | pCurDq->pNumSliceCodedOfPartition[kiPartitionId] = 1; |
| 249 | 245 | pCurDq->pLastCodedMbIdxOfPartition[kiPartitionId] = 0; |
| 250 | − //end of deal with partition | |
| 246 | + | |
| 247 | + //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 | |
| 251 | 248 | |
| 252 | 249 | int32_t iAnyMbLeftInPartition = kiEndMbIdxInPartition - kiFirstMbInPartition + 1; |
| 253 | 250 | int32_t iLocalSliceIdx = m_iSliceIdx; |
| 254 | 251 | while (iAnyMbLeftInPartition > 0) { |
| 252 | + //TODO: will reallocate | |
| 255 | 253 | if (iLocalSliceIdx >= pSliceCtx->iMaxSliceNumConstraint) { |
| 256 | 254 | WelsLog (&m_pCtx->sLogCtx, WELS_LOG_WARNING, |
| 257 | 255 | "[MT] CWelsConstrainedSizeSlicingEncodingTask ExecuteTask() coding_idx %d, uiLocalSliceIdx %d, pSliceCtx->iMaxSliceNumConstraint %d", |