History

Clean spatial picture alloc code

volvet committed 12 years ago

Commit b770bb81 parent c5ea53f1 file · +7 −7Browse files

Showing the changes to codec/encoder/core/src/encoder_ext.cpp (1 of 1 file). Show all

Unified · Split

codec/encoder/core/src/encoder_ext.cpp+7−7
@@ -590,8 +590,8 @@ static inline int32_t AcquireLayersNals (sWelsEncCtx** ppCtx, SWelsSvcCodingPara · 589 unmodified lines
590/*!590/*!
591 * \brief alloc spatial layers pictures (I420 based source pictures)591 * \brief alloc spatial layers pictures (I420 based source pictures)
592 */592 */
593int32_t AllocSpatialPictures (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pParam) {593int32_t AllocSpatialPictures (sWelsEncCtx* pCtx, SWelsSvcCodingParam* pParam) {
594 CMemoryAlign* pMa = (*ppCtx)->pMemAlign;594 CMemoryAlign* pMa = pCtx->pMemAlign;
595 const int32_t kiDlayerCount = pParam->iNumDependencyLayer;595 const int32_t kiDlayerCount = pParam->iNumDependencyLayer;
596 int32_t iDlayerIndex = 0;596 int32_t iDlayerIndex = 0;
597 597
@@ -606,13 +606,13 @@ int32_t AllocSpatialPictures (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pParam) · 8 unmodified lines
606 606
607 do {607 do {
608 SPicture* pPic = AllocPicture (pMa, kiPicWidth, kiPicHeight, false);608 SPicture* pPic = AllocPicture (pMa, kiPicWidth, kiPicHeight, false);
609 WELS_VERIFY_RETURN_PROC_IF (1, (NULL == pPic), FreeMemorySvc (ppCtx); *ppCtx = NULL)609 WELS_VERIFY_RETURN_IF(1, (NULL == pPic))
610 (*ppCtx)->pSpatialPic[iDlayerIndex][i] = pPic;610 pCtx->pSpatialPic[iDlayerIndex][i] = pPic;
611 ++ i;611 ++ i;
612 } while (i < kuiRefNumInTemporal);612 } while (i < kuiRefNumInTemporal);
613 613
614 (*ppCtx)->uiSpatialLayersInTemporal[iDlayerIndex] = kuiLayerInTemporal;614 pCtx->uiSpatialLayersInTemporal[iDlayerIndex] = kuiLayerInTemporal;
615 (*ppCtx)->uiSpatialPicNum[iDlayerIndex] = kuiRefNumInTemporal;615 pCtx->uiSpatialPicNum[iDlayerIndex] = kuiRefNumInTemporal;
616 ++ iDlayerIndex;616 ++ iDlayerIndex;
617 } while (iDlayerIndex < kiDlayerCount);617 } while (iDlayerIndex < kiDlayerCount);
618 618
@@ -864,7 +864,7 @@ static inline int32_t InitDqLayers (sWelsEncCtx** ppCtx) { · 245 unmodified lines
864 }864 }
865 865
866 // for I420 based source spatial pictures866 // for I420 based source spatial pictures
867 if (AllocSpatialPictures (ppCtx, pParam)) {867 if (AllocSpatialPictures (*ppCtx, pParam)) {
868 FreeMemorySvc (ppCtx);868 FreeMemorySvc (ppCtx);
869 return 1;869 return 1;
870 }870 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t