diff --git a/codec/processing/src/backgrounddetection/BackgroundDetection.cpp b/codec/processing/src/backgrounddetection/BackgroundDetection.cpp index f687de0c..93e58519 100644 --- a/codec/processing/src/backgrounddetection/BackgroundDetection.cpp +++ b/codec/processing/src/backgrounddetection/BackgroundDetection.cpp @@ -57,7 +57,7 @@ CBackgroundDetection::CBackgroundDetection (int32_t iCpuFlag) { } CBackgroundDetection::~CBackgroundDetection() { - FreeOUArrayMemory(); + WelsFree (m_BgdParam.pOU_array); } EResult CBackgroundDetection::Process (int32_t iType, SPixMap* pSrcPixMap, SPixMap* pRefPixMap) { @@ -80,7 +80,7 @@ EResult CBackgroundDetection::Process (int32_t iType, SPixMap* pSrcPixMap, SPixM int32_t iCurFrameSize = m_BgdParam.iBgdWidth * m_BgdParam.iBgdHeight; if (m_BgdParam.pOU_array == NULL || iCurFrameSize > m_iLargestFrameSize) { - FreeOUArrayMemory(); + WelsFree (m_BgdParam.pOU_array); m_BgdParam.pOU_array = AllocateOUArrayMemory (m_BgdParam.iBgdWidth, m_BgdParam.iBgdHeight); m_iLargestFrameSize = iCurFrameSize; } @@ -112,10 +112,6 @@ inline SBackgroundOU* CBackgroundDetection::AllocateOUArrayMemory (int32_t iWidt return (SBackgroundOU*)WelsMalloc (iMaxOUWidth * iMaxOUHeight * sizeof (SBackgroundOU)); } -inline void CBackgroundDetection::FreeOUArrayMemory() { - _SafeFree (m_BgdParam.pOU_array); -} - void CBackgroundDetection::GetOUParameters (SVAACalcResult* sVaaCalcInfo, int32_t iMbIndex, int32_t iMbWidth, SBackgroundOU* pBgdOU) { int32_t iSubSD[4]; diff --git a/codec/processing/src/backgrounddetection/BackgroundDetection.h b/codec/processing/src/backgrounddetection/BackgroundDetection.h index 886c9792..0c556cdc 100644 --- a/codec/processing/src/backgrounddetection/BackgroundDetection.h +++ b/codec/processing/src/backgrounddetection/BackgroundDetection.h @@ -81,7 +81,6 @@ class CBackgroundDetection : public IStrategy { private: inline SBackgroundOU* AllocateOUArrayMemory (int32_t iWidth, int32_t iHeight); - inline void FreeOUArrayMemory(); inline int32_t CalculateAsdChromaEdge (uint8_t* pOriRef, uint8_t* pOriCur, int32_t iStride); inline bool ForegroundDilation23Luma (SBackgroundOU* pBackgroundOU, SBackgroundOU* pOUNeighbours[]); //Foreground_Dilation_2_3_Luma