void CHistogram::FreeVectors() { for (int i=0; i < 4; i++) { if (m_pLevels[i]) ippFree(m_pLevels[i]); m_pLevels[i] = NULL; if (m_pHist[i]) ippFree(m_pHist[i]); m_pHist[i] = NULL; } }
BOOL CRunCVFilterRow::AfterCall(BOOL bOK) { if (m_pBuffer) ippFree(m_pBuffer); m_pBuffer = NULL; if (m_ppDst) ippFree(m_ppDst); m_ppDst = NULL; return TRUE; }
// release memory allocated to descriptor void Release(void) { if(pMemory != 0) { Clear(); ippFree(pMemory); pMemory = 0; } }
int CIppImage::Free(void) { m_roi.width = 0; m_roi.height = 0; m_step = 0; if(0 != m_imageData) { if( isAllocated() ) ippFree(m_imageData); m_imageData = 0; } m_allocated = false; return 0; } // CIppImage::Free()
void deallocate() { if(m_pBuffer) { ippFree(m_pBuffer); m_pBuffer = NULL; } m_size = 0; }
int CIppImage::ReduceBits16(Ipp8u* pDst, int dstStep, IppiSize roi) const { IppStatus status; if(m_precision <= 8 || m_precision > 16) return -1; if(m_format == IF_UNSIGNED) { Ipp16u* p1 = (Ipp16u*)m_imageData; Ipp16u* pTmpRow = 0; Ipp16u maxval[4]; Ipp32u val[4]; Ipp8u* dst = pDst; IppiSize sz = {roi.width, 1}; int nBits; int i; switch(m_nchannels) { case 1: status = ippiMax_16u_C1R(p1, m_step, roi, &maxval[0]); break; case 3: status = ippiMax_16u_C3R(p1, m_step, roi, maxval); break; case 4: status = ippiMax_16u_C4R(p1, m_step, roi, maxval); break; default: return -1; } if(ippStsNoErr != status) return -1; for(i = 0; i < m_nchannels; i++) { nBits = 0; while(maxval[i]) { maxval[i] = maxval[i] >> 1; nBits++; } val[i] = 16 - nBits; } pTmpRow = (Ipp16u*)ippMalloc(m_step); if(0 == pTmpRow) return -1; for(i = 0; i < roi.height; i++) { switch(m_nchannels) { case 1: status = ippiLShiftC_16u_C1R(p1,m_step,val[0],pTmpRow,m_step,sz); break; case 3: status = ippiLShiftC_16u_C3R(p1,m_step,val,pTmpRow,m_step,sz); break; case 4: status = ippiLShiftC_16u_C4R(p1,m_step,val,pTmpRow,m_step,sz); break; default: ippFree(pTmpRow); return -1; } if(ippStsNoErr != status) { ippFree(pTmpRow); return -1; } switch(m_nchannels) { case 1: status = ippiReduceBits_16u8u_C1R(pTmpRow,m_step,dst,dstStep,sz,0,ippDitherNone,255); break; case 3: status = ippiReduceBits_16u8u_C3R(pTmpRow,m_step,dst,dstStep,sz,0,ippDitherNone,255); break; case 4: status = ippiReduceBits_16u8u_C4R(pTmpRow,m_step,dst,dstStep,sz,0,ippDitherNone,255); break; default: ippFree(pTmpRow); return -1; } if(ippStsNoErr != status) { ippFree(pTmpRow); return -1; } p1 = (Ipp16u*)((Ipp8u*)p1 + m_step); dst += dstStep; } }
static void deleteTmpVectors(Ipp32f** src, int num) { for (int i=0; i<num; i++) { ippFree(src[i]); } }
void Release() { if(m_pBuffer) ippFree(m_pBuffer); }
BOOL CRunCVFlood::AfterCall(BOOL bOK) { ippFree(m_pBuffer); m_pBuffer = NULL; return TRUE; }