Showing the changes to codec/encoder/core/src/svc_encode_slice.cpp (1 of 5 files). Show all
Unified · Split
| @@ -954,6 +954,7 @@ int32_t InitSliceList (sWelsEncCtx* pCtx, · 953 unmodified lines | |||
| 954 | } | 954 | } |
| 955 | 955 | ||
| 956 | pSlice->uiSliceIdx = iSliceIdx; | 956 | pSlice->uiSliceIdx = iSliceIdx; |
| 957 | pSlice->uiThreadIdx = 0; | ||
| 957 | pSlice->iCountMbNumInSlice = 0; | 958 | pSlice->iCountMbNumInSlice = 0; |
| 958 | pSlice->sSliceHeaderExt.sSliceHeader.iFirstMbInSlice = 0; | 959 | pSlice->sSliceHeaderExt.sSliceHeader.iFirstMbInSlice = 0; |
| 959 | 960 | ||
| @@ -1185,6 +1186,7 @@ int32_t ReallocateSliceList (sWelsEncCtx* pCtx, · 225 unmodified lines | |||
| 1185 | } | 1186 | } |
| 1186 | 1187 | ||
| 1187 | pSlice->uiSliceIdx = iSliceIdx; | 1188 | pSlice->uiSliceIdx = iSliceIdx; |
| 1189 | pSlice->uiThreadIdx = 0; | ||
| 1188 | pSlice->iCountMbNumInSlice = 0; | 1190 | pSlice->iCountMbNumInSlice = 0; |
| 1189 | pSlice->sSliceHeaderExt.sSliceHeader.iFirstMbInSlice = 0; | 1191 | pSlice->sSliceHeaderExt.sSliceHeader.iFirstMbInSlice = 0; |
| 1190 | 1192 | ||
| @@ -1354,7 +1356,6 @@ int32_t ReallocSliceBuffer (sWelsEncCtx* pCtx) { · 163 unmodified lines | |||
| 1354 | pCurLayer->iMaxSliceNum = iMaxSliceNumNew; | 1356 | pCurLayer->iMaxSliceNum = iMaxSliceNumNew; |
| 1355 | return ENC_RETURN_SUCCESS; | 1357 | return ENC_RETURN_SUCCESS; |
| 1356 | } | 1358 | } |
| 1357 | |||
| 1358 | /* | 1359 | /* |
| 1359 | int32_t ReOrderSliceInLayer (SDqLayer* pCurLayer, | 1360 | int32_t ReOrderSliceInLayer (SDqLayer* pCurLayer, |
| 1360 | const int32_t kiThreadNum, | 1361 | const int32_t kiThreadNum, |
| @@ -1518,7 +1519,7 @@ void UpdateMbNeighbourInfoForNextSlice (SDqLayer* pCurDq, · 157 unmodified lines | |||
| 1518 | void AddSliceBoundary (sWelsEncCtx* pEncCtx, SSlice* pCurSlice, SSliceCtx* pSliceCtx, SMB* pCurMb, | 1519 | void AddSliceBoundary (sWelsEncCtx* pEncCtx, SSlice* pCurSlice, SSliceCtx* pSliceCtx, SMB* pCurMb, |
| 1519 | int32_t iFirstMbIdxOfNextSlice, const int32_t kiLastMbIdxInPartition) { | 1520 | int32_t iFirstMbIdxOfNextSlice, const int32_t kiLastMbIdxInPartition) { |
| 1520 | SDqLayer* pCurLayer = pEncCtx->pCurDqLayer; | 1521 | SDqLayer* pCurLayer = pEncCtx->pCurDqLayer; |
| 1521 | SSlice** ppSliceInLayer = pCurLayer->ppSliceInLayer; | 1522 | SSlice* pSliceInThread = pCurLayer->sSliceThreadInfo.pSliceInThread[0]; |
| 1522 | int32_t iCurMbIdx = pCurMb->iMbXY; | 1523 | int32_t iCurMbIdx = pCurMb->iMbXY; |
| 1523 | uint16_t iCurSliceIdc = pSliceCtx->pOverallMbMap[ iCurMbIdx ]; | 1524 | uint16_t iCurSliceIdc = pSliceCtx->pOverallMbMap[ iCurMbIdx ]; |
| 1524 | const int32_t kiSliceIdxStep = pEncCtx->iActiveThreadsNum; | 1525 | const int32_t kiSliceIdxStep = pEncCtx->iActiveThreadsNum; |
| @@ -1531,7 +1532,7 @@ void AddSliceBoundary (sWelsEncCtx* pEncCtx, SSlice* pCurSlice, SSliceCtx* pSlic · 6 unmodified lines | |||
| 1531 | pCurSlice->sSliceHeaderExt.uiNumMbsInSlice = 1 + iCurMbIdx - pCurSlice->sSliceHeaderExt.sSliceHeader.iFirstMbInSlice; | 1532 | pCurSlice->sSliceHeaderExt.uiNumMbsInSlice = 1 + iCurMbIdx - pCurSlice->sSliceHeaderExt.sSliceHeader.iFirstMbInSlice; |
| 1532 | 1533 | ||
| 1533 | //pNextSlice pointer/initialization | 1534 | //pNextSlice pointer/initialization |
| 1534 | pNextSlice = pCurLayer->ppSliceInLayer[ iNextSliceIdc ]; | 1535 | pNextSlice = &pSliceInThread[ iNextSliceIdc ]; |
| 1535 | 1536 | ||
| 1536 | #if _DEBUG | 1537 | #if _DEBUG |
| 1537 | assert (NULL != pNextSlice); | 1538 | assert (NULL != pNextSlice); |
| @@ -1542,7 +1543,7 @@ void AddSliceBoundary (sWelsEncCtx* pEncCtx, SSlice* pCurSlice, SSliceCtx* pSlic · 4 unmodified lines | |||
| 1542 | (NAL_UNIT_CODED_SLICE_EXT == pCurLayer->sLayerInfo.sNalHeaderExt.sNalUnitHeader.eNalUnitType); | 1543 | (NAL_UNIT_CODED_SLICE_EXT == pCurLayer->sLayerInfo.sNalHeaderExt.sNalUnitHeader.eNalUnitType); |
| 1543 | memcpy (&pNextSlice->sSliceHeaderExt, &pCurSlice->sSliceHeaderExt, | 1544 | memcpy (&pNextSlice->sSliceHeaderExt, &pCurSlice->sSliceHeaderExt, |
| 1544 | sizeof (SSliceHeaderExt)); // confirmed_safe_unsafe_usage | 1545 | sizeof (SSliceHeaderExt)); // confirmed_safe_unsafe_usage |
| 1545 | ppSliceInLayer[iNextSliceIdc]->sSliceHeaderExt.sSliceHeader.iFirstMbInSlice = iFirstMbIdxOfNextSlice; | 1546 | pNextSlice->sSliceHeaderExt.sSliceHeader.iFirstMbInSlice = iFirstMbIdxOfNextSlice; |
| 1546 | WelsSetMemMultiplebytes_c (pSliceCtx->pOverallMbMap + iFirstMbIdxOfNextSlice, iNextSliceIdc, | 1547 | WelsSetMemMultiplebytes_c (pSliceCtx->pOverallMbMap + iFirstMbIdxOfNextSlice, iNextSliceIdc, |
| 1547 | (kiLastMbIdxInPartition - iFirstMbIdxOfNextSlice + 1), sizeof (uint16_t)); | 1548 | (kiLastMbIdxInPartition - iFirstMbIdxOfNextSlice + 1), sizeof (uint16_t)); |
| 1548 | 1549 | ||