Showing the changes to codec/encoder/core/src/slice_multi_threading.cpp (1 of 11 files). Show all
Unified · Split
| @@ -322,7 +322,7 @@ int32_t RequestMtResource (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pCodingPara · 321 unmodified lines | ||
| 322 | 322 | |
| 323 | 323 | iIdx = 0; |
| 324 | 324 | while (iIdx < iNumSpatialLayers) { |
| 325 | − SSliceConfig* pMso = &pPara->sDependencyLayers[iIdx].sSliceCfg; | |
| 325 | + SSliceConfig* pMso = &pPara->sSpatialLayers[iIdx].sSliceCfg; | |
| 326 | 326 | const int32_t kiSliceNum = pMso->sSliceArgument.uiSliceNum; |
| 327 | 327 | if (((pMso->uiSliceMode == SM_FIXEDSLCNUM_SLICE) || (pMso->uiSliceMode == SM_AUTO_SLICE)) |
| 328 | 328 | && pPara->iMultipleThreadIdc > 1 |
| @@ -520,7 +520,7 @@ void ReleaseMtResource (sWelsEncCtx** ppCtx) { · 191 unmodified lines | ||
| 520 | 520 | |
| 521 | 521 | int32_t AppendSliceToFrameBs (sWelsEncCtx* pCtx, SLayerBSInfo* pLbi, const int32_t iSliceCount) { |
| 522 | 522 | SWelsSvcCodingParam* pCodingParam = pCtx->pSvcParam; |
| 523 | − SDLayerParam* pDlp = &pCodingParam->sDependencyLayers[pCtx->uiDependencyId]; | |
| 523 | + SSpatialLayerConfig* pDlp = &pCodingParam->sSpatialLayers[pCtx->uiDependencyId]; | |
| 524 | 524 | SWelsSliceBs* pSliceBs = NULL; |
| 525 | 525 | const bool kbIsDynamicSlicingMode = (pDlp->sSliceCfg.uiSliceMode == SM_DYN_SLICE); |
| 526 | 526 | |
| @@ -717,7 +717,7 @@ WELS_THREAD_ROUTINE_TYPE CodingSliceThreadProc (void* arg) { · 190 unmodified lines | ||
| 717 | 717 | const int32_t kiCurDid = pEncPEncCtx->uiDependencyId; |
| 718 | 718 | const int32_t kiCurTid = pEncPEncCtx->uiTemporalId; |
| 719 | 719 | SWelsSvcCodingParam* pCodingParam = pEncPEncCtx->pSvcParam; |
| 720 | − SDLayerParam* pParamD = &pCodingParam->sDependencyLayers[kiCurDid]; | |
| 720 | + SSpatialLayerConfig* pParamD = &pCodingParam->sSpatialLayers[kiCurDid]; | |
| 721 | 721 | |
| 722 | 722 | pCurDq = pEncPEncCtx->pCurDqLayer; |
| 723 | 723 | eNalType = pEncPEncCtx->eNalType; |
| @@ -788,7 +788,8 @@ WELS_THREAD_ROUTINE_TYPE CodingSliceThreadProc (void* arg) { · 64 unmodified lines | ||
| 788 | 788 | if (pCurDq->bDeblockingParallelFlag && pSlice->sSliceHeaderExt.sSliceHeader.uiDisableDeblockingFilterIdc != 1 |
| 789 | 789 | #if !defined(ENABLE_FRAME_DUMP) |
| 790 | 790 | && (eNalRefIdc != NRI_PRI_LOWEST) && |
| 791 | − (pParamD->iHighestTemporalId == 0 || kiCurTid < pParamD->iHighestTemporalId) | |
| 791 | + (pCodingParam->sDependencyLayers[kiCurDid].iHighestTemporalId == 0 | |
| 792 | + || kiCurTid < pCodingParam->sDependencyLayers[kiCurDid].iHighestTemporalId) | |
| 792 | 793 | #endif// !ENABLE_FRAME_DUMP |
| 793 | 794 | ) { |
| 794 | 795 | DeblockingFilterSliceAvcbase (pCurDq, pEncPEncCtx->pFuncList, iSliceIdx); |
| @@ -896,7 +897,8 @@ WELS_THREAD_ROUTINE_TYPE CodingSliceThreadProc (void* arg) { · 101 unmodified lines | ||
| 896 | 897 | if (pCurDq->bDeblockingParallelFlag && pSlice->sSliceHeaderExt.sSliceHeader.uiDisableDeblockingFilterIdc != 1 |
| 897 | 898 | #if !defined(ENABLE_FRAME_DUMP) |
| 898 | 899 | && (eNalRefIdc != NRI_PRI_LOWEST) && |
| 899 | − (pParamD->iHighestTemporalId == 0 || kiCurTid < pParamD->iHighestTemporalId) | |
| 900 | + (pCodingParam->sDependencyLayers[kiCurDid].iHighestTemporalId == 0 | |
| 901 | + || kiCurTid < pCodingParam->sDependencyLayers[kiCurDid].iHighestTemporalId) | |
| 900 | 902 | #endif// !ENABLE_FRAME_DUMP |
| 901 | 903 | ) { |
| 902 | 904 | DeblockingFilterSliceAvcbase (pCurDq, pEncPEncCtx->pFuncList, iSliceIdx); |
| @@ -1050,8 +1052,8 @@ int32_t AdjustEnhanceLayer (sWelsEncCtx* pCtx, int32_t iCurDid) { · 147 unmodified lines | ||
| 1050 | 1052 | // if using spatial base layer for complexity estimation |
| 1051 | 1053 | |
| 1052 | 1054 | const bool kbModelingFromSpatial = (pCtx->pCurDqLayer->pRefLayer != NULL && iCurDid > 0) |
| 1053 | − && (pCtx->pSvcParam->sDependencyLayers[iCurDid - 1].sSliceCfg.uiSliceMode == SM_FIXEDSLCNUM_SLICE | |
| 1054 | − && pCtx->pSvcParam->iMultipleThreadIdc >= pCtx->pSvcParam->sDependencyLayers[iCurDid - | |
| 1055 | + && (pCtx->pSvcParam->sSpatialLayers[iCurDid - 1].sSliceCfg.uiSliceMode == SM_FIXEDSLCNUM_SLICE | |
| 1056 | + && pCtx->pSvcParam->iMultipleThreadIdc >= pCtx->pSvcParam->sSpatialLayers[iCurDid - | |
| 1055 | 1057 | 1].sSliceCfg.sSliceArgument.uiSliceNum); |
| 1056 | 1058 | |
| 1057 | 1059 | if (kbModelingFromSpatial) { // using spatial base layer for complexity estimation |
| @@ -1115,7 +1117,7 @@ void TrackSliceConsumeTime (sWelsEncCtx* pCtx, int32_t* pDidList, const int32_t · 57 unmodified lines | ||
| 1115 | 1117 | pPara = pCtx->pSvcParam; |
| 1116 | 1118 | while (iSpatialIdx < iSpatialNum) { |
| 1117 | 1119 | const int32_t kiDid = pDidList[iSpatialIdx]; |
| 1118 | − SDLayerParam* pDlp = &pPara->sDependencyLayers[kiDid]; | |
| 1120 | + SSpatialLayerInternal* pDlp = &pPara->sDependencyLayers[kiDid]; | |
| 1119 | 1121 | SSliceConfig* pMso = &pDlp->sSliceCfg; |
| 1120 | 1122 | SDqLayer* pCurDq = pCtx->ppDqLayerList[kiDid]; |
| 1121 | 1123 | SSliceCtx* pSliceCtx = pCurDq->pSliceEncCtx; |