Showing the changes to codec/encoder/core/src/slice_multi_threading.cpp (1 of 20 files). Show all
Unified · Split
| @@ -353,7 +353,7 @@ int32_t RequestMtResource (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pCodingPara · 352 unmodified lines | ||
| 353 | 353 | |
| 354 | 354 | pMa = (*ppCtx)->pMemAlign; |
| 355 | 355 | pPara = pCodingParam; |
| 356 | − iNumSpatialLayers = pPara->iNumDependencyLayer; | |
| 356 | + iNumSpatialLayers = pPara->iSpatialLayerNum; | |
| 357 | 357 | iThreadNum = pPara->iCountThreadsNum; |
| 358 | 358 | iMaxSliceNum = (*ppCtx)->iMaxSliceCount; |
| 359 | 359 | |
| @@ -399,8 +399,8 @@ int32_t RequestMtResource (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pCodingPara · 39 unmodified lines | ||
| 399 | 399 | #if defined(DYNAMIC_SLICE_ASSIGN) || defined(MT_DEBUG) |
| 400 | 400 | iIdx = 0; |
| 401 | 401 | while (iIdx < iNumSpatialLayers) { |
| 402 | − SMulSliceOption* pMso = &pPara->sDependencyLayers[iIdx].sMso; | |
| 403 | − const int32_t kiSliceNum = pMso->sSliceArgument.iSliceNum; | |
| 402 | + SSliceConfig* pMso = &pPara->sDependencyLayers[iIdx].sSliceCfg; | |
| 403 | + const int32_t kiSliceNum = pMso->sSliceArgument.uiSliceNum; | |
| 404 | 404 | if (pMso->uiSliceMode == SM_FIXEDSLCNUM_SLICE && pPara->iMultipleThreadIdc > 1 |
| 405 | 405 | && pPara->iMultipleThreadIdc >= kiSliceNum) { |
| 406 | 406 | pSmt->pSliceConsumeTime[iIdx] = (uint32_t*)pMa->WelsMallocz (kiSliceNum * sizeof (uint32_t), "pSliceConsumeTime[]"); |
| @@ -638,7 +638,7 @@ void ReleaseMtResource (sWelsEncCtx** ppCtx) { · 231 unmodified lines | ||
| 638 | 638 | } |
| 639 | 639 | #if defined(DYNAMIC_SLICE_ASSIGN) || defined(MT_DEBUG) |
| 640 | 640 | iIdx = 0; |
| 641 | − while (iIdx < pCodingParam->iNumDependencyLayer) { | |
| 641 | + while (iIdx < pCodingParam->iSpatialLayerNum) { | |
| 642 | 642 | if (pSmt->pSliceConsumeTime[iIdx]) { |
| 643 | 643 | pMa->WelsFree (pSmt->pSliceConsumeTime[iIdx], "pSliceConsumeTime[]"); |
| 644 | 644 | pSmt->pSliceConsumeTime[iIdx] = NULL; |
| @@ -688,7 +688,8 @@ int32_t AppendSliceToFrameBs (sWelsEncCtx* pCtx, SLayerBSInfo* pLbi, const int32 · 43 unmodified lines | ||
| 688 | 688 | SWelsSvcCodingParam* pCodingParam = pCtx->pSvcParam; |
| 689 | 689 | SDLayerParam* pDlp = &pCodingParam->sDependencyLayers[pCtx->uiDependencyId]; |
| 690 | 690 | SWelsSliceBs* pSliceBs = NULL; |
| 691 | − const bool kbIsDynamicSlicingMode = (pDlp->sMso.uiSliceMode == SM_DYN_SLICE); | |
| 691 | + const bool kbIsDynamicSlicingMode = (pDlp->sSliceCfg.uiSliceMode == SM_DYN_SLICE); | |
| 692 | + | |
| 692 | 693 | int32_t iLayerSize = 0; |
| 693 | 694 | int32_t iNalIdxBase = pLbi->iNalCount; |
| 694 | 695 | int32_t iSliceIdx = 0; |
| @@ -944,7 +945,7 @@ WELS_THREAD_ROUTINE_TYPE CodingSliceThreadProc (void* arg) { · 249 unmodified lines | ||
| 944 | 945 | eNalRefIdc = pEncPEncCtx->eNalPriority; |
| 945 | 946 | bNeedPrefix = pEncPEncCtx->bNeedPrefixNalFlag; |
| 946 | 947 | |
| 947 | − if (pParamD->sMso.uiSliceMode != SM_DYN_SLICE) { | |
| 948 | + if (pParamD->sSliceCfg.uiSliceMode != SM_DYN_SLICE) { | |
| 948 | 949 | int64_t iSliceStart = 0; |
| 949 | 950 | bool bDsaFlag = false; |
| 950 | 951 | iSliceIdx = pPrivateData->iSliceIndex; |
| @@ -952,9 +953,9 @@ WELS_THREAD_ROUTINE_TYPE CodingSliceThreadProc (void* arg) { · 1 unmodified line | ||
| 952 | 953 | pSliceBs = &pEncPEncCtx->pSliceBs[iSliceIdx]; |
| 953 | 954 | |
| 954 | 955 | #if defined(DYNAMIC_SLICE_ASSIGN) || defined(MT_DEBUG) |
| 955 | − bDsaFlag = (pParamD->sMso.uiSliceMode == SM_FIXEDSLCNUM_SLICE && | |
| 956 | + bDsaFlag = (pParamD->sSliceCfg.uiSliceMode == SM_FIXEDSLCNUM_SLICE && | |
| 956 | 957 | pCodingParam->iMultipleThreadIdc > 1 && |
| 957 | − pCodingParam->iMultipleThreadIdc >= pParamD->sMso.sSliceArgument.iSliceNum); | |
| 958 | + pCodingParam->iMultipleThreadIdc >= pParamD->sSliceCfg.sSliceArgument.uiSliceNum); | |
| 958 | 959 | if (bDsaFlag) |
| 959 | 960 | iSliceStart = WelsTime(); |
| 960 | 961 | #endif//DYNAMIC_SLICE_ASSIGN || MT_DEBUG |
| @@ -1376,10 +1377,11 @@ int32_t AdjustEnhanceLayer (sWelsEncCtx* pCtx, int32_t iCurDid) { · 415 unmodified lines | ||
| 1376 | 1377 | int32_t iNeedAdj = 1; |
| 1377 | 1378 | // uiSliceMode of referencing spatial should be SM_FIXEDSLCNUM_SLICE |
| 1378 | 1379 | // if using spatial base layer for complexity estimation |
| 1380 | + | |
| 1379 | 1381 | const bool kbModelingFromSpatial = (pCtx->pCurDqLayer->pRefLayer != NULL && iCurDid > 0) |
| 1380 | − && (pCtx->pSvcParam->sDependencyLayers[iCurDid - 1].sMso.uiSliceMode == SM_FIXEDSLCNUM_SLICE | |
| 1382 | + && (pCtx->pSvcParam->sDependencyLayers[iCurDid - 1].sSliceCfg.uiSliceMode == SM_FIXEDSLCNUM_SLICE | |
| 1381 | 1383 | && pCtx->pSvcParam->iMultipleThreadIdc >= pCtx->pSvcParam->sDependencyLayers[iCurDid - |
| 1382 | − 1].sMso.sSliceArgument.iSliceNum); | |
| 1384 | + 1].sSliceCfg.sSliceArgument.uiSliceNum); | |
| 1383 | 1385 | |
| 1384 | 1386 | if (kbModelingFromSpatial) { // using spatial base layer for complexity estimation |
| 1385 | 1387 | #ifdef TRY_SLICING_BALANCE |
| @@ -1457,7 +1459,7 @@ void TrackSliceConsumeTime (sWelsEncCtx* pCtx, int32_t* pDidList, const int32_t · 71 unmodified lines | ||
| 1457 | 1459 | while (iSpatialIdx < iSpatialNum) { |
| 1458 | 1460 | const int32_t kiDid = pDidList[iSpatialIdx]; |
| 1459 | 1461 | SDLayerParam* pDlp = &pPara->sDependencyLayers[kiDid]; |
| 1460 | − SMulSliceOption* pMso = &pDlp->sMso; | |
| 1462 | + SMulSliceOption* pMso = &pDlp->sSliceCfg; | |
| 1461 | 1463 | SDqLayer* pCurDq = pCtx->ppDqLayerList[kiDid]; |
| 1462 | 1464 | SSliceCtx* pSliceCtx = pCurDq->pSliceEncCtx; |
| 1463 | 1465 | const uint32_t kuiCountSliceNum = pSliceCtx->iSliceNumInFrame; |