| 61 | } |
| 62 | |
| 63 | EResult CBackgroundDetection::Process (int32_t iType, SPixMap* pSrcPixMap, SPixMap* pRefPixMap) { |
| 64 | EResult eReturn = RET_INVALIDPARAM; |
| 65 | |
| 66 | if (pSrcPixMap == NULL || pRefPixMap == NULL) |
| 67 | return eReturn; |
| 68 | |
| 69 | m_BgdParam.pCur[0] = (uint8_t*)pSrcPixMap->pPixel[0]; |
| 70 | m_BgdParam.pCur[1] = (uint8_t*)pSrcPixMap->pPixel[1]; |
| 71 | m_BgdParam.pCur[2] = (uint8_t*)pSrcPixMap->pPixel[2]; |
| 72 | m_BgdParam.pRef[0] = (uint8_t*)pRefPixMap->pPixel[0]; |
| 73 | m_BgdParam.pRef[1] = (uint8_t*)pRefPixMap->pPixel[1]; |
| 74 | m_BgdParam.pRef[2] = (uint8_t*)pRefPixMap->pPixel[2]; |
| 75 | m_BgdParam.iBgdWidth = pSrcPixMap->sRect.iRectWidth; |
| 76 | m_BgdParam.iBgdHeight = pSrcPixMap->sRect.iRectHeight; |
| 77 | m_BgdParam.iStride[0] = pSrcPixMap->iStride[0]; |
| 78 | m_BgdParam.iStride[1] = pSrcPixMap->iStride[1]; |
| 79 | m_BgdParam.iStride[2] = pSrcPixMap->iStride[2]; |
| 80 | |
| 81 | int32_t iCurFrameSize = m_BgdParam.iBgdWidth * m_BgdParam.iBgdHeight; |
| 82 | if (m_BgdParam.pOU_array == NULL || iCurFrameSize > m_iLargestFrameSize) { |
| 83 | WelsFree (m_BgdParam.pOU_array); |
| 84 | m_BgdParam.pOU_array = AllocateOUArrayMemory (m_BgdParam.iBgdWidth, m_BgdParam.iBgdHeight); |
| 85 | m_iLargestFrameSize = iCurFrameSize; |
| 86 | } |
| 87 | |
| 88 | if (m_BgdParam.pOU_array == NULL) |
| 89 | return eReturn; |
| 90 | |
| 91 | BackgroundDetection (&m_BgdParam); |
| 92 | |
| 93 | return RET_SUCCESS; |
| 94 | } |
| 95 | |
| 96 | EResult CBackgroundDetection::Set (int32_t iType, void* pParam) { |
| 97 | if (pParam == NULL) { |
nothing calls this directly
no test coverage detected