Showing the changes to codec/encoder/core/src/svc_encode_slice.cpp (1 of 17 files). Show all
Unified · Split
| @@ -921,10 +921,10 @@ bool DynSlcJudgeSliceBoundaryStepBack (void* pCtx, void* pSlice, SSliceCtx* pSli · 920 unmodified lines | |||
| 921 | /////////////// | 921 | /////////////// |
| 922 | // pMb loop | 922 | // pMb loop |
| 923 | /////////////// | 923 | /////////////// |
| 924 | inline void WelsInitInterMDStruc (const SMB* pCurMb, uint16_t* pMvdCostTableInter, const int32_t kiMvdInterTableStride, | 924 | inline void WelsInitInterMDStruc (const SMB* pCurMb, uint16_t* pMvdCostTable, const int32_t kiMvdInterTableStride, |
| 925 | SWelsMD* pMd) { | 925 | SWelsMD* pMd) { |
| 926 | pMd->iLambda = g_kiQpCostTable[pCurMb->uiLumaQp]; | 926 | pMd->iLambda = g_kiQpCostTable[pCurMb->uiLumaQp]; |
| 927 | pMd->pMvdCost = &pMvdCostTableInter[pCurMb->uiLumaQp * kiMvdInterTableStride]; | 927 | pMd->pMvdCost = &pMvdCostTable[pCurMb->uiLumaQp * kiMvdInterTableStride]; |
| 928 | pMd-> iMbPixX = (pCurMb->iMbX << 4); | 928 | pMd-> iMbPixX = (pCurMb->iMbX << 4); |
| 929 | pMd-> iMbPixY = (pCurMb->iMbY << 4); | 929 | pMd-> iMbPixY = (pCurMb->iMbY << 4); |
| 930 | memset (&pMd->iBlock8x8StaticIdc[0], 0, sizeof (pMd->iBlock8x8StaticIdc)); | 930 | memset (&pMd->iBlock8x8StaticIdc[0], 0, sizeof (pMd->iBlock8x8StaticIdc)); |
| @@ -943,9 +943,8 @@ int32_t WelsMdInterMbLoop (sWelsEncCtx* pEncCtx, SSlice* pSlice, void* pWelsMd, · 12 unmodified lines | |||
| 943 | int32_t iCurMbIdx = -1; | 943 | int32_t iCurMbIdx = -1; |
| 944 | int32_t iMbSkipRun = 0; | 944 | int32_t iMbSkipRun = 0; |
| 945 | const int32_t kiTotalNumMb = pCurLayer->iMbWidth * pCurLayer->iMbHeight; | 945 | const int32_t kiTotalNumMb = pCurLayer->iMbWidth * pCurLayer->iMbHeight; |
| 946 | const int32_t kiMvdInterTableSize = (pEncCtx->pSvcParam->iSpatialLayerNum == 1 ? 648 : 972); | 946 | const int32_t kiMvdInterTableStride = pEncCtx->iMvdCostTableStride; |
| 947 | const int32_t kiMvdInterTableStride = 1 + (kiMvdInterTableSize << 1); | 947 | uint16_t* pMvdCostTable = &pEncCtx->pMvdCostTable[pEncCtx->iMvdCostTableSize]; |
| 948 | uint16_t* pMvdCostTableInter = &pEncCtx->pMvdCostTableInter[kiMvdInterTableSize]; | ||
| 949 | const int32_t kiSliceIdx = pSlice->uiSliceIdx; | 948 | const int32_t kiSliceIdx = pSlice->uiSliceIdx; |
| 950 | const uint8_t kuiChromaQpIndexOffset = pCurLayer->sLayerInfo.pPpsP->uiChromaQpIndexOffset; | 949 | const uint8_t kuiChromaQpIndexOffset = pCurLayer->sLayerInfo.pPpsP->uiChromaQpIndexOffset; |
| 951 | int32_t iEncReturn = ENC_RETURN_SUCCESS; | 950 | int32_t iEncReturn = ENC_RETURN_SUCCESS; |
| @@ -965,7 +964,7 @@ int32_t WelsMdInterMbLoop (sWelsEncCtx* pEncCtx, SSlice* pSlice, void* pWelsMd, · 13 unmodified lines | |||
| 965 | WelsMdInterInit (pEncCtx, pSlice, pCurMb, kiSliceFirstMbXY); | 964 | WelsMdInterInit (pEncCtx, pSlice, pCurMb, kiSliceFirstMbXY); |
| 966 | 965 | ||
| 967 | TRY_REENCODING: | 966 | TRY_REENCODING: |
| 968 | WelsInitInterMDStruc (pCurMb, pMvdCostTableInter, kiMvdInterTableStride, pMd); | 967 | WelsInitInterMDStruc (pCurMb, pMvdCostTable, kiMvdInterTableStride, pMd); |
| 969 | pEncCtx->pFuncList->pfInterMd (pEncCtx, pMd, pSlice, pCurMb, pMbCache); | 968 | pEncCtx->pFuncList->pfInterMd (pEncCtx, pMd, pSlice, pCurMb, pMbCache); |
| 970 | //mb_qp | 969 | //mb_qp |
| 971 | 970 | ||
| @@ -1041,7 +1040,7 @@ int32_t WelsMdInterMbLoopOverDynamicSlice (sWelsEncCtx* pEncCtx, SSlice* pSlice, · 69 unmodified lines | |||
| 1041 | int32_t iMbSkipRun = 0; | 1040 | int32_t iMbSkipRun = 0; |
| 1042 | const int32_t kiMvdInterTableSize = (pEncCtx->pSvcParam->iSpatialLayerNum == 1 ? 648 : 972); | 1041 | const int32_t kiMvdInterTableSize = (pEncCtx->pSvcParam->iSpatialLayerNum == 1 ? 648 : 972); |
| 1043 | const int32_t kiMvdInterTableStride = 1 + (kiMvdInterTableSize << 1); | 1042 | const int32_t kiMvdInterTableStride = 1 + (kiMvdInterTableSize << 1); |
| 1044 | uint16_t* pMvdCostTableInter = &pEncCtx->pMvdCostTableInter[kiMvdInterTableSize]; | 1043 | uint16_t* pMvdCostTable = &pEncCtx->pMvdCostTable[kiMvdInterTableSize]; |
| 1045 | const int32_t kiSliceIdx = pSlice->uiSliceIdx; | 1044 | const int32_t kiSliceIdx = pSlice->uiSliceIdx; |
| 1046 | const int32_t kiPartitionId = (kiSliceIdx % pEncCtx->iActiveThreadsNum); | 1045 | const int32_t kiPartitionId = (kiSliceIdx % pEncCtx->iActiveThreadsNum); |
| 1047 | const uint8_t kuiChromaQpIndexOffset = pCurLayer->sLayerInfo.pPpsP->uiChromaQpIndexOffset; | 1046 | const uint8_t kuiChromaQpIndexOffset = pCurLayer->sLayerInfo.pPpsP->uiChromaQpIndexOffset; |
| @@ -1074,7 +1073,7 @@ int32_t WelsMdInterMbLoopOverDynamicSlice (sWelsEncCtx* pEncCtx, SSlice* pSlice, · 26 unmodified lines | |||
| 1074 | WelsMdInterInit (pEncCtx, pSlice, pCurMb, kiSliceFirstMbXY); | 1073 | WelsMdInterInit (pEncCtx, pSlice, pCurMb, kiSliceFirstMbXY); |
| 1075 | 1074 | ||
| 1076 | TRY_REENCODING: | 1075 | TRY_REENCODING: |
| 1077 | WelsInitInterMDStruc (pCurMb, pMvdCostTableInter, kiMvdInterTableStride, pMd); | 1076 | WelsInitInterMDStruc (pCurMb, pMvdCostTable, kiMvdInterTableStride, pMd); |
| 1078 | pEncCtx->pFuncList->pfInterMd (pEncCtx, pMd, pSlice, pCurMb, pMbCache); | 1077 | pEncCtx->pFuncList->pfInterMd (pEncCtx, pMd, pSlice, pCurMb, pMbCache); |
| 1079 | //mb_qp | 1078 | //mb_qp |
| 1080 | 1079 | ||