Showing the changes to codec/encoder/core/src/svc_encode_slice.cpp (1 of 9 files). Show all
Unified · Split
| @@ -929,13 +929,10 @@ void FreeSliceBuffer (SSlice*& pSliceList, const int32_t kiMaxSliceNum, CMemoryA · 928 unmodified lines | |||
| 929 | } | 929 | } |
| 930 | 930 | ||
| 931 | int32_t InitSliceList (sWelsEncCtx* pCtx, | 931 | int32_t InitSliceList (sWelsEncCtx* pCtx, |
| 932 | SDqLayer* pDqLayer, | ||
| 933 | SSlice*& pSliceList, | 932 | SSlice*& pSliceList, |
| 934 | const int32_t kiMaxSliceNum, | 933 | const int32_t kiMaxSliceNum, |
| 935 | const int32_t kiDlayerIndex, | 934 | const int32_t kiDlayerIndex, |
| 936 | CMemoryAlign* pMa) { | 935 | CMemoryAlign* pMa) { |
| 937 | const int32_t kiMBWidth = pDqLayer->iMbWidth; | ||
| 938 | const int32_t kiMBHeight = pDqLayer->iMbHeight; | ||
| 939 | SSliceArgument* pSliceArgument = & pCtx->pSvcParam->sSpatialLayers[kiDlayerIndex].sSliceArgument; | 936 | SSliceArgument* pSliceArgument = & pCtx->pSvcParam->sSpatialLayers[kiDlayerIndex].sSliceArgument; |
| 940 | int32_t iMaxSliceBufferSize = (pCtx)->iSliceBufferSize[kiDlayerIndex]; | 937 | int32_t iMaxSliceBufferSize = (pCtx)->iSliceBufferSize[kiDlayerIndex]; |
| 941 | int32_t iSliceIdx = 0; | 938 | int32_t iSliceIdx = 0; |
| @@ -945,8 +942,7 @@ int32_t InitSliceList (sWelsEncCtx* pCtx, · 3 unmodified lines | |||
| 945 | //even though multi-thread is on for other layers | 942 | //even though multi-thread is on for other layers |
| 946 | bool bIndependenceBsBuffer = (pCtx->pSvcParam->iMultipleThreadIdc > 1 && | 943 | bool bIndependenceBsBuffer = (pCtx->pSvcParam->iMultipleThreadIdc > 1 && |
| 947 | SM_SINGLE_SLICE != pSliceArgument->uiSliceMode) ? true : false; | 944 | SM_SINGLE_SLICE != pSliceArgument->uiSliceMode) ? true : false; |
| 948 | 945 | if (iMaxSliceBufferSize <= 0) { | |
| 949 | if (iMaxSliceBufferSize <= 0 || kiMBWidth <= 0 || kiMBHeight <= 0) { | ||
| 950 | return ENC_RETURN_UNEXPECTED; | 946 | return ENC_RETURN_UNEXPECTED; |
| 951 | } | 947 | } |
| 952 | 948 | ||
| @@ -1048,7 +1044,6 @@ int32_t InitSliceThreadInfo (sWelsEncCtx* pCtx, · 95 unmodified lines | |||
| 1048 | return ENC_RETURN_MEMALLOCERR; | 1044 | return ENC_RETURN_MEMALLOCERR; |
| 1049 | } | 1045 | } |
| 1050 | iRet = InitSliceList (pCtx, | 1046 | iRet = InitSliceList (pCtx, |
| 1051 | pDqLayer, | ||
| 1052 | pDqLayer->sSliceThreadInfo[iIdx].pSliceInThread, | 1047 | pDqLayer->sSliceThreadInfo[iIdx].pSliceInThread, |
| 1053 | iMaxSliceNum, | 1048 | iMaxSliceNum, |
| 1054 | kiDlayerIndex, | 1049 | kiDlayerIndex, |