Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.

How to use ippiWTFwd_32f_C1R?

andylee_kyz
Beginner
503 Views
Hi,
I have encounted a problem of how to use ippiWTFwd_32f_C1R, can anyone help me about this?
I have done some initializations of wavelet decomposition, but I cannot make my program pass the function.
I use the Vs.net to compile this program, and the program breaks down when it runs to the function of ippiWTFwd_32f_C1R() under the Debug mode.
My code is posted below:
// Initialization
const Ipp32f low[4] =
{
3.41506351e-001f,
5.91506351e-001f,
1.58493649e-001f,
-9.15063509e-002f
};
const Ipp32f high[4] =
{
-9.15063509e-002f,
-1.58493649e-001f,
5.91506351e-001f,
-3.41506351e-001f
};
ippiWTFwdInitAlloc_32f_C1R(&m_spec,
low, 4, 2,
high, 4, 2);
int bufSize;
ippiWTFwdGetBufSize_C1R(m_spec, &bufSize);
m_buffer = ippsMalloc_8u(bufSize);
if(!m_buffer)
{
ippiWTFwdFree_32f_C1R(m_spec);
}
// width and height of input image (Ipp8u), and width and heightcan be divided by 8 exactly.
IppiSize size = {m_srcSize.width, m_srcSize.height};

/* width and height of the first wavelet transforming decomposition */
IppiSize decomSize1 = {size.width / 2, size.height / 2};
Ipp32f* LxLy1 = ippsMalloc_32f(decomSize1.width * decomSize1.height);
Ipp32f* LxHy1 = ippsMalloc_32f(decomSize1.width * decomSize1.height);
Ipp32f* HxLy1 = ippsMalloc_32f(decomSize1.width * decomSize1.height);
Ipp32f* HxHy1 = ippsMalloc_32f(decomSize1.width * decomSize1.height);
Transform(m_ippImage, size, LxLy1, LxHy1, HxLy1, HxHy1, decomSize1);
// some free momery operations
....
// The function of Transform() are defined as follows:
void Transform(Ipp8u* pSrc, IppiSize size,
Ipp32f* LxLy, Ipp32f* LxHy,
Ipp32f* HxLy, Ipp32f* HxHy,
IppiSize decomSize)
{
// Convert image format from 8u to 32s
Ipp32s* pSrc32s = ippsMalloc_32s(size.width * size.height);
ippiConvert_8u32s_C1R(pSrc, size.width, pSrc32s, size.width * 4, size);
// Set the border of the source image
IppiSize BorderSize = {size.width + 2, size.height + 2};
Ipp32s* pDst32s = ippsMalloc_32s(BorderSize.width * BorderSize.height);
ippiCopyWrapBorder_32s_C1R(pSrc32s, size.width * 4, size, pDst32s, BorderSize.width * 4, BorderSize, 1, 1);
// Convert image format from 32s to 32f
Ipp8u* pDst8u = ippsMalloc_8u(BorderSize.width * BorderSize.height);
ippiConvert_32s8u_C1R(pDst32s, BorderSize.width * 4, pDst8u, BorderSize.width, BorderSize);
Ipp32f* pDst32f = ippsMalloc_32f(BorderSize.width * BorderSize.height);
ippiConvert_8u32f_C1R(pDst8u, BorderSize.width, pDst32f, BorderSize.width * 4, BorderSize);
//////////////////////////////////////////////////////////////////////////
IppStatus status = ippiWTFwd_32f_C1R(pDst32f, BorderSize.width * 4,
LxLy, decomSize.width * 4,
LxHy, decomSize.width * 4,
HxLy, decomSize.width * 4,
HxHy, decomSize.width * 4,
decomSize, m_spec, m_buffer);

ippsFree(pSrc32s);
ippsFree(pDst8u);
ippsFree(pDst32f);
ippsFree(pDst32s);
}
Best Wishes,
Feng Li
0 Kudos
3 Replies
borix
Beginner
503 Views
could you please look at the ipp sample wavelet2d first
0 Kudos
swagner
Beginner
503 Views

Hi Feng,

Did you ever get your code to work? I like your example much better than the highly factored C++ example by Intel. It would be nice to see the primitives in sequence as you showed without jumping through large amounts of templates and so forth.

Steve

0 Kudos
Mikhail_Kulikov__Int
New Contributor I
503 Views

Hi,

it seems the pointer to WTFwd source is not correct. It should be adjusted by offset topBorder * lineStep + leftBorder * sizeof(32f) according to ROI concept.

Let me know if pointer offset doesn't solve the main problem,

Regards,

Mikhail

Message Edited by mkulikov on 01-12-2006 12:27 PM

0 Kudos
Reply