Showing the changes to codec/encoder/core/src/svc_encode_slice.cpp (1 of 8 files). Show all
Unified · Split
| @@ -776,7 +776,7 @@ void UpdateMbNeighbourInfoForNextSlice (SSliceCtx* pSliceCtx, · 775 unmodified lines | |||
| 776 | bool bLeftTop; | 776 | bool bLeftTop; |
| 777 | bool bRightTop; | 777 | bool bRightTop; |
| 778 | int32_t iLeftXY, iTopXY, iLeftTopXY, iRightTopXY; | 778 | int32_t iLeftXY, iTopXY, iLeftTopXY, iRightTopXY; |
| 779 | const uint8_t kuiSliceIdc = WelsMbToSliceIdc (pSliceCtx, kiMbXY); | 779 | const uint16_t kuiSliceIdc = WelsMbToSliceIdc (pSliceCtx, kiMbXY); |
| 780 | 780 | ||
| 781 | pMb->uiSliceIdc = kuiSliceIdc; | 781 | pMb->uiSliceIdc = kuiSliceIdc; |
| 782 | iLeftXY = kiMbXY - 1; | 782 | iLeftXY = kiMbXY - 1; |
| @@ -814,9 +814,9 @@ void AddSliceBoundary (sWelsEncCtx* pEncCtx, SSlice* pCurSlice, SSliceCtx* pSlic · 31 unmodified lines | |||
| 814 | int32_t iFirstMbIdxOfNextSlice, const int32_t kiLastMbIdxInPartition) { | 814 | int32_t iFirstMbIdxOfNextSlice, const int32_t kiLastMbIdxInPartition) { |
| 815 | SDqLayer* pCurLayer = pEncCtx->pCurDqLayer; | 815 | SDqLayer* pCurLayer = pEncCtx->pCurDqLayer; |
| 816 | int32_t iCurMbIdx = pCurMb->iMbXY; | 816 | int32_t iCurMbIdx = pCurMb->iMbXY; |
| 817 | int32_t iCurSliceIdc = pSliceCtx->pOverallMbMap[ iCurMbIdx ]; | 817 | uint16_t iCurSliceIdc = pSliceCtx->pOverallMbMap[ iCurMbIdx ]; |
| 818 | const int32_t kiSliceIdxStep = pEncCtx->iActiveThreadsNum; | 818 | const int32_t kiSliceIdxStep = pEncCtx->iActiveThreadsNum; |
| 819 | int32_t iNextSliceIdc = iCurSliceIdc + kiSliceIdxStep; | 819 | uint16_t iNextSliceIdc = iCurSliceIdc + kiSliceIdxStep; |
| 820 | SSlice* pNextSlice = NULL; | 820 | SSlice* pNextSlice = NULL; |
| 821 | 821 | ||
| 822 | SMB* pMbList = pCurLayer->sMbDataP; | 822 | SMB* pMbList = pCurLayer->sMbDataP; |
| @@ -839,9 +839,8 @@ void AddSliceBoundary (sWelsEncCtx* pEncCtx, SSlice* pCurSlice, SSliceCtx* pSlic · 16 unmodified lines | |||
| 839 | sizeof (SSliceHeaderExt)); // confirmed_safe_unsafe_usage | 839 | sizeof (SSliceHeaderExt)); // confirmed_safe_unsafe_usage |
| 840 | 840 | ||
| 841 | pSliceCtx->pFirstMbInSlice[iNextSliceIdc] = iFirstMbIdxOfNextSlice; | 841 | pSliceCtx->pFirstMbInSlice[iNextSliceIdc] = iFirstMbIdxOfNextSlice; |
| 842 | 842 | WelsSetMemMultiplebytes_c (pSliceCtx->pOverallMbMap + iFirstMbIdxOfNextSlice, iNextSliceIdc, | |
| 843 | memset (pSliceCtx->pOverallMbMap + iFirstMbIdxOfNextSlice, (uint8_t)iNextSliceIdc, | 843 | (kiLastMbIdxInPartition - iFirstMbIdxOfNextSlice + 1), sizeof(uint16_t)); |
| 844 | (kiLastMbIdxInPartition - iFirstMbIdxOfNextSlice + 1)*sizeof (uint8_t)); | ||
| 845 | 844 | ||
| 846 | //DYNAMIC_SLICING_ONE_THREAD: update pMbList slice_neighbor_info | 845 | //DYNAMIC_SLICING_ONE_THREAD: update pMbList slice_neighbor_info |
| 847 | UpdateMbNeighbourInfoForNextSlice (pSliceCtx, pMbList, iFirstMbIdxOfNextSlice, kiLastMbIdxInPartition); | 846 | UpdateMbNeighbourInfoForNextSlice (pSliceCtx, pMbList, iFirstMbIdxOfNextSlice, kiLastMbIdxInPartition); |
| @@ -875,6 +874,10 @@ bool DynSlcJudgeSliceBoundaryStepBack (void* pCtx, void* pSlice, SSliceCtx* pSli · 27 unmodified lines | |||
| 875 | && JUMPPACKETSIZE_JUDGE (uiLen, iCurMbIdx, pSliceCtx->uiSliceSizeConstraint)) /*jump_avoiding_pack_exceed*/ | 874 | && JUMPPACKETSIZE_JUDGE (uiLen, iCurMbIdx, pSliceCtx->uiSliceSizeConstraint)) /*jump_avoiding_pack_exceed*/ |
| 876 | && kbCurMbNotLastMbOfCurPartition) { //decide to add new pSlice | 875 | && kbCurMbNotLastMbOfCurPartition) { //decide to add new pSlice |
| 877 | 876 | ||
| 877 | WelsLog (&pEncCtx->sLogCtx, WELS_LOG_DETAIL, | ||
| 878 | "DynSlcJudgeSliceBoundaryStepBack: AddSliceBoundary: iCurMbIdx=%d, uiLen=%d, uiSliceIdx=%d", iCurMbIdx, uiLen, | ||
| 879 | pCurSlice->uiSliceIdx); | ||
| 880 | |||
| 878 | if (pEncCtx->pSvcParam->iMultipleThreadIdc > 1) { | 881 | if (pEncCtx->pSvcParam->iMultipleThreadIdc > 1) { |
| 879 | WelsMutexLock (&pEncCtx->pSliceThreading->mutexSliceNumUpdate); | 882 | WelsMutexLock (&pEncCtx->pSliceThreading->mutexSliceNumUpdate); |
| 880 | //lock the acessing to this variable: pSliceCtx->iSliceNumInFrame | 883 | //lock the acessing to this variable: pSliceCtx->iSliceNumInFrame |