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 | 776 | bool bLeftTop; |
| 777 | 777 | bool bRightTop; |
| 778 | 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 | 781 | pMb->uiSliceIdc = kuiSliceIdc; |
| 782 | 782 | iLeftXY = kiMbXY - 1; |
| @@ -814,9 +814,9 @@ void AddSliceBoundary (sWelsEncCtx* pEncCtx, SSlice* pCurSlice, SSliceCtx* pSlic · 31 unmodified lines | ||
| 814 | 814 | int32_t iFirstMbIdxOfNextSlice, const int32_t kiLastMbIdxInPartition) { |
| 815 | 815 | SDqLayer* pCurLayer = pEncCtx->pCurDqLayer; |
| 816 | 816 | int32_t iCurMbIdx = pCurMb->iMbXY; |
| 817 | − int32_t iCurSliceIdc = pSliceCtx->pOverallMbMap[ iCurMbIdx ]; | |
| 817 | + uint16_t iCurSliceIdc = pSliceCtx->pOverallMbMap[ iCurMbIdx ]; | |
| 818 | 818 | const int32_t kiSliceIdxStep = pEncCtx->iActiveThreadsNum; |
| 819 | − int32_t iNextSliceIdc = iCurSliceIdc + kiSliceIdxStep; | |
| 819 | + uint16_t iNextSliceIdc = iCurSliceIdc + kiSliceIdxStep; | |
| 820 | 820 | SSlice* pNextSlice = NULL; |
| 821 | 821 | |
| 822 | 822 | SMB* pMbList = pCurLayer->sMbDataP; |
| @@ -839,9 +839,8 @@ void AddSliceBoundary (sWelsEncCtx* pEncCtx, SSlice* pCurSlice, SSliceCtx* pSlic · 16 unmodified lines | ||
| 839 | 839 | sizeof (SSliceHeaderExt)); // confirmed_safe_unsafe_usage |
| 840 | 840 | |
| 841 | 841 | pSliceCtx->pFirstMbInSlice[iNextSliceIdc] = iFirstMbIdxOfNextSlice; |
| 842 | − | |
| 843 | − memset (pSliceCtx->pOverallMbMap + iFirstMbIdxOfNextSlice, (uint8_t)iNextSliceIdc, | |
| 844 | − (kiLastMbIdxInPartition - iFirstMbIdxOfNextSlice + 1)*sizeof (uint8_t)); | |
| 842 | + WelsSetMemMultiplebytes_c (pSliceCtx->pOverallMbMap + iFirstMbIdxOfNextSlice, iNextSliceIdc, | |
| 843 | + (kiLastMbIdxInPartition - iFirstMbIdxOfNextSlice + 1), sizeof(uint16_t)); | |
| 845 | 844 | |
| 846 | 845 | //DYNAMIC_SLICING_ONE_THREAD: update pMbList slice_neighbor_info |
| 847 | 846 | UpdateMbNeighbourInfoForNextSlice (pSliceCtx, pMbList, iFirstMbIdxOfNextSlice, kiLastMbIdxInPartition); |
| @@ -875,6 +874,10 @@ bool DynSlcJudgeSliceBoundaryStepBack (void* pCtx, void* pSlice, SSliceCtx* pSli · 27 unmodified lines | ||
| 875 | 874 | && JUMPPACKETSIZE_JUDGE (uiLen, iCurMbIdx, pSliceCtx->uiSliceSizeConstraint)) /*jump_avoiding_pack_exceed*/ |
| 876 | 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 | 881 | if (pEncCtx->pSvcParam->iMultipleThreadIdc > 1) { |
| 879 | 882 | WelsMutexLock (&pEncCtx->pSliceThreading->mutexSliceNumUpdate); |
| 880 | 883 | //lock the acessing to this variable: pSliceCtx->iSliceNumInFrame |