Clean spatial picture alloc code
Showing the changes to codec/encoder/core/src/encoder_ext.cpp (1 of 1 file). Show all
Unified · Split
| @@ -573,8 +573,8 @@ static inline int32_t AcquireLayersNals (sWelsEncCtx** ppCtx, SWelsSvcCodingPara · 572 unmodified lines | ||
| 573 | 573 | /*! |
| 574 | 574 | * \brief alloc spatial layers pictures (I420 based source pictures) |
| 575 | 575 | */ |
| 576 | −int32_t AllocSpatialPictures (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pParam) { | |
| 577 | − CMemoryAlign* pMa = (*ppCtx)->pMemAlign; | |
| 576 | +int32_t AllocSpatialPictures (sWelsEncCtx* pCtx, SWelsSvcCodingParam* pParam) { | |
| 577 | + CMemoryAlign* pMa = pCtx->pMemAlign; | |
| 578 | 578 | const int32_t kiDlayerCount = pParam->iNumDependencyLayer; |
| 579 | 579 | int32_t iDlayerIndex = 0; |
| 580 | 580 | |
| @@ -589,13 +589,13 @@ int32_t AllocSpatialPictures (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pParam) · 8 unmodified lines | ||
| 589 | 589 | |
| 590 | 590 | do { |
| 591 | 591 | SPicture* pPic = AllocPicture (pMa, kiPicWidth, kiPicHeight, false); |
| 592 | − WELS_VERIFY_RETURN_PROC_IF (1, (NULL == pPic), FreeMemorySvc (ppCtx); *ppCtx = NULL) | |
| 593 | − (*ppCtx)->pSpatialPic[iDlayerIndex][i] = pPic; | |
| 592 | + WELS_VERIFY_RETURN_IF(1, (NULL == pPic)) | |
| 593 | + pCtx->pSpatialPic[iDlayerIndex][i] = pPic; | |
| 594 | 594 | ++ i; |
| 595 | 595 | } while (i < kuiRefNumInTemporal); |
| 596 | 596 | |
| 597 | − (*ppCtx)->uiSpatialLayersInTemporal[iDlayerIndex] = kuiLayerInTemporal; | |
| 598 | − (*ppCtx)->uiSpatialPicNum[iDlayerIndex] = kuiRefNumInTemporal; | |
| 597 | + pCtx->uiSpatialLayersInTemporal[iDlayerIndex] = kuiLayerInTemporal; | |
| 598 | + pCtx->uiSpatialPicNum[iDlayerIndex] = kuiRefNumInTemporal; | |
| 599 | 599 | ++ iDlayerIndex; |
| 600 | 600 | } while (iDlayerIndex < kiDlayerCount); |
| 601 | 601 | |
| @@ -847,7 +847,7 @@ static inline int32_t InitDqLayers (sWelsEncCtx** ppCtx) { · 245 unmodified lines | ||
| 847 | 847 | } |
| 848 | 848 | |
| 849 | 849 | // for I420 based source spatial pictures |
| 850 | − if (AllocSpatialPictures (ppCtx, pParam)) { | |
| 850 | + if (AllocSpatialPictures (*ppCtx, pParam)) { | |
| 851 | 851 | FreeMemorySvc (ppCtx); |
| 852 | 852 | return 1; |
| 853 | 853 | } |