! * \brief free memory in SVC core encoder * \pParam pEncCtx sWelsEncCtx* * \return none */
| 1795 | * \return none |
| 1796 | */ |
| 1797 | void FreeMemorySvc (sWelsEncCtx** ppCtx) { |
| 1798 | if (NULL != *ppCtx) { |
| 1799 | sWelsEncCtx* pCtx = *ppCtx; |
| 1800 | CMemoryAlign* pMa = pCtx->pMemAlign; |
| 1801 | SWelsSvcCodingParam* pParam = pCtx->pSvcParam; |
| 1802 | int32_t ilayer = 0; |
| 1803 | |
| 1804 | // SStrideTables |
| 1805 | if (NULL != pCtx->pStrideTab) { |
| 1806 | if (NULL != pCtx->pStrideTab->pStrideDecBlockOffset[0][1]) { |
| 1807 | pMa->WelsFree (pCtx->pStrideTab->pStrideDecBlockOffset[0][1], "pBase"); |
| 1808 | pCtx->pStrideTab->pStrideDecBlockOffset[0][1] = NULL; |
| 1809 | } |
| 1810 | pMa->WelsFree (pCtx->pStrideTab, "SStrideTables"); |
| 1811 | pCtx->pStrideTab = NULL; |
| 1812 | } |
| 1813 | // pDq idc map |
| 1814 | if (NULL != pCtx->pDqIdcMap) { |
| 1815 | pMa->WelsFree (pCtx->pDqIdcMap, "pDqIdcMap"); |
| 1816 | pCtx->pDqIdcMap = NULL; |
| 1817 | } |
| 1818 | |
| 1819 | if (NULL != pCtx->pOut) { |
| 1820 | // bs pBuffer |
| 1821 | if (NULL != pCtx->pOut->pBsBuffer) { |
| 1822 | pMa->WelsFree (pCtx->pOut->pBsBuffer, "pOut->pBsBuffer"); |
| 1823 | pCtx->pOut->pBsBuffer = NULL; |
| 1824 | } |
| 1825 | // NALs list |
| 1826 | if (NULL != pCtx->pOut->sNalList) { |
| 1827 | pMa->WelsFree (pCtx->pOut->sNalList, "pOut->sNalList"); |
| 1828 | pCtx->pOut->sNalList = NULL; |
| 1829 | } |
| 1830 | // NALs len |
| 1831 | if (NULL != pCtx->pOut->pNalLen) { |
| 1832 | pMa->WelsFree (pCtx->pOut->pNalLen, "pOut->pNalLen"); |
| 1833 | pCtx->pOut->pNalLen = NULL; |
| 1834 | } |
| 1835 | pMa->WelsFree (pCtx->pOut, "SWelsEncoderOutput"); |
| 1836 | pCtx->pOut = NULL; |
| 1837 | } |
| 1838 | |
| 1839 | if (pParam != NULL && pParam->iMultipleThreadIdc > 1) |
| 1840 | ReleaseMtResource (ppCtx); |
| 1841 | |
| 1842 | if (NULL != pCtx->pReferenceStrategy) { |
| 1843 | WELS_DELETE_OP (pCtx->pReferenceStrategy); |
| 1844 | } |
| 1845 | |
| 1846 | // frame bitstream pBuffer |
| 1847 | if (NULL != pCtx->pFrameBs) { |
| 1848 | pMa->WelsFree (pCtx->pFrameBs, "pFrameBs"); |
| 1849 | pCtx->pFrameBs = NULL; |
| 1850 | } |
| 1851 | for (int32_t iIdx = 0; iIdx < MAX_THREADS_NUM; iIdx++) { |
| 1852 | pMa->WelsFree (pCtx->pDynamicBsBuffer[iIdx], "DynamicSliceBs"); |
| 1853 | pCtx->pDynamicBsBuffer[iIdx] = NULL; |
| 1854 |
no test coverage detected